xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int streql(char *s1, char *s2) { return (s1 && s2 && strcmp(s1, s2) == 0); }


x86 assembly (clang, -O0):
<streql>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1157 <streql+0x47>
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1157 <streql+0x47>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streql>:
xor    %eax,%eax
test   %rdi,%rdi
je     1131 <streql+0x21>
test   %rsi,%rsi
je     1131 <streql+0x21>
push   %rax
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @streql(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i64 @strcmp(i8* %11, i8* %12)
%14 = icmp eq i64 %13, 0
br label %15
15: ; preds = %10, %7, %2
%16 = phi i1 [ false, %7 ], [ false, %2 ], [ %14, %10 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @streql(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i64 @strcmp(i8* %0, i8* %1)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ 0, %2 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
void *malloc(int);
void *hl_gc_alloc(int size) { return malloc(size); }


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

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

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

LLVM IR (-O2):
define noalias i8* @hl_gc_alloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
void quaternion_inverse(double q_inv[4], double q[4]) {
  q_inv[0] = q[0];
  q_inv[1] = -q[1];
  q_inv[2] = -q[2];
  q_inv[3] = -q[3];
}


x86 assembly (clang, -O0):
<quaternion_inverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<quaternion_inverse>:
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
movaps 0xeec(%rip),%xmm1
xorps  %xmm1,%xmm0
movlps %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
xorps  %xmm1,%xmm0
movlps %xmm0,0x10(%rdi)
movsd  0x18(%rsi),%xmm0
xorps  %xmm1,%xmm0
movlps %xmm0,0x18(%rdi)
ret

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

LLVM IR (-O2):
define void @quaternion_inverse(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
store double %3, double* %0
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = load double, double* %4
%6 = fneg double %5
%7 = getelementptr inbounds double, double* %0, i64 1
store double %6, double* %7
%8 = getelementptr inbounds double, double* %1, i64 2
%9 = load double, double* %8
%10 = fneg double %9
%11 = getelementptr inbounds double, double* %0, i64 2
store double %10, double* %11
%12 = getelementptr inbounds double, double* %1, i64 3
%13 = load double, double* %12
%14 = fneg double %13
%15 = getelementptr inbounds double, double* %0, i64 3
store double %14, double* %15
ret void
}
/* Type definitions */
struct i8x_xctx {
  int dummy;
};
struct i8x_object {
  int dummy;
};

/* Variables and functions */
scalar_t__ i8x_ob_ref(struct i8x_object *);
struct i8x_xctx *__attribute__((always_)) i8x_xctx_ref(struct i8x_xctx *x) {
  return (struct i8x_xctx *)i8x_ob_ref((struct i8x_object *)x);
}


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

x86 assembly (clang, -O2):
<i8x_xctx_ref>:
jmp    1030 <i8x_ob_ref@plt>

LLVM IR (-O0):
%struct.i8x_xctx = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_xctx* @i8x_xctx_ref(%struct.i8x_xctx* %0) {
%2 = alloca %struct.i8x_xctx*
store %struct.i8x_xctx* %0, %struct.i8x_xctx** %2
%3 = load %struct.i8x_xctx*, %struct.i8x_xctx** %2
%4 = bitcast %struct.i8x_xctx* %3 to %struct.i8x_object*
%5 = call i64 @i8x_ob_ref(%struct.i8x_object* %4)
%6 = inttoptr i64 %5 to %struct.i8x_xctx*
ret %struct.i8x_xctx* %6
}

LLVM IR (-O2):
%struct.i8x_xctx = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_xctx* @i8x_xctx_ref(%struct.i8x_xctx* %0) {
%2 = bitcast %struct.i8x_xctx* %0 to %struct.i8x_object*
%3 = tail call i64 @i8x_ob_ref(%struct.i8x_object* %2)
%4 = inttoptr i64 %3 to %struct.i8x_xctx*
ret %struct.i8x_xctx* %4
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello, world");
  return (EXIT_SUCCESS);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello, world\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello, world\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int dlclose(void *);
int close_test_lib(void *lib) { return dlclose(lib); }


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

x86 assembly (clang, -O2):
<close_test_lib>:
jmp    1030 <dlclose@plt>

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

LLVM IR (-O2):
define i32 @close_test_lib(i8* %0) {
%2 = tail call i32 @dlclose(i8* %0)
ret i32 %2
}
void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr) {}


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

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

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

LLVM IR (-O2):
%struct.vm_area_struct = type opaque
define void @flush_tlb_page(%struct.vm_area_struct* nocapture %0, i64 %1) {
ret void
}
void input() {}


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

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

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

LLVM IR (-O2):
define void @input() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trap(char *);
void trap_nu(void) { trap("not used"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"not used\00"
define void @trap_nu() {
%1 = call i32 @trap(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"not used\00"
define void @trap_nu() {
%1 = tail call i32 @trap(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
short short_endian_swap(short i) {
  return ((i >> 8) & 0xff) + ((i << 8) & 0xff00);
}


x86 assembly (clang, -O0):
<short_endian_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
movswl -0x2(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff00,%ecx
add    %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<short_endian_swap>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define signext i16 @short_endian_swap(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = ashr i32 %4, 8
%6 = and i32 %5, 255
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = shl i32 %8, 8
%10 = and i32 %9, 65280
%11 = add nsw i32 %6, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define signext i16 @short_endian_swap(i16 signext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
scalar_t__ __builtin_gamma(double);
int /*<<< orphan*/ link_failure_builtin_gamma();
void test_builtin_gamma(double d) {
  if (__builtin_gamma(d) != __builtin_gamma(d))
    link_failure_builtin_gamma();
}


x86 assembly (clang, -O0):
<test_builtin_gamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__builtin_gamma@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__builtin_gamma@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_builtin_gamma+0x3c>
mov    $0x0,%al
call   1040 <link_failure_builtin_gamma@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_gamma>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <__builtin_gamma@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <__builtin_gamma@plt>
cmp    %rax,%rbx
jne    1149 <test_builtin_gamma+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_builtin_gamma@plt>

LLVM IR (-O0):
define void @test_builtin_gamma(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @__builtin_gamma(double %3)
%5 = load double, double* %2
%6 = call i64 @__builtin_gamma(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_builtin_gamma()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_builtin_gamma(double %0) {
%2 = tail call i64 @__builtin_gamma(double %0)
%3 = tail call i64 @__builtin_gamma(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_gamma()
br label %7
7: ; preds = %5, %1
ret void
}
int func3() { return 3; }


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

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

LLVM IR (-O0):
define i32 @func3() {
ret i32 3
}

LLVM IR (-O2):
define i32 @func3() {
ret i32 3
}
int irda_errcode(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @irda_errcode() {
ret i32 0
}
/* Variables and functions */
size_t bset_len(int num_bits) { return (num_bits + (64 - 1)) / 64; }


x86 assembly (clang, -O0):
<bset_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3f,%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<bset_len>:
lea    0x3f(%rdi),%eax
add    $0x7e,%edi
test   %eax,%eax
cmovns %eax,%edi
sar    $0x6,%edi
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @bset_len(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 63
%5 = sdiv i32 %4, 64
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @bset_len(i32 %0) {
%2 = add nsw i32 %0, 63
%3 = sdiv i32 %2, 64
%4 = sext i32 %3 to i64
ret i64 %4
}
void __debug_print(const char *function, const char *fmt, ...) {}


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

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

LLVM IR (-O0):
define void @__debug_print(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__debug_print(i8* nocapture %0, i8* nocapture %1, ...) {
ret void
}
int f3(int n, const char *p) {
  int count;
  __asm__("repne scasb"
          : "=c"(count), "+D"(p)
          : "m"(*(const char(*)[n])p), "0"(-1), "a"(0));
  return -2 - count;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0xffffffff,%ecx
xor    %eax,%eax
repnz scas %es:(%rdi),%al
mov    %ecx,-0x14(%rbp)
mov    %rdi,-0x10(%rbp)
mov    $0xfffffffe,%eax
sub    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
mov    %rsi,%rdi
xor    %eax,%eax
mov    $0xffffffff,%ecx
repnz scas %es:(%rdi),%al
mov    $0xfffffffe,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f3(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i8*, i8** %4
%10 = call { i32, i8* } asm "repne scasb", "={cx},={di},*m,0,{ax},1,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %9, i32 -1, i32 0, i8* %6)
%11 = extractvalue { i32, i8* } %10, 0
%12 = extractvalue { i32, i8* } %10, 1
store i32 %11, i32* %5
store i8* %12, i8** %4
%13 = load i32, i32* %5
%14 = sub nsw i32 -2, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f3(i32 %0, i8* %1) {
%3 = tail call { i32, i8* } asm "repne scasb", "={cx},={di},*m,0,{ax},1,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %1, i32 -1, i32 0, i8* %1)
%4 = extractvalue { i32, i8* } %3, 0
%5 = sub nsw i32 -2, %4
ret i32 %5
}
int max(int n1, int n2) { return n1 > n2 ? n1 : n2; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max(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 sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void PEM_do_header(void) {}


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

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

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

LLVM IR (-O2):
define void @PEM_do_header() {
ret void
}
void main_loop() {}


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

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

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

LLVM IR (-O2):
define void @main_loop() {
ret void
}
int smin(int a, int b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<smin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <smin+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <smin+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smin>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @smin(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 slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @smin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int strncasecmp(char const *, char const *, size_t);
int OPENSSL_strncasecmp(const char *str1, const char *str2, size_t n) {
  return strncasecmp(str1, str2, n);
}


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

x86 assembly (clang, -O2):
<OPENSSL_strncasecmp>:
jmp    1030 <strncasecmp@plt>

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

LLVM IR (-O2):
define i32 @OPENSSL_strncasecmp(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @strncasecmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
int sys$rmsrundwn(struct _fab *fab, void *err, void *suc) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(suc);
    register long int _a2 asm("rsi") = (long)(err);
    register long int _a1 asm("rdi") = (long)(fab);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x82\n\t"
                 : "=a"(resultvar)
                 : "i"(34), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$rmsrundwn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x22,%rax
int    $0x82
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$rmsrundwn>:
mov    $0x22,%rax
int    $0x82
ret

LLVM IR (-O0):
%struct._fab = type opaque
define i32 @"sys$rmsrundwn"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca %struct._fab*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._fab* %0, %struct._fab** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = load i8*, i8** %6
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._fab*, %struct._fab** %4
%17 = ptrtoint %struct._fab* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 34, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._fab = type opaque
define i32 @"sys$rmsrundwn"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint %struct._fab* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 34, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
int test_imm_B5uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xB5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B5uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xb5,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_B5uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 181
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void _Block_object_dispose(void *arg, int flag) {}


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

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

LLVM IR (-O0):
define void @_Block_object_dispose(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @_Block_object_dispose(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strfchr(char *);
char *strpair(int /*<<< orphan*/, char, char);
int _jsonIsArray(char *pcSrc, char **ppcNext) {
  char *pcEOD;
  if (*pcSrc == '[') {
    if ((pcEOD = strpair(strfchr(pcSrc), '[', ']'))) {
      *ppcNext = ++pcEOD;
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<_jsonIsArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5b,%eax
jne    118c <_jsonIsArray+0x6c>
mov    -0x10(%rbp),%rdi
call   1030 <strfchr@plt>
mov    %eax,%edi
mov    $0x5b,%esi
mov    $0x5d,%edx
call   1040 <strpair@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1187 <_jsonIsArray+0x67>
mov    -0x20(%rbp),%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1193 <_jsonIsArray+0x73>
jmp    118c <_jsonIsArray+0x6c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_jsonIsArray>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
cmpb   $0x5b,(%rdi)
jne    1155 <_jsonIsArray+0x35>
mov    %rsi,%r14
call   1030 <strfchr@plt>
mov    %eax,%edi
mov    $0x5b,%esi
mov    $0x5d,%edx
call   1040 <strpair@plt>
test   %rax,%rax
je     1155 <_jsonIsArray+0x35>
add    $0x1,%rax
mov    %rax,(%r14)
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @_jsonIsArray(i8* %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8*
store i8* %0, i8** %4
store i8** %1, i8*** %5
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 91
br i1 %10, label %11, label %21
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i32 @strfchr(i8* %12)
%14 = call i8* @strpair(i32 %13, i8 signext 91, i8 signext 93)
store i8* %14, i8** %6
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %20
16: ; preds = %11
%17 = load i8*, i8** %6
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %6
%19 = load i8**, i8*** %5
store i8* %18, i8** %19
store i32 1, i32* %3
br label %22
20: ; preds = %11
br label %21
21: ; preds = %20, %2
store i32 0, i32* %3
br label %22
22: ; preds = %21, %16
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @_jsonIsArray(i8* %0, i8** nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 91
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = tail call i32 @strfchr(i8* %0)
%7 = tail call i8* @strpair(i32 %6, i8 signext 91, i8 signext 93)
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %10, i8** %1
br label %11
11: ; preds = %2, %5, %9
%12 = phi i32 [ 1, %9 ], [ 0, %5 ], [ 0, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ strncasecmp(char *, char *, int /*<<< orphan*/);
int compare_string(char *str1, char *str2) {
  if (!strncasecmp(str1, str2, strlen(str2))) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<compare_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1040 <strncasecmp@plt>
cmp    $0x0,%eax
jne    116d <compare_string+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1174 <compare_string+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <strncasecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @compare_string(i8* nocapture %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @strncasecmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int do_530() { return 530; }


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

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

LLVM IR (-O0):
define i32 @do_530() {
ret i32 530
}

LLVM IR (-O2):
define i32 @do_530() {
ret i32 530
}
int round2(float x) {
  if (x >= 0)
    return (int)(x + .5);
  else
    return (int)(x - .5);
}


x86 assembly (clang, -O0):
<round2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     113b <round2+0x3b>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed5(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <round2+0x57>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb4(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round2>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setb   %al
cvtss2sd %xmm0,%xmm0
lea    0xeea(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @round2(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp oge float %4, 0.000000e+00
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = fadd double %8, 5.000000e-01
%10 = fptosi double %9 to i32
store i32 %10, i32* %2
br label %16
11: ; preds = %1
%12 = load float, float* %3
%13 = fpext float %12 to double
%14 = fsub double %13, 5.000000e-01
%15 = fptosi double %14 to i32
store i32 %15, i32* %2
br label %16
16: ; preds = %11, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @round2(float %0) {
%2 = fcmp ult float %0, 0.000000e+00
%3 = fpext float %0 to double
%4 = select i1 %2, double -5.000000e-01, double 5.000000e-01
%5 = fadd double %4, %3
%6 = fptosi double %5 to i32
ret i32 %6
}
/* Variables and functions */
char shftc_b(char *, char *, char *);
signed char intr_wrap_567(signed char p1, signed char p2, signed char p3) {
  return shftc_b(&p1, &p2, &p3);
}


x86 assembly (clang, -O0):
<intr_wrap_567>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
lea    -0x1(%rbp),%rdi
lea    -0x2(%rbp),%rsi
lea    -0x3(%rbp),%rdx
call   1030 <shftc_b@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_567>:
push   %rax
mov    %dil,0x7(%rsp)
mov    %sil,0x6(%rsp)
mov    %dl,0x5(%rsp)
lea    0x7(%rsp),%rdi
lea    0x6(%rsp),%rsi
lea    0x5(%rsp),%rdx
call   1030 <shftc_b@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @intr_wrap_567(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = call signext i8 @shftc_b(i8* %4, i8* %5, i8* %6)
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @intr_wrap_567(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = call signext i8 @shftc_b(i8* %4, i8* %5, i8* %6)
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int main(void) {
  unsigned int x = 1;
  unsigned int y = 0;
  while (y < 1024) {
    x = 0;
    y++;
  }
  __VERIFIER_assert(x == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x400,-0xc(%rbp)
jae    114f <main+0x3f>
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__VERIFIER_assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ db_free();
void sdb_close() { db_free(); }


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

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

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

LLVM IR (-O2):
define void @sdb_close() {
%1 = tail call i32 (...) @db_free()
ret void
}
void f1(char c, const void *p) {
  unsigned long v = (unsigned long)p;
  c;
  v;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f1(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i64
store i8 %0, i8* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i64
store i64 %7, i64* %5
%8 = load i8, i8* %3
%9 = load i64, i64* %5
ret void
}

LLVM IR (-O2):
define void @f1(i8 signext %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t sg_get_unaligned_be24(const void *p) {
  return ((const uint8_t *)p)[0] << 16 | ((const uint8_t *)p)[1] << 8 |
         ((const uint8_t *)p)[2];
}


x86 assembly (clang, -O0):
<sg_get_unaligned_be24>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0x8(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sg_get_unaligned_be24>:
mov    (%rdi),%ecx
mov    0x4(%rdi),%eax
shl    $0x10,%ecx
shl    $0x8,%eax
or     %ecx,%eax
or     0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @sg_get_unaligned_be24(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = shl i32 %6, 16
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = shl i32 %11, 8
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = bitcast i8* %14 to i32*
%16 = getelementptr inbounds i32, i32* %15, i64 2
%17 = load i32, i32* %16
%18 = or i32 %13, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @sg_get_unaligned_be24(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = shl i32 %3, 16
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = shl i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 8
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
%13 = or i32 %9, %12
ret i32 %13
}
void command_search(void) {
  printf("%s, %s, %d\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/sczzq/symmetrical-spoon/refs/heads/master/"
         "base-usage/make_study/command.c",
         __func__, 26);
  search();
}


x86 assembly (clang, -O0):
<command_search>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xeda(%rip),%rsi
lea    0xf77(%rip),%rdx
mov    $0x1a,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <search@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<command_search>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedd(%rip),%rsi
lea    0xf7a(%rip),%rdx
mov    $0x1a,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <search@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s, %s, %d\0A\00"
@.str.1 = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sczzq/symmetrical-spoon/refs/heads/master/base-usage/make_study/command.c\00"
@__func__.command_search = [15 x i8] c"command_search\00"
define void @command_search() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.command_search, i64 0, i64 0), i32 26)
%2 = call i32 (...) @search()
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s, %s, %d\0A\00"
@.str.1 = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sczzq/symmetrical-spoon/refs/heads/master/base-usage/make_study/command.c\00"
@__func__.command_search = [15 x i8] c"command_search\00"
define void @command_search() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.command_search, i64 0, i64 0), i32 26)
%2 = tail call i32 (...) @search()
ret void
}
unsigned int f60(unsigned int x, int y __attribute__((unused))) {
  return (x << 1) ^ (x >> ((-1) & (8 * sizeof(unsigned int) - 1)));
}


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

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

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

LLVM IR (-O2):
define i32 @f60(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 1)
ret i32 %3
}
int row(a)
int a;
{ return (9 * (a / 9)); }


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

x86 assembly (clang, -O2):
<row>:
movslq %edi,%rax
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
lea    (%rax,%rax,8),%eax
ret

LLVM IR (-O0):
define i32 @row(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 9
%5 = mul nsw i32 9, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @row(i32 %0) {
%2 = srem i32 %0, 9
%3 = sub i32 %0, %2
ret i32 %3
}
/* Variables and functions */
double __uniform__();
int log(double);
int THRandom_geometric(double p) {
  return ((int)(log(1 - __uniform__()) / log(p)) + 1);
}


x86 assembly (clang, -O0):
<THRandom_geometric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__uniform__@plt>
movaps %xmm0,%xmm1
movsd  0xec1(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1040 <log@plt>
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <log@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<THRandom_geometric>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <__uniform__@plt>
movsd  0xec6(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1040 <log@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1040 <log@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @THRandom_geometric(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @__uniform__()
%4 = fsub double 1.000000e+00, %3
%5 = call i32 @log(double %4)
%6 = load double, double* %2
%7 = call i32 @log(double %6)
%8 = sdiv i32 %5, %7
%9 = add nsw i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @THRandom_geometric(double %0) {
%2 = tail call double (...) @__uniform__()
%3 = fsub double 1.000000e+00, %2
%4 = tail call i32 @log(double %3)
%5 = tail call i32 @log(double %0)
%6 = sdiv i32 %4, %5
%7 = add nsw i32 %6, 1
ret i32 %7
}
/* Variables and functions */
double nan(char const *const);
float nanf(char const *const);
long double nanl(char const *const);
void do_nan_string(char const *const arg) {
  float nf = nanf(arg);
  double n = nan(arg);
  long double nl = nanl(arg);
}


x86 assembly (clang, -O0):
<do_nan_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <nanf@plt>
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <nan@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <nanl@plt>
fstpt  -0x30(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @do_nan_string(i8* %0) {
%2 = alloca i8*
%3 = alloca float
%4 = alloca double
%5 = alloca x86_fp80
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call float @nanf(i8* %6)
store float %7, float* %3
%8 = load i8*, i8** %2
%9 = call double @nan(i8* %8)
store double %9, double* %4
%10 = load i8*, i8** %2
%11 = call x86_fp80 @nanl(i8* %10)
store x86_fp80 %11, x86_fp80* %5
ret void
}

LLVM IR (-O2):
define void @do_nan_string(i8* nocapture %0) {
ret void
}
void main() {
  int i;
  int a;
  for (i = 0; i < 42; i++) {
    a = 2 * i;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2a,-0x4(%rbp)
jge    112c <main+0x2c>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <main+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
void ScaleRowDown34_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown34_NEON() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_unpackhi_pi32(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test80(__m64 a, __m64 b) { return _mm_unpackhi_pi32(a, b); }


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

x86 assembly (clang, -O2):
<test80>:
jmp    1030 <_mm_unpackhi_pi32@plt>

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

LLVM IR (-O2):
define i32 @test80(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_unpackhi_pi32(i32 %0, i32 %1)
ret i32 %3
}
int do_545() { return 545; }


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

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

LLVM IR (-O0):
define i32 @do_545() {
ret i32 545
}

LLVM IR (-O2):
define i32 @do_545() {
ret i32 545
}
_Bool add_overflow_unsigned_long(unsigned long a, unsigned long b) {
  return a > (2UL * 0x7fffffffL + 1) - b;
}


x86 assembly (clang, -O0):
<add_overflow_unsigned_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xffffffff,%ecx
sub    -0x10(%rbp),%rcx
cmp    %rcx,%rax
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_overflow_unsigned_long>:
mov    $0xffffffff,%eax
sub    %rsi,%rax
cmp    %rdi,%rax
setb   %al
ret

LLVM IR (-O0):
define zeroext i1 @add_overflow_unsigned_long(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub i64 4294967295, %6
%8 = icmp ugt i64 %5, %7
ret i1 %8
}

LLVM IR (-O2):
define zeroext i1 @add_overflow_unsigned_long(i64 %0, i64 %1) {
%3 = sub i64 4294967295, %1
%4 = icmp ult i64 %3, %0
ret i1 %4
}
int strhash(const char *str, int szhash) {
  int value = 0;
  while (*str)
    value += *str++;
  return value % szhash;
}


x86 assembly (clang, -O0):
<strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113c <strhash+0x3c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <strhash+0x12>
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1122 <strhash+0x22>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strhash+0x10>
jmp    1124 <strhash+0x24>
xor    %eax,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @strhash(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 i8*, i8** %3
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
%13 = load i8, i8* %11
%14 = sext i8 %13 to i32
%15 = load i32, i32* %5
%16 = add nsw i32 %15, %14
store i32 %16, i32* %5
br label %6
17: ; preds = %6
%18 = load i32, i32* %5
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @strhash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %12, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = sext i8 %6 to i32
%11 = add nsw i32 %7, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
%15 = phi i32 [ 0, %2 ], [ %11, %5 ]
%16 = srem i32 %15, %1
ret i32 %16
}