xunge/DecIR huggingface dataset:
/* Variables and functions */
int sancus_get_frf(double, double, double, double *);
scalar_t__ sancus_get_fs(char const *, double *);
bool sancus_get_frfs(const char *s, double a, double b, double *out) {
  double v;
  bool ret = false;
  if (sancus_get_fs(s, &v))
    ret = sancus_get_frf(v, a, b, out);
  return ret;
}


x86 assembly (clang, -O0):
<sancus_get_frfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <sancus_get_fs@plt>
cmp    $0x0,%rax
je     1173 <sancus_get_frfs+0x53>
movsd  -0x28(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rdi
call   1030 <sancus_get_frf@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_get_frfs>:
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rbx
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
lea    0x18(%rsp),%rsi
call   1040 <sancus_get_fs@plt>
test   %rax,%rax
je     115f <sancus_get_frfs+0x3f>
movsd  0x18(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
mov    %rbx,%rdi
call   1030 <sancus_get_frf@plt>
jmp    1161 <sancus_get_frfs+0x41>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @sancus_get_frfs(i8* %0, double %1, double %2, double* %3) {
%5 = alloca double
%6 = bitcast double* %5 to i8*
%7 = call i64 @sancus_get_fs(i8* %0, double* %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = load double, double* %5
%11 = call i32 @sancus_get_frf(double %10, double %1, double %2, double* %3)
br label %12
12: ; preds = %9, %4
%13 = phi i32 [ %11, %9 ], [ 0, %4 ]
ret i32 %13
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ fputc(int, int /*<<< orphan*/);
int /*<<< orphan*/ onOutputError();
int /*<<< orphan*/ stdout;
void putByte(int byte) {
  if (fputc(byte, stdout) == EOF)
    onOutputError();
}


x86 assembly (clang, -O0):
<putByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
call   1030 <fputc@plt>
mov    0x2ea5(%rip),%rcx
cmp    (%rcx),%rax
jne    1153 <putByte+0x33>
mov    $0x0,%al
call   1040 <onOutputError@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putByte>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
call   1030 <fputc@plt>
mov    0x2eb2(%rip),%rcx
cmp    (%rcx),%rax
jne    1143 <putByte+0x23>
xor    %eax,%eax
pop    %rcx
jmp    1040 <onOutputError@plt>
pop    %rax
ret

LLVM IR (-O0):
@stdout = global i32 0
@EOF = global i64 0
define void @putByte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @stdout
%5 = call i64 @fputc(i32 %3, i32 %4)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @onOutputError()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@EOF = global i64 0
define void @putByte(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i64 @fputc(i32 %0, i32 %2)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (...) @onOutputError()
br label %8
8: ; preds = %6, %1
ret void
}
void hard_fault_exception(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<hard_fault_exception>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <hard_fault_exception+0x9>
jmp    1109 <hard_fault_exception+0x9>

x86 assembly (clang, -O2):
<hard_fault_exception>:
jmp    1100 <hard_fault_exception>

LLVM IR (-O0):
define void @hard_fault_exception() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @hard_fault_exception() {
br label %1
1: ; preds = %0, %1
br label %1
}
char decode(char a) {
  if ((int)a == 1) {
    return a = 255;
  }
  return a - 1;
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x1,%eax
jne    1124 <decode+0x24>
movb   $0xff,-0x2(%rbp)
movb   $0xff,-0x1(%rbp)
jmp    112e <decode+0x2e>
movsbl -0x2(%rbp),%eax
sub    $0x1,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
lea    -0x1(%rdi),%eax
cmp    $0x1,%dil
movzbl %al,%ecx
mov    $0xff,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i8 @decode(i8 signext %0) {
%2 = icmp eq i8 %0, 1
%3 = add i8 %0, -1
%4 = select i1 %2, i8 -1, i8 %3
ret i8 %4
}
/* Variables and functions */
char *strrchr(char *, char);
char *getext(char *in) {
  char *ext = strrchr(in, '.');
  if (!ext)
    return ext;
  return ext + 1;
}


x86 assembly (clang, -O0):
<getext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1146 <getext+0x36>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <getext+0x42>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getext>:
push   %rax
mov    $0x2e,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @getext(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 46)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = load i8*, i8** %4
store i8* %10, i8** %2
br label %14
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %2
br label %14
14: ; preds = %11, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @getext(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* null, i8* %4
ret i8* %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t calculate_header_lrc(uint8_t *data) {
  return ((data[0] + data[1] + data[2] + data[3]) ^ 0xFF) + 1;
}


x86 assembly (clang, -O0):
<calculate_header_lrc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
add    0x4(%rcx),%eax
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%eax
mov    -0x8(%rbp),%rcx
add    0xc(%rcx),%eax
xor    $0xff,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_header_lrc>:
movdqu (%rdi),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
xor    $0xff,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @calculate_header_lrc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = add nsw i32 %5, %8
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 2
%12 = load i32, i32* %11
%13 = add nsw i32 %9, %12
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i64 3
%16 = load i32, i32* %15
%17 = add nsw i32 %13, %16
%18 = xor i32 %17, 255
%19 = add nsw i32 %18, 1
ret i32 %19
}

LLVM IR (-O2):
define i32 @calculate_header_lrc(i32* nocapture %0) {
%2 = bitcast i32* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %3)
%5 = xor i32 %4, 255
%6 = add nsw i32 %5, 1
ret i32 %6
}
int script_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @script_init() {
ret i32 0
}
void CalculateHits(int forces) { int casualties; }


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

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

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

LLVM IR (-O2):
define void @CalculateHits(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __exeptions_disable_board();
int /*<<< orphan*/ __fini_board();
void __fini() {
  __exeptions_disable_board();
  __fini_board();
}


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

x86 assembly (clang, -O2):
<__fini>:
push   %rax
xor    %eax,%eax
call   1040 <__exeptions_disable_board@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__fini_board@plt>

LLVM IR (-O0):
define void @__fini() {
%1 = call i32 (...) @__exeptions_disable_board()
%2 = call i32 (...) @__fini_board()
ret void
}

LLVM IR (-O2):
define void @__fini() {
%1 = tail call i32 (...) @__exeptions_disable_board()
%2 = tail call i32 (...) @__fini_board()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clobbers();
void call_clobbers(void) { clobbers(); }


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

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

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

LLVM IR (-O2):
define void @call_clobbers() {
%1 = tail call i32 (...) @clobbers()
ret void
}
void bss_clear(void) {
  extern void *__bss_start;
  extern void *__bss_end;
  unsigned int *p;
  unsigned int *start = (unsigned int *)&__bss_start;
  unsigned int *end = (unsigned int *)&__bss_end;
  for (p = start; p < end; p++) {
    *p = 0x00;
  }
}


x86 assembly (clang, -O0):
<bss_clear>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2eca(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    114b <bss_clear+0x4b>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1122 <bss_clear+0x22>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bss_clear>:
push   %rax
mov    0x2ed0(%rip),%rdi
cmp    0x2ec1(%rip),%rdi
jae    114c <bss_clear+0x3c>
lea    0x4(%rdi),%rax
mov    0x2eb4(%rip),%rcx
cmp    %rax,%rcx
cmova  %rcx,%rax
mov    %rdi,%rcx
not    %rcx
lea    (%rcx,%rax,1),%rdx
add    $0x4,%rdx
and    $0xfffffffffffffffc,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@__bss_start = external global i8*
@__bss_end = external global i8*
define void @bss_clear() {
br i1 icmp ult (i8** @__bss_start, i8** @__bss_end), label %1, label %5
1: ; preds = %0
%2 = call i64 @llvm.umax.i64(i64 ptrtoint (i8** @__bss_end to i64), i64 add (i64 ptrtoint (i8** @__bss_start to i64), i64 4))
%3 = add i64 %2, add (i64 xor (i64 ptrtoint (i8** @__bss_start to i64), i64 -1), i64 4)
%4 = and i64 %3, -4
br label %5
5: ; preds = %1, %0
ret void
}
void dobra2(int *x, int *y, int *z) {
  *x = (*x) * (*x);
  *y = (*y) * (*y);
  *z = (*z) * (*z);
}


x86 assembly (clang, -O0):
<dobra2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
imul   (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
imul   (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
imul   (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dobra2>:
mov    (%rdi),%eax
imul   %eax,%eax
mov    %eax,(%rdi)
mov    (%rsi),%eax
imul   %eax,%eax
mov    %eax,(%rsi)
mov    (%rdx),%eax
imul   %eax,%eax
mov    %eax,(%rdx)
ret

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

LLVM IR (-O2):
define void @dobra2(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = mul nsw i32 %4, %4
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = mul nsw i32 %6, %6
store i32 %7, i32* %1
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, %8
store i32 %9, i32* %2
ret void
}
int *getOldPC(int dummy) {
  int *PC = (((char *)&dummy) - sizeof(char *));
  return PC;
}


x86 assembly (clang, -O0):
<getOldPC>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getOldPC>:
lea    -0xc(%rsp),%rax
ret

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

LLVM IR (-O2):
define noalias i32* @getOldPC(i32 %0) {
%2 = alloca i32
%3 = getelementptr inbounds i32, i32* %2, i64 -2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ dlhist_close();
scalar_t__ dlhist_open();
int /*<<< orphan*/ dlhist_print();
int cmd_dlhist(int argc, char **argv) {
  if (dlhist_open() < 0)
    return 1;
  dlhist_print();
  dlhist_close();
  return 0;
}


x86 assembly (clang, -O0):
<cmd_dlhist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <dlhist_open@plt>
cmp    $0x0,%rax
jge    115c <cmd_dlhist+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1171 <cmd_dlhist+0x41>
mov    $0x0,%al
call   1030 <dlhist_print@plt>
mov    $0x0,%al
call   1050 <dlhist_close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_dlhist>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <dlhist_open@plt>
test   %rax,%rax
js     114f <cmd_dlhist+0x1f>
xor    %eax,%eax
call   1030 <dlhist_print@plt>
xor    %eax,%eax
call   1050 <dlhist_close@plt>
jmp    1154 <cmd_dlhist+0x24>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @cmd_dlhist(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @dlhist_open()
%4 = icmp slt i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 (...) @dlhist_print()
%7 = tail call i32 (...) @dlhist_close()
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int gob_encode_int64(char *, size_t, int /*<<< orphan*/);
int gob_encode_int(char *buf, size_t buf_size, int v) {
  return gob_encode_int64(buf, buf_size, (int64_t)v);
}


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

x86 assembly (clang, -O2):
<gob_encode_int>:
jmp    1030 <gob_encode_int64@plt>

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

LLVM IR (-O2):
define i32 @gob_encode_int(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @gob_encode_int64(i8* %0, i64 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
float hypotf(float, float);
float futrts_hypot32(float x, float y) { return hypotf(x, y); }


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

x86 assembly (clang, -O2):
<futrts_hypot32>:
jmp    1030 <hypotf@plt>

LLVM IR (-O0):
define float @futrts_hypot32(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @hypotf(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @futrts_hypot32(float %0, float %1) {
%3 = tail call float @hypotf(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ endturn();
void ui_end_turn(void) { endturn(); }


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

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

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

LLVM IR (-O2):
define void @ui_end_turn() {
%1 = tail call i32 (...) @endturn()
ret void
}
void ast_dump_deleg(struct AST *ast, int offs) {}


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

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

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

LLVM IR (-O2):
%struct.AST = type opaque
define void @ast_dump_deleg(%struct.AST* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
float max(float, double);
float min(float, double);
float saturate(float x) {
  x = max(x, 0.0);
  x = min(x, 1.0);
  return x;
}


x86 assembly (clang, -O0):
<saturate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
call   1040 <max@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movsd  0xeb4(%rip),%xmm1
call   1030 <min@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saturate>:
push   %rax
xorps  %xmm1,%xmm1
call   1040 <max@plt>
movsd  0xecf(%rip),%xmm1
pop    %rax
jmp    1030 <min@plt>

LLVM IR (-O0):
define float @saturate(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @max(float %3, double 0.000000e+00)
store float %4, float* %2
%5 = load float, float* %2
%6 = call float @min(float %5, double 1.000000e+00)
store float %6, float* %2
%7 = load float, float* %2
ret float %7
}

LLVM IR (-O2):
define float @saturate(float %0) {
%2 = tail call float @max(float %0, double 0.000000e+00)
%3 = tail call float @min(float %2, double 1.000000e+00)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ dscal(int const *, double const *, double *, int const *);
void c_dscal(const int N, const double alpha, double *X, const int stride) {
  dscal(&N, &alpha, X, &stride);
}


x86 assembly (clang, -O0):
<c_dscal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rdx
lea    -0x4(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rcx
call   1030 <dscal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_dscal>:
sub    $0x18,%rsp
mov    %rsi,%rax
mov    %edi,0xc(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %edx,0x8(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rcx
mov    %rax,%rdx
call   1030 <dscal@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @c_dscal(i32 %0, double %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double*
%8 = alloca i32
store i32 %0, i32* %5
store double %1, double* %6
store double* %2, double** %7
store i32 %3, i32* %8
%9 = load double*, double** %7
%10 = call i32 @dscal(i32* %5, double* %6, double* %9, i32* %8)
ret void
}

LLVM IR (-O2):
define void @c_dscal(i32 %0, double %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca i32
store i32 %0, i32* %5
store double %1, double* %6
store i32 %3, i32* %7
%8 = call i32 @dscal(i32* %5, double* %6, double* %2, i32* %7)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ n;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print64bits(uint64_t n) {
  uint64_t i;
  i = (uint64_t)1 << (sizeof(n) * 8 - 1);
  while (i > 0) {
    if (n & i)
      fprintf(stderr, "1");
    else
      fprintf(stderr, "0");
    i >>= 1;
  }
  fprintf(stderr, "\n");
}


x86 assembly (clang, -O0):
<print64bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x80000000,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1178 <print64bits+0x68>
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
je     1155 <print64bits+0x45>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
jmp    116a <print64bits+0x5a>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <print64bits+0x12>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
lea    0xe7c(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"0\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @print64bits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -2147483648, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = and i32 %8, %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %18
15: ; preds = %7
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %15, %12
%19 = load i32, i32* %3
%20 = ashr i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
%22 = load i32, i32* @stderr
%23 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str.2 = [2 x i8] c"\0A\00"
define void @print64bits(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
__attribute__((constructor)) int test() {
  foo();
  return 0;
}


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* bitcast (i32 ()* @test to void ()*), i8* null }]
define i32 @test() {
%1 = call i32 (...) @foo()
ret i32 0
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* bitcast (i32 ()* @test to void ()*), i8* null }]
define i32 @test() {
%1 = tail call i32 (...) @foo()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x1d() {
  Assert_real((isbdigit(29) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              150, ("isbdigit should be 0 for 0x1d"));
}


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

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

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x1d\00"
define void @t_isbdigit_0x1d() {
%1 = call i64 @isbdigit(i32 29)
%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 150, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x1d\00"
define void @t_isbdigit_0x1d() {
%1 = tail call i64 @isbdigit(i32 29)
%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 150, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
float math_tanf(float);
float call_tanf(float x) { return math_tanf(x); }


x86 assembly (clang, -O0):
<call_tanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <math_tanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_tanf>:
jmp    1030 <math_tanf@plt>

LLVM IR (-O0):
define float @call_tanf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @math_tanf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @call_tanf(float %0) {
%2 = tail call float @math_tanf(float %0)
ret float %2
}
int test_imm_49int16_mem(short *val) {
  return ((*val) & (0x49 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_49int16_mem>:
testb  $0x49,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_49int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 73
%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_49int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 73
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a, sum;
  sum = 0;
  for (a = 1; a <= 100; a++) {
    sum += a;
  }
  printf("sum is %d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     114e <main+0x3e>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea8(%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
mov    $0x13ba,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"sum is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 5050)
ret i32 0
}
/* Variables and functions */
float root(float, int);
float sqrt(float x) { return root(x, 2); }


x86 assembly (clang, -O0):
<sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <root@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt>:
mov    $0x2,%edi
jmp    1030 <root@plt>

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

LLVM IR (-O2):
define float @sqrt(float %0) {
%2 = tail call float @root(float %0, i32 2)
ret float %2
}
unsigned long partial_byte_hash(unsigned long c, unsigned long hash) {
  return (c + (hash << 6) + (hash << 16) - hash);
}


x86 assembly (clang, -O0):
<partial_byte_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
sub    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<partial_byte_hash>:
imul   $0x10040,%rsi,%rax
sub    %rsi,%rdi
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @partial_byte_hash(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = shl i64 %6, 6
%8 = add i64 %5, %7
%9 = load i64, i64* %4
%10 = shl i64 %9, 16
%11 = add i64 %8, %10
%12 = load i64, i64* %4
%13 = sub i64 %11, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @partial_byte_hash(i64 %0, i64 %1) {
%3 = mul i64 %1, 65600
%4 = sub i64 %0, %1
%5 = add i64 %4, %3
ret i64 %5
}
void rec_sum_array2(int *result, int *arr, int i) {
  if (arr[i] == '\0') {
    return;
  } else {
    *result++;
    rec_sum_array2(result, arr, i + 1);
  }
}


x86 assembly (clang, -O0):
<rec_sum_array2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    113a <rec_sum_array2+0x2a>
jmp    1159 <rec_sum_array2+0x49>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
call   1030 <rec_sum_array2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec_sum_array2>:
movslq %edx,%rax
cmpl   $0x0,(%rsi,%rax,4)
je     1129 <rec_sum_array2+0x29>
lea    (%rsi,%rax,4),%rax
add    $0x4,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmpl   $0x0,(%rax)
lea    0x4(%rax),%rax
jne    1120 <rec_sum_array2+0x20>
ret

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

LLVM IR (-O2):
define void @rec_sum_array2(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %3, %8
%9 = phi i64 [ %10, %8 ], [ %4, %3 ]
%10 = add i64 %9, 1
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %8
14: ; preds = %8, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() { puts("this is p1 "); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
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 = [12 x i8] c"this is p1 \00"
define i32 @main() {
%1 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"this is p1 \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int cmp(const void *a, const void *b) {
  return (*(long long int *)a - *(long long int *)b);
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @cmp(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 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = sub nsw i64 %7, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
void gtk_about_dialog_set_translator_credits() {}


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

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

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

LLVM IR (-O2):
define void @gtk_about_dialog_set_translator_credits() {
ret void
}
/* Type definitions */
struct aFILE {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _get_actual_fp(struct aFILE *);
int fileno(int /*<<< orphan*/);
int my_fileno(struct aFILE *fp) { return fileno(_get_actual_fp(fp)); }


x86 assembly (clang, -O0):
<my_fileno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_get_actual_fp@plt>
mov    %eax,%edi
call   1040 <fileno@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fileno>:
push   %rax
call   1030 <_get_actual_fp@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <fileno@plt>

LLVM IR (-O0):
%struct.aFILE = type { i32 }
define i32 @my_fileno(%struct.aFILE* %0) {
%2 = alloca %struct.aFILE*
store %struct.aFILE* %0, %struct.aFILE** %2
%3 = load %struct.aFILE*, %struct.aFILE** %2
%4 = call i32 @_get_actual_fp(%struct.aFILE* %3)
%5 = call i32 @fileno(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.aFILE = type { i32 }
define i32 @my_fileno(%struct.aFILE* %0) {
%2 = tail call i32 @_get_actual_fp(%struct.aFILE* %0)
%3 = tail call i32 @fileno(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
scalar_t__ strquotelen(char const *);
ssize_t parse_string(const char *buffer,
                     __attribute__((unused)) const char **error) {
  if ((*buffer == '"') || (*buffer == '\'') || (*buffer == '`')) {
    if (strquotelen(buffer) > 0)
      return 1;
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<parse_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
je     1150 <parse_string+0x40>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x27,%eax
je     1150 <parse_string+0x40>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x60,%eax
jne    117b <parse_string+0x6b>
mov    -0x10(%rbp),%rdi
call   1030 <strquotelen@plt>
cmp    $0x0,%rax
jle    116f <parse_string+0x5f>
movl   $0x1,-0x4(%rbp)
jmp    1182 <parse_string+0x72>
movl   $0x0,-0x4(%rbp)
jmp    1182 <parse_string+0x72>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_string>:
push   %rax
mov    (%rdi),%cl
mov    $0x1,%eax
add    $0xde,%cl
cmp    $0x3e,%cl
ja     1143 <parse_string+0x33>
movzbl %cl,%ecx
movabs $0x4000000000000021,%rdx
bt     %rcx,%rdx
jae    1143 <parse_string+0x33>
call   1030 <strquotelen@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setg   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @parse_string(i8* %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8**
store i8* %0, i8** %4
store i8** %1, i8*** %5
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 34
br i1 %9, label %20, label %10
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 39
br i1 %14, label %20, label %15
15: ; preds = %10
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 96
br i1 %19, label %20, label %26
20: ; preds = %15, %10, %2
%21 = load i8*, i8** %4
%22 = call i64 @strquotelen(i8* %21)
%23 = icmp sgt i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 1, i32* %3
br label %27
25: ; preds = %20
store i32 0, i32* %3
br label %27
26: ; preds = %15
store i32 1, i32* %3
br label %27
27: ; preds = %26, %25, %24
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @parse_string(i8* %0, i8** nocapture readnone %1) {
%3 = load i8, i8* %0
switch i8 %3, label %8 [
i8 34, label %4
i8 39, label %4
i8 96, label %4
]
4: ; preds = %2, %2, %2
%5 = tail call i64 @strquotelen(i8* %0)
%6 = icmp sgt i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 1, %2 ]
ret i32 %9
}
unsigned int hashtable_hash(char *str) {
  unsigned int end;
  end = 0;
  while (*str) {
    end = (*str * *str) + end;
    str++;
  }
  return end;
}


x86 assembly (clang, -O0):
<hashtable_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1144 <hashtable_hash+0x44>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
imul   %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hashtable_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashtable_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <hashtable_hash+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
imul   %ecx,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashtable_hash+0x10>
ret
xor    %eax,%eax
ret

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

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

  cio_skip(len - 2);
}


x86 assembly (clang, -O0):
<j2k_read_ppt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1040 <cio_read@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
call   1030 <cio_skip@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j2k_read_ppt>:
push   %rax
mov    $0x2,%edi
call   1040 <cio_read@plt>
lea    -0x2(%rax),%edi
pop    %rax
jmp    1030 <cio_skip@plt>

LLVM IR (-O0):
define void @j2k_read_ppt() {
%1 = alloca i32
%2 = call i32 @cio_read(i32 2)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = sub nsw i32 %3, 2
%5 = call i32 @cio_skip(i32 %4)
ret void
}

LLVM IR (-O2):
define void @j2k_read_ppt() {
%1 = tail call i32 @cio_read(i32 2)
%2 = add nsw i32 %1, -2
%3 = tail call i32 @cio_skip(i32 %2)
ret void
}
/* Variables and functions */
int _strcmp(char const *, char const *, void *);
int hfuzz_strcmp(const char *s1, const char *s2, void *addr) {
  return _strcmp(s1, s2, addr);
}


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

x86 assembly (clang, -O2):
<hfuzz_strcmp>:
jmp    1030 <_strcmp@plt>

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

LLVM IR (-O2):
define i32 @hfuzz_strcmp(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @_strcmp(i8* %0, i8* %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _free_vita_heap();
int /*<<< orphan*/ _free_vita_io();
int /*<<< orphan*/ _free_vita_malloc();
int /*<<< orphan*/ _free_vita_reent();
void _free_vita_newlib(void) {
  _free_vita_io();
  _free_vita_malloc();
  _free_vita_reent();
  _free_vita_heap();
}


x86 assembly (clang, -O0):
<_free_vita_newlib>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <_free_vita_io@plt>
mov    $0x0,%al
call   1050 <_free_vita_malloc@plt>
mov    $0x0,%al
call   1040 <_free_vita_reent@plt>
mov    $0x0,%al
call   1060 <_free_vita_heap@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_free_vita_newlib>:
push   %rax
xor    %eax,%eax
call   1030 <_free_vita_io@plt>
xor    %eax,%eax
call   1050 <_free_vita_malloc@plt>
xor    %eax,%eax
call   1040 <_free_vita_reent@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <_free_vita_heap@plt>

LLVM IR (-O0):
define void @_free_vita_newlib() {
%1 = call i32 (...) @_free_vita_io()
%2 = call i32 (...) @_free_vita_malloc()
%3 = call i32 (...) @_free_vita_reent()
%4 = call i32 (...) @_free_vita_heap()
ret void
}

LLVM IR (-O2):
define void @_free_vita_newlib() {
%1 = tail call i32 (...) @_free_vita_io()
%2 = tail call i32 (...) @_free_vita_malloc()
%3 = tail call i32 (...) @_free_vita_reent()
%4 = tail call i32 (...) @_free_vita_heap()
ret void
}
void gtk_icon_view_set_columns() {}


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

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

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

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