xunge/DecIR huggingface dataset:
/* Type definitions */
struct can_frame {
  int *data;
};

/* Variables and functions */
scalar_t__ cs(struct can_frame);
int n(struct can_frame frame) {
  if (cs(frame) == 0) {
    return frame.data[0] >> 1 & 0x7;
  } else {
    return frame.data[0] >> 2 & 0x3;
  }
}


x86 assembly (clang, -O0):
<n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <cs@plt>
cmp    $0x0,%rax
jne    1143 <n+0x33>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sar    $0x1,%eax
and    $0x7,%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <n+0x42>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sar    $0x2,%eax
and    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n>:
push   %rbx
mov    %rdi,%rbx
call   1030 <cs@plt>
xor    %edx,%edx
test   %rax,%rax
sete   %dl
mov    (%rbx),%eax
lea    0x3(,%rdx,4),%esi
mov    $0x2,%cl
sub    %dl,%cl
shr    %cl,%eax
and    %esi,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.can_frame = type { i32* }
define i32 @n(i32* %0) {
%2 = alloca i32
%3 = alloca %struct.can_frame
%4 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %3, i32 0, i32 0
store i32* %0, i32** %4
%5 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %3, i32 0, i32 0
%6 = load i32*, i32** %5
%7 = call i64 @cs(i32* %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %1
%10 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %3, i32 0, i32 0
%11 = load i32*, i32** %10
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = ashr i32 %13, 1
%15 = and i32 %14, 7
store i32 %15, i32* %2
br label %23
16: ; preds = %1
%17 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %3, i32 0, i32 0
%18 = load i32*, i32** %17
%19 = getelementptr inbounds i32, i32* %18, i64 0
%20 = load i32, i32* %19
%21 = ashr i32 %20, 2
%22 = and i32 %21, 3
store i32 %22, i32* %2
br label %23
23: ; preds = %16, %9
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @n(i32* %0) {
%2 = tail call i64 @cs(i32* %0)
%3 = icmp eq i64 %2, 0
%4 = load i32, i32* %0
%5 = select i1 %3, i32 1, i32 2
%6 = select i1 %3, i32 7, i32 3
%7 = lshr i32 %4, %5
%8 = and i32 %7, %6
ret i32 %8
}
/* Variables and functions */
scalar_t__ rand();
double random_number(double inner, double outer) {
  double range = outer - inner;
  return ((((double)rand()) / (double)((32767.0))) * range + inner);
}


x86 assembly (clang, -O0):
<random_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0xebb(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_number>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
divsd  0xec5(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @random_number(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fsub double %6, %7
store double %8, double* %5
%9 = call i64 (...) @rand()
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 3.276700e+04
%12 = load double, double* %5
%13 = load double, double* %3
%14 = call double @llvm.fmuladd.f64(double %11, double %12, double %13)
ret double %14
}

LLVM IR (-O2):
define double @random_number(double %0, double %1) {
%3 = fsub double %1, %0
%4 = tail call i64 (...) @rand()
%5 = sitofp i64 %4 to double
%6 = fdiv double %5, 3.276700e+04
%7 = tail call double @llvm.fmuladd.f64(double %6, double %3, double %0)
ret double %7
}
void loadlist(x) int *x;
{
  if (x != 0) {
    if (0 [x] != 38) {
      load(x);
      return;
    }
    loadlist((int *)1 [x]);
    loadlist((int *)2 [x]);
  }
}


x86 assembly (clang, -O0):
<loadlist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116e <loadlist+0x4e>
mov    -0x8(%rbp),%rax
cmpl   $0x26,(%rax)
je     1154 <loadlist+0x34>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <load@plt>
jmp    116e <loadlist+0x4e>
mov    -0x8(%rbp),%rax
movslq 0x4(%rax),%rdi
call   1030 <loadlist@plt>
mov    -0x8(%rbp),%rax
movslq 0x8(%rax),%rdi
call   1030 <loadlist@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadlist>:
push   %rbx
test   %rdi,%rdi
je     1147 <loadlist+0x27>
mov    %rdi,%rbx
nopl   0x0(%rax)
cmpl   $0x26,(%rbx)
jne    1149 <loadlist+0x29>
movslq 0x4(%rbx),%rdi
call   1030 <loadlist@plt>
movslq 0x8(%rbx),%rbx
test   %rbx,%rbx
jne    1130 <loadlist+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <load@plt>

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

LLVM IR (-O2):
define void @loadlist(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %19, label %3
3: ; preds = %1, %9
%4 = phi i32* [ %17, %9 ], [ %0, %1 ]
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 38
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 (i32*, ...) bitcast (i32 (...)* @load to i32 (i32*, ...)*)(i32* %4)
br label %19
9: ; preds = %3
%10 = getelementptr inbounds i32, i32* %4, i64 1
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
tail call void @loadlist(i32* %13)
%14 = getelementptr inbounds i32, i32* %4, i64 2
%15 = load i32, i32* %14
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = icmp eq i32 %15, 0
br i1 %18, label %19, label %3
19: ; preds = %9, %1, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("Hello World!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
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 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void dump_queue() {}


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

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

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

LLVM IR (-O2):
define void @dump_queue() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x21() {
  Assert_real((isprint(33)),
              "/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_isprint.c",
              170, ("isprint should be 1 for !"));
}


x86 assembly (clang, -O0):
<t_isprint_0x21>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xaa,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x21>:
push   %rax
mov    $0x21,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xaa,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for !\00"
define void @t_isprint_0x21() {
%1 = call i32 @isprint(i32 33)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 170, 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for !\00"
define void @t_isprint_0x21() {
%1 = tail call i32 @isprint(i32 33)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 170, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void CRYPTO_dbg_free(void *addr, int before_p) { abort(); }


x86 assembly (clang, -O0):
<CRYPTO_dbg_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<CRYPTO_dbg_free>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @CRYPTO_dbg_free(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @CRYPTO_dbg_free(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @abort()
unreachable
}
int fun728() { return 728; }


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

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

LLVM IR (-O0):
define i32 @fun728() {
ret i32 728
}

LLVM IR (-O2):
define i32 @fun728() {
ret i32 728
}
/* Variables and functions */
int strcmp(char *, char *);
int strc(void *str1, void *str2) {
  char *stri1 = (char *)str1;
  char *stri2 = (char *)str2;
  return strcmp(stri1, stri2);
}


x86 assembly (clang, -O0):
<strc>:
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),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @strc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %4
store i8* %8, i8** %6
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @strcmp(i8* %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @strc(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_solve_stable_dobldobl_start_system(int k, int *mv) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(883, &k, mv, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_solve_stable_dobldobl_start_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x373,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_solve_stable_dobldobl_start_system>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x373,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @celcon_solve_stable_dobldobl_start_system(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = load double*, double** %6
%9 = call i32 @_ada_use_c2phc4c(i32 883, i32* %3, i32* %7, double* %8, i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @celcon_solve_stable_dobldobl_start_system(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc4c(i32 883, i32* %3, i32* %1, double* undef, i32 0)
ret i32 %4
}
void filaCeros(int matriz[][4], int cols, int fila) {
  int i;
  for (i = 0; i < cols; i++) {
    matriz[fila][i] = 0;
  }
}


x86 assembly (clang, -O0):
<filaCeros>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1149 <filaCeros+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <filaCeros+0x15>
pop    %rbp
ret

x86 assembly (clang, -O2):
<filaCeros>:
test   %esi,%esi
jle    1130 <filaCeros+0x20>
push   %rax
movslq %edx,%rax
shl    $0x4,%rax
add    %rax,%rdi
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @filaCeros([4 x i32]* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %11
5: ; preds = %3
%6 = sext i32 %2 to i64
%7 = getelementptr [4 x i32], [4 x i32]* %0, i64 %6, i64 0
%8 = bitcast i32* %7 to i8*
%9 = zext i32 %1 to i64
%10 = shl nuw nsw i64 %9, 2
br label %11
11: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;
struct spx_date {
  int dummy;
};

/* Variables and functions */
scalar_t__ spx_mkzero(struct spx_date *);
int spx_date_cmp(struct spx_date *d1, struct spx_date *d2) {
  time_t dz1 = spx_mkzero(d1);
  time_t dz2 = spx_mkzero(d2);
  if (dz1 < dz2)
    return -1;
  if (dz1 == dz2)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<spx_date_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <spx_mkzero@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <spx_mkzero@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1154 <spx_date_cmp+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <spx_date_cmp+0x65>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    116e <spx_date_cmp+0x5e>
movl   $0x0,-0x4(%rbp)
jmp    1175 <spx_date_cmp+0x65>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spx_date_cmp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <spx_mkzero@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <spx_mkzero@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.spx_date = type { i32 }
define i32 @spx_date_cmp(%struct.spx_date* %0, %struct.spx_date* %1) {
%3 = alloca i32
%4 = alloca %struct.spx_date*
%5 = alloca %struct.spx_date*
%6 = alloca i64
%7 = alloca i64
store %struct.spx_date* %0, %struct.spx_date** %4
store %struct.spx_date* %1, %struct.spx_date** %5
%8 = load %struct.spx_date*, %struct.spx_date** %4
%9 = call i64 @spx_mkzero(%struct.spx_date* %8)
store i64 %9, i64* %6
%10 = load %struct.spx_date*, %struct.spx_date** %5
%11 = call i64 @spx_mkzero(%struct.spx_date* %10)
store i64 %11, i64* %7
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = icmp slt i64 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 -1, i32* %3
br label %22
16: ; preds = %2
%17 = load i64, i64* %6
%18 = load i64, i64* %7
%19 = icmp eq i64 %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 0, i32* %3
br label %22
21: ; preds = %16
store i32 1, i32* %3
br label %22
22: ; preds = %21, %20, %15
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
%struct.spx_date = type { i32 }
define i32 @spx_date_cmp(%struct.spx_date* %0, %struct.spx_date* %1) {
%3 = tail call i64 @spx_mkzero(%struct.spx_date* %0)
%4 = tail call i64 @spx_mkzero(%struct.spx_date* %1)
%5 = icmp slt i64 %3, %4
%6 = icmp ne i64 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ do_uart_irq();
void uart_irq(void) {
  do_uart_irq();
  (*((volatile unsigned long *)0x71300f00)) = 0;
}


x86 assembly (clang, -O0):
<uart_irq>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <do_uart_irq@plt>
mov    $0x71300f00,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_irq>:
push   %rax
xor    %eax,%eax
call   1030 <do_uart_irq@plt>
movq   $0x0,0x71300f00
pop    %rax
ret

LLVM IR (-O0):
define void @uart_irq() {
%1 = call i32 (...) @do_uart_irq()
store volatile i64 0, i64* inttoptr (i64 1898974976 to i64*)
ret void
}

LLVM IR (-O2):
define void @uart_irq() {
%1 = tail call i32 (...) @do_uart_irq()
store volatile i64 0, i64* inttoptr (i64 1898974976 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g();
int foo(int a) {
  int i;
  for (i = 1; i < 100; i++) {
    if (i)
      g();
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1150 <foo+0x40>
cmpl   $0x0,-0xc(%rbp)
je     113d <foo+0x2d>
mov    $0x0,%al
call   1030 <g@plt>
jmp    1142 <foo+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <foo+0x12>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    $0x63,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <g@plt>
add    $0xffffffff,%ebx
jne    1120 <foo+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 1, %1 ], [ %5, %2 ]
%4 = tail call i32 (...) @g()
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 100
br i1 %6, label %7, label %2
7: ; preds = %2
ret i32 undef
}
signed char fn1() {
  signed char d;
  for (int i = 0; i < 1; i++)
    d = -15;
  return d;
}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1127 <fn1+0x27>
movb   $0xf1,-0x1(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110b <fn1+0xb>
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn1>:
mov    $0xf1,%al
ret

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

LLVM IR (-O2):
define signext i8 @fn1() {
ret i8 -15
}
long long _mpyidll(int src1, int src2) { return (long long)src1 * src2; }


x86 assembly (clang, -O0):
<_mpyidll>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mpyidll>:
movslq %edi,%rcx
movslq %esi,%rax
imul   %rcx,%rax
ret

LLVM IR (-O0):
define i64 @_mpyidll(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 = sext i32 %5 to i64
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = mul nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @_mpyidll(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = sext i32 %1 to i64
%5 = mul nsw i64 %4, %3
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help(void) {
  printf("\n"
         "remote-dump1090 - A helper to send data from a dump1090 instance to "
         "another instance\n"
         "\n"
         "usage:\n"
         "    remote-dump1090 [-h] [-v] [-l] [-s SRC_PORT] [-d DST_PORT] "
         "SRC_HOST DST_HOST\n"
         "\n"
         "positional arguments:\n"
         "    SRC_HOST      source instance host name\n"
         "    DST_HOST      destination instance host name\n"
         "\n"
         "optional arguments:\n"
         "    -h            show this help message and exit\n"
         "    -v            show version and exit\n"
         "    -l            send output messages to syslog\n"
         "    -s SRC_PORT   source instance port. defaults to 30002\n"
         "    -d DST_PORT   destination instance port. defaults to 30001\n");
}


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

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

LLVM IR (-O0):
@.str = [573 x i8] c"\0Aremote-dump1090 - A helper to send data from a dump1090 instance to another instance\0A\0Ausage:\0A remote-dump1090 [-h] [-v] [-l] [-s SRC_PORT] [-d DST_PORT] SRC_HOST DST_HOST\0A\0Apositional arguments:\0A SRC_HOST source instance host name\0A DST_HOST destination instance host name\0A\0Aoptional arguments:\0A -h show this help message and exit\0A -v show version and exit\0A -l send output messages to syslog\0A -s SRC_PORT source instance port. defaults to 30002\0A -d DST_PORT destination instance port. defaults to 30001\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([573 x i8], [573 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [572 x i8] c"\0Aremote-dump1090 - A helper to send data from a dump1090 instance to another instance\0A\0Ausage:\0A remote-dump1090 [-h] [-v] [-l] [-s SRC_PORT] [-d DST_PORT] SRC_HOST DST_HOST\0A\0Apositional arguments:\0A SRC_HOST source instance host name\0A DST_HOST destination instance host name\0A\0Aoptional arguments:\0A -h show this help message and exit\0A -v show version and exit\0A -l send output messages to syslog\0A -s SRC_PORT source instance port. defaults to 30002\0A -d DST_PORT destination instance port. defaults to 30001\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([572 x i8], [572 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parallel_clr_nrfd(int);
int /*<<< orphan*/ parallel_set_nrfd(int);
void parallel_drv2_set_nrfd(unsigned char val) {
  if (val) {
    parallel_set_nrfd(0x10);
  } else {
    parallel_clr_nrfd(~0x10);
  }
}


x86 assembly (clang, -O0):
<parallel_drv2_set_nrfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1147 <parallel_drv2_set_nrfd+0x27>
mov    $0x10,%edi
call   1040 <parallel_set_nrfd@plt>
jmp    1151 <parallel_drv2_set_nrfd+0x31>
mov    $0xffffffef,%edi
call   1030 <parallel_clr_nrfd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parallel_drv2_set_nrfd>:
test   %edi,%edi
je     112e <parallel_drv2_set_nrfd+0xe>
mov    $0x10,%edi
jmp    1040 <parallel_set_nrfd@plt>
mov    $0xffffffef,%edi
jmp    1030 <parallel_clr_nrfd@plt>

LLVM IR (-O0):
define void @parallel_drv2_set_nrfd(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @parallel_set_nrfd(i32 16)
br label %9
7: ; preds = %1
%8 = call i32 @parallel_clr_nrfd(i32 -17)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @parallel_drv2_set_nrfd(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @parallel_set_nrfd(i32 16)
br label %7
5: ; preds = %1
%6 = tail call i32 @parallel_clr_nrfd(i32 -17)
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void USBHostReset(uint32_t ui32Base, bool bStart) {
  ;
  if (bStart) {
    (*((volatile uint8_t *)(ui32Base + 0x00000001))) |= 0x00000008;
  } else {
    (*((volatile uint8_t *)(ui32Base + 0x00000001))) &= ~0x00000008;
  }
}


x86 assembly (clang, -O0):
<USBHostReset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1127 <USBHostReset+0x27>
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%ecx
or     $0x8,%ecx
mov    %ecx,0x1(%rax)
jmp    1134 <USBHostReset+0x34>
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%ecx
and    $0xfffffff7,%ecx
mov    %ecx,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostReset>:
xor    %eax,%eax
test   %esi,%esi
setne  %al
mov    0x1(%rdi),%ecx
and    $0xfffffff7,%ecx
lea    (%rcx,%rax,8),%eax
mov    %eax,0x1(%rdi)
ret

LLVM IR (-O0):
define void @USBHostReset(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i64, i64* %3
%9 = add nsw i64 %8, 1
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = or i32 %11, 8
store volatile i32 %12, i32* %10
br label %19
13: ; preds = %2
%14 = load i64, i64* %3
%15 = add nsw i64 %14, 1
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = and i32 %17, -9
store volatile i32 %18, i32* %16
br label %19
19: ; preds = %13, %7
ret void
}

LLVM IR (-O2):
define void @USBHostReset(i64 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = add nsw i64 %0, 1
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -9
%8 = select i1 %3, i32 0, i32 8
%9 = or i32 %7, %8
store volatile i32 %9, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  int x = 5;
  int y = 8;
  if (y == 8) {
    if (x == 5) {
      puts("@@@@@");
    } else {
      puts("#####");
    }
    puts("$$$$$");
    puts("&&&&&");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x8,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jne    1176 <main+0x66>
cmpl   $0x5,-0x8(%rbp)
jne    1152 <main+0x42>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
jmp    115e <main+0x4e>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"@@@@@\00"
@.str.2 = [6 x i8] c"$$$$$\00"
@.str.3 = [6 x i8] c"&&&&&\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clear_attn();
int /*<<< orphan*/ clear_bot();
int /*<<< orphan*/ flush();
void cmd_exec(void) {
  clear_attn();
  clear_bot();
  flush();
}


x86 assembly (clang, -O0):
<cmd_exec>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <clear_attn@plt>
mov    $0x0,%al
call   1040 <clear_bot@plt>
mov    $0x0,%al
call   1030 <flush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_exec>:
push   %rax
xor    %eax,%eax
call   1050 <clear_attn@plt>
xor    %eax,%eax
call   1040 <clear_bot@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <flush@plt>

LLVM IR (-O0):
define void @cmd_exec() {
%1 = call i32 (...) @clear_attn()
%2 = call i32 (...) @clear_bot()
%3 = call i32 (...) @flush()
ret void
}

LLVM IR (-O2):
define void @cmd_exec() {
%1 = tail call i32 (...) @clear_attn()
%2 = tail call i32 (...) @clear_bot()
%3 = tail call i32 (...) @flush()
ret void
}
/* Variables and functions */
int close(int);
int errno;
int robust_close(int fd) {
  int saved_errno = errno;
  int rc;
  if (fd < 0) {
    return 0;
  }
  rc = close(fd);
  errno = saved_errno;
  return rc;
}


x86 assembly (clang, -O0):
<robust_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    113d <robust_close+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    115a <robust_close+0x4a>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    0x2e8e(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<robust_close>:
test   %edi,%edi
js     112e <robust_close+0x1e>
push   %rbp
push   %rbx
push   %rax
mov    0x2ec2(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <close@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @robust_close(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @errno
%5 = tail call i32 @close(i32 %0)
store i32 %4, i32* @errno
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ Sys_failure(char *);
int ftruncate(int, int /*<<< orphan*/);
void Ftruncate(int fd, off_t length) {
  int retval;
  retval = ftruncate(fd, length);
  if (retval == -1)
    Sys_failure("ftruncate");
}


x86 assembly (clang, -O0):
<Ftruncate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <ftruncate@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1152 <Ftruncate+0x32>
lea    0xeb3(%rip),%rdi
call   1040 <Sys_failure@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ftruncate>:
push   %rax
call   1030 <ftruncate@plt>
cmp    $0xffffffff,%eax
je     112d <Ftruncate+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <Sys_failure@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"ftruncate\00"
define void @Ftruncate(i32 %0, i32 %1) {
%3 = tail call i32 @ftruncate(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int strlen(const char *str) {
  char *s = (char *)str;
  int len = 0;
  if (s == 0)
    return 0;
  while (*s++ != '\0')
    ++len;
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    112e <strlen+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1162 <strlen+0x62>
jmp    1133 <strlen+0x33>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115c <strlen+0x5c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1133 <strlen+0x33>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
xor    %eax,%eax
test   %rdi,%rdi
je     111b <strlen+0x1b>
cmpb   $0x0,(%rdi)
je     111b <strlen+0x1b>
xor    %eax,%eax
xchg   %ax,%ax
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 0, %3 ]
%8 = phi i8* [ %9, %6 ], [ %0, %3 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = add nuw nsw i32 %7, 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %10, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ console_print(char *);
int /*<<< orphan*/ sprintf(char *, char *, double);
void format_output_float(double value, int align, int w, char pad) {
  char buf[21];
  sprintf(buf, "%f", value);
  console_print(buf);
}


x86 assembly (clang, -O0):
<format_output_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dl,%al
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
lea    -0x30(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
lea    0xeb8(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <console_print@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_output_float>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <console_print@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define void @format_output_float(double %0, i32 %1, i32 %2, i8 signext %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
%9 = alloca [21 x i8]
store double %0, double* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8 %3, i8* %8
%10 = getelementptr inbounds [21 x i8], [21 x i8]* %9, i64 0, i64 0
%11 = load double, double* %5
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %11)
%13 = getelementptr inbounds [21 x i8], [21 x i8]* %9, i64 0, i64 0
%14 = call i32 @console_print(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @format_output_float(double %0, i32 %1, i32 %2, i8 signext %3) {
%5 = alloca [21 x i8]
%6 = getelementptr inbounds [21 x i8], [21 x i8]* %5, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0)
%8 = call i32 @console_print(i8* %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
void setFilePosition(int fd, off_t pos) { lseek(fd, pos, SEEK_SET); }


x86 assembly (clang, -O0):
<setFilePosition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setFilePosition>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <lseek@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @setFilePosition(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 = load i32, i32* @SEEK_SET
%8 = call i32 @lseek(i32 %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @setFilePosition(i32 %0, i32 %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i32 @lseek(i32 %0, i32 %1, i32 %3)
ret void
}
void rule_neural_act_free(const struct XCSF *xcsf, const struct Cl *c) {
  (void)xcsf;
  (void)c;
}


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

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

LLVM IR (-O0):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @rule_neural_act_free(%struct.XCSF* %0, %struct.Cl* %1) {
%3 = alloca %struct.XCSF*
%4 = alloca %struct.Cl*
store %struct.XCSF* %0, %struct.XCSF** %3
store %struct.Cl* %1, %struct.Cl** %4
%5 = load %struct.XCSF*, %struct.XCSF** %3
%6 = load %struct.Cl*, %struct.Cl** %4
ret void
}

LLVM IR (-O2):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @rule_neural_act_free(%struct.XCSF* nocapture %0, %struct.Cl* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void printVersion(FILE *stream) {
  fprintf(stream, "vPICdisasm version 1.3 - 04/03/2011.\n");
  fprintf(stream, "Written by Vanya Sergeev - <vsergeev@gmail.com>\n");
}


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

x86 assembly (clang, -O2):
<printVersion>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    $0x25,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xef2(%rip),%rdi
mov    $0x30,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"vPICdisasm version 1.3 - 04/03/2011.\0A\00"
@.str.1 = [49 x i8] c"Written by Vanya Sergeev - <vsergeev@gmail.com>\0A\00"
define void @printVersion(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"vPICdisasm version 1.3 - 04/03/2011.\0A\00"
@.str.1 = [49 x i8] c"Written by Vanya Sergeev - <vsergeev@gmail.com>\0A\00"
define void @printVersion(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i64 37, i64 1, i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i64 48, i64 1, i32* %0)
ret void
}
int long_cmp(const void *a, const void *b) {
  long aa = *((long *)a);
  long bb = *((long *)b);
  if (aa > bb)
    return 1;
  else if (aa < bb)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<long_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    113c <long_cmp+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    115d <long_cmp+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1156 <long_cmp+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <long_cmp+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_cmp>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
xor    %edx,%edx
cmp    %rcx,%rax
setl   %dl
neg    %edx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @long_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
%8 = icmp slt i64 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
void dump_data(const unsigned char *data, unsigned int datalen) {}


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

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

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

LLVM IR (-O2):
define void @dump_data(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timespec {
  int dummy;
};
typedef scalar_t__ int64_t;

/* Variables and functions */
scalar_t__ timespec_to_ns(struct timespec const *);
int64_t timespec_delta_ns(struct timespec const *a, struct timespec const *b) {
  uint64_t a_ns = timespec_to_ns(a);
  uint64_t b_ns = timespec_to_ns(b);
  if (a_ns >= b_ns)
    return a_ns - b_ns;
  else
    return -(b_ns - a_ns);
}


x86 assembly (clang, -O0):
<timespec_delta_ns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <timespec_to_ns@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <timespec_to_ns@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jl     1159 <timespec_delta_ns+0x49>
mov    -0x20(%rbp),%rax
sub    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <timespec_delta_ns+0x5a>
mov    -0x28(%rbp),%rcx
sub    -0x20(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_delta_ns>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <timespec_to_ns@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <timespec_to_ns@plt>
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i64 @timespec_delta_ns(%struct.timespec* %0, %struct.timespec* %1) {
%3 = tail call i64 @timespec_to_ns(%struct.timespec* %0)
%4 = tail call i64 @timespec_to_ns(%struct.timespec* %1)
%5 = sub i64 %3, %4
ret i64 %5
}