xunge/DecIR huggingface dataset:
int foo(void) { return 21; }


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 21
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 21
}
/* Variables and functions */
long meat_time_offset_days(int const);
signed long int meat_time_offset_months(int const i_months) {
  return meat_time_offset_days(i_months * 30);
}


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

x86 assembly (clang, -O2):
<meat_time_offset_months>:
mov    %edi,%eax
shl    $0x5,%eax
sub    %edi,%eax
sub    %edi,%eax
mov    %eax,%edi
jmp    1030 <meat_time_offset_days@plt>

LLVM IR (-O0):
define i64 @meat_time_offset_months(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 30
%5 = call i64 @meat_time_offset_days(i32 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @meat_time_offset_months(i32 %0) {
%2 = mul nsw i32 %0, 30
%3 = tail call i64 @meat_time_offset_days(i32 %2)
ret i64 %3
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ basic_test(int);
int /*<<< orphan*/ cleanup_test();
int /*<<< orphan*/ init_test();
int log_read_end(int);
void read_one_page_end(void) {
  ssize_t n;
  init_test();
  n = log_read_end(4096);
  basic_test(n == 4096);
  cleanup_test();
}


x86 assembly (clang, -O0):
<read_one_page_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <init_test@plt>
mov    $0x1000,%edi
call   1040 <log_read_end@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <basic_test@plt>
mov    $0x0,%al
call   1050 <cleanup_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_one_page_end>:
push   %rax
xor    %eax,%eax
call   1060 <init_test@plt>
mov    $0x1000,%edi
call   1040 <log_read_end@plt>
xor    %edi,%edi
cmp    $0x1000,%eax
sete   %dil
call   1030 <basic_test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cleanup_test@plt>

LLVM IR (-O0):
define void @read_one_page_end() {
%1 = alloca i32
%2 = call i32 (...) @init_test()
%3 = call i32 @log_read_end(i32 4096)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 4096
%6 = zext i1 %5 to i32
%7 = call i32 @basic_test(i32 %6)
%8 = call i32 (...) @cleanup_test()
ret void
}

LLVM IR (-O2):
define void @read_one_page_end() {
%1 = tail call i32 (...) @init_test()
%2 = tail call i32 @log_read_end(i32 4096)
%3 = icmp eq i32 %2, 4096
%4 = zext i1 %3 to i32
%5 = tail call i32 @basic_test(i32 %4)
%6 = tail call i32 (...) @cleanup_test()
ret void
}
/* Variables and functions */
int errno;
int link(char const *, char const *);
int link_file(const char *to, const char *from) {
  int err;
  err = link(to, from);
  if (err)
    return -errno;
  return 0;
}


x86 assembly (clang, -O0):
<link_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <link@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     114d <link_file+0x3d>
xor    %eax,%eax
mov    0x2e9d(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <link_file+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<link_file>:
push   %rax
call   1030 <link@plt>
mov    0x2ec3(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
test   %eax,%eax
cmovne %edx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @link_file(i8* %0, i8* %1) {
%3 = tail call i32 @link(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = load i32, i32* @errno
%6 = sub nsw i32 0, %5
%7 = select i1 %4, i32 0, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  if (x > 0 && x < 2)
    __VERIFIER_assert(x == 1);
  else {
    __VERIFIER_assert(1);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1163 <main+0x43>
cmpl   $0x2,-0x8(%rbp)
jge    1163 <main+0x43>
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
jmp    1179 <main+0x59>
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
movl   $0x1,-0x4(%rbp)
jmp    1180 <main+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %ebx,%ebx
cmp    $0x1,%eax
setne  %bl
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 1
%12 = zext i1 %11 to i32
%13 = call i32 @__VERIFIER_assert(i32 %12)
br label %16
14: ; preds = %6, %0
%15 = call i32 @__VERIFIER_assert(i32 1)
store i32 1, i32* %1
br label %17
16: ; preds = %9
store i32 0, i32* %1
br label %17
17: ; preds = %16, %14
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp ne i32 %1, 1
%3 = tail call i32 @__VERIFIER_assert(i32 1)
%4 = zext i1 %2 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ DrawTextw139(char const *, unsigned long);
void drawtextw(const char *s, unsigned long cfg) { DrawTextw139(s, cfg); }


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

x86 assembly (clang, -O2):
<drawtextw>:
jmp    1030 <DrawTextw139@plt>

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

LLVM IR (-O2):
define void @drawtextw(i8* %0, i64 %1) {
%3 = tail call i32 @DrawTextw139(i8* %0, i64 %1)
ret void
}
/* Variables and functions */
void *malloc_unlocked(size_t);
void *malloc(size_t size) {
  void *ptr;
  ;
  ptr = malloc_unlocked(size);
  ;
  return (ptr);
}


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

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

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

LLVM IR (-O2):
define i8* @malloc(i64 %0) {
%2 = tail call i8* @malloc_unlocked(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void zxdate(void) { system("date"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"date\00"
define void @zxdate() {
%1 = call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"date\00"
define void @zxdate() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void g_flags_complete_type_info() {}


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

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

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

LLVM IR (-O2):
define void @g_flags_complete_type_info() {
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int cmp(void *s1, void *s2) { return (strcmp((char *)s1, (char *)s2)); }


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

x86 assembly (clang, -O2):
<cmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
int test_imm_7Fint16_mem(short *val) {
  return ((*val) & (-0x7F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Fint16_mem>:
movzwl (%rdi),%eax
test   $0xff81,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Fint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -127
%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_7Fint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -127
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
float fabs(float);
float f_clamp(float x, float a, float b) {
  const float x1 = fabs(x - a);
  const float x2 = fabs(x - b);
  x = x1 + a + b;
  x -= x2;
  x *= 0.5;
  return x;
}


x86 assembly (clang, -O0):
<f_clamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
call   1030 <fabs@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x14(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe79(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_clamp>:
movaps %xmm0,%xmm3
subss  %xmm1,%xmm3
movaps 0xef2(%rip),%xmm4
andps  %xmm4,%xmm3
subss  %xmm2,%xmm0
andps  %xmm4,%xmm0
addss  %xmm1,%xmm3
addss  %xmm2,%xmm3
subss  %xmm0,%xmm3
mulss  0xee4(%rip),%xmm3
movaps %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @f_clamp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%9 = load float, float* %4
%10 = load float, float* %5
%11 = fsub float %9, %10
%12 = call float @fabs(float %11)
store float %12, float* %7
%13 = load float, float* %4
%14 = load float, float* %6
%15 = fsub float %13, %14
%16 = call float @fabs(float %15)
store float %16, float* %8
%17 = load float, float* %7
%18 = load float, float* %5
%19 = fadd float %17, %18
%20 = load float, float* %6
%21 = fadd float %19, %20
store float %21, float* %4
%22 = load float, float* %8
%23 = load float, float* %4
%24 = fsub float %23, %22
store float %24, float* %4
%25 = load float, float* %4
%26 = fpext float %25 to double
%27 = fmul double %26, 5.000000e-01
%28 = fptrunc double %27 to float
store float %28, float* %4
%29 = load float, float* %4
ret float %29
}

LLVM IR (-O2):
define float @f_clamp(float %0, float %1, float %2) {
%4 = fsub float %0, %1
%5 = tail call float @llvm.fabs.f32(float %4)
%6 = fsub float %0, %2
%7 = tail call float @llvm.fabs.f32(float %6)
%8 = fadd float %5, %1
%9 = fadd float %8, %2
%10 = fsub float %9, %7
%11 = fmul float %10, 5.000000e-01
ret float %11
}
/* Variables and functions */
int csub(int);
int foo__Fi(int x) { return csub(x / 2); }


x86 assembly (clang, -O0):
<foo__Fi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <csub@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo__Fi>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %eax,%edi
sar    %edi
jmp    1030 <csub@plt>

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

LLVM IR (-O2):
define i32 @foo__Fi(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = tail call i32 @csub(i32 %2)
ret i32 %3
}
/* Variables and functions */
int write_block(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                int /*<<< orphan*/, int /*<<< orphan*/);
int setAnlogReadResolution(int bits) {
  return write_block(31, bits, 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<setAnlogReadResolution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1f,%edi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <write_block@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setAnlogReadResolution>:
mov    %edi,%esi
mov    $0x1f,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <write_block@plt>

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

LLVM IR (-O2):
define i32 @setAnlogReadResolution(i32 %0) {
%2 = tail call i32 @write_block(i32 31, i32 %0, i32 0, i32 0, i32 0, i32 0)
ret i32 %2
}
unsigned long dp_crc32(unsigned char *buf, int len) {
  return ~dp_crc32_inc(buf, len, 0xffffffff);
}


x86 assembly (clang, -O0):
<dp_crc32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0xffffffff,%edx
mov    $0x0,%al
call   1030 <dp_crc32_inc@plt>
xor    $0xffffffff,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dp_crc32>:
push   %rax
mov    $0xffffffff,%edx
xor    %eax,%eax
call   1030 <dp_crc32_inc@plt>
not    %eax
cltq
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @dp_crc32(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @dp_crc32_inc to i32 (i8*, i32, i32, ...)*)(i8* %0, i32 %1, i32 -1)
%4 = xor i32 %3, -1
%5 = sext i32 %4 to i64
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void *liftoff(void *arg) {
  int a = *(int *)arg;
  while (a) {
    printf(" %d ", a--);
  }
  printf("Lift off...\n");
  return (void *)0;
}


x86 assembly (clang, -O0):
<liftoff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114d <liftoff+0x3d>
mov    -0xc(%rbp),%esi
mov    %esi,%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1125 <liftoff+0x15>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<liftoff>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%ebx
test   %ebx,%ebx
je     1151 <liftoff+0x31>
lea    0xecf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebx
jne    1140 <liftoff+0x20>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c" %d \00"
@.str.1 = [13 x i8] c"Lift off...\0A\00"
define i8* @liftoff(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
br label %7
7: ; preds = %10, %1
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, -1
store i32 %12, i32* %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %7
14: ; preds = %7
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [5 x i8] c" %d \00"
@str = [12 x i8] c"Lift off...\00"
define noalias i8* @liftoff(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %7, %5 ], [ %3, %1 ]
%7 = add nsw i32 %6, -1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %1
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i8* null
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int timestamp_ns();
uint64_t timestamp_ms() { return timestamp_ns() / 1000 / 1000; }


x86 assembly (clang, -O0):
<timestamp_ms>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <timestamp_ns@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    $0x3e8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<timestamp_ms>:
push   %rax
xor    %eax,%eax
call   1030 <timestamp_ns@plt>
cltq
imul   $0x431bde83,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x32,%rax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @timestamp_ms() {
%1 = call i32 (...) @timestamp_ns()
%2 = sdiv i32 %1, 1000
%3 = sdiv i32 %2, 1000
ret i32 %3
}

LLVM IR (-O2):
define i32 @timestamp_ms() {
%1 = tail call i32 (...) @timestamp_ns()
%2 = sdiv i32 %1, 1000000
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
int read_int24(FILE *in) {
  int num;
  num = getc(in);
  if (num == EOF) {
    return 0;
  }
  num |= (getc(in) << 8);
  num |= (getc(in) << 16);
  return num;
}


x86 assembly (clang, -O0):
<read_int24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2eb6(%rip),%rcx
cmp    (%rcx),%eax
jne    1146 <read_int24+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1170 <read_int24+0x60>
mov    -0x10(%rbp),%rdi
call   1030 <getc@plt>
shl    $0x8,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getc@plt>
shl    $0x10,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int24>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <getc@plt>
mov    %eax,%r14d
mov    0x2ec2(%rip),%rcx
xor    %eax,%eax
cmp    (%rcx),%r14d
je     114a <read_int24+0x3a>
mov    %rbx,%rdi
call   1030 <getc@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
or     %r14d,%ebp
mov    %rbx,%rdi
call   1030 <getc@plt>
shl    $0x10,%eax
or     %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @read_int24(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %12, label %5
5: ; preds = %1
%6 = tail call i32 @getc(i32* %0)
%7 = shl i32 %6, 8
%8 = or i32 %7, %2
%9 = tail call i32 @getc(i32* %0)
%10 = shl i32 %9, 16
%11 = or i32 %8, %10
br label %12
12: ; preds = %1, %5
%13 = phi i32 [ %11, %5 ], [ 0, %1 ]
ret i32 %13
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ mp2vstart_init(int *, int);
void mp2vpicx_init(uint8_t *p_mp2vpic) {
  mp2vstart_init(p_mp2vpic, 0xb5);
  p_mp2vpic[4] = (8 << 4) & 0xf0;
  p_mp2vpic[7] = 0;
  p_mp2vpic[8] = 0;
}


x86 assembly (clang, -O0):
<mp2vpicx_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xb5,%esi
call   1030 <mp2vstart_init@plt>
mov    -0x8(%rbp),%rax
movl   $0x80,0x10(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x1c(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x20(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vpicx_init>:
push   %rbx
mov    %rdi,%rbx
mov    $0xb5,%esi
call   1030 <mp2vstart_init@plt>
movl   $0x80,0x10(%rbx)
movq   $0x0,0x1c(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @mp2vpicx_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @mp2vstart_init(i32* %3, i32 181)
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 4
store i32 128, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 7
store i32 0, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 8
store i32 0, i32* %10
ret void
}

LLVM IR (-O2):
define void @mp2vpicx_init(i32* %0) {
%2 = tail call i32 @mp2vstart_init(i32* %0, i32 181)
%3 = getelementptr inbounds i32, i32* %0, i64 4
store i32 128, i32* %3
%4 = getelementptr inbounds i32, i32* %0, i64 7
store i32 0, i32* %4
%5 = getelementptr inbounds i32, i32* %0, i64 8
store i32 0, i32* %5
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int std_bind(int, struct sockaddr const *, int /*<<< orphan*/);
int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen) {
  return std_bind(sockfd, addr, addrlen);
}


x86 assembly (clang, -O0):
<bind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <std_bind@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bind>:
jmp    1030 <std_bind@plt>

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

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @bind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = tail call i32 @std_bind(i32 %0, %struct.sockaddr* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
double RAND_MAX;
double rand();
long TestingMostlyEqual(long index, long total) {
  return 1000 + rand() * 1.0 / RAND_MAX * 4;
}


x86 assembly (clang, -O0):
<TestingMostlyEqual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  0xee1(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    0x2eae(%rip),%rax
divsd  (%rax),%xmm0
movsd  0xeba(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestingMostlyEqual>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
divsd  (%rax),%xmm0
mulsd  0xed5(%rip),%xmm0
addsd  0xed5(%rip),%xmm0
cvttsd2si %xmm0,%rax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i64 @TestingMostlyEqual(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call double (...) @rand()
%6 = fmul double %5, 1.000000e+00
%7 = load double, double* @RAND_MAX
%8 = fdiv double %6, %7
%9 = call double @llvm.fmuladd.f64(double %8, double 4.000000e+00, double 1.000000e+03)
%10 = fptosi double %9 to i64
ret i64 %10
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i64 @TestingMostlyEqual(i64 %0, i64 %1) {
%3 = tail call double (...) @rand()
%4 = load double, double* @RAND_MAX
%5 = fdiv double %3, %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double 4.000000e+00, double 1.000000e+03)
%7 = fptosi double %6 to i64
ret i64 %7
}
/* Type definitions */
struct addrinfo {
  int /*<<< orphan*/ ai_socktype;
  int /*<<< orphan*/ ai_family;
};

/* Variables and functions */
int /*<<< orphan*/ AF_UNSPEC;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ memset(struct addrinfo *, int /*<<< orphan*/, int);
struct addrinfo *getsockhints(void) {
  static struct addrinfo hints;
  memset(&hints, 0, sizeof(struct addrinfo));
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_STREAM;
  return &hints;
}


x86 assembly (clang, -O0):
<getsockhints>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f11(%rip),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x2efa(%rip)
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x2ee7(%rip)
lea    0x2ee0(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsockhints>:
push   %rbx
lea    0x2f14(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x2efa(%rip)
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x2ee7(%rip)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.addrinfo = type { i32, i32 }
@getsockhints.hints = internal global %struct.addrinfo zeroinitializer
@AF_UNSPEC = global i32 0
@SOCK_STREAM = global i32 0
define %struct.addrinfo* @getsockhints() {
%1 = call i32 @memset(%struct.addrinfo* @getsockhints.hints, i32 0, i32 8)
%2 = load i32, i32* @AF_UNSPEC
store i32 %2, i32* getelementptr inbounds (%struct.addrinfo, %struct.addrinfo* @getsockhints.hints, i32 0, i32 1)
%3 = load i32, i32* @SOCK_STREAM
store i32 %3, i32* getelementptr inbounds (%struct.addrinfo, %struct.addrinfo* @getsockhints.hints, i32 0, i32 0)
ret %struct.addrinfo* @getsockhints.hints
}

LLVM IR (-O2):
%struct.addrinfo = type { i32, i32 }
@getsockhints.hints = internal global %struct.addrinfo zeroinitializer
@AF_UNSPEC = global i32 0
@SOCK_STREAM = global i32 0
define %struct.addrinfo* @getsockhints() {
%1 = tail call i32 @memset(%struct.addrinfo* @getsockhints.hints, i32 0, i32 8)
%2 = load i32, i32* @AF_UNSPEC
store i32 %2, i32* getelementptr inbounds (%struct.addrinfo, %struct.addrinfo* @getsockhints.hints, i64 0, i32 1)
%3 = load i32, i32* @SOCK_STREAM
store i32 %3, i32* getelementptr inbounds (%struct.addrinfo, %struct.addrinfo* @getsockhints.hints, i64 0, i32 0)
ret %struct.addrinfo* @getsockhints.hints
}
int xyz() {
  printf("\n %s: \n", __func__);
  printf("begin of app functionality\n");
  return 0;
}


x86 assembly (clang, -O0):
<xyz>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee6(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xyz>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed9(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"\0A %s: \0A\00"
@__func__.xyz = [4 x i8] c"xyz\00"
@.str.1 = [28 x i8] c"begin of app functionality\0A\00"
define i32 @xyz() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.xyz, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"\0A %s: \0A\00"
@__func__.xyz = [4 x i8] c"xyz\00"
@str = [27 x i8] c"begin of app functionality\00"
define i32 @xyz() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.xyz, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ oom();
char *strdup(char const *);
char *mstrdup(const char *p) {
  char *n = strdup(p);
  if (n == NULL)
    oom();
  return n;
}


x86 assembly (clang, -O0):
<mstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <mstrdup+0x2b>
mov    $0x0,%al
call   1030 <oom@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <mstrdup+0x15>
xor    %eax,%eax
call   1030 <oom@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @oom()
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @mstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @oom()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void setOM() {}


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

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

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

LLVM IR (-O2):
define void @setOM() {
ret void
}
void PDMR3CritSectDelete(void) {}


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

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

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

LLVM IR (-O2):
define void @PDMR3CritSectDelete() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ count(char *, int *);
int numDecodings(char *s) {
  int ret = 0;
  if (s && *s)
    count(s, &ret);
  return ret;
}


x86 assembly (clang, -O0):
<numDecodings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <numDecodings+0x3b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114b <numDecodings+0x3b>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <count@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numDecodings>:
push   %rax
movl   $0x0,0x4(%rsp)
xor    %eax,%eax
test   %rdi,%rdi
je     1133 <numDecodings+0x23>
cmpb   $0x0,(%rdi)
je     1133 <numDecodings+0x23>
lea    0x4(%rsp),%rsi
call   1030 <count@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @numDecodings(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = icmp eq i8* %0, null
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = call i32 @count(i8* %0, i32* %2)
%10 = load i32, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = phi i32 [ %10, %8 ], [ 0, %5 ], [ 0, %1 ]
ret i32 %12
}
int dlz_version(unsigned int *flags) {
  (void)(flags);
  return (2);
}


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

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

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

LLVM IR (-O2):
define i32 @dlz_version(i32* nocapture readnone %0) {
ret i32 2
}
double atan2(double y, double x) {
  double res = 0.0;
  asm volatile("fpatan" : "=t"(res) : "u"(y), "0"(x) : "st(1)");
  return res;
}


x86 assembly (clang, -O0):
<atan2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
fldl   -0x20(%rbp)
fldl   -0x28(%rbp)
fpatan
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan2>:
movsd  %xmm0,-0x8(%rsp)
movsd  %xmm1,-0x10(%rsp)
fldl   -0x8(%rsp)
fldl   -0x10(%rsp)
fpatan
fstpl  -0x18(%rsp)
movsd  -0x18(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @atan2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 0.000000e+00, double* %5
%6 = load double, double* %3
%7 = load double, double* %4
%8 = call double asm sideeffect "fpatan", "={st},{st(1)},0,~{st(1)},~{dirflag},~{fpsr},~{flags}"(double %6, double %7)
store double %8, double* %5
%9 = load double, double* %5
ret double %9
}

LLVM IR (-O2):
define double @atan2(double %0, double %1) {
%3 = tail call double asm sideeffect "fpatan", "={st},{st(1)},0,~{st(1)},~{dirflag},~{fpsr},~{flags}"(double %0, double %1)
ret double %3
}
int op(volatile struct obj *op, int i) { return i; }


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

x86 assembly (clang, -O2):
<op>:
mov    %esi,%eax
ret

LLVM IR (-O0):
%struct.obj = type opaque
define i32 @op(%struct.obj* %0, i32 %1) {
%3 = alloca %struct.obj*
%4 = alloca i32
store %struct.obj* %0, %struct.obj** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.obj = type opaque
define i32 @op(%struct.obj* nocapture readnone %0, i32 returned %1) {
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ exit(int);
int msgctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int work_queue_destroy_(int *msqids) {
  int i;
  for (i = 0; i < 1; i++) {
    if (msgctl(msqids[i], IPC_RMID, NULL) == -1) {
      perror("msgctl");
      exit(1);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<work_queue_destroy_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    119c <work_queue_destroy_+0x6c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    0x2e81(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <msgctl@plt>
cmp    $0xffffffff,%eax
jne    1189 <work_queue_destroy_+0x59>
lea    0xe86(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    118e <work_queue_destroy_+0x5e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <work_queue_destroy_+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<work_queue_destroy_>:
push   %rax
mov    (%rdi),%edi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <msgctl@plt>
cmp    $0xffffffff,%eax
je     114c <work_queue_destroy_+0x1c>
xor    %eax,%eax
pop    %rcx
ret
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
@.str = [7 x i8] c"msgctl\00"
define i32 @work_queue_destroy_(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %20, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %23
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = load i32, i32* @IPC_RMID
%14 = call i32 @msgctl(i32 %12, i32 %13, i32* null)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %19
16: ; preds = %7
%17 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %7
br label %20
20: ; preds = %19
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %4
23: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
@.str = [7 x i8] c"msgctl\00"
define i32 @work_queue_destroy_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = load i32, i32* @IPC_RMID
%4 = tail call i32 @msgctl(i32 %2, i32 %3, i32* null)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t Sigma1(uint32_t x) {
  return (x >> 6 | x << 26) ^ (x >> 11 | x << 21) ^ (x >> 25 | x << 7);
}


x86 assembly (clang, -O0):
<Sigma1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x6,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1a,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0xb,%ecx
mov    -0x4(%rbp),%edx
shl    $0x15,%edx
or     %edx,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x19,%ecx
mov    -0x4(%rbp),%edx
shl    $0x7,%edx
or     %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sigma1>:
mov    %edi,%eax
sar    $0x6,%eax
mov    %edi,%ecx
shl    $0x1a,%ecx
or     %eax,%ecx
mov    %edi,%eax
sar    $0xb,%eax
mov    %edi,%edx
shl    $0x15,%edx
or     %eax,%edx
xor    %ecx,%edx
mov    %edi,%eax
sar    $0x19,%eax
shl    $0x7,%edi
or     %edi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @Sigma1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 6
%5 = load i32, i32* %2
%6 = shl i32 %5, 26
%7 = or i32 %4, %6
%8 = load i32, i32* %2
%9 = ashr i32 %8, 11
%10 = load i32, i32* %2
%11 = shl i32 %10, 21
%12 = or i32 %9, %11
%13 = xor i32 %7, %12
%14 = load i32, i32* %2
%15 = ashr i32 %14, 25
%16 = load i32, i32* %2
%17 = shl i32 %16, 7
%18 = or i32 %15, %17
%19 = xor i32 %13, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @Sigma1(i32 %0) {
%2 = ashr i32 %0, 6
%3 = shl i32 %0, 26
%4 = or i32 %2, %3
%5 = ashr i32 %0, 11
%6 = shl i32 %0, 21
%7 = or i32 %5, %6
%8 = xor i32 %4, %7
%9 = ashr i32 %0, 25
%10 = shl i32 %0, 7
%11 = or i32 %9, %10
%12 = xor i32 %8, %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ a_fetch_add(int volatile *, int);
void a_dec(volatile int *p) { a_fetch_add(p, -1); }


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

x86 assembly (clang, -O2):
<a_dec>:
mov    $0xffffffff,%esi
jmp    1030 <a_fetch_add@plt>

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

LLVM IR (-O2):
define void @a_dec(i32* %0) {
%2 = tail call i32 @a_fetch_add(i32* %0, i32 -1)
ret void
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  int x, y;
  int r = rand();
  if (r >= 0) {
    rand();
    y = rand();
    x = 42;
  } else {
    y = rand();
    x = 7;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     1157 <main+0x47>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
movl   $0x2a,-0x14(%rbp)
jmp    1168 <main+0x58>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
movl   $0x7,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
test   %ebx,%ebx
js     1133 <main+0x23>
xor    %eax,%eax
call   1030 <rand@plt>
mov    $0x2a,%eax
pop    %rbx
ret
mov    $0x7,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (...) @rand()
store i32 %9, i32* %8
%10 = load i32, i32* %8
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 (...) @rand()
%14 = call i32 (...) @rand()
store i32 %14, i32* %7
store i32 42, i32* %6
br label %17
15: ; preds = %2
%16 = call i32 (...) @rand()
store i32 %16, i32* %7
store i32 7, i32* %6
br label %17
17: ; preds = %15, %12
%18 = load i32, i32* %6
ret i32 %18
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = icmp sgt i32 %3, -1
%5 = tail call i32 (...) @rand()
br i1 %4, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @rand()
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 42, %6 ], [ 7, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_split_in_place() {
  printf("NOT IMPLEMENTED:"
         "pa_split_in_place"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_split_in_place\00"
define i32 @pa_split_in_place() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *consumidor(int *buffer) {
  int tmp;
  int count = 0;
  while (count < 3) {
  }
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<consumidor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    1132 <consumidor+0x22>
jmp    1123 <consumidor+0x13>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @consumidor(i32* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t _swap32(uint32_t v) {
  uint8_t *ptr = (void *)&v;
  uint8_t tmp;
  tmp = ptr[3];
  ptr[3] = ptr[0];
  ptr[0] = tmp;
  tmp = ptr[2];
  ptr[2] = ptr[1];
  ptr[1] = tmp;
  return v;
}


x86 assembly (clang, -O0):
<_swap32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_swap32(i32 %0) {
ret i32 poison
}