xunge/DecIR huggingface dataset:
int foo2(int i) {
  int j = 0;
  switch (i) {
  case 1:
    j = 2;
    break;
  case 2 ... 10:
    j = 3;
    break;
  default:
    j = 42;
    break;
  }
  j = j + 1;
  return j;
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1136 <foo2+0x36>
jmp    1122 <foo2+0x22>
mov    -0xc(%rbp),%eax
add    $0xfffffffe,%eax
sub    $0x9,%eax
jb     1142 <foo2+0x42>
jmp    114e <foo2+0x4e>
movl   $0x2,-0x8(%rbp)
jmp    1155 <foo2+0x55>
movl   $0x3,-0x8(%rbp)
jmp    1155 <foo2+0x55>
movl   $0x2a,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %7 [
i32 1, label %5
i32 2, label %6
i32 3, label %6
i32 4, label %6
i32 5, label %6
i32 6, label %6
i32 7, label %6
i32 8, label %6
i32 9, label %6
i32 10, label %6
]
5: ; preds = %1
store i32 2, i32* %3
br label %8
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 3, i32* %3
br label %8
7: ; preds = %1
store i32 42, i32* %3
br label %8
8: ; preds = %7, %6, %5
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@switch.table.foo2 = [10 x i32] [i32 3, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4]
define i32 @foo2(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 10
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [10 x i32], [10 x i32]* @switch.table.foo2, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 43, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ canonicalize_pathname(char *);
char *g_strdup(char const *);
char *vfs_canon(const char *path) {
  char *p = g_strdup(path);
  canonicalize_pathname(p);
  return p;
}


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

x86 assembly (clang, -O2):
<vfs_canon>:
push   %rbx
call   1030 <g_strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <canonicalize_pathname@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @vfs_canon(i8* %0) {
%2 = tail call i8* @g_strdup(i8* %0)
%3 = tail call i32 @canonicalize_pathname(i8* %2)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ c_interface();
int main() { c_interface(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <c_interface@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @c_interface()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @c_interface()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void aligned_free(void *ptr) { free((char *)ptr - *((size_t *)ptr - 1)); }


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

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

LLVM IR (-O0):
define void @aligned_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
%6 = getelementptr inbounds i64, i64* %5, i64 -1
%7 = load i64, i64* %6
%8 = sub i64 0, %7
%9 = getelementptr inbounds i8, i8* %3, i64 %8
%10 = call i32 @free(i8* %9)
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 i64*
%4 = load i64, i64* %3
%5 = sub i64 0, %4
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = tail call i32 @free(i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_arglist(void) {
  fprintf(stderr, "Usage: snowball <file> [options]\n\n"
                  "options are: [-o[utput] file]\n"
                  "             [-s[yntax]]\n"
                  "             [-j[ava]]\n"
                  "             [-c++]\n"
                  "             [-w[idechars]]\n"
                  "             [-u[tf8]]\n"
                  "             [-n[ame] class name]\n"
                  "             [-ep[refix] string]\n"
                  "             [-vp[refix] string]\n"
                  "             [-i[nclude] directory]\n"
                  "             [-r[untime] path to runtime headers]\n"
                  "             [-p[arentclassname] parent class name]\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<print_arglist>:
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 = [422 x i8] c"Usage: snowball <file> [options]\0A\0Aoptions are: [-o[utput] file]\0A [-s[yntax]]\0A [-j[ava]]\0A [-c++]\0A [-w[idechars]]\0A [-u[tf8]]\0A [-n[ame] class name]\0A [-ep[refix] string]\0A [-vp[refix] string]\0A [-i[nclude] directory]\0A [-r[untime] path to runtime headers]\0A [-p[arentclassname] parent class name]\0A\00"
define void @print_arglist() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([422 x i8], [422 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [422 x i8] c"Usage: snowball <file> [options]\0A\0Aoptions are: [-o[utput] file]\0A [-s[yntax]]\0A [-j[ava]]\0A [-c++]\0A [-w[idechars]]\0A [-u[tf8]]\0A [-n[ame] class name]\0A [-ep[refix] string]\0A [-vp[refix] string]\0A [-i[nclude] directory]\0A [-r[untime] path to runtime headers]\0A [-p[arentclassname] parent class name]\0A\00"
define void @print_arglist() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([422 x i8], [422 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ crt_scroll_down();
void console_scroll_down() { crt_scroll_down(); }


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

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

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

LLVM IR (-O2):
define void @console_scroll_down() {
%1 = tail call i32 (...) @crt_scroll_down()
ret void
}
void rot32_sem() { int aux; }


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

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

LLVM IR (-O0):
define void @rot32_sem() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @rot32_sem() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() { system("/usr/bin/pkill --signal SIGHUP --exact openvpn"); }


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"/usr/bin/pkill --signal SIGHUP --exact openvpn\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"/usr/bin/pkill --signal SIGHUP --exact openvpn\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rec(int);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int n;
  scanf("%d", &n);
  printf("%d", rec(n));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1050 <rec@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
call   1050 <rec@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @rec(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
int array_length(char **strings) {
  int i;
  if (!strings)
    return 0;
  i = 0;
  for (; strings[i]; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<array_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <array_length+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1152 <array_length+0x52>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     114c <array_length+0x4c>
jmp    113e <array_length+0x3e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <array_length+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_length>:
test   %rdi,%rdi
je     111e <array_length+0x1e>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <array_length+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @array_length(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
void argv_destroy(char **argv) {
  int i;
  if (!argv)
    return;
  for (i = 0; argv[i]; i++)
    free(argv[i]);
  free(argv);
}


x86 assembly (clang, -O0):
<argv_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <argv_destroy+0x1c>
jmp    116e <argv_destroy+0x5e>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1165 <argv_destroy+0x55>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <argv_destroy+0x23>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argv_destroy>:
test   %rdi,%rdi
je     1150 <argv_destroy+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <argv_destroy+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <argv_destroy+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @argv_destroy(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %11, %6 ], [ %4, %3 ]
tail call void @free(i8* %8)
%9 = add nuw nsw i64 %7, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3
%14 = bitcast i8** %0 to i8*
tail call void @free(i8* %14)
br label %15
15: ; preds = %1, %13
ret void
}
__attribute__((always_)) int notifier_to_errno(int ret) {
  ret &= ~0x8000;
  return ret > 0x0001 ? 0x0001 - ret : 0;
}


x86 assembly (clang, -O0):
<notifier_to_errno>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff7fff,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    112c <notifier_to_errno+0x2c>
mov    $0x1,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <notifier_to_errno+0x36>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <notifier_to_errno+0x36>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<notifier_to_errno>:
and    $0xffff7fff,%edi
mov    $0x1,%ecx
sub    %edi,%ecx
xor    %eax,%eax
cmp    $0x2,%edi
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @notifier_to_errno(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -32769
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 1, %8
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %7
%12 = phi i32 [ %9, %7 ], [ 0, %10 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @notifier_to_errno(i32 %0) {
%2 = and i32 %0, -32769
%3 = icmp sgt i32 %2, 1
%4 = sub nsw i32 1, %2
%5 = select i1 %3, i32 %4, i32 0
ret i32 %5
}
int tcflush(int fildes, int queue_selector) {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<tcflush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %edi,%edi
lea    0xed9(%rip),%rsi
lea    0xee4(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
jmp    1135 <tcflush+0x25>

x86 assembly (clang, -O2):
<tcflush>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
nopl   0x0(%rax,%rax,1)
jmp    1130 <tcflush+0x20>

LLVM IR (-O0):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.tcflush = [8 x i8] c"tcflush\00"
define i32 @tcflush(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.tcflush, i64 0, i64 0))
br label %6
6: ; preds = %2, %6
br label %6
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.tcflush = [8 x i8] c"tcflush\00"
define i32 @tcflush(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.tcflush, i64 0, i64 0))
br label %4
4: ; preds = %2, %4
br label %4
}
int spaceship2(long a) { return a > 0 ? 1 : a == 0 ? 0 : -1; }


x86 assembly (clang, -O0):
<spaceship2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1120 <spaceship2+0x20>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <spaceship2+0x35>
mov    -0x8(%rbp),%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spaceship2>:
xor    %ecx,%ecx
test   %rdi,%rdi
setne  %cl
neg    %ecx
test   %rdi,%rdi
mov    $0x1,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @spaceship2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load i64, i64* %2
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 -1
br label %11
11: ; preds = %6, %5
%12 = phi i32 [ 1, %5 ], [ %10, %6 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @spaceship2(i64 %0) {
%2 = icmp sgt i64 %0, 0
%3 = icmp ne i64 %0, 0
%4 = sext i1 %3 to i32
%5 = select i1 %2, i32 1, i32 %4
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int int_to_bcd2(unsigned int);
uint32_t int_to_bcd4(unsigned int x) {
  return int_to_bcd2(x / 100) << 8 | int_to_bcd2(x % 100);
}


x86 assembly (clang, -O0):
<int_to_bcd4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
call   1030 <int_to_bcd2@plt>
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%edi
call   1030 <int_to_bcd2@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_bcd4>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
mov    %edi,%eax
imul   $0x51eb851f,%rax,%rbx
shr    $0x25,%rbx
mov    %ebx,%edi
call   1030 <int_to_bcd2@plt>
mov    %eax,%r14d
shl    $0x8,%r14d
imul   $0x64,%ebx,%eax
sub    %eax,%ebp
mov    %ebp,%edi
call   1030 <int_to_bcd2@plt>
or     %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @int_to_bcd4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = udiv i32 %3, 100
%5 = call i32 @int_to_bcd2(i32 %4)
%6 = shl i32 %5, 8
%7 = load i32, i32* %2
%8 = urem i32 %7, 100
%9 = call i32 @int_to_bcd2(i32 %8)
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @int_to_bcd4(i32 %0) {
%2 = udiv i32 %0, 100
%3 = tail call i32 @int_to_bcd2(i32 %2)
%4 = shl i32 %3, 8
%5 = urem i32 %0, 100
%6 = tail call i32 @int_to_bcd2(i32 %5)
%7 = or i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fusione(char *, char *);
int /*<<< orphan*/ stampa(char *);
int main(void) {
  char *messaggioErrore = "Cod. Errore 666 - Volo non trovato. ";
  char *messaggioFileNonTrovato = "Cod. Errore 000 - File non trovato. ";
  fusione(messaggioErrore, messaggioFileNonTrovato);
  stampa(messaggioFileNonTrovato);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xee4(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <fusione@plt>
mov    -0x18(%rbp),%rdi
call   1030 <stampa@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xef6(%rip),%rbx
mov    %rbx,%rsi
call   1040 <fusione@plt>
mov    %rbx,%rdi
call   1030 <stampa@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Cod. Errore 666 - Volo non trovato. \00"
@.str.1 = [37 x i8] c"Cod. Errore 000 - File non trovato. \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %3
%6 = call i32 @fusione(i8* %4, i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 @stampa(i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Cod. Errore 666 - Volo non trovato. \00"
@.str.1 = [37 x i8] c"Cod. Errore 000 - File non trovato. \00"
define i32 @main() {
%1 = tail call i32 @fusione(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @stampa(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void move(int x, int y) { printf("\x1b[%d;%dH", y, x); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @move(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 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @move(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int ogp_spi_shutdown(void *data) {
  free(data);
  return 0;
}


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

x86 assembly (clang, -O2):
<ogp_spi_shutdown>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ogp_spi_shutdown(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
int test_imm_9Bint64_lowword_reg(long long val) {
  return ((val) & (0x9B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Bint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x9b,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Bint64_lowword_reg>:
test   $0x9b,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Bint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 155
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_9Bint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 155
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void wifi_rsp_hardware_io_port_config_direction(
    const struct wifi_msg_hardware_io_port_config_direction_rsp_t *msg) {}


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

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

LLVM IR (-O0):
%struct.wifi_msg_hardware_io_port_config_direction_rsp_t = type opaque
define void @wifi_rsp_hardware_io_port_config_direction(%struct.wifi_msg_hardware_io_port_config_direction_rsp_t* %0) {
%2 = alloca %struct.wifi_msg_hardware_io_port_config_direction_rsp_t*
store %struct.wifi_msg_hardware_io_port_config_direction_rsp_t* %0, %struct.wifi_msg_hardware_io_port_config_direction_rsp_t** %2
ret void
}

LLVM IR (-O2):
%struct.wifi_msg_hardware_io_port_config_direction_rsp_t = type opaque
define void @wifi_rsp_hardware_io_port_config_direction(%struct.wifi_msg_hardware_io_port_config_direction_rsp_t* nocapture %0) {
ret void
}
int ProcToValue(int procent, int baseValue) {
  int a = (baseValue / 100) * procent;
  return a;
}


x86 assembly (clang, -O0):
<ProcToValue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
imul   -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ProcToValue>:
movslq %esi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @ProcToValue(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 = sdiv i32 %6, 100
%8 = load i32, i32* %3
%9 = mul nsw i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @ProcToValue(i32 %0, i32 %1) {
%3 = sdiv i32 %1, 100
%4 = mul nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ qwertysh_loop();
int main(int argc, char **argv) {
  printf("\033[2J");
  qwertysh_loop();
  return EXIT_SUCCESS;
}


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    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <qwertysh_loop@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
@EXIT_SUCCESS = global i32 0
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 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @qwertysh_loop()
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @qwertysh_loop()
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
void *align_buffer(void *ptr, unsigned long align_size) {
  return (void *)(((unsigned long)ptr + (align_size - 1)) / align_size *
                  align_size);
}


x86 assembly (clang, -O0):
<align_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
add    %rcx,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
imul   -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_buffer>:
lea    (%rsi,%rdi,1),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     111e <align_buffer+0x1e>
mov    %rcx,%rax
xor    %edx,%edx
div    %rsi
jmp    1124 <align_buffer+0x24>
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
sub    %rdx,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @align_buffer(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = load i64, i64* %4
%8 = sub i64 %7, 1
%9 = add i64 %6, %8
%10 = load i64, i64* %4
%11 = udiv i64 %9, %10
%12 = load i64, i64* %4
%13 = mul i64 %11, %12
%14 = inttoptr i64 %13 to i8*
ret i8* %14
}

LLVM IR (-O2):
define i8* @align_buffer(i8* %0, i64 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = add i64 %1, -1
%5 = add i64 %4, %3
%6 = urem i64 %5, %1
%7 = sub i64 %5, %6
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}
void input_exit(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ff_hevc_h_loop_filter_luma_10_sse2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pelgev_(double *, double *);
void cpelgev(double *xmom, double *para) { pelgev_(xmom, para); }


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

x86 assembly (clang, -O2):
<cpelgev>:
jmp    1030 <pelgev_@plt>

LLVM IR (-O0):
define void @cpelgev(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double*, double** %4
%7 = call i32 @pelgev_(double* %5, double* %6)
ret void
}

LLVM IR (-O2):
define void @cpelgev(double* %0, double* %1) {
%3 = tail call i32 @pelgev_(double* %0, double* %1)
ret void
}
void option_free_real(void *p) {}


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

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

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

LLVM IR (-O2):
define void @option_free_real(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_write_multprec_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(441, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_write_multprec_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1b9,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_write_multprec_system>:
mov    $0x1b9,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @syscon_write_multprec_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 441, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_write_multprec_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 441, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *str_strdup(const char *str) {
  size_t ssize = strlen(str) + 1;
  char *tmp = (char *)malloc(ssize);
  if (NULL == tmp) {
    return NULL;
  } else {
    memcpy(tmp, str, ssize);
    return tmp;
  }
}


x86 assembly (clang, -O0):
<str_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
jne    1174 <str_strdup+0x44>
movq   $0x0,-0x8(%rbp)
jmp    118d <str_strdup+0x5d>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     1163 <str_strdup+0x33>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
jmp    1165 <str_strdup+0x35>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @str_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = call i64 @malloc(i64 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = icmp eq i8* null, %13
br i1 %14, label %15, label %16
15: ; preds = %1
store i8* null, i8** %2
br label %22
16: ; preds = %1
%17 = load i8*, i8** %5
%18 = load i8*, i8** %3
%19 = load i64, i64* %4
%20 = call i32 @memcpy(i8* %17, i8* %18, i64 %19)
%21 = load i8*, i8** %5
store i8* %21, i8** %2
br label %22
22: ; preds = %16, %15
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
define i8* @str_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i64 %5, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %4)
br label %10
10: ; preds = %1, %8
%11 = phi i8* [ %6, %8 ], [ null, %1 ]
ret i8* %11
}
char *langRomTypeSccMirrored() { return "SCC Mirrored"; }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"SCC Mirrored\00"
define i8* @langRomTypeSccMirrored() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int begin_verbatum(void) {
  newline();
  return 0;
}


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

x86 assembly (clang, -O2):
<begin_verbatum>:
push   %rax
xor    %eax,%eax
call   1030 <newline@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @begin_verbatum() {
%1 = call i32 (...) @newline()
ret i32 0
}

LLVM IR (-O2):
define i32 @begin_verbatum() {
%1 = tail call i32 (...) @newline()
ret i32 0
}
void RTAvlrPVInsert(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrPVInsert() {
ret void
}
long VideoForWindowsVersion(void) { return 0x040003B6; }


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

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

LLVM IR (-O0):
define i64 @VideoForWindowsVersion() {
ret i64 67109814
}

LLVM IR (-O2):
define i64 @VideoForWindowsVersion() {
ret i64 67109814
}
float NO_FLIP_FLOAT(float pVar) { return pVar; }


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

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

LLVM IR (-O0):
define float @NO_FLIP_FLOAT(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
ret float %3
}

LLVM IR (-O2):
define float @NO_FLIP_FLOAT(float returned %0) {
ret float %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: si-dump [CMD]\n"
                  "    L - configuration parameters\n"
                  "    H - readout parameters\n"
                  "    I - camera status\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [104 x i8] c"Usage: si-dump [CMD]\0A L - configuration parameters\0A H - readout parameters\0A I - camera status\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([104 x i8], [104 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [104 x i8] c"Usage: si-dump [CMD]\0A L - configuration parameters\0A H - readout parameters\0A I - camera status\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([104 x i8], [104 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ gen_syndrome_table();
void atm_init(void) { gen_syndrome_table(); }


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

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

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

LLVM IR (-O2):
define void @atm_init() {
%1 = tail call i32 (...) @gen_syndrome_table()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
int xissame(const char *s1, const char *s2) {
  return !s1 ? !s2 : !s2 ? 0 : !strcmp(s1, s2);
}


x86 assembly (clang, -O0):
<xissame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1142 <xissame+0x32>
cmpq   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
jmp    117a <xissame+0x6a>
cmpq   $0x0,-0x10(%rbp)
jne    1157 <xissame+0x47>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    1174 <xissame+0x64>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xissame>:
mov    %rdi,%rax
or     %rsi,%rax
sete   %al
test   %rdi,%rdi
je     1132 <xissame+0x22>
test   %rsi,%rsi
je     1132 <xissame+0x22>
push   %rax
call   1030 <strcmp@plt>
test   %eax,%eax
sete   %al
add    $0x8,%rsp
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @xissame(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 = icmp ne i8* %5, null
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
br label %25
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = icmp ne i8* %13, null
br i1 %14, label %16, label %15
15: ; preds = %12
br label %23
16: ; preds = %12
%17 = load i8*, i8** %3
%18 = load i8*, i8** %4
%19 = call i32 @strcmp(i8* %17, i8* %18)
%20 = icmp ne i32 %19, 0
%21 = xor i1 %20, true
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %16, %15
%24 = phi i32 [ 0, %15 ], [ %22, %16 ]
br label %25
25: ; preds = %23, %7
%26 = phi i32 [ %11, %7 ], [ %24, %23 ]
ret i32 %26
}

LLVM IR (-O2):
define i32 @xissame(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
%6 = and i1 %3, %4
br i1 %5, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @strcmp(i8* %0, i8* %1)
%9 = icmp eq i32 %8, 0
br label %10
10: ; preds = %2, %7
%11 = phi i1 [ %9, %7 ], [ %6, %2 ]
%12 = zext i1 %11 to i32
ret i32 %12
}
void initialise_trigger() {}


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

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

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

LLVM IR (-O2):
define void @initialise_trigger() {
ret void
}
/* Type definitions */
struct xdg_surface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int, char const *);
void xdg_surface_set_title(struct xdg_surface *xdg_surface, const char *title) {
  wl_proxy_marshal((struct wl_proxy *)xdg_surface, 2, title);
}


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

x86 assembly (clang, -O2):
<xdg_surface_set_title>:
mov    %rsi,%rdx
mov    $0x2,%esi
jmp    1030 <wl_proxy_marshal@plt>

LLVM IR (-O0):
%struct.xdg_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_surface_set_title(%struct.xdg_surface* %0, i8* %1) {
%3 = alloca %struct.xdg_surface*
%4 = alloca i8*
store %struct.xdg_surface* %0, %struct.xdg_surface** %3
store i8* %1, i8** %4
%5 = load %struct.xdg_surface*, %struct.xdg_surface** %3
%6 = bitcast %struct.xdg_surface* %5 to %struct.wl_proxy*
%7 = load i8*, i8** %4
%8 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %6, i32 2, i8* %7)
ret void
}

LLVM IR (-O2):
%struct.xdg_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_surface_set_title(%struct.xdg_surface* %0, i8* %1) {
%3 = bitcast %struct.xdg_surface* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %3, i32 2, i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct passwd {
  char *pw_name;
};

/* Variables and functions */
struct passwd *getpwuid(int /*<<< orphan*/);
char *username_from_userid(uid_t uid) {
  struct passwd *pwd;
  pwd = getpwuid(uid);
  return (pwd == NULL) ? NULL : pwd->pw_name;
}


x86 assembly (clang, -O0):
<username_from_userid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113d <username_from_userid+0x2d>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1148 <username_from_userid+0x38>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<username_from_userid>:
push   %rax
call   1030 <getpwuid@plt>
test   %rax,%rax
je     1120 <username_from_userid+0x10>
mov    (%rax),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i8* }
define i8* @username_from_userid(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.passwd*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.passwd* @getpwuid(i32 %4)
store %struct.passwd* %5, %struct.passwd** %3
%6 = load %struct.passwd*, %struct.passwd** %3
%7 = icmp eq %struct.passwd* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
br label %13
9: ; preds = %1
%10 = load %struct.passwd*, %struct.passwd** %3
%11 = getelementptr inbounds %struct.passwd, %struct.passwd* %10, i32 0, i32 0
%12 = load i8*, i8** %11
br label %13
13: ; preds = %9, %8
%14 = phi i8* [ null, %8 ], [ %12, %9 ]
ret i8* %14
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
define i8* @username_from_userid(i32 %0) {
%2 = tail call %struct.passwd* @getpwuid(i32 %0)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%6 = load i8*, i8** %5
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %6, %4 ], [ null, %1 ]
ret i8* %8
}
/* Variables and functions */
int GetPlayerLocationX();
int GetPlayerLocationY();
int distance(int, int, int, int);
int DistanceToPlayer(int y1, int x1) {
  int x, y;
  y = GetPlayerLocationY();
  x = GetPlayerLocationX();
  return distance(y, x, y1, x1);
}


x86 assembly (clang, -O0):
<DistanceToPlayer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <GetPlayerLocationY@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <GetPlayerLocationX@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
call   1040 <distance@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DistanceToPlayer>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <GetPlayerLocationY@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <GetPlayerLocationX@plt>
mov    %ebx,%edi
mov    %eax,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <distance@plt>

LLVM IR (-O0):
define i32 @DistanceToPlayer(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i32 (...) @GetPlayerLocationY()
store i32 %7, i32* %6
%8 = call i32 (...) @GetPlayerLocationX()
store i32 %8, i32* %5
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @distance(i32 %9, i32 %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @DistanceToPlayer(i32 %0, i32 %1) {
%3 = tail call i32 (...) @GetPlayerLocationY()
%4 = tail call i32 (...) @GetPlayerLocationX()
%5 = tail call i32 @distance(i32 %3, i32 %4, i32 %0, i32 %1)
ret i32 %5
}