xunge/DecIR huggingface dataset:
/* Type definitions */
typedef float const uint32_t;

/* Variables and functions */
float float_from_u4_28(uint32_t uval) {
  static const float scale = 1. / (float)(1UL << 28);
  return uval * scale;
}


x86 assembly (clang, -O0):
<float_from_u4_28>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
@float_from_u4_28.scale = internal constant float 0x3E30000000000000
define float @float_from_u4_28(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x3E30000000000000
ret float %4
}

LLVM IR (-O2):
define float @float_from_u4_28(float %0) {
%2 = fmul float %0, 0x3E30000000000000
ret float %2
}
test_store_copy_prop(int i) {
  int *p, a, b, c;
  if (i < 5)
    p = &a;
  else if (i > 8)
    p = &b;
  else
    p = &c;
  *p = i;
  b = i + 1;
  return *p;
}


x86 assembly (clang, -O0):
<test_store_copy_prop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    111e <test_store_copy_prop+0x1e>
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1142 <test_store_copy_prop+0x42>
cmpl   $0x8,-0x4(%rbp)
jle    1135 <test_store_copy_prop+0x35>
lea    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    113d <test_store_copy_prop+0x3d>
lea    -0x1c(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1142 <test_store_copy_prop+0x42>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_store_copy_prop>:
cmp    $0x9,%edi
lea    -0xc(%rsp),%rax
lea    -0x8(%rsp),%rcx
cmovge %rax,%rcx
cmp    $0x5,%edi
lea    -0x4(%rsp),%rax
cmovge %rcx,%rax
mov    %edi,(%rax)
add    $0x1,%edi
mov    %edi,-0xc(%rsp)
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
define i32 @test_store_copy_prop(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = icmp slt i32 %0, 5
%9 = icmp sgt i32 %0, 8
%10 = select i1 %9, i32* %3, i32* %4
%11 = select i1 %8, i32* %2, i32* %10
store i32 %0, i32* %11
%12 = add nsw i32 %0, 1
store i32 %12, i32* %3
%13 = load i32, i32* %11
ret i32 %13
}
void init_compiler_specifics(void) {}


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

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

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

LLVM IR (-O2):
define void @init_compiler_specifics() {
ret void
}
char *langRomTypeWaveSCSI() { return "WAVE-SCSI"; }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"WAVE-SCSI\00"
define i8* @langRomTypeWaveSCSI() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ Substitute(int /*<<< orphan*/);
int /*<<< orphan*/ malloc_wrapper();
void main() { Substitute(malloc_wrapper()); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <malloc_wrapper@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <Substitute@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @malloc_wrapper()
%2 = call i32 @Substitute(i32 %1)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @malloc_wrapper()
%2 = tail call i32 @Substitute(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read_map12();
int /*<<< orphan*/ read_map34();
int /*<<< orphan*/ scale_map12();
int /*<<< orphan*/ scale_map34();
int /*<<< orphan*/ write_map12();
int /*<<< orphan*/ write_map34();
int main(void) {
  int listmax;
  int filecycles;
  read_map12();
  scale_map12();
  write_map12();
  read_map34();
  scale_map34();
  write_map34();
  printf("End of Program\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <read_map12@plt>
mov    $0x0,%al
call   1060 <scale_map12@plt>
mov    $0x0,%al
call   1090 <write_map12@plt>
mov    $0x0,%al
call   1070 <read_map34@plt>
mov    $0x0,%al
call   1030 <scale_map34@plt>
mov    $0x0,%al
call   1080 <write_map34@plt>
lea    0xe50(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <read_map12@plt>
xor    %eax,%eax
call   1060 <scale_map12@plt>
xor    %eax,%eax
call   1090 <write_map12@plt>
xor    %eax,%eax
call   1070 <read_map34@plt>
xor    %eax,%eax
call   1040 <scale_map34@plt>
xor    %eax,%eax
call   1080 <write_map34@plt>
lea    0xe5e(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"End of Program\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @read_map12()
%5 = call i32 (...) @scale_map12()
%6 = call i32 (...) @write_map12()
%7 = call i32 (...) @read_map34()
%8 = call i32 (...) @scale_map34()
%9 = call i32 (...) @write_map34()
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"End of Program\00"
define i32 @main() {
%1 = tail call i32 (...) @read_map12()
%2 = tail call i32 (...) @scale_map12()
%3 = tail call i32 (...) @write_map12()
%4 = tail call i32 (...) @read_map34()
%5 = tail call i32 (...) @scale_map34()
%6 = tail call i32 (...) @write_map34()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strncmp(char *, char *, int);
int get_opr(char *in) {
  if (!strncmp(in, "&&", 2) || !strncmp(in, "||", 2)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<get_opr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     1158 <get_opr+0x48>
mov    -0x10(%rbp),%rdi
lea    0xebe(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1164 <get_opr+0x54>
movl   $0x1,-0x4(%rbp)
jmp    116b <get_opr+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_opr>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1148 <get_opr+0x38>
lea    0xed3(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"&&\00"
@.str.1 = [3 x i8] c"||\00"
define i32 @get_opr(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 ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @strncmp(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %7, %1
store i32 1, i32* %2
br label %13
12: ; preds = %7
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"&&\00"
@.str.1 = [3 x i8] c"||\00"
define i32 @get_opr(i8* %0) {
%2 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sigHandler(int sig) { printf("Ouch!\n"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"Ouch!\0A\00"
define void @sigHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"Ouch!\00"
define void @sigHandler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
int disable_irq_wake(unsigned int irq) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @disable_irq_wake(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug_puts(char *);
int /*<<< orphan*/ sim_exit(int);
int main() {
  debug_puts("\n"
             "This program tests the simulator magic exit port.\n"
             "There should be no more messages after this one.\n");
  sim_exit(1);
  debug_puts("ERROR - Simulator did not exit?\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <debug_puts@plt>
mov    $0x1,%edi
call   1030 <sim_exit@plt>
lea    0xf19(%rip),%rdi
call   1040 <debug_puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <debug_puts@plt>
mov    $0x1,%edi
call   1030 <sim_exit@plt>
lea    0xf27(%rip),%rdi
call   1040 <debug_puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [101 x i8] c"\0AThis program tests the simulator magic exit port.\0AThere should be no more messages after this one.\0A\00"
@.str.1 = [33 x i8] c"ERROR - Simulator did not exit?\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @debug_puts(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @sim_exit(i32 1)
%4 = call i32 @debug_puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [101 x i8] c"\0AThis program tests the simulator magic exit port.\0AThere should be no more messages after this one.\0A\00"
@.str.1 = [33 x i8] c"ERROR - Simulator did not exit?\0A\00"
define i32 @main() {
%1 = tail call i32 @debug_puts(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @sim_exit(i32 1)
%3 = tail call i32 @debug_puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void advance_to_next(char **ptr, const char c) {
  while (c != **ptr) {
    (*ptr)++;
  }
}


x86 assembly (clang, -O0):
<advance_to_next>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1137 <advance_to_next+0x37>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    110e <advance_to_next+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<advance_to_next>:
mov    (%rdi),%rax
cmp    %sil,(%rax)
je     111f <advance_to_next+0x1f>
add    $0x1,%rax
nopl   0x0(%rax)
mov    %rax,(%rdi)
lea    0x1(%rax),%rcx
cmp    %sil,(%rax)
mov    %rcx,%rax
jne    1110 <advance_to_next+0x10>
ret

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

LLVM IR (-O2):
define void @advance_to_next(i8** nocapture %0, i8 signext %1) {
%3 = load i8*, i8** %0
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, %1
br i1 %5, label %11, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %8, %6 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, %1
br i1 %10, label %11, label %6
11: ; preds = %6, %2
ret void
}
int fun1295() { return 1295; }


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

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

LLVM IR (-O0):
define i32 @fun1295() {
ret i32 1295
}

LLVM IR (-O2):
define i32 @fun1295() {
ret i32 1295
}
void paddle_move_right() {}


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

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

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

LLVM IR (-O2):
define void @paddle_move_right() {
ret void
}
void scrHideCursor(void) {}


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

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

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

LLVM IR (-O2):
define void @scrHideCursor() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ barrier();
void putc(int c) {
  while (((*(volatile unsigned char *)(0x82500010)) & 4) == 0)
    barrier();
  (*(volatile unsigned char *)(0x82500020)) = c;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x82500010,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x4,%eax
cmp    $0x0,%eax
jne    113d <putc+0x2d>
mov    $0x0,%al
call   1030 <barrier@plt>
jmp    111b <putc+0xb>
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    $0x82500020,%eax
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x82500010,%ebx
testb  $0x4,(%rbx)
jne    112c <putc+0x1c>
nop
xor    %eax,%eax
call   1030 <barrier@plt>
testb  $0x4,(%rbx)
je     1120 <putc+0x10>
mov    %bpl,0x10(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @putc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i8, i8* inttoptr (i64 2186280976 to i8*)
%5 = zext i8 %4 to i32
%6 = and i32 %5, 4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = call i32 (...) @barrier()
br label %3
10: ; preds = %3
%11 = load i32, i32* %2
%12 = trunc i32 %11 to i8
store volatile i8 %12, i8* inttoptr (i64 2186280992 to i8*)
ret void
}

LLVM IR (-O2):
define void @putc(i32 %0) {
%2 = load volatile i8, i8* inttoptr (i64 2186280976 to i8*)
%3 = and i8 %2, 4
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = tail call i32 (...) @barrier()
%7 = load volatile i8, i8* inttoptr (i64 2186280976 to i8*)
%8 = and i8 %7, 4
%9 = icmp eq i8 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %1
%11 = trunc i32 %0 to i8
store volatile i8 %11, i8* inttoptr (i64 2186280992 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
int main() {
mylabel:
  putchar('H');
  putchar('i');
  putchar(13);
  goto mylabel;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x48,%edi
call   1030 <putchar@plt>
mov    $0x69,%edi
call   1030 <putchar@plt>
mov    $0xd,%edi
call   1030 <putchar@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x48,%edi
call   1030 <putchar@plt>
mov    $0x69,%edi
call   1030 <putchar@plt>
mov    $0xd,%edi
call   1030 <putchar@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = call i32 @putchar(i32 72)
%4 = call i32 @putchar(i32 105)
%5 = call i32 @putchar(i32 13)
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @putchar(i32 72)
%3 = tail call i32 @putchar(i32 105)
%4 = tail call i32 @putchar(i32 13)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *);
int /*<<< orphan*/ stderr;
void assert_false(const char *condition, int actual, const char *file,
                  int line) {
  if (actual) {
    fprintf(stderr, "%s:%d expression unexpectedly evaluated to true: %s\n",
            file, line, condition);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<assert_false>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     116a <assert_false+0x4a>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x8(%rbp),%r8
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_false>:
test   %esi,%esi
jne    1125 <assert_false+0x5>
ret
push   %rax
mov    %rdi,%r8
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"%s:%d expression unexpectedly evaluated to true: %s\0A\00"
define void @assert_false(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %4
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i8*, i8** %5
%16 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14, i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %4
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"%s:%d expression unexpectedly evaluated to true: %s\0A\00"
define void @assert_false(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %1, 0
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3, i8* %0)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void adjustedLE(unsigned a) {
  char *b = ((void *)0);
  if (a + 1 <= 1)
    b = malloc(1);
  if (a == 0)
    free(b);
  return;
}


x86 assembly (clang, -O0):
<adjustedLE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x1,%eax
ja     1150 <adjustedLE+0x30>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1163 <adjustedLE+0x43>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjustedLE>:
push   %rbx
mov    %edi,%ebx
lea    0x1(%rbx),%eax
cmp    $0x1,%eax
ja     1139 <adjustedLE+0x19>
mov    $0x1,%edi
call   1040 <malloc@plt>
test   %ebx,%ebx
je     113b <adjustedLE+0x1b>
pop    %rbx
ret
mov    %rax,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @adjustedLE(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %3
%4 = load i32, i32* %2
%5 = add i32 %4, 1
%6 = icmp ule i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i8* @malloc(i32 1)
store i8* %8, i8** %3
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i8*, i8** %3
%14 = call i32 @free(i8* %13)
br label %15
15: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
define void @adjustedLE(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp ult i32 %2, 2
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%6 = icmp eq i32 %0, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @free(i8* %5)
br label %9
9: ; preds = %1, %7, %4
ret void
}
int ishex(int x) {
  return (x >= '0' && x <= '9') || (x >= 'a' && x <= 'f') ||
         (x >= 'A' && x <= 'F');
}


x86 assembly (clang, -O0):
<ishex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jl     1120 <ishex+0x20>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <ishex+0x58>
cmpl   $0x61,-0x4(%rbp)
jl     1139 <ishex+0x39>
mov    $0x1,%al
cmpl   $0x66,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <ishex+0x58>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <ishex+0x52>
cmpl   $0x46,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x6,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ishex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 102
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 65
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 70
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @ishex(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_253() {
  Assert_real((isqrt(253) == 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",
              1270, ("Integer square root of 253 should be 15"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_253>:
push   %rax
mov    $0xfd,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xf,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x4f6,%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 253 should be 15\00"
define void @t_sqrt_253() {
%1 = call i32 @isqrt(i32 253)
%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 1270, 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 253 should be 15\00"
define void @t_sqrt_253() {
%1 = tail call i32 @isqrt(i32 253)
%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 1270, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcsncat(int /*<<< orphan*/ *, int /*<<< orphan*/ *, size_t);
void uninivar_wcsncat(wchar_t *Ct, wchar_t *S, size_t N) {
  wchar_t *ct;
  wchar_t *s;
  size_t n;
  (void)wcsncat(ct, s, n);
  (void)wcsncat(ct, S, N);
  (void)wcsncat(Ct, s, N);
  (void)wcsncat(Ct, S, n);
  (void)wcsncat(Ct, S, N);
}


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

x86 assembly (clang, -O2):
<uninivar_wcsncat>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <wcsncat@plt>
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <wcsncat@plt>
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <wcsncat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <wcsncat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <wcsncat@plt>

LLVM IR (-O0):
define void @uninivar_wcsncat(i32* %0, i32* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%10 = load i32*, i32** %7
%11 = load i32*, i32** %8
%12 = load i64, i64* %9
%13 = call i32 @wcsncat(i32* %10, i32* %11, i64 %12)
%14 = load i32*, i32** %7
%15 = load i32*, i32** %5
%16 = load i64, i64* %6
%17 = call i32 @wcsncat(i32* %14, i32* %15, i64 %16)
%18 = load i32*, i32** %4
%19 = load i32*, i32** %8
%20 = load i64, i64* %6
%21 = call i32 @wcsncat(i32* %18, i32* %19, i64 %20)
%22 = load i32*, i32** %4
%23 = load i32*, i32** %5
%24 = load i64, i64* %9
%25 = call i32 @wcsncat(i32* %22, i32* %23, i64 %24)
%26 = load i32*, i32** %4
%27 = load i32*, i32** %5
%28 = load i64, i64* %6
%29 = call i32 @wcsncat(i32* %26, i32* %27, i64 %28)
ret void
}

LLVM IR (-O2):
define void @uninivar_wcsncat(i32* %0, i32* %1, i64 %2) {
%4 = tail call i32 @wcsncat(i32* undef, i32* undef, i64 undef)
%5 = tail call i32 @wcsncat(i32* undef, i32* %1, i64 %2)
%6 = tail call i32 @wcsncat(i32* %0, i32* undef, i64 %2)
%7 = tail call i32 @wcsncat(i32* %0, i32* %1, i64 undef)
%8 = tail call i32 @wcsncat(i32* %0, i32* %1, i64 %2)
ret void
}
void samsung_pm_saved_gpios(void) {}


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

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

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

LLVM IR (-O2):
define void @samsung_pm_saved_gpios() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outbyte(int /*<<< orphan*/);
void outstr(char *str) {
  while (*str != 0)
    outbyte(*str++);
}


x86 assembly (clang, -O0):
<outstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <outstr+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <outbyte@plt>
jmp    111c <outstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <outstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <outbyte@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <outstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @outstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @outbyte(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int INT_MAX;
int fitness(int heightDiff) { return INT_MAX - heightDiff; }


x86 assembly (clang, -O0):
<fitness>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%eax
sub    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fitness>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
sub    %edi,%eax
ret

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

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @fitness(i32 %0) {
%2 = load i32, i32* @INT_MAX
%3 = sub nsw i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ foo();
int main() {
  foo();
  exit(0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_69int16_mem(short *val) {
  return ((*val) & (-0x69 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_69int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffff97,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_69int16_mem>:
movzwl (%rdi),%eax
test   $0xff97,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_69int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -105
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int unlink(char const *);
int remove_utf8(const char *path) { return (unlink(path)); }


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

x86 assembly (clang, -O2):
<remove_utf8>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define i32 @remove_utf8(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
void NET_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @NET_Init() {
ret void
}
int main() {
  char *t, s[8];
  int n;
  t = s;
  gets(t);
  n = t;
  while (t != '\0')
    n = n * 8 + *t - '0';
  printf(" %d\n", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <gets@plt>
mov    -0x10(%rbp),%rax
mov    %eax,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116e <main+0x4e>
mov    -0x1c(%rbp),%eax
shl    $0x3,%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0x1c(%rbp)
jmp    1149 <main+0x29>
mov    -0x1c(%rbp),%esi
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <gets@plt>

LLVM IR (-O0):
@.str = [5 x i8] c" %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [8 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @gets to i32 (i8*, ...)*)(i8* %6)
%8 = load i8*, i8** %2
%9 = ptrtoint i8* %8 to i32
store i32 %9, i32* %4
br label %10
10: ; preds = %13, %0
%11 = load i8*, i8** %2
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %21
13: ; preds = %10
%14 = load i32, i32* %4
%15 = mul nsw i32 %14, 8
%16 = load i8*, i8** %2
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = add nsw i32 %15, %18
%20 = sub nsw i32 %19, 48
store i32 %20, i32* %4
br label %10
21: ; preds = %10
%22 = load i32, i32* %4
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %22)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [8 x i8]
%2 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @gets to i32 (i8*, ...)*)(i8* %2)
unreachable
}
int mul(int a, int b) { return (a * b); }


x86 assembly (clang, -O0):
<mul>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @mul(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ alexa_main();
int main(int argv, const char *argc[]) {
  argv = argv;
  argc = argc;
  alexa_main();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <alexa_main@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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
store i32 %6, i32* %4
%7 = load i8**, i8*** %5
store i8** %7, i8*** %5
%8 = call i32 (...) @alexa_main()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @alexa_main()
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_clear_standard_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(37, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<solcon_clear_standard_solutions>:
mov    $0x25,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @solcon_clear_standard_solutions() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 37, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void VC_PlayStop(void) {}


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

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

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

LLVM IR (-O2):
define void @VC_PlayStop() {
ret void
}
char __attribute__((unused)) printable(char a) {
  if (a >= 32 && a <= 126)
    return a;
  return '.';
}


x86 assembly (clang, -O0):
<printable>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jl     112f <printable+0x2f>
movsbl -0x2(%rbp),%eax
cmp    $0x7e,%eax
jg     112f <printable+0x2f>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1133 <printable+0x33>
movb   $0x2e,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<printable>:
lea    -0x20(%rdi),%eax
cmp    $0x5f,%al
mov    $0x2e,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @printable(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 32
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 126
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = load i8, i8* %3
store i8 %12, i8* %2
br label %14
13: ; preds = %7, %1
store i8 46, i8* %2
br label %14
14: ; preds = %13, %11
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @printable(i8 signext %0) {
%2 = add i8 %0, -32
%3 = icmp ult i8 %2, 95
%4 = select i1 %3, i8 %0, i8 46
ret i8 %4
}
int clickplc_int16_dec(unsigned char *stream2bytes, unsigned short *pnumber) {
  int retval = 2;
  *pnumber =
      ((unsigned short)stream2bytes[0] << 8) | (unsigned short)stream2bytes[1];
  return (retval);
}


x86 assembly (clang, -O0):
<clickplc_int16_dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzwl %ax,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
movzwl %cx,%ecx
or     %ecx,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clickplc_int16_dec>:
movzwl (%rdi),%eax
rol    $0x8,%ax
mov    %ax,(%rsi)
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @clickplc_int16_dec(i8* %0, i16* %1) {
%3 = alloca i8*
%4 = alloca i16*
%5 = alloca i32
store i8* %0, i8** %3
store i16* %1, i16** %4
store i32 2, i32* %5
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = zext i8 %8 to i16
%10 = zext i16 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = zext i8 %14 to i16
%16 = zext i16 %15 to i32
%17 = or i32 %11, %16
%18 = trunc i32 %17 to i16
%19 = load i16*, i16** %4
store i16 %18, i16* %19
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @clickplc_int16_dec(i8* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i16
%5 = shl nuw i16 %4, 8
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i16
%9 = or i16 %5, %8
store i16 %9, i16* %1
ret i32 2
}
void set_inode_used(unsigned char *inode_bitmap, int inodenum) {
  unsigned char bm;
  bm = inode_bitmap[inodenum / 8];
  bm |= (0x80 >> (inodenum % 8));
  inode_bitmap[inodenum / 8] = bm;
}


x86 assembly (clang, -O0):
<set_inode_used>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x80,%eax
sar    %cl,%eax
mov    %eax,%ecx
movzbl -0xd(%rbp),%eax
or     %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x19(%rbp),%dl
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_inode_used>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
and    $0x7,%cl
mov    $0x80,%edx
shr    %cl,%edx
cltq
or     %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @set_inode_used(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sdiv i32 %7, 8
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = load i8, i8* %10
store i8 %11, i8* %5
%12 = load i32, i32* %4
%13 = srem i32 %12, 8
%14 = ashr i32 128, %13
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = or i32 %16, %14
%18 = trunc i32 %17 to i8
store i8 %18, i8* %5
%19 = load i8, i8* %5
%20 = load i8*, i8** %3
%21 = load i32, i32* %4
%22 = sdiv i32 %21, 8
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %20, i64 %23
store i8 %19, i8* %24
ret void
}

LLVM IR (-O2):
define void @set_inode_used(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = and i32 %1, 7
%8 = lshr i32 128, %7
%9 = trunc i32 %8 to i8
%10 = or i8 %6, %9
store i8 %10, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_13288() {
  Assert_real((isqrt(13288) == 115),
              "/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",
              1560, ("Integer square root of 13288 should be 115"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_13288>:
push   %rax
mov    $0x33e8,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x73,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x618,%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 13288 should be 115\00"
define void @t_sqrt_13288() {
%1 = call i32 @isqrt(i32 13288)
%2 = icmp eq i32 %1, 115
%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 1560, 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 13288 should be 115\00"
define void @t_sqrt_13288() {
%1 = tail call i32 @isqrt(i32 13288)
%2 = icmp eq i32 %1, 115
%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 1560, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int exynos_pm_late_initcall(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @exynos_pm_late_initcall() {
ret i32 0
}
int sys_wait4(tcp)
struct tcb *tcp;
{
  return printwaitn(tcp, 4, 0);
}


x86 assembly (clang, -O0):
<sys_wait4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <printwaitn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_wait4>:
mov    $0x4,%esi
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <printwaitn@plt>

LLVM IR (-O0):
%struct.tcb = type opaque
define i32 @sys_wait4(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
%3 = load %struct.tcb*, %struct.tcb** %2
%4 = call i32 (%struct.tcb*, i32, i32, ...) bitcast (i32 (...)* @printwaitn to i32 (%struct.tcb*, i32, i32, ...)*)(%struct.tcb* %3, i32 4, i32 0)
ret i32 %4
}

LLVM IR (-O2):
%struct.tcb = type opaque
define i32 @sys_wait4(%struct.tcb* %0) {
%2 = tail call i32 (%struct.tcb*, i32, i32, ...) bitcast (i32 (...)* @printwaitn to i32 (%struct.tcb*, i32, i32, ...)*)(%struct.tcb* %0, i32 4, i32 0)
ret i32 %2
}
double sqrt(double x) { return x * x; }


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

x86 assembly (clang, -O2):
<sqrt>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @sqrt(double %0) {
%2 = fmul double %0, %0
ret double %2
}