xunge/DecIR huggingface dataset:
/* Variables and functions */
bool less_or_equals(int excepted, int actual) { return actual <= excepted; }


x86 assembly (clang, -O0):
<less_or_equals>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<less_or_equals>:
xor    %eax,%eax
cmp    %edi,%esi
setle  %al
ret

LLVM IR (-O0):
define i32 @less_or_equals(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = icmp sle i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @less_or_equals(i32 %0, i32 %1) {
%3 = icmp sle i32 %1, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
imm0indreg1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if (22 <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imm0indreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movswl (%rax),%ecx
mov    $0x16,%eax
cmp    %ecx,%eax
jg     113f <imm0indreg1+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <imm0indreg1+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imm0indreg1>:
xor    %eax,%eax
cmpw   $0x16,(%r9)
setge  %al
ret

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

LLVM IR (-O2):
define i32 @imm0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = load i16, i16* %5
%8 = icmp sgt i16 %7, 21
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_ynf();
scalar_t__ ynf(int, float);
void test_ynf(int x, float f) {
  if (ynf(x, f) != ynf(x, f))
    link_failure_ynf();
}


x86 assembly (clang, -O0):
<test_ynf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
movss  -0x8(%rbp),%xmm0
call   1030 <ynf@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
movss  -0x8(%rbp),%xmm0
call   1030 <ynf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     1165 <test_ynf+0x45>
mov    $0x0,%al
call   1040 <link_failure_ynf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ynf>:
push   %r14
push   %rbx
push   %rax
movss  %xmm0,0x4(%rsp)
mov    %edi,%ebx
call   1030 <ynf@plt>
mov    %rax,%r14
mov    %ebx,%edi
movss  0x4(%rsp),%xmm0
call   1030 <ynf@plt>
cmp    %rax,%r14
jne    114e <test_ynf+0x2e>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <link_failure_ynf@plt>

LLVM IR (-O0):
define void @test_ynf(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load i32, i32* %3
%6 = load float, float* %4
%7 = call i64 @ynf(i32 %5, float %6)
%8 = load i32, i32* %3
%9 = load float, float* %4
%10 = call i64 @ynf(i32 %8, float %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_ynf()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_ynf(i32 %0, float %1) {
%3 = tail call i64 @ynf(i32 %0, float %1)
%4 = tail call i64 @ynf(i32 %0, float %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_ynf()
br label %8
8: ; preds = %6, %2
ret void
}
void walt_init_new_task_load(struct task_struct *p) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @walt_init_new_task_load(%struct.task_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int random();
void FNlatent_random_modelled_bad(int y) {
  int x = random();
  if (x == y) {
    int *p = NULL;
    *p = 42;
  }
}


x86 assembly (clang, -O0):
<FNlatent_random_modelled_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    1143 <FNlatent_random_modelled_bad+0x33>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x2a,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @FNlatent_random_modelled_bad(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %2
%5 = call i32 (...) @random()
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %1
store i32* null, i32** %4
%10 = load i32*, i32** %4
store i32 42, i32* %10
br label %11
11: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
define void @FNlatent_random_modelled_bad(i32 %0) {
%2 = tail call i32 (...) @random()
%3 = icmp ne i32 %2, %0
tail call void @llvm.assume(i1 %3)
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double currentSeconds(void) {
  struct timeval now_time;
  gettimeofday(&now_time, 0);
  return (now_time.tv_sec + now_time.tv_usec * 1.e-6);
}


x86 assembly (clang, -O0):
<currentSeconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xecb(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<currentSeconds>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @currentSeconds() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = call double @llvm.fmuladd.f64(double %6, double 0x3EB0C6F7A0B5ED8D, double %4)
ret double %7
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @currentSeconds() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = call double @llvm.fmuladd.f64(double %7, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %8
}
/* Variables and functions */
int getgid();
int getuid();
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  printf("uid = %d, gid = %d\n", getuid(), getgid());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getgid@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getgid@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"uid = %d, gid = %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getuid()
%3 = call i32 (...) @getgid()
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"uid = %d, gid = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getuid()
%2 = tail call i32 (...) @getgid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
void remove_element_from_list(int *array, int tam, int index) {
  array[index] = array[--tam];
}


x86 assembly (clang, -O0):
<remove_element_from_list>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_element_from_list>:
movslq %esi,%rax
mov    -0x4(%rdi,%rax,4),%eax
movslq %edx,%rcx
mov    %eax,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @remove_element_from_list(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 = add nsw i32 %8, -1
store i32 %9, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %7, i64 %10
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
store i32 %12, i32* %16
ret void
}

LLVM IR (-O2):
define void @remove_element_from_list(i32* nocapture %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %7, i32* %9
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int i, j, n;
  i = __VERIFIER_nondet_int();
  j = __VERIFIER_nondet_int();
  n = __VERIFIER_nondet_int();
  while (i < n) {
    j = 0;
    while (j <= i) {
      j = j + 1;
    }
    i = i + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1178 <main+0x68>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     116a <main+0x5a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <main+0x40>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
double sacos(double);
double edgetoangle(double a, double b, double c) {
  return sacos((b * b + c * c - a * a) / (2 * b * c));
}


x86 assembly (clang, -O0):
<edgetoangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe8c(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sacos@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<edgetoangle>:
movapd %xmm1,%xmm3
addsd  %xmm1,%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm2
mulsd  %xmm3,%xmm3
addsd  %xmm2,%xmm3
mulsd  %xmm0,%xmm0
subsd  %xmm0,%xmm3
divsd  %xmm1,%xmm3
movapd %xmm3,%xmm0
jmp    1030 <sacos@plt>

LLVM IR (-O0):
define double @edgetoangle(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* %5
%8 = load double, double* %5
%9 = load double, double* %6
%10 = load double, double* %6
%11 = fmul double %9, %10
%12 = call double @llvm.fmuladd.f64(double %7, double %8, double %11)
%13 = load double, double* %4
%14 = load double, double* %4
%15 = fneg double %13
%16 = call double @llvm.fmuladd.f64(double %15, double %14, double %12)
%17 = load double, double* %5
%18 = fmul double 2.000000e+00, %17
%19 = load double, double* %6
%20 = fmul double %18, %19
%21 = fdiv double %16, %20
%22 = call double @sacos(double %21)
ret double %22
}

LLVM IR (-O2):
define double @edgetoangle(double %0, double %1, double %2) {
%4 = fmul double %2, %2
%5 = tail call double @llvm.fmuladd.f64(double %1, double %1, double %4)
%6 = fneg double %0
%7 = tail call double @llvm.fmuladd.f64(double %6, double %0, double %5)
%8 = fmul double %1, 2.000000e+00
%9 = fmul double %8, %2
%10 = fdiv double %7, %9
%11 = tail call double @sacos(double %10)
ret double %11
}
unsigned int altera_a10_atx_lookup_tank(unsigned int fvco) {
  if (fvco < 8800000)
    return 0;
  else if (fvco < 11400000)
    return 1;
  else
    return 2;
}


x86 assembly (clang, -O0):
<altera_a10_atx_lookup_tank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x864700,-0x8(%rbp)
jae    1120 <altera_a10_atx_lookup_tank+0x20>
movl   $0x0,-0x4(%rbp)
jmp    1140 <altera_a10_atx_lookup_tank+0x40>
cmpl   $0xadf340,-0x8(%rbp)
jae    1139 <altera_a10_atx_lookup_tank+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1140 <altera_a10_atx_lookup_tank+0x40>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<altera_a10_atx_lookup_tank>:
cmp    $0xadf340,%edi
mov    $0x2,%ecx
sbb    $0x0,%ecx
xor    %eax,%eax
cmp    $0x864700,%edi
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @altera_a10_atx_lookup_tank(i32 %0) {
%2 = icmp ult i32 %0, 8800000
%3 = icmp ult i32 %0, 11400000
%4 = select i1 %3, i32 1, i32 2
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
void XSetWMName() {}


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

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

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

LLVM IR (-O2):
define void @XSetWMName() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void _HibernateWriteComplete(void) {
  while (!((*((volatile uint32_t *)(0x400FC010))) & 0x80000000)) {
  }
}


x86 assembly (clang, -O0):
<_HibernateWriteComplete>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <_HibernateWriteComplete+0x9>
mov    $0x400fc010,%eax
mov    (%rax),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112a <_HibernateWriteComplete+0x2a>
jmp    112f <_HibernateWriteComplete+0x2f>
jmp    1109 <_HibernateWriteComplete+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_HibernateWriteComplete>:
cmpl   $0x0,0x400fc010
jns    1100 <_HibernateWriteComplete>
ret

LLVM IR (-O0):
define void @_HibernateWriteComplete() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i32, i32* inttoptr (i64 1074774032 to i32*)
%3 = and i32 %2, -2147483648
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @_HibernateWriteComplete() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 1074774032 to i32*)
%3 = icmp sgt i32 %2, -1
br i1 %3, label %1, label %4
4: ; preds = %1
ret void
}
void raw_set_stdio(init) int init;
{ mch_settmode(init); }


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

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

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

LLVM IR (-O2):
define void @raw_set_stdio(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @mch_settmode to i32 (i32, ...)*)(i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ symbolic_char(char);
int find_nonsymbolic(char *str, int index) {
  while (symbolic_char(str[index]))
    index++;
  return index;
}


x86 assembly (clang, -O0):
<find_nonsymbolic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <symbolic_char@plt>
cmp    $0x0,%rax
je     1148 <find_nonsymbolic+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <find_nonsymbolic+0xf>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_nonsymbolic>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movslq %esi,%rax
lea    -0x1(%rax),%ebp
add    %rax,%rbx
nop
movsbl (%rbx),%edi
call   1030 <symbolic_char@plt>
add    $0x1,%ebp
add    $0x1,%rbx
test   %rax,%rax
jne    1120 <find_nonsymbolic+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @find_nonsymbolic(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %10, %4 ], [ %3, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i64 @symbolic_char(i8 signext %7)
%9 = icmp eq i64 %8, 0
%10 = add i64 %5, 1
br i1 %9, label %11, label %4
11: ; preds = %4
%12 = trunc i64 %5 to i32
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void write_prototype(FILE *filep, char *base_name) {
  fprintf(filep, "void %s(void);\n", base_name);
}


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

x86 assembly (clang, -O2):
<write_prototype>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"void %s(void);\0A\00"
define void @write_prototype(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ write(int, void const *, size_t);
__attribute__((weak)) ssize_t __real_write(int fd, const void *buf,
                                           size_t nbyte) {
  return write(fd, buf, nbyte);
}


x86 assembly (clang, -O0):
<__real_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__real_write>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define weak i32 @__real_write(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
void h(void) { const struct u3; }


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

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

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

LLVM IR (-O2):
define void @h() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char i;
  for (i = 'A'; i <= 'z'; i++) {
    printf("%c", i);
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x41,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     115d <main+0x4d>
movsbl -0x5(%rbp),%esi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1123 <main+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x41,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x7b,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 65, %0 ], [ %5, %1 ]
%3 = tail call i32 @putchar(i32 %2)
%4 = tail call i32 @putchar(i32 10)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 123
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
/* Variables and functions */
int voCore_writeFile(char *, char *, char *);
int voCore_gpioDirectionOut(char *index) {
  return voCore_writeFile("/direction", index, "out");
}


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

x86 assembly (clang, -O2):
<voCore_gpioDirectionOut>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
lea    0xeea(%rip),%rdx
jmp    1030 <voCore_writeFile@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"/direction\00"
@.str.1 = [4 x i8] c"out\00"
define i32 @voCore_gpioDirectionOut(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @voCore_writeFile(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [11 x i8] c"/direction\00"
@.str.1 = [4 x i8] c"out\00"
define i32 @voCore_gpioDirectionOut(i8* %0) {
%2 = tail call i32 @voCore_writeFile(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ adc_pin_config();
int /*<<< orphan*/ lcd_port_config();
int /*<<< orphan*/ left_encoder_pin_config();
int /*<<< orphan*/ motion_pin_config();
int /*<<< orphan*/ right_encoder_pin_config();
int /*<<< orphan*/ spi_pin_config();
void port_init(void) {
  adc_pin_config();
  spi_pin_config();
  lcd_port_config();
  motion_pin_config();
  left_encoder_pin_config();
  right_encoder_pin_config();
}


x86 assembly (clang, -O0):
<port_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <adc_pin_config@plt>
mov    $0x0,%al
call   1070 <spi_pin_config@plt>
mov    $0x0,%al
call   1050 <lcd_port_config@plt>
mov    $0x0,%al
call   1080 <motion_pin_config@plt>
mov    $0x0,%al
call   1060 <left_encoder_pin_config@plt>
mov    $0x0,%al
call   1040 <right_encoder_pin_config@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<port_init>:
push   %rax
xor    %eax,%eax
call   1030 <adc_pin_config@plt>
xor    %eax,%eax
call   1070 <spi_pin_config@plt>
xor    %eax,%eax
call   1050 <lcd_port_config@plt>
xor    %eax,%eax
call   1080 <motion_pin_config@plt>
xor    %eax,%eax
call   1060 <left_encoder_pin_config@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <right_encoder_pin_config@plt>

LLVM IR (-O0):
define void @port_init() {
%1 = call i32 (...) @adc_pin_config()
%2 = call i32 (...) @spi_pin_config()
%3 = call i32 (...) @lcd_port_config()
%4 = call i32 (...) @motion_pin_config()
%5 = call i32 (...) @left_encoder_pin_config()
%6 = call i32 (...) @right_encoder_pin_config()
ret void
}

LLVM IR (-O2):
define void @port_init() {
%1 = tail call i32 (...) @adc_pin_config()
%2 = tail call i32 (...) @spi_pin_config()
%3 = tail call i32 (...) @lcd_port_config()
%4 = tail call i32 (...) @motion_pin_config()
%5 = tail call i32 (...) @left_encoder_pin_config()
%6 = tail call i32 (...) @right_encoder_pin_config()
ret void
}
void XShmGetImage() {}


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

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

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

LLVM IR (-O2):
define void @XShmGetImage() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
void char_test() {
  char c1 = 'E';
  char c2 = 'GH';
  printf("c1 = %c, c2 = %c\n", c1, c2);
}


x86 assembly (clang, -O0):
<char_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x45,-0x1(%rbp)
movb   $0x48,-0x2(%rbp)
mov    -0x1(%rbp),%al
lea    0xed6(%rip),%rdi
movsbl %al,%esi
movsbl -0x2(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_test>:
lea    0xee9(%rip),%rdi
mov    $0x45,%esi
mov    $0x48,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"c1 = %c, c2 = %c\0A\00"
define void @char_test() {
%1 = alloca i8
%2 = alloca i8
store i8 69, i8* %1
store i8 72, i8* %2
%3 = load i8, i8* %1
%4 = load i8, i8* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8 signext %3, i8 signext %4)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"c1 = %c, c2 = %c\0A\00"
define void @char_test() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8 signext 69, i8 signext 72)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_ptr(void *ptr) {
  if (!ptr || !(*(void **)ptr))
    return;
  free(*(void **)ptr);
  *(void **)ptr = NULL;
}


x86 assembly (clang, -O0):
<free_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1135 <free_ptr+0x25>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    113a <free_ptr+0x2a>
jmp    1151 <free_ptr+0x41>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_ptr>:
push   %rbx
test   %rdi,%rdi
je     112d <free_ptr+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <free_ptr+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @free_ptr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i8**
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @free(i8* %5)
store i8* null, i8** %4
br label %9
9: ; preds = %1, %3, %7
ret void
}
void RTTcpServerDisconnectClient2(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTcpServerDisconnectClient2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printArr(int arr[], int m) {
  int i;
  for (i = 0; i < m; i++) {
    printf("%d ", arr[i]);
  }
}


x86 assembly (clang, -O0):
<printArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <printArr+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArr+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <printArr+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printArr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @printArr(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
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int SignExtend(unsigned int x, int bits) {
  int r;
  int m = 1U << (bits - 1);
  x = x & ((1U << bits) - 1);
  r = (x ^ m) - m;
  return r;
}


x86 assembly (clang, -O0):
<SignExtend>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x10(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SignExtend>:
lea    -0x1(%rsi),%r8d
mov    $0x1,%edx
mov    %r8d,%ecx
shl    %cl,%edx
mov    $0xffffffff,%eax
mov    %esi,%ecx
shl    %cl,%eax
not    %eax
and    %edi,%eax
btc    %r8d,%eax
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @SignExtend(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 = sub nsw i32 %7, 1
%9 = shl i32 1, %8
store i32 %9, i32* %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = shl i32 1, %11
%13 = sub i32 %12, 1
%14 = and i32 %10, %13
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = load i32, i32* %6
%17 = xor i32 %15, %16
%18 = load i32, i32* %6
%19 = sub i32 %17, %18
store i32 %19, i32* %5
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @SignExtend(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = shl nuw i32 1, %3
%5 = shl nsw i32 -1, %1
%6 = xor i32 %5, -1
%7 = and i32 %6, %0
%8 = xor i32 %7, %4
%9 = sub i32 %8, %4
ret i32 %9
}
double bessel_y(x, y)
double x, y;
{
  int n = (int)x;
  return (yn(n, y));
}


x86 assembly (clang, -O0):
<bessel_y>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1030 <yn@plt>
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bessel_y>:
push   %rax
cvttsd2si %xmm0,%edi
movaps %xmm1,%xmm0
mov    $0x1,%al
call   1030 <yn@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @bessel_y(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fptosi double %6 to i32
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load double, double* %4
%10 = call i32 (i32, double, ...) bitcast (i32 (...)* @yn to i32 (i32, double, ...)*)(i32 %8, double %9)
%11 = sitofp i32 %10 to double
ret double %11
}

LLVM IR (-O2):
define double @bessel_y(double %0, double %1) {
%3 = fptosi double %0 to i32
%4 = tail call i32 (i32, double, ...) bitcast (i32 (...)* @yn to i32 (i32, double, ...)*)(i32 %3, double %1)
%5 = sitofp i32 %4 to double
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_UNBLOCK;
scalar_t__ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/);
int sigrelse(int sig) {
  sigset_t mask;
  sigemptyset(&mask);
  if (sigaddset(&mask, sig) < 0)
    return -1;
  return sigprocmask(SIG_UNBLOCK, &mask, 0);
}


x86 assembly (clang, -O0):
<sigrelse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    -0x8(%rbp),%esi
lea    -0xc(%rbp),%rdi
call   1050 <sigaddset@plt>
cmp    $0x0,%rax
jge    1166 <sigrelse+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <sigrelse+0x4d>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    -0xc(%rbp),%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigrelse>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <sigemptyset@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <sigaddset@plt>
test   %rax,%rax
js     1169 <sigrelse+0x39>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
jmp    116e <sigrelse+0x3e>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@SIG_UNBLOCK = global i32 0
define i32 @sigrelse(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sigemptyset(i32* %2)
%5 = call i64 @sigaddset(i32* %2, i32 %0)
%6 = icmp slt i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* @SIG_UNBLOCK
%9 = call i32 @sigprocmask(i32 %8, i32* %2, i32 0)
br label %10
10: ; preds = %1, %7
%11 = phi i32 [ %9, %7 ], [ -1, %1 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
char *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
char *first_line(const char *path, char *buff, int len) {
  FILE *fp = fopen(path, "r");
  char *ret = fgets(buff, len, fp);
  fclose(fp);
  return ret;
}


x86 assembly (clang, -O0):
<first_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <fgets@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_line>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
lea    0xebf(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %rax,%rdx
call   1040 <fgets@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1030 <fclose@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i8* @first_line(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %10, i32** %7
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = load i32*, i32** %7
%14 = call i8* @fgets(i8* %11, i32 %12, i32* %13)
store i8* %14, i8** %8
%15 = load i32*, i32** %7
%16 = call i32 @fclose(i32* %15)
%17 = load i8*, i8** %8
ret i8* %17
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i8* @first_line(i8* nocapture %0, i8* %1, i32 %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i8* @fgets(i8* %1, i32 %2, i32* %4)
%6 = tail call i32 @fclose(i32* %4)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void our_debug_ap(void *ctx, int reason, const char *fmt, va_list ap) {
  (void)ctx;
  (void)reason;
  vfprintf(stderr, fmt, ap);
  fputc('\n', stderr);
  fflush(stderr);
}


x86 assembly (clang, -O0):
<our_debug_ap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1050 <vfprintf@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<our_debug_ap>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
mov    %rdx,%rsi
mov    %ecx,%edx
call   1050 <vfprintf@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @our_debug_ap(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call i32 @vfprintf(i32 %11, i8* %12, i32 %13)
%15 = load i32, i32* @stderr
%16 = call i32 @fputc(i8 signext 10, i32 %15)
%17 = load i32, i32* @stderr
%18 = call i32 @fflush(i32 %17)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @our_debug_ap(i8* nocapture readnone %0, i32 %1, i8* %2, i32 %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @vfprintf(i32 %5, i8* %2, i32 %3)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fputc(i8 signext 10, i32 %7)
%9 = load i32, i32* @stderr
%10 = tail call i32 @fflush(i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void funcWithParm(int i) { printf("this is func() %d\n", i); }


x86 assembly (clang, -O0):
<funcWithParm>:
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):
<funcWithParm>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"this is func() %d\0A\00"
define void @funcWithParm(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct forth_instance {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ parse(struct forth_instance *);
int /*<<< orphan*/ st_push(struct forth_instance *, intptr_t);
int /*<<< orphan*/ tick_addr(struct forth_instance *);
void tick(struct forth_instance *fi) {
  st_push(fi, (intptr_t)' ');
  parse(fi);
  tick_addr(fi);
}


x86 assembly (clang, -O0):
<tick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1050 <st_push@plt>
mov    -0x8(%rbp),%rdi
call   1040 <parse@plt>
mov    -0x8(%rbp),%rdi
call   1030 <tick_addr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tick>:
push   %rbx
mov    %rdi,%rbx
mov    $0x20,%esi
call   1050 <st_push@plt>
mov    %rbx,%rdi
call   1040 <parse@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <tick_addr@plt>

LLVM IR (-O0):
%struct.forth_instance = type { i32 }
define void @tick(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
store %struct.forth_instance* %0, %struct.forth_instance** %2
%3 = load %struct.forth_instance*, %struct.forth_instance** %2
%4 = call i32 @st_push(%struct.forth_instance* %3, i64 32)
%5 = load %struct.forth_instance*, %struct.forth_instance** %2
%6 = call i32 @parse(%struct.forth_instance* %5)
%7 = load %struct.forth_instance*, %struct.forth_instance** %2
%8 = call i32 @tick_addr(%struct.forth_instance* %7)
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type { i32 }
define void @tick(%struct.forth_instance* %0) {
%2 = tail call i32 @st_push(%struct.forth_instance* %0, i64 32)
%3 = tail call i32 @parse(%struct.forth_instance* %0)
%4 = tail call i32 @tick_addr(%struct.forth_instance* %0)
ret void
}