xunge/DecIR huggingface dataset:
int sync_test_and_change_bit(long nr, volatile unsigned long *addr) {
  unsigned char oldbit;
  asm volatile("lock; btc %2,%1\n\tsetc %0"
               : "=qm"(oldbit), "+m"((*(volatile long *)addr))
               : "Ir"(nr)
               : "memory");
  return oldbit;
}


x86 assembly (clang, -O0):
<sync_test_and_change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
lock btc %rcx,(%rax)
setb   -0x11(%rbp)
movzbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_test_and_change_bit>:
lock btc %rdi,(%rsi)
setb   -0x1(%rsp)
movzbl -0x1(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @sync_test_and_change_bit(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca i8
store i64 %0, i64* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i64, i64* %3
%8 = load i8, i8* %5
%9 = zext i8 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @sync_test_and_change_bit(i64 %0, i64* %1) {
%3 = alloca i8
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
ret i32 %5
}
int output_data(struct huffman *huffman) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.huffman = type opaque
define i32 @output_data(%struct.huffman* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
void msecs_to_timespec(int msecs, struct timespec *tmspec) {
  tmspec->tv_sec = msecs / 1000;
  tmspec->tv_nsec = (msecs % 1000) * 1000 * 1000;
}


x86 assembly (clang, -O0):
<msecs_to_timespec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0x3e8,%edx,%eax
imul   $0x3e8,%eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<msecs_to_timespec>:
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,(%rsi)
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0xf4240,%eax,%eax
mov    %eax,0x4(%rsi)
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @msecs_to_timespec(i32 %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca %struct.timespec*
store i32 %0, i32* %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load i32, i32* %3
%6 = sdiv i32 %5, 1000
%7 = load %struct.timespec*, %struct.timespec** %4
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
store i32 %6, i32* %8
%9 = load i32, i32* %3
%10 = srem i32 %9, 1000
%11 = mul nsw i32 %10, 1000
%12 = mul nsw i32 %11, 1000
%13 = load %struct.timespec*, %struct.timespec** %4
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %13, i32 0, i32 1
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @msecs_to_timespec(i32 %0, %struct.timespec* nocapture writeonly %1) {
%3 = sdiv i32 %0, 1000
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
store i32 %3, i32* %4
%5 = srem i32 %0, 1000
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
store i32 %6, i32* %7
ret void
}
int main(int argc, const char *argv[]) {}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void g_scanner_get_next_token() {}


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

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

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

LLVM IR (-O2):
define void @g_scanner_get_next_token() {
ret void
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_newsvardir(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_newsvardir>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_newsvardir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_newsvardir(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
float __nv_fmaf_rd(float, float, float);
float __fmaf_rd(float __a, float __b, float __c) {
  return __nv_fmaf_rd(__a, __b, __c);
}


x86 assembly (clang, -O0):
<__fmaf_rd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <__nv_fmaf_rd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fmaf_rd>:
jmp    1030 <__nv_fmaf_rd@plt>

LLVM IR (-O0):
define float @__fmaf_rd(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @__nv_fmaf_rd(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @__fmaf_rd(float %0, float %1, float %2) {
%4 = tail call float @__nv_fmaf_rd(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_operation_ref() {
  printf("NOT IMPLEMENTED:"
         "pa_operation_ref"
         "\n");
}


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

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

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_operation_ref\00"
define i32 @pa_operation_ref() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ malloc(int);
char *itob(int integer) {
  int i;
  int size = 4;
  char *result = (char *)malloc(sizeof(char) * size);
  char *aux = (char *)&integer;
  for (i = size - 1; i >= 0; i--) {
    result[size - 1 - i] = aux[i];
  }
  return result;
}


x86 assembly (clang, -O0):
<itob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     117c <itob+0x6c>
mov    -0x20(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
sub    -0x8(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <itob+0x36>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itob>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <malloc@plt>
bswap  %ebx
mov    %ebx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @itob(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %2
store i32 4, i32* %4
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = mul i64 1, %8
%10 = trunc i64 %9 to i32
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %5
%13 = bitcast i32* %2 to i8*
store i8* %13, i8** %6
%14 = load i32, i32* %4
%15 = sub nsw i32 %14, 1
store i32 %15, i32* %3
br label %16
16: ; preds = %32, %1
%17 = load i32, i32* %3
%18 = icmp sge i32 %17, 0
br i1 %18, label %19, label %35
19: ; preds = %16
%20 = load i8*, i8** %6
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = load i8*, i8** %5
%26 = load i32, i32* %4
%27 = sub nsw i32 %26, 1
%28 = load i32, i32* %3
%29 = sub nsw i32 %27, %28
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %25, i64 %30
store i8 %24, i8* %31
br label %32
32: ; preds = %19
%33 = load i32, i32* %3
%34 = add nsw i32 %33, -1
store i32 %34, i32* %3
br label %16
35: ; preds = %16
%36 = load i8*, i8** %5
ret i8* %36
}

LLVM IR (-O2):
define i8* @itob(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = lshr i32 %0, 8
%4 = trunc i32 %3 to i8
%5 = lshr i32 %0, 16
%6 = trunc i32 %5 to i8
%7 = lshr i32 %0, 24
%8 = trunc i32 %7 to i8
%9 = tail call i64 @malloc(i32 4)
%10 = inttoptr i64 %9 to i8*
store i8 %8, i8* %10
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %6, i8* %11
%12 = getelementptr inbounds i8, i8* %10, i64 2
store i8 %4, i8* %12
%13 = getelementptr inbounds i8, i8* %10, i64 3
store i8 %2, i8* %13
ret i8* %10
}
/* Type definitions */
struct gpio_desc {
  int dummy;
};

/* Variables and functions */
int gpio_hog_list(struct gpio_desc *, int, char const *, char const *, int);
int gpio_hog(struct gpio_desc *gpiod, const char *node_name,
             const char *gpio_name, int value) {
  return gpio_hog_list(gpiod, 1, node_name, gpio_name, value);
}


x86 assembly (clang, -O0):
<gpio_hog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%esi
call   1030 <gpio_hog_list@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_hog>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <gpio_hog_list@plt>

LLVM IR (-O0):
%struct.gpio_desc = type { i32 }
define i32 @gpio_hog(%struct.gpio_desc* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca %struct.gpio_desc*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store %struct.gpio_desc* %0, %struct.gpio_desc** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct.gpio_desc*, %struct.gpio_desc** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @gpio_hog_list(%struct.gpio_desc* %9, i32 1, i8* %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.gpio_desc = type { i32 }
define i32 @gpio_hog(%struct.gpio_desc* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @gpio_hog_list(%struct.gpio_desc* %0, i32 1, i8* %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ minibuf_write(char *);
int /*<<< orphan*/ set_mark();
int set_mark_command(void) {
  set_mark();
  minibuf_write("Mark set");
  return 1;
}


x86 assembly (clang, -O0):
<set_mark_command>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <set_mark@plt>
lea    0xece(%rip),%rdi
call   1030 <minibuf_write@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_mark_command>:
push   %rax
xor    %eax,%eax
call   1040 <set_mark@plt>
lea    0xed1(%rip),%rdi
call   1030 <minibuf_write@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Mark set\00"
define i32 @set_mark_command() {
%1 = call i32 (...) @set_mark()
%2 = call i32 @minibuf_write(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [9 x i8] c"Mark set\00"
define i32 @set_mark_command() {
%1 = tail call i32 (...) @set_mark()
%2 = tail call i32 @minibuf_write(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ do_split(char *, char **);
void split_values(char **names, char **values, unsigned int n) {
  unsigned int i;
  for (i = 0; i < n; i++)
    do_split(names[i], &values[i]);
}


x86 assembly (clang, -O0):
<split_values>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1162 <split_values+0x52>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%eax
shl    $0x3,%rax
add    %rax,%rsi
call   1030 <do_split@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <split_values+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<split_values>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
je     1146 <split_values+0x36>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
shl    $0x3,%r12
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,1),%rdi
lea    (%r14,%rbx,1),%rsi
call   1030 <do_split@plt>
add    $0x8,%rbx
cmp    %rbx,%r12
jne    1130 <split_values+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @split_values(i8** %0, i8** %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i8** %0, i8*** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %23, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp ult i32 %9, %10
br i1 %11, label %12, label %26
12: ; preds = %8
%13 = load i8**, i8*** %4
%14 = load i32, i32* %7
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = load i8**, i8*** %5
%19 = load i32, i32* %7
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = call i32 @do_split(i8* %17, i8** %21)
br label %23
23: ; preds = %12
%24 = load i32, i32* %7
%25 = add i32 %24, 1
store i32 %25, i32* %7
br label %8
26: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @split_values(i8** nocapture %0, i8** %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %15, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8*, i8** %1, i64 %8
%12 = tail call i32 @do_split(i8* %10, i8** %11)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
int test_imm_F2uint16_mem(unsigned short *val) {
  return ((*val) & (-0xF2 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F2uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -242
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x91() {
  Assert_real((isspace(145) == 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",
              730, ("isspace should be 0 for 0x91"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x91>:
push   %rax
mov    $0x91,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2da,%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 = [29 x i8] c"isspace should be 0 for 0x91\00"
define void @t_isspace_0x91() {
%1 = call i64 @isspace(i32 145)
%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 730, i8* getelementptr inbounds ([29 x i8], [29 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 = [29 x i8] c"isspace should be 0 for 0x91\00"
define void @t_isspace_0x91() {
%1 = tail call i64 @isspace(i32 145)
%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 730, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int fsync(int fd) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @fsync(i32 %0) {
ret i32 -1
}
int unregister_blkdev(unsigned int x, char *y) {
  int a;
  return a;
}


x86 assembly (clang, -O0):
<unregister_blkdev>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @unregister_blkdev(i32 %0, i8* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int random();
int /*<<< orphan*/ stderr;
int random_centered(int interval) {
  if (interval == 0) {
    fprintf(stderr, "derp\n");
    exit(1);
  }
  return random() % interval - interval / 2;
}


x86 assembly (clang, -O0):
<random_centered>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1164 <random_centered+0x34>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    $0x0,%al
call   1040 <random@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_centered>:
push   %rbx
test   %edi,%edi
je     1150 <random_centered+0x20>
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <random@plt>
cltd
idiv   %ebx
mov    %edx,%eax
mov    %ebx,%ecx
shr    $0x1f,%ecx
add    %ebx,%ecx
sar    %ecx
sub    %ecx,%eax
pop    %rbx
ret
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"derp\0A\00"
define i32 @random_centered(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = call i32 (...) @random()
%11 = load i32, i32* %2
%12 = srem i32 %10, %11
%13 = load i32, i32* %2
%14 = sdiv i32 %13, 2
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"derp\0A\00"
define i32 @random_centered(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = tail call i32 (...) @random()
%9 = srem i32 %8, %0
%10 = sdiv i32 %0, -2
%11 = add i32 %9, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fb_clear();
void clrscr() { fb_clear(); }


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

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

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

LLVM IR (-O2):
define void @clrscr() {
%1 = tail call i32 (...) @fb_clear()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void xpath_error_callback(void *_instance, ...) {
  printf("xpath_error_callback is called\n");
}


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

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

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

LLVM IR (-O2):
@str = [31 x i8] c"xpath_error_callback is called\00"
define void @xpath_error_callback(i8* nocapture readnone %0, ...) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int printf(char *);
int main() { return printf("hello world!\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}

LLVM IR (-O2):
@.str = [14 x i8] c"hello world!\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
__attribute__((visibility("hidden"))) float fmaf(float x, float y, float z) {
  return (x * y) + z;
}


x86 assembly (clang, -O0):
<fmaf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmaf>:
mulss  %xmm1,%xmm0
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define hidden float @fmaf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @llvm.fmuladd.f32(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define hidden float @fmaf(float %0, float %1, float %2) {
%4 = tail call float @llvm.fmuladd.f32(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ CRCTable_Init();
unsigned long CRC_BufferInternal(unsigned char *, unsigned long, unsigned long);
unsigned long CRC_Buffer(unsigned char *buffer, unsigned long len,
                         unsigned long crc) {
  CRCTable_Init();
  return (CRC_BufferInternal(buffer, len, crc));
}


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

x86 assembly (clang, -O2):
<CRC_Buffer>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <CRCTable_Init@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <CRC_BufferInternal@plt>

LLVM IR (-O0):
define i64 @CRC_Buffer(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = call i32 (...) @CRCTable_Init()
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = call i64 @CRC_BufferInternal(i8* %8, i64 %9, i64 %10)
ret i64 %11
}

LLVM IR (-O2):
define i64 @CRC_Buffer(i8* %0, i64 %1, i64 %2) {
%4 = tail call i32 (...) @CRCTable_Init()
%5 = tail call i64 @CRC_BufferInternal(i8* %0, i64 %1, i64 %2)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ led(int, int, int, int);
int main(int argn, char *argv[]) {
  led(0, 255, 255, 255);
  led(1, 255, 0, 255);
  led(2, 0, 255, 255);
  led(3, 255, 255, 0);
  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)
xor    %edi,%edi
mov    $0xff,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <led@plt>
mov    $0x1,%edi
mov    $0xff,%ecx
xor    %edx,%edx
mov    %ecx,%esi
call   1030 <led@plt>
mov    $0x2,%edi
xor    %esi,%esi
mov    $0xff,%ecx
mov    %ecx,%edx
call   1030 <led@plt>
mov    $0x3,%edi
mov    $0xff,%edx
xor    %ecx,%ecx
mov    %edx,%esi
call   1030 <led@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0xff,%esi
mov    $0xff,%edx
mov    $0xff,%ecx
call   1030 <led@plt>
mov    $0x1,%edi
mov    $0xff,%esi
xor    %edx,%edx
mov    $0xff,%ecx
call   1030 <led@plt>
mov    $0x2,%edi
xor    %esi,%esi
mov    $0xff,%edx
mov    $0xff,%ecx
call   1030 <led@plt>
mov    $0x3,%edi
mov    $0xff,%esi
mov    $0xff,%edx
xor    %ecx,%ecx
call   1030 <led@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @led(i32 0, i32 255, i32 255, i32 255)
%4 = tail call i32 @led(i32 1, i32 255, i32 0, i32 255)
%5 = tail call i32 @led(i32 2, i32 0, i32 255, i32 255)
%6 = tail call i32 @led(i32 3, i32 255, i32 255, i32 0)
ret i32 0
}
/* Type definitions */
struct lconv {
  scalar_t__ *decimal_point;
};

/* Variables and functions */
struct lconv *localeconv();
unsigned char get_decimal_point(void) {
  struct lconv *lconv = localeconv();
  return (unsigned char)lconv->decimal_point[0];
}


x86 assembly (clang, -O0):
<get_decimal_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <localeconv@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_decimal_point>:
push   %rax
xor    %eax,%eax
call   1030 <localeconv@plt>
mov    (%rax),%rax
mov    (%rax),%al
pop    %rcx
ret

LLVM IR (-O0):
%struct.lconv = type { i64* }
define zeroext i8 @get_decimal_point() {
%1 = alloca %struct.lconv*
%2 = call %struct.lconv* (...) @localeconv()
store %struct.lconv* %2, %struct.lconv** %1
%3 = load %struct.lconv*, %struct.lconv** %1
%4 = getelementptr inbounds %struct.lconv, %struct.lconv* %3, i32 0, i32 0
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i64 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
%struct.lconv = type { i64* }
define zeroext i8 @get_decimal_point() {
%1 = tail call %struct.lconv* (...) @localeconv()
%2 = getelementptr inbounds %struct.lconv, %struct.lconv* %1, i64 0, i32 0
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i8
ret i8 %5
}
/* Variables and functions */
int __sigpause(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sigblock(int /*<<< orphan*/);
int pause(void) { return __sigpause(sigblock(0), 0); }


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <sigblock@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <__sigpause@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rax
xor    %edi,%edi
call   1030 <sigblock@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <__sigpause@plt>

LLVM IR (-O0):
define i32 @pause() {
%1 = call i32 @sigblock(i32 0)
%2 = call i32 @__sigpause(i32 %1, i32 0)
ret i32 %2
}

LLVM IR (-O2):
define i32 @pause() {
%1 = tail call i32 @sigblock(i32 0)
%2 = tail call i32 @__sigpause(i32 %1, i32 0)
ret i32 %2
}
/* Variables and functions */
int strcpy(char *tar, char *src) {
  while ((*tar++ = *src++) != '\0') {
    ;
  }
  return 0;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
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     113f <strcpy+0x3f>
jmp    110c <strcpy+0xc>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcpy+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32 0
}
/* Variables and functions */
float logf(scalar_t__);
scalar_t__ sqrtf(float);
float asinhf(float x) { return logf(x + sqrtf(x * x + 1)); }


x86 assembly (clang, -O0):
<asinhf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xeb3(%rip),%xmm1
addss  %xmm1,%xmm0
call   1040 <sqrtf@plt>
movss  -0x8(%rbp),%xmm0
cvtsi2ss %rax,%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%rdi
call   1030 <logf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asinhf>:
push   %rax
movss  %xmm0,0x4(%rsp)
mulss  %xmm0,%xmm0
addss  0xecd(%rip),%xmm0
call   1040 <sqrtf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
addss  0x4(%rsp),%xmm0
cvttss2si %xmm0,%rdi
pop    %rax
jmp    1030 <logf@plt>

LLVM IR (-O0):
define float @asinhf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = call float @llvm.fmuladd.f32(float %4, float %5, float 1.000000e+00)
%7 = call i64 @sqrtf(float %6)
%8 = sitofp i64 %7 to float
%9 = fadd float %3, %8
%10 = fptosi float %9 to i64
%11 = call float @logf(i64 %10)
ret float %11
}

LLVM IR (-O2):
define float @asinhf(float %0) {
%2 = tail call float @llvm.fmuladd.f32(float %0, float %0, float 1.000000e+00)
%3 = tail call i64 @sqrtf(float %2)
%4 = sitofp i64 %3 to float
%5 = fadd float %4, %0
%6 = fptosi float %5 to i64
%7 = tail call float @logf(i64 %6)
ret float %7
}
/* Variables and functions */
int *dynCastOrNull(int *);
int *getNull();
void testTrackNullVariable() {
  int *ptr;
  ptr = getNull();
  int *casted = dynCastOrNull(ptr);
  *casted = 1;
}


x86 assembly (clang, -O0):
<testTrackNullVariable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getNull@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <dynCastOrNull@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTrackNullVariable>:
push   %rax
xor    %eax,%eax
call   1040 <getNull@plt>
mov    %rax,%rdi
call   1030 <dynCastOrNull@plt>
movl   $0x1,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @testTrackNullVariable() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* (...) @getNull()
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32* @dynCastOrNull(i32* %4)
store i32* %5, i32** %2
%6 = load i32*, i32** %2
store i32 1, i32* %6
ret void
}

LLVM IR (-O2):
define void @testTrackNullVariable() {
%1 = tail call i32* (...) @getNull()
%2 = tail call i32* @dynCastOrNull(i32* %1)
store i32 1, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ go_south_east(int *, int *);
int /*<<< orphan*/ printString(char *);
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char *argv[]) {
  int latitude = 32;
  int longitude = -64;
  go_south_east(&latitude, &longitude);
  printf("Now at [%i,%i]", latitude, longitude);
  printString("asdfsafsdf");
  int x = 4;
  int *address_of_x = &x;
  int value_stored = *address_of_x;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x20,-0x14(%rbp)
movl   $0xffffffc0,-0x18(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <go_south_east@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
lea    0xe95(%rip),%rdi
call   1040 <printString@plt>
movl   $0x4,-0x1c(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x20,0x4(%rsp)
movl   $0xffffffc0,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1050 <go_south_east@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
lea    0xea8(%rip),%rdi
call   1040 <printString@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Now at [%i,%i]\00"
@.str.1 = [11 x i8] c"asdfsafsdf\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 32, i32* %6
store i32 -64, i32* %7
%11 = call i32 @go_south_east(i32* %6, i32* %7)
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
%15 = call i32 @printString(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
store i32 4, i32* %8
store i32* %8, i32** %9
%16 = load i32*, i32** %9
%17 = load i32, i32* %16
store i32 %17, i32* %10
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Now at [%i,%i]\00"
@.str.1 = [11 x i8] c"asdfsafsdf\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 32, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 -64, i32* %4
%7 = call i32 @go_south_east(i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
%11 = call i32 @printString(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t MPURegionCountGet(void) {
  return (((*((volatile unsigned long *)(0xE000ED90))) & 0x0000FF00) >> 8);
}


x86 assembly (clang, -O0):
<MPURegionCountGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000ed90,%eax
mov    (%rax),%rax
and    $0xff00,%rax
shr    $0x8,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPURegionCountGet>:
mov    $0xe000ed90,%eax
mov    (%rax),%rax
movzbl %ah,%eax
ret

LLVM IR (-O0):
define i64 @MPURegionCountGet() {
%1 = load volatile i64, i64* inttoptr (i64 3758157200 to i64*)
%2 = and i64 %1, 65280
%3 = lshr i64 %2, 8
ret i64 %3
}

LLVM IR (-O2):
define i64 @MPURegionCountGet() {
%1 = load volatile i64, i64* inttoptr (i64 3758157200 to i64*)
%2 = lshr i64 %1, 8
%3 = and i64 %2, 255
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *my_realloc(int *, int);
void foo(int *p) {
  p = my_realloc(p, 10 * sizeof(int));
  p[0] = 42;
  free(p);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x28,%esi
call   1040 <my_realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    $0x28,%esi
call   1040 <my_realloc@plt>
movl   $0x2a,(%rax)
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @foo(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32* @my_realloc(i32* %3, i32 40)
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
store i32 42, i32* %6
%7 = load i32*, i32** %2
%8 = call i32 @free(i32* %7)
ret void
}

LLVM IR (-O2):
define void @foo(i32* %0) {
%2 = tail call i32* @my_realloc(i32* %0, i32 40)
store i32 42, i32* %2
%3 = tail call i32 @free(i32* %2)
ret void
}
void strrchrTest() {
  char str[] = "This is a sample string";
  char *pch;
  pch = strrchr(str, 's');
  printf("Last occurrence of 's' in '%s' found at %d (%d) \n", str,
         pch - str + 1, pch);
}


x86 assembly (clang, -O0):
<strrchrTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x73,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    -0x20(%rbp),%rax
sub    %rax,%rdx
add    $0x1,%rdx
mov    -0x28(%rbp),%rcx
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchrTest>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x676e6972747320,%rax
mov    %rax,0x10(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x73,%esi
call   1040 <strrchr@plt>
mov    %rax,%rdx
sub    %rbx,%rdx
add    $0x1,%rdx
lea    0xeb8(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rcx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.strrchrTest.str = [24 x i8] c"This is a sample string\00"
@.str = [50 x i8] c"Last occurrence of 's' in '%s' found at %d (%d) \0A\00"
define void @strrchrTest() {
%1 = alloca [24 x i8]
%2 = alloca i8*
%3 = bitcast [24 x i8]* %1 to i8*
%4 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
%5 = call i8* @strrchr(i8* %4, i32 115)
store i8* %5, i8** %2
%6 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
%9 = ptrtoint i8* %7 to i64
%10 = ptrtoint i8* %8 to i64
%11 = sub i64 %9, %10
%12 = add nsw i64 %11, 1
%13 = load i8*, i8** %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %6, i64 %12, i8* %13)
ret void
}

LLVM IR (-O2):
@__const.strrchrTest.str = [24 x i8] c"This is a sample string\00"
@.str = [50 x i8] c"Last occurrence of 's' in '%s' found at %d (%d) \0A\00"
define void @strrchrTest() {
%1 = alloca [24 x i8]
%2 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
%3 = call i8* @strrchr(i8* %2, i32 115)
%4 = ptrtoint i8* %3 to i64
%5 = ptrtoint [24 x i8]* %1 to i64
%6 = sub i64 1, %5
%7 = add i64 %6, %4
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %2, i64 %7, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
void g(int *b[2][3]) { f(b[1][2]); }


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

x86 assembly (clang, -O2):
<g>:
mov    0x28(%rdi),%rdi
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @g([3 x i32*]* %0) {
%2 = alloca [3 x i32*]*
store [3 x i32*]* %0, [3 x i32*]** %2
%3 = load [3 x i32*]*, [3 x i32*]** %2
%4 = getelementptr inbounds [3 x i32*], [3 x i32*]* %3, i64 1
%5 = getelementptr inbounds [3 x i32*], [3 x i32*]* %4, i64 0, i64 2
%6 = load i32*, i32** %5
%7 = call i32 @f(i32* %6)
ret void
}

LLVM IR (-O2):
define void @g([3 x i32*]* nocapture %0) {
%2 = getelementptr inbounds [3 x i32*], [3 x i32*]* %0, i64 1, i64 2
%3 = load i32*, i32** %2
%4 = tail call i32 @f(i32* %3)
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
void add(char *arg1, char *arg2) {
  int a, b;
  a = atoi(arg1);
  b = atoi(arg2);
  printf("%d\n", a + b);
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
add    -0x18(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <atoi@plt>
add    %eax,%ebp
lea    0xec2(%rip),%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @add(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 = call i32 @atoi(i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = call i32 @atoi(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @add(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @atoi(i8* %0)
%4 = tail call i32 @atoi(i8* %1)
%5 = add nsw i32 %4, %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
void outbyte(c) int c;
{
  if (c == '\n')
    printf("\r\n");
  else
    printf("%c", c);
}


x86 assembly (clang, -O0):
<outbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    1138 <outbyte+0x28>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1149 <outbyte+0x39>
mov    -0x4(%rbp),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outbyte>:
cmp    $0xa,%edi
jne    1131 <outbyte+0x11>
lea    0xed4(%rip),%rdi
jmp    1040 <puts@plt>
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@str = [2 x i8] c"\0D\00"
define void @outbyte(i32 %0) {
%2 = icmp eq i32 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @putchar(i32 %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ njord_gc_sample1();
int /*<<< orphan*/ njord_gc_sample2();
int /*<<< orphan*/ njord_gc_sample3();
int /*<<< orphan*/ njord_gc_sample4();
int /*<<< orphan*/ njord_initgc(char const *);
void njord_gc(const char *gc_name, int prof) {
  njord_initgc(gc_name);
  njord_gc_sample1();
  njord_gc_sample2();
  njord_gc_sample3();
  if (prof)
    njord_gc_sample4();
}


x86 assembly (clang, -O0):
<njord_gc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <njord_initgc@plt>
mov    $0x0,%al
call   1060 <njord_gc_sample1@plt>
mov    $0x0,%al
call   1040 <njord_gc_sample2@plt>
mov    $0x0,%al
call   1050 <njord_gc_sample3@plt>
cmpl   $0x0,-0xc(%rbp)
je     118e <njord_gc+0x3e>
mov    $0x0,%al
call   1030 <njord_gc_sample4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<njord_gc>:
push   %rbx
mov    %esi,%ebx
call   1070 <njord_initgc@plt>
xor    %eax,%eax
call   1060 <njord_gc_sample1@plt>
xor    %eax,%eax
call   1040 <njord_gc_sample2@plt>
xor    %eax,%eax
call   1050 <njord_gc_sample3@plt>
test   %ebx,%ebx
je     1179 <njord_gc+0x29>
xor    %eax,%eax
pop    %rbx
jmp    1030 <njord_gc_sample4@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @njord_gc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @njord_initgc(i8* %5)
%7 = call i32 (...) @njord_gc_sample1()
%8 = call i32 (...) @njord_gc_sample2()
%9 = call i32 (...) @njord_gc_sample3()
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @njord_gc_sample4()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @njord_gc(i8* %0, i32 %1) {
%3 = tail call i32 @njord_initgc(i8* %0)
%4 = tail call i32 (...) @njord_gc_sample1()
%5 = tail call i32 (...) @njord_gc_sample2()
%6 = tail call i32 (...) @njord_gc_sample3()
%7 = icmp eq i32 %1, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 (...) @njord_gc_sample4()
br label %10
10: ; preds = %8, %2
ret void
}