xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *realloc(void *, size_t);
void *safe_realloc(void *ptr, size_t size) {
  void *newptr = realloc(ptr, size);
  if (newptr == NULL) {
    free(ptr);
  }
  return newptr;
}


x86 assembly (clang, -O0):
<safe_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1155 <safe_realloc+0x35>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_realloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <safe_realloc+0x1c>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @safe_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ e_abs();
int /*<<< orphan*/ e_lsr();
int /*<<< orphan*/ e_writeback();
void e_lsr_abs() {
  e_abs();
  e_lsr();
  e_writeback();
}


x86 assembly (clang, -O0):
<e_lsr_abs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <e_abs@plt>
mov    $0x0,%al
call   1040 <e_lsr@plt>
mov    $0x0,%al
call   1030 <e_writeback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_lsr_abs>:
push   %rax
xor    %eax,%eax
call   1050 <e_abs@plt>
xor    %eax,%eax
call   1040 <e_lsr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <e_writeback@plt>

LLVM IR (-O0):
define void @e_lsr_abs() {
%1 = call i32 (...) @e_abs()
%2 = call i32 (...) @e_lsr()
%3 = call i32 (...) @e_writeback()
ret void
}

LLVM IR (-O2):
define void @e_lsr_abs() {
%1 = tail call i32 (...) @e_abs()
%2 = tail call i32 (...) @e_lsr()
%3 = tail call i32 (...) @e_writeback()
ret void
}
void avsubtitle_free() {}


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

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

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

LLVM IR (-O2):
define void @avsubtitle_free() {
ret void
}
/* Variables and functions */
int lcm(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int temp = lcm(20);
  printf("%d\n", temp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x14,%edi
call   1040 <lcm@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x14,%edi
call   1040 <lcm@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @lcm(i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int starts_with(char *source, char *check) {
  int p = 0;
  for (; check[p] != 0; p++) {
    if (check[p] != source[p]) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<starts_with>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1167 <starts_with+0x67>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1154 <starts_with+0x54>
movl   $0x0,-0x4(%rbp)
jmp    116e <starts_with+0x6e>
jmp    1159 <starts_with+0x59>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <starts_with+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<starts_with>:
mov    (%rsi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1122 <starts_with+0x22>
xor    %edx,%edx
nopl   (%rax)
cmp    (%rdi,%rdx,1),%cl
jne    1123 <starts_with+0x23>
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <starts_with+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @starts_with(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 0, i32* %6
br label %7
7: ; preds = %31, %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 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %34
15: ; preds = %7
%16 = load i8*, i8** %5
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = load i8*, i8** %4
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %21, %27
br i1 %28, label %29, label %30
29: ; preds = %15
store i32 0, i32* %3
br label %35
30: ; preds = %15
br label %31
31: ; preds = %30
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
br label %7
34: ; preds = %7
store i32 1, i32* %3
br label %35
35: ; preds = %34, %29
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
define i32 @starts_with(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8, i8* %1, i64 %15
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %2, %5
%10 = phi i64 [ %15, %5 ], [ 0, %2 ]
%11 = phi i8 [ %7, %5 ], [ %3, %2 ]
%12 = getelementptr inbounds i8, i8* %0, i64 %10
%13 = load i8, i8* %12
%14 = icmp eq i8 %11, %13
%15 = add nuw i64 %10, 1
br i1 %14, label %5, label %16
16: ; preds = %9, %5, %2
%17 = phi i32 [ 1, %2 ], [ 1, %5 ], [ 0, %9 ]
ret i32 %17
}
void set_dr6(unsigned long value) {
  asm volatile("mov %0,%%dr6" : : "r"(value));
}


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

x86 assembly (clang, -O2):
<set_dr6>:
mov    %rdi,%db6
ret

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

LLVM IR (-O2):
define void @set_dr6(i64 %0) {
tail call void asm sideeffect "mov $0,%dr6", "r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
/* Type definitions */
struct tftphdr {
  int dummy;
};

/* Variables and functions */
struct tftphdr *rw_init(int /*<<< orphan*/);
struct tftphdr *w_init(void) {
  return rw_init(0);
}


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

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

LLVM IR (-O0):
%struct.tftphdr = type { i32 }
define %struct.tftphdr* @w_init() {
%1 = call %struct.tftphdr* @rw_init(i32 0)
ret %struct.tftphdr* %1
}

LLVM IR (-O2):
%struct.tftphdr = type { i32 }
define %struct.tftphdr* @w_init() {
%1 = tail call %struct.tftphdr* @rw_init(i32 0)
ret %struct.tftphdr* %1
}
/* Variables and functions */
int func(int);
int main(void) { return func(2); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x2,%edi
jmp    1030 <func@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func(i32 2)
ret i32 %1
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int read_quaddobl_target_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(769, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<read_quaddobl_target_Laurent_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x301,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_quaddobl_target_Laurent_system>:
mov    $0x301,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @read_quaddobl_target_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 769, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
unsigned int jmm_test_cell_g(unsigned int ptr) { return *(unsigned int *)ptr; }


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

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

LLVM IR (-O0):
define i32 @jmm_test_cell_g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @jmm_test_cell_g(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
int bounds_okay(int x, int y) {
  if (x >= 0)
    if (y >= 0)
      if (x < 800)
        if (y < 600)
          return (1);
  return (0);
}


x86 assembly (clang, -O0):
<bounds_okay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1153 <bounds_okay+0x53>
cmpl   $0x0,-0xc(%rbp)
jl     114e <bounds_okay+0x4e>
cmpl   $0x320,-0x8(%rbp)
jge    1149 <bounds_okay+0x49>
cmpl   $0x258,-0xc(%rbp)
jge    1144 <bounds_okay+0x44>
movl   $0x1,-0x4(%rbp)
jmp    115a <bounds_okay+0x5a>
jmp    1149 <bounds_okay+0x49>
jmp    114e <bounds_okay+0x4e>
jmp    1153 <bounds_okay+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bounds_okay>:
mov    %esi,%eax
or     %edi,%eax
setns  %al
cmp    $0x320,%edi
setl   %cl
and    %al,%cl
cmp    $0x258,%esi
setl   %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @bounds_okay(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* %4
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %21
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 800
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i32, i32* %5
%16 = icmp slt i32 %15, 600
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 1, i32* %3
br label %22
18: ; preds = %14
br label %19
19: ; preds = %18, %11
br label %20
20: ; preds = %19, %8
br label %21
21: ; preds = %20, %2
store i32 0, i32* %3
br label %22
22: ; preds = %21, %17
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @bounds_okay(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp sgt i32 %3, -1
%5 = icmp slt i32 %0, 800
%6 = and i1 %5, %4
%7 = icmp slt i32 %1, 600
%8 = and i1 %7, %6
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void hidpp_set_unaligned_le_u16(uint8_t *buf, uint16_t value) {
  buf[0] = value & 0xFF;
  buf[1] = value >> 8;
}


x86 assembly (clang, -O0):
<hidpp_set_unaligned_le_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<hidpp_set_unaligned_le_u16>:
movzbl %sil,%eax
mov    %eax,(%rdi)
sar    $0x8,%esi
mov    %esi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @hidpp_set_unaligned_le_u16(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
define void @hidpp_set_unaligned_le_u16(i32* nocapture writeonly %0, i32 %1) {
%3 = and i32 %1, 255
store i32 %3, i32* %0
%4 = ashr i32 %1, 8
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clearStdinBuf();
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int getInput() {
  int cmd = -1;
  char cmdBuf[4];
  fgets(cmdBuf, 2, stdin);
  clearStdinBuf();
  cmd = (int)cmdBuf[0];
  return cmd;
}


x86 assembly (clang, -O0):
<getInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%esi
call   1040 <fgets@plt>
mov    $0x0,%al
call   1030 <clearStdinBuf@plt>
movsbl -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInput>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rdi
mov    $0x2,%esi
call   1040 <fgets@plt>
xor    %eax,%eax
call   1030 <clearStdinBuf@plt>
movsbl 0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @getInput() {
%1 = alloca i32
%2 = alloca [4 x i8]
store i32 -1, i32* %1
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 2, i32 %4)
%6 = call i32 (...) @clearStdinBuf()
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
store i32 %9, i32* %1
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @getInput() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 2, i32 %3)
%5 = call i32 (...) @clearStdinBuf()
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
ret i32 %7
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int apc_nothing(void *cls, const struct sockaddr *addr, socklen_t addrlen) {
  return 0;
}


x86 assembly (clang, -O0):
<apc_nothing>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @apc_nothing(i8* %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca %struct.sockaddr*
%6 = alloca i32
store i8* %0, i8** %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @apc_nothing(i8* nocapture readnone %0, %struct.sockaddr* nocapture readnone %1, i32 %2) {
ret i32 0
}
void *default_copy(const void *data) { return (void *)data; }


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

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

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

LLVM IR (-O2):
define i8* @default_copy(i8* readnone returned %0) {
ret i8* %0
}
int isDiverge(float x, float y) { return x * x + y * y > 2.0f * 2.0f; }


x86 assembly (clang, -O0):
<isDiverge>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xece(%rip),%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDiverge>:
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xor    %eax,%eax
ucomiss 0xeeb(%rip),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @isDiverge(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %3
%7 = load float, float* %4
%8 = load float, float* %4
%9 = fmul float %7, %8
%10 = call float @llvm.fmuladd.f32(float %5, float %6, float %9)
%11 = fcmp ogt float %10, 4.000000e+00
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isDiverge(float %0, float %1) {
%3 = fmul float %1, %1
%4 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %3)
%5 = fcmp ogt float %4, 4.000000e+00
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ absolutelong();
int /*<<< orphan*/ adc8(int /*<<< orphan*/);
int /*<<< orphan*/ readmem65816(int /*<<< orphan*/);
void adcLong8(void) { adc8(readmem65816(absolutelong())); }


x86 assembly (clang, -O0):
<adcLong8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <absolutelong@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
call   1030 <adc8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcLong8>:
push   %rax
xor    %eax,%eax
call   1040 <absolutelong@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <adc8@plt>

LLVM IR (-O0):
define void @adcLong8() {
%1 = call i32 (...) @absolutelong()
%2 = call i32 @readmem65816(i32 %1)
%3 = call i32 @adc8(i32 %2)
ret void
}

LLVM IR (-O2):
define void @adcLong8() {
%1 = tail call i32 (...) @absolutelong()
%2 = tail call i32 @readmem65816(i32 %1)
%3 = tail call i32 @adc8(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned char *);
void encode_destroy(unsigned char *encode) { free(encode); }


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

x86 assembly (clang, -O2):
<encode_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @encode_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void BGRAToYRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @BGRAToYRow_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __expand(char *, char const *, char, char *, char *);
void expand2(char *str, const char *fmt, char **args, char out) {
  __expand(str, fmt, out, args[0], args[1]);
}


x86 assembly (clang, -O0):
<expand2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x19(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x18(%rbp),%rdx
mov    0x8(%rdx),%r8
movsbl %al,%edx
call   1030 <__expand@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand2>:
mov    (%rdx),%rax
mov    0x8(%rdx),%r8
mov    %ecx,%edx
mov    %rax,%rcx
jmp    1030 <__expand@plt>

LLVM IR (-O0):
define void @expand2(i8* %0, i8* %1, i8** %2, i8 signext %3) {
%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
store i8 %3, i8* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8, i8* %8
%12 = load i8**, i8*** %7
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = load i8**, i8*** %7
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @__expand(i8* %9, i8* %10, i8 signext %11, i8* %14, i8* %17)
ret void
}

LLVM IR (-O2):
define void @expand2(i8* %0, i8* %1, i8** nocapture %2, i8 signext %3) {
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8*, i8** %2, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @__expand(i8* %0, i8* %1, i8 signext %3, i8* %5, i8* %7)
ret void
}
void rt_delete_scanlinereceives(void *voidhandle) {}


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

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

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

LLVM IR (-O2):
define void @rt_delete_scanlinereceives(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int mii_nway_result(unsigned int);
unsigned int mii_duplex(unsigned int duplex_lock, unsigned int negotiated) {
  if (duplex_lock)
    return 1;
  if (mii_nway_result(negotiated) & (0x0040 | 0x0100))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<mii_duplex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1134 <mii_duplex+0x24>
movl   $0x1,-0x4(%rbp)
jmp    115d <mii_duplex+0x4d>
mov    -0xc(%rbp),%edi
call   1030 <mii_nway_result@plt>
and    $0x140,%eax
cmp    $0x0,%eax
je     1156 <mii_duplex+0x46>
movl   $0x1,-0x4(%rbp)
jmp    115d <mii_duplex+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mii_duplex>:
mov    $0x1,%eax
test   %edi,%edi
je     111a <mii_duplex+0xa>
ret
push   %rax
mov    %esi,%edi
call   1030 <mii_nway_result@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   $0x140,%ecx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @mii_duplex(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* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %16
9: ; preds = %2
%10 = load i32, i32* %5
%11 = call i32 @mii_nway_result(i32 %10)
%12 = and i32 %11, 320
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 1, i32* %3
br label %16
15: ; preds = %9
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @mii_duplex(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = tail call i32 @mii_nway_result(i32 %1)
%6 = and i32 %5, 320
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %2
%10 = phi i32 [ 1, %2 ], [ %8, %4 ]
ret i32 %10
}
int try_homepath_envvar_for_home(void) {
  {
    log_prefix("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/cosminadrianpopescu/vifm/"
               "refs/heads/master/src/cfg/config.c",
               __FUNCTION__, 285);
    log_msg("Entered into this function");
  };
  return 0;
}


x86 assembly (clang, -O0):
<try_homepath_envvar_for_home>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xf64(%rip),%rsi
mov    $0x11d,%edx
mov    $0x0,%al
call   1030 <log_prefix@plt>
lea    0xf6e(%rip),%rdi
mov    $0x0,%al
call   1040 <log_msg@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_homepath_envvar_for_home>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf67(%rip),%rsi
mov    $0x11d,%edx
xor    %eax,%eax
call   1030 <log_prefix@plt>
lea    0xf71(%rip),%rdi
xor    %eax,%eax
call   1040 <log_msg@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cosminadrianpopescu/vifm/refs/heads/master/src/cfg/config.c\00"
@__FUNCTION__.try_homepath_envvar_for_home = [29 x i8] c"try_homepath_envvar_for_home\00"
@.str.1 = [27 x i8] c"Entered into this function\00"
define i32 @try_homepath_envvar_for_home() {
%1 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @log_prefix to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__FUNCTION__.try_homepath_envvar_for_home, i64 0, i64 0), i32 285)
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @log_msg to i32 (i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cosminadrianpopescu/vifm/refs/heads/master/src/cfg/config.c\00"
@__FUNCTION__.try_homepath_envvar_for_home = [29 x i8] c"try_homepath_envvar_for_home\00"
@.str.1 = [27 x i8] c"Entered into this function\00"
define i32 @try_homepath_envvar_for_home() {
%1 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @log_prefix to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__FUNCTION__.try_homepath_envvar_for_home, i64 0, i64 0), i32 285)
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @log_msg to i32 (i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int strlen(char str[]) {
  int i = 0;
  while (str[i] != 0)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int ispunct(int c) {
  return ((c >= 0x21 && c <= 0x2F) || (c >= 0x3A && c <= 0x40) ||
          (c >= 0x5B && c <= 0x60) || (c >= 0x7B && c <= 0x7E))
             ? 1
             : 0;
}


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x21,-0x4(%rbp)
jl     1120 <ispunct+0x20>
mov    $0x1,%al
cmpl   $0x2f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1171 <ispunct+0x71>
cmpl   $0x3a,-0x4(%rbp)
jl     1139 <ispunct+0x39>
mov    $0x1,%al
cmpl   $0x40,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1171 <ispunct+0x71>
cmpl   $0x5b,-0x4(%rbp)
jl     1152 <ispunct+0x52>
mov    $0x1,%al
cmpl   $0x60,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1171 <ispunct+0x71>
xor    %eax,%eax
cmpl   $0x7b,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     116b <ispunct+0x6b>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
movd   %edi,%xmm0
pshufd $0x0,%xmm0,%xmm0
paddd  0xeef(%rip),%xmm0
pxor   0xef7(%rip),%xmm0
movdqa 0xeff(%rip),%xmm1
pcmpgtd %xmm0,%xmm1
movmskps %xmm1,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
ret

LLVM IR (-O0):
define i32 @ispunct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 33
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 47
br i1 %7, label %28, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 58
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 64
br i1 %13, label %28, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 91
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 96
br i1 %19, label %28, label %20
20: ; preds = %17, %14
%21 = load i32, i32* %2
%22 = icmp sge i32 %21, 123
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %2
%25 = icmp sle i32 %24, 126
br label %26
26: ; preds = %23, %20
%27 = phi i1 [ false, %20 ], [ %25, %23 ]
br label %28
28: ; preds = %26, %17, %11, %5
%29 = phi i1 [ true, %17 ], [ true, %11 ], [ true, %5 ], [ %27, %26 ]
%30 = zext i1 %29 to i64
%31 = select i1 %29, i32 1, i32 0
ret i32 %31
}

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = insertelement <4 x i32> poison, i32 %0, i64 0
%3 = shufflevector <4 x i32> %2, <4 x i32> poison, <4 x i32> zeroinitializer
%4 = add <4 x i32> %3, <i32 -123, i32 -91, i32 -33, i32 -58>
%5 = icmp ult <4 x i32> %4, <i32 4, i32 6, i32 15, i32 7>
%6 = bitcast <4 x i1> %5 to i4
%7 = icmp ne i4 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void safe_free(char *s) {
  if (s)
    free(s);
}


x86 assembly (clang, -O0):
<safe_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <safe_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_free>:
test   %rdi,%rdi
je     111a <safe_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @safe_free(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 %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @safe_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
unsigned mix32(unsigned h) {
  h ^= h >> 16;
  h *= 0x85ebca6b;
  h ^= h >> 13;
  h *= 0xc2b2ae35;
  h ^= h >> 16;
  return h;
}


x86 assembly (clang, -O0):
<mix32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
imul   $0x85ebca6b,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0xd,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
imul   $0xc2b2ae35,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mix32>:
mov    %edi,%eax
shr    $0x10,%eax
xor    %edi,%eax
imul   $0x85ebca6b,%eax,%eax
mov    %eax,%ecx
shr    $0xd,%ecx
xor    %eax,%ecx
imul   $0xc2b2ae35,%ecx,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mix32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 16
%5 = load i32, i32* %2
%6 = xor i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = mul i32 %7, -2048144789
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = lshr i32 %9, 13
%11 = load i32, i32* %2
%12 = xor i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = mul i32 %13, -1028477387
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = lshr i32 %15, 16
%17 = load i32, i32* %2
%18 = xor i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @mix32(i32 %0) {
%2 = lshr i32 %0, 16
%3 = xor i32 %2, %0
%4 = mul i32 %3, -2048144789
%5 = lshr i32 %4, 13
%6 = xor i32 %5, %4
%7 = mul i32 %6, -1028477387
%8 = lshr i32 %7, 16
%9 = xor i32 %8, %7
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int child_func(void *arg) {
  char *buf = (char *)arg;
  printf("Child sees buf = \"%s\"\n", buf);
  strcpy(buf, "hello from child");
  return 0;
}


x86 assembly (clang, -O0):
<child_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xec8(%rip),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_func>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xedd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Child sees buf = \22%s\22\0A\00"
@.str.1 = [17 x i8] c"hello from child\00"
define i32 @child_func(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Child sees buf = \22%s\22\0A\00"
@.str.1 = [17 x i8] c"hello from child\00"
define i32 @child_func(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a = -5;
  int neg = 0;
  int d = (a < 0) ? 1 : -1;
  while (a != 0) {
    a += d;
    neg += d;
  }
  printf("%d", neg);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xfffffffb,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     115d <main+0x4d>
mov    -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    113c <main+0x2c>
mov    -0x8(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x5,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5)
ret void
}
long deci_kelvin_to_millicelsius_with_offset(long t, long offset) {
  return t * 100 - offset;
}


x86 assembly (clang, -O0):
<deci_kelvin_to_millicelsius_with_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
imul   $0x64,-0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<deci_kelvin_to_millicelsius_with_offset>:
imul   $0x64,%rdi,%rax
sub    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @deci_kelvin_to_millicelsius_with_offset(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 = mul nsw i64 %5, 100
%7 = load i64, i64* %4
%8 = sub nsw i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @deci_kelvin_to_millicelsius_with_offset(i64 %0, i64 %1) {
%3 = mul nsw i64 %0, 100
%4 = sub nsw i64 %3, %1
ret i64 %4
}
void g_unichar_break_type() {}


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

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

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

LLVM IR (-O2):
define void @g_unichar_break_type() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t read_32_be(unsigned char bytes[4]) {
  uint32_t result = 0;
  for (int i = 0; i < 4; i++)
    result = (result << 8) | bytes[i];
  return result;
}


x86 assembly (clang, -O0):
<read_32_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    1145 <read_32_be+0x45>
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <read_32_be+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_32_be>:
mov    (%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @read_32_be(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %18, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %21
8: ; preds = %5
%9 = load i32, i32* %3
%10 = shl i32 %9, 8
%11 = load i8*, i8** %2
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = or i32 %10, %16
store i32 %17, i32* %3
br label %18
18: ; preds = %8
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %5
21: ; preds = %5
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @read_32_be(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %3, 16
%8 = shl nuw nsw i32 %6, 8
%9 = or i32 %7, %8
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = or i32 %9, %12
%14 = shl nuw i32 %13, 8
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=19 REPO_URL= REVISION= CHANGED_REVISION= "
         "CHANGE_DATE= BUILD_DATE=Thu Apr 24 18:34:19 CST 2014 BUILD=release "
         "TARGET_PLATFORM=meson_platform MALI_PLATFORM= KDIR= "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= "
         "USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=0 "
         "MALI_UPPER_HALF_SCHEDULING=1";
}


x86 assembly (clang, -O0):
<__malidrv_build_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__malidrv_build_info>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [327 x i8] c"malidrv: API_VERSION=19 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Thu Apr 24 18:34:19 CST 2014 BUILD=release TARGET_PLATFORM=meson_platform MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=0 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([327 x i8], [327 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [327 x i8] c"malidrv: API_VERSION=19 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Thu Apr 24 18:34:19 CST 2014 BUILD=release TARGET_PLATFORM=meson_platform MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=0 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([327 x i8], [327 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int memcmp(void const *, void const *, int);
int cmp_pktinfos(size_t size_a, const void *a, size_t size_b, const void *b) {
  assert(size_a == 38);
  assert(size_b == 38);
  return memcmp(a, b, 38);
}


x86 assembly (clang, -O0):
<cmp_pktinfos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x26,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpq   $0x26,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x26,%edx
call   1030 <memcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_pktinfos>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %rsi,%r15
xor    %eax,%eax
cmp    $0x26,%rdi
sete   %al
mov    %eax,%edi
call   1040 <assert@plt>
xor    %edi,%edi
cmp    $0x26,%rbx
sete   %dil
call   1040 <assert@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x26,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <memcmp@plt>

LLVM IR (-O0):
define i32 @cmp_pktinfos(i64 %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
store i64 %0, i64* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%9 = load i64, i64* %5
%10 = icmp eq i64 %9, 38
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i64, i64* %7
%14 = icmp eq i64 %13, 38
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i8*, i8** %6
%18 = load i8*, i8** %8
%19 = call i32 @memcmp(i8* %17, i8* %18, i32 38)
ret i32 %19
}

LLVM IR (-O2):
define i32 @cmp_pktinfos(i64 %0, i8* %1, i64 %2, i8* %3) {
%5 = icmp eq i64 %0, 38
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = icmp eq i64 %2, 38
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 @memcmp(i8* %1, i8* %3, i32 38)
ret i32 %11
}
int GetFd(int dir) { return 3 + dir; }


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

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

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

LLVM IR (-O2):
define i32 @GetFd(i32 %0) {
%2 = add nsw i32 %0, 3
ret i32 %2
}
/* Variables and functions */
int munmap(void *, size_t);
int drm_munmap(void *addr, size_t length) { return munmap(addr, length); }


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

x86 assembly (clang, -O2):
<drm_munmap>:
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define i32 @drm_munmap(i8* %0, i64 %1) {
%3 = tail call i32 @munmap(i8* %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int ck(double d) {
  if (d != 64.0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<ck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    113f <ck+0x2f>
jp     113f <ck+0x2f>
jmp    1146 <ck+0x36>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ck>:
push   %rax
ucomisd 0xee7(%rip),%xmm0
jne    1121 <ck+0x11>
jp     1121 <ck+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @ck(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp une double %3, 6.400000e+01
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
ret i32 0
}

LLVM IR (-O2):
define i32 @ck(double %0) {
%2 = fcmp une double %0, 6.400000e+01
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ get_all_grid_addresses(long **, long const *);
void grg_get_all_grid_addresses(long grid_address[][3], const long D_diag[3]) {
  get_all_grid_addresses(grid_address, D_diag);
}


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

x86 assembly (clang, -O2):
<grg_get_all_grid_addresses>:
jmp    1030 <get_all_grid_addresses@plt>

LLVM IR (-O0):
define void @grg_get_all_grid_addresses([3 x i64]* %0, i64* %1) {
%3 = alloca [3 x i64]*
%4 = alloca i64*
store [3 x i64]* %0, [3 x i64]** %3
store i64* %1, i64** %4
%5 = load [3 x i64]*, [3 x i64]** %3
%6 = bitcast [3 x i64]* %5 to i64**
%7 = load i64*, i64** %4
%8 = call i32 @get_all_grid_addresses(i64** %6, i64* %7)
ret void
}

LLVM IR (-O2):
define void @grg_get_all_grid_addresses([3 x i64]* %0, i64* %1) {
%3 = bitcast [3 x i64]* %0 to i64**
%4 = tail call i32 @get_all_grid_addresses(i64** %3, i64* %1)
ret void
}
double fabs(double x) {
  if (x < 0.0) {
    x *= -1.0;
  }
  return x;
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <fabs+0x29>
movsd  0xee1(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fmul double %6, -1.000000e+00
store double %7, double* %2
br label %8
8: ; preds = %5, %1
%9 = load double, double* %2
ret double %9
}

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}