xunge/DecIR huggingface dataset:
/* Variables and functions */
double ln_get_saturn_earth_dist(double);
double ln_get_saturn_solar_dist(double);
int log10(double);
double ln_get_saturn_magnitude(double JD) {
  double delta, r;
  r = ln_get_saturn_solar_dist(JD);
  delta = ln_get_saturn_earth_dist(JD);
  return -8.88 + 5 * log10(r * delta);
}


x86 assembly (clang, -O0):
<ln_get_saturn_magnitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ln_get_saturn_solar_dist@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <ln_get_saturn_earth_dist@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1040 <log10@plt>
imul   $0x5,%eax,%eax
cvtsi2sd %eax,%xmm1
movsd  0xe87(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_saturn_magnitude>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <ln_get_saturn_solar_dist@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <ln_get_saturn_earth_dist@plt>
mulsd  0x10(%rsp),%xmm0
call   1040 <log10@plt>
lea    (%rax,%rax,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xe93(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ln_get_saturn_magnitude(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @ln_get_saturn_solar_dist(double %5)
store double %6, double* %4
%7 = load double, double* %2
%8 = call double @ln_get_saturn_earth_dist(double %7)
store double %8, double* %3
%9 = load double, double* %4
%10 = load double, double* %3
%11 = fmul double %9, %10
%12 = call i32 @log10(double %11)
%13 = mul nsw i32 5, %12
%14 = sitofp i32 %13 to double
%15 = fadd double -8.880000e+00, %14
ret double %15
}

LLVM IR (-O2):
define double @ln_get_saturn_magnitude(double %0) {
%2 = tail call double @ln_get_saturn_solar_dist(double %0)
%3 = tail call double @ln_get_saturn_earth_dist(double %0)
%4 = fmul double %2, %3
%5 = tail call i32 @log10(double %4)
%6 = mul nsw i32 %5, 5
%7 = sitofp i32 %6 to double
%8 = fadd double %7, -8.880000e+00
ret double %8
}
BOOST_AUTO_TEST_CASE(arcsinh) { TESTCASE1(arcsinh, 0, 0); }


x86 assembly (clang, -O0):
<BOOST_AUTO_TEST_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <TESTCASE1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BOOST_AUTO_TEST_CASE>:
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <TESTCASE1@plt>

LLVM IR (-O0):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %4, i32 0, i32 0)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %0, i32 0, i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(const char *pn) {
  fprintf(stderr, "Usage: %s <filename>\n", pn);
  fprintf(stderr, "\tsimple stack machine\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee2(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Usage: %s <filename>\0A\00"
@.str.1 = [23 x i8] c"\09simple stack machine\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Usage: %s <filename>\0A\00"
@.str.1 = [23 x i8] c"\09simple stack machine\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int slk_init(int);
int wrap_slk_init(int fmt) { return slk_init(fmt); }


x86 assembly (clang, -O0):
<wrap_slk_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <slk_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_slk_init>:
jmp    1030 <slk_init@plt>

LLVM IR (-O0):
define i32 @wrap_slk_init(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @slk_init(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @wrap_slk_init(i32 %0) {
%2 = tail call i32 @slk_init(i32 %0)
ret i32 %2
}
/* Variables and functions */
float __nv_fsqrt_ru(float);
float __fsqrt_ru(float __a) { return __nv_fsqrt_ru(__a); }


x86 assembly (clang, -O0):
<__fsqrt_ru>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__nv_fsqrt_ru@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fsqrt_ru>:
jmp    1030 <__nv_fsqrt_ru@plt>

LLVM IR (-O0):
define float @__fsqrt_ru(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @__nv_fsqrt_ru(float %3)
ret float %4
}

LLVM IR (-O2):
define float @__fsqrt_ru(float %0) {
%2 = tail call float @__nv_fsqrt_ru(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_cfg_data_usage(void) {
  printf("\nUsage : cfg_data <type> [*.conf]\n");
  printf("\n        type : 2 -- cal data");
  printf("\n        *.conf : file contain configuration data");
  printf("\n                 empty - get current configuration data\n");
  return;
}


x86 assembly (clang, -O0):
<print_cfg_data_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0e(%rip),%rdi
call   1030 <printf@plt>
lea    0xf34(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_cfg_data_usage>:
push   %rax
lea    0xf28(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
lea    0xede(%rip),%rdi
call   1040 <printf@plt>
lea    0xf26(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"\0AUsage : cfg_data <type> [*.conf]\0A\00"
@.str.1 = [30 x i8] c"\0A type : 2 -- cal data\00"
@.str.2 = [50 x i8] c"\0A *.conf : file contain configuration data\00"
@.str.3 = [58 x i8] c"\0A empty - get current configuration data\0A\00"
define void @print_cfg_data_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [30 x i8] c"\0A type : 2 -- cal data\00"
@.str.2 = [50 x i8] c"\0A *.conf : file contain configuration data\00"
@str = [34 x i8] c"\0AUsage : cfg_data <type> [*.conf]\00"
@str.4 = [57 x i8] c"\0A empty - get current configuration data\00"
define void @print_cfg_data_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.4, i64 0, i64 0))
ret void
}
unsigned char MApi_PNL_SetDiffSwingLevel(unsigned char u8Swing_Level) {
  return 0;
}


x86 assembly (clang, -O0):
<MApi_PNL_SetDiffSwingLevel>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MApi_PNL_SetDiffSwingLevel>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define zeroext i8 @MApi_PNL_SetDiffSwingLevel(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @MApi_PNL_SetDiffSwingLevel(i8 zeroext %0) {
ret i8 0
}
/* Variables and functions */
unsigned char read(int, unsigned char *, unsigned char);
int readI2C_asFile(int i2c_fd, unsigned char readbuffer[],
                   unsigned char bytes) {
  unsigned char bytesRead = read(i2c_fd, readbuffer, bytes);
  if (bytes != bytesRead)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<readI2C_asFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
movzbl -0x11(%rbp),%edx
call   1030 <read@plt>
mov    %al,-0x12(%rbp)
movzbl -0x11(%rbp),%eax
movzbl -0x12(%rbp),%ecx
cmp    %ecx,%eax
je     1153 <readI2C_asFile+0x43>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <readI2C_asFile+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readI2C_asFile>:
push   %rbx
mov    %edx,%ebx
call   1030 <read@plt>
xor    %ecx,%ecx
cmp    %bl,%al
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @readI2C_asFile(i32 %0, i8* %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i8
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8 %2, i8* %7
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8, i8* %7
%12 = call zeroext i8 @read(i32 %9, i8* %10, i8 zeroext %11)
store i8 %12, i8* %8
%13 = load i8, i8* %7
%14 = zext i8 %13 to i32
%15 = load i8, i8* %8
%16 = zext i8 %15 to i32
%17 = icmp ne i32 %14, %16
br i1 %17, label %18, label %19
18: ; preds = %3
store i32 -1, i32* %4
br label %20
19: ; preds = %3
store i32 0, i32* %4
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @readI2C_asFile(i32 %0, i8* nocapture %1, i8 zeroext %2) {
%4 = tail call zeroext i8 @read(i32 %0, i8* %1, i8 zeroext %2)
%5 = icmp ne i8 %4, %2
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int AMI_Up_RegisterBit8(void *, int, int);
int /*<<< orphan*/ AMI_udelay(int);
int AMI_ForceModeActive(void *i2c_hnd) {
  int res = 0;
  res = AMI_Up_RegisterBit8(i2c_hnd, 0x1b, 0x80 | 0x02);
  AMI_udelay(8);
  return (res);
}


x86 assembly (clang, -O0):
<AMI_ForceModeActive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1b,%esi
mov    $0x82,%edx
call   1030 <AMI_Up_RegisterBit8@plt>
mov    %eax,-0xc(%rbp)
mov    $0x8,%edi
call   1040 <AMI_udelay@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AMI_ForceModeActive>:
push   %rbx
mov    $0x1b,%esi
mov    $0x82,%edx
call   1030 <AMI_Up_RegisterBit8@plt>
mov    %eax,%ebx
mov    $0x8,%edi
call   1040 <AMI_udelay@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @AMI_ForceModeActive(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = call i32 @AMI_Up_RegisterBit8(i8* %4, i32 27, i32 130)
store i32 %5, i32* %3
%6 = call i32 @AMI_udelay(i32 8)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @AMI_ForceModeActive(i8* %0) {
%2 = tail call i32 @AMI_Up_RegisterBit8(i8* %0, i32 27, i32 130)
%3 = tail call i32 @AMI_udelay(i32 8)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned long);
scalar_t__ pthread_self();
int /*<<< orphan*/ stderr;
void thread_init() {
  fprintf(stderr, "Running Thread Init (T=%lu)\n",
          (unsigned long)pthread_self());
}


x86 assembly (clang, -O0):
<thread_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_init>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xec8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Running Thread Init (T=%lu)\0A\00"
define void @thread_init() {
%1 = load i32, i32* @stderr
%2 = call i64 (...) @pthread_self()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %2)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Running Thread Init (T=%lu)\0A\00"
define void @thread_init() {
%1 = load i32, i32* @stderr
%2 = tail call i64 (...) @pthread_self()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %2)
ret void
}
int test_imm_69uint16_mem(unsigned short *val) {
  return ((*val) & (-0x69 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_69uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff97,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_69uint16_mem>:
movzwl (%rdi),%eax
test   $0xff97,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_69uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -105
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_69uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -105
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int pow2(int arg) {
  int r = 1;
  for (int i = 0; i < arg; i++)
    r *= 2;
  return r;
}


x86 assembly (clang, -O0):
<pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <pow2+0x38>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <pow2+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow2>:
test   %edi,%edi
jle    1118 <pow2+0x18>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    111e <pow2+0x1e>
mov    $0x1,%eax
jmp    1138 <pow2+0x38>
mov    $0x1,%eax
ret
and    $0xfffffff8,%edi
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
shl    $0x8,%eax
add    $0xfffffff8,%edi
jne    1130 <pow2+0x30>
test   %ecx,%ecx
je     1147 <pow2+0x47>
nopl   0x0(%rax)
add    %eax,%eax
add    $0xffffffff,%ecx
jne    1140 <pow2+0x40>
ret

LLVM IR (-O0):
define i32 @pow2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %12, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i32, i32* %3
%11 = mul nsw i32 %10, 2
store i32 %11, i32* %3
br label %12
12: ; preds = %9
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
br label %5
15: ; preds = %5
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @pow2(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %19
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %21
9: ; preds = %21, %3
%10 = phi i32 [ undef, %3 ], [ %24, %21 ]
%11 = phi i32 [ 1, %3 ], [ %24, %21 ]
%12 = icmp eq i32 %5, 0
br i1 %12, label %19, label %13
13: ; preds = %9, %13
%14 = phi i32 [ %16, %13 ], [ %11, %9 ]
%15 = phi i32 [ %17, %13 ], [ 0, %9 ]
%16 = shl nsw i32 %14, 1
%17 = add i32 %15, 1
%18 = icmp eq i32 %17, %5
br i1 %18, label %19, label %13
19: ; preds = %9, %13, %1
%20 = phi i32 [ 1, %1 ], [ %10, %9 ], [ %16, %13 ]
ret i32 %20
21: ; preds = %21, %7
%22 = phi i32 [ 1, %7 ], [ %24, %21 ]
%23 = phi i32 [ 0, %7 ], [ %25, %21 ]
%24 = shl i32 %22, 8
%25 = add i32 %23, 8
%26 = icmp eq i32 %25, %8
br i1 %26, label %9, label %21
}
int findSizeCollatz(int N) {
  if (N == 1)
    return 1;
  if (N % 2 == 0)
    return 1 + findSizeCollatz(N / 2);
  else
    return 1 + findSizeCollatz(N * 3 + 1);
}


x86 assembly (clang, -O0):
<findSizeCollatz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1131 <findSizeCollatz+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1174 <findSizeCollatz+0x64>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1162 <findSizeCollatz+0x52>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <findSizeCollatz@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1174 <findSizeCollatz+0x64>
imul   $0x3,-0x8(%rbp),%edi
add    $0x1,%edi
call   1030 <findSizeCollatz@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findSizeCollatz>:
push   %rbx
mov    $0x1,%ebx
cmp    $0x1,%edi
je     114b <findSizeCollatz+0x3b>
mov    $0x1,%ebx
test   $0x1,%dil
jne    113e <findSizeCollatz+0x2e>
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
and    $0xfffffffe,%edi
add    $0x1,%ebx
cmp    $0x2,%edi
mov    %eax,%edi
jne    1120 <findSizeCollatz+0x10>
jmp    114b <findSizeCollatz+0x3b>
lea    (%rdi,%rdi,2),%edi
add    $0x1,%edi
call   1030 <findSizeCollatz@plt>
add    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @findSizeCollatz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %22
7: ; preds = %1
%8 = load i32, i32* %3
%9 = srem i32 %8, 2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i32, i32* %3
%13 = sdiv i32 %12, 2
%14 = call i32 @findSizeCollatz(i32 %13)
%15 = add nsw i32 1, %14
store i32 %15, i32* %2
br label %22
16: ; preds = %7
%17 = load i32, i32* %3
%18 = mul nsw i32 %17, 3
%19 = add nsw i32 %18, 1
%20 = call i32 @findSizeCollatz(i32 %19)
%21 = add nsw i32 1, %20
store i32 %21, i32* %2
br label %22
22: ; preds = %16, %11, %6
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @findSizeCollatz(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %13, label %3
3: ; preds = %1, %8
%4 = phi i32 [ %9, %8 ], [ %0, %1 ]
%5 = phi i32 [ %10, %8 ], [ 0, %1 ]
%6 = and i32 %4, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %3
%9 = sdiv i32 %4, 2
%10 = add nuw nsw i32 %5, 1
%11 = and i32 %4, -2
%12 = icmp eq i32 %11, 2
br i1 %12, label %21, label %3
13: ; preds = %1, %21, %15
%14 = phi i32 [ %20, %15 ], [ 1, %1 ], [ %22, %21 ]
ret i32 %14
15: ; preds = %3
%16 = mul nsw i32 %4, 3
%17 = add nsw i32 %16, 1
%18 = tail call i32 @findSizeCollatz(i32 %17)
%19 = add nuw i32 %5, 1
%20 = add i32 %19, %18
br label %13
21: ; preds = %8
%22 = add nuw i32 %5, 2
br label %13
}
void _physical_set_rom(void) {}


x86 assembly (clang, -O0):
<_physical_set_rom>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_physical_set_rom>:
ret

LLVM IR (-O0):
define void @_physical_set_rom() {
ret void
}

LLVM IR (-O2):
define void @_physical_set_rom() {
ret void
}
int include_function() { return 12; }


x86 assembly (clang, -O0):
<include_function>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<include_function>:
mov    $0xc,%eax
ret

LLVM IR (-O0):
define i32 @include_function() {
ret i32 12
}

LLVM IR (-O2):
define i32 @include_function() {
ret i32 12
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int __stdfix_sat_uhr(int);
uint32_t __stdfix_smul_uhr(uint32_t x, uint32_t y) {
  return (__stdfix_sat_uhr(((uint32_t)x * (uint32_t)y) >> 8));
}


x86 assembly (clang, -O0):
<__stdfix_smul_uhr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
imul   -0x8(%rbp),%edi
sar    $0x8,%edi
call   1030 <__stdfix_sat_uhr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__stdfix_smul_uhr>:
imul   %esi,%edi
sar    $0x8,%edi
jmp    1030 <__stdfix_sat_uhr@plt>

LLVM IR (-O0):
define i32 @__stdfix_smul_uhr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
%8 = ashr i32 %7, 8
%9 = call i32 @__stdfix_sat_uhr(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @__stdfix_smul_uhr(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = ashr i32 %3, 8
%5 = tail call i32 @__stdfix_sat_uhr(i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  int x = 97.02;
  char ch = 97;
  float flt = 10;
  printf("integer, x: %d\n", x);
  printf("character, ch: %c\n", ch);
  printf("floating point, flt: %f\n", flt);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x61,-0x8(%rbp)
movb   $0x61,-0x9(%rbp)
movl   $0x41200000,-0x10(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x9(%rbp),%eax
cvtsi2ss %eax,%xmm0
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
movss  0xecc(%rip),%xmm0
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
movss  0xebc(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"integer, x: %d\0A\00"
@.str.1 = [19 x i8] c"character, ch: %c\0A\00"
@.str.2 = [25 x i8] c"floating point, flt: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca float
store i32 0, i32* %1
store i32 97, i32* %2
store i8 97, i8* %3
store float 1.000000e+01, float* %4
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to float
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), float %6)
%8 = load i8, i8* %3
%9 = sitofp i8 %8 to float
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), float %9)
%11 = load float, float* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), float %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"integer, x: %d\0A\00"
@.str.1 = [19 x i8] c"character, ch: %c\0A\00"
@.str.2 = [25 x i8] c"floating point, flt: %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), float 9.700000e+01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), float 9.700000e+01)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), float 1.000000e+01)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void handle_error(char *message) {
  fprintf(stderr, "%s", message);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<handle_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle_error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
@EXIT_FAILURE = global i32 0
define void @handle_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
@EXIT_FAILURE = global i32 0
define void @handle_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void inicializa_estoque(int *produto) {
  do {
    scanf("%d", produto);
  } while (*produto <= 0);
}


x86 assembly (clang, -O0):
<inicializa_estoque>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jle    111c <inicializa_estoque+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inicializa_estoque>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%r14
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
cmpl   $0x0,(%rbx)
jle    1120 <inicializa_estoque+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @inicializa_estoque(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
br label %3
3: ; preds = %6, %1
%4 = load i32*, i32** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
br label %6
6: ; preds = %3
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = icmp sle i32 %8, 0
br i1 %9, label %3, label %10
10: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @inicializa_estoque(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %0)
%4 = load i32, i32* %0
%5 = icmp slt i32 %4, 1
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
int f11(double a, int b) { return a < 0.0f && b == 30; }


x86 assembly (clang, -O0):
<f11>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
xor    %eax,%eax
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
mov    %al,-0xd(%rbp)
jbe    1129 <f11+0x29>
cmpl   $0x1e,-0xc(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f11>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
seta   %al
cmp    $0x1e,%edi
sete   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @f11(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 30
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @f11(double %0, i32 %1) {
%3 = fcmp olt double %0, 0.000000e+00
%4 = icmp eq i32 %1, 30
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
rs(i) {
  if (fs(i++) != 5)
    abort();
  if (fs(++i) != 7)
    abort();
}


x86 assembly (clang, -O0):
<rs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <fs@plt>
cmp    $0x5,%eax
je     114b <rs+0x2b>
call   1030 <abort@plt>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <fs@plt>
cmp    $0x7,%eax
je     1169 <rs+0x49>
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rs>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <fs@plt>
cmp    $0x5,%eax
jne    1142 <rs+0x22>
add    $0x2,%ebx
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <fs@plt>
cmp    $0x7,%eax
jne    1142 <rs+0x22>
pop    %rbx
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @rs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
%6 = call i32 (i32, ...) bitcast (i32 (...)* @fs to i32 (i32, ...)*)(i32 %4)
%7 = icmp ne i32 %6, 5
br i1 %7, label %8, label %9
8: ; preds = %1
unreachable
9: ; preds = %1
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
%12 = call i32 (i32, ...) bitcast (i32 (...)* @fs to i32 (i32, ...)*)(i32 %11)
%13 = icmp ne i32 %12, 7
br i1 %13, label %14, label %15
14: ; preds = %9
unreachable
15: ; preds = %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @rs(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @fs to i32 (i32, ...)*)(i32 %0)
%3 = icmp eq i32 %2, 5
br i1 %3, label %5, label %4
4: ; preds = %1
tail call void @abort()
unreachable
5: ; preds = %1
%6 = add nsw i32 %0, 2
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @fs to i32 (i32, ...)*)(i32 %6)
%8 = icmp eq i32 %7, 7
br i1 %8, label %10, label %9
9: ; preds = %5
tail call void @abort()
unreachable
10: ; preds = %5
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ GPSPositionHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void GPSPositionUpdated() { UAVObjUpdated(GPSPositionHandle()); }


x86 assembly (clang, -O0):
<GPSPositionUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GPSPositionHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPSPositionUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <GPSPositionHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @GPSPositionUpdated() {
%1 = call i32 (...) @GPSPositionHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GPSPositionUpdated() {
%1 = tail call i32 (...) @GPSPositionHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ header_read(int /*<<< orphan*/ *);
scalar_t__ jtrace_read(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  FILE *f;
  f = fopen(argv[1], "r");
  header_read(f);
  while (jtrace_read(f) >= 0)
    ;
  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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeab(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <header_read@plt>
mov    -0x18(%rbp),%rdi
call   1030 <jtrace_read@plt>
cmp    $0x0,%rax
jl     117f <main+0x4f>
jmp    1167 <main+0x37>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
lea    0xec4(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <header_read@plt>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <jtrace_read@plt>
test   %rax,%rax
jns    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %10, i32** %6
%11 = load i32*, i32** %6
%12 = call i32 @header_read(i32* %11)
br label %13
13: ; preds = %17, %2
%14 = load i32*, i32** %6
%15 = call i64 @jtrace_read(i32* %14)
%16 = icmp sge i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
br label %13
18: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @header_read(i32* %5)
br label %7
7: ; preds = %7, %2
%8 = tail call i64 @jtrace_read(i32* %5)
%9 = icmp sgt i64 %8, -1
br i1 %9, label %7, label %10
10: ; preds = %7
ret i32 0
}
/* Type definitions */
struct in6_addr {
  int /*<<< orphan*/ s6_addr;
};

/* Variables and functions */
unsigned long lookup(unsigned char *, int, int /*<<< orphan*/);
unsigned long int ippool_hash6(struct in6_addr *addr) {
  return lookup((unsigned char *)&addr->s6_addr, sizeof(addr->s6_addr), 0);
}


x86 assembly (clang, -O0):
<ippool_hash6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <lookup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ippool_hash6>:
mov    $0x4,%esi
xor    %edx,%edx
jmp    1030 <lookup@plt>

LLVM IR (-O0):
%struct.in6_addr = type { i32 }
define i64 @ippool_hash6(%struct.in6_addr* %0) {
%2 = alloca %struct.in6_addr*
store %struct.in6_addr* %0, %struct.in6_addr** %2
%3 = load %struct.in6_addr*, %struct.in6_addr** %2
%4 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %3, i32 0, i32 0
%5 = bitcast i32* %4 to i8*
%6 = call i64 @lookup(i8* %5, i32 4, i32 0)
ret i64 %6
}

LLVM IR (-O2):
%struct.in6_addr = type { i32 }
define i64 @ippool_hash6(%struct.in6_addr* %0) {
%2 = bitcast %struct.in6_addr* %0 to i8*
%3 = tail call i64 @lookup(i8* %2, i32 4, i32 0)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ nlopt_version(int *, int *, int *);
void nloptv(int *major, int *minor, int *bugfix) {
  nlopt_version(major, minor, bugfix);
}


x86 assembly (clang, -O0):
<nloptv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <nlopt_version@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nloptv>:
jmp    1030 <nlopt_version@plt>

LLVM IR (-O0):
define void @nloptv(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = call i32 @nlopt_version(i32* %7, i32* %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @nloptv(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @nlopt_version(i32* %0, i32* %1, i32* %2)
ret void
}
char *skipPastMap(char *p) {
  while (*p != '.' && *p != '(' && *p != ',' && *p != '\0')
    ++p;
  return p;
}


x86 assembly (clang, -O0):
<skipPastMap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0x9(%rbp)
je     1157 <skipPastMap+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x28,%ecx
mov    %al,-0x9(%rbp)
je     1157 <skipPastMap+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2c,%ecx
mov    %al,-0x9(%rbp)
je     1157 <skipPastMap+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1167 <skipPastMap+0x67>
jmp    1178 <skipPastMap+0x78>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skipPastMap+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipPastMap>:
mov    %rdi,%rax
movabs $0x510000000001,%rcx
jmp    1114 <skipPastMap+0x14>
nop
add    $0x1,%rax
movzbl (%rax),%edx
cmp    $0x2e,%rdx
ja     1110 <skipPastMap+0x10>
bt     %rdx,%rcx
jae    1110 <skipPastMap+0x10>
ret

LLVM IR (-O0):
define i8* @skipPastMap(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %25, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 46
br i1 %7, label %8, label %23
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 40
br i1 %12, label %13, label %23
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 44
br i1 %17, label %18, label %23
18: ; preds = %13
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 0
br label %23
23: ; preds = %18, %13, %8, %3
%24 = phi i1 [ false, %13 ], [ false, %8 ], [ false, %3 ], [ %22, %18 ]
br i1 %24, label %25, label %28
25: ; preds = %23
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %2
br label %3
28: ; preds = %23
%29 = load i8*, i8** %2
ret i8* %29
}

LLVM IR (-O2):
define i8* @skipPastMap(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 46, label %7
i8 40, label %7
i8 44, label %7
i8 0, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ println(char *);
int main() {
  println("Hello, world!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <println@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <println@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @println(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = tail call i32 @println(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
unsigned int UCHAR_MAX;
int /*<<< orphan*/ time(int /*<<< orphan*/);
unsigned time_seed() {
  time_t now = time(0);
  unsigned char *p = (unsigned char *)&now;
  unsigned seed = 0;
  size_t i;
  for (i = 0; i < sizeof now; i++)
    seed = seed * (UCHAR_MAX + 2U) + p[i];
  return seed;
}


x86 assembly (clang, -O0):
<time_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x4,-0x20(%rbp)
jae    1178 <time_seed+0x68>
mov    -0x14(%rbp),%eax
mov    0x2ea2(%rip),%rcx
mov    (%rcx),%ecx
add    $0x2,%ecx
imul   %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1139 <time_seed+0x29>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_seed>:
push   %rax
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,%ecx
movzbl %al,%edx
movzbl %ah,%esi
shr    $0x10,%eax
shr    $0x18,%ecx
mov    0x2ec3(%rip),%rdi
mov    (%rdi),%edi
add    $0x2,%edi
imul   %edi,%edx
add    %edx,%esi
imul   %edi,%esi
movzbl %al,%eax
add    %esi,%eax
imul   %edi,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@UCHAR_MAX = global i32 0
define i32 @time_seed() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
%5 = call i32 @time(i32 0)
store i32 %5, i32* %1
%6 = bitcast i32* %1 to i8*
store i8* %6, i8** %2
store i32 0, i32* %3
store i64 0, i64* %4
br label %7
7: ; preds = %21, %0
%8 = load i64, i64* %4
%9 = icmp ult i64 %8, 4
br i1 %9, label %10, label %24
10: ; preds = %7
%11 = load i32, i32* %3
%12 = load i32, i32* @UCHAR_MAX
%13 = add i32 %12, 2
%14 = mul i32 %11, %13
%15 = load i8*, i8** %2
%16 = load i64, i64* %4
%17 = getelementptr inbounds i8, i8* %15, i64 %16
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = add i32 %14, %19
store i32 %20, i32* %3
br label %21
21: ; preds = %10
%22 = load i64, i64* %4
%23 = add i64 %22, 1
store i64 %23, i64* %4
br label %7
24: ; preds = %7
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@UCHAR_MAX = global i32 0
define i32 @time_seed() {
%1 = tail call i32 @time(i32 0)
%2 = lshr i32 %1, 8
%3 = lshr i32 %1, 16
%4 = lshr i32 %1, 24
%5 = load i32, i32* @UCHAR_MAX
%6 = add i32 %5, 2
%7 = and i32 %1, 255
%8 = mul i32 %6, %7
%9 = and i32 %2, 255
%10 = add i32 %8, %9
%11 = mul i32 %6, %10
%12 = and i32 %3, 255
%13 = add i32 %11, %12
%14 = mul i32 %6, %13
%15 = add i32 %14, %4
ret i32 %15
}
/* Variables and functions */
int npfao(int, int);
int npfaro(int nmin, int nmax) {
  return 2 * npfao((nmin + 1) / 2, (nmax + 1) / 2);
}


x86 assembly (clang, -O0):
<npfaro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <npfao@plt>
shl    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<npfaro>:
push   %rax
mov    %edi,%eax
add    $0x1,%eax
shr    $0x1f,%eax
add    %eax,%edi
add    $0x1,%edi
sar    %edi
mov    %esi,%eax
add    $0x1,%eax
shr    $0x1f,%eax
add    %eax,%esi
add    $0x1,%esi
sar    %esi
call   1030 <npfao@plt>
add    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @npfaro(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
%7 = sdiv i32 %6, 2
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
%10 = sdiv i32 %9, 2
%11 = call i32 @npfao(i32 %7, i32 %10)
%12 = mul nsw i32 2, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @npfaro(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1
%4 = sdiv i32 %3, 2
%5 = add nsw i32 %1, 1
%6 = sdiv i32 %5, 2
%7 = tail call i32 @npfao(i32 %4, i32 %6)
%8 = shl nsw i32 %7, 1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
bool tread_arr_start(void *s) {
  fprintf(stderr, "arr_start\n");
  return true;
}


x86 assembly (clang, -O0):
<tread_arr_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tread_arr_start>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"arr_start\0A\00"
define i32 @tread_arr_start(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"arr_start\0A\00"
define i32 @tread_arr_start(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
int is_big_endian(void) {
  int x = 0x01;
  char *c = (char *)&x;
  return (c[0] != 0x01);
}


x86 assembly (clang, -O0):
<is_big_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_big_endian>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_big_endian() {
%1 = alloca i32
%2 = alloca i8*
store i32 1, i32* %1
%3 = bitcast i32* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 1
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_big_endian() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void mov_reg32_reg32(unsigned int reg1, unsigned int reg2) {
  if (reg1 == reg2)
    return;
  put8(0x89);
  put8(0xC0 | (reg2 << 3) | reg1);
}


x86 assembly (clang, -O0):
<mov_reg32_reg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    112f <mov_reg32_reg32+0x1f>
jmp    114d <mov_reg32_reg32+0x3d>
mov    $0x89,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x4(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_reg32_reg32>:
cmp    %esi,%edi
jne    1115 <mov_reg32_reg32+0x5>
ret
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x89,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @mov_reg32_reg32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %17
9: ; preds = %2
%10 = call i32 @put8(i32 137)
%11 = load i32, i32* %4
%12 = shl i32 %11, 3
%13 = or i32 192, %12
%14 = load i32, i32* %3
%15 = or i32 %13, %14
%16 = call i32 @put8(i32 %15)
br label %17
17: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @mov_reg32_reg32(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = tail call i32 @put8(i32 137)
%6 = shl i32 %1, 3
%7 = or i32 %6, %0
%8 = or i32 %7, 192
%9 = tail call i32 @put8(i32 %8)
br label %10
10: ; preds = %2, %4
ret void
}
void TMTimerR3Ptr(void) {}


x86 assembly (clang, -O0):
<TMTimerR3Ptr>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TMTimerR3Ptr>:
ret

LLVM IR (-O0):
define void @TMTimerR3Ptr() {
ret void
}

LLVM IR (-O2):
define void @TMTimerR3Ptr() {
ret void
}