xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char *);
int checkLength(char *isbn) {
  int length = 0;
  length = strlen(isbn);
  if (length != 17)
    return -1;
  return 1;
}


x86 assembly (clang, -O0):
<checkLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x11,-0x14(%rbp)
je     1145 <checkLength+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <checkLength+0x3c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkLength>:
push   %rax
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    $0x11,%eax
sete   %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @checkLength(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 17
%4 = select i1 %3, i32 1, i32 -1
ret i32 %4
}
void print_comp_data(design) struct Design *design;
{
  void fprint_data();
  int i;
  i = 0;
  while (++i <= 8)
    fprint_data(design, i);
}


x86 assembly (clang, -O0):
<print_comp_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x8,%eax
jg     1148 <print_comp_data+0x38>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <fprint_data@plt>
jmp    1123 <print_comp_data+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_comp_data>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <fprint_data@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <fprint_data@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <fprint_data@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <fprint_data@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <fprint_data@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1030 <fprint_data@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1030 <fprint_data@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprint_data@plt>

LLVM IR (-O0):
%struct.Design = type opaque
define void @print_comp_data(%struct.Design* %0) {
%2 = alloca %struct.Design*
%3 = alloca i32
store %struct.Design* %0, %struct.Design** %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = icmp sle i32 %6, 8
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load %struct.Design*, %struct.Design** %2
%10 = load i32, i32* %3
br label %4
11: ; preds = %4
ret void
}

LLVM IR (-O2):
%struct.Design = type opaque
define void @print_comp_data(%struct.Design* %0) {
tail call void (%struct.Design*, i32, ...) bitcast (void (...)* @fprint_data to void (%struct.Design*, i32, ...)*)(%struct.Design* %0, i32 1)
tail call void (%struct.Design*, i32, ...) bitcast (void (...)* @fprint_data to void (%struct.Design*, i32, ...)*)(%struct.Design* %0, i32 2)
tail call void (%struct.Design*, i32, ...) bitcast (void (...)* @fprint_data to void (%struct.Design*, i32, ...)*)(%struct.Design* %0, i32 3)
tail call void (%struct.Design*, i32, ...) bitcast (void (...)* @fprint_data to void (%struct.Design*, i32, ...)*)(%struct.Design* %0, i32 4)
tail call void (%struct.Design*, i32, ...) bitcast (void (...)* @fprint_data to void (%struct.Design*, i32, ...)*)(%struct.Design* %0, i32 5)
tail call void (%struct.Design*, i32, ...) bitcast (void (...)* @fprint_data to void (%struct.Design*, i32, ...)*)(%struct.Design* %0, i32 6)
tail call void (%struct.Design*, i32, ...) bitcast (void (...)* @fprint_data to void (%struct.Design*, i32, ...)*)(%struct.Design* %0, i32 7)
tail call void (%struct.Design*, i32, ...) bitcast (void (...)* @fprint_data to void (%struct.Design*, i32, ...)*)(%struct.Design* %0, i32 8)
ret void
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ fabs(double);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
scalar_t__ scanf(char *, double *);
int main() {
  double a;
  while (scanf("%lf", &a) != EOF) {
    printf("%.2lf\n", fabs(a));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%rax
je     117c <main+0x4c>
movsd  -0x10(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %eax,%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xec1(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    0x2e9a(%rip),%r12
cmp    (%r12),%rax
je     1195 <main+0x65>
lea    0xea9(%rip),%r14
lea    0xe9e(%rip),%r15
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%rsp),%xmm0
call   1040 <fabs@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmp    (%r12),%rax
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@EOF = global i64 0
@.str.1 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %13, label %6
6: ; preds = %0, %6
%7 = load double, double* %1
%8 = call i32 @fabs(double %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%11 = load i64, i64* @EOF
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %6
13: ; preds = %6, %0
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t mul_int32_t(int32_t a, int32_t b) { return a * b; }


x86 assembly (clang, -O0):
<mul_int32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul_int32_t>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @mul_int32_t(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mul_int32_t(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int f();
int main() {
  int x = f();
  int y = f();
  if (x != y) {
  ERROR:
    goto ERROR;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1142 <main+0x32>
jmp    113d <main+0x2d>
jmp    113d <main+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <f@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <f@plt>
cmp    %eax,%ebx
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret
nopl   0x0(%rax)
jmp    1130 <main+0x20>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 (...) @f()
%3 = icmp eq i32 %1, %2
br i1 %3, label %5, label %4
4: ; preds = %0, %4
br label %4
5: ; preds = %0
ret i32 0
}
int foo(int x[2]) { ; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ strsep(char **, int /*<<< orphan*/);
void strsep_null_delim(char *s) { strsep(&s, 0); }


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

x86 assembly (clang, -O2):
<strsep_null_delim>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <strsep@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @strsep_null_delim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @strsep(i8** %2, i32 0)
ret void
}
extern unsigned short inw_p(unsigned short port) {
  unsigned short _v;
  __asm__ __volatile__("in"
                       "w"
                       " %"
                       "w"
                       "1,%"
                       ""
                       "0"
                       "\noutb %%al,$0x80"
                       : "=a"(_v)
                       : "Nd"(port));
  return _v;
}


x86 assembly (clang, -O0):
<inw_p>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
out    %al,$0x80
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw_p>:
mov    %edi,%edx
in     (%dx),%ax
out    %al,$0x80
ret

LLVM IR (-O0):
define zeroext i16 @inw_p(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i16 asm sideeffect "inw ${1:w},$0\0Aoutb %al,$$0x80", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @inw_p(i16 zeroext %0) {
%2 = tail call i16 asm sideeffect "inw ${1:w},$0\0Aoutb %al,$$0x80", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i16 %2
}
void sync_clear_bit(int nr, volatile unsigned long *addr) {
  __asm__ __volatile__("lock; btrl %1,%0"
                       : "+m"((*(volatile long *)addr))
                       : "Ir"(nr)
                       : "memory");
}


x86 assembly (clang, -O0):
<sync_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
lock btr %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_clear_bit>:
lock btr %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @sync_clear_bit(i32 %0, i64* %1) {
tail call void asm sideeffect "lock; btrl $1,$0", "=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0, i64* elementtype(i64) %1)
ret void
}
void final_check(const struct ebt_u_entry *entry,
                 const struct ebt_entry_target *target, const char *name,
                 unsigned int hookmask, unsigned int time) {}


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

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

LLVM IR (-O0):
%struct.ebt_u_entry = type opaque
%struct.ebt_entry_target = type opaque
define void @final_check(%struct.ebt_u_entry* %0, %struct.ebt_entry_target* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca %struct.ebt_u_entry*
%7 = alloca %struct.ebt_entry_target*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store %struct.ebt_u_entry* %0, %struct.ebt_u_entry** %6
store %struct.ebt_entry_target* %1, %struct.ebt_entry_target** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
%struct.ebt_u_entry = type opaque
%struct.ebt_entry_target = type opaque
define void @final_check(%struct.ebt_u_entry* nocapture %0, %struct.ebt_entry_target* nocapture %1, i8* nocapture %2, i32 %3, i32 %4) {
ret void
}
int tolower(int c) {
  return (((c >= 'A') && (c <= 'Z')) ? (c - 'A' + 'a') : c);
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     112c <tolower+0x2c>
cmpl   $0x5a,-0x4(%rbp)
jg     112c <tolower+0x2c>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <tolower+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 65
%11 = add nsw i32 %10, 97
br label %14
12: ; preds = %5, %1
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %8
%15 = phi i32 [ %11, %8 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int strtol(char const *, void *, int /*<<< orphan*/);
int atoi(const char *nptr) { return strtol(nptr, (void *)0, 0); }


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

x86 assembly (clang, -O2):
<atoi>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <strtol@plt>

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = tail call i32 @strtol(i8* nocapture %0, i8* null, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("AES 192 Key Expansion\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"AES 192 Key Expansion\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"AES 192 Key Expansion\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rob_dec_1024();
int /*<<< orphan*/ rob_enc_1024();
void simple_tests(void) {
  rob_enc_1024();
  rob_dec_1024();
}


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

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

LLVM IR (-O0):
define void @simple_tests() {
%1 = call i32 (...) @rob_enc_1024()
%2 = call i32 (...) @rob_dec_1024()
ret void
}

LLVM IR (-O2):
define void @simple_tests() {
%1 = tail call i32 (...) @rob_enc_1024()
%2 = tail call i32 (...) @rob_dec_1024()
ret void
}
double pathconN_nm6_twice(double x) { return x + x; }


x86 assembly (clang, -O0):
<pathconN_nm6_twice>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm6_twice>:
addsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @pathconN_nm6_twice(double %0) {
%2 = fadd double %0, %0
ret double %2
}
void g_main_loop_run() {}


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

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

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

LLVM IR (-O2):
define void @g_main_loop_run() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ genlambda2();
int /*<<< orphan*/ init_two();
void init_opt_math() {
  genlambda2();
  init_two();
}


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

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

LLVM IR (-O0):
define void @init_opt_math() {
%1 = call i32 (...) @genlambda2()
%2 = call i32 (...) @init_two()
ret void
}

LLVM IR (-O2):
define void @init_opt_math() {
%1 = tail call i32 (...) @genlambda2()
%2 = tail call i32 (...) @init_two()
ret void
}
/* Variables and functions */
int __builtin_wasm_trunc_saturate_s_i32_f32(float);
int trunc_saturate_s_i32_f32(float f) {
  return __builtin_wasm_trunc_saturate_s_i32_f32(f);
}


x86 assembly (clang, -O0):
<trunc_saturate_s_i32_f32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__builtin_wasm_trunc_saturate_s_i32_f32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trunc_saturate_s_i32_f32>:
jmp    1030 <__builtin_wasm_trunc_saturate_s_i32_f32@plt>

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

LLVM IR (-O2):
define i32 @trunc_saturate_s_i32_f32(float %0) {
%2 = tail call i32 @__builtin_wasm_trunc_saturate_s_i32_f32(float %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ OSPutChr(int /*<<< orphan*/);
void OSPutStr(char *s) {
  while (*s != '\0') {
    OSPutChr(*s++);
  }
  return;
}


x86 assembly (clang, -O0):
<OSPutStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <OSPutStr+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <OSPutChr@plt>
jmp    111c <OSPutStr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSPutStr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <OSPutStr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <OSPutChr@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <OSPutStr+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @OSPutStr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
%13 = call i32 @OSPutChr(i32 %12)
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @OSPutStr(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* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @OSPutChr(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NiashWriteReg(int, int, int);
void WriteAFEReg(int iHandle, int iReg, int iData) {
  NiashWriteReg(iHandle, 0x25, iReg);
  NiashWriteReg(iHandle, 0x26, iData);
}


x86 assembly (clang, -O0):
<WriteAFEReg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x25,%esi
call   1030 <NiashWriteReg@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x26,%esi
call   1030 <NiashWriteReg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteAFEReg>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%edx
mov    %edi,%ebp
mov    $0x25,%esi
call   1030 <NiashWriteReg@plt>
mov    %ebp,%edi
mov    $0x26,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <NiashWriteReg@plt>

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

LLVM IR (-O2):
define void @WriteAFEReg(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @NiashWriteReg(i32 %0, i32 37, i32 %1)
%5 = tail call i32 @NiashWriteReg(i32 %0, i32 38, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ begin_set;

/* Variables and functions */
int /*<<< orphan*/ g(int);
void f(int n) {
  unsigned begin_set[n];
  g(sizeof(begin_set));
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <g@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
shl    $0x2,%edi
jmp    1030 <g@plt>

LLVM IR (-O0):
define void @f(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i32, i64 %6
store i64 %6, i64* %4
%9 = mul nuw i64 4, %6
%10 = trunc i64 %9 to i32
%11 = call i32 @g(i32 %10)
%12 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @f(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i32 @g(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(void *);
void ddcl_exit_thread() { pthread_exit(((void *)0)); }


x86 assembly (clang, -O0):
<ddcl_exit_thread>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <pthread_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddcl_exit_thread>:
xor    %edi,%edi
jmp    1030 <pthread_exit@plt>

LLVM IR (-O0):
define void @ddcl_exit_thread() {
%1 = call i32 @pthread_exit(i8* null)
ret void
}

LLVM IR (-O2):
define void @ddcl_exit_thread() {
%1 = tail call i32 @pthread_exit(i8* null)
ret void
}
/* Variables and functions */
double absolute_error(double, double);
double relative_error(double measured, double actual) {
  return (absolute_error(measured, actual)) / (actual);
}


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

x86 assembly (clang, -O2):
<relative_error>:
push   %rax
movsd  %xmm1,(%rsp)
call   1030 <absolute_error@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @relative_error(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @absolute_error(double %5, double %6)
%8 = load double, double* %4
%9 = fdiv double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @relative_error(double %0, double %1) {
%3 = tail call double @absolute_error(double %0, double %1)
%4 = fdiv double %3, %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void granizo(int x) {
  if (x < 1)
    return;
  printf("%d ", x);
  if (x == 1)
    return;
  if ((x % 2) == 0)
    return granizo(x / 2);
  else
    return granizo((x * 3) + 1);
}


x86 assembly (clang, -O0):
<granizo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    113a <granizo+0x1a>
jmp    118f <granizo+0x6f>
mov    -0x4(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x1,-0x4(%rbp)
jne    1158 <granizo+0x38>
jmp    118f <granizo+0x6f>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1183 <granizo+0x63>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <granizo@plt>
jmp    118f <granizo+0x6f>
imul   $0x3,-0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <granizo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<granizo>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1151 <granizo+0x41>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    $0x1,%ebx
je     1151 <granizo+0x41>
mov    %ebx,%eax
shr    %eax
test   $0x1,%bl
lea    0x1(%rbx,%rbx,2),%ebx
cmove  %eax,%ebx
test   %ebx,%ebx
jg     1130 <granizo+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @granizo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %1
br label %23
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %6
br label %23
12: ; preds = %6
%13 = load i32, i32* %2
%14 = srem i32 %13, 2
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i32, i32* %2
%18 = sdiv i32 %17, 2
br label %23
19: ; preds = %12
%20 = load i32, i32* %2
%21 = mul nsw i32 %20, 3
%22 = add nsw i32 %21, 1
br label %23
23: ; preds = %19, %16, %11, %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @granizo(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %15, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %13, %7 ], [ %0, %1 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = icmp eq i32 %4, 1
br i1 %6, label %15, label %7
7: ; preds = %3
%8 = and i32 %4, 1
%9 = icmp eq i32 %8, 0
%10 = lshr i32 %4, 1
%11 = mul nsw i32 %4, 3
%12 = add nsw i32 %11, 1
%13 = select i1 %9, i32 %10, i32 %12
%14 = icmp slt i32 %13, 1
br i1 %14, label %15, label %3
15: ; preds = %7, %3, %1
ret void
}
char *strcat(char *dest, char *src) {
  for (; *dest; dest++)
    ;
  while (*dest++ = *src++)
    ;
  return dest;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112f <strcat+0x2f>
jmp    111e <strcat+0x1e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <strcat+0xc>
jmp    1134 <strcat+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1163 <strcat+0x63>
jmp    1134 <strcat+0x34>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmpb   $0x0,(%rax)
lea    0x1(%rax),%rax
jne    1110 <strcat+0x10>
mov    $0xffffffffffffffff,%rcx
movzbl 0x1(%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1120 <strcat+0x20>
add    %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %13
}
/* Variables and functions */
int write(int, char *, int);
int tap_write(int fd, char *buf, int len) { return write(fd, buf, len); }


x86 assembly (clang, -O0):
<tap_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tap_write>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @tap_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
void gtk_clipboard_set_image() {}


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

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

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

LLVM IR (-O2):
define void @gtk_clipboard_set_image() {
ret void
}
void rop3_10_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = ~T;
  stk1 = *D & stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


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

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

LLVM IR (-O2):
define void @rop3_10_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %2 to i32
%5 = xor i32 %4, -1
%6 = load i8, i8* %0
%7 = zext i8 %6 to i32
%8 = trunc i32 %5 to i8
%9 = and i8 %6, %8
%10 = zext i8 %9 to i32
%11 = zext i8 %1 to i32
%12 = and i8 %9, %1
%13 = zext i8 %12 to i32
%14 = and i32 %10, %5
%15 = xor i32 %11, -1
%16 = and i32 %4, %15
%17 = and i32 %16, %7
%18 = or i32 %17, %13
%19 = or i32 %18, %14
%20 = trunc i32 %19 to i8
store i8 %20, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__42__IO__selectIOFunc();
void Msp430Adc12ImplP__Port62__selectIOFunc(void) {
  HplMsp430GeneralIOP__42__IO__selectIOFunc();
}


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

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

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

LLVM IR (-O2):
define void @Msp430Adc12ImplP__Port62__selectIOFunc() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__42__IO__selectIOFunc()
ret void
}
int pad1(char *buff) {
  if (!buff)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<pad1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <pad1+0x1f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1126 <pad1+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pad1>:
cmp    $0x1,%rdi
sbb    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @pad1(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int strlen(char *);
long hash(char *word) {
  long hash = 42;
  int i;
  for (i = 0; i < strlen(word); i++) {
    hash += word[i] * (i + 1);
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x2a,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    1174 <hash+0x64>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <hash+0x1b>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    $0x2a,%r15d
test   %eax,%eax
jle    1150 <hash+0x40>
xor    %ebx,%ebx
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%eax
add    $0x1,%rbx
imul   %ebx,%eax
cltq
add    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1130 <hash+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @hash(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %18
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = phi i64 [ %14, %4 ], [ 42, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %5
%8 = load i8, i8* %7
%9 = sext i8 %8 to i64
%10 = add nuw nsw i64 %5, 1
%11 = mul i64 %10, %9
%12 = shl i64 %11, 32
%13 = ashr exact i64 %12, 32
%14 = add nsw i64 %6, %13
%15 = tail call i32 @strlen(i8* %0)
%16 = sext i32 %15 to i64
%17 = icmp slt i64 %10, %16
br i1 %17, label %4, label %18
18: ; preds = %4, %1
%19 = phi i64 [ 42, %1 ], [ %14, %4 ]
ret i64 %19
}
/* Variables and functions */
int /*<<< orphan*/ both_logs(char *);
int /*<<< orphan*/ exit(int);
int strlen(char const *);
void check_path_length(const char *path) {
  if (strlen(path) + 6 > 100) {
    both_logs("Your path variable is too large, this might be an attempt to "
              "compromise the script\n");
    both_logs("Exiting program, please shorten your path variable (use "
              "symlinks if you need to)\n");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<check_path_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x6,%eax
cmp    $0x64,%eax
jle    1173 <check_path_length+0x43>
lea    0xea8(%rip),%rdi
call   1040 <both_logs@plt>
lea    0xef0(%rip),%rdi
call   1040 <both_logs@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_path_length>:
push   %rax
call   1030 <strlen@plt>
cmp    $0x5f,%eax
jge    113d <check_path_length+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <both_logs@plt>
lea    0xf04(%rip),%rdi
call   1040 <both_logs@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [84 x i8] c"Your path variable is too large, this might be an attempt to compromise the script\0A\00"
@.str.1 = [82 x i8] c"Exiting program, please shorten your path variable (use symlinks if you need to)\0A\00"
define void @check_path_length(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = add nsw i32 %4, 6
%6 = icmp sgt i32 %5, 100
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 @both_logs(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @both_logs(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [84 x i8] c"Your path variable is too large, this might be an attempt to compromise the script\0A\00"
@.str.1 = [82 x i8] c"Exiting program, please shorten your path variable (use symlinks if you need to)\0A\00"
define void @check_path_length(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 94
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @both_logs(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @both_logs(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %1
ret void
}
void av_rc4_init() {}


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

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

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

LLVM IR (-O2):
define void @av_rc4_init() {
ret void
}
/* Variables and functions */
int fileDetails(char *);
int getFileDetails(char *path) { return fileDetails(path); }


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

x86 assembly (clang, -O2):
<getFileDetails>:
jmp    1030 <fileDetails@plt>

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

LLVM IR (-O2):
define i32 @getFileDetails(i8* %0) {
%2 = tail call i32 @fileDetails(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_webpath(char *webpath) { free(webpath); }


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

LLVM IR (-O0):
define void @free_webpath(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 @free_webpath(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
void putchar(char s) { *(unsigned int *)(0x100000) = s; }


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x100000,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
mov    %edi,0x100000
ret

LLVM IR (-O0):
define void @putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
store i32 %4, i32* inttoptr (i64 1048576 to i32*)
ret void
}

LLVM IR (-O2):
define void @putchar(i8 signext %0) {
%2 = sext i8 %0 to i32
store i32 %2, i32* inttoptr (i64 1048576 to i32*)
ret void
}
void iface_stat_update(struct net_device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.net_device = type opaque
define void @iface_stat_update(%struct.net_device* nocapture %0) {
ret void
}
int hxd_v_api(void) { return 0x20130412; }


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

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

LLVM IR (-O0):
define i32 @hxd_v_api() {
ret i32 538117138
}

LLVM IR (-O2):
define i32 @hxd_v_api() {
ret i32 538117138
}
/* Variables and functions */
double triangleArea(double **);
void localVector(double vertices[][2], double f, double localB[]) {
  int i;
  double area = triangleArea(vertices);
  for (i = 0; i < 3; i++) {
    localB[i] = (1.0 / 3) * area * f;
  }
}


x86 assembly (clang, -O0):
<localVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <triangleArea@plt>
movsd  %xmm0,-0x28(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    1171 <localVector+0x61>
movsd  0xeb4(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113a <localVector+0x2a>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<localVector>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movsd  %xmm0,0x8(%rsp)
call   1030 <triangleArea@plt>
mulsd  0xed5(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  %xmm0,0x8(%rbx)
movsd  %xmm0,0x10(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @localVector([2 x double]* %0, double %1, double* nocapture writeonly %2) {
%4 = bitcast [2 x double]* %0 to double**
%5 = tail call double @triangleArea(double** %4)
%6 = fmul double %5, 0x3FD5555555555555
%7 = fmul double %6, %1
store double %7, double* %2
%8 = getelementptr inbounds double, double* %2, i64 1
store double %7, double* %8
%9 = getelementptr inbounds double, double* %2, i64 2
store double %7, double* %9
ret void
}