xunge/DecIR huggingface dataset:
int multiple(int stevilo) {
  if (stevilo % 3 == 0 || stevilo % 5 == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<multiple>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     112f <multiple+0x2f>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113b <multiple+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <multiple+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiple>:
imul   $0xaaaaaaab,%edi,%eax
add    $0x2aaaaaaa,%eax
cmp    $0x55555555,%eax
setb   %al
imul   $0xcccccccd,%edi,%ecx
add    $0x19999999,%ecx
cmp    $0x33333333,%ecx
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @multiple(i32 %0) {
%2 = srem i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = srem i32 %0, 5
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
scalar_t__ strlen(char const *);
int string_valid(const char *s) { return s && strlen(s); }


x86 assembly (clang, -O0):
<string_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     113f <string_valid+0x2f>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_valid>:
xor    %eax,%eax
test   %rdi,%rdi
je     110d <string_valid+0xd>
cmpb   $0x0,(%rdi)
setne  %al
ret

LLVM IR (-O0):
define i32 @string_valid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ false, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @string_valid(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp ne i8 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
void stop_daemon(sig) int sig;
{
  Terminate();
  return;
}


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

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

LLVM IR (-O0):
define void @stop_daemon(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @Terminate()
ret void
}

LLVM IR (-O2):
define void @stop_daemon(i32 %0) {
%2 = tail call i32 (...) @Terminate()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(float *);
int /*<<< orphan*/ printf(char *, char *);
void free_float(float *f) {
  printf("%s\n", "free_float");
  free(f);
}


x86 assembly (clang, -O0):
<free_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_float>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [11 x i8] c"free_float\00"
define void @free_float(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = load float*, float** %2
%5 = call i32 @free(float* %4)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [11 x i8] c"free_float\00"
define void @free_float(float* nocapture %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @free(float* %0)
ret void
}
void vma_adjust_trans_huge(struct vm_area_struct *vma, unsigned long start,
                           unsigned long end, long adjust_next) {}


x86 assembly (clang, -O0):
<vma_adjust_trans_huge>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.vm_area_struct = type opaque
define void @vma_adjust_trans_huge(%struct.vm_area_struct* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca %struct.vm_area_struct*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store %struct.vm_area_struct* %0, %struct.vm_area_struct** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
ret void
}

LLVM IR (-O2):
%struct.vm_area_struct = type opaque
define void @vma_adjust_trans_huge(%struct.vm_area_struct* nocapture %0, i64 %1, i64 %2, i64 %3) {
ret void
}
struct S2 *f4() {
  ;
}


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

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

LLVM IR (-O0):
%struct.S2 = type opaque
define %struct.S2* @f4() {
%1 = alloca %struct.S2*
%2 = load %struct.S2*, %struct.S2** %1
ret %struct.S2* %2
}

LLVM IR (-O2):
%struct.S2 = type opaque
define noalias %struct.S2* @f4() {
ret %struct.S2* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int ask() {
  int i;
  printf("\nLine: ");
  scanf("%d", &i);
  return i;
}


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

x86 assembly (clang, -O2):
<ask>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"\0ALine: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @ask() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"\0ALine: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @ask() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
/* Type definitions */
struct hashtable_value {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hashtable_err_value_free(struct hashtable_value *);
void hashtable_value_free(struct hashtable_value *val) {
  hashtable_err_value_free(val);
}


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

x86 assembly (clang, -O2):
<hashtable_value_free>:
jmp    1030 <hashtable_err_value_free@plt>

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

LLVM IR (-O2):
%struct.hashtable_value = type { i32 }
define void @hashtable_value_free(%struct.hashtable_value* %0) {
%2 = tail call i32 @hashtable_err_value_free(%struct.hashtable_value* %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int dobldobl_diagonal_cascade_solutions(int a, int b) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(297, &a, &b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<dobldobl_diagonal_cascade_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x18(%rbp),%rcx
mov    $0x129,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dobldobl_diagonal_cascade_solutions>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x129,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dobldobl_diagonal_cascade_solutions(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load double*, double** %6
%8 = call i32 @_ada_use_c2phc4c(i32 297, i32* %3, i32* %4, double* %7, i32 0)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @dobldobl_diagonal_cascade_solutions(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_ada_use_c2phc4c(i32 297, i32* %3, i32* %4, double* undef, i32 0)
ret i32 %5
}
/* Type definitions */
struct lxt2_wr_trace {
  int dummy;
};

/* Variables and functions */
int lxt2_wr_emit_u32(struct lxt2_wr_trace *, int);
int lxt2_wr_emit_u64(struct lxt2_wr_trace *lt, int valueh, int valuel) {
  int rc;
  if ((rc = lxt2_wr_emit_u32(lt, valueh))) {
    rc = lxt2_wr_emit_u32(lt, valuel);
  }
  return (rc);
}


x86 assembly (clang, -O0):
<lxt2_wr_emit_u64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <lxt2_wr_emit_u32@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1149 <lxt2_wr_emit_u64+0x39>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <lxt2_wr_emit_u32@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lxt2_wr_emit_u64>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
call   1030 <lxt2_wr_emit_u32@plt>
test   %eax,%eax
je     1131 <lxt2_wr_emit_u64+0x21>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <lxt2_wr_emit_u32@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.lxt2_wr_trace = type { i32 }
define i32 @lxt2_wr_emit_u64(%struct.lxt2_wr_trace* %0, i32 %1, i32 %2) {
%4 = alloca %struct.lxt2_wr_trace*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.lxt2_wr_trace* %0, %struct.lxt2_wr_trace** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load %struct.lxt2_wr_trace*, %struct.lxt2_wr_trace** %4
%9 = load i32, i32* %5
%10 = call i32 @lxt2_wr_emit_u32(%struct.lxt2_wr_trace* %8, i32 %9)
store i32 %10, i32* %7
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load %struct.lxt2_wr_trace*, %struct.lxt2_wr_trace** %4
%14 = load i32, i32* %6
%15 = call i32 @lxt2_wr_emit_u32(%struct.lxt2_wr_trace* %13, i32 %14)
store i32 %15, i32* %7
br label %16
16: ; preds = %12, %3
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
%struct.lxt2_wr_trace = type { i32 }
define i32 @lxt2_wr_emit_u64(%struct.lxt2_wr_trace* %0, i32 %1, i32 %2) {
%4 = tail call i32 @lxt2_wr_emit_u32(%struct.lxt2_wr_trace* %0, i32 %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @lxt2_wr_emit_u32(%struct.lxt2_wr_trace* %0, i32 %2)
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ %7, %6 ], [ 0, %3 ]
ret i32 %9
}
int mini18n_set_log(const char *filename) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mini18n_set_log(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *, void *, size_t const, size_t const);
void *reallocarray(void *, size_t const, size_t const);
void *checkedReallocarray(void *ptr, const size_t nmemb, const size_t size) {
  void *retVal = reallocarray(ptr, nmemb, size);
  if (retVal == NULL) {
    printf("reallocarray failed ptr %p nmemb %zu size %zu\n", ptr, nmemb, size);
    abort();
  }
  return retVal;
}


x86 assembly (clang, -O0):
<checkedReallocarray>:
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   1040 <reallocarray@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1183 <checkedReallocarray+0x53>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe89(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkedReallocarray>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <reallocarray@plt>
test   %rax,%rax
je     114e <checkedReallocarray+0x1e>
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"reallocarray failed ptr %p nmemb %zu size %zu\0A\00"
define i8* @checkedReallocarray(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = call i8* @reallocarray(i8* %8, i64 %9, i64 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %20
14: ; preds = %3
%15 = load i8*, i8** %4
%16 = load i64, i64* %5
%17 = load i64, i64* %6
%18 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %15, i64 %16, i64 %17)
%19 = call i32 (...) @abort()
unreachable
20: ; preds = %3
%21 = load i8*, i8** %7
ret i8* %21
}

LLVM IR (-O2):
@.str = [47 x i8] c"reallocarray failed ptr %p nmemb %zu size %zu\0A\00"
define i8* @checkedReallocarray(i8* %0, i64 %1, i64 %2) {
%4 = tail call i8* @reallocarray(i8* %0, i64 %1, i64 %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1, i64 %2)
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %3
ret i8* %4
}
int syscall_struct() {}


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

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

LLVM IR (-O0):
define i32 @syscall_struct() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @syscall_struct() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ eqep_init(unsigned char);
void ENCInit(unsigned char Channel) { eqep_init(Channel); }


x86 assembly (clang, -O0):
<ENCInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <eqep_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ENCInit>:
jmp    1030 <eqep_init@plt>

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

LLVM IR (-O2):
define void @ENCInit(i8 zeroext %0) {
%2 = tail call i32 @eqep_init(i8 zeroext %0)
ret void
}
/* Variables and functions */
char *bson_find_field(char *, char *, int);
int bson_find_field_as_string(char *buffer, char *field, char **data) {
  char *tmp = bson_find_field(buffer, field, 0x02);
  if (tmp) {
    *data = tmp + 4;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<bson_find_field_as_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x2,%edx
call   1030 <bson_find_field@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1160 <bson_find_field_as_string+0x50>
mov    -0x28(%rbp),%rcx
add    $0x4,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1167 <bson_find_field_as_string+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bson_find_field_as_string>:
push   %rbx
mov    %rdx,%rbx
mov    $0x2,%edx
call   1030 <bson_find_field@plt>
test   %rax,%rax
je     1131 <bson_find_field_as_string+0x21>
add    $0x4,%rax
mov    %rax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @bson_find_field_as_string(i8* %0, i8* %1, i8** nocapture writeonly %2) {
%4 = tail call i8* @bson_find_field(i8* %0, i8* %1, i32 2)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 4
store i8* %7, i8** %2
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %9
}
int test_imm_8Bint16_reg(short val) {
  return ((val) & (-0x8B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Bint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff75,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Bint16_reg>:
test   $0xff75,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Bint16_reg(i16 signext %0) {
%2 = and i16 %0, -139
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char *reg_token_advance(char *ptr, char *colname, char sep) {
  char *optr = colname;
  while (*ptr != sep && *ptr != '\0')
    *optr++ = *ptr++;
  *optr = '\0';
  return ptr;
}


x86 assembly (clang, -O0):
<reg_token_advance>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
movsbl -0x11(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x21(%rbp)
je     1141 <reg_token_advance+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1151 <reg_token_advance+0x51>
jmp    1178 <reg_token_advance+0x78>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    1119 <reg_token_advance+0x19>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg_token_advance>:
mov    %rdi,%rax
mov    (%rdi),%cl
cmp    %dl,%cl
je     1126 <reg_token_advance+0x26>
nopl   0x0(%rax)
test   %cl,%cl
je     1126 <reg_token_advance+0x26>
mov    %cl,(%rsi)
add    $0x1,%rsi
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    %dl,%cl
jne    1110 <reg_token_advance+0x10>
movb   $0x0,(%rsi)
ret

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

LLVM IR (-O2):
define i8* @reg_token_advance(i8* %0, i8* nocapture writeonly %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, %2
%6 = icmp eq i8 %4, 0
%7 = or i1 %5, %6
br i1 %7, label %18, label %8
8: ; preds = %3, %8
%9 = phi i8 [ %14, %8 ], [ %4, %3 ]
%10 = phi i8* [ %13, %8 ], [ %1, %3 ]
%11 = phi i8* [ %12, %8 ], [ %0, %3 ]
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %9, i8* %10
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, %2
%16 = icmp eq i8 %14, 0
%17 = or i1 %15, %16
br i1 %17, label %18, label %8
18: ; preds = %8, %3
%19 = phi i8* [ %0, %3 ], [ %12, %8 ]
%20 = phi i8* [ %1, %3 ], [ %13, %8 ]
store i8 0, i8* %20
ret i8* %19
}
void foo224() {}


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

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

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

LLVM IR (-O2):
define void @foo224() {
ret void
}
int test2(int b) { return b + 1; }


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

x86 assembly (clang, -O2):
<test2>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @test2(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int previous(int a[]) { return a[-1]; }


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

x86 assembly (clang, -O2):
<previous>:
mov    -0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @previous(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 -1
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @previous(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 -1
%3 = load i32, i32* %2
ret i32 %3
}
int cairo_code_draw_envAttackLabel_get_height() { return 63; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_envAttackLabel_get_height() {
ret i32 63
}

LLVM IR (-O2):
define i32 @cairo_code_draw_envAttackLabel_get_height() {
ret i32 63
}
/* Type definitions */
struct flashrom_flashctx {
  int dummy;
};

/* Variables and functions */
int spi_write_cmd(struct flashrom_flashctx *, int, int, unsigned int,
                  int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int spi_block_erase_db(struct flashrom_flashctx *flash, unsigned int addr,
                       unsigned int blocklen) {
  return spi_write_cmd(flash, 0xdb, false, addr, NULL, 0, 1 * 1000);
}


x86 assembly (clang, -O0):
<spi_block_erase_db>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0xdb,%esi
xor    %r9d,%r9d
xor    %eax,%eax
mov    %eax,%r8d
mov    %r9d,%edx
movl   $0x3e8,(%rsp)
call   1030 <spi_write_cmd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_block_erase_db>:
push   %rax
mov    %esi,%ecx
movl   $0x3e8,(%rsp)
mov    $0xdb,%esi
xor    %edx,%edx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <spi_write_cmd@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.flashrom_flashctx = type { i32 }
define i32 @spi_block_erase_db(%struct.flashrom_flashctx* %0, i32 %1, i32 %2) {
%4 = alloca %struct.flashrom_flashctx*
%5 = alloca i32
%6 = alloca i32
store %struct.flashrom_flashctx* %0, %struct.flashrom_flashctx** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %4
%8 = load i32, i32* %5
%9 = call i32 @spi_write_cmd(%struct.flashrom_flashctx* %7, i32 219, i32 0, i32 %8, i32* null, i32 0, i32 1000)
ret i32 %9
}

LLVM IR (-O2):
%struct.flashrom_flashctx = type { i32 }
define i32 @spi_block_erase_db(%struct.flashrom_flashctx* %0, i32 %1, i32 %2) {
%4 = tail call i32 @spi_write_cmd(%struct.flashrom_flashctx* %0, i32 219, i32 0, i32 %1, i32* null, i32 0, i32 1000)
ret i32 %4
}
int retPosVector(char letra, char alfabeto[]) {
  int i;
  for (i = 0; alfabeto[i]; i++) {
    if (alfabeto[i] == letra) {
      return i;
    }
  }
}


x86 assembly (clang, -O0):
<retPosVector>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115d <retPosVector+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    114a <retPosVector+0x4a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <retPosVector+0x5d>
jmp    114f <retPosVector+0x4f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <retPosVector+0x15>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @retPosVector(i8 signext %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %10, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = icmp eq i8 %6, %0
%9 = or i1 %7, %8
%10 = add nuw i64 %4, 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = trunc i64 %4 to i32
ret i32 %12
}
int isalnum(int c) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
ret i32 0
}
int is_day_legit(int day, int month) {
  if (month == 2 && day <= 28)
    return 1;
  if (month % 2 == 1 && day <= 31)
    return 1;
  if (month % 2 == 0 && day <= 30)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_day_legit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jne    112a <is_day_legit+0x2a>
cmpl   $0x1c,-0x8(%rbp)
jg     112a <is_day_legit+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1185 <is_day_legit+0x85>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1154 <is_day_legit+0x54>
cmpl   $0x1f,-0x8(%rbp)
jg     1154 <is_day_legit+0x54>
movl   $0x1,-0x4(%rbp)
jmp    1185 <is_day_legit+0x85>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    117e <is_day_legit+0x7e>
cmpl   $0x1e,-0x8(%rbp)
jg     117e <is_day_legit+0x7e>
movl   $0x1,-0x4(%rbp)
jmp    1185 <is_day_legit+0x85>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_day_legit>:
mov    $0x1,%eax
cmp    $0x1c,%edi
jg     1110 <is_day_legit+0x10>
cmp    $0x2,%esi
jne    1110 <is_day_legit+0x10>
ret
mov    %esi,%ecx
shr    $0x1f,%ecx
add    %esi,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%esi
cmp    $0x1f,%edi
jg     1126 <is_day_legit+0x26>
cmp    $0x1,%esi
je     110f <is_day_legit+0xf>
test   %esi,%esi
sete   %al
cmp    $0x1f,%edi
setl   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @is_day_legit(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 2
%4 = icmp slt i32 %0, 29
%5 = and i1 %4, %3
br i1 %5, label %16, label %6
6: ; preds = %2
%7 = srem i32 %1, 2
%8 = icmp eq i32 %7, 1
%9 = icmp slt i32 %0, 32
%10 = and i1 %9, %8
br i1 %10, label %16, label %11
11: ; preds = %6
%12 = icmp eq i32 %7, 0
%13 = icmp slt i32 %0, 31
%14 = and i1 %13, %12
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %11, %6, %2
%17 = phi i32 [ 1, %2 ], [ 1, %6 ], [ %15, %11 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int main(void) {
  int i1, i2;
  int *p1, *p2;
  i1 = 5;
  p1 = &i1;
  i2 = *p1 / 2 + 10;
  p2 = p1;
  printf("il = %i, i2 = %i, *p1 = %i, *p2 = %i\n", i1, i2, *p1, *p2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    (%rax),%r8d
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [38 x i8] c"il = %i, i2 = %i, *p1 = %i, *p2 = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32 0, i32* %1
store i32 5, i32* %2
store i32* %2, i32** %4
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 2
%9 = add nsw i32 %8, 10
store i32 %9, i32* %3
%10 = load i32*, i32** %4
store i32* %10, i32** %5
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %5
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %14, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"il = %i, i2 = %i, *p1 = %i, *p2 = %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 5, i32 12, i32 5, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void entry_to() { printf("Factory status: ACCEPTING\n"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"Factory status: ACCEPTING\0A\00"
define void @entry_to() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"Factory status: ACCEPTING\00"
define void @entry_to() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ editorProcessKeypress();
int /*<<< orphan*/ editorRefreshScreen();
int /*<<< orphan*/ enableRawMode();
int main() {
  enableRawMode();
  while (1) {
    editorRefreshScreen();
    editorProcessKeypress();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <enableRawMode@plt>
mov    $0x0,%al
call   1040 <editorRefreshScreen@plt>
mov    $0x0,%al
call   1050 <editorProcessKeypress@plt>
jmp    1146 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <enableRawMode@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <editorRefreshScreen@plt>
xor    %eax,%eax
call   1050 <editorProcessKeypress@plt>
jmp    1140 <main+0x10>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @enableRawMode()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @editorRefreshScreen()
%4 = tail call i32 (...) @editorProcessKeypress()
br label %2
}
int main(int argc, char **argv) {
  int to_complete = 0;
  return to_complete;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_port(int nPort) { close(nPort); }


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

x86 assembly (clang, -O2):
<close_port>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @close_port(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int __glob_sort(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
}


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

x86 assembly (clang, -O2):
<__glob_sort>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @__glob_sort(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @__glob_sort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
void foo_2_1_1_2_2_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_2_2_1_2_2_1() {
ret void
}
long double _Complex div_long_double_cr(long double _Complex a, long double b) {
  return a / b;
}


x86 assembly (clang, -O0):
<div_long_double_cr>:
push   %rbp
mov    %rsp,%rbp
fldt   0x30(%rbp)
lea    0x10(%rbp),%rax
fstpt  -0x30(%rbp)
fldt   (%rax)
fldt   0x10(%rax)
fldt   -0x30(%rbp)
fdivr  %st,%st(2)
fdivrp %st,%st(1)
fxch   %st(1)
fstpt  -0x20(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_long_double_cr>:
fldt   0x28(%rsp)
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fxch   %st(1)
fdiv   %st(2),%st
fxch   %st(1)
fdivp  %st,%st(2)
ret

LLVM IR (-O0):
define { x86_fp80, x86_fp80 } @div_long_double_cr({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0, x86_fp80 %1) {
%3 = alloca { x86_fp80, x86_fp80 }
%4 = alloca x86_fp80
store x86_fp80 %1, x86_fp80* %4
%5 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%6 = load x86_fp80, x86_fp80* %5
%7 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%8 = load x86_fp80, x86_fp80* %7
%9 = load x86_fp80, x86_fp80* %4
%10 = fdiv x86_fp80 %6, %9
%11 = fdiv x86_fp80 %8, %9
%12 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 0
%13 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 1
store x86_fp80 %10, x86_fp80* %12
store x86_fp80 %11, x86_fp80* %13
%14 = load { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3
ret { x86_fp80, x86_fp80 } %14
}

LLVM IR (-O2):
define { x86_fp80, x86_fp80 } @div_long_double_cr({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0, x86_fp80 %1) {
%3 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 0
%4 = load x86_fp80, x86_fp80* %3
%5 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%6 = load x86_fp80, x86_fp80* %5
%7 = fdiv x86_fp80 %4, %1
%8 = fdiv x86_fp80 %6, %1
%9 = insertvalue { x86_fp80, x86_fp80 } poison, x86_fp80 %7, 0
%10 = insertvalue { x86_fp80, x86_fp80 } %9, x86_fp80 %8, 1
ret { x86_fp80, x86_fp80 } %10
}
int nuc_cmp(char forward, char reverse) { return (int)(forward - reverse); }


x86 assembly (clang, -O0):
<nuc_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @nuc_cmp(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @nuc_cmp(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = sext i8 %1 to i32
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ blinkdot();
int /*<<< orphan*/ sleep(double);
int blinkS() {
  int c = 0;
  while (c != 3) {
    blinkdot();
    c++;
  }
  sleep(1.5);
  return 0;
}


x86 assembly (clang, -O0):
<blinkS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
je     114e <blinkS+0x2e>
mov    $0x0,%al
call   1030 <blinkdot@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <blinkS+0xf>
movsd  0xeaa(%rip),%xmm0
call   1040 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blinkS>:
push   %rax
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
movsd  0xec2(%rip),%xmm0
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @blinkS() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 3
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = call i32 (...) @blinkdot()
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
%10 = call i32 @sleep(double 1.500000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @blinkS() {
%1 = tail call i32 (...) @blinkdot()
%2 = tail call i32 (...) @blinkdot()
%3 = tail call i32 (...) @blinkdot()
%4 = tail call i32 @sleep(double 1.500000e+00)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef size_t ssize_t;

/* Variables and functions */
int /*<<< orphan*/ string_destroy(char **);
size_t vasprintf(char **, char const *, int /*<<< orphan*/);
size_t string_vprintf(char **string, const char *format, va_list vargs) {
  ssize_t result;
  string_destroy(string);
  if ((result = vasprintf(string, format, vargs)) < 0) {
    string_destroy(string);
    result = 0;
  }
  return result;
}


x86 assembly (clang, -O0):
<string_vprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <string_destroy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <vasprintf@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jae    116b <string_vprintf+0x4b>
mov    -0x8(%rbp),%rdi
call   1040 <string_destroy@plt>
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_vprintf>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1040 <string_destroy@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <vasprintf@plt>

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

LLVM IR (-O2):
define i64 @string_vprintf(i8** %0, i8* %1, i32 %2) {
%4 = tail call i32 @string_destroy(i8** %0)
%5 = tail call i64 @vasprintf(i8** %0, i8* %1, i32 %2)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int main() {
  pthread_create(NULL, NULL, NULL, NULL);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <pthread_create@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @pthread_create(i32* null, i32* null, i32* null, i32* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ log_init(char *);
void amf_application_init(void) { log_init("AMF"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"AMF\00"
define void @amf_application_init() {
%1 = tail call i32 @log_init(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}