#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, char *argv[]) {
  uint32_t op1;
  uint32_t op2;
  uint32_t i;
  op1 = 1;
  op2 = 2579;
  i = 32;
  for (i = 0; i < 32; ++i) {
    printf("0x%08x,0x%08x,0x%08x\n", op1, op2, op2 / op1);
    op1++;
  }
  op1 = 1;
  op2 = 2579;
  i = 32;
  for (i = 0; i < 32; ++i) {
    printf("%u,%u,%u\n", op1, op2, op2 / op1);
    op1++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0xa13,-0x18(%rbp)
movl   $0x20,-0x1c(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x20,-0x1c(%rbp)
jge    1184 <main+0x74>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    -0x20(%rbp),%edx
mov    %eax,%ecx
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1142 <main+0x32>
movl   $0x1,-0x14(%rbp)
movl   $0xa13,-0x18(%rbp)
movl   $0x20,-0x1c(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x20,-0x1c(%rbp)
jge    11e2 <main+0xd2>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    -0x24(%rbp),%edx
mov    %eax,%ecx
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11a0 <main+0x90>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
mov    $0xa13,%eax
xor    %edx,%edx
div    %ebx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0xa13,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x21,%ebx
jne    1120 <main+0x10>
mov    $0x1,%ebx
lea    0xec8(%rip),%r14
xchg   %ax,%ax
mov    $0xa13,%eax
xor    %edx,%edx
div    %ebx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0xa13,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x21,%ebx
jne    1150 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [22 x i8] c"0x%08x,0x%08x,0x%08x\0A\00"
@.str.1 = [10 x i8] c"%u,%u,%u\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 1, %2 ], [ %7, %3 ]
%5 = udiv i32 2579, %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %4, i32 2579, i32 %5)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, 33
br i1 %8, label %9, label %3
9: ; preds = %3, %9
%10 = phi i32 [ %13, %9 ], [ 1, %3 ]
%11 = udiv i32 2579, %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 2579, i32 %11)
%13 = add nuw nsw i32 %10, 1
%14 = icmp eq i32 %13, 33
br i1 %14, label %15, label %9
15: ; preds = %9
ret i32 0
}