xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: bin2c [-csvzCH] <input_file> <output_file>\n"
                  "  <input_file> is the binary file to convert\n"
                  "  <output_file> should not have a .c or .h extension\n"
                  "\n"
                  "  -c - do NOT use const in declaration\n"
                  "  -s - do use static in declaration\n"
                  "  -v - verbose\n"
                  "  -z - add zero terminator\n"
                  "  -H - create c-header only\n"
                  "  -C - create c-source file only\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [328 x i8] c"usage: bin2c [-csvzCH] <input_file> <output_file>\0A <input_file> is the binary file to convert\0A <output_file> should not have a .c or .h extension\0A\0A -c - do NOT use const in declaration\0A -s - do use static in declaration\0A -v - verbose\0A -z - add zero terminator\0A -H - create c-header only\0A -C - create c-source file only\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([328 x i8], [328 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [328 x i8] c"usage: bin2c [-csvzCH] <input_file> <output_file>\0A <input_file> is the binary file to convert\0A <output_file> should not have a .c or .h extension\0A\0A -c - do NOT use const in declaration\0A -s - do use static in declaration\0A -v - verbose\0A -z - add zero terminator\0A -H - create c-header only\0A -C - create c-source file only\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([328 x i8], [328 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *prg) {
  printf("USAGE: %s [-v] [-i <niter>] [-k <file>] [-p <proj>] -s <size>\n"
         "\n"
         "  -i <niter>  number of iterations, default=5\n"
         "  -k <file>   file name used to generate shm key, default=this "
         "executable\n"
         "  -p <proj>   project number used to generate shm key, default=0\n"
         "  -s <size>   shared memory size in bytes\n"
         "              (specify K, M, G for kilo, mega, giga bytes)\n"
         "\n"
         "  -v          verbose, display more diagnostic messages\n"
         "\n",
         prg);
}


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

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

LLVM IR (-O0):
@.str = [408 x i8] c"USAGE: %s [-v] [-i <niter>] [-k <file>] [-p <proj>] -s <size>\0A\0A -i <niter> number of iterations, default=5\0A -k <file> file name used to generate shm key, default=this executable\0A -p <proj> project number used to generate shm key, default=0\0A -s <size> shared memory size in bytes\0A (specify K, M, G for kilo, mega, giga bytes)\0A\0A -v verbose, display more diagnostic messages\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([408 x i8], [408 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [408 x i8] c"USAGE: %s [-v] [-i <niter>] [-k <file>] [-p <proj>] -s <size>\0A\0A -i <niter> number of iterations, default=5\0A -k <file> file name used to generate shm key, default=this executable\0A -p <proj> project number used to generate shm key, default=0\0A -s <size> shared memory size in bytes\0A (specify K, M, G for kilo, mega, giga bytes)\0A\0A -v verbose, display more diagnostic messages\0A\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([408 x i8], [408 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void XtCreateApplicationShell() {}


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

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

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

LLVM IR (-O2):
define void @XtCreateApplicationShell() {
ret void
}
int execute_create_module() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_create_module() {
ret i32 0
}
void gp_set_printer_binary(int prnfno, int binary) {}


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

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

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

LLVM IR (-O2):
define void @gp_set_printer_binary(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
struct page_context {
  int dummy;
};

/* Variables and functions */
scalar_t__ getphys(struct page_context *, void *);
void *unflag(void *);
void *virt_to_phys(struct page_context *ctx, void *ptr) {
  return unflag((void *)getphys(ctx, ptr));
}


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

x86 assembly (clang, -O2):
<virt_to_phys>:
push   %rax
call   1040 <getphys@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <unflag@plt>

LLVM IR (-O0):
%struct.page_context = type { i32 }
define i8* @virt_to_phys(%struct.page_context* %0, i8* %1) {
%3 = alloca %struct.page_context*
%4 = alloca i8*
store %struct.page_context* %0, %struct.page_context** %3
store i8* %1, i8** %4
%5 = load %struct.page_context*, %struct.page_context** %3
%6 = load i8*, i8** %4
%7 = call i64 @getphys(%struct.page_context* %5, i8* %6)
%8 = inttoptr i64 %7 to i8*
%9 = call i8* @unflag(i8* %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.page_context = type { i32 }
define i8* @virt_to_phys(%struct.page_context* %0, i8* %1) {
%3 = tail call i64 @getphys(%struct.page_context* %0, i8* %1)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i8* @unflag(i8* %4)
ret i8* %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint32_t build_limit(uint16_t limit_0_15, uint8_t limit_16_19) {
  return limit_0_15 | ((limit_16_19 & 0xF) << 16);
}


x86 assembly (clang, -O0):
<build_limit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    $0xf,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_limit>:
mov    %esi,%eax
and    $0xf,%eax
shl    $0x10,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @build_limit(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 = and i32 %6, 15
%8 = shl i32 %7, 16
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @build_limit(i32 %0, i32 %1) {
%3 = shl i32 %1, 16
%4 = and i32 %3, 983040
%5 = or i32 %4, %0
ret i32 %5
}
/* Variables and functions */
scalar_t__ strstr(char *, char *);
int pos(char *haystack, char *needle) {
  if (strstr(haystack, needle)) {
    return (int)strstr(haystack, needle) - (int)haystack;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1152 <pos+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
mov    -0x10(%rbp),%rcx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <pos+0x49>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pos>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strstr@plt>
test   %rax,%rax
je     1133 <pos+0x23>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strstr@plt>
sub    %ebx,%eax
jmp    1138 <pos+0x28>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @pos(i8* %0, i8* %1) {
%3 = tail call i64 @strstr(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = tail call i64 @strstr(i8* %0, i8* %1)
%7 = trunc i64 %6 to i32
%8 = ptrtoint i8* %0 to i64
%9 = trunc i64 %8 to i32
%10 = sub nsw i32 %7, %9
br label %11
11: ; preds = %2, %5
%12 = phi i32 [ %10, %5 ], [ -1, %2 ]
ret i32 %12
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int32_t new_val(uint32_t i, uint32_t j) { return 100000 * j + i; }


x86 assembly (clang, -O0):
<new_val>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x186a0,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_val>:
imul   $0x186a0,%esi,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @new_val(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = mul nsw i32 100000, %5
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @new_val(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, 100000
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *malloc(int);
char *Obj_char_create(char const inVal) {
  char *const retVal = malloc(sizeof *retVal);
  assert(retVal != NULL);
  *retVal = inVal;
  return retVal;
}


x86 assembly (clang, -O0):
<Obj_char_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Obj_char_create>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %bpl,(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @Obj_char_create(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8*
store i8 %0, i8* %2
%4 = call i8* @malloc(i32 1)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8, i8* %2
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @Obj_char_create(i8 signext %0) {
%2 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%3 = icmp ne i8* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
store i8 %0, i8* %2
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER_CTX;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
                const unsigned char *in, size_t inl) {
  if (in != out)
    memcpy((char *)out, (const char *)in, inl);
  return 1;
}


x86 assembly (clang, -O0):
<null_cipher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1147 <null_cipher+0x37>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcpy@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<null_cipher>:
cmp    %rsi,%rdx
je     1128 <null_cipher+0x18>
push   %rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1030 <memcpy@plt>
add    $0x8,%rsp
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @null_cipher(i32* nocapture readnone %0, i8* %1, i8* %2, i64 %3) {
%5 = icmp eq i8* %2, %1
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @memcpy(i8* %1, i8* %2, i64 %3)
br label %8
8: ; preds = %6, %4
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ cl_int;
typedef scalar_t__ cl_event;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, unsigned int *);
cl_int clReleaseEvent(cl_event event) {
  unsigned int sys_args[1];
  sys_args[0] = (unsigned int)event;
  return (cl_int)syscall(325, 1047, sys_args);
}


x86 assembly (clang, -O0):
<clReleaseEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdx
mov    $0x145,%edi
mov    $0x417,%esi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clReleaseEvent>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x145,%edi
mov    $0x417,%esi
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @clReleaseEvent(i64 %0) {
%2 = alloca i64
%3 = alloca [1 x i32]
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 %5, i32* %6
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%8 = call i32 @syscall(i32 325, i32 1047, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @clReleaseEvent(i64 %0) {
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %2 to i8*
%4 = trunc i64 %0 to i32
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 %4, i32* %5
%6 = call i32 @syscall(i32 325, i32 1047, i32* %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ import(char *);
int /*<<< orphan*/ on_save_config();
int /*<<< orphan*/ scanf(char *, char *);
int on_add() {
  char name_newdir[256];
  scanf(" %[^\n]", name_newdir);
  import(name_newdir);
  on_save_config();
  return 0;
}


x86 assembly (clang, -O0):
<on_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1030 <scanf@plt>
lea    -0x100(%rbp),%rdi
call   1050 <import@plt>
mov    $0x0,%al
call   1040 <on_save_config@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_add>:
push   %rbx
sub    $0x100,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <scanf@plt>
mov    %rbx,%rdi
call   1050 <import@plt>
xor    %eax,%eax
call   1040 <on_save_config@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c" %[^\0A]\00"
define i32 @on_add() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @import(i8* %4)
%6 = call i32 (...) @on_save_config()
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c" %[^\0A]\00"
define i32 @on_add() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @import(i8* %2)
%5 = call i32 (...) @on_save_config()
ret i32 0
}
/* Variables and functions */
int close(int);
int ab_close(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<ab_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @ab_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
int matchscore(char a, char b) {
  if (a == b)
    return 4;
  return -3;
}


x86 assembly (clang, -O0):
<matchscore>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jne    112c <matchscore+0x2c>
movl   $0x4,-0x4(%rbp)
jmp    1133 <matchscore+0x33>
movl   $0xfffffffd,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<matchscore>:
cmp    %sil,%dil
mov    $0x4,%ecx
mov    $0xfffffffd,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @matchscore(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, %1
%4 = select i1 %3, i32 4, i32 -3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ULONG_MAX;
unsigned long strtox(char const *, char **, int, int /*<<< orphan*/);
unsigned long strtoul(const char *restrict s, char **restrict p, int base) {
  return strtox(s, p, base, ULONG_MAX);
}


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

x86 assembly (clang, -O2):
<strtoul>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <strtox@plt>

LLVM IR (-O0):
@ULONG_MAX = global i32 0
define i64 @strtoul(i8* noalias %0, i8** noalias %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = load i32, i32* %6
%10 = load i32, i32* @ULONG_MAX
%11 = call i64 @strtox(i8* %7, i8** %8, i32 %9, i32 %10)
ret i64 %11
}

LLVM IR (-O2):
@ULONG_MAX = global i32 0
define i64 @strtoul(i8* noalias %0, i8** noalias %1, i32 %2) {
%4 = load i32, i32* @ULONG_MAX
%5 = tail call i64 @strtox(i8* %0, i8** %1, i32 %2, i32 %4)
ret i64 %5
}
/* Variables and functions */
size_t strlen(const char *a) {
  size_t i = 0;
  while (a[i++])
    ;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
cmpb   $0x0,(%rax,%rcx,1)
je     1132 <strlen+0x32>
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %4, %2 ]
%4 = add i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
ret i64 %4
}
char *icl_xz_name(void) { return "xz"; }


x86 assembly (clang, -O0):
<icl_xz_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<icl_xz_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"xz\00"
define i8* @icl_xz_name() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [3 x i8] c"xz\00"
define i8* @icl_xz_name() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
void updateSeriesReleaseYear(unsigned int seriesID, unsigned short year) {
  return;
}


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

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

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

LLVM IR (-O2):
define void @updateSeriesReleaseYear(i32 %0, i16 zeroext %1) {
ret void
}
int md_update(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @md_update() {
ret i32 1
}
/* Variables and functions */
void *fdopen(int, char *);
void *stderr;
void *stdin;
void *stdout;
void __streams_init() {
  stdin = fdopen(0, "r");
  stdout = fdopen(1, "a");
  stderr = fdopen(2, "a");
}


x86 assembly (clang, -O0):
<__streams_init>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
call   1030 <fdopen@plt>
mov    %rax,%rcx
mov    0x2ebc(%rip),%rax
mov    %rcx,(%rax)
mov    $0x1,%edi
lea    0xec7(%rip),%rsi
call   1030 <fdopen@plt>
mov    %rax,%rcx
mov    0x2e86(%rip),%rax
mov    %rcx,(%rax)
mov    $0x2,%edi
lea    0xea9(%rip),%rsi
call   1030 <fdopen@plt>
mov    %rax,%rcx
mov    0x2e70(%rip),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__streams_init>:
push   %rbx
lea    0xee8(%rip),%rsi
xor    %edi,%edi
call   1030 <fdopen@plt>
mov    0x2ec2(%rip),%rcx
mov    %rax,(%rcx)
lea    0xed2(%rip),%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
call   1030 <fdopen@plt>
mov    0x2e8c(%rip),%rcx
mov    %rax,(%rcx)
mov    $0x2,%edi
mov    %rbx,%rsi
call   1030 <fdopen@plt>
mov    0x2e7d(%rip),%rcx
mov    %rax,(%rcx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@stdin = global i8* null
@.str.1 = [2 x i8] c"a\00"
@stdout = global i8* null
@stderr = global i8* null
define void @__streams_init() {
%1 = call i8* @fdopen(i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %1, i8** @stdin
%2 = call i8* @fdopen(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %2, i8** @stdout
%3 = call i8* @fdopen(i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %3, i8** @stderr
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stdin = global i8* null
@.str.1 = [2 x i8] c"a\00"
@stdout = global i8* null
@stderr = global i8* null
define void @__streams_init() {
%1 = tail call i8* @fdopen(i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %1, i8** @stdin
%2 = tail call i8* @fdopen(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %2, i8** @stdout
%3 = tail call i8* @fdopen(i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %3, i8** @stderr
ret void
}
OP(ed, ca) {}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @OP(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Type definitions */
typedef double *__m128d;

/* Variables and functions */
void __attribute__((__always___, __nodebug__))
_mm_store1_pd(double *dp, __m128d a) {
  dp[0] = a[0];
  dp[1] = a[0];
}


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

x86 assembly (clang, -O2):
<_mm_store1_pd>:
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
movsd  (%rsi),%xmm0
movsd  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @_mm_store1_pd(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
store double %3, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
store double %4, double* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ resetRx();
void UART_rxDone(void) { resetRx(); }


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

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

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

LLVM IR (-O2):
define void @UART_rxDone() {
%1 = tail call i32 (...) @resetRx()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ERR(char *, int, int);
void assert_np(int n, int m) {
  if (n > m)
    ERR("too many particles: n = %d < m = %d", n, m);
}


x86 assembly (clang, -O0):
<assert_np>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113c <assert_np+0x2c>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec9(%rip),%rdi
call   1030 <ERR@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_np>:
mov    %esi,%edx
cmp    %esi,%edi
jle    1124 <assert_np+0x14>
mov    %edi,%esi
lea    0xee1(%rip),%rdi
jmp    1030 <ERR@plt>
ret

LLVM IR (-O0):
@.str = [36 x i8] c"too many particles: n = %d < m = %d\00"
define void @assert_np(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @ERR(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
br label %12
12: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"too many particles: n = %d < m = %d\00"
define void @assert_np(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @ERR(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _wbinvd();
void test_wbinvd(void) { _wbinvd(); }


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

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

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

LLVM IR (-O2):
define void @test_wbinvd() {
%1 = tail call i32 (...) @_wbinvd()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ k_strltrim(char *);
char *k_strrtrim(int /*<<< orphan*/);
char *k_strtrim(char *dest) { return k_strrtrim(k_strltrim(dest)); }


x86 assembly (clang, -O0):
<k_strtrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <k_strltrim@plt>
mov    %eax,%edi
call   1040 <k_strrtrim@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_strtrim>:
push   %rax
call   1030 <k_strltrim@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <k_strrtrim@plt>

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

LLVM IR (-O2):
define i8* @k_strtrim(i8* %0) {
%2 = tail call i32 @k_strltrim(i8* %0)
%3 = tail call i8* @k_strrtrim(i32 %2)
ret i8* %3
}
/* Type definitions */
struct qcc_arena {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ qcc_arena_reset(struct qcc_arena *);
void qcc_arena_done(struct qcc_arena *arena) { qcc_arena_reset(arena); }


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

x86 assembly (clang, -O2):
<qcc_arena_done>:
jmp    1030 <qcc_arena_reset@plt>

LLVM IR (-O0):
%struct.qcc_arena = type { i32 }
define void @qcc_arena_done(%struct.qcc_arena* %0) {
%2 = alloca %struct.qcc_arena*
store %struct.qcc_arena* %0, %struct.qcc_arena** %2
%3 = load %struct.qcc_arena*, %struct.qcc_arena** %2
%4 = call i32 @qcc_arena_reset(%struct.qcc_arena* %3)
ret void
}

LLVM IR (-O2):
%struct.qcc_arena = type { i32 }
define void @qcc_arena_done(%struct.qcc_arena* %0) {
%2 = tail call i32 @qcc_arena_reset(%struct.qcc_arena* %0)
ret void
}
int SymbolToBase(int symbol) {
  switch (symbol) {
  case 0:
    return 'A';
  case 1:
    return 'C';
  case 2:
    return 'G';
  case 3:
    return 'T';
  default:
    return '-';
  }
}


x86 assembly (clang, -O0):
<SymbolToBase>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x3,%rax
ja     115c <SymbolToBase+0x5c>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x41,-0x4(%rbp)
jmp    1163 <SymbolToBase+0x63>
movl   $0x43,-0x4(%rbp)
jmp    1163 <SymbolToBase+0x63>
movl   $0x47,-0x4(%rbp)
jmp    1163 <SymbolToBase+0x63>
movl   $0x54,-0x4(%rbp)
jmp    1163 <SymbolToBase+0x63>
movl   $0x2d,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SymbolToBase>:
mov    $0x2d,%eax
cmp    $0x3,%edi
ja     1117 <SymbolToBase+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @SymbolToBase(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
]
5: ; preds = %1
store i32 65, i32* %2
br label %10
6: ; preds = %1
store i32 67, i32* %2
br label %10
7: ; preds = %1
store i32 71, i32* %2
br label %10
8: ; preds = %1
store i32 84, i32* %2
br label %10
9: ; preds = %1
store i32 45, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@switch.table.SymbolToBase = [4 x i32] [i32 65, i32 67, i32 71, i32 84]
define i32 @SymbolToBase(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.SymbolToBase, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 45, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ trap_R_RegisterShaderNoMip(char *);
void UI_CinematicsMenu_Cache(void) {
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/back_0");
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/back_1");
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/frame2_l");
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/frame1_r");
}


x86 assembly (clang, -O0):
<UI_CinematicsMenu_Cache>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xef1(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xefd(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xf0b(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_CinematicsMenu_Cache>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xef4(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xf00(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xf0e(%rip),%rdi
pop    %rax
jmp    1030 <trap_R_RegisterShaderNoMip@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"menu/art_blueish/back_0\00"
@.str.1 = [24 x i8] c"menu/art_blueish/back_1\00"
@.str.2 = [26 x i8] c"menu/art_blueish/frame2_l\00"
@.str.3 = [26 x i8] c"menu/art_blueish/frame1_r\00"
define void @UI_CinematicsMenu_Cache() {
%1 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"menu/art_blueish/back_0\00"
@.str.1 = [24 x i8] c"menu/art_blueish/back_1\00"
@.str.2 = [26 x i8] c"menu/art_blueish/frame2_l\00"
@.str.3 = [26 x i8] c"menu/art_blueish/frame1_r\00"
define void @UI_CinematicsMenu_Cache() {
%1 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t base64_estimate_encode_size(size_t data_in_size) {
  return (4 * ((data_in_size + 2) / 3));
}


x86 assembly (clang, -O0):
<base64_estimate_encode_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_estimate_encode_size>:
lea    0x2(%rdi),%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
lea    (%rdx,%rdx,1),%rax
and    $0xfffffffffffffffc,%rax
ret

LLVM IR (-O0):
define i64 @base64_estimate_encode_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 2
%5 = udiv i64 %4, 3
%6 = mul i64 4, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @base64_estimate_encode_size(i64 %0) {
%2 = add i64 %0, 2
%3 = udiv i64 %2, 3
%4 = shl i64 %3, 2
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void METHOD(int *i) { printf("-DFORTRAN_UPPERCASE"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"-DFORTRAN_UPPERCASE\00"
define void @METHOD(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"-DFORTRAN_UPPERCASE\00"
define void @METHOD(i32* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_all();
int main(void) {
  printf("\nUnit testing memxxx functions.\n\n");
  test_all();
  printf("Tests passed\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"\0AUnit testing memxxx functions.\0A\0A\00"
@.str.1 = [14 x i8] c"Tests passed\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @test_all()
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [33 x i8] c"\0AUnit testing memxxx functions.\0A\00"
@str.2 = [13 x i8] c"Tests passed\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @test_all()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int arith_div(int, int);
int arith_ceiling(int x, int y) { return arith_div(x, y) + (x % y != 0); }


x86 assembly (clang, -O0):
<arith_ceiling>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <arith_div@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0xc(%rbp),%eax
cmp    $0x0,%edx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arith_ceiling>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <arith_div@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ebx
cmp    $0x1,%edx
sbb    $0xffffffff,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @arith_ceiling(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @arith_div(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
%13 = add nsw i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @arith_ceiling(i32 %0, i32 %1) {
%3 = tail call i32 @arith_div(i32 %0, i32 %1)
%4 = srem i32 %0, %1
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = add nsw i32 %3, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void get_input(int *decimal) {
  printf("Please enter an integer: ");
  scanf("%d", decimal);
}


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

x86 assembly (clang, -O2):
<get_input>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Please enter an integer: \00"
@.str.1 = [3 x i8] c"%d\00"
define void @get_input(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Please enter an integer: \00"
@.str.1 = [3 x i8] c"%d\00"
define void @get_input(i32* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %0)
ret void
}
/* Variables and functions */
void *malloc(int);
void *calloc(int size, int n) { return malloc(size * n); }


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

x86 assembly (clang, -O2):
<calloc>:
imul   %esi,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @calloc(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 = mul nsw i32 %5, %6
%8 = call i8* @malloc(i32 %7)
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @calloc(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i8* @malloc(i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_help() {
  printf("Usage: ifcounters [-v] [-h] [-b|-p|-e|-m|-q] interface\n"
         "\n"
         "Options:\n"
         "   -b      Input/Output Bytes counter\n"
         "   -p      Input/Output Unicast Packets counter\n"
         "   -e      Input/Output Errors counter\n"
         "   -m      Input/Output Multicast Packets counter\n"
         "   -q      Input/Output Queue Drops counter\n"
         "   -v      Display version information\n"
         "   -h      Display this help message\n");
}


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

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

LLVM IR (-O0):
@.str = [361 x i8] c"Usage: ifcounters [-v] [-h] [-b|-p|-e|-m|-q] interface\0A\0AOptions:\0A -b Input/Output Bytes counter\0A -p Input/Output Unicast Packets counter\0A -e Input/Output Errors counter\0A -m Input/Output Multicast Packets counter\0A -q Input/Output Queue Drops counter\0A -v Display version information\0A -h Display this help message\0A\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([361 x i8], [361 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [360 x i8] c"Usage: ifcounters [-v] [-h] [-b|-p|-e|-m|-q] interface\0A\0AOptions:\0A -b Input/Output Bytes counter\0A -p Input/Output Unicast Packets counter\0A -e Input/Output Errors counter\0A -m Input/Output Multicast Packets counter\0A -q Input/Output Queue Drops counter\0A -v Display version information\0A -h Display this help message\00"
define void @show_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([360 x i8], [360 x i8]* @str, i64 0, i64 0))
ret void
}
void av_file_map() {}


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

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

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

LLVM IR (-O2):
define void @av_file_map() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_welcome_msg(char *username) {
  printf("Welcome! %s!:-)\n", username);
  printf("------------------\n");
}


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

x86 assembly (clang, -O2):
<print_welcome_msg>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed8(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"Welcome! %s!:-)\0A\00"
@str = [19 x i8] c"------------------\00"
define void @print_welcome_msg(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned char dxl_read_word(unsigned char, int);
unsigned char getReturnDelayTime(unsigned char id) {
  return dxl_read_word(id, (5));
}


x86 assembly (clang, -O0):
<getReturnDelayTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x5,%esi
movzbl -0x1(%rbp),%edi
call   1030 <dxl_read_word@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getReturnDelayTime>:
mov    $0x5,%esi
jmp    1030 <dxl_read_word@plt>

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

LLVM IR (-O2):
define zeroext i8 @getReturnDelayTime(i8 zeroext %0) {
%2 = tail call zeroext i8 @dxl_read_word(i8 zeroext %0, i32 5)
ret i8 %2
}