xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ glutDestroyWindow;
int glutGetWindow();
int /*<<< orphan*/ glutHideWindow();
int /*<<< orphan*/ glutSetWindow(int);
int /*<<< orphan*/ glutTimerFunc(int, void *, int);
int glipKillImageWin(int No) {
  int win;
  win = glutGetWindow();
  if (win == No) {
    glutSetWindow(No);
    glutHideWindow();
  }
  glutTimerFunc(1000, (void *)glutDestroyWindow, No);
  return win;
}


x86 assembly (clang, -O0):
<glipKillImageWin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <glutGetWindow@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    1170 <glipKillImageWin+0x30>
mov    -0x4(%rbp),%edi
call   1060 <glutSetWindow@plt>
mov    $0x0,%al
call   1040 <glutHideWindow@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%rsi
mov    -0x4(%rbp),%edx
mov    $0x3e8,%edi
call   1050 <glutTimerFunc@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glipKillImageWin>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <glutGetWindow@plt>
mov    %eax,%ebp
cmp    %ebx,%eax
jne    1160 <glipKillImageWin+0x20>
mov    %ebx,%edi
call   1060 <glutSetWindow@plt>
xor    %eax,%eax
call   1040 <glutHideWindow@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%rsi
mov    $0x3e8,%edi
mov    %ebx,%edx
call   1050 <glutTimerFunc@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@glutDestroyWindow = global i64 0
define i32 @glipKillImageWin(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @glutGetWindow()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @glutSetWindow(i32 %9)
%11 = call i32 (...) @glutHideWindow()
br label %12
12: ; preds = %8, %1
%13 = load i64, i64* @glutDestroyWindow
%14 = inttoptr i64 %13 to i8*
%15 = load i32, i32* %2
%16 = call i32 @glutTimerFunc(i32 1000, i8* %14, i32 %15)
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@glutDestroyWindow = global i64 0
define i32 @glipKillImageWin(i32 %0) {
%2 = tail call i32 (...) @glutGetWindow()
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @glutSetWindow(i32 %0)
%6 = tail call i32 (...) @glutHideWindow()
br label %7
7: ; preds = %4, %1
%8 = load i64, i64* @glutDestroyWindow
%9 = inttoptr i64 %8 to i8*
%10 = tail call i32 @glutTimerFunc(i32 1000, i8* %9, i32 %0)
ret i32 %2
}
void __attribute__((weak)) EXTI8_Callback(void) {}


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

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

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

LLVM IR (-O2):
define weak void @EXTI8_Callback() {
ret void
}
int devtmpfs_mount(const char *mountpoint) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @devtmpfs_mount(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void printDouble(void *value) {
  double *doublePtr = (double *)value;
  printf("%.2f", *doublePtr);
}


x86 assembly (clang, -O0):
<printDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printDouble>:
movsd  (%rdi),%xmm0
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%.2f\00"
define void @printDouble(i8* nocapture %0) {
%2 = bitcast i8* %0 to double*
%3 = load double, double* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ae(int);
int s(int, int);
int S(int j, int e) {
  ae(1032325);
  return s(132 + j, e);
}


x86 assembly (clang, -O0):
<S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xfc085,%edi
call   1030 <ae@plt>
mov    -0x4(%rbp),%edi
add    $0x84,%edi
mov    -0x8(%rbp),%esi
call   1040 <s@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xfc085,%edi
call   1030 <ae@plt>
add    $0x84,%ebp
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <s@plt>

LLVM IR (-O0):
define i32 @S(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @ae(i32 1032325)
%6 = load i32, i32* %3
%7 = add nsw i32 132, %6
%8 = load i32, i32* %4
%9 = call i32 @s(i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @S(i32 %0, i32 %1) {
%3 = tail call i32 @ae(i32 1032325)
%4 = add nsw i32 %0, 132
%5 = tail call i32 @s(i32 %4, i32 %1)
ret i32 %5
}
/* Variables and functions */
int __VERIFIER_nondet_int();
scalar_t__ alloca(int);
int /*<<< orphan*/ test_fun(int *, int);
int main() {
  int array_size = __VERIFIER_nondet_int();
  if (array_size < 1 || array_size >= 2147483647 / sizeof(int)) {
    array_size = 1;
  }
  int *numbers = (int *)alloca(array_size * sizeof(int));
  test_fun(numbers, array_size);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     1163 <main+0x33>
movslq -0x8(%rbp),%rax
cmp    $0x1fffffff,%rax
jb     116a <main+0x3a>
movl   $0x1,-0x8(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <alloca@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <test_fun@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
lea    -0x1fffffff(%rax),%ecx
cmp    $0xe0000002,%ecx
mov    $0x1,%ebx
cmovae %eax,%ebx
lea    0x0(,%rbx,4),%edi
call   1030 <alloca@plt>
mov    %rax,%rdi
mov    %ebx,%esi
call   1050 <test_fun@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 1
br i1 %6, label %11, label %7
7: ; preds = %0
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = icmp uge i64 %9, 536870911
br i1 %10, label %11, label %12
11: ; preds = %7, %0
store i32 1, i32* %2
br label %12
12: ; preds = %11, %7
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = mul i64 %14, 4
%16 = trunc i64 %15 to i32
%17 = call i64 @alloca(i32 %16)
%18 = inttoptr i64 %17 to i32*
store i32* %18, i32** %3
%19 = load i32*, i32** %3
%20 = load i32, i32* %2
%21 = call i32 @test_fun(i32* %19, i32 %20)
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = add i32 %1, -536870911
%3 = icmp ult i32 %2, -536870910
%4 = select i1 %3, i32 1, i32 %1
%5 = shl nuw nsw i32 %4, 2
%6 = tail call i64 @alloca(i32 %5)
%7 = inttoptr i64 %6 to i32*
%8 = tail call i32 @test_fun(i32* %7, i32 %4)
ret i32 0
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ critical(char *);
void *mp_calloc(size_t nmemb, size_t size) {
  void *p;
  p = calloc(nmemb, size);
  if (!p)
    critical("Out of memory!");
  return p;
}


x86 assembly (clang, -O0):
<mp_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <mp_calloc+0x38>
lea    0xead(%rip),%rdi
call   1030 <critical@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_calloc>:
push   %rbx
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <mp_calloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <critical@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Out of memory!\00"
define i8* @mp_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @critical(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [15 x i8] c"Out of memory!\00"
define noalias i8* @mp_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @critical(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
void loop_body(int *x, int *y, int *i) {
  *x = *x + *y;
  *y = *y + 1;
  *i = *i + 1;
}


x86 assembly (clang, -O0):
<loop_body>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop_body>:
mov    (%rsi),%eax
add    %eax,(%rdi)
addl   $0x1,(%rsi)
addl   $0x1,(%rdx)
ret

LLVM IR (-O0):
define void @loop_body(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* %7
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
%12 = load i32*, i32** %4
store i32 %11, i32* %12
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1
%16 = load i32*, i32** %5
store i32 %15, i32* %16
%17 = load i32*, i32** %6
%18 = load i32, i32* %17
%19 = add nsw i32 %18, 1
%20 = load i32*, i32** %6
store i32 %19, i32* %20
ret void
}

LLVM IR (-O2):
define void @loop_body(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = add nsw i32 %5, %4
store i32 %6, i32* %0
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void do_output_word_count(FILE *out, int words) {
  fprintf(out, "total %d words\n", words);
}


x86 assembly (clang, -O0):
<do_output_word_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_output_word_count>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"total %d words\0A\00"
define void @do_output_word_count(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"total %d words\0A\00"
define void @do_output_word_count(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void bpnn_initialize(seed) {
  printf("Random number generator seed: %d\n", seed);
  srandom(seed);
}


x86 assembly (clang, -O0):
<bpnn_initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <srandom@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpnn_initialize>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <srandom@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Random number generator seed: %d\0A\00"
define void @bpnn_initialize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = call i32 (i32, ...) bitcast (i32 (...)* @srandom to i32 (i32, ...)*)(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Random number generator seed: %d\0A\00"
define void @bpnn_initialize(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @srandom to i32 (i32, ...)*)(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Com_Printf(char *);
int /*<<< orphan*/ Cvar_InfoString(int);
int /*<<< orphan*/ Info_Print(int /*<<< orphan*/);
void SV_Systeminfo_f(void) {
  Com_Printf("System info settings:\n");
  Info_Print(Cvar_InfoString(4 | 8192));
}


x86 assembly (clang, -O0):
<SV_Systeminfo_f>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <Com_Printf@plt>
mov    $0x2004,%edi
call   1030 <Cvar_InfoString@plt>
mov    %eax,%edi
call   1050 <Info_Print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SV_Systeminfo_f>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <Com_Printf@plt>
mov    $0x2004,%edi
call   1030 <Cvar_InfoString@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <Info_Print@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"System info settings:\0A\00"
define void @SV_Systeminfo_f() {
%1 = call i32 @Com_Printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @Cvar_InfoString(i32 8196)
%3 = call i32 @Info_Print(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"System info settings:\0A\00"
define void @SV_Systeminfo_f() {
%1 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @Cvar_InfoString(i32 8196)
%3 = tail call i32 @Info_Print(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_help(char *fname) {
  printf("Usage: %s <option(s)> elf-files(s)\n Inject ELF protect code to ELF "
         "executables to protect it from infection, inject ELF object to ELF "
         "executable, scan ELF file for changes\n Options are:\n -h\tDisplay "
         "this text\n -p\tInject ELF protect code\n -i\tInject ELF object to "
         "ELF executable\n",
         fname);
  return;
}


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

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

LLVM IR (-O0):
@.str = [277 x i8] c"Usage: %s <option(s)> elf-files(s)\0A Inject ELF protect code to ELF executables to protect it from infection, inject ELF object to ELF executable, scan ELF file for changes\0A Options are:\0A -h\09Display this text\0A -p\09Inject ELF protect code\0A -i\09Inject ELF object to ELF executable\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([277 x i8], [277 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [277 x i8] c"Usage: %s <option(s)> elf-files(s)\0A Inject ELF protect code to ELF executables to protect it from infection, inject ELF object to ELF executable, scan ELF file for changes\0A Options are:\0A -h\09Display this text\0A -p\09Inject ELF protect code\0A -i\09Inject ELF object to ELF executable\0A\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([277 x i8], [277 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int remove_file_c4_(char *, long);
int remove_file_c8_(char *filename, long len_filename) {
  return remove_file_c4_(filename, len_filename);
}


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

x86 assembly (clang, -O2):
<remove_file_c8_>:
jmp    1030 <remove_file_c4_@plt>

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

LLVM IR (-O2):
define i32 @remove_file_c8_(i8* %0, i64 %1) {
%3 = tail call i32 @remove_file_c4_(i8* %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void htmlHeaderExpires(char *title) {
  printf("Content-type: text/html\n\n<HTML><HEAD><TITLE>%s</TITLE>\n<meta "
         "http-equiv=\"Expires\" CONTENT=\"0\"></HEAD>",
         title);
}


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

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

LLVM IR (-O0):
@.str = [102 x i8] c"Content-type: text/html\0A\0A<HTML><HEAD><TITLE>%s</TITLE>\0A<meta http-equiv=\22Expires\22 CONTENT=\220\22></HEAD>\00"
define void @htmlHeaderExpires(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [102 x i8] c"Content-type: text/html\0A\0A<HTML><HEAD><TITLE>%s</TITLE>\0A<meta http-equiv=\22Expires\22 CONTENT=\220\22></HEAD>\00"
define void @htmlHeaderExpires(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef size_t uint32_t;
typedef int int32_t;

/* Variables and functions */
void cast_signed_to_unsigned2_Bad_FN() {
  char arr[10];
  int32_t x = -2;
  uint32_t y = (uint32_t)x;
  if (y > 0) {
    arr[y] = 0;
  }
}


x86 assembly (clang, -O0):
<cast_signed_to_unsigned2_Bad_FN>:
push   %rbp
mov    %rsp,%rbp
movl   $0xfffffffe,-0x10(%rbp)
movslq -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jbe    1127 <cast_signed_to_unsigned2_Bad_FN+0x27>
mov    -0x18(%rbp),%rax
movb   $0x0,-0xa(%rbp,%rax,1)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cast_signed_to_unsigned2_Bad_FN() {
%1 = alloca [10 x i8]
%2 = alloca i32
%3 = alloca i64
store i32 -2, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = icmp ugt i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i64, i64* %3
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %9
store i8 0, i8* %10
br label %11
11: ; preds = %8, %0
ret void
}

LLVM IR (-O2):
define void @cast_signed_to_unsigned2_Bad_FN() {
ret void
}
/* Variables and functions */
char *memchr(char *, int /*<<< orphan*/, int);
char s_find_first_zero_index(char *sudoku) {
  char *first_zero = memchr(sudoku, 0, 81);
  if (!first_zero) {
    return -1;
  }
  return first_zero - sudoku;
}


x86 assembly (clang, -O0):
<s_find_first_zero_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x51,%edx
call   1030 <memchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1144 <s_find_first_zero_index+0x34>
movb   $0xff,-0x1(%rbp)
jmp    1152 <s_find_first_zero_index+0x42>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_find_first_zero_index>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x51,%edx
call   1030 <memchr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %cl,%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @s_find_first_zero_index(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @memchr(i8* %5, i32 0, i32 81)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i8 -1, i8* %2
br label %17
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = load i8*, i8** %3
%13 = ptrtoint i8* %11 to i64
%14 = ptrtoint i8* %12 to i64
%15 = sub i64 %13, %14
%16 = trunc i64 %15 to i8
store i8 %16, i8* %2
br label %17
17: ; preds = %10, %9
%18 = load i8, i8* %2
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @s_find_first_zero_index(i8* %0) {
%2 = tail call i8* @memchr(i8* %0, i32 0, i32 81)
%3 = icmp eq i8* %2, null
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %4, %5
%7 = trunc i64 %6 to i8
%8 = select i1 %3, i8 -1, i8 %7
ret i8 %8
}
/* Type definitions */
struct flat_combining {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct flat_combining *);
int fc_destroy(struct flat_combining *fc) {
  if (fc) {
    free(fc);
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<fc_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113c <fc_destroy+0x2c>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    1143 <fc_destroy+0x33>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc_destroy>:
test   %rdi,%rdi
je     1122 <fc_destroy+0x12>
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.flat_combining = type { i32 }
define i32 @fc_destroy(%struct.flat_combining* %0) {
%2 = alloca i32
%3 = alloca %struct.flat_combining*
store %struct.flat_combining* %0, %struct.flat_combining** %3
%4 = load %struct.flat_combining*, %struct.flat_combining** %3
%5 = icmp ne %struct.flat_combining* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.flat_combining*, %struct.flat_combining** %3
%8 = call i32 @free(%struct.flat_combining* %7)
store i32 0, i32* %2
br label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.flat_combining = type { i32 }
define i32 @fc_destroy(%struct.flat_combining* %0) {
%2 = icmp eq %struct.flat_combining* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.flat_combining* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 0, %3 ], [ -1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main(int argc, char **argv) {
  unsigned int a = 0;
  unsigned int b = 1;
  unsigned int sum = 0;
  unsigned int fib;
  while (1) {
    fib = a;
    if (fib > 4000000) {
      break;
    }
    a = b;
    b = fib + b;
    if (fib % 2 == 0) {
      sum += fib;
    }
  }
  printf("%d\n", sum);
  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   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x3d0900,-0x20(%rbp)
jbe    1153 <main+0x43>
jmp    117f <main+0x6f>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    117a <main+0x6a>
mov    -0x20(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    113b <main+0x2b>
mov    -0x1c(%rbp),%esi
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 1, i32* %7
store i32 0, i32* %8
br label %10
10: ; preds = %2, %27
%11 = load i32, i32* %6
store i32 %11, i32* %9
%12 = load i32, i32* %9
%13 = icmp ugt i32 %12, 4000000
br i1 %13, label %14, label %15
14: ; preds = %10
br label %28
15: ; preds = %10
%16 = load i32, i32* %7
store i32 %16, i32* %6
%17 = load i32, i32* %9
%18 = load i32, i32* %7
%19 = add i32 %17, %18
store i32 %19, i32* %7
%20 = load i32, i32* %9
%21 = urem i32 %20, 2
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %15
%24 = load i32, i32* %9
%25 = load i32, i32* %8
%26 = add i32 %25, %24
store i32 %26, i32* %8
br label %27
27: ; preds = %23, %15
br label %10
28: ; preds = %14
%29 = load i32, i32* %8
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4613732)
ret i32 0
}
int main(void) { extern int f(); }


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

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

LLVM IR (-O0):
define i32 @main() {
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ isColourOk(char *);
int /*<<< orphan*/ setConfigTextValue(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int updateColour(char *value, char *configName) {
  if (isColourOk(value)) {
    char colTxt[7];
    sprintf(colTxt, "#%s", value);
    setConfigTextValue(configName, colTxt);
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<updateColour>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <isColourOk@plt>
cmp    $0x0,%rax
je     1180 <updateColour+0x50>
lea    -0x1f(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe9e(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x1f(%rbp),%rsi
call   1040 <setConfigTextValue@plt>
movl   $0x1,-0x4(%rbp)
jmp    1187 <updateColour+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateColour>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <isColourOk@plt>
test   %rax,%rax
je     1172 <updateColour+0x42>
lea    0xeb0(%rip),%rsi
lea    0x9(%rsp),%r15
mov    %r15,%rdi
mov    %rbx,%rdx
call   1050 <sprintf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <setConfigTextValue@plt>
mov    $0x1,%eax
jmp    1174 <updateColour+0x44>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"#%s\00"
define i32 @updateColour(i8* %0, i8* %1) {
%3 = alloca [7 x i8]
%4 = tail call i64 @isColourOk(i8* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%8 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = call i32 @setConfigTextValue(i8* %1, i8* %7)
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ 1, %6 ], [ 0, %2 ]
ret i32 %11
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool smpte_fec_check_n(const uint8_t *p_fec) { return !!(p_fec[12] & 0x80); }


x86 assembly (clang, -O0):
<smpte_fec_check_n>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpte_fec_check_n>:
mov    0x30(%rdi),%eax
shr    $0x7,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @smpte_fec_check_n(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 12
%3 = load i32, i32* %2
%4 = lshr i32 %3, 7
%5 = and i32 %4, 1
ret i32 %5
}
int matchwhitespace(char c) {
  return ((c == ' ') || (c == '\t') || (c == '\n') || (c == '\r') ||
          (c == '\f') || (c == '\v'));
}


x86 assembly (clang, -O0):
<matchwhitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1171 <matchwhitespace+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     1171 <matchwhitespace+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     1171 <matchwhitespace+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     1171 <matchwhitespace+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xc,%ecx
mov    %al,-0x2(%rbp)
je     1171 <matchwhitespace+0x71>
movsbl -0x1(%rbp),%eax
cmp    $0xb,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<matchwhitespace>:
cmp    $0x20,%dil
ja     1120 <matchwhitespace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100003600,%rdx
bt     %rcx,%rdx
jae    1120 <matchwhitespace+0x20>
ret
xor    %eax,%eax
cmp    $0xb,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @matchwhitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
i8 12, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 11
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ die(char *);
void *xcalloc(size_t n, size_t m) {
  void *p = calloc(n, m);
  if (!p)
    die("out of core");
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
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 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <xcalloc+0x38>
lea    0xead(%rip),%rdi
call   1040 <die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xcalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"out of core\00"
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @die(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [12 x i8] c"out of core\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
unsigned char *__builtin_vis_alignaddr(unsigned char *, int /*<<< orphan*/);
unsigned char *foo5(unsigned char *data) {
  return __builtin_vis_alignaddr(data, 0);
}


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

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

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

LLVM IR (-O2):
define i8* @foo5(i8* %0) {
%2 = tail call i8* @__builtin_vis_alignaddr(i8* %0, i32 0)
ret i8* %2
}
void updateEverything() {
  int (*func)(void) = (int (*)(void))0x080A9129;
  func();
  int (*func2)(void) = (int (*)(void))0x080069C1;
  func2();
  int (*func3)(void) = (int (*)(void))0x08006A0D;
  func3();
  int (*func4)(void) = (int (*)(void))0x080A1A39;
  func4();
}


x86 assembly (clang, -O0):
<updateEverything>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x80a9129,%eax
mov    %rax,-0x8(%rbp)
call   *-0x8(%rbp)
mov    $0x80069c1,%eax
mov    %rax,-0x10(%rbp)
call   *-0x10(%rbp)
mov    $0x8006a0d,%eax
mov    %rax,-0x18(%rbp)
call   *-0x18(%rbp)
mov    $0x80a1a39,%eax
mov    %rax,-0x20(%rbp)
call   *-0x20(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateEverything>:
push   %rax
mov    $0x80a9129,%eax
call   *%rax
mov    $0x80069c1,%eax
call   *%rax
mov    $0x8006a0d,%eax
call   *%rax
mov    $0x80a1a39,%eax
pop    %rcx
jmp    *%rax

LLVM IR (-O0):
define void @updateEverything() {
%1 = alloca i32 ()*
%2 = alloca i32 ()*
%3 = alloca i32 ()*
%4 = alloca i32 ()*
store i32 ()* inttoptr (i64 134910249 to i32 ()*), i32 ()** %1
%5 = load i32 ()*, i32 ()** %1
%6 = call i32 %5()
store i32 ()* inttoptr (i64 134244801 to i32 ()*), i32 ()** %2
%7 = load i32 ()*, i32 ()** %2
%8 = call i32 %7()
store i32 ()* inttoptr (i64 134244877 to i32 ()*), i32 ()** %3
%9 = load i32 ()*, i32 ()** %3
%10 = call i32 %9()
store i32 ()* inttoptr (i64 134879801 to i32 ()*), i32 ()** %4
%11 = load i32 ()*, i32 ()** %4
%12 = call i32 %11()
ret void
}

LLVM IR (-O2):
define void @updateEverything() {
%1 = tail call i32 inttoptr (i64 134910249 to i32 ()*)()
%2 = tail call i32 inttoptr (i64 134244801 to i32 ()*)()
%3 = tail call i32 inttoptr (i64 134244877 to i32 ()*)()
%4 = tail call i32 inttoptr (i64 134879801 to i32 ()*)()
ret void
}
void a_or_l(volatile void *p, long v) {
  __asm__("lock ; or %1, %0" : "=m"(*(long *)p) : "r"(v) : "memory");
}


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

x86 assembly (clang, -O2):
<a_or_l>:
lock or %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @a_or_l(i8* %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
tail call void asm "lock ; or $1, $0", "=*m,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %3, i64 %1)
ret void
}
/* Variables and functions */
int __usb_find_busses();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int usb_find_busses() {
  int ret;
  fprintf(stderr, "USBSNF: usb_find_busses()\n");
  ret = __usb_find_busses();
  fprintf(stderr, "USBSNF:   return       = %d\n", ret);
  return ret;
}


x86 assembly (clang, -O0):
<usb_find_busses>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <__usb_find_busses@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xebf(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_find_busses>:
push   %r14
push   %rbx
push   %rax
mov    0x2eb5(%rip),%r14
mov    (%r14),%edi
lea    0xecb(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <__usb_find_busses@plt>
mov    %eax,%ebx
mov    (%r14),%edi
lea    0xecc(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"USBSNF: usb_find_busses()\0A\00"
@.str.1 = [29 x i8] c"USBSNF: return = %d\0A\00"
define i32 @usb_find_busses() {
%1 = alloca i32
%2 = load i32, i32* @stderr
%3 = call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @__usb_find_busses()
store i32 %4, i32* %1
%5 = load i32, i32* @stderr
%6 = load i32, i32* %1
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"USBSNF: usb_find_busses()\0A\00"
@.str.1 = [29 x i8] c"USBSNF: return = %d\0A\00"
define i32 @usb_find_busses() {
%1 = load i32, i32* @stderr
%2 = tail call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @__usb_find_busses()
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int isLowerOrDigitStr(char *, int);
int /*<<< orphan*/ printf(char *);
void isLowerOrDigitStrTestB() {
  bool result = isLowerOrDigitStr("testString", 5);
  assert(result == false);
  printf("Test successful.");
}


x86 assembly (clang, -O0):
<isLowerOrDigitStrTestB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x5,%esi
call   1050 <isLowerOrDigitStr@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLowerOrDigitStrTestB>:
push   %rax
lea    0xec8(%rip),%rdi
mov    $0x5,%esi
call   1050 <isLowerOrDigitStr@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xeb5(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"testString\00"
@.str.1 = [17 x i8] c"Test successful.\00"
define void @isLowerOrDigitStrTestB() {
%1 = alloca i32
%2 = call i32 @isLowerOrDigitStr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 5)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"testString\00"
@.str.1 = [17 x i8] c"Test successful.\00"
define void @isLowerOrDigitStrTestB() {
%1 = tail call i32 @isLowerOrDigitStr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(size_t);
char *memcpy(char *, char const *, size_t);
char *hts_strndup(const char *src, size_t len) {
  char *r = malloc(len + 1);
  r[len] = 0;
  return memcpy(r, src, len);
}


x86 assembly (clang, -O0):
<hts_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hts_strndup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1040 <malloc@plt>
movb   $0x0,(%rax,%rbx,1)
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define i8* @hts_strndup(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 i64, i64* %4
%7 = add i64 %6, 1
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i64, i64* %4
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8 0, i8* %11
%12 = load i8*, i8** %5
%13 = load i8*, i8** %3
%14 = load i64, i64* %4
%15 = call i8* @memcpy(i8* %12, i8* %13, i64 %14)
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @hts_strndup(i8* nocapture %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = getelementptr inbounds i8, i8* %4, i64 %1
store i8 0, i8* %5
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %4, i8* align 1 %0, i64 %1, i1 false)
ret i8* %4
}
/* Variables and functions */
void *virtual_machine_resource_pool_plain_init(size_t size) {
  (void)size;
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @virtual_machine_resource_pool_plain_init(i64 %0) {
ret i8* null
}
void spu_look_up_symbols(void) {}


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

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

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

LLVM IR (-O2):
define void @spu_look_up_symbols() {
ret void
}
int bmap_would_wrap(unsigned bmap_nr) { return bmap_nr > ((1LL << 16) - 1); }


x86 assembly (clang, -O0):
<bmap_would_wrap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    $0xffff,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmap_would_wrap>:
xor    %eax,%eax
cmp    $0x10000,%edi
setae  %al
ret

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

LLVM IR (-O2):
define i32 @bmap_would_wrap(i32 %0) {
%2 = icmp ugt i32 %0, 65535
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ nullf(char *);
int /*<<< orphan*/ output_byte(int);
int /*<<< orphan*/ output_modrm(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ output_sib(int /*<<< orphan*/, int, int);
void emit_fnstcw_stack() {
  nullf("fnstcw (%%esp)\n");
  output_byte(0xd9);
  output_modrm(0, 4, 7);
  output_sib(0, 4, 4);
}


x86 assembly (clang, -O0):
<emit_fnstcw_stack>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1030 <nullf@plt>
mov    $0xd9,%edi
call   1040 <output_byte@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0x7,%edx
call   1050 <output_modrm@plt>
xor    %edi,%edi
mov    $0x4,%edx
mov    %edx,%esi
call   1060 <output_sib@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fnstcw_stack>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <nullf@plt>
mov    $0xd9,%edi
call   1040 <output_byte@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0x7,%edx
call   1050 <output_modrm@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0x4,%edx
pop    %rax
jmp    1060 <output_sib@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"fnstcw (%%esp)\0A\00"
define void @emit_fnstcw_stack() {
%1 = call i32 @nullf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @output_byte(i32 217)
%3 = call i32 @output_modrm(i32 0, i32 4, i32 7)
%4 = call i32 @output_sib(i32 0, i32 4, i32 4)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"fnstcw (%%esp)\0A\00"
define void @emit_fnstcw_stack() {
%1 = tail call i32 @nullf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @output_byte(i32 217)
%3 = tail call i32 @output_modrm(i32 0, i32 4, i32 7)
%4 = tail call i32 @output_sib(i32 0, i32 4, i32 4)
ret void
}