xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ val;
typedef scalar_t__ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ basic_test(int);
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
scalar_t__ read(int, int *, int);
void use_after_close_invalid(void) {
  int fd, val;
  ssize_t n;
  fd = open("/dev/ssr", O_RDWR);
  close(fd);
  n = read(fd, &val, sizeof(val));
  basic_test(n < 0);
}


x86 assembly (clang, -O0):
<use_after_close_invalid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
lea    0xea8(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1050 <read@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <basic_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<use_after_close_invalid>:
push   %rbx
sub    $0x10,%rsp
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    0xeab(%rip),%rdi
call   1060 <open@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <close@plt>
lea    0xc(%rsp),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
call   1050 <read@plt>
shr    $0x3f,%rax
mov    %eax,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <basic_test@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"/dev/ssr\00"
@O_RDWR = global i32 0
define void @use_after_close_invalid() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = load i32, i32* @O_RDWR
%5 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @close(i32 %6)
%8 = load i32, i32* %1
%9 = call i64 @read(i32 %8, i32* %2, i32 4)
store i64 %9, i64* %3
%10 = load i64, i64* %3
%11 = icmp slt i64 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @basic_test(i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"/dev/ssr\00"
@O_RDWR = global i32 0
define void @use_after_close_invalid() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @O_RDWR
%4 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @close(i32 %4)
%6 = call i64 @read(i32 %4, i32* %1, i32 4)
%7 = lshr i64 %6, 63
%8 = trunc i64 %7 to i32
%9 = tail call i32 @basic_test(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ loop_one_wire();
int /*<<< orphan*/ loop_relay();
int /*<<< orphan*/ loop_wifi();
void loop() {
  loop_one_wire();
  loop_wifi();
  loop_relay();
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <loop_one_wire@plt>
mov    $0x0,%al
call   1030 <loop_wifi@plt>
mov    $0x0,%al
call   1050 <loop_relay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop>:
push   %rax
xor    %eax,%eax
call   1040 <loop_one_wire@plt>
xor    %eax,%eax
call   1030 <loop_wifi@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <loop_relay@plt>

LLVM IR (-O0):
define void @loop() {
%1 = call i32 (...) @loop_one_wire()
%2 = call i32 (...) @loop_wifi()
%3 = call i32 (...) @loop_relay()
ret void
}

LLVM IR (-O2):
define void @loop() {
%1 = tail call i32 (...) @loop_one_wire()
%2 = tail call i32 (...) @loop_wifi()
%3 = tail call i32 (...) @loop_relay()
ret void
}
int test_imm_68int8_reg(signed char val) {
  return ((val) & (-0x68 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_68int8_reg(i8 signext %0) {
%2 = and i8 %0, -104
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ rename(char const *, char const *);
int rename_file(const char *dst, const char *src) { return !rename(src, dst); }


x86 assembly (clang, -O0):
<rename_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <rename@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rename_file>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <rename@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rename_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @rename(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @rename_file(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @rename(i8* %1, i8* %0)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ mcheck_regions(int /*<<< orphan*/, int /*<<< orphan*/);
int mmalloc_check() {
  mcheck_regions(0, 0);
  return 1;
}


x86 assembly (clang, -O0):
<mmalloc_check>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <mcheck_regions@plt>
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mmalloc_check() {
%1 = call i32 @mcheck_regions(i32 0, i32 0)
ret i32 1
}

LLVM IR (-O2):
define i32 @mmalloc_check() {
%1 = tail call i32 @mcheck_regions(i32 0, i32 0)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ fenv_t;

/* Variables and functions */
int /*<<< orphan*/ fegetenv(int /*<<< orphan*/ *);
int feholdexcept(fenv_t *e) {
  fegetenv(e);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @feholdexcept(i32* %0) {
%2 = tail call i32 @fegetenv(i32* %0)
ret i32 0
}
unsigned int f25(unsigned int x, unsigned int y) {
  return (x >> ((-y) & (8 * sizeof(unsigned int) - 1))) ^ (x << y);
}


x86 assembly (clang, -O0):
<f25>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
mov    %ecx,%ecx
and    $0x1f,%rcx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f25>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shr    %cl,%eax
mov    %esi,%ecx
shl    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f25(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 = sub i32 0, %6
%8 = zext i32 %7 to i64
%9 = and i64 %8, 31
%10 = trunc i64 %9 to i32
%11 = lshr i32 %5, %10
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = shl i32 %12, %13
%15 = xor i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @f25(i32 %0, i32 %1) {
%3 = sub i32 0, %1
%4 = and i32 %3, 31
%5 = lshr i32 %0, %4
%6 = shl i32 %0, %1
%7 = xor i32 %5, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ivory_serialize_unpack_prim_8_be(int /*<<< orphan*/ const *);
int /*<<< orphan*/ memcpy(double *, int /*<<< orphan*/ *, int);
void ivory_serialize_unpack_double_be(const uint8_t *src, uint32_t offs,
                                      double *dst) {
  uint64_t tmp = ivory_serialize_unpack_prim_8_be(src + offs);
  memcpy(dst, &tmp, sizeof(*dst));
}


x86 assembly (clang, -O0):
<ivory_serialize_unpack_double_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <ivory_serialize_unpack_prim_8_be@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_unpack_double_be>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
call   1030 <ivory_serialize_unpack_prim_8_be@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @ivory_serialize_unpack_double_be(i32* %0, i32 %1, double* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store double* %2, double** %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = call i32 @ivory_serialize_unpack_prim_8_be(i32* %11)
store i32 %12, i32* %7
%13 = load double*, double** %6
%14 = call i32 @memcpy(double* %13, i32* %7, i32 8)
ret void
}

LLVM IR (-O2):
define void @ivory_serialize_unpack_double_be(i32* %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = tail call i32 @ivory_serialize_unpack_prim_8_be(i32* %7)
store i32 %8, i32* %4
%9 = call i32 @memcpy(double* %2, i32* %4, i32 8)
ret void
}
/* Type definitions */
struct litehash {
  int dummy;
};
typedef scalar_t__ int64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(scalar_t__);
int /*<<< orphan*/ lh_getval(struct litehash *, void *);
int64_t lookup_new_id(int64_t old_id, struct litehash *lh) {
  if (old_id < 0)
    return -1;
  int64_t new_id = (int64_t)lh_getval(lh, (void *)(&old_id));
  assert(new_id);
  return (new_id);
}


x86 assembly (clang, -O0):
<lookup_new_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1148 <lookup_new_id+0x28>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    116c <lookup_new_id+0x4c>
mov    -0x18(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <lh_getval@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookup_new_id>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,0x8(%rsp)
test   %rdi,%rdi
js     114c <lookup_new_id+0x2c>
lea    0x8(%rsp),%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <lh_getval@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
call   1040 <assert@plt>
jmp    1153 <lookup_new_id+0x33>
mov    $0xffffffffffffffff,%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.litehash = type { i32 }
define i64 @lookup_new_id(i64 %0, %struct.litehash* %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca %struct.litehash*
%6 = alloca i64
store i64 %0, i64* %4
store %struct.litehash* %1, %struct.litehash** %5
%7 = load i64, i64* %4
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i64 -1, i64* %3
br label %18
10: ; preds = %2
%11 = load %struct.litehash*, %struct.litehash** %5
%12 = bitcast i64* %4 to i8*
%13 = call i32 @lh_getval(%struct.litehash* %11, i8* %12)
%14 = sext i32 %13 to i64
store i64 %14, i64* %6
%15 = load i64, i64* %6
%16 = call i32 @assert(i64 %15)
%17 = load i64, i64* %6
store i64 %17, i64* %3
br label %18
18: ; preds = %10, %9
%19 = load i64, i64* %3
ret i64 %19
}

LLVM IR (-O2):
%struct.litehash = type { i32 }
define i64 @lookup_new_id(i64 %0, %struct.litehash* %1) {
%3 = alloca i64
store i64 %0, i64* %3
%4 = icmp slt i64 %0, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = bitcast i64* %3 to i8*
%7 = call i32 @lh_getval(%struct.litehash* %1, i8* %6)
%8 = sext i32 %7 to i64
%9 = call i32 @assert(i64 %8)
br label %10
10: ; preds = %2, %5
%11 = phi i64 [ %8, %5 ], [ -1, %2 ]
ret i64 %11
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *malloc(int);
void *myCalloc(size_t nmemb, size_t size) {
  return nmemb > (size_t)0 && size > (size_t)0 ? calloc(nmemb, size)
                                               : malloc(1);
}


x86 assembly (clang, -O0):
<myCalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jbe    115c <myCalloc+0x3c>
cmpq   $0x0,-0x10(%rbp)
jbe    115c <myCalloc+0x3c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
jmp    116a <myCalloc+0x4a>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myCalloc>:
test   %rdi,%rdi
je     112f <myCalloc+0xf>
test   %rsi,%rsi
je     112f <myCalloc+0xf>
jmp    1030 <calloc@plt>
mov    $0x1,%edi
jmp    1040 <malloc@plt>

LLVM IR (-O0):
define i8* @myCalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp ugt i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i64, i64* %4
%9 = icmp ugt i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = call i8* @calloc(i64 %11, i64 %12)
br label %16
14: ; preds = %7, %2
%15 = call i8* @malloc(i32 1)
br label %16
16: ; preds = %14, %10
%17 = phi i8* [ %13, %10 ], [ %15, %14 ]
ret i8* %17
}

LLVM IR (-O2):
define noalias i8* @myCalloc(i64 %0, i64 %1) {
%3 = icmp ne i64 %0, 0
%4 = icmp ne i64 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i8* @calloc(i64 %0, i64 %1)
br label %10
8: ; preds = %2
%9 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
br label %10
10: ; preds = %8, %6
%11 = phi i8* [ %7, %6 ], [ %9, %8 ]
ret i8* %11
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_spinlock_t;

/* Variables and functions */
int /*<<< orphan*/ spinlock_double_lock_bad(int /*<<< orphan*/ *);
void spinlock_double_lock_bad2() {
  pthread_spinlock_t m;
  spinlock_double_lock_bad(&m);
}


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

x86 assembly (clang, -O2):
<spinlock_double_lock_bad2>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <spinlock_double_lock_bad@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @spinlock_double_lock_bad2() {
%1 = alloca i32
%2 = call i32 @spinlock_double_lock_bad(i32* %1)
ret void
}

LLVM IR (-O2):
define void @spinlock_double_lock_bad2() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @spinlock_double_lock_bad(i32* %1)
ret void
}
void gtk_spin_button_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_spin_button_new() {
ret void
}
void trieFree(struct TrieNode *root) {}


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

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

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

LLVM IR (-O2):
%struct.TrieNode = type opaque
define void @trieFree(%struct.TrieNode* nocapture %0) {
ret void
}
int main() {
  int a, b, c;
  b = (a + c + b) * (c + a);
  return b;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
void main() {
  _Bool c = __VERIFIER_nondet_bool();
  if (c) {
    f(1);
  } else {
    f(2);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_bool@plt>
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
mov    %al,-0x1(%rbp)
testb  $0x1,-0x1(%rbp)
je     1155 <main+0x35>
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <f@plt>
jmp    1161 <main+0x41>
mov    $0x2,%edi
mov    $0x0,%al
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_bool@plt>
cmp    $0x1,%eax
mov    $0x1,%edi
adc    $0x0,%edi
xor    %eax,%eax
pop    %rcx
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i8
%2 = call i32 (...) @__VERIFIER_nondet_bool()
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i8
store i8 %4, i8* %1
%5 = load i8, i8* %1
%6 = trunc i8 %5 to i1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (i32, ...) bitcast (i32 (...)* @f to i32 (i32, ...)*)(i32 1)
br label %11
9: ; preds = %0
%10 = call i32 (i32, ...) bitcast (i32 (...)* @f to i32 (i32, ...)*)(i32 2)
br label %11
11: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_bool()
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i32 2, i32 1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @f to i32 (i32, ...)*)(i32 %3)
ret void
}
/* Variables and functions */
float const expf(float);
float gauss(float dd, float rr) {
  const float a = 1.f / (2.f * 3.14159265358979323846264338327 * rr);
  const float b = -1.f / (2.f * rr);
  return a * expf(dd * b);
}


x86 assembly (clang, -O0):
<gauss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xedd(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xec9(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xeb0(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
movss  0xe9f(%rip),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
call   1030 <expf@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gauss>:
push   %rax
cvtss2sd %xmm1,%xmm2
mulsd  0xee3(%rip),%xmm2
movsd  0xee3(%rip),%xmm3
divsd  %xmm2,%xmm3
xorps  %xmm2,%xmm2
cvtsd2ss %xmm3,%xmm2
movss  %xmm2,0x4(%rsp)
addss  %xmm1,%xmm1
movss  0xece(%rip),%xmm2
divss  %xmm1,%xmm2
mulss  %xmm2,%xmm0
call   1030 <expf@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @gauss(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = fmul double 0x401921FB54442D18, %8
%10 = fdiv double 1.000000e+00, %9
%11 = fptrunc double %10 to float
store float %11, float* %5
%12 = load float, float* %4
%13 = fmul float 2.000000e+00, %12
%14 = fdiv float -1.000000e+00, %13
store float %14, float* %6
%15 = load float, float* %5
%16 = load float, float* %3
%17 = load float, float* %6
%18 = fmul float %16, %17
%19 = call float @expf(float %18)
%20 = fmul float %15, %19
ret float %20
}

LLVM IR (-O2):
define float @gauss(float %0, float %1) {
%3 = fpext float %1 to double
%4 = fmul double %3, 0x401921FB54442D18
%5 = fdiv double 1.000000e+00, %4
%6 = fptrunc double %5 to float
%7 = fmul float %1, 2.000000e+00
%8 = fdiv float -1.000000e+00, %7
%9 = fmul float %8, %0
%10 = tail call float @expf(float %9)
%11 = fmul float %10, %6
ret float %11
}
/* Type definitions */
typedef int time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int __infer_nondet_time_t();
time_t mktime(struct tm *timeptr) {
  time_t res;
  res = __infer_nondet_time_t();
  if (res < -1)
    while (1)
      ;
  return res;
}


x86 assembly (clang, -O0):
<mktime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_time_t@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jge    113a <mktime+0x2a>
jmp    1135 <mktime+0x25>
jmp    1135 <mktime+0x25>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mktime>:
push   %rax
xor    %eax,%eax
call   1030 <__infer_nondet_time_t@plt>
cmp    $0xfffffffe,%eax
jg     1122 <mktime+0x12>
nopl   (%rax)
jmp    1120 <mktime+0x10>
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @mktime(%struct.tm* nocapture readnone %0) {
%2 = tail call i32 (...) @__infer_nondet_time_t()
%3 = icmp slt i32 %2, -1
br i1 %3, label %4, label %5
4: ; preds = %1, %4
br label %4
5: ; preds = %1
ret i32 %2
}
int getSize(int head, int tail) { return (tail + 65 - head) % 65; }


x86 assembly (clang, -O0):
<getSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x41,%eax
sub    -0x4(%rbp),%eax
mov    $0x41,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSize>:
sub    %edi,%esi
add    $0x41,%esi
movslq %esi,%rax
imul   $0x7e07e07f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x6,%edx
add    %ecx,%edx
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @getSize(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 65
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = srem i32 %8, 65
ret i32 %9
}

LLVM IR (-O2):
define i32 @getSize(i32 %0, i32 %1) {
%3 = sub i32 65, %0
%4 = add i32 %3, %1
%5 = srem i32 %4, 65
ret i32 %5
}
void caller_2_2_2_2_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_2_2_2_2_1_2() {
ret void
}
int isascii(int c) { return !(c & 0x7fff); }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7fff,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
test   $0x7fff,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 32767
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = and i32 %0, 32767
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ *opendir(char const *);
int omb_utils_dir_exists(const char *folder) {
  DIR *fd = opendir(folder);
  if (fd) {
    closedir(fd);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<omb_utils_dir_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1159 <omb_utils_dir_exists+0x39>
mov    -0x18(%rbp),%rdi
call   1040 <closedir@plt>
movl   $0x1,-0x4(%rbp)
jmp    1160 <omb_utils_dir_exists+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<omb_utils_dir_exists>:
push   %rax
call   1030 <opendir@plt>
test   %rax,%rax
je     113a <omb_utils_dir_exists+0x1a>
mov    %rax,%rdi
call   1040 <closedir@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @omb_utils_dir_exists(i8* nocapture %0) {
%2 = tail call i32* @opendir(i8* %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @closedir(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
int tls13_client_hello_send(struct tls13_ctx *ctx) { return 1; }


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

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

LLVM IR (-O0):
%struct.tls13_ctx = type opaque
define i32 @tls13_client_hello_send(%struct.tls13_ctx* %0) {
%2 = alloca %struct.tls13_ctx*
store %struct.tls13_ctx* %0, %struct.tls13_ctx** %2
ret i32 1
}

LLVM IR (-O2):
%struct.tls13_ctx = type opaque
define i32 @tls13_client_hello_send(%struct.tls13_ctx* nocapture readnone %0) {
ret i32 1
}
int BotEntityToActivate(int entitynum) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @BotEntityToActivate(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x23_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):
<x23_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):
<x23_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 @x23_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 @x23_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
}
unsigned r(void) {
  static unsigned x = 0xdeadbeefU;
  static unsigned y = 0x12347654U;
  static unsigned z = 0x1a2b3c4dU;
  static unsigned w = 0x87654321U;
  unsigned t = x ^ (x << 11);
  x = y;
  y = z;
  z = w;
  w = w ^ (w >> 19) ^ t ^ (t >> 8);
  return w;
}


x86 assembly (clang, -O0):
<r>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
mov    0x2f10(%rip),%ecx
shl    $0xb,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    0x2f06(%rip),%eax
mov    %eax,0x2efc(%rip)
mov    0x2efe(%rip),%eax
mov    %eax,0x2ef4(%rip)
mov    0x2ef6(%rip),%eax
mov    %eax,0x2eec(%rip)
mov    0x2eea(%rip),%eax
mov    0x2ee4(%rip),%ecx
shr    $0x13,%ecx
xor    %ecx,%eax
xor    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
xor    %ecx,%eax
mov    %eax,0x2ece(%rip)
mov    0x2ec8(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<r>:
mov    0x2f1a(%rip),%ecx
mov    %ecx,%eax
shl    $0xb,%eax
xor    %ecx,%eax
mov    0x2f11(%rip),%ecx
mov    %ecx,0x2f07(%rip)
mov    0x2f09(%rip),%ecx
mov    %ecx,0x2eff(%rip)
mov    0x2f01(%rip),%ecx
mov    %ecx,0x2ef7(%rip)
mov    %eax,%edx
shr    $0x8,%edx
xor    %ecx,%eax
shr    $0x13,%ecx
xor    %edx,%eax
xor    %ecx,%eax
mov    %eax,0x2ee7(%rip)
ret

LLVM IR (-O0):
@r.x = internal global i32 -559038737
@r.y = internal global i32 305428052
@r.z = internal global i32 439041101
@r.w = internal global i32 -2023406815
define i32 @r() {
%1 = alloca i32
%2 = load i32, i32* @r.x
%3 = load i32, i32* @r.x
%4 = shl i32 %3, 11
%5 = xor i32 %2, %4
store i32 %5, i32* %1
%6 = load i32, i32* @r.y
store i32 %6, i32* @r.x
%7 = load i32, i32* @r.z
store i32 %7, i32* @r.y
%8 = load i32, i32* @r.w
store i32 %8, i32* @r.z
%9 = load i32, i32* @r.w
%10 = load i32, i32* @r.w
%11 = lshr i32 %10, 19
%12 = xor i32 %9, %11
%13 = load i32, i32* %1
%14 = xor i32 %12, %13
%15 = load i32, i32* %1
%16 = lshr i32 %15, 8
%17 = xor i32 %14, %16
store i32 %17, i32* @r.w
%18 = load i32, i32* @r.w
ret i32 %18
}

LLVM IR (-O2):
@r.x = internal unnamed_addr global i32 -559038737
@r.y = internal unnamed_addr global i32 305428052
@r.z = internal unnamed_addr global i32 439041101
@r.w = internal unnamed_addr global i32 -2023406815
define i32 @r() {
%1 = load i32, i32* @r.x
%2 = shl i32 %1, 11
%3 = xor i32 %2, %1
%4 = load i32, i32* @r.y
store i32 %4, i32* @r.x
%5 = load i32, i32* @r.z
store i32 %5, i32* @r.y
%6 = load i32, i32* @r.w
store i32 %6, i32* @r.z
%7 = lshr i32 %6, 19
%8 = lshr i32 %3, 8
%9 = xor i32 %8, %3
%10 = xor i32 %9, %6
%11 = xor i32 %10, %7
store i32 %11, i32* @r.w
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int kill(int pid, int sig) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ed7(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebe(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @kill(i32 %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
int fun1065() { return 1065; }


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

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

LLVM IR (-O0):
define i32 @fun1065() {
ret i32 1065
}

LLVM IR (-O2):
define i32 @fun1065() {
ret i32 1065
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_help(char **argv) {
  printf("Usage: %s [-c conf] [-s startpoint] [-t thread-num]\n", argv[0]);
  printf("Optional arguments:\n"
         "	-t, --threads num: number of operating threads\n"
         "	-c, --conf file: conf file to use\n"
         "	-s, --start[point] dir: do the walk from there\n"
         " 	-v, --verbose: print what's found\n");
}


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

x86 assembly (clang, -O2):
<print_help>:
push   %rax
mov    (%rdi),%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xefc(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Usage: %s [-c conf] [-s startpoint] [-t thread-num]\0A\00"
@.str.1 = [188 x i8] c"Optional arguments:\0A\09-t, --threads num: number of operating threads\0A\09-c, --conf file: conf file to use\0A\09-s, --start[point] dir: do the walk from there\0A \09-v, --verbose: print what's found\0A\00"
define void @print_help(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([188 x i8], [188 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"Usage: %s [-c conf] [-s startpoint] [-t thread-num]\0A\00"
@str = [187 x i8] c"Optional arguments:\0A\09-t, --threads num: number of operating threads\0A\09-c, --conf file: conf file to use\0A\09-s, --start[point] dir: do the walk from there\0A \09-v, --verbose: print what's found\00"
define void @print_help(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([187 x i8], [187 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned int MaxBitresSize(unsigned long bitRate, unsigned long sampleRate) {
  return 6144 -
         (unsigned int)((double)bitRate / (double)sampleRate * (double)1024);
}


x86 assembly (clang, -O0):
<MaxBitresSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movaps 0xeed(%rip),%xmm3
movq   -0x8(%rbp),%xmm0
punpckldq %xmm3,%xmm0
movapd 0xeec(%rip),%xmm2
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movq   -0x10(%rbp),%xmm1
punpckldq %xmm3,%xmm1
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0xec9(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %eax,%ecx
mov    $0x1800,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MaxBitresSize>:
movq   %rdi,%xmm0
movdqa 0xef3(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xef7(%rip),%xmm2
subpd  %xmm2,%xmm0
movapd %xmm0,%xmm3
unpckhpd %xmm0,%xmm3
addsd  %xmm0,%xmm3
movq   %rsi,%xmm0
punpckldq %xmm1,%xmm0
subpd  %xmm2,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm3
mulsd  0xed2(%rip),%xmm3
cvttsd2si %xmm3,%rcx
mov    $0x1800,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @MaxBitresSize(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = uitofp i64 %5 to double
%7 = load i64, i64* %4
%8 = uitofp i64 %7 to double
%9 = fdiv double %6, %8
%10 = fmul double %9, 1.024000e+03
%11 = fptoui double %10 to i32
%12 = sub i32 6144, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @MaxBitresSize(i64 %0, i64 %1) {
%3 = uitofp i64 %0 to double
%4 = uitofp i64 %1 to double
%5 = fdiv double %3, %4
%6 = fmul double %5, 1.024000e+03
%7 = fptoui double %6 to i32
%8 = sub i32 6144, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ GBackMat(int, int);
int MatDensity(int /*<<< orphan*/);
int GBackDensity(int x, int y) { return MatDensity(GBackMat(x, y)); }


x86 assembly (clang, -O0):
<GBackDensity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <GBackMat@plt>
mov    %eax,%edi
call   1030 <MatDensity@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GBackDensity>:
push   %rax
call   1040 <GBackMat@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <MatDensity@plt>

LLVM IR (-O0):
define i32 @GBackDensity(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 @GBackMat(i32 %5, i32 %6)
%8 = call i32 @MatDensity(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @GBackDensity(i32 %0, i32 %1) {
%3 = tail call i32 @GBackMat(i32 %0, i32 %1)
%4 = tail call i32 @MatDensity(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void allocError(const char *msg) {
  perror(msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<allocError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<allocError>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @allocError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @allocError(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void dump_registers(void) { return; }


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

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

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

LLVM IR (-O2):
define void @dump_registers() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ X_OK;
int access(char *, int /*<<< orphan*/);
int executable(char *filepath) {
  if (access(filepath, X_OK) != -1) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<executable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0xffffffff,%eax
je     1143 <executable+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <executable+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<executable>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@X_OK = global i32 0
define i32 @executable(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* @X_OK
%6 = call i32 @access(i8* %4, i32 %5)
%7 = icmp ne i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@X_OK = global i32 0
define i32 @executable(i8* nocapture %0) {
%2 = load i32, i32* @X_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}
int authenticate(const char *password) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @authenticate(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct lldp_tlv {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ validate_length_max_255(struct lldp_tlv *);
uint8_t validate_port_description_tlv(struct lldp_tlv *tlv) {
  return validate_length_max_255(tlv);
}


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

x86 assembly (clang, -O2):
<validate_port_description_tlv>:
jmp    1030 <validate_length_max_255@plt>

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

LLVM IR (-O2):
%struct.lldp_tlv = type { i32 }
define i32 @validate_port_description_tlv(%struct.lldp_tlv* %0) {
%2 = tail call i32 @validate_length_max_255(%struct.lldp_tlv* %0)
ret i32 %2
}
int ft_isspace(int c) {
  if (c == ' ')
    return (1);
  if (c == '\v' || c == '\f' || c == '\r')
    return (2);
  if (c == '\t' || c == '\n')
    return (3);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jne    111d <ft_isspace+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    116e <ft_isspace+0x6e>
cmpl   $0xb,-0x8(%rbp)
je     113b <ft_isspace+0x3b>
cmpl   $0xc,-0x8(%rbp)
je     113b <ft_isspace+0x3b>
cmpl   $0xd,-0x8(%rbp)
jne    1147 <ft_isspace+0x47>
movl   $0x2,-0x4(%rbp)
jmp    116e <ft_isspace+0x6e>
cmpl   $0x9,-0x8(%rbp)
je     115b <ft_isspace+0x5b>
cmpl   $0xa,-0x8(%rbp)
jne    1167 <ft_isspace+0x67>
movl   $0x3,-0x4(%rbp)
jmp    116e <ft_isspace+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isspace>:
mov    $0x1,%eax
cmp    $0x20,%edi
je     1125 <ft_isspace+0x25>
lea    -0xb(%rdi),%ecx
mov    $0x2,%eax
cmp    $0x3,%ecx
jb     1125 <ft_isspace+0x25>
add    $0xfffffff7,%edi
xor    %eax,%eax
cmp    $0x2,%edi
setb   %al
lea    (%rax,%rax,2),%eax
ret

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

LLVM IR (-O2):
define i32 @ft_isspace(i32 %0) {
%2 = icmp eq i32 %0, 32
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = add i32 %0, -11
%5 = icmp ult i32 %4, 3
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = add i32 %0, -9
%8 = icmp ult i32 %7, 2
%9 = select i1 %8, i32 3, i32 0
br label %10
10: ; preds = %6, %3, %1
%11 = phi i32 [ 1, %1 ], [ 2, %3 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
void *malloc(size_t);
void *cnt_heap_alloc(size_t size) { return malloc(size); }


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

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

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

LLVM IR (-O2):
define noalias i8* @cnt_heap_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
int test_imm_0Duint8_mem(unsigned char *val) {
  return ((*val) & (-0x0D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Duint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xfffffff3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_0Duint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -13
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void __attribute__((const, no)) bar(void) {}


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

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

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

LLVM IR (-O2):
define void @bar() {
ret void
}
int openmp_thread_num() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @openmp_thread_num() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
time_t get_current_time() { return time(NULL); }


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

x86 assembly (clang, -O2):
<get_current_time>:
xor    %edi,%edi
jmp    1030 <time@plt>

LLVM IR (-O0):
define i32 @get_current_time() {
%1 = call i32 @time(i32* null)
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_current_time() {
%1 = tail call i32 @time(i32* null)
ret i32 %1
}