xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_castpd_ps(int /*<<< orphan*/);
__m128 test_mm_castpd_ps(__m128d A) { return _mm_castpd_ps(A); }


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

x86 assembly (clang, -O2):
<test_mm_castpd_ps>:
jmp    1030 <_mm_castpd_ps@plt>

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

LLVM IR (-O2):
define i32 @test_mm_castpd_ps(i32 %0) {
%2 = tail call i32 @_mm_castpd_ps(i32 %0)
ret i32 %2
}
float sutDotProduct_3x3(float *VectorA, float *VectorB) {
  return VectorA[0] * VectorB[0] + VectorA[1] * VectorB[1] +
         VectorA[2] * VectorB[2];
}


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

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

LLVM IR (-O0):
define float @sutDotProduct_3x3(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 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
%18 = call float @llvm.fmuladd.f32(float %7, float %10, float %17)
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 2
%24 = load float, float* %23
%25 = call float @llvm.fmuladd.f32(float %21, float %24, float %18)
ret float %25
}

LLVM IR (-O2):
define float @sutDotProduct_3x3(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
ret float %15
}
/* Variables and functions */
scalar_t__ cpu_is_s5pc100();
scalar_t__ cpu_is_s5pc110();
unsigned int get_bank_num(void) {
  if (cpu_is_s5pc100())
    return 1;
  else if (cpu_is_s5pc110())
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<get_bank_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <cpu_is_s5pc100@plt>
cmp    $0x0,%rax
je     1145 <get_bank_num+0x25>
movl   $0x1,-0x4(%rbp)
jmp    116e <get_bank_num+0x4e>
mov    $0x0,%al
call   1030 <cpu_is_s5pc110@plt>
cmp    $0x0,%rax
je     1162 <get_bank_num+0x42>
movl   $0x1,-0x4(%rbp)
jmp    116e <get_bank_num+0x4e>
jmp    1167 <get_bank_num+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bank_num>:
push   %rax
xor    %eax,%eax
call   1040 <cpu_is_s5pc100@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <get_bank_num+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <cpu_is_s5pc110@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @get_bank_num() {
%1 = tail call i64 (...) @cpu_is_s5pc100()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @cpu_is_s5pc110()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int led_get();
int /*<<< orphan*/ led_set(int);
void led_blink(uint32_t led_id) {
  led_set(0x1f320000 | ((led_get() | (1 << (led_id << 4))) & 0x0000ffff));
}


x86 assembly (clang, -O0):
<led_blink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <led_get@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%ecx
shl    $0x4,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,%edi
and    $0xffff,%edi
or     $0x1f320000,%edi
call   1040 <led_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_blink>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <led_get@plt>
shl    $0x4,%ebx
bts    %ebx,%eax
movzwl %ax,%edi
or     $0x1f320000,%edi
pop    %rbx
jmp    1040 <led_set@plt>

LLVM IR (-O0):
define void @led_blink(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @led_get()
%4 = load i32, i32* %2
%5 = shl i32 %4, 4
%6 = shl i32 1, %5
%7 = or i32 %3, %6
%8 = and i32 %7, 65535
%9 = or i32 523370496, %8
%10 = call i32 @led_set(i32 %9)
ret void
}

LLVM IR (-O2):
define void @led_blink(i32 %0) {
%2 = tail call i32 (...) @led_get()
%3 = shl i32 %0, 4
%4 = shl nuw i32 1, %3
%5 = or i32 %2, %4
%6 = and i32 %5, 65535
%7 = or i32 %6, 523370496
%8 = tail call i32 @led_set(i32 %7)
ret void
}
int ti_zlema_start(double const *options) {
  return ((int)options[0] - 1) / 2 - 1;
}


x86 assembly (clang, -O0):
<ti_zlema_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si (%rax),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti_zlema_start>:
cvttsd2si (%rdi),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
add    $0xffffffff,%eax
sar    %eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ti_zlema_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fptosi double %5 to i32
%7 = sub nsw i32 %6, 1
%8 = sdiv i32 %7, 2
%9 = sub nsw i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @ti_zlema_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = add nsw i32 %3, -1
%5 = sdiv i32 %4, 2
%6 = add nsw i32 %5, -1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void display(int a[], int n) {
  int i;
  for (i = 0; i < n; i++)
    printf("%d ", a[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<display>:
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    1159 <display+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <display+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <display+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <display+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @display(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 (i8*, ...) @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
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @display(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 (i8*, ...) @printf(i8* dereferenceable(1) 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
%14 = tail call i32 @putchar(i32 10)
ret void
}
gotoXY(x, y) short x, y;
{ move(y - 1, x - 1); }


x86 assembly (clang, -O0):
<gotoXY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%cx
mov    %si,%ax
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
movswl -0x8(%rbp),%edi
sub    $0x1,%edi
movswl -0x6(%rbp),%esi
sub    $0x1,%esi
mov    $0x0,%al
call   1030 <move@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotoXY>:
movswl %si,%eax
add    $0xffffffff,%eax
movswl %di,%esi
add    $0xffffffff,%esi
mov    %eax,%edi
xor    %eax,%eax
jmp    1030 <move@plt>

LLVM IR (-O0):
define i32 @gotoXY(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i16
%5 = alloca i16
%6 = trunc i32 %0 to i16
%7 = trunc i32 %1 to i16
store i16 %6, i16* %4
store i16 %7, i16* %5
%8 = load i16, i16* %5
%9 = sext i16 %8 to i32
%10 = sub nsw i32 %9, 1
%11 = load i16, i16* %4
%12 = sext i16 %11 to i32
%13 = sub nsw i32 %12, 1
%14 = call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 %10, i32 %13)
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @gotoXY(i32 %0, i32 %1) {
%3 = shl i32 %1, 16
%4 = ashr exact i32 %3, 16
%5 = add nsw i32 %4, -1
%6 = shl i32 %0, 16
%7 = ashr exact i32 %6, 16
%8 = add nsw i32 %7, -1
%9 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 %5, i32 %8)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ print_report(char *, int *);
void symamd_report(int stats[20]) { print_report("symamd", stats); }


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

x86 assembly (clang, -O2):
<symamd_report>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <print_report@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"symamd\00"
define void @symamd_report(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @print_report(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"symamd\00"
define void @symamd_report(i32* %0) {
%2 = tail call i32 @print_report(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ h(int);
void a(int v) {
  if (v == 1) {
    h(2);
    h(2);
    h(1);
  }
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1143 <a+0x33>
mov    $0x2,%edi
call   1030 <h@plt>
mov    $0x2,%edi
call   1030 <h@plt>
mov    $0x1,%edi
call   1030 <h@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
cmp    $0x1,%edi
jne    1135 <a+0x25>
push   %rax
mov    $0x2,%edi
call   1030 <h@plt>
mov    $0x2,%edi
call   1030 <h@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <h@plt>
ret

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

LLVM IR (-O2):
define void @a(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @h(i32 2)
%5 = tail call i32 @h(i32 2)
%6 = tail call i32 @h(i32 1)
br label %7
7: ; preds = %3, %1
ret void
}
/* Type definitions */
struct sk_buff {
  int dummy;
};
struct Qdisc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kfree_skb(struct sk_buff *);
int noop_enqueue(struct sk_buff *skb, struct Qdisc *qdisc) {
  {
    kfree_skb(skb);
    return (2);
  }
}


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

x86 assembly (clang, -O2):
<noop_enqueue>:
push   %rax
call   1030 <kfree_skb@plt>
mov    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sk_buff = type { i32 }
%struct.Qdisc = type { i32 }
define i32 @noop_enqueue(%struct.sk_buff* %0, %struct.Qdisc* %1) {
%3 = alloca %struct.sk_buff*
%4 = alloca %struct.Qdisc*
store %struct.sk_buff* %0, %struct.sk_buff** %3
store %struct.Qdisc* %1, %struct.Qdisc** %4
%5 = load %struct.sk_buff*, %struct.sk_buff** %3
%6 = call i32 @kfree_skb(%struct.sk_buff* %5)
ret i32 2
}

LLVM IR (-O2):
%struct.sk_buff = type { i32 }
%struct.Qdisc = type { i32 }
define i32 @noop_enqueue(%struct.sk_buff* %0, %struct.Qdisc* nocapture readnone %1) {
%3 = tail call i32 @kfree_skb(%struct.sk_buff* %0)
ret i32 2
}
long double recip_l(int denom) { return 1.0 / (long double)denom; }


x86 assembly (clang, -O0):
<recip_l>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
fildl  -0x8(%rbp)
fld1
fdivp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<recip_l>:
mov    %edi,-0x4(%rsp)
fld1
fidivl -0x4(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @recip_l(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to x86_fp80
%5 = fdiv x86_fp80 0xK3FFF8000000000000000, %4
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @recip_l(i32 %0) {
%2 = sitofp i32 %0 to x86_fp80
%3 = fdiv x86_fp80 0xK3FFF8000000000000000, %2
ret x86_fp80 %3
}
void INT_Excep_TMR0_OV0I(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_h4_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ handle_exit();
void sig_handler(int signo) { exit(handle_exit()); }


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <handle_exit@plt>
mov    %eax,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @handle_exit()
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @sig_handler(i32 %0) {
%2 = tail call i32 (...) @handle_exit()
%3 = tail call i32 @exit(i32 %2)
unreachable
}
void rotr(int *a, int *b, int *c) {
  int temp;
  temp = *c;
  *c = *b;
  *b = *a;
  *a = temp;
}


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

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

LLVM IR (-O0):
define void @rotr(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %6
%9 = load i32, i32* %8
store i32 %9, i32* %7
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = load i32*, i32** %6
store i32 %11, i32* %12
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %5
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = load i32*, i32** %4
store i32 %16, i32* %17
ret void
}

LLVM IR (-O2):
define void @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = load i32, i32* %1
store i32 %5, i32* %2
%6 = load i32, i32* %0
store i32 %6, i32* %1
store i32 %4, i32* %0
ret void
}
__typeof__(fputs(1, 1)) test_fputs_208(void) { return fputs(1, 1); }


x86 assembly (clang, -O0):
<test_fputs_208>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fputs_208>:
mov    $0x1,%edi
mov    $0x1,%esi
xor    %eax,%eax
jmp    1030 <fputs@plt>

LLVM IR (-O0):
define i32 @test_fputs_208() {
%1 = call i32 (i32, i32, ...) bitcast (i32 (...)* @fputs to i32 (i32, i32, ...)*)(i32 1, i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_fputs_208() {
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @fputs to i32 (i32, i32, ...)*)(i32 1, i32 1)
ret i32 %1
}
void opaque_routine(void) {}


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

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

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

LLVM IR (-O2):
define void @opaque_routine() {
ret void
}
int doOtherThing(int a, int b) { return a; }


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

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

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

LLVM IR (-O2):
define i32 @doOtherThing(i32 returned %0, i32 %1) {
ret i32 %0
}
int cnss_logger_event_unregister(int radio, int event,
                                 int (*cb)(struct sk_buff *skb)) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.sk_buff = type opaque
define i32 @cnss_logger_event_unregister(i32 %0, i32 %1, i32 (%struct.sk_buff*)* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32 (%struct.sk_buff*)*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 (%struct.sk_buff*)* %2, i32 (%struct.sk_buff*)** %6
ret i32 0
}

LLVM IR (-O2):
%struct.sk_buff = type opaque
define i32 @cnss_logger_event_unregister(i32 %0, i32 %1, i32 (%struct.sk_buff*)* nocapture readnone %2) {
ret i32 0
}
void ncrshift1(char *p) {
  char cur;
  cur = 0;
  do {
    char next = *p;
    *p++ = cur;
    cur = next;
  } while (cur != 0);
  *p = 0;
}


x86 assembly (clang, -O0):
<ncrshift1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xa(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jne    110c <ncrshift1+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @ncrshift1(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8 [ 0, %1 ], [ %5, %2 ]
%4 = phi i8* [ %0, %1 ], [ %6, %2 ]
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %3, i8* %4
%7 = icmp eq i8 %5, 0
br i1 %7, label %8, label %2
8: ; preds = %2
store i8 0, i8* %6
ret void
}
/* Variables and functions */
int mlock(void *, unsigned int);
int lock_memory(void *addr, size_t size) {
  return mlock(addr, (unsigned int)size);
}


x86 assembly (clang, -O0):
<lock_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
call   1030 <mlock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lock_memory>:
jmp    1030 <mlock@plt>

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

LLVM IR (-O2):
define i32 @lock_memory(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = tail call i32 @mlock(i8* %0, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Log_add(char *);
void arg_setLog(char *s) { Log_add(s); }


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

x86 assembly (clang, -O2):
<arg_setLog>:
jmp    1030 <Log_add@plt>

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

LLVM IR (-O2):
define void @arg_setLog(i8* %0) {
%2 = tail call i32 @Log_add(i8* %0)
ret void
}
const char *rcsid(const char *p) {
  return rcsid(p = "@(#)$File: print.c,v 1.63 2008/02/17 19:28:54 rrt Exp $");
}


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

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

LLVM IR (-O0):
@.str = [56 x i8] c"@(#)$File: print.c,v 1.63 2008/02/17 19:28:54 rrt Exp $\00"
define i8* @rcsid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i8* @rcsid(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @rcsid(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
int foo(int *p, int b) {
  int a;
  if (b)
    bar(123);
  else
    bar(321);
  a = *p;
  if (p == 0)
    return 0;
  return a;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1138 <foo+0x28>
mov    $0x7b,%edi
call   1030 <bar@plt>
jmp    1142 <foo+0x32>
mov    $0x141,%edi
call   1030 <bar@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1162 <foo+0x52>
movl   $0x0,-0x4(%rbp)
jmp    1168 <foo+0x58>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %rdi,%rbx
test   %esi,%esi
mov    $0x141,%eax
mov    $0x7b,%edi
cmove  %eax,%edi
call   1030 <bar@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @foo(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @bar(i32 123)
br label %13
11: ; preds = %2
%12 = call i32 @bar(i32 321)
br label %13
13: ; preds = %11, %9
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
store i32 %15, i32* %6
%16 = load i32*, i32** %4
%17 = icmp eq i32* %16, null
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 0, i32* %3
br label %21
19: ; preds = %13
%20 = load i32, i32* %6
store i32 %20, i32* %3
br label %21
21: ; preds = %19, %18
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 321, i32 123
%5 = tail call i32 @bar(i32 %4)
%6 = load i32, i32* %0
ret i32 %6
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_is_reassoc_resp(__le16 fc) {
  return (fc & cpu_to_le16(0x000c | 0x00f0)) == cpu_to_le16(0x0000 | 0x0030);
}


x86 assembly (clang, -O0):
<ieee80211_is_reassoc_resp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x30,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_reassoc_resp>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0x30,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_reassoc_resp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @cpu_to_le16(i32 48)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_reassoc_resp(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @cpu_to_le16(i32 48)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned long http_parser_version(void) {
  return 2 * 0x10000 | 9 * 0x00100 | 3 * 0x00001;
}


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

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

LLVM IR (-O0):
define i64 @http_parser_version() {
ret i64 133379
}

LLVM IR (-O2):
define i64 @http_parser_version() {
ret i64 133379
}
void vrna_C11_features(void) { __asm("nop"); }


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

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

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

LLVM IR (-O2):
define void @vrna_C11_features() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
unsigned long tcfg_to_divisor(unsigned long tcfg1) { return 1 << (1 + tcfg1); }


x86 assembly (clang, -O0):
<tcfg_to_divisor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcfg_to_divisor>:
lea    0x1(%rdi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
ret

LLVM IR (-O0):
define i64 @tcfg_to_divisor(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 1, %3
%5 = trunc i64 %4 to i32
%6 = shl i32 1, %5
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @tcfg_to_divisor(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = add i32 %2, 1
%4 = shl nuw i32 1, %3
%5 = sext i32 %4 to i64
ret i64 %5
}
void __DELETE_org_xmlvm_runtime_XMLVMClassLoader(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_org_xmlvm_runtime_XMLVMClassLoader(i8* nocapture %0, i8* nocapture %1) {
ret void
}
long double f_va_2(char *fmt, ...) {
  __builtin_va_list va;
  __builtin_va_start(va, fmt);
  long double v = __builtin_va_arg(va, long double);
  __builtin_va_end(va);
  return v;
}


x86 assembly (clang, -O0):
<f_va_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
test   %al,%al
je     1139 <f_va_2+0x39>
movaps %xmm0,-0xb0(%rbp)
movaps %xmm1,-0xa0(%rbp)
movaps %xmm2,-0x90(%rbp)
movaps %xmm3,-0x80(%rbp)
movaps %xmm4,-0x70(%rbp)
movaps %xmm5,-0x60(%rbp)
movaps %xmm6,-0x50(%rbp)
movaps %xmm7,-0x40(%rbp)
mov    %r9,-0xb8(%rbp)
mov    %r8,-0xc0(%rbp)
mov    %rcx,-0xc8(%rbp)
mov    %rdx,-0xd0(%rbp)
mov    %rsi,-0xd8(%rbp)
mov    %rdi,-0x8(%rbp)
lea    -0xe0(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x30,-0x1c(%rbp)
movl   $0x8,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
mov    %rax,%rcx
add    $0x10,%rcx
mov    %rcx,-0x18(%rbp)
fldt   (%rax)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_va_2>:
sub    $0x48,%rsp
mov    %rsi,-0x78(%rsp)
mov    %rdx,-0x70(%rsp)
mov    %rcx,-0x68(%rsp)
mov    %r8,-0x60(%rsp)
mov    %r9,-0x58(%rsp)
test   %al,%al
je     1148 <f_va_2+0x48>
movaps %xmm0,-0x50(%rsp)
movaps %xmm1,-0x40(%rsp)
movaps %xmm2,-0x30(%rsp)
movaps %xmm3,-0x20(%rsp)
movaps %xmm4,-0x10(%rsp)
movaps %xmm5,(%rsp)
movaps %xmm6,0x10(%rsp)
movaps %xmm7,0x20(%rsp)
fldt   0x50(%rsp)
add    $0x48,%rsp
ret

LLVM IR (-O0):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define x86_fp80 @f_va_2(i8* %0, ...) {
%2 = alloca i8*
%3 = alloca [1 x %struct.__va_list_tag]
%4 = alloca x86_fp80
store i8* %0, i8** %2
%5 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %3, i64 0, i64 0
%6 = bitcast %struct.__va_list_tag* %5 to i8*
%7 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %3, i64 0, i64 0
%8 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %7, i32 0, i32 2
%9 = load i8*, i8** %8
%10 = ptrtoint i8* %9 to i64
%11 = add i64 %10, 15
%12 = and i64 %11, -16
%13 = inttoptr i64 %12 to i8*
%14 = bitcast i8* %13 to x86_fp80*
%15 = getelementptr i8, i8* %13, i32 16
store i8* %15, i8** %8
%16 = load x86_fp80, x86_fp80* %14
store x86_fp80 %16, x86_fp80* %4
%17 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %3, i64 0, i64 0
%18 = bitcast %struct.__va_list_tag* %17 to i8*
%19 = load x86_fp80, x86_fp80* %4
ret x86_fp80 %19
}

LLVM IR (-O2):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define x86_fp80 @f_va_2(i8* nocapture readnone %0, ...) {
%2 = alloca [1 x %struct.__va_list_tag]
%3 = bitcast [1 x %struct.__va_list_tag]* %2 to i8*
%4 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %2, i64 0, i64 0, i32 2
%5 = load i8*, i8** %4
%6 = ptrtoint i8* %5 to i64
%7 = add i64 %6, 15
%8 = and i64 %7, -16
%9 = inttoptr i64 %8 to i8*
%10 = inttoptr i64 %8 to x86_fp80*
%11 = getelementptr i8, i8* %9, i64 16
store i8* %11, i8** %4
%12 = load x86_fp80, x86_fp80* %10
ret x86_fp80 %12
}
/* Variables and functions */
char *cdel_encode_as_base2_string(unsigned char *in_buffer, size_t data_length,
                                  int letter_case, int *error) {}


x86 assembly (clang, -O0):
<cdel_encode_as_base2_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @cdel_encode_as_base2_string(i8* nocapture readnone %0, i64 %1, i32 %2, i32* nocapture readnone %3) {
ret i8* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void maze_to_fig_header(FILE *fp) {
  fprintf(fp, "#FIG 3.2  Produced by maze.c\n");
  fprintf(fp, "Landscape\nCenter\nInches\nLetter\n");
  fprintf(fp, "100.00\nSingle\n-2\n1200 2\n");
}


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

x86 assembly (clang, -O2):
<maze_to_fig_header>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    $0x1d,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xeea(%rip),%rdi
mov    $0x1f,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xef1(%rip),%rdi
mov    $0x18,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"#FIG 3.2 Produced by maze.c\0A\00"
@.str.1 = [32 x i8] c"Landscape\0ACenter\0AInches\0ALetter\0A\00"
@.str.2 = [25 x i8] c"100.00\0ASingle\0A-2\0A1200 2\0A\00"
define void @maze_to_fig_header(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32*, i32** %2
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"#FIG 3.2 Produced by maze.c\0A\00"
@.str.1 = [32 x i8] c"Landscape\0ACenter\0AInches\0ALetter\0A\00"
@.str.2 = [25 x i8] c"100.00\0ASingle\0A-2\0A1200 2\0A\00"
define void @maze_to_fig_header(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 29, i64 1, i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i64 31, i64 1, i32* %0)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i64 24, i64 1, i32* %0)
ret void
}
int setbit(int x, int i) { return x | (1 << i); }


x86 assembly (clang, -O0):
<setbit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @setbit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @setbit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = or i32 %3, %0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ i;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  int i = 0x12345678;
  int n, j;
  char *c = (char *)&i;
  n = sizeof(i);
  for (j = 0; j < n; j++) {
    printf("%.2x ", c[j]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x12345678,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x4,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116e <main+0x5e>
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xea9(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113c <main+0x2c>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x78,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x56,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x12,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.2x \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 0, i32* %1
store i32 305419896, i32* %2
%6 = bitcast i32* %2 to i8*
store i8* %6, i8** %5
store i32 4, i32* %3
store i32 0, i32* %4
br label %7
7: ; preds = %18, %0
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i8*, i8** %5
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %7
21: ; preds = %7
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.2x \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 120)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 86)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 52)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 18)
ret i32 0
}
int dcmpge(double a, double b) { return a >= b; }


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

x86 assembly (clang, -O2):
<dcmpge>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @dcmpge(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 oge double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @dcmpge(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int fn5(int a, unsigned int b) { return a - ((a / b) * b); }


x86 assembly (clang, -O0):
<fn5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn5>:
mov    %edi,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @fn5(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = udiv i32 %6, %7
%9 = load i32, i32* %4
%10 = mul i32 %8, %9
%11 = sub i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @fn5(i32 %0, i32 %1) {
%3 = urem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int main() {
  int p = fork();
  if (p == 0) {
    printf("OK\n");
    return 0;
  }
  if (p < 0) {
    perror("great, failed");
    assert(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    117b <main+0x3b>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    119f <main+0x5f>
cmpl   $0x0,-0x8(%rbp)
jge    1198 <main+0x58>
lea    0xe78(%rip),%rdi
call   1050 <perror@plt>
xor    %edi,%edi
call   1040 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <fork@plt>
test   %eax,%eax
je     1163 <main+0x23>
jns    116f <main+0x2f>
lea    0xeab(%rip),%rdi
call   1050 <perror@plt>
xor    %edi,%edi
call   1040 <assert@plt>
jmp    116f <main+0x2f>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [14 x i8] c"great, failed\00"
@str = [3 x i8] c"OK\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
br label %10
5: ; preds = %0
%6 = icmp slt i32 %1, 0
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @assert(i32 0)
br label %10
10: ; preds = %5, %7, %3
ret i32 0
}
void ath_hal_set_function(const char *name) {}


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

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

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

LLVM IR (-O2):
define void @ath_hal_set_function(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, int);
int /*<<< orphan*/ stderr;
void _PHAssert(const char *expr, const char *file, int line) {
  fprintf(stderr, "Assertion failed: %s in %s at line %d\n", expr, file, line);
}


x86 assembly (clang, -O0):
<_PHAssert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_PHAssert>:
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Assertion failed: %s in %s at line %d\0A\00"
define void @_PHAssert(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Assertion failed: %s in %s at line %d\0A\00"
define void @_PHAssert(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
ret void
}