xunge/DecIR huggingface dataset:
/* Variables and functions */
int str_index_of(char *, char *);
char *strndup(char *, int);
char *get_until(char *haystack, char *until) {
  int offset = str_index_of(haystack, until);
  return strndup(haystack, offset);
}


x86 assembly (clang, -O0):
<get_until>:
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 <str_index_of@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <strndup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_until>:
push   %rbx
mov    %rdi,%rbx
call   1030 <str_index_of@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <strndup@plt>

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

LLVM IR (-O2):
define noalias i8* @get_until(i8* %0, i8* %1) {
%3 = tail call i32 @str_index_of(i8* %0, i8* %1)
%4 = tail call i8* @strndup(i8* %0, i32 %3)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntDisable(int);
int /*<<< orphan*/ IntUnregister(int);
void DESIntUnregister(uint32_t ui32Base) {
  ;
  IntDisable(112);
  IntUnregister(112);
}


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

x86 assembly (clang, -O2):
<DESIntUnregister>:
push   %rax
mov    $0x70,%edi
call   1030 <IntDisable@plt>
mov    $0x70,%edi
pop    %rax
jmp    1040 <IntUnregister@plt>

LLVM IR (-O0):
define void @DESIntUnregister(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @IntDisable(i32 112)
%4 = call i32 @IntUnregister(i32 112)
ret void
}

LLVM IR (-O2):
define void @DESIntUnregister(i32 %0) {
%2 = tail call i32 @IntDisable(i32 112)
%3 = tail call i32 @IntUnregister(i32 112)
ret void
}
int close_async_thread_pool() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @close_async_thread_pool() {
ret i32 0
}
/* Variables and functions */
int gpio_export_unexport(char *, int);
int /*<<< orphan*/ gpio_is_exported(int);
int gpio_unexport(int gpio) {
  if (gpio & (0x80000000))
    return 0;
  if (!gpio_is_exported(gpio))
    return 0;
  return gpio_export_unexport("/sys/class/gpio"
                              "/unexport",
                              gpio);
}


x86 assembly (clang, -O0):
<gpio_unexport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
je     1148 <gpio_unexport+0x28>
movl   $0x0,-0x4(%rbp)
jmp    1177 <gpio_unexport+0x57>
mov    -0x8(%rbp),%edi
call   1030 <gpio_is_exported@plt>
cmp    $0x0,%eax
jne    1165 <gpio_unexport+0x45>
movl   $0x0,-0x4(%rbp)
jmp    1177 <gpio_unexport+0x57>
mov    -0x8(%rbp),%esi
lea    0xe91(%rip),%rdi
call   1040 <gpio_export_unexport@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_unexport>:
push   %rbx
test   %edi,%edi
js     113f <gpio_unexport+0x1f>
mov    %edi,%ebx
call   1030 <gpio_is_exported@plt>
test   %eax,%eax
je     113f <gpio_unexport+0x1f>
lea    0xec9(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <gpio_export_unexport@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"/sys/class/gpio/unexport\00"
define i32 @gpio_unexport(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, -2147483648
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %16
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 @gpio_is_exported(i32 %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %8
store i32 0, i32* %2
br label %16
13: ; preds = %8
%14 = load i32, i32* %3
%15 = call i32 @gpio_export_unexport(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %14)
store i32 %15, i32* %2
br label %16
16: ; preds = %13, %12, %7
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [25 x i8] c"/sys/class/gpio/unexport\00"
define i32 @gpio_unexport(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = tail call i32 @gpio_is_exported(i32 %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @gpio_export_unexport(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %8
8: ; preds = %3, %1, %6
%9 = phi i32 [ %7, %6 ], [ 0, %1 ], [ 0, %3 ]
ret i32 %9
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
time_t time(time_t *t) {
  *t = 1359763200;
  return 0;
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x510c5700,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
movl   $0x510c5700,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @time(i32* nocapture writeonly %0) {
store i32 1359763200, i32* %0
ret i32 0
}
char uart_testc(void) {
  if ((*((volatile unsigned char *)(0x90000000 + 5)) & 0x01) == 0x01)
    return *((volatile unsigned char *)(0x90000000 + 0));
  else
    return 0;
}


x86 assembly (clang, -O0):
<uart_testc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x90000005,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    1129 <uart_testc+0x29>
mov    $0x90000000,%eax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
jmp    112d <uart_testc+0x2d>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_testc>:
mov    $0x90000000,%eax
testb  $0x1,0x5(%rax)
jne    110e <uart_testc+0xe>
xor    %eax,%eax
ret
mov    (%rax),%al
ret

LLVM IR (-O0):
define signext i8 @uart_testc() {
%1 = alloca i8
%2 = load volatile i8, i8* inttoptr (i64 2415919109 to i8*)
%3 = zext i8 %2 to i32
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load volatile i8, i8* inttoptr (i64 2415919104 to i8*)
store i8 %7, i8* %1
br label %9
8: ; preds = %0
store i8 0, i8* %1
br label %9
9: ; preds = %8, %6
%10 = load i8, i8* %1
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @uart_testc() {
%1 = load volatile i8, i8* inttoptr (i64 2415919109 to i8*)
%2 = and i8 %1, 1
%3 = icmp eq i8 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = load volatile i8, i8* inttoptr (i64 2415919104 to i8*)
br label %6
6: ; preds = %0, %4
%7 = phi i8 [ %5, %4 ], [ 0, %0 ]
ret i8 %7
}
int Operand_ars_encode(unsigned int *valp) {
  int error;
  error = (*valp & ~0xf) != 0;
  return error;
}


x86 assembly (clang, -O0):
<Operand_ars_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xfffffff0,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_ars_encode>:
xor    %eax,%eax
cmpl   $0x10,(%rdi)
setae  %al
ret

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

LLVM IR (-O2):
define i32 @Operand_ars_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ugt i32 %2, 15
%4 = zext i1 %3 to i32
ret i32 %4
}
_raise() {}


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

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

LLVM IR (-O0):
define i32 @_raise() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @_raise() {
ret i32 undef
}
/* Type definitions */
typedef int __pid_t;

/* Variables and functions */
int getpid();
int getppid();
int /*<<< orphan*/ printf(char *, int);
int main() {
  __pid_t pid = getpid();
  __pid_t ppid = getppid();
  printf("pid %d\n", pid);
  printf("ppid %d\n", ppid);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getppid@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getppid@plt>
mov    %eax,%ebp
lea    0xeb5(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
lea    0xea6(%rip),%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"pid %d\0A\00"
@.str.1 = [9 x i8] c"ppid %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getpid()
store i32 %3, i32* %1
%4 = call i32 (...) @getppid()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"pid %d\0A\00"
@.str.1 = [9 x i8] c"ppid %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 (...) @getppid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *cwd = getenv("PWD");
  printf("cwd: %s", cwd);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"PWD\00"
@.str.1 = [8 x i8] c"cwd: %s\00"
define i32 @main() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void mailimf_id_right_free(char *id_right) { free(id_right); }


x86 assembly (clang, -O0):
<mailimf_id_right_free>:
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):
<mailimf_id_right_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @mailimf_id_right_free(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 @mailimf_id_right_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int colpt(void *, int);
int ccollapse(void *v) { return colpt(v, 1); }


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

x86 assembly (clang, -O2):
<ccollapse>:
mov    $0x1,%esi
jmp    1030 <colpt@plt>

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

LLVM IR (-O2):
define i32 @ccollapse(i8* %0) {
%2 = tail call i32 @colpt(i8* %0, i32 1)
ret i32 %2
}
void userSetup() {}


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

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

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

LLVM IR (-O2):
define void @userSetup() {
ret void
}
int Max(int a, int b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<Max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <Max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <Max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @Max(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @Max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gpio_output(int, int, int /*<<< orphan*/);
void pwr_off(void) { gpio_output(9, 10, 0); }


x86 assembly (clang, -O0):
<pwr_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9,%edi
mov    $0xa,%esi
xor    %edx,%edx
call   1030 <gpio_output@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwr_off>:
mov    $0x9,%edi
mov    $0xa,%esi
xor    %edx,%edx
jmp    1030 <gpio_output@plt>

LLVM IR (-O0):
define void @pwr_off() {
%1 = call i32 @gpio_output(i32 9, i32 10, i32 0)
ret void
}

LLVM IR (-O2):
define void @pwr_off() {
%1 = tail call i32 @gpio_output(i32 9, i32 10, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
__attribute__((no, noclone)) void foo(char *p, const char *q, const char *r) {
  strcpy(p, q);
  strcat(p, r);
  strcat(p, "abcd");
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1040 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
lea    0xebf(%rip),%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strcat@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"abcd\00"
define void @foo(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strcpy(i8* %0, i8* %1)
%5 = tail call i32 @strcat(i8* %0, i8* %2)
%6 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void func() {
  static int a = 10;
  a++;
  printf("a=%d\n", a);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0e(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f05(%rip)
mov    0x2eff(%rip),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
mov    0x2f12(%rip),%esi
add    $0x1,%esi
mov    %esi,0x2f09(%rip)
lea    0xeda(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@func.a = internal global i32 10
@.str = [6 x i8] c"a=%d\0A\00"
define void @func() {
%1 = load i32, i32* @func.a
%2 = add nsw i32 %1, 1
store i32 %2, i32* @func.a
%3 = load i32, i32* @func.a
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@func.a = internal unnamed_addr global i32 10
@.str = [6 x i8] c"a=%d\0A\00"
define void @func() {
%1 = load i32, i32* @func.a
%2 = add nsw i32 %1, 1
store i32 %2, i32* @func.a
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *
createUnaryGeneralMathsExpression(struct memorycontainer *, int);
struct memorycontainer *
createLogExpression(struct memorycontainer *expression) {
  return createUnaryGeneralMathsExpression(expression, 0x000C);
}


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

x86 assembly (clang, -O2):
<createLogExpression>:
mov    $0xc,%esi
jmp    1030 <createUnaryGeneralMathsExpression@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createLogExpression(%struct.memorycontainer* %0) {
%2 = alloca %struct.memorycontainer*
store %struct.memorycontainer* %0, %struct.memorycontainer** %2
%3 = load %struct.memorycontainer*, %struct.memorycontainer** %2
%4 = call %struct.memorycontainer* @createUnaryGeneralMathsExpression(%struct.memorycontainer* %3, i32 12)
ret %struct.memorycontainer* %4
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createLogExpression(%struct.memorycontainer* %0) {
%2 = tail call %struct.memorycontainer* @createUnaryGeneralMathsExpression(%struct.memorycontainer* %0, i32 12)
ret %struct.memorycontainer* %2
}
void funcion_v_iii(int a, int b, int c) {
  int w;
  w = 40;
}


x86 assembly (clang, -O0):
<funcion_v_iii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x28,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @funcion_v_iii(i32 %0, i32 %1, i32 %2) {
ret void
}
void gtk_text_buffer_insert_range() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_icon_size_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void D() { printf("B\n"); }


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

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

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

LLVM IR (-O2):
@str = [2 x i8] c"B\00"
define void @D() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct feature_pair {
  int dummy;
};
struct CovariateAnalysis {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void _emitJSONUniUnusedL(const struct feature_pair *pair,
                         const struct CovariateAnalysis *covan, FILE *fp) {}


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

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

LLVM IR (-O0):
%struct.feature_pair = type { i32 }
%struct.CovariateAnalysis = type { i32 }
define void @_emitJSONUniUnusedL(%struct.feature_pair* %0, %struct.CovariateAnalysis* %1, i32* %2) {
%4 = alloca %struct.feature_pair*
%5 = alloca %struct.CovariateAnalysis*
%6 = alloca i32*
store %struct.feature_pair* %0, %struct.feature_pair** %4
store %struct.CovariateAnalysis* %1, %struct.CovariateAnalysis** %5
store i32* %2, i32** %6
ret void
}

LLVM IR (-O2):
%struct.feature_pair = type { i32 }
%struct.CovariateAnalysis = type { i32 }
define void @_emitJSONUniUnusedL(%struct.feature_pair* nocapture %0, %struct.CovariateAnalysis* nocapture %1, i32* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ return_union_hom_fp();
int /*<<< orphan*/ take_union_hom_fp(int /*<<< orphan*/);
void test_union_hom_fp() { take_union_hom_fp(return_union_hom_fp()); }


x86 assembly (clang, -O0):
<test_union_hom_fp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <return_union_hom_fp@plt>
mov    %eax,%edi
call   1040 <take_union_hom_fp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_union_hom_fp>:
push   %rax
xor    %eax,%eax
call   1030 <return_union_hom_fp@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <take_union_hom_fp@plt>

LLVM IR (-O0):
define void @test_union_hom_fp() {
%1 = call i32 (...) @return_union_hom_fp()
%2 = call i32 @take_union_hom_fp(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_union_hom_fp() {
%1 = tail call i32 (...) @return_union_hom_fp()
%2 = tail call i32 @take_union_hom_fp(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void ps(char *s) {
  int c;
  while (1) {
    c = *s;
    if (c == 0)
      break;
    printf("%c", c);
    s++;
  }
}


x86 assembly (clang, -O0):
<ps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1135 <ps+0x25>
jmp    1155 <ps+0x45>
mov    -0xc(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <ps+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1146 <ps+0x36>
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0xed8(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ps+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @ps(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int sqrt(float);
float g1Dash(float x) { return 1 / (2 * sqrt(x + 6)); }


x86 assembly (clang, -O0):
<g1Dash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
call   1030 <sqrt@plt>
mov    %eax,%ecx
shl    $0x1,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g1Dash>:
push   %rax
addss  0xee7(%rip),%xmm0
call   1030 <sqrt@plt>
lea    (%rax,%rax,1),%ecx
add    $0x1,%ecx
add    %eax,%eax
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @g1Dash(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fadd float %3, 6.000000e+00
%5 = call i32 @sqrt(float %4)
%6 = mul nsw i32 2, %5
%7 = sdiv i32 1, %6
%8 = sitofp i32 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @g1Dash(float %0) {
%2 = fadd float %0, 6.000000e+00
%3 = tail call i32 @sqrt(float %2)
%4 = shl nsw i32 %3, 1
%5 = or i32 %4, 1
%6 = icmp ult i32 %5, 3
%7 = select i1 %6, i32 %4, i32 0
%8 = sitofp i32 %7 to float
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, char *);
void fsetwd(char *buffer) { syscall(0x4657, buffer); }


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

x86 assembly (clang, -O2):
<fsetwd>:
mov    %rdi,%rsi
mov    $0x4657,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define void @fsetwd(i8* %0) {
%2 = tail call i32 @syscall(i32 18007, i8* %0)
ret void
}
/* Variables and functions */
int _getbytes(char *, int, int);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_getbytes(char *buf, int cnt, int block) {
  int ret;
  monLock();
  ret = _getbytes(buf, cnt, block);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_getbytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1030 <monLock@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <_getbytes@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <monUnlock@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_getbytes>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <monLock@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1050 <_getbytes@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <monUnlock@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mon_getbytes(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i32 (...) @monLock()
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @_getbytes(i8* %9, i32 %10, i32 %11)
store i32 %12, i32* %7
%13 = call i32 (...) @monUnlock()
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
define i32 @mon_getbytes(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @monLock()
%5 = tail call i32 @_getbytes(i8* %0, i32 %1, i32 %2)
%6 = tail call i32 (...) @monUnlock()
ret i32 %5
}
/* Variables and functions */
int mcfioC_NTupleSubVar(int, int, int, int, char *);
int mcfio_ntuplesubvar_(int *stream, int *ntupleid, int *ivar, int *multIndex,
                        char *version, int ll) {
  int ivarF, multIndexF;
  ivarF = (*ivar) - 1;
  multIndexF = (*multIndex) - 1;
  return mcfioC_NTupleSubVar(*stream, *ntupleid, ivarF, multIndexF, version);
}


x86 assembly (clang, -O0):
<mcfio_ntuplesubvar_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x28(%rbp),%r8
call   1030 <mcfioC_NTupleSubVar@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcfio_ntuplesubvar_>:
mov    (%rdx),%edx
add    $0xffffffff,%edx
mov    (%rcx),%ecx
add    $0xffffffff,%ecx
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <mcfioC_NTupleSubVar@plt>

LLVM IR (-O0):
define i32 @mcfio_ntuplesubvar_(i32* %0, i32* %1, i32* %2, i32* %3, i8* %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32* %0, i32** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%15 = load i32*, i32** %9
%16 = load i32, i32* %15
%17 = sub nsw i32 %16, 1
store i32 %17, i32* %13
%18 = load i32*, i32** %10
%19 = load i32, i32* %18
%20 = sub nsw i32 %19, 1
store i32 %20, i32* %14
%21 = load i32*, i32** %7
%22 = load i32, i32* %21
%23 = load i32*, i32** %8
%24 = load i32, i32* %23
%25 = load i32, i32* %13
%26 = load i32, i32* %14
%27 = load i8*, i8** %11
%28 = call i32 @mcfioC_NTupleSubVar(i32 %22, i32 %24, i32 %25, i32 %26, i8* %27)
ret i32 %28
}

LLVM IR (-O2):
define i32 @mcfio_ntuplesubvar_(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3, i8* %4, i32 %5) {
%7 = load i32, i32* %2
%8 = add nsw i32 %7, -1
%9 = load i32, i32* %3
%10 = add nsw i32 %9, -1
%11 = load i32, i32* %0
%12 = load i32, i32* %1
%13 = tail call i32 @mcfioC_NTupleSubVar(i32 %11, i32 %12, i32 %8, i32 %10, i8* %4)
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ gfx_close();
void gui_close(void) { gfx_close(); }


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

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

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

LLVM IR (-O2):
define void @gui_close() {
%1 = tail call i32 (...) @gfx_close()
ret void
}
void ub_io_account_clean(struct address_space *mapping) {}


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

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

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

LLVM IR (-O2):
%struct.address_space = type opaque
define void @ub_io_account_clean(%struct.address_space* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned int list_remove(int /*<<< orphan*/, int /*<<< orphan*/ *);
bool test_list_remove_null_params(void) {
  bool pass = false;
  unsigned int res = list_remove(0, NULL);
  if (res == 1) {
    pass = true;
  }
  return pass;
}


x86 assembly (clang, -O0):
<test_list_remove_null_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <list_remove@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    113e <test_list_remove_null_params+0x2e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_list_remove_null_params>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <list_remove@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @test_list_remove_null_params() {
%1 = tail call i32 @list_remove(i32 0, i32* null)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ disk_initialize();
void block_initialize(void) { disk_initialize(); }


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

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

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

LLVM IR (-O2):
define void @block_initialize() {
%1 = tail call i32 (...) @disk_initialize()
ret void
}
/* Variables and functions */
unsigned char *stat_proc_verf_time_location(unsigned char **);
int stat_proc_n_time_ranges_index(unsigned char **sec) {
  unsigned char *ptr;
  ptr = stat_proc_verf_time_location(sec);
  if (ptr == NULL)
    return -1;
  return ptr - sec[4] + 7;
}


x86 assembly (clang, -O0):
<stat_proc_n_time_ranges_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <stat_proc_verf_time_location@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1140 <stat_proc_n_time_ranges_index+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <stat_proc_n_time_ranges_index+0x46>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    0x20(%rcx),%rcx
sub    %rcx,%rax
add    $0x7,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat_proc_n_time_ranges_index>:
push   %rbx
mov    %rdi,%rbx
call   1030 <stat_proc_verf_time_location@plt>
test   %rax,%rax
je     1126 <stat_proc_n_time_ranges_index+0x16>
sub    0x20(%rbx),%eax
add    $0x7,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @stat_proc_n_time_ranges_index(i8** %0) {
%2 = tail call i8* @stat_proc_verf_time_location(i8** %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8*, i8** %0, i64 4
%6 = load i8*, i8** %5
%7 = ptrtoint i8* %2 to i64
%8 = ptrtoint i8* %6 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
%11 = add i32 %10, 7
br label %12
12: ; preds = %1, %4
%13 = phi i32 [ %11, %4 ], [ -1, %1 ]
ret i32 %13
}
int test_imm_2Euint8_mem(unsigned char *val) {
  return ((*val) & (0x2E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Euint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x2e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_2Euint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 46
%7 = icmp ne i32 %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_2Euint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 46
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int strlen(char *);
char toupper(char);
void str_upper(char *str) {
  int i = 0;
  int length = strlen(str);
  for (i = 0; i < length; i++)
    str[i] = toupper(str[i]);
  return;
}


x86 assembly (clang, -O0):
<str_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    117e <str_upper+0x5e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <str_upper+0x26>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_upper>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1040 <strlen@plt>
test   %eax,%eax
jle    1157 <str_upper+0x37>
mov    %eax,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <str_upper+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @str_upper(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @toupper(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %1
ret void
}
/* Variables and functions */
unsigned char nvmem_write(int, int, int /*<<< orphan*/, unsigned char *);
unsigned char nvmem_set_mac_address(unsigned char *mac) {
  return nvmem_write((6), (6), 0, mac);
}


x86 assembly (clang, -O0):
<nvmem_set_mac_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x6,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1030 <nvmem_write@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvmem_set_mac_address>:
mov    %rdi,%rcx
mov    $0x6,%edi
mov    $0x6,%esi
xor    %edx,%edx
jmp    1030 <nvmem_write@plt>

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

LLVM IR (-O2):
define zeroext i8 @nvmem_set_mac_address(i8* %0) {
%2 = tail call zeroext i8 @nvmem_write(i32 6, i32 6, i32 0, i8* %0)
ret i8 %2
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *strdup(const char *s) {
  char *t;
  int l;
  if (!s)
    return 0;
  l = strlen(s) + 1;
  t = (char *)malloc(l);
  if (!t)
    return 0;
  memcpy(t, s, l);
  return t;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    119f <strdup+0x6f>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1187 <strdup+0x57>
movq   $0x0,-0x8(%rbp)
jmp    119f <strdup+0x6f>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %rbp
push   %r14
push   %rbx
test   %rdi,%rdi
je     1164 <strdup+0x34>
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %eax,%ebp
add    $0x1,%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     1164 <strdup+0x34>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
jmp    1166 <strdup+0x36>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = icmp eq i64 %6, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 @memcpy(i8* %7, i8* %0, i32 %5)
br label %11
11: ; preds = %3, %1, %9
%12 = phi i8* [ %7, %9 ], [ null, %1 ], [ null, %3 ]
ret i8* %12
}
/* Type definitions */
typedef int int_fast32_t;
typedef int int64_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int64_t tuple(const int32_t x, const int32_t y) {
  int_fast32_t min, max;
  if (x < y) {
    min = x;
    max = y;
  } else {
    min = y;
    max = x;
  }
  return (max * (max + 1)) / 2 + min;
}


x86 assembly (clang, -O0):
<tuple>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    112d <tuple+0x2d>
mov    -0x8(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x18(%rbp)
jmp    113b <tuple+0x3b>
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tuple>:
cmp    %rsi,%rdi
mov    %edi,%eax
cmovl  %esi,%eax
cmovl  %edi,%esi
lea    0x1(%rax),%ecx
imul   %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
add    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @tuple(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
%5 = select i1 %3, i64 %1, i64 %0
%6 = trunc i64 %5 to i32
%7 = trunc i64 %4 to i32
%8 = add nsw i32 %6, 1
%9 = mul nsw i32 %8, %6
%10 = sdiv i32 %9, 2
%11 = add nsw i32 %10, %7
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ myclock(int);
int /*<<< orphan*/ mywrapper();
int /*<<< orphan*/ sleep(int);
void loop() {
  while (1) {
    myclock(999);
    mywrapper();
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
jmp    1139 <loop+0x9>
mov    $0x3e7,%edi
call   1040 <myclock@plt>
mov    $0x0,%al
call   1030 <mywrapper@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1139 <loop+0x9>

x86 assembly (clang, -O2):
<loop>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x3e7,%edi
call   1040 <myclock@plt>
xor    %eax,%eax
call   1030 <mywrapper@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1140 <loop+0x10>

LLVM IR (-O0):
define void @loop() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @myclock(i32 999)
%3 = call i32 (...) @mywrapper()
%4 = call i32 @sleep(i32 1)
br label %1
}

LLVM IR (-O2):
define void @loop() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @myclock(i32 999)
%3 = tail call i32 (...) @mywrapper()
%4 = tail call i32 @sleep(i32 1)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ generateFibonacci(int);
int main(void) { generateFibonacci(40); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @generateFibonacci(i32 40)
ret i32 0
}