#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 Sum_it(int, int);
int /*<<< orphan*/ error_with_code();
int main(void) {
  int Arg_1 = 20, Arg_2 = 40;
  int i;
  for (i = 0; i < 10; i++) {
    if (Arg_1 > Arg_2)
      Arg_2 = Sum_it(Arg_1, Arg_2);
    else
      Arg_1 = Sum_it(Arg_1, Arg_2);
  }
  error_with_code();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
movl   $0x28,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    118e <main+0x6e>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    116d <main+0x4d>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <Sum_it@plt>
mov    %eax,-0xc(%rbp)
jmp    117b <main+0x5b>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <Sum_it@plt>
mov    %eax,-0x8(%rbp)
jmp    1180 <main+0x60>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <main+0x24>
mov    $0x0,%al
call   1030 <error_with_code@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x28,%ebx
mov    $0x14,%edi
mov    $0x28,%esi
call   1040 <Sum_it@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    $0x28,%esi
call   1040 <Sum_it@plt>
cmp    $0x29,%ebp
cmovl  %eax,%ebp
cmovge %eax,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <Sum_it@plt>
cmp    %ebx,%ebp
cmovle %eax,%ebp
cmovg  %eax,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <Sum_it@plt>
cmp    %ebx,%ebp
cmovle %eax,%ebp
cmovg  %eax,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <Sum_it@plt>
cmp    %ebx,%ebp
cmovle %eax,%ebp
cmovg  %eax,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <Sum_it@plt>
cmp    %ebx,%ebp
cmovle %eax,%ebp
cmovg  %eax,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <Sum_it@plt>
cmp    %ebx,%ebp
cmovle %eax,%ebp
cmovg  %eax,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <Sum_it@plt>
cmp    %ebx,%ebp
cmovle %eax,%ebp
cmovg  %eax,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <Sum_it@plt>
cmp    %ebx,%ebp
cmovle %eax,%ebp
cmovg  %eax,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <Sum_it@plt>
xor    %eax,%eax
call   1030 <error_with_code@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 20, i32* %2
store i32 40, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %21, %0
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %24
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 @Sum_it(i32 %13, i32 %14)
store i32 %15, i32* %3
br label %20
16: ; preds = %8
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = call i32 @Sum_it(i32 %17, i32 %18)
store i32 %19, i32* %2
br label %20
20: ; preds = %16, %12
br label %21
21: ; preds = %20
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %5
24: ; preds = %5
%25 = call i32 (...) @error_with_code()
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @Sum_it(i32 20, i32 40)
%2 = icmp sgt i32 %1, 40
%3 = tail call i32 @Sum_it(i32 %1, i32 40)
%4 = select i1 %2, i32 %1, i32 %3
%5 = select i1 %2, i32 %3, i32 40
%6 = icmp sgt i32 %4, %5
%7 = tail call i32 @Sum_it(i32 %4, i32 %5)
%8 = select i1 %6, i32 %4, i32 %7
%9 = select i1 %6, i32 %7, i32 %5
%10 = icmp sgt i32 %8, %9
%11 = tail call i32 @Sum_it(i32 %8, i32 %9)
%12 = select i1 %10, i32 %8, i32 %11
%13 = select i1 %10, i32 %11, i32 %9
%14 = icmp sgt i32 %12, %13
%15 = tail call i32 @Sum_it(i32 %12, i32 %13)
%16 = select i1 %14, i32 %12, i32 %15
%17 = select i1 %14, i32 %15, i32 %13
%18 = icmp sgt i32 %16, %17
%19 = tail call i32 @Sum_it(i32 %16, i32 %17)
%20 = select i1 %18, i32 %16, i32 %19
%21 = select i1 %18, i32 %19, i32 %17
%22 = icmp sgt i32 %20, %21
%23 = tail call i32 @Sum_it(i32 %20, i32 %21)
%24 = select i1 %22, i32 %20, i32 %23
%25 = select i1 %22, i32 %23, i32 %21
%26 = icmp sgt i32 %24, %25
%27 = tail call i32 @Sum_it(i32 %24, i32 %25)
%28 = select i1 %26, i32 %24, i32 %27
%29 = select i1 %26, i32 %27, i32 %25
%30 = icmp sgt i32 %28, %29
%31 = tail call i32 @Sum_it(i32 %28, i32 %29)
%32 = select i1 %30, i32 %28, i32 %31
%33 = select i1 %30, i32 %31, i32 %29
%34 = tail call i32 @Sum_it(i32 %32, i32 %33)
%35 = tail call i32 (...) @error_with_code()
ret i32 0
}