xunge/DecIR huggingface dataset:
/* Variables and functions */
void *__memmove_down(void *, void const *, size_t);
void *__memmove_up(void *, void const *, size_t);
void *(memmove)(void *__dest, __const void *__src, size_t __n) {
  if (__dest > __src)
    return __memmove_up(__dest, __src, __n);
  else
    return __memmove_down(__dest, __src, __n);
}


x86 assembly (clang, -O0):
<memmove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    115c <memmove+0x3c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <__memmove_up@plt>
mov    %rax,-0x8(%rbp)
jmp    1171 <memmove+0x51>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <__memmove_down@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memmove>:
cmp    %rsi,%rdi
jbe    112a <memmove+0xa>
jmp    1040 <__memmove_up@plt>
jmp    1030 <__memmove_down@plt>

LLVM IR (-O0):
define i8* @memmove(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = icmp ugt i8* %8, %9
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = load i64, i64* %7
%15 = call i8* @__memmove_up(i8* %12, i8* %13, i64 %14)
store i8* %15, i8** %4
br label %21
16: ; preds = %3
%17 = load i8*, i8** %5
%18 = load i8*, i8** %6
%19 = load i64, i64* %7
%20 = call i8* @__memmove_down(i8* %17, i8* %18, i64 %19)
store i8* %20, i8** %4
br label %21
21: ; preds = %16, %11
%22 = load i8*, i8** %4
ret i8* %22
}

LLVM IR (-O2):
define i8* @memmove(i8* %0, i8* %1, i64 %2) {
%4 = icmp ugt i8* %0, %1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i8* @__memmove_up(i8* %0, i8* %1, i64 %2)
br label %9
7: ; preds = %3
%8 = tail call i8* @__memmove_down(i8* %0, i8* %1, i64 %2)
br label %9
9: ; preds = %7, %5
%10 = phi i8* [ %6, %5 ], [ %8, %7 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
extern int Blue2(int one, int two) {
  printf(" Hello from Blue2: one = %d, two = %d!\n ", one, two);
  return one + two;
}


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

x86 assembly (clang, -O2):
<Blue2>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c" Hello from Blue2: one = %d, two = %d!\0A \00"
define i32 @Blue2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
@.str = [41 x i8] c" Hello from Blue2: one = %d, two = %d!\0A \00"
define i32 @Blue2(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = add nsw i32 %1, %0
ret i32 %4
}
/* Variables and functions */
int *malloc(int);
int main() {
  int *p = malloc(sizeof(int));
  while (*p >= 0) {
    (*p)--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jl     114a <main+0x3a>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
cmpl   $0x0,(%rax)
js     1126 <main+0x16>
movl   $0xffffffff,(%rax)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @malloc(i32 4)
store i32* %3, i32** %2
br label %4
4: ; preds = %8, %0
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = add nsw i32 %10, -1
store i32 %11, i32* %9
br label %4
12: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
%2 = load i32, i32* %1
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %5
5: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
void *sqlite3GenericMalloc(int);
void *sqlite3_malloc(int nByte) {
  return nByte > 0 ? sqlite3GenericMalloc(nByte) : 0;
}


x86 assembly (clang, -O0):
<sqlite3_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1136 <sqlite3_malloc+0x26>
mov    -0x4(%rbp),%edi
call   1030 <sqlite3GenericMalloc@plt>
mov    %rax,-0x10(%rbp)
jmp    1141 <sqlite3_malloc+0x31>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1141 <sqlite3_malloc+0x31>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3_malloc>:
test   %edi,%edi
jle    1119 <sqlite3_malloc+0x9>
jmp    1030 <sqlite3GenericMalloc@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @sqlite3_malloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i8* @sqlite3GenericMalloc(i32 %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i8* [ %7, %5 ], [ null, %8 ]
ret i8* %10
}

LLVM IR (-O2):
define i8* @sqlite3_malloc(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i8* @sqlite3GenericMalloc(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
void g_io_channel_error_from_errno() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int open(char const *, int /*<<< orphan*/);
struct tracecmd_input *tracecmd_alloc_fd(int);
struct tracecmd_input *tracecmd_alloc(const char *file) {
  int fd;
  fd = open(file, O_RDONLY);
  if (fd < 0)
    return NULL;
  return tracecmd_alloc_fd(fd);
}


x86 assembly (clang, -O0):
<tracecmd_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1158 <tracecmd_alloc+0x38>
movq   $0x0,-0x8(%rbp)
jmp    1164 <tracecmd_alloc+0x44>
mov    -0x14(%rbp),%edi
call   1030 <tracecmd_alloc_fd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tracecmd_alloc>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
test   %eax,%eax
js     113b <tracecmd_alloc+0x1b>
mov    %eax,%edi
pop    %rax
jmp    1030 <tracecmd_alloc_fd@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tracecmd_input = type { i32 }
@O_RDONLY = global i32 0
define %struct.tracecmd_input* @tracecmd_alloc(i8* %0) {
%2 = alloca %struct.tracecmd_input*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_RDONLY
%7 = call i32 @open(i8* %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store %struct.tracecmd_input* null, %struct.tracecmd_input** %2
br label %14
11: ; preds = %1
%12 = load i32, i32* %4
%13 = call %struct.tracecmd_input* @tracecmd_alloc_fd(i32 %12)
store %struct.tracecmd_input* %13, %struct.tracecmd_input** %2
br label %14
14: ; preds = %11, %10
%15 = load %struct.tracecmd_input*, %struct.tracecmd_input** %2
ret %struct.tracecmd_input* %15
}

LLVM IR (-O2):
%struct.tracecmd_input = type { i32 }
@O_RDONLY = global i32 0
define %struct.tracecmd_input* @tracecmd_alloc(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call %struct.tracecmd_input* @tracecmd_alloc_fd(i32 %3)
br label %7
7: ; preds = %1, %5
%8 = phi %struct.tracecmd_input* [ %6, %5 ], [ null, %1 ]
ret %struct.tracecmd_input* %8
}
double mflops(int nn, double cpu, double flop) {
  return (flop / cpu * 1.e-6 * (double)nn);
}


x86 assembly (clang, -O0):
<mflops>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mflops>:
divsd  %xmm0,%xmm1
mulsd  0xef4(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @mflops(i32 %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store i32 %0, i32* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = load double, double* %5
%9 = fdiv double %7, %8
%10 = fmul double %9, 0x3EB0C6F7A0B5ED8D
%11 = load i32, i32* %4
%12 = sitofp i32 %11 to double
%13 = fmul double %10, %12
ret double %13
}

LLVM IR (-O2):
define double @mflops(i32 %0, double %1, double %2) {
%4 = fdiv double %2, %1
%5 = fmul double %4, 0x3EB0C6F7A0B5ED8D
%6 = sitofp i32 %0 to double
%7 = fmul double %5, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sscanf(char *, char *, uintptr_t **);
int /*<<< orphan*/ stdin;
void file_patch(void) {
  char str[17];
  uintptr_t *trgt = NULL;
  printf("\t[pa] Target Address: ");
  fgets(str, 17, stdin);
  sscanf(str, "%p", &trgt);
}


x86 assembly (clang, -O0):
<file_patch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movq   $0x0,-0x28(%rbp)
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%edx
mov    $0x11,%esi
call   1040 <fgets@plt>
lea    -0x20(%rbp),%rdi
lea    0xea9(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1050 <sscanf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_patch>:
push   %rbx
sub    $0x30,%rsp
movq   $0x0,0x8(%rsp)
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x11,%esi
call   1040 <fgets@plt>
lea    0xeab(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
call   1050 <sscanf@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\09[pa] Target Address: \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%p\00"
define void @file_patch() {
%1 = alloca [17 x i8]
%2 = alloca i64*
store i64* null, i64** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 17, i32 %5)
%7 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%8 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64** %2)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"\09[pa] Target Address: \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%p\00"
define void @file_patch() {
%1 = alloca [17 x i8]
%2 = alloca i64*
%3 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%4 = bitcast i64** %2 to i8*
store i64* null, i64** %2
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %3, i32 17, i32 %6)
%8 = call i32 @sscanf(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64** %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_y_or_n();
int main() {
  get_y_or_n();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @get_y_or_n()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @get_y_or_n()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "CRLF: Change carriage returns to linefeeds in a file\n");
  fprintf(stderr, "Usage:  crlf [-v] file1 file2 ... filen\n");
  fprintf(stderr, "  -v: verbose\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    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeed(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xf01(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"CRLF: Change carriage returns to linefeeds in a file\0A\00"
@.str.1 = [41 x i8] c"Usage: crlf [-v] file1 file2 ... filen\0A\00"
@.str.2 = [15 x i8] c" -v: verbose\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"CRLF: Change carriage returns to linefeeds in a file\0A\00"
@.str.1 = [41 x i8] c"Usage: crlf [-v] file1 file2 ... filen\0A\00"
@.str.2 = [15 x i8] c" -v: verbose\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int tor_mem_is_zero(char const *, int);
int tor_digest256_is_zero(const char *digest) {
  return tor_mem_is_zero(digest, 32);
}


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

x86 assembly (clang, -O2):
<tor_digest256_is_zero>:
mov    $0x20,%esi
jmp    1030 <tor_mem_is_zero@plt>

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

LLVM IR (-O2):
define i32 @tor_digest256_is_zero(i8* %0) {
%2 = tail call i32 @tor_mem_is_zero(i8* %0, i32 32)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ truclient_step(char *, char *, char *);
Script_View_Action() {
  truclient_step("1", "Evaluate JavaScript code 'xhReq_synchronous_call'",
                 "snapshot=Action_1.inf");
  truclient_step("2", "Evaluate JavaScript code 'xhReq_async_call'",
                 "snapshot=Action_2.inf");
}


x86 assembly (clang, -O0):
<Script_View_Action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    0xedc(%rip),%rsi
lea    0xf07(%rip),%rdx
call   1030 <truclient_step@plt>
lea    0xf11(%rip),%rdi
lea    0xf0c(%rip),%rsi
lea    0xf31(%rip),%rdx
call   1030 <truclient_step@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Script_View_Action>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee3(%rip),%rsi
lea    0xf0e(%rip),%rdx
call   1030 <truclient_step@plt>
lea    0xf18(%rip),%rdi
lea    0xf13(%rip),%rsi
lea    0xf38(%rip),%rdx
pop    %rax
jmp    1030 <truclient_step@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
@.str.1 = [50 x i8] c"Evaluate JavaScript code 'xhReq_synchronous_call'\00"
@.str.2 = [22 x i8] c"snapshot=Action_1.inf\00"
@.str.3 = [2 x i8] c"2\00"
@.str.4 = [44 x i8] c"Evaluate JavaScript code 'xhReq_async_call'\00"
@.str.5 = [22 x i8] c"snapshot=Action_2.inf\00"
define i32 @Script_View_Action() {
%1 = alloca i32
%2 = call i32 @truclient_step(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @truclient_step(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@.str.1 = [50 x i8] c"Evaluate JavaScript code 'xhReq_synchronous_call'\00"
@.str.2 = [22 x i8] c"snapshot=Action_1.inf\00"
@.str.3 = [2 x i8] c"2\00"
@.str.4 = [44 x i8] c"Evaluate JavaScript code 'xhReq_async_call'\00"
@.str.5 = [22 x i8] c"snapshot=Action_2.inf\00"
define i32 @Script_View_Action() {
%1 = tail call i32 @truclient_step(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @truclient_step(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
scalar_t__ isupper(int);
void test_isupper(int x) {
  if (isupper(x))
    clang_analyzer_eval(x < 'A');
}


x86 assembly (clang, -O0):
<test_isupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     114e <test_isupper+0x2e>
cmpl   $0x41,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
test   %rax,%rax
je     113c <test_isupper+0x1c>
xor    %edi,%edi
cmp    $0x41,%ebx
setl   %dil
pop    %rbx
jmp    1040 <clang_analyzer_eval@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @test_isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isupper(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 65
%9 = zext i1 %8 to i32
%10 = call i32 @clang_analyzer_eval(i32 %9)
br label %11
11: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @test_isupper(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = icmp slt i32 %0, 65
%6 = zext i1 %5 to i32
%7 = tail call i32 @clang_analyzer_eval(i32 %6)
br label %8
8: ; preds = %4, %1
ret void
}
unsigned short GET_UAA16LE(void *p, unsigned int i) {
  unsigned char *_p = (unsigned char *)&((unsigned short *)p)[i];
  return (unsigned short)_p[0] | (unsigned short)_p[1] << 8;
}


x86 assembly (clang, -O0):
<GET_UAA16LE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
movzwl %ax,%eax
mov    -0x18(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
movzwl %cx,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GET_UAA16LE>:
mov    %esi,%eax
movzwl (%rdi,%rax,2),%eax
ret

LLVM IR (-O0):
define zeroext i16 @GET_UAA16LE(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i16*
%8 = load i32, i32* %4
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i16, i16* %7, i64 %9
%11 = bitcast i16* %10 to i8*
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = zext i8 %14 to i16
%16 = zext i16 %15 to i32
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
%20 = zext i8 %19 to i16
%21 = zext i16 %20 to i32
%22 = shl i32 %21, 8
%23 = or i32 %16, %22
%24 = trunc i32 %23 to i16
ret i16 %24
}

LLVM IR (-O2):
define zeroext i16 @GET_UAA16LE(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i16*
%4 = zext i32 %1 to i64
%5 = getelementptr inbounds i16, i16* %3, i64 %4
%6 = bitcast i16* %5 to i8*
%7 = load i8, i8* %6
%8 = zext i8 %7 to i16
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i16
%12 = shl nuw i16 %11, 8
%13 = or i16 %12, %8
ret i16 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void b() { printf("In function b\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"In function b\00"
define void @b() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
int snd_device_name_free_hint(void **hints) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @snd_device_name_free_hint(i8** nocapture readnone %0) {
ret i32 0
}
int sign(int x) {
  int sign = x >> 31;
  int negOneIfNegX = (~0 + !sign);
  int oneIfXEqualsZero = (!x);
  return negOneIfNegX + !(oneIfXEqualsZero | sign);
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
or     -0x8(%rbp),%ecx
cmp    $0x0,%ecx
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
mov    %edi,%eax
sar    $0x1f,%eax
mov    %edi,%ecx
not    %ecx
shr    $0x1f,%ecx
xor    %edx,%edx
test   %edi,%edi
sete   %dl
xor    %esi,%esi
or     %eax,%edx
sete   %sil
lea    (%rcx,%rsi,1),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @sign(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = ashr i32 %6, 31
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = add nsw i32 -1, %11
store i32 %12, i32* %4
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
%16 = zext i1 %15 to i32
store i32 %16, i32* %5
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = load i32, i32* %3
%20 = or i32 %18, %19
%21 = icmp ne i32 %20, 0
%22 = xor i1 %21, true
%23 = zext i1 %22 to i32
%24 = add nsw i32 %17, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @sign(i32 %0) {
%2 = ashr i32 %0, 31
%3 = xor i32 %0, -1
%4 = lshr i32 %3, 31
%5 = add nsw i32 %4, -1
%6 = icmp eq i32 %0, 0
%7 = zext i1 %6 to i32
%8 = or i32 %2, %7
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = add nsw i32 %5, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_eni(int);
void foo(void) {
  __builtin_eni(0);
  __builtin_eni(1);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <__builtin_eni@plt>
mov    $0x1,%edi
call   1030 <__builtin_eni@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %edi,%edi
call   1030 <__builtin_eni@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <__builtin_eni@plt>

LLVM IR (-O0):
define void @foo() {
%1 = call i32 @__builtin_eni(i32 0)
%2 = call i32 @__builtin_eni(i32 1)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @__builtin_eni(i32 0)
%2 = tail call i32 @__builtin_eni(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x16() {
  Assert_real((isbdigit(22) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              115, ("isbdigit should be 0 for 0x16"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0x16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x16,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x73,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0x16>:
push   %rax
mov    $0x16,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x73,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x16\00"
define void @t_isbdigit_0x16() {
%1 = call i64 @isbdigit(i32 22)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 115, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x16\00"
define void @t_isbdigit_0x16() {
%1 = tail call i64 @isbdigit(i32 22)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 115, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *s = "hello";
  printf("%s\n", s);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int system(char *);
int main(void) { return system("xpet.exe -sounddev dummy"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"xpet.exe -sounddev dummy\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}

LLVM IR (-O2):
@.str = [25 x i8] c"xpet.exe -sounddev dummy\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int inet_aton(char const *, int /*<<< orphan*/ *);
int set_address(const char *address, struct sockaddr *sa) {
  return inet_aton(address, &((struct sockaddr_in *)sa)->sin_addr);
}


x86 assembly (clang, -O0):
<set_address>:
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 <inet_aton@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_address>:
jmp    1030 <inet_aton@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
%struct.sockaddr_in = type { i32 }
define i32 @set_address(i8* %0, %struct.sockaddr* %1) {
%3 = alloca i8*
%4 = alloca %struct.sockaddr*
store i8* %0, i8** %3
store %struct.sockaddr* %1, %struct.sockaddr** %4
%5 = load i8*, i8** %3
%6 = load %struct.sockaddr*, %struct.sockaddr** %4
%7 = bitcast %struct.sockaddr* %6 to %struct.sockaddr_in*
%8 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
%9 = call i32 @inet_aton(i8* %5, i32* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @set_address(i8* %0, %struct.sockaddr* %1) {
%3 = getelementptr %struct.sockaddr, %struct.sockaddr* %1, i64 0, i32 0
%4 = tail call i32 @inet_aton(i8* %0, i32* %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int toupper(int);
int toupper_l(int c, locale_t l) { return toupper(c); }


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

x86 assembly (clang, -O2):
<toupper_l>:
jmp    1030 <toupper@plt>

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

LLVM IR (-O2):
define i32 @toupper_l(i32 %0, i32 %1) {
%3 = tail call i32 @toupper(i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
main() {
  volatile int x = L'\x0000000100';
  if (x != 0x100)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x100,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x100,%eax
je     113b <main+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x100,0x4(%rsp)
mov    0x4(%rsp),%eax
cmp    $0x100,%eax
jne    1128 <main+0x18>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store volatile i32 256, i32* %2
%3 = load volatile i32, i32* %2
%4 = icmp ne i32 %3, 256
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 256, i32* %1
%3 = load volatile i32, i32* %1
%4 = icmp eq i32 %3, 256
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %0
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int detect_endian() {
  uint8_t x[2];
  *((uint16_t *)x) = 1;
  if (x[0] == 0 && x[1] == 1)
    return -1;
  if (x[0] == 1 && x[1] == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<detect_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    112b <detect_endian+0x2b>
cmpl   $0x1,-0x8(%rbp)
jne    112b <detect_endian+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1152 <detect_endian+0x52>
cmpl   $0x1,-0xc(%rbp)
jne    114b <detect_endian+0x4b>
cmpl   $0x0,-0x8(%rbp)
jne    114b <detect_endian+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <detect_endian+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @detect_endian() {
ret i32 0
}
void GetCursorSize(int *CursTop, int *CursBottom) {}


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

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

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

LLVM IR (-O2):
define void @GetCursorSize(i32* nocapture %0, i32* nocapture %1) {
ret void
}
void ARGBSepiaRow_C() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ free(struct string_t *);
void string_del(struct string_t *s) { free(s); }


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

x86 assembly (clang, -O2):
<string_del>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.string_t = type { i32 }
define void @string_del(%struct.string_t* nocapture %0) {
%2 = tail call i32 @free(%struct.string_t* %0)
ret void
}
/* Variables and functions */
int lsddbapi_getLastInsertRowId();
int plugindb_getLastInsertRowId() { return lsddbapi_getLastInsertRowId(); }


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

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

LLVM IR (-O0):
define i32 @plugindb_getLastInsertRowId() {
%1 = call i32 (...) @lsddbapi_getLastInsertRowId()
ret i32 %1
}

LLVM IR (-O2):
define i32 @plugindb_getLastInsertRowId() {
%1 = tail call i32 (...) @lsddbapi_getLastInsertRowId()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void delete_caller_name(char *name) { free(name); }


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

x86 assembly (clang, -O2):
<delete_caller_name>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @delete_caller_name(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EBADF;
int /*<<< orphan*/ errno;
int sys_close(int file) {
  errno = EBADF;
  return -1;
}


x86 assembly (clang, -O0):
<sys_close>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_close>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EBADF = global i32 0
@errno = global i32 0
define i32 @sys_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @EBADF
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EBADF = global i32 0
@errno = global i32 0
define i32 @sys_close(i32 %0) {
%2 = load i32, i32* @EBADF
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int x(int (*self)()) {
  static int x;
  if (++x > 10) {
    printf("limit\n");
    exit(0);
  }
  printf("hi\n");
  self(self);
}


x86 assembly (clang, -O0):
<x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2f02(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ef9(%rip)
cmp    $0xa,%eax
jle    1157 <x+0x37>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rcx
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   *%rcx
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x>:
push   %rbx
mov    0x2f0d(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f04(%rip)
cmp    $0xa,%eax
jge    114c <x+0x2c>
mov    %rdi,%rbx
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    *%rdi
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@x.x = internal global i32 0
@.str = [7 x i8] c"limit\0A\00"
@.str.1 = [4 x i8] c"hi\0A\00"
define i32 @x(i32 (...)* %0) {
%2 = alloca i32
%3 = alloca i32 (...)*
store i32 (...)* %0, i32 (...)** %3
%4 = load i32, i32* @x.x
%5 = add nsw i32 %4, 1
store i32 %5, i32* @x.x
%6 = icmp sgt i32 %5, 10
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32 (...)*, i32 (...)** %3
%13 = load i32 (...)*, i32 (...)** %3
%14 = bitcast i32 (...)* %12 to i32 (i32 (...)*, ...)*
%15 = call i32 (i32 (...)*, ...) %14(i32 (...)* %13)
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@x.x = internal unnamed_addr global i32 0
@str = [3 x i8] c"hi\00"
@str.2 = [6 x i8] c"limit\00"
define i32 @x(i32 (...)* %0) {
%2 = load i32, i32* @x.x
%3 = add nsw i32 %2, 1
store i32 %3, i32* @x.x
%4 = icmp sgt i32 %2, 9
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0))
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %1
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%10 = bitcast i32 (...)* %0 to i32 (i32 (...)*, ...)*
%11 = tail call i32 (i32 (...)*, ...) %10(i32 (...)* %0)
ret i32 undef
}
double Double_neg(double x) { return -x; }


x86 assembly (clang, -O0):
<Double_neg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Double_neg>:
xorps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @Double_neg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
ret double %4
}

LLVM IR (-O2):
define double @Double_neg(double %0) {
%2 = fneg double %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void ov75() {
  printf("\nIncreasing CPU VDD Voltage by 75mV\n");
  char buf[256];
  sprintf(
      buf, "/system/bin/sh -c %s",
      "'echo +75000 > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels'");
  system(buf);
}


x86 assembly (clang, -O0):
<ov75>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    -0x100(%rbp),%rdi
lea    0xed0(%rip),%rsi
lea    0xede(%rip),%rdx
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ov75>:
push   %rbx
sub    $0x100,%rsp
lea    0xf1b(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"\0AIncreasing CPU VDD Voltage by 75mV\0A\00"
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [69 x i8] c"'echo +75000 > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels'\00"
define void @ov75() {
%1 = alloca [256 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0))
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = call i32 @system(i8* %5)
ret void
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [69 x i8] c"'echo +75000 > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels'\00"
@str = [36 x i8] c"\0AIncreasing CPU VDD Voltage by 75mV\00"
define void @ov75() {
%1 = alloca [256 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @system(i8* %3)
ret void
}
int countDigits(unsigned long long in) {
  int result = 0;
  while (in > 0) {
    result++;
    in /= 10;
  }
  return result;
}


x86 assembly (clang, -O0):
<countDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jbe    113a <countDigits+0x3a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
jmp    110f <countDigits+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countDigits>:
xor    %ecx,%ecx
test   %rdi,%rdi
je     1136 <countDigits+0x36>
movabs $0xcccccccccccccccd,%rsi
cc cc cc
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ecx
mov    %rdi,%rax
mul    %rsi
shr    $0x3,%rdx
cmp    $0x9,%rdi
mov    %rdx,%rdi
ja     1120 <countDigits+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @countDigits(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = udiv i64 %5, 10
%8 = icmp ult i64 %5, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t from32to16(uint32_t sum) {
  sum = (sum & 0xffff) + (sum >> 16);
  sum = (sum & 0xffff) + (sum >> 16);
  return sum;
}


x86 assembly (clang, -O0):
<from32to16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<from32to16>:
movzwl %di,%eax
sar    $0x10,%edi
add    %edi,%eax
movzwl %ax,%ecx
sar    $0x10,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @from32to16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = load i32, i32* %2
%6 = ashr i32 %5, 16
%7 = add nsw i32 %4, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = and i32 %8, 65535
%10 = load i32, i32* %2
%11 = ashr i32 %10, 16
%12 = add nsw i32 %9, %11
store i32 %12, i32* %2
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @from32to16(i32 %0) {
%2 = and i32 %0, 65535
%3 = ashr i32 %0, 16
%4 = add nsw i32 %2, %3
%5 = and i32 %4, 65535
%6 = ashr i32 %4, 16
%7 = add nsw i32 %5, %6
ret i32 %7
}