xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fail_test(int);
scalar_t__ run(char *);
void test_semidiff() {
  do {
    if (run("test/progs/"
            "semidiff_basic.b"))
      fail_test(116);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "semidiff_types_err.b"))
      fail_test(117);
    ;
  } while (0);
}


x86 assembly (clang, -O0):
<test_semidiff>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test_semidiff+0x9>
lea    0xed0(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
je     1149 <test_semidiff+0x29>
mov    $0x74,%edi
call   1030 <fail_test@plt>
jmp    114e <test_semidiff+0x2e>
jmp    1153 <test_semidiff+0x33>
lea    0xec2(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    1173 <test_semidiff+0x53>
mov    $0x75,%edi
call   1030 <fail_test@plt>
jmp    1178 <test_semidiff+0x58>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_semidiff>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
je     113c <test_semidiff+0x1c>
mov    $0x74,%edi
call   1030 <fail_test@plt>
lea    0xed9(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
je     114f <test_semidiff+0x2f>
pop    %rax
ret
mov    $0x75,%edi
pop    %rax
jmp    1030 <fail_test@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"test/progs/semidiff_basic.b\00"
@.str.1 = [32 x i8] c"test/progs/semidiff_types_err.b\00"
define void @test_semidiff() {
br label %1
1: ; preds = %0
%2 = call i64 @run(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = call i32 @fail_test(i32 116)
br label %6
6: ; preds = %4, %1
br label %7
7: ; preds = %6
br label %8
8: ; preds = %7
%9 = call i64 @run(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = call i32 @fail_test(i32 117)
br label %13
13: ; preds = %11, %8
br label %14
14: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"test/progs/semidiff_basic.b\00"
@.str.1 = [32 x i8] c"test/progs/semidiff_types_err.b\00"
define void @test_semidiff() {
%1 = tail call i64 @run(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @fail_test(i32 116)
br label %5
5: ; preds = %3, %0
%6 = tail call i64 @run(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @fail_test(i32 117)
br label %10
10: ; preds = %5, %8
ret void
}
int __test_and_change_bit(int nr, volatile unsigned long *addr) {
  int oldbit;
  __asm__ __volatile__("btcl %2,%1\n\tsbbl %0,%0"
                       : "=r"(oldbit), "=m"((*(volatile long *)addr))
                       : "Ir"(nr)
                       : "memory");
  return oldbit;
}


x86 assembly (clang, -O0):
<__test_and_change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
btc    %ecx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_and_change_bit>:
btc    %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @__test_and_change_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i32, i32* %3
%8 = call i32 asm sideeffect "btcl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @__test_and_change_bit(i32 %0, i64* %1) {
%3 = tail call i32 asm sideeffect "btcl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int i;
int main() {
  char a;
  char b = a = 'a';
  assert(a == 'a');
  assert(b == 'a');
  int i = (long int)&i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x61,-0x1(%rbp)
movb   $0x61,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    -0x8(%rbp),%rax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@i = global i32 0
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i32
store i8 97, i8* %1
store i8 97, i8* %2
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 97
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 97
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = ptrtoint i32* %3 to i64
%15 = trunc i64 %14 to i32
store i32 %15, i32* %3
ret i32 0
}

LLVM IR (-O2):
@i = global i32 0
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
int test_imm_AFuint8_reg(unsigned char val) {
  return ((val) & (0xAF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_AFuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xaf,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_AFuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -81
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double floor(double);
double round_double(double d) {
  if (d >= 0.0)
    return (double)(int)(d + 0.5);
  else
    return -floor(-d);
}


x86 assembly (clang, -O0):
<round_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     114e <round_double+0x3e>
movsd  0xec9(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118b <round_double+0x7b>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <floor@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_double>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    1132 <round_double+0x22>
xorpd  0xeed(%rip),%xmm0
call   1030 <floor@plt>
xorpd  0xee0(%rip),%xmm0
pop    %rax
ret
addsd  0xec6(%rip),%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @round_double(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load double, double* %3
%8 = fadd double %7, 5.000000e-01
%9 = fptosi double %8 to i32
%10 = sitofp i32 %9 to double
store double %10, double* %2
br label %16
11: ; preds = %1
%12 = load double, double* %3
%13 = fneg double %12
%14 = call double @llvm.floor.f64(double %13)
%15 = fneg double %14
store double %15, double* %2
br label %16
16: ; preds = %11, %6
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @round_double(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = fadd double %0, 5.000000e-01
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to double
br label %11
7: ; preds = %1
%8 = fneg double %0
%9 = tail call double @llvm.floor.f64(double %8)
%10 = fneg double %9
br label %11
11: ; preds = %7, %3
%12 = phi double [ %6, %3 ], [ %10, %7 ]
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/, int /*<<< orphan*/);
int btk_version_main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  printf("Bitcoin Toolkit Version %d.%d.%d\n", 1, 0, 0);
  return 1;
}


x86 assembly (clang, -O0):
<btk_version_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"Bitcoin Toolkit Version %d.%d.%d\0A\00"
define i32 @btk_version_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 0)
ret i32 1
}

LLVM IR (-O2):
@.str = [34 x i8] c"Bitcoin Toolkit Version %d.%d.%d\0A\00"
define i32 @btk_version_main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ coop_finish();
void __attribute__((destructor)) dsm_main_finish(void) {
  coop_finish();
  return;
}


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

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

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @dsm_main_finish, i8* null }]
define void @dsm_main_finish() {
%1 = call i32 (...) @coop_finish()
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @dsm_main_finish, i8* null }]
define void @dsm_main_finish() {
%1 = tail call i32 (...) @coop_finish()
ret void
}
/* Variables and functions */
float cos(float x) { return (float)cos((double)x); }


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

x86 assembly (clang, -O2):
<cos>:
ucomiss 0xef9(%rip),%xmm0
jae    1120 <cos+0x20>
movss  0xef3(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    1120 <cos+0x20>
ret
nopw   0x0(%rax,%rax,1)
jmp    1120 <cos+0x20>

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

LLVM IR (-O2):
define float @cos(float %0) {
%2 = fcmp oeq float %0, 0xFFF0000000000000
%3 = fcmp oeq float %0, 0x7FF0000000000000
%4 = or i1 %3, %2
br i1 %4, label %5, label %6
5: ; preds = %1, %5
br label %5
6: ; preds = %1
ret float undef
}
int kthread_stop(struct task_struct *k) {
  int a;
  return a;
}


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define i32 @kthread_stop(%struct.task_struct* %0) {
%2 = alloca %struct.task_struct*
%3 = alloca i32
store %struct.task_struct* %0, %struct.task_struct** %2
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define i32 @kthread_stop(%struct.task_struct* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xd8() {
  Assert_real((isalpha(216) == 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_isalpha.c",
              1085, ("isalpha should be 0 for 0xd8"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xd8>:
push   %rax
mov    $0xd8,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x43d,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xd8\00"
define void @t_isalpha_0xd8() {
%1 = call i64 @isalpha(i32 216)
%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 1085, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xd8\00"
define void @t_isalpha_0xd8() {
%1 = tail call i64 @isalpha(i32 216)
%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 1085, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int main() {
  static void *array[] = {&&L1, &&L2, &&L3};
  int acc = 0;
L1:
  acc += 1;
  goto *array[1];
L2:
  acc += 2;
  goto *array[2];
L3:
  acc += 3;
  return acc - 6;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    0x2f16(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1155 <main+0x55>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    0x2f05(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1155 <main+0x55>
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x6,%eax
pop    %rbp
ret
mov    -0x10(%rbp),%rax
jmp    *%rax

x86 assembly (clang, -O2):
<main>:
lea    0x9(%rip),%rcx
mov    $0xfffffffe,%eax
jmp    *%rcx
xchg   %ax,%ax
add    $0x2,%eax
lea    0x2(%rip),%rcx
jmp    *%rcx
ret

LLVM IR (-O0):
@main.array = internal global [3 x i8*] [i8* blockaddress(@main, %3), i8* blockaddress(@main, %7), i8* blockaddress(@main, %11)]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %0, %16
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = load i8*, i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @main.array, i64 0, i64 1)
br label %16
7: ; preds = %16
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 2
store i32 %9, i32* %2
%10 = load i8*, i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @main.array, i64 0, i64 2)
br label %16
11: ; preds = %16
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 3
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = sub nsw i32 %14, 6
ret i32 %15
16: ; preds = %7, %3
%17 = phi i8* [ %6, %3 ], [ %10, %7 ]
indirectbr i8* %17, [label %3, label %7, label %11]
}

LLVM IR (-O2):
define i32 @main() {
br label %5
1: ; preds = %5
%2 = add nuw nsw i32 %6, 2
br label %5
3: ; preds = %5
%4 = add nsw i32 %6, -3
ret i32 %4
5: ; preds = %1, %0
%6 = phi i32 [ 1, %0 ], [ %2, %1 ]
%7 = phi i8* [ blockaddress(@main, %1), %0 ], [ blockaddress(@main, %3), %1 ]
indirectbr i8* %7, [label %3, label %1]
}
long long int llabs(const long long int j) { return (j < 0) ? -j : j; }


x86 assembly (clang, -O0):
<llabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <llabs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <llabs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llabs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @llabs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 0, %6
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @llabs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
void __set_bit(int nr, volatile unsigned long *addr) {
  __asm__("btsl %1,%0" : "+m"((*(volatile long *)addr)) : "Ir"(nr));
}


x86 assembly (clang, -O0):
<__set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
bts    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__set_bit>:
bts    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @__set_bit(i32 %0, i64* %1) {
tail call void asm "btsl $1,$0", "=*m,Ir,*m,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0, i64* elementtype(i64) %1)
ret void
}
auto_load_dll() {}


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

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

LLVM IR (-O0):
define i32 @auto_load_dll() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @auto_load_dll() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ NRF24_Disable();
int /*<<< orphan*/ NRF24_Enable();
void NRF24_CSN_Test(void) {
  NRF24_Enable();
  NRF24_Disable();
}


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

x86 assembly (clang, -O2):
<NRF24_CSN_Test>:
push   %rax
xor    %eax,%eax
call   1030 <NRF24_Enable@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <NRF24_Disable@plt>

LLVM IR (-O0):
define void @NRF24_CSN_Test() {
%1 = call i32 (...) @NRF24_Enable()
%2 = call i32 (...) @NRF24_Disable()
ret void
}

LLVM IR (-O2):
define void @NRF24_CSN_Test() {
%1 = tail call i32 (...) @NRF24_Enable()
%2 = tail call i32 (...) @NRF24_Disable()
ret void
}
/* Variables and functions */
float atof(char *);
int /*<<< orphan*/ free(char *);
float atof_del(char *data) {
  float ret = atof(data);
  free(data);
  return ret;
}


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

x86 assembly (clang, -O2):
<atof_del>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <atof@plt>
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <free@plt>
movss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @atof_del(i8* %0) {
%2 = alloca i8*
%3 = alloca float
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call float @atof(i8* %4)
store float %5, float* %3
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
%8 = load float, float* %3
ret float %8
}

LLVM IR (-O2):
define float @atof_del(i8* nocapture %0) {
%2 = tail call float @atof(i8* %0)
%3 = tail call i32 @free(i8* %0)
ret float %2
}
/* Variables and functions */
int read16(int);
void VIDEO_WaitVSync(void) {
  while (read16(((0xCC002000) + 0x2C)) >= 200)
    ;
  while (read16(((0xCC002000) + 0x2C)) < 200)
    ;
}


x86 assembly (clang, -O0):
<VIDEO_WaitVSync>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <VIDEO_WaitVSync+0x9>
mov    $0xcc00202c,%edi
call   1030 <read16@plt>
cmp    $0xc8,%eax
jl     1133 <VIDEO_WaitVSync+0x23>
jmp    1119 <VIDEO_WaitVSync+0x9>
jmp    1138 <VIDEO_WaitVSync+0x28>
mov    $0xcc00202c,%edi
call   1030 <read16@plt>
cmp    $0xc8,%eax
jge    1152 <VIDEO_WaitVSync+0x42>
jmp    1138 <VIDEO_WaitVSync+0x28>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIDEO_WaitVSync>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xcc00202c,%edi
call   1030 <read16@plt>
cmp    $0xc7,%eax
jg     1120 <VIDEO_WaitVSync+0x10>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xcc00202c,%edi
call   1030 <read16@plt>
cmp    $0xc8,%eax
jl     1140 <VIDEO_WaitVSync+0x30>
pop    %rax
ret

LLVM IR (-O0):
define void @VIDEO_WaitVSync() {
br label %1
1: ; preds = %4, %0
%2 = call i32 @read16(i32 -872406996)
%3 = icmp sge i32 %2, 200
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
br label %6
6: ; preds = %9, %5
%7 = call i32 @read16(i32 -872406996)
%8 = icmp slt i32 %7, 200
br i1 %8, label %9, label %10
9: ; preds = %6
br label %6
10: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @VIDEO_WaitVSync() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @read16(i32 -872406996)
%3 = icmp sgt i32 %2, 199
br i1 %3, label %1, label %4
4: ; preds = %1, %4
%5 = tail call i32 @read16(i32 -872406996)
%6 = icmp slt i32 %5, 200
br i1 %6, label %4, label %7
7: ; preds = %4
ret void
}
void tick_broadcast_oneshot_control(unsigned long reason) {}


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

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

LLVM IR (-O0):
define void @tick_broadcast_oneshot_control(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret void
}

LLVM IR (-O2):
define void @tick_broadcast_oneshot_control(i64 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int int16_t;

/* Variables and functions */
int INT16_MAX;
int INT16_MIN;
int /*<<< orphan*/ assert(int);
int vm_exec(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
            int /*<<< orphan*/ *);
int16_t vm_resolve(uint16_t opcode) {
  int o = vm_exec(&opcode, NULL, NULL, NULL);
  assert(o <= INT16_MAX);
  assert(o >= INT16_MIN);
  return o;
}


x86 assembly (clang, -O0):
<vm_resolve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1040 <vm_exec@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2e95(%rip),%rcx
cmp    (%rcx),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
mov    0x2e74(%rip),%rcx
cmp    (%rcx),%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vm_resolve>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <vm_exec@plt>
mov    %eax,%ebx
mov    0x2e9e(%rip),%rax
xor    %edi,%edi
cmp    (%rax),%ebx
setle  %dil
call   1030 <assert@plt>
mov    0x2e82(%rip),%rax
xor    %edi,%edi
cmp    (%rax),%ebx
setge  %dil
call   1030 <assert@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@INT16_MAX = global i32 0
@INT16_MIN = global i32 0
define i32 @vm_resolve(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @vm_exec(i32* %2, i32* null, i32* null, i32* null)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @INT16_MAX
%7 = icmp sle i32 %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %3
%11 = load i32, i32* @INT16_MIN
%12 = icmp sge i32 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@INT16_MAX = global i32 0
@INT16_MIN = global i32 0
define i32 @vm_resolve(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @vm_exec(i32* %2, i32* null, i32* null, i32* null)
%4 = load i32, i32* @INT16_MAX
%5 = icmp sle i32 %3, %4
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* @INT16_MIN
%9 = icmp sge i32 %3, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i32 %3
}
int (*foo(int a))(int) {
  int (*fptr)(int);
  return fptr;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i32 (i32)* @foo(i32 %0) {
ret i32 (i32)* undef
}
/* Variables and functions */
int /*<<< orphan*/ bar();
__attribute__((indirect_branch("thunk-extern"))) void foo(void) { bar(); }


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

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

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

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 (...) @bar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: tcopy [-cvx] [-s maxblk] [src [dest]]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"usage: tcopy [-cvx] [-s maxblk] [src [dest]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"usage: tcopy [-cvx] [-s maxblk] [src [dest]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
const char *pixman_version_string(void) { return "PIXMAN NOT AVAILABLE"; }


x86 assembly (clang, -O0):
<pixman_version_string>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixman_version_string>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"PIXMAN NOT AVAILABLE\00"
define i8* @pixman_version_string() {
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [21 x i8] c"PIXMAN NOT AVAILABLE\00"
define i8* @pixman_version_string() {
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)
}
int mkdir(char *path, int permissions) { 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
}
/* Variables and functions */
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
int isActRef(char *string) {
  return strlen(string) > 8 && (strncmp(string, "act(", 4) == 0);
}


x86 assembly (clang, -O0):
<isActRef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x8,%ecx
mov    %al,-0x9(%rbp)
jle    1164 <isActRef+0x44>
mov    -0x8(%rbp),%rdi
lea    0xeb0(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
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):
<isActRef>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x9,%ecx
jl     1151 <isActRef+0x31>
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"act(\00"
define i32 @isActRef(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = icmp sgt i32 %4, 8
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%9 = icmp eq i64 %8, 0
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):
@.str = [5 x i8] c"act(\00"
define i32 @isActRef(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 8
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ std_err(char *);
usage() {
  std_err("Usage: recover file ...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <std_err@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <std_err@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Usage: recover file ...\0A\00"
define i32 @usage() {
%1 = call i32 @std_err(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"Usage: recover file ...\0A\00"
define i32 @usage() {
%1 = tail call i32 @std_err(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_F8int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xF8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F8int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0xf8,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F8int64_highword_mem>:
testb  $0xf8,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F8int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1065151889408
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void gtk_radio_menu_item_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_radio_menu_item_get_type() {
ret void
}
int test_imm_92int32_reg(int val) { return ((val) & (0x92 << 0)) ? -20 : -40; }


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

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

LLVM IR (-O0):
define i32 @test_imm_92int32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 146
%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_92int32_reg(i32 %0) {
%2 = and i32 %0, 146
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int axi_stream_counter(int *counter) {
  static int counterValue = 0;
  counterValue++;
  *counter = counterValue;
  return 0;
}


x86 assembly (clang, -O0):
<axi_stream_counter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2f16(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f0d(%rip)
mov    0x2f07(%rip),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<axi_stream_counter>:
mov    0x2f1e(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f15(%rip)
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
@axi_stream_counter.counterValue = internal global i32 0
define i32 @axi_stream_counter(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @axi_stream_counter.counterValue
%4 = add nsw i32 %3, 1
store i32 %4, i32* @axi_stream_counter.counterValue
%5 = load i32, i32* @axi_stream_counter.counterValue
%6 = load i32*, i32** %2
store i32 %5, i32* %6
ret i32 0
}

LLVM IR (-O2):
@axi_stream_counter.counterValue = internal unnamed_addr global i32 0
define i32 @axi_stream_counter(i32* nocapture writeonly %0) {
%2 = load i32, i32* @axi_stream_counter.counterValue
%3 = add nsw i32 %2, 1
store i32 %3, i32* @axi_stream_counter.counterValue
store i32 %3, i32* %0
ret i32 0
}
void foo_1_2_2_1_2_1_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_1_2_1_2_1_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_string(int, char const *);
void print_spew(const char *str) { __console_tx_string(8, str); }


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

x86 assembly (clang, -O2):
<print_spew>:
mov    %rdi,%rsi
mov    $0x8,%edi
jmp    1030 <__console_tx_string@plt>

LLVM IR (-O0):
define void @print_spew(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @__console_tx_string(i32 8, i8* %3)
ret void
}

LLVM IR (-O2):
define void @print_spew(i8* %0) {
%2 = tail call i32 @__console_tx_string(i32 8, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i;
  for (i = 0; i < 509; i++) {
    printf("90 ");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1fd,-0x8(%rbp)
jge    114d <main+0x3d>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1fd,%ebp
lea    0xee1(%rip),%rbx
nop
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"90 \00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 509
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("Usage:  raw_extract --pal <palette-file>\n");
  printf("\n");
  printf("The input file is the standard input, the output file the standard "
         "output.\n");
}


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

x86 assembly (clang, -O2):
<print_help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeeb(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Usage: raw_extract --pal <palette-file>\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [76 x i8] c"The input file is the standard input, the output file the standard output.\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [41 x i8] c"Usage: raw_extract --pal <palette-file>\00"
@str.3 = [75 x i8] c"The input file is the standard input, the output file the standard output.\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ fact(int);
double perm(int, int);
double comb(int n, int r) { return perm(n, r) / ((double)fact(r)); }


x86 assembly (clang, -O0):
<comb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <perm@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fact@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comb>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
call   1040 <perm@plt>
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
call   1030 <fact@plt>
cvtsi2sd %rax,%xmm1
movsd  0x8(%rsp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @comb(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call double @perm(i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = call i64 @fact(i32 %8)
%10 = sitofp i64 %9 to double
%11 = fdiv double %7, %10
ret double %11
}

LLVM IR (-O2):
define double @comb(i32 %0, i32 %1) {
%3 = tail call double @perm(i32 %0, i32 %1)
%4 = tail call i64 @fact(i32 %1)
%5 = sitofp i64 %4 to double
%6 = fdiv double %3, %5
ret double %6
}
execle(file, args) char *file;
char *args;
{
  register char **p;
  p = &args;
  while (*p++)
    ;
  return (execve(file, &args, *p));
}


x86 assembly (clang, -O0):
<execle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
cmpq   $0x0,(%rax)
je     1146 <execle+0x36>
jmp    1128 <execle+0x18>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <execve@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execle>:
push   %rax
mov    %rsi,(%rsp)
lea    0x10(%rsp),%rax
xor    %ecx,%ecx
test   %cl,%cl
je     1130 <execle+0x20>
mov    %rax,%rcx
jmp    113d <execle+0x2d>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x8(%rax),%rcx
cmpq   $0x0,(%rax)
mov    %rcx,%rax
jne    1130 <execle+0x20>
mov    (%rcx),%rdx
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <execve@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @execle(i8* %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = icmp ne i8* %1, null
%5 = getelementptr inbounds i8*, i8** %3, i64 2
br i1 undef, label %11, label %6
6: ; preds = %2, %6
%7 = phi i8** [ %9, %6 ], [ %5, %2 ]
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %7, i64 1
%10 = icmp eq i8* %8, null
br i1 %10, label %11, label %6
11: ; preds = %6, %2
%12 = phi i8** [ %5, %2 ], [ %9, %6 ]
%13 = load i8*, i8** %12
%14 = call i32 (i8*, i8**, i8*, ...) bitcast (i32 (...)* @execve to i32 (i8*, i8**, i8*, ...)*)(i8* %0, i8** %3, i8* %13)
ret i32 %14
}
/* Variables and functions */
unsigned long ULONG_MAX;
unsigned long getfree(char *path) { return ULONG_MAX; }


x86 assembly (clang, -O0):
<getfree>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfree>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@ULONG_MAX = global i64 0
define i64 @getfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @ULONG_MAX
ret i64 %3
}

LLVM IR (-O2):
@ULONG_MAX = global i64 0
define i64 @getfree(i8* nocapture readnone %0) {
%2 = load i64, i64* @ULONG_MAX
ret i64 %2
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint64_t __SMLSLD(uint32_t x, uint32_t y,
                                           uint64_t sum) {
  return ((uint64_t)(((((int32_t)x << 16) >> 16) * (((int32_t)y << 16) >> 16)) -
                     ((((int32_t)x) >> 16) * (((int32_t)y) >> 16)) +
                     (((uint64_t)sum))));
}


x86 assembly (clang, -O0):
<__SMLSLD>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x10,%eax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
shl    $0x10,%ecx
sar    $0x10,%ecx
imul   %ecx,%eax
mov    -0x8(%rbp),%rcx
sar    $0x10,%ecx
mov    -0x10(%rbp),%rdx
sar    $0x10,%edx
imul   %edx,%ecx
sub    %ecx,%eax
add    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__SMLSLD>:
movswl %di,%ecx
movswl %si,%eax
imul   %ecx,%eax
sar    $0x10,%edi
sar    $0x10,%esi
imul   %edi,%esi
sub    %esi,%edx
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @__SMLSLD(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 16
%10 = ashr i32 %9, 16
%11 = load i64, i64* %5
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 16
%14 = ashr i32 %13, 16
%15 = mul nsw i32 %10, %14
%16 = load i64, i64* %4
%17 = trunc i64 %16 to i32
%18 = ashr i32 %17, 16
%19 = load i64, i64* %5
%20 = trunc i64 %19 to i32
%21 = ashr i32 %20, 16
%22 = mul nsw i32 %18, %21
%23 = sub nsw i32 %15, %22
%24 = load i32, i32* %6
%25 = add nsw i32 %23, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @__SMLSLD(i64 %0, i64 %1, i32 %2) {
%4 = trunc i64 %0 to i32
%5 = shl i32 %4, 16
%6 = ashr exact i32 %5, 16
%7 = trunc i64 %1 to i32
%8 = shl i32 %7, 16
%9 = ashr exact i32 %8, 16
%10 = mul nsw i32 %9, %6
%11 = ashr i32 %4, 16
%12 = ashr i32 %7, 16
%13 = mul nsw i32 %12, %11
%14 = sub i32 %2, %13
%15 = add i32 %14, %10
ret i32 %15
}
unsigned xrop3_243_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = ~S;
  stk1 = T | stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_243_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_243_0_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
mov    %eax,%edx
not    %edx
or     %esi,%edx
xor    %edx,%eax
and    %ecx,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_243_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %6
%23 = xor i32 %22, -1
store i32 %23, i32* %9
%24 = load i32, i32* %7
%25 = load i32, i32* %9
%26 = or i32 %24, %25
store i32 %26, i32* %8
%27 = load i32, i32* %8
%28 = load i32, i32* %6
%29 = and i32 %27, %28
%30 = load i32, i32* %8
%31 = load i32, i32* %7
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = or i32 %29, %33
%35 = load i32, i32* %7
%36 = load i32, i32* %6
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = load i32, i32* %5
%40 = and i32 %38, %39
%41 = or i32 %34, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @xrop3_243_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -1
%8 = and i32 %6, %4
%9 = xor i32 %6, -1
%10 = or i32 %9, %5
%11 = and i32 %10, %7
%12 = or i32 %11, %8
ret i32 %12
}