xunge/DecIR huggingface dataset:
/* Variables and functions */
int fontrender_get_font_index(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int symbol_index(int bold, int italic, int underline) {
  char buf[32];
  sprintf(buf, "symbol%s", bold ? "-bold" : "");
  return (fontrender_get_font_index(buf));
}


x86 assembly (clang, -O0):
<symbol_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%ecx
lea    0xecf(%rip),%rdx
lea    0xec3(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xeac(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <fontrender_get_font_index@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<symbol_index>:
push   %rbx
sub    $0x20,%rsp
test   %edi,%edi
lea    0xee0(%rip),%rax
lea    0xed4(%rip),%rdx
cmove  %rax,%rdx
lea    0xec0(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <fontrender_get_font_index@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"symbol%s\00"
@.str.1 = [6 x i8] c"-bold\00"
@.str.2 = [1 x i8] zeroinitializer
define i32 @symbol_index(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [32 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%13 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%15 = call i32 @fontrender_get_font_index(i8* %14)
ret i32 %15
}

LLVM IR (-O2):
@.str = [9 x i8] c"symbol%s\00"
@.str.1 = [6 x i8] c"-bold\00"
@.str.2 = [1 x i8] zeroinitializer
define i32 @symbol_index(i32 %0, i32 %1, i32 %2) {
%4 = alloca [32 x i8]
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%6 = icmp eq i32 %0, 0
%7 = select i1 %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%8 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 @fontrender_get_font_index(i8* %5)
ret i32 %9
}
/* Variables and functions */
int f29(int *);
int f30(int *p) { return f29(p); }


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

x86 assembly (clang, -O2):
<f30>:
jmp    1030 <f29@plt>

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

LLVM IR (-O2):
define i32 @f30(i32* %0) {
%2 = tail call i32 @f29(i32* %0)
ret i32 %2
}
int server_priv_val() { return 5; }


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

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

LLVM IR (-O0):
define i32 @server_priv_val() {
ret i32 5
}

LLVM IR (-O2):
define i32 @server_priv_val() {
ret i32 5
}
/* Type definitions */
typedef int /*<<< orphan*/ int_fast32_t;

/* Variables and functions */
void SHAREMIND_MAP_KEY_FREE_int_fast32_t(int_fast32_t *const dest) {
  (void)dest;
}


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

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

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

LLVM IR (-O2):
define void @SHAREMIND_MAP_KEY_FREE_int_fast32_t(i32* nocapture %0) {
ret void
}
int direct_fd(void *arg) { return (long)arg; }


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

x86 assembly (clang, -O2):
<direct_fd>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i32 @direct_fd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @direct_fd(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
int isBoss(int id) { return (id == 7); }


x86 assembly (clang, -O0):
<isBoss>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x7,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBoss>:
xor    %eax,%eax
cmp    $0x7,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isBoss(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 7
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isBoss(i32 %0) {
%2 = icmp eq i32 %0, 7
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dvr_print_schedule() { printf("TODO"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"TODO\00"
define void @dvr_print_schedule() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *memcpy_forward(void *, void *, size_t);
void *my_memcpy(void *dst, void *src, size_t n) {
  return memcpy_forward(dst, src, n);
}


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

x86 assembly (clang, -O2):
<my_memcpy>:
jmp    1030 <memcpy_forward@plt>

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

LLVM IR (-O2):
define i8* @my_memcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @memcpy_forward(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
/* Variables and functions */
double floor(double);
double round_down(double x, double scale) {
  return (scale == 1.0 ? floor(x) : floor(x / scale) * scale);
}


x86 assembly (clang, -O0):
<round_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1153 <round_down+0x43>
jp     1153 <round_down+0x43>
movsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
movsd  %xmm0,-0x18(%rbp)
jmp    116c <round_down+0x5c>
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <floor@plt>
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_down>:
push   %rax
ucomisd 0xee7(%rip),%xmm1
jne    1123 <round_down+0x13>
jp     1123 <round_down+0x13>
pop    %rax
jmp    1030 <floor@plt>
divsd  %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1030 <floor@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @round_down(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fcmp oeq double %5, 1.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load double, double* %3
%9 = call double @llvm.floor.f64(double %8)
br label %17
10: ; preds = %2
%11 = load double, double* %3
%12 = load double, double* %4
%13 = fdiv double %11, %12
%14 = call double @llvm.floor.f64(double %13)
%15 = load double, double* %4
%16 = fmul double %14, %15
br label %17
17: ; preds = %10, %7
%18 = phi double [ %9, %7 ], [ %16, %10 ]
ret double %18
}

LLVM IR (-O2):
define double @round_down(double %0, double %1) {
%3 = fcmp oeq double %1, 1.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call double @llvm.floor.f64(double %0)
br label %10
6: ; preds = %2
%7 = fdiv double %0, %1
%8 = tail call double @llvm.floor.f64(double %7)
%9 = fmul double %8, %1
br label %10
10: ; preds = %6, %4
%11 = phi double [ %5, %4 ], [ %9, %6 ]
ret double %11
}
/* Variables and functions */
scalar_t__ user_cmd_is_white_space(char);
char *user_cmd_skip_spaces(char *buffer) {
  char *p = buffer;
  while (user_cmd_is_white_space(*p)) {
    p++;
  }
  return p;
}


x86 assembly (clang, -O0):
<user_cmd_skip_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <user_cmd_is_white_space@plt>
cmp    $0x0,%rax
je     114b <user_cmd_skip_spaces+0x3b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <user_cmd_skip_spaces+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_cmd_skip_spaces>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <user_cmd_is_white_space@plt>
test   %rax,%rax
jne    1120 <user_cmd_skip_spaces+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @user_cmd_skip_spaces(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 = %10, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = call i64 @user_cmd_is_white_space(i8 signext %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %5
13: ; preds = %5
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @user_cmd_skip_spaces(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @user_cmd_is_white_space(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ ptext(char const *);
int /*<<< orphan*/ tc_putp(char const *);
void put_name(const char *cap, const char *name) {
  if (cap) {
    ptext(name);
    tc_putp(cap);
  }
}


x86 assembly (clang, -O0):
<put_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114d <put_name+0x2d>
mov    -0x10(%rbp),%rdi
call   1040 <ptext@plt>
mov    -0x8(%rbp),%rdi
call   1030 <tc_putp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_name>:
test   %rdi,%rdi
je     113a <put_name+0x1a>
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <ptext@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <tc_putp@plt>
ret

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

LLVM IR (-O2):
define void @put_name(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @ptext(i8* %1)
%6 = tail call i32 @tc_putp(i8* %0)
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _dl_div(unsigned long, unsigned long, unsigned long *);
unsigned long _dl_mod(unsigned long num, unsigned long den) {
  unsigned long rem;
  _dl_div(num, den, &rem);
  return rem;
}


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

x86 assembly (clang, -O2):
<_dl_mod>:
push   %rax
mov    %rsp,%rdx
call   1030 <_dl_div@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @_dl_mod(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i32 @_dl_div(i64 %6, i64 %7, i64* %5)
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @_dl_mod(i64 %0, i64 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @_dl_div(i64 %0, i64 %1, i64* %3)
%6 = load i64, i64* %3
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int x;
  for (x == 1; x <= 10; x++) {
    if (x == 5) {
      continue;
    }
    printf("%d ", x);
  }
  printf("\nUsed continue to skip printing the value 5\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     1157 <main+0x47>
cmpl   $0x5,-0x8(%rbp)
jne    1138 <main+0x28>
jmp    1149 <main+0x39>
mov    -0x8(%rbp),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111f <main+0xf>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
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 = [4 x i8] c"%d \00"
@.str.1 = [45 x i8] c"\0AUsed continue to skip printing the value 5\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 10
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 5
br i1 %11, label %12, label %13
12: ; preds = %9
br label %16
13: ; preds = %9
%14 = load i32, i32* %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %13, %12
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %6
19: ; preds = %6
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [44 x i8] c"\0AUsed continue to skip printing the value 5\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int mul8bit(int, int);
int blerp(int a, int b, int x) { return (a + mul8bit(b - a, x)); }


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

x86 assembly (clang, -O2):
<blerp>:
push   %rbx
mov    %edi,%ebx
sub    %edi,%esi
mov    %esi,%edi
mov    %edx,%esi
call   1030 <mul8bit@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @blerp(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 = load i32, i32* %4
%10 = sub nsw i32 %8, %9
%11 = load i32, i32* %6
%12 = call i32 @mul8bit(i32 %10, i32 %11)
%13 = add nsw i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @blerp(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %1, %0
%5 = tail call i32 @mul8bit(i32 %4, i32 %2)
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, int /*<<< orphan*/ *);
void shell(void) { execl("/bin/sh", "sh", NULL); }


x86 assembly (clang, -O0):
<shell>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee3(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <execl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shell>:
lea    0xee9(%rip),%rdi
lea    0xee7(%rip),%rsi
xor    %edx,%edx
jmp    1030 <execl@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/sh\00"
@.str.1 = [3 x i8] c"sh\00"
define void @shell() {
%1 = call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
@.str.1 = [3 x i8] c"sh\00"
define void @shell() {
%1 = tail call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void diewith(char *me, char *s) {
  fprintf(stderr, "%s:%s\n", me, s);
  die();
}


x86 assembly (clang, -O0):
<diewith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diewith>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <die@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s:%s\0A\00"
define void @diewith(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = tail call i32 (...) @die()
ret void
}
unsigned long long int factorial(unsigned int n) {
  unsigned long long int results = 1;
  if (n == 0)
    return 1;
  for (unsigned int i = n; i > 1; i--) {
    results *= i;
  }
  return results;
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
movq   $0x1,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1126 <factorial+0x26>
movq   $0x1,-0x8(%rbp)
jmp    1158 <factorial+0x58>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jbe    1150 <factorial+0x50>
mov    -0x1c(%rbp),%eax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    112c <factorial+0x2c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
mov    $0x1,%eax
cmp    $0x2,%edi
jb     1130 <factorial+0x30>
mov    %edi,%ecx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
imul   %rcx,%rax
add    $0xffffffffffffffff,%rcx
test   $0xfffffffe,%ecx
jne    1120 <factorial+0x20>
ret

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

LLVM IR (-O2):
define i64 @factorial(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = zext i32 %0 to i64
br label %5
5: ; preds = %3, %5
%6 = phi i64 [ %4, %3 ], [ %9, %5 ]
%7 = phi i64 [ 1, %3 ], [ %8, %5 ]
%8 = mul i64 %7, %6
%9 = add nsw i64 %6, -1
%10 = and i64 %9, 4294967294
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = phi i64 [ 1, %1 ], [ %8, %5 ]
ret i64 %13
}
/* Variables and functions */
int fib2(int, int, int);
int _fib(int x0, int x1, int n) {
  if (n == 0)
    return x0;
  else
    return fib2(x1, x0 + x1, n - 1);
}


x86 assembly (clang, -O0):
<_fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1136 <_fib+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114d <_fib+0x3d>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
call   1030 <fib2@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fib>:
mov    %edi,%eax
test   %edx,%edx
je     1124 <_fib+0x14>
add    %esi,%eax
add    $0xffffffff,%edx
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <fib2@plt>
ret

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

LLVM IR (-O2):
define i32 @_fib(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = add nsw i32 %1, %0
%7 = add nsw i32 %2, -1
%8 = tail call i32 @fib2(i32 %1, i32 %6, i32 %7)
br label %9
9: ; preds = %3, %5
%10 = phi i32 [ %8, %5 ], [ %0, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void clearerr(FILE *stream) {}


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

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

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

LLVM IR (-O2):
define void @clearerr(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void lh_release(int **i, int **p) {
  assert(**i != 0);
  assert(*i != *p);
}


x86 assembly (clang, -O0):
<lh_release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmpl   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lh_release>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rax
xor    %edi,%edi
cmpl   $0x0,(%rax)
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%rax
xor    %edi,%edi
cmp    (%r14),%rax
setne  %dil
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @lh_release(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** %5
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32**, i32*** %3
%12 = load i32*, i32** %11
%13 = load i32**, i32*** %4
%14 = load i32*, i32** %13
%15 = icmp ne i32* %12, %14
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret void
}

LLVM IR (-O2):
define void @lh_release(i32** nocapture %0, i32** nocapture %1) {
%3 = load i32*, i32** %0
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = load i32*, i32** %0
%9 = load i32*, i32** %1
%10 = icmp ne i32* %8, %9
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret void
}
/* Variables and functions */
double cbrt_5d(double);
double cbrta_newtond(double, double);
double cbrt(double d) {
  double a = 0.0;
  a = cbrt_5d(d);
  a = cbrta_newtond(a, d);
  a = cbrta_newtond(a, d);
  a = cbrta_newtond(a, d);
  return cbrta_newtond(a, d);
}


x86 assembly (clang, -O0):
<cbrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cbrt_5d@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
call   1040 <cbrta_newtond@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
call   1040 <cbrta_newtond@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
call   1040 <cbrta_newtond@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
call   1040 <cbrta_newtond@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbrt>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <cbrt_5d@plt>
movsd  (%rsp),%xmm1
call   1040 <cbrta_newtond@plt>
movsd  (%rsp),%xmm1
call   1040 <cbrta_newtond@plt>
movsd  (%rsp),%xmm1
call   1040 <cbrta_newtond@plt>
movsd  (%rsp),%xmm1
pop    %rax
jmp    1040 <cbrta_newtond@plt>

LLVM IR (-O0):
define double @cbrt(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0.000000e+00, double* %3
%4 = load double, double* %2
%5 = call double @cbrt_5d(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %2
%8 = call double @cbrta_newtond(double %6, double %7)
store double %8, double* %3
%9 = load double, double* %3
%10 = load double, double* %2
%11 = call double @cbrta_newtond(double %9, double %10)
store double %11, double* %3
%12 = load double, double* %3
%13 = load double, double* %2
%14 = call double @cbrta_newtond(double %12, double %13)
store double %14, double* %3
%15 = load double, double* %3
%16 = load double, double* %2
%17 = call double @cbrta_newtond(double %15, double %16)
ret double %17
}

LLVM IR (-O2):
define double @cbrt(double %0) {
%2 = tail call double @cbrt_5d(double %0)
%3 = tail call double @cbrta_newtond(double %2, double %0)
%4 = tail call double @cbrta_newtond(double %3, double %0)
%5 = tail call double @cbrta_newtond(double %4, double %0)
%6 = tail call double @cbrta_newtond(double %5, double %0)
ret double %6
}
void erroFatalMemoria() {}


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

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

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

LLVM IR (-O2):
define void @erroFatalMemoria() {
ret void
}
float erffc(float x) {
  float gammp(float a, float x);
  float gammq(float a, float x);
  return x < 0.0 ? 1.0 + gammp(0.5, x * x) : gammq(0.5, x * x);
}


x86 assembly (clang, -O0):
<erffc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1174 <erffc+0x54>
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  0xeab(%rip),%xmm0
call   1040 <gammp@plt>
cvtss2sd %xmm0,%xmm1
movsd  0xea2(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1194 <erffc+0x74>
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  0xe7a(%rip),%xmm0
call   1030 <gammq@plt>
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erffc>:
push   %rax
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm1,%xmm0
mulss  %xmm1,%xmm1
movss  0xeca(%rip),%xmm0
jbe    114b <erffc+0x2b>
call   1040 <gammp@plt>
cvtss2sd %xmm0,%xmm0
addsd  0xebf(%rip),%xmm0
jmp    1154 <erffc+0x34>
call   1030 <gammq@plt>
cvtss2sd %xmm0,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @erffc(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load float, float* %2
%8 = load float, float* %2
%9 = fmul float %7, %8
%10 = call float @gammp(float 5.000000e-01, float %9)
%11 = fpext float %10 to double
%12 = fadd double 1.000000e+00, %11
br label %19
13: ; preds = %1
%14 = load float, float* %2
%15 = load float, float* %2
%16 = fmul float %14, %15
%17 = call float @gammq(float 5.000000e-01, float %16)
%18 = fpext float %17 to double
br label %19
19: ; preds = %13, %6
%20 = phi double [ %12, %6 ], [ %18, %13 ]
%21 = fptrunc double %20 to float
ret float %21
}

LLVM IR (-O2):
define float @erffc(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fmul float %0, %0
br i1 %2, label %4, label %8
4: ; preds = %1
%5 = tail call float @gammp(float 5.000000e-01, float %3)
%6 = fpext float %5 to double
%7 = fadd double %6, 1.000000e+00
br label %11
8: ; preds = %1
%9 = tail call float @gammq(float 5.000000e-01, float %3)
%10 = fpext float %9 to double
br label %11
11: ; preds = %8, %4
%12 = phi double [ %7, %4 ], [ %10, %8 ]
%13 = fptrunc double %12 to float
ret float %13
}
/* Variables and functions */
int /*<<< orphan*/ Merge(int, int, int);
void MergeSort(int low, int high) {
  if (low < high) {
    int mid = (low + high) / 2;
    MergeSort(low, mid);
    MergeSort(mid + 1, high);
    Merge(low, mid, high);
  }
}


x86 assembly (clang, -O0):
<MergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1172 <MergeSort+0x52>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <MergeSort@plt>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1040 <MergeSort@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <Merge@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MergeSort>:
cmp    %esi,%edi
jge    1160 <MergeSort+0x40>
push   %r15
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%r15d
lea    (%r14,%r15,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%esi
call   1040 <MergeSort@plt>
lea    0x1(%rbx),%edi
mov    %r14d,%esi
call   1040 <MergeSort@plt>
mov    %r15d,%edi
mov    %ebx,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <Merge@plt>
ret

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

LLVM IR (-O2):
define void @MergeSort(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %5, label %4
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = add nsw i32 %1, %0
%7 = sdiv i32 %6, 2
tail call void @MergeSort(i32 %0, i32 %7)
%8 = add nsw i32 %7, 1
tail call void @MergeSort(i32 %8, i32 %1)
%9 = tail call i32 @Merge(i32 %0, i32 %7, i32 %1)
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void opus_free(void *ptr) { free(ptr); }


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

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

LLVM IR (-O2):
define void @opus_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int test_uvarint(int);
char *test_uvarint1() {
  do {
    if (!(test_uvarint(0x01) == 1))
      return "error, test_uvarint1";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_uvarint1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <test_uvarint@plt>
cmp    $0x1,%eax
je     113b <test_uvarint1+0x2b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1148 <test_uvarint1+0x38>
jmp    1140 <test_uvarint1+0x30>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_uvarint1>:
push   %rax
mov    $0x1,%edi
call   1030 <test_uvarint@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
lea    0xed9(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"error, test_uvarint1\00"
define i8* @test_uvarint1() {
%1 = tail call i32 @test_uvarint(i32 1)
%2 = icmp eq i32 %1, 1
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
unsigned int dns_domain_length(char *dn) {
  char *x;
  unsigned char c;
  x = dn;
  while (c = *x++)
    x += (unsigned int)c;
  return x - dn;
}


x86 assembly (clang, -O0):
<dns_domain_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     1142 <dns_domain_length+0x42>
movzbl -0x11(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <dns_domain_length+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_domain_length>:
mov    (%rdi),%cl
mov    %rdi,%rax
test   %cl,%cl
je     1127 <dns_domain_length+0x27>
mov    %rdi,%rdx
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rdx,%rcx,1),%rax
add    $0x1,%rax
movzbl 0x1(%rdx,%rcx,1),%ecx
mov    %rax,%rdx
test   %cl,%cl
jne    1110 <dns_domain_length+0x10>
sub    %edi,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @dns_domain_length(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = zext i8 %5 to i64
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = phi i8* [ %0, %1 ], [ %9, %4 ]
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = ptrtoint i8* %14 to i64
%16 = ptrtoint i8* %0 to i64
%17 = sub i64 %15, %16
%18 = trunc i64 %17 to i32
ret i32 %18
}
void olpc_dt_build_devicetree(void) {}


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

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

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

LLVM IR (-O2):
define void @olpc_dt_build_devicetree() {
ret void
}
void XtCallActionProc() {}


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

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

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

LLVM IR (-O2):
define void @XtCallActionProc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do1000Transactions(unsigned long);
void *child(void *buf) {
  unsigned long childID = (unsigned long)buf;
  do1000Transactions(childID);
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @child(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @do1000Transactions(i64 %6)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @child(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @do1000Transactions(i64 %2)
ret i8* null
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t div_round_up(uint32_t x, uint32_t y) { return (x + y - 1U) / y; }


x86 assembly (clang, -O0):
<div_round_up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
xor    %edx,%edx
divl   -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_round_up>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
define i32 @div_round_up(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 = add i32 %5, %6
%8 = sub i32 %7, 1
%9 = load i32, i32* %4
%10 = udiv i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @div_round_up(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = udiv i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: ls [-1ACFLRSTWacdfiklmnopqrstux] [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 = [52 x i8] c"usage: ls [-1ACFLRSTWacdfiklmnopqrstux] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"usage: ls [-1ACFLRSTWacdfiklmnopqrstux] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ end();
int /*<<< orphan*/ perror(char const *);
void error(const char *str) {
  perror(str);
  end();
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x0,%al
call   1030 <end@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 (...) @end()
ret void
}

LLVM IR (-O2):
define void @error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 (...) @end()
ret void
}
/* Variables and functions */
unsigned int hexMagnitude(int, int);
unsigned int hex_distanceBetween(signed int ax, signed int ay, signed int bx,
                                 signed int by) {
  signed int x = ax - bx, y = ay - by;
  return hexMagnitude(x, y);
}


x86 assembly (clang, -O0):
<hex_distanceBetween>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <hexMagnitude@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_distanceBetween>:
sub    %edx,%edi
sub    %ecx,%esi
jmp    1030 <hexMagnitude@plt>

LLVM IR (-O0):
define i32 @hex_distanceBetween(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %9
%14 = load i32, i32* %6
%15 = load i32, i32* %8
%16 = sub nsw i32 %14, %15
store i32 %16, i32* %10
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = call i32 @hexMagnitude(i32 %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @hex_distanceBetween(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = sub nsw i32 %1, %3
%7 = tail call i32 @hexMagnitude(i32 %5, i32 %6)
ret i32 %7
}
unsigned long msdosMakeAddress(unsigned short segment, unsigned short offset) {
  return ((unsigned long)segment << 4) + (unsigned long)offset;
}


x86 assembly (clang, -O0):
<msdosMakeAddress>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
shl    $0x4,%rax
movzwl -0x4(%rbp),%ecx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msdosMakeAddress>:
mov    %edi,%ecx
shl    $0x4,%rcx
mov    %esi,%eax
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @msdosMakeAddress(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i64
%7 = shl i64 %6, 4
%8 = load i16, i16* %4
%9 = zext i16 %8 to i64
%10 = add i64 %7, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @msdosMakeAddress(i16 zeroext %0, i16 zeroext %1) {
%3 = zext i16 %0 to i64
%4 = shl nuw nsw i64 %3, 4
%5 = zext i16 %1 to i64
%6 = add nuw nsw i64 %4, %5
ret i64 %6
}
void cop_set(void (*function)()) {}


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

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

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

LLVM IR (-O2):
define void @cop_set(void (...)* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ w5100_writeGAR(int /*<<< orphan*/ *);
void w5100_setGatewayIp(uint8_t *addr) { w5100_writeGAR(addr); }


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

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

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

LLVM IR (-O2):
define void @w5100_setGatewayIp(i32* %0) {
%2 = tail call i32 @w5100_writeGAR(i32* %0)
ret void
}
int test_imm_E7int8_mem(signed char *val) {
  return ((*val) & (-0xE7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E7int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff19,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E7int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -231
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int hi = 2;
  int r = 0, r2 = 0;
  int low = 1;
  r = hi << 4 + low;
  r2 = (hi << 4) + low;
  printf("%d ,%d\n", r, r2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    $0x4,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x40,%esi
mov    $0x21,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%d ,%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 1, i32* %5
%6 = load i32, i32* %2
%7 = load i32, i32* %5
%8 = add nsw i32 4, %7
%9 = shl i32 %6, %8
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = shl i32 %10, 4
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d ,%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 64, i32 33)
ret i32 0
}