xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ isfinite(double);
bool az_dapprox(double a, double b) {
  assert(isfinite(a));
  assert(isfinite(b));
  const double d = a - b;
  return (d < 0.00000001 && d > -0.00000001);
}


x86 assembly (clang, -O0):
<az_dapprox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <isfinite@plt>
mov    %eax,%edi
call   1030 <assert@plt>
movsd  -0x10(%rbp),%xmm0
call   1040 <isfinite@plt>
mov    %eax,%edi
call   1030 <assert@plt>
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
xor    %eax,%eax
movsd  0xe93(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
mov    %al,-0x19(%rbp)
jbe    1192 <az_dapprox+0x72>
movsd  -0x18(%rbp),%xmm0
movsd  0xe80(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<az_dapprox>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1040 <isfinite@plt>
mov    %eax,%edi
call   1030 <assert@plt>
movsd  0x8(%rsp),%xmm0
call   1040 <isfinite@plt>
mov    %eax,%edi
call   1030 <assert@plt>
movsd  0x10(%rsp),%xmm1
subsd  0x8(%rsp),%xmm1
movsd  0xe9e(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
ucomisd 0xe97(%rip),%xmm1
seta   %cl
and    %al,%cl
movzbl %cl,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @az_dapprox(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = call i32 @isfinite(double %6)
%8 = call i32 @assert(i32 %7)
%9 = load double, double* %4
%10 = call i32 @isfinite(double %9)
%11 = call i32 @assert(i32 %10)
%12 = load double, double* %3
%13 = load double, double* %4
%14 = fsub double %12, %13
store double %14, double* %5
%15 = load double, double* %5
%16 = fcmp olt double %15, 1.000000e-08
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = load double, double* %5
%19 = fcmp ogt double %18, -1.000000e-08
br label %20
20: ; preds = %17, %2
%21 = phi i1 [ false, %2 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @az_dapprox(double %0, double %1) {
%3 = tail call i32 @isfinite(double %0)
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @isfinite(double %1)
%6 = tail call i32 @assert(i32 %5)
%7 = fsub double %0, %1
%8 = fcmp olt double %7, 1.000000e-08
%9 = fcmp ogt double %7, -1.000000e-08
%10 = and i1 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
void Inertia(M, q) double M[4];
double q[2];
{
  double t2;
  {
    t2 = cos(q[1]);
    M[0] = 3.0 + 2.0 * t2;
    M[1] = t2 + 1.0;
    M[2] = M[1];
    M[3] = 1.0;
    return;
  }
}


x86 assembly (clang, -O0):
<Inertia>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
call   1030 <cos@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xec4(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xea8(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
movsd  0xe7c(%rip),%xmm0
movsd  %xmm0,0x18(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Inertia>:
push   %rbx
mov    %rdi,%rbx
movsd  0x8(%rsi),%xmm0
call   1030 <cos@plt>
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
addsd  0xed2(%rip),%xmm1
movsd  %xmm1,(%rbx)
addsd  0xece(%rip),%xmm0
movsd  %xmm0,0x8(%rbx)
movsd  %xmm0,0x10(%rbx)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x18(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @Inertia(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
%9 = call double @cos(double %8)
store double %9, double* %5
%10 = load double, double* %5
%11 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %10, double 3.000000e+00)
%12 = load double*, double** %3
%13 = getelementptr inbounds double, double* %12, i64 0
store double %11, double* %13
%14 = load double, double* %5
%15 = fadd double %14, 1.000000e+00
%16 = load double*, double** %3
%17 = getelementptr inbounds double, double* %16, i64 1
store double %15, double* %17
%18 = load double*, double** %3
%19 = getelementptr inbounds double, double* %18, i64 1
%20 = load double, double* %19
%21 = load double*, double** %3
%22 = getelementptr inbounds double, double* %21, i64 2
store double %20, double* %22
%23 = load double*, double** %3
%24 = getelementptr inbounds double, double* %23, i64 3
store double 1.000000e+00, double* %24
ret void
}

LLVM IR (-O2):
define void @Inertia(double* nocapture writeonly %0, double* nocapture %1) {
%3 = getelementptr inbounds double, double* %1, i64 1
%4 = load double, double* %3
%5 = tail call double @cos(double %4)
%6 = tail call double @llvm.fmuladd.f64(double %5, double 2.000000e+00, double 3.000000e+00)
store double %6, double* %0
%7 = fadd double %5, 1.000000e+00
%8 = getelementptr inbounds double, double* %0, i64 1
store double %7, double* %8
%9 = getelementptr inbounds double, double* %0, i64 2
store double %7, double* %9
%10 = getelementptr inbounds double, double* %0, i64 3
store double 1.000000e+00, double* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: wc [-Lclmw] [file ...]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"usage: wc [-Lclmw] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"usage: wc [-Lclmw] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *stb_strtok_raw(char *, char *, char *, int, int);
char *stb_strtok_invert(char *output, char *src, char *delimit) {
  return stb_strtok_raw(output, src, delimit, 1, 1);
}


x86 assembly (clang, -O0):
<stb_strtok_invert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%r8d
mov    %r8d,%ecx
call   1030 <stb_strtok_raw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_strtok_invert>:
mov    $0x1,%ecx
mov    $0x1,%r8d
jmp    1030 <stb_strtok_raw@plt>

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

LLVM IR (-O2):
define i8* @stb_strtok_invert(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @stb_strtok_raw(i8* %0, i8* %1, i8* %2, i32 1, i32 1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ ADD_FREE(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ strlen(char *);
void zzstrfree(char *p) {
  if (!p) {
    return;
  }
  ADD_FREE(strlen(p));
  free(p);
}


x86 assembly (clang, -O0):
<zzstrfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114c <zzstrfree+0x1c>
jmp    1165 <zzstrfree+0x35>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
call   1050 <ADD_FREE@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zzstrfree>:
test   %rdi,%rdi
je     114e <zzstrfree+0x1e>
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%edi
call   1050 <ADD_FREE@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @zzstrfree(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 %6, label %5
5: ; preds = %1
br label %12
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @ADD_FREE(i32 %8)
%10 = load i8*, i8** %2
%11 = call i32 @free(i8* %10)
br label %12
12: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @zzstrfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @ADD_FREE(i32 %4)
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %1, %3
ret void
}
int _get_first_child(int pos) { return (pos * 2) + 1; }


x86 assembly (clang, -O0):
<_get_first_child>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_first_child>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @_get_first_child(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 2
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @_get_first_child(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
float atan2f(float, float);
float futrts_atan2_32(float x, float y) { return atan2f(x, y); }


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

x86 assembly (clang, -O2):
<futrts_atan2_32>:
jmp    1030 <atan2f@plt>

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

LLVM IR (-O2):
define float @futrts_atan2_32(float %0, float %1) {
%3 = tail call float @atan2f(float %0, float %1)
ret float %3
}
int IsAlpha(char c) {
  c &= 0xDF;
  return c >= 'A' && c <= 'Z';
}


x86 assembly (clang, -O0):
<IsAlpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xdf,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1135 <IsAlpha+0x35>
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):
<IsAlpha>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @IsAlpha(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ hl_math_fceil(double);
int hl_math_ceil(double d) { return (int)hl_math_fceil(d); }


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

x86 assembly (clang, -O2):
<hl_math_ceil>:
jmp    1030 <hl_math_fceil@plt>

LLVM IR (-O0):
define i32 @hl_math_ceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @hl_math_fceil(double %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @hl_math_ceil(double %0) {
%2 = tail call i64 @hl_math_fceil(double %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ init_serial_debug();
int module_init() {
  init_serial_debug();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @module_init() {
%1 = call i32 (...) @init_serial_debug()
ret i32 0
}

LLVM IR (-O2):
define i32 @module_init() {
%1 = tail call i32 (...) @init_serial_debug()
ret i32 0
}
void net_deinitialize() {}


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

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

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

LLVM IR (-O2):
define void @net_deinitialize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int a = 1;
  int b = 1;
  printf("%d\n", a + ++b);
  printf("%d\n", a + b++);
  printf("%d\n", b);
  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   $0x1,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
add    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x18(%rbp)
add    %eax,%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
__attribute__((no, noclone, used)) void _ITM_registerTMCloneTable() { asm(""); }


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @_ITM_registerTMCloneTable to i8*)], section "llvm.metadata"
define void @_ITM_registerTMCloneTable() {
ret void
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @_ITM_registerTMCloneTable to i8*)], section "llvm.metadata"
define void @_ITM_registerTMCloneTable() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
void crash_fseeks() {
  FILE *f;
  f = fopen("this_file_doesnt_exist", "r");
  fseek(f, 7, SEEK_SET);
  fclose(f);
}


x86 assembly (clang, -O0):
<crash_fseeks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e86(%rip),%rax
mov    (%rax),%edx
mov    $0x7,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crash_fseeks>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    0x2e92(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
@SEEK_SET = global i32 0
define void @crash_fseeks() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = load i32, i32* @SEEK_SET
%5 = call i32 @fseek(i32* %3, i32 7, i32 %4)
%6 = load i32*, i32** %1
%7 = call i32 @fclose(i32* %6)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
@SEEK_SET = global i32 0
define void @crash_fseeks() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = load i32, i32* @SEEK_SET
%3 = tail call i32 @fseek(i32* %1, i32 7, i32 %2)
%4 = tail call i32 @fclose(i32* %1)
ret void
}
/* Type definitions */
typedef unsigned char uint32_t;

/* Variables and functions */
uint32_t le2uint(const unsigned char *buf) {
  uint32_t res = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0];
  return res;
}


x86 assembly (clang, -O0):
<le2uint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le2uint>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @le2uint(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl i32 %7, 24
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 16
%14 = or i32 %8, %13
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = or i32 %14, %19
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 0
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = or i32 %20, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %3
%27 = load i8, i8* %3
ret i8 %27
}

LLVM IR (-O2):
define zeroext i8 @le2uint(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *xmalloc(size_t size) {
  void *ptr = malloc(size);
  if (ptr == NULL)
    abort();
  else
    memset(ptr, 0, size);
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115b <xmalloc+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
test   %rax,%rax
je     115c <xmalloc+0x2c>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i64, i64* %2
%13 = call i32 @memset(i8* %11, i32 0, i64 %12)
br label %14
14: ; preds = %10
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
%7 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
int /*<<< orphan*/ stat(char const *, struct stat *);
int isDir(const char *path) {
  struct stat path_stat;
  stat(path, &path_stat);
  return S_ISDIR(path_stat.st_mode);
}


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

x86 assembly (clang, -O2):
<isDir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    (%rsp),%edi
pop    %rax
jmp    1030 <S_ISDIR@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @isDir(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i32 @S_ISDIR(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @isDir(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @S_ISDIR(i32 %6)
ret i32 %7
}
/* Variables and functions */
int duplicate_func();
int func();
int main(void) { return duplicate_func() + func(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <duplicate_func@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <func@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <duplicate_func@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <func@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @duplicate_func()
%3 = call i32 (...) @func()
%4 = add nsw i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @duplicate_func()
%2 = tail call i32 (...) @func()
%3 = add nsw i32 %2, %1
ret i32 %3
}
void unused() {}


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

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

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

LLVM IR (-O2):
define void @unused() {
ret void
}
int kvmppc_get_cap_safe_bounds_check(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @kvmppc_get_cap_safe_bounds_check() {
ret i32 0
}

LLVM IR (-O2):
define i32 @kvmppc_get_cap_safe_bounds_check() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dolower(int /*<<< orphan*/);
void lwc_lcase_memcpy(char *target, const char *source, size_t n) {
  while (n--) {
    *target++ = dolower(*source++);
  }
}


x86 assembly (clang, -O0):
<lwc_lcase_memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     116c <lwc_lcase_memcpy+0x5c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <dolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1124 <lwc_lcase_memcpy+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lwc_lcase_memcpy>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
je     1147 <lwc_lcase_memcpy+0x37>
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <dolower@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <lwc_lcase_memcpy+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @lwc_lcase_memcpy(i8* nocapture writeonly %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %17, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %9, %5 ], [ %2, %3 ]
%7 = phi i8* [ %10, %5 ], [ %1, %3 ]
%8 = phi i8* [ %15, %5 ], [ %0, %3 ]
%9 = add i64 %6, -1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %7
%12 = sext i8 %11 to i32
%13 = tail call i32 @dolower(i32 %12)
%14 = trunc i32 %13 to i8
%15 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %14, i8* %8
%16 = icmp eq i64 %9, 0
br i1 %16, label %17, label %5
17: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Eternal Passsion,\tEternal Pain.\tBy- Mathew Arnold.");
  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 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [51 x i8] c"Eternal Passsion,\09Eternal Pain.\09By- Mathew Arnold.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [51 x i8] c"Eternal Passsion,\09Eternal Pain.\09By- Mathew Arnold.\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned int get_uint32(char *start) {
  unsigned int value = 0;
  value = (unsigned int)((unsigned char)*start) |
          (((unsigned char)*(start + 1)) << 8) |
          (((unsigned char)*(start + 2)) << 16) |
          (((unsigned char)*(start + 3)) << 24);
  return value;
}


x86 assembly (clang, -O0):
<get_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_uint32(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
store i32 %24, i32* %3
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @get_uint32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ sendto(int, void const *, size_t, int,
                          struct sockaddr const *, int /*<<< orphan*/);
__attribute__((weak)) ssize_t __real_sendto(int fd, const void *buf, size_t len,
                                            int flags,
                                            const struct sockaddr *to,
                                            socklen_t tolen) {
  return sendto(fd, buf, len, flags, to, tolen);
}


x86 assembly (clang, -O0):
<__real_sendto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1030 <sendto@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__real_sendto>:
jmp    1030 <sendto@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define weak i32 @__real_sendto(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca %struct.sockaddr*
%12 = alloca i32
store i32 %0, i32* %7
store i8* %1, i8** %8
store i64 %2, i64* %9
store i32 %3, i32* %10
store %struct.sockaddr* %4, %struct.sockaddr** %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = load i64, i64* %9
%16 = load i32, i32* %10
%17 = load %struct.sockaddr*, %struct.sockaddr** %11
%18 = load i32, i32* %12
%19 = call i32 @sendto(i32 %13, i8* %14, i64 %15, i32 %16, %struct.sockaddr* %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define weak i32 @__real_sendto(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5) {
%7 = tail call i32 @sendto(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0x8a() {
  Assert_real((isascii(138) == 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_isascii.c",
              695, ("isascii should be 0 for 0x8a"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0x8a>:
push   %rax
mov    $0x8a,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2b7,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x8a\00"
define void @t_isascii_0x8a() {
%1 = call i64 @isascii(i32 138)
%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 695, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x8a\00"
define void @t_isascii_0x8a() {
%1 = tail call i64 @isascii(i32 138)
%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 695, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void swap(char *string, int firstIndex, int secondIndex) {
  char temp = string[firstIndex];
  string[firstIndex] = string[secondIndex];
  string[secondIndex] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
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)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%sil
movslq %edx,%rdx
mov    (%rdi,%rdx,1),%cl
mov    %cl,(%rdi,%rax,1)
mov    %sil,(%rdi,%rdx,1)
ret

LLVM IR (-O0):
define void @swap(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
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
store i8 %12, i8* %7
%13 = load i8*, i8** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = load i8*, i8** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 %17, i8* %21
%22 = load i8, i8* %7
%23 = load i8*, i8** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 %22, i8* %26
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %5
store i8 %6, i8* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Com_DPrintf(char *, size_t);
void *realloc(void *, size_t);
void *Memory_realloc(void *memblock, size_t size) {
  void *ptr;
  ptr = realloc(memblock, size);
  if (ptr != ((void *)0)) {
    return ptr;
  }
  Com_DPrintf("[Memory_realloc]: Could not reallocate %d bytes\n", size);
  return ((void *)0);
}


x86 assembly (clang, -O0):
<Memory_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1159 <Memory_realloc+0x39>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1171 <Memory_realloc+0x51>
mov    -0x18(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1030 <Com_DPrintf@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Memory_realloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <Memory_realloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <Com_DPrintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [49 x i8] c"[Memory_realloc]: Could not reallocate %d bytes\0A\00"
define i8* @Memory_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @realloc(i8* %7, i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i8*, i8** %6
store i8* %13, i8** %3
br label %17
14: ; preds = %2
%15 = load i64, i64* %5
%16 = call i32 @Com_DPrintf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i64 %15)
store i8* null, i8** %3
br label %17
17: ; preds = %14, %12
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [49 x i8] c"[Memory_realloc]: Could not reallocate %d bytes\0A\00"
define noalias i8* @Memory_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @Com_DPrintf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i64 %1)
br label %7
7: ; preds = %2, %5
ret i8* %3
}
/* Variables and functions */
unsigned int sys_call(int, unsigned int, unsigned int, unsigned int,
                      int /*<<< orphan*/);
unsigned int ioc_write(unsigned int lba, void *buffer, unsigned int count) {
  return sys_call(0x15, lba, (unsigned int)buffer, count, 0);
}


x86 assembly (clang, -O0):
<ioc_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
mov    -0x14(%rbp),%ecx
mov    $0x15,%edi
xor    %r8d,%r8d
call   1030 <sys_call@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ioc_write>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x15,%edi
xor    %r8d,%r8d
jmp    1030 <sys_call@plt>

LLVM IR (-O0):
define i32 @ioc_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i32
%10 = load i32, i32* %6
%11 = call i32 @sys_call(i32 21, i32 %7, i32 %9, i32 %10, i32 0)
ret i32 %11
}

LLVM IR (-O2):
define i32 @ioc_write(i32 %0, i8* %1, i32 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @sys_call(i32 21, i32 %0, i32 %5, i32 %2, i32 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void f1(const char *s) { printf("%s triggered probe1:f1\n", s); }


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

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

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

LLVM IR (-O2):
@.str = [24 x i8] c"%s triggered probe1:f1\0A\00"
define void @f1(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Reverse();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Enter a sentence: ");
  Reverse();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Enter a sentence: \00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @Reverse()
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Enter a sentence: \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @Reverse()
ret i32 0
}
int readnump(p)
char **p;
{
  int t;
  t = 0;
  while (((int)**p >= '0') && ((int)**p <= '9')) {
    t = t * 10 + (int)**p - '0';
    *p = *p + 1;
  };
  return (t);
}


x86 assembly (clang, -O0):
<readnump>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xd(%rbp)
jl     113a <readnump+0x3a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114a <readnump+0x4a>
jmp    1177 <readnump+0x77>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    110f <readnump+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readnump>:
mov    (%rdi),%rcx
mov    (%rcx),%dl
lea    -0x30(%rdx),%esi
xor    %eax,%eax
cmp    $0x9,%sil
ja     113f <readnump+0x3f>
add    $0x1,%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movzbl %dl,%edx
lea    (%rax,%rax,4),%eax
lea    (%rdx,%rax,2),%eax
add    $0xffffffd0,%eax
mov    %rcx,(%rdi)
movzbl (%rcx),%edx
lea    -0x30(%rdx),%esi
add    $0x1,%rcx
cmp    $0xa,%sil
jb     1120 <readnump+0x20>
ret

LLVM IR (-O0):
define i32 @readnump(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 48
br i1 %9, label %10, label %16
10: ; preds = %4
%11 = load i8**, i8*** %2
%12 = load i8*, i8** %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp sle i32 %14, 57
br label %16
16: ; preds = %10, %4
%17 = phi i1 [ false, %4 ], [ %15, %10 ]
br i1 %17, label %18, label %31
18: ; preds = %16
%19 = load i32, i32* %3
%20 = mul nsw i32 %19, 10
%21 = load i8**, i8*** %2
%22 = load i8*, i8** %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = add nsw i32 %20, %24
%26 = sub nsw i32 %25, 48
store i32 %26, i32* %3
%27 = load i8**, i8*** %2
%28 = load i8*, i8** %27
%29 = getelementptr inbounds i8, i8* %28, i64 1
%30 = load i8**, i8*** %2
store i8* %29, i8** %30
br label %4
31: ; preds = %16
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @readnump(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %18
6: ; preds = %1, %6
%7 = phi i8 [ %15, %6 ], [ %3, %1 ]
%8 = phi i8* [ %14, %6 ], [ %2, %1 ]
%9 = phi i32 [ %13, %6 ], [ 0, %1 ]
%10 = zext i8 %7 to i32
%11 = mul nsw i32 %9, 10
%12 = add i32 %11, -48
%13 = add i32 %12, %10
%14 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %14, i8** %0
%15 = load i8, i8* %14
%16 = add i8 %15, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %6, label %18
18: ; preds = %6, %1
%19 = phi i32 [ 0, %1 ], [ %13, %6 ]
ret i32 %19
}
void EXTI1_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @EXTI1_IRQHandler() {
ret void
}
/* Variables and functions */
size_t divide_round_up(size_t dividend, size_t divisor) {
  if (dividend % divisor == 0) {
    return dividend / divisor;
  } else {
    return dividend / divisor + 1;
  }
}


x86 assembly (clang, -O0):
<divide_round_up>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
cmp    $0x0,%rdx
jne    1137 <divide_round_up+0x37>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rax,-0x8(%rbp)
jmp    114b <divide_round_up+0x4b>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide_round_up>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1116 <divide_round_up+0x16>
xor    %edx,%edx
div    %rsi
jmp    111a <divide_round_up+0x1a>
xor    %edx,%edx
div    %esi
cmp    $0x1,%rdx
sbb    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @divide_round_up(i64 %0, i64 %1) {
%3 = urem i64 %0, %1
%4 = icmp ne i64 %3, 0
%5 = udiv i64 %0, %1
%6 = zext i1 %4 to i64
%7 = add i64 %5, %6
ret i64 %7
}