#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 fast_multiply(int, int);
int /*<<< orphan*/ printf(char *, int, int);
int slow_multiply(int, int);
int main(int argc, char *argv[]) {
  int i, j;
  int x, y;
  for (i = 0; i < 200; i++) {
    for (j = 0; j < 30; j++) {
      x = fast_multiply(i, j);
      y = slow_multiply(i, j);
    }
  }
  printf("x=%d, y=%d\n", x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xc8,-0x14(%rbp)
jge    11a8 <main+0x78>
movl   $0x0,-0x18(%rbp)
cmpl   $0x1e,-0x18(%rbp)
jge    1195 <main+0x65>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <fast_multiply@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1050 <slow_multiply@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1161 <main+0x31>
jmp    119a <main+0x6a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114d <main+0x1d>
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xe4b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14d,%edi
mov    %ebx,%esi
call   1040 <fast_multiply@plt>
mov    %eax,%ebp
mov    %r14d,%edi
mov    %ebx,%esi
call   1050 <slow_multiply@plt>
add    $0x1,%ebx
cmp    $0x1e,%ebx
jne    1150 <main+0x20>
add    $0x1,%r14d
cmp    $0xc8,%r14d
jne    1140 <main+0x10>
lea    0xe7e(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"x=%d, y=%d\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
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %10
10: ; preds = %28, %2
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 200
br i1 %12, label %13, label %31
13: ; preds = %10
store i32 0, i32* %7
br label %14
14: ; preds = %24, %13
%15 = load i32, i32* %7
%16 = icmp slt i32 %15, 30
br i1 %16, label %17, label %27
17: ; preds = %14
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = call i32 @fast_multiply(i32 %18, i32 %19)
store i32 %20, i32* %8
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = call i32 @slow_multiply(i32 %21, i32 %22)
store i32 %23, i32* %9
br label %24
24: ; preds = %17
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
store i32 %26, i32* %7
br label %14
27: ; preds = %14
br label %28
28: ; preds = %27
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %10
31: ; preds = %10
%32 = load i32, i32* %8
%33 = load i32, i32* %9
%34 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %32, i32 %33)
ret i32 0
}

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