#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 atoi(char *);
int /*<<< orphan*/ printf(char *, int, int);
int test_trueThreeFourths(int);
int trueThreeFourths(int);
int main(int argc, char *argv[]) {
  int i;
  for (i = 1; i < argc; i++) {
    int x = atoi(argv[i]);
    int v1 = trueThreeFourths(x);
    int v2 = test_trueThreeFourths(x);
    printf("x = %d (0x%x)\n", x, x);
    printf("\tref: %d (0x%x)\n", v2, v2);
    printf("\tGot: %d (0x%x)\n", v1, v1);
  }
  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   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d7 <main+0x97>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1050 <trueThreeFourths@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
call   1030 <test_trueThreeFourths@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe60(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xe5d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x1c(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe5c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115d <main+0x1d>
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
cmp    $0x2,%edi
jl     11ba <main+0x7a>
mov    %rsi,%r13
mov    %edi,%r15d
mov    $0x1,%r12d
nopl   0x0(%rax)
mov    0x0(%r13,%r12,8),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1050 <trueThreeFourths@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1030 <test_trueThreeFourths@plt>
mov    %eax,%r14d
lea    0xe7a(%rip),%rdi
mov    %ebp,%esi
mov    %ebp,%edx
call   1040 <printf@plt>
lea    0xe79(%rip),%rdi
mov    %r14d,%esi
mov    %r14d,%edx
call   1040 <printf@plt>
lea    0xe78(%rip),%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1040 <printf@plt>
add    $0x1,%r12
cmp    %r12,%r15
jne    1160 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"x = %d (0x%x)\0A\00"
@.str.1 = [17 x i8] c"\09ref: %d (0x%x)\0A\00"
@.str.2 = [17 x i8] c"\09Got: %d (0x%x)\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %16, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = tail call i32 @trueThreeFourths(i32 %10)
%12 = tail call i32 @test_trueThreeFourths(i32 %10)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %10)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %12)
%15 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %11, i32 %11)
%16 = add nuw nsw i64 %7, 1
%17 = icmp eq i64 %16, %5
br i1 %17, label %18, label %6
18: ; preds = %6, %2
ret i32 0
}