xunge/DecIR huggingface dataset:
int arrangeCoins(int n) {
  if (n == 0)
    return 0;
  int layer = 1;
  while (n >= layer) {
    n -= layer;
    layer++;
  }
  return layer - 1;
}


x86 assembly (clang, -O0):
<arrangeCoins>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <arrangeCoins+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1152 <arrangeCoins+0x52>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1149 <arrangeCoins+0x49>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <arrangeCoins+0x24>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrangeCoins>:
xor    %eax,%eax
test   %edi,%edi
jle    1119 <arrangeCoins+0x19>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
sub    %eax,%edi
cmp    %eax,%edi
jg     1110 <arrangeCoins+0x10>
ret

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

LLVM IR (-O2):
define i32 @arrangeCoins(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sub nsw i32 %5, %4
%7 = add nuw nsw i32 %4, 1
%8 = icmp sgt i32 %6, %4
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %4, %3 ]
ret i32 %10
}
int large_enough(unsigned long long i) { return (i >= 1000000000000000000LLU); }


x86 assembly (clang, -O0):
<large_enough>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0xde0b6b3a7640000,%rax
b6 e0 0d
cmp    %rax,-0x8(%rbp)
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<large_enough>:
movabs $0xde0b6b3a763ffff,%rcx
b6 e0 0d
xor    %eax,%eax
cmp    %rcx,%rdi
seta   %al
ret

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

LLVM IR (-O2):
define i32 @large_enough(i64 %0) {
%2 = icmp ugt i64 %0, 999999999999999999
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
double _surface_fractal_kernel(double, double, double, double);
double Iq(double q, double radius, double fractal_dim_surf,
          double cutoff_length) {
  return _surface_fractal_kernel(q, radius, fractal_dim_surf, cutoff_length);
}


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

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

LLVM IR (-O0):
define double @Iq(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call double @_surface_fractal_kernel(double %9, double %10, double %11, double %12)
ret double %13
}

LLVM IR (-O2):
define double @Iq(double %0, double %1, double %2, double %3) {
%5 = tail call double @_surface_fractal_kernel(double %0, double %1, double %2, double %3)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ dirnext();
int /*<<< orphan*/ pushStringCopy(int /*<<< orphan*/);
void basDirNext() { pushStringCopy(dirnext()); }


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

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

LLVM IR (-O0):
define void @basDirNext() {
%1 = call i32 (...) @dirnext()
%2 = call i32 @pushStringCopy(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basDirNext() {
%1 = tail call i32 (...) @dirnext()
%2 = tail call i32 @pushStringCopy(i32 %1)
ret void
}
double pair_tailcorr_switch3_olpslater1s1s(void *pair_data, long center_index,
                                           long other_index, double rcut,
                                           double width) {
  double t1 = 0;
  return t1;
}


x86 assembly (clang, -O0):
<pair_tailcorr_switch3_olpslater1s1s>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pair_tailcorr_switch3_olpslater1s1s>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @pair_tailcorr_switch3_olpslater1s1s(i8* %0, i64 %1, i64 %2, double %3, double %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca double
%10 = alloca double
%11 = alloca double
store i8* %0, i8** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store double %3, double* %9
store double %4, double* %10
store double 0.000000e+00, double* %11
%12 = load double, double* %11
ret double %12
}

LLVM IR (-O2):
define double @pair_tailcorr_switch3_olpslater1s1s(i8* nocapture readnone %0, i64 %1, i64 %2, double %3, double %4) {
ret double 0.000000e+00
}
void RTAvlULDoWithAll(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlULDoWithAll() {
ret void
}
const char *event_base_get_method(const struct event_base *base) {
  return "libev";
}


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

x86 assembly (clang, -O2):
<event_base_get_method>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct.event_base = type opaque
@.str = [6 x i8] c"libev\00"
define i8* @event_base_get_method(%struct.event_base* %0) {
%2 = alloca %struct.event_base*
store %struct.event_base* %0, %struct.event_base** %2
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.event_base = type opaque
@.str = [6 x i8] c"libev\00"
define i8* @event_base_get_method(%struct.event_base* nocapture readnone %0) {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ perror(char *);
void terminate_client(int client) {
  if (close(client) < 0) {
    perror("Client close failed: ");
  }
}


x86 assembly (clang, -O0):
<terminate_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
jge    1149 <terminate_client+0x29>
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminate_client>:
push   %rax
call   1030 <close@plt>
test   %rax,%rax
js     112d <terminate_client+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Client close failed: \00"
define void @terminate_client(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @close(i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Client close failed: \00"
define void @terminate_client(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
void f1(int *px) { *px = 1234; }


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

x86 assembly (clang, -O2):
<f1>:
movl   $0x4d2,(%rdi)
ret

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

LLVM IR (-O2):
define void @f1(i32* nocapture writeonly %0) {
store i32 1234, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ asm_cprint(char, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ getdisppage();
int getnumcols();
int getnumrows();
int /*<<< orphan*/ gotoxy(int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/);
void cls(void) {
  gotoxy(0, 0, getdisppage());
  asm_cprint(' ', 0x07, getnumrows() * getnumcols(), getdisppage());
}


x86 assembly (clang, -O0):
<cls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getdisppage@plt>
mov    %eax,%edx
xor    %esi,%esi
mov    %esi,%edi
call   1060 <gotoxy@plt>
mov    $0x0,%al
call   1030 <getnumrows@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getnumcols@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getdisppage@plt>
mov    -0x4(%rbp),%edx
mov    %eax,%ecx
mov    $0x20,%edi
mov    $0x7,%esi
call   1070 <asm_cprint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cls>:
push   %rbx
xor    %eax,%eax
call   1040 <getdisppage@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %eax,%edx
call   1060 <gotoxy@plt>
xor    %eax,%eax
call   1030 <getnumrows@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getnumcols@plt>
imul   %eax,%ebx
xor    %eax,%eax
call   1040 <getdisppage@plt>
mov    $0x20,%edi
mov    $0x7,%esi
mov    %ebx,%edx
mov    %eax,%ecx
pop    %rbx
jmp    1070 <asm_cprint@plt>

LLVM IR (-O0):
define void @cls() {
%1 = call i32 (...) @getdisppage()
%2 = call i32 @gotoxy(i32 0, i32 0, i32 %1)
%3 = call i32 (...) @getnumrows()
%4 = call i32 (...) @getnumcols()
%5 = mul nsw i32 %3, %4
%6 = call i32 (...) @getdisppage()
%7 = call i32 @asm_cprint(i8 signext 32, i32 7, i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @cls() {
%1 = tail call i32 (...) @getdisppage()
%2 = tail call i32 @gotoxy(i32 0, i32 0, i32 %1)
%3 = tail call i32 (...) @getnumrows()
%4 = tail call i32 (...) @getnumcols()
%5 = mul nsw i32 %4, %3
%6 = tail call i32 (...) @getdisppage()
%7 = tail call i32 @asm_cprint(i8 signext 32, i32 7, i32 %5, i32 %6)
ret void
}
int inevent_get_fd(void) { return (-1); }


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

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

LLVM IR (-O0):
define i32 @inevent_get_fd() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @inevent_get_fd() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ err_quit(char *);
int listen(int, int);
int Listen(int sockfd, int backlog) {
  if (listen(sockfd, backlog) == -1)
    err_quit("listen()");
  return 0;
}


x86 assembly (clang, -O0):
<Listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <listen@plt>
cmp    $0xffffffff,%eax
jne    114e <Listen+0x2e>
lea    0xeb7(%rip),%rdi
call   1030 <err_quit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Listen>:
push   %rax
call   1040 <listen@plt>
cmp    $0xffffffff,%eax
jne    1137 <Listen+0x17>
lea    0xece(%rip),%rdi
call   1030 <err_quit@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"listen()\00"
define i32 @Listen(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err_quit(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, char *, int);
int flash_query(unsigned char *data) {
  memcpy(data, "Linux Synthetic Flash", sizeof("Linux Synthetic Flash"));
  return 0;
}


x86 assembly (clang, -O0):
<flash_query>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x16,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_query>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x16,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Linux Synthetic Flash\00"
define i32 @flash_query(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @memcpy(i8* %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 22)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Linux Synthetic Flash\00"
define i32 @flash_query(i8* %0) {
%2 = tail call i32 @memcpy(i8* %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 22)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gdt_init();
int /*<<< orphan*/ idt_init();
void isa_init() {
  gdt_init();
  idt_init();
}


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

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

LLVM IR (-O0):
define void @isa_init() {
%1 = call i32 (...) @gdt_init()
%2 = call i32 (...) @idt_init()
ret void
}

LLVM IR (-O2):
define void @isa_init() {
%1 = tail call i32 (...) @gdt_init()
%2 = tail call i32 (...) @idt_init()
ret void
}
int w3(struct rusage *__usage) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.rusage = type opaque
define i32 @w3(%struct.rusage* nocapture readnone %0) {
ret i32 0
}
char FormatDataDigitValueToChar(unsigned digit) {
  char ret = '?';
  if (digit < 10)
    ret = digit + '0';
  else
    ret = (digit - 10) + 'A';
  return ret;
}


x86 assembly (clang, -O0):
<FormatDataDigitValueToChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movb   $0x3f,-0x5(%rbp)
cmpl   $0xa,-0x4(%rbp)
jae    1123 <FormatDataDigitValueToChar+0x23>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x5(%rbp)
jmp    112f <FormatDataDigitValueToChar+0x2f>
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FormatDataDigitValueToChar>:
cmp    $0xa,%edi
mov    $0x30,%ecx
mov    $0x37,%eax
cmovb  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @FormatDataDigitValueToChar(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
store i8 63, i8* %3
%4 = load i32, i32* %2
%5 = icmp ult i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add i32 %7, 48
%9 = trunc i32 %8 to i8
store i8 %9, i8* %3
br label %15
10: ; preds = %1
%11 = load i32, i32* %2
%12 = sub i32 %11, 10
%13 = add i32 %12, 65
%14 = trunc i32 %13 to i8
store i8 %14, i8* %3
br label %15
15: ; preds = %10, %6
%16 = load i8, i8* %3
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @FormatDataDigitValueToChar(i32 %0) {
%2 = icmp ult i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 48, i8 55
%5 = add i8 %4, %3
ret i8 %5
}
int _mpyhslu(int src1, unsigned int src2) {
  return (short)(src1 >> 16) * (unsigned short)src2;
}


x86 assembly (clang, -O0):
<_mpyhslu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
cwtl
mov    -0x8(%rbp),%ecx
movzwl %cx,%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mpyhslu>:
sar    $0x10,%edi
movzwl %si,%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @_mpyhslu(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 = ashr i32 %5, 16
%7 = trunc i32 %6 to i16
%8 = sext i16 %7 to i32
%9 = load i32, i32* %4
%10 = trunc i32 %9 to i16
%11 = zext i16 %10 to i32
%12 = mul nsw i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @_mpyhslu(i32 %0, i32 %1) {
%3 = ashr i32 %0, 16
%4 = and i32 %1, 65535
%5 = mul nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ wb_smsc_wdt_set_timeout(unsigned char);
void wb_smsc_wdt_disable(void) {
  {
    wb_smsc_wdt_set_timeout((unsigned char)0);
    return;
  }
}


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

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

LLVM IR (-O0):
define void @wb_smsc_wdt_disable() {
%1 = call i32 @wb_smsc_wdt_set_timeout(i8 zeroext 0)
ret void
}

LLVM IR (-O2):
define void @wb_smsc_wdt_disable() {
%1 = tail call i32 @wb_smsc_wdt_set_timeout(i8 zeroext 0)
ret void
}
void cgispst(void) {}


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

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

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

LLVM IR (-O2):
define void @cgispst() {
ret void
}
/* Variables and functions */
size_t pppoat_base64_enc_len(const void *buf, size_t len) {
  return (len + 2) / 3 * 4;
}


x86 assembly (clang, -O0):
<pppoat_base64_enc_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pppoat_base64_enc_len>:
lea    0x2(%rsi),%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
lea    (%rdx,%rdx,1),%rax
and    $0xfffffffffffffffc,%rax
ret

LLVM IR (-O0):
define i64 @pppoat_base64_enc_len(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = add i64 %5, 2
%7 = udiv i64 %6, 3
%8 = mul i64 %7, 4
ret i64 %8
}

LLVM IR (-O2):
define i64 @pppoat_base64_enc_len(i8* nocapture readnone %0, i64 %1) {
%3 = add i64 %1, 2
%4 = udiv i64 %3, 3
%5 = shl i64 %4, 2
ret i64 %5
}
void pinInit() {
  (*(volatile unsigned long *)(0x3FFFC000 + 0x80)) |= 1 << 14;
  (*(volatile unsigned long *)(0x3FFFC000 + 0x80)) |= 1 << 12;
}


x86 assembly (clang, -O0):
<pinInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3fffc080,%eax
mov    (%rax),%rcx
or     $0x4000,%rcx
mov    $0x3fffc080,%eax
mov    %rcx,(%rax)
mov    $0x3fffc080,%eax
mov    (%rax),%rcx
or     $0x1000,%rcx
mov    $0x3fffc080,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pinInit>:
orq    $0x4000,0x3fffc080
orq    $0x1000,0x3fffc080
ret

LLVM IR (-O0):
define void @pinInit() {
%1 = load volatile i64, i64* inttoptr (i64 1073725568 to i64*)
%2 = or i64 %1, 16384
store volatile i64 %2, i64* inttoptr (i64 1073725568 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1073725568 to i64*)
%4 = or i64 %3, 4096
store volatile i64 %4, i64* inttoptr (i64 1073725568 to i64*)
ret void
}

LLVM IR (-O2):
define void @pinInit() {
%1 = load volatile i64, i64* inttoptr (i64 1073725568 to i64*)
%2 = or i64 %1, 16384
store volatile i64 %2, i64* inttoptr (i64 1073725568 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1073725568 to i64*)
%4 = or i64 %3, 4096
store volatile i64 %4, i64* inttoptr (i64 1073725568 to i64*)
ret void
}
int main(int argc, char **argv) {
  switch (argc) {
  case 1:
    return 1;
  case 2:
    return 2;
  case 3:
    __builtin_abort();
  case 4:
    __builtin_abort();
  default:
    return 5;
  }
  return 10;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x3,%eax
ja     1171 <main+0x61>
mov    -0x18(%rbp),%rax
lea    0xeba(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1178 <main+0x68>
movl   $0x2,-0x4(%rbp)
jmp    1178 <main+0x68>
call   1030 <abort@plt>
call   1030 <abort@plt>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    -0x1(%rdi),%eax
cmp    $0x3,%eax
ja     1130 <main+0x20>
lea    0xee0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x2,%edi
jmp    1135 <main+0x25>
mov    $0x5,%edi
mov    %edi,%eax
pop    %rcx
ret
call   1030 <abort@plt>

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 = load i32, i32* %4
switch i32 %6, label %11 [
i32 1, label %7
i32 2, label %8
i32 3, label %9
i32 4, label %10
]
7: ; preds = %2
store i32 1, i32* %3
br label %12
8: ; preds = %2
store i32 2, i32* %3
br label %12
9: ; preds = %2
unreachable
10: ; preds = %2
unreachable
11: ; preds = %2
store i32 5, i32* %3
br label %12
12: ; preds = %11, %8, %7
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
switch i32 %0, label %6 [
i32 1, label %7
i32 2, label %3
i32 3, label %4
i32 4, label %5
]
3: ; preds = %2
br label %7
4: ; preds = %2
tail call void @abort()
unreachable
5: ; preds = %2
tail call void @abort()
unreachable
6: ; preds = %2
br label %7
7: ; preds = %2, %6, %3
%8 = phi i32 [ 5, %6 ], [ 2, %3 ], [ %0, %2 ]
ret i32 %8
}
void __both3(void) {}


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

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

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

LLVM IR (-O2):
define void @__both3() {
ret void
}
int ft_wlen(char const *s, char c) {
  int len;
  len = 0;
  while (s[len] && s[len] != c)
    len++;
  return (len);
}


x86 assembly (clang, -O0):
<ft_wlen>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1147 <ft_wlen+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1157 <ft_wlen+0x57>
jmp    1165 <ft_wlen+0x65>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <ft_wlen+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_wlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi),%ecx
add    $0x1,%eax
test   %cl,%cl
je     1123 <ft_wlen+0x23>
add    $0x1,%rdi
cmp    %sil,%cl
jne    1110 <ft_wlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @ft_wlen(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %10, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = icmp eq i8 %6, %1
%9 = or i1 %7, %8
%10 = add nuw i64 %4, 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = trunc i64 %4 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("bin-embed\r\n");
  printf("(C) 2014 Christian Gunderman\r\n\r\n");
  printf("Convert binary files to C headers.\r\n");
  printf("Usage:\r\n");
  printf("  bin-embed [constantName] [inputFile] [outputFile] ... repeat\r\n");
}


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

x86 assembly (clang, -O2):
<print_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xf13(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0f(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"bin-embed\0D\0A\00"
@.str.1 = [33 x i8] c"(C) 2014 Christian Gunderman\0D\0A\0D\0A\00"
@.str.2 = [37 x i8] c"Convert binary files to C headers.\0D\0A\00"
@.str.3 = [9 x i8] c"Usage:\0D\0A\00"
@.str.4 = [65 x i8] c" bin-embed [constantName] [inputFile] [outputFile] ... repeat\0D\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"bin-embed\0D\00"
@str.5 = [32 x i8] c"(C) 2014 Christian Gunderman\0D\0A\0D\00"
@str.6 = [36 x i8] c"Convert binary files to C headers.\0D\00"
@str.7 = [8 x i8] c"Usage:\0D\00"
@str.8 = [64 x i8] c" bin-embed [constantName] [inputFile] [outputFile] ... repeat\0D\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.8, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ brp_free_null_internal(void *, void *, int);
void brp_free_null_1(void *storage, void *ptr) {
  brp_free_null_internal(storage, ptr, 1);
}


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

x86 assembly (clang, -O2):
<brp_free_null_1>:
mov    $0x1,%edx
jmp    1030 <brp_free_null_internal@plt>

LLVM IR (-O0):
define void @brp_free_null_1(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 = load i8*, i8** %4
%7 = call i32 @brp_free_null_internal(i8* %5, i8* %6, i32 1)
ret void
}

LLVM IR (-O2):
define void @brp_free_null_1(i8* %0, i8* %1) {
%3 = tail call i32 @brp_free_null_internal(i8* %0, i8* %1, i32 1)
ret void
}
void test79_Junk_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test79_Junk_targetInit__I() {
ret void
}
int ws_list_comparator_double(const void *a, const void *b) {
  return (*(double *)a < *(double *)b) - (*(double *)a > *(double *)b);
}


x86 assembly (clang, -O0):
<ws_list_comparator_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%rcx
movsd  (%rcx),%xmm0
mov    -0x10(%rbp),%rcx
ucomisd (%rcx),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ws_list_comparator_double>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ws_list_comparator_double(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 = bitcast i8* %5 to double*
%7 = load double, double* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
%11 = fcmp olt double %7, %10
%12 = zext i1 %11 to i32
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to double*
%15 = load double, double* %14
%16 = load i8*, i8** %4
%17 = bitcast i8* %16 to double*
%18 = load double, double* %17
%19 = fcmp ogt double %15, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @ws_list_comparator_double(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = zext i1 %7 to i32
%9 = fcmp ogt double %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
long long GetN() { return 100LL; }


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

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

LLVM IR (-O0):
define i64 @GetN() {
ret i64 100
}

LLVM IR (-O2):
define i64 @GetN() {
ret i64 100
}
/* Variables and functions */
int /*<<< orphan*/ wait_for_one_thread(int);
void wait_for_bio_threads() {
  int i = 2;
  for (; i < 130; i++) {
    wait_for_one_thread(i);
  }
}


x86 assembly (clang, -O0):
<wait_for_bio_threads>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
cmpl   $0x82,-0x4(%rbp)
jge    1142 <wait_for_bio_threads+0x32>
mov    -0x4(%rbp),%edi
call   1030 <wait_for_one_thread@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <wait_for_bio_threads+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_bio_threads>:
push   %rbx
mov    $0x2,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <wait_for_one_thread@plt>
add    $0x1,%ebx
cmp    $0x82,%ebx
jne    1120 <wait_for_bio_threads+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @wait_for_bio_threads() {
%1 = alloca i32
store i32 2, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 130
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @wait_for_one_thread(i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @wait_for_bio_threads() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 2, %0 ], [ %4, %1 ]
%3 = tail call i32 @wait_for_one_thread(i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 130
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_inivect();
int /*<<< orphan*/ init_sincos();
int /*<<< orphan*/ init_window();
void init_tbl(void) {
  init_sincos();
  init_window();
  init_inivect();
}


x86 assembly (clang, -O0):
<init_tbl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <init_sincos@plt>
mov    $0x0,%al
call   1040 <init_window@plt>
mov    $0x0,%al
call   1050 <init_inivect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_tbl>:
push   %rax
xor    %eax,%eax
call   1030 <init_sincos@plt>
xor    %eax,%eax
call   1040 <init_window@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <init_inivect@plt>

LLVM IR (-O0):
define void @init_tbl() {
%1 = call i32 (...) @init_sincos()
%2 = call i32 (...) @init_window()
%3 = call i32 (...) @init_inivect()
ret void
}

LLVM IR (-O2):
define void @init_tbl() {
%1 = tail call i32 (...) @init_sincos()
%2 = tail call i32 (...) @init_window()
%3 = tail call i32 (...) @init_inivect()
ret void
}
/* Variables and functions */
int is_file_or_directory64(char *);
int IsValidFile(char *lpf) {
  if (is_file_or_directory64(lpf) == 2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<IsValidFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <is_file_or_directory64@plt>
cmp    $0x2,%eax
jne    113a <IsValidFile+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <IsValidFile+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsValidFile>:
push   %rax
call   1030 <is_file_or_directory64@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @IsValidFile(i8* %0) {
%2 = tail call i32 @is_file_or_directory64(i8* %0)
%3 = icmp eq i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ log_part(char *, char);
void log_array(char *name) { log_part(name, '['); }


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

x86 assembly (clang, -O2):
<log_array>:
mov    $0x5b,%esi
jmp    1030 <log_part@plt>

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

LLVM IR (-O2):
define void @log_array(i8* %0) {
%2 = tail call i32 @log_part(i8* %0, i8 signext 91)
ret void
}
void setup() { return; }


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

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

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

LLVM IR (-O2):
define void @setup() {
ret void
}
void strreverse(unsigned char *begin, unsigned char *end) {
  unsigned char aux;
  while (end > begin) {
    aux = *end, *end-- = *begin, *begin++ = aux;
  }
}


x86 assembly (clang, -O0):
<strreverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jbe    1153 <strreverse+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <strreverse+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strreverse>:
cmp    %rdi,%rsi
jbe    112c <strreverse+0x2c>
add    $0xffffffffffffffff,%rsi
nopl   0x0(%rax)
movzbl 0x1(%rsi),%eax
movzbl (%rdi),%ecx
mov    %cl,0x1(%rsi)
mov    %al,(%rdi)
add    $0x1,%rdi
lea    -0x1(%rsi),%rax
cmp    %rdi,%rsi
mov    %rax,%rsi
ja     1110 <strreverse+0x10>
ret

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

LLVM IR (-O2):
define void @strreverse(i8* %0, i8* %1) {
%3 = icmp ugt i8* %1, %0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i8* [ %10, %4 ], [ %0, %2 ]
%6 = phi i8* [ %9, %4 ], [ %1, %2 ]
%7 = load i8, i8* %6
%8 = load i8, i8* %5
%9 = getelementptr inbounds i8, i8* %6, i64 -1
store i8 %8, i8* %6
%10 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%11 = icmp ugt i8* %9, %10
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
int ft_strclen(const char *s, char c) {
  int i;
  i = 0;
  while (s[i] != c && s[i])
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<ft_strclen>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
movsbl -0x9(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
je     1147 <ft_strclen+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1157 <ft_strclen+0x57>
jmp    1165 <ft_strclen+0x65>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <ft_strclen+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi),%ecx
add    $0x1,%eax
cmp    %sil,%cl
je     1123 <ft_strclen+0x23>
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <ft_strclen+0x10>
ret

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

LLVM IR (-O2):
define i32 @ft_strclen(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %10, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, %1
%8 = icmp eq i8 %6, 0
%9 = or i1 %7, %8
%10 = add nuw i64 %4, 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = trunc i64 %4 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ __wrap_write(int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void _start(void) { __wrap_write(1, "hi there\n", strlen("hi there\n")); }


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xec2(%rip),%rsi
call   1040 <__wrap_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <__wrap_write@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"hi there\0A\00"
define void @_start() {
%1 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @__wrap_write(i32 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"hi there\0A\00"
define void @_start() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @__wrap_write(i32 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_sigchld(int /*<<< orphan*/);
void bg_jobs_unfreeze(void) { (void)set_sigchld(0); }


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

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

LLVM IR (-O0):
define void @bg_jobs_unfreeze() {
%1 = call i32 @set_sigchld(i32 0)
ret void
}

LLVM IR (-O2):
define void @bg_jobs_unfreeze() {
%1 = tail call i32 @set_sigchld(i32 0)
ret void
}
int fun1311() { return 1311; }


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

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

LLVM IR (-O0):
define i32 @fun1311() {
ret i32 1311
}

LLVM IR (-O2):
define i32 @fun1311() {
ret i32 1311
}
/* Variables and functions */
float scalbf(float, float);
float test6f(float x, float exp) { return scalbf(x, exp); }


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

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

LLVM IR (-O0):
define float @test6f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @scalbf(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @test6f(float %0, float %1) {
%3 = tail call float @scalbf(float %0, float %1)
ret float %3
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t quicly_decode24(const uint8_t **src) {
  uint32_t v = (uint32_t)(*src)[0] << 16 | (uint32_t)(*src)[1] << 8 |
               (uint32_t)(*src)[2];
  *src += 3;
  return v;
}


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

x86 assembly (clang, -O2):
<quicly_decode24>:
mov    (%rdi),%rcx
mov    (%rcx),%edx
mov    0x8(%rcx),%eax
shl    $0x10,%edx
shl    $0x8,%eax
or     %edx,%eax
or     0x10(%rcx),%eax
add    $0x18,%rcx
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @quicly_decode24(i64** nocapture %0) {
%2 = load i64*, i64** %0
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = shl i32 %4, 16
%6 = getelementptr inbounds i64, i64* %2, i64 1
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 8
%10 = or i32 %9, %5
%11 = getelementptr inbounds i64, i64* %2, i64 2
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = or i32 %10, %13
%15 = getelementptr inbounds i64, i64* %2, i64 3
store i64* %15, i64** %0
ret i32 %14
}
int get_PDSGridTYPE(unsigned char *pds) { return pds[6]; }


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

x86 assembly (clang, -O2):
<get_PDSGridTYPE>:
movzbl 0x6(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_PDSGridTYPE(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 6
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_PDSGridTYPE(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 6
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fmod(float, float);
float luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
void math_mod(void) {
  float x = luaL_check_number(1);
  float y = luaL_check_number(2);
  lua_pushnumber(fmod(x, y));
}


x86 assembly (clang, -O0):
<math_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1040 <luaL_check_number@plt>
movss  %xmm0,-0x4(%rbp)
mov    $0x2,%edi
call   1040 <luaL_check_number@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <fmod@plt>
mov    %eax,%edi
call   1050 <lua_pushnumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_mod>:
push   %rax
mov    $0x1,%edi
call   1040 <luaL_check_number@plt>
movss  %xmm0,0x4(%rsp)
mov    $0x2,%edi
call   1040 <luaL_check_number@plt>
movaps %xmm0,%xmm1
movss  0x4(%rsp),%xmm0
call   1030 <fmod@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_mod() {
%1 = alloca float
%2 = alloca float
%3 = call float @luaL_check_number(i32 1)
store float %3, float* %1
%4 = call float @luaL_check_number(i32 2)
store float %4, float* %2
%5 = load float, float* %1
%6 = load float, float* %2
%7 = call i32 @fmod(float %5, float %6)
%8 = call i32 @lua_pushnumber(i32 %7)
ret void
}

LLVM IR (-O2):
define void @math_mod() {
%1 = tail call float @luaL_check_number(i32 1)
%2 = tail call float @luaL_check_number(i32 2)
%3 = tail call i32 @fmod(float %1, float %2)
%4 = tail call i32 @lua_pushnumber(i32 %3)
ret void
}