#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ floordivmod(int, int, int *, int *);
int /*<<< orphan*/ floordivmodc(int, int, int *, int *);
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int);
int main(void) {
  int n, d, f1, m1, f2, m2;
  int start, end;
  start = -10000;
  end = 10000;
  for (n = start; n <= end; n++) {
    for (d = start; d < end; d++) {
      floordivmod(n, d, &f1, &m1);
      floordivmodc(n, d, &f2, &m2);
      if (f1 != f2 || m1 != m2)
        printf("%d %d %d %d %d %d\n", n, d, f1, m1, f2, m2);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffd8f0,-0x20(%rbp)
movl   $0x2710,-0x24(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x24(%rbp),%eax
jg     11f8 <main+0xc8>
mov    -0x20(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    11e5 <main+0xb5>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1030 <floordivmod@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1050 <floordivmodc@plt>
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    11af <main+0x7f>
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
je     11d2 <main+0xa2>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x1c(%rbp),%eax
lea    0xe36(%rip),%rdi
mov    %eax,(%rsp)
call   1040 <printf@plt>
jmp    11d7 <main+0xa7>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1165 <main+0x35>
jmp    11ea <main+0xba>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1153 <main+0x23>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    $0xffffd8f0,%ebx
lea    0x14(%rsp),%r14
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r12
lea    0x8(%rsp),%r13
jmp    116b <main+0x3b>
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x2711,%ebx
je     11da <main+0xaa>
mov    $0xffffd8f0,%ebp
jmp    119e <main+0x6e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,(%rsp)
lea    0xe76(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0x2710,%ebp
je     1160 <main+0x30>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %r15,%rcx
call   1030 <floordivmod@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r12,%rdx
mov    %r13,%rcx
call   1050 <floordivmodc@plt>
mov    0x14(%rsp),%ecx
mov    0xc(%rsp),%r9d
mov    0x10(%rsp),%r8d
mov    0x8(%rsp),%eax
cmp    %r9d,%ecx
jne    1180 <main+0x50>
cmp    %eax,%r8d
je     1193 <main+0x63>
jmp    1180 <main+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"%d %d %d %d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
store i32 -10000, i32* %8
store i32 10000, i32* %9
%10 = load i32, i32* %8
store i32 %10, i32* %2
br label %11
11: ; preds = %48, %0
%12 = load i32, i32* %2
%13 = load i32, i32* %9
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %51
15: ; preds = %11
%16 = load i32, i32* %8
store i32 %16, i32* %3
br label %17
17: ; preds = %44, %15
%18 = load i32, i32* %3
%19 = load i32, i32* %9
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %47
21: ; preds = %17
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = call i32 @floordivmod(i32 %22, i32 %23, i32* %4, i32* %5)
%25 = load i32, i32* %2
%26 = load i32, i32* %3
%27 = call i32 @floordivmodc(i32 %25, i32 %26, i32* %6, i32* %7)
%28 = load i32, i32* %4
%29 = load i32, i32* %6
%30 = icmp ne i32 %28, %29
br i1 %30, label %35, label %31
31: ; preds = %21
%32 = load i32, i32* %5
%33 = load i32, i32* %7
%34 = icmp ne i32 %32, %33
br i1 %34, label %35, label %43
35: ; preds = %31, %21
%36 = load i32, i32* %2
%37 = load i32, i32* %3
%38 = load i32, i32* %4
%39 = load i32, i32* %5
%40 = load i32, i32* %6
%41 = load i32, i32* %7
%42 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %36, i32 %37, i32 %38, i32 %39, i32 %40, i32 %41)
br label %43
43: ; preds = %35, %31
br label %44
44: ; preds = %43
%45 = load i32, i32* %3
%46 = add nsw i32 %45, 1
store i32 %46, i32* %3
br label %17
47: ; preds = %17
br label %48
48: ; preds = %47
%49 = load i32, i32* %2
%50 = add nsw i32 %49, 1
store i32 %50, i32* %2
br label %11
51: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"%d %d %d %d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
br label %9
9: ; preds = %0, %27
%10 = phi i32 [ -10000, %0 ], [ %28, %27 ]
br label %11
11: ; preds = %9, %24
%12 = phi i32 [ -10000, %9 ], [ %25, %24 ]
%13 = call i32 @floordivmod(i32 %10, i32 %12, i32* %1, i32* %2)
%14 = call i32 @floordivmodc(i32 %10, i32 %12, i32* %3, i32* %4)
%15 = load i32, i32* %1
%16 = load i32, i32* %3
%17 = icmp eq i32 %15, %16
%18 = load i32, i32* %2
%19 = load i32, i32* %4
%20 = icmp eq i32 %18, %19
%21 = select i1 %17, i1 %20, i1 false
br i1 %21, label %24, label %22
22: ; preds = %11
%23 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %12, i32 %15, i32 %18, i32 %16, i32 %19)
br label %24
24: ; preds = %11, %22
%25 = add nsw i32 %12, 1
%26 = icmp eq i32 %25, 10000
br i1 %26, label %27, label %11
27: ; preds = %24
%28 = add nsw i32 %10, 1
%29 = icmp eq i32 %28, 10001
br i1 %29, label %30, label %9
30: ; preds = %27
ret i32 0
}