xunge/DecIR huggingface dataset:
void outw(unsigned short value, int port) {
  __asm__ __volatile__("out"
                       "w"
                       " %"
                       "w"
                       "0, %w1"
                       :
                       : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x8(%rbp),%edx
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %esi,%edx
mov    %edi,%eax
out    %ax,(%dx)
ret

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

LLVM IR (-O2):
define void @outw(i16 zeroext %0, i32 %1) {
tail call void asm sideeffect "outw ${0:w}, ${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
void wordspace() { delay(8); }


x86 assembly (clang, -O0):
<wordspace>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wordspace>:
mov    $0x8,%edi
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @wordspace() {
%1 = call i32 @delay(i32 8)
ret void
}

LLVM IR (-O2):
define void @wordspace() {
%1 = tail call i32 @delay(i32 8)
ret void
}
long giAtomicIncrement(volatile long *p) { return __sync_add_and_fetch(p, 1L); }


x86 assembly (clang, -O0):
<giAtomicIncrement>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%eax
lock xadd %rax,(%rcx)
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<giAtomicIncrement>:
mov    $0x1,%eax
lock xadd %rax,(%rdi)
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @giAtomicIncrement(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = atomicrmw add i64* %3, i64 1 seq_cst
%5 = add i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @giAtomicIncrement(i64* nocapture %0) {
%2 = atomicrmw add i64* %0, i64 1 seq_cst
%3 = add i64 %2, 1
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ getValueFromIndex(int);
uint16_t getStartAddress() { return getValueFromIndex(15000); }


x86 assembly (clang, -O0):
<getStartAddress>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3a98,%edi
call   1030 <getValueFromIndex@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getStartAddress>:
mov    $0x3a98,%edi
jmp    1030 <getValueFromIndex@plt>

LLVM IR (-O0):
define i32 @getStartAddress() {
%1 = call i32 @getValueFromIndex(i32 15000)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getStartAddress() {
%1 = tail call i32 @getValueFromIndex(i32 15000)
ret i32 %1
}
int testg2(int a, int c) {
  int j = 0;
  do {
    j += a;
  } while (j < 56);
  j += c;
  return j;
}


x86 assembly (clang, -O0):
<testg2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x38,-0xc(%rbp)
jl     1111 <testg2+0x11>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testg2>:
mov    %esi,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    %edi,%ecx
cmp    $0x38,%ecx
jl     1110 <testg2+0x10>
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @testg2(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %5, %3 ]
%5 = add nsw i32 %4, %0
%6 = icmp slt i32 %5, 56
br i1 %6, label %3, label %7
7: ; preds = %3
%8 = add nsw i32 %5, %1
ret i32 %8
}
/* Variables and functions */
bool nrf52_errata_122(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf52_errata_122() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf52_errata_122() {
ret i32 0
}
const char *get_loop_mode_str(short mode) {
  switch (mode) {
  case 0:
    return "none";
  case 1:
    return "forward";
  case 2:
    return "backward";
  };
  return "*** unknown";
}


x86 assembly (clang, -O0):
<get_loop_mode_str>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1141 <get_loop_mode_str+0x41>
jmp    111f <get_loop_mode_str+0x1f>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     1151 <get_loop_mode_str+0x51>
jmp    1130 <get_loop_mode_str+0x30>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1161 <get_loop_mode_str+0x61>
jmp    1171 <get_loop_mode_str+0x71>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117c <get_loop_mode_str+0x7c>
lea    0xead(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117c <get_loop_mode_str+0x7c>
lea    0xea5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117c <get_loop_mode_str+0x7c>
lea    0xe9e(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_loop_mode_str>:
cmp    $0x2,%di
ja     1119 <get_loop_mode_str+0x19>
movswq %di,%rax
lea    0xf13(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xef6(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"none\00"
@.str.1 = [8 x i8] c"forward\00"
@.str.2 = [9 x i8] c"backward\00"
@.str.3 = [12 x i8] c"*** unknown\00"
define i8* @get_loop_mode_str(i16 signext %0) {
%2 = alloca i8*
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
switch i32 %5, label %9 [
i32 0, label %6
i32 1, label %7
i32 2, label %8
]
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
7: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %10
8: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %10
9: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [5 x i8] c"none\00"
@.str.1 = [8 x i8] c"forward\00"
@.str.2 = [9 x i8] c"backward\00"
@.str.3 = [12 x i8] c"*** unknown\00"
@reltable.get_loop_mode_str = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.get_loop_mode_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.get_loop_mode_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.get_loop_mode_str to i64)) to i32)]
define i8* @get_loop_mode_str(i16 signext %0) {
%2 = icmp ult i16 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i16 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.get_loop_mode_str to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ ecb_e_m(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  ecb_e_m(128);
  ecb_e_m(192);
  ecb_e_m(256);
  printf("\n===========");
  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    $0x80,%edi
call   1040 <ecb_e_m@plt>
mov    $0xc0,%edi
call   1040 <ecb_e_m@plt>
mov    $0x100,%edi
call   1040 <ecb_e_m@plt>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x80,%edi
call   1040 <ecb_e_m@plt>
mov    $0xc0,%edi
call   1040 <ecb_e_m@plt>
mov    $0x100,%edi
call   1040 <ecb_e_m@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"\0A===========\00"
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 = call i32 @ecb_e_m(i32 128)
%7 = call i32 @ecb_e_m(i32 192)
%8 = call i32 @ecb_e_m(i32 256)
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"\0A===========\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @ecb_e_m(i32 128)
%4 = tail call i32 @ecb_e_m(i32 192)
%5 = tail call i32 @ecb_e_m(i32 256)
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ins_in_line(int /*<<< orphan*/);
void ins_string(char *s) {
  while (*s)
    ins_in_line(*s++);
}


x86 assembly (clang, -O0):
<ins_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <ins_string+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <ins_in_line@plt>
jmp    111c <ins_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ins_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <ins_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <ins_in_line@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <ins_string+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @ins_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @ins_in_line(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @ins_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @ins_in_line(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
double dblXor(double a, double b) { return ((long)a) ^ ((long)b); }


x86 assembly (clang, -O0):
<dblXor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
cvttsd2si -0x8(%rbp),%rax
cvttsd2si -0x10(%rbp),%rcx
xor    %rcx,%rax
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dblXor>:
cvttsd2si %xmm0,%rax
cvttsd2si %xmm1,%rcx
xor    %rax,%rcx
xorps  %xmm0,%xmm0
cvtsi2sd %rcx,%xmm0
ret

LLVM IR (-O0):
define double @dblXor(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 = fptosi double %5 to i64
%7 = load double, double* %4
%8 = fptosi double %7 to i64
%9 = xor i64 %6, %8
%10 = sitofp i64 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @dblXor(double %0, double %1) {
%3 = fptosi double %0 to i64
%4 = fptosi double %1 to i64
%5 = xor i64 %4, %3
%6 = sitofp i64 %5 to double
ret double %6
}
void main(int argc, char **argv) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    110b <main+0xb>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
br label %5
5: ; preds = %2, %5
br label %5
}

LLVM IR (-O2):
define void @main(i32 %0, i8** nocapture %1) {
br label %3
3: ; preds = %2, %3
br label %3
}
/* Variables and functions */
int remove(char const *);
int fild_Remove(const char *pathname) { return remove(pathname); }


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

x86 assembly (clang, -O2):
<fild_Remove>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define i32 @fild_Remove(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test_file() { printf("a faire"); }


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

x86 assembly (clang, -O2):
<test_file>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"a faire\00"
define void @test_file() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"a faire\00"
define void @test_file() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
int main(int argc, char **argv) {
  if (__builtin_expect((argc == 1), 1))
    return 0;
  if (__builtin_expect((argc > 0), 1))
    return 1;
  if (__builtin_expect((argc < 0), 0))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
cmp    $0x0,%rax
je     1136 <main+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1185 <main+0x85>
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
cltq
cmp    $0x0,%rax
je     115a <main+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1185 <main+0x85>
cmpl   $0x0,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
cltq
cmp    $0x0,%rax
je     117e <main+0x7e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1185 <main+0x85>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
cmp    $0x1,%edi
jne    1108 <main+0x8>
ret
mov    $0x1,%eax
jge    1107 <main+0x7>
neg    %edi
sbb    %eax,%eax
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 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = sext i32 %8 to i64
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %27
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 0
%15 = zext i1 %14 to i32
%16 = sext i32 %15 to i64
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %12
store i32 1, i32* %3
br label %27
19: ; preds = %12
%20 = load i32, i32* %4
%21 = icmp slt i32 %20, 0
%22 = zext i1 %21 to i32
%23 = sext i32 %22 to i64
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %19
store i32 -1, i32* %3
br label %27
26: ; preds = %19
store i32 0, i32* %3
br label %27
27: ; preds = %26, %25, %18, %11
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 0
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = icmp ne i32 %0, 0
%8 = sext i1 %7 to i32
br label %9
9: ; preds = %6, %4, %2
%10 = phi i32 [ 0, %2 ], [ 1, %4 ], [ %8, %6 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ __infer_nondet_int();
int /*<<< orphan*/ exit(int);
void FP_loop_with_exit_good() {
  while (1) {
    if (__infer_nondet_int()) {
      exit(1);
    }
  }
}


x86 assembly (clang, -O0):
<FP_loop_with_exit_good>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <FP_loop_with_exit_good+0x9>
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
cmp    $0x0,%rax
je     1144 <FP_loop_with_exit_good+0x24>
mov    $0x1,%edi
call   1040 <exit@plt>
jmp    1129 <FP_loop_with_exit_good+0x9>

x86 assembly (clang, -O2):
<FP_loop_with_exit_good>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
test   %rax,%rax
je     1130 <FP_loop_with_exit_good+0x10>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @FP_loop_with_exit_good() {
br label %1
1: ; preds = %0, %6
%2 = call i64 (...) @__infer_nondet_int()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = call i32 @exit(i32 1)
unreachable
6: ; preds = %1
br label %1
}

LLVM IR (-O2):
define void @FP_loop_with_exit_good() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @__infer_nondet_int()
%3 = icmp eq i64 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call i32 @exit(i32 1)
unreachable
}
int main() {
  char *p = "HELLO";
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void g_param_spec_set_qdata() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_set_qdata() {
ret void
}
/* Type definitions */
struct position {
  int dummy;
};
struct move {
  int dummy;
};

/* Variables and functions */
struct move *find_bestmove(struct position *, unsigned char, int);
int /*<<< orphan*/ make_move(struct position *, struct move *);
void computer_move(struct position *pos, unsigned char ply) {
  struct move *bestmove = find_bestmove(pos, ply, 3000000000);
  make_move(pos, bestmove);
}


x86 assembly (clang, -O0):
<computer_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xb2d05e00,%edx
movzbl -0x9(%rbp),%esi
call   1040 <find_bestmove@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <make_move@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<computer_move>:
push   %rbx
mov    %rdi,%rbx
mov    $0xb2d05e00,%edx
call   1040 <find_bestmove@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <make_move@plt>

LLVM IR (-O0):
%struct.position = type { i32 }
%struct.move = type { i32 }
define void @computer_move(%struct.position* %0, i8 zeroext %1) {
%3 = alloca %struct.position*
%4 = alloca i8
%5 = alloca %struct.move*
store %struct.position* %0, %struct.position** %3
store i8 %1, i8* %4
%6 = load %struct.position*, %struct.position** %3
%7 = load i8, i8* %4
%8 = call %struct.move* @find_bestmove(%struct.position* %6, i8 zeroext %7, i32 -1294967296)
store %struct.move* %8, %struct.move** %5
%9 = load %struct.position*, %struct.position** %3
%10 = load %struct.move*, %struct.move** %5
%11 = call i32 @make_move(%struct.position* %9, %struct.move* %10)
ret void
}

LLVM IR (-O2):
%struct.position = type { i32 }
%struct.move = type { i32 }
define void @computer_move(%struct.position* %0, i8 zeroext %1) {
%3 = tail call %struct.move* @find_bestmove(%struct.position* %0, i8 zeroext %1, i32 -1294967296)
%4 = tail call i32 @make_move(%struct.position* %0, %struct.move* %3)
ret void
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
void send_msg(int client_sock, char *msg, int length) {
  int len;
  len = length > 0 ? length : strlen(msg);
  write(client_sock, msg, len);
}


x86 assembly (clang, -O0):
<send_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1147 <send_msg+0x27>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1153 <send_msg+0x33>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_msg>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
test   %edx,%edx
jg     1136 <send_msg+0x16>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @send_msg(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %6
br label %15
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = call i32 @strlen(i8* %13)
br label %15
15: ; preds = %12, %10
%16 = phi i32 [ %11, %10 ], [ %14, %12 ]
store i32 %16, i32* %7
%17 = load i32, i32* %4
%18 = load i8*, i8** %5
%19 = load i32, i32* %7
%20 = call i32 @write(i32 %17, i8* %18, i32 %19)
ret void
}

LLVM IR (-O2):
define void @send_msg(i32 %0, i8* %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @strlen(i8* %1)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ %2, %3 ]
%9 = tail call i32 @write(i32 %0, i8* %1, i32 %8)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void put_uint16_le(unsigned char *ptr, uint16_t data) {
  ptr[0] = data & 0xff;
  ptr[1] = (data >> 8) & 0xff;
}


x86 assembly (clang, -O0):
<put_uint16_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_uint16_le>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @put_uint16_le(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
ret void
}

LLVM IR (-O2):
define void @put_uint16_le(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
/* Variables and functions */
int utest_main(int, char const *const *);
int main(int argc, const char *const argv[]) { return utest_main(argc, argv); }


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   1030 <utest_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <utest_main@plt>

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 @utest_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @utest_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ get_next_line(int /*<<< orphan*/, char **);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  char *line;
  while (1) {
    get_next_line(0, &line);
    printf("%s\n", line);
    free(line);
  }
  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)
xor    %edi,%edi
lea    -0x18(%rbp),%rsi
call   1050 <get_next_line@plt>
mov    -0x18(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
jmp    1146 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsp,%r14
lea    0xec2(%rip),%rbx
xchg   %ax,%ax
xor    %edi,%edi
mov    %r14,%rsi
call   1050 <get_next_line@plt>
mov    (%rsp),%rsi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
jmp    1140 <main+0x10>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
br label %5
5: ; preds = %5, %2
%6 = call i32 @get_next_line(i32 0, i8** %3)
%7 = load i8*, i8** %3
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
br label %5
}
/* Variables and functions */
long _f_lrintl(long double);
long int lrintl(long double x) { return _f_lrintl(x); }


x86 assembly (clang, -O0):
<lrintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <_f_lrintl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrintl>:
jmp    1030 <_f_lrintl@plt>

LLVM IR (-O0):
define i64 @lrintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @_f_lrintl(x86_fp80 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @lrintl(x86_fp80 %0) {
%2 = tail call i64 @_f_lrintl(x86_fp80 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ g(int, int, int *);
void f(int x, int *y) {
  int u;
  if (x > 0) {
    f(x - 1, &u);
    g(x - 1, u, y);
  } else
    *y = 1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    115f <f+0x3f>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
lea    -0x14(%rbp),%rsi
call   1030 <f@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <g@plt>
jmp    1169 <f+0x49>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
test   %edi,%edi
jle    114b <f+0x2b>
mov    %edi,%ebp
add    $0xffffffff,%ebp
lea    0x4(%rsp),%rsi
mov    %ebp,%edi
call   1030 <f@plt>
mov    0x4(%rsp),%esi
mov    %ebp,%edi
mov    %rbx,%rdx
call   1040 <g@plt>
jmp    1151 <f+0x31>
movl   $0x1,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @f(i32 %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = add nsw i32 %0, -1
%8 = load i32, i32* %3
%9 = call i32 @g(i32 %7, i32 %8, i32* %1)
br label %11
10: ; preds = %2
store i32 1, i32* %1
br label %11
11: ; preds = %10, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emitanoperand(int, char *, int);
int /*<<< orphan*/ printf(char *);
void emittwooperandsl(void) {
  printf(" ");
  emitanoperand(2, "ds:dword ptr", 1);
  printf(",");
  emitanoperand(1, "ds:dword ptr", 1);
}


x86 assembly (clang, -O0):
<emittwooperandsl>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
lea    0xec6(%rip),%rsi
mov    $0x1,%edx
call   1040 <emitanoperand@plt>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edx
lea    0xea4(%rip),%rsi
mov    %edx,%edi
call   1040 <emitanoperand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emittwooperandsl>:
push   %rbx
mov    $0x20,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rbx
mov    $0x2,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <emitanoperand@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
pop    %rbx
jmp    1040 <emitanoperand@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [13 x i8] c"ds:dword ptr\00"
@.str.2 = [2 x i8] c",\00"
define void @emittwooperandsl() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @emitanoperand(i32 2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @emitanoperand(i32 1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"ds:dword ptr\00"
define void @emittwooperandsl() {
%1 = tail call i32 @putchar(i32 32)
%2 = tail call i32 @emitanoperand(i32 2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 @putchar(i32 44)
%4 = tail call i32 @emitanoperand(i32 1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u16;

/* Variables and functions */
int /*<<< orphan*/ cpu_to_le16(int /*<<< orphan*/);
__u16 le16_to_cpu(__u16 val) {
  return val;
  return cpu_to_le16(val);
}


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

x86 assembly (clang, -O2):
<le16_to_cpu>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @le16_to_cpu(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
struct p7_waitk {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct p7_waitk *);
void p7_waitk_delete_(struct p7_waitk *k) { free(k); }


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

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

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

LLVM IR (-O2):
%struct.p7_waitk = type { i32 }
define void @p7_waitk_delete_(%struct.p7_waitk* nocapture %0) {
%2 = tail call i32 @free(%struct.p7_waitk* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int /*<<< orphan*/);
int main(void) { printf("gcc version: %d.%d.%d\n", 9, 4, 0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x9,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"gcc version: %d.%d.%d\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 9, i32 4, i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"gcc version: %d.%d.%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 9, i32 4, i32 0)
ret i32 0
}
int pth_pth_select(int p1, int p2, int p3, int p4, int p5) { return 0; }


x86 assembly (clang, -O0):
<pth_pth_select>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pth_pth_select(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret i32 0
}
/* Variables and functions */
scalar_t__ Random();
double log(scalar_t__);
double Exponential(double m) { return (-m * log(1.0 - Random())); }


x86 assembly (clang, -O0):
<Exponential>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <Random@plt>
cvtsi2sd %rax,%xmm1
movsd  0xe9e(%rip),%xmm0
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Exponential>:
sub    $0x18,%rsp
xorps  0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <Random@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0xeca(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rdi
call   1040 <log@plt>
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @Exponential(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call i64 (...) @Random()
%6 = sitofp i64 %5 to double
%7 = fsub double 1.000000e+00, %6
%8 = fptosi double %7 to i64
%9 = call double @log(i64 %8)
%10 = fmul double %4, %9
ret double %10
}

LLVM IR (-O2):
define double @Exponential(double %0) {
%2 = fneg double %0
%3 = tail call i64 (...) @Random()
%4 = sitofp i64 %3 to double
%5 = fsub double 1.000000e+00, %4
%6 = fptosi double %5 to i64
%7 = tail call double @log(i64 %6)
%8 = fmul double %7, %2
ret double %8
}
OP(dd, b2) { op_b2(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_b2()
ret i32 undef
}
int _valid_index(int curr, int step, int cap) { return (curr + step) % cap; }


x86 assembly (clang, -O0):
<_valid_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_valid_index>:
mov    %edx,%ecx
lea    (%rdi,%rsi,1),%eax
cltd
idiv   %ecx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @_valid_index(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = srem i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @_valid_index(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = srem i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ret();
void cpu_ret() { ret(); }


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

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

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

LLVM IR (-O2):
define void @cpu_ret() {
%1 = tail call i32 (...) @ret()
ret void
}
void rop3_21_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T & S;
  stk1 = *D | stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_21_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_21_1_1>:
mov    (%rdi),%al
mov    %edx,%ecx
or     %sil,%cl
or     %al,%cl
not    %cl
and    %al,%sil
and    %dl,%al
or     %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_21_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = and i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8, i8* %6
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %6
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_21_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = or i8 %5, %4
%7 = xor i8 %6, -1
%8 = and i8 %4, %1
%9 = or i8 %8, %7
%10 = and i8 %4, %2
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
int mod255(int x) { return x % 255; }


x86 assembly (clang, -O0):
<mod255>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod255>:
movslq %edi,%rcx
imul   $0xffffffff80808081,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x7,%eax
add    %edx,%eax
mov    %eax,%edx
shl    $0x8,%edx
sub    %edx,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @mod255(i32 %0) {
%2 = srem i32 %0, 255
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Cmd_ArgsFrom(int);
int /*<<< orphan*/ Com_Printf(char *, int /*<<< orphan*/);
void Cmd_Echo_f(void) { Com_Printf("%s\n", Cmd_ArgsFrom(1)); }


x86 assembly (clang, -O0):
<Cmd_Echo_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <Cmd_ArgsFrom@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1040 <Com_Printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cmd_Echo_f>:
push   %rax
mov    $0x1,%edi
call   1030 <Cmd_ArgsFrom@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <Com_Printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @Cmd_Echo_f() {
%1 = call i32 @Cmd_ArgsFrom(i32 1)
%2 = call i32 @Com_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @Cmd_Echo_f() {
%1 = tail call i32 @Cmd_ArgsFrom(i32 1)
%2 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
int module_init(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @module_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @module_init() {
ret i32 0
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int recv(int, char *, int, int /*<<< orphan*/);
int wfaTrafficRecv(int sock, char *buf, struct sockaddr *from) {
  int bytesRecvd = 0;
  bytesRecvd = recv(sock, buf, (32 * 1024), 0);
  return bytesRecvd;
}


x86 assembly (clang, -O0):
<wfaTrafficRecv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x8000,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wfaTrafficRecv>:
mov    $0x8000,%edx
xor    %ecx,%ecx
jmp    1030 <recv@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @wfaTrafficRecv(i32 %0, i8* %1, %struct.sockaddr* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.sockaddr*
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.sockaddr* %2, %struct.sockaddr** %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = call i32 @recv(i32 %8, i8* %9, i32 32768, i32 0)
store i32 %10, i32* %7
%11 = load i32, i32* %7
ret i32 %11
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @wfaTrafficRecv(i32 %0, i8* %1, %struct.sockaddr* nocapture readnone %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i32 32768, i32 0)
ret i32 %4
}
/* Variables and functions */
int process_pipe2(int *, int /*<<< orphan*/);
int process_pipe(int *pipefd) { return process_pipe2(pipefd, 0); }


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

x86 assembly (clang, -O2):
<process_pipe>:
xor    %esi,%esi
jmp    1030 <process_pipe2@plt>

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

LLVM IR (-O2):
define i32 @process_pipe(i32* %0) {
%2 = tail call i32 @process_pipe2(i32* %0, i32 0)
ret i32 %2
}
int my_strlen_c(const char *str, char c) {
  int n;
  n = 0;
  while (str[n] && (str[n] != c)) {
    n++;
  }
  return (n);
}


x86 assembly (clang, -O0):
<my_strlen_c>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1147 <my_strlen_c+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1157 <my_strlen_c+0x57>
jmp    1165 <my_strlen_c+0x65>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <my_strlen_c+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen_c>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi),%ecx
add    $0x1,%eax
test   %cl,%cl
je     1123 <my_strlen_c+0x23>
add    $0x1,%rdi
cmp    %sil,%cl
jne    1110 <my_strlen_c+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_strlen_c(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %10, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = icmp eq i8 %6, %1
%9 = or i1 %7, %8
%10 = add nuw i64 %4, 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = trunc i64 %4 to i32
ret i32 %12
}
const char *zlibVersion(void) { return "1.2.11.zlib-ng"; }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"1.2.11.zlib-ng\00"
define i8* @zlibVersion() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"1.2.11.zlib-ng\00"
define i8* @zlibVersion() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}