xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ strncmp(char *, char *, int);
int check_header(char *src) {
  if (!strncmp(src, "CHK", 3) && src[3] == 0x21)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<check_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1157 <check_header+0x47>
mov    -0x10(%rbp),%rax
movsbl 0x3(%rax),%eax
cmp    $0x21,%eax
jne    1157 <check_header+0x47>
movl   $0x1,-0x4(%rbp)
jmp    115e <check_header+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_header>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    1134 <check_header+0x24>
mov    $0x1,%eax
cmpb   $0x21,0x3(%rbx)
je     1136 <check_header+0x26>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"CHK\00"
define i32 @check_header(i8* %0) {
%2 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 33
br i1 %7, label %9, label %8
8: ; preds = %4, %1
br label %9
9: ; preds = %4, %8
%10 = phi i32 [ 0, %8 ], [ 1, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_long_dashed_line(void) {
  printf(" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "
         "- - - - - -\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [81 x i8] c" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\00"
define void @print_long_dashed_line() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_75int8_reg(signed char val) {
  return ((val) & (0x75 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_75int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x75,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_75int8_reg>:
test   $0x75,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_75int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 117
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_75int8_reg(i8 signext %0) {
%2 = and i8 %0, 117
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t color565(uint8_t r, uint8_t g, uint8_t b) {
  return ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3);
}


x86 assembly (clang, -O0):
<color565>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf8,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%ecx
and    $0xfc,%ecx
shl    $0x3,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
sar    $0x3,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<color565>:
shl    $0x8,%edi
and    $0xf800,%edi
and    $0xfc,%esi
lea    (%rdi,%rsi,8),%eax
sar    $0x3,%edx
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @color565(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = and i32 %7, 248
%9 = shl i32 %8, 8
%10 = load i32, i32* %5
%11 = and i32 %10, 252
%12 = shl i32 %11, 3
%13 = or i32 %9, %12
%14 = load i32, i32* %6
%15 = ashr i32 %14, 3
%16 = or i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @color565(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 8
%5 = and i32 %4, 63488
%6 = shl i32 %1, 3
%7 = and i32 %6, 2016
%8 = or i32 %7, %5
%9 = ashr i32 %2, 3
%10 = or i32 %8, %9
ret i32 %10
}
void fdleak_debug_init(void) {}


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

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

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

LLVM IR (-O2):
define void @fdleak_debug_init() {
ret void
}
void InterpolateRow_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @InterpolateRow_SSSE3() {
ret void
}
/* Variables and functions */
unsigned long mfspr(int);
int /*<<< orphan*/ mtspr(int, unsigned long);
void cache_iflush(void) {
  unsigned long sr = mfspr((17));
  mtspr((17), sr | (1 << 17));
}


x86 assembly (clang, -O0):
<cache_iflush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x11,%edi
call   1030 <mfspr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
or     $0x20000,%rsi
mov    $0x11,%edi
call   1040 <mtspr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cache_iflush>:
push   %rax
mov    $0x11,%edi
call   1030 <mfspr@plt>
or     $0x20000,%rax
mov    $0x11,%edi
mov    %rax,%rsi
pop    %rax
jmp    1040 <mtspr@plt>

LLVM IR (-O0):
define void @cache_iflush() {
%1 = alloca i64
%2 = call i64 @mfspr(i32 17)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = or i64 %3, 131072
%5 = call i32 @mtspr(i32 17, i64 %4)
ret void
}

LLVM IR (-O2):
define void @cache_iflush() {
%1 = tail call i64 @mfspr(i32 17)
%2 = or i64 %1, 131072
%3 = tail call i32 @mtspr(i32 17, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doStuff_pointerToConstInt(int *);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int f_malloc_2(void) {
  int *ptr;
  ptr = (int *)malloc(sizeof(int));
  *ptr = 25;
  doStuff_pointerToConstInt(ptr);
  free(ptr);
  return 0;
}


x86 assembly (clang, -O0):
<f_malloc_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x19,(%rax)
mov    -0x8(%rbp),%rdi
call   1050 <doStuff_pointerToConstInt@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_malloc_2>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movl   $0x19,(%rax)
mov    %rax,%rdi
call   1050 <doStuff_pointerToConstInt@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f_malloc_2() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
store i32 25, i32* %4
%5 = load i32*, i32** %1
%6 = call i32 @doStuff_pointerToConstInt(i32* %5)
%7 = load i32*, i32** %1
%8 = call i32 @free(i32* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @f_malloc_2() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
store i32 25, i32* %2
%3 = tail call i32 @doStuff_pointerToConstInt(i32* %2)
%4 = tail call i32 @free(i32* %2)
ret i32 0
}
struct pthread *__pthread_self(void) {
  return (struct pthread *)-1;
}


x86 assembly (clang, -O0):
<__pthread_self>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pthread_self>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
%struct.pthread = type opaque
define %struct.pthread* @__pthread_self() {
ret %struct.pthread* inttoptr (i64 -1 to %struct.pthread*)
}

LLVM IR (-O2):
%struct.pthread = type opaque
define %struct.pthread* @__pthread_self() {
ret %struct.pthread* inttoptr (i64 -1 to %struct.pthread*)
}
int sub(int i) { return i + 10; }


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

x86 assembly (clang, -O2):
<sub>:
lea    0xa(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @sub(i32 %0) {
%2 = add nsw i32 %0, 10
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void closeredir(int *redir) {
  if (redir[0] != -1)
    close(redir[0]);
  if (redir[1] != -1)
    close(redir[1]);
}


x86 assembly (clang, -O0):
<closeredir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0xffffffff,(%rax)
je     1134 <closeredir+0x24>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%rax
cmpl   $0xffffffff,0x4(%rax)
je     114e <closeredir+0x3e>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeredir>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
cmp    $0xffffffff,%edi
je     1120 <closeredir+0x10>
call   1030 <close@plt>
mov    0x4(%rbx),%edi
cmp    $0xffffffff,%edi
je     112e <closeredir+0x1e>
pop    %rbx
jmp    1030 <close@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @closeredir(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, -1
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @close(i32 %2)
br label %6
6: ; preds = %4, %1
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, -1
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = tail call i32 @close(i32 %8)
br label %12
12: ; preds = %10, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_symbol(int n, char **tokens) {
  if (tokens) {
    printf("%s ", tokens[n]);
  } else {
    printf("%c", n);
  }
}


x86 assembly (clang, -O0):
<print_symbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1149 <print_symbol+0x39>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115a <print_symbol+0x4a>
mov    -0x4(%rbp),%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_symbol>:
test   %rsi,%rsi
je     113a <print_symbol+0x1a>
movslq %edi,%rax
mov    (%rsi,%rax,8),%rsi
lea    0xecd(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define void @print_symbol(i32 %0, i8** %1) {
%3 = icmp eq i8** %1, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds i8*, i8** %1, i64 %5
%7 = load i8*, i8** %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %11
9: ; preds = %2
%10 = tail call i32 @putchar(i32 %0)
br label %11
11: ; preds = %9, %4
ret void
}
/* Variables and functions */
int main_imprintf(int, char **);
int main(int c, char **v) { return main_imprintf(c, v); }


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 <main_imprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <main_imprintf@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @main_imprintf(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @main_imprintf(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ testBoolean();
int /*<<< orphan*/ testBooleanArray();
int /*<<< orphan*/ testInt8();
int /*<<< orphan*/ testIntArray();
int /*<<< orphan*/ testObject();
int /*<<< orphan*/ testString();
int main(void) {
  if (1)
    testBoolean();
  if (1)
    testBooleanArray();
  if (1)
    testInt8();
  if (1)
    testIntArray();
  if (1)
    testString();
  if (1)
    testObject();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <testBoolean@plt>
mov    $0x0,%al
call   1040 <testBooleanArray@plt>
mov    $0x0,%al
call   1070 <testInt8@plt>
mov    $0x0,%al
call   1080 <testIntArray@plt>
mov    $0x0,%al
call   1030 <testString@plt>
mov    $0x0,%al
call   1060 <testObject@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <testBoolean@plt>
xor    %eax,%eax
call   1040 <testBooleanArray@plt>
xor    %eax,%eax
call   1070 <testInt8@plt>
xor    %eax,%eax
call   1080 <testIntArray@plt>
xor    %eax,%eax
call   1030 <testString@plt>
xor    %eax,%eax
call   1060 <testObject@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @testBoolean()
%2 = call i32 (...) @testBooleanArray()
%3 = call i32 (...) @testInt8()
%4 = call i32 (...) @testIntArray()
%5 = call i32 (...) @testString()
%6 = call i32 (...) @testObject()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testBoolean()
%2 = tail call i32 (...) @testBooleanArray()
%3 = tail call i32 (...) @testInt8()
%4 = tail call i32 (...) @testIntArray()
%5 = tail call i32 (...) @testString()
%6 = tail call i32 (...) @testObject()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EIO;
int /*<<< orphan*/ errno;
int link(const char *oldname, const char *newname) {
  (void)oldname;
  (void)newname;
  errno = EIO;
  return -1;
}


x86 assembly (clang, -O0):
<link>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<link>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EIO = global i32 0
@errno = global i32 0
define i32 @link(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @EIO
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EIO = global i32 0
@errno = global i32 0
define i32 @link(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EIO
store i32 %3, i32* @errno
ret i32 -1
}
const char *sqlassieVersion() { return "(Development)"; }


x86 assembly (clang, -O0):
<sqlassieVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlassieVersion>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"(Development)\00"
define i8* @sqlassieVersion() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"(Development)\00"
define i8* @sqlassieVersion() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int dap_read_word(int);
int /*<<< orphan*/ dap_write_word(int, int);
void target_erase(void) {
  dap_write_word(0x400e0c04, 0x5a000005);
  while (0 == (dap_read_word(0x400e0c08) & 1))
    ;
}


x86 assembly (clang, -O0):
<target_erase>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400e0c04,%edi
mov    $0x5a000005,%esi
call   1030 <dap_write_word@plt>
mov    $0x400e0c08,%edi
call   1040 <dap_read_word@plt>
mov    %eax,%ecx
and    $0x1,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    1151 <target_erase+0x31>
jmp    1133 <target_erase+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<target_erase>:
push   %rax
mov    $0x400e0c04,%edi
mov    $0x5a000005,%esi
call   1030 <dap_write_word@plt>
mov    $0x400e0c08,%edi
call   1040 <dap_read_word@plt>
test   $0x1,%al
je     1130 <target_erase+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @target_erase() {
%1 = call i32 @dap_write_word(i32 1074662404, i32 1509949445)
br label %2
2: ; preds = %6, %0
%3 = call i32 @dap_read_word(i32 1074662408)
%4 = and i32 %3, 1
%5 = icmp eq i32 0, %4
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @target_erase() {
%1 = tail call i32 @dap_write_word(i32 1074662404, i32 1509949445)
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @dap_read_word(i32 1074662408)
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
void _init_ferret(void) {}


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

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

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

LLVM IR (-O2):
define void @_init_ferret() {
ret void
}
void EnableIntP1() {}


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

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

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

LLVM IR (-O2):
define void @EnableIntP1() {
ret void
}
/* Variables and functions */
char *memchr(char *, char, int);
char *uwsgi_str_contains(char *str, int slen, char what) {
  return memchr(str, what, slen);
}


x86 assembly (clang, -O0):
<uwsgi_str_contains>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xd(%rbp),%al
mov    -0xc(%rbp),%edx
movsbl %al,%esi
call   1030 <memchr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_str_contains>:
mov    %esi,%eax
mov    %edx,%esi
mov    %eax,%edx
jmp    1030 <memchr@plt>

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

LLVM IR (-O2):
define i8* @uwsgi_str_contains(i8* %0, i32 %1, i8 signext %2) {
%4 = tail call i8* @memchr(i8* %0, i8 signext %2, i32 %1)
ret i8* %4
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  int z = __VERIFIER_nondet_int();
  while (x >= 0 && x <= z) {
    x = 2 * x + y;
    y++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jl     1158 <main+0x48>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1168 <main+0x58>
jmp    1182 <main+0x72>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x2d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
void nullvector(int x1, int y1, int x2, int y2, int nfat, int vpdashon) {}


x86 assembly (clang, -O0):
<nullvector>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @nullvector(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
ret void
}

LLVM IR (-O2):
define void @nullvector(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret void
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IROTH;
scalar_t__ stat(char const *, struct stat *);
int fsop_path_read_other(const char *path) {
  struct stat st;
  if (stat(path, &st) < 0)
    return -1;
  return (st.st_mode & S_IROTH);
}


x86 assembly (clang, -O0):
<fsop_path_read_other>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    113f <fsop_path_read_other+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <fsop_path_read_other+0x3e>
mov    -0x18(%rbp),%eax
mov    0x2e97(%rip),%rcx
and    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsop_path_read_other>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    0x2ec0(%rip),%rcx
mov    (%rcx),%ecx
and    (%rsp),%ecx
test   %rax,%rax
mov    $0xffffffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IROTH = global i32 0
define i32 @fsop_path_read_other(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %14
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load i32, i32* @S_IROTH
%13 = and i32 %11, %12
store i32 %13, i32* %2
br label %14
14: ; preds = %9, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IROTH = global i32 0
define i32 @fsop_path_read_other(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* @S_IROTH
%9 = and i32 %8, %7
%10 = select i1 %5, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int isCompressed(char *fn) {
  int fnlen;
  fnlen = strlen(fn);
  return strcmp(fn + fnlen - 3, ".gz") == 0;
}


x86 assembly (clang, -O0):
<isCompressed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
add    $0xfffffffffffffffd,%rdi
lea    0xeb2(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isCompressed>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
lea    (%rbx,%rax,1),%rdi
add    $0xfffffffffffffffd,%rdi
lea    0xec6(%rip),%rsi
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c".gz\00"
define i32 @isCompressed(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = getelementptr inbounds i8, i8* %9, i64 -3
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@.str = [4 x i8] c".gz\00"
define i32 @isCompressed(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -3
%6 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int get_stodep_value();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int val;
  val = get_stodep_value();
  if (val != 1) {
    printf("st1 value was %i instead of 1\n", val);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <get_stodep_value@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
je     1165 <main+0x45>
mov    -0x14(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <main+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <get_stodep_value@plt>
cmp    $0x1,%eax
je     1142 <main+0x22>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"st1 value was %i instead of 1\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @get_stodep_value()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %11)
store i32 -1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str = [31 x i8] c"st1 value was %i instead of 1\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @get_stodep_value()
%4 = icmp eq i32 %3, 1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double const *, int);
void glmCopyMatrix5d(const double source[25], double target[25]) {
  memcpy(target, source, 25 * sizeof(double));
}


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

x86 assembly (clang, -O2):
<glmCopyMatrix5d>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0xc8,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @glmCopyMatrix5d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = load double*, double** %3
%7 = call i32 @memcpy(double* %5, double* %6, i32 200)
ret void
}

LLVM IR (-O2):
define void @glmCopyMatrix5d(double* %0, double* %1) {
%3 = tail call i32 @memcpy(double* %1, double* %0, i32 200)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntEnable(int);
int /*<<< orphan*/ IntRegister(int, void (*)());
void AESIntRegister(uint32_t ui32Base, void (*pfnHandler)(void)) {
  ;
  IntRegister(111, pfnHandler);
  IntEnable(111);
}


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

x86 assembly (clang, -O2):
<AESIntRegister>:
push   %rax
mov    $0x6f,%edi
call   1040 <IntRegister@plt>
mov    $0x6f,%edi
pop    %rax
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @AESIntRegister(i32 %0, void ()* %1) {
%3 = alloca i32
%4 = alloca void ()*
store i32 %0, i32* %3
store void ()* %1, void ()** %4
%5 = load void ()*, void ()** %4
%6 = bitcast void ()* %5 to void (...)*
%7 = call i32 @IntRegister(i32 111, void (...)* %6)
%8 = call i32 @IntEnable(i32 111)
ret void
}

LLVM IR (-O2):
define void @AESIntRegister(i32 %0, void ()* %1) {
%3 = bitcast void ()* %1 to void (...)*
%4 = tail call i32 @IntRegister(i32 111, void (...)* %3)
%5 = tail call i32 @IntEnable(i32 111)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_16187() {
  Assert_real((isqrt(16187) == 127),
              "/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",
              1625, ("Integer square root of 16187 should be 127"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_16187>:
push   %rax
mov    $0x3f3b,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x7f,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x659,%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 = [43 x i8] c"Integer square root of 16187 should be 127\00"
define void @t_sqrt_16187() {
%1 = call i32 @isqrt(i32 16187)
%2 = icmp eq i32 %1, 127
%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 1625, i8* getelementptr inbounds ([43 x i8], [43 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 = [43 x i8] c"Integer square root of 16187 should be 127\00"
define void @t_sqrt_16187() {
%1 = tail call i32 @isqrt(i32 16187)
%2 = icmp eq i32 %1, 127
%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 1625, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int atoi(const char *p) {
  int k = 0;
  while (*p) {
    k = (k << 3) + (k << 1) + (*p) - '0';
    p++;
  }
  return k;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <atoi+0x4a>
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <atoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <atoi+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,4),%eax
movsbl %cl,%ecx
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <atoi+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 10
%9 = sext i8 %5 to i32
%10 = add i32 %8, -48
%11 = add i32 %10, %9
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void doSomething() { usleep(1000000); }


x86 assembly (clang, -O0):
<doSomething>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf4240,%edi
call   1030 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<doSomething>:
mov    $0xf4240,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @doSomething() {
%1 = call i32 @usleep(i32 1000000)
ret void
}

LLVM IR (-O2):
define void @doSomething() {
%1 = tail call i32 @usleep(i32 1000000)
ret void
}
/* Variables and functions */
int pow(double, int);
int hparse_dntbl_sz(int len) {
  if (len < 12) {
    return (pow(2.0, (len + 5)));
  } else {
    return (262144);
  }
}


x86 assembly (clang, -O0):
<hparse_dntbl_sz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xc,-0x8(%rbp)
jge    1140 <hparse_dntbl_sz+0x30>
mov    -0x8(%rbp),%edi
add    $0x5,%edi
movsd  0xecd(%rip),%xmm0
call   1030 <pow@plt>
mov    %eax,-0x4(%rbp)
jmp    1147 <hparse_dntbl_sz+0x37>
movl   $0x40000,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hparse_dntbl_sz>:
cmp    $0xb,%edi
jg     1125 <hparse_dntbl_sz+0x15>
add    $0x5,%edi
movsd  0xee0(%rip),%xmm0
jmp    1030 <pow@plt>
mov    $0x40000,%eax
ret

LLVM IR (-O0):
define i32 @hparse_dntbl_sz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 12
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 5
%9 = call i32 @pow(double 2.000000e+00, i32 %8)
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 262144, i32* %2
br label %11
11: ; preds = %10, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @hparse_dntbl_sz(i32 %0) {
%2 = icmp slt i32 %0, 12
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = add nsw i32 %0, 5
%5 = tail call i32 @pow(double 2.000000e+00, i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 262144, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void usage() {
  fprintf(stdout, "Tool for overwriting configuration settings (at this time "
                  "only ovewriting port number is supported).\n"
                  "Usage: confpack -f <original> -o <new> -s <settings>\n"
                  "\t-f <original> original settings binary to use\n"
                  "\t-o <new> new binary to produce\n"
                  "\t-s <settings> settings file to use\n"
                  "\t-h prints this message\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [294 x i8] c"Tool for overwriting configuration settings (at this time only ovewriting port number is supported).\0AUsage: confpack -f <original> -o <new> -s <settings>\0A\09-f <original> original settings binary to use\0A\09-o <new> new binary to produce\0A\09-s <settings> settings file to use\0A\09-h prints this message\0A\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([294 x i8], [294 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [294 x i8] c"Tool for overwriting configuration settings (at this time only ovewriting port number is supported).\0AUsage: confpack -f <original> -o <new> -s <settings>\0A\09-f <original> original settings binary to use\0A\09-o <new> new binary to produce\0A\09-s <settings> settings file to use\0A\09-h prints this message\0A\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([294 x i8], [294 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void forever() {
  int z = 0;
  for (;;) {
    printf("%d\n", z);
    z += 1;
  }
}


x86 assembly (clang, -O0):
<forever>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    111f <forever+0xf>

x86 assembly (clang, -O2):
<forever>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
jmp    1120 <forever+0x10>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @forever() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
br label %2
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @forever() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 1
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ write(int, int /*<<< orphan*/ *, int);
void hoic_ret_read(int fd, uint32_t value) {
  write(fd, &value, sizeof(uint32_t));
}


x86 assembly (clang, -O0):
<hoic_ret_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hoic_ret_read>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @hoic_ret_read(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 = call i32 @write(i32 %5, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
define void @hoic_ret_read(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @write(i32 %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
int test12(void) {
  void *ptr;
  ptr = malloc(10);
  free(ptr);
  free(ptr);
  return 0;
}


x86 assembly (clang, -O0):
<test12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test12>:
push   %rbx
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test12() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 10)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @free(i8* %3)
%5 = load i8*, i8** %1
%6 = call i32 @free(i8* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @test12() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call i32 @free(i8* %1)
%3 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned int *, unsigned char const *, int);
int ntohl(unsigned int);
unsigned ipv4_address(const unsigned char *ipv4) {
  unsigned a;
  memcpy(&a, ipv4, 4);
  return ntohl(a);
}


x86 assembly (clang, -O0):
<ipv4_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%edi
call   1040 <ntohl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv4_address>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%edi
call   1040 <ntohl@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ipv4_address(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i32* %3, i8* %4, i32 4)
%6 = load i32, i32* %3
%7 = call i32 @ntohl(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ipv4_address(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
%6 = call i32 @ntohl(i32 %5)
ret i32 %6
}
double deg_rad(double ang) {
  return ang * (3.14159265358979323846264338327950288 / 180.0);
}


x86 assembly (clang, -O0):
<deg_rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg_rad>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @deg_rad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x3F91DF46A2529D39
ret double %4
}

LLVM IR (-O2):
define double @deg_rad(double %0) {
%2 = fmul double %0, 0x3F91DF46A2529D39
ret double %2
}
/* Type definitions */
struct lh_ctx_t {
  int dummy;
};
struct lh_con_t {
  int dummy;
};

/* Variables and functions */
scalar_t__ XX_httplib_should_keep_alive(struct lh_ctx_t const *,
                                        struct lh_con_t const *);
const char *XX_httplib_suggest_connection_header(const struct lh_ctx_t *ctx,
                                                 const struct lh_con_t *conn) {
  return XX_httplib_should_keep_alive(ctx, conn) ? "keep-alive" : "close";
}


x86 assembly (clang, -O0):
<XX_httplib_suggest_connection_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <XX_httplib_should_keep_alive@plt>
mov    %rax,%rdx
lea    0xed4(%rip),%rax
lea    0xec2(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XX_httplib_suggest_connection_header>:
push   %rax
call   1030 <XX_httplib_should_keep_alive@plt>
test   %rax,%rax
lea    0xeeb(%rip),%rcx
lea    0xed9(%rip),%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.lh_ctx_t = type { i32 }
%struct.lh_con_t = type { i32 }
@.str = [11 x i8] c"keep-alive\00"
@.str.1 = [6 x i8] c"close\00"
define i8* @XX_httplib_suggest_connection_header(%struct.lh_ctx_t* %0, %struct.lh_con_t* %1) {
%3 = alloca %struct.lh_ctx_t*
%4 = alloca %struct.lh_con_t*
store %struct.lh_ctx_t* %0, %struct.lh_ctx_t** %3
store %struct.lh_con_t* %1, %struct.lh_con_t** %4
%5 = load %struct.lh_ctx_t*, %struct.lh_ctx_t** %3
%6 = load %struct.lh_con_t*, %struct.lh_con_t** %4
%7 = call i64 @XX_httplib_should_keep_alive(%struct.lh_ctx_t* %5, %struct.lh_con_t* %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
ret i8* %10
}

LLVM IR (-O2):
%struct.lh_ctx_t = type { i32 }
%struct.lh_con_t = type { i32 }
@.str = [11 x i8] c"keep-alive\00"
@.str.1 = [6 x i8] c"close\00"
define i8* @XX_httplib_suggest_connection_header(%struct.lh_ctx_t* %0, %struct.lh_con_t* %1) {
%3 = tail call i64 @XX_httplib_should_keep_alive(%struct.lh_ctx_t* %0, %struct.lh_con_t* %1)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
ret i8* %5
}