xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t memhash_hash(const char *buf) {
  unsigned int hash = 5381;
  unsigned char c;
  while ((c = *buf++) != '\0')
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<memhash_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movzbl %al,%eax
cmp    $0x0,%eax
je     1146 <memhash_hash+0x46>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
movzbl -0xd(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <memhash_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memhash_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112a <memhash_hash+0x2a>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
movzbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <memhash_hash+0x10>
mov    %eax,%eax
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @memhash_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%8 = zext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 33
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = zext i32 %11 to i64
br label %16
16: ; preds = %14, %1
%17 = phi i64 [ 5381, %1 ], [ %15, %14 ]
ret i64 %17
}
/* Variables and functions */
int /*<<< orphan*/ pfan_draw_text(char *, int, int, unsigned short *);
void Test_textOneChar(unsigned short display[156]) {
  pfan_draw_text("A", 1, 1, display);
}


x86 assembly (clang, -O0):
<Test_textOneChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xed9(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <pfan_draw_text@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Test_textOneChar>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
jmp    1030 <pfan_draw_text@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"A\00"
define void @Test_textOneChar(i16* %0) {
%2 = tail call i32 @pfan_draw_text(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i16* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int efi_vsnprintf(int /*<<< orphan*/ *, size_t, char const *,
                  int /*<<< orphan*/);
int efi_vsprintf(wchar_t *buf, const char *fmt, va_list args) {
  return efi_vsnprintf(buf, ~((size_t)0), fmt, args);
}


x86 assembly (clang, -O0):
<efi_vsprintf>:
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),%rdx
mov    -0x14(%rbp),%ecx
mov    $0xffffffffffffffff,%rsi
call   1030 <efi_vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<efi_vsprintf>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0xffffffffffffffff,%rsi
jmp    1030 <efi_vsnprintf@plt>

LLVM IR (-O0):
define i32 @efi_vsprintf(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 @efi_vsnprintf(i32* %7, i64 -1, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @efi_vsprintf(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @efi_vsnprintf(i32* %0, i64 -1, i8* %1, i32 %2)
ret i32 %4
}
main() { return sizeof(int[]){2, 3}; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ gui_window_ask_refresh(int);
void gui_main_signal_sigwinch() { gui_window_ask_refresh(2); }


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

x86 assembly (clang, -O2):
<gui_main_signal_sigwinch>:
mov    $0x2,%edi
jmp    1030 <gui_window_ask_refresh@plt>

LLVM IR (-O0):
define void @gui_main_signal_sigwinch() {
%1 = call i32 @gui_window_ask_refresh(i32 2)
ret void
}

LLVM IR (-O2):
define void @gui_main_signal_sigwinch() {
%1 = tail call i32 @gui_window_ask_refresh(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ read_row();
void table_scan() { read_row(); }


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

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

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

LLVM IR (-O2):
define void @table_scan() {
%1 = tail call i32 (...) @read_row()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, char *);
int /*<<< orphan*/ stderr;
FILE *efopen(char *file, char *mode) {
  FILE *fp, *fopen();
  extern char *progname;
  if ((fp = fopen(file, mode)) != NULL)
    return fp;
  fprintf(stderr, "%s: can't open file %s mode %s\n", progname, file, mode);
  exit(1);
}


x86 assembly (clang, -O0):
<efopen>:
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 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1165 <efopen+0x35>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
mov    0x2e63(%rip),%rax
mov    (%rax),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xe79(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<efopen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     114c <efopen+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    0x2e7c(%rip),%rax
mov    (%rax),%rdx
lea    0xe9a(%rip),%rsi
mov    %rbx,%rcx
mov    %r14,%r8
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"%s: can't open file %s mode %s\0A\00"
@progname = external global i8*
define i32* @efopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** %5
ret i32* %11
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i8*, i8** @progname
%15 = load i8*, i8** %3
%16 = load i8*, i8** %4
%17 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15, i8* %16)
%18 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"%s: can't open file %s mode %s\0A\00"
@progname = external global i8*
define noalias i32* @efopen(i8* %0, i8* %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
ret i32* %3
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i8*, i8** @progname
%9 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %0, i8* %1)
%10 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
scalar_t__ fcntl(int, int /*<<< orphan*/);
int is_open(int fd) { return 0 <= fcntl(fd, F_GETFL); }


x86 assembly (clang, -O0):
<is_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
setle  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_open>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
define i32 @is_open(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_GETFL
%5 = call i64 @fcntl(i32 %3, i32 %4)
%6 = icmp sle i64 0, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@F_GETFL = global i32 0
define i32 @is_open(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i64 @fcntl(i32 %0, i32 %2)
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
%6 = xor i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, char *);
int recv(int, char *, int, int /*<<< orphan*/);
int readmsg(int currentsocket, char *msg) {
  int size = 0;
  memset(msg, 0, 3000);
  size = recv(currentsocket, msg, 3000, 0);
  printf("%s\n", msg);
  return size;
}


x86 assembly (clang, -O0):
<readmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0xbb8,%edx
call   1050 <memset@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0xbb8,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readmsg>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
xor    %esi,%esi
mov    $0xbb8,%edx
call   1050 <memset@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0xbb8,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,%ebp
lea    0xe9f(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @readmsg(i32 %0, i8* %1) {
%3 = tail call i32 @memset(i8* %1, i32 0, i32 3000)
%4 = tail call i32 @recv(i32 %0, i8* %1, i32 3000, i32 0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *inc_x(void *x_ptr) {
  int *xptr = (int *)x_ptr;
  while (++(*xptr) < 100)
    ;
  printf("x inc fin\n");
  return NULL;
}


x86 assembly (clang, -O0):
<inc_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%eax
add    $0x1,%eax
mov    %eax,(%rcx)
cmp    $0x64,%eax
jge    113d <inc_x+0x2d>
jmp    1124 <inc_x+0x14>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc_x>:
push   %rax
mov    (%rdi),%eax
cmp    $0x64,%eax
mov    $0x63,%ecx
cmovge %eax,%ecx
add    $0x1,%ecx
mov    %ecx,(%rdi)
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"x inc fin\0A\00"
define i8* @inc_x(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
br label %6
6: ; preds = %11, %1
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %7
%10 = icmp slt i32 %9, 100
br i1 %10, label %11, label %12
11: ; preds = %6
br label %6
12: ; preds = %6
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@str = [10 x i8] c"x inc fin\00"
define noalias i8* @inc_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = call i32 @llvm.smax.i32(i32 %3, i32 99)
%5 = add nuw i32 %4, 1
store i32 %5, i32* %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i8* null
}
void test_loop_simple(int *buf, int size) {
  int i;
  for (i = 0; i < size; ++i)
    buf[i] = 0;
}


x86 assembly (clang, -O0):
<test_loop_simple>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <test_loop_simple+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <test_loop_simple+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_loop_simple>:
test   %esi,%esi
jle    1126 <test_loop_simple+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @test_loop_simple(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
void Menu() {}


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

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

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

LLVM IR (-O2):
define void @Menu() {
ret void
}
int ap_os_is_path_absolute(const char *file) { return file[0] == '/'; }


x86 assembly (clang, -O0):
<ap_os_is_path_absolute>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_os_is_path_absolute>:
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @ap_os_is_path_absolute(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 47
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ap_os_is_path_absolute(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t gcd(uint64_t a, uint64_t b) {
begin:
  if (b == 0)
    return a;
  if (a >= b) {
    a -= b;
    goto begin;
  }
  uint64_t c = b - a;
  b = a;
  a = c;
  goto begin;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111d <gcd+0x1d>
mov    -0x8(%rbp),%rax
pop    %rbp
ret
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jl     113f <gcd+0x3f>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <gcd+0xc>
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    110c <gcd+0xc>

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1136 <gcd+0x36>
nopl   0x0(%rax,%rax,1)
mov    %rax,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
sub    %rsi,%rcx
jge    1120 <gcd+0x20>
mov    %rcx,%rax
neg    %rax
add    %rcx,%rsi
jne    1110 <gcd+0x10>
neg    %rcx
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2, %13
%5 = phi i64 [ %14, %13 ], [ %0, %2 ]
%6 = phi i64 [ %10, %13 ], [ %1, %2 ]
br label %9
7: ; preds = %13, %2
%8 = phi i64 [ %0, %2 ], [ %14, %13 ]
ret i64 %8
9: ; preds = %9, %4
%10 = phi i64 [ %5, %4 ], [ %12, %9 ]
%11 = icmp slt i64 %10, %6
%12 = sub nsw i64 %10, %6
br i1 %11, label %13, label %9
13: ; preds = %9
%14 = sub nsw i64 %6, %10
%15 = icmp eq i64 %10, 0
br i1 %15, label %7, label %4
}
int pathconN_nm7_n_out(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @pathconN_nm7_n_out() {
ret i32 2
}

LLVM IR (-O2):
define i32 @pathconN_nm7_n_out() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ my_free1(int *);
void test5() {
  int *data;
  my_free1((int *)data);
}


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

x86 assembly (clang, -O2):
<test5>:
jmp    1030 <my_free1@plt>

LLVM IR (-O0):
define void @test5() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @my_free1(i32* %2)
ret void
}

LLVM IR (-O2):
define void @test5() {
%1 = tail call i32 @my_free1(i32* undef)
ret void
}
/* Variables and functions */
int hello_add(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a = 3, b = 4;
  printf("%d + %d = %d\n", a, b, hello_add(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <hello_add@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <hello_add@plt>
lea    0xec9(%rip),%rdi
mov    $0x3,%esi
mov    $0x4,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"%d + %d = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @hello_add(i32 3, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 3, i32 4, i32 %1)
ret i32 0
}
/* Variables and functions */
float lerp(float, float, float);
float blerp(float c00, float c10, float c01, float c11, float tx, float ty) {
  return lerp(lerp(c00, c10, tx), lerp(c01, c11, tx), ty);
}


x86 assembly (clang, -O0):
<blerp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   1030 <lerp@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   1030 <lerp@plt>
movaps %xmm0,%xmm1
movss  -0x1c(%rbp),%xmm0
movss  -0x18(%rbp),%xmm2
call   1030 <lerp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blerp>:
sub    $0x18,%rsp
movss  %xmm5,0x14(%rsp)
movss  %xmm4,0x4(%rsp)
movss  %xmm3,0x10(%rsp)
movss  %xmm2,0xc(%rsp)
movaps %xmm4,%xmm2
call   1030 <lerp@plt>
movss  %xmm0,0x8(%rsp)
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movss  0x4(%rsp),%xmm2
call   1030 <lerp@plt>
movaps %xmm0,%xmm1
movss  0x8(%rsp),%xmm0
movss  0x14(%rsp),%xmm2
add    $0x18,%rsp
jmp    1030 <lerp@plt>

LLVM IR (-O0):
define float @blerp(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%13 = load float, float* %7
%14 = load float, float* %8
%15 = load float, float* %11
%16 = call float @lerp(float %13, float %14, float %15)
%17 = load float, float* %9
%18 = load float, float* %10
%19 = load float, float* %11
%20 = call float @lerp(float %17, float %18, float %19)
%21 = load float, float* %12
%22 = call float @lerp(float %16, float %20, float %21)
ret float %22
}

LLVM IR (-O2):
define float @blerp(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = tail call float @lerp(float %0, float %1, float %4)
%8 = tail call float @lerp(float %2, float %3, float %4)
%9 = tail call float @lerp(float %7, float %8, float %5)
ret float %9
}
void caam_pkc_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @caam_pkc_exit() {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ serial;
};
struct TYPE_4__ {
  TYPE_1__ xmotion;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xmotion_serial(void *_p) {
  return (unsigned long)((XEvent *)_p)->xmotion.serial;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xmotion_serial>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xmotion_serial(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xmotion_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int ProcessCommand(char *, char *);
int atoi(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int ReadLampHours(char ret[]) {
  int err;
  if (!(err = ProcessCommand(ret, "CR3\r"))) {
    sprintf(ret, "%i", atoi(ret));
  }
  return (err);
}


x86 assembly (clang, -O0):
<ReadLampHours>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1030 <ProcessCommand@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jne    117b <ReadLampHours+0x4b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
lea    0xe8f(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadLampHours>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xec3(%rip),%rsi
call   1030 <ProcessCommand@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1161 <ReadLampHours+0x31>
mov    %rbx,%rdi
call   1040 <atoi@plt>
lea    0xeae(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1050 <sprintf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"CR3\0D\00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @ReadLampHours(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @ProcessCommand(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %5, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = load i8*, i8** %2
%10 = call i32 @atoi(i8* %9)
%11 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %7, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"CR3\0D\00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @ReadLampHours(i8* %0) {
%2 = tail call i32 @ProcessCommand(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @atoi(i8* %0)
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void direct_abort_example_ok() {
  int *p = NULL;
  abort();
  *p = 42;
}


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

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

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

LLVM IR (-O2):
define void @direct_abort_example_ok() {
%1 = tail call i32 (...) @abort()
unreachable
}
int contieneMat(int *l, int n, int x) {
  for (int i = 0; i < n; i++) {
    if (l[i] == x) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<contieneMat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <contieneMat+0x54>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1141 <contieneMat+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <contieneMat+0x5b>
jmp    1146 <contieneMat+0x46>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <contieneMat+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<contieneMat>:
test   %esi,%esi
jle    113a <contieneMat+0x3a>
mov    $0x1,%eax
cmp    %edx,(%rdi)
je     1139 <contieneMat+0x39>
mov    %esi,%ecx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%rsi
cmp    %rax,%rcx
je     1131 <contieneMat+0x31>
lea    0x1(%rsi),%rax
cmp    %edx,(%rdi,%rsi,4)
jne    1120 <contieneMat+0x20>
xor    %eax,%eax
cmp    %rcx,%rsi
setb   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @contieneMat(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %21
5: ; preds = %3
%6 = zext i32 %1 to i64
%7 = zext i32 %1 to i64
%8 = load i32, i32* %0
%9 = icmp eq i32 %8, %2
br i1 %9, label %21, label %10
10: ; preds = %5, %13
%11 = phi i64 [ %17, %13 ], [ 1, %5 ]
%12 = icmp eq i64 %11, %7
br i1 %12, label %18, label %13
13: ; preds = %10
%14 = getelementptr inbounds i32, i32* %0, i64 %11
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, %2
%17 = add nuw nsw i64 %11, 1
br i1 %16, label %18, label %10
18: ; preds = %10, %13
%19 = icmp ult i64 %11, %6
%20 = zext i1 %19 to i32
br label %21
21: ; preds = %18, %5, %3
%22 = phi i32 [ 0, %3 ], [ 1, %5 ], [ %20, %18 ]
ret i32 %22
}
/* Variables and functions */
int log(double);
double aCoth(double x) { return log((x + 1.) / (x - 1.)) / 2.; }


x86 assembly (clang, -O0):
<aCoth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xed1(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
cvtsi2sd %eax,%xmm0
movsd  0xeb0(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aCoth>:
push   %rax
movsd  0xee7(%rip),%xmm1
addsd  %xmm0,%xmm1
addsd  0xee3(%rip),%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xecf(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @aCoth(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 1.000000e+00
%5 = load double, double* %2
%6 = fsub double %5, 1.000000e+00
%7 = fdiv double %4, %6
%8 = call i32 @log(double %7)
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 2.000000e+00
ret double %10
}

LLVM IR (-O2):
define double @aCoth(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fadd double %0, -1.000000e+00
%4 = fdiv double %2, %3
%5 = tail call i32 @log(double %4)
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 5.000000e-01
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ copyWordEndianString(unsigned char *, unsigned char *, int);
int /*<<< orphan*/ stringTrimSpace(char *);
void readSerialNumber(char *name, unsigned short *data) {
  copyWordEndianString((unsigned char *)name, (unsigned char *)&data[10], 10);
  stringTrimSpace(name);
}


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

x86 assembly (clang, -O2):
<readSerialNumber>:
push   %rbx
mov    %rdi,%rbx
add    $0x14,%rsi
mov    $0xa,%edx
call   1030 <copyWordEndianString@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <stringTrimSpace@plt>

LLVM IR (-O0):
define void @readSerialNumber(i8* %0, i16* %1) {
%3 = alloca i8*
%4 = alloca i16*
store i8* %0, i8** %3
store i16* %1, i16** %4
%5 = load i8*, i8** %3
%6 = load i16*, i16** %4
%7 = getelementptr inbounds i16, i16* %6, i64 10
%8 = bitcast i16* %7 to i8*
%9 = call i32 @copyWordEndianString(i8* %5, i8* %8, i32 10)
%10 = load i8*, i8** %3
%11 = call i32 @stringTrimSpace(i8* %10)
ret void
}

LLVM IR (-O2):
define void @readSerialNumber(i8* %0, i16* %1) {
%3 = getelementptr inbounds i16, i16* %1, i64 10
%4 = bitcast i16* %3 to i8*
%5 = tail call i32 @copyWordEndianString(i8* %0, i8* %4, i32 10)
%6 = tail call i32 @stringTrimSpace(i8* %0)
ret void
}
void login(void) {}


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

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

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

LLVM IR (-O2):
define void @login() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, size_t);
void *xmalloc(size_t s) {
  void *value = malloc(s);
  if (value != NULL)
    return value;
  syslog(LOG_ERR, "memory exhausted (xalloc %zu bytes)", s);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115e <xmalloc+0x2e>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe8e(%rip),%rsi
call   1040 <syslog@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1030 <malloc@plt>
test   %rax,%rax
je     1140 <xmalloc+0x10>
pop    %rbx
ret
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1040 <syslog@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [36 x i8] c"memory exhausted (xalloc %zu bytes)\00"
@EXIT_FAILURE = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
ret i8* %9
10: ; preds = %1
%11 = load i32, i32* @LOG_ERR
%12 = load i64, i64* %2
%13 = call i32 @syslog(i32 %11, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %12)
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [36 x i8] c"memory exhausted (xalloc %zu bytes)\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
ret i8* %2
5: ; preds = %1
%6 = load i32, i32* @LOG_ERR
%7 = tail call i32 @syslog(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %0)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ absolute();
int /*<<< orphan*/ ror8addr(int /*<<< orphan*/);
void rorAbs8(void) { ror8addr(absolute()); }


x86 assembly (clang, -O0):
<rorAbs8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <absolute@plt>
mov    %eax,%edi
call   1040 <ror8addr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rorAbs8>:
push   %rax
xor    %eax,%eax
call   1030 <absolute@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <ror8addr@plt>

LLVM IR (-O0):
define void @rorAbs8() {
%1 = call i32 (...) @absolute()
%2 = call i32 @ror8addr(i32 %1)
ret void
}

LLVM IR (-O2):
define void @rorAbs8() {
%1 = tail call i32 (...) @absolute()
%2 = tail call i32 @ror8addr(i32 %1)
ret void
}
unsigned int BSP_CPU_GetTotalUtilize(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @BSP_CPU_GetTotalUtilize() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ log_error(char *);
int mgmt_peeruser(int sock, char *user) {
  log_error("'mgmg_ipc' auth is not supported on local connections "
            "on this platform");
  return 0;
}


x86 assembly (clang, -O0):
<mgmt_peeruser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <log_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mgmt_peeruser>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <log_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [71 x i8] c"'mgmg_ipc' auth is not supported on local connections on this platform\00"
define i32 @mgmt_peeruser(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 @log_error(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [71 x i8] c"'mgmg_ipc' auth is not supported on local connections on this platform\00"
define i32 @mgmt_peeruser(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @log_error(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *dfile_get_ident(int);
char *g_get_object_file_ident(int file_id) { return dfile_get_ident(file_id); }


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

x86 assembly (clang, -O2):
<g_get_object_file_ident>:
jmp    1030 <dfile_get_ident@plt>

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

LLVM IR (-O2):
define i8* @g_get_object_file_ident(i32 %0) {
%2 = tail call i8* @dfile_get_ident(i32 %0)
ret i8* %2
}
int linearsearch(int find, int list[]) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @linearsearch(i32 %0, i32* nocapture readnone %1) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ time;

/* Variables and functions */
int /*<<< orphan*/ klee_make_symbolic(int /*<<< orphan*/ *, int, char *);
uint64_t read_time(void) {
  uint64_t time;
  klee_make_symbolic(&time, sizeof(time), "time");
  return time;
}


x86 assembly (clang, -O0):
<read_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
lea    0xed8(%rip),%rdx
call   1030 <klee_make_symbolic@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_time>:
push   %rax
lea    0xee8(%rip),%rdx
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <klee_make_symbolic@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"time\00"
define i32 @read_time() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @klee_make_symbolic(i32* %1, i32 4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hidden_display(void) {
  printf("hidden_display: this should not be called ever\n");
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"hidden_display: this should not be called ever\0A\00"
define void @hidden_display() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [47 x i8] c"hidden_display: this should not be called ever\00"
define void @hidden_display() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int f1();
int f3(void) { return f1(); }


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

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

LLVM IR (-O0):
define i32 @f3() {
%1 = call i32 (...) @f1()
ret i32 %1
}

LLVM IR (-O2):
define i32 @f3() {
%1 = tail call i32 (...) @f1()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
scalar_t__ pthread_mutex_destroy(int /*<<< orphan*/ *);
scalar_t__ pthread_mutex_init(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int test_status_destroyed(pthread_mutex_t *mutex) {
  int result = 1;
  if (pthread_mutex_init(mutex, NULL) == 0 && pthread_mutex_destroy(mutex) == 0)
    result = 0;
  return result;
}


x86 assembly (clang, -O0):
<test_status_destroyed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_mutex_init@plt>
cmp    $0x0,%rax
jne    1164 <test_status_destroyed+0x44>
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_destroy@plt>
cmp    $0x0,%rax
jne    1164 <test_status_destroyed+0x44>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_status_destroyed>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <pthread_mutex_init@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     113a <test_status_destroyed+0x1a>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <pthread_mutex_destroy@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_status_destroyed(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 1, i32* %3
%4 = load i32*, i32** %2
%5 = call i64 @pthread_mutex_init(i32* %4, i32* null)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = call i64 @pthread_mutex_destroy(i32* %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 0, i32* %3
br label %12
12: ; preds = %11, %7, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @test_status_destroyed(i32* %0) {
%2 = tail call i64 @pthread_mutex_init(i32* %0, i32* null)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @pthread_mutex_destroy(i32* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: mkbinimg <bootstrap> <kernel> <ramdisk> -o <binary>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"Usage: mkbinimg <bootstrap> <kernel> <ramdisk> -o <binary>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [59 x i8] c"Usage: mkbinimg <bootstrap> <kernel> <ramdisk> -o <binary>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ GLenum;
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ glTexGend(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
void TexGend(GLenum coord, GLenum pname, GLdouble param) {
  glTexGend(coord, pname, param);
}


x86 assembly (clang, -O0):
<TexGend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <glTexGend@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TexGend>:
jmp    1030 <glTexGend@plt>

LLVM IR (-O0):
define void @TexGend(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @glTexGend(i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @TexGend(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @glTexGend(i32 %0, i32 %1, i32 %2)
ret void
}