xunge/DecIR huggingface dataset:
/* Variables and functions */
char *ffindex_get_data_by_offset(char *data, size_t offset) {
  return data + offset;
}


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

x86 assembly (clang, -O2):
<ffindex_get_data_by_offset>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i8* @ffindex_get_data_by_offset(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = getelementptr inbounds i8, i8* %5, i64 %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @ffindex_get_data_by_offset(i8* readnone %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
ret i8* %3
}
void swap(char *a, char *b) {
  char tmp;
  tmp = *a;
  *a = *b;
  *b = tmp;
}


x86 assembly (clang, -O0):
<swap>:
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):
<swap>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @swap(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 @swap(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
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_write;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int, void const *, size_t);
ssize_t write(int fd, const void *buf, size_t count) {
  return syscall(SYS_write, fd, buf, count);
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_write = global i32 0
define i32 @write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* @SYS_write
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @syscall(i32 %7, i32 %8, i8* %9, i64 %10)
ret i32 %11
}

LLVM IR (-O2):
@SYS_write = global i32 0
define i32 @write(i32 %0, i8* %1, i64 %2) {
%4 = load i32, i32* @SYS_write
%5 = tail call i32 @syscall(i32 %4, i32 %0, i8* %1, i64 %2)
ret i32 %5
}
/* Variables and functions */
int partition(int *, int, int);
void _quick_sort(int a[], int l, int r) {
  int j;
  if (l < r) {
    j = partition(a, l, r);
    _quick_sort(a, l, j - 1);
    _quick_sort(a, j + 1, r);
  }
}


x86 assembly (clang, -O0):
<_quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <_quick_sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <_quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <_quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <_quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <_quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <_quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @_quick_sort(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
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @partition(i32* %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = load i32*, i32** %4
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
%23 = load i32, i32* %6
br label %24
24: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @_quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @_quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
long long_double_from_double(int);
int main(void) {
  assert(long_double_from_double(42.) == 42.L);
  assert(long_double_from_double(-42.) == -42.L);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2a,%edi
call   1040 <long_double_from_double@plt>
mov    %rax,-0x10(%rbp)
fildll -0x10(%rbp)
flds   0xec1(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setnp  %cl
sete   %al
and    %cl,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0xffffffd6,%edi
call   1040 <long_double_from_double@plt>
mov    %rax,-0x8(%rbp)
fildll -0x8(%rbp)
flds   0xe98(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setnp  %cl
sete   %al
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
call   1040 <long_double_from_double@plt>
xor    %edi,%edi
cmp    $0x2a,%rax
sete   %dil
call   1030 <assert@plt>
mov    $0xffffffd6,%edi
call   1040 <long_double_from_double@plt>
xor    %edi,%edi
cmp    $0xffffffffffffffd6,%rax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i64 @long_double_from_double(i32 42)
%2 = sitofp i64 %1 to x86_fp80
%3 = fcmp oeq x86_fp80 %2, 0xK4004A800000000000000
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i64 @long_double_from_double(i32 -42)
%7 = sitofp i64 %6 to x86_fp80
%8 = fcmp oeq x86_fp80 %7, 0xKC004A800000000000000
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @long_double_from_double(i32 42)
%2 = icmp eq i64 %1, 42
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @long_double_from_double(i32 -42)
%6 = icmp eq i64 %5, -42
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ quicksort_rec(void *, int /*<<< orphan*/, size_t, size_t,
                                 int (*)(void const *, void const *));
void quicksort(void *base, size_t nmemb, size_t size,
               int (*compare)(const void *, const void *)) {
  if (base == NULL || compare == NULL)
    return;
  quicksort_rec(base, 0, nmemb - 1, size, compare);
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113e <quicksort+0x2e>
cmpq   $0x0,-0x20(%rbp)
jne    1143 <quicksort+0x33>
jmp    115e <quicksort+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
sub    $0x1,%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
xor    %esi,%esi
call   1030 <quicksort_rec@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
test   %rdi,%rdi
je     112e <quicksort+0x1e>
mov    %rcx,%r8
test   %rcx,%rcx
je     112e <quicksort+0x1e>
mov    %rdx,%rcx
mov    %rsi,%rdx
add    $0xffffffffffffffff,%rdx
xor    %esi,%esi
jmp    1030 <quicksort_rec@plt>
ret

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

LLVM IR (-O2):
define void @quicksort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = icmp eq i8* %0, null
%6 = icmp eq i32 (i8*, i8*)* %3, null
%7 = or i1 %5, %6
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = add i64 %1, -1
%10 = tail call i32 @quicksort_rec(i8* %0, i32 0, i64 %9, i64 %2, i32 (i8*, i8*)* %3)
br label %11
11: ; preds = %4, %8
ret void
}
int f(int a0, int a1, int a2, int a3, int a4, int a5) {
  return a0 + a1 + a2 + a3 + a4 + a5;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
add    %ecx,%eax
add    %r8d,%eax
add    %r9d,%eax
ret

LLVM IR (-O0):
define i32 @f(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 = add nsw i32 %13, %14
%16 = load i32, i32* %9
%17 = add nsw i32 %15, %16
%18 = load i32, i32* %10
%19 = add nsw i32 %17, %18
%20 = load i32, i32* %11
%21 = add nsw i32 %19, %20
%22 = load i32, i32* %12
%23 = add nsw i32 %21, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = add nsw i32 %1, %0
%8 = add nsw i32 %7, %2
%9 = add nsw i32 %8, %3
%10 = add nsw i32 %9, %4
%11 = add nsw i32 %10, %5
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ printerr(int, char *);
int qword_eol(FILE *f) {
  int err;
  fprintf(f, "\n");
  err = fflush(f);
  printerr(2, "\n");
  return err;
}


x86 assembly (clang, -O0):
<qword_eol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1050 <fflush@plt>
mov    %eax,-0xc(%rbp)
mov    $0x2,%edi
lea    0xe9c(%rip),%rsi
call   1030 <printerr@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qword_eol>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    %rbx,%rdi
call   1050 <fflush@plt>
mov    %eax,%ebx
lea    0xeae(%rip),%rsi
mov    $0x2,%edi
call   1040 <printerr@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @qword_eol(i32* nocapture %0) {
%2 = tail call i32 @fputc(i32 10, i32* %0)
%3 = tail call i32 @fflush(i32* %0)
%4 = tail call i32 @printerr(i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ clear_screen();
int /*<<< orphan*/ menu();
void main() {
  clear_screen();
  menu();
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @clear_screen()
%2 = call i32 (...) @menu()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @clear_screen()
%2 = tail call i32 (...) @menu()
ret void
}
long UMASK(cmask)
int *cmask;
{ return ((long)umask((long)*cmask)); }


x86 assembly (clang, -O0):
<UMASK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rdi
mov    $0x0,%al
call   1030 <umask@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UMASK>:
push   %rax
movslq (%rdi),%rdi
xor    %eax,%eax
call   1030 <umask@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @UMASK(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = call i32 (i64, ...) bitcast (i32 (...)* @umask to i32 (i64, ...)*)(i64 %5)
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @UMASK(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sext i32 %2 to i64
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @umask to i32 (i64, ...)*)(i64 %3)
%5 = sext i32 %4 to i64
ret i64 %5
}
int do_765() { return 765; }


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

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

LLVM IR (-O0):
define i32 @do_765() {
ret i32 765
}

LLVM IR (-O2):
define i32 @do_765() {
ret i32 765
}
/* Variables and functions */
scalar_t__ malloc(int);
void *lst_create() {
  void *aux = (void *)malloc(2 * sizeof(void *));
  *(void **)aux = NULL;
  *(void **)(aux + sizeof(void *)) = NULL;
  return aux;
}


x86 assembly (clang, -O0):
<lst_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lst_create>:
push   %rax
mov    $0x10,%edi
call   1030 <malloc@plt>
xorps  %xmm0,%xmm0
movups %xmm0,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @lst_create() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 16)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = bitcast i8* %4 to i8**
store i8* null, i8** %5
%6 = load i8*, i8** %1
%7 = getelementptr i8, i8* %6, i64 8
%8 = bitcast i8* %7 to i8**
store i8* null, i8** %8
%9 = load i8*, i8** %1
ret i8* %9
}

LLVM IR (-O2):
define i8* @lst_create() {
%1 = tail call i64 @malloc(i32 16)
%2 = inttoptr i64 %1 to i8*
%3 = inttoptr i64 %1 to i8**
store i8* null, i8** %3
%4 = getelementptr i8, i8* %2, i64 8
%5 = bitcast i8* %4 to i8**
store i8* null, i8** %5
ret i8* %2
}
char *writeline(const char *buf, int fd) {
  int buf_len = strlen(buf);
  write(fd, buf, buf_len);
  return 0x0;
}


x86 assembly (clang, -O0):
<writeline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%edx
mov    $0x0,%al
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeline>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @writeline(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = load i8*, i8** %3
%11 = load i32, i32* %5
%12 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %9, i8* %10, i32 %11)
ret i8* null
}

LLVM IR (-O2):
define i8* @writeline(i8* %0, i32 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = trunc i64 %3 to i32
%5 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %1, i8* %0, i32 %4)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printout(int n, char *e, char *actual) {
  printf("Test %d: \texpected \"%s\"\n", n, e);
  printf("         \tgot      \"%s\"\n", actual);
}


x86 assembly (clang, -O0):
<printout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printout>:
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Test %d: \09expected \22%s\22\0A\00"
@.str.1 = [25 x i8] c" \09got \22%s\22\0A\00"
define void @printout(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = load i8*, i8** %6
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Test %d: \09expected \22%s\22\0A\00"
@.str.1 = [25 x i8] c" \09got \22%s\22\0A\00"
define void @printout(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
void print_sequence(void **seq_ptr) {}


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

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

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

LLVM IR (-O2):
define void @print_sequence(i8** nocapture %0) {
ret void
}
/* Variables and functions */
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
int starts_with(char *pattern, char *str) {
  int len = strlen(pattern);
  if (strncmp(pattern, str, len) == 0) {
    return 0;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<starts_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1162 <starts_with+0x42>
movl   $0x0,-0x4(%rbp)
jmp    1169 <starts_with+0x49>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<starts_with>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
neg    %rax
sbb    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @starts_with(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %6
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i64 @strncmp(i8* %9, i8* %10, i32 %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 0, i32* %3
br label %16
15: ; preds = %2
store i32 -1, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @starts_with(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp ne i64 %4, 0
%6 = sext i1 %5 to i32
ret i32 %6
}
void rop3_245_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = ~*D;
  stk1 = T | stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_245_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%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    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%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_245_1_1>:
mov    (%rdi),%al
mov    %edx,%ecx
or     %sil,%cl
or     %al,%cl
not    %cl
and    %al,%sil
and    %dl,%al
or     %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_245_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = or i8 %5, %4
%7 = xor i8 %6, -1
%8 = and i8 %4, %1
%9 = or i8 %8, %7
%10 = and i8 %4, %2
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
double test_tanh(double x) { return __builtin_tanh(x); }


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

x86 assembly (clang, -O2):
<test_tanh>:
jmp    1030 <tanh@plt>

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

LLVM IR (-O2):
define double @test_tanh(double %0) {
%2 = tail call double @tanh(double %0)
ret double %2
}
void gtk_fixed_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_fixed_get_type() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int fileOk(const char *fname) {
  FILE *fp = fopen(fname, "r");
  if (!fp)
    return 0;
  fclose(fp);
  return 1;
}


x86 assembly (clang, -O0):
<fileOk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <fileOk+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1167 <fileOk+0x47>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileOk>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <fileOk+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @fileOk(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void re_start_window_input() { fatal("Out of scripted events!"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Out of scripted events!\00"
define void @re_start_window_input() {
%1 = call i32 @fatal(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Out of scripted events!\00"
define void @re_start_window_input() {
%1 = tail call i32 @fatal(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ AES_KEY;

/* Variables and functions */
int /*<<< orphan*/ AES_decrypt(unsigned char const *, unsigned char *,
                               int /*<<< orphan*/ *);
int /*<<< orphan*/ AES_set_decrypt_key(unsigned char const *, int,
                                       int /*<<< orphan*/ *);
void aes_block_decrypt(const unsigned char *key, const unsigned char *cipher,
                       int blen, unsigned char *plain) {
  AES_KEY key_ctx;
  AES_set_decrypt_key(key, blen * 8, &key_ctx);
  AES_decrypt(cipher, plain, &key_ctx);
}


x86 assembly (clang, -O0):
<aes_block_decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
shl    $0x3,%esi
lea    -0x24(%rbp),%rdx
call   1030 <AES_set_decrypt_key@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    -0x24(%rbp),%rdx
call   1040 <AES_decrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_block_decrypt>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%r14
mov    %rsi,%rbx
lea    0x0(,%rdx,8),%esi
lea    0xc(%rsp),%r15
mov    %r15,%rdx
call   1030 <AES_set_decrypt_key@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <AES_decrypt@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @aes_block_decrypt(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = load i8*, i8** %5
%11 = load i32, i32* %7
%12 = mul nsw i32 %11, 8
%13 = call i32 @AES_set_decrypt_key(i8* %10, i32 %12, i32* %9)
%14 = load i8*, i8** %6
%15 = load i8*, i8** %8
%16 = call i32 @AES_decrypt(i8* %14, i8* %15, i32* %9)
ret void
}

LLVM IR (-O2):
define void @aes_block_decrypt(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
%7 = shl nsw i32 %2, 3
%8 = call i32 @AES_set_decrypt_key(i8* %0, i32 %7, i32* %5)
%9 = call i32 @AES_decrypt(i8* %1, i8* %3, i32* %5)
ret void
}
void PDMR3NsBwGroupSetLimit(void) {}


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

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

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

LLVM IR (-O2):
define void @PDMR3NsBwGroupSetLimit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void ps3_factory_reset(int ps3_ir) {
  puts("Begin Factory Reset\n");
  puts("End Factory Reset\n");
  return;
}


x86 assembly (clang, -O0):
<ps3_factory_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps3_factory_reset>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Begin Factory Reset\0A\00"
@.str.1 = [19 x i8] c"End Factory Reset\0A\00"
define void @ps3_factory_reset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Begin Factory Reset\0A\00"
@.str.1 = [19 x i8] c"End Factory Reset\0A\00"
define void @ps3_factory_reset(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dtoa(double, int, char *);
int /*<<< orphan*/ prints(int /*<<< orphan*/);
void printd(double d) {
  char buf[80];
  prints(dtoa(d, 7, buf));
}


x86 assembly (clang, -O0):
<printd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x60(%rbp),%rsi
mov    $0x7,%edi
call   1030 <dtoa@plt>
mov    %eax,%edi
call   1040 <prints@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printd>:
sub    $0x58,%rsp
mov    %rsp,%rsi
mov    $0x7,%edi
call   1030 <dtoa@plt>
mov    %eax,%edi
call   1040 <prints@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
define void @printd(double %0) {
%2 = alloca double
%3 = alloca [80 x i8]
store double %0, double* %2
%4 = load double, double* %2
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%6 = call i32 @dtoa(double %4, i32 7, i8* %5)
%7 = call i32 @prints(i32 %6)
ret void
}

LLVM IR (-O2):
define void @printd(double %0) {
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = call i32 @dtoa(double %0, i32 7, i8* %3)
%5 = call i32 @prints(i32 %4)
ret void
}
int d_ble_mr2(double *a1, double a2) {
  return !(__builtin_islessequal(*a1, a2));
}


x86 assembly (clang, -O0):
<d_ble_mr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ble_mr2>:
xor    %eax,%eax
ucomisd (%rdi),%xmm0
setb   %al
ret

LLVM IR (-O0):
define i32 @d_ble_mr2(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fcmp ole double %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @d_ble_mr2(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp ugt double %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: fold [-bs] [-w width] [file ...]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"usage: fold [-bs] [-w width] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"usage: fold [-bs] [-w width] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void gtk_label_set_markup_with_mnemonic() {}


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

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

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

LLVM IR (-O2):
define void @gtk_label_set_markup_with_mnemonic() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void WatchdogReloadSet(unsigned long ulBase, unsigned long ulLoadVal) {
  DEBUG_ASSERT((ulBase == 0x40000000) || (ulBase == 0x40001000));
  (*((volatile unsigned long *)(ulBase + 0x00000000))) = ulLoadVal;
}


x86 assembly (clang, -O0):
<WatchdogReloadSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%al
cmpq   $0x40000000,-0x8(%rbp)
40
mov    %al,-0x11(%rbp)
je     1141 <WatchdogReloadSet+0x31>
cmpq   $0x40001000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogReloadSet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x40000000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %r14,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @WatchdogReloadSet(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 = icmp eq i64 %5, 1073741824
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i64, i64* %3
%9 = icmp eq i64 %8, 1073745920
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @DEBUG_ASSERT(i32 %12)
%14 = load i64, i64* %4
%15 = load i64, i64* %3
%16 = add i64 %15, 0
%17 = inttoptr i64 %16 to i64*
store volatile i64 %14, i64* %17
ret void
}

LLVM IR (-O2):
define void @WatchdogReloadSet(i64 %0, i64 %1) {
%3 = and i64 %0, -4097
%4 = icmp eq i64 %3, 1073741824
%5 = zext i1 %4 to i32
%6 = tail call i32 @DEBUG_ASSERT(i32 %5)
%7 = inttoptr i64 %0 to i64*
store volatile i64 %1, i64* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_put_error(char *);
void zero_param(char *av) {
  ft_put_error("ft_cat: ");
  ft_put_error(av);
  ft_put_error(": No such file or directory\n");
}


x86 assembly (clang, -O0):
<zero_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <ft_put_error@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ft_put_error@plt>
lea    0xed1(%rip),%rdi
call   1030 <ft_put_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_param>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <ft_put_error@plt>
mov    %rbx,%rdi
call   1030 <ft_put_error@plt>
lea    0xeda(%rip),%rdi
pop    %rbx
jmp    1030 <ft_put_error@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ft_cat: \00"
@.str.1 = [29 x i8] c": No such file or directory\0A\00"
define void @zero_param(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @ft_put_error(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @ft_put_error(i8* %4)
%6 = call i32 @ft_put_error(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ft_cat: \00"
@.str.1 = [29 x i8] c": No such file or directory\0A\00"
define void @zero_param(i8* %0) {
%2 = tail call i32 @ft_put_error(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @ft_put_error(i8* %0)
%4 = tail call i32 @ft_put_error(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ tss_t;
typedef int /*<<< orphan*/ tss_dtor_t;

/* Variables and functions */
int kthread_key_create(int /*<<< orphan*/ *, int /*<<< orphan*/);
int tss_create(tss_t *key, tss_dtor_t dtor) {
  return kthread_key_create(key, dtor);
}


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

x86 assembly (clang, -O2):
<tss_create>:
jmp    1030 <kthread_key_create@plt>

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

LLVM IR (-O2):
define i32 @tss_create(i32* %0, i32 %1) {
%3 = tail call i32 @kthread_key_create(i32* %0, i32 %1)
ret i32 %3
}
void ARGBRotate90() {}


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

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

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

LLVM IR (-O2):
define void @ARGBRotate90() {
ret void
}
int __unlockpt(int fd) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__unlockpt(i32 %0) {
ret i32 0
}
char *mystrupr(char *string) {
  char *c;
  for (c = string; *c != '\0'; c++) {
    if (*c >= 'a' && *c <= 'z') {
      *c += ('A' - 'a');
    }
  }
  return string;
}


x86 assembly (clang, -O0):
<mystrupr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1162 <mystrupr+0x62>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     114c <mystrupr+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     114c <mystrupr+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    $0xffffffe0,%ecx
mov    %cl,(%rax)
jmp    1151 <mystrupr+0x51>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <mystrupr+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrupr>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <mystrupr+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <mystrupr+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <mystrupr+0x2c>
lea    -0x61(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <mystrupr+0x10>
add    $0xe0,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <mystrupr+0x10>
ret

LLVM IR (-O0):
define i8* @mystrupr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %27, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %30
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %26
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 122
br i1 %19, label %20, label %26
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = add nsw i32 %23, -32
%25 = trunc i32 %24 to i8
store i8 %25, i8* %21
br label %26
26: ; preds = %20, %15, %10
br label %27
27: ; preds = %26
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %3
br label %5
30: ; preds = %5
%31 = load i8*, i8** %2
ret i8* %31
}

LLVM IR (-O2):
define i8* @mystrupr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i8 %5, -32
store i8 %10, i8* %6
br label %11
11: ; preds = %4, %9
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
fgeu(unsigned int x, unsigned int y) {
  if (x >= y)
    return 13;
  else
    return 140;
}


x86 assembly (clang, -O0):
<fgeu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jb     1122 <fgeu+0x22>
movl   $0xd,-0x4(%rbp)
jmp    1129 <fgeu+0x29>
movl   $0x8c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgeu>:
cmp    %esi,%edi
mov    $0x8c,%ecx
mov    $0xd,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @fgeu(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 140, i32 13
ret i32 %4
}
void SemWait(int sid) { asm("movl %0, %%eax; int $52" : : "g"(sid) : "eax"); }


x86 assembly (clang, -O0):
<SemWait>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
int    $0x34
pop    %rbp
ret

x86 assembly (clang, -O2):
<SemWait>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
int    $0x34
ret

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

LLVM IR (-O2):
define void @SemWait(i32 %0) {
tail call void asm sideeffect "movl $0, %eax; int $$52", "imr,~{eax},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret void
}
/* Type definitions */
struct fuzzy_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct fuzzy_state *);
void fuzzy_free(struct fuzzy_state *self) { free(self); }


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

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

LLVM IR (-O2):
%struct.fuzzy_state = type { i32 }
define void @fuzzy_free(%struct.fuzzy_state* nocapture %0) {
%2 = tail call i32 @free(%struct.fuzzy_state* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ string_rip(char *, char const *);
void main() {
  char str[] = "They are students.";
  const char *ripper = "aeiou";
  string_rip(str, ripper);
  printf("%s\n", str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%ax
mov    %ax,-0x10(%rbp)
mov    0xec3(%rip),%al
mov    %al,-0xe(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <string_rip@plt>
lea    -0x20(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x2e7374,0xf(%rsp)
lea    0xed4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <string_rip@plt>
lea    0xec8(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [19 x i8] c"They are students.\00"
@.str = [6 x i8] c"aeiou\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca [19 x i8]
%2 = alloca i8*
%3 = bitcast [19 x i8]* %1 to i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = getelementptr inbounds [19 x i8], [19 x i8]* %1, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @string_rip(i8* %4, i8* %5)
%7 = getelementptr inbounds [19 x i8], [19 x i8]* %1, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@__const.main.str = [19 x i8] c"They are students.\00"
@.str = [6 x i8] c"aeiou\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca [19 x i8]
%2 = getelementptr inbounds [19 x i8], [19 x i8]* %1, i64 0, i64 0
%3 = call i32 @string_rip(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}