xunge/DecIR huggingface dataset:
/* Variables and functions */
double c_norm(double);
double dr_dtau(double);
double dv_dtau(double);
double lmd_m(double);
double val_h(double);
double val_r(double);
double drho_dtau(double tau) {
  double r, h;
  r = val_r(tau);
  h = val_h(r);
  return c_norm(h) * (lmd_m(h) * dv_dtau(tau) - dr_dtau(tau));
}


x86 assembly (clang, -O0):
<drho_dtau>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <val_r@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1070 <val_h@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <c_norm@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <lmd_m@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1080 <dv_dtau@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <dr_dtau@plt>
movsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm3
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drho_dtau>:
sub    $0x28,%rsp
movsd  %xmm0,0x10(%rsp)
call   1040 <val_r@plt>
call   1070 <val_h@plt>
movsd  %xmm0,0x8(%rsp)
call   1050 <c_norm@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <lmd_m@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1080 <dv_dtau@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
call   1060 <dr_dtau@plt>
movsd  0x18(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x20(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @drho_dtau(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @val_r(double %5)
store double %6, double* %3
%7 = load double, double* %3
%8 = call double @val_h(double %7)
store double %8, double* %4
%9 = load double, double* %4
%10 = call double @c_norm(double %9)
%11 = load double, double* %4
%12 = call double @lmd_m(double %11)
%13 = load double, double* %2
%14 = call double @dv_dtau(double %13)
%15 = load double, double* %2
%16 = call double @dr_dtau(double %15)
%17 = fneg double %16
%18 = call double @llvm.fmuladd.f64(double %12, double %14, double %17)
%19 = fmul double %10, %18
ret double %19
}

LLVM IR (-O2):
define double @drho_dtau(double %0) {
%2 = tail call double @val_r(double %0)
%3 = tail call double @val_h(double %2)
%4 = tail call double @c_norm(double %3)
%5 = tail call double @lmd_m(double %3)
%6 = tail call double @dv_dtau(double %0)
%7 = tail call double @dr_dtau(double %0)
%8 = fneg double %7
%9 = tail call double @llvm.fmuladd.f64(double %5, double %6, double %8)
%10 = fmul double %4, %9
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int s;
  s = ((98) + (1024));
  printf("%d\n", s);
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1122)
ret i32 0
}
int lan2_keepalive(int type, void *rsp) { return (-8); }


x86 assembly (clang, -O0):
<lan2_keepalive>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xfffffff8,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @lan2_keepalive(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret i32 -8
}

LLVM IR (-O2):
define i32 @lan2_keepalive(i32 %0, i8* nocapture readnone %1) {
ret i32 -8
}
void resetMote() {}


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

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

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

LLVM IR (-O2):
define void @resetMote() {
ret void
}
int da8xx_pinmux_setup(const short pins[]) { return 0; }


x86 assembly (clang, -O0):
<da8xx_pinmux_setup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @da8xx_pinmux_setup(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @da8xx_pinmux_setup(i16* nocapture readnone %0) {
ret i32 0
}
unsigned int pop3(unsigned int x) {
  unsigned int n = 0;
  while (x) {
    x &= x - 1;
    ++n;
  }
  return n;
}


x86 assembly (clang, -O0):
<pop3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <pop3+0x32>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <pop3+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop3>:
xor    %eax,%eax
test   %edi,%edi
je     111c <pop3+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <pop3+0x10>
ret

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

LLVM IR (-O2):
define i32 @pop3(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %5, -1
%7 = and i32 %6, %5
%8 = add i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
int test_imm_C2int32_reg(int val) { return ((val) & (0xC2 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_C2int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xc2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C2int32_reg>:
test   $0xc2,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C2int32_reg(i32 %0) {
%2 = and i32 %0, 194
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int dns_v_api(void) { return 0x20120618; }


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

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

LLVM IR (-O0):
define i32 @dns_v_api() {
ret i32 538052120
}

LLVM IR (-O2):
define i32 @dns_v_api() {
ret i32 538052120
}
/* Type definitions */
struct graph {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ remove_edge(struct graph *, int, int);
void remove_edge_double(struct graph *g, int a, int b) {
  remove_edge(g, a, b);
  remove_edge(g, a, b);
}


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

x86 assembly (clang, -O2):
<remove_edge_double>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <remove_edge@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <remove_edge@plt>

LLVM IR (-O0):
%struct.graph = type { i32 }
define void @remove_edge_double(%struct.graph* %0, i32 %1, i32 %2) {
%4 = alloca %struct.graph*
%5 = alloca i32
%6 = alloca i32
store %struct.graph* %0, %struct.graph** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.graph*, %struct.graph** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @remove_edge(%struct.graph* %7, i32 %8, i32 %9)
%11 = load %struct.graph*, %struct.graph** %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @remove_edge(%struct.graph* %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
%struct.graph = type { i32 }
define void @remove_edge_double(%struct.graph* %0, i32 %1, i32 %2) {
%4 = tail call i32 @remove_edge(%struct.graph* %0, i32 %1, i32 %2)
%5 = tail call i32 @remove_edge(%struct.graph* %0, i32 %1, i32 %2)
ret void
}
int main(void) {
  int i = 43;
  i--;
  return i;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 43, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
unsigned int bit_reverse(unsigned int n) {
  n = ((n & 0xAAAAAAAA) >> 1) | ((n & 0x55555555) << 1);
  n = ((n & 0xCCCCCCCC) >> 2) | ((n & 0x33333333) << 2);
  n = ((n & 0xF0F0F0F0) >> 4) | ((n & 0x0F0F0F0F) << 4);
  n = ((n & 0xFF00FF00) >> 8) | ((n & 0x00FF00FF) << 8);
  return (n >> 16) | (n << 16);
}


x86 assembly (clang, -O0):
<bit_reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xaaaaaaaa,%eax
shr    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x55555555,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xcccccccc,%eax
shr    $0x2,%eax
mov    -0x4(%rbp),%ecx
and    $0x33333333,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0f0f0f0,%eax
shr    $0x4,%eax
mov    -0x4(%rbp),%ecx
and    $0xf0f0f0f,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff00,%eax
shr    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00ff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
mov    -0x4(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_reverse>:
bswap  %edi
mov    %edi,%eax
and    $0xf0f0f0f,%eax
shl    $0x4,%eax
shr    $0x4,%edi
and    $0xf0f0f0f,%edi
or     %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
lea    (%rdi,%rax,4),%eax
mov    %eax,%ecx
and    $0x55555555,%ecx
shr    %eax
and    $0x55555555,%eax
lea    (%rax,%rcx,2),%eax
ret

LLVM IR (-O0):
define i32 @bit_reverse(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -1431655766
%5 = lshr i32 %4, 1
%6 = load i32, i32* %2
%7 = and i32 %6, 1431655765
%8 = shl i32 %7, 1
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = and i32 %10, -858993460
%12 = lshr i32 %11, 2
%13 = load i32, i32* %2
%14 = and i32 %13, 858993459
%15 = shl i32 %14, 2
%16 = or i32 %12, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = and i32 %17, -252645136
%19 = lshr i32 %18, 4
%20 = load i32, i32* %2
%21 = and i32 %20, 252645135
%22 = shl i32 %21, 4
%23 = or i32 %19, %22
store i32 %23, i32* %2
%24 = load i32, i32* %2
%25 = and i32 %24, -16711936
%26 = lshr i32 %25, 8
%27 = load i32, i32* %2
%28 = and i32 %27, 16711935
%29 = shl i32 %28, 8
%30 = or i32 %26, %29
store i32 %30, i32* %2
%31 = load i32, i32* %2
%32 = lshr i32 %31, 16
%33 = load i32, i32* %2
%34 = shl i32 %33, 16
%35 = or i32 %32, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @bit_reverse(i32 %0) {
%2 = tail call i32 @llvm.bitreverse.i32(i32 %0)
ret i32 %2
}
void to_uns_long_store(__float128 a, unsigned long *p) {
  *p = (unsigned long)a;
}


x86 assembly (clang, -O0):
<to_uns_long_store>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movaps %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movaps -0x10(%rbp),%xmm0
call   1130 <__fixunstfdi>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret
nopl   0x0(%rax)

x86 assembly (clang, -O2):
<to_uns_long_store>:
push   %rbx
mov    %rdi,%rbx
call   1110 <__fixunstfdi>
mov    %rax,(%rbx)
pop    %rbx
ret
xchg   %ax,%ax

LLVM IR (-O0):
define void @to_uns_long_store(fp128 %0, i64* %1) {
%3 = alloca fp128
%4 = alloca i64*
store fp128 %0, fp128* %3
store i64* %1, i64** %4
%5 = load fp128, fp128* %3
%6 = fptoui fp128 %5 to i64
%7 = load i64*, i64** %4
store i64 %6, i64* %7
ret void
}

LLVM IR (-O2):
define void @to_uns_long_store(fp128 %0, i64* nocapture writeonly %1) {
%3 = fptoui fp128 %0 to i64
store i64 %3, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ move_cursor_xy(int, int);
int /*<<< orphan*/ printf(char *, int);
void show_score(int score, int row, int col) {
  move_cursor_xy(row, col);
  printf("Score: %-5d", score);
}


x86 assembly (clang, -O0):
<show_score>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <move_cursor_xy@plt>
mov    -0x4(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_score>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
mov    %edx,%esi
call   1040 <move_cursor_xy@plt>
lea    0xecd(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Score: %-5d\00"
define void @show_score(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* %5
%8 = load i32, i32* %6
%9 = call i32 @move_cursor_xy(i32 %7, i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Score: %-5d\00"
define void @show_score(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @move_cursor_xy(i32 %1, i32 %2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct struct_dll {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_struct_dll(struct struct_dll *);
struct struct_dll *get_struct_dll();
int main() {
  struct struct_dll *s1 = get_struct_dll();
  free_struct_dll(s1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_struct_dll@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free_struct_dll@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <get_struct_dll@plt>
mov    %rax,%rdi
call   1030 <free_struct_dll@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.struct_dll = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.struct_dll*
store i32 0, i32* %1
%3 = call %struct.struct_dll* (...) @get_struct_dll()
store %struct.struct_dll* %3, %struct.struct_dll** %2
%4 = load %struct.struct_dll*, %struct.struct_dll** %2
%5 = call i32 @free_struct_dll(%struct.struct_dll* %4)
ret i32 0
}

LLVM IR (-O2):
%struct.struct_dll = type { i32 }
define i32 @main() {
%1 = tail call %struct.struct_dll* (...) @get_struct_dll()
%2 = tail call i32 @free_struct_dll(%struct.struct_dll* %1)
ret i32 0
}
int to_int32(const char *bytes) {
  return (int)bytes[0] | ((int)bytes[1] << 8) | ((int)bytes[2] << 16) |
         ((int)bytes[3] << 24);
}


x86 assembly (clang, -O0):
<to_int32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_int32>:
movsbl (%rdi),%eax
movsbl 0x1(%rdi),%ecx
shl    $0x8,%ecx
or     %eax,%ecx
movsbl 0x2(%rdi),%edx
shl    $0x10,%edx
movzbl 0x3(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @to_int32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @to_int32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = shl nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = shl nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int *malloc(int);
int main() {
  int *p;
  p = malloc(100 * sizeof(int));
  p[100] = 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x190,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,0x190(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x190,%edi
call   1030 <malloc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 400)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 100
store i32 1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 400)
ret i32 0
}
float double_to_float(double src) { return src; }


x86 assembly (clang, -O0):
<double_to_float>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_to_float>:
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @double_to_float(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptrunc double %3 to float
ret float %4
}

LLVM IR (-O2):
define float @double_to_float(double %0) {
%2 = fptrunc double %0 to float
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ set_cloexec_action(int);
int /*<<< orphan*/ x_msg(int, char *);
void set_cloexec(int fd) {
  if (!set_cloexec_action(fd))
    x_msg(((1 << 4) | (1 << 8)),
          "Set FD_CLOEXEC flag on file descriptor failed");
}


x86 assembly (clang, -O0):
<set_cloexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <set_cloexec_action@plt>
cmp    $0x0,%eax
jne    114d <set_cloexec+0x2d>
mov    $0x110,%edi
lea    0xeb8(%rip),%rsi
call   1040 <x_msg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cloexec>:
push   %rax
call   1030 <set_cloexec_action@plt>
test   %eax,%eax
je     112c <set_cloexec+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rsi
mov    $0x110,%edi
pop    %rax
jmp    1040 <x_msg@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Set FD_CLOEXEC flag on file descriptor failed\00"
define void @set_cloexec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @set_cloexec_action(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @x_msg(i32 272, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"Set FD_CLOEXEC flag on file descriptor failed\00"
define void @set_cloexec(i32 %0) {
%2 = tail call i32 @set_cloexec_action(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @x_msg(i32 272, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430TimerCapComP__6__Compare__default__fired();
void Msp430TimerCapComP__6__Compare__fired(void) {
  Msp430TimerCapComP__6__Compare__default__fired();
}


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

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

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

LLVM IR (-O2):
define void @Msp430TimerCapComP__6__Compare__fired() {
%1 = tail call i32 (...) @Msp430TimerCapComP__6__Compare__default__fired()
ret void
}
int is_num(char c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<is_num>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_num+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_num>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_num(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_num(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int, int, int, int, int, int, int, int);
int main() {
  f(1, 2, 3, 4, 5, 6, 7, 8, 9);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
movl   $0x7,(%rsp)
movl   $0x8,0x8(%rsp)
movl   $0x9,0x10(%rsp)
call   1030 <f@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
sub    $0x8,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
push   $0x9
push   $0x8
push   $0x7
call   1030 <f@plt>
add    $0x20,%rsp
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int /*<<< orphan*/ __lock;
};
struct TYPE_5__ {
  TYPE_1__ __data;
};
typedef TYPE_2__ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ ll_lock(int /*<<< orphan*/ *);
int pthread_mutex_lock(pthread_mutex_t *mutex) {
  ll_lock(&(mutex)->__data.__lock);
  return 0;
}


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

x86 assembly (clang, -O2):
<pthread_mutex_lock>:
push   %rax
call   1030 <ll_lock@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32 }
define i32 @pthread_mutex_lock(%struct.TYPE_5__* %0) {
%2 = alloca %struct.TYPE_5__*
store %struct.TYPE_5__* %0, %struct.TYPE_5__** %2
%3 = load %struct.TYPE_5__*, %struct.TYPE_5__** %2
%4 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i32 0, i32 0
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = call i32 @ll_lock(i32* %5)
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32 }
define i32 @pthread_mutex_lock(%struct.TYPE_5__* %0) {
%2 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %0, i64 0, i32 0, i32 0
%3 = tail call i32 @ll_lock(i32* %2)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
void flag_set(uint64_t *flag, uint64_t i) {
  size_t a;
  a = i / 64;
  i &= 63;
  flag[a] |= (1UL << i);
}


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

x86 assembly (clang, -O2):
<flag_set>:
mov    %esi,%ecx
lea    0x3f(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x6,%eax
mov    $0x1,%edx
shl    %cl,%rdx
cltq
or     %edx,(%rdi,%rax,4)
ret

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

LLVM IR (-O2):
define void @flag_set(i32* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 64
%4 = sext i32 %3 to i64
%5 = and i32 %1, 63
%6 = zext i32 %5 to i64
%7 = shl nuw i64 1, %6
%8 = getelementptr inbounds i32, i32* %0, i64 %4
%9 = load i32, i32* %8
%10 = trunc i64 %7 to i32
%11 = or i32 %9, %10
store i32 %11, i32* %8
ret void
}
int tsize(int type) {
  if (type & 0x20)
    return 2;
  if (type & 0x10)
    return 1;
  switch (type & 0x0f) {
  default:
    return 0;
  case 1:
    return 0;
  case 2:
    return 1;
  case 3:
    return 2;
  case 4:
    return 4;
  }
}


x86 assembly (clang, -O0):
<tsize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     1122 <tsize+0x22>
movl   $0x2,-0x4(%rbp)
jmp    11a0 <tsize+0xa0>
mov    -0x8(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     113d <tsize+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    11a0 <tsize+0xa0>
mov    -0x8(%rbp),%eax
and    $0xf,%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     1169 <tsize+0x69>
mov    -0x10(%rbp),%rax
lea    0xea0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    11a0 <tsize+0xa0>
movl   $0x0,-0x4(%rbp)
jmp    11a0 <tsize+0xa0>
movl   $0x1,-0x4(%rbp)
jmp    11a0 <tsize+0xa0>
movl   $0x2,-0x4(%rbp)
jmp    11a0 <tsize+0xa0>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsize>:
mov    $0x2,%eax
test   $0x20,%dil
jne    1130 <tsize+0x30>
mov    $0x1,%eax
test   $0x10,%dil
jne    1130 <tsize+0x30>
and    $0xf,%edi
add    $0xfffffffe,%edi
xor    %eax,%eax
cmp    $0x2,%edi
ja     1130 <tsize+0x30>
movslq %edi,%rax
lea    0xed3(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @tsize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 32
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 2, i32* %2
br label %21
8: ; preds = %1
%9 = load i32, i32* %3
%10 = and i32 %9, 16
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %21
13: ; preds = %8
%14 = load i32, i32* %3
%15 = and i32 %14, 15
switch i32 %15, label %16 [
i32 1, label %17
i32 2, label %18
i32 3, label %19
i32 4, label %20
]
16: ; preds = %13
store i32 0, i32* %2
br label %21
17: ; preds = %13
store i32 0, i32* %2
br label %21
18: ; preds = %13
store i32 1, i32* %2
br label %21
19: ; preds = %13
store i32 2, i32* %2
br label %21
20: ; preds = %13
store i32 4, i32* %2
br label %21
21: ; preds = %20, %19, %18, %17, %16, %12, %7
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
@switch.table.tsize = [3 x i32] [i32 1, i32 2, i32 4]
define i32 @tsize(i32 %0) {
%2 = and i32 %0, 32
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %15
4: ; preds = %1
%5 = and i32 %0, 16
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = and i32 %0, 15
%9 = add nsw i32 %8, -2
%10 = icmp ult i32 %9, 3
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = sext i32 %9 to i64
%13 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.tsize, i64 0, i64 %12
%14 = load i32, i32* %13
br label %15
15: ; preds = %11, %7, %4, %1
%16 = phi i32 [ 2, %1 ], [ 1, %4 ], [ 0, %7 ], [ %14, %11 ]
ret i32 %16
}
void ff_hevc_put_hevc_epel_hv8_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_hv8_8_sse4() {
ret void
}
int NoSoundDrv_CD_Play(int track, int loop) { return 0; }


x86 assembly (clang, -O0):
<NoSoundDrv_CD_Play>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @NoSoundDrv_CD_Play(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @NoSoundDrv_CD_Play(i32 %0, i32 %1) {
ret i32 0
}
void semihost_init(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @dac_misconduct() {
ret void
}
int test_imm_7Aint32_reg(int val) { return ((val) & (0x7A << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_7Aint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x7a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Aint32_reg>:
test   $0x7a,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_7Aint32_reg(i32 %0) {
%2 = and i32 %0, 122
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
void *memalign(int, size_t);
int /*<<< orphan*/ memset(void *, char, size_t);
void *alloc1(size_t n1, size_t type) {
  void *p = memalign(32, n1 * type);
  memset((void *)p, '\0', n1 * type);
  return p;
}


x86 assembly (clang, -O0):
<alloc1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
imul   -0x10(%rbp),%rsi
mov    $0x20,%edi
call   1040 <memalign@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc1>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
imul   %rdi,%rbx
mov    $0x20,%edi
mov    %rbx,%rsi
call   1040 <memalign@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @alloc1(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %6, %7
%9 = call i8* @memalign(i32 32, i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = mul i64 %11, %12
%14 = call i32 @memset(i8* %10, i8 signext 0, i64 %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @alloc1(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call align 32 i8* @memalign(i32 32, i64 %3)
%5 = tail call i32 @memset(i8* %4, i8 signext 0, i64 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430InterruptP__Port26__default__fired();
void HplMsp430InterruptP__Port26__fired(void) {
  HplMsp430InterruptP__Port26__default__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplMsp430InterruptP__Port26__fired() {
%1 = tail call i32 (...) @HplMsp430InterruptP__Port26__default__fired()
ret void
}
void testClosureIDIrV(void (*closure)(int, double, int), int a1, double a2,
                      int a3) {
  (*closure)(a1, a2, a3);
}


x86 assembly (clang, -O0):
<testClosureIDIrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%esi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureIDIrV>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %edx,%esi
jmp    *%rax

LLVM IR (-O0):
define void @testClosureIDIrV(void (i32, double, i32)* %0, i32 %1, double %2, i32 %3) {
%5 = alloca void (i32, double, i32)*
%6 = alloca i32
%7 = alloca double
%8 = alloca i32
store void (i32, double, i32)* %0, void (i32, double, i32)** %5
store i32 %1, i32* %6
store double %2, double* %7
store i32 %3, i32* %8
%9 = load void (i32, double, i32)*, void (i32, double, i32)** %5
%10 = load i32, i32* %6
%11 = load double, double* %7
%12 = load i32, i32* %8
ret void
}

LLVM IR (-O2):
define void @testClosureIDIrV(void (i32, double, i32)* nocapture %0, i32 %1, double %2, i32 %3) {
tail call void %0(i32 %1, double %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("%d", 23);
  printf(" + ");
  printf("%d", 24);
  printf(" = 47");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x17,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x18,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c" + \00"
@.str.2 = [6 x i8] c" = 47\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 23)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 24)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c" + \00"
@.str.2 = [6 x i8] c" = 47\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 23)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 24)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
unsigned long long clear_lsb(unsigned long long mask) {
  return mask & (mask - 1);
}


x86 assembly (clang, -O0):
<clear_lsb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_lsb>:
lea    -0x1(%rdi),%rax
and    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @clear_lsb(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = sub i64 %4, 1
%6 = and i64 %3, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @clear_lsb(i64 %0) {
%2 = add i64 %0, -1
%3 = and i64 %2, %0
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int mkdir(const char *path, mode_t mode) { return 0; }


x86 assembly (clang, -O0):
<mkdir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mkdir(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @mkdir(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
struct rb3_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rb3_get_child(struct rb3_head *, int);
struct rb3_head *rb3_get_minmax_in_subtree(int /*<<< orphan*/, int);
extern struct rb3_head *rb3_get_prevnext_descendant(struct rb3_head *head,
                                                    int dir) {
  return rb3_get_minmax_in_subtree(rb3_get_child(head, dir), !dir);
}


x86 assembly (clang, -O0):
<rb3_get_prevnext_descendant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <rb3_get_child@plt>
mov    %eax,%edi
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
call   1030 <rb3_get_minmax_in_subtree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb3_get_prevnext_descendant>:
push   %rbx
mov    %esi,%ebx
call   1040 <rb3_get_child@plt>
xor    %esi,%esi
test   %ebx,%ebx
sete   %sil
mov    %eax,%edi
pop    %rbx
jmp    1030 <rb3_get_minmax_in_subtree@plt>

LLVM IR (-O0):
%struct.rb3_head = type { i32 }
define %struct.rb3_head* @rb3_get_prevnext_descendant(%struct.rb3_head* %0, i32 %1) {
%3 = alloca %struct.rb3_head*
%4 = alloca i32
store %struct.rb3_head* %0, %struct.rb3_head** %3
store i32 %1, i32* %4
%5 = load %struct.rb3_head*, %struct.rb3_head** %3
%6 = load i32, i32* %4
%7 = call i32 @rb3_get_child(%struct.rb3_head* %5, i32 %6)
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = call %struct.rb3_head* @rb3_get_minmax_in_subtree(i32 %7, i32 %11)
ret %struct.rb3_head* %12
}

LLVM IR (-O2):
%struct.rb3_head = type { i32 }
define %struct.rb3_head* @rb3_get_prevnext_descendant(%struct.rb3_head* %0, i32 %1) {
%3 = tail call i32 @rb3_get_child(%struct.rb3_head* %0, i32 %1)
%4 = icmp eq i32 %1, 0
%5 = zext i1 %4 to i32
%6 = tail call %struct.rb3_head* @rb3_get_minmax_in_subtree(i32 %3, i32 %5)
ret %struct.rb3_head* %6
}
/* Variables and functions */
int /*<<< orphan*/ ctest1(int *);
int /*<<< orphan*/ ctest2(int *);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int x;
  int y;
  int z;
  ctest1(&x);
  ctest2(&y);
  z = (x / y);
  printf("%d / %d = %d\n", x, y, z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <ctest1@plt>
lea    -0xc(%rbp),%rdi
call   1030 <ctest2@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1050 <ctest1@plt>
mov    %rsp,%rdi
call   1030 <ctest2@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%ecx
mov    %esi,%eax
cltd
idiv   %ecx
lea    0xeaa(%rip),%rdi
mov    %ecx,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"%d / %d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @ctest1(i32* %1)
%6 = call i32 @ctest2(i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = sdiv i32 %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ kputnum(int /*<<< orphan*/, int);
void kputdec(int32_t _num) { kputnum(_num, 10); }


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

x86 assembly (clang, -O2):
<kputdec>:
mov    $0xa,%esi
jmp    1030 <kputnum@plt>

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

LLVM IR (-O2):
define void @kputdec(i32 %0) {
%2 = tail call i32 @kputnum(i32 %0, i32 10)
ret void
}
/* Variables and functions */
int *dynCastOrNull(void *);
void testDynCastOrNull(void *p) {
  int *casted = dynCastOrNull(p);
  *casted = 1;
}


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

x86 assembly (clang, -O2):
<testDynCastOrNull>:
push   %rax
call   1030 <dynCastOrNull@plt>
movl   $0x1,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @testDynCastOrNull(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @dynCastOrNull(i8* %4)
store i32* %5, i32** %3
%6 = load i32*, i32** %3
store i32 1, i32* %6
ret void
}

LLVM IR (-O2):
define void @testDynCastOrNull(i8* %0) {
%2 = tail call i32* @dynCastOrNull(i8* %0)
store i32 1, i32* %2
ret void
}
long RB_GetAvailableFreeSpace(void *pbUserData, unsigned short *partition_name,
                              unsigned long *available_flash_size) {
  *available_flash_size = 0xefffffff;
  return 0;
}


x86 assembly (clang, -O0):
<RB_GetAvailableFreeSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xefffffff,%ecx
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RB_GetAvailableFreeSpace>:
mov    $0xefffffff,%eax
mov    %rax,(%rdx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @RB_GetAvailableFreeSpace(i8* %0, i16* %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i16*
%6 = alloca i64*
store i8* %0, i8** %4
store i16* %1, i16** %5
store i64* %2, i64** %6
%7 = load i64*, i64** %6
store i64 4026531839, i64* %7
ret i64 0
}

LLVM IR (-O2):
define i64 @RB_GetAvailableFreeSpace(i8* nocapture readnone %0, i16* nocapture readnone %1, i64* nocapture writeonly %2) {
store i64 4026531839, i64* %2
ret i64 0
}
int count_set_bits(int n) {
  int result = 0;
  while (n) {
    result += n & 1;
    n >>= 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<count_set_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <count_set_bits+0x32>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <count_set_bits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_set_bits>:
xor    %eax,%eax
test   %edi,%edi
je     1120 <count_set_bits+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <count_set_bits+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_set_bits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = ashr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}