xunge/DecIR huggingface dataset:
/* Type definitions */
struct dirent {
  char *d_name;
};

/* Variables and functions */
int select_files(const struct dirent *dirbuf) {
  if (dirbuf->d_name[0] == '.')
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<select_files>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1127 <select_files+0x27>
movl   $0x0,-0x4(%rbp)
jmp    112e <select_files+0x2e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<select_files>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmpb   $0x2e,(%rcx)
setne  %al
ret

LLVM IR (-O0):
%struct.dirent = type { i8* }
define i32 @select_files(%struct.dirent* %0) {
%2 = alloca i32
%3 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %3
%4 = load %struct.dirent*, %struct.dirent** %3
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %4, i32 0, i32 0
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 46
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 0, i32* %2
br label %13
12: ; preds = %1
store i32 1, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.dirent = type { i8* }
define i32 @select_files(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 46
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int *malloc(int);
void f(char c) {
  int local_data = 4;
  int *heap_data = malloc(50 * sizeof(int));
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x4,-0x8(%rbp)
mov    $0xc8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    $0xc8,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @f(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32*
store i8 %0, i8* %2
store i32 4, i32* %3
%5 = call i32* @malloc(i32 200)
store i32* %5, i32** %4
ret void
}

LLVM IR (-O2):
define void @f(i8 signext %0) {
%2 = tail call i32* @malloc(i32 200)
ret void
}
/* Variables and functions */
int EOF;
int scanf(char *, char *);
int nextchar(void) {
  char s[2];
  if (scanf("%1s", s) != 1)
    return EOF;
  else
    return s[0];
}


x86 assembly (clang, -O0):
<nextchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x6(%rbp),%rsi
lea    0xedd(%rip),%rdi
call   1030 <scanf@plt>
cmp    $0x1,%eax
je     1142 <nextchar+0x32>
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <nextchar+0x39>
movsbl -0x6(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextchar>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x6(%rsp),%rsi
call   1030 <scanf@plt>
cmp    $0x1,%eax
je     1132 <nextchar+0x22>
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
movsbl 0x6(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%1s\00"
@EOF = global i32 0
define i32 @nextchar() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = icmp eq i32 %3, 1
%5 = load i32, i32* @EOF
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = select i1 %4, i32 %7, i32 %5
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ ln_deg_to_rad(double);
double sin(int /*<<< orphan*/);
double sqrt(double);
double ln_get_airmass(double alt, double airmass_scale) {
  double a;
  a = airmass_scale * sin(ln_deg_to_rad(alt));
  return sqrt(a * a + 2 * airmass_scale + 1) - a;
}


x86 assembly (clang, -O0):
<ln_get_airmass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <ln_deg_to_rad@plt>
mov    %eax,%edi
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  0xe88(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe6b(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
subsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_airmass>:
push   %rax
movsd  %xmm1,(%rsp)
call   1040 <ln_deg_to_rad@plt>
mov    %eax,%edi
call   1030 <sin@plt>
movapd %xmm0,%xmm2
movsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm2
addsd  %xmm0,%xmm0
movapd %xmm0,%xmm1
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  0xe95(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     117b <ln_get_airmass+0x4b>
sqrtsd %xmm0,%xmm0
jmp    118a <ln_get_airmass+0x5a>
movsd  %xmm2,(%rsp)
call   1050 <sqrt@plt>
movsd  (%rsp),%xmm2
subsd  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ln_get_airmass(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = call i32 @ln_deg_to_rad(double %7)
%9 = call double @sin(i32 %8)
%10 = fmul double %6, %9
store double %10, double* %5
%11 = load double, double* %5
%12 = load double, double* %5
%13 = load double, double* %4
%14 = fmul double 2.000000e+00, %13
%15 = call double @llvm.fmuladd.f64(double %11, double %12, double %14)
%16 = fadd double %15, 1.000000e+00
%17 = call double @sqrt(double %16)
%18 = load double, double* %5
%19 = fsub double %17, %18
ret double %19
}

LLVM IR (-O2):
define double @ln_get_airmass(double %0, double %1) {
%3 = tail call i32 @ln_deg_to_rad(double %0)
%4 = tail call double @sin(i32 %3)
%5 = fmul double %4, %1
%6 = fmul double %1, 2.000000e+00
%7 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %6)
%8 = fadd double %7, 1.000000e+00
%9 = tail call double @sqrt(double %8)
%10 = fsub double %9, %5
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  if (argc > 1)
    printf("aaaaaaa: %s", argv[1]);
  else
    printf("nnnnnaaaa");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    114b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1159 <main+0x49>
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     112a <main+0x1a>
mov    0x8(%rsi),%rsi
lea    0xedf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1138 <main+0x28>
lea    0xedb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"aaaaaaa: %s\00"
@.str.1 = [10 x i8] c"nnnnnaaaa\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 i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %15
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"aaaaaaa: %s\00"
@.str.1 = [10 x i8] c"nnnnnaaaa\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %10
8: ; preds = %2
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %4
ret i32 0
}
int allocate_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @allocate_init() {
ret i32 0
}
void HAT_heap_flush() {}


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

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

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

LLVM IR (-O2):
define void @HAT_heap_flush() {
ret void
}
int min(int a, int b) { return a <= b ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @min(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 = icmp sle i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
char **backtrace_symbols(void **, int);
int /*<<< orphan*/ free(char **);
int /*<<< orphan*/ printf(char *, char *);
void print_ip_sym(unsigned long ip) {
  char **name;
  name = backtrace_symbols((void **)&ip, 1);
  printf("%s\n", *name);
  free(name);
}


x86 assembly (clang, -O0):
<print_ip_sym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <backtrace_symbols@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea4(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ip_sym>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x1,%esi
call   1040 <backtrace_symbols@plt>
mov    %rax,%rbx
mov    (%rax),%rsi
lea    0xeaa(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_ip_sym(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = bitcast i64* %2 to i8**
%4 = call i8** @backtrace_symbols(i8** %3, i32 1)
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @free(i8** %4)
ret void
}
initpvm(void) {}


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

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

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

LLVM IR (-O2):
define i32 @initpvm() {
ret i32 undef
}
void paddle_move_left() {}


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

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

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

LLVM IR (-O2):
define void @paddle_move_left() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ keygen25519(unsigned char *, unsigned char *,
                               unsigned char *);
void ecc_keygen(unsigned char *P, unsigned char *s, unsigned char *k) {
  keygen25519(P, s, k);
}


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

x86 assembly (clang, -O2):
<ecc_keygen>:
jmp    1030 <keygen25519@plt>

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

LLVM IR (-O2):
define void @ecc_keygen(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @keygen25519(i8* %0, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t length = 0;
  while (*str++ != '\0') {
    length++;
  }
  return length;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113c <strlen+0x3c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ get_last_boss_ptn_bg();
int /*<<< orphan*/ set_map_total_last_boss(int /*<<< orphan*/, long, long, long,
                                           long);
void set_map_total_last_boss_bg(long x, long y, long dx, long dy) {
  set_map_total_last_boss(get_last_boss_ptn_bg(), x, y, dx, dy);
}


x86 assembly (clang, -O0):
<set_map_total_last_boss_bg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1040 <get_last_boss_ptn_bg@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <set_map_total_last_boss@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_map_total_last_boss_bg>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <get_last_boss_ptn_bg@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <set_map_total_last_boss@plt>

LLVM IR (-O0):
define void @set_map_total_last_boss_bg(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = call i32 (...) @get_last_boss_ptn_bg()
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = call i32 @set_map_total_last_boss(i32 %9, i64 %10, i64 %11, i64 %12, i64 %13)
ret void
}

LLVM IR (-O2):
define void @set_map_total_last_boss_bg(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i32 (...) @get_last_boss_ptn_bg()
%6 = tail call i32 @set_map_total_last_boss(i32 %5, i64 %0, i64 %1, i64 %2, i64 %3)
ret void
}
long __atomic64_cmpxchg(long *ptr, long old, long new) {
  return __sync_val_compare_and_swap(ptr, old, new);
}


x86 assembly (clang, -O0):
<__atomic64_cmpxchg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdx
lock cmpxchg %rdx,(%rcx)
sete   %cl
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic64_cmpxchg>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
ret

LLVM IR (-O0):
define i64 @__atomic64_cmpxchg(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64*, i64** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = cmpxchg i64* %7, i64 %8, i64 %9 seq_cst seq_cst
%11 = extractvalue { i64, i1 } %10, 0
ret i64 %11
}

LLVM IR (-O2):
define i64 @__atomic64_cmpxchg(i64* nocapture %0, i64 %1, i64 %2) {
%4 = cmpxchg i64* %0, i64 %1, i64 %2 seq_cst seq_cst
%5 = extractvalue { i64, i1 } %4, 0
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int send_command(int sock, char *command) {
  if (send(sock, command, strlen(command), 0) == -1) {
    return -1;
  }
  printf("%s\n", command);
  return 0;
}


x86 assembly (clang, -O0):
<send_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
cmp    $0xffffffff,%eax
jne    117b <send_command+0x4b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1192 <send_command+0x62>
mov    -0x10(%rbp),%rsi
lea    0xe7a(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_command>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
xor    %r14d,%r14d
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
cmp    $0xffffffff,%eax
je     1168 <send_command+0x38>
lea    0xea2(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
jmp    116e <send_command+0x3e>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @send_command(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %3, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 0, %6 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void arbreg_destory(void *p_arbreg) { free(p_arbreg); }


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

x86 assembly (clang, -O2):
<arbreg_destory>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @arbreg_destory(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
bool fspath_find(const char pattern[]) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @fspath_find(i8* nocapture readnone %0) {
ret i32 0
}
void sys_initmidiqueue(void) {}


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

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

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

LLVM IR (-O2):
define void @sys_initmidiqueue() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int nva_rd32(int, int);
int /*<<< orphan*/ nva_wr32(int, int, int);
uint32_t nva_mask(int cnum, uint32_t reg, uint32_t mask, uint32_t val) {
  uint32_t tmp = nva_rd32(cnum, reg);
  nva_wr32(cnum, reg, (tmp & ~mask) | val);
  return tmp;
}


x86 assembly (clang, -O0):
<nva_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <nva_rd32@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    %eax,%edx
or     -0x10(%rbp),%edx
call   1040 <nva_wr32@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nva_mask>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%r15d
mov    %edi,%r12d
call   1030 <nva_rd32@plt>
mov    %eax,%ebx
not    %ebp
and    %eax,%ebp
or     %r14d,%ebp
mov    %r12d,%edi
mov    %r15d,%esi
mov    %ebp,%edx
call   1040 <nva_wr32@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @nva_mask(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @nva_rd32(i32 %10, i32 %11)
store i32 %12, i32* %9
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = load i32, i32* %9
%16 = load i32, i32* %7
%17 = xor i32 %16, -1
%18 = and i32 %15, %17
%19 = load i32, i32* %8
%20 = or i32 %18, %19
%21 = call i32 @nva_wr32(i32 %13, i32 %14, i32 %20)
%22 = load i32, i32* %9
ret i32 %22
}

LLVM IR (-O2):
define i32 @nva_mask(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @nva_rd32(i32 %0, i32 %1)
%6 = xor i32 %2, -1
%7 = and i32 %5, %6
%8 = or i32 %7, %3
%9 = tail call i32 @nva_wr32(i32 %0, i32 %1, i32 %8)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_greetings1(void) { printf("Hello from thread1 (UNPATCHED)\n"); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"Hello from thread1 (UNPATCHED)\0A\00"
define void @print_greetings1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"Hello from thread1 (UNPATCHED)\00"
define void @print_greetings1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
void cbor_null_indef_map_start_callback(void *_ctx) {}


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

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

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

LLVM IR (-O2):
define void @cbor_null_indef_map_start_callback(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ define_config(char const *, int, unsigned int);
scalar_t__ is_defined_config(char const *, int, unsigned int);
int /*<<< orphan*/ print_config(char const *, int);
unsigned int strhash(char const *, int);
void use_config(const char *m, int slen) {
  unsigned int hash = strhash(m, slen);
  if (is_defined_config(m, slen, hash))
    return;
  define_config(m, slen, hash);
  print_config(m, slen);
}


x86 assembly (clang, -O0):
<use_config>:
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 <strhash@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <is_defined_config@plt>
cmp    $0x0,%rax
je     117c <use_config+0x3c>
jmp    1197 <use_config+0x57>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <define_config@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1060 <print_config@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<use_config>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strhash@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1050 <is_defined_config@plt>
test   %rax,%rax
je     1167 <use_config+0x27>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <define_config@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <print_config@plt>

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

LLVM IR (-O2):
define void @use_config(i8* %0, i32 %1) {
%3 = tail call i32 @strhash(i8* %0, i32 %1)
%4 = tail call i64 @is_defined_config(i8* %0, i32 %1, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @define_config(i8* %0, i32 %1, i32 %3)
%8 = tail call i32 @print_config(i8* %0, i32 %1)
br label %9
9: ; preds = %2, %6
ret void
}
/* Type definitions */
struct statfs {
  int dummy;
};

/* Variables and functions */
int errno;
int fstatfs(int, struct statfs *);
int __sulong_posix_fstatfs(int fd, struct statfs *buf) {
  {
    int native_errno = errno;
    int result = fstatfs(fd, buf);
    if (result == (int)-1) {
      result = (int)(long)-errno;
    }
    errno = native_errno;
    return result;
  };
}


x86 assembly (clang, -O0):
<__sulong_posix_fstatfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <fstatfs@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1154 <__sulong_posix_fstatfs+0x44>
xor    %eax,%eax
mov    0x2e93(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
mov    0x2e82(%rip),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_fstatfs>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <fstatfs@plt>
xor    %ecx,%ecx
sub    (%rbx),%ecx
cmp    $0xffffffff,%eax
cmove  %ecx,%eax
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.statfs = type { i32 }
@errno = global i32 0
define i32 @__sulong_posix_fstatfs(i32 %0, %struct.statfs* %1) {
%3 = alloca i32
%4 = alloca %struct.statfs*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store %struct.statfs* %1, %struct.statfs** %4
%7 = load i32, i32* @errno
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load %struct.statfs*, %struct.statfs** %4
%10 = call i32 @fstatfs(i32 %8, %struct.statfs* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i32, i32* @errno
%15 = sub nsw i32 0, %14
%16 = sext i32 %15 to i64
%17 = trunc i64 %16 to i32
store i32 %17, i32* %6
br label %18
18: ; preds = %13, %2
%19 = load i32, i32* %5
store i32 %19, i32* @errno
%20 = load i32, i32* %6
ret i32 %20
}

LLVM IR (-O2):
%struct.statfs = type { i32 }
@errno = global i32 0
define i32 @__sulong_posix_fstatfs(i32 %0, %struct.statfs* %1) {
%3 = load i32, i32* @errno
%4 = tail call i32 @fstatfs(i32 %0, %struct.statfs* %1)
%5 = icmp eq i32 %4, -1
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 %4
store i32 %3, i32* @errno
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xda() {
  Assert_real((isxdigit(218) == 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_isxdigit.c",
              1095, ("isxdigit should be 0 for 0xda"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xda>:
push   %rax
mov    $0xda,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x447,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xda\00"
define void @t_isxdigit_0xda() {
%1 = tail call i64 @isxdigit(i32 218)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1095, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int ffsll(long long i) { return __builtin_ffsll(i); }


x86 assembly (clang, -O0):
<ffsll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
bsf    %rdx,%rax
add    $0x1,%rax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffsll>:
bsf    %rdi,%rcx
add    $0x1,%ecx
xor    %eax,%eax
test   %rdi,%rdi
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ffsll(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.cttz.i64(i64 %3, i1 true)
%5 = add i64 %4, 1
%6 = icmp eq i64 %3, 0
%7 = select i1 %6, i64 0, i64 %5
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ffsll(i64 %0) {
%2 = tail call i64 @llvm.cttz.i64(i64 %0, i1 true)
%3 = icmp eq i64 %0, 0
%4 = trunc i64 %2 to i32
%5 = add nuw nsw i32 %4, 1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Type definitions */
struct cpufreq_affected_cpus {
  int dummy;
};

/* Variables and functions */
struct cpufreq_affected_cpus *sysfs_get_cpu_list(unsigned int, char *);
struct cpufreq_affected_cpus *sysfs_get_affected_cpus(unsigned int cpu) {
  return sysfs_get_cpu_list(cpu, "affected_cpus");
}


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

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

LLVM IR (-O0):
%struct.cpufreq_affected_cpus = type { i32 }
@.str = [14 x i8] c"affected_cpus\00"
define %struct.cpufreq_affected_cpus* @sysfs_get_affected_cpus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call %struct.cpufreq_affected_cpus* @sysfs_get_cpu_list(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret %struct.cpufreq_affected_cpus* %4
}

LLVM IR (-O2):
%struct.cpufreq_affected_cpus = type { i32 }
@.str = [14 x i8] c"affected_cpus\00"
define %struct.cpufreq_affected_cpus* @sysfs_get_affected_cpus(i32 %0) {
%2 = tail call %struct.cpufreq_affected_cpus* @sysfs_get_cpu_list(i32 %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret %struct.cpufreq_affected_cpus* %2
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, char *const);
int option_write_string(char *out, const void *in, size_t n) {
  char *const *in_char = in;
  snprintf(out, n, "%s", *in_char ? *in_char : "none");
  return 0;
}


x86 assembly (clang, -O0):
<option_write_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
je     115a <option_write_string+0x4a>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
jmp    116a <option_write_string+0x5a>
lea    0xea2(%rip),%rax
mov    %rax,-0x38(%rbp)
jmp    116a <option_write_string+0x5a>
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rcx
lea    0xe83(%rip),%rdx
call   1030 <snprintf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<option_write_string>:
push   %rax
mov    (%rsi),%rax
test   %rax,%rax
lea    0xee5(%rip),%rcx
cmovne %rax,%rcx
lea    0xed7(%rip),%rax
mov    %rdx,%rsi
mov    %rax,%rdx
call   1030 <snprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"none\00"
define i32 @option_write_string(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8**
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to i8**
store i8** %9, i8*** %7
%10 = load i8*, i8** %4
%11 = load i64, i64* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %12
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %18
15: ; preds = %3
%16 = load i8**, i8*** %7
%17 = load i8*, i8** %16
br label %19
18: ; preds = %3
br label %19
19: ; preds = %18, %15
%20 = phi i8* [ %17, %15 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %18 ]
%21 = call i32 @snprintf(i8* %10, i64 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"none\00"
define i32 @option_write_string(i8* %0, i8* nocapture %1, i64 %2) {
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = select i1 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %5
%8 = tail call i32 @snprintf(i8* %0, i64 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 0
}
unsigned long elf_hash(const unsigned char *name) {
  unsigned long h = 0, g;
  while (*name) {
    h = (h << 4) + *name++;
    g = h & 0xf0000000;
    if (g)
      h ^= g >> 24;
    h &= ~g;
  }
  return h;
}


x86 assembly (clang, -O0):
<elf_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1180 <elf_hash+0x80>
mov    -0x10(%rbp),%rax
shl    $0x4,%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movzbl (%rcx),%ecx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
movabs $0xf0000000,%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116b <elf_hash+0x6b>
mov    -0x18(%rbp),%rax
shr    $0x18,%rax
xor    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <elf_hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<elf_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     113d <elf_hash+0x3d>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
shl    $0x4,%rax
movzbl %cl,%ecx
add    %rax,%rcx
mov    %ecx,%eax
and    $0xf0000000,%eax
mov    %rax,%rdx
shr    $0x18,%rdx
xor    %rcx,%rdx
not    %rax
and    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <elf_hash+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @elf_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %5
5: ; preds = %26, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %31
9: ; preds = %5
%10 = load i64, i64* %3
%11 = shl i64 %10, 4
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
%14 = load i8, i8* %12
%15 = zext i8 %14 to i64
%16 = add i64 %11, %15
store i64 %16, i64* %3
%17 = load i64, i64* %3
%18 = and i64 %17, 4026531840
store i64 %18, i64* %4
%19 = load i64, i64* %4
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %9
%22 = load i64, i64* %4
%23 = lshr i64 %22, 24
%24 = load i64, i64* %3
%25 = xor i64 %24, %23
store i64 %25, i64* %3
br label %26
26: ; preds = %21, %9
%27 = load i64, i64* %4
%28 = xor i64 %27, -1
%29 = load i64, i64* %3
%30 = and i64 %29, %28
store i64 %30, i64* %3
br label %5
31: ; preds = %5
%32 = load i64, i64* %3
ret i64 %32
}

LLVM IR (-O2):
define i64 @elf_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %17, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i64 [ %16, %4 ], [ 0, %1 ]
%8 = shl i64 %7, 4
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = zext i8 %5 to i64
%11 = add i64 %8, %10
%12 = and i64 %11, 4026531840
%13 = lshr exact i64 %12, 24
%14 = xor i64 %13, %11
%15 = xor i64 %12, -1
%16 = and i64 %14, %15
%17 = load i8, i8* %9
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %4
19: ; preds = %4, %1
%20 = phi i64 [ 0, %1 ], [ %16, %4 ]
ret i64 %20
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_236() {
  Assert_real((isqrt(236) == 15),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              1185, ("Integer square root of 236 should be 15"));
}


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

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

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 236 should be 15\00"
define void @t_sqrt_236() {
%1 = call i32 @isqrt(i32 236)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1185, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 236 should be 15\00"
define void @t_sqrt_236() {
%1 = tail call i32 @isqrt(i32 236)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1185, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ __mriCore_IsWaitingForGdbToConnect();
int /*<<< orphan*/ waitForGdbToConnect();
void blockIfGdbHasNotConnected(void) {
  if (__mriCore_IsWaitingForGdbToConnect())
    waitForGdbToConnect();
}


x86 assembly (clang, -O0):
<blockIfGdbHasNotConnected>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <__mriCore_IsWaitingForGdbToConnect@plt>
cmp    $0x0,%rax
je     113c <blockIfGdbHasNotConnected+0x1c>
mov    $0x0,%al
call   1040 <waitForGdbToConnect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<blockIfGdbHasNotConnected>:
push   %rax
xor    %eax,%eax
call   1030 <__mriCore_IsWaitingForGdbToConnect@plt>
test   %rax,%rax
je     1135 <blockIfGdbHasNotConnected+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <waitForGdbToConnect@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @blockIfGdbHasNotConnected() {
%1 = call i64 (...) @__mriCore_IsWaitingForGdbToConnect()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @waitForGdbToConnect()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @blockIfGdbHasNotConnected() {
%1 = tail call i64 (...) @__mriCore_IsWaitingForGdbToConnect()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @waitForGdbToConnect()
br label %5
5: ; preds = %3, %0
ret void
}
/* Type definitions */
struct Tester {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(struct Tester *);
int /*<<< orphan*/ printf(char *, char *);
void testf(struct Tester *t, int test, char *msg) {
  if (test) {
    printf("PASSED: %s\n", msg);
  } else {
    printf("FAILED: %s\n", msg);
    free(t);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<testf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1162 <testf+0x32>
mov    -0x18(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
jmp    1185 <testf+0x55>
mov    -0x18(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testf>:
test   %esi,%esi
je     1143 <testf+0x13>
lea    0xec5(%rip),%rdi
mov    %rdx,%rsi
jmp    1040 <printf@plt>
push   %rbx
mov    %rdi,%rbx
lea    0xebe(%rip),%rdi
mov    %rdx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.Tester = type { i32 }
@.str = [12 x i8] c"PASSED: %s\0A\00"
@.str.1 = [12 x i8] c"FAILED: %s\0A\00"
define void @testf(%struct.Tester* %0, i32 %1, i8* %2) {
%4 = alloca %struct.Tester*
%5 = alloca i32
%6 = alloca i8*
store %struct.Tester* %0, %struct.Tester** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8*, i8** %6
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %18
12: ; preds = %3
%13 = load i8*, i8** %6
%14 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = load %struct.Tester*, %struct.Tester** %4
%16 = call i32 @free(%struct.Tester* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %9
ret void
}

LLVM IR (-O2):
%struct.Tester = type { i32 }
@.str = [12 x i8] c"PASSED: %s\0A\00"
@.str.1 = [12 x i8] c"FAILED: %s\0A\00"
define void @testf(%struct.Tester* nocapture %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
7: ; preds = %3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%9 = tail call i32 @free(%struct.Tester* %0)
%10 = tail call i32 @exit(i32 1)
unreachable
}