xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ binomial(int, int);
int rank(int k, int *a) {
  int i, r;
  r = 0;
  for (i = 0; i < k; ++i)
    r += binomial(a[i], i + 1);
  return r;
}


x86 assembly (clang, -O0):
<rank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116a <rank+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
call   1030 <binomial@plt>
mov    %rax,%rcx
movslq -0x18(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <rank+0x1d>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rank>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1148 <rank+0x38>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,4),%edi
add    $0x1,%rbx
mov    %ebx,%esi
call   1030 <binomial@plt>
add    %eax,%ebp
cmp    %rbx,%r15
jne    1130 <rank+0x20>
jmp    114a <rank+0x3a>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @rank(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = phi i32 [ 0, %4 ], [ %15, %6 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %7
%10 = load i32, i32* %9
%11 = add nuw nsw i64 %7, 1
%12 = trunc i64 %11 to i32
%13 = tail call i64 @binomial(i32 %10, i32 %12)
%14 = trunc i64 %13 to i32
%15 = add i32 %8, %14
%16 = icmp eq i64 %11, %5
br i1 %16, label %17, label %6
17: ; preds = %6, %2
%18 = phi i32 [ 0, %2 ], [ %15, %6 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ read_buffer(void *, int);
int /*<<< orphan*/ set_offset(unsigned long);
void do_read_header(void *buff, int size, unsigned long block_addr) {
  set_offset(block_addr);
  read_buffer(buff, size);
}


x86 assembly (clang, -O0):
<do_read_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <set_offset@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <read_buffer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_read_header>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1030 <set_offset@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <read_buffer@plt>

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

LLVM IR (-O2):
define void @do_read_header(i8* %0, i32 %1, i64 %2) {
%4 = tail call i32 @set_offset(i64 %2)
%5 = tail call i32 @read_buffer(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
void usd_perror(const char *s) {
  if (0) {
    perror(s);
  }
}


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

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

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

LLVM IR (-O2):
define void @usd_perror(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(unsigned int);
int main() {
  for (unsigned int i = 0; i < 1000; ++i)
    bar(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jae    1149 <main+0x39>
mov    -0x8(%rbp),%edi
call   1030 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <bar@plt>
add    $0x1,%ebx
cmp    $0x3e8,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 @bar(i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 1000
br i1 %6, label %1, label %2
}
int setenv(char *name, char *value) {}


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

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

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

LLVM IR (-O2):
define i32 @setenv(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int rand();
int Random() { return rand() % 1000 + 1; }


x86 assembly (clang, -O0):
<Random>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Random>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Random() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 1000
%3 = add nsw i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @Random() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 1000
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
double sqrt(double);
double c(double x, double y, double r) { return sqrt(x * x + y * y) - r; }


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
subsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112f <c+0x1f>
sqrtsd %xmm0,%xmm0
subsd  %xmm2,%xmm0
ret
push   %rax
movsd  %xmm2,(%rsp)
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm2
add    $0x8,%rsp
subsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @c(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %4
%9 = load double, double* %5
%10 = load double, double* %5
%11 = fmul double %9, %10
%12 = call double @llvm.fmuladd.f64(double %7, double %8, double %11)
%13 = call double @sqrt(double %12)
%14 = load double, double* %6
%15 = fsub double %13, %14
ret double %15
}

LLVM IR (-O2):
define double @c(double %0, double %1, double %2) {
%4 = fmul double %1, %1
%5 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %4)
%6 = tail call double @sqrt(double %5)
%7 = fsub double %6, %2
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void my_print_2(void) { printf("come on!\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"come on!\00"
define void @my_print_2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ draw_gameover();
void state_gameover_screen_resized() { draw_gameover(); }


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

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

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

LLVM IR (-O2):
define void @state_gameover_screen_resized() {
%1 = tail call i32 (...) @draw_gameover()
ret void
}
void stringmap_nuke_noop(const void *key, const void *val, void *d) {}


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

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

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

LLVM IR (-O2):
define void @stringmap_nuke_noop(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int towide_euc_impl(int /*<<< orphan*/ *, char const *, unsigned int, int, int,
                    int /*<<< orphan*/, int /*<<< orphan*/);
int towide_euccn(wchar_t *wc, const char *mb, unsigned n) {
  return (towide_euc_impl(wc, mb, n, 0x8e, 4, 0, 0));
}


x86 assembly (clang, -O0):
<towide_euccn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x8e,%ecx
mov    $0x4,%r8d
xor    %r9d,%r9d
movl   $0x0,(%rsp)
call   1030 <towide_euc_impl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<towide_euccn>:
push   %rax
movl   $0x0,(%rsp)
mov    $0x8e,%ecx
mov    $0x4,%r8d
xor    %r9d,%r9d
call   1030 <towide_euc_impl@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @towide_euccn(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 @towide_euc_impl(i32* %7, i8* %8, i32 %9, i32 142, i32 4, i32 0, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @towide_euccn(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @towide_euc_impl(i32* %0, i8* %1, i32 %2, i32 142, i32 4, i32 0, i32 0)
ret i32 %4
}
int round_to_next_multiple(int number, int multiple) {
  int remaining = number % multiple;
  if (remaining == 0)
    return number;
  else
    return number + multiple - remaining;
}


x86 assembly (clang, -O0):
<round_to_next_multiple>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1129 <round_to_next_multiple+0x29>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <round_to_next_multiple+0x35>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_to_next_multiple>:
mov    %edi,%eax
cltd
idiv   %esi
lea    (%rsi,%rdi,1),%eax
sub    %edx,%eax
test   %edx,%edx
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @round_to_next_multiple(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = add nsw i32 %1, %0
%6 = sub i32 %5, %3
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
int fun_coverage_base() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fun_coverage_base() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nocall(char *);
void stop(void) { nocall("stop"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"stop\00"
define void @stop() {
%1 = tail call i32 @nocall(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
const char *strchrc(const char *str, char v) {
  while (*str && *str != v) {
    str++;
  }
  if (*str == v)
    return str;
  return NULL;
}


x86 assembly (clang, -O0):
<strchrc>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x12(%rbp)
je     1136 <strchrc+0x36>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    1146 <strchrc+0x46>
jmp    1157 <strchrc+0x57>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <strchrc+0xe>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1177 <strchrc+0x77>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117f <strchrc+0x7f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchrc>:
add    $0xffffffffffffffff,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
je     1121 <strchrc+0x21>
cmp    %sil,%cl
jne    1110 <strchrc+0x10>
xor    %eax,%eax
cmp    %sil,%cl
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i8* @strchrc(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
br label %6
6: ; preds = %20, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %6
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = load i8, i8* %5
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %14, %16
br label %18
18: ; preds = %11, %6
%19 = phi i1 [ false, %6 ], [ %17, %11 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %4
br label %6
23: ; preds = %18
%24 = load i8*, i8** %4
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = load i8, i8* %5
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %26, %28
br i1 %29, label %30, label %32
30: ; preds = %23
%31 = load i8*, i8** %4
store i8* %31, i8** %3
br label %33
32: ; preds = %23
store i8* null, i8** %3
br label %33
33: ; preds = %32, %30
%34 = load i8*, i8** %3
ret i8* %34
}

LLVM IR (-O2):
define i8* @strchrc(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = icmp eq i8 %5, %1
%8 = or i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
%11 = select i1 %7, i8* %4, i8* null
ret i8* %11
}
/* Variables and functions */
int op_xnor(int, int);
int test_xnor() {
  if (op_xnor(3, 4) != (~(3 ^ 4)))
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<test_xnor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <op_xnor@plt>
cmp    $0xfffffff8,%eax
je     113c <test_xnor+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1143 <test_xnor+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_xnor>:
push   %rax
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <op_xnor@plt>
xor    %ecx,%ecx
cmp    $0xfffffff8,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @test_xnor() {
%1 = tail call i32 @op_xnor(i32 3, i32 4)
%2 = icmp ne i32 %1, -8
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ get_cpu_isa_extensions(char *, int);
int /*<<< orphan*/ *strstr(char *, char *);
int feature_available(char *feature) {
  char buffer[512];
  get_cpu_isa_extensions(buffer, sizeof(buffer));
  if (strstr(buffer, feature) != NULL)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<feature_available>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    $0x200,%esi
call   1030 <get_cpu_isa_extensions@plt>
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     1166 <feature_available+0x46>
movl   $0x1,-0x4(%rbp)
jmp    116d <feature_available+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feature_available>:
push   %r14
push   %rbx
sub    $0x208,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x200,%esi
call   1030 <get_cpu_isa_extensions@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @feature_available(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [512 x i8]
store i8* %0, i8** %3
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%6 = call i32 @get_cpu_isa_extensions(i8* %5, i32 512)
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = call i32* @strstr(i8* %7, i8* %8)
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @feature_available(i8* nocapture %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = call i32 @get_cpu_isa_extensions(i8* %3, i32 512)
%5 = call i32* @strstr(i8* %3, i8* dereferenceable(1) %0)
%6 = icmp ne i32* %5, null
%7 = zext i1 %6 to i32
ret i32 %7
}
int test_imm_29int16_reg(short val) {
  return ((val) & (0x29 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_29int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x29,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_29int16_reg>:
test   $0x29,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_29int16_reg(i16 signext %0) {
%2 = and i16 %0, 41
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct drm_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mga_do_cleanup_dma(struct drm_device *, int);
void mga_driver_lastclose(struct drm_device *dev) {
  mga_do_cleanup_dma(dev, 1);
}


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

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

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

LLVM IR (-O2):
%struct.drm_device = type { i32 }
define void @mga_driver_lastclose(%struct.drm_device* %0) {
%2 = tail call i32 @mga_do_cleanup_dma(%struct.drm_device* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _remove_half_nodes();
void main() { _remove_half_nodes(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @_remove_half_nodes()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ solve_wiki_ex();
int main(int argc, char **argv) {
  solve_wiki_ex();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <solve_wiki_ex@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @solve_wiki_ex()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @solve_wiki_ex()
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int compare_types(const char *server_type, const char *client_type) {
  if (strcmp(client_type, "*/*") == 0) {
    return 1;
  } else {
    return strcmp(server_type, client_type) == 0;
  }
}


x86 assembly (clang, -O0):
<compare_types>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1146 <compare_types+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1162 <compare_types+0x52>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_types>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1146 <compare_types+0x36>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
jmp    114b <compare_types+0x3b>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"*/*\00"
define i32 @compare_types(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %0, i8* %1)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ %8, %5 ], [ 1, %2 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(int *, int, int, int /*<<< orphan*/ *);
int read_int(FILE *fp) {
  int ret;
  fread(&ret, sizeof(int), 1, fp);
  return ret;
}


x86 assembly (clang, -O0):
<read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int>:
push   %rax
mov    %rdi,%rcx
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read_int(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fread(i32* %3, i32 4, i32 1, i32* %4)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @read_int(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fread(i32* %2, i32 4, i32 1, i32* %0)
%5 = load i32, i32* %2
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t dd_rom_address(uint32_t address) { return (address & 0x3fffff) >> 2; }


x86 assembly (clang, -O0):
<dd_rom_address>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3fffff,%eax
sar    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd_rom_address>:
mov    %edi,%eax
shr    $0x2,%eax
and    $0xfffff,%eax
ret

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

LLVM IR (-O2):
define i32 @dd_rom_address(i32 %0) {
%2 = lshr i32 %0, 2
%3 = and i32 %2, 1048575
ret i32 %3
}
/* Variables and functions */
double Norm(double, double);
double NormalRandom(double miu, double sigma) {
  double norm_x;
  do {
    norm_x = Norm(miu, sigma);
  } while (norm_x < -10 || norm_x > 10);
  return norm_x;
}


x86 assembly (clang, -O0):
<NormalRandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <Norm@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x1,%al
movsd  0xec0(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
mov    %al,-0x19(%rbp)
ja     1165 <NormalRandom+0x55>
movsd  -0x18(%rbp),%xmm0
movsd  0xead(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1122 <NormalRandom+0x12>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NormalRandom>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <Norm@plt>
movsd  0xec7(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1120 <NormalRandom+0x10>
ucomisd 0xec1(%rip),%xmm0
ja     1120 <NormalRandom+0x10>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @NormalRandom(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
br label %6
6: ; preds = %16, %2
%7 = load double, double* %3
%8 = load double, double* %4
%9 = call double @Norm(double %7, double %8)
store double %9, double* %5
br label %10
10: ; preds = %6
%11 = load double, double* %5
%12 = fcmp olt double %11, -1.000000e+01
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load double, double* %5
%15 = fcmp ogt double %14, 1.000000e+01
br label %16
16: ; preds = %13, %10
%17 = phi i1 [ true, %10 ], [ %15, %13 ]
br i1 %17, label %6, label %18
18: ; preds = %16
%19 = load double, double* %5
ret double %19
}

LLVM IR (-O2):
define double @NormalRandom(double %0, double %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call double @Norm(double %0, double %1)
%5 = fcmp olt double %4, -1.000000e+01
%6 = fcmp ogt double %4, 1.000000e+01
%7 = or i1 %5, %6
br i1 %7, label %3, label %8
8: ; preds = %3
ret double %4
}
unsigned char CharToBaseBWA(char charBase) {
  if (charBase == 'A')
    return 0;
  else if (charBase == 'C')
    return 1;
  else if (charBase == 'T')
    return 3;
  else if (charBase == 'G')
    return 2;
  return 0x00;
}


x86 assembly (clang, -O0):
<CharToBaseBWA>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jne    1120 <CharToBaseBWA+0x20>
movb   $0x0,-0x1(%rbp)
jmp    1175 <CharToBaseBWA+0x75>
movsbl -0x2(%rbp),%eax
cmp    $0x43,%eax
jne    1136 <CharToBaseBWA+0x36>
movb   $0x1,-0x1(%rbp)
jmp    1175 <CharToBaseBWA+0x75>
movsbl -0x2(%rbp),%eax
cmp    $0x54,%eax
jne    114c <CharToBaseBWA+0x4c>
movb   $0x3,-0x1(%rbp)
jmp    1175 <CharToBaseBWA+0x75>
movsbl -0x2(%rbp),%eax
cmp    $0x47,%eax
jne    1162 <CharToBaseBWA+0x62>
movb   $0x2,-0x1(%rbp)
jmp    1175 <CharToBaseBWA+0x75>
jmp    1167 <CharToBaseBWA+0x67>
jmp    116c <CharToBaseBWA+0x6c>
jmp    1171 <CharToBaseBWA+0x71>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CharToBaseBWA>:
cmp    $0x54,%dil
je     1115 <CharToBaseBWA+0x15>
cmp    $0x47,%dil
je     1118 <CharToBaseBWA+0x18>
cmp    $0x43,%dil
jne    111b <CharToBaseBWA+0x1b>
mov    $0x1,%al
ret
mov    $0x3,%al
ret
mov    $0x2,%al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define zeroext i8 @CharToBaseBWA(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 65
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 0, i8* %2
br label %27
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 67
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 1, i8* %2
br label %27
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 84
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 3, i8* %2
br label %27
18: ; preds = %13
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 71
br i1 %21, label %22, label %23
22: ; preds = %18
store i8 2, i8* %2
br label %27
23: ; preds = %18
br label %24
24: ; preds = %23
br label %25
25: ; preds = %24
br label %26
26: ; preds = %25
store i8 0, i8* %2
br label %27
27: ; preds = %26, %22, %17, %12, %7
%28 = load i8, i8* %2
ret i8 %28
}

LLVM IR (-O2):
define zeroext i8 @CharToBaseBWA(i8 signext %0) {
switch i8 %0, label %5 [
i8 71, label %4
i8 67, label %2
i8 84, label %3
]
2: ; preds = %1
br label %5
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3, %2
%6 = phi i8 [ 1, %2 ], [ 3, %3 ], [ 2, %4 ], [ 0, %1 ]
ret i8 %6
}
void mystat(int fd) {
  printf(1, "==============\n");
  pinode(fd);
  printf(1, "\n");
  cat(fd);
  printf(1, "\n");
}


x86 assembly (clang, -O0):
<mystat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
lea    0xeb9(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <pinode@plt>
mov    $0x1,%edi
lea    0xeaa(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1050 <cat@plt>
mov    $0x1,%edi
lea    0xe8d(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystat>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xec3(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <pinode@plt>
lea    0xeb5(%rip),%r14
mov    $0x1,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1050 <cat@plt>
mov    $0x1,%edi
mov    %r14,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"==============\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @mystat(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @pinode to i32 (i32, ...)*)(i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* %2
%8 = call i32 (i32, ...) bitcast (i32 (...)* @cat to i32 (i32, ...)*)(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"==============\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @mystat(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @pinode to i32 (i32, ...)*)(i32 %0)
%4 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @cat to i32 (i32, ...)*)(i32 %0)
%6 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
__attribute__((__no__)) void
do_nothing_trailing_hole_runtime_partial(struct test_trailing_hole *ptr) {
  if ((unsigned long)ptr > 0x2)
    return;
  else
    return;
}


x86 assembly (clang, -O0):
<do_nothing_trailing_hole_runtime_partial>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x2,%rax
jbe    111b <do_nothing_trailing_hole_runtime_partial+0x1b>
jmp    1120 <do_nothing_trailing_hole_runtime_partial+0x20>
jmp    1120 <do_nothing_trailing_hole_runtime_partial+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test_trailing_hole = type opaque
define void @do_nothing_trailing_hole_runtime_partial(%struct.test_trailing_hole* %0) {
%2 = alloca %struct.test_trailing_hole*
store %struct.test_trailing_hole* %0, %struct.test_trailing_hole** %2
%3 = load %struct.test_trailing_hole*, %struct.test_trailing_hole** %2
%4 = ptrtoint %struct.test_trailing_hole* %3 to i64
%5 = icmp ugt i64 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.test_trailing_hole = type opaque
define void @do_nothing_trailing_hole_runtime_partial(%struct.test_trailing_hole* nocapture %0) {
ret void
}
void mv88f6281gtw_ge_init(void) {}


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

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

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

LLVM IR (-O2):
define void @mv88f6281gtw_ge_init() {
ret void
}
unsigned int funA(unsigned int size) {
  asm("cmpl $1,%%eax;"
      "jbe 1f;"
      "decl %%eax;"
      "bsrl %%eax,%%ecx;"
      "incb %%cl;"
      "movl $1,%%eax;"
      "shl %%cl,%%eax;"
      "1:" ::"a"(size));
}


x86 assembly (clang, -O0):
<funA>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x1,%eax
jbe    1121 <funA+0x21>
dec    %eax
bsr    %eax,%ecx
inc    %cl
mov    $0x1,%eax
shl    %cl,%eax
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<funA>:
mov    %edi,%eax
cmp    $0x1,%eax
jbe    1115 <funA+0x15>
dec    %eax
bsr    %eax,%ecx
inc    %cl
mov    $0x1,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @funA(i32 %0) {
tail call void asm sideeffect "cmpl $$1,%eax;jbe 1f;decl %eax;bsrl %eax,%ecx;incb %cl;movl $$1,%eax;shl %cl,%eax;1:", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main() {
  char *ss;
  int j, len = 0;
  int a = 0, e = 0, i = 0, o = 0, u = 0, p = 1, sum = 0;
  printf("%.4lf\n", 1.0);
  printf("%.4lf\n", 111.0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x1,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
lea    0xeb9(%rip),%rdi
movsd  0xea9(%rip),%xmm0
call   1030 <printf@plt>
lea    0xea5(%rip),%rdi
movsd  0xe8d(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef8(%rip),%rbx
movsd  0xee0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xed8(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%.4lf\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 1, i32* %9
store i32 0, i32* %10
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double 1.000000e+00)
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double 1.110000e+02)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%.4lf\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double 1.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double 1.110000e+02)
ret i32 0
}
void main() {
  int y;
  if (y > 1) {
    y = 2;
  } else {
    y = 3;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x1,-0x4(%rbp)
jle    111a <main+0x1a>
movl   $0x2,-0x4(%rbp)
jmp    1121 <main+0x21>
movl   $0x3,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *debugfs__mountpoint();
bool debugfs__configured(void) { return debugfs__mountpoint() != NULL; }


x86 assembly (clang, -O0):
<debugfs__configured>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <debugfs__mountpoint@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<debugfs__configured>:
push   %rax
xor    %eax,%eax
call   1030 <debugfs__mountpoint@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @debugfs__configured() {
%1 = call i32* (...) @debugfs__mountpoint()
%2 = icmp ne i32* %1, null
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @debugfs__configured() {
%1 = tail call i32* (...) @debugfs__mountpoint()
%2 = icmp ne i32* %1, null
%3 = zext i1 %2 to i32
ret i32 %3
}
int test_imm_61int64_lowword_mem(long long *val) {
  return ((*val) & (0x61 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_61int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 97
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void av_register_output_format() {}


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

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

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

LLVM IR (-O2):
define void @av_register_output_format() {
ret void
}
/* Variables and functions */
bool verify_collision(int character_position, int possible_collision) {
  bool collision = false;
  collision |= character_position == possible_collision - 1;
  collision |= character_position == possible_collision;
  collision |= character_position == possible_collision + 1;
  return collision;
}


x86 assembly (clang, -O0):
<verify_collision>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_collision>:
lea    -0x1(%rsi),%eax
cmp    %edi,%eax
sete   %al
cmp    %esi,%edi
sete   %cl
or     %al,%cl
add    $0x1,%esi
cmp    %edi,%esi
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @verify_collision(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i32
%11 = load i32, i32* %5
%12 = or i32 %11, %10
store i32 %12, i32* %5
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = icmp eq i32 %13, %14
%16 = zext i1 %15 to i32
%17 = load i32, i32* %5
%18 = or i32 %17, %16
store i32 %18, i32* %5
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
%22 = icmp eq i32 %19, %21
%23 = zext i1 %22 to i32
%24 = load i32, i32* %5
%25 = or i32 %24, %23
store i32 %25, i32* %5
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @verify_collision(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = icmp eq i32 %3, %0
%5 = icmp eq i32 %0, %1
%6 = or i1 %5, %4
%7 = add nsw i32 %1, 1
%8 = icmp eq i32 %7, %0
%9 = or i1 %8, %6
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
float read_float_be(const uint8_t *data) {
  union {
    uint32_t i;
    float f;
  } u;
  u.i = ((((uint32_t)(((const uint8_t *)(data))[0])) << (24)) |
         (((uint32_t)(((const uint8_t *)(data))[1])) << (16)) |
         (((uint32_t)(((const uint8_t *)(data))[2])) << (8)) |
         (((uint32_t)(((const uint8_t *)(data))[3])) << (0)));
  return u.f;
}


x86 assembly (clang, -O0):
<read_float_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
shl    $0x0,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_float_be>:
mov    (%rdi),%eax
mov    0x8(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x10(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x18(%rdi),%eax
movd   %eax,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @read_float_be(i64* %0) {
%2 = alloca i64*
%3 = alloca %union.anon
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = getelementptr inbounds i64, i64* %4, i64 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 24
%9 = load i64*, i64** %2
%10 = getelementptr inbounds i64, i64* %9, i64 1
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 16
%14 = or i32 %8, %13
%15 = load i64*, i64** %2
%16 = getelementptr inbounds i64, i64* %15, i64 2
%17 = load i64, i64* %16
%18 = trunc i64 %17 to i32
%19 = shl i32 %18, 8
%20 = or i32 %14, %19
%21 = load i64*, i64** %2
%22 = getelementptr inbounds i64, i64* %21, i64 3
%23 = load i64, i64* %22
%24 = trunc i64 %23 to i32
%25 = shl i32 %24, 0
%26 = or i32 %20, %25
%27 = bitcast %union.anon* %3 to i32*
store i32 %26, i32* %27
%28 = bitcast %union.anon* %3 to float*
%29 = load float, float* %28
ret float %29
}

LLVM IR (-O2):
define float @read_float_be(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i64, i64* %0, i64 2
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i64, i64* %0, i64 3
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = or i32 %14, %17
%19 = bitcast i32 %18 to float
ret float %19
}