xunge/DecIR huggingface dataset:
void move_chars_right(char *line, int pos, int end) {
  for (int i = end + 1; i > pos; i--)
    line[i] = line[i - 1];
}


x86 assembly (clang, -O0):
<move_chars_right>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    114c <move_chars_right+0x4c>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <move_chars_right+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_chars_right>:
cmp    %esi,%edx
jl     1124 <move_chars_right+0x24>
add    $0x1,%edx
movslq %edx,%rcx
movslq %esi,%rax
nopl   (%rax)
movzbl -0x1(%rdi,%rcx,1),%edx
mov    %dl,(%rdi,%rcx,1)
lea    -0x1(%rcx),%rdx
mov    %rdx,%rcx
cmp    %rax,%rdx
jg     1110 <move_chars_right+0x10>
ret

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

LLVM IR (-O2):
define void @move_chars_right(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, %1
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = add i32 %2, 1
%7 = sext i32 %6 to i64
%8 = sext i32 %1 to i64
br label %10
9: ; preds = %10, %3
ret void
10: ; preds = %5, %10
%11 = phi i64 [ %7, %5 ], [ %12, %10 ]
%12 = add nsw i64 %11, -1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 %14, i8* %15
%16 = icmp sgt i64 %12, %8
br i1 %16, label %10, label %9
}
int f_eq_rm2(float a1, float *a2) { return !(((a1) == (*a2))); }


x86 assembly (clang, -O0):
<f_eq_rm2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_eq_rm2>:
cmpneqss (%rdi),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f_eq_rm2(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 = load float, float* %6
%8 = fcmp oeq float %5, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f_eq_rm2(float %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fcmp une float %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SOCKET_stop();
int /*<<< orphan*/ printf(char *);
void app_terminate(void) {
  printf("\rService is being closed...");
  SOCKET_stop();
  printf("ok.\n");
  return;
}


x86 assembly (clang, -O0):
<app_terminate>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <SOCKET_stop@plt>
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<app_terminate>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <SOCKET_stop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"\0DService is being closed...\00"
@.str.1 = [5 x i8] c"ok.\0A\00"
define void @app_terminate() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @SOCKET_stop()
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"\0DService is being closed...\00"
@str = [4 x i8] c"ok.\00"
define void @app_terminate() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @SOCKET_stop()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t high_size_bit(int /*<<< orphan*/);
size_t splitkexists_bit_LaceKVE_size() { return high_size_bit(0); }


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

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

LLVM IR (-O0):
define i64 @splitkexists_bit_LaceKVE_size() {
%1 = call i64 @high_size_bit(i32 0)
ret i64 %1
}

LLVM IR (-O2):
define i64 @splitkexists_bit_LaceKVE_size() {
%1 = tail call i64 @high_size_bit(i32 0)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ __checkType(int, int);
void f(int x) {
  int i, j, k;
  __checkType(x ? i : j, k);
  __checkType(x ? (i + 1) : j, 1);
  __checkType(x ? i : (j + 1), 1);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1130 <f+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <f+0x26>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <__checkType@plt>
cmpl   $0x0,-0x4(%rbp)
je     1159 <f+0x49>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115f <f+0x4f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    $0x1,%esi
call   1030 <__checkType@plt>
cmpl   $0x0,-0x4(%rbp)
je     1181 <f+0x71>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    118a <f+0x7a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x1,%esi
call   1030 <__checkType@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
call   1030 <__checkType@plt>
mov    $0x1,%esi
call   1030 <__checkType@plt>
mov    $0x1,%esi
pop    %rax
jmp    1030 <__checkType@plt>

LLVM IR (-O0):
define void @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %3
br label %12
10: ; preds = %1
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
%14 = load i32, i32* %5
%15 = call i32 @__checkType(i32 %13, i32 %14)
%16 = load i32, i32* %2
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %12
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
br label %23
21: ; preds = %12
%22 = load i32, i32* %4
br label %23
23: ; preds = %21, %18
%24 = phi i32 [ %20, %18 ], [ %22, %21 ]
%25 = call i32 @__checkType(i32 %24, i32 1)
%26 = load i32, i32* %2
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %23
%29 = load i32, i32* %3
br label %33
30: ; preds = %23
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
br label %33
33: ; preds = %30, %28
%34 = phi i32 [ %29, %28 ], [ %32, %30 ]
%35 = call i32 @__checkType(i32 %34, i32 1)
ret void
}

LLVM IR (-O2):
define void @f(i32 %0) {
%2 = tail call i32 @__checkType(i32 undef, i32 undef)
%3 = tail call i32 @__checkType(i32 undef, i32 1)
%4 = tail call i32 @__checkType(i32 undef, i32 1)
ret void
}
/* Type definitions */
struct wl_subsurface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int, int /*<<< orphan*/,
                                    int /*<<< orphan*/);
void wl_subsurface_set_position(struct wl_subsurface *wl_subsurface, int32_t x,
                                int32_t y) {
  wl_proxy_marshal((struct wl_proxy *)wl_subsurface, 1, x, y);
}


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

x86 assembly (clang, -O2):
<wl_subsurface_set_position>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <wl_proxy_marshal@plt>

LLVM IR (-O0):
%struct.wl_subsurface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_subsurface_set_position(%struct.wl_subsurface* %0, i32 %1, i32 %2) {
%4 = alloca %struct.wl_subsurface*
%5 = alloca i32
%6 = alloca i32
store %struct.wl_subsurface* %0, %struct.wl_subsurface** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.wl_subsurface*, %struct.wl_subsurface** %4
%8 = bitcast %struct.wl_subsurface* %7 to %struct.wl_proxy*
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %8, i32 1, i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.wl_subsurface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_subsurface_set_position(%struct.wl_subsurface* %0, i32 %1, i32 %2) {
%4 = bitcast %struct.wl_subsurface* %0 to %struct.wl_proxy*
%5 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %4, i32 1, i32 %1, i32 %2)
ret void
}
int find(int S[], int i) {
  if (S[i] != i) {
    return find(S, S[i]);
  }
  return i;
}


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
je     114f <find+0x3f>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <find@plt>
mov    %eax,-0x4(%rbp)
jmp    1155 <find+0x45>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find>:
mov    %esi,%eax
movslq %esi,%rcx
mov    (%rdi,%rcx,4),%esi
cmp    %ecx,%esi
jne    1100 <find>
ret

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

LLVM IR (-O2):
define i32 @find(i32* nocapture %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %1, %2 ], [ %7, %3 ]
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, %4
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 %4
}
void ftrace_nmi_enter(void) {}


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

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

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

LLVM IR (-O2):
define void @ftrace_nmi_enter() {
ret void
}
/* Variables and functions */
double normrand2();
double gaussrand(double mean, double std) {
  double rn, proposal;
  rn = normrand2();
  proposal = mean + std * rn;
  return (proposal);
}


x86 assembly (clang, -O0):
<gaussrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <normrand2@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gaussrand>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1030 <normrand2@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @gaussrand(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = call double (...) @normrand2()
store double %7, double* %5
%8 = load double, double* %3
%9 = load double, double* %4
%10 = load double, double* %5
%11 = call double @llvm.fmuladd.f64(double %9, double %10, double %8)
store double %11, double* %6
%12 = load double, double* %6
ret double %12
}

LLVM IR (-O2):
define double @gaussrand(double %0, double %1) {
%3 = tail call double (...) @normrand2()
%4 = tail call double @llvm.fmuladd.f64(double %1, double %3, double %0)
ret double %4
}
/* Variables and functions */
int unknown_function();
void l1_unknown_function_Bad() {
  int a[5];
  int idx = unknown_function() * 10;
  if (10 <= idx) {
    if (idx <= 10) {
      a[idx] = 0;
    }
  }
}


x86 assembly (clang, -O0):
<l1_unknown_function_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1030 <unknown_function@plt>
imul   $0xa,%eax,%eax
mov    %eax,-0x24(%rbp)
mov    $0xa,%eax
cmp    -0x24(%rbp),%eax
jg     114e <l1_unknown_function_Bad+0x3e>
cmpl   $0xa,-0x24(%rbp)
jg     1149 <l1_unknown_function_Bad+0x39>
movslq -0x24(%rbp),%rax
movl   $0x0,-0x20(%rbp,%rax,4)
jmp    114e <l1_unknown_function_Bad+0x3e>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @l1_unknown_function_Bad() {
%1 = alloca [5 x i32]
%2 = alloca i32
%3 = call i32 (...) @unknown_function()
%4 = mul nsw i32 %3, 10
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sle i32 10, %5
br i1 %6, label %7, label %15
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp sle i32 %8, 10
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 %12
store i32 0, i32* %13
br label %14
14: ; preds = %10, %7
br label %15
15: ; preds = %14, %0
ret void
}

LLVM IR (-O2):
define void @l1_unknown_function_Bad() {
%1 = tail call i32 (...) @unknown_function()
ret void
}
int ls_cost_nm5_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 2;
  if (sz_res)
    *sz_res = 2;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 1;
  return 0;
}


x86 assembly (clang, -O0):
<ls_cost_nm5_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <ls_cost_nm5_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <ls_cost_nm5_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <ls_cost_nm5_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <ls_cost_nm5_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm5_work>:
test   %rdi,%rdi
je     110b <ls_cost_nm5_work+0xb>
movl   $0x2,(%rdi)
test   %rsi,%rsi
je     1116 <ls_cost_nm5_work+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <ls_cost_nm5_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <ls_cost_nm5_work+0x2c>
movl   $0x1,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ls_cost_nm5_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 2, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 1, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dirs_rmdir(char *path) { printf("deleting directory... :) \n"); }


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

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

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

LLVM IR (-O2):
@str = [26 x i8] c"deleting directory... :) \00"
define void @dirs_rmdir(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
void set2(int *a) { *a = 2; }


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

x86 assembly (clang, -O2):
<set2>:
movl   $0x2,(%rdi)
ret

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

LLVM IR (-O2):
define void @set2(i32* nocapture writeonly %0) {
store i32 2, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_mainloop_iterate() {
  printf("NOT IMPLEMENTED:"
         "pa_mainloop_iterate"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_mainloop_iterate\00"
define i32 @pa_mainloop_iterate() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
float ceilf(float);
__attribute__((__weak__, __always___)) float softboundmpx_ceilf(float x) {
  return ceilf(x);
}


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

x86 assembly (clang, -O2):
<softboundmpx_ceilf>:
jmp    1030 <ceilf@plt>

LLVM IR (-O0):
define weak float @softboundmpx_ceilf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.ceil.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define weak float @softboundmpx_ceilf(float %0) {
%2 = tail call float @llvm.ceil.f32(float %0)
ret float %2
}
void ExttLogMonthAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttLogMonthAuxTable() {
ret void
}
double gt_double(double a, double b) { return a > b; }


x86 assembly (clang, -O0):
<gt_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt_double>:
cmpltsd %xmm0,%xmm1
movsd  0xef3(%rip),%xmm0
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @gt_double(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @gt_double(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
double heading_of_to_angle_deg(double angle) {
  double a = 90. - angle + 360.;
  while (a >= 180.)
    a -= 360.;
  return a;
}


x86 assembly (clang, -O0):
<heading_of_to_angle_deg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xedc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1159 <heading_of_to_angle_deg+0x59>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb5(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1127 <heading_of_to_angle_deg+0x27>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<heading_of_to_angle_deg>:
movapd %xmm0,%xmm1
movsd  0xef4(%rip),%xmm0
subsd  %xmm1,%xmm0
addsd  0xef0(%rip),%xmm0
ucomisd 0xef0(%rip),%xmm0
jb     114a <heading_of_to_angle_deg+0x4a>
movsd  0xeee(%rip),%xmm1
movsd  0xede(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
addsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
jae    1140 <heading_of_to_angle_deg+0x40>
ret

LLVM IR (-O0):
define double @heading_of_to_angle_deg(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double 9.000000e+01, %4
%6 = fadd double %5, 3.600000e+02
store double %6, double* %3
br label %7
7: ; preds = %10, %1
%8 = load double, double* %3
%9 = fcmp oge double %8, 1.800000e+02
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load double, double* %3
%12 = fsub double %11, 3.600000e+02
store double %12, double* %3
br label %7
13: ; preds = %7
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @heading_of_to_angle_deg(double %0) {
%2 = fsub double 9.000000e+01, %0
%3 = fadd double %2, 3.600000e+02
%4 = fcmp ult double %3, 1.800000e+02
br i1 %4, label %9, label %5
5: ; preds = %1, %5
%6 = phi double [ %7, %5 ], [ %3, %1 ]
%7 = fadd double %6, -3.600000e+02
%8 = fcmp ult double %7, 1.800000e+02
br i1 %8, label %9, label %5
9: ; preds = %5, %1
%10 = phi double [ %3, %1 ], [ %7, %5 ]
ret double %10
}
void fool(double x, double y, double *z) {
  *z = x * y + y;
  return;
}


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

x86 assembly (clang, -O2):
<fool>:
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @fool(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* %5
%9 = load double, double* %5
%10 = call double @llvm.fmuladd.f64(double %7, double %8, double %9)
%11 = load double*, double** %6
store double %10, double* %11
ret void
}

LLVM IR (-O2):
define void @fool(double %0, double %1, double* nocapture writeonly %2) {
%4 = tail call double @llvm.fmuladd.f64(double %0, double %1, double %1)
store double %4, double* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *strstr(char const *, char const *);
int check_username(const char *inp, const char *login) {
  return (NULL != strstr(inp, login)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<check_username>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,%rsi
xor    %eax,%eax
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_username>:
push   %rax
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @check_username(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 = load i8*, i8** %4
%7 = call i32* @strstr(i8* %5, i8* %6)
%8 = icmp ne i32* null, %7
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @check_username(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
f(int j) { return j; }


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

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int abs(int);
int __attribute__((no)) iabsv(int a) { return abs(a); }


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

x86 assembly (clang, -O2):
<iabsv>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @iabsv(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
int pfloat_ConvertFromFloat(float f) { return (int)(f * (1 << 16)); }


x86 assembly (clang, -O0):
<pfloat_ConvertFromFloat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pfloat_ConvertFromFloat>:
mulss  0xef8(%rip),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @pfloat_ConvertFromFloat(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 6.553600e+04
%5 = fptosi float %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @pfloat_ConvertFromFloat(float %0) {
%2 = fmul float %0, 6.553600e+04
%3 = fptosi float %2 to i32
ret i32 %3
}
/* Variables and functions */
char *bson_find_field(char *, char *, int);
int bson_find_field_as_array(char *buffer, char *field, char **data) {
  char *tmp = bson_find_field(buffer, field, 0x04);
  if (tmp) {
    *data = tmp + 4;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<bson_find_field_as_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1030 <bson_find_field@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1160 <bson_find_field_as_array+0x50>
mov    -0x28(%rbp),%rcx
add    $0x4,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1167 <bson_find_field_as_array+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bson_find_field_as_array>:
push   %rbx
mov    %rdx,%rbx
mov    $0x4,%edx
call   1030 <bson_find_field@plt>
test   %rax,%rax
je     1131 <bson_find_field_as_array+0x21>
add    $0x4,%rax
mov    %rax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @bson_find_field_as_array(i8* %0, i8* %1, i8** nocapture writeonly %2) {
%4 = tail call i8* @bson_find_field(i8* %0, i8* %1, i32 4)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 4
store i8* %7, i8** %2
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %9
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int numbtrop_standard_dimension(int *dim) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc4c(729, dim, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<numbtrop_standard_dimension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2d9,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numbtrop_standard_dimension>:
mov    %rdi,%rsi
mov    $0x2d9,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @numbtrop_standard_dimension(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %4
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc4c(i32 729, i32* %6, i32* %7, double* %8, i32 0)
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @numbtrop_standard_dimension(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 729, i32* %0, i32* undef, double* undef, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ CE_High();
int /*<<< orphan*/ CE_Low();
int /*<<< orphan*/ Send_Byte(unsigned char);
void Auto_Add_IncB(unsigned char byte1, unsigned char byte2) {
  CE_Low();
  Send_Byte(0xAD);
  Send_Byte(byte1);
  Send_Byte(byte2);
  CE_High();
}


x86 assembly (clang, -O0):
<Auto_Add_IncB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1050 <CE_Low@plt>
mov    $0xad,%edi
call   1030 <Send_Byte@plt>
movzbl -0x1(%rbp),%edi
call   1030 <Send_Byte@plt>
movzbl -0x2(%rbp),%edi
call   1030 <Send_Byte@plt>
mov    $0x0,%al
call   1040 <CE_High@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Auto_Add_IncB>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <CE_Low@plt>
mov    $0xad,%edi
call   1030 <Send_Byte@plt>
mov    %ebp,%edi
call   1030 <Send_Byte@plt>
mov    %ebx,%edi
call   1030 <Send_Byte@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <CE_High@plt>

LLVM IR (-O0):
define void @Auto_Add_IncB(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call i32 (...) @CE_Low()
%6 = call i32 @Send_Byte(i8 zeroext -83)
%7 = load i8, i8* %3
%8 = call i32 @Send_Byte(i8 zeroext %7)
%9 = load i8, i8* %4
%10 = call i32 @Send_Byte(i8 zeroext %9)
%11 = call i32 (...) @CE_High()
ret void
}

LLVM IR (-O2):
define void @Auto_Add_IncB(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 (...) @CE_Low()
%4 = tail call i32 @Send_Byte(i8 zeroext -83)
%5 = tail call i32 @Send_Byte(i8 zeroext %0)
%6 = tail call i32 @Send_Byte(i8 zeroext %1)
%7 = tail call i32 (...) @CE_High()
ret void
}
void dll_create_generic(void (*insert_fnc)()) {
  int x;
  insert_fnc(&x);
}


x86 assembly (clang, -O0):
<dll_create_generic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x0,%al
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dll_create_generic>:
push   %rax
mov    %rdi,%rcx
lea    0x4(%rsp),%rdi
xor    %eax,%eax
call   *%rcx
pop    %rax
ret

LLVM IR (-O0):
define void @dll_create_generic(void (...)* %0) {
%2 = alloca void (...)*
%3 = alloca i32
store void (...)* %0, void (...)** %2
%4 = load void (...)*, void (...)** %2
%5 = bitcast void (...)* %4 to void (i32*, ...)*
ret void
}

LLVM IR (-O2):
define void @dll_create_generic(void (...)* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = bitcast void (...)* %0 to void (i32*, ...)*
ret void
}
void *ikvm_MarshalDelegate(void *p) { return p; }


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

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

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

LLVM IR (-O2):
define i8* @ikvm_MarshalDelegate(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xe4() {
  Assert_real((isxdigit(228) == 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_isxdigit.c",
              1145, ("isxdigit should be 0 for 0xe4"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xe4>:
push   %rax
mov    $0xe4,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x479,%edx
pop    %rax
jmp    1040 <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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xe4\00"
define void @t_isxdigit_0xe4() {
%1 = call i64 @isxdigit(i32 228)
%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 1145, 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xe4\00"
define void @t_isxdigit_0xe4() {
%1 = tail call i64 @isxdigit(i32 228)
%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 1145, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void handler(int num) { printf("signal %d raised\n", num); }


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"signal %d raised\0A\00"
define void @handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
char **strv_split_full(char const *, char const *, int /*<<< orphan*/);
char **strv_split(const char *s, const char *separator) {
  return strv_split_full(s, separator, 0);
}


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

x86 assembly (clang, -O2):
<strv_split>:
xor    %edx,%edx
jmp    1030 <strv_split_full@plt>

LLVM IR (-O0):
define i8** @strv_split(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 = load i8*, i8** %4
%7 = call i8** @strv_split_full(i8* %5, i8* %6, i32 0)
ret i8** %7
}

LLVM IR (-O2):
define i8** @strv_split(i8* %0, i8* %1) {
%3 = tail call i8** @strv_split_full(i8* %0, i8* %1, i32 0)
ret i8** %3
}
void ctl_pitch_bend(int channel, int val) {}


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

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

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

LLVM IR (-O2):
define void @ctl_pitch_bend(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ net_send(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, int);
void irc_limit(char *channel, int limit) {
  char msg[(512 - 3)];
  snprintf(msg, (512 - 3), "%s %s +l %d", "MODE", channel, limit);
  net_send(msg);
}


x86 assembly (clang, -O0):
<irc_limit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    -0xc(%rbp),%r9d
mov    $0x1fd,%esi
lea    0xeb3(%rip),%rdx
lea    0xeb8(%rip),%rcx
call   1030 <snprintf@plt>
lea    -0x210(%rbp),%rdi
call   1040 <net_send@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_limit>:
push   %rbx
sub    $0x200,%rsp
mov    %esi,%r9d
mov    %rdi,%r8
lea    0xecb(%rip),%rdx
lea    0xed0(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1fd,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <net_send@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%s %s +l %d\00"
@.str.1 = [5 x i8] c"MODE\00"
define void @irc_limit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [509 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @snprintf(i8* %6, i32 509, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %7, i32 %8)
%10 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%11 = call i32 @net_send(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s %s +l %d\00"
@.str.1 = [5 x i8] c"MODE\00"
define void @irc_limit(i8* %0, i32 %1) {
%3 = alloca [509 x i8]
%4 = getelementptr inbounds [509 x i8], [509 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 509, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %1)
%6 = call i32 @net_send(i8* %4)
ret void
}
int ft_2dlen(char **array) {
  int i;
  int j;
  i = 0;
  while (array[i] != '\0') {
    j = 0;
    while (array[i][j] != '\0')
      j++;
    i++;
  }
  return (i);
}


x86 assembly (clang, -O0):
<ft_2dlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1162 <ft_2dlen+0x62>
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1154 <ft_2dlen+0x54>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1129 <ft_2dlen+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ft_2dlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_2dlen>:
cmpq   $0x0,(%rdi)
je     111d <ft_2dlen+0x1d>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <ft_2dlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_2dlen(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw i64 %5, 1
%7 = getelementptr inbounds i8*, i8** %0, i64 %6
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %6 to i32
br label %12
12: ; preds = %10, %1
%13 = phi i32 [ 0, %1 ], [ %11, %10 ]
ret i32 %13
}
void object_fini(struct mm *mm, struct object *obj) {}


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

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

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

LLVM IR (-O2):
%struct.mm = type opaque
%struct.object = type opaque
define void @object_fini(%struct.mm* nocapture %0, %struct.object* nocapture %1) {
ret void
}
int hamming_weight(char c) {
  int ret = 0;
  for (int i = 7; i >= 0; i--) {
    char tmp = c;
    tmp = (tmp >> i) & 0x01;
    if (tmp == 1)
      ret++;
  }
  return ret;
}


x86 assembly (clang, -O0):
<hamming_weight>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1160 <hamming_weight+0x60>
mov    -0x1(%rbp),%al
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
cmp    $0x1,%eax
jne    114d <hamming_weight+0x4d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <hamming_weight+0x52>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1118 <hamming_weight+0x18>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hamming_weight>:
movzbl %dil,%eax
mov    %eax,%ecx
shr    $0x7,%ecx
mov    %eax,%edx
shr    $0x6,%edx
and    $0x1,%edx
add    %ecx,%edx
mov    %eax,%ecx
shr    $0x5,%ecx
and    $0x1,%ecx
add    %edx,%ecx
mov    %eax,%edx
shr    $0x4,%edx
and    $0x1,%edx
add    %ecx,%edx
mov    %eax,%ecx
shr    $0x3,%ecx
and    $0x1,%ecx
add    %edx,%ecx
mov    %eax,%edx
shr    $0x2,%edx
and    $0x1,%edx
add    %ecx,%edx
shr    %eax
and    $0x1,%eax
add    %edx,%eax
and    $0x1,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @hamming_weight(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i8 %0, i8* %2
store i32 0, i32* %3
store i32 7, i32* %4
br label %6
6: ; preds = %24, %1
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %27
9: ; preds = %6
%10 = load i8, i8* %2
store i8 %10, i8* %5
%11 = load i8, i8* %5
%12 = sext i8 %11 to i32
%13 = load i32, i32* %4
%14 = ashr i32 %12, %13
%15 = and i32 %14, 1
%16 = trunc i32 %15 to i8
store i8 %16, i8* %5
%17 = load i8, i8* %5
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %23
20: ; preds = %9
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %23
23: ; preds = %20, %9
br label %24
24: ; preds = %23
%25 = load i32, i32* %4
%26 = add nsw i32 %25, -1
store i32 %26, i32* %4
br label %6
27: ; preds = %6
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @hamming_weight(i8 signext %0) {
%2 = zext i8 %0 to i32
%3 = lshr i32 %2, 7
%4 = lshr i32 %2, 6
%5 = and i32 %4, 1
%6 = add nuw nsw i32 %5, %3
%7 = lshr i32 %2, 5
%8 = and i32 %7, 1
%9 = add nuw nsw i32 %8, %6
%10 = lshr i32 %2, 4
%11 = and i32 %10, 1
%12 = add nuw nsw i32 %11, %9
%13 = lshr i32 %2, 3
%14 = and i32 %13, 1
%15 = add nuw nsw i32 %14, %12
%16 = lshr i32 %2, 2
%17 = and i32 %16, 1
%18 = add nuw nsw i32 %17, %15
%19 = lshr i32 %2, 1
%20 = and i32 %19, 1
%21 = add nuw nsw i32 %20, %18
%22 = and i32 %2, 1
%23 = add nuw nsw i32 %22, %21
ret i32 %23
}