xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ n;

/* Variables and functions */
int /*<<< orphan*/ be16toh(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, char const *, int);
uint16_t ntoh16(const char *p) {
  uint16_t n;
  memcpy(&n, p, sizeof(n));
  return be16toh(n);
}


x86 assembly (clang, -O0):
<ntoh16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%edi
call   1040 <be16toh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntoh16>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%edi
call   1040 <be16toh@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ntoh16(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i32* %3, i8* %4, i32 4)
%6 = load i32, i32* %3
%7 = call i32 @be16toh(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ntoh16(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
%6 = call i32 @be16toh(i32 %5)
ret i32 %6
}
/* Variables and functions */
int hits(char *, char *, int);
int pseudo(char *, char *, int);
int test_hits_pseudo() {
  char actual[] = {'R', 'G', 'G', 'R'};
  char guess[] = {'Y', 'G', 'R', 'Y'};
  return 1 == hits(actual, guess, 4) && 1 == pseudo(actual, guess, 4);
}


x86 assembly (clang, -O0):
<test_hits_pseudo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    0xecd(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1040 <hits@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0x9(%rbp)
jne    1181 <test_hits_pseudo+0x61>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <pseudo@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_hits_pseudo>:
push   %rax
movl   $0x52474752,0x4(%rsp)
52
movl   $0x59524759,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1040 <hits@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
jne    1167 <test_hits_pseudo+0x47>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <pseudo@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
@__const.test_hits_pseudo.actual = [4 x i8] c"RGGR"
@__const.test_hits_pseudo.guess = [4 x i8] c"YGRY"
define i32 @test_hits_pseudo() {
%1 = alloca [4 x i8]
%2 = alloca [4 x i8]
%3 = bitcast [4 x i8]* %1 to i8*
%4 = bitcast [4 x i8]* %2 to i8*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%7 = call i32 @hits(i8* %5, i8* %6, i32 4)
%8 = icmp eq i32 1, %7
br i1 %8, label %9, label %14
9: ; preds = %0
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%12 = call i32 @pseudo(i8* %10, i8* %11, i32 4)
%13 = icmp eq i32 1, %12
br label %14
14: ; preds = %9, %0
%15 = phi i1 [ false, %0 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @test_hits_pseudo() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 1380403026, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 1498564441, i32* %2
%5 = call i32 @hits(i8* %3, i8* %4, i32 4)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = call i32 @pseudo(i8* %3, i8* %4, i32 4)
%9 = icmp eq i32 %8, 1
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %0
%12 = phi i32 [ 0, %0 ], [ %10, %7 ]
ret i32 %12
}
/* Type definitions */
struct thread_state {
  int dummy;
};
typedef int /*<<< orphan*/ mcontext_t;

/* Variables and functions */
void copy_state_from(struct thread_state *src, mcontext_t *dst) {}


x86 assembly (clang, -O0):
<copy_state_from>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.thread_state = type { i32 }
define void @copy_state_from(%struct.thread_state* %0, i32* %1) {
%3 = alloca %struct.thread_state*
%4 = alloca i32*
store %struct.thread_state* %0, %struct.thread_state** %3
store i32* %1, i32** %4
ret void
}

LLVM IR (-O2):
%struct.thread_state = type { i32 }
define void @copy_state_from(%struct.thread_state* nocapture %0, i32* nocapture %1) {
ret void
}
double var_uraeph(int ura) {
  const double ura_value[] = {2.4,   3.4,   4.85,   6.85,   9.65,
                              13.65, 24.0,  48.0,   96.0,   192.0,
                              384.0, 768.0, 1536.0, 3072.0, 6144.0};
  return ura < 0 || 15 < ura ? ((6144.0) * (6144.0))
                             : ((ura_value[ura]) * (ura_value[ura]));
}


x86 assembly (clang, -O0):
<var_uraeph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xee7(%rip),%rsi
mov    $0x78,%edx
call   1030 <memcpy@plt>
cmpl   $0x0,-0x4(%rbp)
jl     114b <var_uraeph+0x3b>
mov    $0xf,%eax
cmp    -0x4(%rbp),%eax
jge    1160 <var_uraeph+0x50>
movsd  0xead(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
jmp    117c <var_uraeph+0x6c>
movslq -0x4(%rbp),%rax
movsd  -0x80(%rbp,%rax,8),%xmm0
movslq -0x4(%rbp),%rax
mulsd  -0x80(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<var_uraeph>:
cmp    $0xf,%edi
jbe    110e <var_uraeph+0xe>
movsd  0xef3(%rip),%xmm0
ret
mov    %edi,%eax
lea    0xef9(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
@__const.var_uraeph.ura_value = [15 x double] [double 2.400000e+00, double 3.400000e+00, double 4.850000e+00, double 6.850000e+00, double 9.650000e+00, double 1.365000e+01, double 2.400000e+01, double 4.800000e+01, double 9.600000e+01, double 1.920000e+02, double 3.840000e+02, double 7.680000e+02, double 1.536000e+03, double 3.072000e+03, double 6.144000e+03]
define double @var_uraeph(i32 %0) {
%2 = alloca i32
%3 = alloca [15 x double]
store i32 %0, i32* %2
%4 = bitcast [15 x double]* %3 to i8*
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp slt i32 15, %8
br i1 %9, label %10, label %11
10: ; preds = %7, %1
br label %21
11: ; preds = %7
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [15 x double], [15 x double]* %3, i64 0, i64 %13
%15 = load double, double* %14
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [15 x double], [15 x double]* %3, i64 0, i64 %17
%19 = load double, double* %18
%20 = fmul double %15, %19
br label %21
21: ; preds = %11, %10
%22 = phi double [ 0x4182000000000000, %10 ], [ %20, %11 ]
ret double %22
}

LLVM IR (-O2):
@__const.var_uraeph.ura_value = [15 x double] [double 2.400000e+00, double 3.400000e+00, double 4.850000e+00, double 6.850000e+00, double 9.650000e+00, double 1.365000e+01, double 2.400000e+01, double 4.800000e+01, double 9.600000e+01, double 1.920000e+02, double 3.840000e+02, double 7.680000e+02, double 1.536000e+03, double 3.072000e+03, double 6.144000e+03]
define double @var_uraeph(i32 %0) {
%2 = icmp ugt i32 %0, 15
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = zext i32 %0 to i64
%5 = getelementptr inbounds [15 x double], [15 x double]* @__const.var_uraeph.ura_value, i64 0, i64 %4
%6 = load double, double* %5
%7 = fmul double %6, %6
br label %8
8: ; preds = %1, %3
%9 = phi double [ %7, %3 ], [ 0x4182000000000000, %1 ]
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xd7() {
  Assert_real((isdigit(215) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              1080, ("isdigit should be 0 for 0xd7"));
}


x86 assembly (clang, -O0):
<t_isdigit_0xd7>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd7,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x438,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0xd7>:
push   %rax
mov    $0xd7,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x438,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xd7\00"
define void @t_isdigit_0xd7() {
%1 = call i64 @isdigit(i32 215)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1080, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xd7\00"
define void @t_isdigit_0xd7() {
%1 = tail call i64 @isdigit(i32 215)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1080, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int handleProgaddr(int progaddr) {
  if (0 <= progaddr && progaddr < (1 << 20))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<handleProgaddr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jg     112b <handleProgaddr+0x2b>
cmpl   $0x100000,-0x8(%rbp)
jge    112b <handleProgaddr+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1132 <handleProgaddr+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<handleProgaddr>:
xor    %eax,%eax
cmp    $0x100000,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @handleProgaddr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 0, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 1048576
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @handleProgaddr(i32 %0) {
%2 = icmp ult i32 %0, 1048576
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
double floor(double);
int log(double);
double magic(double f) {
  double ff = floor(f);
  double r = log(ff + 6) * (log(ff + 6) - 1);
  return (f - ff) * floor(r) + f;
}


x86 assembly (clang, -O0):
<magic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xebc(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
mov    %eax,-0x24(%rbp)
movsd  0xea7(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
sub    $0x1,%ecx
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <floor@plt>
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<magic>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm0,0x18(%rsp)
call   1040 <floor@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0xec2(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
call   1030 <log@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1030 <log@plt>
add    $0xffffffff,%eax
imul   %ebx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0x18(%rsp),%xmm2
movapd %xmm2,%xmm0
subsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @magic(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @llvm.floor.f64(double %5)
store double %6, double* %3
%7 = load double, double* %3
%8 = fadd double %7, 6.000000e+00
%9 = call i32 @log(double %8)
%10 = load double, double* %3
%11 = fadd double %10, 6.000000e+00
%12 = call i32 @log(double %11)
%13 = sub nsw i32 %12, 1
%14 = mul nsw i32 %9, %13
%15 = sitofp i32 %14 to double
store double %15, double* %4
%16 = load double, double* %2
%17 = load double, double* %3
%18 = fsub double %16, %17
%19 = load double, double* %4
%20 = call double @llvm.floor.f64(double %19)
%21 = load double, double* %2
%22 = call double @llvm.fmuladd.f64(double %18, double %20, double %21)
ret double %22
}

LLVM IR (-O2):
define double @magic(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = fadd double %2, 6.000000e+00
%4 = tail call i32 @log(double %3)
%5 = tail call i32 @log(double %3)
%6 = add nsw i32 %5, -1
%7 = mul nsw i32 %6, %4
%8 = sitofp i32 %7 to double
%9 = fsub double %0, %2
%10 = tail call double @llvm.fmuladd.f64(double %9, double %8, double %0)
ret double %10
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void set_black(uint8_t *bw, int i) { bw[i / 8] |= 1 << i % 8; }


x86 assembly (clang, -O0):
<set_black>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_black>:
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
lea    0x7(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
or     %eax,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @set_black(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = srem i32 %5, 8
%7 = shl i32 1, %6
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = sdiv i32 %9, 8
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %8, i64 %11
%13 = load i32, i32* %12
%14 = or i32 %13, %7
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @set_black(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 7
%4 = shl nuw nsw i32 1, %3
%5 = sdiv i32 %1, 8
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = or i32 %8, %4
store i32 %9, i32* %7
ret void
}
int foo(void) {
  return 0;
rtattr_failure:
  __attribute__((unused)) return -1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
store i32 0, i32* %1
br label %3
2: ; No predecessors!
store i32 -1, i32* %1
br label %3
3: ; preds = %2, %0
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int time_conv(time_t countdown, time_t unit_sec_val) {
  int i = 0;
  while (countdown > 0) {
    countdown = countdown - unit_sec_val;
    ++i;
  }
  if (countdown < 0) {
    countdown = countdown + unit_sec_val;
    i = i - 1;
  }
  return i;
}


x86 assembly (clang, -O0):
<time_conv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1138 <time_conv+0x38>
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <time_conv+0x13>
cmpq   $0x0,-0x8(%rbp)
jge    1158 <time_conv+0x58>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_conv>:
xor    %eax,%eax
test   %rdi,%rdi
jle    111b <time_conv+0x1b>
nopw   0x0(%rax,%rax,1)
sub    %rsi,%rdi
add    $0x1,%eax
test   %rdi,%rdi
jg     1110 <time_conv+0x10>
cmp    $0x1,%rdi
adc    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @time_conv(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, 0
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ 0, %2 ]
%6 = phi i64 [ %7, %4 ], [ %0, %2 ]
%7 = sub nsw i64 %6, %1
%8 = add nuw nsw i32 %5, 1
%9 = icmp sgt i64 %7, 0
br i1 %9, label %4, label %10
10: ; preds = %4, %2
%11 = phi i64 [ %0, %2 ], [ %7, %4 ]
%12 = phi i32 [ 0, %2 ], [ %8, %4 ]
%13 = icmp ne i64 %11, 0
%14 = sext i1 %13 to i32
%15 = add nsw i32 %12, %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ AdmTcpBind();
void AdmTcpInit() { AdmTcpBind(); }


x86 assembly (clang, -O0):
<AdmTcpInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <AdmTcpBind@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AdmTcpInit>:
xor    %eax,%eax
jmp    1030 <AdmTcpBind@plt>

LLVM IR (-O0):
define void @AdmTcpInit() {
%1 = call i32 (...) @AdmTcpBind()
ret void
}

LLVM IR (-O2):
define void @AdmTcpInit() {
%1 = tail call i32 (...) @AdmTcpBind()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ appendCODE(int /*<<< orphan*/);
int /*<<< orphan*/ makeCODEdup(int /*<<< orphan*/ *);
void code_dup() { appendCODE(makeCODEdup(NULL)); }


x86 assembly (clang, -O0):
<code_dup>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <makeCODEdup@plt>
mov    %eax,%edi
call   1030 <appendCODE@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @code_dup() {
%1 = call i32 @makeCODEdup(i32* null)
%2 = call i32 @appendCODE(i32 %1)
ret void
}

LLVM IR (-O2):
define void @code_dup() {
%1 = tail call i32 @makeCODEdup(i32* null)
%2 = tail call i32 @appendCODE(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TxDByte_Zigbee(unsigned char);
int zgb_hal_tx(unsigned char *pPacket, int numPacket) {
  unsigned char i;
  for (i = 0; i < numPacket; i++)
    TxDByte_Zigbee(pPacket[i]);
  return numPacket;
}


x86 assembly (clang, -O0):
<zgb_hal_tx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movb   $0x0,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114e <zgb_hal_tx+0x3e>
mov    -0x8(%rbp),%rax
movzbl -0xd(%rbp),%ecx
movzbl (%rax,%rcx,1),%edi
call   1030 <TxDByte_Zigbee@plt>
mov    -0xd(%rbp),%al
add    $0x1,%al
mov    %al,-0xd(%rbp)
jmp    1123 <zgb_hal_tx+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zgb_hal_tx>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
test   %esi,%esi
jle    1137 <zgb_hal_tx+0x27>
mov    %rdi,%r14
xor    %ebx,%ebx
nop
movzbl %bl,%ebx
movzbl (%r14,%rbx,1),%edi
call   1030 <TxDByte_Zigbee@plt>
add    $0x1,%bl
movzbl %bl,%eax
cmp    %ebp,%eax
jl     1120 <zgb_hal_tx+0x10>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @zgb_hal_tx(i8* nocapture %0, i32 returned %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i8 [ %10, %4 ], [ 0, %2 ]
%6 = zext i8 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @TxDByte_Zigbee(i8 zeroext %8)
%10 = add i8 %5, 1
%11 = zext i8 %10 to i32
%12 = icmp slt i32 %11, %1
br i1 %12, label %4, label %13
13: ; preds = %4, %2
ret i32 %1
}
double deg2rad(double x) { return x * 1.7453292519943295e-2; }


x86 assembly (clang, -O0):
<deg2rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg2rad>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @deg2rad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x3F91DF46A2529D39
ret double %4
}

LLVM IR (-O2):
define double @deg2rad(double %0) {
%2 = fmul double %0, 0x3F91DF46A2529D39
ret double %2
}
void g_value_get_object() {}


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

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

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

LLVM IR (-O2):
define void @g_value_get_object() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printspaces(int n) {
  int i;
  for (i = 0; i < n; i++)
    printf(" ");
}


x86 assembly (clang, -O0):
<printspaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <printspaces+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printspaces+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printspaces>:
push   %rbx
test   %edi,%edi
jle    112f <printspaces+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <printspaces+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @printspaces(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
void ____atomic_set_bit(unsigned int bit, unsigned long *p) {
  unsigned long flags;
  unsigned long mask;
  unsigned long temp;
  mask = 1UL << (bit & 31U);
  p += bit >> 5;
  (*p) |= (unsigned long)mask;
  return;
}


x86 assembly (clang, -O0):
<____atomic_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
shr    $0x5,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,%ecx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<____atomic_set_bit>:
mov    %edi,%ecx
and    $0x1f,%cl
mov    $0x1,%eax
shl    %cl,%rax
shr    $0x5,%edi
or     %rax,(%rsi,%rdi,8)
ret

LLVM IR (-O0):
define void @____atomic_set_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i32 %0, i32* %3
store i64* %1, i64** %4
%8 = load i32, i32* %3
%9 = and i32 %8, 31
%10 = zext i32 %9 to i64
%11 = shl i64 1, %10
store i64 %11, i64* %6
%12 = load i32, i32* %3
%13 = lshr i32 %12, 5
%14 = load i64*, i64** %4
%15 = zext i32 %13 to i64
%16 = getelementptr inbounds i64, i64* %14, i64 %15
store i64* %16, i64** %4
%17 = load i64, i64* %6
%18 = load i64*, i64** %4
%19 = load i64, i64* %18
%20 = or i64 %19, %17
store i64 %20, i64* %18
ret void
}

LLVM IR (-O2):
define void @____atomic_set_bit(i32 %0, i64* nocapture %1) {
%3 = and i32 %0, 31
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 1, %4
%6 = lshr i32 %0, 5
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %1, i64 %7
%9 = load i64, i64* %8
%10 = or i64 %9, %5
store i64 %10, i64* %8
ret void
}
/* Variables and functions */
int strlen(char const *);
int mes_filename_check(const char *filename) {
  int len;
  if (!filename)
    return (-1);
  len = strlen(filename);
  if (len <= 0)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<mes_filename_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <mes_filename_check+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <mes_filename_check+0x4c>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1155 <mes_filename_check+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <mes_filename_check+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mes_filename_check>:
test   %rdi,%rdi
je     112b <mes_filename_check+0x1b>
push   %rax
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setle  %al
neg    %eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @mes_filename_check(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 -1, i32* %2
br label %15
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp sle i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 -1, i32* %2
br label %15
14: ; preds = %8
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13, %7
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @mes_filename_check(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp slt i32 %4, 1
%6 = sext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ -1, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int agea(int);
int /*<<< orphan*/ printf(char *, int, int);
void main() {
  int age(int num);
  int year, num = 5;
  year = age(num);
  printf("the %d is %d\n", num, year);
  year = agea(num);
  printf("the %d is %d\n", num, year);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <age@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <agea@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%edi
call   1050 <age@plt>
lea    0xebe(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <agea@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"the %d is %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 5, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @age(i32 %3)
store i32 %4, i32* %1
%5 = load i32, i32* %2
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @agea(i32 %8)
store i32 %9, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %1
%12 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"the %d is %d\0A\00"
define void @main() {
%1 = tail call i32 @age(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 5, i32 %1)
%3 = tail call i32 @agea(i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 5, i32 %3)
ret void
}
int os_stat(void *data, struct stat *st, int *rc) { return -1; }


x86 assembly (clang, -O0):
<os_stat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @os_stat(i8* %0, %struct.stat* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca %struct.stat*
%6 = alloca i32*
store i8* %0, i8** %4
store %struct.stat* %1, %struct.stat** %5
store i32* %2, i32** %6
ret i32 -1
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @os_stat(i8* nocapture readnone %0, %struct.stat* nocapture readnone %1, i32* nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
void timer(int timer) {
  sleep(timer);
  exit(0);
}


x86 assembly (clang, -O0):
<timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <sleep@plt>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<timer>:
push   %rax
call   1040 <sleep@plt>
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @timer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sleep(i32 %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @timer(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double floor(double const);
double coco_double_round(const double number) { return floor(number + 0.5); }


x86 assembly (clang, -O0):
<coco_double_round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coco_double_round>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @coco_double_round(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 5.000000e-01
%5 = call double @llvm.floor.f64(double %4)
ret double %5
}

LLVM IR (-O2):
define double @coco_double_round(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = tail call double @llvm.floor.f64(double %2)
ret double %3
}
long addimmsi3(long a) { return a + 50; }


x86 assembly (clang, -O0):
<addimmsi3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x32,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addimmsi3>:
lea    0x32(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @addimmsi3(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 50
ret i64 %4
}

LLVM IR (-O2):
define i64 @addimmsi3(i64 %0) {
%2 = add nsw i64 %0, 50
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int, int);
int main() {
  int a = 1, b = 2;
  int *p1 = &a;
  int *p2 = &b;
  swap(*p1, *p2);
  printf("%d %d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
call   1040 <swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <swap@plt>
lea    0xec9(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
store i32* %2, i32** %4
store i32* %3, i32** %5
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = call i32 @swap(i32 %7, i32 %9)
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @swap(i32 1, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1, i32 2)
ret i32 0
}
/* Variables and functions */
scalar_t__ Pfun(int, int);
float accum(int k) {
  int i;
  float tmp = 0.0;
#pragma omp target map(tofrom : tmp)
#pragma omp parallel for reduction(+ : tmp)
  for (i = 0; i < 1000; i++)
    tmp += Pfun(i, k);
  return tmp;
}


x86 assembly (clang, -O0):
<accum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    115f <accum+0x4f>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <Pfun@plt>
cvtsi2ss %rax,%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112a <accum+0x1a>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accum>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
xorps  %xmm0,%xmm0
nopw   0x0(%rax,%rax,1)
movss  %xmm0,0x4(%rsp)
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <Pfun@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  0x4(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
movss  0x4(%rsp),%xmm0
add    $0x1,%ebp
cmp    $0x3e8,%ebp
jne    1120 <accum+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define float @accum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %2
store float 0.000000e+00, float* %4
store i32 0, i32* %3
br label %5
5: ; preds = %15, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 1000
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = call i64 @Pfun(i32 %9, i32 %10)
%12 = sitofp i64 %11 to float
%13 = load float, float* %4
%14 = fadd float %13, %12
store float %14, float* %4
br label %15
15: ; preds = %8
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %5
18: ; preds = %5
%19 = load float, float* %4
ret float %19
}

LLVM IR (-O2):
define float @accum(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi float [ 0.000000e+00, %1 ], [ %7, %2 ]
%4 = phi i32 [ 0, %1 ], [ %8, %2 ]
%5 = tail call i64 @Pfun(i32 %4, i32 %0)
%6 = sitofp i64 %5 to float
%7 = fadd float %3, %6
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %8, 1000
br i1 %9, label %10, label %2
10: ; preds = %2
ret float %7
}
/* Variables and functions */
int foo(int *);
int main() {
  int a[3] = {1, 2, 3};
  return foo(a);
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <foo@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
store i32 0, i32* %1
%3 = bitcast [3 x i32]* %2 to i8*
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%5 = call i32 @foo(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fatal();
void __attribute__((noreturn)) f0(void) { fatal(); }


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <fatal@plt>

x86 assembly (clang, -O2):
<f0>:
push   %rax
xor    %eax,%eax
call   1030 <fatal@plt>

LLVM IR (-O0):
define void @f0() {
%1 = call i32 (...) @fatal()
unreachable
}

LLVM IR (-O2):
define void @f0() {
%1 = tail call i32 (...) @fatal()
unreachable
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned char, int);
void fprint_mov_data_to_atRi(FILE *stream, unsigned char i, uint8_t data) {
  fprintf(stream,
          "MOV   @R%X, #"
          "0x%02X"
          "                ",
          i, data);
}


x86 assembly (clang, -O0):
<fprint_mov_data_to_atRi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x10(%rbp),%ecx
lea    0xeca(%rip),%rsi
movzbl %al,%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_mov_data_to_atRi>:
mov    %edx,%ecx
mov    %esi,%edx
lea    0xee5(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"MOV @R%X,x%02X \00"
define void @fprint_mov_data_to_atRi(i32* %0, i8 zeroext %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8
%6 = alloca i32
store i32* %0, i32** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i8, i8* %5
%9 = load i32, i32* %6
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8 zeroext %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"MOV @R%X,x%02X \00"
define void @fprint_mov_data_to_atRi(i32* nocapture %0, i8 zeroext %1, i32 %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8 zeroext %1, i32 %2)
ret void
}
/* Type definitions */
typedef int uint32_t;
struct _internal_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct _internal_node *);
uint32_t _dealloc_internal_node(struct _internal_node *node) {
  free(node);
  return 1;
}


x86 assembly (clang, -O0):
<_dealloc_internal_node>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dealloc_internal_node>:
push   %rax
call   1030 <free@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct._internal_node = type { i32 }
define i32 @_dealloc_internal_node(%struct._internal_node* %0) {
%2 = alloca %struct._internal_node*
store %struct._internal_node* %0, %struct._internal_node** %2
%3 = load %struct._internal_node*, %struct._internal_node** %2
%4 = call i32 @free(%struct._internal_node* %3)
ret i32 1
}

LLVM IR (-O2):
%struct._internal_node = type { i32 }
define i32 @_dealloc_internal_node(%struct._internal_node* nocapture %0) {
%2 = tail call i32 @free(%struct._internal_node* %0)
ret i32 1
}
/* Variables and functions */
scalar_t__ white_space(char);
char *skip_white_space(char *str) {
  for (; white_space(*str) && *str != '\0'; str++)
    ;
  return str;
}


x86 assembly (clang, -O0):
<skip_white_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <white_space@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     114a <skip_white_space+0x3a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115a <skip_white_space+0x4a>
jmp    1170 <skip_white_space+0x60>
jmp    115f <skip_white_space+0x4f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_white_space+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_white_space>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
nopw   0x0(%rax,%rax,1)
call   1030 <white_space@plt>
test   %rax,%rax
je     1139 <skip_white_space+0x29>
cmpb   $0x0,(%rbx)
je     1139 <skip_white_space+0x29>
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
jmp    1120 <skip_white_space+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skip_white_space(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @white_space(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %19
15: ; preds = %13
br label %16
16: ; preds = %15
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %13
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @skip_white_space(i8* %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @white_space(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %9
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = tail call i64 @white_space(i8 signext %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %9, %1
%15 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %5 ]
ret i8* %15
}
/* Variables and functions */
void free(void *);
void sawmill_free(void *ptr) { return free(ptr); }


x86 assembly (clang, -O0):
<sawmill_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sawmill_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @sawmill_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @sawmill_free(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
int LINT_TO_DINT(long var) {
  int newvar;
  if (var >= 65535)
    newvar = 65535;
  else
    newvar = (int)var;
  return newvar;
}


x86 assembly (clang, -O0):
<LINT_TO_DINT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0xffff,-0x8(%rbp)
jl     1122 <LINT_TO_DINT+0x22>
movl   $0xffff,-0xc(%rbp)
jmp    1129 <LINT_TO_DINT+0x29>
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LINT_TO_DINT>:
cmp    $0xffff,%rdi
mov    $0xffff,%eax
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @LINT_TO_DINT(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp sge i64 %4, 65535
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 65535, i32* %3
br label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @LINT_TO_DINT(i64 %0) {
%2 = icmp sgt i64 %0, 65534
%3 = trunc i64 %0 to i32
%4 = select i1 %2, i32 65535, i32 %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ halt(int /*<<< orphan*/);
int /*<<< orphan*/ wheatLog(int, char *);
void handleInt() {
  wheatLog(4, "Signal int");
  halt(0);
}


x86 assembly (clang, -O0):
<handleInt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
lea    0xed0(%rip),%rsi
call   1030 <wheatLog@plt>
xor    %edi,%edi
call   1040 <halt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handleInt>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x4,%edi
call   1030 <wheatLog@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <halt@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Signal int\00"
define void @handleInt() {
%1 = call i32 @wheatLog(i32 4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @halt(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Signal int\00"
define void @handleInt() {
%1 = tail call i32 @wheatLog(i32 4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @halt(i32 0)
ret void
}
float *mat3_adjugate(float *result, float *m) {
  result = m;
  return result;
}


x86 assembly (clang, -O0):
<mat3_adjugate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat3_adjugate>:
mov    %rsi,%rax
ret

LLVM IR (-O0):
define float* @mat3_adjugate(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
store float* %5, float** %3
%6 = load float*, float** %3
ret float* %6
}

LLVM IR (-O2):
define float* @mat3_adjugate(float* nocapture readnone %0, float* readnone returned %1) {
ret float* %1
}
int wifi_unload_driver() { return -1; }


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

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

LLVM IR (-O0):
define i32 @wifi_unload_driver() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @wifi_unload_driver() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ load_compiler();
int /*<<< orphan*/ pNvCliCompileLogFree(char const *);
void NvCliCompileLogFree(const char *compileLog) {
  load_compiler();
  pNvCliCompileLogFree(compileLog);
}


x86 assembly (clang, -O0):
<NvCliCompileLogFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <load_compiler@plt>
mov    -0x8(%rbp),%rdi
call   1030 <pNvCliCompileLogFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NvCliCompileLogFree>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <load_compiler@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <pNvCliCompileLogFree@plt>

LLVM IR (-O0):
define void @NvCliCompileLogFree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @load_compiler()
%4 = load i8*, i8** %2
%5 = call i32 @pNvCliCompileLogFree(i8* %4)
ret void
}

LLVM IR (-O2):
define void @NvCliCompileLogFree(i8* %0) {
%2 = tail call i32 (...) @load_compiler()
%3 = tail call i32 @pNvCliCompileLogFree(i8* %0)
ret void
}