xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ max_heapify(int *, int, int);
void build_max_heap(int *array, int size) {
  int i = 0;
  for (i = (size - 2) / 2; i >= 0; i--) {
    max_heapify(array, size, i);
  }
  return;
}


x86 assembly (clang, -O0):
<build_max_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     115e <build_max_heap+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <max_heapify@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1137 <build_max_heap+0x27>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_max_heap>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1141 <build_max_heap+0x31>
mov    %esi,%ebx
mov    %rdi,%r14
lea    -0x2(%rbx),%eax
shr    $0x1f,%eax
lea    (%rbx,%rax,1),%ebp
add    $0xfffffffe,%ebp
sar    %ebp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <max_heapify@plt>
add    $0xffffffff,%ebp
jb     1130 <build_max_heap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @build_max_heap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = add nsw i32 %1, -2
%6 = sdiv i32 %5, 2
br label %7
7: ; preds = %4, %7
%8 = phi i32 [ %10, %7 ], [ %6, %4 ]
%9 = tail call i32 @max_heapify(i32* %0, i32 %1, i32 %8)
%10 = add nsw i32 %8, -1
%11 = icmp eq i32 %8, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_char(int, unsigned char);
void print_warning_char(unsigned char byte) { __console_tx_char(4, byte); }


x86 assembly (clang, -O0):
<print_warning_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x4,%edi
movzbl -0x1(%rbp),%esi
call   1030 <__console_tx_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_warning_char>:
mov    %edi,%esi
mov    $0x4,%edi
jmp    1030 <__console_tx_char@plt>

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

LLVM IR (-O2):
define void @print_warning_char(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_char(i32 4, i8 zeroext %0)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t rotl_64e(short dummy, uint64_t x) { return (x << 24) | (x >> 40); }


x86 assembly (clang, -O0):
<rotl_64e>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%edx
mov    $0x28,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rotl_64e(i16 signext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = load i32, i32* %4
%8 = ashr i32 %7, 40
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @rotl_64e(i16 signext %0, i32 %1) {
ret i32 poison
}
int BAMBGZFMIN(int x, int y) { return (x < y) ? x : y; }


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

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

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

LLVM IR (-O2):
define i32 @BAMBGZFMIN(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void usage(void) {
  fputs("usage: xmenu [-b] [-i] [-p prompt] [-fn font][-nb color] [-nf color]\n"
        "             [-sb color] [-sf color] [-H height] [-v]\n",
        stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [124 x i8] c"usage: xmenu [-b] [-i] [-p prompt] [-fn font][-nb color] [-nf color]\0A [-sb color] [-sf color] [-H height] [-v]\0A\00"
@stderr = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([124 x i8], [124 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [124 x i8] c"usage: xmenu [-b] [-i] [-p prompt] [-fn font][-nb color] [-nf color]\0A [-sb color] [-sf color] [-H height] [-v]\0A\00"
@stderr = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([124 x i8], [124 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ function1(char *);
int /*<<< orphan*/ setup_sigsegv();
int main() {
  setup_sigsegv();
  char *s = "hello";
  function1(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <setup_sigsegv@plt>
lea    0xec3(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <function1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 (...) @setup_sigsegv()
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @function1(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 (...) @setup_sigsegv()
%2 = tail call i32 @function1(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ alert(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n = 0;
  printf("请输入一个正整数: ");
  scanf("%d", &n);
  alert(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <alert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <alert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E6\AD\A3\E6\95\B4\E6\95\B0: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @alert(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E6\AD\A3\E6\95\B4\E6\95\B0: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @alert(i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int createUtmpEntry(char *uname, pid_t job_pid, char *current_tty) {
  int err = 0;
  return (err);
}


x86 assembly (clang, -O0):
<createUtmpEntry>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @createUtmpEntry(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
scalar_t__ ECDH_DATA_new_method(int /*<<< orphan*/ *);
void *ecdh_data_new(void) { return (void *)ECDH_DATA_new_method(NULL); }


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

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

LLVM IR (-O0):
define i8* @ecdh_data_new() {
%1 = call i64 @ECDH_DATA_new_method(i32* null)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}

LLVM IR (-O2):
define i8* @ecdh_data_new() {
%1 = tail call i64 @ECDH_DATA_new_method(i32* null)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void message2() { printf("Cruel World!\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Cruel World!\0A\00"
define void @message2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Cruel World!\00"
define void @message2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bc_epoll_process(void *);
int /*<<< orphan*/ printf(char *);
void *thread_fun(void *obj) {
  while (1) {
    printf("run...\n");
    bc_epoll_process(obj);
  }
}


x86 assembly (clang, -O0):
<thread_fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <bc_epoll_process@plt>
jmp    112c <thread_fun+0xc>

x86 assembly (clang, -O2):
<thread_fun>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <bc_epoll_process@plt>
jmp    1130 <thread_fun+0x10>

LLVM IR (-O0):
@.str = [8 x i8] c"run...\0A\00"
define i8* @thread_fun(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @bc_epoll_process(i8* %5)
br label %3
}

LLVM IR (-O2):
@str = [7 x i8] c"run...\00"
define noalias i8* @thread_fun(i8* %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @bc_epoll_process(i8* %0)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  int r = 2, KupunHacmi = 0;
  float pi = 3.14, Oran = 0, KureHacmi = 0;
  KupunHacmi = r * r * r;
  KureHacmi = 4.0 / 3.0 * pi * KupunHacmi;
  Oran = KureHacmi / KupunHacmi;
  printf("adasda:%f\n", Oran);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movss  0xed3(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe97(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"adasda:%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
store i32 2, i32* %2
store i32 0, i32* %3
store float 0x40091EB860000000, float* %4
store float 0.000000e+00, float* %5
store float 0.000000e+00, float* %6
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
store i32 %11, i32* %3
%12 = load float, float* %4
%13 = fpext float %12 to double
%14 = fmul double 0x3FF5555555555555, %13
%15 = load i32, i32* %3
%16 = sitofp i32 %15 to double
%17 = fmul double %14, %16
%18 = fptrunc double %17 to float
store float %18, float* %6
%19 = load float, float* %6
%20 = load i32, i32* %3
%21 = sitofp i32 %20 to float
%22 = fdiv float %19, %21
store float %22, float* %5
%23 = load float, float* %5
%24 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"adasda:%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float 0x4010BF25A0000000)
ret i32 0
}
/* Variables and functions */
double tanh(double);
float sigtanh(float x) { return 1.0 * tanh(1.0 * x); }


x86 assembly (clang, -O0):
<sigtanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <tanh@plt>
movaps %xmm0,%xmm1
movsd  0xebe(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigtanh>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <tanh@plt>
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sigtanh(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double 1.000000e+00, %4
%6 = call double @tanh(double %5)
%7 = fmul double 1.000000e+00, %6
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @sigtanh(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @tanh(double %2)
%4 = fptrunc double %3 to float
ret float %4
}
int sum(int arr[], int size) {
  int result;
  if (size == 0)
    result = 0;
  else {
    int small_result = sum(arr, size - 1);
    result = small_result + arr[size - 1];
  }
  return result;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1135 <sum+0x25>
movl   $0x0,-0x10(%rbp)
jmp    115d <sum+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <sum@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
add    (%rcx,%rdx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
test   %esi,%esi
je     1135 <sum+0x25>
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    -0x1(%rbx),%esi
call   1030 <sum@plt>
movslq %ebx,%rcx
add    -0x4(%r14,%rcx,4),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2, %6
%5 = phi i32 [ %12, %6 ], [ 0, %2 ]
ret i32 %5
6: ; preds = %2
%7 = add nsw i32 %1, -1
%8 = tail call i32 @sum(i32* %0, i32 %7)
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = add nsw i32 %11, %8
br label %4
}
__attribute__((__const__)) int gumbo_ascii_isascii(int c) {
  return ((unsigned int)c & ~0x7fu) == 0;
}


x86 assembly (clang, -O0):
<gumbo_ascii_isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff80,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gumbo_ascii_isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @gumbo_ascii_isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -128
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @gumbo_ascii_isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xea() {
  Assert_real((isascii(234) == 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_isascii.c",
              1175, ("isascii should be 0 for 0xea"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xea>:
push   %rax
mov    $0xea,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x497,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xea\00"
define void @t_isascii_0xea() {
%1 = call i64 @isascii(i32 234)
%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 1175, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xea\00"
define void @t_isascii_0xea() {
%1 = tail call i64 @isascii(i32 234)
%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 1175, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void register_tangled_nonterminals(void) {}


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

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

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

LLVM IR (-O2):
define void @register_tangled_nonterminals() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_trylock(int /*<<< orphan*/ *);
int gen_posix_mutex_trylock(pthread_mutex_t *mut) {
  return (pthread_mutex_trylock(mut));
}


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

x86 assembly (clang, -O2):
<gen_posix_mutex_trylock>:
jmp    1030 <pthread_mutex_trylock@plt>

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

LLVM IR (-O2):
define i32 @gen_posix_mutex_trylock(i32* %0) {
%2 = tail call i32 @pthread_mutex_trylock(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ConvertToIeeeExtended(double, char *);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
void write_ieee_extended(FILE *fdest, double x) {
  char buf[10];
  ConvertToIeeeExtended(x, buf);
  (void)fwrite(buf, 1, 10, fdest);
}


x86 assembly (clang, -O0):
<write_ieee_extended>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    -0x1a(%rbp),%rdi
call   1030 <ConvertToIeeeExtended@plt>
lea    -0x1a(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0xa,%edx
call   1040 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_ieee_extended>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
lea    0xe(%rsp),%r14
mov    %r14,%rdi
call   1030 <ConvertToIeeeExtended@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0xa,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @write_ieee_extended(i32* %0, double %1) {
%3 = alloca i32*
%4 = alloca double
%5 = alloca [10 x i8]
store i32* %0, i32** %3
store double %1, double* %4
%6 = load double, double* %4
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%8 = call i32 @ConvertToIeeeExtended(double %6, i8* %7)
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%10 = load i32*, i32** %3
%11 = call i32 @fwrite(i8* %9, i32 1, i32 10, i32* %10)
ret void
}

LLVM IR (-O2):
define void @write_ieee_extended(i32* nocapture %0, double %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @ConvertToIeeeExtended(double %1, i8* %4)
%6 = call i32 @fwrite(i8* %4, i32 1, i32 10, i32* %0)
ret void
}
/* Type definitions */
struct utsname {
  char *sysname;
  char *nodename;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int uname(struct utsname *);
int main(int argc, char *argv[]) {
  struct utsname u_name;
  if (uname(&u_name) == -1)
    return -1;
  printf("system name is: %s, node name is %s\n", u_name.sysname,
         u_name.nodename);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <uname@plt>
cmp    $0xffffffff,%eax
jne    1154 <main+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <main+0x4f>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1040 <uname@plt>
cmp    $0xffffffff,%eax
je     1150 <main+0x30>
mov    0x8(%rsp),%rsi
mov    0x10(%rsp),%rdx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret
mov    $0xffffffff,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.utsname = type { i8*, i8* }
@.str = [37 x i8] c"system name is: %s, node name is %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.utsname
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @uname(%struct.utsname* %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %16
10: ; preds = %2
%11 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i32 0, i32 0
%12 = load i8*, i8** %11
%13 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i32 0, i32 1
%14 = load i8*, i8** %13
%15 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %14)
store i32 0, i32* %3
br label %16
16: ; preds = %10, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.utsname = type { i8*, i8* }
@.str = [37 x i8] c"system name is: %s, node name is %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.utsname
%4 = bitcast %struct.utsname* %3 to i8*
%5 = call i32 @uname(%struct.utsname* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = getelementptr inbounds %struct.utsname, %struct.utsname* %3, i64 0, i32 0
%9 = load i8*, i8** %8
%10 = getelementptr inbounds %struct.utsname, %struct.utsname* %3, i64 0, i32 1
%11 = load i8*, i8** %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %11)
br label %13
13: ; preds = %2, %7
%14 = phi i32 [ 0, %7 ], [ -1, %2 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ RTExceptions_GetExceptionBlock();
int /*<<< orphan*/ RTExceptions_GetNumber(int /*<<< orphan*/);
int /*<<< orphan*/ throw(int /*<<< orphan*/);
void DoThrow(void) {
  throw(RTExceptions_GetNumber(RTExceptions_GetExceptionBlock()));
}


x86 assembly (clang, -O0):
<DoThrow>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <RTExceptions_GetExceptionBlock@plt>
mov    %eax,%edi
call   1050 <RTExceptions_GetNumber@plt>
mov    %eax,%edi
call   1040 <throw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoThrow>:
push   %rax
xor    %eax,%eax
call   1030 <RTExceptions_GetExceptionBlock@plt>
mov    %eax,%edi
call   1050 <RTExceptions_GetNumber@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <throw@plt>

LLVM IR (-O0):
define void @DoThrow() {
%1 = call i32 (...) @RTExceptions_GetExceptionBlock()
%2 = call i32 @RTExceptions_GetNumber(i32 %1)
%3 = call i32 @throw(i32 %2)
ret void
}

LLVM IR (-O2):
define void @DoThrow() {
%1 = tail call i32 (...) @RTExceptions_GetExceptionBlock()
%2 = tail call i32 @RTExceptions_GetNumber(i32 %1)
%3 = tail call i32 @throw(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ui_field_value_down(int /*<<< orphan*/ const);
void switch_s1_down(const uint32_t repeat_count) {
  ui_field_value_down(repeat_count);
}


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

x86 assembly (clang, -O2):
<switch_s1_down>:
jmp    1030 <ui_field_value_down@plt>

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

LLVM IR (-O2):
define void @switch_s1_down(i32 %0) {
%2 = tail call i32 @ui_field_value_down(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_LWP(int /*<<< orphan*/);
int gen_LWP() { handle_LWP(0); }


x86 assembly (clang, -O0):
<gen_LWP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <handle_LWP@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_LWP() {
%1 = alloca i32
%2 = call i32 @handle_LWP(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_LWP() {
%1 = tail call i32 @handle_LWP(i32 0)
ret i32 undef
}
void UARTSmartCardDisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000030))) &= ~0x00000008;
}


x86 assembly (clang, -O0):
<UARTSmartCardDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rcx
and    $0xfffffffffffffff7,%rcx
mov    %rcx,0x30(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTSmartCardDisable>:
andq   $0xfffffffffffffff7,0x30(%rdi)
ret

LLVM IR (-O0):
define void @UARTSmartCardDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 48
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -9
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @UARTSmartCardDisable(i64 %0) {
%2 = add i64 %0, 48
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -9
store volatile i64 %5, i64* %3
ret void
}
void vadd(const float src1[3], const float src2[3], float dst[3]) {
  dst[0] = src1[0] + src2[0];
  dst[1] = src1[1] + src2[1];
  dst[2] = src1[2] + src2[2];
}


x86 assembly (clang, -O0):
<vadd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vadd>:
movss  (%rdi),%xmm0
addss  (%rsi),%xmm0
movss  %xmm0,(%rdx)
movss  0x4(%rdi),%xmm0
addss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdx)
movss  0x8(%rdi),%xmm0
addss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @vadd(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 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fadd float %9, %12
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %5
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fadd float %18, %21
%23 = load float*, float** %6
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %4
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %5
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fadd float %27, %30
%32 = load float*, float** %6
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
ret void
}

LLVM IR (-O2):
define void @vadd(float* nocapture %0, float* nocapture %1, float* nocapture writeonly %2) {
%4 = load float, float* %0
%5 = load float, float* %1
%6 = fadd float %4, %5
store float %6, float* %2
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %2, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %1, i64 2
%16 = load float, float* %15
%17 = fadd float %14, %16
%18 = getelementptr inbounds float, float* %2, i64 2
store float %17, float* %18
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct multiply_fcb_line {
  int dummy;
};

/* Variables and functions */
struct multiply_fcb_line *
multiply_fcb_line_new_with_configure_raw(int /*<<< orphan*/, int /*<<< orphan*/,
                                         int);
struct multiply_fcb_line *
multiply_fcb_line_new_with_configure_type(uint32_t opcode, uint32_t operand,
                                          int type) {
  return multiply_fcb_line_new_with_configure_raw(opcode, operand, type);
}


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

x86 assembly (clang, -O2):
<multiply_fcb_line_new_with_configure_type>:
jmp    1030 <multiply_fcb_line_new_with_configure_raw@plt>

LLVM IR (-O0):
%struct.multiply_fcb_line = type { i32 }
define %struct.multiply_fcb_line* @multiply_fcb_line_new_with_configure_type(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call %struct.multiply_fcb_line* @multiply_fcb_line_new_with_configure_raw(i32 %7, i32 %8, i32 %9)
ret %struct.multiply_fcb_line* %10
}

LLVM IR (-O2):
%struct.multiply_fcb_line = type { i32 }
define %struct.multiply_fcb_line* @multiply_fcb_line_new_with_configure_type(i32 %0, i32 %1, i32 %2) {
%4 = tail call %struct.multiply_fcb_line* @multiply_fcb_line_new_with_configure_raw(i32 %0, i32 %1, i32 %2)
ret %struct.multiply_fcb_line* %4
}
/* Type definitions */
typedef int off_t;

/* Variables and functions */
int /*<<< orphan*/ ESPIPE;
int /*<<< orphan*/ errno;
off_t uart_lseek(int file __attribute__((unused)),
                 off_t offset __attribute__((unused)),
                 int dir __attribute__((unused))) {
  errno = ESPIPE;
  return -1;
}


x86 assembly (clang, -O0):
<uart_lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ed4(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebb(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ESPIPE = global i32 0
@errno = global i32 0
define i32 @uart_lseek(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* @ESPIPE
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ESPIPE = global i32 0
@errno = global i32 0
define i32 @uart_lseek(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ESPIPE
store i32 %4, i32* @errno
ret i32 -1
}
int double_cmp(const void *_a, const void *_b) {
  const double *a = (const double *)_a;
  const double *b = (const double *)_b;
  if (*a < *b)
    return -1;
  if (*a > *b)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<double_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1142 <double_cmp+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <double_cmp+0x6b>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1164 <double_cmp+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <double_cmp+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_cmp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @double_cmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double*
%7 = alloca double*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
store double* %9, double** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to double*
store double* %11, double** %7
%12 = load double*, double** %6
%13 = load double, double* %12
%14 = load double*, double** %7
%15 = load double, double* %14
%16 = fcmp olt double %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %26
18: ; preds = %2
%19 = load double*, double** %6
%20 = load double, double* %19
%21 = load double*, double** %7
%22 = load double, double* %21
%23 = fcmp ogt double %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 1, i32* %3
br label %26
25: ; preds = %18
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %17
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @double_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = fcmp ogt double %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
int G_API(void) { return 46; }


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

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

LLVM IR (-O0):
define i32 @G_API() {
ret i32 46
}

LLVM IR (-O2):
define i32 @G_API() {
ret i32 46
}
/* Variables and functions */
int /*<<< orphan*/ terminal_write_string(char const *);
void write(const char *str, size_t len) {
  char backup_char = str[len];
  ((char *)str)[len] = 0;
  terminal_write_string(str);
  ((char *)str)[len] = backup_char;
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
call   1030 <terminal_write_string@plt>
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,1),%bpl
movb   $0x0,(%rdi,%rsi,1)
call   1030 <terminal_write_string@plt>
mov    %bpl,(%rbx,%r14,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @write(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = getelementptr inbounds i8, i8* %6, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %5
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = getelementptr inbounds i8, i8* %10, i64 %11
store i8 0, i8* %12
%13 = load i8*, i8** %3
%14 = call i32 @terminal_write_string(i8* %13)
%15 = load i8, i8* %5
%16 = load i8*, i8** %3
%17 = load i64, i64* %4
%18 = getelementptr inbounds i8, i8* %16, i64 %17
store i8 %15, i8* %18
ret void
}

LLVM IR (-O2):
define void @write(i8* %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = load i8, i8* %3
store i8 0, i8* %3
%5 = tail call i32 @terminal_write_string(i8* %0)
store i8 %4, i8* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void log_msg(const char *str) { fprintf(stderr, "%s\n", str); }


x86 assembly (clang, -O0):
<log_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_msg>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @log_msg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @log_msg(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
double baz(double x, double y, double z) {
  return x * x * y * y * y * z * z * z * z;
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @baz(double %0, double %1, double %2) {
%4 = fmul double %0, %0
%5 = fmul double %4, %1
%6 = fmul double %5, %1
%7 = fmul double %6, %1
%8 = fmul double %7, %2
%9 = fmul double %8, %2
%10 = fmul double %9, %2
%11 = fmul double %10, %2
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ K_cleanup();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void K_terminate() {
  K_cleanup();
  exit(0);
}


x86 assembly (clang, -O0):
<K_terminate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <K_cleanup@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define void @K_terminate() {
%1 = call i32 (...) @K_cleanup()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @K_terminate() {
%1 = tail call i32 (...) @K_cleanup()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  char fav;
  printf("Enter your favourite letter character :");
  fav = getchar();
  if (fav == 'q')
    printf("That's my favourite colur too!");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x71,%eax
jne    115e <main+0x3e>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x71,%al
jne    1144 <main+0x24>
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Enter your favourite letter character :\00"
@.str.1 = [31 x i8] c"That's my favourite colur too!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 113
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"Enter your favourite letter character :\00"
@.str.1 = [31 x i8] c"That's my favourite colur too!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 113
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test(void) { printf("hello\n"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"hello\0A\00"
define void @test() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define void @test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
int func_one(int num) {
  num++;
  return num;
}


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

x86 assembly (clang, -O2):
<func_one>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @func_one(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @func_one(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}