#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 *, ...);
int main() {
  char *read_area = (char *)1;
  char *print_area = (char *)201;
  int i, d;
  i = -20;
  d = -30;
  printf("I = %d\n", i);
  printf("D = %d\n", d);
  for (i = -20; i <= 20; i++) {
    for (d = -20; d <= 20; d++) {
      printf("I = %d\n", i);
      printf("D = %d\n", d);
      printf("I * D = %d\n", i * d);
      if (i < d) {
        printf("I < D\n");
      } else if (i > d) {
        printf("I > D\n");
      } else {
        printf("I == D\n");
      }
      printf("\n");
    }
  }
  printf("-----------\n");
  printf("Bye!!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%eax
mov    %rax,-0x10(%rbp)
mov    $0xc9,%eax
mov    %rax,-0x18(%rbp)
movl   $0xffffffec,-0x1c(%rbp)
movl   $0xffffffe2,-0x20(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffec,-0x1c(%rbp)
cmpl   $0x14,-0x1c(%rbp)
jg     123a <main+0x12a>
movl   $0xffffffec,-0x20(%rbp)
cmpl   $0x14,-0x20(%rbp)
jg     1227 <main+0x117>
mov    -0x1c(%rbp),%esi
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
imul   -0x20(%rbp),%esi
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    11d9 <main+0xc9>
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    120b <main+0xfb>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    11f8 <main+0xe8>
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1206 <main+0xf6>
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    120b <main+0xfb>
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1179 <main+0x69>
jmp    122c <main+0x11c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1168 <main+0x58>
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%rdi
mov    $0xffffffec,%r13d
mov    $0xffffffec,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb1(%rip),%rdi
mov    $0xffffffe2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x190,%ebx
nopl   0x0(%rax)
mov    %ebx,0x4(%rsp)
mov    $0xffffffec,%ebp
lea    0xead(%rip),%r14
lea    0xe9f(%rip),%r15
lea    0xea5(%rip),%r12
xchg   %ax,%ax
lea    0xe69(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe64(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe50(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %ebp,%r13d
mov    %r15,%rdi
cmovg  %r14,%rdi
cmovl  %r12,%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
add    %r13d,%ebx
cmp    $0x15,%ebp
jne    1190 <main+0x60>
add    $0x1,%r13d
mov    0x4(%rsp),%ebx
add    $0xffffffec,%ebx
cmp    $0x15,%r13d
jne    1170 <main+0x40>
lea    0xe0f(%rip),%rdi
call   1040 <puts@plt>
lea    0xe0f(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"I = %d\0A\00"
@.str.1 = [8 x i8] c"D = %d\0A\00"
@.str.2 = [12 x i8] c"I * D = %d\0A\00"
@str = [12 x i8] c"-----------\00"
@str.9 = [6 x i8] c"Bye!!\00"
@str.10 = [7 x i8] c"I == D\00"
@str.11 = [6 x i8] c"I > D\00"
@str.12 = [6 x i8] c"I < D\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 -20)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 -30)
br label %3
3: ; preds = %0, %19
%4 = phi i32 [ -20, %0 ], [ %20, %19 ]
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ -20, %3 ], [ %17, %5 ]
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%9 = mul nsw i32 %6, %4
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = icmp slt i32 %4, %6
%12 = icmp sgt i32 %4, %6
%13 = select i1 %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.11, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str.10, i64 0, i64 0)
%14 = select i1 %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.12, i64 0, i64 0), i8* %13
%15 = tail call i32 @puts(i8* dereferenceable(1) %14)
%16 = tail call i32 @putchar(i32 10)
%17 = add nsw i32 %6, 1
%18 = icmp eq i32 %17, 21
br i1 %18, label %19, label %5
19: ; preds = %5
%20 = add nsw i32 %4, 1
%21 = icmp eq i32 %20, 21
br i1 %21, label %22, label %3
22: ; preds = %19
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.9, i64 0, i64 0))
ret i32 0
}