xunge/DecIR huggingface dataset:
/* Variables and functions */
int highest(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);
  printf("%d eh o maior\n", highest(highest(a, b), c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <highest@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%esi
call   1030 <highest@plt>
mov    %eax,%esi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
call   1030 <highest@plt>
mov    0xc(%rsp),%esi
mov    %eax,%edi
call   1030 <highest@plt>
lea    0xe9b(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [15 x i8] c"%d eh o maior\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 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @highest(i32 %6, i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @highest(i32 %8, i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [15 x i8] c"%d eh o maior\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 @highest(i32 %8, i32 %9)
%11 = load i32, i32* %3
%12 = call i32 @highest(i32 %10, i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ user_itoa(int, char *);
void main() {
  int n;
  char str[20];
  printf("Input number:");
  scanf("%d", &n);
  user_itoa(n, str);
  printf("\nString str=%s\n", str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1050 <user_itoa@plt>
lea    -0x20(%rbp),%rsi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <user_itoa@plt>
lea    0xea5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Input number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"\0AString str=%s\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = call i32 @user_itoa(i32 %5, i8* %6)
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Input number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"\0AString str=%s\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = call i32 @user_itoa(i32 %7, i8* %4)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %4)
ret void
}
float fastMap(long x, long in_min, long in_max, long out_min, long out_max) {
  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}


x86 assembly (clang, -O0):
<fastMap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    -0x20(%rbp),%rcx
imul   %rcx,%rax
mov    -0x18(%rbp),%rcx
sub    -0x10(%rbp),%rcx
cqto
idiv   %rcx
add    -0x20(%rbp),%rax
cvtsi2ss %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastMap>:
mov    %r8,%rax
mov    %rdx,%r8
sub    %rsi,%rdi
sub    %rcx,%rax
imul   %rdi,%rax
sub    %rsi,%r8
mov    %rax,%rdx
or     %r8,%rdx
shr    $0x20,%rdx
je     1126 <fastMap+0x26>
cqto
idiv   %r8
jmp    112b <fastMap+0x2b>
xor    %edx,%edx
div    %r8d
add    %rcx,%rax
cvtsi2ss %rax,%xmm0
ret

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

LLVM IR (-O2):
define float @fastMap(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = sub nsw i64 %0, %1
%7 = sub nsw i64 %4, %3
%8 = mul nsw i64 %7, %6
%9 = sub nsw i64 %2, %1
%10 = sdiv i64 %8, %9
%11 = add nsw i64 %10, %3
%12 = sitofp i64 %11 to float
ret float %12
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int intcelcon_number_of_cells(int *length) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(743, length, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<intcelcon_number_of_cells>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2e7,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcelcon_number_of_cells>:
mov    %rdi,%rsi
mov    $0x2e7,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @intcelcon_number_of_cells(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc4c(i32 743, i32* %6, i32* %7, double* %8, i32 0)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @intcelcon_number_of_cells(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 743, i32* %0, i32* undef, double* undef, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ A();
void simple_for_test(void) {
  int i;
  for (i = 0; i < 10; i++) {
    A();
  }
}


x86 assembly (clang, -O0):
<simple_for_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    113e <simple_for_test+0x2e>
mov    $0x0,%al
call   1030 <A@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <simple_for_test+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_for_test>:
push   %rax
xor    %eax,%eax
call   1030 <A@plt>
xor    %eax,%eax
call   1030 <A@plt>
xor    %eax,%eax
call   1030 <A@plt>
xor    %eax,%eax
call   1030 <A@plt>
xor    %eax,%eax
call   1030 <A@plt>
xor    %eax,%eax
call   1030 <A@plt>
xor    %eax,%eax
call   1030 <A@plt>
xor    %eax,%eax
call   1030 <A@plt>
xor    %eax,%eax
call   1030 <A@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <A@plt>

LLVM IR (-O0):
define void @simple_for_test() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 (...) @A()
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @simple_for_test() {
%1 = tail call i32 (...) @A()
%2 = tail call i32 (...) @A()
%3 = tail call i32 (...) @A()
%4 = tail call i32 (...) @A()
%5 = tail call i32 (...) @A()
%6 = tail call i32 (...) @A()
%7 = tail call i32 (...) @A()
%8 = tail call i32 (...) @A()
%9 = tail call i32 (...) @A()
%10 = tail call i32 (...) @A()
ret void
}
void __ctest_ctest_dummy_nop1_run(void) {}


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

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

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

LLVM IR (-O2):
define void @__ctest_ctest_dummy_nop1_run() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void introduction() {
  printf("\t\t***%c%c PEBBLE DROPPING GAME %c%c***\n\n\n", 1, 1, 1, 1);
  printf("## You can play against computer or human.\n");
  printf("## You have to drop pebble in the columns.\n");
  printf("## Every player will get chance by turns.\n\n");
  return;
}


x86 assembly (clang, -O0):
<introduction>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%r8d
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<introduction>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"\09\09***%c%c PEBBLE DROPPING GAME %c%c***\0A\0A\0A\00"
@.str.1 = [44 x i8] c"## You can play against computer or human.\0A\00"
@.str.2 = [44 x i8] c"## You have to drop pebble in the columns.\0A\00"
@.str.3 = [44 x i8] c"## Every player will get chance by turns.\0A\0A\00"
define void @introduction() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 1, i32 1)
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"\09\09***%c%c PEBBLE DROPPING GAME %c%c***\0A\0A\0A\00"
@str = [43 x i8] c"## You can play against computer or human.\00"
@str.4 = [43 x i8] c"## You have to drop pebble in the columns.\00"
@str.5 = [43 x i8] c"## Every player will get chance by turns.\0A\00"
define void @introduction() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 1, i32 1)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.5, i64 0, i64 0))
ret void
}
void HibernateLowBatSet(unsigned long ulLowBatFlags) {

  ;
  (*((volatile unsigned long *)(0x400FC010))) =
      (ulLowBatFlags | ((*((volatile unsigned long *)(0x400FC010))) & ~0xA0));
}


x86 assembly (clang, -O0):
<HibernateLowBatSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400fc010,%eax
mov    (%rax),%rax
and    $0xffffffffffffff5f,%rax
or     %rax,%rcx
mov    $0x400fc010,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateLowBatSet>:
mov    $0xffffffffffffff5f,%rax
and    0x400fc010,%rax
40
or     %rdi,%rax
mov    %rax,0x400fc010
40
ret

LLVM IR (-O0):
define void @HibernateLowBatSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%5 = and i64 %4, -161
%6 = or i64 %3, %5
store volatile i64 %6, i64* inttoptr (i64 1074774032 to i64*)
ret void
}

LLVM IR (-O2):
define void @HibernateLowBatSet(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%3 = and i64 %2, -161
%4 = or i64 %3, %0
store volatile i64 %4, i64* inttoptr (i64 1074774032 to i64*)
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ catalanDP(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int i;
  int count = atoi(argv[1]) + 1;
  for (i = 0; i < count; i++)
    printf("%ld ", catalanDP(i));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1190 <main+0x60>
mov    -0x14(%rbp),%edi
call   1050 <catalanDP@plt>
mov    %eax,%esi
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1160 <main+0x30>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
test   %eax,%eax
js     1168 <main+0x38>
mov    %eax,%ebx
add    $0x1,%ebx
xor    %ebp,%ebp
lea    0xeb1(%rip),%r14
nop
mov    %ebp,%edi
call   1050 <catalanDP@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%ld \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
%12 = add nsw i32 %11, 1
store i32 %12, i32* %7
store i32 0, i32* %6
br label %13
13: ; preds = %21, %2
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %24
17: ; preds = %13
%18 = load i32, i32* %6
%19 = call i32 @catalanDP(i32 %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %17
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %13
24: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = icmp slt i32 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %2, %7
%8 = phi i32 [ %11, %7 ], [ 0, %2 ]
%9 = tail call i32 @catalanDP(i32 %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw i32 %8, 1
%12 = icmp eq i32 %8, %5
br i1 %12, label %13, label %7
13: ; preds = %7, %2
ret i32 0
}
void XSyncInitialize() {}


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

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

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

LLVM IR (-O2):
define void @XSyncInitialize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void msg_err(char *msg) { printf("%s\n", (msg)); }


x86 assembly (clang, -O0):
<msg_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_err>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @msg_err(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rdtscp(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ u32_to_64(int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((__unused__, __always___)) __attribute__((__artificial__))
uint64_t
rdtscpl() {
  uint32_t high, low;
  rdtscp(&low, &high);
  return u32_to_64(low, high);
}


x86 assembly (clang, -O0):
<rdtscpl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <rdtscp@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <u32_to_64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtscpl>:
push   %rax
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
call   1040 <rdtscp@plt>
mov    (%rsp),%edi
mov    0x4(%rsp),%esi
call   1030 <u32_to_64@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rdtscpl() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @rdtscp(i32* %2, i32* %1)
%4 = load i32, i32* %2
%5 = load i32, i32* %1
%6 = call i32 @u32_to_64(i32 %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @rdtscpl() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @rdtscp(i32* %2, i32* %1)
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = call i32 @u32_to_64(i32 %6, i32 %7)
ret i32 %8
}
unsigned long complementBit_fun_ulong(unsigned long x, unsigned i) {
  return x ^ 1 << i;
}


x86 assembly (clang, -O0):
<complementBit_fun_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
xor    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<complementBit_fun_ulong>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
xor    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @complementBit_fun_ulong(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = sext i32 %7 to i64
%9 = xor i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @complementBit_fun_ulong(i64 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = sext i32 %3 to i64
%5 = xor i64 %4, %0
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ sum_n(int);
int /*<<< orphan*/ sum_n_reccursive(int /*<<< orphan*/, int /*<<< orphan*/,
                                    int);
int main() {
  sum_n_reccursive(0, 0, 60000);
  sum_n(60000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %esi,%esi
mov    $0xea60,%edx
mov    %esi,%edi
call   1030 <sum_n_reccursive@plt>
mov    $0xea60,%edi
call   1040 <sum_n@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
mov    $0xea60,%edx
call   1030 <sum_n_reccursive@plt>
mov    $0xea60,%edi
call   1040 <sum_n@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sum_n_reccursive(i32 0, i32 0, i32 60000)
%3 = call i32 @sum_n(i32 60000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sum_n_reccursive(i32 0, i32 0, i32 60000)
%2 = tail call i32 @sum_n(i32 60000)
ret i32 0
}
/* Variables and functions */
double __ocml_sub_rtp_f64(double, double);
double __dsub_rd(double x, double y) { return __ocml_sub_rtp_f64(x, y); }


x86 assembly (clang, -O0):
<__dsub_rd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__ocml_sub_rtp_f64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dsub_rd>:
jmp    1030 <__ocml_sub_rtp_f64@plt>

LLVM IR (-O0):
define double @__dsub_rd(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @__ocml_sub_rtp_f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @__dsub_rd(double %0, double %1) {
%3 = tail call double @__ocml_sub_rtp_f64(double %0, double %1)
ret double %3
}
/* Variables and functions */
unsigned int *malloc(size_t);
int /*<<< orphan*/ memcpy(unsigned int *, unsigned int const *, size_t);
unsigned int *ziudup(unsigned int const *src, size_t len) {
  unsigned int *p = malloc(len * sizeof(unsigned int));
  memcpy(p, src, len * sizeof(unsigned int));
  return p;
}


x86 assembly (clang, -O0):
<ziudup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
shl    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
shl    $0x2,%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ziudup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0x0(,%rsi,4),%r15
mov    %r15,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32* @ziudup(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 = mul i64 %6, 4
%8 = call i32* @malloc(i64 %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = load i32*, i32** %3
%11 = load i64, i64* %4
%12 = mul i64 %11, 4
%13 = call i32 @memcpy(i32* %9, i32* %10, i64 %12)
%14 = load i32*, i32** %5
ret i32* %14
}

LLVM IR (-O2):
define i32* @ziudup(i32* %0, i64 %1) {
%3 = shl i64 %1, 2
%4 = tail call i32* @malloc(i64 %3)
%5 = tail call i32 @memcpy(i32* %4, i32* %0, i64 %3)
ret i32* %4
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf21(int f, int n) { return (cbuf(f, n, 21)); }


x86 assembly (clang, -O0):
<cbuf21>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x15,%edx
call   1030 <cbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf21>:
mov    $0x15,%edx
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf21(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 i32 @cbuf(i32 %5, i32 %6, i32 21)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf21(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 21)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void sigint_handler(int signo) {
  printf("Entering SIGINT handler ...\n");
  sleep(10);
  printf("Exiting SIGINT handler ...\n");
}


x86 assembly (clang, -O0):
<sigint_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <sleep@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c"Entering SIGINT handler ...\0A\00"
@.str.1 = [28 x i8] c"Exiting SIGINT handler ...\0A\00"
define void @sigint_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep(i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"Entering SIGINT handler ...\00"
@str.2 = [27 x i8] c"Exiting SIGINT handler ...\00"
define void @sigint_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.2, i64 0, i64 0))
ret void
}
float test_scalblnf(float x, int y) { return __builtin_scalblnf(x, y); }


x86 assembly (clang, -O0):
<test_scalblnf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movslq -0x8(%rbp),%rdi
call   1030 <scalblnf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_scalblnf>:
movslq %edi,%rdi
jmp    1030 <scalblnf@plt>

LLVM IR (-O0):
define float @test_scalblnf(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = call float @scalblnf(float %5, i64 %7)
ret float %8
}

LLVM IR (-O2):
define float @test_scalblnf(float %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = tail call float @scalblnf(float %0, i64 %3)
ret float %4
}
/* Variables and functions */
int abs(int);
int calc_diff_angle(int x, int y) {
  int diff;
  diff = abs(x - y);
  if (diff > 1800)
    return (abs(diff - 3600));
  else
    return (diff);
}


x86 assembly (clang, -O0):
<calc_diff_angle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x708,-0x10(%rbp)
jle    114f <calc_diff_angle+0x3f>
mov    -0x10(%rbp),%edi
sub    $0xe10,%edi
call   1030 <abs@plt>
mov    %eax,-0x4(%rbp)
jmp    1155 <calc_diff_angle+0x45>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_diff_angle>:
sub    %esi,%edi
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
lea    -0xe10(%rcx),%edx
neg    %edx
mov    %ecx,%eax
sub    $0xe10,%eax
cmovb  %edx,%eax
cmp    $0x709,%ecx
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @calc_diff_angle(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = sub nsw i32 %7, %8
%10 = call i32 @abs(i32 %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp sgt i32 %11, 1800
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i32, i32* %6
%15 = sub nsw i32 %14, 3600
%16 = call i32 @abs(i32 %15)
store i32 %16, i32* %3
br label %19
17: ; preds = %2
%18 = load i32, i32* %6
store i32 %18, i32* %3
br label %19
19: ; preds = %17, %13
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @calc_diff_angle(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = tail call i32 @llvm.abs.i32(i32 %3, i1 true)
%5 = icmp ugt i32 %4, 1800
%6 = add nsw i32 %4, -3600
%7 = icmp ult i32 %4, 3600
%8 = sub nsw i32 3600, %4
%9 = select i1 %7, i32 %8, i32 %6
%10 = select i1 %5, i32 %9, i32 %4
ret i32 %10
}
void print_users_in_room() {}


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

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

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

LLVM IR (-O2):
define void @print_users_in_room() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ internal_print_distances(int);
int /*<<< orphan*/ internal_print_hline(int);
int /*<<< orphan*/ internal_print_numbers(int);
int /*<<< orphan*/ internal_print_via(int);
void internal_print_rtab(int size) {
  internal_print_hline(size);
  internal_print_numbers(size);
  internal_print_hline(size);
  internal_print_distances(size);
  internal_print_via(size);
}


x86 assembly (clang, -O0):
<internal_print_rtab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <internal_print_hline@plt>
mov    -0x4(%rbp),%edi
call   1050 <internal_print_numbers@plt>
mov    -0x4(%rbp),%edi
call   1030 <internal_print_hline@plt>
mov    -0x4(%rbp),%edi
call   1060 <internal_print_distances@plt>
mov    -0x4(%rbp),%edi
call   1040 <internal_print_via@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_print_rtab>:
push   %rbx
mov    %edi,%ebx
call   1030 <internal_print_hline@plt>
mov    %ebx,%edi
call   1050 <internal_print_numbers@plt>
mov    %ebx,%edi
call   1030 <internal_print_hline@plt>
mov    %ebx,%edi
call   1060 <internal_print_distances@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <internal_print_via@plt>

LLVM IR (-O0):
define void @internal_print_rtab(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @internal_print_hline(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @internal_print_numbers(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @internal_print_hline(i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @internal_print_distances(i32 %9)
%11 = load i32, i32* %2
%12 = call i32 @internal_print_via(i32 %11)
ret void
}

LLVM IR (-O2):
define void @internal_print_rtab(i32 %0) {
%2 = tail call i32 @internal_print_hline(i32 %0)
%3 = tail call i32 @internal_print_numbers(i32 %0)
%4 = tail call i32 @internal_print_hline(i32 %0)
%5 = tail call i32 @internal_print_distances(i32 %0)
%6 = tail call i32 @internal_print_via(i32 %0)
ret void
}
/* Variables and functions */
int mprotect(void *, int, int);
int libbf_mprotect(void *ptr, int size, int protFlags) {
  return mprotect(ptr, size, protFlags);
}


x86 assembly (clang, -O0):
<libbf_mprotect>:
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 <mprotect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libbf_mprotect>:
jmp    1030 <mprotect@plt>

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

LLVM IR (-O2):
define i32 @libbf_mprotect(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @mprotect(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
void host_notify_dev_unregister(struct host_notify_dev *ndev) {}


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

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

LLVM IR (-O0):
%struct.host_notify_dev = type opaque
define void @host_notify_dev_unregister(%struct.host_notify_dev* %0) {
%2 = alloca %struct.host_notify_dev*
store %struct.host_notify_dev* %0, %struct.host_notify_dev** %2
ret void
}

LLVM IR (-O2):
%struct.host_notify_dev = type opaque
define void @host_notify_dev_unregister(%struct.host_notify_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x17_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x17_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x17_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x17_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x17_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ line;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
void pathfinding(FILE *piece) {
  char line[999];
  while (fgets(line, sizeof(line), piece)) {
    printf("%s", line);
  }
}


x86 assembly (clang, -O0):
<pathfinding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x3e7,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     1166 <pathfinding+0x46>
lea    -0x3f0(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <pathfinding+0xf>
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathfinding>:
push   %r15
push   %r14
push   %rbx
sub    $0x3f0,%rsp
mov    %rdi,%r15
mov    %rsp,%rdi
mov    $0x3e7,%esi
mov    %r15,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
je     1170 <pathfinding+0x50>
lea    0xeb5(%rip),%r14
mov    %rsp,%rbx
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e7,%esi
mov    %r15,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
jne    1150 <pathfinding+0x30>
add    $0x3f0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @pathfinding(i32* nocapture %0) {
%2 = alloca [999 x i8]
%3 = getelementptr inbounds [999 x i8], [999 x i8]* %2, i64 0, i64 0
%4 = call i64 @fgets(i8* %3, i32 999, i32* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1, %6
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%8 = call i64 @fgets(i8* %3, i32 999, i32* %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %6
10: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ COLOR_BLACK;
int /*<<< orphan*/ COLOR_GREEN;
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ wbkgd(int /*<<< orphan*/, int /*<<< orphan*/);
void initWindow() {
  init_pair(1, COLOR_GREEN, COLOR_BLACK);
  wbkgd(stdscr, COLOR_PAIR(1));
  curs_set(0);
  refresh();
}


x86 assembly (clang, -O0):
<initWindow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e79(%rip),%rax
mov    (%rax),%esi
mov    0x2e78(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1030 <init_pair@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
call   1050 <COLOR_PAIR@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
call   1040 <wbkgd@plt>
xor    %edi,%edi
call   1070 <curs_set@plt>
mov    $0x0,%al
call   1060 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initWindow>:
push   %rbx
mov    0x2e80(%rip),%rax
mov    (%rax),%esi
mov    0x2e7f(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1030 <init_pair@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%ebx
mov    $0x1,%edi
call   1050 <COLOR_PAIR@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <wbkgd@plt>
xor    %edi,%edi
call   1070 <curs_set@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <refresh@plt>

LLVM IR (-O0):
@COLOR_GREEN = global i32 0
@COLOR_BLACK = global i32 0
@stdscr = global i32 0
define void @initWindow() {
%1 = load i32, i32* @COLOR_GREEN
%2 = load i32, i32* @COLOR_BLACK
%3 = call i32 @init_pair(i32 1, i32 %1, i32 %2)
%4 = load i32, i32* @stdscr
%5 = call i32 @COLOR_PAIR(i32 1)
%6 = call i32 @wbkgd(i32 %4, i32 %5)
%7 = call i32 @curs_set(i32 0)
%8 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@COLOR_GREEN = global i32 0
@COLOR_BLACK = global i32 0
@stdscr = global i32 0
define void @initWindow() {
%1 = load i32, i32* @COLOR_GREEN
%2 = load i32, i32* @COLOR_BLACK
%3 = tail call i32 @init_pair(i32 1, i32 %1, i32 %2)
%4 = load i32, i32* @stdscr
%5 = tail call i32 @COLOR_PAIR(i32 1)
%6 = tail call i32 @wbkgd(i32 %4, i32 %5)
%7 = tail call i32 @curs_set(i32 0)
%8 = tail call i32 (...) @refresh()
ret void
}
/* Variables and functions */
void *malloc(int);
void *st_alloc(int size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<st_alloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @st_alloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ get_opt(int, char **);
int /*<<< orphan*/ modify_flags();
int /*<<< orphan*/ use_flags();
int main(int argc, char **argv) {
  get_opt(argc, argv);
  modify_flags();
  use_flags();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <get_opt@plt>
mov    $0x0,%al
call   1040 <modify_flags@plt>
mov    $0x0,%al
call   1030 <use_flags@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1050 <get_opt@plt>
xor    %eax,%eax
call   1040 <modify_flags@plt>
xor    %eax,%eax
call   1030 <use_flags@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @get_opt(i32 %6, i8** %7)
%9 = call i32 (...) @modify_flags()
%10 = call i32 (...) @use_flags()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @get_opt(i32 %0, i8** %1)
%4 = tail call i32 (...) @modify_flags()
%5 = tail call i32 (...) @use_flags()
ret i32 0
}
/* Type definitions */
typedef int state;
typedef int control_id;

/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void BatchSetButtonValue(unsigned short int control_id, unsigned char state) {
  SendChar(((control_id) >> 8) & 0xFF);
  SendChar((control_id)&0xFF);
  SendChar(((1) >> 8) & 0xFF);
  SendChar((1) & 0xFF);
  SendChar((state)&0xFF);
}


x86 assembly (clang, -O0):
<BatchSetButtonValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzwl -0x2(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
movzwl -0x2(%rbp),%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
xor    %edi,%edi
call   1030 <SendChar@plt>
mov    $0x1,%edi
call   1030 <SendChar@plt>
movzbl -0x3(%rbp),%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BatchSetButtonValue>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
shr    $0x8,%edi
call   1030 <SendChar@plt>
movzbl %bpl,%edi
call   1030 <SendChar@plt>
xor    %edi,%edi
call   1030 <SendChar@plt>
mov    $0x1,%edi
call   1030 <SendChar@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @BatchSetButtonValue(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = call i32 @SendChar(i32 %8)
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = and i32 %11, 255
%13 = call i32 @SendChar(i32 %12)
%14 = call i32 @SendChar(i32 0)
%15 = call i32 @SendChar(i32 1)
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = and i32 %17, 255
%19 = call i32 @SendChar(i32 %18)
ret void
}

LLVM IR (-O2):
define void @BatchSetButtonValue(i16 zeroext %0, i8 zeroext %1) {
%3 = zext i16 %0 to i32
%4 = lshr i32 %3, 8
%5 = tail call i32 @SendChar(i32 %4)
%6 = and i32 %3, 255
%7 = tail call i32 @SendChar(i32 %6)
%8 = tail call i32 @SendChar(i32 0)
%9 = tail call i32 @SendChar(i32 1)
%10 = zext i8 %1 to i32
%11 = tail call i32 @SendChar(i32 %10)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int UP3D_GetParameter(int);
int32_t UP3D_GetHeaterSetTemp(int heater) {
  if ((heater < 1) || (heater > 4))
    return -1;
  return UP3D_GetParameter(0x39 + heater - 1);
}


x86 assembly (clang, -O0):
<UP3D_GetHeaterSetTemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     112f <UP3D_GetHeaterSetTemp+0x1f>
cmpl   $0x4,-0x8(%rbp)
jle    113b <UP3D_GetHeaterSetTemp+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <UP3D_GetHeaterSetTemp+0x3c>
mov    -0x8(%rbp),%edi
add    $0x39,%edi
sub    $0x1,%edi
call   1030 <UP3D_GetParameter@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UP3D_GetHeaterSetTemp>:
lea    -0x5(%rdi),%eax
cmp    $0xfffffffc,%eax
jae    111e <UP3D_GetHeaterSetTemp+0xe>
mov    $0xffffffff,%eax
ret
add    $0x38,%edi
jmp    1030 <UP3D_GetParameter@plt>

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

LLVM IR (-O2):
define i32 @UP3D_GetHeaterSetTemp(i32 %0) {
%2 = add i32 %0, -5
%3 = icmp ult i32 %2, -4
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = add nuw nsw i32 %0, 56
%6 = tail call i32 @UP3D_GetParameter(i32 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
void debug_dmem_allocated(struct imx21 *imx21, int size) {}


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

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

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

LLVM IR (-O2):
%struct.imx21 = type opaque
define void @debug_dmem_allocated(%struct.imx21* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
float atoi(char *);
int /*<<< orphan*/ printf(char *, float);
int main(int argc, char *argv[]) {
  printf("Quotient = %.2f\n", ((float)atoi(argv[1]) / atoi(argv[2])));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
divss  %xmm1,%xmm0
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
movss  %xmm0,0xc(%rsp)
mov    0x10(%rbx),%rdi
call   1040 <atoi@plt>
movss  0xc(%rsp),%xmm1
divss  %xmm0,%xmm1
lea    0xeaf(%rip),%rdi
movaps %xmm1,%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"Quotient = %.2f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call float @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call float @atoi(i8* %7)
%9 = fdiv float %5, %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ core3_swap(char *, int);
void U_EMRSETICMMODE_swap(char *record, int torev) {
  core3_swap(record, torev);
}


x86 assembly (clang, -O0):
<U_EMRSETICMMODE_swap>:
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   1030 <core3_swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_EMRSETICMMODE_swap>:
jmp    1030 <core3_swap@plt>

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

LLVM IR (-O2):
define void @U_EMRSETICMMODE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core3_swap(i8* %0, i32 %1)
ret void
}