xunge/DecIR huggingface dataset:
/* Type definitions */
struct ui_file {
  int dummy;
};
struct cmd_list_element {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _(char *);
int /*<<< orphan*/ fprintf_filtered(struct ui_file *, int /*<<< orphan*/,
                                    char const *);
void show_host_charset_name(struct ui_file *file, int from_tty,
                            struct cmd_list_element *c, const char *value) {
  fprintf_filtered(file, _("The host character set is \"%s\".\n"), value);
}


x86 assembly (clang, -O0):
<show_host_charset_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <_@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
mov    -0x20(%rbp),%rdx
call   1030 <fprintf_filtered@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_host_charset_name>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1040 <_@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf_filtered@plt>

LLVM IR (-O0):
%struct.ui_file = type { i32 }
%struct.cmd_list_element = type { i32 }
@.str = [33 x i8] c"The host character set is \22%s\22.\0A\00"
define void @show_host_charset_name(%struct.ui_file* %0, i32 %1, %struct.cmd_list_element* %2, i8* %3) {
%5 = alloca %struct.ui_file*
%6 = alloca i32
%7 = alloca %struct.cmd_list_element*
%8 = alloca i8*
store %struct.ui_file* %0, %struct.ui_file** %5
store i32 %1, i32* %6
store %struct.cmd_list_element* %2, %struct.cmd_list_element** %7
store i8* %3, i8** %8
%9 = load %struct.ui_file*, %struct.ui_file** %5
%10 = call i32 @_(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %8
%12 = call i32 @fprintf_filtered(%struct.ui_file* %9, i32 %10, i8* %11)
ret void
}

LLVM IR (-O2):
%struct.ui_file = type { i32 }
%struct.cmd_list_element = type { i32 }
@.str = [33 x i8] c"The host character set is \22%s\22.\0A\00"
define void @show_host_charset_name(%struct.ui_file* %0, i32 %1, %struct.cmd_list_element* nocapture readnone %2, i8* %3) {
%5 = tail call i32 @_(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @fprintf_filtered(%struct.ui_file* %0, i32 %5, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __poet_fail();
int main(void) {
  int x = 5;
  if (x != 5)
    __poet_fail();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
je     1137 <main+0x27>
mov    $0x0,%al
call   1030 <__poet_fail@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main() {
  write(3, "DONE!\n", 6);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x3,%edi
mov    $0x6,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"DONE!\0A\00"
define i32 @main() {
%1 = tail call i32 @write(i32 3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ strcpy(char *, char *);
size_t strlen(char *);
char *str_add(char *str, char add) {
  size_t len = strlen(str);
  char *str2 = malloc(len + 1 + 1);
  strcpy(str2, str);
  str2[len - 2] = add;
  str2[len - 1] = '\0';
  return str2;
}


x86 assembly (clang, -O0):
<str_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x9(%rbp),%dl
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x2,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_add>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbp
lea    0x2(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %r14b,-0x2(%rbp,%rbx,1)
movb   $0x0,-0x1(%rbp,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @str_add(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i8 %1, i8* %4
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = add i64 %9, 1
%11 = add i64 %10, 1
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8, i8* %4
%17 = load i8*, i8** %6
%18 = load i64, i64* %5
%19 = sub i64 %18, 2
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 %16, i8* %20
%21 = load i8*, i8** %6
%22 = load i64, i64* %5
%23 = sub i64 %22, 1
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 0, i8* %24
%25 = load i8*, i8** %6
ret i8* %25
}

LLVM IR (-O2):
define i8* @str_add(i8* %0, i8 signext %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add i64 %3, 2
%5 = tail call i8* @malloc(i64 %4)
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
%7 = add i64 %3, -2
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 %1, i8* %8
%9 = add i64 %3, -1
%10 = getelementptr inbounds i8, i8* %5, i64 %9
store i8 0, i8* %10
ret i8* %5
}
/* Variables and functions */
int getpid();
int get_pid_c4_() { return getpid(); }


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

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

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

LLVM IR (-O2):
define i32 @get_pid_c4_() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ print_debug(char *);
int /*<<< orphan*/ print_debug_hex8(unsigned int);
void disable_dimm(unsigned index) {
  print_debug("disabling dimm");
  print_debug_hex8(index);
  print_debug("\r\n");
}


x86 assembly (clang, -O0):
<disable_dimm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <print_debug@plt>
mov    -0x4(%rbp),%edi
call   1030 <print_debug_hex8@plt>
lea    0xec9(%rip),%rdi
call   1040 <print_debug@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_dimm>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <print_debug@plt>
mov    %ebx,%edi
call   1030 <print_debug_hex8@plt>
lea    0xed2(%rip),%rdi
pop    %rbx
jmp    1040 <print_debug@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"disabling dimm\00"
@.str.1 = [3 x i8] c"\0D\0A\00"
define void @disable_dimm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @print_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @print_debug_hex8(i32 %4)
%6 = call i32 @print_debug(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"disabling dimm\00"
@.str.1 = [3 x i8] c"\0D\0A\00"
define void @disable_dimm(i32 %0) {
%2 = tail call i32 @print_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @print_debug_hex8(i32 %0)
%4 = tail call i32 @print_debug(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ new_box(unsigned int, unsigned int, int, void (*)(void *));
void *init_box(unsigned int myeltsize, unsigned int nombre_initial,
               void (*fct_print)(void *)) {
  new_box(myeltsize, nombre_initial, 1 << 0, fct_print);
}


x86 assembly (clang, -O0):
<init_box>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1030 <new_box@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_box>:
mov    %rdx,%rcx
mov    $0x1,%edx
jmp    1030 <new_box@plt>

LLVM IR (-O0):
define i8* @init_box(i32 %0, i32 %1, void (i8*)* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca void (i8*)*
store i32 %0, i32* %5
store i32 %1, i32* %6
store void (i8*)* %2, void (i8*)** %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = load void (i8*)*, void (i8*)** %7
%11 = call i32 @new_box(i32 %8, i32 %9, i32 1, void (i8*)* %10)
%12 = load i8*, i8** %4
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @init_box(i32 %0, i32 %1, void (i8*)* %2) {
%4 = tail call i32 @new_box(i32 %0, i32 %1, i32 1, void (i8*)* %2)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void numEsq(int n, int max) {
  printf("%d", n);
  if (n == max)
    return;
  else {
    numEsq(n + 1, max);
    printf("%d", n);
  }
}


x86 assembly (clang, -O0):
<numEsq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    114e <numEsq+0x2e>
jmp    116b <numEsq+0x4b>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1030 <numEsq@plt>
mov    -0x4(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numEsq>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xed2(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
cmp    %ebp,%ebx
jne    1140 <numEsq+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0x1(%rbx),%edi
mov    %ebp,%esi
call   1030 <numEsq@plt>
lea    0xeaf(%rip),%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @numEsq(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 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %2
br label %17
11: ; preds = %2
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10, %11
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @numEsq(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = icmp eq i32 %0, %1
br i1 %4, label %5, label %6
5: ; preds = %2, %6
ret void
6: ; preds = %2
%7 = add nsw i32 %0, 1
tail call void @numEsq(i32 %7, i32 %1)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
extern void clear_screen(void) { system("clear"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define void @clear_screen() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int);
int mergeSort(int vetor[], int tamanho) {
  int meio = tamanho / 2;
  if (tamanho > 1) {
    mergeSort(vetor, meio);
    mergeSort(vetor + meio, tamanho - meio);
    merge(vetor, tamanho);
  }
}


x86 assembly (clang, -O0):
<mergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x14(%rbp)
jle    1179 <mergeSort+0x59>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <mergeSort@plt>
mov    -0x10(%rbp),%rdi
movslq -0x18(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x14(%rbp),%esi
sub    -0x18(%rbp),%esi
call   1030 <mergeSort@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <merge@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergeSort>:
cmp    $0x1,%esi
jle    115c <mergeSort+0x3c>
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%ebp
shr    $0x1f,%ebp
add    %esi,%ebp
sar    %ebp
mov    %ebp,%esi
call   1030 <mergeSort@plt>
movslq %ebp,%rax
lea    (%r14,%rax,4),%rdi
mov    %ebx,%esi
sub    %eax,%esi
call   1030 <mergeSort@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <merge@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @mergeSort(i32* %0, i32 %1) {
%3 = sdiv i32 %1, 2
%4 = icmp sgt i32 %1, 1
br i1 %4, label %6, label %5
5: ; preds = %2, %6
ret i32 undef
6: ; preds = %2
%7 = tail call i32 @mergeSort(i32* %0, i32 %3)
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = sub nsw i32 %1, %3
%11 = tail call i32 @mergeSort(i32* %9, i32 %10)
%12 = tail call i32 @merge(i32* %0, i32 %1)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ DeallocateDataRxBuffer();
void WF_RxPacketDeallocate() { DeallocateDataRxBuffer(); }


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

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

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

LLVM IR (-O2):
define void @WF_RxPacketDeallocate() {
%1 = tail call i32 (...) @DeallocateDataRxBuffer()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void USB_EndPoint5(uint32_t event) {}


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

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

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

LLVM IR (-O2):
define void @USB_EndPoint5(i32 %0) {
ret void
}
void test_fixit_insert_newline(void) {}


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

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

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

LLVM IR (-O2):
define void @test_fixit_insert_newline() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void any2c(void *a) {
  if (a == NULL) {
    printf("NULL\n");
  } else {
    printf("not NULL\n");
  }
}


x86 assembly (clang, -O0):
<any2c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1138 <any2c+0x28>
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
jmp    1144 <any2c+0x34>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<any2c>:
test   %rdi,%rdi
lea    0xeea(%rip),%rax
lea    0xedf(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [9 x i8] c"not NULL\00"
@str.2 = [5 x i8] c"NULL\00"
define void @any2c(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret void
}
unsigned int deviceRobotInfraredDetectorGetSoftwareRevision() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @deviceRobotInfraredDetectorGetSoftwareRevision() {
ret i32 1
}
void rop3_231_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk1 = S ^ T;
  stk2 = T ^ *D;
  stk1 = stk1 & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_231_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_231_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
xor    %dl,%cl
xor    %sil,%dl
and    %cl,%dl
or     %sil,%dl
not    %dl
and    %sil,%al
or     %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_231_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = load i8*, i8** %4
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = xor i32 %16, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %8
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %8
%25 = zext i8 %24 to i32
%26 = and i32 %23, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %7
%28 = load i8, i8* %7
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = trunc i32 %30 to i8
store i8 %31, i8* %7
%32 = load i8, i8* %7
%33 = zext i8 %32 to i32
%34 = load i8, i8* %5
%35 = zext i8 %34 to i32
%36 = xor i32 %35, -1
%37 = and i32 %33, %36
%38 = load i8*, i8** %4
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = load i8, i8* %5
%42 = zext i8 %41 to i32
%43 = and i32 %40, %42
%44 = or i32 %37, %43
%45 = trunc i32 %44 to i8
%46 = load i8*, i8** %4
store i8 %45, i8* %46
ret void
}

LLVM IR (-O2):
define void @rop3_231_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = xor i8 %5, %2
%7 = and i8 %6, %4
%8 = or i8 %7, %1
%9 = xor i8 %8, -1
%10 = and i8 %5, %1
%11 = or i8 %10, %9
store i8 %11, i8* %0
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t hash_32(int val, unsigned int bits) {
  uint32_t hash = val * 0x9e370001UL;
  return hash >> (32 - bits);
}


x86 assembly (clang, -O0):
<hash_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movabs $0x9e370001,%rcx
imul   %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_32>:
mov    %esi,%ecx
imul   $0x9e370001,%edi,%eax
neg    %cl
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @hash_32(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* %3
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 2654404609
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = sub i32 32, %11
%13 = ashr i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @hash_32(i32 %0, i32 %1) {
%3 = mul i32 %0, -1640562687
%4 = sub i32 32, %1
%5 = ashr i32 %3, %4
ret i32 %5
}
int get_min_empty(int num_buckets) { return (int)(num_buckets * (1.0 - .93)); }


x86 assembly (clang, -O0):
<get_min_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_min_empty>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @get_min_empty(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 0x3FB1EB851EB851E8
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_min_empty(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 0x3FB1EB851EB851E8
%4 = fptosi double %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void get_time(int *time) {
  printf("Years: ");
  scanf(" %d", time);
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1040 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"Years: \00"
@.str.1 = [4 x i8] c" %d\00"
define void @get_time(i32* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %0)
ret void
}
const unsigned long long int _clock_tic() {
  unsigned long long int x;
  __asm__ volatile("rdtsc\n" : "=A"(x));
  return x;
}


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

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

LLVM IR (-O0):
define i64 @_clock_tic() {
%1 = alloca i64
%2 = call i64 asm sideeffect "rdtsc\0A", "=A,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @_clock_tic() {
%1 = tail call i64 asm sideeffect "rdtsc\0A", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int dummy1(void) {
  printf("Called dummy1()\n");
  return 1;
}


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"Called dummy1()\00"
define i32 @dummy1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 1
}
void handle_sigusr1(int nsignal) {}


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

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

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

LLVM IR (-O2):
define void @handle_sigusr1(i32 %0) {
ret void
}
__attribute__((always_)) void __might_sleep(const char *file, int line,
                                            int preempt_offset) {}


x86 assembly (clang, -O0):
<__might_sleep>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @__might_sleep(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_interrupt_handler();
void USART1_IRQHandler() { serial_interrupt_handler(); }


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

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

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

LLVM IR (-O2):
define void @USART1_IRQHandler() {
%1 = tail call i32 (...) @serial_interrupt_handler()
ret void
}
void fun(char *t1, char *t2) {
  char temp;
  temp = *t1;
  *t1 = *t2;
  *t2 = temp;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

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

LLVM IR (-O2):
define void @fun(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ initTermios(int);
int /*<<< orphan*/ resetTermios();
char getch_(int echo) {
  char ch;
  initTermios(echo);
  ch = getchar();
  resetTermios();
  return ch;
}


x86 assembly (clang, -O0):
<getch_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <initTermios@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
mov    $0x0,%al
call   1030 <resetTermios@plt>
movsbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch_>:
push   %rbx
call   1050 <initTermios@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <resetTermios@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @getch_(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @initTermios(i32 %4)
%6 = call signext i8 (...) @getchar()
store i8 %6, i8* %3
%7 = call i32 (...) @resetTermios()
%8 = load i8, i8* %3
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @getch_(i32 %0) {
%2 = tail call i32 @initTermios(i32 %0)
%3 = tail call signext i8 (...) @getchar()
%4 = tail call i32 (...) @resetTermios()
ret i8 %3
}
int test_jnxguid() {
  jnx_log(0,
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/AlexsJones/jnxlibc/refs/heads/master/test/"
          "unit/test_jnxguid.c",
          __FUNCTION__, 67, "Running test for jnxguid");
  ;
  test_generate_guid();
  test_compare_guid();
  test_string();
  return 0;
}


x86 assembly (clang, -O0):
<test_jnxguid>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xeb3(%rip),%rsi
lea    0xf44(%rip),%rdx
mov    $0x43,%ecx
lea    0xf45(%rip),%r8
mov    $0x0,%al
call   1030 <jnx_log@plt>
mov    $0x0,%al
call   1060 <test_generate_guid@plt>
mov    $0x0,%al
call   1040 <test_compare_guid@plt>
mov    $0x0,%al
call   1050 <test_string@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_jnxguid>:
push   %rax
lea    0xeb8(%rip),%rsi
lea    0xf49(%rip),%rdx
lea    0xf4f(%rip),%r8
xor    %edi,%edi
mov    $0x43,%ecx
xor    %eax,%eax
call   1030 <jnx_log@plt>
xor    %eax,%eax
call   1060 <test_generate_guid@plt>
xor    %eax,%eax
call   1040 <test_compare_guid@plt>
xor    %eax,%eax
call   1050 <test_string@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AlexsJones/jnxlibc/refs/heads/master/test/unit/test_jnxguid.c\00"
@__FUNCTION__.test_jnxguid = [13 x i8] c"test_jnxguid\00"
@.str.1 = [25 x i8] c"Running test for jnxguid\00"
define i32 @test_jnxguid() {
%1 = call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @jnx_log to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_jnxguid, i64 0, i64 0), i32 67, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (...) @test_generate_guid()
%3 = call i32 (...) @test_compare_guid()
%4 = call i32 (...) @test_string()
ret i32 0
}

LLVM IR (-O2):
@.str = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AlexsJones/jnxlibc/refs/heads/master/test/unit/test_jnxguid.c\00"
@__FUNCTION__.test_jnxguid = [13 x i8] c"test_jnxguid\00"
@.str.1 = [25 x i8] c"Running test for jnxguid\00"
define i32 @test_jnxguid() {
%1 = tail call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @jnx_log to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_jnxguid, i64 0, i64 0), i32 67, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @test_generate_guid()
%3 = tail call i32 (...) @test_compare_guid()
%4 = tail call i32 (...) @test_string()
ret i32 0
}
/* Variables and functions */
void *android_alloc(size_t);
void *_android_array_alloc(size_t itemSize, size_t count) {
  return android_alloc(itemSize * count);
}


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

x86 assembly (clang, -O2):
<_android_array_alloc>:
imul   %rsi,%rdi
jmp    1030 <android_alloc@plt>

LLVM IR (-O0):
define i8* @_android_array_alloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = mul i64 %5, %6
%8 = call i8* @android_alloc(i64 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @_android_array_alloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @android_alloc(i64 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
int main() {
  void *x = malloc(1);
  void *y = x;
  free(x);
  if (x != y) {
    *(void *)0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1161 <main+0x41>
jmp    1161 <main+0x41>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%2 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_adds_pi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test37(__m64 a, __m64 b) { return _mm_adds_pi8(a, b); }


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

x86 assembly (clang, -O2):
<test37>:
jmp    1030 <_mm_adds_pi8@plt>

LLVM IR (-O0):
define i32 @test37(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 @_mm_adds_pi8(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test37(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_adds_pi8(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int list_comparator_uint64_t(const void *a, const void *b) {
  return (*(uint64_t *)a < *(uint64_t *)b) - (*(uint64_t *)a > *(uint64_t *)b);
}


x86 assembly (clang, -O0):
<list_comparator_uint64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x10(%rbp),%rdx
cmp    (%rdx),%rcx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_comparator_uint64_t>:
mov    (%rdi),%rcx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%rcx
setl   %al
setg   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @list_comparator_uint64_t(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 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = icmp slt i64 %7, %10
%12 = zext i1 %11 to i32
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to i64*
%15 = load i64, i64* %14
%16 = load i8*, i8** %4
%17 = bitcast i8* %16 to i64*
%18 = load i64, i64* %17
%19 = icmp sgt i64 %15, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @list_comparator_uint64_t(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp sgt i64 %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int squares(int);
int main() {
  int n;
  while (1) {
    scanf("%d", &n);
    if (n == 0)
      break;
    printf("%d\n", squares(n));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    115e <main+0x2e>
jmp    1179 <main+0x49>
mov    -0x8(%rbp),%edi
call   1040 <squares@plt>
mov    %eax,%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
test   %edi,%edi
je     1192 <main+0x62>
lea    0xeaa(%rip),%r14
lea    0xea0(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
call   1040 <squares@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
test   %edi,%edi
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %8
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %12
8: ; preds = %3
%9 = load i32, i32* %2
%10 = call i32 @squares(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %3
12: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @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 = icmp eq i32 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %11, %6 ], [ %4, %0 ]
%8 = call i32 @squares(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ enfshut(int, int /*<<< orphan*/ *, char const *);
void efshut(FILE *fp, const char *fname) { enfshut(1, fp, fname); }


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

x86 assembly (clang, -O2):
<efshut>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <enfshut@plt>

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

LLVM IR (-O2):
define void @efshut(i32* %0, i8* %1) {
%3 = tail call i32 @enfshut(i32 1, i32* %0, i8* %1)
ret void
}
int test_imm_76uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x76 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_76uint64_midword_mem>:
testb  $0x76,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_76uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 7733248
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ nios_pkt_8x16_pack(int *, int, int, int, int /*<<< orphan*/);
void nios_pkt_8x16_resp_pack(uint8_t *buf, uint8_t target, bool write,
                             uint8_t addr, uint16_t data, bool success) {
  nios_pkt_8x16_pack(buf, target, write, addr, data);
  if (success) {
    buf[2] |= (1 << 1);
  }
}


x86 assembly (clang, -O0):
<nios_pkt_8x16_resp_pack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1030 <nios_pkt_8x16_pack@plt>
cmpl   $0x0,-0x1c(%rbp)
je     115a <nios_pkt_8x16_resp_pack+0x4a>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
or     $0x2,%ecx
mov    %ecx,0x8(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nios_pkt_8x16_resp_pack>:
push   %rbp
push   %rbx
push   %rax
mov    %r9d,%ebp
mov    %rdi,%rbx
call   1030 <nios_pkt_8x16_pack@plt>
test   %ebp,%ebp
je     1126 <nios_pkt_8x16_resp_pack+0x16>
orb    $0x2,0x8(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @nios_pkt_8x16_resp_pack(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @nios_pkt_8x16_pack(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4)
%8 = icmp eq i32 %5, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = getelementptr inbounds i32, i32* %0, i64 2
%11 = load i32, i32* %10
%12 = or i32 %11, 2
store i32 %12, i32* %10
br label %13
13: ; preds = %9, %6
ret void
}
/* Variables and functions */
char *my_strdup(char *);
char *par_getsl(char *, char *);
char *par_gets(char *block, char *name) {
  char *pp = par_getsl(block, name);
  return my_strdup(pp);
}


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

x86 assembly (clang, -O2):
<par_gets>:
push   %rax
call   1030 <par_getsl@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <my_strdup@plt>

LLVM IR (-O0):
define i8* @par_gets(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @par_getsl(i8* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i8* @my_strdup(i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @par_gets(i8* %0, i8* %1) {
%3 = tail call i8* @par_getsl(i8* %0, i8* %1)
%4 = tail call i8* @my_strdup(i8* %3)
ret i8* %4
}
unsigned int ktoh(unsigned int key) { return key % 1000; }


x86 assembly (clang, -O0):
<ktoh>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ktoh>:
mov    %edi,%eax
mov    %edi,%ecx
imul   $0x10624dd3,%rcx,%rcx
shr    $0x26,%rcx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ktoh(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = urem i32 %3, 1000
ret i32 %4
}

LLVM IR (-O2):
define i32 @ktoh(i32 %0) {
%2 = urem i32 %0, 1000
ret i32 %2
}
unsigned int config_cmd2(unsigned char bus, unsigned devfn, unsigned where) {
  return 0x80000000 | (bus << 16) | (devfn << 8) | (where & ~3);
}


x86 assembly (clang, -O0):
<config_cmd2>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x10,%eax
or     $0x80000000,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
and    $0xfffffffc,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_cmd2>:
mov    %edx,%eax
shl    $0x10,%edi
shl    $0x8,%esi
or     %edi,%esi
and    $0x7ffffffc,%eax
or     %esi,%eax
or     $0x80000000,%eax
ret

LLVM IR (-O0):
define i32 @config_cmd2(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 16
%10 = or i32 -2147483648, %9
%11 = load i32, i32* %5
%12 = shl i32 %11, 8
%13 = or i32 %10, %12
%14 = load i32, i32* %6
%15 = and i32 %14, -4
%16 = or i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @config_cmd2(i8 zeroext %0, i32 %1, i32 %2) {
%4 = zext i8 %0 to i32
%5 = shl nuw nsw i32 %4, 16
%6 = shl i32 %1, 8
%7 = and i32 %2, 2147483644
%8 = or i32 %6, %5
%9 = or i32 %8, %7
%10 = or i32 %9, -2147483648
ret i32 %10
}