xunge/DecIR huggingface dataset:
int wfile_leap_year(int year) {
  return ((year % 400 == 0) || ((year % 100 != 0) && (year % 4 == 0)));
}


x86 assembly (clang, -O0):
<wfile_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
je     1153 <wfile_leap_year+0x53>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
je     114d <wfile_leap_year+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wfile_leap_year>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
jb     112c <wfile_leap_year+0x2c>
ror    $0x2,%eax
cmp    $0x28f5c29,%eax
jb     1132 <wfile_leap_year+0x32>
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @wfile_leap_year(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 400
%5 = icmp eq i32 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 4
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ false, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ true, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @wfile_leap_year(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = and i32 %0, 3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ qsortHelper(void *, size_t, size_t, int /*<<< orphan*/,
                               size_t, int (*)(void const *, void const *));
int /*<<< orphan*/ shuffle(void *, size_t, size_t, size_t);
scalar_t__ time(int /*<<< orphan*/ *);
void quicksort(void *base, size_t count, size_t width,
               int (*cmp)(const void *, const void *)) {
  shuffle(base, count, width, (size_t)time(NULL));
  qsortHelper(base, count, width, 0, count, cmp);
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    %rax,%rcx
call   1030 <shuffle@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%r8
mov    -0x20(%rbp),%r9
xor    %ecx,%ecx
call   1050 <qsortHelper@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r12
xor    %edi,%edi
call   1040 <time@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %rax,%rcx
call   1030 <shuffle@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
xor    %ecx,%ecx
mov    %rbx,%r8
mov    %r14,%r9
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1050 <qsortHelper@plt>

LLVM IR (-O0):
define void @quicksort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32 (i8*, i8*)*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 (i8*, i8*)* %3, i32 (i8*, i8*)** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = call i64 @time(i32* null)
%13 = call i32 @shuffle(i8* %9, i64 %10, i64 %11, i64 %12)
%14 = load i8*, i8** %5
%15 = load i64, i64* %6
%16 = load i64, i64* %7
%17 = load i64, i64* %6
%18 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %8
%19 = call i32 @qsortHelper(i8* %14, i64 %15, i64 %16, i32 0, i64 %17, i32 (i8*, i8*)* %18)
ret void
}

LLVM IR (-O2):
define void @quicksort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = tail call i64 @time(i32* null)
%6 = tail call i32 @shuffle(i8* %0, i64 %1, i64 %2, i64 %5)
%7 = tail call i32 @qsortHelper(i8* %0, i64 %1, i64 %2, i32 0, i64 %1, i32 (i8*, i8*)* %3)
ret void
}
int ft_strlen(char *str) {
  int i;
  i = 0;
  if (str == 0)
    return (0);
  while (str[i] != '\0') {
    i++;
  }
  return (i);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1126 <ft_strlen+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1154 <ft_strlen+0x54>
jmp    112b <ft_strlen+0x2b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114e <ft_strlen+0x4e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <ft_strlen+0x2b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
test   %rdi,%rdi
je     111d <ft_strlen+0x1d>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void b_putchar(int idx, int *cells, int size) { putchar(cells[idx]); }


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

x86 assembly (clang, -O2):
<b_putchar>:
movslq %edi,%rax
mov    (%rsi,%rax,4),%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @b_putchar(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %5
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
%12 = call i32 @putchar(i32 %11)
ret void
}

LLVM IR (-O2):
define void @b_putchar(i32 %0, i32* nocapture %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
%7 = tail call i32 @putchar(i32 %6)
ret void
}
void CONF_parse_list(void) {}


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

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

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

LLVM IR (-O2):
define void @CONF_parse_list() {
ret void
}
zz_bind_call_exe_proc(proc, tag) int (*proc)();
const char *tag;
{
  setaction_exeproc(proc, find_tag(tag));
  return 1;
}


x86 assembly (clang, -O0):
<zz_bind_call_exe_proc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <find_tag@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    $0x0,%al
call   1040 <setaction_exeproc@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zz_bind_call_exe_proc>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
xor    %eax,%eax
call   1030 <find_tag@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <setaction_exeproc@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @zz_bind_call_exe_proc(i32 (...)* %0, i8* %1) {
%3 = alloca i32 (...)*
%4 = alloca i8*
store i32 (...)* %0, i32 (...)** %3
store i8* %1, i8** %4
%5 = load i32 (...)*, i32 (...)** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @find_tag to i32 (i8*, ...)*)(i8* %6)
%8 = call i32 (i32 (...)*, i32, ...) bitcast (i32 (...)* @setaction_exeproc to i32 (i32 (...)*, i32, ...)*)(i32 (...)* %5, i32 %7)
ret i32 1
}

LLVM IR (-O2):
define i32 @zz_bind_call_exe_proc(i32 (...)* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @find_tag to i32 (i8*, ...)*)(i8* %1)
%4 = tail call i32 (i32 (...)*, i32, ...) bitcast (i32 (...)* @setaction_exeproc to i32 (i32 (...)*, i32, ...)*)(i32 (...)* %0, i32 %3)
ret i32 1
}
int fusion_short(short *p) { return p[0x12345]; }


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

x86 assembly (clang, -O2):
<fusion_short>:
movswl 0x2468a(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @fusion_short(i16* nocapture %0) {
%2 = getelementptr inbounds i16, i16* %0, i64 74565
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
ret i32 %4
}
/* Variables and functions */
int UINT_MAX;
f4() {
  int b = -1;
  return b >= UINT_MAX;
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed3(%rip),%rcx
cmp    (%rcx),%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
@UINT_MAX = global i32 0
define i32 @f4() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = load i32, i32* %1
%3 = load i32, i32* @UINT_MAX
%4 = icmp sge i32 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
@UINT_MAX = global i32 0
define i32 @f4() {
%1 = load i32, i32* @UINT_MAX
%2 = lshr i32 %1, 31
ret i32 %2
}
double calcEccentricityEarthOrbit(double t) {
  double e = 0.016708634 - t * (0.000042037 + 0.0000001267 * t);
  return e;
}


x86 assembly (clang, -O0):
<calcEccentricityEarthOrbit>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xeed(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xee9(%rip),%xmm2
addsd  %xmm2,%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeb2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcEccentricityEarthOrbit>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xef0(%rip),%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calcEccentricityEarthOrbit(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double 1.267000e-07, double %5, double 4.203700e-05)
%7 = fneg double %4
%8 = call double @llvm.fmuladd.f64(double %7, double %6, double 0x3F911C11725D0380)
store double %8, double* %3
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @calcEccentricityEarthOrbit(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 1.267000e-07, double 4.203700e-05)
%3 = fneg double %0
%4 = tail call double @llvm.fmuladd.f64(double %3, double %2, double 0x3F911C11725D0380)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ init();
int /*<<< orphan*/ loop();
int /*<<< orphan*/ setup();
int main(int argc, char **argv) {
  init();
  setup();
  while (1)
    loop();
}


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   1040 <init@plt>
mov    $0x0,%al
call   1050 <setup@plt>
mov    $0x0,%al
call   1030 <loop@plt>
jmp    1154 <main+0x24>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init@plt>
xor    %eax,%eax
call   1050 <setup@plt>
nop
xor    %eax,%eax
call   1030 <loop@plt>
jmp    1140 <main+0x10>

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 (...) @init()
%7 = call i32 (...) @setup()
br label %8
8: ; preds = %2, %8
%9 = call i32 (...) @loop()
br label %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init()
%4 = tail call i32 (...) @setup()
br label %5
5: ; preds = %2, %5
%6 = tail call i32 (...) @loop()
br label %5
}
void INT_Excep_CAN2_TXF2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_CAN2_TXF2() {
ret void
}
/* Variables and functions */
scalar_t__ isspace(unsigned char);
char *mutt_skip_whitespace(char *p) {
  while (*(p) && isspace((unsigned char)*(p)))
    p++;
  ;
  return p;
}


x86 assembly (clang, -O0):
<mutt_skip_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <mutt_skip_whitespace+0x37>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <mutt_skip_whitespace+0x47>
jmp    1168 <mutt_skip_whitespace+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <mutt_skip_whitespace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutt_skip_whitespace>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <mutt_skip_whitespace+0x29>
nopw   0x0(%rax,%rax,1)
movzbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <mutt_skip_whitespace+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <mutt_skip_whitespace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mutt_skip_whitespace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i64 @isspace(i8 zeroext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @mutt_skip_whitespace(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 zeroext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
int str_is_space(char c) {
  if ((c == ' ') || (c == '\t')) {
    return (1);
  }
  if ((c == '\n') || (c == '\r')) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<str_is_space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1124 <str_is_space+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
jne    1130 <str_is_space+0x30>
movl   $0x1,-0x4(%rbp)
jmp    115d <str_is_space+0x5d>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     114a <str_is_space+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
jne    1156 <str_is_space+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <str_is_space+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_is_space>:
cmp    $0x20,%dil
ja     1120 <str_is_space+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002600,%rdx
bt     %rcx,%rdx
jae    1120 <str_is_space+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @str_is_space(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 9, label %3
i8 13, label %3
i8 10, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Type definitions */
struct libgamma_site_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct libgamma_site_state *);
int /*<<< orphan*/ libgamma_site_destroy(struct libgamma_site_state *);
__attribute__((__nonnull__)) void
libgamma_site_free(struct libgamma_site_state *restrict this__) {
  libgamma_site_destroy(this__);
  free(this__);
}


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

x86 assembly (clang, -O2):
<libgamma_site_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <libgamma_site_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.libgamma_site_state = type { i32 }
define void @libgamma_site_free(%struct.libgamma_site_state* noalias %0) {
%2 = alloca %struct.libgamma_site_state*
store %struct.libgamma_site_state* %0, %struct.libgamma_site_state** %2
%3 = load %struct.libgamma_site_state*, %struct.libgamma_site_state** %2
%4 = call i32 @libgamma_site_destroy(%struct.libgamma_site_state* %3)
%5 = load %struct.libgamma_site_state*, %struct.libgamma_site_state** %2
%6 = call i32 @free(%struct.libgamma_site_state* %5)
ret void
}

LLVM IR (-O2):
%struct.libgamma_site_state = type { i32 }
define void @libgamma_site_free(%struct.libgamma_site_state* noalias %0) {
%2 = tail call i32 @libgamma_site_destroy(%struct.libgamma_site_state* %0)
%3 = tail call i32 @free(%struct.libgamma_site_state* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int run();
int main() {
  int f, i;
  for (i = 0; i < 1000; i++) {
    f = run();
  }
  printf("%d", f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    115b <main+0x3b>
mov    $0x0,%al
call   1030 <run@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0x8(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3e8,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <run@plt>
add    $0xffffffff,%ebx
jne    1130 <main+0x10>
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 (...) @run()
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 1000
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
int monus(int const a, int const b) { return a >= b ? a - b : 0; }


x86 assembly (clang, -O0):
<monus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1124 <monus+0x24>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112e <monus+0x2e>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <monus+0x2e>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<monus>:
xor    %eax,%eax
sub    %esi,%edi
cmovge %edi,%eax
ret

LLVM IR (-O0):
define i32 @monus(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 = icmp sge i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
br label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %8
%14 = phi i32 [ %11, %8 ], [ 0, %12 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @monus(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = sub nsw i32 %0, %1
%5 = select i1 %3, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int PAPI_multiplex_init();
void papif_multiplex_init_(int *check) { *check = PAPI_multiplex_init(); }


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

x86 assembly (clang, -O2):
<papif_multiplex_init_>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <PAPI_multiplex_init@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_multiplex_init_(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @PAPI_multiplex_init()
store i32 %2, i32* %0
ret void
}
/* Variables and functions */
int dal_reg_read(unsigned int, unsigned int, unsigned int *);
int ingress_reg_get(unsigned int dev_id, unsigned int reg_addr,
                    unsigned int *pvalue) {
  return dal_reg_read(dev_id, reg_addr + 0x100000, pvalue);
}


x86 assembly (clang, -O0):
<ingress_reg_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x100000,%esi
mov    -0x10(%rbp),%rdx
call   1030 <dal_reg_read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ingress_reg_get>:
add    $0x100000,%esi
jmp    1030 <dal_reg_read@plt>

LLVM IR (-O0):
define i32 @ingress_reg_get(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add i32 %8, 1048576
%10 = load i32*, i32** %6
%11 = call i32 @dal_reg_read(i32 %7, i32 %9, i32* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @ingress_reg_get(i32 %0, i32 %1, i32* %2) {
%4 = add i32 %1, 1048576
%5 = tail call i32 @dal_reg_read(i32 %0, i32 %4, i32* %2)
ret i32 %5
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/sexp.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/sexp.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/sexp.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ clr_write_event(int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ writeSocket(int);
bool socketchild_write_event_cb(int fd,
                                void __attribute__((__unused__)) * data) {
  syslog(LOG_INFO, "socketchild_write_event_cb OK fd %d", fd);
  writeSocket(fd);
  clr_write_event(fd);
  return true;
}


x86 assembly (clang, -O0):
<socketchild_write_event_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xeae(%rip),%rsi
call   1050 <syslog@plt>
mov    -0x4(%rbp),%edi
call   1040 <writeSocket@plt>
mov    -0x4(%rbp),%edi
call   1030 <clr_write_event@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socketchild_write_event_cb>:
push   %rbx
mov    %edi,%ebx
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
mov    %ebx,%edx
call   1050 <syslog@plt>
mov    %ebx,%edi
call   1040 <writeSocket@plt>
mov    %ebx,%edi
call   1030 <clr_write_event@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@LOG_INFO = global i32 0
@.str = [36 x i8] c"socketchild_write_event_cb OK fd %d\00"
define i32 @socketchild_write_event_cb(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @LOG_INFO
%6 = load i32, i32* %3
%7 = call i32 @syslog(i32 %5, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @writeSocket(i32 %8)
%10 = load i32, i32* %3
%11 = call i32 @clr_write_event(i32 %10)
ret i32 1
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@.str = [36 x i8] c"socketchild_write_event_cb OK fd %d\00"
define i32 @socketchild_write_event_cb(i32 %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @LOG_INFO
%4 = tail call i32 @syslog(i32 %3, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = tail call i32 @writeSocket(i32 %0)
%6 = tail call i32 @clr_write_event(i32 %0)
ret i32 1
}
/* Variables and functions */
int strcmp(char const *, char const *);
int iks_strcmp(const char *a, const char *b) {
  if (!a || !b)
    return -1;
  return strcmp(a, b);
}


x86 assembly (clang, -O0):
<iks_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <iks_strcmp+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <iks_strcmp+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1152 <iks_strcmp+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iks_strcmp>:
test   %rdi,%rdi
je     111f <iks_strcmp+0xf>
test   %rsi,%rsi
je     111f <iks_strcmp+0xf>
jmp    1030 <strcmp@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @iks_strcmp(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** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %8, %2
store i32 -1, i32* %3
br label %16
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = call i32 @strcmp(i8* %13, i8* %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %12, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @iks_strcmp(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @strcmp(i8* %0, i8* %1)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t size) {
  void *value = realloc(ptr, size);
  if (value == 0) {
    fatal("virtual memory exhausted");
  }
  return value;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <xrealloc+0x38>
lea    0xead(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xrealloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [25 x i8] c"virtual memory exhausted\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
float ceil(float);
float fabs(float);
float modceil(float f, float t) {
  t = fabs(t);
  return (ceil(f / t) * t);
}


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

x86 assembly (clang, -O2):
<modceil>:
sub    $0x18,%rsp
andps  0xee5(%rip),%xmm1
movaps %xmm1,(%rsp)
divss  %xmm1,%xmm0
call   1030 <ceilf@plt>
mulss  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @modceil(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = call float @fabs(float %5)
store float %6, float* %4
%7 = load float, float* %3
%8 = load float, float* %4
%9 = fdiv float %7, %8
%10 = call float @ceil(float %9)
%11 = load float, float* %4
%12 = fmul float %10, %11
ret float %12
}

LLVM IR (-O2):
define float @modceil(float %0, float %1) {
%3 = tail call float @llvm.fabs.f32(float %1)
%4 = fdiv float %0, %3
%5 = tail call float @llvm.ceil.f32(float %4)
%6 = fmul float %3, %5
ret float %6
}
double f(double x) { return 1 / x; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
ret double %4
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = fdiv double 1.000000e+00, %0
ret double %2
}
/* Variables and functions */
int serial_inbyte();
int getchar(void) { return (serial_inbyte()); }


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

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

LLVM IR (-O0):
define i32 @getchar() {
%1 = call i32 (...) @serial_inbyte()
ret i32 %1
}

LLVM IR (-O2):
define i32 @getchar() {
%1 = tail call i32 (...) @serial_inbyte()
ret i32 %1
}
/* Variables and functions */
char *strnset(char *s, int c, size_t l) {
  int i;
  for (i = 0; i < (int)l; i++)
    *(s + i) = (char)c;
  return s;
}


x86 assembly (clang, -O0):
<strnset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    %ecx,%eax
jge    1143 <strnset+0x43>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1116 <strnset+0x16>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnset>:
push   %rbx
mov    %rdi,%rbx
test   %edx,%edx
jle    1122 <strnset+0x12>
mov    %edx,%edx
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strnset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = trunc i64 %2 to i32
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = trunc i32 %1 to i8
%8 = and i64 %2, 4294967295
br label %9
9: ; preds = %6, %3
ret i8* %0
}
int fun852() { return 852; }


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

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

LLVM IR (-O0):
define i32 @fun852() {
ret i32 852
}

LLVM IR (-O2):
define i32 @fun852() {
ret i32 852
}
/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ symlinkat(char *, int /*<<< orphan*/, char *);
int main(void) {
  if (0 > symlinkat("see.emily.play/gnome", AT_FDCWD, "jugband.blues"))
    return EXIT_FAILURE;
  else
    return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
lea    0xed1(%rip),%rdi
lea    0xedf(%rip),%rdx
call   1030 <symlinkat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jle    115a <main+0x4a>
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <main+0x56>
mov    0x2e77(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
lea    0xeed(%rip),%rdx
call   1030 <symlinkat@plt>
test   %rax,%rax
jns    113b <main+0x2b>
mov    0x2ea7(%rip),%rax
jmp    1142 <main+0x32>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"see.emily.play/gnome\00"
@AT_FDCWD = global i32 0
@.str.1 = [14 x i8] c"jugband.blues\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @AT_FDCWD
%3 = call i64 @symlinkat(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp sgt i64 0, %3
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32, i32* @EXIT_FAILURE
store i32 %6, i32* %1
br label %9
7: ; preds = %0
%8 = load i32, i32* @EXIT_SUCCESS
store i32 %8, i32* %1
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [21 x i8] c"see.emily.play/gnome\00"
@AT_FDCWD = global i32 0
@.str.1 = [14 x i8] c"jugband.blues\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = load i32, i32* @AT_FDCWD
%2 = tail call i64 @symlinkat(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp slt i64 %2, 0
%4 = load i32, i32* @EXIT_FAILURE
%5 = load i32, i32* @EXIT_SUCCESS
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
int _write(int fd, char *buf, int nbytes) {
  (void)fd;
  (void)buf;
  (void)nbytes;
  return 0;
}


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_write(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
void fixChromosomeName(char *cname) {
  if (!strcmp(cname, "MT"))
    cname[1] = '\0';
}


x86 assembly (clang, -O0):
<fixChromosomeName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    113d <fixChromosomeName+0x2d>
mov    -0x8(%rbp),%rax
movb   $0x0,0x1(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixChromosomeName>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1126 <fixChromosomeName+0x16>
pop    %rbx
ret
movb   $0x0,0x1(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"MT\00"
define void @fixChromosomeName(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 0, i8* %5
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int link(const char *old, const char *new) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<link>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<link>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @link(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
float undenormalise(float x) {
  union {
    float f;
    unsigned int i;
  } u;
  u.f = x;
  if ((u.i & 0x7f800000) == 0) {
    return 0.0f;
  }
  return x;
}


x86 assembly (clang, -O0):
<undenormalise>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x7f800000,%eax
cmp    $0x0,%eax
jne    1131 <undenormalise+0x31>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113b <undenormalise+0x3b>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<undenormalise>:
movd   %xmm0,%eax
pxor   %xmm1,%xmm1
test   $0x7f800000,%eax
je     1113 <undenormalise+0x13>
movdqa %xmm0,%xmm1
movdqa %xmm1,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @undenormalise(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca %union.anon
store float %0, float* %3
%5 = load float, float* %3
%6 = bitcast %union.anon* %4 to float*
store float %5, float* %6
%7 = bitcast %union.anon* %4 to i32*
%8 = load i32, i32* %7
%9 = and i32 %8, 2139095040
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store float 0.000000e+00, float* %2
br label %14
12: ; preds = %1
%13 = load float, float* %3
store float %13, float* %2
br label %14
14: ; preds = %12, %11
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
define float @undenormalise(float %0) {
%2 = bitcast float %0 to i32
%3 = and i32 %2, 2139095040
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, float 0.000000e+00, float %0
ret float %5
}
_Complex float f32(_Complex float A, _Complex float B) { return A + B; }


x86 assembly (clang, -O0):
<f32>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x10(%rbp)
movlpd %xmm1,-0x18(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x18(%rbp),%xmm3
movss  -0x14(%rbp),%xmm2
addss  %xmm3,%xmm1
addss  %xmm2,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f32>:
addps  %xmm1,%xmm0
ret

LLVM IR (-O0):
define <2 x float> @f32(<2 x float> %0, <2 x float> %1) {
%3 = alloca { float, float }
%4 = alloca { float, float }
%5 = alloca { float, float }
%6 = bitcast { float, float }* %4 to <2 x float>*
store <2 x float> %0, <2 x float>* %6
%7 = bitcast { float, float }* %5 to <2 x float>*
store <2 x float> %1, <2 x float>* %7
%8 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%9 = load float, float* %8
%10 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
%11 = load float, float* %10
%12 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 0
%13 = load float, float* %12
%14 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 1
%15 = load float, float* %14
%16 = fadd float %9, %13
%17 = fadd float %11, %15
%18 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%19 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
store float %16, float* %18
store float %17, float* %19
%20 = bitcast { float, float }* %3 to <2 x float>*
%21 = load <2 x float>, <2 x float>* %20
ret <2 x float> %21
}

LLVM IR (-O2):
define <2 x float> @f32(<2 x float> %0, <2 x float> %1) {
%3 = fadd <2 x float> %0, %1
ret <2 x float> %3
}