#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 id(int);
int /*<<< orphan*/ print_int(int);
int /*<<< orphan*/ print_string(char *);
void main(void) {
  int x, i;
  x = 123;
  if (id(id(3)) > id(id(id(4))))
    x = 321;
  i = 12;
  while (id(id(id(i))) > 0) {
    x = x - 1;
    i = i - 1;
  }
  for (i = id(0); id(id(i)) < 6; i = id(i) + 1)
    x = x + 2;
  print_int(x);
  print_string("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7b,-0x4(%rbp)
mov    $0x3,%edi
call   1050 <id@plt>
mov    %eax,%edi
call   1050 <id@plt>
mov    %eax,-0xc(%rbp)
mov    $0x4,%edi
call   1050 <id@plt>
mov    %eax,%edi
call   1050 <id@plt>
mov    %eax,%edi
call   1050 <id@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
jle    117f <main+0x4f>
movl   $0x141,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <id@plt>
mov    %eax,%edi
call   1050 <id@plt>
mov    %eax,%edi
call   1050 <id@plt>
cmp    $0x0,%eax
jle    11bc <main+0x8c>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1186 <main+0x56>
xor    %edi,%edi
call   1050 <id@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <id@plt>
mov    %eax,%edi
call   1050 <id@plt>
cmp    $0x6,%eax
jge    11fa <main+0xca>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <id@plt>
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c6 <main+0x96>
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
lea    0xdf7(%rip),%rdi
call   1030 <print_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x3,%edi
call   1050 <id@plt>
mov    %eax,%edi
call   1050 <id@plt>
mov    %eax,%ebx
mov    $0x4,%edi
call   1050 <id@plt>
mov    %eax,%edi
call   1050 <id@plt>
mov    %eax,%edi
call   1050 <id@plt>
cmp    %eax,%ebx
mov    $0x141,%eax
mov    $0x7b,%ebx
cmovg  %eax,%ebx
mov    $0xc,%edi
call   1050 <id@plt>
mov    %eax,%edi
call   1050 <id@plt>
mov    %eax,%edi
call   1050 <id@plt>
test   %eax,%eax
jle    11b1 <main+0x81>
mov    $0xb,%ebp
xchg   %ax,%ax
mov    %ebp,%edi
call   1050 <id@plt>
mov    %eax,%edi
call   1050 <id@plt>
mov    %eax,%edi
call   1050 <id@plt>
add    $0xffffffff,%ebp
test   %eax,%eax
jg     1190 <main+0x60>
add    %ebp,%ebx
add    $0xfffffff5,%ebx
xor    %edi,%edi
call   1050 <id@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1050 <id@plt>
mov    %eax,%edi
call   1050 <id@plt>
cmp    $0x5,%eax
jg     11f2 <main+0xc2>
nopl   (%rax)
add    $0x2,%ebx
mov    %ebp,%edi
call   1050 <id@plt>
mov    %eax,%ebp
add    $0x1,%ebp
mov    %ebp,%edi
call   1050 <id@plt>
mov    %eax,%edi
call   1050 <id@plt>
cmp    $0x6,%eax
jl     11d0 <main+0xa0>
mov    %ebx,%edi
call   1040 <print_int@plt>
lea    0xe00(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <print_string@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = tail call i32 @id(i32 3)
%2 = tail call i32 @id(i32 %1)
%3 = tail call i32 @id(i32 4)
%4 = tail call i32 @id(i32 %3)
%5 = tail call i32 @id(i32 %4)
%6 = icmp sgt i32 %2, %5
%7 = select i1 %6, i32 321, i32 123
%8 = tail call i32 @id(i32 12)
%9 = tail call i32 @id(i32 %8)
%10 = tail call i32 @id(i32 %9)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %0, %12
%13 = phi i32 [ %16, %12 ], [ 12, %0 ]
%14 = phi i32 [ %15, %12 ], [ %7, %0 ]
%15 = add nsw i32 %14, -1
%16 = add nsw i32 %13, -1
%17 = tail call i32 @id(i32 %16)
%18 = tail call i32 @id(i32 %17)
%19 = tail call i32 @id(i32 %18)
%20 = icmp sgt i32 %19, 0
br i1 %20, label %12, label %21
21: ; preds = %12, %0
%22 = phi i32 [ %7, %0 ], [ %15, %12 ]
%23 = tail call i32 @id(i32 0)
%24 = tail call i32 @id(i32 %23)
%25 = tail call i32 @id(i32 %24)
%26 = icmp slt i32 %25, 6
br i1 %26, label %27, label %36
27: ; preds = %21, %27
%28 = phi i32 [ %32, %27 ], [ %23, %21 ]
%29 = phi i32 [ %30, %27 ], [ %22, %21 ]
%30 = add nsw i32 %29, 2
%31 = tail call i32 @id(i32 %28)
%32 = add nsw i32 %31, 1
%33 = tail call i32 @id(i32 %32)
%34 = tail call i32 @id(i32 %33)
%35 = icmp slt i32 %34, 6
br i1 %35, label %27, label %36
36: ; preds = %27, %21
%37 = phi i32 [ %22, %21 ], [ %30, %27 ]
%38 = tail call i32 @print_int(i32 %37)
%39 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}