xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ error(int, char *);
char *strdup(char const *);
char *safe_strdup(const char *str) {
  char *s = strdup(str);
  if (!s)
    error(2, "Failed to allocated memory");
  return s;
}


x86 assembly (clang, -O0):
<safe_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <safe_strdup+0x35>
mov    $0x2,%edi
lea    0xeb0(%rip),%rsi
call   1030 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_strdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <safe_strdup+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x2,%edi
call   1030 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Failed to allocated memory\00"
define i8* @safe_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @error(i32 2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [27 x i8] c"Failed to allocated memory\00"
define noalias i8* @safe_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error(i32 2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage: nudist_platypus_gold [option]\n");
  printf("\t--help\tPrint this message.\n");
  printf("\t-c\tColors, colors everywhere!\n");
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"Usage: nudist_platypus_gold [option]\0A\00"
@.str.1 = [29 x i8] c"\09--help\09Print this message.\0A\00"
@.str.2 = [32 x i8] c"\09-c\09Colors, colors everywhere!\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"Usage: nudist_platypus_gold [option]\00"
@str.3 = [28 x i8] c"\09--help\09Print this message.\00"
@str.4 = [31 x i8] c"\09-c\09Colors, colors everywhere!\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void pass_close(FILE *fp) { fclose(fp); }


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

x86 assembly (clang, -O2):
<pass_close>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @pass_close(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_getdirentry_buf();
int /*<<< orphan*/ test_getdirentry_fd();
void test_getdirentry(void) {
  test_getdirentry_fd();
  test_getdirentry_buf();
}


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

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

LLVM IR (-O0):
define void @test_getdirentry() {
%1 = call i32 (...) @test_getdirentry_fd()
%2 = call i32 (...) @test_getdirentry_buf()
ret void
}

LLVM IR (-O2):
define void @test_getdirentry() {
%1 = tail call i32 (...) @test_getdirentry_fd()
%2 = tail call i32 (...) @test_getdirentry_buf()
ret void
}
void gtk_tree_view_set_column_drag_function() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_set_column_drag_function() {
ret void
}
/* Variables and functions */
scalar_t__ chdir(char const *);
short directory_exists(const char *path) {
  if (chdir(path) == 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<directory_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <chdir@plt>
cmp    $0x0,%rax
jne    113a <directory_exists+0x2a>
movw   $0x1,-0x2(%rbp)
jmp    1140 <directory_exists+0x30>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<directory_exists>:
push   %rax
call   1030 <chdir@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @directory_exists(i8* %0) {
%2 = alloca i16
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @chdir(i8* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i16 1, i16* %2
br label %9
8: ; preds = %1
store i16 0, i16* %2
br label %9
9: ; preds = %8, %7
%10 = load i16, i16* %2
ret i16 %10
}

LLVM IR (-O2):
define signext i16 @directory_exists(i8* %0) {
%2 = tail call i64 @chdir(i8* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i16
ret i16 %4
}
void byte_draw(char *param) {
  int startpos, endpos;
  int ch, cn;
}


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

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

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

LLVM IR (-O2):
define void @byte_draw(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR90_set(void) { return U_WMRCORENONE_set("U_WMR90"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR90\00"
define i8* @U_WMR90_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR90\00"
define i8* @U_WMR90_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ arm_set_reg(int, int);
void init_execution(void) { arm_set_reg(16, 0x0); }


x86 assembly (clang, -O0):
<init_execution>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%edi
xor    %esi,%esi
call   1030 <arm_set_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_execution>:
mov    $0x10,%edi
xor    %esi,%esi
jmp    1030 <arm_set_reg@plt>

LLVM IR (-O0):
define void @init_execution() {
%1 = call i32 @arm_set_reg(i32 16, i32 0)
ret void
}

LLVM IR (-O2):
define void @init_execution() {
%1 = tail call i32 @arm_set_reg(i32 16, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ seatest_simple_test_result(int, char *, char const *,
                                              unsigned int);
void seatest_assert_true(int test, const char *function, unsigned int line) {
  seatest_simple_test_result(test, "Should of been true", function, line);
}


x86 assembly (clang, -O0):
<seatest_assert_true>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xecd(%rip),%rsi
call   1030 <seatest_simple_test_result@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seatest_assert_true>:
mov    %edx,%ecx
mov    %rsi,%rdx
lea    0xee4(%rip),%rsi
jmp    1030 <seatest_simple_test_result@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Should of been true\00"
define void @seatest_assert_true(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @seatest_simple_test_result(i32 %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Should of been true\00"
define void @seatest_assert_true(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @seatest_simple_test_result(i32 %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void banner(const char *str) {
  printf("---------------------------------------------------------------------"
         "-------\n");
  printf("%s\n", str);
  printf("---------------------------------------------------------------------"
         "-------\n");
}


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

x86 assembly (clang, -O2):
<banner>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str.2 = [77 x i8] c"----------------------------------------------------------------------------\00"
define void @banner(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __ROR(uint32_t op1, uint32_t op2) {
  op2 %= 32U;
  if (op2 == 0U) {
    return op1;
  }
  return (op1 >> op2) | (op1 << (32U - op2));
}


x86 assembly (clang, -O0):
<__ROR>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1128 <__ROR+0x28>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <__ROR+0x44>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    %cl,%eax
mov    -0x8(%rbp),%edx
mov    $0x20,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ROR>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @__ROR(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = urem i32 %6, 32
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* %4
store i32 %11, i32* %3
br label %21
12: ; preds = %2
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = lshr i32 %13, %14
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = sub i32 32, %17
%19 = shl i32 %16, %18
%20 = or i32 %15, %19
store i32 %20, i32* %3
br label %21
21: ; preds = %12, %10
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @__ROR(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshr.i32(i32 %0, i32 %0, i32 %1)
ret i32 %3
}
void SysCtlPVDLevelConfig(unsigned long ulConfig) {
  (*((volatile unsigned long *)(0x40007000))) &= ~(0x00000010 | 0x000000E0);
  (*((volatile unsigned long *)(0x40007000))) |= ulConfig;
}


x86 assembly (clang, -O0):
<SysCtlPVDLevelConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x40007000,%eax
mov    (%rax),%rcx
and    $0xffffffffffffff0f,%rcx
mov    $0x40007000,%eax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    $0x40007000,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x40007000,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlPVDLevelConfig>:
andq   $0xffffffffffffff0f,0x40007000
40 0f ff ff ff
or     %rdi,0x40007000
40
ret

LLVM IR (-O0):
define void @SysCtlPVDLevelConfig(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1073770496 to i64*)
%4 = and i64 %3, -241
store volatile i64 %4, i64* inttoptr (i64 1073770496 to i64*)
%5 = load i64, i64* %2
%6 = load volatile i64, i64* inttoptr (i64 1073770496 to i64*)
%7 = or i64 %6, %5
store volatile i64 %7, i64* inttoptr (i64 1073770496 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlPVDLevelConfig(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1073770496 to i64*)
%3 = and i64 %2, -241
store volatile i64 %3, i64* inttoptr (i64 1073770496 to i64*)
%4 = load volatile i64, i64* inttoptr (i64 1073770496 to i64*)
%5 = or i64 %4, %0
store volatile i64 %5, i64* inttoptr (i64 1073770496 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float c;
  scanf("%f", &c);
  printf("%f\n", c * 9 / 5 + 32);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xec1(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xeb0(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xea0(%rip),%xmm1
addss  %xmm1,%xmm0
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
mulss  0xec0(%rip),%xmm0
divss  0xebc(%rip),%xmm0
addss  0xeb8(%rip),%xmm0
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%4 = load float, float* %2
%5 = fmul float %4, 9.000000e+00
%6 = fdiv float %5, 5.000000e+00
%7 = fadd float %6, 3.200000e+01
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = fmul float %4, 9.000000e+00
%6 = fdiv float %5, 5.000000e+00
%7 = fadd float %6, 3.200000e+01
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %7)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int powercap_sysfs_zone_exists(char *, int /*<<< orphan*/ *, int);
int rapl_sysfs_sz_exists(uint32_t zone, uint32_t sz) {
  uint32_t zones[2];
  zones[0] = zone;
  zones[1] = sz;
  ;
  return powercap_sysfs_zone_exists("intel-rapl", zones, 2);
}


x86 assembly (clang, -O0):
<rapl_sysfs_sz_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rsi
lea    0xecb(%rip),%rdi
mov    $0x2,%edx
call   1030 <powercap_sysfs_zone_exists@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rapl_sysfs_sz_exists>:
push   %rax
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
lea    0xee1(%rip),%rdi
mov    %rsp,%rsi
mov    $0x2,%edx
call   1030 <powercap_sysfs_zone_exists@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"intel-rapl\00"
define i32 @rapl_sysfs_sz_exists(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %6, i32* %7
%8 = load i32, i32* %4
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %8, i32* %9
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%11 = call i32 @powercap_sysfs_zone_exists(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %10, i32 2)
ret i32 %11
}

LLVM IR (-O2):
@.str = [11 x i8] c"intel-rapl\00"
define i32 @rapl_sysfs_sz_exists(i32 %0, i32 %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 %0, i32* %5
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %1, i32* %6
%7 = call i32 @powercap_sysfs_zone_exists(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %5, i32 2)
ret i32 %7
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ putchar(char);
int main() {
  while (1) {
    int c = getchar();
    switch (c) {
    case -1:
      return 0;
    case '(':
      putchar('p');
      break;
    case '-':
    case '0':
      putchar('n');
      break;
    default:
      putchar('o');
      break;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xffffffff,%eax
je     1180 <main+0x60>
jmp    114d <main+0x2d>
mov    -0xc(%rbp),%eax
sub    $0x28,%eax
je     1188 <main+0x68>
jmp    115e <main+0x3e>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     1197 <main+0x77>
jmp    116f <main+0x4f>
mov    -0xc(%rbp),%eax
sub    $0x30,%eax
je     1197 <main+0x77>
jmp    11a6 <main+0x86>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret
mov    $0x70,%edi
call   1030 <putchar@plt>
jmp    11b0 <main+0x90>
mov    $0x6e,%edi
call   1030 <putchar@plt>
jmp    11b0 <main+0x90>
mov    $0x6f,%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
jmp    113a <main+0x1a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x6e,%cl
movzbl %cl,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x2c,%eax
jle    1160 <main+0x40>
cmp    $0x30,%eax
je     1130 <main+0x10>
cmp    $0x2d,%eax
je     1130 <main+0x10>
jmp    116c <main+0x4c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x70,%cl
cmp    $0x28,%eax
je     1132 <main+0x12>
cmp    $0xffffffff,%eax
je     1170 <main+0x50>
mov    $0x6f,%cl
jmp    1132 <main+0x12>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %13
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* %2
switch i32 %5, label %11 [
i32 -1, label %6
i32 40, label %7
i32 45, label %9
i32 48, label %9
]
6: ; preds = %3
ret i32 0
7: ; preds = %3
%8 = call i32 @putchar(i8 signext 112)
br label %13
9: ; preds = %3, %3
%10 = call i32 @putchar(i8 signext 110)
br label %13
11: ; preds = %3
%12 = call i32 @putchar(i8 signext 111)
br label %13
13: ; preds = %11, %9, %7
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %5, %0
%2 = tail call i32 (...) @getchar()
switch i32 %2, label %4 [
i32 -1, label %8
i32 40, label %5
i32 45, label %3
i32 48, label %3
]
3: ; preds = %1, %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %3, %4
%6 = phi i8 [ 110, %3 ], [ 111, %4 ], [ 112, %1 ]
%7 = tail call i32 @putchar(i8 signext %6)
br label %1
8: ; preds = %1
ret i32 0
}
/* Variables and functions */
__attribute__((visibility("default"))) void *sd_resolve_unref(void *resolve) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sd_resolve_unref(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ QSort(int *, int /*<<< orphan*/, int);
void quickSort(int A[], int N) { QSort(A, 0, N - 1); }


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

x86 assembly (clang, -O2):
<quickSort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <QSort@plt>

LLVM IR (-O0):
define void @quickSort(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 = sub nsw i32 %6, 1
%8 = call i32 @QSort(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @QSort(i32* %0, i32 0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int tribonacci_num(int);
void tribonacci_num_test(void) {
  assert(tribonacci_num(0) == 1);
  assert(tribonacci_num(1) == 2);
  assert(tribonacci_num(5) == 24);
  assert(tribonacci_num(10) == 504);
}


x86 assembly (clang, -O0):
<tribonacci_num_test>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <tribonacci_num@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1040 <tribonacci_num@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x5,%edi
call   1040 <tribonacci_num@plt>
cmp    $0x18,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0xa,%edi
call   1040 <tribonacci_num@plt>
cmp    $0x1f8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tribonacci_num_test>:
push   %rax
xor    %edi,%edi
call   1040 <tribonacci_num@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x1,%edi
call   1040 <tribonacci_num@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x5,%edi
call   1040 <tribonacci_num@plt>
xor    %edi,%edi
cmp    $0x18,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0xa,%edi
call   1040 <tribonacci_num@plt>
xor    %edi,%edi
cmp    $0x1f8,%eax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @tribonacci_num_test() {
%1 = call i32 @tribonacci_num(i32 0)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i32 @tribonacci_num(i32 1)
%6 = icmp eq i32 %5, 2
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @tribonacci_num(i32 5)
%10 = icmp eq i32 %9, 24
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i32 @tribonacci_num(i32 10)
%14 = icmp eq i32 %13, 504
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret void
}

LLVM IR (-O2):
define void @tribonacci_num_test() {
%1 = tail call i32 @tribonacci_num(i32 0)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @tribonacci_num(i32 1)
%6 = icmp eq i32 %5, 2
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @tribonacci_num(i32 5)
%10 = icmp eq i32 %9, 24
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @tribonacci_num(i32 10)
%14 = icmp eq i32 %13, 504
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void fatal() {
  fprintf(stderr, "Malformed TTF file.\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Malformed TTF file.\0A\00"
define void @fatal() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Malformed TTF file.\0A\00"
define void @fatal() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ foo();
int main(int argc, const char *argv[]) {
  foo();
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @foo()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void abort() { kill(getpid(), SIGABRT); }


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1040 <kill@plt>

LLVM IR (-O0):
@SIGABRT = global i32 0
define void @abort() {
%1 = call i32 (...) @getpid()
%2 = load i32, i32* @SIGABRT
%3 = call i32 @kill(i32 %1, i32 %2)
unreachable
}

LLVM IR (-O2):
@SIGABRT = global i32 0
define void @abort() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @SIGABRT
%3 = tail call i32 @kill(i32 %1, i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(void) {
  abort();
  printf("xyzzy\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @abort()
unreachable
}
extern int wrapped(int n) {
  if (n == 42)
    return 8;
  return 0;
}


x86 assembly (clang, -O0):
<wrapped>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2a,-0x8(%rbp)
jne    111d <wrapped+0x1d>
movl   $0x8,-0x4(%rbp)
jmp    1124 <wrapped+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrapped>:
xor    %eax,%eax
cmp    $0x2a,%edi
sete   %al
shl    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @wrapped(i32 %0) {
%2 = icmp eq i32 %0, 42
%3 = select i1 %2, i32 8, i32 0
ret i32 %3
}
int test(int x, int *y) { return x + *y; }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
add    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test(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 = load i32, i32* %6
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
size_t hash_str(void *p) {
  size_t hash = 0;
  char *s = (char *)p;
  while (*s) {
    hash += *s * 7 + 13;
    s++;
  }
  hash %= 1021;
  return hash;
}


x86 assembly (clang, -O0):
<hash_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <hash_str+0x4d>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
imul   $0x7,%eax,%eax
add    $0xd,%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <hash_str+0x18>
mov    -0x10(%rbp),%rax
mov    $0x3fd,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_str>:
mov    (%rdi),%al
test   %al,%al
je     115f <hash_str+0x5f>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
movsbq %al,%rax
lea    0x0(,%rax,8),%rdx
sub    %rax,%rdx
add    %rdx,%rcx
add    $0xd,%rcx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash_str+0x10>
movabs $0xc0906c513cedb3,%rdx
mov    %rcx,%rax
mul    %rdx
mov    %rcx,%rax
sub    %rdx,%rax
shr    %rax
add    %rdx,%rax
shr    $0x9,%rax
imul   $0x3fd,%rax,%rax
sub    %rax,%rcx
mov    %rcx,%rax
ret
xor    %ecx,%ecx
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @hash_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i8* [ %12, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i64
%9 = mul nsw i64 %8, 7
%10 = add i64 %7, 13
%11 = add i64 %10, %9
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4
%16 = urem i64 %11, 1021
br label %17
17: ; preds = %15, %1
%18 = phi i64 [ 0, %1 ], [ %16, %15 ]
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fun2(void) { printf("i am in fun 2\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"i am in fun 2\0A\00"
define void @fun2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"i am in fun 2\00"
define void @fun2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
int raise(int signum) {
  signum += 0;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @raise(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gameLoop();
int /*<<< orphan*/ initRand();
int /*<<< orphan*/ logStart();
int /*<<< orphan*/ printMessageC(char *, char *);
int main() {
  logStart();
  initRand();
  printMessageC("Welcome to NuCTex 0.1d!", "\x1b[33m");
  gameLoop();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <logStart@plt>
mov    $0x0,%al
call   1040 <initRand@plt>
lea    0xe9c(%rip),%rdi
lea    0xead(%rip),%rsi
call   1060 <printMessageC@plt>
mov    $0x0,%al
call   1030 <gameLoop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <logStart@plt>
xor    %eax,%eax
call   1040 <initRand@plt>
lea    0xeaa(%rip),%rdi
lea    0xebb(%rip),%rsi
call   1060 <printMessageC@plt>
xor    %eax,%eax
call   1030 <gameLoop@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Welcome to NuCTex 0.1d!\00"
@.str.1 = [6 x i8] c"\1B[33m\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @logStart()
%3 = call i32 (...) @initRand()
%4 = call i32 @printMessageC(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @gameLoop()
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Welcome to NuCTex 0.1d!\00"
@.str.1 = [6 x i8] c"\1B[33m\00"
define i32 @main() {
%1 = tail call i32 (...) @logStart()
%2 = tail call i32 (...) @initRand()
%3 = tail call i32 @printMessageC(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @gameLoop()
ret i32 0
}
/* Variables and functions */
void fill_char_array(unsigned char *const p_char_array,
                     unsigned char const i_fill_value,
                     size_t i_char_array_len) {
  size_t i_array_iterator;
  for (i_array_iterator = 0u; (i_array_iterator < i_char_array_len);
       i_array_iterator++) {
    p_char_array[i_array_iterator] = i_fill_value;
  }
}


x86 assembly (clang, -O0):
<fill_char_array>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1147 <fill_char_array+0x47>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111a <fill_char_array+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_char_array>:
test   %rdx,%rdx
je     1123 <fill_char_array+0x13>
push   %rax
movzbl %sil,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @fill_char_array(i8* nocapture writeonly %0, i8 zeroext %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %6, label %5
5: ; preds = %3
br label %6
6: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __NR_close;
int syscall(int /*<<< orphan*/, int);
int op_close(int fd) { return syscall(__NR_close, fd); }


x86 assembly (clang, -O0):
<op_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_close>:
mov    %edi,%esi
mov    0x2ecf(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_close = global i32 0
define i32 @op_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @__NR_close
%4 = load i32, i32* %2
%5 = call i32 @syscall(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@__NR_close = global i32 0
define i32 @op_close(i32 %0) {
%2 = load i32, i32* @__NR_close
%3 = tail call i32 @syscall(i32 %2, i32 %0)
ret i32 %3
}
/* Variables and functions */
double timer_stop(double);
double timer_get_frequency(double timestamp) {
  return 1.0 / timer_stop(timestamp);
}


x86 assembly (clang, -O0):
<timer_get_frequency>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <timer_stop@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_get_frequency>:
push   %rax
call   1030 <timer_stop@plt>
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @timer_get_frequency(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @timer_stop(double %3)
%5 = fdiv double 1.000000e+00, %4
ret double %5
}

LLVM IR (-O2):
define double @timer_get_frequency(double %0) {
%2 = tail call double @timer_stop(double %0)
%3 = fdiv double 1.000000e+00, %2
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_t;
typedef int /*<<< orphan*/ mpfr_prec_t;

/* Variables and functions */
int /*<<< orphan*/ arr_alloc(size_t const, int /*<<< orphan*/ ***);
int /*<<< orphan*/ arr_fill(size_t const, int /*<<< orphan*/ *,
                            int /*<<< orphan*/);
void _createArray(const size_t n, mpfr_t (**a)[n], mpfr_prec_t precision) {
  arr_alloc(n, a);
  arr_fill(n, **a, precision);
}


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

x86 assembly (clang, -O2):
<_createArray>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1040 <arr_alloc@plt>
mov    (%rbx),%rsi
mov    %rbp,%rdi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <arr_fill@plt>

LLVM IR (-O0):
define void @_createArray(i64 %0, i32** %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32**
%6 = alloca i32
store i64 %0, i64* %4
store i32** %1, i32*** %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %4
%9 = load i32**, i32*** %5
%10 = bitcast i32** %9 to i32***
%11 = call i32 @arr_alloc(i64 %8, i32*** %10)
%12 = load i64, i64* %4
%13 = load i32**, i32*** %5
%14 = load i32*, i32** %13
%15 = load i32, i32* %6
%16 = call i32 @arr_fill(i64 %12, i32* %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @_createArray(i64 %0, i32** %1, i32 %2) {
%4 = bitcast i32** %1 to i32***
%5 = tail call i32 @arr_alloc(i64 %0, i32*** %4)
%6 = load i32*, i32** %1
%7 = tail call i32 @arr_fill(i64 %0, i32* %6, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCDIF_DriverIRQHandler();
__attribute__((weak)) void LCDIF_IRQHandler(void) { LCDIF_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @LCDIF_IRQHandler() {
%1 = call i32 (...) @LCDIF_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @LCDIF_IRQHandler() {
%1 = tail call i32 (...) @LCDIF_DriverIRQHandler()
ret void
}
/* Variables and functions */
char *chop(char *);
int /*<<< orphan*/ printf(char *, char *);
void putline(char *str) {
  char *line = chop(str);
  printf("%s", line);
}


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

x86 assembly (clang, -O2):
<putline>:
push   %rax
call   1040 <chop@plt>
lea    0xed3(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @putline(i8* %0) {
%2 = tail call i8* @chop(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
double sqrt(double);
double radius(double xi) { return sqrt(xi * (2 - xi)); }


x86 assembly (clang, -O0):
<radius>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radius>:
movapd %xmm0,%xmm1
movsd  0xee4(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1133 <radius+0x23>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @radius(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fsub double 2.000000e+00, %4
%6 = fmul double %3, %5
%7 = call double @sqrt(double %6)
ret double %7
}

LLVM IR (-O2):
define double @radius(double %0) {
%2 = fsub double 2.000000e+00, %0
%3 = fmul double %2, %0
%4 = tail call double @sqrt(double %3)
ret double %4
}
int pebbles_left(int state) {
  state = state - ((state >> 1) & 0x55555555);
  state = (state & 0x33333333) + ((state >> 2) & 0x33333333);
  return (((state + (state >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;
}


x86 assembly (clang, -O0):
<pebbles_left>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0x55555555,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
sar    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pebbles_left>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @pebbles_left(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 1
%6 = and i32 %5, 1431655765
%7 = sub nsw i32 %3, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = and i32 %8, 858993459
%10 = load i32, i32* %2
%11 = ashr i32 %10, 2
%12 = and i32 %11, 858993459
%13 = add nsw i32 %9, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 4
%17 = add nsw i32 %14, %16
%18 = and i32 %17, 252645135
%19 = mul nsw i32 %18, 16843009
%20 = ashr i32 %19, 24
ret i32 %20
}

LLVM IR (-O2):
define i32 @pebbles_left(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub nsw i32 %0, %3
%5 = and i32 %4, 858993459
%6 = lshr i32 %4, 2
%7 = and i32 %6, 858993459
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = mul nsw i32 %11, 16843009
%13 = lshr i32 %12, 24
ret i32 %13
}