#include <stdio.h>
int main() {
int dividend = -42, divisor = 5, quotient, remainder;
__asm__ ( "cdq; idivl %%ebx;"
: "=a" (quotient), "=d" (remainder)
: "a" (dividend), "b" (divisor)
: );
printf("%i / %i = %i, remainder: %i\n", dividend
, divisor
, quotient
, remainder
); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpIHsKICBpbnQgZGl2aWRlbmQgPSAtNDIsIGRpdmlzb3IgPSA1LCBxdW90aWVudCwgcmVtYWluZGVyOwoKICBfX2FzbV9fICggImNkcTsgaWRpdmwgJSVlYng7IgogICAgICAgICAgOiAiPWEiIChxdW90aWVudCksICI9ZCIgKHJlbWFpbmRlcikKICAgICAgICAgIDogImEiICAoZGl2aWRlbmQpLCAiYiIgIChkaXZpc29yKQogICAgICAgICAgOiApOwoKICBwcmludGYoIiVpIC8gJWkgPSAlaSwgcmVtYWluZGVyOiAlaVxuIiwgZGl2aWRlbmQsIGRpdmlzb3IsIHF1b3RpZW50LCByZW1haW5kZXIpOwogIHJldHVybiAwOwp9