xunge/DecIR huggingface dataset:
/* Variables and functions */
int S_IWGRP;
int S_IWOTH;
int S_IWUSR;
int /*<<< orphan*/ chmod(char *, int);
void main(void) {
  chmod("/sys/class/gpio/export", S_IWUSR | S_IWGRP | S_IWOTH);
  chmod("/sys/class/gpio/unexport", S_IWUSR | S_IWGRP | S_IWOTH);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
mov    0x2ec4(%rip),%rax
or     (%rax),%esi
mov    0x2e9b(%rip),%rax
or     (%rax),%esi
lea    0xeca(%rip),%rdi
call   1030 <chmod@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
mov    0x2e9d(%rip),%rax
or     (%rax),%esi
mov    0x2e74(%rip),%rax
or     (%rax),%esi
lea    0xeba(%rip),%rdi
call   1030 <chmod@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    0x2ec4(%rip),%r14
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%esi
or     (%r14),%esi
mov    0x2e99(%rip),%r15
or     (%r15),%esi
lea    0xec7(%rip),%rdi
call   1030 <chmod@plt>
mov    (%rbx),%esi
or     (%r14),%esi
or     (%r15),%esi
lea    0xeca(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <chmod@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"/sys/class/gpio/export\00"
@S_IWUSR = global i32 0
@S_IWGRP = global i32 0
@S_IWOTH = global i32 0
@.str.1 = [25 x i8] c"/sys/class/gpio/unexport\00"
define void @main() {
%1 = load i32, i32* @S_IWUSR
%2 = load i32, i32* @S_IWGRP
%3 = or i32 %1, %2
%4 = load i32, i32* @S_IWOTH
%5 = or i32 %3, %4
%6 = call i32 @chmod(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @S_IWUSR
%8 = load i32, i32* @S_IWGRP
%9 = or i32 %7, %8
%10 = load i32, i32* @S_IWOTH
%11 = or i32 %9, %10
%12 = call i32 @chmod(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"/sys/class/gpio/export\00"
@S_IWUSR = global i32 0
@S_IWGRP = global i32 0
@S_IWOTH = global i32 0
@.str.1 = [25 x i8] c"/sys/class/gpio/unexport\00"
define void @main() {
%1 = load i32, i32* @S_IWUSR
%2 = load i32, i32* @S_IWGRP
%3 = or i32 %2, %1
%4 = load i32, i32* @S_IWOTH
%5 = or i32 %3, %4
%6 = tail call i32 @chmod(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @S_IWUSR
%8 = load i32, i32* @S_IWGRP
%9 = or i32 %8, %7
%10 = load i32, i32* @S_IWOTH
%11 = or i32 %9, %10
%12 = tail call i32 @chmod(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NoAction();
int /*<<< orphan*/ Waitframe();
void WaitNoAction() {
  NoAction();
  Waitframe();
}


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

x86 assembly (clang, -O2):
<WaitNoAction>:
push   %rax
xor    %eax,%eax
call   1040 <NoAction@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <Waitframe@plt>

LLVM IR (-O0):
define void @WaitNoAction() {
%1 = call i32 (...) @NoAction()
%2 = call i32 (...) @Waitframe()
ret void
}

LLVM IR (-O2):
define void @WaitNoAction() {
%1 = tail call i32 (...) @NoAction()
%2 = tail call i32 (...) @Waitframe()
ret void
}
void NV12ToRGB565Row_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @NV12ToRGB565Row_AVX2() {
ret void
}
void ScaleFilterCols_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ScaleFilterCols_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syscall3(int, unsigned int, int);
char *getcwd(char *buf, int size) { syscall3(183, (unsigned int)buf, size); }


x86 assembly (clang, -O0):
<getcwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
mov    -0x14(%rbp),%edx
mov    $0xb7,%edi
call   1030 <syscall3@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcwd>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0xb7,%edi
jmp    1030 <syscall3@plt>

LLVM IR (-O0):
define i8* @getcwd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i32
%8 = load i32, i32* %5
%9 = call i32 @syscall3(i32 183, i32 %7, i32 %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @getcwd(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @syscall3(i32 183, i32 %4, i32 %1)
ret i8* undef
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int syscall(int, char const *, struct stat *);
int stat(const char *path, struct stat *buf) { return syscall(195, path, buf); }


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

x86 assembly (clang, -O2):
<stat>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xc3,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @stat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i8*, i8** %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i32 @syscall(i32 195, i8* %5, %struct.stat* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @stat(i8* %0, %struct.stat* %1) {
%3 = tail call i32 @syscall(i32 195, i8* %0, %struct.stat* %1)
ret i32 %3
}
long long factorial(int number) {
  if (number <= 1)
    return 1;
  else
    return number * factorial(number - 1);
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     1132 <factorial+0x22>
movq   $0x1,-0x8(%rbp)
jmp    1154 <factorial+0x44>
movslq -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <factorial@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1131 <factorial+0x31>
mov    %edi,%ecx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
imul   %rcx,%rax
lea    -0x1(%rcx),%rdx
cmp    $0x2,%rcx
mov    %rdx,%rcx
ja     1120 <factorial+0x20>
ret

LLVM IR (-O0):
define i64 @factorial(i32 %0) {
%2 = alloca i64
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %2
br label %14
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 1
%12 = call i64 @factorial(i32 %11)
%13 = mul nsw i64 %9, %12
store i64 %13, i64* %2
br label %14
14: ; preds = %7, %6
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
define i64 @factorial(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = zext i32 %0 to i64
br label %5
5: ; preds = %3, %5
%6 = phi i64 [ %4, %3 ], [ %8, %5 ]
%7 = phi i64 [ 1, %3 ], [ %9, %5 ]
%8 = add nsw i64 %6, -1
%9 = mul nsw i64 %7, %6
%10 = icmp ult i64 %6, 3
br i1 %10, label %11, label %5
11: ; preds = %5, %1
%12 = phi i64 [ 1, %1 ], [ %9, %5 ]
ret i64 %12
}
int main(int argc, const char *argv[]) {
  unsigned long rsp = 0, rbp = 0;
  register unsigned long rip = 0;
  __asm__ __volatile__("mov %%rsp, %0\n"
                       "mov %%rbp, %1\n"
                       "lea (%%rip), %2\n"
                       : "=m"(rsp), "=m"(rbp), "=r"(rip)
                       :);
  printf("rsp = %lx, rip = %lx, rbp = %lx\n", rsp, rip, rbp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    %rsp,-0x18(%rbp)
mov    %rbp,-0x20(%rbp)
lea    0x0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,0x10(%rsp)
mov    %rbp,0x8(%rsp)
lea    0x0(%rip),%rdx
mov    0x10(%rsp),%rsi
mov    0x8(%rsp),%rcx
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"rsp = %lx, rip = %lx, rbp = %lx\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %6
store i64 0, i64* %7
store i64 0, i64* %8
%9 = call i64 asm sideeffect "mov %rsp, $0\0Amov %rbp, $1\0Alea (%rip), $2\0A", "=*m,=*m,=r,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i64* elementtype(i64) %7)
store i64 %9, i64* %8
%10 = load i64, i64* %6
%11 = load i64, i64* %8
%12 = load i64, i64* %7
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 %10, i64 %11, i64 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"rsp = %lx, rip = %lx, rbp = %lx\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = alloca i64
%5 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%6 = bitcast i64* %4 to i8*
store i64 0, i64* %4
%7 = call i64 asm sideeffect "mov %rsp, $0\0Amov %rbp, $1\0Alea (%rip), $2\0A", "=*m,=*m,=r,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %3, i64* elementtype(i64) %4)
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 %8, i64 %7, i64 %9)
ret i32 0
}
void constructor_rlhs_f_test_penalty_do_nothing_d(
    const struct Flux_Ref *const flux_r,
    const struct Numerical_Flux *const num_flux,
    struct Solver_Face *const s_face,
    struct Solver_Storage_Implicit *const ssi) {
  (void)(flux_r);
  (void)(num_flux);
  (void)(s_face);
  (void)(ssi);
  return;
}


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

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

LLVM IR (-O0):
%struct.Flux_Ref = type opaque
%struct.Numerical_Flux = type opaque
%struct.Solver_Face = type opaque
%struct.Solver_Storage_Implicit = type opaque
define void @constructor_rlhs_f_test_penalty_do_nothing_d(%struct.Flux_Ref* %0, %struct.Numerical_Flux* %1, %struct.Solver_Face* %2, %struct.Solver_Storage_Implicit* %3) {
%5 = alloca %struct.Flux_Ref*
%6 = alloca %struct.Numerical_Flux*
%7 = alloca %struct.Solver_Face*
%8 = alloca %struct.Solver_Storage_Implicit*
store %struct.Flux_Ref* %0, %struct.Flux_Ref** %5
store %struct.Numerical_Flux* %1, %struct.Numerical_Flux** %6
store %struct.Solver_Face* %2, %struct.Solver_Face** %7
store %struct.Solver_Storage_Implicit* %3, %struct.Solver_Storage_Implicit** %8
%9 = load %struct.Flux_Ref*, %struct.Flux_Ref** %5
%10 = load %struct.Numerical_Flux*, %struct.Numerical_Flux** %6
%11 = load %struct.Solver_Face*, %struct.Solver_Face** %7
%12 = load %struct.Solver_Storage_Implicit*, %struct.Solver_Storage_Implicit** %8
ret void
}

LLVM IR (-O2):
%struct.Flux_Ref = type opaque
%struct.Numerical_Flux = type opaque
%struct.Solver_Face = type opaque
%struct.Solver_Storage_Implicit = type opaque
define void @constructor_rlhs_f_test_penalty_do_nothing_d(%struct.Flux_Ref* nocapture %0, %struct.Numerical_Flux* nocapture %1, %struct.Solver_Face* nocapture %2, %struct.Solver_Storage_Implicit* nocapture %3) {
ret void
}
void set_led_2(int mode) {
  if (mode == 0) {
    (*(volatile unsigned int *)(0x7F008824)) &= ~2;
  } else {
    (*(volatile unsigned int *)(0x7F008824)) |= 2;
  }
  return;
}


x86 assembly (clang, -O0):
<set_led_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1127 <set_led_2+0x27>
mov    $0x7f008824,%eax
mov    (%rax),%ecx
and    $0xfffffffd,%ecx
mov    $0x7f008824,%eax
mov    %ecx,(%rax)
jmp    1138 <set_led_2+0x38>
mov    $0x7f008824,%eax
mov    (%rax),%ecx
or     $0x2,%ecx
mov    $0x7f008824,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_led_2>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
mov    0x7f008824,%ecx
and    $0xfffffffd,%ecx
lea    (%rcx,%rax,2),%eax
mov    %eax,0x7f008824
ret

LLVM IR (-O0):
define void @set_led_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%7 = and i32 %6, -3
store volatile i32 %7, i32* inttoptr (i64 2130741284 to i32*)
br label %11
8: ; preds = %1
%9 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%10 = or i32 %9, 2
store volatile i32 %10, i32* inttoptr (i64 2130741284 to i32*)
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
define void @set_led_2(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%4 = and i32 %3, -3
%5 = select i1 %2, i32 0, i32 2
%6 = or i32 %4, %5
store volatile i32 %6, i32* inttoptr (i64 2130741284 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fun3() {
  printf("this is func3.\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"this is func3.\0A\00"
define void @fun3() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"this is func3.\00"
define void @fun3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xf0() {
  Assert_real((isspace(240) == 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_isspace.c",
              1205, ("isspace should be 0 for 0xf0"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0xf0>:
push   %rax
mov    $0xf0,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4b5,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xf0\00"
define void @t_isspace_0xf0() {
%1 = call i64 @isspace(i32 240)
%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 1205, i8* getelementptr inbounds ([29 x i8], [29 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xf0\00"
define void @t_isspace_0xf0() {
%1 = tail call i64 @isspace(i32 240)
%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 1205, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int htonl(unsigned int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  unsigned int ia = 0x12345678;
  printf("host:%#x\n", ia);
  printf("network:%#x\n", htonl(ia));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"host:%#x\0A\00"
@.str.1 = [13 x i8] c"network:%#x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 305419896, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %6
%10 = call i32 @htonl(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"host:%#x\0A\00"
@.str.1 = [13 x i8] c"network:%#x\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 305419896)
%4 = tail call i32 @htonl(i32 305419896)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
void deadspace(char *str) {
  char *p = str;
  do
    *(*p == ' ' ? str : str++) = *p;
  while (*p++);
}


x86 assembly (clang, -O0):
<deadspace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1136 <deadspace+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1149 <deadspace+0x49>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x11(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    1110 <deadspace+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<deadspace>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
xor    %edx,%edx
cmp    $0x20,%cl
setne  %dl
add    %rdi,%rdx
mov    %cl,(%rdi)
cmpb   $0x0,(%rax)
lea    0x1(%rax),%rax
mov    %rdx,%rdi
jne    1110 <deadspace+0x10>
ret

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

LLVM IR (-O2):
define void @deadspace(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %8, %2 ]
%4 = phi i8* [ %0, %1 ], [ %9, %2 ]
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 32
%7 = zext i1 %6 to i64
%8 = getelementptr i8, i8* %3, i64 %7
store i8 %5, i8* %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %2
12: ; preds = %2
ret void
}
double hole_inject_density(double x, double y, double z, double nx, double ny,
                           double nz, double t) {
  return 0.0;
}


x86 assembly (clang, -O0):
<hole_inject_density>:
push   %rbp
mov    %rsp,%rbp
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  %xmm6,-0x38(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hole_inject_density>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @hole_inject_density(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double %5, double* %13
store double %6, double* %14
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @hole_inject_density(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ putc(char);
void puts(char s[]) {
  for (int i = 0; s[i]; i++) {
    putc(s[i]);
  }
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1154 <puts+0x44>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putc@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <puts+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8 [ %11, %5 ], [ %2, %1 ]
%8 = tail call i32 @putc(i8 signext %7)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %4, label %5
}
unsigned short f5(int x) { return x; }


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

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

LLVM IR (-O0):
define zeroext i16 @f5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @f5(i32 %0) {
%2 = trunc i32 %0 to i16
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ FD_CLOEXEC;
int /*<<< orphan*/ F_SETFD;
int /*<<< orphan*/ error(char *);
int fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
void set_cloexec(int fd) {
  int res;
  res = fcntl(fd, F_SETFD, FD_CLOEXEC);
  if (res == -1)
    error("Cannot fcntl for cloexec");
}


x86 assembly (clang, -O0):
<set_cloexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    115e <set_cloexec+0x3e>
lea    0xea7(%rip),%rdi
call   1040 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cloexec>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
je     113f <set_cloexec+0x1f>
pop    %rax
ret
lea    0xeba(%rip),%rdi
pop    %rax
jmp    1040 <error@plt>

LLVM IR (-O0):
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
@.str = [25 x i8] c"Cannot fcntl for cloexec\00"
define void @set_cloexec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_SETFD
%6 = load i32, i32* @FD_CLOEXEC
%7 = call i32 @fcntl(i32 %4, i32 %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
@.str = [25 x i8] c"Cannot fcntl for cloexec\00"
define void @set_cloexec(i32 %0) {
%2 = load i32, i32* @F_SETFD
%3 = load i32, i32* @FD_CLOEXEC
%4 = tail call i32 @fcntl(i32 %0, i32 %2, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func();
int /*<<< orphan*/ printf(char *);
int main() {
  func();
  printf("end\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <func@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [4 x i8] c"end\00"
define i32 @main() {
%1 = tail call i32 (...) @func()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 0
}
extern int sfvfs_fsnode_close(struct sfvfs_fs *sfs, int fid) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.sfvfs_fs = type opaque
define i32 @sfvfs_fsnode_close(%struct.sfvfs_fs* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void stop_log(void) { closelog(); }


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

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

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

LLVM IR (-O2):
define void @stop_log() {
%1 = tail call i32 (...) @closelog()
ret void
}
/* Variables and functions */
int strncasecmp(char const *, char const *, size_t);
int ls_strncasecmp(const char *a, const char *b, size_t n) {
  if (a == b) {
    return 0;
  }
  if (a == NULL) {
    return -1;
  }
  if (b == NULL) {
    return 1;
  }
  return strncasecmp(a, b, n);
}


x86 assembly (clang, -O0):
<ls_strncasecmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    113e <ls_strncasecmp+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1180 <ls_strncasecmp+0x70>
cmpq   $0x0,-0x10(%rbp)
jne    1155 <ls_strncasecmp+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <ls_strncasecmp+0x70>
cmpq   $0x0,-0x18(%rbp)
jne    116c <ls_strncasecmp+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1180 <ls_strncasecmp+0x70>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncasecmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_strncasecmp>:
cmp    %rsi,%rdi
je     1124 <ls_strncasecmp+0x14>
test   %rdi,%rdi
je     1127 <ls_strncasecmp+0x17>
test   %rsi,%rsi
je     112d <ls_strncasecmp+0x1d>
jmp    1030 <strncasecmp@plt>
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ls_strncasecmp(i8* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = icmp eq i8* %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 0, i32* %4
br label %25
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 -1, i32* %4
br label %25
16: ; preds = %12
%17 = load i8*, i8** %6
%18 = icmp eq i8* %17, null
br i1 %18, label %19, label %20
19: ; preds = %16
store i32 1, i32* %4
br label %25
20: ; preds = %16
%21 = load i8*, i8** %5
%22 = load i8*, i8** %6
%23 = load i64, i64* %7
%24 = call i32 @strncasecmp(i8* %21, i8* %22, i64 %23)
store i32 %24, i32* %4
br label %25
25: ; preds = %20, %19, %15, %11
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @ls_strncasecmp(i8* %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %0, %1
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = icmp eq i8* %0, null
br i1 %6, label %11, label %7
7: ; preds = %5
%8 = icmp eq i8* %1, null
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i32 @strncasecmp(i8* %0, i8* %1, i64 %2)
br label %11
11: ; preds = %7, %5, %3, %9
%12 = phi i32 [ %10, %9 ], [ 0, %3 ], [ -1, %5 ], [ 1, %7 ]
ret i32 %12
}
/* Variables and functions */
int bitarith_msb_32bit_no_native_clz(unsigned int);
unsigned bitarithm_msb(unsigned v) {
  return bitarith_msb_32bit_no_native_clz(v);
}


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

x86 assembly (clang, -O2):
<bitarithm_msb>:
jmp    1030 <bitarith_msb_32bit_no_native_clz@plt>

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

LLVM IR (-O2):
define i32 @bitarithm_msb(i32 %0) {
%2 = tail call i32 @bitarith_msb_32bit_no_native_clz(i32 %0)
ret i32 %2
}
yyPrint_POS(i) long i;
{ printf("%ld", i); }


x86 assembly (clang, -O0):
<yyPrint_POS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyPrint_POS>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i32 @yyPrint_POS(i64 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i32 undef
}
unsigned char implicitcast_2(signed int x) { return x; }


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

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

LLVM IR (-O0):
define zeroext i8 @implicitcast_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @implicitcast_2(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ setsig_fatal_gen(int, void (*)(int), int, char *);
void setsig_fatal(int sig, void (*handler)(int)) {
  setsig_fatal_gen(sig, handler, 1, "setting");
}


x86 assembly (clang, -O0):
<setsig_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
lea    0xece(%rip),%rcx
call   1030 <setsig_fatal_gen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setsig_fatal>:
lea    0xee9(%rip),%rcx
mov    $0x1,%edx
jmp    1030 <setsig_fatal_gen@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"setting\00"
define void @setsig_fatal(i32 %0, void (i32)* %1) {
%3 = alloca i32
%4 = alloca void (i32)*
store i32 %0, i32* %3
store void (i32)* %1, void (i32)** %4
%5 = load i32, i32* %3
%6 = load void (i32)*, void (i32)** %4
%7 = call i32 @setsig_fatal_gen(i32 %5, void (i32)* %6, i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"setting\00"
define void @setsig_fatal(i32 %0, void (i32)* %1) {
%3 = tail call i32 @setsig_fatal_gen(i32 %0, void (i32)* %1, i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ oom_error(char *, size_t);
void *realloc(void *, size_t);
__attribute__((unused)) void *xrealloc(void *p, size_t n) {
  void *result = realloc(p, n);
  if (result == NULL && (n > 0 || p == NULL))
    oom_error("realloc", n);
  return result;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1172 <xrealloc+0x52>
cmpq   $0x0,-0x10(%rbp)
ja     1162 <xrealloc+0x42>
cmpq   $0x0,-0x8(%rbp)
jne    1172 <xrealloc+0x52>
mov    -0x10(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1040 <oom_error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1151 <xrealloc+0x31>
test   %r15,%r15
je     1142 <xrealloc+0x22>
test   %r14,%r14
je     1151 <xrealloc+0x31>
lea    0xeb7(%rip),%rdi
mov    %r14,%rsi
call   1040 <oom_error@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"realloc\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %20
11: ; preds = %2
%12 = load i64, i64* %4
%13 = icmp ugt i64 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = load i8*, i8** %3
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %20
17: ; preds = %14, %11
%18 = load i64, i64* %4
%19 = call i32 @oom_error(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %18)
br label %20
20: ; preds = %17, %14, %2
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
@.str = [8 x i8] c"realloc\00"
define noalias i8* @xrealloc(i8* %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = icmp ne i64 %1, 0
%7 = icmp eq i8* %0, null
%8 = or i1 %7, %6
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 @oom_error(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %1)
br label %11
11: ; preds = %5, %9, %2
ret i8* %3
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
void xA130143D143D0000(uint16_t *accusative, uint16_t *instrumental) {
  if (*instrumental) {
    *accusative = (uint16_t) ~(*accusative);
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     112c <xA130143D143D0000+0x2c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
xor    $0xffffffffffffffff,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
cmpq   $0x0,(%rsi)
je     1109 <xA130143D143D0000+0x9>
notq   (%rdi)
ret

LLVM IR (-O0):
define void @xA130143D143D0000(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load i64, i64* %5
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i64*, i64** %3
%10 = load i64, i64* %9
%11 = xor i64 %10, -1
%12 = load i64*, i64** %3
store i64 %11, i64* %12
br label %13
13: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @xA130143D143D0000(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i64, i64* %0
%7 = xor i64 %6, -1
store i64 %7, i64* %0
br label %8
8: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
long double __ieee754_gammal_r(long double x, int *signgamp) {
  *signgamp = 0;
  fputs("__ieee754_gammal_r not implemented\n", stderr);
  __set_errno(ENOSYS);
  return 0.0;
}


x86 assembly (clang, -O0):
<__ieee754_gammal_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
lea    0xeb4(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ieee754_gammal_r>:
push   %rax
movl   $0x0,(%rdi)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec9(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
pop    %rax
ret

LLVM IR (-O0):
@.str = [36 x i8] c"__ieee754_gammal_r not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__ieee754_gammal_r(x86_fp80 %0, i32* %1) {
%3 = alloca x86_fp80
%4 = alloca i32*
store x86_fp80 %0, x86_fp80* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
store i32 0, i32* %5
%6 = load i32, i32* @stderr
%7 = call i32 @fputs(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @ENOSYS
%9 = call i32 @__set_errno(i32 %8)
ret x86_fp80 0xK00000000000000000000
}

LLVM IR (-O2):
@.str = [36 x i8] c"__ieee754_gammal_r not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__ieee754_gammal_r(x86_fp80 %0, i32* nocapture writeonly %1) {
store i32 0, i32* %1
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @ENOSYS
%6 = tail call i32 @__set_errno(i32 %5)
ret x86_fp80 0xK00000000000000000000
}
/* Type definitions */
struct Connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Connection_close(struct Connection *);
void Connection_error(void *opaque) {
  struct Connection *self;
  self = (struct Connection *)opaque;
  Connection_close(self);
}


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

x86 assembly (clang, -O2):
<Connection_error>:
jmp    1030 <Connection_close@plt>

LLVM IR (-O0):
%struct.Connection = type { i32 }
define void @Connection_error(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.Connection*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.Connection*
store %struct.Connection* %5, %struct.Connection** %3
%6 = load %struct.Connection*, %struct.Connection** %3
%7 = call i32 @Connection_close(%struct.Connection* %6)
ret void
}

LLVM IR (-O2):
%struct.Connection = type { i32 }
define void @Connection_error(i8* %0) {
%2 = bitcast i8* %0 to %struct.Connection*
%3 = tail call i32 @Connection_close(%struct.Connection* %2)
ret void
}
/* Type definitions */
struct s_map {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mapGetKeySize(struct s_map *);
int mapSplayPrefix(struct s_map *, void const *, int /*<<< orphan*/);
int mapSplayKey(struct s_map *map, const void *key) {
  return mapSplayPrefix(map, key, mapGetKeySize(map));
}


x86 assembly (clang, -O0):
<mapSplayKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mapGetKeySize@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <mapSplayPrefix@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapSplayKey>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <mapGetKeySize@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <mapSplayPrefix@plt>

LLVM IR (-O0):
%struct.s_map = type { i32 }
define i32 @mapSplayKey(%struct.s_map* %0, i8* %1) {
%3 = alloca %struct.s_map*
%4 = alloca i8*
store %struct.s_map* %0, %struct.s_map** %3
store i8* %1, i8** %4
%5 = load %struct.s_map*, %struct.s_map** %3
%6 = load i8*, i8** %4
%7 = load %struct.s_map*, %struct.s_map** %3
%8 = call i32 @mapGetKeySize(%struct.s_map* %7)
%9 = call i32 @mapSplayPrefix(%struct.s_map* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.s_map = type { i32 }
define i32 @mapSplayKey(%struct.s_map* %0, i8* %1) {
%3 = tail call i32 @mapGetKeySize(%struct.s_map* %0)
%4 = tail call i32 @mapSplayPrefix(%struct.s_map* %0, i8* %1, i32 %3)
ret i32 %4
}
float builtin_fnmaf(float b, float c, float d) {
  return -__builtin_fmaf(b, c, d);
}


x86 assembly (clang, -O0):
<builtin_fnmaf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <fmaf@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<builtin_fnmaf>:
push   %rax
call   1030 <fmaf@plt>
xorps  0xee3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @builtin_fnmaf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @llvm.fma.f32(float %7, float %8, float %9)
%11 = fneg float %10
ret float %11
}

LLVM IR (-O2):
define float @builtin_fnmaf(float %0, float %1, float %2) {
%4 = tail call float @llvm.fma.f32(float %0, float %1, float %2)
%5 = fneg float %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ mat4d_scale_new(double *, double const, double const,
                                   double const);
void mat4d_scaleVec_new(double result[16], const double xyz[3]) {
  mat4d_scale_new(result, xyz[0], xyz[1], xyz[2]);
}


x86 assembly (clang, -O0):
<mat4d_scaleVec_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
call   1030 <mat4d_scale_new@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat4d_scaleVec_new>:
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm1
movsd  0x10(%rsi),%xmm2
jmp    1030 <mat4d_scale_new@plt>

LLVM IR (-O0):
define void @mat4d_scaleVec_new(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 2
%14 = load double, double* %13
%15 = call i32 @mat4d_scale_new(double* %5, double %8, double %11, double %14)
ret void
}

LLVM IR (-O2):
define void @mat4d_scaleVec_new(double* %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %1, i64 2
%7 = load double, double* %6
%8 = tail call i32 @mat4d_scale_new(double* %0, double %3, double %5, double %7)
ret void
}
/* Variables and functions */
int PRCMHIBRegRead(int);
unsigned long PRCMHibernateWakeupCauseGet() {
  if (((*((volatile unsigned long *)(0x00000400))) & 0xFFFF) >= 2) {
    return ((PRCMHIBRegRead((0x4402E000 + 0x00000188)) >> 2) & 0xF);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<PRCMHibernateWakeupCauseGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x400,%eax
mov    (%rax),%rax
and    $0xffff,%rax
cmp    $0x2,%rax
jb     114b <PRCMHibernateWakeupCauseGet+0x3b>
mov    $0x4402e188,%edi
call   1030 <PRCMHIBRegRead@plt>
sar    $0x2,%eax
and    $0xf,%eax
cltq
mov    %rax,-0x8(%rbp)
jmp    1153 <PRCMHibernateWakeupCauseGet+0x43>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRCMHibernateWakeupCauseGet>:
push   %rax
testq  $0xfffe,0x400
je     1131 <PRCMHibernateWakeupCauseGet+0x21>
mov    $0x4402e188,%edi
call   1030 <PRCMHIBRegRead@plt>
shr    $0x2,%eax
and    $0xf,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @PRCMHibernateWakeupCauseGet() {
%1 = alloca i64
%2 = load volatile i64, i64* inttoptr (i64 1024 to i64*)
%3 = and i64 %2, 65535
%4 = icmp uge i64 %3, 2
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = call i32 @PRCMHIBRegRead(i32 1141039496)
%7 = ashr i32 %6, 2
%8 = and i32 %7, 15
%9 = sext i32 %8 to i64
store i64 %9, i64* %1
br label %11
10: ; preds = %0
store i64 0, i64* %1
br label %11
11: ; preds = %10, %5
%12 = load i64, i64* %1
ret i64 %12
}

LLVM IR (-O2):
define i64 @PRCMHibernateWakeupCauseGet() {
%1 = load volatile i64, i64* inttoptr (i64 1024 to i64*)
%2 = and i64 %1, 65534
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %0
%5 = tail call i32 @PRCMHIBRegRead(i32 1141039496)
%6 = lshr i32 %5, 2
%7 = and i32 %6, 15
%8 = zext i32 %7 to i64
br label %9
9: ; preds = %0, %4
%10 = phi i64 [ %8, %4 ], [ 0, %0 ]
ret i64 %10
}