xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(unsigned long *);
void FreeMemory(void *ptr) {
  unsigned long int *memid;
  memid = (unsigned long int *)((char *)ptr - sizeof(unsigned long int));
  if (*memid == 0x12345678l) {
    free(memid);
  }
}


x86 assembly (clang, -O0):
<FreeMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x12345678,(%rax)
jne    1142 <FreeMemory+0x32>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeMemory>:
cmpq   $0x12345678,-0x8(%rdi)
12
jne    1123 <FreeMemory+0x13>
add    $0xfffffffffffffff8,%rdi
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @FreeMemory(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 -8
%6 = bitcast i8* %5 to i64*
store i64* %6, i64** %3
%7 = load i64*, i64** %3
%8 = load i64, i64* %7
%9 = icmp eq i64 %8, 305419896
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i64*, i64** %3
%12 = call i32 @free(i64* %11)
br label %13
13: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
define void @FreeMemory(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -8
%3 = bitcast i8* %2 to i64*
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 305419896
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @free(i64* %3)
br label %8
8: ; preds = %6, %1
ret void
}
/* Variables and functions */
int Get_Word();
int Get_Long(void) {
  int i;
  int tmp;
  {
    i = Get_Word();
    tmp = Get_Word();
    return ((i << 16) | tmp);
  }
}


x86 assembly (clang, -O0):
<Get_Long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Get_Word@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Get_Word@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
or     -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Get_Long>:
push   %rbx
xor    %eax,%eax
call   1030 <Get_Word@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <Get_Word@plt>
shl    $0x10,%ebx
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Get_Long() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @Get_Word()
store i32 %3, i32* %1
%4 = call i32 (...) @Get_Word()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = shl i32 %5, 16
%7 = load i32, i32* %2
%8 = or i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @Get_Long() {
%1 = tail call i32 (...) @Get_Word()
%2 = tail call i32 (...) @Get_Word()
%3 = shl i32 %1, 16
%4 = or i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ANATOP_EVENT1_DriverIRQHandler();
__attribute__((weak)) void ANATOP_EVENT1_IRQHandler(void) {
  ANATOP_EVENT1_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @ANATOP_EVENT1_IRQHandler() {
%1 = call i32 (...) @ANATOP_EVENT1_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @ANATOP_EVENT1_IRQHandler() {
%1 = tail call i32 (...) @ANATOP_EVENT1_DriverIRQHandler()
ret void
}
void screen(char mode) { mode; }


x86 assembly (clang, -O0):
<screen>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @screen(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret void
}

LLVM IR (-O2):
define void @screen(i8 signext %0) {
ret void
}
int op_left_assoc(const char c) {
  switch (c) {
  case '|':
  case '&':
    return 1;
  case '!':
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<op_left_assoc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x21,%eax
je     114d <op_left_assoc+0x4d>
jmp    111f <op_left_assoc+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x26,%eax
je     1141 <op_left_assoc+0x41>
jmp    1130 <op_left_assoc+0x30>
mov    -0xc(%rbp),%eax
sub    $0x7c,%eax
jne    1159 <op_left_assoc+0x59>
jmp    1141 <op_left_assoc+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1160 <op_left_assoc+0x60>
movl   $0x0,-0x4(%rbp)
jmp    1160 <op_left_assoc+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_left_assoc>:
mov    $0x1,%eax
cmp    $0x7c,%edi
je     1114 <op_left_assoc+0x14>
cmp    $0x26,%edi
je     1114 <op_left_assoc+0x14>
cmp    $0x21,%edi
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @op_left_assoc(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %8 [
i32 124, label %6
i32 38, label %6
i32 33, label %7
]
6: ; preds = %1, %1
store i32 1, i32* %2
br label %9
7: ; preds = %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7, %6
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @op_left_assoc(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %4 [
i32 124, label %5
i32 38, label %5
i32 33, label %3
]
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %1, %4, %3
%6 = phi i32 [ 0, %4 ], [ 0, %3 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *);
void *handle_quit_enter(void *a) {
  printf("Press Enter to Quit\n");
  if (getchar()) {
    printf("Bye\n");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<handle_quit_enter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
cmp    $0x0,%rax
je     116c <handle_quit_enter+0x3c>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_quit_enter>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
test   %rax,%rax
jne    114b <handle_quit_enter+0x1b>
pop    %rcx
ret
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Press Enter to Quit\0A\00"
@.str.1 = [5 x i8] c"Bye\0A\00"
define i8* @handle_quit_enter(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = call i64 (...) @getchar()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %1
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@str = [20 x i8] c"Press Enter to Quit\00"
@str.2 = [4 x i8] c"Bye\00"
define noalias i8* @handle_quit_enter(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%3 = tail call i64 (...) @getchar()
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.2, i64 0, i64 0))
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %1
ret i8* undef
}
void slog(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @slog(i8* nocapture %0, ...) {
ret void
}
long long *john(long long n) {}


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

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

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

LLVM IR (-O2):
define noalias i64* @john(i64 %0) {
ret i64* undef
}
/* Variables and functions */
int pow(double, int);
double Vfunc_beta(double x, double nu, double beta) {
  return 1. / nu * x * (1. - x) * pow(beta + 1, 2) / (4 * beta);
}


x86 assembly (clang, -O0):
<Vfunc_beta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xed9(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xec7(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeb1(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  -0x20(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe85(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vfunc_beta>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  0xede(%rip),%xmm4
movapd %xmm4,%xmm3
divsd  %xmm1,%xmm3
mulsd  %xmm0,%xmm3
movapd %xmm2,%xmm1
addsd  %xmm4,%xmm1
subsd  %xmm0,%xmm4
mulsd  %xmm3,%xmm4
movsd  %xmm4,0x8(%rsp)
movapd %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0xe9b(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @Vfunc_beta(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* %5
%8 = fdiv double 1.000000e+00, %7
%9 = load double, double* %4
%10 = fmul double %8, %9
%11 = load double, double* %4
%12 = fsub double 1.000000e+00, %11
%13 = fmul double %10, %12
%14 = load double, double* %6
%15 = fadd double %14, 1.000000e+00
%16 = call i32 @pow(double %15, i32 2)
%17 = sitofp i32 %16 to double
%18 = fmul double %13, %17
%19 = load double, double* %6
%20 = fmul double 4.000000e+00, %19
%21 = fdiv double %18, %20
ret double %21
}

LLVM IR (-O2):
define double @Vfunc_beta(double %0, double %1, double %2) {
%4 = fdiv double 1.000000e+00, %1
%5 = fmul double %4, %0
%6 = fsub double 1.000000e+00, %0
%7 = fmul double %6, %5
%8 = fadd double %2, 1.000000e+00
%9 = tail call i32 @pow(double %8, i32 2)
%10 = sitofp i32 %9 to double
%11 = fmul double %7, %10
%12 = fmul double %2, 4.000000e+00
%13 = fdiv double %11, %12
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xa8() {
  Assert_real((isupper(168) == 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",
              845, ("isupper should be 0 for 0xa8"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0xa8>:
push   %rax
mov    $0xa8,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x34d,%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 0xa8\00"
define void @t_isupper_0xa8() {
%1 = call i64 @isupper(i32 168)
%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 845, 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 0xa8\00"
define void @t_isupper_0xa8() {
%1 = tail call i64 @isupper(i32 168)
%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 845, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ runTest(int, char **);
int main(int argc, char **argv) {
  runTest(argc, argv);
  return EXIT_SUCCESS;
}


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <runTest@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <runTest@plt>
mov    0x2ec3(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @runTest(i32 %6, i8** %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @runTest(i32 %0, i8** %1)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
int mystery(int a, int b) {
  if (b == 1) {
    return a;
  } else {
    return a + mystery(a, b - 1);
  }
}


x86 assembly (clang, -O0):
<mystery>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1133 <mystery+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <mystery+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <mystery@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystery>:
lea    -0x1(%rsi),%ecx
imul   %edi,%ecx
xor    %eax,%eax
cmp    $0x1,%esi
cmovne %ecx,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @mystery(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 1
%4 = add i32 %1, -1
%5 = mul i32 %4, %0
%6 = select i1 %3, i32 0, i32 %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ OPENSSL_free(char *);
unsigned char *aokex_malloc(scalar_t__);
int /*<<< orphan*/ strcpy(unsigned char *, char *);
scalar_t__ strlen(char *);
char *openssl_to_aokex_str(char *src) {
  unsigned char *ret = aokex_malloc(strlen(src) + 1);
  strcpy(ret, src);
  OPENSSL_free(src);
  return ret;
}


x86 assembly (clang, -O0):
<openssl_to_aokex_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <aokex_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
call   1060 <OPENSSL_free@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openssl_to_aokex_str>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <aokex_malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1060 <OPENSSL_free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @openssl_to_aokex_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @aokex_malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %2
%12 = call i32 @OPENSSL_free(i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @openssl_to_aokex_str(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @aokex_malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
%6 = tail call i32 @OPENSSL_free(i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void rootstate_dealloc(void *arg) { abort(); }


x86 assembly (clang, -O0):
<rootstate_dealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

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

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

LLVM IR (-O2):
define void @rootstate_dealloc(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
unsigned int bigbinary2ui(char *binary) {
  unsigned int result = 0;
  int len = sizeof(result);
  unsigned int exp = 1;
  int i;
  for (i = len - 1; i >= 0; --i) {
    result += binary[i] * exp;
    exp <<= 8;
  }
  return result;
}


x86 assembly (clang, -O0):
<bigbinary2ui>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     115d <bigbinary2ui+0x5d>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
imul   -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1126 <bigbinary2ui+0x26>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigbinary2ui>:
movsbl 0x3(%rdi),%eax
movsbl 0x2(%rdi),%ecx
shl    $0x8,%ecx
add    %eax,%ecx
movsbl 0x1(%rdi),%edx
shl    $0x10,%edx
add    %ecx,%edx
movzbl (%rdi),%eax
shl    $0x18,%eax
add    %edx,%eax
ret

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

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

/* Variables and functions */
int __infer_nondet_int();
int iswxdigit(wint_t wc) { return __infer_nondet_int(); }


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

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

LLVM IR (-O0):
define i32 @iswxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @__infer_nondet_int()
ret i32 %3
}

LLVM IR (-O2):
define i32 @iswxdigit(i32 %0) {
%2 = tail call i32 (...) @__infer_nondet_int()
ret i32 %2
}
/* Type definitions */
struct cvmx_shmem_dscptr {
  int dummy;
};

/* Variables and functions */
int __cvmx_shmem_close_dscptr(struct cvmx_shmem_dscptr *, int);
int __cvmx_shmem_close_standalone(struct cvmx_shmem_dscptr *dscptr,
                                  int remove) {
  return __cvmx_shmem_close_dscptr(dscptr, remove);
}


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

x86 assembly (clang, -O2):
<__cvmx_shmem_close_standalone>:
jmp    1030 <__cvmx_shmem_close_dscptr@plt>

LLVM IR (-O0):
%struct.cvmx_shmem_dscptr = type { i32 }
define i32 @__cvmx_shmem_close_standalone(%struct.cvmx_shmem_dscptr* %0, i32 %1) {
%3 = alloca %struct.cvmx_shmem_dscptr*
%4 = alloca i32
store %struct.cvmx_shmem_dscptr* %0, %struct.cvmx_shmem_dscptr** %3
store i32 %1, i32* %4
%5 = load %struct.cvmx_shmem_dscptr*, %struct.cvmx_shmem_dscptr** %3
%6 = load i32, i32* %4
%7 = call i32 @__cvmx_shmem_close_dscptr(%struct.cvmx_shmem_dscptr* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.cvmx_shmem_dscptr = type { i32 }
define i32 @__cvmx_shmem_close_standalone(%struct.cvmx_shmem_dscptr* %0, i32 %1) {
%3 = tail call i32 @__cvmx_shmem_close_dscptr(%struct.cvmx_shmem_dscptr* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct userrec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cmd_pls_mask(char, struct userrec *, int, char *);
void cmd_pls_ban(struct userrec *u, int idx, char *par) {
  cmd_pls_mask('b', u, idx, par);
}


x86 assembly (clang, -O0):
<cmd_pls_ban>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x62,%edi
call   1030 <cmd_pls_mask@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_pls_ban>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x62,%edi
jmp    1030 <cmd_pls_mask@plt>

LLVM IR (-O0):
%struct.userrec = type { i32 }
define void @cmd_pls_ban(%struct.userrec* %0, i32 %1, i8* %2) {
%4 = alloca %struct.userrec*
%5 = alloca i32
%6 = alloca i8*
store %struct.userrec* %0, %struct.userrec** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.userrec*, %struct.userrec** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @cmd_pls_mask(i8 signext 98, %struct.userrec* %7, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
%struct.userrec = type { i32 }
define void @cmd_pls_ban(%struct.userrec* %0, i32 %1, i8* %2) {
%4 = tail call i32 @cmd_pls_mask(i8 signext 98, %struct.userrec* %0, i32 %1, i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef scalar_t__ int64_t;

/* Variables and functions */
scalar_t__ max_int(int /*<<< orphan*/);
scalar_t__ min_int(int /*<<< orphan*/);
bool fits_k_bits(int64_t x, uint32_t k) {
  return min_int(k) <= x && x <= max_int(k);
}


x86 assembly (clang, -O0):
<fits_k_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <min_int@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    -0x8(%rbp),%rcx
mov    %al,-0xd(%rbp)
jg     1169 <fits_k_bits+0x49>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <max_int@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fits_k_bits>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <min_int@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
jg     114b <fits_k_bits+0x2b>
mov    %ebp,%edi
call   1030 <max_int@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
setge  %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fits_k_bits(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i64 @min_int(i32 %5)
%7 = load i64, i64* %3
%8 = icmp sle i64 %6, %7
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i64, i64* %3
%11 = load i32, i32* %4
%12 = call i64 @max_int(i32 %11)
%13 = icmp sle i64 %10, %12
br label %14
14: ; preds = %9, %2
%15 = phi i1 [ false, %2 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @fits_k_bits(i64 %0, i32 %1) {
%3 = tail call i64 @min_int(i32 %1)
%4 = icmp sgt i64 %3, %0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @max_int(i32 %1)
%7 = icmp sge i64 %6, %0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_number_of_quaddobl_Laurentials(int *length) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(562, length, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_number_of_quaddobl_Laurentials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x232,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_number_of_quaddobl_Laurentials>:
mov    %rdi,%rsi
mov    $0x232,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @syscon_number_of_quaddobl_Laurentials(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc4c(i32 562, i32* %6, i32* %7, double* %8, i32 0)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @syscon_number_of_quaddobl_Laurentials(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 562, i32* %0, i32* undef, double* undef, i32 0)
ret i32 %2
}
char *nullptr_var(unsigned long offset) {
  static char *const base = (char *)0;
  return base + offset;
}


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

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

LLVM IR (-O0):
@nullptr_var.base = internal constant i8* null
define i8* @nullptr_var(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = getelementptr inbounds i8, i8* null, i64 %3
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @nullptr_var(i64 %0) {
%2 = getelementptr inbounds i8, i8* null, i64 %0
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ resetltchars();
void my_exit(int st) {
  resetltchars();
  exit(st);
}


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

x86 assembly (clang, -O2):
<my_exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <resetltchars@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @my_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @resetltchars()
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
define void @my_exit(i32 %0) {
%2 = tail call i32 (...) @resetltchars()
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
scalar_t__ match_suffix(char *, char *);
int pack_alpha(int, char **);
int unpackbin(int, char **);
int main(int argc, char *argv[]) {
  if (match_suffix(argv[0], "unpack_alpha") == 0)
    return unpackbin(argc, argv);
  return pack_alpha(argc, argv);
}


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    (%rax),%rdi
lea    0xeac(%rip),%rsi
call   1040 <match_suffix@plt>
cmp    $0x0,%rax
jne    1177 <main+0x47>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <unpackbin@plt>
mov    %eax,-0x4(%rbp)
jmp    1186 <main+0x56>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <pack_alpha@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%rdi
lea    0xebe(%rip),%rsi
call   1040 <match_suffix@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
test   %rax,%rax
je     115c <main+0x2c>
pop    %rbx
pop    %rbp
jmp    1050 <pack_alpha@plt>
pop    %rbx
pop    %rbp
jmp    1030 <unpackbin@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"unpack_alpha\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 0
%8 = load i8*, i8** %7
%9 = call i64 @match_suffix(i8* %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = call i32 @unpackbin(i32 %12, i8** %13)
store i32 %14, i32* %3
br label %19
15: ; preds = %2
%16 = load i32, i32* %4
%17 = load i8**, i8*** %5
%18 = call i32 @pack_alpha(i32 %16, i8** %17)
store i32 %18, i32* %3
br label %19
19: ; preds = %15, %11
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [13 x i8] c"unpack_alpha\00"
define i32 @main(i32 %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = tail call i64 @match_suffix(i8* %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @unpackbin(i32 %0, i8** %1)
br label %10
8: ; preds = %2
%9 = tail call i32 @pack_alpha(i32 %0, i8** %1)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}
int ascii_to_int(char c) {
  return c < 'A' ? c - '0' : ((c < 'a') ? c - 'A' + 10 : c - 'a' + 10);
}


x86 assembly (clang, -O0):
<ascii_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jge    1126 <ascii_to_int+0x26>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1158 <ascii_to_int+0x58>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jge    1145 <ascii_to_int+0x45>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
jmp    1152 <ascii_to_int+0x52>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_to_int>:
xor    %ecx,%ecx
cmp    $0x61,%dil
setb   %cl
shl    $0x5,%ecx
add    $0xffffffa9,%ecx
cmp    $0x41,%dil
mov    $0xffffffd0,%eax
cmovge %ecx,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ascii_to_int(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = icmp slt i8 %0, 65
%4 = icmp ult i8 %0, 97
%5 = select i1 %4, i32 -55, i32 -87
%6 = select i1 %3, i32 -48, i32 %5
%7 = add nsw i32 %6, %2
ret i32 %7
}
const char *ls_costN_nm8_name_out(int i) {
  switch (i) {
  case 0:
    return "o0";
  case 1:
    return "o1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ls_costN_nm8_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <ls_costN_nm8_name_out+0x2b>
jmp    111a <ls_costN_nm8_name_out+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <ls_costN_nm8_name_out+0x3b>
jmp    114b <ls_costN_nm8_name_out+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_costN_nm8_name_out+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_costN_nm8_name_out+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm8_name_out>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @ls_costN_nm8_name_out(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @ls_costN_nm8_name_out(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
uint32_t sdmmc_read32(uint16_t reg) {
  return *(volatile uint32_t *)(0x10006000 + reg);
}


x86 assembly (clang, -O0):
<sdmmc_read32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10006000,%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sdmmc_read32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 268460032, %3
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @sdmmc_read32(i64 %0) {
%2 = add nsw i64 %0, 268460032
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
ret i32 %4
}
void CantReadResourceFile() { ; }


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

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

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

LLVM IR (-O2):
define void @CantReadResourceFile() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x93() {
  Assert_real((isdigit(147) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              740, ("isdigit should be 0 for 0x93"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x93>:
push   %rax
mov    $0x93,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2e4,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x93\00"
define void @t_isdigit_0x93() {
%1 = call i64 @isdigit(i32 147)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 740, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x93\00"
define void @t_isdigit_0x93() {
%1 = tail call i64 @isdigit(i32 147)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 740, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
__attribute__((noreturn)) void __stack_chk_fail(void) { abort(); }


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

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

LLVM IR (-O0):
define void @__stack_chk_fail() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @__stack_chk_fail() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ printf(char *);
scalar_t__ sprintf(char *, char *, char *);
scalar_t__ strlen(char *);
int main(void) {
  char *letra = "A";
  char *buffer = malloc(strlen(letra) + 6);
  if (sprintf(buffer, "echo %s", letra) > 0)
    printf(buffer);
  else
    printf("algo deu errado");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdi
add    $0x6,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe80(%rip),%rsi
call   1060 <sprintf@plt>
cmp    $0x0,%rax
jle    119f <main+0x5f>
mov    -0x18(%rbp),%rdi
call   1040 <printf@plt>
jmp    11ab <main+0x6b>
lea    0xe64(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x7,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xebd(%rip),%rsi
lea    0xeb4(%rip),%rdx
mov    %rax,%rdi
call   1050 <sprintf@plt>
test   %rax,%rax
lea    0xeac(%rip),%rdi
cmovg  %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"A\00"
@.str.1 = [8 x i8] c"echo %s\00"
@.str.2 = [16 x i8] c"algo deu errado\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 6
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i64 @sprintf(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = icmp sgt i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %0
%13 = load i8*, i8** %3
%14 = call i32 @printf(i8* %13)
br label %17
15: ; preds = %0
%16 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@.str = [2 x i8] c"A\00"
@.str.1 = [8 x i8] c"echo %s\00"
@.str.2 = [16 x i8] c"algo deu errado\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(7) i8* @malloc(i64 7)
%2 = tail call i64 @sprintf(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp sgt i64 %2, 0
%4 = select i1 %3, i8* %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0)
%5 = tail call i32 @printf(i8* dereferenceable(1) %4)
ret i32 0
}
/* Type definitions */
struct sockaddr_in6 {
  int dummy;
};
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int sa_family;
};

/* Variables and functions */
#define AF_INET 129
#define AF_INET6 128
size_t get_sa_len(struct sockaddr *addr) {
  switch (addr->sa_family) {
  case AF_INET:
    return (sizeof(struct sockaddr_in));
  case AF_INET6:
    return (sizeof(struct sockaddr_in6));
  default:
    return (sizeof(struct sockaddr));
  }
}


x86 assembly (clang, -O0):
<get_sa_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x80,%eax
je     1141 <get_sa_len+0x41>
jmp    1121 <get_sa_len+0x21>
mov    -0x14(%rbp),%eax
sub    $0x81,%eax
jne    114e <get_sa_len+0x4e>
jmp    1134 <get_sa_len+0x34>
movq   $0x4,-0x8(%rbp)
jmp    1156 <get_sa_len+0x56>
movq   $0x4,-0x8(%rbp)
jmp    1156 <get_sa_len+0x56>
movq   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i64 @get_sa_len(%struct.sockaddr* %0) {
%2 = alloca i64
%3 = alloca %struct.sockaddr*
store %struct.sockaddr* %0, %struct.sockaddr** %3
%4 = load %struct.sockaddr*, %struct.sockaddr** %3
%5 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %4, i32 0, i32 0
%6 = load i32, i32* %5
switch i32 %6, label %9 [
i32 129, label %7
i32 128, label %8
]
7: ; preds = %1
store i64 4, i64* %2
br label %10
8: ; preds = %1
store i64 4, i64* %2
br label %10
9: ; preds = %1
store i64 4, i64* %2
br label %10
10: ; preds = %9, %8, %7
%11 = load i64, i64* %2
ret i64 %11
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i64 @get_sa_len(%struct.sockaddr* nocapture %0) {
ret i64 4
}
/* Variables and functions */
char fonction();
char main() { return fonction(); }


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

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

LLVM IR (-O0):
define signext i8 @main() {
%1 = call signext i8 (...) @fonction()
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @main() {
%1 = tail call signext i8 (...) @fonction()
ret i8 %1
}
void log_null(const char *message, void *stream) {}


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

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

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

LLVM IR (-O2):
define void @log_null(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
void fillz(void *ptr, const size_t size, const int nitem) {
  long n;
  char *p = ptr;
  n = size * nitem;
  while (n--)
    *p++ = '\0';
}


x86 assembly (clang, -O0):
<fillz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
cmp    $0x0,%rax
je     1157 <fillz+0x57>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movb   $0x0,(%rax)
jmp    1127 <fillz+0x27>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillz>:
movslq %edx,%rdx
imul   %rsi,%rdx
test   %rdx,%rdx
je     1128 <fillz+0x18>
push   %rax
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @fillz(i8* nocapture writeonly %0, i64 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = mul i64 %4, %1
%6 = icmp eq i64 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %3
br label %8
8: ; preds = %7, %3
ret void
}