xunge/DecIR huggingface dataset:
long lrintf(float x) {
  long r;
  __asm__("fistpl %0" : "=m"(r) : "t"(x) : "st");
  return r;
}


x86 assembly (clang, -O0):
<lrintf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
flds   -0x14(%rbp)
fistpl -0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrintf>:
movss  %xmm0,-0xc(%rsp)
flds   -0xc(%rsp)
fistpl -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @lrintf(float %0) {
%2 = alloca float
%3 = alloca i64
store float %0, float* %2
%4 = load float, float* %2
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @lrintf(float %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = load i64, i64* %2
ret i64 %4
}
/* Variables and functions */
float __nv_fdiv_ru(float, float);
float __fdiv_ru(float __a, float __b) { return __nv_fdiv_ru(__a, __b); }


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

x86 assembly (clang, -O2):
<__fdiv_ru>:
jmp    1030 <__nv_fdiv_ru@plt>

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

LLVM IR (-O2):
define float @__fdiv_ru(float %0, float %1) {
%3 = tail call float @__nv_fdiv_ru(float %0, float %1)
ret float %3
}
void rotr(int *a, int *b, int *c) {
  int help = 0;
  help = *a;
  *a = *c;
  *c = *b;
  *b = help;
}


x86 assembly (clang, -O0):
<rotr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr>:
mov    (%rdi),%eax
mov    (%rdx),%ecx
mov    %ecx,(%rdi)
mov    (%rsi),%ecx
mov    %ecx,(%rdx)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @rotr(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
store i32 0, i32* %7
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
store i32 %9, i32* %7
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = load i32*, i32** %4
store i32 %11, i32* %12
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = load i32*, i32** %6
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = load i32*, i32** %5
store i32 %16, i32* %17
ret void
}

LLVM IR (-O2):
define void @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %2
store i32 %5, i32* %0
%6 = load i32, i32* %1
store i32 %6, i32* %2
store i32 %4, i32* %1
ret void
}
void predefine_macros(void) {}


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

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

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

LLVM IR (-O2):
define void @predefine_macros() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(int /*<<< orphan*/);
int is_number(char *str) {
  while (*str) {
    if (!isdigit(*str++))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <is_number+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1155 <is_number+0x45>
movl   $0x0,-0x4(%rbp)
jmp    1161 <is_number+0x51>
jmp    111c <is_number+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_number>:
movsbl (%rdi),%eax
test   %eax,%eax
je     1116 <is_number+0x16>
add    $0x1,%rdi
add    $0xffffffd0,%eax
cmp    $0xa,%eax
jb     1100 <is_number>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_number(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = sext i8 %4 to i32
%9 = add nsw i32 %8, -48
%10 = icmp ult i32 %9, 10
br i1 %10, label %2, label %11
11: ; preds = %2, %6
%12 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %12
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ window;
};
typedef TYPE_1__ XExposeEvent;

/* Variables and functions */
unsigned long get_XExposeEvent_window(void *_p) {
  return (unsigned long)((XExposeEvent *)_p)->window;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XExposeEvent_window(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XExposeEvent_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ STDERR_FILENO;
void *malloc(size_t);
int /*<<< orphan*/ usleep(int);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void *safemalloc(size_t size) {
  void *var;
  while ((var = malloc(size)) == NULL) {
    write(STDERR_FILENO, "malloc failed, reattempting in half second...\n", 46);
    usleep(500);
  }
  return var;
}


x86 assembly (clang, -O0):
<safemalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    117c <safemalloc+0x4c>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
mov    $0x2e,%edx
call   1030 <write@plt>
mov    $0x1f4,%edi
call   1050 <usleep@plt>
jmp    113c <safemalloc+0xc>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safemalloc>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
jne    1177 <safemalloc+0x47>
mov    0x2e97(%rip),%r15
lea    0xeb0(%rip),%r14
mov    (%r15),%edi
mov    %r14,%rsi
mov    $0x2e,%edx
call   1030 <write@plt>
mov    $0x1f4,%edi
call   1050 <usleep@plt>
mov    %rbx,%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     1150 <safemalloc+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@STDERR_FILENO = global i32 0
@.str = [47 x i8] c"malloc failed, reattempting in half second...\0A\00"
define i8* @safemalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
br label %4
4: ; preds = %8, %1
%5 = load i64, i64* %2
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i32, i32* @STDERR_FILENO
%10 = call i32 @write(i32 %9, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 46)
%11 = call i32 @usleep(i32 500)
br label %4
12: ; preds = %4
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@STDERR_FILENO = global i32 0
@.str = [47 x i8] c"malloc failed, reattempting in half second...\0A\00"
define noalias i8* @safemalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %10
4: ; preds = %1, %4
%5 = load i32, i32* @STDERR_FILENO
%6 = tail call i32 @write(i32 %5, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 46)
%7 = tail call i32 @usleep(i32 500)
%8 = tail call i8* @malloc(i64 %0)
%9 = icmp eq i8* %8, null
br i1 %9, label %4, label %10
10: ; preds = %4, %1
%11 = phi i8* [ %2, %1 ], [ %8, %4 ]
ret i8* %11
}
void foo(int a) {}


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

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

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

LLVM IR (-O2):
define void @foo(i32 %0) {
ret void
}
test03(const char *s1) {
  return __builtin_strlen(__builtin_assume_aligned(s1, 4));
}


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

x86 assembly (clang, -O2):
<test03>:
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @test03(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @test03(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
int m10mo_status_fac(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @m10mo_status_fac() {
ret i32 0
}
float rsqrt1(float x) {
  float xhalf = 0.5f * x;
  int i = *(int *)&x;
  i = 0x5f37599e - (i >> 1);
  x = *(float *)&i;
  x = x * (1.5f - xhalf * x * x);
  x = x * (1.5f - xhalf * x * x);
  return x;
}


x86 assembly (clang, -O0):
<rsqrt1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f37599e,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe98(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe5e(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rsqrt1>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f37599e,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
mulss  0xee7(%rip),%xmm0
movaps %xmm0,%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm1,%xmm2
movss  0xed8(%rip),%xmm3
addss  %xmm3,%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm2,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm3,%xmm0
mulss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @rsqrt1(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store float %0, float* %2
%5 = load float, float* %2
%6 = fmul float 5.000000e-01, %5
store float %6, float* %3
%7 = bitcast float* %2 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = ashr i32 %9, 1
%11 = sub nsw i32 1597462942, %10
store i32 %11, i32* %4
%12 = bitcast i32* %4 to float*
%13 = load float, float* %12
store float %13, float* %2
%14 = load float, float* %2
%15 = load float, float* %3
%16 = load float, float* %2
%17 = fmul float %15, %16
%18 = load float, float* %2
%19 = fneg float %17
%20 = call float @llvm.fmuladd.f32(float %19, float %18, float 1.500000e+00)
%21 = fmul float %14, %20
store float %21, float* %2
%22 = load float, float* %2
%23 = load float, float* %3
%24 = load float, float* %2
%25 = fmul float %23, %24
%26 = load float, float* %2
%27 = fneg float %25
%28 = call float @llvm.fmuladd.f32(float %27, float %26, float 1.500000e+00)
%29 = fmul float %22, %28
store float %29, float* %2
%30 = load float, float* %2
ret float %30
}

LLVM IR (-O2):
define float @rsqrt1(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597462942, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %0, -5.000000e-01
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.500000e+00)
%9 = fmul float %8, %5
%10 = fmul float %6, %9
%11 = tail call float @llvm.fmuladd.f32(float %10, float %9, float 1.500000e+00)
%12 = fmul float %9, %11
ret float %12
}
int fixedPointCV(float Val, int whole, int fract) { return 0; }


x86 assembly (clang, -O0):
<fixedPointCV>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fixedPointCV(float %0, i32 %1, i32 %2) {
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
store float %0, float* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @fixedPointCV(float %0, i32 %1, i32 %2) {
ret i32 0
}
void startCounter(int n, int interr) {
  int volatile *IO = (int *)(0x3c000000 + 5 * 0x00000020);
  int interrupt;
  interrupt = (interr == 0 ? 0x00000000 : 0x80000000);
  *IO = (interrupt | 0x40000000 | (0x3fffffff & n));
}


x86 assembly (clang, -O0):
<startCounter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x3c0000a0,%eax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edx
mov    $0x80000000,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
or     $0x40000000,%ecx
mov    -0x4(%rbp),%eax
and    $0x3fffffff,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<startCounter>:
test   %esi,%esi
mov    $0x40000000,%eax
mov    $0xc0000000,%ecx
cmove  %eax,%ecx
and    $0x3fffffff,%edi
or     %ecx,%edi
mov    %edi,0x3c0000a0
ret

LLVM IR (-O0):
define void @startCounter(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32* inttoptr (i64 1006633120 to i32*), i32** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 -2147483648
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = or i32 %11, 1073741824
%13 = load i32, i32* %3
%14 = and i32 1073741823, %13
%15 = or i32 %12, %14
%16 = load i32*, i32** %5
store volatile i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @startCounter(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 1073741824, i32 -1073741824
%5 = and i32 %0, 1073741823
%6 = or i32 %4, %5
store volatile i32 %6, i32* inttoptr (i64 1006633120 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ proc(int *, int *);
main() {
  int z = 1;
  proc(&z, &z);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
lea    -0x4(%rbp),%rsi
mov    %rsi,%rdi
call   1030 <proc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    %rdi,%rsi
call   1030 <proc@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = call i32 @proc(i32* %1, i32* %1)
ret i32 0
}
int num(char c) {
  if (c >= '0' && c <= '9')
    return c - '0';
  return -1;
}


x86 assembly (clang, -O0):
<num>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <num+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <num+0x33>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    113a <num+0x3a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num>:
lea    -0x30(%rdi),%eax
lea    -0x30(%rdi),%ecx
cmp    $0xa,%al
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @num(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
store i32 %14, i32* %2
br label %16
15: ; preds = %7, %1
store i32 -1, i32* %2
br label %16
16: ; preds = %15, %11
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @num(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -48
%6 = select i1 %3, i32 %5, i32 -1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int quotes_reload();
void quotes_modified(void) { printf("RELOAD: %d\n", quotes_reload()); }


x86 assembly (clang, -O0):
<quotes_modified>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <quotes_reload@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<quotes_modified>:
push   %rax
xor    %eax,%eax
call   1030 <quotes_reload@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"RELOAD: %d\0A\00"
define void @quotes_modified() {
%1 = call i32 (...) @quotes_reload()
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"RELOAD: %d\0A\00"
define void @quotes_modified() {
%1 = tail call i32 (...) @quotes_reload()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
long atomic_dec_long(volatile long *value) {
  return __sync_sub_and_fetch(value, 1);
}


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

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

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

LLVM IR (-O2):
define i64 @atomic_dec_long(i64* nocapture %0) {
%2 = atomicrmw sub i64* %0, i64 1 seq_cst
%3 = add i64 %2, -1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ ws_disconnect(void *);
void ws_free(void *ws) {
  ws_disconnect(ws);
  free(ws);
}


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

x86 assembly (clang, -O2):
<ws_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ws_disconnect@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @ws_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ws_disconnect(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @ws_free(i8* %0) {
%2 = tail call i32 @ws_disconnect(i8* %0)
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_shufflelo_epi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_shufflelo_epi16(__m128i A) { return _mm_shufflelo_epi16(A, 0); }


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

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

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

LLVM IR (-O2):
define i32 @test_mm_shufflelo_epi16(i32 %0) {
%2 = tail call i32 @_mm_shufflelo_epi16(i32 %0, i32 0)
ret i32 %2
}
void bones_timer_stop() {}


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

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

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

LLVM IR (-O2):
define void @bones_timer_stop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ script_write_byte(int);
void script_wait_for_light() {
  script_write_byte(147);
  script_write_byte(4);
  script_write_byte(158);
  script_write_byte(18);
}


x86 assembly (clang, -O0):
<script_wait_for_light>:
push   %rbp
mov    %rsp,%rbp
mov    $0x93,%edi
call   1030 <script_write_byte@plt>
mov    $0x4,%edi
call   1030 <script_write_byte@plt>
mov    $0x9e,%edi
call   1030 <script_write_byte@plt>
mov    $0x12,%edi
call   1030 <script_write_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<script_wait_for_light>:
push   %rax
mov    $0x93,%edi
call   1030 <script_write_byte@plt>
mov    $0x4,%edi
call   1030 <script_write_byte@plt>
mov    $0x9e,%edi
call   1030 <script_write_byte@plt>
mov    $0x12,%edi
pop    %rax
jmp    1030 <script_write_byte@plt>

LLVM IR (-O0):
define void @script_wait_for_light() {
%1 = call i32 @script_write_byte(i32 147)
%2 = call i32 @script_write_byte(i32 4)
%3 = call i32 @script_write_byte(i32 158)
%4 = call i32 @script_write_byte(i32 18)
ret void
}

LLVM IR (-O2):
define void @script_wait_for_light() {
%1 = tail call i32 @script_write_byte(i32 147)
%2 = tail call i32 @script_write_byte(i32 4)
%3 = tail call i32 @script_write_byte(i32 158)
%4 = tail call i32 @script_write_byte(i32 18)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printCpass(unsigned char *str, unsigned int len) {
  unsigned int i = 0;
  while (i < len) {
    printf("%c", str[i]);
    i++;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printCpass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1159 <printCpass+0x49>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movzbl (%rax,%rcx,1),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printCpass+0x16>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCpass>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1143 <printCpass+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <printCpass+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printCpass(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = tail call i32 @putchar(i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}
int test_imm_FFint8_mem(signed char *val) {
  return ((*val) & (-0xFF << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_FFint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff01,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FFint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -255
%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_FFint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -255
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
int ft_isascii(char c) { return (0 <= c && c <= 127); }


x86 assembly (clang, -O0):
<ft_isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112a <ft_isascii+0x2a>
movsbl -0x1(%rbp),%eax
cmp    $0x7f,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isascii>:
not    %dil
shr    $0x7,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @ft_isascii(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 0, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 127
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_isascii(i8 signext %0) {
%2 = xor i8 %0, -1
%3 = lshr i8 %2, 7
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int __get_array_size(char const *);
int __infer_nondet_int();
int puts(const char *str) {
  int size1;
  size1 = __get_array_size(str);
  return __infer_nondet_int();
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__get_array_size@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @__get_array_size(i8* %4)
store i32 %5, i32* %3
%6 = call i32 (...) @__infer_nondet_int()
ret i32 %6
}

LLVM IR (-O2):
define i32 @puts(i8* %0) {
%2 = tail call i32 @__get_array_size(i8* %0)
%3 = tail call i32 (...) @__infer_nondet_int()
ret i32 %3
}
/* Type definitions */
struct eucalyptus_opts {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_args(struct eucalyptus_opts *);
int /*<<< orphan*/ clear_given(struct eucalyptus_opts *);
int /*<<< orphan*/ init_args_info(struct eucalyptus_opts *);
void arguments_init(struct eucalyptus_opts *args_info) {
  clear_given(args_info);
  clear_args(args_info);
  init_args_info(args_info);
}


x86 assembly (clang, -O0):
<arguments_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <clear_given@plt>
mov    -0x8(%rbp),%rdi
call   1030 <clear_args@plt>
mov    -0x8(%rbp),%rdi
call   1050 <init_args_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arguments_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <clear_given@plt>
mov    %rbx,%rdi
call   1030 <clear_args@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <init_args_info@plt>

LLVM IR (-O0):
%struct.eucalyptus_opts = type { i32 }
define void @arguments_init(%struct.eucalyptus_opts* %0) {
%2 = alloca %struct.eucalyptus_opts*
store %struct.eucalyptus_opts* %0, %struct.eucalyptus_opts** %2
%3 = load %struct.eucalyptus_opts*, %struct.eucalyptus_opts** %2
%4 = call i32 @clear_given(%struct.eucalyptus_opts* %3)
%5 = load %struct.eucalyptus_opts*, %struct.eucalyptus_opts** %2
%6 = call i32 @clear_args(%struct.eucalyptus_opts* %5)
%7 = load %struct.eucalyptus_opts*, %struct.eucalyptus_opts** %2
%8 = call i32 @init_args_info(%struct.eucalyptus_opts* %7)
ret void
}

LLVM IR (-O2):
%struct.eucalyptus_opts = type { i32 }
define void @arguments_init(%struct.eucalyptus_opts* %0) {
%2 = tail call i32 @clear_given(%struct.eucalyptus_opts* %0)
%3 = tail call i32 @clear_args(%struct.eucalyptus_opts* %0)
%4 = tail call i32 @init_args_info(%struct.eucalyptus_opts* %0)
ret void
}
/* Variables and functions */
int rand();
int ProducirComida() {
  int n;
  n = rand() % 101;
  return n;
}


x86 assembly (clang, -O0):
<ProducirComida>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x65,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ProducirComida>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x288df0cb,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
imul   $0x65,%ecx,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ProducirComida() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 101
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @ProducirComida() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 101
ret i32 %2
}
int flipBit(int number, int bitLocation) {
  number ^= 1 << bitLocation;
  return number;
}


x86 assembly (clang, -O0):
<flipBit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @flipBit(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 = shl i32 1, %5
%7 = load i32, i32* %3
%8 = xor i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @flipBit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ printf(char *);
void *SafeMalloc(size_t size) {
  void *result;
  if ((result = malloc(size))) {
    return (result);
  } else {
    printf("memory overflow: malloc failed in SafeMalloc.");
    printf("  Exiting Program.\n");
    exit(-1);
    return (0);
  }
}


x86 assembly (clang, -O0):
<SafeMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     115d <SafeMalloc+0x2d>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<SafeMalloc>:
push   %rax
call   1050 <malloc@plt>
test   %rax,%rax
je     114d <SafeMalloc+0xd>
pop    %rcx
ret
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"memory overflow: malloc failed in SafeMalloc.\00"
@.str.1 = [20 x i8] c" Exiting Program.\0A\00"
define i8* @SafeMalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8*, i8** %3
ret i8* %8
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [46 x i8] c"memory overflow: malloc failed in SafeMalloc.\00"
@str = [19 x i8] c" Exiting Program.\00"
define noalias i8* @SafeMalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
ret i8* %2
5: ; preds = %1
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ willus_mem_free(double **, char *);
void freexyz(double **x) { willus_mem_free(x, "freexyz"); }


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

x86 assembly (clang, -O2):
<freexyz>:
lea    0xee9(%rip),%rsi
jmp    1030 <willus_mem_free@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"freexyz\00"
define void @freexyz(double** %0) {
%2 = tail call i32 @willus_mem_free(double** %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _isatty(int);
int __attribute__((weak)) isatty(int fildes) { return _isatty(fildes); }


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

x86 assembly (clang, -O2):
<isatty>:
jmp    1030 <_isatty@plt>

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

LLVM IR (-O2):
define weak i32 @isatty(i32 %0) {
%2 = tail call i32 @_isatty(i32 %0)
ret i32 %2
}
__attribute__((weak)) int test2(void) { return 0; }


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

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

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

LLVM IR (-O2):
define weak i32 @test2() {
ret i32 0
}
int sum(int n) {
  int sum;
  for (sum = 0; n > 0; sum += n % 10, n /= 10)
    ;
  return sum;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1141 <sum+0x41>
jmp    111d <sum+0x1d>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <sum+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
xor    %eax,%eax
test   %edi,%edi
jle    112d <sum+0x2d>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
add    %ecx,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <sum+0x10>
ret

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

LLVM IR (-O2):
define i32 @sum(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = urem i32 %5, 10
%7 = add nuw nsw i32 %4, %6
%8 = udiv i32 %5, 10
%9 = icmp ult i32 %5, 10
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, char *, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hola\n");
  execl("/bin/ls", "-l", "-a", (char *)0);
  printf("Adios\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
lea    0xebe(%rip),%rsi
lea    0xeba(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <execl@plt>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0xecd(%rip),%rsi
lea    0xec9(%rip),%rdx
xor    %ecx,%ecx
call   1040 <execl@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Hola\0A\00"
@.str.1 = [8 x i8] c"/bin/ls\00"
@.str.2 = [3 x i8] c"-l\00"
@.str.3 = [3 x i8] c"-a\00"
@.str.4 = [7 x i8] c"Adios\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* null)
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"/bin/ls\00"
@.str.2 = [3 x i8] c"-l\00"
@.str.3 = [3 x i8] c"-a\00"
@str = [5 x i8] c"Hola\00"
@str.5 = [6 x i8] c"Adios\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* null)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}
int lessEqual(int lhs, int rhs) { return lhs <= rhs; }


x86 assembly (clang, -O0):
<lessEqual>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lessEqual>:
xor    %eax,%eax
cmp    %esi,%edi
setle  %al
ret

LLVM IR (-O0):
define i32 @lessEqual(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 = icmp sle i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @lessEqual(i32 %0, i32 %1) {
%3 = icmp sle i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x9f() {
  Assert_real((isbdigit(159) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              800, ("isbdigit should be 0 for 0x9f"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x9f>:
push   %rax
mov    $0x9f,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x320,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x9f\00"
define void @t_isbdigit_0x9f() {
%1 = call i64 @isbdigit(i32 159)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 800, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x9f\00"
define void @t_isbdigit_0x9f() {
%1 = tail call i64 @isbdigit(i32 159)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 800, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char const *, char const *, int);
void set_env(const char *var, const char *val) { setenv(var, val, 1); }


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

x86 assembly (clang, -O2):
<set_env>:
mov    $0x1,%edx
jmp    1030 <setenv@plt>

LLVM IR (-O0):
define void @set_env(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 @setenv(i8* %5, i8* %6, i32 1)
ret void
}

LLVM IR (-O2):
define void @set_env(i8* %0, i8* %1) {
%3 = tail call i32 @setenv(i8* %0, i8* %1, i32 1)
ret void
}
/* Variables and functions */
int play(int, int);
int cd_play(int track) { return play(track, track); }


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

x86 assembly (clang, -O2):
<cd_play>:
mov    %edi,%esi
jmp    1030 <play@plt>

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

LLVM IR (-O2):
define i32 @cd_play(i32 %0) {
%2 = tail call i32 @play(i32 %0, i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_srli_epi16(int /*<<< orphan*/, int);
__m128i test_mm_srli_epi16(__m128i A) { return _mm_srli_epi16(A, 1); }


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

x86 assembly (clang, -O2):
<test_mm_srli_epi16>:
mov    $0x1,%esi
jmp    1030 <_mm_srli_epi16@plt>

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

LLVM IR (-O2):
define i32 @test_mm_srli_epi16(i32 %0) {
%2 = tail call i32 @_mm_srli_epi16(i32 %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ bar(char *);
void f2() {
  static char x[] = "hello";
  bar(x);
}


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

x86 assembly (clang, -O2):
<f2>:
lea    0x2f11(%rip),%rdi
jmp    1030 <bar@plt>

LLVM IR (-O0):
@f2.x = internal global [6 x i8] c"hello\00"
define void @f2() {
%1 = call i32 @bar(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @f2.x, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@f2.x = internal global [6 x i8] c"hello\00"
define void @f2() {
%1 = tail call i32 @bar(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @f2.x, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M531_f(char *s) {
  debug("M531_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M531_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M531_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M531_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M531_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M531_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M531_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}