xunge/DecIR huggingface dataset:
void PyDTrace_FUNCTION_RETURN(const char *arg0, const char *arg1, int arg2) {}


x86 assembly (clang, -O0):
<PyDTrace_FUNCTION_RETURN>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @PyDTrace_FUNCTION_RETURN(i8* %0, i8* %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
ret void
}

LLVM IR (-O2):
define void @PyDTrace_FUNCTION_RETURN(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
const char *pathconN_nm7_name_out(int i) {
  switch (i) {
  case 0:
    return "o0";
  case 1:
    return "o1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<pathconN_nm7_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <pathconN_nm7_name_out+0x2b>
jmp    111a <pathconN_nm7_name_out+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <pathconN_nm7_name_out+0x3b>
jmp    114b <pathconN_nm7_name_out+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathconN_nm7_name_out+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathconN_nm7_name_out+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm7_name_out>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @pathconN_nm7_name_out(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @pathconN_nm7_name_out(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
void CRYPTO_get_dynlock_create_callback(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_get_dynlock_create_callback() {
ret void
}
void gencvt_d_w() {}


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

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

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

LLVM IR (-O2):
define void @gencvt_d_w() {
ret void
}
/* Variables and functions */
void *malloc(int);
void *Malloc(int bytes) {
  void *mem = malloc(bytes);
  return mem;
}


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

x86 assembly (clang, -O2):
<Malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @Malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _chroot_usage(void) {
  fputs("Usage: "
        "chroot"
        " path [command]\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_chroot_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_chroot_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Usage: chroot path [command]\0A\00"
@stderr = global i32 0
define i32 @_chroot_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [30 x i8] c"Usage: chroot path [command]\0A\00"
@stderr = global i32 0
define i32 @_chroot_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
int softmagic(buf, nbytes)
unsigned char *buf;
int nbytes;
{
  if (match(buf, nbytes))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<softmagic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1030 <match@plt>
cmp    $0x0,%eax
je     1142 <softmagic+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <softmagic+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @softmagic(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = load i32, i32* %5
%8 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @match to i32 (i8*, i32, ...)*)(i8* %6, i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @softmagic(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @match to i32 (i8*, i32, ...)*)(i8* %0, i32 %1)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void lif_seek_phy_device(int device, int cylinder) {}


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

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

LLVM IR (-O0):
define void @lif_seek_phy_device(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 @lif_seek_phy_device(i32 %0, i32 %1) {
ret void
}
void MUSIC_SetMaxFMMidiChannel(int channel) {}


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

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

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

LLVM IR (-O2):
define void @MUSIC_SetMaxFMMidiChannel(i32 %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ widechar;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, int /*<<< orphan*/ *, int);
void pe_utils_str_widechar2ascii(char *output, const char *widechar,
                                 size_t length) {
  for (size_t p = 0; p < length; p++) {
    memcpy(output + p, (uint16_t *)(widechar) + p, 1);
  }
}


x86 assembly (clang, -O0):
<pe_utils_str_widechar2ascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    116c <pe_utils_str_widechar2ascii+0x5c>
mov    -0x8(%rbp),%rdi
add    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <pe_utils_str_widechar2ascii+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pe_utils_str_widechar2ascii>:
push   %r15
push   %r14
push   %rbx
test   %rdx,%rdx
je     114e <pe_utils_str_widechar2ascii+0x3e>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
add    $0x4,%r15
add    $0x1,%rbx
add    $0xffffffffffffffff,%r14
jne    1130 <pe_utils_str_widechar2ascii+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @pe_utils_str_widechar2ascii(i8* %0, i8* %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = bitcast i8* %1 to i32*
br label %8
7: ; preds = %8, %3
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %13, %8 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = getelementptr inbounds i32, i32* %6, i64 %9
%12 = tail call i32 @memcpy(i8* %10, i32* %11, i32 1)
%13 = add nuw i64 %9, 1
%14 = icmp eq i64 %13, %2
br i1 %14, label %7, label %8
}
/* Variables and functions */
void *talloc_named_const(void const *, size_t, char *);
void *_talloc_array(const void *ctx, size_t el_size, unsigned count,
                    const char *name) {
  return talloc_named_const(
      ctx, el_size * count,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/osmocom/libosmocore/refs/heads/master/src/"
      "pseudotalloc/pseudotalloc.c"
      ":"
      "82");
}


x86 assembly (clang, -O0):
<_talloc_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
imul   %rax,%rsi
lea    0xec3(%rip),%rdx
call   1030 <talloc_named_const@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_talloc_array>:
mov    %edx,%eax
imul   %rax,%rsi
lea    0xee3(%rip),%rdx
jmp    1030 <talloc_named_const@plt>

LLVM IR (-O0):
@.str = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/osmocom/libosmocore/refs/heads/master/src/pseudotalloc/pseudotalloc.c:82\00"
define i8* @_talloc_array(i8* %0, i64 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i32, i32* %7
%12 = zext i32 %11 to i64
%13 = mul i64 %10, %12
%14 = call i8* @talloc_named_const(i8* %9, i64 %13, i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str, i64 0, i64 0))
ret i8* %14
}

LLVM IR (-O2):
@.str = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/osmocom/libosmocore/refs/heads/master/src/pseudotalloc/pseudotalloc.c:82\00"
define i8* @_talloc_array(i8* %0, i64 %1, i32 %2, i8* nocapture readnone %3) {
%5 = zext i32 %2 to i64
%6 = mul i64 %5, %1
%7 = tail call i8* @talloc_named_const(i8* %0, i64 %6, i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int syntax_error(void) {
  fprintf(stderr, "syntax error\n");
  return 0;
}


x86 assembly (clang, -O0):
<syntax_error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<syntax_error>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"syntax error\0A\00"
define i32 @syntax_error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"syntax error\0A\00"
define i32 @syntax_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *strcat(char *dest, const char *src) {
  char *tmp = dest;
  while (*dest)
    dest++;
  while ((*dest++ = *src++) != '\0')
    ;
  return tmp;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <strcat+0x32>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcat+0x14>
jmp    1137 <strcat+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     116a <strcat+0x6a>
jmp    1137 <strcat+0x37>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ lprcat(char *);
void dnd_2hed() {
  lprcat("Welcome to the Ularn Thrift Shoppe.  We stock many items explorers "
         "find useful\n");
  lprcat("in their adventures.  Feel free to browse to your hearts content.\n");
  lprcat("Also be advised, if you break 'em, you pay for 'em.");
}


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

x86 assembly (clang, -O2):
<dnd_2hed>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <lprcat@plt>
lea    0xf2c(%rip),%rdi
call   1030 <lprcat@plt>
lea    0xf63(%rip),%rdi
pop    %rax
jmp    1030 <lprcat@plt>

LLVM IR (-O0):
@.str = [80 x i8] c"Welcome to the Ularn Thrift Shoppe. We stock many items explorers find useful\0A\00"
@.str.1 = [67 x i8] c"in their adventures. Feel free to browse to your hearts content.\0A\00"
@.str.2 = [52 x i8] c"Also be advised, if you break 'em, you pay for 'em.\00"
define void @dnd_2hed() {
%1 = call i32 @lprcat(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @lprcat(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @lprcat(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [80 x i8] c"Welcome to the Ularn Thrift Shoppe. We stock many items explorers find useful\0A\00"
@.str.1 = [67 x i8] c"in their adventures. Feel free to browse to your hearts content.\0A\00"
@.str.2 = [52 x i8] c"Also be advised, if you break 'em, you pay for 'em.\00"
define void @dnd_2hed() {
%1 = tail call i32 @lprcat(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @lprcat(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @lprcat(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int read(int, char *, int);
int /*<<< orphan*/ write(int, char *, int);
void filecopy(int fdin, int fdout) {
  char buf[1024];
  int n;
  while ((n = read(fdin, buf, 1024)) > 0)
    write(fdout, buf, n);
}


x86 assembly (clang, -O0):
<filecopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    $0x400,%edx
call   1040 <read@plt>
mov    %eax,-0x414(%rbp)
cmp    $0x0,%eax
jle    116e <filecopy+0x4e>
mov    -0x8(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    -0x414(%rbp),%edx
call   1030 <write@plt>
jmp    1131 <filecopy+0x11>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filecopy>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %esi,%r14d
mov    %edi,%ebp
mov    %rsp,%rsi
mov    $0x400,%edx
call   1040 <read@plt>
test   %eax,%eax
jle    1170 <filecopy+0x50>
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1040 <read@plt>
test   %eax,%eax
jg     1150 <filecopy+0x30>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @filecopy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [1024 x i8]
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %7
7: ; preds = %12, %2
%8 = load i32, i32* %3
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%10 = call i32 @read(i32 %8, i8* %9, i32 1024)
store i32 %10, i32* %6
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = load i32, i32* %4
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%15 = load i32, i32* %6
%16 = call i32 @write(i32 %13, i8* %14, i32 %15)
br label %7
17: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @filecopy(i32 %0, i32 %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @read(i32 %0, i8* %4, i32 1024)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2, %7
%8 = phi i32 [ %10, %7 ], [ %5, %2 ]
%9 = call i32 @write(i32 %1, i8* %4, i32 %8)
%10 = call i32 @read(i32 %0, i8* %4, i32 1024)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %2
ret void
}
/* Variables and functions */
int atoi(char *);
int t_font(char *s) { return atoi(s); }


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

x86 assembly (clang, -O2):
<t_font>:
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @t_font(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ TELOPT_BINARY;
int /*<<< orphan*/ send_dont(int /*<<< orphan*/, int);
int /*<<< orphan*/ send_wont(int /*<<< orphan*/, int);
void tel_leave_binary(int rw) {
  if (rw & 1)
    send_dont(TELOPT_BINARY, 1);
  if (rw & 2)
    send_wont(TELOPT_BINARY, 1);
}


x86 assembly (clang, -O0):
<tel_leave_binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114d <tel_leave_binary+0x2d>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1040 <send_dont@plt>
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     116f <tel_leave_binary+0x4f>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1030 <send_wont@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tel_leave_binary>:
push   %rbx
mov    %edi,%ebx
test   $0x1,%bl
je     113b <tel_leave_binary+0x1b>
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1040 <send_dont@plt>
test   $0x2,%bl
jne    1142 <tel_leave_binary+0x22>
pop    %rbx
ret
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
pop    %rbx
jmp    1030 <send_wont@plt>

LLVM IR (-O0):
@TELOPT_BINARY = global i32 0
define void @tel_leave_binary(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @TELOPT_BINARY
%8 = call i32 @send_dont(i32 %7, i32 1)
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
%11 = and i32 %10, 2
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* @TELOPT_BINARY
%15 = call i32 @send_wont(i32 %14, i32 1)
br label %16
16: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
@TELOPT_BINARY = global i32 0
define void @tel_leave_binary(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @TELOPT_BINARY
%6 = tail call i32 @send_dont(i32 %5, i32 1)
br label %7
7: ; preds = %4, %1
%8 = and i32 %0, 2
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* @TELOPT_BINARY
%12 = tail call i32 @send_wont(i32 %11, i32 1)
br label %13
13: ; preds = %10, %7
ret void
}
void fontcmd(int cmd, int font) { return; }


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

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

LLVM IR (-O0):
define void @fontcmd(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 @fontcmd(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tst_timer_elapsed();
long long tst_timespec_to_ms(int /*<<< orphan*/);
long long tst_timer_elapsed_ms(void) {
  return tst_timespec_to_ms(tst_timer_elapsed());
}


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

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

LLVM IR (-O0):
define i64 @tst_timer_elapsed_ms() {
%1 = call i32 (...) @tst_timer_elapsed()
%2 = call i64 @tst_timespec_to_ms(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
define i64 @tst_timer_elapsed_ms() {
%1 = tail call i32 (...) @tst_timer_elapsed()
%2 = tail call i64 @tst_timespec_to_ms(i32 %1)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage:  map <device_type(options)> [as <name>] at <base_addr>\n");
}


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

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

LLVM IR (-O0):
@.str = [63 x i8] c"Usage: map <device_type(options)> [as <name>] at <base_addr>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [62 x i8] c"Usage: map <device_type(options)> [as <name>] at <base_addr>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
ret void
}
void SDCard_EnableTxInt(void) {}


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

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

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

LLVM IR (-O2):
define void @SDCard_EnableTxInt() {
ret void
}
/* Type definitions */
struct timespec {
  long tv_sec;
  long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/);
void msleep(long mtime) {
  struct timespec time;
  time.tv_sec = (mtime / 1000);
  time.tv_nsec = (mtime % 1000) * 1000000;
  nanosleep(&time, 0);
}


x86 assembly (clang, -O0):
<msleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
imul   $0xf4240,%rdx,%rax
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msleep>:
sub    $0x18,%rsp
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rax,%rdx
mov    %rdx,0x8(%rsp)
imul   $0x3e8,%rdx,%rax
sub    %rax,%rdi
imul   $0xf4240,%rdi,%rax
mov    %rax,0x10(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @msleep(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timespec
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = sdiv i64 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %5, i64* %6
%7 = load i64, i64* %2
%8 = srem i64 %7, 1000
%9 = mul nsw i64 %8, 1000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 %9, i64* %10
%11 = call i32 @nanosleep(%struct.timespec* %3, i32 0)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @msleep(i64 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = sdiv i64 %0, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %4, i64* %5
%6 = srem i64 %0, 1000
%7 = mul nsw i64 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 %7, i64* %8
%9 = call i32 @nanosleep(%struct.timespec* %2, i32 0)
ret void
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t rotl32(uint32_t n, unsigned int c) {
  const unsigned int mask = 31;
  c &= mask;
  unsigned int neg_c = (unsigned int)(-(int)c);
  return (n << c) | (n >> (neg_c & mask));
}


x86 assembly (clang, -O0):
<rotl32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1f,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%ecx
and    $0x1f,%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rotl32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 31, i32* %5
%7 = load i32, i32* %4
%8 = and i32 %7, 31
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = sub nsw i32 0, %9
store i32 %10, i32* %6
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = shl i32 %11, %12
%14 = load i32, i32* %3
%15 = load i32, i32* %6
%16 = and i32 %15, 31
%17 = lshr i32 %14, %16
%18 = or i32 %13, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @rotl32(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_ConstantsMustBeSimple(long p_position) {
  _Error(p_position, "Constant definitions must be a literal expression");
}


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

x86 assembly (clang, -O2):
<Error_ConstantsMustBeSimple>:
lea    0xee9(%rip),%rsi
jmp    1030 <_Error@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"Constant definitions must be a literal expression\00"
define void @Error_ConstantsMustBeSimple(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"Constant definitions must be a literal expression\00"
define void @Error_ConstantsMustBeSimple(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret void
}
sprintf(buffer, format) char *buffer, *format;
{
  int _sspr();
  _spr(&format, &_sspr, &buffer);
  *buffer = '\0';
}


x86 assembly (clang, -O0):
<sprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0x2ec1(%rip),%rsi
xor    %eax,%eax
lea    -0x18(%rbp),%rdi
lea    -0x10(%rbp),%rdx
call   1030 <_spr@plt>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprintf>:
sub    $0x18,%rsp
mov    %rdi,0x8(%rsp)
mov    %rsi,0x10(%rsp)
mov    0x2ec3(%rip),%rsi
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1030 <_spr@plt>
mov    0x8(%rsp),%rax
movb   $0x0,(%rax)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @sprintf(i8* %0, i8* %1, ...) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = call i32 (i8**, i32 (...)*, i8**, ...) bitcast (i32 (...)* @_spr to i32 (i8**, i32 (...)*, i8**, ...)*)(i8** %5, i32 (...)* @_sspr, i8** %4)
%7 = load i8*, i8** %4
store i8 0, i8* %7
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @sprintf(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (i8**, i32 (...)*, i8**, ...) bitcast (i32 (...)* @_spr to i32 (i8**, i32 (...)*, i8**, ...)*)(i8** %4, i32 (...)* @_sspr, i8** %3)
%6 = load i8*, i8** %3
store i8 0, i8* %6
ret i32 undef
}
/* Variables and functions */
unsigned int SDBMHash(unsigned char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strlen(unsigned char *);
int main(int argc, char *argv[]) {
  unsigned char *str = argv[1];
  unsigned int hash = SDBMHash(str, strlen(str));
  if (hash == 0x89dcd66e)
    printf("You win!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1050 <SDBMHash@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x89dcd66e,-0x1c(%rbp)
jne    118a <main+0x5a>
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <SDBMHash@plt>
cmp    $0x89dcd66e,%eax
jne    115a <main+0x2a>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"You win!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = load i8*, i8** %6
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @SDBMHash(i8* %11, i32 %13)
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, -1982015890
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %2
ret i32 0
}

LLVM IR (-O2):
@str = [9 x i8] c"You win!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @strlen(i8* %4)
%6 = tail call i32 @SDBMHash(i8* %4, i32 %5)
%7 = icmp eq i32 %6, -1982015890
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret i32 0
}
/* Type definitions */
struct Var {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pA(char *, char const *, char const *, char const *);
void __func_xor_ptr(struct Var *avar, const char *areg, const char *lreg,
                    const char *rreg) {
  pA("%s = %s ^ %s;", areg, lreg, rreg);
}


x86 assembly (clang, -O0):
<__func_xor_ptr>:
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    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xec5(%rip),%rdi
call   1030 <pA@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Var = type { i32 }
@.str = [14 x i8] c"%s = %s ^ %s;\00"
define void @__func_xor_ptr(%struct.Var* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.Var*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store %struct.Var* %0, %struct.Var** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = load i8*, i8** %8
%12 = call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
%struct.Var = type { i32 }
@.str = [14 x i8] c"%s = %s ^ %s;\00"
define void @__func_xor_ptr(%struct.Var* nocapture readnone %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
char *ctime(scalar_t__ const *);
scalar_t__ time(int /*<<< orphan*/ *);
char *getTimeInString(void) {
  time_t timeInSeconds;
  char *timeInString;
  timeInSeconds = time(NULL);
  if (timeInSeconds == (time_t)(-1)) {
    return NULL;
  }
  timeInString = ctime((const time_t *)&timeInSeconds);
  if (timeInString == NULL) {
    return NULL;
  }
  return timeInString;
}


x86 assembly (clang, -O0):
<getTimeInString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    114d <getTimeInString+0x2d>
movq   $0x0,-0x8(%rbp)
jmp    117a <getTimeInString+0x5a>
lea    -0x10(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1172 <getTimeInString+0x52>
movq   $0x0,-0x8(%rbp)
jmp    117a <getTimeInString+0x5a>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTimeInString>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <time@plt>
mov    %rax,0x8(%rsp)
cmp    $0xffffffffffffffff,%rax
je     1146 <getTimeInString+0x26>
lea    0x8(%rsp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @getTimeInString() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i64 @time(i32* null)
store i64 %3, i64* %1
%4 = icmp eq i64 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i8* @ctime(i64* %1)
br label %7
7: ; preds = %5, %0
%8 = phi i8* [ null, %0 ], [ %6, %5 ]
ret i8* %8
}
/* Type definitions */
typedef int /*<<< orphan*/ pem_password_cb;
typedef int /*<<< orphan*/ EVP_PKEY;
typedef int /*<<< orphan*/ EC_KEY;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ *PEM_read_bio_PrivateKey(int /*<<< orphan*/ *,
                                            int /*<<< orphan*/ *,
                                            int /*<<< orphan*/ *, void *);
int /*<<< orphan*/ *pkey_get_eckey(int /*<<< orphan*/ *, int /*<<< orphan*/ **);
EC_KEY *PEM_read_bio_ECPrivateKey(BIO *bp, EC_KEY **key, pem_password_cb *cb,
                                  void *u) {
  EVP_PKEY *pktmp;
  pktmp = PEM_read_bio_PrivateKey(bp, NULL, cb, u);
  return pkey_get_eckey(pktmp, key);
}


x86 assembly (clang, -O0):
<PEM_read_bio_ECPrivateKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <PEM_read_bio_PrivateKey@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <pkey_get_eckey@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_read_bio_ECPrivateKey>:
push   %rbx
mov    %rsi,%rbx
xor    %esi,%esi
call   1040 <PEM_read_bio_PrivateKey@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <pkey_get_eckey@plt>

LLVM IR (-O0):
define i32* @PEM_read_bio_ECPrivateKey(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32**
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i32*
store i32* %0, i32** %5
store i32** %1, i32*** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%10 = load i32*, i32** %5
%11 = load i32*, i32** %7
%12 = load i8*, i8** %8
%13 = call i32* @PEM_read_bio_PrivateKey(i32* %10, i32* null, i32* %11, i8* %12)
store i32* %13, i32** %9
%14 = load i32*, i32** %9
%15 = load i32**, i32*** %6
%16 = call i32* @pkey_get_eckey(i32* %14, i32** %15)
ret i32* %16
}

LLVM IR (-O2):
define i32* @PEM_read_bio_ECPrivateKey(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = tail call i32* @PEM_read_bio_PrivateKey(i32* %0, i32* null, i32* %2, i8* %3)
%6 = tail call i32* @pkey_get_eckey(i32* %5, i32** %1)
ret i32* %6
}
/* Variables and functions */
int /*<<< orphan*/ lgen(char *, char *, int);
void cgdefl(int v) { lgen("%s\t%c%d", ".long", v); }


x86 assembly (clang, -O0):
<cgdefl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xedc(%rip),%rsi
call   1030 <lgen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgdefl>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xee8(%rip),%rsi
jmp    1030 <lgen@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s\09%c%d\00"
@.str.1 = [6 x i8] c".long\00"
define void @cgdefl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @lgen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s\09%c%d\00"
@.str.1 = [6 x i8] c".long\00"
define void @cgdefl(i32 %0) {
%2 = tail call i32 @lgen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll14(struct __test_metadata *);
void wrapper_epoll14(struct __test_metadata *_metadata,
                     struct __fixture_variant_metadata *variant) {
  epoll14(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_epoll14>:
jmp    1030 <epoll14@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll14(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @epoll14(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll14(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll14(%struct.__test_metadata* %0)
ret void
}
/* Variables and functions */
double pow(double, int);
double se_dist(double x, double y) { return pow(x - y, 2); }


x86 assembly (clang, -O0):
<se_dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<se_dist>:
subsd  %xmm1,%xmm0
mov    $0x2,%edi
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @se_dist(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = call double @pow(double %7, i32 2)
ret double %8
}

LLVM IR (-O2):
define double @se_dist(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @pow(double %3, i32 2)
ret double %4
}
/* Variables and functions */
double revolution(double);
double GMST0(double d) {
  double sidtim0;
  sidtim0 = revolution((180.0 + 356.0470 + 282.9404) +
                       (0.9856002585 + 4.70935E-5) * d);
  return sidtim0;
}


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

x86 assembly (clang, -O2):
<GMST0>:
mulsd  0xee8(%rip),%xmm0
addsd  0xee8(%rip),%xmm0
jmp    1030 <revolution@plt>

LLVM IR (-O0):
define double @GMST0(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double 0x3FEF8A6C50C753F8, double %4, double 0x408997E631F8A090)
%6 = call double @revolution(double %5)
store double %6, double* %3
%7 = load double, double* %3
ret double %7
}

LLVM IR (-O2):
define double @GMST0(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 0x3FEF8A6C50C753F8, double 0x408997E631F8A090)
%3 = tail call double @revolution(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *rax_malloc(size_t);
void *rax_calloc(size_t n, size_t size) {
  void *ptr = rax_malloc(size * n);
  memset(ptr, 0, size * n);
  return ptr;
}


x86 assembly (clang, -O0):
<rax_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
imul   -0x8(%rbp),%rdi
call   1030 <rax_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
imul   -0x8(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rax_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1030 <rax_malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @rax_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = mul i64 %6, %7
%9 = call i8* @rax_malloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i64, i64* %4
%12 = load i64, i64* %3
%13 = mul i64 %11, %12
%14 = call i32 @memset(i8* %10, i32 0, i64 %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @rax_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @rax_malloc(i64 %3)
%5 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
ret i8* %4
}