xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x2a() {
  Assert_real((iscntrl(42) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              215, ("iscntrl should be 0 for *"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x2a>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0xd7,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x2a>:
push   %rax
mov    $0x2a,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xd7,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for *\00"
define void @t_iscntrl_0x2a() {
%1 = call i64 @iscntrl(i32 42)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 215, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for *\00"
define void @t_iscntrl_0x2a() {
%1 = tail call i64 @iscntrl(i32 42)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 215, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_AEuint16_reg(unsigned short val) {
  return ((val) & (0xAE << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_AEuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 174
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int count_characters(char *s, char c) {
  int count = 0;
  while (*s) {
    if (*s == c)
      count++;
    s++;
  }
  return count;
}


x86 assembly (clang, -O0):
<count_characters>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <count_characters+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113e <count_characters+0x3e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <count_characters+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_characters>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <count_characters+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <count_characters+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @count_characters(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %16
}
double gprime2(double x) { return 120 * x * x * x + 108 * x * x - 12 * x - 10; }


x86 assembly (clang, -O0):
<gprime2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xf07(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  0xee8(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xec1(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xea9(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gprime2>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xef0(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm1
mulsd  0xee4(%rip),%xmm0
addsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
addsd  0xedc(%rip),%xmm0
ret

LLVM IR (-O0):
define double @gprime2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 1.200000e+02, %3
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = load double, double* %2
%8 = load double, double* %2
%9 = fmul double 1.080000e+02, %8
%10 = load double, double* %2
%11 = fmul double %9, %10
%12 = call double @llvm.fmuladd.f64(double %6, double %7, double %11)
%13 = load double, double* %2
%14 = call double @llvm.fmuladd.f64(double -1.200000e+01, double %13, double %12)
%15 = fsub double %14, 1.000000e+01
ret double %15
}

LLVM IR (-O2):
define double @gprime2(double %0) {
%2 = fmul double %0, 1.200000e+02
%3 = fmul double %2, %0
%4 = fmul double %0, 1.080000e+02
%5 = fmul double %4, %0
%6 = tail call double @llvm.fmuladd.f64(double %3, double %0, double %5)
%7 = tail call double @llvm.fmuladd.f64(double %0, double -1.200000e+01, double %6)
%8 = fadd double %7, -1.000000e+01
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int syscall(int, int, long, int, int /*<<< orphan*/, int /*<<< orphan*/);
int putstr(char *s) {
  static char buf[64] __attribute__((aligned(64)));
  strncpy(buf, s, sizeof(buf) - 1);
  int buflen = strlen(buf);
  return syscall(64, 1, (long)buf, buflen, 0, 0);
  return 0;
}


x86 assembly (clang, -O0):
<putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0x2f39(%rip),%rdi
mov    $0x3f,%edx
call   1030 <strncpy@plt>
lea    0x2f28(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x40,%edi
mov    $0x1,%esi
lea    0x2f0c(%rip),%rdx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1050 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putstr>:
push   %rbx
mov    %rdi,%rsi
lea    0x2f45(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3f,%edx
call   1030 <strncpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x40,%edi
mov    $0x1,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
pop    %rbx
jmp    1050 <syscall@plt>

LLVM IR (-O0):
@putstr.buf = internal global [64 x i8] zeroinitializer
define i32 @putstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strncpy(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @putstr.buf, i64 0, i64 0), i8* %4, i32 63)
%6 = call i32 @strlen(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @putstr.buf, i64 0, i64 0))
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @syscall(i32 64, i32 1, i64 ptrtoint ([64 x i8]* @putstr.buf to i64), i32 %7, i32 0, i32 0)
ret i32 %8
}

LLVM IR (-O2):
@putstr.buf = internal global [64 x i8] zeroinitializer
define i32 @putstr(i8* %0) {
%2 = tail call i32 @strncpy(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @putstr.buf, i64 0, i64 0), i8* %0, i32 63)
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @putstr.buf, i64 0, i64 0))
%4 = tail call i32 @syscall(i32 64, i32 1, i64 ptrtoint ([64 x i8]* @putstr.buf to i64), i32 %3, i32 0, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ isspace(unsigned char);
int isEmpty(const char *str) {
  while (*str != '\0') {
    if (!isspace((unsigned char)*str))
      return 0;
    str++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isEmpty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115e <isEmpty+0x4e>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    114d <isEmpty+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1165 <isEmpty+0x55>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <isEmpty+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEmpty>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <isEmpty+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1149 <isEmpty+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <isEmpty+0x20>
jmp    114b <isEmpty+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isEmpty(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isspace(i8 zeroext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
void INT_Excep_SCI6_RXI6(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCI6_RXI6() {
ret void
}
void *resolver() { return 0; }


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

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

LLVM IR (-O0):
define i8* @resolver() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @resolver() {
ret i8* null
}
int fib(int x) {
  if (x <= 1)
    return x;
  else
    return fib(x - 1) + fib(x - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1130 <fib+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fib+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <fib+0x10>
mov    %ebx,%ecx
jmp    1144 <fib+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fib+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ outp(int, int);
void resetWavunoIntUserPointer() {
  outp(64571, 251);
  outp(64827, 0);
  outp(64571, 250);
  outp(64827, 0);
}


x86 assembly (clang, -O0):
<resetWavunoIntUserPointer>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfc3b,%edi
mov    $0xfb,%esi
call   1030 <outp@plt>
mov    $0xfd3b,%edi
xor    %esi,%esi
call   1030 <outp@plt>
mov    $0xfc3b,%edi
mov    $0xfa,%esi
call   1030 <outp@plt>
mov    $0xfd3b,%edi
xor    %esi,%esi
call   1030 <outp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<resetWavunoIntUserPointer>:
push   %rax
mov    $0xfc3b,%edi
mov    $0xfb,%esi
call   1030 <outp@plt>
mov    $0xfd3b,%edi
xor    %esi,%esi
call   1030 <outp@plt>
mov    $0xfc3b,%edi
mov    $0xfa,%esi
call   1030 <outp@plt>
mov    $0xfd3b,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <outp@plt>

LLVM IR (-O0):
define void @resetWavunoIntUserPointer() {
%1 = call i32 @outp(i32 64571, i32 251)
%2 = call i32 @outp(i32 64827, i32 0)
%3 = call i32 @outp(i32 64571, i32 250)
%4 = call i32 @outp(i32 64827, i32 0)
ret void
}

LLVM IR (-O2):
define void @resetWavunoIntUserPointer() {
%1 = tail call i32 @outp(i32 64571, i32 251)
%2 = tail call i32 @outp(i32 64827, i32 0)
%3 = tail call i32 @outp(i32 64571, i32 250)
%4 = tail call i32 @outp(i32 64827, i32 0)
ret void
}
/* Variables and functions */
int RAND_MAX;
int rand();
int get_alarm_time_full(int interval, int random_factor) {
  int sign = rand() / (RAND_MAX >> 1);
  int random_value = (sign ? 1 : -1) * (rand() / (RAND_MAX / random_factor));
  return interval + random_value;
}


x86 assembly (clang, -O0):
<get_alarm_time_full>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ebc(%rip),%rcx
mov    (%rcx),%ecx
sar    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_alarm_time_full>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%r14d
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ebe(%rip),%r15
mov    (%r15),%ecx
sar    %ecx
cltd
idiv   %ecx
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ecx
mov    (%r15),%eax
cltd
idiv   %ebp
mov    %eax,%esi
mov    %ecx,%eax
cltd
idiv   %esi
mov    %eax,%ecx
neg    %ecx
test   %ebx,%ebx
cmove  %ecx,%eax
add    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @get_alarm_time_full(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i32 (...) @rand()
%8 = load i32, i32* @RAND_MAX
%9 = ashr i32 %8, 1
%10 = sdiv i32 %7, %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 -1
%15 = call i32 (...) @rand()
%16 = load i32, i32* @RAND_MAX
%17 = load i32, i32* %4
%18 = sdiv i32 %16, %17
%19 = sdiv i32 %15, %18
%20 = mul nsw i32 %14, %19
store i32 %20, i32* %6
%21 = load i32, i32* %3
%22 = load i32, i32* %6
%23 = add nsw i32 %21, %22
ret i32 %23
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @get_alarm_time_full(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = load i32, i32* @RAND_MAX
%5 = ashr i32 %4, 1
%6 = sdiv i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = tail call i32 (...) @rand()
%9 = load i32, i32* @RAND_MAX
%10 = sdiv i32 %9, %1
%11 = sdiv i32 %8, %10
%12 = sub nsw i32 0, %11
%13 = select i1 %7, i32 %12, i32 %11
%14 = add nsw i32 %13, %0
ret i32 %14
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
void subCpy(uint16_t *src, uint16_t *sub, uint16_t *subNew) {
  do {
    if (!(*src)) {
      break;
    }
    (*src)--;
    (*subNew)++;
    (*sub)--;
  } while (*sub);
}


x86 assembly (clang, -O0):
<subCpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1123 <subCpy+0x23>
jmp    115b <subCpy+0x5b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1110 <subCpy+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<subCpy>:
mov    (%rdi),%rax
test   %rax,%rax
je     1119 <subCpy+0x19>
add    $0xffffffffffffffff,%rax
mov    %rax,(%rdi)
addq   $0x1,(%rdx)
addq   $0xffffffffffffffff,(%rsi)
jne    1100 <subCpy>
ret

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

LLVM IR (-O2):
define void @subCpy(i64* nocapture %0, i64* nocapture %1, i64* nocapture %2) {
br label %4
4: ; preds = %7, %3
%5 = load i64, i64* %0
%6 = icmp eq i64 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %4
%8 = add nsw i64 %5, -1
store i64 %8, i64* %0
%9 = load i64, i64* %2
%10 = add nsw i64 %9, 1
store i64 %10, i64* %2
%11 = load i64, i64* %1
%12 = add nsw i64 %11, -1
store i64 %12, i64* %1
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %7
ret void
}
void replace(char *str, char o, char n) {
  while (*str != '\0') {
    if (*str == o) {
      *str = n;
    }
    str++;
  }
}


x86 assembly (clang, -O0):
<replace>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1150 <replace+0x50>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113f <replace+0x3f>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <replace+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace>:
mov    (%rdi),%al
test   %al,%al
je     1125 <replace+0x25>
add    $0x1,%rdi
jmp    111b <replace+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1125 <replace+0x25>
cmp    %sil,%al
jne    1110 <replace+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <replace+0x10>
ret

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

LLVM IR (-O2):
define void @replace(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %10, %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
ret void
}
int fun377() { return 377; }


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

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

LLVM IR (-O0):
define i32 @fun377() {
ret i32 377
}

LLVM IR (-O2):
define i32 @fun377() {
ret i32 377
}
extern int f(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long, long long);
int fun_call_align_ll_2(long long a, long long b) {
  printf("a = %lld, b = %lld\n", a, b);
  return a + b;
}


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

x86 assembly (clang, -O2):
<fun_call_align_ll_2>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xedf(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
add    %r14d,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c"a = %lld, b = %lld\0A\00"
define i32 @fun_call_align_ll_2(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %5, i64 %6)
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = add nsw i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@.str = [20 x i8] c"a = %lld, b = %lld\0A\00"
define i32 @fun_call_align_ll_2(i64 %0, i64 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
%4 = add nsw i64 %1, %0
%5 = trunc i64 %4 to i32
ret i32 %5
}
void fake_enospc() { return; }


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

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

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

LLVM IR (-O2):
define void @fake_enospc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pipe(int *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
int main() {
  int fd[2];
  pipe(fd);
  char d[1];
  d[0] = 1;
  int i = 0;
  while (1) {
    write(fd[1], d, 1);
    printf("%d\n", i++);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <pipe@plt>
movb   $0x1,-0xd(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xd(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    %eax,-0x14(%rbp)
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
jmp    1153 <main+0x23>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
call   1050 <pipe@plt>
movb   $0x1,0xf(%rsp)
xor    %ebx,%ebx
lea    0xf(%rsp),%r14
lea    0xea9(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    0x14(%rsp),%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
lea    0x1(%rbx),%ebp
mov    %r15,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    %ebp,%ebx
jmp    1160 <main+0x30>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [2 x i32]
%2 = alloca [1 x i8]
%3 = bitcast [2 x i32]* %1 to i8*
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%5 = call i32 @pipe(i32* %4)
%6 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
store i8 1, i8* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
br label %8
8: ; preds = %8, %0
%9 = phi i32 [ 0, %0 ], [ %12, %8 ]
%10 = load i32, i32* %7
%11 = call i32 @write(i32 %10, i8* %6, i32 1)
%12 = add nuw nsw i32 %9, 1
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %8
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
void esp_transport_utils_ms_to_timeval(int timeout_ms, struct timeval *tv) {
  tv->tv_sec = timeout_ms / 1000;
  tv->tv_usec = (timeout_ms - (tv->tv_sec * 1000)) * 1000;
}


x86 assembly (clang, -O0):
<esp_transport_utils_ms_to_timeval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
imul   $0x3e8,(%rcx),%ecx
sub    %ecx,%eax
imul   $0x3e8,%eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<esp_transport_utils_ms_to_timeval>:
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,(%rsi)
imul   $0xfffffc18,%ecx,%ecx
add    %ecx,%eax
imul   $0x3e8,%eax,%eax
mov    %eax,0x4(%rsi)
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @esp_transport_utils_ms_to_timeval(i32 %0, %struct.timeval* %1) {
%3 = alloca i32
%4 = alloca %struct.timeval*
store i32 %0, i32* %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load i32, i32* %3
%6 = sdiv i32 %5, 1000
%7 = load %struct.timeval*, %struct.timeval** %4
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
store i32 %6, i32* %8
%9 = load i32, i32* %3
%10 = load %struct.timeval*, %struct.timeval** %4
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = mul nsw i32 %12, 1000
%14 = sub nsw i32 %9, %13
%15 = mul nsw i32 %14, 1000
%16 = load %struct.timeval*, %struct.timeval** %4
%17 = getelementptr inbounds %struct.timeval, %struct.timeval* %16, i32 0, i32 1
store i32 %15, i32* %17
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @esp_transport_utils_ms_to_timeval(i32 %0, %struct.timeval* nocapture writeonly %1) {
%3 = sdiv i32 %0, 1000
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
store i32 %3, i32* %4
%5 = mul nsw i32 %3, -1000
%6 = add i32 %5, %0
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
store i32 %7, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void __attribute__((constructor)) para_ctor(void) {
  printf(
      "%s: Constructor\n",
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/frdeso/fun-with-so/refs/heads/master/bbb.c");
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"%s: Constructor\0A\00"
@.str.1 = [133 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/frdeso/fun-with-so/refs/heads/master/bbb.c\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @para_ctor, i8* null }]
define void @para_ctor() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s: Constructor\0A\00"
@.str.1 = [133 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/frdeso/fun-with-so/refs/heads/master/bbb.c\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @para_ctor, i8* null }]
define void @para_ctor() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int squaresOfHundred = 0;
  int sumOfHundred = 0;
  int i;
  for (i = 1; i <= 100; i++) {
    squaresOfHundred += i * i;
    sumOfHundred += i;
  }
  int squaresOfSumHundred = sumOfHundred * sumOfHundred;
  int difference = squaresOfSumHundred - squaresOfHundred;
  printf("result: %d", difference);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x64,-0x10(%rbp)
jg     1162 <main+0x52>
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <main+0x24>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"result: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
br label %7
7: ; preds = %19, %0
%8 = load i32, i32* %4
%9 = icmp sle i32 %8, 100
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = mul nsw i32 %11, %12
%14 = load i32, i32* %2
%15 = add nsw i32 %14, %13
store i32 %15, i32* %2
%16 = load i32, i32* %4
%17 = load i32, i32* %3
%18 = add nsw i32 %17, %16
store i32 %18, i32* %3
br label %19
19: ; preds = %10
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %7
22: ; preds = %7
%23 = load i32, i32* %3
%24 = load i32, i32* %3
%25 = mul nsw i32 %23, %24
store i32 %25, i32* %5
%26 = load i32, i32* %5
%27 = load i32, i32* %2
%28 = sub nsw i32 %26, %27
store i32 %28, i32* %6
%29 = load i32, i32* %6
%30 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"result: %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 25164150)
ret i32 0
}
/* Variables and functions */
unsigned long do_csum(unsigned char const *, int, int /*<<< orphan*/);
unsigned int csum_partial(const unsigned char *buff, int len,
                          unsigned int sum) {
  unsigned long result = do_csum(buff, len, 0);
  result += sum;
  result = (result & 0xffffffff) + (result >> 32);
  return result;
}


x86 assembly (clang, -O0):
<csum_partial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1030 <do_csum@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
movabs $0xffffffff,%rax
and    -0x18(%rbp),%rax
mov    -0x18(%rbp),%rcx
shr    $0x20,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csum_partial>:
push   %rbx
mov    %edx,%ebx
xor    %edx,%edx
call   1030 <do_csum@plt>
mov    %ebx,%ecx
add    %rcx,%rax
mov    %rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @csum_partial(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i64 @do_csum(i8* %8, i32 %9, i32 0)
store i64 %10, i64* %7
%11 = load i32, i32* %6
%12 = zext i32 %11 to i64
%13 = load i64, i64* %7
%14 = add i64 %13, %12
store i64 %14, i64* %7
%15 = load i64, i64* %7
%16 = and i64 %15, 4294967295
%17 = load i64, i64* %7
%18 = lshr i64 %17, 32
%19 = add i64 %16, %18
store i64 %19, i64* %7
%20 = load i64, i64* %7
%21 = trunc i64 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @csum_partial(i8* %0, i32 %1, i32 %2) {
%4 = tail call i64 @do_csum(i8* %0, i32 %1, i32 0)
%5 = zext i32 %2 to i64
%6 = add i64 %4, %5
%7 = lshr i64 %6, 32
%8 = add i64 %7, %6
%9 = trunc i64 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void printlog(void *ptr, const char s[]) { printf("%s", s); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @printlog(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @printlog(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_OCTET_STRING;

/* Variables and functions */
int /*<<< orphan*/ ASN1_OCTET_STRING_it;
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
ASN1_OCTET_STRING *d2i_ASN1_OCTET_STRING(ASN1_OCTET_STRING **a,
                                         const unsigned char **in, long len) {
  return (ASN1_OCTET_STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                            &ASN1_OCTET_STRING_it);
}


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

x86 assembly (clang, -O2):
<d2i_ASN1_OCTET_STRING>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@ASN1_OCTET_STRING_it = global i32 0
define i32* @d2i_ASN1_OCTET_STRING(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @ASN1_OCTET_STRING_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@ASN1_OCTET_STRING_it = global i32 0
define i32* @d2i_ASN1_OCTET_STRING(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @ASN1_OCTET_STRING_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ reuseon;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int yudpsocket_client() {
  int socketfd = socket(AF_INET, SOCK_DGRAM, 0);
  int reuseon = 1;
  setsockopt(socketfd, SOL_SOCKET, SO_REUSEADDR, &reuseon, sizeof(reuseon));
  return socketfd;
}


x86 assembly (clang, -O0):
<yudpsocket_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
mov    0x2e6a(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yudpsocket_client>:
push   %rbx
sub    $0x10,%rsp
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,%ebx
movl   $0x1,0xc(%rsp)
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
mov    0x2e70(%rip),%rax
mov    (%rax),%edx
lea    0xc(%rsp),%rcx
mov    %ebx,%edi
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @yudpsocket_client() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @AF_INET
%4 = load i32, i32* @SOCK_DGRAM
%5 = call i32 @socket(i32 %3, i32 %4, i32 0)
store i32 %5, i32* %1
store i32 1, i32* %2
%6 = load i32, i32* %1
%7 = load i32, i32* @SOL_SOCKET
%8 = load i32, i32* @SO_REUSEADDR
%9 = call i32 @setsockopt(i32 %6, i32 %7, i32 %8, i32* %2, i32 4)
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @yudpsocket_client() {
%1 = alloca i32
%2 = load i32, i32* @AF_INET
%3 = load i32, i32* @SOCK_DGRAM
%4 = tail call i32 @socket(i32 %2, i32 %3, i32 0)
%5 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_REUSEADDR
%8 = call i32 @setsockopt(i32 %4, i32 %6, i32 %7, i32* %1, i32 4)
ret i32 %4
}
int Pl_Hash_Nb_Elements(char *tbl) { return (((int *)(tbl))[2]); }


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

x86 assembly (clang, -O2):
<Pl_Hash_Nb_Elements>:
mov    0x8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @Pl_Hash_Nb_Elements(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 8
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
int rollover(int min, int max, int step, int input) {
  int output = input + step;
  if (output > max) {
    output = min - 1 + (output % max);
  }
  return (output);
}


x86 assembly (clang, -O0):
<rollover>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113d <rollover+0x3d>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x18(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rollover>:
mov    %edx,%eax
add    %ecx,%eax
cmp    %esi,%eax
jle    1111 <rollover+0x11>
cltd
idiv   %esi
lea    (%rdi,%rdx,1),%eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @rollover(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %3, %2
%6 = icmp sgt i32 %5, %1
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = add nsw i32 %0, -1
%9 = srem i32 %5, %1
%10 = add nsw i32 %8, %9
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ %10, %7 ], [ %5, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: fflisp [--load filename] [--help].\n");
  printf("       --load eval code from file.\n");
  printf("       --help print help message.\n");
  return;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf06(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Usage: fflisp [--load filename] [--help].\0A\00"
@.str.1 = [36 x i8] c" --load eval code from file.\0A\00"
@.str.2 = [35 x i8] c" --help print help message.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [42 x i8] c"Usage: fflisp [--load filename] [--help].\00"
@str.3 = [35 x i8] c" --load eval code from file.\00"
@str.4 = [34 x i8] c" --help print help message.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.4, i64 0, i64 0))
ret void
}
const char *pathconN_nm8_name_out(int i) {
  switch (i) {
  case 0:
    return "o0";
  case 1:
    return "o1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<pathconN_nm8_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <pathconN_nm8_name_out+0x2b>
jmp    111a <pathconN_nm8_name_out+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <pathconN_nm8_name_out+0x3b>
jmp    114b <pathconN_nm8_name_out+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathconN_nm8_name_out+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathconN_nm8_name_out+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm8_name_out>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @pathconN_nm8_name_out(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}