xunge/DecIR huggingface dataset:
/* Type definitions */
struct ape_header {
  int dummy;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int ape_parse_header(char *, struct ape_header *);
int read_all(int, char *, int);
int read_header(int fd, struct ape_header *h) {
  char buf[(32)];
  if (read_all(fd, buf, sizeof(buf)) != sizeof(buf))
    return 0;
  return ape_parse_header(buf, h);
}


x86 assembly (clang, -O0):
<read_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x20,%edx
call   1040 <read_all@plt>
cltq
cmp    $0x20,%rax
je     1158 <read_header+0x38>
movl   $0x0,-0x4(%rbp)
jmp    1168 <read_header+0x48>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ape_parse_header@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_header>:
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rbx
mov    %rsp,%rsi
mov    $0x20,%edx
call   1040 <read_all@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
jne    1149 <read_header+0x29>
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1030 <ape_parse_header@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.ape_header = type { i32 }
define i32 @read_header(i32 %0, %struct.ape_header* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.ape_header*
%6 = alloca [32 x i8]
store i32 %0, i32* %4
store %struct.ape_header* %1, %struct.ape_header** %5
%7 = load i32, i32* %4
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%9 = call i32 @read_all(i32 %7, i8* %8, i32 32)
%10 = sext i32 %9 to i64
%11 = icmp ne i64 %10, 32
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %17
13: ; preds = %2
%14 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%15 = load %struct.ape_header*, %struct.ape_header** %5
%16 = call i32 @ape_parse_header(i8* %14, %struct.ape_header* %15)
store i32 %16, i32* %3
br label %17
17: ; preds = %13, %12
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.ape_header = type { i32 }
define i32 @read_header(i32 %0, %struct.ape_header* %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @read_all(i32 %0, i8* %4, i32 32)
%6 = icmp eq i32 %5, 32
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @ape_parse_header(i8* %4, %struct.ape_header* %1)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ 0, %2 ]
ret i32 %10
}
int max(int x, int y) {
  int z = 0;
  z = (x > y) ? x : y;
  return z;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1128 <max+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    112e <max+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
float c_log(float, int);
float c_log_10(float a) { return c_log(a, 10); }


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

x86 assembly (clang, -O2):
<c_log_10>:
mov    $0xa,%edi
jmp    1030 <c_log@plt>

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

LLVM IR (-O2):
define float @c_log_10(float %0) {
%2 = tail call float @c_log(float %0, i32 10)
ret float %2
}
int in_def_get_config(void *drv_data, int what, int *val) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @in_def_get_config(i8* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
ret i32 -1
}
/* Type definitions */
struct task_struct {
  int dummy;
};
struct rq {
  int dummy;
};

/* Variables and functions */
unsigned int get_rr_interval_idle(struct rq *rq, struct task_struct *task) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define i32 @get_rr_interval_idle(%struct.rq* %0, %struct.task_struct* %1) {
%3 = alloca %struct.rq*
%4 = alloca %struct.task_struct*
store %struct.rq* %0, %struct.rq** %3
store %struct.task_struct* %1, %struct.task_struct** %4
ret i32 0
}

LLVM IR (-O2):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define i32 @get_rr_interval_idle(%struct.rq* nocapture readnone %0, %struct.task_struct* nocapture readnone %1) {
ret i32 0
}
int do_885() { return 885; }


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

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

LLVM IR (-O0):
define i32 @do_885() {
ret i32 885
}

LLVM IR (-O2):
define i32 @do_885() {
ret i32 885
}
/* Variables and functions */
int /*<<< orphan*/ file_time_default(int *, int *, int *);
int file_last_modified_time(const char *pathname, int *day, int *month,
                            int *year) {
  file_time_default(day, month, year);
  return 0;
}


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

x86 assembly (clang, -O2):
<file_last_modified_time>:
push   %rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1030 <file_time_default@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @file_last_modified_time(i8* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %6
%10 = load i32*, i32** %7
%11 = load i32*, i32** %8
%12 = call i32 @file_time_default(i32* %9, i32* %10, i32* %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @file_last_modified_time(i8* nocapture readnone %0, i32* %1, i32* %2, i32* %3) {
%5 = tail call i32 @file_time_default(i32* %1, i32* %2, i32* %3)
ret i32 0
}
int ft_isalnum(int c) {
  return ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') ||
          (c >= 'a' && c <= 'z'));
}


x86 assembly (clang, -O0):
<ft_isalnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jl     1120 <ft_isalnum+0x20>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <ft_isalnum+0x58>
cmpl   $0x41,-0x4(%rbp)
jl     1139 <ft_isalnum+0x39>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <ft_isalnum+0x58>
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <ft_isalnum+0x52>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalnum>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x1a,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ft_isalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 97
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 122
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @ft_isalnum(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 26
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int kill(int /*<<< orphan*/, int);
int raise(int sig) { return kill(getpid(), sig); }


x86 assembly (clang, -O0):
<raise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1040 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raise>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <kill@plt>

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

LLVM IR (-O2):
define i32 @raise(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @kill(i32 %2, i32 %0)
ret i32 %3
}
unsigned long b_smp_queuelen(void) {
  unsigned long tlong;
  asm volatile("call 0x00100148" : "=a"(tlong));
  return tlong;
}


x86 assembly (clang, -O0):
<b_smp_queuelen>:
push   %rbp
mov    %rsp,%rbp
call   100148 <completed.0+0xfc128>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_smp_queuelen>:
call   100148 <completed.0+0xfc128>
ret

LLVM IR (-O0):
define i64 @b_smp_queuelen() {
%1 = alloca i64
%2 = call i64 asm sideeffect "call 0x00100148", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @b_smp_queuelen() {
%1 = tail call i64 asm sideeffect "call 0x00100148", "={ax},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
void *ummap_addr_alloc(size_t, size_t);
void *u_mmap_align(size_t alignment, size_t len) {
  return ummap_addr_alloc(alignment, len);
}


x86 assembly (clang, -O0):
<u_mmap_align>:
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 <ummap_addr_alloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_mmap_align>:
jmp    1030 <ummap_addr_alloc@plt>

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

LLVM IR (-O2):
define i8* @u_mmap_align(i64 %0, i64 %1) {
%3 = tail call i8* @ummap_addr_alloc(i64 %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  int j;
  i = 0;
  j = 5;
  while (i < 5) {
    i = i + 1;
    j = j + 1;
  }
  assert(j == 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    114e <main+0x3e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
cmpl   $0xa,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
void empty_destructor(void **tag, void **cell) {}


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

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

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

LLVM IR (-O2):
define void @empty_destructor(i8** nocapture %0, i8** nocapture %1) {
ret void
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/list.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/list.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/list.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
int isascii(c)
register int c;
{ return (int)!((c) & ~0x7F); }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -128
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, int);
int /*<<< orphan*/ stderr;
void __assert(const char *file, const char *func, int line) {
  fprintf(stderr, "Assertion failed in file %s, function %s(), line %d\n", file,
          func, line);
  abort();
}


x86 assembly (clang, -O0):
<__assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<__assert>:
push   %rax
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"Assertion failed in file %s, function %s(), line %d\0A\00"
define void @__assert(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i32 %10)
%12 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"Assertion failed in file %s, function %s(), line %d\0A\00"
define void @__assert(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
%6 = tail call i32 (...) @abort()
unreachable
}
void ecm_nss_ipv4_stop(int num) { return; }


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

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

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

LLVM IR (-O2):
define void @ecm_nss_ipv4_stop(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
void default_info(const char *msg) { fprintf(stdout, "%s\n", msg); }


x86 assembly (clang, -O0):
<default_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_info>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @default_info(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void busyWait(void) {
  int counter;
  for (counter = 0; counter < 10; ++counter) {
    ;
  }
}


x86 assembly (clang, -O0):
<busyWait>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1128 <busyWait+0x28>
jmp    111a <busyWait+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <busyWait+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @busyWait() {
ret void
}
unsigned xrop3_108_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & T;
  stk1 = S ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_108_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_108_0_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
mov    %ecx,%edx
xor    %esi,%edx
not    %eax
or     %edx,%eax
xor    %esi,%eax
and    %ecx,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_108_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %6
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = and i32 %28, %29
%31 = load i32, i32* %8
%32 = load i32, i32* %7
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = or i32 %30, %34
%36 = load i32, i32* %7
%37 = load i32, i32* %6
%38 = xor i32 %37, -1
%39 = and i32 %36, %38
%40 = load i32, i32* %5
%41 = and i32 %39, %40
%42 = or i32 %35, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @xrop3_108_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, %5
%8 = xor i32 %6, -1
%9 = or i32 %7, %8
%10 = and i32 %9, %4
%11 = xor i32 %4, -1
%12 = and i32 %11, %5
%13 = or i32 %10, %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char *, int *);
int stringToInt(const char *str) {
  int result;
  sscanf(str, "%d", &result);
  return result;
}


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

x86 assembly (clang, -O2):
<stringToInt>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @stringToInt(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
void g(int *x, int y) {
  if (y > 1) {
    g(x, y - 1);
    *x = *x * *x;
  } else
    *x = *x + 1;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1150 <g+0x40>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <g@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
imul   (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    115f <g+0x4f>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x2,%esi
jl     112b <g+0x1b>
add    $0xffffffff,%esi
mov    %rbx,%rdi
call   1030 <g@plt>
mov    (%rbx),%eax
imul   %eax,%eax
jmp    1130 <g+0x20>
mov    (%rbx),%eax
add    $0x1,%eax
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @g(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 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %17
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32*, i32** %3
%14 = load i32, i32* %13
%15 = mul nsw i32 %12, %14
%16 = load i32*, i32** %3
store i32 %15, i32* %16
br label %22
17: ; preds = %2
%18 = load i32*, i32** %3
%19 = load i32, i32* %18
%20 = add nsw i32 %19, 1
%21 = load i32*, i32** %3
store i32 %20, i32* %21
br label %22
22: ; preds = %17, %7
ret void
}

LLVM IR (-O2):
define void @g(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = add nsw i32 %1, -1
tail call void @g(i32* %0, i32 %5)
%6 = load i32, i32* %0
%7 = mul nsw i32 %6, %6
br label %11
8: ; preds = %2
%9 = load i32, i32* %0
%10 = add nsw i32 %9, 1
br label %11
11: ; preds = %8, %4
%12 = phi i32 [ %10, %8 ], [ %7, %4 ]
store i32 %12, i32* %0
ret void
}
void __ipipe_report_cleanup(struct mm_struct *mm) {}


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

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

LLVM IR (-O0):
%struct.mm_struct = type opaque
define void @__ipipe_report_cleanup(%struct.mm_struct* %0) {
%2 = alloca %struct.mm_struct*
store %struct.mm_struct* %0, %struct.mm_struct** %2
ret void
}

LLVM IR (-O2):
%struct.mm_struct = type opaque
define void @__ipipe_report_cleanup(%struct.mm_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fstab_filter_options(char const *, char const *,
                                        int /*<<< orphan*/ *,
                                        int /*<<< orphan*/ *,
                                        int /*<<< orphan*/ *);
bool fstab_test_option(const char *opts, const char *names) {
  return !!fstab_filter_options(opts, names, NULL, NULL, NULL);
}


x86 assembly (clang, -O0):
<fstab_test_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   1030 <fstab_filter_options@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstab_test_option>:
push   %rax
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <fstab_filter_options@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fstab_test_option(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @fstab_filter_options(i8* %5, i8* %6, i32* null, i32* null, i32* null)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @fstab_test_option(i8* %0, i8* %1) {
%3 = tail call i32 @fstab_filter_options(i8* %0, i8* %1, i32* null, i32* null, i32* null)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
f(c) unsigned char c;
{
  if (c != 0xFF)
    abort();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0xff,%eax
je     1132 <f+0x22>
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cmp    $0xff,%dil
jne    1117 <f+0x7>
ret
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = icmp ne i32 %6, 255
br i1 %7, label %8, label %9
8: ; preds = %1
unreachable
9: ; preds = %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp eq i32 %2, 255
br i1 %3, label %5, label %4
4: ; preds = %1
tail call void @abort()
unreachable
5: ; preds = %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("SOMA = %d\n", a + b);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [11 x i8] c"SOMA = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
double sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ stat_var(double *, int);
double stat_stddev(double *data, int size) {
  return sqrt(stat_var(data, size));
}


x86 assembly (clang, -O0):
<stat_stddev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <stat_var@plt>
mov    %eax,%edi
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat_stddev>:
push   %rax
call   1040 <stat_var@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @stat_stddev(double* %0, i32 %1) {
%3 = tail call i32 @stat_var(double* %0, i32 %1)
%4 = tail call double @sqrt(i32 %3)
ret double %4
}
void mapArray(int *a, int n, int (*f)(int)) {
  int i;
  for (i = 0; i < n; i++) {
    a[i] = (*f)(a[i]);
  }
}


x86 assembly (clang, -O0):
<mapArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1152 <mapArray+0x52>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
mov    (%rcx,%rdx,4),%edi
call   *%rax
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111a <mapArray+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1134 <mapArray+0x34>
mov    %rdx,%r14
mov    %rdi,%r12
mov    %esi,%r15d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r12,%rbx,4),%edi
call   *%r14
mov    %eax,(%r12,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1120 <mapArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @mapArray(i32* nocapture %0, i32 %1, i32 (i32)* nocapture %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 %2(i32 %10)
store i32 %11, i32* %9
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}
/* Variables and functions */
void *init_nop_lock(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @init_nop_lock() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @init_nop_lock() {
ret i8* null
}
float maths_fast_sqrt_1(float input) {
  if (input < 0) {
    return 0.0f;
  }
  float result = 1.0f;
  result = 0.5f * (result + (input / result));
  result = 0.5f * (result + (input / result));
  return result;
}


x86 assembly (clang, -O0):
<maths_fast_sqrt_1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1123 <maths_fast_sqrt_1+0x23>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1182 <maths_fast_sqrt_1+0x82>
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
addss  %xmm0,%xmm1
movss  0xeb5(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
addss  %xmm0,%xmm1
movss  0xe91(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<maths_fast_sqrt_1>:
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
ja     112f <maths_fast_sqrt_1+0x2f>
movss  0xef0(%rip),%xmm1
addss  %xmm0,%xmm1
movss  0xee8(%rip),%xmm2
mulss  %xmm2,%xmm1
divss  %xmm1,%xmm0
addss  %xmm1,%xmm0
mulss  %xmm2,%xmm0
movaps %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @maths_fast_sqrt_1(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = fcmp olt float %5, 0.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store float 0.000000e+00, float* %2
br label %22
8: ; preds = %1
store float 1.000000e+00, float* %4
%9 = load float, float* %4
%10 = load float, float* %3
%11 = load float, float* %4
%12 = fdiv float %10, %11
%13 = fadd float %9, %12
%14 = fmul float 5.000000e-01, %13
store float %14, float* %4
%15 = load float, float* %4
%16 = load float, float* %3
%17 = load float, float* %4
%18 = fdiv float %16, %17
%19 = fadd float %15, %18
%20 = fmul float 5.000000e-01, %19
store float %20, float* %4
%21 = load float, float* %4
store float %21, float* %2
br label %22
22: ; preds = %8, %7
%23 = load float, float* %2
ret float %23
}

LLVM IR (-O2):
define float @maths_fast_sqrt_1(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = fadd float %0, 1.000000e+00
%5 = fmul float %4, 5.000000e-01
%6 = fdiv float %0, %5
%7 = fadd float %5, %6
%8 = fmul float %7, 5.000000e-01
br label %9
9: ; preds = %1, %3
%10 = phi float [ %8, %3 ], [ 0.000000e+00, %1 ]
ret float %10
}
/* Type definitions */
struct termp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void ascii_endline(struct termp *p) { putchar('\n'); }


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

x86 assembly (clang, -O2):
<ascii_endline>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
%struct.termp = type { i32 }
define void @ascii_endline(%struct.termp* %0) {
%2 = alloca %struct.termp*
store %struct.termp* %0, %struct.termp** %2
%3 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
%struct.termp = type { i32 }
define void @ascii_endline(%struct.termp* nocapture readnone %0) {
%2 = tail call i32 @putchar(i8 signext 10)
ret void
}
int double_comparer(const void *input1, const void *input2) {
  double *element1 = (double *)input1;
  double *element2 = (double *)input2;
  return *element1 - *element2;
}


x86 assembly (clang, -O0):
<double_comparer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
subsd  (%rax),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_comparer>:
movsd  (%rdi),%xmm0
subsd  (%rsi),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @double_comparer(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double*
%6 = alloca double*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to double*
store double* %8, double** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to double*
store double* %10, double** %6
%11 = load double*, double** %5
%12 = load double, double* %11
%13 = load double*, double** %6
%14 = load double, double* %13
%15 = fsub double %12, %14
%16 = fptosi double %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @double_comparer(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = fptosi double %7 to i32
ret i32 %8
}
int getOsName(char *osname) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getOsName(i8* nocapture readnone %0) {
ret i32 0
}
long sys_sigreturn() { return 0; }


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

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

LLVM IR (-O0):
define i64 @sys_sigreturn() {
ret i64 0
}

LLVM IR (-O2):
define i64 @sys_sigreturn() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void freeusimatrix(unsigned int **matrix) { free((void *)matrix[0]); }


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

x86 assembly (clang, -O2):
<freeusimatrix>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @freeusimatrix(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = getelementptr inbounds i32*, i32** %3, i64 0
%5 = load i32*, i32** %4
%6 = bitcast i32* %5 to i8*
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @freeusimatrix(i32** nocapture %0) {
%2 = bitcast i32** %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
ret void
}
void error(h) const char *h;
{ ziperr(5, h); }


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x5,%edi
mov    $0x0,%al
call   1030 <ziperr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
mov    %rdi,%rsi
mov    $0x5,%edi
xor    %eax,%eax
jmp    1030 <ziperr@plt>

LLVM IR (-O0):
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @ziperr to i32 (i32, i8*, ...)*)(i32 5, i8* %3)
ret void
}

LLVM IR (-O2):
define void @error(i8* %0) {
%2 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @ziperr to i32 (i32, i8*, ...)*)(i32 5, i8* %0)
ret void
}
void tcp_fin(struct Squirrel *squirrel, struct NetFrame *frame) {
  squirrel = (squirrel);
  frame = (frame);
}


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

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

LLVM IR (-O0):
%struct.Squirrel = type opaque
%struct.NetFrame = type opaque
define void @tcp_fin(%struct.Squirrel* %0, %struct.NetFrame* %1) {
%3 = alloca %struct.Squirrel*
%4 = alloca %struct.NetFrame*
store %struct.Squirrel* %0, %struct.Squirrel** %3
store %struct.NetFrame* %1, %struct.NetFrame** %4
%5 = load %struct.Squirrel*, %struct.Squirrel** %3
store %struct.Squirrel* %5, %struct.Squirrel** %3
%6 = load %struct.NetFrame*, %struct.NetFrame** %4
store %struct.NetFrame* %6, %struct.NetFrame** %4
ret void
}

LLVM IR (-O2):
%struct.Squirrel = type opaque
%struct.NetFrame = type opaque
define void @tcp_fin(%struct.Squirrel* nocapture %0, %struct.NetFrame* nocapture %1) {
ret void
}
void noop(void *data) { return; }


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

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

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

LLVM IR (-O2):
define void @noop(i8* nocapture %0) {
ret void
}
int main() {
  char a[][10] = {"Hello", "How", "When"};
  int i = 0;
  for (i = 0; i < 3; i++)
    func(a[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed2(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x14(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x3,-0x34(%rbp)
jge    1190 <main+0x80>
movslq -0x34(%rbp),%rax
lea    -0x30(%rbp),%rdi
imul   $0xa,%rax,%rax
add    %rax,%rdi
mov    $0x0,%al
call   1030 <func@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1162 <main+0x52>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xef3(%rip),%xmm0
movups %xmm0,0xe(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <func@plt>
lea    0xa(%rsp),%rdi
xor    %eax,%eax
call   1030 <func@plt>
lea    0x14(%rsp),%rdi
xor    %eax,%eax
call   1030 <func@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [3 x [10 x i8]] [[10 x i8] c"Hello\00\00\00\00\00", [10 x i8] c"How\00\00\00\00\00\00\00", [10 x i8] c"When\00\00\00\00\00\00"]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [10 x i8]]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [3 x [10 x i8]]* %2 to i8*
store i32 0, i32* %3
store i32 0, i32* %3
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %2, i64 0, i64 %10
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 0
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @func to i32 (i8*, ...)*)(i8* %12)
br label %14
14: ; preds = %8
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %5
17: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [3 x [10 x i8]] [[10 x i8] c"Hello\00\00\00\00\00", [10 x i8] c"How\00\00\00\00\00\00\00", [10 x i8] c"When\00\00\00\00\00\00"]
define i32 @main() {
%1 = alloca [3 x [10 x i8]]
%2 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %1, i64 0, i64 0, i64 0
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @func to i32 (i8*, ...)*)(i8* %2)
%4 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %1, i64 0, i64 1, i64 0
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @func to i32 (i8*, ...)*)(i8* %4)
%6 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %1, i64 0, i64 2, i64 0
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @func to i32 (i8*, ...)*)(i8* %6)
ret i32 0
}