xunge/DecIR huggingface dataset:
void bpnn_initialize(seed) {
  printf("Random number generator seed: %d\n", seed);
  srand(seed);
}


x86 assembly (clang, -O0):
<bpnn_initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpnn_initialize>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1040 <srand@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Random number generator seed: %d\0A\00"
define void @bpnn_initialize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = call i32 (i32, ...) bitcast (i32 (...)* @srand to i32 (i32, ...)*)(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Random number generator seed: %d\0A\00"
define void @bpnn_initialize(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @srand to i32 (i32, ...)*)(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ baz(int);
void foo() { baz(1); }


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

x86 assembly (clang, -O2):
<foo>:
mov    $0x1,%edi
jmp    1030 <baz@plt>

LLVM IR (-O0):
define void @foo() {
%1 = call i32 @baz(i32 1)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @baz(i32 1)
ret void
}
void foo4a() {}


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

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

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

LLVM IR (-O2):
define void @foo4a() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int main(int argc, char *argv[]) {
  if (argc)
    printf("%s,%i\n", argv[0], argc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1146 <main+0x36>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x8(%rbp),%edx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
test   %edi,%edi
je     112a <main+0x1a>
push   %rax
mov    %edi,%edx
mov    (%rsi),%rsi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s,%i\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %0)
br label %7
7: ; preds = %4, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xda() {
  Assert_real((isodigit(218) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              1095, ("isodigit should be 0 for 0xda"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xda>:
push   %rax
mov    $0xda,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x447,%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 = [30 x i8] c"isodigit should be 0 for 0xda\00"
define void @t_isodigit_0xda() {
%1 = call i64 @isodigit(i32 218)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1095, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

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


x86 assembly (clang, -O0):
<initiateRand>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @initiateRand() {
%1 = call i32 @time(i32 0)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @initiateRand() {
%1 = tail call i32 @time(i32 0)
%2 = tail call i32 @srand(i32 %1)
ret void
}
int security_file_permission(struct file *file, int mask) { return 0; }


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

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

LLVM IR (-O0):
%struct.file = type opaque
define i32 @security_file_permission(%struct.file* %0, i32 %1) {
%3 = alloca %struct.file*
%4 = alloca i32
store %struct.file* %0, %struct.file** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.file = type opaque
define i32 @security_file_permission(%struct.file* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t *h264avcc_spsh_get_sps(const uint8_t *p) { return (uint8_t *)p + 2; }


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

x86 assembly (clang, -O2):
<h264avcc_spsh_get_sps>:
lea    0x8(%rdi),%rax
ret

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

LLVM IR (-O2):
define i32* @h264avcc_spsh_get_sps(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
ret i32* %2
}
char *langRomTypeEseRam1mb() { return "1MB Ese-RAM"; }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"1MB Ese-RAM\00"
define i8* @langRomTypeEseRam1mb() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"1MB Ese-RAM\00"
define i8* @langRomTypeEseRam1mb() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
int ld_lt_rr2(long double a1, long double a2) { return !(((a1) < (a2))); }


x86 assembly (clang, -O0):
<ld_lt_rr2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_lt_rr2>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setbe  %al
ret

LLVM IR (-O0):
define i32 @ld_lt_rr2(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fcmp olt x86_fp80 %5, %6
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @ld_lt_rr2(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp uge x86_fp80 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct cpack_state {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int cpack_uint64(struct cpack_state *, int /*<<< orphan*/ *);
int cpack_int64(struct cpack_state *s, int64_t *p) {
  return cpack_uint64(s, (uint64_t *)p);
}


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

x86 assembly (clang, -O2):
<cpack_int64>:
jmp    1030 <cpack_uint64@plt>

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

LLVM IR (-O2):
%struct.cpack_state = type { i32 }
define i32 @cpack_int64(%struct.cpack_state* %0, i32* %1) {
%3 = tail call i32 @cpack_uint64(%struct.cpack_state* %0, i32* %1)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void CANIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) &= ~ui32IntFlags;
}


x86 assembly (clang, -O0):
<CANIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANIntDisable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
not    %rax
mov    -0x8(%rsp),%rcx
and    %rax,(%rcx)
ret

LLVM IR (-O0):
define void @CANIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add nsw i64 %7, 0
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @CANIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, %6
store volatile i64 %10, i64* %8
ret void
}
int min(int valor1, int valor2) {
  if (valor1 < valor2)
    return valor1;
  else
    return valor2;
}


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

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

LLVM IR (-O0):
define i32 @min(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
unsigned int my_rand(unsigned long *seed, unsigned int lbound,
                     unsigned int ubound) {
  ubound = (!ubound ? 1 : ubound);
  *seed = (unsigned long)(*seed * 0x6fe5) + 0x7ab9;
  return (unsigned int)(lbound + ((*seed & 0x0ff0) >> 4) % ubound);
}


x86 assembly (clang, -O0):
<my_rand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1125 <my_rand+0x25>
mov    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <my_rand+0x2b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x6fe5,(%rax),%rcx
add    $0x7ab9,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
and    $0xff0,%rax
shr    $0x4,%rax
mov    -0x10(%rbp),%ecx
xor    %edx,%edx
div    %rcx
mov    -0x20(%rbp),%rax
add    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_rand>:
test   %edx,%edx
mov    $0x1,%ecx
cmovne %edx,%ecx
imul   $0x6fe5,(%rdi),%rax
add    $0x7ab9,%rax
mov    %rax,(%rdi)
shr    $0x4,%eax
movzbl %al,%eax
xor    %edx,%edx
div    %ecx
lea    (%rdx,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @my_rand(i64* %0, i32 %1, i32 %2) {
%4 = alloca i64*
%5 = alloca i32
%6 = alloca i32
store i64* %0, i64** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %3
br label %12
10: ; preds = %3
%11 = load i32, i32* %6
br label %12
12: ; preds = %10, %9
%13 = phi i32 [ 1, %9 ], [ %11, %10 ]
store i32 %13, i32* %6
%14 = load i64*, i64** %4
%15 = load i64, i64* %14
%16 = mul i64 %15, 28645
%17 = add i64 %16, 31417
%18 = load i64*, i64** %4
store i64 %17, i64* %18
%19 = load i32, i32* %5
%20 = zext i32 %19 to i64
%21 = load i64*, i64** %4
%22 = load i64, i64* %21
%23 = and i64 %22, 4080
%24 = lshr i64 %23, 4
%25 = load i32, i32* %6
%26 = zext i32 %25 to i64
%27 = urem i64 %24, %26
%28 = add i64 %20, %27
%29 = trunc i64 %28 to i32
ret i32 %29
}

LLVM IR (-O2):
define i32 @my_rand(i64* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = select i1 %4, i32 1, i32 %2
%6 = load i64, i64* %0
%7 = mul i64 %6, 28645
%8 = add i64 %7, 31417
store i64 %8, i64* %0
%9 = trunc i64 %8 to i32
%10 = lshr i32 %9, 4
%11 = and i32 %10, 255
%12 = urem i32 %11, %5
%13 = add i32 %12, %1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argvp[]) {
  printf("Hello, world!\n");
  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)
lea    0xed3(%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 = [15 x i8] c"Hello, world!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
extern void *ReturnSomePointer() {
  char *x = "Got passed back the pointer I returned";
  return x;
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"Got passed back the pointer I returned\00"
define i8* @ReturnSomePointer() {
%1 = alloca i8*
store i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
@.str = [39 x i8] c"Got passed back the pointer I returned\00"
define i8* @ReturnSomePointer() {
ret i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0)
}
void copy3d3f(double *v1, float *v2) {
  v2[0] = (float)v1[0];
  v2[1] = (float)v1[1];
  v2[2] = (float)v1[2];
}


x86 assembly (clang, -O0):
<copy3d3f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy3d3f>:
movsd  (%rdi),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rsi)
movsd  0x8(%rdi),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x4(%rsi)
movsd  0x10(%rdi),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsi)
ret

LLVM IR (-O0):
define void @copy3d3f(double* %0, float* %1) {
%3 = alloca double*
%4 = alloca float*
store double* %0, double** %3
store float* %1, float** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = fptrunc double %7 to float
%9 = load float*, float** %4
%10 = getelementptr inbounds float, float* %9, i64 0
store float %8, float* %10
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = fptrunc double %13 to float
%15 = load float*, float** %4
%16 = getelementptr inbounds float, float* %15, i64 1
store float %14, float* %16
%17 = load double*, double** %3
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = fptrunc double %19 to float
%21 = load float*, float** %4
%22 = getelementptr inbounds float, float* %21, i64 2
store float %20, float* %22
ret void
}

LLVM IR (-O2):
define void @copy3d3f(double* nocapture %0, float* nocapture writeonly %1) {
%3 = load double, double* %0
%4 = fptrunc double %3 to float
store float %4, float* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = fptrunc double %6 to float
%8 = getelementptr inbounds float, float* %1, i64 1
store float %7, float* %8
%9 = getelementptr inbounds double, double* %0, i64 2
%10 = load double, double* %9
%11 = fptrunc double %10 to float
%12 = getelementptr inbounds float, float* %1, i64 2
store float %11, float* %12
ret void
}
void main() {
  int *addr1 = (int *)0x10000000;
  *addr1 = 0x55;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x55,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x55,0x10000000
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i32*
store i32* inttoptr (i64 268435456 to i32*), i32** %1
%2 = load i32*, i32** %1
store i32 85, i32* %2
ret void
}

LLVM IR (-O2):
define void @main() {
store i32 85, i32* inttoptr (i64 268435456 to i32*)
ret void
}
void RTLockValidatorIsQuiet(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorIsQuiet() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__31__IO__makeOutput();
void Msp430GpioC__13__HplGeneralIO__makeOutput(void) {
  HplMsp430GeneralIOP__31__IO__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__13__HplGeneralIO__makeOutput() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__31__IO__makeOutput()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void gizmo_error(int sockfd, const char *message) {
  write(sockfd, message, strlen(message));
}


x86 assembly (clang, -O0):
<gizmo_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gizmo_error>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @gizmo_error(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret void
}
void *reduce_sum(void *acc, void *val) {
  int x = (int)acc;
  int y = (int)val;
  return (int *)(x + y);
}


x86 assembly (clang, -O0):
<reduce_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<reduce_sum>:
add    %edi,%esi
movslq %esi,%rax
ret

LLVM IR (-O0):
define i8* @reduce_sum(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i32
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i32
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = bitcast i32* %15 to i8*
ret i8* %16
}

LLVM IR (-O2):
define i8* @reduce_sum(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = add i64 %4, %3
%6 = shl i64 %5, 32
%7 = ashr exact i64 %6, 32
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}
__attribute__((no)) unsigned long andc_vv(unsigned long a, unsigned long b) {
  return ~b & a;
}


x86 assembly (clang, -O0):
<andc_vv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<andc_vv>:
mov    %rsi,%rax
not    %rax
and    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @andc_vv(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = xor i64 %5, -1
%7 = load i64, i64* %3
%8 = and i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @andc_vv(i64 %0, i64 %1) {
%3 = xor i64 %1, -1
%4 = and i64 %3, %0
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int __enosys() {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<__enosys>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @__enosys() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @__enosys() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}
float expon(int n, int x) {
  if (x == 0)
    return 1.0;
  else
    return n * expon(n, x - 1);
}


x86 assembly (clang, -O0):
<expon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    113a <expon+0x2a>
movss  0xed0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1163 <expon+0x53>
cvtsi2ssl -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <expon@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expon>:
push   %rax
test   %esi,%esi
je     112f <expon+0x1f>
cvtsi2ss %edi,%xmm0
movss  %xmm0,0x4(%rsp)
add    $0xffffffff,%esi
call   1030 <expon@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret
movss  0xec9(%rip),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @expon(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2, %6
%5 = phi float [ %10, %6 ], [ 1.000000e+00, %2 ]
ret float %5
6: ; preds = %2
%7 = sitofp i32 %0 to float
%8 = add nsw i32 %1, -1
%9 = tail call float @expon(i32 %0, i32 %8)
%10 = fmul float %9, %7
br label %4
}
const char *skip_comment(const char *str) {
  if (*str == ';')
    while (*str && *str != '\n')
      str++;
  return str;
}


x86 assembly (clang, -O0):
<skip_comment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3b,%eax
jne    1168 <skip_comment+0x68>
jmp    111d <skip_comment+0x1d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1142 <skip_comment+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1152 <skip_comment+0x52>
jmp    1163 <skip_comment+0x63>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111d <skip_comment+0x1d>
jmp    1168 <skip_comment+0x68>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_comment>:
mov    %rdi,%rax
cmpb   $0x3b,(%rdi)
jne    1121 <skip_comment+0x21>
mov    $0x3b,%cl
test   %cl,%cl
je     1121 <skip_comment+0x21>
xchg   %ax,%ax
cmp    $0xa,%cl
je     1121 <skip_comment+0x21>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <skip_comment+0x10>
ret

LLVM IR (-O0):
define i8* @skip_comment(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 59
br i1 %6, label %7, label %24
7: ; preds = %1
br label %8
8: ; preds = %20, %7
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 10
br label %18
18: ; preds = %13, %8
%19 = phi i1 [ false, %8 ], [ %17, %13 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %2
br label %8
23: ; preds = %18
br label %24
24: ; preds = %23, %1
%25 = load i8*, i8** %2
ret i8* %25
}

LLVM IR (-O2):
define i8* @skip_comment(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 59
br i1 %3, label %4, label %10
4: ; preds = %1, %7
%5 = phi i8 [ %9, %7 ], [ 59, %1 ]
%6 = phi i8* [ %8, %7 ], [ %0, %1 ]
switch i8 %5, label %7 [
i8 0, label %10
i8 10, label %10
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
br label %4
10: ; preds = %4, %4, %1
%11 = phi i8* [ %0, %1 ], [ %6, %4 ], [ %6, %4 ]
ret i8* %11
}
int isprime(int n) {
  int i;
  for (i = 2; i <= n / 2; i++) {
    if (n % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     115b <isprime+0x5b>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1148 <isprime+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1162 <isprime+0x62>
jmp    114d <isprime+0x4d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isprime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
mov    $0x1,%r8d
cmp    $0x4,%edi
jl     1137 <isprime+0x37>
mov    %edi,%esi
shr    %esi
neg    %esi
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     113b <isprime+0x3b>
lea    (%rsi,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ecx
cmp    $0x1,%eax
jne    1120 <isprime+0x20>
mov    %r8d,%eax
ret
xor    %r8d,%r8d
mov    %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @isprime(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i32 %0, 1
br label %8
5: ; preds = %8
%6 = add nuw nsw i32 %9, 1
%7 = icmp eq i32 %9, %4
br i1 %7, label %12, label %8
8: ; preds = %3, %5
%9 = phi i32 [ %6, %5 ], [ 2, %3 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %8, %5, %1
%13 = phi i32 [ 1, %1 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %13
}
/* Type definitions */
struct lvinfo_item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ lvinfo_add_items(struct lvinfo_item *, int);
void lvinfo_add_item(struct lvinfo_item *item) { lvinfo_add_items(item, 1); }


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

x86 assembly (clang, -O2):
<lvinfo_add_item>:
mov    $0x1,%esi
jmp    1030 <lvinfo_add_items@plt>

LLVM IR (-O0):
%struct.lvinfo_item = type { i32 }
define void @lvinfo_add_item(%struct.lvinfo_item* %0) {
%2 = alloca %struct.lvinfo_item*
store %struct.lvinfo_item* %0, %struct.lvinfo_item** %2
%3 = load %struct.lvinfo_item*, %struct.lvinfo_item** %2
%4 = call i32 @lvinfo_add_items(%struct.lvinfo_item* %3, i32 1)
ret void
}

LLVM IR (-O2):
%struct.lvinfo_item = type { i32 }
define void @lvinfo_add_item(%struct.lvinfo_item* %0) {
%2 = tail call i32 @lvinfo_add_items(%struct.lvinfo_item* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int scanf(char *, double *);
main() {
  double sum, v;
  sum = 0;
  while (scanf("%lf", &v) == 1)
    printf("\t%.2f\n", sum += v);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1170 <main+0x50>
movsd  -0x18(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
jmp    1137 <main+0x17>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    118d <main+0x6d>
xorpd  %xmm0,%xmm0
lea    0xeba(%rip),%r14
lea    0xeaf(%rip),%r15
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rsp)
mov    %r14,%rdi
movsd  (%rsp),%xmm0
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
cmp    $0x1,%eax
je     1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [7 x i8] c"\09%.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
br label %4
4: ; preds = %7, %0
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load double, double* %3
%9 = load double, double* %2
%10 = fadd double %9, %8
store double %10, double* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %10)
br label %4
12: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [7 x i8] c"\09%.2f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %12
5: ; preds = %0, %5
%6 = phi double [ %8, %5 ], [ 0.000000e+00, %0 ]
%7 = load double, double* %1
%8 = fadd double %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %8)
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%11 = icmp eq i32 %10, 1
br i1 %11, label %5, label %12
12: ; preds = %5, %0
ret i32 0
}
unsigned test_leftmost_one(unsigned x) {
  unsigned mask;
  for (mask = 1u << 31; mask; mask >>= 1)
    if (x & mask)
      return mask;
  return 0;
}


x86 assembly (clang, -O0):
<test_leftmost_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x80000000,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1145 <test_leftmost_one+0x45>
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
cmp    $0x0,%eax
je     1132 <test_leftmost_one+0x32>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114c <test_leftmost_one+0x4c>
jmp    1137 <test_leftmost_one+0x37>
mov    -0xc(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <test_leftmost_one+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_leftmost_one>:
mov    $0x80000000,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%eax
test   %ecx,%ecx
je     1122 <test_leftmost_one+0x22>
mov    %eax,%edx
and    %edi,%edx
mov    %eax,%ecx
shr    %ecx
test   %edx,%edx
je     1110 <test_leftmost_one+0x10>
ret

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

LLVM IR (-O2):
define i32 @test_leftmost_one(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ -2147483648, %1 ], [ %8, %2 ]
%4 = icmp ne i32 %3, 0
%5 = and i32 %3, %0
%6 = icmp eq i32 %5, 0
%7 = and i1 %4, %6
%8 = lshr i32 %3, 1
br i1 %7, label %2, label %9
9: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblockq_get_length() {
  printf("NOT IMPLEMENTED:"
         "pa_memblockq_get_length"
         "\n");
}


x86 assembly (clang, -O0):
<pa_memblockq_get_length>:
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):
<pa_memblockq_get_length>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [40 x i8] c"NOT IMPLEMENTED:pa_memblockq_get_length\00"
define i32 @pa_memblockq_get_length() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char *stpcpy(char *dst, const char *src) {
  assert(dst != NULL && src != NULL);
  while ((*dst++ = *src++) != 0)
    ;
  return (dst - 1);
}


x86 assembly (clang, -O0):
<stpcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     113b <stpcpy+0x2b>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     117b <stpcpy+0x6b>
jmp    1148 <stpcpy+0x38>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stpcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
add    $0xffffffffffffffff,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%r14),%eax
add    $0x1,%r14
mov    %al,0x1(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1140 <stpcpy+0x30>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @stpcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
br label %14
14: ; preds = %22, %10
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %4
%17 = load i8, i8* %15
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
store i8 %17, i8* %18
%20 = sext i8 %17 to i32
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %14
br label %14
23: ; preds = %14
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 -1
ret i8* %25
}

LLVM IR (-O2):
define i8* @stpcpy(i8* writeonly %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
br label %8
8: ; preds = %8, %2
%9 = phi i8* [ %0, %2 ], [ %13, %8 ]
%10 = phi i8* [ %1, %2 ], [ %11, %8 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %9
}
/* Variables and functions */
unsigned short _cvtss_sh(float, int /*<<< orphan*/);
unsigned short test_cvtss_sh(float a) { return _cvtss_sh(a, 0); }


x86 assembly (clang, -O0):
<test_cvtss_sh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xor    %edi,%edi
call   1030 <_cvtss_sh@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cvtss_sh>:
xor    %edi,%edi
jmp    1030 <_cvtss_sh@plt>

LLVM IR (-O0):
define zeroext i16 @test_cvtss_sh(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call zeroext i16 @_cvtss_sh(float %3, i32 0)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @test_cvtss_sh(float %0) {
%2 = tail call zeroext i16 @_cvtss_sh(float %0, i32 0)
ret i16 %2
}
void case_fault() { *(int *)0 = 0; }


x86 assembly (clang, -O0):
<case_fault>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @case_fault() {
store i32 0, i32* null
ret void
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x76() {
  Assert_real((isspace(118) == 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_isspace.c",
              595, ("isspace should be 0 for v"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x76>:
push   %rax
mov    $0x76,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x253,%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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for v\00"
define void @t_isspace_0x76() {
%1 = call i64 @isspace(i32 118)
%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 595, 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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for v\00"
define void @t_isspace_0x76() {
%1 = tail call i64 @isspace(i32 118)
%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 595, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int read_quaddobl_start_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(767, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<read_quaddobl_start_Laurent_system>:
mov    $0x2ff,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @read_quaddobl_start_Laurent_system() {
%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_c2phc(i32 767, 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 @read_quaddobl_start_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 767, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ function_which_gives_up(int *);
scalar_t__ malloc(int);
void coverage2(int *x) {
  if (x) {
    function_which_gives_up(x);
    char *m = (char *)malloc(12);
  }
}


x86 assembly (clang, -O0):
<coverage2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114e <coverage2+0x2e>
mov    -0x8(%rbp),%rdi
call   1030 <function_which_gives_up@plt>
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coverage2>:
test   %rdi,%rdi
je     1136 <coverage2+0x16>
push   %rax
call   1030 <function_which_gives_up@plt>
mov    $0xc,%edi
pop    %rax
jmp    1040 <malloc@plt>
ret

LLVM IR (-O0):
define void @coverage2(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = call i32 @function_which_gives_up(i32* %7)
%9 = call i64 @malloc(i32 12)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %3
br label %11
11: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @coverage2(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @function_which_gives_up(i32* %0)
%5 = tail call i64 @malloc(i32 12)
br label %6
6: ; preds = %3, %1
ret void
}