xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ serial;
};
struct TYPE_4__ {
  TYPE_1__ xconfigure;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xconfigure_serial(void *_p) {
  return (unsigned long)((XEvent *)_p)->xconfigure.serial;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xconfigure_serial(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xconfigure_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ lseek(int, int, int /*<<< orphan*/);
int write(int, unsigned char *, int);
int write_data(int f, unsigned char *buff, int len) {
  lseek(f, 0x6600, SEEK_SET);
  return write(f, buff, len);
}


x86 assembly (clang, -O0):
<write_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
mov    $0x6600,%esi
call   1040 <lseek@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_data>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
mov    $0x6600,%esi
call   1040 <lseek@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @write_data(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* @SEEK_SET
%9 = call i32 @lseek(i32 %7, i32 26112, i32 %8)
%10 = load i32, i32* %4
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @write(i32 %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @write_data(i32 %0, i8* nocapture %1, i32 %2) {
%4 = load i32, i32* @SEEK_SET
%5 = tail call i32 @lseek(i32 %0, i32 26112, i32 %4)
%6 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_81() {
  Assert_real((isqrt(81) == 9),
              "/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",
              410, ("Integer square root of 81 should be 9"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_81>:
push   %rax
mov    $0x51,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x9,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x19a,%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 = [38 x i8] c"Integer square root of 81 should be 9\00"
define void @t_sqrt_81() {
%1 = call i32 @isqrt(i32 81)
%2 = icmp eq i32 %1, 9
%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 410, i8* getelementptr inbounds ([38 x i8], [38 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 = [38 x i8] c"Integer square root of 81 should be 9\00"
define void @t_sqrt_81() {
%1 = tail call i32 @isqrt(i32 81)
%2 = icmp eq i32 %1, 9
%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 410, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_data_blocks();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ run_basic_tests_a();
int /*<<< orphan*/ run_basic_tests_b();
int /*<<< orphan*/ run_basic_tests_c();
int /*<<< orphan*/ run_basic_tests_d();
int /*<<< orphan*/ run_basic_tests_e();
void run_tests() {
  init_data_blocks();
  run_basic_tests_a();
  run_basic_tests_b();
  run_basic_tests_c();
  run_basic_tests_d();
  run_basic_tests_e();
  puts("TESTS COMPLETE");
}


x86 assembly (clang, -O0):
<run_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <init_data_blocks@plt>
mov    $0x0,%al
call   1090 <run_basic_tests_a@plt>
mov    $0x0,%al
call   1050 <run_basic_tests_b@plt>
mov    $0x0,%al
call   1080 <run_basic_tests_c@plt>
mov    $0x0,%al
call   1040 <run_basic_tests_d@plt>
mov    $0x0,%al
call   1070 <run_basic_tests_e@plt>
lea    0xe5b(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_tests>:
push   %rax
xor    %eax,%eax
call   1060 <init_data_blocks@plt>
xor    %eax,%eax
call   1090 <run_basic_tests_a@plt>
xor    %eax,%eax
call   1050 <run_basic_tests_b@plt>
xor    %eax,%eax
call   1080 <run_basic_tests_c@plt>
xor    %eax,%eax
call   1040 <run_basic_tests_d@plt>
xor    %eax,%eax
call   1070 <run_basic_tests_e@plt>
lea    0xe5e(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"TESTS COMPLETE\00"
define void @run_tests() {
%1 = call i32 (...) @init_data_blocks()
%2 = call i32 (...) @run_basic_tests_a()
%3 = call i32 (...) @run_basic_tests_b()
%4 = call i32 (...) @run_basic_tests_c()
%5 = call i32 (...) @run_basic_tests_d()
%6 = call i32 (...) @run_basic_tests_e()
%7 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"TESTS COMPLETE\00"
define void @run_tests() {
%1 = tail call i32 (...) @init_data_blocks()
%2 = tail call i32 (...) @run_basic_tests_a()
%3 = tail call i32 (...) @run_basic_tests_b()
%4 = tail call i32 (...) @run_basic_tests_c()
%5 = tail call i32 (...) @run_basic_tests_d()
%6 = tail call i32 (...) @run_basic_tests_e()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
int nxtd_bt_disconnect(struct nxtd_nxt_bt *nxt) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.nxtd_nxt_bt = type opaque
define i32 @nxtd_bt_disconnect(%struct.nxtd_nxt_bt* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int sumOfThirdBytes(int *, int);
int main() {
  int *numbers;
  int array_size = __VERIFIER_nondet_int();
  return sumOfThirdBytes(numbers, array_size);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <sumOfThirdBytes@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 @sumOfThirdBytes(i32* undef, i32 %1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void poke16(uint16_t *address, uint16_t value) { (*address) = value; }


x86 assembly (clang, -O0):
<poke16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<poke16>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @poke16(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xb1() {
  Assert_real((isbdigit(177) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              890, ("isbdigit should be 0 for 0xb1"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xb1\00"
define void @t_isbdigit_0xb1() {
%1 = tail call i64 @isbdigit(i32 177)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 890, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void print(char data) { printf("%c", data); }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @print(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
/* Variables and functions */
char *filename_ext(char const *);
int /*<<< orphan*/ printf(char *, char *, char const *, char *);
int foreach_file_callbk(const char *filename, void *arg) {
  char *path = (char *)arg;
  char *ext = filename_ext(filename);
  printf("%s/%s (ext:`%s')\n", path, filename, (ext == NULL) ? "null" : ext);
  return 0;
}


x86 assembly (clang, -O0):
<foreach_file_callbk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <filename_ext@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1170 <foreach_file_callbk+0x50>
lea    0xeab(%rip),%rax
mov    %rax,-0x38(%rbp)
jmp    1178 <foreach_file_callbk+0x58>
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rcx
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foreach_file_callbk>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <filename_ext@plt>
test   %rax,%rax
lea    0xed9(%rip),%rcx
cmovne %rax,%rcx
lea    0xebc(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"%s/%s (ext:`%s')\0A\00"
@.str.1 = [5 x i8] c"null\00"
define i32 @foreach_file_callbk(i8* %0, i8* %1) {
%3 = tail call i8* @filename_ext(i8* %0)
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0, i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x55() {
  Assert_real((isodigit(85) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              430, ("isodigit should be 0 for U"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for U\00"
define void @t_isodigit_0x55() {
%1 = tail call i64 @isodigit(i32 85)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 430, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgi_freeall();
void cg_finish(void) { cgi_freeall(); }


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

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

LLVM IR (-O0):
define void @cg_finish() {
%1 = call i32 (...) @cgi_freeall()
ret void
}

LLVM IR (-O2):
define void @cg_finish() {
%1 = tail call i32 (...) @cgi_freeall()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x2d() {
  Assert_real((iscntrl(45) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              230, ("iscntrl should be 0 for -"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for -\00"
define void @t_iscntrl_0x2d() {
%1 = tail call i64 @iscntrl(i32 45)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 230, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void uxmi_halt() { printf("\nHalt\n"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"\0AHalt\0A\00"
define void @uxmi_halt() {
%1 = 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"\0AHalt\00"
define void @uxmi_halt() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
dwa() { printf("dwa\n"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"dwa\0A\00"
define i32 @dwa() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [4 x i8] c"dwa\00"
define i32 @dwa() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int Exists(char *fileName) {
  FILE *file;
  if (file = fopen(fileName, "r")) {
    fclose(file);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<Exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     115f <Exists+0x3f>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1166 <Exists+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Exists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <Exists+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @Exists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int strlen(const char *buffer) {
  const char *from = buffer;
  while (*buffer)
    buffer++;
  return buffer - from;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <strlen+0x2e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ diag(char *, int, int);
int /*<<< orphan*/ fail(char const *);
int /*<<< orphan*/ pass(char const *);
void is_i(int got, int expected, const char *description) {
  if (got == expected)
    pass(description);
  else {
    fail(description);
    diag("got %d but expected %d", got, expected);
  }
}


x86 assembly (clang, -O0):
<is_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    115c <is_i+0x2c>
mov    -0x10(%rbp),%rdi
call   1040 <pass@plt>
jmp    1177 <is_i+0x47>
mov    -0x10(%rbp),%rdi
call   1030 <fail@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe8e(%rip),%rdi
call   1050 <diag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_i>:
cmp    %esi,%edi
jne    113c <is_i+0xc>
mov    %rdx,%rdi
jmp    1040 <pass@plt>
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %rdx,%rdi
call   1030 <fail@plt>
lea    0xeae(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <diag@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"got %d but expected %d\00"
define void @is_i(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i8*, i8** %6
%12 = call i32 @pass(i8* %11)
br label %19
13: ; preds = %3
%14 = load i8*, i8** %6
%15 = call i32 @fail(i8* %14)
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = call i32 @diag(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17)
br label %19
19: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"got %d but expected %d\00"
define void @is_i(i32 %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %0, %1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @pass(i8* %2)
br label %10
7: ; preds = %3
%8 = tail call i32 @fail(i8* %2)
%9 = tail call i32 @diag(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
br label %10
10: ; preds = %7, %5
ret void
}
double mapDouble(double input, double input_start, double input_end,
                 double output_start, double output_end) {
  double output =
      output_start + ((output_end - output_start) / (input_end - input_start)) *
                         (input - input_start);
  return output;
}


x86 assembly (clang, -O0):
<mapDouble>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
divsd  %xmm2,%xmm0
movsd  -0x8(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapDouble>:
subsd  %xmm3,%xmm4
subsd  %xmm1,%xmm2
divsd  %xmm2,%xmm4
subsd  %xmm1,%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @mapDouble(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%12 = load double, double* %9
%13 = load double, double* %10
%14 = load double, double* %9
%15 = fsub double %13, %14
%16 = load double, double* %8
%17 = load double, double* %7
%18 = fsub double %16, %17
%19 = fdiv double %15, %18
%20 = load double, double* %6
%21 = load double, double* %7
%22 = fsub double %20, %21
%23 = call double @llvm.fmuladd.f64(double %19, double %22, double %12)
store double %23, double* %11
%24 = load double, double* %11
ret double %24
}

LLVM IR (-O2):
define double @mapDouble(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %4, %3
%7 = fsub double %2, %1
%8 = fdiv double %6, %7
%9 = fsub double %0, %1
%10 = tail call double @llvm.fmuladd.f64(double %8, double %9, double %3)
ret double %10
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void start_timer(struct timeval *tv) { gettimeofday(tv, NULL); }


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

x86 assembly (clang, -O2):
<start_timer>:
xor    %esi,%esi
jmp    1030 <gettimeofday@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @start_timer(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @start_timer(%struct.timeval* nocapture %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int d = 0;
  int a = 0;
  a = 42 / d;
  printf("Este codigo no se ejecuta nunca\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x2a,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Este codigo no se ejecuta nunca\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = sdiv i32 42, %4
store i32 %5, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [32 x i8] c"Este codigo no se ejecuta nunca\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 0
}
long xxx(char st) {
  static long f, s;
  long r;
  if (st) {
    f = 37;
    s = 7;
    return (0L);
  }
  r = ((f * s) + 9337) % 8887;
  f = s;
  s = r;
  return (r);
}


x86 assembly (clang, -O0):
<xxx>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
cmpb   $0x0,-0x9(%rbp)
je     1137 <xxx+0x37>
movq   $0x25,0x2f09(%rip)
movq   $0x7,0x2f06(%rip)
movq   $0x0,-0x8(%rbp)
jmp    117b <xxx+0x7b>
mov    0x2eea(%rip),%rax
imul   0x2eea(%rip),%rax
add    $0x2479,%rax
mov    $0x22b7,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x18(%rbp)
mov    0x2ecf(%rip),%rax
mov    %rax,0x2ec0(%rip)
mov    -0x18(%rbp),%rax
mov    %rax,0x2ebd(%rip)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xxx>:
test   %dil,%dil
je     1113 <xxx+0x13>
mov    $0x7,%ecx
mov    $0x25,%esi
xor    %eax,%eax
jmp    1157 <xxx+0x57>
mov    0x2f16(%rip),%rsi
mov    0x2f07(%rip),%rcx
imul   %rsi,%rcx
add    $0x2479,%rcx
movabs $0x75fd684e9545f857,%rdx
68 fd 75
mov    %rcx,%rax
imul   %rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0xc,%rdx
add    %rax,%rdx
imul   $0x22b7,%rdx,%rax
sub    %rax,%rcx
mov    %rcx,%rax
mov    %rsi,0x2eca(%rip)
mov    %rcx,0x2ecb(%rip)
ret

LLVM IR (-O0):
@xxx.f = internal global i64 0
@xxx.s = internal global i64 0
define i64 @xxx(i8 signext %0) {
%2 = alloca i64
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 37, i64* @xxx.f
store i64 7, i64* @xxx.s
store i64 0, i64* %2
br label %17
8: ; preds = %1
%9 = load i64, i64* @xxx.f
%10 = load i64, i64* @xxx.s
%11 = mul nsw i64 %9, %10
%12 = add nsw i64 %11, 9337
%13 = srem i64 %12, 8887
store i64 %13, i64* %4
%14 = load i64, i64* @xxx.s
store i64 %14, i64* @xxx.f
%15 = load i64, i64* %4
store i64 %15, i64* @xxx.s
%16 = load i64, i64* %4
store i64 %16, i64* %2
br label %17
17: ; preds = %8, %7
%18 = load i64, i64* %2
ret i64 %18
}

LLVM IR (-O2):
@xxx.f = internal unnamed_addr global i64 0
@xxx.s = internal unnamed_addr global i64 0
define i64 @xxx(i8 signext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = load i64, i64* @xxx.f
%5 = load i64, i64* @xxx.s
%6 = mul nsw i64 %5, %4
%7 = add nsw i64 %6, 9337
%8 = srem i64 %7, 8887
br label %9
9: ; preds = %1, %3
%10 = phi i64 [ %5, %3 ], [ 37, %1 ]
%11 = phi i64 [ %8, %3 ], [ 7, %1 ]
%12 = phi i64 [ %8, %3 ], [ 0, %1 ]
store i64 %10, i64* @xxx.f
store i64 %11, i64* @xxx.s
ret i64 %12
}
void bow_foilgain_free(float **fig_per_wi_ci, int num_wi) {
  int wi;
  for (wi = 0; wi < num_wi; wi++)
    bow_free(fig_per_wi_ci[wi]);
  bow_free(fig_per_wi_ci);
}


x86 assembly (clang, -O0):
<bow_foilgain_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1153 <bow_foilgain_free+0x43>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   1030 <bow_free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <bow_foilgain_free+0x16>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <bow_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bow_foilgain_free>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1144 <bow_foilgain_free+0x34>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
xor    %eax,%eax
call   1030 <bow_free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <bow_foilgain_free+0x20>
mov    %r14,%rdi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <bow_free@plt>

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

LLVM IR (-O2):
define void @bow_foilgain_free(float** %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds float*, float** %0, i64 %7
%9 = load float*, float** %8
%10 = tail call i32 (float*, ...) bitcast (i32 (...)* @bow_free to i32 (float*, ...)*)(float* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 (float**, ...) bitcast (i32 (...)* @bow_free to i32 (float**, ...)*)(float** %0)
ret void
}
void memory_status_calibrate(const char *marker) {}


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

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

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

LLVM IR (-O2):
define void @memory_status_calibrate(i8* nocapture %0) {
ret void
}
char phredToPhred64(int p) {
  if (p > 93)
    p = 93;
  else if (p < 0)
    p = 0;
  return ((char)(p + 64));
}


x86 assembly (clang, -O0):
<phredToPhred64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x5d,-0x4(%rbp)
jle    111d <phredToPhred64+0x1d>
movl   $0x5d,-0x4(%rbp)
jmp    1133 <phredToPhred64+0x33>
cmpl   $0x0,-0x4(%rbp)
jge    112e <phredToPhred64+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1133 <phredToPhred64+0x33>
mov    -0x4(%rbp),%eax
add    $0x40,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<phredToPhred64>:
xor    %eax,%eax
test   %edi,%edi
cmovg  %edi,%eax
add    $0x40,%al
cmp    $0x5e,%edi
movzbl %al,%ecx
mov    $0x9d,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @phredToPhred64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 93
br i1 %4, label %5, label %6
5: ; preds = %1
store i32 93, i32* %2
br label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 0, i32* %2
br label %10
10: ; preds = %9, %6
br label %11
11: ; preds = %10, %5
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 64
%14 = trunc i32 %13 to i8
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @phredToPhred64(i32 %0) {
%2 = icmp sgt i32 %0, 93
%3 = icmp sgt i32 %0, 0
%4 = select i1 %3, i32 %0, i32 0
%5 = trunc i32 %4 to i8
%6 = add i8 %5, 64
%7 = select i1 %2, i8 -99, i8 %6
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ redecl3();
void use119() { redecl3(); }


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

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

LLVM IR (-O0):
define void @use119() {
%1 = call i32 (...) @redecl3()
ret void
}

LLVM IR (-O2):
define void @use119() {
%1 = tail call i32 (...) @redecl3()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void foo(int x, int y, int z) {
  if (x != 245 || y != 36 || z != 444)
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0xf5,-0x4(%rbp)
jne    1145 <foo+0x35>
cmpl   $0x24,-0x8(%rbp)
jne    1145 <foo+0x35>
cmpl   $0x1bc,-0xc(%rbp)
je     114c <foo+0x3c>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0xf5,%edi
jne    1126 <foo+0x16>
cmp    $0x24,%esi
jne    1126 <foo+0x16>
cmp    $0x1bc,%edx
jne    1126 <foo+0x16>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo(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 = icmp ne i32 %7, 245
br i1 %8, label %15, label %9
9: ; preds = %3
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 36
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %6
%14 = icmp ne i32 %13, 444
br i1 %14, label %15, label %17
15: ; preds = %12, %9, %3
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1, i32 %2) {
%4 = icmp ne i32 %0, 245
%5 = icmp ne i32 %1, 36
%6 = or i1 %4, %5
%7 = icmp ne i32 %2, 444
%8 = or i1 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %3
ret void
}
/* Variables and functions */
int M_PI;
double calcc1(double sintheta, double fieldOfViewRadial, double interleaves) {
  return 4 * M_PI * M_PI * sintheta * sintheta * fieldOfViewRadial *
         fieldOfViewRadial / (interleaves * interleaves);
}


x86 assembly (clang, -O0):
<calcc1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%eax
shl    $0x2,%eax
mov    0x2ec2(%rip),%rcx
imul   (%rcx),%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcc1>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
imul   %eax,%eax
shl    $0x2,%eax
cvtsi2sd %eax,%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm3,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @calcc1(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load i32, i32* @M_PI
%8 = mul nsw i32 4, %7
%9 = load i32, i32* @M_PI
%10 = mul nsw i32 %8, %9
%11 = sitofp i32 %10 to double
%12 = load double, double* %4
%13 = fmul double %11, %12
%14 = load double, double* %4
%15 = fmul double %13, %14
%16 = load double, double* %5
%17 = fmul double %15, %16
%18 = load double, double* %5
%19 = fmul double %17, %18
%20 = load double, double* %6
%21 = load double, double* %6
%22 = fmul double %20, %21
%23 = fdiv double %19, %22
ret double %23
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @calcc1(double %0, double %1, double %2) {
%4 = load i32, i32* @M_PI
%5 = shl nsw i32 %4, 2
%6 = mul nsw i32 %5, %4
%7 = sitofp i32 %6 to double
%8 = fmul double %7, %0
%9 = fmul double %8, %0
%10 = fmul double %9, %1
%11 = fmul double %10, %1
%12 = fmul double %2, %2
%13 = fdiv double %11, %12
ret double %13
}
int zero(double x[], int n) {
  int i;
  for (i = 0; i < n; i++)
    x[i] = 0;
  return (0);
}


x86 assembly (clang, -O0):
<zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <zero+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <zero+0x12>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero>:
test   %esi,%esi
jle    1126 <zero+0x16>
push   %rax
mov    %esi,%edx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @zero(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load double*, double** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
store double 0.000000e+00, double* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @zero(double* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast double* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 3
br label %8
8: ; preds = %4, %2
ret i32 0
}
/* Variables and functions */
int Minu(int, unsigned int);
unsigned Min3u(unsigned a, unsigned b, unsigned c) {
  return Minu(Minu(a, b), c);
}


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

x86 assembly (clang, -O2):
<Min3u>:
push   %rbx
mov    %edx,%ebx
call   1030 <Minu@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <Minu@plt>

LLVM IR (-O0):
define i32 @Min3u(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 = load i32, i32* %5
%9 = call i32 @Minu(i32 %7, i32 %8)
%10 = load i32, i32* %6
%11 = call i32 @Minu(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @Min3u(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @Minu(i32 %0, i32 %1)
%5 = tail call i32 @Minu(i32 %4, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ write_string(char *);
void send_draw() { write_string("offer draw\n"); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"offer draw\0A\00"
define void @send_draw() {
%1 = tail call i32 @write_string(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
double clad_mind(double one, double two) { return (one < two) ? one : two; }


x86 assembly (clang, -O0):
<clad_mind>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <clad_mind+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <clad_mind+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_mind>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @clad_mind(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @clad_mind(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
int isomgr_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @isomgr_init() {
ret i32 0
}