xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned long bb_strtoull(char const *, char **, int);
unsigned long bb_strtoul(const char *arg, char **endp, int base) {
  return bb_strtoull(arg, endp, base);
}


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

x86 assembly (clang, -O2):
<bb_strtoul>:
jmp    1030 <bb_strtoull@plt>

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

LLVM IR (-O2):
define i64 @bb_strtoul(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @bb_strtoull(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ kclear();
void clear() { kclear(); }


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

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

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

LLVM IR (-O2):
define void @clear() {
%1 = tail call i32 (...) @kclear()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ process_get_current();
int /*<<< orphan*/ process_set_priority(int /*<<< orphan*/, unsigned int);
void process_set_current_priority(unsigned int priority) {
  process_set_priority(process_get_current(), priority);
}


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

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

LLVM IR (-O0):
define void @process_set_current_priority(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @process_get_current()
%4 = load i32, i32* %2
%5 = call i32 @process_set_priority(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
define void @process_set_current_priority(i32 %0) {
%2 = tail call i32 (...) @process_get_current()
%3 = tail call i32 @process_set_priority(i32 %2, i32 %0)
ret void
}
void do_vtonoff(void *gw, void *closure, void *data) {}


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

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

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

LLVM IR (-O2):
define void @do_vtonoff(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
int pledge(const char *promises, const char *paths[]) {
  (void)(paths);
  (void)(promises);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pledge(i8* nocapture readnone %0, i8** nocapture readnone %1) {
ret i32 0
}
void atomic_ptr_set(void **ptr, void *val) { *ptr = val; }


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

x86 assembly (clang, -O2):
<atomic_ptr_set>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @atomic_ptr_set(i8** nocapture writeonly %0, i8* %1) {
store i8* %1, i8** %0
ret void
}
void shelld_alarm(int sig) { ; }


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

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

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

LLVM IR (-O2):
define void @shelld_alarm(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int arraySize, int *array) {
  int i;
  for (i = 0; i < arraySize; i++) {
    printf("%d ", array[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1159 <printArray+0x49>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1157 <printArray+0x37>
mov    %rsi,%r15
mov    %edi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %1, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("GLEX - DFA Generator beta (2015 Oct 31)\n");
  printf("usage: glex <file>    parse specified file\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf04(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"GLEX - DFA Generator beta (2015 Oct 31)\0A\00"
@.str.1 = [44 x i8] c"usage: glex <file> parse specified file\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [40 x i8] c"GLEX - DFA Generator beta (2015 Oct 31)\00"
@str.2 = [43 x i8] c"usage: glex <file> parse specified file\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glOrtho(double, double, double, double, double, double);
void Ortho(double l, double r, double b, double t, double n, double f) {
  glOrtho(l, r, b, t, n, f);
}


x86 assembly (clang, -O0):
<Ortho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm5
call   1030 <glOrtho@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ortho>:
jmp    1030 <glOrtho@plt>

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

LLVM IR (-O2):
define void @Ortho(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call i32 @glOrtho(double %0, double %1, double %2, double %3, double %4, double %5)
ret void
}
/* Type definitions */
struct quat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ quat_conjugate(float *, float *);
__attribute__((always_)) struct quat *psquat_conjugate(struct quat *result,
                                                       struct quat *a) {
  quat_conjugate((float *)result, (float *)a);
  return result;
}


x86 assembly (clang, -O0):
<psquat_conjugate>:
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 <quat_conjugate@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psquat_conjugate>:
push   %rbx
mov    %rdi,%rbx
call   1030 <quat_conjugate@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.quat = type { i32 }
define %struct.quat* @psquat_conjugate(%struct.quat* %0, %struct.quat* %1) {
%3 = alloca %struct.quat*
%4 = alloca %struct.quat*
store %struct.quat* %0, %struct.quat** %3
store %struct.quat* %1, %struct.quat** %4
%5 = load %struct.quat*, %struct.quat** %3
%6 = bitcast %struct.quat* %5 to float*
%7 = load %struct.quat*, %struct.quat** %4
%8 = bitcast %struct.quat* %7 to float*
%9 = call i32 @quat_conjugate(float* %6, float* %8)
%10 = load %struct.quat*, %struct.quat** %3
ret %struct.quat* %10
}

LLVM IR (-O2):
%struct.quat = type { i32 }
define %struct.quat* @psquat_conjugate(%struct.quat* returned %0, %struct.quat* %1) {
%3 = bitcast %struct.quat* %0 to float*
%4 = bitcast %struct.quat* %1 to float*
%5 = tail call i32 @quat_conjugate(float* %3, float* %4)
ret %struct.quat* %0
}
int always_sampler_next(struct htrace_sampler *sampler) { return 1; }


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

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

LLVM IR (-O0):
%struct.htrace_sampler = type opaque
define i32 @always_sampler_next(%struct.htrace_sampler* %0) {
%2 = alloca %struct.htrace_sampler*
store %struct.htrace_sampler* %0, %struct.htrace_sampler** %2
ret i32 1
}

LLVM IR (-O2):
%struct.htrace_sampler = type opaque
define i32 @always_sampler_next(%struct.htrace_sampler* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
scalar_t__ cos(double);
int /*<<< orphan*/ printf(char *, double);
int foo() {
  printf("cos (0.0) = %g\n", (double)cos((double)0.0));
  return 0xf00;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
call   1040 <cos@plt>
cvtsi2sd %rax,%xmm0
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    $0xf00,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xorps  %xmm0,%xmm0
call   1040 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    $0xf00,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"cos (0.0) = %g\0A\00"
define i32 @foo() {
%1 = call i64 @cos(double 0.000000e+00)
%2 = sitofp i64 %1 to double
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 3840
}

LLVM IR (-O2):
@.str = [16 x i8] c"cos (0.0) = %g\0A\00"
define i32 @foo() {
%1 = tail call i64 @cos(double 0.000000e+00)
%2 = sitofp i64 %1 to double
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 3840
}
int imgseed(int **img, int x, int y) {
  img[x][y] = 255;
  return 0;
}


x86 assembly (clang, -O0):
<imgseed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
movl   $0xff,(%rax,%rcx,4)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imgseed>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rax
movslq %edx,%rcx
movl   $0xff,(%rax,%rcx,4)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @imgseed(i32** %0, i32 %1, i32 %2) {
%4 = alloca i32**
%5 = alloca i32
%6 = alloca i32
store i32** %0, i32*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32**, i32*** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32*, i32** %7, i64 %9
%11 = load i32*, i32** %10
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 255, i32* %14
ret i32 0
}

LLVM IR (-O2):
define i32 @imgseed(i32** nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32*, i32** %0, i64 %4
%6 = load i32*, i32** %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %6, i64 %7
store i32 255, i32* %8
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x38() {
  Assert_real((isalpha(56) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              285, ("isalpha should be 0 for 8"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x38>:
push   %rax
mov    $0x38,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x11d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for 8\00"
define void @t_isalpha_0x38() {
%1 = tail call i64 @isalpha(i32 56)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 285, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *leading(char *);
char firstchar(char *line) {
  line = leading(line);
  return line ? *line : 0;
}


x86 assembly (clang, -O0):
<firstchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <leading@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1143 <firstchar+0x33>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    114d <firstchar+0x3d>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <firstchar+0x3d>
mov    -0xc(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<firstchar>:
push   %rax
call   1030 <leading@plt>
test   %rax,%rax
je     111f <firstchar+0xf>
mov    (%rax),%al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @firstchar(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @leading(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %7
%13 = phi i32 [ %10, %7 ], [ 0, %11 ]
%14 = trunc i32 %13 to i8
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @firstchar(i8* %0) {
%2 = tail call i8* @leading(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = load i8, i8* %2
br label %6
6: ; preds = %1, %4
%7 = phi i8 [ %5, %4 ], [ 0, %1 ]
ret i8 %7
}
/* Type definitions */
struct ibv_cq {
  int dummy;
};
struct ibv_comp_channel {
  int dummy;
};

/* Variables and functions */
int _get_cq_event(struct ibv_comp_channel *, struct ibv_cq **, void **);
int /*<<< orphan*/ dmtcp_plugin_disable_ckpt();
int /*<<< orphan*/ dmtcp_plugin_enable_ckpt();
int ibv_get_cq_event(struct ibv_comp_channel *channel, struct ibv_cq **cq,
                     void **cq_context) {
  dmtcp_plugin_disable_ckpt();
  int rslt = _get_cq_event(channel, cq, cq_context);
  dmtcp_plugin_enable_ckpt();
  return rslt;
}


x86 assembly (clang, -O0):
<ibv_get_cq_event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <_get_cq_event@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibv_get_cq_event>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <_get_cq_event@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.ibv_comp_channel = type { i32 }
%struct.ibv_cq = type { i32 }
define i32 @ibv_get_cq_event(%struct.ibv_comp_channel* %0, %struct.ibv_cq** %1, i8** %2) {
%4 = alloca %struct.ibv_comp_channel*
%5 = alloca %struct.ibv_cq**
%6 = alloca i8**
%7 = alloca i32
store %struct.ibv_comp_channel* %0, %struct.ibv_comp_channel** %4
store %struct.ibv_cq** %1, %struct.ibv_cq*** %5
store i8** %2, i8*** %6
%8 = call i32 (...) @dmtcp_plugin_disable_ckpt()
%9 = load %struct.ibv_comp_channel*, %struct.ibv_comp_channel** %4
%10 = load %struct.ibv_cq**, %struct.ibv_cq*** %5
%11 = load i8**, i8*** %6
%12 = call i32 @_get_cq_event(%struct.ibv_comp_channel* %9, %struct.ibv_cq** %10, i8** %11)
store i32 %12, i32* %7
%13 = call i32 (...) @dmtcp_plugin_enable_ckpt()
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
%struct.ibv_comp_channel = type { i32 }
%struct.ibv_cq = type { i32 }
define i32 @ibv_get_cq_event(%struct.ibv_comp_channel* %0, %struct.ibv_cq** %1, i8** %2) {
%4 = tail call i32 (...) @dmtcp_plugin_disable_ckpt()
%5 = tail call i32 @_get_cq_event(%struct.ibv_comp_channel* %0, %struct.ibv_cq** %1, i8** %2)
%6 = tail call i32 (...) @dmtcp_plugin_enable_ckpt()
ret i32 %5
}
void prompt_lib(char *c, int *dx, int *dy) {}


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

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

LLVM IR (-O0):
define void @prompt_lib(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 void
}

LLVM IR (-O2):
define void @prompt_lib(i8* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printParenthesis(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                    int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printParenthesis(0, n, 0, 0);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%esi
xor    %ecx,%ecx
mov    %ecx,%edi
mov    %ecx,%edx
call   1030 <printParenthesis@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
xor    %edi,%edi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <printParenthesis@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printParenthesis(i32 0, i32 %4, i32 0, i32 0)
%6 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
void *linked_mem_pool_new(size_t, int);
void *virtual_machine_resource_pool_linked_init(size_t size) {
  return linked_mem_pool_new(size, 1);
}


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

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

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

LLVM IR (-O2):
define i8* @virtual_machine_resource_pool_linked_init(i64 %0) {
%2 = tail call i8* @linked_mem_pool_new(i64 %0, i32 1)
ret i8* %2
}
/* Variables and functions */
char *strtok_r(char *, char const *, char **);
char *strtok(char *str, const char *delim) {
  static char *saveptr = NULL;
  char *token;
  token = strtok_r(str, delim, &saveptr);
  if (!token) {
    saveptr = NULL;
  }
  return token;
}


x86 assembly (clang, -O0):
<strtok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0x2f01(%rip),%rdx
call   1030 <strtok_r@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114e <strtok+0x3e>
movq   $0x0,0x2ee2(%rip)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtok>:
push   %rax
lea    0x2f18(%rip),%rdx
call   1030 <strtok_r@plt>
test   %rax,%rax
je     1124 <strtok+0x14>
pop    %rcx
ret
movq   $0x0,0x2f01(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@strtok.saveptr = internal global i8* null
define i8* @strtok(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @strtok_r(i8* %6, i8* %7, i8** @strtok.saveptr)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %2
store i8* null, i8** @strtok.saveptr
br label %12
12: ; preds = %11, %2
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
@strtok.saveptr = internal global i8* null
define i8* @strtok(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strtok_r(i8* %0, i8* %1, i8** @strtok.saveptr)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %2
store i8* null, i8** @strtok.saveptr
br label %6
6: ; preds = %5, %2
ret i8* %3
}
int compare_enum() {
  enum { A };
  return A == A;
}


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

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

LLVM IR (-O0):
define i32 @compare_enum() {
ret i32 1
}

LLVM IR (-O2):
define i32 @compare_enum() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ do_mlog();
int /*<<< orphan*/ do_reboot_count_file();
int main(int argc, char *argv[]) {
  do_mlog();
  do_reboot_count_file();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <do_mlog@plt>
mov    $0x0,%al
call   1030 <do_reboot_count_file@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <do_mlog@plt>
xor    %eax,%eax
call   1030 <do_reboot_count_file@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @do_mlog()
%4 = tail call i32 (...) @do_reboot_count_file()
ret i32 0
}
/* Variables and functions */
scalar_t__ asprintf(char **, char *, char const *, char const *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
char *path_join(const char *p1, const char *p2) {
  char *result;
  if (asprintf(&result, "%s/%s", p1, p2) < 0) {
    fprintf(stderr, "scubainit"
                    ": "
                    "Failed to allocate path string: %m\n");
    exit(99);
  }
  return result;
}


x86 assembly (clang, -O0):
<path_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    -0x18(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1040 <asprintf@plt>
cmp    $0x0,%rax
jge    1181 <path_join+0x51>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x63,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_join>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xec2(%rip),%rsi
mov    %rsp,%rdi
call   1040 <asprintf@plt>
test   %rax,%rax
js     1151 <path_join+0x21>
mov    (%rsp),%rax
pop    %rcx
ret
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x63,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s/%s\00"
@stderr = global i32 0
@.str.1 = [47 x i8] c"scubainit: Failed to allocate path string: %m\0A\00"
define i8* @path_join(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i64 @asprintf(i8** %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @exit(i32 99)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
@stderr = global i32 0
@.str.1 = [47 x i8] c"scubainit: Failed to allocate path string: %m\0A\00"
define i8* @path_join(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i64 @asprintf(i8** %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @exit(i32 99)
unreachable
11: ; preds = %2
%12 = load i8*, i8** %3
ret i8* %12
}
int xmlUCSIsTamil(int code) { return (((code >= 0x0B80) && (code <= 0x0BFF))); }


x86 assembly (clang, -O0):
<xmlUCSIsTamil>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xb80,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsTamil+0x26>
cmpl   $0xbff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsTamil>:
and    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0xb80,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @xmlUCSIsTamil(i32 %0) {
%2 = and i32 %0, -128
%3 = icmp eq i32 %2, 2944
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test3_f();
void test3_foo(void) { test3_f(); }


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

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

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

LLVM IR (-O2):
define void @test3_foo() {
%1 = tail call i32 (...) @test3_f()
ret void
}
/* Variables and functions */
long strtol(unsigned char const *, unsigned char **, int);
long atol(const unsigned char *__p) {
  return strtol(__p, (unsigned char **)0, 10);
}


x86 assembly (clang, -O0):
<atol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atol>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i64 @atol(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtol(i8* %3, i8** null, i32 10)
ret i64 %4
}

LLVM IR (-O2):
define i64 @atol(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
char GetInput(void) {
  char plaintext;
  scanf("%c", &plaintext);
  return plaintext;
}


x86 assembly (clang, -O0):
<GetInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1030 <scanf@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetInput>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define signext i8 @GetInput() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
ret i8 %3
}
void powerOffUart0(void) {}


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

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

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

LLVM IR (-O2):
define void @powerOffUart0() {
ret void
}
struct protoent *getprotobynumber(int proto) {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<getprotobynumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
lea    0xedc(%rip),%rsi
lea    0xee7(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
jmp    1132 <getprotobynumber+0x22>

x86 assembly (clang, -O2):
<getprotobynumber>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
nopl   0x0(%rax,%rax,1)
jmp    1130 <getprotobynumber+0x20>

LLVM IR (-O0):
%struct.protoent = type opaque
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.getprotobynumber = [17 x i8] c"getprotobynumber\00"
define %struct.protoent* @getprotobynumber(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__FUNCTION__.getprotobynumber, i64 0, i64 0))
br label %4
4: ; preds = %1, %4
br label %4
}

LLVM IR (-O2):
%struct.protoent = type opaque
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.getprotobynumber = [17 x i8] c"getprotobynumber\00"
define %struct.protoent* @getprotobynumber(i32 %0) {
%2 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__FUNCTION__.getprotobynumber, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
br label %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int nrg_check_footer(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool nrg_check_file(FILE *f) { return nrg_check_footer(f, NULL); }


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

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

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

LLVM IR (-O2):
define i32 @nrg_check_file(i32* %0) {
%2 = tail call i32 @nrg_check_footer(i32* %0, i32* null)
ret i32 %2
}
void olpc_quirks_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @olpc_quirks_cleanup() {
ret void
}
void __null_handler__() {}


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

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

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

LLVM IR (-O2):
define void @__null_handler__() {
ret void
}
/* Variables and functions */
unsigned long long _tzcnt_u64(unsigned long long);
unsigned long long test_tzcnt_u64(unsigned long long __X) {
  return _tzcnt_u64(__X);
}


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

x86 assembly (clang, -O2):
<test_tzcnt_u64>:
jmp    1030 <_tzcnt_u64@plt>

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

LLVM IR (-O2):
define i64 @test_tzcnt_u64(i64 %0) {
%2 = tail call i64 @_tzcnt_u64(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ mdfour(unsigned char *, unsigned char *, int);
unsigned Com_BlockChecksum(void *buffer, int length) {
  unsigned char digest[16];
  mdfour((unsigned char *)digest, (unsigned char *)buffer, length);
  return ((unsigned *)digest)[0] ^ ((unsigned *)digest)[1] ^
         ((unsigned *)digest)[2] ^ ((unsigned *)digest)[3];
}


x86 assembly (clang, -O0):
<Com_BlockChecksum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <mdfour@plt>
mov    -0x20(%rbp),%eax
xor    -0x1c(%rbp),%eax
xor    -0x18(%rbp),%eax
xor    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Com_BlockChecksum>:
sub    $0x18,%rsp
mov    %esi,%edx
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <mdfour@plt>
movdqa (%rsp),%xmm0
pshufd $0xee,%xmm0,%xmm1
pxor   %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
pxor   %xmm1,%xmm0
movd   %xmm0,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @Com_BlockChecksum(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [16 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @mdfour(i8* %6, i8* %7, i32 %8)
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%11 = bitcast i8* %10 to i32*
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%15 = bitcast i8* %14 to i32*
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
%18 = xor i32 %13, %17
%19 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%20 = bitcast i8* %19 to i32*
%21 = getelementptr inbounds i32, i32* %20, i64 2
%22 = load i32, i32* %21
%23 = xor i32 %18, %22
%24 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%25 = bitcast i8* %24 to i32*
%26 = getelementptr inbounds i32, i32* %25, i64 3
%27 = load i32, i32* %26
%28 = xor i32 %23, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @Com_BlockChecksum(i8* %0, i32 %1) {
%3 = alloca <4 x i32>
%4 = bitcast <4 x i32>* %3 to i8*
%5 = call i32 @mdfour(i8* %4, i8* %0, i32 %1)
%6 = load <4 x i32>, <4 x i32>* %3
%7 = call i32 @llvm.vector.reduce.xor.v4i32(<4 x i32> %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arc_seti(int);
void bar(void) { __builtin_arc_seti(10); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <__builtin_arc_seti@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @bar() {
%1 = call i32 @__builtin_arc_seti(i32 10)
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 @__builtin_arc_seti(i32 10)
ret void
}
/* Variables and functions */
double sqrt(float);
double dist(int x1, int y1, int x2, int y2) {
  float dx, dy;
  dx = x2 - x1;
  dy = y2 - y1;
  return sqrt(dx * dx + dy * dy) + 0.5;
}


x86 assembly (clang, -O0):
<dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
sub    -0x8(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  0xe95(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist>:
push   %rax
sub    %edi,%edx
cvtsi2ss %edx,%xmm0
sub    %esi,%ecx
cvtsi2ss %ecx,%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
addsd  0xeca(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dist(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca float
%10 = alloca float
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %7
%12 = load i32, i32* %5
%13 = sub nsw i32 %11, %12
%14 = sitofp i32 %13 to float
store float %14, float* %9
%15 = load i32, i32* %8
%16 = load i32, i32* %6
%17 = sub nsw i32 %15, %16
%18 = sitofp i32 %17 to float
store float %18, float* %10
%19 = load float, float* %9
%20 = load float, float* %9
%21 = load float, float* %10
%22 = load float, float* %10
%23 = fmul float %21, %22
%24 = call float @llvm.fmuladd.f32(float %19, float %20, float %23)
%25 = call double @sqrt(float %24)
%26 = fadd double %25, 5.000000e-01
ret double %26
}

LLVM IR (-O2):
define double @dist(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %2, %0
%6 = sitofp i32 %5 to float
%7 = sub nsw i32 %3, %1
%8 = sitofp i32 %7 to float
%9 = fmul float %8, %8
%10 = tail call float @llvm.fmuladd.f32(float %6, float %6, float %9)
%11 = tail call double @sqrt(float %10)
%12 = fadd double %11, 5.000000e-01
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int chroot(const char *path) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<chroot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chroot>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @chroot(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @chroot(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void DefaultPath(char *path, char *basepath) {
  char temp[128];
  if (path[0] == '/')
    return;
  strcpy(temp, path);
  strcpy(path, basepath);
  strcat(path, temp);
}


x86 assembly (clang, -O0):
<DefaultPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1148 <DefaultPath+0x28>
jmp    1175 <DefaultPath+0x55>
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DefaultPath>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
cmpb   $0x2f,(%rdi)
je     115b <DefaultPath+0x3b>
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcat@plt>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @DefaultPath(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [128 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 47
br i1 %10, label %11, label %12
11: ; preds = %2
br label %22
12: ; preds = %2
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %3
%17 = load i8*, i8** %4
%18 = call i32 @strcpy(i8* %16, i8* %17)
%19 = load i8*, i8** %3
%20 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%21 = call i32 @strcat(i8* %19, i8* %20)
br label %22
22: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @DefaultPath(i8* %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 47
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = call i32 @strcpy(i8* %4, i8* %0)
%9 = call i32 @strcpy(i8* %0, i8* %1)
%10 = call i32 @strcat(i8* %0, i8* %4)
br label %11
11: ; preds = %2, %7
ret void
}