xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, float *);
float media(int n) {
  float res, temp;
  int i;
  for (i = n; i > 0; --i) {
    scanf("%f", &temp);
    res += temp;
  }
  return res / n;
}


x86 assembly (clang, -O0):
<media>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1158 <media+0x48>
lea    0xece(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <scanf@plt>
movss  -0xc(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1121 <media+0x11>
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<media>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
test   %edi,%edi
jle    1155 <media+0x45>
lea    0x1(%r14),%ebp
lea    0xed7(%rip),%r15
lea    0x4(%rsp),%rbx
xchg   %ax,%ax
movss  %xmm0,(%rsp)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
movss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <media+0x20>
jmp    1155 <media+0x45>
cvtsi2ss %r14d,%xmm1
divss  %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define float @media(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
store i32 %6, i32* %5
br label %7
7: ; preds = %15, %1
%8 = load i32, i32* %5
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %4)
%12 = load float, float* %4
%13 = load float, float* %3
%14 = fadd float %13, %12
store float %14, float* %3
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, -1
store i32 %17, i32* %5
br label %7
18: ; preds = %7
%19 = load float, float* %3
%20 = load i32, i32* %2
%21 = sitofp i32 %20 to float
%22 = fdiv float %19, %21
ret float %22
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define float @media(i32 %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %13
5: ; preds = %1, %5
%6 = phi i32 [ %11, %5 ], [ %0, %1 ]
%7 = phi float [ %10, %5 ], [ undef, %1 ]
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%9 = load float, float* %2
%10 = fadd float %7, %9
%11 = add nsw i32 %6, -1
%12 = icmp ugt i32 %6, 1
br i1 %12, label %5, label %13
13: ; preds = %5, %1
%14 = phi float [ undef, %1 ], [ %10, %5 ]
%15 = sitofp i32 %0 to float
%16 = fdiv float %14, %15
ret float %16
}
/* Variables and functions */
int minitest_fail(char const *, char const *, int);
int minitest_pass(char const *);
int assert_int_equal(int expected, int actual, const char *msg,
                     const char *caller, int line) {
  if (expected == actual) {
    return minitest_pass(msg);
  } else {
    return minitest_fail(msg, caller, line);
  }
}


x86 assembly (clang, -O0):
<assert_int_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1157 <assert_int_equal+0x37>
mov    -0x18(%rbp),%rdi
call   1030 <minitest_pass@plt>
mov    %eax,-0x4(%rbp)
jmp    116a <assert_int_equal+0x4a>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1040 <minitest_fail@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_int_equal>:
cmp    %esi,%edi
jne    112c <assert_int_equal+0xc>
mov    %rdx,%rdi
jmp    1030 <minitest_pass@plt>
mov    %rdx,%rdi
mov    %rcx,%rsi
mov    %r8d,%edx
jmp    1040 <minitest_fail@plt>

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

LLVM IR (-O2):
define i32 @assert_int_equal(i32 %0, i32 %1, i8* %2, i8* %3, i32 %4) {
%6 = icmp eq i32 %0, %1
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 @minitest_pass(i8* %2)
br label %11
9: ; preds = %5
%10 = tail call i32 @minitest_fail(i8* %2, i8* %3, i32 %4)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
ret i32 %12
}
__attribute__((always_)) double x264_clip3f(double v, double f_min,
                                            double f_max) {
  return ((v < f_min) ? f_min : (v > f_max) ? f_max : v);
}


x86 assembly (clang, -O0):
<x264_clip3f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <x264_clip3f+0x36>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1169 <x264_clip3f+0x69>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1155 <x264_clip3f+0x55>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    115f <x264_clip3f+0x5f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<x264_clip3f>:
minsd  %xmm0,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @x264_clip3f(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fcmp olt double %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load double, double* %5
br label %22
12: ; preds = %3
%13 = load double, double* %4
%14 = load double, double* %6
%15 = fcmp ogt double %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load double, double* %6
br label %20
18: ; preds = %12
%19 = load double, double* %4
br label %20
20: ; preds = %18, %16
%21 = phi double [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi double [ %11, %10 ], [ %21, %20 ]
ret double %23
}

LLVM IR (-O2):
define double @x264_clip3f(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %2, double %0
%7 = select i1 %4, double %1, double %6
ret double %7
}
/* Type definitions */
struct addrinfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
int /*<<< orphan*/ getaddrinfo(char *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *, struct addrinfo **);
void memleak_getaddrinfo() {
  struct addrinfo *res = NULL;
  getaddrinfo("node", NULL, NULL, &res);
  freeaddrinfo(res);
}


x86 assembly (clang, -O0):
<memleak_getaddrinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
lea    0xec9(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
lea    -0x8(%rbp),%rcx
mov    %rdx,%rsi
call   1030 <getaddrinfo@plt>
mov    -0x8(%rbp),%rdi
call   1040 <freeaddrinfo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memleak_getaddrinfo>:
push   %rax
movq   $0x0,(%rsp)
lea    0xed0(%rip),%rdi
mov    %rsp,%rcx
xor    %esi,%esi
xor    %edx,%edx
call   1030 <getaddrinfo@plt>
mov    (%rsp),%rdi
call   1040 <freeaddrinfo@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.addrinfo = type { i32 }
@.str = [5 x i8] c"node\00"
define void @memleak_getaddrinfo() {
%1 = alloca %struct.addrinfo*
store %struct.addrinfo* null, %struct.addrinfo** %1
%2 = call i32 @getaddrinfo(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* null, i32* null, %struct.addrinfo** %1)
%3 = load %struct.addrinfo*, %struct.addrinfo** %1
%4 = call i32 @freeaddrinfo(%struct.addrinfo* %3)
ret void
}

LLVM IR (-O2):
%struct.addrinfo = type { i32 }
@.str = [5 x i8] c"node\00"
define void @memleak_getaddrinfo() {
%1 = alloca %struct.addrinfo*
%2 = bitcast %struct.addrinfo** %1 to i8*
store %struct.addrinfo* null, %struct.addrinfo** %1
%3 = call i32 @getaddrinfo(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* null, i32* null, %struct.addrinfo** %1)
%4 = load %struct.addrinfo*, %struct.addrinfo** %1
%5 = call i32 @freeaddrinfo(%struct.addrinfo* %4)
ret void
}
void dpm_runtime_resume(struct device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define void @dpm_runtime_resume(%struct.device* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hal_system_reset();
void _exit(int status) { hal_system_reset(); }


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <hal_system_reset@plt>

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

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @hal_system_reset()
unreachable
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
%2 = tail call i32 (...) @hal_system_reset()
unreachable
}
/* Variables and functions */
int getLine(char *);
int /*<<< orphan*/ printf(char *, int, char *);
void main() {
  char line[100];
  int length;
  while ((length = getLine(line)) > 0) {
    printf("%d: %s\n", length, line);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x70(%rbp),%rdi
call   1040 <getLine@plt>
mov    %eax,-0x74(%rbp)
cmp    $0x0,%eax
jle    1158 <main+0x38>
mov    -0x74(%rbp),%esi
lea    -0x70(%rbp),%rdx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <main+0xb>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rsp,%rdi
call   1040 <getLine@plt>
test   %eax,%eax
jle    1159 <main+0x39>
lea    0xec6(%rip),%r14
mov    %rsp,%rbx
nopl   (%rax)
mov    %r14,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <getLine@plt>
test   %eax,%eax
jg     1140 <main+0x20>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%d: %s\0A\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca i32
br label %3
3: ; preds = %7, %0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i32 @getLine(i8* %4)
store i32 %5, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = load i32, i32* %2
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %9)
br label %3
11: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d: %s\0A\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @getLine(i8* %2)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = phi i32 [ %8, %5 ], [ %3, %0 ]
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %2)
%8 = call i32 @getLine(i8* %2)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int get_account_no(int *customer_account_no) {
  int err = 0;
  printf("Account Number: ");
  scanf("%d", customer_account_no);
  return err;
}


x86 assembly (clang, -O0):
<get_account_no>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xec7(%rip),%rdi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_account_no>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Account Number: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @get_account_no(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@.str = [17 x i8] c"Account Number: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @get_account_no(i32* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %0)
ret i32 0
}
void func4(void) {
  asm("    .global "
      "set_tracepoint"
      "\n"
      "set_tracepoint"
      ":\n"
      "    call "
      "x86_trace_dummy"
      "\n");
}


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

x86 assembly (clang, -O2):
<func4>:
call   1030 <x86_trace_dummy@plt>
ret

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

LLVM IR (-O2):
define void @func4() {
tail call void asm sideeffect " .global set_tracepoint\0Aset_tracepoint:\0A call x86_trace_dummy\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
scalar_t__ __builtin_j1(double);
int /*<<< orphan*/ link_failure_builtin_j1();
void test_builtin_j1(double d) {
  if (__builtin_j1(d) != __builtin_j1(d))
    link_failure_builtin_j1();
}


x86 assembly (clang, -O0):
<test_builtin_j1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__builtin_j1@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__builtin_j1@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_builtin_j1+0x3c>
mov    $0x0,%al
call   1040 <link_failure_builtin_j1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_j1>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <__builtin_j1@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <__builtin_j1@plt>
cmp    %rax,%rbx
jne    1149 <test_builtin_j1+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_builtin_j1@plt>

LLVM IR (-O0):
define void @test_builtin_j1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @__builtin_j1(double %3)
%5 = load double, double* %2
%6 = call i64 @__builtin_j1(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_builtin_j1()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_builtin_j1(double %0) {
%2 = tail call i64 @__builtin_j1(double %0)
%3 = tail call i64 @__builtin_j1(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_j1()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int is_oct(const char *arg, size_t len) {
  return (arg[0] == '0' || (len > 1 && arg[0] == '-' && arg[1] == '0'));
}


x86 assembly (clang, -O0):
<is_oct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x30,%ecx
mov    %al,-0x11(%rbp)
je     115d <is_oct+0x5d>
xor    %eax,%eax
cmpq   $0x1,-0x10(%rbp)
mov    %al,-0x12(%rbp)
jbe    1157 <is_oct+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0x12(%rbp)
jne    1157 <is_oct+0x57>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x30,%eax
sete   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_oct>:
mov    (%rdi),%cl
mov    $0x1,%eax
cmp    $0x30,%cl
je     1122 <is_oct+0x22>
xor    %eax,%eax
cmp    $0x2,%rsi
jb     1122 <is_oct+0x22>
cmp    $0x2d,%cl
jne    1122 <is_oct+0x22>
xor    %eax,%eax
cmpb   $0x30,0x1(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_oct(i8* nocapture %0, i64 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 48
br i1 %4, label %14, label %5
5: ; preds = %2
%6 = icmp ugt i64 %1, 1
%7 = icmp eq i8 %3, 45
%8 = select i1 %6, i1 %7, i1 false
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 48
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %5, %9, %2
%15 = phi i32 [ 1, %2 ], [ 0, %5 ], [ %13, %9 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ gl2psMsg(int, char *);
void *malloc(size_t);
void *gl2psMalloc(size_t size) {
  void *ptr;
  if (!size)
    return (NULL);
  ptr = malloc(size);
  if (!ptr) {
    gl2psMsg(3, "Couldn't allocate requested memory");
    exit(1);
  }
  return (ptr);
}


x86 assembly (clang, -O0):
<gl2psMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <gl2psMalloc+0x24>
movq   $0x0,-0x8(%rbp)
jmp    118f <gl2psMalloc+0x5f>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1187 <gl2psMalloc+0x57>
mov    $0x3,%edi
lea    0xe88(%rip),%rsi
call   1030 <gl2psMsg@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gl2psMalloc>:
push   %rax
test   %rdi,%rdi
je     1142 <gl2psMalloc+0x12>
call   1040 <malloc@plt>
test   %rax,%rax
je     1146 <gl2psMalloc+0x16>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb3(%rip),%rsi
mov    $0x3,%edi
call   1030 <gl2psMsg@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Couldn't allocate requested memory\00"
define i8* @gl2psMalloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp ne i64 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* null, i8** %2
br label %18
8: ; preds = %1
%9 = load i64, i64* %3
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %16, label %13
13: ; preds = %8
%14 = call i32 @gl2psMsg(i32 3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %8
%17 = load i8*, i8** %4
store i8* %17, i8** %2
br label %18
18: ; preds = %16, %7
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
@.str = [35 x i8] c"Couldn't allocate requested memory\00"
define noalias i8* @gl2psMalloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @gl2psMsg(i32 3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3, %1
%10 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %10
}
int main() {
  int c = 10;
  printf("main %d %d\n", c, &c);
  calcula(&c);
  printf("main %d %d\n", c, &c);
}


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

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0xa,0x4(%rsp)
lea    0xecd(%rip),%r14
lea    0x4(%rsp),%rbx
mov    %r14,%rdi
mov    $0xa,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <calcula@plt>
mov    0x4(%rsp),%esi
mov    %r14,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"main %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 10, i32* %1
%2 = load i32, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2, i32* %1)
%4 = call i32 (i32*, ...) bitcast (i32 (...)* @calcula to i32 (i32*, ...)*)(i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5, i32* %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"main %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 10, i32* %1)
%4 = call i32 (i32*, ...) bitcast (i32 (...)* @calcula to i32 (i32*, ...)*)(i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5, i32* %1)
ret i32 0
}
void ag7240_phy_speed(int unit, int *speed) {
  {}
}


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

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

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

LLVM IR (-O2):
define void @ag7240_phy_speed(i32 %0, i32* nocapture %1) {
ret void
}
void *_______size_helper(void *soFarParam, void *currentValue) {
  unsigned int *soFar = (unsigned int *)soFarParam;
  (void)currentValue;
  unsigned int prev = *soFar;
  *soFar = prev + 1;
  return soFar;
}


x86 assembly (clang, -O0):
<_______size_helper>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_______size_helper>:
mov    %rdi,%rax
addl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define i8* @_______size_helper(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = add i32 %12, 1
%14 = load i32*, i32** %5
store i32 %13, i32* %14
%15 = load i32*, i32** %5
%16 = bitcast i32* %15 to i8*
ret i8* %16
}

LLVM IR (-O2):
define i8* @_______size_helper(i8* returned %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = add i32 %4, 1
store i32 %5, i32* %3
ret i8* %0
}
int exact_sqare(int number) {
  int a;
  for (a = 0; a <= number; a++) {
    if (number == a * a) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<exact_sqare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     114b <exact_sqare+0x4b>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
jne    1138 <exact_sqare+0x38>
movl   $0x1,-0x4(%rbp)
jmp    1152 <exact_sqare+0x52>
jmp    113d <exact_sqare+0x3d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <exact_sqare+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_sqare>:
test   %edi,%edi
js     1120 <exact_sqare+0x20>
lea    0x1(%rdi),%eax
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %ecx,%edx
imul   %ecx,%edx
cmp    %edi,%edx
je     1123 <exact_sqare+0x23>
add    $0x1,%ecx
cmp    %ecx,%eax
jne    1110 <exact_sqare+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @exact_sqare(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %10, label %6
3: ; preds = %6
%4 = add nuw i32 %7, 1
%5 = icmp eq i32 %7, %0
br i1 %5, label %10, label %6
6: ; preds = %1, %3
%7 = phi i32 [ %4, %3 ], [ 0, %1 ]
%8 = mul nsw i32 %7, %7
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %6, %3, %1
%11 = phi i32 [ 0, %1 ], [ 0, %3 ], [ 1, %6 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
scalar_t__ sieve(int /*<<< orphan*/);
int main() {
  int *a = (int *)sieve((uint32_t)100000000);
  printf("%d\n", (int)*a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5f5e100,%edi
call   1040 <sieve@plt>
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i64 @sieve(i32 100000000)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i64 @sieve(i32 100000000)
%2 = inttoptr i64 %1 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xde() {
  Assert_real((isupper(222) == 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_isupper.c",
              1115, ("isupper should be 0 for 0xde"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0xde>:
push   %rax
mov    $0xde,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x45b,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xde\00"
define void @t_isupper_0xde() {
%1 = call i64 @isupper(i32 222)
%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 1115, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xde\00"
define void @t_isupper_0xde() {
%1 = tail call i64 @isupper(i32 222)
%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 1115, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ isnan(double);
double fixnan(double x) { return (isnan(x) ? 0. : x); }


x86 assembly (clang, -O0):
<fixnan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
je     113e <fixnan+0x2e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1148 <fixnan+0x38>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixnan>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <isnan@plt>
movsd  (%rsp),%xmm0
test   %rax,%rax
je     1128 <fixnan+0x18>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @fixnan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @isnan(double %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %9
7: ; preds = %1
%8 = load double, double* %2
br label %9
9: ; preds = %7, %6
%10 = phi double [ 0.000000e+00, %6 ], [ %8, %7 ]
ret double %10
}

LLVM IR (-O2):
define double @fixnan(double %0) {
%2 = tail call i64 @isnan(double %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, double %0, double 0.000000e+00
ret double %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t _ror(uint32_t v, int n) { return (v >> n) | (v << (32 - n)); }


x86 assembly (clang, -O0):
<_ror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ror>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @_ror(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @_ror(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_matrix(float **m, long nrl, long nrh, long ncl, long nch) {
  free((void *)(m[nrl] + ncl - 1));
  free((void *)(m + nrl - 1));
}


x86 assembly (clang, -O0):
<free_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_matrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
lea    (%rax,%rcx,4),%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_matrix(float** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds float*, float** %0, i64 %1
%7 = load float*, float** %6
%8 = getelementptr inbounds float, float* %7, i64 %3
%9 = getelementptr inbounds float, float* %8, i64 -1
%10 = bitcast float* %9 to i8*
%11 = tail call i32 @free(i8* %10)
%12 = getelementptr inbounds float*, float** %6, i64 -1
%13 = bitcast float** %12 to i8*
%14 = tail call i32 @free(i8* %13)
ret void
}
int base64contraction(int len) { return (len / 4 + (len % 4 != 0)) * 3; }


x86 assembly (clang, -O0):
<base64contraction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
cmp    $0x0,%edx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
imul   $0x3,%eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64contraction>:
lea    0x3(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x2,%eax
and    $0x3,%edi
cmp    $0x1,%edi
sbb    $0xffffffff,%eax
lea    (%rax,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @base64contraction(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 4
%5 = load i32, i32* %2
%6 = srem i32 %5, 4
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
%9 = add nsw i32 %4, %8
%10 = mul nsw i32 %9, 3
ret i32 %10
}

LLVM IR (-O2):
define i32 @base64contraction(i32 %0) {
%2 = sdiv i32 %0, 4
%3 = and i32 %0, 3
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = add nsw i32 %2, %5
%7 = mul nsw i32 %6, 3
ret i32 %7
}
/* Type definitions */
struct mountinfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_mountinfo(struct mountinfo *);
void cleanup_mountinfo(struct mountinfo **ptr) {
  if (*ptr != NULL) {
    free_mountinfo(*ptr);
    *ptr = NULL;
  }
}


x86 assembly (clang, -O0):
<cleanup_mountinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1141 <cleanup_mountinfo+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free_mountinfo@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_mountinfo>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <cleanup_mountinfo+0x18>
call   1030 <free_mountinfo@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.mountinfo = type { i32 }
define void @cleanup_mountinfo(%struct.mountinfo** %0) {
%2 = alloca %struct.mountinfo**
store %struct.mountinfo** %0, %struct.mountinfo*** %2
%3 = load %struct.mountinfo**, %struct.mountinfo*** %2
%4 = load %struct.mountinfo*, %struct.mountinfo** %3
%5 = icmp ne %struct.mountinfo* %4, null
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load %struct.mountinfo**, %struct.mountinfo*** %2
%8 = load %struct.mountinfo*, %struct.mountinfo** %7
%9 = call i32 @free_mountinfo(%struct.mountinfo* %8)
%10 = load %struct.mountinfo**, %struct.mountinfo*** %2
store %struct.mountinfo* null, %struct.mountinfo** %10
br label %11
11: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.mountinfo = type { i32 }
define void @cleanup_mountinfo(%struct.mountinfo** nocapture %0) {
%2 = load %struct.mountinfo*, %struct.mountinfo** %0
%3 = icmp eq %struct.mountinfo* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free_mountinfo(%struct.mountinfo* %2)
store %struct.mountinfo* null, %struct.mountinfo** %0
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void set_pmu_sleep_radio() {
  mbus_remote_register_write(0x3, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (14 << 9) | (14 << 5) | (1)));
  delay(100);
  mbus_remote_register_write(0x3, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (14 << 9) | (14 << 5) | (1)));
  delay(100);
  mbus_remote_register_write(
      0x3, 0x17, ((3 << 14) | (0 << 13) | (2 << 9) | (3 << 5) | (1)));
  delay(100);
}


x86 assembly (clang, -O0):
<set_pmu_sleep_radio>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x15,%esi
mov    $0xddc1,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x3,%edi
mov    $0x15,%esi
mov    $0xddc1,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x3,%edi
mov    $0x17,%esi
mov    $0xc461,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pmu_sleep_radio>:
push   %rax
mov    $0x3,%edi
mov    $0x15,%esi
mov    $0xddc1,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x3,%edi
mov    $0x15,%esi
mov    $0xddc1,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x3,%edi
mov    $0x17,%esi
mov    $0xc461,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @set_pmu_sleep_radio() {
%1 = call i32 @mbus_remote_register_write(i32 3, i32 21, i32 56769)
%2 = call i32 @delay(i32 100)
%3 = call i32 @mbus_remote_register_write(i32 3, i32 21, i32 56769)
%4 = call i32 @delay(i32 100)
%5 = call i32 @mbus_remote_register_write(i32 3, i32 23, i32 50273)
%6 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @set_pmu_sleep_radio() {
%1 = tail call i32 @mbus_remote_register_write(i32 3, i32 21, i32 56769)
%2 = tail call i32 @delay(i32 100)
%3 = tail call i32 @mbus_remote_register_write(i32 3, i32 21, i32 56769)
%4 = tail call i32 @delay(i32 100)
%5 = tail call i32 @mbus_remote_register_write(i32 3, i32 23, i32 50273)
%6 = tail call i32 @delay(i32 100)
ret void
}
int __open(const char *filename, int mode, int filemode) {
  long __res, dummy;
  __asm__ __volatile__("int $0x80"
                       : "=a"(__res), "=&b"(dummy)
                       : "0"(5), "1"((long)(filename)), "c"((long)(mode)),
                         "d"((long)(filemode)));
  return (int)__res;
}


x86 assembly (clang, -O0):
<__open>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rbx
movslq -0x14(%rbp),%rcx
movslq -0x18(%rbp),%rdx
mov    $0x5,%eax
int    $0x80
mov    %rax,-0x20(%rbp)
mov    %rbx,-0x28(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__open>:
push   %rbx
mov    %rdi,%rbx
movslq %esi,%rcx
movslq %edx,%rdx
mov    $0x5,%eax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define i32 @__open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = call { i64, i64 } asm sideeffect "int $$0x80", "={ax},=&{bx},0,1,{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i64 5, i64 %10, i64 %12, i64 %14)
%16 = extractvalue { i64, i64 } %15, 0
%17 = extractvalue { i64, i64 } %15, 1
store i64 %16, i64* %7
store i64 %17, i64* %8
%18 = load i64, i64* %7
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @__open(i8* %0, i32 %1, i32 %2) {
%4 = ptrtoint i8* %0 to i64
%5 = sext i32 %1 to i64
%6 = sext i32 %2 to i64
%7 = tail call { i64, i64 } asm sideeffect "int $$0x80", "={ax},=&{bx},0,1,{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i64 5, i64 %4, i64 %5, i64 %6)
%8 = extractvalue { i64, i64 } %7, 0
%9 = trunc i64 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x8f() {
  Assert_real((isdigit(143) == 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_isdigit.c",
              720, ("isdigit should be 0 for 0x8f"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x8f>:
push   %rax
mov    $0x8f,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2d0,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x8f\00"
define void @t_isdigit_0x8f() {
%1 = call i64 @isdigit(i32 143)
%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 720, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x8f\00"
define void @t_isdigit_0x8f() {
%1 = tail call i64 @isdigit(i32 143)
%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 720, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
curinvis() {}


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

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

LLVM IR (-O0):
define i32 @curinvis() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @curinvis() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void help_invalid_mode(const char *mode) {
  printf("chmod: invalid mode: '%s'\n"
         "Try 'chmod -h' for more information.\n",
         mode);
}


x86 assembly (clang, -O0):
<help_invalid_mode>:
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):
<help_invalid_mode>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [64 x i8] c"chmod: invalid mode: '%s'\0ATry 'chmod -h' for more information.\0A\00"
define void @help_invalid_mode(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [64 x i8] c"chmod: invalid mode: '%s'\0ATry 'chmod -h' for more information.\0A\00"
define void @help_invalid_mode(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_letter_distribution_diagram(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char string[100];
  scanf("%[^\n]s", string);
  create_letter_distribution_diagram(string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <create_letter_distribution_diagram@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xed4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <create_letter_distribution_diagram@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%[^\0A]s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = call i32 @create_letter_distribution_diagram(i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @create_letter_distribution_diagram(i8* %2)
ret i32 0
}