xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int hideme(unsigned int);
unsigned int rand();
int main(int argc, char **argv) {
  unsigned r = rand();
  unsigned s = hideme(r);
  return (r >= s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <hideme@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
setae  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <rand@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <hideme@plt>
xor    %ecx,%ecx
cmp    %eax,%ebx
setae  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @rand()
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @hideme(i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = icmp uge i32 %11, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = tail call i32 @hideme(i32 %3)
%5 = icmp uge i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void DMAabort(long addr) {
  long temp_out, temp_in;
  printf("DMA abort!\n");
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"DMA abort!\0A\00"
define void @DMAabort(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"DMA abort!\00"
define void @DMAabort(i64 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
char *crn_strncpy(char *src, size_t n) {
  char *dest = malloc(n + 1);
  strncpy(dest, src, n);
  dest[n] = '\0';
  return dest;
}


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

x86 assembly (clang, -O2):
<crn_strncpy>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @crn_strncpy(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 %6, 1
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = call i32 @strncpy(i8* %9, i8* %10, i64 %11)
%13 = load i8*, i8** %5
%14 = load i64, i64* %4
%15 = getelementptr inbounds i8, i8* %13, i64 %14
store i8 0, i8* %15
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
define i8* @crn_strncpy(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strncpy(i8* %4, i8* %0, i64 %1)
%6 = getelementptr inbounds i8, i8* %4, i64 %1
store i8 0, i8* %6
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ println(int *, int);
int /*<<< orphan*/ select_sort(int *, int);
int main() {
  int arr[] = {122, 25, 42, 543, 87};
  int len = sizeof(arr) / sizeof(*arr);
  println(arr, len);
  select_sort(arr, len);
  println(arr, len);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x5,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <println@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <select_sort@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <println@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <println@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <select_sort@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <println@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [5 x i32] [i32 122, i32 25, i32 42, i32 543, i32 87]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [5 x i32]* %2 to i8*
store i32 5, i32* %3
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @println(i32* %5, i32 %6)
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @select_sort(i32* %8, i32 %9)
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%12 = load i32, i32* %3
%13 = call i32 @println(i32* %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [5 x i32] [i32 122, i32 25, i32 42, i32 543, i32 87]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @println(i32* %3, i32 5)
%5 = call i32 @select_sort(i32* %3, i32 5)
%6 = call i32 @println(i32* %3, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
scalar_t__ strcmp(char *, char *);
void fun8(char *str) {
  printf("CFFI test8...");
  assert(strcmp(str, "ABC") == 0);
  puts("OK");
}


x86 assembly (clang, -O0):
<fun8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeab(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xe92(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun8>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
lea    0xe9e(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"CFFI test8...\00"
@.str.1 = [4 x i8] c"ABC\00"
@.str.2 = [3 x i8] c"OK\00"
define void @fun8(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"CFFI test8...\00"
@.str.1 = [4 x i8] c"ABC\00"
@.str.2 = [3 x i8] c"OK\00"
define void @fun8(i8* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int io_in8(int);
void wait_KBC_sendready(void) {
  for (;;) {
    if ((io_in8(0x0064) & 0x02) == 0) {
      break;
    }
  }
}


x86 assembly (clang, -O0):
<wait_KBC_sendready>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <wait_KBC_sendready+0x9>
mov    $0x64,%edi
call   1030 <io_in8@plt>
and    $0x2,%eax
cmp    $0x0,%eax
jne    1134 <wait_KBC_sendready+0x24>
jmp    1139 <wait_KBC_sendready+0x29>
jmp    1119 <wait_KBC_sendready+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_KBC_sendready>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x64,%edi
call   1030 <io_in8@plt>
test   $0x2,%al
jne    1120 <wait_KBC_sendready+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @wait_KBC_sendready() {
br label %1
1: ; preds = %6, %0
%2 = call i32 @io_in8(i32 100)
%3 = and i32 %2, 2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %7
6: ; preds = %1
br label %1
7: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @wait_KBC_sendready() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @io_in8(i32 100)
%3 = and i32 %2, 2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
void option_free_int(void *p) {}


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

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

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

LLVM IR (-O2):
define void @option_free_int(i8* nocapture %0) {
ret void
}
void ff_hevc_put_hevc_uni_epel_hv12_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_hv12_10_sse4() {
ret void
}
int nanddrv_status_busy(unsigned char status) {
  return (status & (1 << 6)) == 0;
}


x86 assembly (clang, -O0):
<nanddrv_status_busy>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nanddrv_status_busy>:
xor    %eax,%eax
test   $0x40,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @nanddrv_status_busy(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 64
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @nanddrv_status_busy(i8 zeroext %0) {
%2 = lshr i8 %0, 6
%3 = and i8 %2, 1
%4 = xor i8 %3, 1
%5 = zext i8 %4 to i32
ret i32 %5
}
int toCard(int number) {
  if (number == 10)
    return 'T';
  if (number == 11)
    return 'J';
  if (number == 12)
    return 'Q';
  if (number == 13)
    return 'K';
  if (number == 14)
    return 'A';
  return 0;
}


x86 assembly (clang, -O0):
<toCard>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    111d <toCard+0x1d>
movl   $0x54,-0x4(%rbp)
jmp    117c <toCard+0x7c>
cmpl   $0xb,-0x8(%rbp)
jne    1133 <toCard+0x33>
movl   $0x4a,-0x4(%rbp)
jmp    117c <toCard+0x7c>
cmpl   $0xc,-0x8(%rbp)
jne    1149 <toCard+0x49>
movl   $0x51,-0x4(%rbp)
jmp    117c <toCard+0x7c>
cmpl   $0xd,-0x8(%rbp)
jne    115f <toCard+0x5f>
movl   $0x4b,-0x4(%rbp)
jmp    117c <toCard+0x7c>
cmpl   $0xe,-0x8(%rbp)
jne    1175 <toCard+0x75>
movl   $0x41,-0x4(%rbp)
jmp    117c <toCard+0x7c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toCard>:
add    $0xfffffff6,%edi
xor    %eax,%eax
cmp    $0x4,%edi
ja     1117 <toCard+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @toCard(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 84, i32* %2
br label %24
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 11
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 74, i32* %2
br label %24
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 12
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 81, i32* %2
br label %24
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 13
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 75, i32* %2
br label %24
19: ; preds = %15
%20 = load i32, i32* %3
%21 = icmp eq i32 %20, 14
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 65, i32* %2
br label %24
23: ; preds = %19
store i32 0, i32* %2
br label %24
24: ; preds = %23, %22, %18, %14, %10, %6
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
@switch.table.toCard = [5 x i32] [i32 84, i32 74, i32 81, i32 75, i32 65]
define i32 @toCard(i32 %0) {
%2 = add i32 %0, -10
%3 = icmp ult i32 %2, 5
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [5 x i32], [5 x i32]* @switch.table.toCard, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Type definitions */
struct fatx_fs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fatx_print(struct fatx_fs *, int, char *, char const *);
int fatx_mkdir(struct fatx_fs *fs, char const *path) {
  fatx_print(fs, 5, "fatx_mkdir(path=\"%s\")\n", path);
  return -1;
}


x86 assembly (clang, -O0):
<fatx_mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x5,%esi
lea    0xecc(%rip),%rdx
call   1030 <fatx_print@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatx_mkdir>:
push   %rax
mov    %rsi,%rcx
lea    0xee5(%rip),%rdx
mov    $0x5,%esi
call   1030 <fatx_print@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.fatx_fs = type { i32 }
@.str = [23 x i8] c"fatx_mkdir(path=\22%s\22)\0A\00"
define i32 @fatx_mkdir(%struct.fatx_fs* %0, i8* %1) {
%3 = alloca %struct.fatx_fs*
%4 = alloca i8*
store %struct.fatx_fs* %0, %struct.fatx_fs** %3
store i8* %1, i8** %4
%5 = load %struct.fatx_fs*, %struct.fatx_fs** %3
%6 = load i8*, i8** %4
%7 = call i32 @fatx_print(%struct.fatx_fs* %5, i32 5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 -1
}

LLVM IR (-O2):
%struct.fatx_fs = type { i32 }
@.str = [23 x i8] c"fatx_mkdir(path=\22%s\22)\0A\00"
define i32 @fatx_mkdir(%struct.fatx_fs* %0, i8* %1) {
%3 = tail call i32 @fatx_print(%struct.fatx_fs* %0, i32 5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 -1
}
/* Variables and functions */
char *password_cache_lookup(const char *keygrip, int *fatal_error) {
  (void)keygrip;
  (void)fatal_error;
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @password_cache_lookup(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @password_cache_lookup(i8* nocapture readnone %0, i32* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int args, char **argv) {
  puts("Hello World!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct html {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ htprintf(struct html *, char *);
void end_colour_bar(struct html *ctx) { htprintf(ctx, "</tr>\n</table>\n"); }


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

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

LLVM IR (-O0):
%struct.html = type { i32 }
@.str = [16 x i8] c"</tr>\0A</table>\0A\00"
define void @end_colour_bar(%struct.html* %0) {
%2 = alloca %struct.html*
store %struct.html* %0, %struct.html** %2
%3 = load %struct.html*, %struct.html** %2
%4 = call i32 @htprintf(%struct.html* %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.html = type { i32 }
@.str = [16 x i8] c"</tr>\0A</table>\0A\00"
define void @end_colour_bar(%struct.html* %0) {
%2 = tail call i32 @htprintf(%struct.html* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
void *mem_realloc(void *ptr, unsigned long size) {
  void *tmp = realloc((char *)ptr - sizeof(unsigned long),
                      size + sizeof(unsigned long));
  ((unsigned long *)tmp)[0] = size;
  return ((char *)tmp + sizeof(unsigned long));
}


x86 assembly (clang, -O0):
<mem_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xfffffffffffffff8,%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x8,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_realloc>:
push   %rbx
mov    %rsi,%rbx
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsi
call   1030 <realloc@plt>
mov    %rbx,(%rax)
add    $0x8,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mem_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 -8
%8 = load i64, i64* %4
%9 = add i64 %8, 8
%10 = call i8* @realloc(i8* %7, i64 %9)
store i8* %10, i8** %5
%11 = load i64, i64* %4
%12 = load i8*, i8** %5
%13 = bitcast i8* %12 to i64*
%14 = getelementptr inbounds i64, i64* %13, i64 0
store i64 %11, i64* %14
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i64 8
ret i8* %16
}

LLVM IR (-O2):
define noalias i8* @mem_realloc(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 -8
%4 = add i64 %1, 8
%5 = tail call i8* @realloc(i8* %3, i64 %4)
%6 = bitcast i8* %5 to i64*
store i64 %1, i64* %6
%7 = getelementptr inbounds i8, i8* %5, i64 8
ret i8* %7
}
unsigned int _rotl(unsigned int src1, unsigned int src2) {
  src2 &= 0x1f;
  return (src1 << src2) | (src1 >> (32 - src2));
}


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

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

LLVM IR (-O0):
define i32 @_rotl(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 = and i32 %5, 31
store i32 %6, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = shl i32 %7, %8
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sub i32 32, %11
%13 = lshr i32 %10, %12
%14 = or i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @_rotl(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 %1)
ret i32 %3
}
long double test_sinhl(long double x) { return __builtin_sinhl(x); }


x86 assembly (clang, -O0):
<test_sinhl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sinhl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sinhl>:
jmp    1030 <sinhl@plt>

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

LLVM IR (-O2):
define x86_fp80 @test_sinhl(x86_fp80 %0) {
%2 = tail call x86_fp80 @sinhl(x86_fp80 %0)
ret x86_fp80 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void spaces(FILE *out, int indent) {
  assert(indent % 2 == 0);
  for (int i = 0; i < indent; i += 2) {
    fprintf(out, "  ");
  }
}


x86 assembly (clang, -O0):
<spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    117b <spaces+0x5b>
mov    -0x8(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
jmp    1151 <spaces+0x31>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spaces>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
not    %edi
and    $0x1,%edi
call   1030 <assert@plt>
test   %ebx,%ebx
jle    116c <spaces+0x4c>
xor    %ebp,%ebp
lea    0xebb(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %r14,%rcx
call   1040 <fwrite@plt>
add    $0x2,%ebp
cmp    %ebx,%ebp
jl     1150 <spaces+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c" \00"
define void @spaces(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = srem i32 %6, 2
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
store i32 0, i32* %5
br label %11
11: ; preds = %18, %2
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load i32*, i32** %3
%17 = call i32 @fprintf(i32* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %15
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 2
store i32 %20, i32* %5
br label %11
21: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @spaces(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 1
%4 = xor i32 %3, 1
%5 = tail call i32 @assert(i32 %4)
%6 = icmp sgt i32 %1, 0
br i1 %6, label %8, label %7
7: ; preds = %8, %2
ret void
8: ; preds = %2, %8
%9 = phi i32 [ %11, %8 ], [ 0, %2 ]
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2, i64 1, i32* %0)
%11 = add nuw nsw i32 %9, 2
%12 = icmp slt i32 %11, %1
br i1 %12, label %8, label %7
}
char *_DlError_(void) { return ("ERROR: this is the dummy dynamic loader\n"); }


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"ERROR: this is the dummy dynamic loader\0A\00"
define i8* @_DlError_() {
ret i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [41 x i8] c"ERROR: this is the dummy dynamic loader\0A\00"
define i8* @_DlError_() {
ret i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t SDL_Swap32(uint32_t x) {
  return ((x << 24) | ((x << 8) & 0x00FF0000) | ((x >> 8) & 0x0000FF00) |
          (x >> 24));
}


x86 assembly (clang, -O0):
<SDL_Swap32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDL_Swap32>:
mov    %edi,%eax
and    $0xffffff,%eax
bswap  %eax
sar    $0x18,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @SDL_Swap32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = load i32, i32* %2
%6 = shl i32 %5, 8
%7 = and i32 %6, 16711680
%8 = or i32 %4, %7
%9 = load i32, i32* %2
%10 = ashr i32 %9, 8
%11 = and i32 %10, 65280
%12 = or i32 %8, %11
%13 = load i32, i32* %2
%14 = ashr i32 %13, 24
%15 = or i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @SDL_Swap32(i32 %0) {
%2 = and i32 %0, 16777215
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = ashr i32 %0, 24
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
long Paeth(long, long, long);
long Paeth686(long a, long b, long c) { return (Paeth(a, b, c)); }


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

x86 assembly (clang, -O2):
<Paeth686>:
jmp    1030 <Paeth@plt>

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

LLVM IR (-O2):
define i64 @Paeth686(i64 %0, i64 %1, i64 %2) {
%4 = tail call i64 @Paeth(i64 %0, i64 %1, i64 %2)
ret i64 %4
}
/* Type definitions */
typedef enum auth_stat { ____Placeholder_auth_stat } auth_stat;

/* Variables and functions */
int AUTH_OK;
enum auth_stat _svcauth_null(void) { return (AUTH_OK); }


x86 assembly (clang, -O0):
<_svcauth_null>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eed(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_svcauth_null>:
mov    0x2ef1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@AUTH_OK = global i32 0
define i32 @_svcauth_null() {
%1 = load i32, i32* @AUTH_OK
ret i32 %1
}

LLVM IR (-O2):
@AUTH_OK = global i32 0
define i32 @_svcauth_null() {
%1 = load i32, i32* @AUTH_OK
ret i32 %1
}
/* Variables and functions */
double sin(double);
double smileDsp_sinc(double x) { return sin(x) / (x); }


x86 assembly (clang, -O0):
<smileDsp_sinc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
divsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smileDsp_sinc>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @smileDsp_sinc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sin(double %3)
%5 = load double, double* %2
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
define double @smileDsp_sinc(double %0) {
%2 = tail call double @sin(double %0)
%3 = fdiv double %2, %0
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ trainer_branch_1(int /*<<< orphan*/);
void trainer_branch_1_launcher(void) { trainer_branch_1(0); }


x86 assembly (clang, -O0):
<trainer_branch_1_launcher>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <trainer_branch_1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<trainer_branch_1_launcher>:
xor    %edi,%edi
jmp    1030 <trainer_branch_1@plt>

LLVM IR (-O0):
define void @trainer_branch_1_launcher() {
%1 = call i32 @trainer_branch_1(i32 0)
ret void
}

LLVM IR (-O2):
define void @trainer_branch_1_launcher() {
%1 = tail call i32 @trainer_branch_1(i32 0)
ret void
}
char *hash_plugin_summary(void) { return ("lm \t\tLM plugin"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"lm \09\09LM plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"lm \09\09LM plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void b() {
  printf("b"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [2 x i8] c"b\00"
define void @b() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t const);
void *malloc_or_die(const size_t sz) {
  void *mem;
  mem = malloc(sz);
  if (mem == NULL)
    exit(1);
  return mem;
}


x86 assembly (clang, -O0):
<malloc_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <malloc_or_die+0x2e>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_or_die>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     112d <malloc_or_die+0xd>
pop    %rcx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define noalias i8* @malloc_or_die(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ zero(int);
void one(int size) { zero(size); }


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

x86 assembly (clang, -O2):
<one>:
jmp    1030 <zero@plt>

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

LLVM IR (-O2):
define void @one(i32 %0) {
%2 = tail call i32 @zero(i32 %0)
ret void
}
/* Variables and functions */
int ceil(double);
int /*<<< orphan*/ getNumber(double *);
int techo(double a) {
  getNumber(&a);
  return ceil(a);
}


x86 assembly (clang, -O0):
<techo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <getNumber@plt>
movsd  -0x8(%rbp),%xmm0
call   1030 <ceil@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<techo>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1040 <getNumber@plt>
movsd  (%rsp),%xmm0
call   1030 <ceil@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @techo(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @getNumber(double* %2)
%4 = load double, double* %2
%5 = call i32 @ceil(double %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @techo(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @getNumber(double* %2)
%4 = load double, double* %2
%5 = call i32 @ceil(double %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ notimplemented(char *);
void __svgalib_driver16p_putboxmask(int x, int y, int w, int h, void *b) {
  {
    notimplemented("16-bit paged putboxmask");
    return;
  };
}


x86 assembly (clang, -O0):
<__svgalib_driver16p_putboxmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
lea    0xed1(%rip),%rdi
call   1030 <notimplemented@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"16-bit paged putboxmask\00"
define void @__svgalib_driver16p_putboxmask(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = call i32 @notimplemented(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"16-bit paged putboxmask\00"
define void @__svgalib_driver16p_putboxmask(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4) {
%6 = tail call i32 @notimplemented(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
void NoSoundDrv_PCM_Lock(void) {}


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

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

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

LLVM IR (-O2):
define void @NoSoundDrv_PCM_Lock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int strlen(char *);
int /*<<< orphan*/ strncat(char *, char *, int);
void strncat_symbolic_src_length(char *src) {
  char dst[8] = "1234";
  strncat(dst, src, 3);
  clang_analyzer_eval(strlen(dst) >= 4);
  char dst2[8] = "1234";
  strncat(dst2, src, 4);
}


x86 assembly (clang, -O0):
<strncat_symbolic_src_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x3,%edx
call   1040 <strncat@plt>
lea    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
mov    0xe87(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1040 <strncat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncat_symbolic_src_length>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
movq   $0x34333231,0x10(%rsp)
33 34
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1040 <strncat@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
cmp    $0x4,%eax
setge  %dil
call   1050 <clang_analyzer_eval@plt>
movq   $0x34333231,0x8(%rsp)
33 34
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1040 <strncat@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.strncat_symbolic_src_length.dst = [8 x i8] c"1234\00\00\00\00"
@__const.strncat_symbolic_src_length.dst2 = [8 x i8] c"1234\00\00\00\00"
define void @strncat_symbolic_src_length(i8* %0) {
%2 = alloca i8*
%3 = alloca [8 x i8]
%4 = alloca [8 x i8]
store i8* %0, i8** %2
%5 = bitcast [8 x i8]* %3 to i8*
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @strncat(i8* %6, i8* %7, i32 3)
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
%11 = icmp sge i32 %10, 4
%12 = zext i1 %11 to i32
%13 = call i32 @clang_analyzer_eval(i32 %12)
%14 = bitcast [8 x i8]* %4 to i8*
%15 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%16 = load i8*, i8** %2
%17 = call i32 @strncat(i8* %15, i8* %16, i32 4)
ret void
}

LLVM IR (-O2):
define void @strncat_symbolic_src_length(i8* %0) {
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i64* %2 to i8*
store i64 875770417, i64* %2
%5 = call i32 @strncat(i8* %4, i8* %0, i32 3)
%6 = call i32 @strlen(i8* %4)
%7 = icmp sgt i32 %6, 3
%8 = zext i1 %7 to i32
%9 = call i32 @clang_analyzer_eval(i32 %8)
%10 = bitcast i64* %3 to i8*
store i64 875770417, i64* %3
%11 = call i32 @strncat(i8* %10, i8* %0, i32 4)
ret void
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int get_constant(int /*<<< orphan*/);
int /*<<< orphan*/ next_word(char *);
int assemble_ld(char *line) {
  int constant = get_constant(next_word(line));
  if (constant != 0xffff)
    return 0x80 | (int8_t)constant;
  return -1;
}


x86 assembly (clang, -O0):
<assemble_ld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <next_word@plt>
mov    %eax,%edi
call   1040 <get_constant@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffff,-0x14(%rbp)
je     115c <assemble_ld+0x3c>
mov    -0x14(%rbp),%eax
or     $0x80,%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <assemble_ld+0x43>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assemble_ld>:
push   %rax
call   1030 <next_word@plt>
mov    %eax,%edi
call   1040 <get_constant@plt>
mov    %eax,%ecx
or     $0x80,%ecx
cmp    $0xffff,%eax
mov    $0xffffffff,%eax
cmovne %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @assemble_ld(i8* %0) {
%2 = tail call i32 @next_word(i8* %0)
%3 = tail call i32 @get_constant(i32 %2)
%4 = icmp eq i32 %3, 65535
%5 = or i32 %3, 128
%6 = select i1 %4, i32 -1, i32 %5
ret i32 %6
}
/* Type definitions */
struct module {
  int dummy;
};

/* Variables and functions */
double **module_getsym(struct module *, char const *);
int /*<<< orphan*/ printf(char *, char const *);
int testPtr(struct module *mod, const char *name, double *val) {
  double **ptr = module_getsym(mod, name);
  if (!ptr) {
    printf("ERROR: Can't find %s\n", name);
  }
  return *ptr == val;
}


x86 assembly (clang, -O0):
<testPtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <module_getsym@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1160 <testPtr+0x40>
mov    -0x10(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testPtr>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
call   1030 <module_getsym@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1147 <testPtr+0x27>
lea    0xec1(%rip),%rdi
mov    %r15,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
cmp    %r14,(%rbx)
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.module = type { i32 }
@.str = [22 x i8] c"ERROR: Can't find %s\0A\00"
define i32 @testPtr(%struct.module* %0, i8* %1, double* %2) {
%4 = alloca %struct.module*
%5 = alloca i8*
%6 = alloca double*
%7 = alloca double**
store %struct.module* %0, %struct.module** %4
store i8* %1, i8** %5
store double* %2, double** %6
%8 = load %struct.module*, %struct.module** %4
%9 = load i8*, i8** %5
%10 = call double** @module_getsym(%struct.module* %8, i8* %9)
store double** %10, double*** %7
%11 = load double**, double*** %7
%12 = icmp ne double** %11, null
br i1 %12, label %16, label %13
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %13, %3
%17 = load double**, double*** %7
%18 = load double*, double** %17
%19 = load double*, double** %6
%20 = icmp eq double* %18, %19
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
%struct.module = type { i32 }
@.str = [22 x i8] c"ERROR: Can't find %s\0A\00"
define i32 @testPtr(%struct.module* %0, i8* %1, double* readnone %2) {
%4 = tail call double** @module_getsym(%struct.module* %0, i8* %1)
%5 = icmp eq double** %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %8
8: ; preds = %6, %3
%9 = load double*, double** %4
%10 = icmp eq double* %9, %2
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void muxPrepareInt(unsigned char *buf, int32_t i) {
  buf[0] = i >> 24;
  buf[1] = (i >> 16) & 0xFF;
  buf[2] = (i >> 8) & 0xFF;
  buf[3] = i & 0xFF;
}


x86 assembly (clang, -O0):
<muxPrepareInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<muxPrepareInt>:
bswap  %esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @muxPrepareInt(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 24
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i32, i32* %4
%17 = ashr i32 %16, 8
%18 = and i32 %17, 255
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 %19, i8* %21
%22 = load i32, i32* %4
%23 = and i32 %22, 255
%24 = trunc i32 %23 to i8
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 3
store i8 %24, i8* %26
ret void
}

LLVM IR (-O2):
define void @muxPrepareInt(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
short printNumber(unsigned long, int);
short printNumber_UI(unsigned int n, int base) {
  return printNumber((unsigned long)n, base);
}


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

x86 assembly (clang, -O2):
<printNumber_UI>:
mov    %edi,%edi
jmp    1030 <printNumber@plt>

LLVM IR (-O0):
define signext i16 @printNumber_UI(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 = zext i32 %5 to i64
%7 = load i32, i32* %4
%8 = call signext i16 @printNumber(i64 %6, i32 %7)
ret i16 %8
}

LLVM IR (-O2):
define signext i16 @printNumber_UI(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = tail call signext i16 @printNumber(i64 %3, i32 %1)
ret i16 %4
}
int ipc_server(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @ipc_server() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void alarm_handler(int signo) {
  fprintf(stderr, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/GinjaNinja32/otp/refs/"
                  "heads/maint/erts/test/erlexec_SUITE_data/erlexec_tests.c"
                  " self terminating after timeout\n");
  exit(1);
}


x86 assembly (clang, -O0):
<alarm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<alarm_handler>:
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 = [201 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/GinjaNinja32/otp/refs/heads/maint/erts/test/erlexec_SUITE_data/erlexec_tests.c self terminating after timeout\0A\00"
define void @alarm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [201 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/GinjaNinja32/otp/refs/heads/maint/erts/test/erlexec_SUITE_data/erlexec_tests.c self terminating after timeout\0A\00"
define void @alarm_handler(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}