#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*/ printf(char *, unsigned int, unsigned int, unsigned int);
void main() {
  unsigned x = 134;
  unsigned y = 1;
  unsigned q, r, p, i;
  for (i = 0; i < 12; i++) {
    q = x / y;
    r = x % y;
    p = q * y + r;
    y++;
    printf("%08x\n%08x\n%08x\n", y, q, p);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x86,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0xc,-0x18(%rbp)
jae    1186 <main+0x76>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112d <main+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"%08x\0A%08x\0A%08x\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 134, i32* %1
store i32 1, i32* %2
store i32 0, i32* %6
br label %7
7: ; preds = %28, %0
%8 = load i32, i32* %6
%9 = icmp ult i32 %8, 12
br i1 %9, label %10, label %31
10: ; preds = %7
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = udiv i32 %11, %12
store i32 %13, i32* %3
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = urem i32 %14, %15
store i32 %16, i32* %4
%17 = load i32, i32* %3
%18 = load i32, i32* %2
%19 = mul i32 %17, %18
%20 = load i32, i32* %4
%21 = add i32 %19, %20
store i32 %21, i32* %5
%22 = load i32, i32* %2
%23 = add i32 %22, 1
store i32 %23, i32* %2
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = load i32, i32* %5
%27 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %24, i32 %25, i32 %26)
br label %28
28: ; preds = %10
%29 = load i32, i32* %6
%30 = add i32 %29, 1
store i32 %30, i32* %6
br label %7
31: ; preds = %7
ret void
}

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