xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strCpy(int *, int *);
int strLen(int *);
int *strDup(int *a) {
  int *p = (int *)malloc((strLen(a) + 1) * sizeof(int));
  strCpy(p, a);
  return p;
}


x86 assembly (clang, -O0):
<strDup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strLen@plt>
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strCpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strDup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strLen@plt>
lea    0x4(,%rax,4),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strCpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @strDup(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @strLen(i32* %4)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 4
%9 = trunc i64 %8 to i32
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %3
%12 = load i32*, i32** %3
%13 = load i32*, i32** %2
%14 = call i32 @strCpy(i32* %12, i32* %13)
%15 = load i32*, i32** %3
ret i32* %15
}

LLVM IR (-O2):
define i32* @strDup(i32* %0) {
%2 = tail call i32 @strLen(i32* %0)
%3 = shl i32 %2, 2
%4 = add i32 %3, 4
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i32*
%7 = tail call i32 @strCpy(i32* %6, i32* %0)
ret i32* %6
}
/* Variables and functions */
int F_OK;
int octave_access_f_ok(void) { return F_OK; }


x86 assembly (clang, -O0):
<octave_access_f_ok>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<octave_access_f_ok>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @octave_access_f_ok() {
%1 = load i32, i32* @F_OK
ret i32 %1
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @octave_access_f_ok() {
%1 = load i32, i32* @F_OK
ret i32 %1
}
/* Variables and functions */
double sqrt(double);
void hex_qr2xy(double p, int q, int r, double *x, double *y) {
  *x = p * (sqrt(3.0) / 2.0 * q);
  *y = p * (0.5 * q + 1.0 * r);
}


x86 assembly (clang, -O0):
<hex_qr2xy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xedb(%rip),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  0xebe(%rip),%xmm2
divsd  %xmm2,%xmm1
cvtsi2sdl -0xc(%rbp),%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
cvtsi2sdl -0x10(%rbp),%xmm3
movsd  0xe86(%rip),%xmm2
mulsd  %xmm3,%xmm2
movsd  0xe72(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_qr2xy>:
cvtsi2sd %edi,%xmm1
movsd  0xef4(%rip),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
cvtsi2sd %esi,%xmm3
mulsd  0xee8(%rip),%xmm1
movsd  %xmm2,(%rdx)
addsd  %xmm3,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rcx)
ret

LLVM IR (-O0):
define void @hex_qr2xy(double %0, i32 %1, i32 %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
%9 = alloca double*
%10 = alloca double*
store double %0, double* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store double* %3, double** %9
store double* %4, double** %10
%11 = load double, double* %6
%12 = call double @sqrt(double 3.000000e+00)
%13 = fdiv double %12, 2.000000e+00
%14 = load i32, i32* %7
%15 = sitofp i32 %14 to double
%16 = fmul double %13, %15
%17 = fmul double %11, %16
%18 = load double*, double** %9
store double %17, double* %18
%19 = load double, double* %6
%20 = load i32, i32* %7
%21 = sitofp i32 %20 to double
%22 = load i32, i32* %8
%23 = sitofp i32 %22 to double
%24 = fmul double 1.000000e+00, %23
%25 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %21, double %24)
%26 = fmul double %19, %25
%27 = load double*, double** %10
store double %26, double* %27
ret void
}

LLVM IR (-O2):
define void @hex_qr2xy(double %0, i32 %1, i32 %2, double* nocapture writeonly %3, double* nocapture writeonly %4) {
%6 = sitofp i32 %1 to double
%7 = fmul double %6, 0x3FEBB67AE8584CAA
%8 = fmul double %7, %0
store double %8, double* %3
%9 = sitofp i32 %2 to double
%10 = tail call double @llvm.fmuladd.f64(double %6, double 5.000000e-01, double %9)
%11 = fmul double %10, %0
store double %11, double* %4
ret void
}
void f20(a20) union file *a20;
{}


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

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

LLVM IR (-O0):
%union.file = type opaque
define void @f20(%union.file* %0) {
%2 = alloca %union.file*
store %union.file* %0, %union.file** %2
ret void
}

LLVM IR (-O2):
%union.file = type opaque
define void @f20(%union.file* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glLineWidth(float);
void graphic_set_line_width(float width) { glLineWidth(width); }


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

x86 assembly (clang, -O2):
<graphic_set_line_width>:
jmp    1030 <glLineWidth@plt>

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

LLVM IR (-O2):
define void @graphic_set_line_width(float %0) {
%2 = tail call i32 @glLineWidth(float %0)
ret void
}
int ls_costN_nm2_n_out(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @ls_costN_nm2_n_out() {
ret i32 2
}

LLVM IR (-O2):
define i32 @ls_costN_nm2_n_out() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ grava_li(int, char *);
void rot19_sem() { grava_li(1, "$FOR"); }


x86 assembly (clang, -O0):
<rot19_sem>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <grava_li@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot19_sem>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <grava_li@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"$FOR\00"
define void @rot19_sem() {
%1 = call i32 @grava_li(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"$FOR\00"
define void @rot19_sem() {
%1 = tail call i32 @grava_li(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int fibonacci(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("%i\n", fibonacci(atoi(argv[1])));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <fibonacci@plt>
lea    0xeb8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @atoi(i8* %8)
%10 = call i32 @fibonacci(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @fibonacci(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
struct correlate {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ freez(struct correlate **);
void correlateFree(struct correlate **pC) { freez(pC); }


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

x86 assembly (clang, -O2):
<correlateFree>:
jmp    1030 <freez@plt>

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

LLVM IR (-O2):
%struct.correlate = type { i32 }
define void @correlateFree(%struct.correlate** %0) {
%2 = tail call i32 @freez(%struct.correlate** %0)
ret void
}
/* Type definitions */
struct kernel_sigset_t {
  int dummy;
};

/* Variables and functions */
int sys_rt_sigprocmask(int, struct kernel_sigset_t const *,
                       struct kernel_sigset_t *, int);
int sys_sigprocmask(int how, const struct kernel_sigset_t *set,
                    struct kernel_sigset_t *oldset) {
  return sys_rt_sigprocmask(how, set, oldset, (64 + 7) / 8);
}


x86 assembly (clang, -O0):
<sys_sigprocmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x8,%ecx
call   1030 <sys_rt_sigprocmask@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_sigprocmask>:
mov    $0x8,%ecx
jmp    1030 <sys_rt_sigprocmask@plt>

LLVM IR (-O0):
%struct.kernel_sigset_t = type { i32 }
define i32 @sys_sigprocmask(i32 %0, %struct.kernel_sigset_t* %1, %struct.kernel_sigset_t* %2) {
%4 = alloca i32
%5 = alloca %struct.kernel_sigset_t*
%6 = alloca %struct.kernel_sigset_t*
store i32 %0, i32* %4
store %struct.kernel_sigset_t* %1, %struct.kernel_sigset_t** %5
store %struct.kernel_sigset_t* %2, %struct.kernel_sigset_t** %6
%7 = load i32, i32* %4
%8 = load %struct.kernel_sigset_t*, %struct.kernel_sigset_t** %5
%9 = load %struct.kernel_sigset_t*, %struct.kernel_sigset_t** %6
%10 = call i32 @sys_rt_sigprocmask(i32 %7, %struct.kernel_sigset_t* %8, %struct.kernel_sigset_t* %9, i32 8)
ret i32 %10
}

LLVM IR (-O2):
%struct.kernel_sigset_t = type { i32 }
define i32 @sys_sigprocmask(i32 %0, %struct.kernel_sigset_t* %1, %struct.kernel_sigset_t* %2) {
%4 = tail call i32 @sys_rt_sigprocmask(i32 %0, %struct.kernel_sigset_t* %1, %struct.kernel_sigset_t* %2, i32 8)
ret i32 %4
}
int validExpression(char *s) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @validExpression(i8* nocapture readnone %0) {
ret i32 1
}
int func(int a, int *b) {
  int result = 0;
  int i;
  for (i = 0; i < a; i++) {
    int temp = (*b);
    *b = *b - 1;
    result += temp;
  }
  return result;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1154 <func+0x54>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1119 <func+0x19>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
test   %edi,%edi
jle    1128 <func+0x28>
mov    (%rsi),%r8d
lea    -0x1(%r8),%eax
lea    -0x1(%rdi),%edx
imul   %edx,%eax
lea    -0x2(%rdi),%ecx
imul   %rdx,%rcx
shr    %rcx
add    %r8d,%eax
mov    %r8d,%edx
sub    %edi,%edx
sub    %ecx,%eax
mov    %edx,(%rsi)
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @func(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = load i32, i32* %1
%6 = add i32 %5, -1
%7 = add nsw i32 %0, -1
%8 = mul i32 %6, %7
%9 = zext i32 %7 to i33
%10 = add nsw i32 %0, -2
%11 = zext i32 %10 to i33
%12 = mul i33 %9, %11
%13 = lshr i33 %12, 1
%14 = trunc i33 %13 to i32
%15 = sub i32 %5, %0
%16 = add i32 %5, %8
%17 = sub i32 %16, %14
store i32 %15, i32* %1
br label %18
18: ; preds = %4, %2
%19 = phi i32 [ %17, %4 ], [ 0, %2 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ Absolute(int);
int /*<<< orphan*/ DEC8(int /*<<< orphan*/);
void OpCEM1(void) { DEC8(Absolute(3)); }


x86 assembly (clang, -O0):
<OpCEM1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1040 <Absolute@plt>
mov    %eax,%edi
call   1030 <DEC8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpCEM1>:
push   %rax
mov    $0x3,%edi
call   1040 <Absolute@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <DEC8@plt>

LLVM IR (-O0):
define void @OpCEM1() {
%1 = call i32 @Absolute(i32 3)
%2 = call i32 @DEC8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @OpCEM1() {
%1 = tail call i32 @Absolute(i32 3)
%2 = tail call i32 @DEC8(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ArgNum();
int /*<<< orphan*/ ExitName(int /*<<< orphan*/);
int /*<<< orphan*/ Me();
int /*<<< orphan*/ SendItem(int /*<<< orphan*/, char *, int /*<<< orphan*/);
void Act_PExit(void) { SendItem(Me(), "%s", ExitName(ArgNum())); }


x86 assembly (clang, -O0):
<Act_PExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <Me@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <ArgNum@plt>
mov    %eax,%edi
call   1030 <ExitName@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%edx
lea    0xe94(%rip),%rsi
call   1040 <SendItem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Act_PExit>:
push   %rbx
xor    %eax,%eax
call   1060 <Me@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <ArgNum@plt>
mov    %eax,%edi
call   1030 <ExitName@plt>
lea    0xea1(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1040 <SendItem@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @Act_PExit() {
%1 = call i32 (...) @Me()
%2 = call i32 (...) @ArgNum()
%3 = call i32 @ExitName(i32 %2)
%4 = call i32 @SendItem(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @Act_PExit() {
%1 = tail call i32 (...) @Me()
%2 = tail call i32 (...) @ArgNum()
%3 = tail call i32 @ExitName(i32 %2)
%4 = tail call i32 @SendItem(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t write(int, void const *, size_t);
size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) {
  return write(((int)stream), ptr, size * nmemb);
}


x86 assembly (clang, -O0):
<fwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
imul   -0x18(%rbp),%rdx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwrite>:
mov    %rdi,%rax
imul   %rsi,%rdx
mov    %ecx,%edi
mov    %rax,%rsi
jmp    1030 <write@plt>

LLVM IR (-O0):
define i64 @fwrite(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load i32*, i32** %8
%10 = ptrtoint i32* %9 to i32
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = mul i64 %12, %13
%15 = call i64 @write(i32 %10, i8* %11, i64 %14)
ret i64 %15
}

LLVM IR (-O2):
define i64 @fwrite(i8* nocapture %0, i64 %1, i64 %2, i32* %3) {
%5 = ptrtoint i32* %3 to i64
%6 = trunc i64 %5 to i32
%7 = mul i64 %2, %1
%8 = tail call i64 @write(i32 %6, i8* %0, i64 %7)
ret i64 %8
}
int(toupper)(int c) { return toupper(c); }


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

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

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

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ sendcmd(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void sendreset() { sendcmd(0xfe, NULL, 0); }


x86 assembly (clang, -O0):
<sendreset>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfe,%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <sendcmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendreset>:
mov    $0xfe,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <sendcmd@plt>

LLVM IR (-O0):
define void @sendreset() {
%1 = call i32 @sendcmd(i32 254, i32* null, i32 0)
ret void
}

LLVM IR (-O2):
define void @sendreset() {
%1 = tail call i32 @sendcmd(i32 254, i32* null, i32 0)
ret void
}
void write_debug_info(const char *format, ...) { return; }


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

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

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

LLVM IR (-O2):
define void @write_debug_info(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bef_pop();
int ins_drp() {
  bef_pop();
  return 1;
}


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

x86 assembly (clang, -O2):
<ins_drp>:
push   %rax
xor    %eax,%eax
call   1030 <bef_pop@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ins_drp() {
%1 = call i32 (...) @bef_pop()
ret i32 1
}

LLVM IR (-O2):
define i32 @ins_drp() {
%1 = tail call i32 (...) @bef_pop()
ret i32 1
}
float atan2f(float y, float x) {}


x86 assembly (clang, -O0):
<atan2f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @atan2f(float %0, float %1) {
ret float undef
}
int mod9_sum(int a) {
  int mod9sum = 0;
  while (a > 0) {
    if (a % 10 != 9) {
      mod9sum += a % 10;
    }
    a = a / 10;
  }
  return mod9sum % 9;
}


x86 assembly (clang, -O0):
<mod9_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1150 <mod9_sum+0x50>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x9,%edx
je     113d <mod9_sum+0x3d>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <mod9_sum+0xe>
mov    -0x8(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod9_sum>:
test   %edi,%edi
jle    1147 <mod9_sum+0x47>
xor    %r8d,%r8d
mov    $0xcccccccd,%r9d
xor    %eax,%eax
nop
mov    %edi,%esi
imul   %r9,%rsi
shr    $0x23,%rsi
lea    (%rsi,%rsi,1),%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %edi,%edx
sub    %ecx,%edx
cmp    $0x9,%edx
cmove  %r8d,%edx
add    %edx,%eax
cmp    $0x9,%edi
mov    %esi,%edi
ja     1110 <mod9_sum+0x10>
mov    %eax,%ecx
imul   $0x38e38e39,%rcx,%rcx
shr    $0x21,%rcx
lea    (%rcx,%rcx,8),%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mod9_sum(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %14
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = phi i32 [ %10, %3 ], [ %0, %1 ]
%6 = urem i32 %5, 10
%7 = icmp eq i32 %6, 9
%8 = select i1 %7, i32 0, i32 %6
%9 = add nuw nsw i32 %8, %4
%10 = udiv i32 %5, 10
%11 = icmp ult i32 %5, 10
br i1 %11, label %12, label %3
12: ; preds = %3
%13 = urem i32 %9, 9
br label %14
14: ; preds = %12, %1
%15 = phi i32 [ 0, %1 ], [ %13, %12 ]
ret i32 %15
}
/* Type definitions */
struct _char_list {
  int dummy;
};

/* Variables and functions */
char *char_list_get_curr(struct _char_list *);
int /*<<< orphan*/ char_list_rm_curr(struct _char_list *);
char *char_list_pop(struct _char_list *_s) {
  char *result = char_list_get_curr(_s);
  char_list_rm_curr(_s);
  return result;
}


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

x86 assembly (clang, -O2):
<char_list_pop>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <char_list_get_curr@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <char_list_rm_curr@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct._char_list = type { i32 }
define i8* @char_list_pop(%struct._char_list* %0) {
%2 = alloca %struct._char_list*
%3 = alloca i8*
store %struct._char_list* %0, %struct._char_list** %2
%4 = load %struct._char_list*, %struct._char_list** %2
%5 = call i8* @char_list_get_curr(%struct._char_list* %4)
store i8* %5, i8** %3
%6 = load %struct._char_list*, %struct._char_list** %2
%7 = call i32 @char_list_rm_curr(%struct._char_list* %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
%struct._char_list = type { i32 }
define i8* @char_list_pop(%struct._char_list* %0) {
%2 = tail call i8* @char_list_get_curr(%struct._char_list* %0)
%3 = tail call i32 @char_list_rm_curr(%struct._char_list* %0)
ret i8* %2
}
void menu(int state) {
  int m = 0;
  int i;
  for (i = 0; i < state; i++)
    ;
}


x86 assembly (clang, -O0):
<menu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1134 <menu+0x34>
jmp    1126 <menu+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <menu+0x15>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @menu(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int so_setboolopt(int, int /*<<< orphan*/, int /*<<< orphan*/, _Bool);
int so_reuseaddr(int fd, _Bool reuseaddr) {
  return so_setboolopt(fd, SOL_SOCKET, SO_REUSEADDR, reuseaddr);
}


x86 assembly (clang, -O0):
<so_reuseaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
and    $0x1,%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
mov    0x2ea2(%rip),%rax
mov    (%rax),%edx
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%ecx
call   1030 <so_setboolopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<so_reuseaddr>:
mov    %esi,%ecx
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
jmp    1030 <so_setboolopt@plt>

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @so_reuseaddr(i32 %0, i1 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
%5 = zext i1 %1 to i8
store i8 %5, i8* %4
%6 = load i32, i32* %3
%7 = load i32, i32* @SOL_SOCKET
%8 = load i32, i32* @SO_REUSEADDR
%9 = load i8, i8* %4
%10 = trunc i8 %9 to i1
%11 = call i32 @so_setboolopt(i32 %6, i32 %7, i32 %8, i1 zeroext %10)
ret i32 %11
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @so_reuseaddr(i32 %0, i1 zeroext %1) {
%3 = load i32, i32* @SOL_SOCKET
%4 = load i32, i32* @SO_REUSEADDR
%5 = tail call i32 @so_setboolopt(i32 %0, i32 %3, i32 %4, i1 zeroext %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
scalar_t__ close(int);
void xclose(int fd) {
  if (close(fd) != 0)
    _exit(12);
}


x86 assembly (clang, -O0):
<xclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
cmp    $0x0,%rax
je     1147 <xclose+0x27>
mov    $0xc,%edi
call   1030 <_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xclose>:
push   %rax
call   1040 <close@plt>
test   %rax,%rax
jne    112d <xclose+0xd>
pop    %rax
ret
mov    $0xc,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @xclose(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @close(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @_exit(i32 12)
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @xclose(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @_exit(i32 12)
unreachable
6: ; preds = %1
ret void
}
/* Variables and functions */
int ksft_exit_pass();
int /*<<< orphan*/ ksft_print_header();
int /*<<< orphan*/ test_membarrier();
int /*<<< orphan*/ test_membarrier_query();
int main(int argc, char **argv) {
  ksft_print_header();
  test_membarrier_query();
  test_membarrier();
  return ksft_exit_pass();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <ksft_print_header@plt>
mov    $0x0,%al
call   1040 <test_membarrier_query@plt>
mov    $0x0,%al
call   1050 <test_membarrier@plt>
mov    $0x0,%al
call   1030 <ksft_exit_pass@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <ksft_print_header@plt>
xor    %eax,%eax
call   1040 <test_membarrier_query@plt>
xor    %eax,%eax
call   1050 <test_membarrier@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ksft_exit_pass@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @ksft_print_header()
%7 = call i32 (...) @test_membarrier_query()
%8 = call i32 (...) @test_membarrier()
%9 = call i32 (...) @ksft_exit_pass()
ret i32 %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ksft_print_header()
%4 = tail call i32 (...) @test_membarrier_query()
%5 = tail call i32 (...) @test_membarrier()
%6 = tail call i32 (...) @ksft_exit_pass()
ret i32 %6
}
/* Variables and functions */
int CopyLinux(char *, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[], char *envp[]) {
  if (argc != 3) {
    printf("Usage: copy <to> <from>\n");
    return -1;
  }
  return CopyLinux(argv[1], argv[2]);
}


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)
mov    %rdx,-0x18(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     115c <main+0x3c>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <main+0x54>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <CopyLinux@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x3,%edi
jne    1134 <main+0x14>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
pop    %rax
jmp    1040 <CopyLinux@plt>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Usage: copy <to> <from>\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 3
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %4
br label %20
12: ; preds = %3
%13 = load i8**, i8*** %6
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = load i8**, i8*** %6
%17 = getelementptr inbounds i8*, i8** %16, i64 2
%18 = load i8*, i8** %17
%19 = call i32 @CopyLinux(i8* %15, i8* %18)
store i32 %19, i32* %4
br label %20
20: ; preds = %12, %10
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
@str = [24 x i8] c"Usage: copy <to> <from>\00"
define i32 @main(i32 %0, i8** nocapture %1, i8** nocapture readnone %2) {
%4 = icmp eq i32 %0, 3
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %13
7: ; preds = %3
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @CopyLinux(i8* %9, i8* %11)
br label %13
13: ; preds = %7, %5
%14 = phi i32 [ -1, %5 ], [ %12, %7 ]
ret i32 %14
}
/* Variables and functions */
int log10(double);
double db(double g) { return 20 * log10(g); }


x86 assembly (clang, -O0):
<db>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log10@plt>
imul   $0x14,%eax,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db>:
push   %rax
call   1030 <log10@plt>
shl    $0x2,%eax
lea    (%rax,%rax,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @db(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @log10(double %3)
%5 = mul nsw i32 20, %4
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @db(double %0) {
%2 = tail call i32 @log10(double %0)
%3 = mul nsw i32 %2, 20
%4 = sitofp i32 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x01() {
  Assert_real((islower(1) == 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_islower.c",
              10, ("islower should be 0 for 0x01"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x01>:
push   %rax
mov    $0x1,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xa,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x01\00"
define void @t_islower_0x01() {
%1 = call i64 @islower(i32 1)
%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 10, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x01\00"
define void @t_islower_0x01() {
%1 = tail call i64 @islower(i32 1)
%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 10, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void module1_section3_topic4() {
  int lol = 1;
  int lel = 0;
  int hah = ((lol && lel) || (0 || 1)) ^ 0;
  printf("lol: %d\n", lol);
  printf("lel: %d\n", lel);
  printf("hah: %d\n", hah);
}


x86 assembly (clang, -O0):
<module1_section3_topic4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113f <module1_section3_topic4+0x2f>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jne    1149 <module1_section3_topic4+0x39>
mov    $0x1,%al
mov    %al,-0xd(%rbp)
jmp    1149 <module1_section3_topic4+0x39>
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
xor    $0x0,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<module1_section3_topic4>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x1,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"lol: %d\0A\00"
@.str.1 = [9 x i8] c"lel: %d\0A\00"
@.str.2 = [9 x i8] c"hah: %d\0A\00"
define void @module1_section3_topic4() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 1, i32* %1
store i32 0, i32* %2
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %6, %0
br label %10
10: ; preds = %9, %6
%11 = phi i1 [ true, %6 ], [ true, %9 ]
%12 = zext i1 %11 to i32
%13 = xor i32 %12, 0
store i32 %13, i32* %3
%14 = load i32, i32* %1
%15 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %2
%17 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %3
%19 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"lol: %d\0A\00"
@.str.1 = [9 x i8] c"lel: %d\0A\00"
@.str.2 = [9 x i8] c"hah: %d\0A\00"
define void @module1_section3_topic4() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 1)
ret void
}
int mm_check_change(struct gendisk *disk) {
  { return (0); }
}


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

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

LLVM IR (-O0):
%struct.gendisk = type opaque
define i32 @mm_check_change(%struct.gendisk* %0) {
%2 = alloca %struct.gendisk*
store %struct.gendisk* %0, %struct.gendisk** %2
ret i32 0
}

LLVM IR (-O2):
%struct.gendisk = type opaque
define i32 @mm_check_change(%struct.gendisk* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
float ANTweenTimingFunctionQuartIn(float, int /*<<< orphan*/, int, float);
float ANTweenProgressTimingFunctionQuartIn(float time, float duration) {
  return ANTweenTimingFunctionQuartIn(time, 0, 1, duration);
}


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

x86 assembly (clang, -O2):
<ANTweenProgressTimingFunctionQuartIn>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <ANTweenTimingFunctionQuartIn@plt>

LLVM IR (-O0):
define float @ANTweenProgressTimingFunctionQuartIn(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 @ANTweenTimingFunctionQuartIn(float %5, i32 0, i32 1, float %6)
ret float %7
}

LLVM IR (-O2):
define float @ANTweenProgressTimingFunctionQuartIn(float %0, float %1) {
%3 = tail call float @ANTweenTimingFunctionQuartIn(float %0, i32 0, i32 1, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x11() {
  Assert_real((isalnum(17) == 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_isalnum.c",
              90, ("isalnum should be 0 for 0x11"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x11>:
push   %rax
mov    $0x11,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x5a,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x11\00"
define void @t_isalnum_0x11() {
%1 = call i64 @isalnum(i32 17)
%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 90, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x11\00"
define void @t_isalnum_0x11() {
%1 = tail call i64 @isalnum(i32 17)
%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 90, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ R_Systeminit();
void HardwareSetup(void) { R_Systeminit(); }


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

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

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

LLVM IR (-O2):
define void @HardwareSetup() {
%1 = tail call i32 (...) @R_Systeminit()
ret void
}
int main() {
  int *array = (int *)malloc(sizeof(int) * 10);
  array = (int[10]){-10, -20, -30, -40, -50, -60, -70, 80, -90, -100};
  printf("Max Number in the array is %d \n", arrayMax(array, 10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x28,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    -0x38(%rbp),%rdi
lea    0x2ed8(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x38(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
mov    $0x0,%al
call   1060 <arrayMax@plt>
mov    %eax,%esi
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movups 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <arrayMax@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@constinit = private global [10 x i32] [i32 -10, i32 -20, i32 -30, i32 -40, i32 -50, i32 -60, i32 -70, i32 80, i32 -90, i32 -100]
@.str = [32 x i8] c"Max Number in the array is %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [10 x i32]
store i32 0, i32* %1
%4 = call i8* @malloc(i64 40)
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %2
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%7 = bitcast [10 x i32]* %3 to i8*
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
store i32* %8, i32** %2
%9 = load i32*, i32** %2
%10 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @arrayMax to i32 (i32*, i32, ...)*)(i32* %9, i32 10)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@constinit = [10 x i32] [i32 -10, i32 -20, i32 -30, i32 -40, i32 -50, i32 -60, i32 -70, i32 80, i32 -90, i32 -100]
@.str = [32 x i8] c"Max Number in the array is %d \0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @arrayMax to i32 (i32*, i32, ...)*)(i32* %3, i32 10)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
double OBJMath_sum(double a, double b) { return a + b; }


x86 assembly (clang, -O0):
<OBJMath_sum>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<OBJMath_sum>:
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @OBJMath_sum(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int spi_transfer_w32(unsigned int *, unsigned int *);
unsigned int small1_ping(unsigned int v) {
  unsigned int CMD = v;
  unsigned int rbuf = 31;
  int ret = spi_transfer_w32(&CMD, &rbuf);
  if (ret)
    error("Cannot write");
  return rbuf;
}


x86 assembly (clang, -O0):
<small1_ping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x1f,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <spi_transfer_w32@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     115e <small1_ping+0x3e>
lea    0xea7(%rip),%rdi
call   1030 <error@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<small1_ping>:
push   %rax
mov    %edi,0x4(%rsp)
movl   $0x1f,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <spi_transfer_w32@plt>
test   %eax,%eax
je     1149 <small1_ping+0x29>
lea    0xebc(%rip),%rdi
call   1030 <error@plt>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"Cannot write\00"
define i32 @small1_ping(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
store i32 %0, i32* %2
%5 = bitcast i32* %3 to i8*
store i32 31, i32* %3
%6 = call i32 @spi_transfer_w32(i32* %2, i32* %3)
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %3
ret i32 %11
}