xunge/DecIR huggingface dataset:
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ test_set_page_writeback(struct page *);
__attribute__((always_)) void set_page_writeback(struct page *page) {
  test_set_page_writeback(page);
}


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

x86 assembly (clang, -O2):
<set_page_writeback>:
jmp    1030 <test_set_page_writeback@plt>

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

LLVM IR (-O2):
%struct.page = type { i32 }
define void @set_page_writeback(%struct.page* %0) {
%2 = tail call i32 @test_set_page_writeback(%struct.page* %0)
ret void
}
/* Variables and functions */
int rand();
unsigned char get_pu() { return (rand() % 3) + 1; }


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

x86 assembly (clang, -O2):
<get_pu>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
add    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @get_pu() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 3
%3 = add nsw i32 %2, 1
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @get_pu() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 3
%3 = trunc i32 %2 to i8
%4 = add nsw i8 %3, 1
ret i8 %4
}
double fatt(int n) {
  double result = 1.0;
  for (int i = n; i > 0; i -= 2)
    result *= i;
  return result;
}


x86 assembly (clang, -O0):
<fatt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  0xef1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1141 <fatt+0x41>
cvtsi2sdl -0x14(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    111a <fatt+0x1a>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatt>:
movsd  0xef8(%rip),%xmm0
test   %edi,%edi
jle    1125 <fatt+0x25>
nopl   0x0(%rax)
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
mulsd  %xmm1,%xmm0
lea    -0x2(%rdi),%eax
cmp    $0x2,%edi
mov    %eax,%edi
ja     1110 <fatt+0x10>
ret

LLVM IR (-O0):
define double @fatt(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca i32
store i32 %0, i32* %2
store double 1.000000e+00, double* %3
%5 = load i32, i32* %2
store i32 %5, i32* %4
br label %6
6: ; preds = %14, %1
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to double
%12 = load double, double* %3
%13 = fmul double %12, %11
store double %13, double* %3
br label %14
14: ; preds = %9
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 2
store i32 %16, i32* %4
br label %6
17: ; preds = %6
%18 = load double, double* %3
ret double %18
}

LLVM IR (-O2):
define double @fatt(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %5, %1
%4 = phi double [ 1.000000e+00, %1 ], [ %9, %5 ]
ret double %4
5: ; preds = %1, %5
%6 = phi i32 [ %10, %5 ], [ %0, %1 ]
%7 = phi double [ %9, %5 ], [ 1.000000e+00, %1 ]
%8 = sitofp i32 %6 to double
%9 = fmul double %7, %8
%10 = add nsw i32 %6, -2
%11 = icmp ugt i32 %6, 2
br i1 %11, label %5, label %3
}
/* Variables and functions */
int /*<<< orphan*/ sla_geoc_(double *, double *, double *, double *);
void slaGeoc(double p, double h, double *r, double *z) {
  double P;
  double H;
  double R;
  double Z;
  P = p;
  H = h;
  sla_geoc_(&P, &H, &R, &Z);
  *r = R;
  *z = Z;
}


x86 assembly (clang, -O0):
<slaGeoc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    -0x28(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x38(%rbp),%rdx
lea    -0x40(%rbp),%rcx
call   1030 <sla_geoc_@plt>
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaGeoc>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,0x20(%rsp)
movsd  %xmm1,0x18(%rsp)
lea    0x20(%rsp),%rdi
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1030 <sla_geoc_@plt>
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @slaGeoc(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = bitcast double* %5 to i8*
%10 = bitcast double* %6 to i8*
%11 = bitcast double* %7 to i8*
%12 = bitcast double* %8 to i8*
store double %0, double* %5
store double %1, double* %6
%13 = call i32 @sla_geoc_(double* %5, double* %6, double* %7, double* %8)
%14 = load double, double* %7
store double %14, double* %2
%15 = load double, double* %8
store double %15, double* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x6e() {
  Assert_real((isodigit(110) == 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_isodigit.c",
              555, ("isodigit should be 0 for n"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x6e>:
push   %rax
mov    $0x6e,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x22b,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for n\00"
define void @t_isodigit_0x6e() {
%1 = call i64 @isodigit(i32 110)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 555, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for n\00"
define void @t_isodigit_0x6e() {
%1 = tail call i64 @isodigit(i32 110)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 555, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void test22() {
  if ("help")
    (void)0;
  if (test22)
    (void)0;
  if (&test22)
    (void)0;
}


x86 assembly (clang, -O0):
<test22>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%al
test   $0x1,%al
jne    1113 <test22+0x13>
jmp    1118 <test22+0x18>
jmp    1118 <test22+0x18>
mov    $0x1,%al
test   $0x1,%al
jne    1127 <test22+0x27>
jmp    112c <test22+0x2c>
jmp    112c <test22+0x2c>
mov    $0x1,%al
test   $0x1,%al
jne    113b <test22+0x3b>
jmp    1140 <test22+0x40>
jmp    1140 <test22+0x40>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"help\00"
define void @test22() {
br i1 true, label %1, label %2
1: ; preds = %0
br label %2
2: ; preds = %1, %0
br i1 true, label %3, label %4
3: ; preds = %2
br label %4
4: ; preds = %3, %2
br i1 true, label %5, label %6
5: ; preds = %4
br label %6
6: ; preds = %5, %4
ret void
}

LLVM IR (-O2):
define void @test22() {
ret void
}
/* Variables and functions */
int sqrt(int);
int is_prime(int num) {
  int i;
  for (i = 2; i <= sqrt(num); ++i)
    if (num % i == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     116c <is_prime+0x5c>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1159 <is_prime+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1173 <is_prime+0x63>
jmp    115e <is_prime+0x4e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <is_prime+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x2,%ecx
jl     1150 <is_prime+0x40>
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    %ebx,%eax
cltd
idiv   %ebp
test   %edx,%edx
je     114e <is_prime+0x3e>
mov    %ebx,%edi
call   1030 <sqrt@plt>
cmp    %eax,%ebp
jl     1130 <is_prime+0x20>
mov    $0x1,%eax
jmp    1150 <is_prime+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = icmp slt i32 %2, 2
br i1 %3, label %12, label %8
4: ; preds = %8
%5 = add nuw nsw i32 %9, 1
%6 = tail call i32 @sqrt(i32 %0)
%7 = icmp slt i32 %9, %6
br i1 %7, label %8, label %12
8: ; preds = %1, %4
%9 = phi i32 [ %5, %4 ], [ 2, %1 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %8, %4, %1
%13 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i32 %13
}
void sys_dump_perf(void) {}


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

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

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

LLVM IR (-O2):
define void @sys_dump_perf() {
ret void
}
void reverse(char *s, int i, int j) {
  char temp = 0;
  while (i < j) {
    temp = s[i];
    s[i] = s[j];
    s[j] = temp;
    i++;
    j--;
  }
  return;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1167 <reverse+0x67>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <reverse+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
cmp    %edx,%esi
jge    1131 <reverse+0x31>
movslq %edx,%rax
movslq %esi,%rcx
add    $0xffffffffffffffff,%rax
xchg   %ax,%ax
movzbl (%rdi,%rcx,1),%esi
movzbl 0x1(%rdi,%rax,1),%edx
mov    %dl,(%rdi,%rcx,1)
mov    %sil,0x1(%rdi,%rax,1)
add    $0x1,%rcx
lea    -0x1(%rax),%rdx
cmp    %rax,%rcx
mov    %rdx,%rax
jl     1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define void @reverse(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = sext i32 %2 to i64
%7 = sext i32 %1 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %7, %5 ], [ %15, %8 ]
%10 = phi i64 [ %6, %5 ], [ %16, %8 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 %10
%14 = load i8, i8* %13
store i8 %14, i8* %11
store i8 %12, i8* %13
%15 = add nsw i64 %9, 1
%16 = add nsw i64 %10, -1
%17 = icmp slt i64 %15, %16
br i1 %17, label %8, label %18
18: ; preds = %8, %3
ret void
}
/* Variables and functions */
int get_time_msec();
int /*<<< orphan*/ get_time_sec();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int);
void print_time_chekpoint() {
  printf("diffsec = %ld sec %ld millisec ", get_time_sec(),
         get_time_msec() % 1000);
}


x86 assembly (clang, -O0):
<print_time_chekpoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <get_time_sec@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_time_msec@plt>
mov    -0x4(%rbp),%esi
mov    $0x3e8,%ecx
cltd
idiv   %ecx
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_time_chekpoint>:
push   %rbx
xor    %eax,%eax
call   1050 <get_time_sec@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <get_time_msec@plt>
movslq %eax,%rdx
imul   $0x10624dd3,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
imul   $0x3e8,%eax,%eax
sub    %eax,%edx
lea    0xe99(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"diffsec = %ld sec %ld millisec \00"
define void @print_time_chekpoint() {
%1 = call i32 (...) @get_time_sec()
%2 = call i32 (...) @get_time_msec()
%3 = srem i32 %2, 1000
%4 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"diffsec = %ld sec %ld millisec \00"
define void @print_time_chekpoint() {
%1 = tail call i32 (...) @get_time_sec()
%2 = tail call i32 (...) @get_time_msec()
%3 = srem i32 %2, 1000
%4 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *asctime_r(int /*<<< orphan*/, char *);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ const *);
char *ctime_r(const time_t *timer, char *buf) {
  return asctime_r(localtime(timer), buf);
}


x86 assembly (clang, -O0):
<ctime_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <asctime_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctime_r>:
push   %rbx
mov    %rsi,%rbx
call   1030 <localtime@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <asctime_r@plt>

LLVM IR (-O0):
define i8* @ctime_r(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = call i32 @localtime(i32* %5)
%7 = load i8*, i8** %4
%8 = call i8* @asctime_r(i32 %6, i8* %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @ctime_r(i32* %0, i8* %1) {
%3 = tail call i32 @localtime(i32* %0)
%4 = tail call i8* @asctime_r(i32 %3, i8* %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void f10(void) {
  int m;
  int *array[3];
  typedef int *arr[3];
  arr *b;
  b = &array;
  (*b)[0] = &m;
  *((*b)[0]) = 'd';
  putchar(*((*b)[0]));
}


x86 assembly (clang, -O0):
<f10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
lea    -0x4(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
movl   $0x64,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edi
call   1030 <putchar@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f10>:
mov    $0x64,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @f10() {
%1 = alloca i32
%2 = alloca [3 x i32*]
%3 = alloca [3 x i32*]*
store [3 x i32*]* %2, [3 x i32*]** %3
%4 = load [3 x i32*]*, [3 x i32*]** %3
%5 = getelementptr inbounds [3 x i32*], [3 x i32*]* %4, i64 0, i64 0
store i32* %1, i32** %5
%6 = load [3 x i32*]*, [3 x i32*]** %3
%7 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 0
%8 = load i32*, i32** %7
store i32 100, i32* %8
%9 = load [3 x i32*]*, [3 x i32*]** %3
%10 = getelementptr inbounds [3 x i32*], [3 x i32*]* %9, i64 0, i64 0
%11 = load i32*, i32** %10
%12 = load i32, i32* %11
%13 = call i32 @putchar(i32 %12)
ret void
}

LLVM IR (-O2):
define void @f10() {
%1 = tail call i32 @putchar(i32 100)
ret void
}
int space(char c) { return c == ' '; }


x86 assembly (clang, -O0):
<space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<space>:
xor    %eax,%eax
cmp    $0x20,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @space(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @space(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = zext i1 %2 to i32
ret i32 %3
}
void setLineNumber(int *entry, int line) { *(entry + 2) = line; }


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

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

LLVM IR (-O0):
define void @setLineNumber(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 2
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @setLineNumber(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() { printf("%s\n", "Welcome to the Cat Generator!"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [30 x i8] c"Welcome to the Cat Generator!\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [30 x i8] c"Welcome to the Cat Generator!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void printVersion() {
  printf("drakkar 0.1.1 (beta)\n GNU GPLv3\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<printVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printVersion>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"drakkar 0.1.1 (beta)\0A GNU GPLv3\0A\00"
@EXIT_SUCCESS = global i32 0
define void @printVersion() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [32 x i8] c"drakkar 0.1.1 (beta)\0A GNU GPLv3\00"
define void @printVersion() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Type definitions */
typedef size_t uint8_t;
typedef size_t uint16_t;

/* Variables and functions */
uint16_t stringLength(char *string) {
  uint8_t i = 0;
  while (string[i] > 0)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<stringLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jle    1136 <stringLength+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <stringLength+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringLength>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jg     1110 <stringLength+0x10>
ret

LLVM IR (-O0):
define i64 @stringLength(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %4
4: ; preds = %11, %1
%5 = load i8*, i8** %2
%6 = load i64, i64* %3
%7 = getelementptr inbounds i8, i8* %5, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i64, i64* %3
%13 = add i64 %12, 1
store i64 %13, i64* %3
br label %4
14: ; preds = %4
%15 = load i64, i64* %3
ret i64 %15
}

LLVM IR (-O2):
define i64 @stringLength(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp sgt i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %2, label %8
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ eFree(void *);
extern void eFreeIndirect(void **ptr) {
  if (ptr && *ptr) {
    eFree(*ptr);
    *ptr = NULL;
  }
}


x86 assembly (clang, -O0):
<eFreeIndirect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <eFreeIndirect+0x3c>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114c <eFreeIndirect+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <eFree@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eFreeIndirect>:
push   %rbx
test   %rdi,%rdi
je     112d <eFreeIndirect+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <eFreeIndirect+0x1d>
call   1030 <eFree@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @eFreeIndirect(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = icmp ne i8** %3, null
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = load i8**, i8*** %2
%11 = load i8*, i8** %10
%12 = call i32 @eFree(i8* %11)
%13 = load i8**, i8*** %2
store i8* null, i8** %13
br label %14
14: ; preds = %9, %5, %1
ret void
}

LLVM IR (-O2):
define void @eFreeIndirect(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @eFree(i8* %4)
store i8* null, i8** %0
br label %8
8: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ udelay(int);
void lcd_wait(void) { udelay(200); }


x86 assembly (clang, -O0):
<lcd_wait>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc8,%edi
call   1030 <udelay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_wait>:
mov    $0xc8,%edi
jmp    1030 <udelay@plt>

LLVM IR (-O0):
define void @lcd_wait() {
%1 = call i32 @udelay(i32 200)
ret void
}

LLVM IR (-O2):
define void @lcd_wait() {
%1 = tail call i32 @udelay(i32 200)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) { printf("Hello, webassembly!\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%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 = [21 x i8] c"Hello, webassembly!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

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


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

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

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

LLVM IR (-O2):
define void @BN_nnmod() {
ret void
}
int f2(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @f2() {
ret i32 42
}

LLVM IR (-O2):
define i32 @f2() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xf1() {
  Assert_real((isxdigit(241) == 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_isxdigit.c",
              1210, ("isxdigit should be 0 for 0xf1"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xf1>:
push   %rax
mov    $0xf1,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4ba,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xf1\00"
define void @t_isxdigit_0xf1() {
%1 = call i64 @isxdigit(i32 241)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1210, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xf1\00"
define void @t_isxdigit_0xf1() {
%1 = tail call i64 @isxdigit(i32 241)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1210, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GP_addData(short);
scalar_t__ getParLong(long *);
int /*<<< orphan*/ is1Tab();
int /*<<< orphan*/ messErr(int);
void IF_gplot_append(void) {
  long t;
  if (getParLong(&t)) {
    if (!is1Tab()) {
      messErr(12);
      return;
    }
    GP_addData((short)t);
  }
}


x86 assembly (clang, -O0):
<IF_gplot_append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1060 <getParLong@plt>
cmp    $0x0,%rax
je     1186 <IF_gplot_append+0x46>
mov    $0x0,%al
call   1030 <is1Tab@plt>
cmp    $0x0,%eax
jne    117a <IF_gplot_append+0x3a>
mov    $0xc,%edi
call   1040 <messErr@plt>
jmp    1186 <IF_gplot_append+0x46>
mov    -0x8(%rbp),%rax
movswl %ax,%edi
call   1050 <GP_addData@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_gplot_append>:
push   %rax
mov    %rsp,%rdi
call   1060 <getParLong@plt>
test   %rax,%rax
je     1162 <IF_gplot_append+0x22>
xor    %eax,%eax
call   1030 <is1Tab@plt>
test   %eax,%eax
je     1164 <IF_gplot_append+0x24>
movswl (%rsp),%edi
call   1050 <GP_addData@plt>
pop    %rax
ret
mov    $0xc,%edi
call   1040 <messErr@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @IF_gplot_append() {
%1 = alloca i64
%2 = call i64 @getParLong(i64* %1)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %0
%5 = call i32 (...) @is1Tab()
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = call i32 @messErr(i32 12)
br label %13
9: ; preds = %4
%10 = load i64, i64* %1
%11 = trunc i64 %10 to i16
%12 = call i32 @GP_addData(i16 signext %11)
br label %13
13: ; preds = %7, %9, %0
ret void
}

LLVM IR (-O2):
define void @IF_gplot_append() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i64 @getParLong(i64* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %0
%6 = call i32 (...) @is1Tab()
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @messErr(i32 12)
br label %14
10: ; preds = %5
%11 = load i64, i64* %1
%12 = trunc i64 %11 to i16
%13 = call i32 @GP_addData(i16 signext %12)
br label %14
14: ; preds = %0, %10, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dbg_sock_close();
void dbg_sock_cleanup(void) { dbg_sock_close(); }


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

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

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

LLVM IR (-O2):
define void @dbg_sock_cleanup() {
%1 = tail call i32 (...) @dbg_sock_close()
ret void
}
unsigned spd_to_dimm(unsigned device) { return (device - 0x00); }


x86 assembly (clang, -O0):
<spd_to_dimm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spd_to_dimm>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @spd_to_dimm(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ bfc_panic();
int /*<<< orphan*/ free(void *);
void *realloc(void *, size_t);
void *bfc_realloc(void *ptr, size_t nbytes) {
  if (!nbytes) {
    free(ptr);
    return 0;
  }
  ptr = realloc(ptr, nbytes);
  if (!ptr)
    bfc_panic();
  return ptr;
}


x86 assembly (clang, -O0):
<bfc_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1161 <bfc_realloc+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    118c <bfc_realloc+0x5c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1184 <bfc_realloc+0x54>
mov    $0x0,%al
call   1040 <bfc_panic@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bfc_realloc>:
push   %rbx
test   %rsi,%rsi
je     114e <bfc_realloc+0x1e>
call   1050 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1155 <bfc_realloc+0x25>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <bfc_panic@plt>
jmp    1155 <bfc_realloc+0x25>
call   1030 <free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @bfc_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = icmp ne i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i32 @free(i8* %9)
store i8* null, i8** %3
br label %21
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load i64, i64* %5
%14 = call i8* @realloc(i8* %12, i64 %13)
store i8* %14, i8** %4
%15 = load i8*, i8** %4
%16 = icmp ne i8* %15, null
br i1 %16, label %19, label %17
17: ; preds = %11
%18 = call i32 (...) @bfc_panic()
br label %19
19: ; preds = %17, %11
%20 = load i8*, i8** %4
store i8* %20, i8** %3
br label %21
21: ; preds = %19, %8
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define noalias i8* @bfc_realloc(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @free(i8* %0)
br label %11
6: ; preds = %2
%7 = tail call i8* @realloc(i8* %0, i64 %1)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 (...) @bfc_panic()
br label %11
11: ; preds = %6, %9, %4
%12 = phi i8* [ null, %4 ], [ null, %9 ], [ %7, %6 ]
ret i8* %12
}
void EVP_EncodeBlock(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_EncodeBlock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_ivector(int *v, int nl, int nh) { free((void *)(v + nl)); }


x86 assembly (clang, -O0):
<free_ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_ivector>:
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_ivector(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = bitcast i32* %5 to i8*
%7 = tail call i32 @free(i8* %6)
ret void
}
/* Type definitions */
struct generator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ w(struct generator *, char *);
int /*<<< orphan*/ write_int(struct generator *, int);
void wsetlab_begin(struct generator *g, int n) {
  w(g, "~Mlab");
  write_int(g, n);
  w(g, ": do {~+~N");
}


x86 assembly (clang, -O0):
<wsetlab_begin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1040 <w@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <write_int@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1040 <w@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wsetlab_begin>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed1(%rip),%rsi
call   1040 <w@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <write_int@plt>
lea    0xec1(%rip),%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <w@plt>

LLVM IR (-O0):
%struct.generator = type { i32 }
@.str = [6 x i8] c"~Mlab\00"
@.str.1 = [11 x i8] c": do {~+~N\00"
define void @wsetlab_begin(%struct.generator* %0, i32 %1) {
%3 = alloca %struct.generator*
%4 = alloca i32
store %struct.generator* %0, %struct.generator** %3
store i32 %1, i32* %4
%5 = load %struct.generator*, %struct.generator** %3
%6 = call i32 @w(%struct.generator* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = load %struct.generator*, %struct.generator** %3
%8 = load i32, i32* %4
%9 = call i32 @write_int(%struct.generator* %7, i32 %8)
%10 = load %struct.generator*, %struct.generator** %3
%11 = call i32 @w(%struct.generator* %10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.generator = type { i32 }
@.str = [6 x i8] c"~Mlab\00"
@.str.1 = [11 x i8] c": do {~+~N\00"
define void @wsetlab_begin(%struct.generator* %0, i32 %1) {
%3 = tail call i32 @w(%struct.generator* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @write_int(%struct.generator* %0, i32 %1)
%5 = tail call i32 @w(%struct.generator* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double KTStoFPS(double KTS) {
  double FPS = 1.6878099 * KTS;
  return FPS;
}


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

x86 assembly (clang, -O2):
<KTStoFPS>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @KTStoFPS(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double 0x3FFB0144F425D72A, %4
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @KTStoFPS(double %0) {
%2 = fmul double %0, 0x3FFB0144F425D72A
ret double %2
}
int repeat(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @repeat() {
ret i32 1
}
void bsp_set_pintrl(unsigned int type, unsigned int gpio, unsigned int value) {
  return;
}


x86 assembly (clang, -O0):
<bsp_set_pintrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @bsp_set_pintrl(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
double cdfexp_(double *, double *);
double ccdfexp(double *x, double *para) { return cdfexp_(x, para); }


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

x86 assembly (clang, -O2):
<ccdfexp>:
jmp    1030 <cdfexp_@plt>

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

LLVM IR (-O2):
define double @ccdfexp(double* %0, double* %1) {
%3 = tail call double @cdfexp_(double* %0, double* %1)
ret double %3
}
int f1(int c, int shamt) { return 1 << (c << shamt); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %esi,%ecx
shl    %cl,%edi
mov    $0x1,%eax
mov    %edi,%ecx
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f1(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 = shl i32 %5, %6
%8 = shl i32 1, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = shl nuw i32 1, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x93() {
  Assert_real((iscntrl(147) == 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",
              740, ("iscntrl should be 0 for 0x93"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x93>:
push   %rax
mov    $0x93,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2e4,%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 = [29 x i8] c"iscntrl should be 0 for 0x93\00"
define void @t_iscntrl_0x93() {
%1 = call i64 @iscntrl(i32 147)
%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 740, i8* getelementptr inbounds ([29 x i8], [29 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 = [29 x i8] c"iscntrl should be 0 for 0x93\00"
define void @t_iscntrl_0x93() {
%1 = tail call i64 @iscntrl(i32 147)
%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 740, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int memRead(unsigned short);
unsigned short memReadAbsolute(unsigned short adr) {
  return (memRead(adr) | memRead((unsigned short)(adr + 1)) << 8);
}


x86 assembly (clang, -O0):
<memReadAbsolute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <memRead@plt>
mov    %eax,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x1,%eax
movzwl %ax,%edi
call   1030 <memRead@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memReadAbsolute>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <memRead@plt>
mov    %eax,%ebp
add    $0x1,%ebx
movzwl %bx,%edi
call   1030 <memRead@plt>
shl    $0x8,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i16 @memReadAbsolute(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @memRead(i16 zeroext %3)
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = add nsw i32 %6, 1
%8 = trunc i32 %7 to i16
%9 = call i32 @memRead(i16 zeroext %8)
%10 = shl i32 %9, 8
%11 = or i32 %4, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @memReadAbsolute(i16 zeroext %0) {
%2 = tail call i32 @memRead(i16 zeroext %0)
%3 = add i16 %0, 1
%4 = tail call i32 @memRead(i16 zeroext %3)
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
%7 = trunc i32 %6 to i16
ret i16 %7
}