xunge/DecIR huggingface dataset:
/* Variables and functions */
int ischan(char *chan) {
  if (chan == NULL)
    return 0;
  if (chan[0] == '#' || chan[0] == '+' || chan[0] == '&' || chan[0] == '!')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<ischan>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <ischan+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1172 <ischan+0x72>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
je     115f <ischan+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
je     115f <ischan+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x26,%eax
je     115f <ischan+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x21,%eax
jne    116b <ischan+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    1172 <ischan+0x72>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ischan>:
xor    %eax,%eax
test   %rdi,%rdi
je     1125 <ischan+0x25>
movzbl (%rdi),%ecx
cmp    $0x2b,%rcx
ja     1126 <ischan+0x26>
mov    $0x1,%eax
movabs $0x84a00000000,%rdx
bt     %rcx,%rdx
jae    1126 <ischan+0x26>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ischan(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %33
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 35
br i1 %12, label %31, label %13
13: ; preds = %7
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 43
br i1 %18, label %31, label %19
19: ; preds = %13
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 38
br i1 %24, label %31, label %25
25: ; preds = %19
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 0
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 33
br i1 %30, label %31, label %32
31: ; preds = %25, %19, %13, %7
store i32 1, i32* %2
br label %33
32: ; preds = %25
store i32 0, i32* %2
br label %33
33: ; preds = %32, %31, %6
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @ischan(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8, i8* %0
switch i8 %4, label %5 [
i8 35, label %6
i8 43, label %6
i8 38, label %6
i8 33, label %6
]
5: ; preds = %3
br label %6
6: ; preds = %3, %3, %3, %3, %1, %5
%7 = phi i32 [ 0, %5 ], [ 0, %1 ], [ 1, %3 ], [ 1, %3 ], [ 1, %3 ], [ 1, %3 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int fstat64(int fildes, void *buf) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<fstat64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstat64>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fstat64(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fstat64(i32 %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ printf(char *);
void clearfile(char *path) {
  FILE *pOutfile = fopen(path, "w");
  if (pOutfile == NULL) {
    printf("Error opening file!\n");
    exit(1);
  }
  fprintf(pOutfile, "%s", "");
  fclose(pOutfile);
}


x86 assembly (clang, -O0):
<clearfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1191 <clearfile+0x41>
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rdi
lea    0xe7b(%rip),%rsi
lea    0xe73(%rip),%rdx
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearfile>:
push   %rax
lea    0xeb8(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     115b <clearfile+0x1b>
mov    %rax,%rdi
pop    %rax
jmp    1040 <fclose@plt>
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [21 x i8] c"Error opening file!\0A\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [1 x i8] zeroinitializer
define void @clearfile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i32*, i32** %3
%13 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%14 = load i32*, i32** %3
%15 = call i32 @fclose(i32* %14)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@str = [20 x i8] c"Error opening file!\00"
define void @clearfile(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = tail call i32 @fclose(i32* %2)
ret void
}
/* Variables and functions */
int execve_wrapper(char *, char const *, char *const *, char *const *);
int __execve(const char *path, char *const argv[], char *const envp[]) {
  return execve_wrapper("__execve", path, argv, envp);
}


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

x86 assembly (clang, -O2):
<__execve>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
jmp    1030 <execve_wrapper@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"__execve\00"
define i32 @__execve(i8* %0, i8** %1, i8** %2) {
%4 = tail call i32 @execve_wrapper(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i8** %1, i8** %2)
ret i32 %4
}
/* Variables and functions */
char menu();
int /*<<< orphan*/ przyklad();
int /*<<< orphan*/ wypisanie();
int main(void) {
  char wyb = 0;
  while (wyb != 'k') {
    wyb = menu();
    switch (wyb) {
    case 'w':
    case 'W':
      wypisanie();
      break;
    case 'p':
    case 'P':
      przyklad();
      break;
    default:
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x6b,%eax
je     11a6 <main+0x76>
xor    %eax,%eax
call   1050 <menu@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffb0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x27,%eax
ja     119c <main+0x6c>
mov    -0x10(%rbp),%rax
lea    0xe85(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1040 <wypisanie@plt>
jmp    11a1 <main+0x71>
mov    $0x0,%al
call   1030 <przyklad@plt>
jmp    11a1 <main+0x71>
jmp    11a1 <main+0x71>
jmp    1143 <main+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
jmp    114c <main+0x1c>
nopl   (%rax)
xor    %eax,%eax
call   1030 <przyklad@plt>
cmp    $0x6b,%bl
je     1172 <main+0x42>
xor    %eax,%eax
call   1050 <menu@plt>
mov    %eax,%ebx
movsbl %al,%eax
add    $0xffffffb0,%eax
cmp    $0x27,%eax
ja     1147 <main+0x17>
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
xor    %eax,%eax
call   1040 <wypisanie@plt>
jmp    1147 <main+0x17>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 0, i8* %2
br label %3
3: ; preds = %16, %0
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 107
br i1 %6, label %7, label %17
7: ; preds = %3
%8 = call signext i8 (...) @menu()
store i8 %8, i8* %2
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
switch i32 %10, label %15 [
i32 119, label %11
i32 87, label %11
i32 112, label %13
i32 80, label %13
]
11: ; preds = %7, %7
%12 = call i32 (...) @wypisanie()
br label %16
13: ; preds = %7, %7
%14 = call i32 (...) @przyklad()
br label %16
15: ; preds = %7
br label %16
16: ; preds = %15, %13, %11
br label %3
17: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %8
%2 = tail call signext i8 (...) @menu()
%3 = sext i8 %2 to i32
switch i32 %3, label %8 [
i32 119, label %4
i32 87, label %4
i32 112, label %6
i32 80, label %6
]
4: ; preds = %1, %1
%5 = tail call i32 (...) @wypisanie()
br label %8
6: ; preds = %1, %1
%7 = tail call i32 (...) @przyklad()
br label %8
8: ; preds = %1, %6, %4
%9 = icmp eq i8 %2, 107
br i1 %9, label %10, label %1
10: ; preds = %8
ret i32 0
}
void AONRTCEnable(void) {
  (*((volatile unsigned long
          *)(((unsigned long)(0x40092000 + 0x00000000) & 0xF0000000) |
             0x02000000 |
             (((unsigned long)(0x40092000 + 0x00000000) & 0x000FFFFF) << 5) |
             ((0) << 2)))) = 1;
}


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

x86 assembly (clang, -O2):
<AONRTCEnable>:
movq   $0x1,0x43240000
ret

LLVM IR (-O0):
define void @AONRTCEnable() {
store volatile i64 1, i64* inttoptr (i64 1126432768 to i64*)
ret void
}

LLVM IR (-O2):
define void @AONRTCEnable() {
store volatile i64 1, i64* inttoptr (i64 1126432768 to i64*)
ret void
}
void MainThread() {
  int i;
  for (i = 0; i < 4; i++) {
  }
  return;
}


x86 assembly (clang, -O0):
<MainThread>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    1128 <MainThread+0x28>
jmp    111a <MainThread+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <MainThread+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @MainThread() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int fork();
int /*<<< orphan*/ wait(int *);
int main(int argc, char **argv) {
  int pid, status;
  pid = fork();
  switch (pid) {
  case -1:
    exit(-1);
  case 0:
  default:
    wait(&status);
  }
  exit(0);
}


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)
xor    %eax,%eax
call   1050 <fork@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0xffffffff,%eax
je     1174 <main+0x44>
jmp    1164 <main+0x34>
mov    -0x1c(%rbp),%eax
test   %eax,%eax
je     117e <main+0x4e>
jmp    1183 <main+0x53>
mov    $0xffffffff,%edi
call   1030 <exit@plt>
jmp    1183 <main+0x53>
lea    -0x18(%rbp),%rdi
call   1040 <wait@plt>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
cmp    $0xffffffff,%eax
jne    1147 <main+0x17>
mov    $0xffffffff,%edi
call   1030 <exit@plt>
lea    0x4(%rsp),%rdi
call   1040 <wait@plt>
xor    %edi,%edi
call   1030 <exit@plt>

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 (...) @fork()
store i32 %8, i32* %6
%9 = load i32, i32* %6
switch i32 %9, label %13 [
i32 -1, label %10
i32 0, label %12
]
10: ; preds = %2
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %2
br label %13
13: ; preds = %2, %12
%14 = call i32 @wait(i32* %7)
br label %15
15: ; preds = %13
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (...) @fork()
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %2
%10 = call i32 @wait(i32* %3)
%11 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ strerr_die(int, char *, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
void usage(void) {
  strerr_die((100), ("tcprules: usage: tcprules rules.cdb rules.tmp"), 0, 0, 0,
             0, 0, 0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
lea    0xedc(%rip),%rsi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <strerr_die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x64,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1030 <strerr_die@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [46 x i8] c"tcprules: usage: tcprules rules.cdb rules.tmp\00"
define void @usage() {
%1 = call i32 @strerr_die(i32 100, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"tcprules: usage: tcprules rules.cdb rules.tmp\00"
define void @usage() {
%1 = tail call i32 @strerr_die(i32 100, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
scalar_t__ strcmp(char const *, char *);
void panic_print_str(const char *str) {
  if (strcmp(str, "Backtrace:") != 0)
    printf("%s", str);
}


x86 assembly (clang, -O0):
<panic_print_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1156 <panic_print_str+0x36>
mov    -0x8(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<panic_print_str>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1145 <panic_print_str+0x25>
lea    0xecf(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Backtrace:\00"
@.str.1 = [3 x i8] c"%s\00"
define void @panic_print_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Backtrace:\00"
@.str.1 = [3 x i8] c"%s\00"
define void @panic_print_str(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(char *);
void print_space() { write(" "); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ es6(float *, int);
int main() {
  float array[] = {35.4, 46.7, 77.55, 11.1, 9.04, 0.75};
  es6(array, sizeof(array) / sizeof(array[0]));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1030 <es6@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1030 <es6@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [6 x float] [float 0x4041B33340000000, float 0x40475999A0000000, float 0x4053633340000000, float 0x4026333340000000, float 0x4022147AE0000000, float 7.500000e-01]
define i32 @main() {
%1 = alloca [6 x float]
%2 = bitcast [6 x float]* %1 to i8*
%3 = getelementptr inbounds [6 x float], [6 x float]* %1, i64 0, i64 0
%4 = call i32 @es6(float* %3, i32 6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [6 x float] [float 0x4041B33340000000, float 0x40475999A0000000, float 0x4053633340000000, float 0x4026333340000000, float 0x4022147AE0000000, float 7.500000e-01]
define i32 @main() {
%1 = alloca [6 x float]
%2 = bitcast [6 x float]* %1 to i8*
%3 = getelementptr inbounds [6 x float], [6 x float]* %1, i64 0, i64 0
%4 = call i32 @es6(float* %3, i32 6)
ret i32 0
}
int spemonth(int month) {
  int mday[7] = {1, 3, 5, 7, 8, 10, 12};
  int i;
  for (i = 0; i < 7; i++) {
    if (mday[i] == month)
      return 31;
  }
  return 30;
}


x86 assembly (clang, -O0):
<spemonth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeef(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeec(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeea(%rip),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x7,-0x34(%rbp)
jge    1172 <spemonth+0x72>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
cmp    -0x8(%rbp),%eax
jne    115f <spemonth+0x5f>
movl   $0x1f,-0x4(%rbp)
jmp    1179 <spemonth+0x79>
jmp    1164 <spemonth+0x64>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1138 <spemonth+0x38>
movl   $0x1e,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spemonth>:
add    $0xffffffff,%edi
mov    $0x1e,%eax
cmp    $0xb,%edi
ja     111a <spemonth+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@__const.spemonth.mday = [7 x i32] [i32 1, i32 3, i32 5, i32 7, i32 8, i32 10, i32 12]
define i32 @spemonth(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [7 x i32]
%5 = alloca i32
store i32 %0, i32* %3
%6 = bitcast [7 x i32]* %4 to i8*
store i32 0, i32* %5
br label %7
7: ; preds = %19, %1
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 7
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [7 x i32], [7 x i32]* %4, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = load i32, i32* %3
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %10
store i32 31, i32* %2
br label %23
18: ; preds = %10
br label %19
19: ; preds = %18
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %7
22: ; preds = %7
store i32 30, i32* %2
br label %23
23: ; preds = %22, %17
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
@switch.table.spemonth = [12 x i32] [i32 31, i32 30, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31]
define i32 @spemonth(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 12
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [12 x i32], [12 x i32]* @switch.table.spemonth, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 30, %1 ]
ret i32 %9
}
int test_c2i(char c) { return (int)c; }


x86 assembly (clang, -O0):
<test_c2i>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_c2i(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @test_c2i(i8 signext %0) {
%2 = sext i8 %0 to i32
ret i32 %2
}
void UARTAddressSet(unsigned long ulBase, unsigned long ulAddress) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000010))) &= ~0x0000000F;
  (*((volatile unsigned long *)(ulBase + 0x00000010))) |= ulAddress;
}


x86 assembly (clang, -O0):
<UARTAddressSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rcx,0x10(%rax)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTAddressSet>:
andq   $0xfffffffffffffff0,0x10(%rdi)
or     %rsi,0x10(%rdi)
ret

LLVM IR (-O0):
define void @UARTAddressSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 16
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, -16
store volatile i64 %9, i64* %7
%10 = load i64, i64* %4
%11 = load i64, i64* %3
%12 = add i64 %11, 16
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = or i64 %14, %10
store volatile i64 %15, i64* %13
ret void
}

LLVM IR (-O2):
define void @UARTAddressSet(i64 %0, i64 %1) {
%3 = add i64 %0, 16
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -16
store volatile i64 %6, i64* %4
%7 = load volatile i64, i64* %4
%8 = or i64 %7, %1
store volatile i64 %8, i64* %4
ret void
}
void *xmalloc(size)
int size;
{
  void *result = (void *)malloc(size);
  if (!result)
    fatal("Malloc failed");
  return result;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1151 <xmalloc+0x31>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
movslq %edi,%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xmalloc+0x1f>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Malloc failed\00"
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [14 x i8] c"Malloc failed\00"
define i8* @xmalloc(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ screen_load();
int /*<<< orphan*/ screen_save();
int /*<<< orphan*/ show_scores();
void death_scores(void *unused, const char *title) {
  (void)unused;
  (void)title;
  screen_save();
  show_scores();
  screen_load();
}


x86 assembly (clang, -O0):
<death_scores>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <screen_save@plt>
mov    $0x0,%al
call   1050 <show_scores@plt>
mov    $0x0,%al
call   1030 <screen_load@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<death_scores>:
push   %rax
xor    %eax,%eax
call   1040 <screen_save@plt>
xor    %eax,%eax
call   1050 <show_scores@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <screen_load@plt>

LLVM IR (-O0):
define void @death_scores(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (...) @screen_save()
%8 = call i32 (...) @show_scores()
%9 = call i32 (...) @screen_load()
ret void
}

LLVM IR (-O2):
define void @death_scores(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @screen_save()
%4 = tail call i32 (...) @show_scores()
%5 = tail call i32 (...) @screen_load()
ret void
}
/* Variables and functions */
int njShowBits(int);
int /*<<< orphan*/ njSkipBits(int);
int njGetBits(int bits) {
  int res = njShowBits(bits);
  njSkipBits(bits);
  return res;
}


x86 assembly (clang, -O0):
<njGetBits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <njShowBits@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <njSkipBits@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<njGetBits>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <njShowBits@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <njSkipBits@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @njGetBits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @njShowBits(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = call i32 @njSkipBits(i32 %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @njGetBits(i32 %0) {
%2 = tail call i32 @njShowBits(i32 %0)
%3 = tail call i32 @njSkipBits(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void key_quit() { exit(EXIT_SUCCESS); }


x86 assembly (clang, -O0):
<key_quit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<key_quit>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @key_quit() {
%1 = load i32, i32* @EXIT_SUCCESS
%2 = call i32 @exit(i32 %1)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @key_quit() {
%1 = load i32, i32* @EXIT_SUCCESS
%2 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ HUP(double *, int *, int *, int, int *);
void HINSERT(double HA[], int HJ[], int HK[], int N, double V, int JV,
             int *HOPS) {
  HA[N] = V;
  HJ[N] = JV;
  HK[JV] = N;
  HUP(HA, HJ, HK, N, HOPS);
}


x86 assembly (clang, -O0):
<HINSERT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    %r9,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x38(%rbp),%r8
call   1030 <HUP@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HINSERT>:
movslq %ecx,%rcx
movsd  %xmm0,(%rdi,%rcx,8)
mov    %r8d,(%rsi,%rcx,4)
movslq %r8d,%rax
mov    %ecx,(%rdx,%rax,4)
mov    %r9,%r8
jmp    1030 <HUP@plt>

LLVM IR (-O0):
define void @HINSERT(double* %0, i32* %1, i32* %2, i32 %3, double %4, i32 %5, i32* %6) {
%8 = alloca double*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca double
%13 = alloca i32
%14 = alloca i32*
store double* %0, double** %8
store i32* %1, i32** %9
store i32* %2, i32** %10
store i32 %3, i32* %11
store double %4, double* %12
store i32 %5, i32* %13
store i32* %6, i32** %14
%15 = load double, double* %12
%16 = load double*, double** %8
%17 = load i32, i32* %11
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %16, i64 %18
store double %15, double* %19
%20 = load i32, i32* %13
%21 = load i32*, i32** %9
%22 = load i32, i32* %11
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
store i32 %20, i32* %24
%25 = load i32, i32* %11
%26 = load i32*, i32** %10
%27 = load i32, i32* %13
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %26, i64 %28
store i32 %25, i32* %29
%30 = load double*, double** %8
%31 = load i32*, i32** %9
%32 = load i32*, i32** %10
%33 = load i32, i32* %11
%34 = load i32*, i32** %14
%35 = call i32 @HUP(double* %30, i32* %31, i32* %32, i32 %33, i32* %34)
ret void
}

LLVM IR (-O2):
define void @HINSERT(double* %0, i32* %1, i32* %2, i32 %3, double %4, i32 %5, i32* %6) {
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds double, double* %0, i64 %8
store double %4, double* %9
%10 = getelementptr inbounds i32, i32* %1, i64 %8
store i32 %5, i32* %10
%11 = sext i32 %5 to i64
%12 = getelementptr inbounds i32, i32* %2, i64 %11
store i32 %3, i32* %12
%13 = tail call i32 @HUP(double* %0, i32* %1, i32* %2, i32 %3, i32* %6)
ret void
}
int cmgr_mmap_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cmgr_mmap_init() {
ret i32 0
}
void test_fopen() {}


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

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

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

LLVM IR (-O2):
define void @test_fopen() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *thread_function(void *thread_arg) {
  while (1)
    fprintf(stderr, "x");
  return NULL;
}


x86 assembly (clang, -O0):
<thread_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
jmp    111c <thread_function+0xc>

x86 assembly (clang, -O2):
<thread_function>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%r14
lea    0xede(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14),%edi
mov    %rbx,%rsi
call   1030 <fprintf@plt>
jmp    1130 <thread_function+0x20>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [2 x i8] c"x\00"
define i8* @thread_function(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %3
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"x\00"
define noalias i8* @thread_function(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %2
}
/* Variables and functions */
int funca();
int funcb();
int funcc();
int main(int argc, char **argv) { return funca() + funcb() + funcc(); }


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   1030 <funca@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <funcb@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <funcc@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <funca@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <funcb@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1040 <funcc@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
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 (...) @funca()
%7 = call i32 (...) @funcb()
%8 = add nsw i32 %6, %7
%9 = call i32 (...) @funcc()
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @funca()
%4 = tail call i32 (...) @funcb()
%5 = add nsw i32 %4, %3
%6 = tail call i32 (...) @funcc()
%7 = add nsw i32 %5, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
scalar_t__ fgetc(int /*<<< orphan*/ *);
int get_file_size(FILE *ifp) {
  int counter = 0;
  while (1) {
    if (fgetc(ifp) == EOF) {
      break;
    }
    counter++;
  }
  return counter;
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    0x2eb5(%rip),%rcx
cmp    (%rcx),%rax
jne    1141 <get_file_size+0x31>
jmp    114f <get_file_size+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <get_file_size+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0xffffffff,%ebx
mov    0x2ec4(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <fgetc@plt>
add    $0x1,%ebx
cmp    (%r15),%rax
jne    1130 <get_file_size+0x20>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i64 0
define i32 @get_file_size(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %1, %10
%5 = load i32*, i32** %2
%6 = call i64 @fgetc(i32* %5)
%7 = load i64, i64* @EOF
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %4
br label %13
10: ; preds = %4
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i64 0
define i32 @get_file_size(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %7, %2 ]
%4 = tail call i64 @fgetc(i32* %0)
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
%7 = add nuw nsw i32 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ e_ora();
int /*<<< orphan*/ e_zp();
void e_ora_zp() {
  e_zp();
  e_ora();
}


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

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

LLVM IR (-O0):
define void @e_ora_zp() {
%1 = call i32 (...) @e_zp()
%2 = call i32 (...) @e_ora()
ret void
}

LLVM IR (-O2):
define void @e_ora_zp() {
%1 = tail call i32 (...) @e_zp()
%2 = tail call i32 (...) @e_ora()
ret void
}
int CONFIG_WriteChar(const char *FileName, const char *ConfName, char Value) {
  return 42;
}


x86 assembly (clang, -O0):
<CONFIG_WriteChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    $0x2a,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @CONFIG_WriteChar(i8* %0, i8* %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8 %2, i8* %6
ret i32 42
}

LLVM IR (-O2):
define i32 @CONFIG_WriteChar(i8* nocapture readnone %0, i8* nocapture readnone %1, i8 signext %2) {
ret i32 42
}
/* Variables and functions */
char *ft_itoa(int);
int /*<<< orphan*/ ft_putstr_fd(char *, int);
int /*<<< orphan*/ ft_strdel(char **);
void ft_putnbr_fd(int n, int fd) {
  char *ptr;
  ptr = ft_itoa(n);
  ft_putstr_fd(ptr, fd);
  ft_strdel(&ptr);
}


x86 assembly (clang, -O0):
<ft_putnbr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ft_itoa@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <ft_putstr_fd@plt>
lea    -0x10(%rbp),%rdi
call   1040 <ft_strdel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr_fd>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
call   1030 <ft_itoa@plt>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
mov    %ebx,%esi
call   1050 <ft_putstr_fd@plt>
lea    0x8(%rsp),%rdi
call   1040 <ft_strdel@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @ft_putnbr_fd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i8* @ft_itoa(i32 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i32, i32* %4
%10 = call i32 @ft_putstr_fd(i8* %8, i32 %9)
%11 = call i32 @ft_strdel(i8** %5)
ret void
}

LLVM IR (-O2):
define void @ft_putnbr_fd(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = tail call i8* @ft_itoa(i32 %0)
store i8* %5, i8** %3
%6 = tail call i32 @ft_putstr_fd(i8* %5, i32 %1)
%7 = call i32 @ft_strdel(i8** %3)
ret void
}
int sd_notify_supported(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sd_notify_supported() {
ret i32 0
}
void foo5e() {}


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

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

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

LLVM IR (-O2):
define void @foo5e() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void aligned_free(void *ptr) {
  int *ptr2 = (int *)ptr - 2;
  free(((char *)ptr - *ptr2));
}


x86 assembly (clang, -O0):
<aligned_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq (%rax),%rcx
xor    %eax,%eax
sub    %rcx,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aligned_free>:
movslq -0x8(%rdi),%rax
sub    %rax,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @aligned_free(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = getelementptr inbounds i32, i32* %5, i64 -2
store i32* %6, i32** %3
%7 = load i8*, i8** %2
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = sub i64 0, %10
%12 = getelementptr inbounds i8, i8* %7, i64 %11
%13 = call i32 @free(i8* %12)
ret void
}

LLVM IR (-O2):
define void @aligned_free(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -8
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = sub nsw i64 0, %5
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = tail call i32 @free(i8* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void writeerr() { fprintf(stderr, "error writing output file"); }


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

x86 assembly (clang, -O2):
<writeerr>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"error writing output file\00"
define void @writeerr() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"error writing output file\00"
define void @writeerr() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
int sort_room(char *database, int (*compare)(const void *x, const void *y)) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @sort_room(i8* nocapture readnone %0, i32 (i8*, i8*)* nocapture readnone %1) {
ret i32 0
}
void debugpins_frame_toggle() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @getParamNumber() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lock_atom_add();
int /*<<< orphan*/ unlock_atom_add();
unsigned long long atomicAdd(unsigned long long *addr, long long value) {
  long long ret;
  lock_atom_add();
  ret = *addr;
  *addr += value;
  unlock_atom_add();
  return ret;
}


x86 assembly (clang, -O0):
<atomicAdd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <lock_atom_add@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    $0x0,%al
call   1040 <unlock_atom_add@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomicAdd>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <lock_atom_add@plt>
mov    (%r14),%r15
add    %r15,%rbx
mov    %rbx,(%r14)
xor    %eax,%eax
call   1040 <unlock_atom_add@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @atomicAdd(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%6 = call i32 (...) @lock_atom_add()
%7 = load i64*, i64** %3
%8 = load i64, i64* %7
store i64 %8, i64* %5
%9 = load i64, i64* %4
%10 = load i64*, i64** %3
%11 = load i64, i64* %10
%12 = add i64 %11, %9
store i64 %12, i64* %10
%13 = call i32 (...) @unlock_atom_add()
%14 = load i64, i64* %5
ret i64 %14
}

LLVM IR (-O2):
define i64 @atomicAdd(i64* nocapture %0, i64 %1) {
%3 = tail call i32 (...) @lock_atom_add()
%4 = load i64, i64* %0
%5 = add i64 %4, %1
store i64 %5, i64* %0
%6 = tail call i32 (...) @unlock_atom_add()
ret i64 %4
}
void foo_1_2_1_1_2_2_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_1_2_2_1_2_2() {
ret void
}
void fatalBreakPoint(void) { ; }


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

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

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

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