xunge/DecIR huggingface dataset:
_Bool EQ(double __complex A, double __complex B) { return A == B; }


x86 assembly (clang, -O0):
<EQ>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm1
ucomisd %xmm3,%xmm2
sete   %al
setnp  %cl
and    %cl,%al
ucomisd %xmm1,%xmm0
sete   %cl
setnp  %dl
and    %dl,%cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EQ>:
ucomisd %xmm2,%xmm0
setnp  %al
sete   %cl
and    %al,%cl
ucomisd %xmm3,%xmm1
setnp  %dl
sete   %al
and    %dl,%al
and    %cl,%al
ret

LLVM IR (-O0):
define zeroext i1 @EQ(double %0, double %1, double %2, double %3) {
%5 = alloca { double, double }
%6 = alloca { double, double }
%7 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
store double %0, double* %7
%8 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
store double %1, double* %8
%9 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 0
store double %2, double* %9
%10 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 1
store double %3, double* %10
%11 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%12 = load double, double* %11
%13 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
%14 = load double, double* %13
%15 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 0
%16 = load double, double* %15
%17 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 1
%18 = load double, double* %17
%19 = fcmp oeq double %12, %16
%20 = fcmp oeq double %14, %18
%21 = and i1 %19, %20
ret i1 %21
}

LLVM IR (-O2):
define zeroext i1 @EQ(double %0, double %1, double %2, double %3) {
%5 = fcmp oeq double %0, %2
%6 = fcmp oeq double %1, %3
%7 = and i1 %5, %6
ret i1 %7
}
__attribute__((nomips16)) void f1(char *p) { __builtin_memcpy(p, "12345", 5); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xeee(%rip),%ecx
mov    %ecx,(%rax)
mov    0xeea(%rip),%cl
mov    %cl,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
movb   $0x35,0x4(%rdi)
movl   $0x34333231,(%rdi)
ret

LLVM IR (-O0):
@.str = [6 x i8] c"12345\00"
define void @f1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"12345\00"
define void @f1(i8* nocapture writeonly %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %0, i8* align 1 dereferenceable(5) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 5, i1 false)
ret void
}
void HardFaultDefaultHandler() {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @HardFaultDefaultHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ ispunct(int);
int /*<<< orphan*/ isspace(int);
int isfnamechar(int c) {
  return !isspace(c) && !ispunct(c) && c != '"' && c != '\'';
}


x86 assembly (clang, -O0):
<isfnamechar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isspace@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1174 <isfnamechar+0x54>
mov    -0x4(%rbp),%edi
call   1030 <ispunct@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1174 <isfnamechar+0x54>
xor    %eax,%eax
cmpl   $0x22,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1174 <isfnamechar+0x54>
cmpl   $0x27,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isfnamechar>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <isspace@plt>
xor    %ebx,%ebx
test   %eax,%eax
jne    1148 <isfnamechar+0x28>
mov    %ebp,%edi
call   1030 <ispunct@plt>
cmp    $0x22,%ebp
je     1148 <isfnamechar+0x28>
test   %eax,%eax
jne    1148 <isfnamechar+0x28>
xor    %ebx,%ebx
cmp    $0x27,%ebp
setne  %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isfnamechar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @isspace(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @ispunct(i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %16, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = icmp ne i32 %11, 34
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %2
%15 = icmp ne i32 %14, 39
br label %16
16: ; preds = %13, %10, %6, %1
%17 = phi i1 [ false, %10 ], [ false, %6 ], [ false, %1 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isfnamechar(i32 %0) {
%2 = tail call i32 @isspace(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = tail call i32 @ispunct(i32 %0)
%6 = icmp eq i32 %5, 0
%7 = icmp ne i32 %0, 34
%8 = and i1 %7, %6
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = icmp ne i32 %0, 39
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %9, %4, %1
%13 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %11, %9 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
size_t LZMA_read(void *handle, void *mem, size_t len) {
  (void)handle;
  (void)mem;
  (void)len;
  fprintf(stderr,
          "LZMA support was not compiled into this executable, sorry.\n");
  exit(255);
}


x86 assembly (clang, -O0):
<LZMA_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<LZMA_read>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [60 x i8] c"LZMA support was not compiled into this executable, sorry.\0A\00"
define i64 @LZMA_read(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 255)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [60 x i8] c"LZMA support was not compiled into this executable, sorry.\0A\00"
define i64 @LZMA_read(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 255)
unreachable
}
/* Variables and functions */
scalar_t__ esPrimo(long);
double prim(double k) {
  long cnt = 0, i = 1, n;
  n = (long)k;
  while (cnt < n) {
    if (esPrimo(i))
      cnt++;
    i++;
  }
  i--;
  return ((double)i);
}


x86 assembly (clang, -O0):
<prim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
cvttsd2si -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    1175 <prim+0x65>
mov    -0x18(%rbp),%rdi
call   1030 <esPrimo@plt>
cmp    $0x0,%rax
je     1164 <prim+0x54>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1137 <prim+0x27>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
cvtsi2sdq -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prim>:
push   %r15
push   %r14
push   %rbx
cvttsd2si %xmm0,%r14
xor    %r15d,%r15d
test   %r14,%r14
jle    1149 <prim+0x39>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%r15
mov    %r15,%rdi
call   1030 <esPrimo@plt>
cmp    $0x1,%rax
sbb    $0xffffffffffffffff,%rbx
cmp    %r14,%rbx
jl     1130 <prim+0x20>
xorps  %xmm0,%xmm0
cvtsi2sd %r15,%xmm0
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define double @prim(double %0) {
%2 = alloca double
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store double %0, double* %2
store i64 0, i64* %3
store i64 1, i64* %4
%6 = load double, double* %2
%7 = fptosi double %6 to i64
store i64 %7, i64* %5
br label %8
8: ; preds = %19, %1
%9 = load i64, i64* %3
%10 = load i64, i64* %5
%11 = icmp slt i64 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i64, i64* %4
%14 = call i64 @esPrimo(i64 %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i64, i64* %3
%18 = add nsw i64 %17, 1
store i64 %18, i64* %3
br label %19
19: ; preds = %16, %12
%20 = load i64, i64* %4
%21 = add nsw i64 %20, 1
store i64 %21, i64* %4
br label %8
22: ; preds = %8
%23 = load i64, i64* %4
%24 = add nsw i64 %23, -1
store i64 %24, i64* %4
%25 = load i64, i64* %4
%26 = sitofp i64 %25 to double
ret double %26
}

LLVM IR (-O2):
define double @prim(double %0) {
%2 = fptosi double %0 to i64
%3 = icmp sgt i64 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = phi i64 [ %11, %4 ], [ 1, %1 ]
%7 = tail call i64 @esPrimo(i64 %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i64
%10 = add nuw nsw i64 %5, %9
%11 = add nuw nsw i64 %6, 1
%12 = icmp slt i64 %10, %2
br i1 %12, label %4, label %13
13: ; preds = %4, %1
%14 = phi i64 [ 0, %1 ], [ %6, %4 ]
%15 = sitofp i64 %14 to double
ret double %15
}
/* Variables and functions */
scalar_t__ floor(scalar_t__);
scalar_t__ sqrt(long);
long npix2nside_(long npix) {
  long res = (long)floor(sqrt(npix / 12.) + 0.5);
  return (res * res * 12 == npix) ? res : -1;
}


x86 assembly (clang, -O0):
<npix2nside_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <sqrt@plt>
cvtsi2sd %rax,%xmm0
movsd  0xeab(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <floor@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x10(%rbp),%rax
imul   $0xc,%rax,%rax
cmp    -0x8(%rbp),%rax
jne    118b <npix2nside_+0x6b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    119b <npix2nside_+0x7b>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    119b <npix2nside_+0x7b>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<npix2nside_>:
push   %rbx
mov    %rdi,%rbx
cvtsi2sd %rdi,%xmm0
divsd  0xecf(%rip),%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xebd(%rip),%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <floor@plt>
mov    %rax,%rcx
imul   %rax,%rcx
shl    $0x2,%rcx
lea    (%rcx,%rcx,2),%rcx
cmp    %rbx,%rcx
mov    $0xffffffffffffffff,%rcx
cmovne %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @npix2nside_(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = sitofp i64 %4 to double
%6 = fdiv double %5, 1.200000e+01
%7 = fptosi double %6 to i64
%8 = call i64 @sqrt(i64 %7)
%9 = sitofp i64 %8 to double
%10 = fadd double %9, 5.000000e-01
%11 = fptosi double %10 to i64
%12 = call i64 @floor(i64 %11)
store i64 %12, i64* %3
%13 = load i64, i64* %3
%14 = load i64, i64* %3
%15 = mul nsw i64 %13, %14
%16 = mul nsw i64 %15, 12
%17 = load i64, i64* %2
%18 = icmp eq i64 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %1
%20 = load i64, i64* %3
br label %22
21: ; preds = %1
br label %22
22: ; preds = %21, %19
%23 = phi i64 [ %20, %19 ], [ -1, %21 ]
ret i64 %23
}

LLVM IR (-O2):
define i64 @npix2nside_(i64 %0) {
%2 = sitofp i64 %0 to double
%3 = fdiv double %2, 1.200000e+01
%4 = fptosi double %3 to i64
%5 = tail call i64 @sqrt(i64 %4)
%6 = sitofp i64 %5 to double
%7 = fadd double %6, 5.000000e-01
%8 = fptosi double %7 to i64
%9 = tail call i64 @floor(i64 %8)
%10 = mul i64 %9, 12
%11 = mul i64 %10, %9
%12 = icmp eq i64 %11, %0
%13 = select i1 %12, i64 %9, i64 -1
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int ReadBinMesh(char *fname) {
  fprintf(stderr, "Advisory: not configured to read binary mesh files.\n");
  fprintf(stderr, "Contact your S2PLOT supplier for assistance.\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<ReadBinMesh>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf06(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"Advisory: not configured to read binary mesh files.\0A\00"
@.str.1 = [46 x i8] c"Contact your S2PLOT supplier for assistance.\0A\00"
define i32 @ReadBinMesh(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"Advisory: not configured to read binary mesh files.\0A\00"
@.str.1 = [46 x i8] c"Contact your S2PLOT supplier for assistance.\0A\00"
define i32 @ReadBinMesh(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t dns_get_expiry_ttl(uint32_t ttl) {
  if (ttl < 60)
    return 60;
  else if (ttl > (30 * 60))
    return (30 * 60);
  else
    return ttl;
}


x86 assembly (clang, -O0):
<dns_get_expiry_ttl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x3c,-0x8(%rbp)
jge    111d <dns_get_expiry_ttl+0x1d>
movl   $0x3c,-0x4(%rbp)
jmp    113c <dns_get_expiry_ttl+0x3c>
cmpl   $0x708,-0x8(%rbp)
jle    1136 <dns_get_expiry_ttl+0x36>
movl   $0x708,-0x4(%rbp)
jmp    113c <dns_get_expiry_ttl+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_get_expiry_ttl>:
cmp    $0x708,%edi
mov    $0x708,%ecx
cmovl  %edi,%ecx
cmp    $0x3d,%ecx
mov    $0x3c,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @dns_get_expiry_ttl(i32 %0) {
%2 = icmp slt i32 %0, 1800
%3 = select i1 %2, i32 %0, i32 1800
%4 = icmp sgt i32 %3, 60
%5 = select i1 %4, i32 %3, i32 60
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_wsr64(char *, unsigned long);
void wsr64_1(unsigned long v) { __builtin_arm_wsr64("sysreg", v); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"sysreg\00"
define void @wsr64_1(i64 %0) {
%2 = tail call i32 @__builtin_arm_wsr64(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
/* Variables and functions */
long RAND_MAX;
long random();
long randomRangeFast(long min, long max) {
  return max + random() / (RAND_MAX / (min - max) + 1);
}


x86 assembly (clang, -O0):
<randomRangeFast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    %rax,-0x20(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
sub    -0x10(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    $0x1,%rcx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomRangeFast>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <random@plt>
mov    %rax,%rcx
mov    0x2ebd(%rip),%rax
mov    (%rax),%rax
sub    %r14,%rbx
mov    %rax,%rdx
or     %rbx,%rdx
shr    $0x20,%rdx
je     1147 <randomRangeFast+0x37>
cqto
idiv   %rbx
mov    %rax,%rsi
jmp    114d <randomRangeFast+0x3d>
xor    %edx,%edx
div    %ebx
mov    %eax,%esi
add    $0x1,%rsi
mov    %rcx,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1167 <randomRangeFast+0x57>
mov    %rcx,%rax
cqto
idiv   %rsi
jmp    116d <randomRangeFast+0x5d>
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i64 @randomRangeFast(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i64 (...) @random()
%7 = load i64, i64* @RAND_MAX
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = sub nsw i64 %8, %9
%11 = sdiv i64 %7, %10
%12 = add nsw i64 %11, 1
%13 = sdiv i64 %6, %12
%14 = add nsw i64 %5, %13
ret i64 %14
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i64 @randomRangeFast(i64 %0, i64 %1) {
%3 = tail call i64 (...) @random()
%4 = load i64, i64* @RAND_MAX
%5 = sub nsw i64 %0, %1
%6 = sdiv i64 %4, %5
%7 = add nsw i64 %6, 1
%8 = sdiv i64 %3, %7
%9 = add nsw i64 %8, %1
ret i64 %9
}
/* Type definitions */
struct sk_buff {
  int dummy;
};

/* Variables and functions */
int skb_checksum_help(struct sk_buff **, int /*<<< orphan*/);
int skb_checksum_help_to_2_6_18(struct sk_buff *skb) {
  return skb_checksum_help(&skb, 0);
}


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

x86 assembly (clang, -O2):
<skb_checksum_help_to_2_6_18>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <skb_checksum_help@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sk_buff = type { i32 }
define i32 @skb_checksum_help_to_2_6_18(%struct.sk_buff* %0) {
%2 = alloca %struct.sk_buff*
store %struct.sk_buff* %0, %struct.sk_buff** %2
%3 = call i32 @skb_checksum_help(%struct.sk_buff** %2, i32 0)
ret i32 %3
}

LLVM IR (-O2):
%struct.sk_buff = type { i32 }
define i32 @skb_checksum_help_to_2_6_18(%struct.sk_buff* %0) {
%2 = alloca %struct.sk_buff*
store %struct.sk_buff* %0, %struct.sk_buff** %2
%3 = call i32 @skb_checksum_help(%struct.sk_buff** %2, i32 0)
ret i32 %3
}
unsigned bitCount_fun_llong(long long x) {
  unsigned r = x & 1;
  for (x = x >> 1 & 0x7fffffffffffffffll; x; x >>= 1)
    r += x & 1;
  return r;
}


x86 assembly (clang, -O0):
<bitCount_fun_llong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
movabs $0x7fffffffffffffff,%rcx
ff ff 7f
and    %rcx,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1159 <bitCount_fun_llong+0x59>
mov    -0x8(%rbp),%rcx
and    $0x1,%rcx
mov    -0xc(%rbp),%eax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <bitCount_fun_llong+0x2c>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitCount_fun_llong>:
mov    %edi,%eax
and    $0x1,%eax
cmp    $0x2,%rdi
jb     1123 <bitCount_fun_llong+0x23>
mov    %rdi,%rcx
xchg   %ax,%ax
shr    %rcx
mov    %ecx,%edx
and    $0x1,%edx
add    %edx,%eax
cmp    $0x3,%rdi
mov    %rcx,%rdi
ja     1110 <bitCount_fun_llong+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitCount_fun_llong(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = and i32 %2, 1
%4 = icmp ult i64 %0, 2
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i64 [ %8, %5 ], [ %0, %1 ]
%7 = phi i32 [ %11, %5 ], [ %3, %1 ]
%8 = lshr i64 %6, 1
%9 = trunc i64 %8 to i32
%10 = and i32 %9, 1
%11 = add i32 %10, %7
%12 = icmp ult i64 %6, 4
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = phi i32 [ %3, %1 ], [ %11, %5 ]
ret i32 %14
}
int subs_si_test3(int a, int b, int c) {
  int d = a - (b << 3);
  if (d <= 0)
    return a + c;
  else
    return b + d + c;
}


x86 assembly (clang, -O0):
<subs_si_test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1133 <subs_si_test3+0x33>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113f <subs_si_test3+0x3f>
mov    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<subs_si_test3>:
lea    0x0(,%rsi,8),%eax
mov    %edi,%ecx
sub    %eax,%ecx
lea    (%rsi,%rcx,1),%eax
test   %ecx,%ecx
cmovle %edi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @subs_si_test3(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %1, -8
%5 = add i32 %4, %0
%6 = icmp slt i32 %5, 1
%7 = add nsw i32 %5, %1
%8 = select i1 %6, i32 %0, i32 %7
%9 = add nsw i32 %8, %2
ret i32 %9
}
void alloc_page() {}


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

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

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

LLVM IR (-O2):
define void @alloc_page() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CAN0_DriverIRQHandler();
__attribute__((weak)) void CAN0_Wake_Up_IRQHandler(void) {
  CAN0_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @CAN0_Wake_Up_IRQHandler() {
%1 = call i32 (...) @CAN0_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @CAN0_Wake_Up_IRQHandler() {
%1 = tail call i32 (...) @CAN0_DriverIRQHandler()
ret void
}
/* Type definitions */
struct tinyrl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tinyrl_printf(struct tinyrl *, char *);
void tinyrl_vt100_erase_line(struct tinyrl *this) {
  tinyrl_printf(this, "\x1b[2K");
}


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

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

LLVM IR (-O0):
%struct.tinyrl = type { i32 }
@.str = [5 x i8] c"\1B[2K\00"
define void @tinyrl_vt100_erase_line(%struct.tinyrl* %0) {
%2 = alloca %struct.tinyrl*
store %struct.tinyrl* %0, %struct.tinyrl** %2
%3 = load %struct.tinyrl*, %struct.tinyrl** %2
%4 = call i32 @tinyrl_printf(%struct.tinyrl* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.tinyrl = type { i32 }
@.str = [5 x i8] c"\1B[2K\00"
define void @tinyrl_vt100_erase_line(%struct.tinyrl* %0) {
%2 = tail call i32 @tinyrl_printf(%struct.tinyrl* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
float __subsf3(float a, float b) {
  long lc = (*(const long *)&b) ^ 0x80000000;
  return a + (*(const float *)&lc);
}


x86 assembly (clang, -O0):
<__subsf3>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movabs $0x80000000,%rax
xor    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__subsf3>:
movss  %xmm1,-0x8(%rsp)
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @__subsf3(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i64
store float %0, float* %3
store float %1, float* %4
%6 = bitcast float* %4 to i64*
%7 = load i64, i64* %6
%8 = xor i64 %7, 2147483648
store i64 %8, i64* %5
%9 = load float, float* %3
%10 = bitcast i64* %5 to float*
%11 = load float, float* %10
%12 = fadd float %9, %11
ret float %12
}

LLVM IR (-O2):
define float @__subsf3(float %0, float %1) {
%3 = alloca float
store float %1, float* %3
%4 = bitcast float* %3 to i64*
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = xor i32 %6, -2147483648
%8 = bitcast i32 %7 to float
%9 = fadd float %8, %0
ret float %9
}
void vde_chain_nm6_incref(void) {}


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

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

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

LLVM IR (-O2):
define void @vde_chain_nm6_incref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int input_n() {
  int n;
  printf("Inserisci un numero tra 0 e 100:  ");
  scanf("%d", &n);
  if ((n < 0) || (n > 100)) {
    input_n();
  } else {
    return n;
  }
}


x86 assembly (clang, -O0):
<input_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jl     1168 <input_n+0x38>
cmpl   $0x64,-0x8(%rbp)
jle    1172 <input_n+0x42>
call   1030 <input_n@plt>
jmp    1178 <input_n+0x48>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_n>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
lea    0xedb(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
cmp    $0x65,%ebx
jb     1160 <input_n+0x30>
call   1030 <input_n@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Inserisci un numero tra 0 e 100: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @input_n() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 100
br i1 %9, label %10, label %12
10: ; preds = %7, %0
%11 = call i32 @input_n()
br label %14
12: ; preds = %7
%13 = load i32, i32* %2
store i32 %13, i32* %1
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [35 x i8] c"Inserisci un numero tra 0 e 100: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @input_n() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp ugt i32 %5, 100
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @input_n()
br label %9
9: ; preds = %0, %7
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ uart_puts(char const *);
void log_info(const char *msg) {
  uart_puts(msg);
  uart_puts("\n");
}


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

x86 assembly (clang, -O2):
<log_info>:
push   %rax
call   1030 <uart_puts@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <uart_puts@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @log_info(i8* %0) {
%2 = tail call i32 @uart_puts(i8* %0)
%3 = tail call i32 @uart_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
int is_rate_valid(int rate) {
  int ret = 1;
  switch (rate) {
  case 2:
  case 4:
  case 11:
  case 22:
  case 12:
  case 18:
  case 24:
  case 48:
  case 72:
  case 96:
  case 108:
  case 36:
    break;
  default:
    ret = 0;
    break;
  }
  return ret;
}


x86 assembly (clang, -O0):
<is_rate_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xfffffffe,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x6a,%eax
ja     113c <is_rate_valid+0x3c>
mov    -0x10(%rbp),%rax
lea    0xed2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    1143 <is_rate_valid+0x43>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_rate_valid>:
add    $0xfffffffe,%edi
cmp    $0x6a,%edi
ja     111e <is_rate_valid+0x1e>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_rate_valid(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %6 [
i32 2, label %5
i32 4, label %5
i32 11, label %5
i32 22, label %5
i32 12, label %5
i32 18, label %5
i32 24, label %5
i32 48, label %5
i32 72, label %5
i32 96, label %5
i32 108, label %5
i32 36, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
br label %7
6: ; preds = %1
store i32 0, i32* %3
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_rate_valid(i32 %0) {
switch i32 %0, label %2 [
i32 2, label %3
i32 4, label %3
i32 11, label %3
i32 22, label %3
i32 12, label %3
i32 18, label %3
i32 24, label %3
i32 48, label %3
i32 72, label %3
i32 96, label %3
i32 108, label %3
i32 36, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
int _dotp2(int src1, int src2) {
  short int s1_h = src1 >> 16;
  short int s1_l = src1;
  short int s2_h = src2 >> 16;
  short int s2_l = src2;
  return s1_h * s2_h + s1_l * s2_l;
}


x86 assembly (clang, -O0):
<_dotp2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    %ax,-0xa(%rbp)
mov    -0x4(%rbp),%eax
mov    %ax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x10,%eax
mov    %ax,-0xe(%rbp)
mov    -0x8(%rbp),%eax
mov    %ax,-0x10(%rbp)
movswl -0xa(%rbp),%eax
movswl -0xe(%rbp),%ecx
imul   %ecx,%eax
movswl -0xc(%rbp),%ecx
movswl -0x10(%rbp),%edx
imul   %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dotp2>:
movswl %di,%ecx
sar    $0x10,%edi
movswl %si,%eax
sar    $0x10,%esi
imul   %edi,%esi
imul   %ecx,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @_dotp2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %3
%10 = ashr i32 %9, 16
%11 = trunc i32 %10 to i16
store i16 %11, i16* %5
%12 = load i32, i32* %3
%13 = trunc i32 %12 to i16
store i16 %13, i16* %6
%14 = load i32, i32* %4
%15 = ashr i32 %14, 16
%16 = trunc i32 %15 to i16
store i16 %16, i16* %7
%17 = load i32, i32* %4
%18 = trunc i32 %17 to i16
store i16 %18, i16* %8
%19 = load i16, i16* %5
%20 = sext i16 %19 to i32
%21 = load i16, i16* %7
%22 = sext i16 %21 to i32
%23 = mul nsw i32 %20, %22
%24 = load i16, i16* %6
%25 = sext i16 %24 to i32
%26 = load i16, i16* %8
%27 = sext i16 %26 to i32
%28 = mul nsw i32 %25, %27
%29 = add nsw i32 %23, %28
ret i32 %29
}

LLVM IR (-O2):
define i32 @_dotp2(i32 %0, i32 %1) {
%3 = ashr i32 %0, 16
%4 = ashr i32 %1, 16
%5 = mul nsw i32 %4, %3
%6 = shl i32 %0, 16
%7 = ashr exact i32 %6, 16
%8 = shl i32 %1, 16
%9 = ashr exact i32 %8, 16
%10 = mul nsw i32 %9, %7
%11 = add nsw i32 %10, %5
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void cleanup(void *arg) { printf("cleanup: %s\n", (char *)arg); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"cleanup: %s\0A\00"
define void @cleanup(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void page_cache_get(struct page *page) {}


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define void @page_cache_get(%struct.page* nocapture %0) {
ret void
}
/* Type definitions */
struct mstr {
  int dummy;
};

/* Variables and functions */
struct mstr *_mstr_init(struct mstr *, char *, size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *nalloc(int);
struct mstr *mstr_init_dup(struct mstr *mstr, const char *data, size_t len) {
  char *d = nalloc(sizeof(char) * (len + 1));
  d[len] = 0x00;
  memcpy(d, data, len);
  return _mstr_init(mstr, d, len);
}


x86 assembly (clang, -O0):
<mstr_init_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <nalloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <_mstr_init@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mstr_init_dup>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x1(%rdx),%edi
call   1050 <nalloc@plt>
mov    %rax,%rbx
movb   $0x0,(%rax,%r12,1)
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1030 <memcpy@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <_mstr_init@plt>

LLVM IR (-O0):
%struct.mstr = type { i32 }
define %struct.mstr* @mstr_init_dup(%struct.mstr* %0, i8* %1, i64 %2) {
%4 = alloca %struct.mstr*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store %struct.mstr* %0, %struct.mstr** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = add i64 %8, 1
%10 = mul i64 1, %9
%11 = trunc i64 %10 to i32
%12 = call i8* @nalloc(i32 %11)
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = load i64, i64* %6
%15 = getelementptr inbounds i8, i8* %13, i64 %14
store i8 0, i8* %15
%16 = load i8*, i8** %7
%17 = load i8*, i8** %5
%18 = load i64, i64* %6
%19 = call i32 @memcpy(i8* %16, i8* %17, i64 %18)
%20 = load %struct.mstr*, %struct.mstr** %4
%21 = load i8*, i8** %7
%22 = load i64, i64* %6
%23 = call %struct.mstr* @_mstr_init(%struct.mstr* %20, i8* %21, i64 %22)
ret %struct.mstr* %23
}

LLVM IR (-O2):
%struct.mstr = type { i32 }
define %struct.mstr* @mstr_init_dup(%struct.mstr* %0, i8* %1, i64 %2) {
%4 = trunc i64 %2 to i32
%5 = add i32 %4, 1
%6 = tail call i8* @nalloc(i32 %5)
%7 = getelementptr inbounds i8, i8* %6, i64 %2
store i8 0, i8* %7
%8 = tail call i32 @memcpy(i8* %6, i8* %1, i64 %2)
%9 = tail call %struct.mstr* @_mstr_init(%struct.mstr* %0, i8* %6, i64 %2)
ret %struct.mstr* %9
}
/* Variables and functions */
int /*<<< orphan*/ W_OK;
int /*<<< orphan*/ access(char *, int /*<<< orphan*/);
int unary_w(char *s) { return !access(s, W_OK); }


x86 assembly (clang, -O0):
<unary_w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unary_w>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@W_OK = global i32 0
define i32 @unary_w(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @W_OK
%5 = call i32 @access(i8* %3, i32 %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@W_OK = global i32 0
define i32 @unary_w(i8* nocapture %0) {
%2 = load i32, i32* @W_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void trace_block_leave(struct __trace_block *tb) {}


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

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

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

LLVM IR (-O2):
%struct.__trace_block = type opaque
define void @trace_block_leave(%struct.__trace_block* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int ph_irc_handle_packet(void *handler, const char *packet, ssize_t len) {
  return 0;
}


x86 assembly (clang, -O0):
<ph_irc_handle_packet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ph_irc_handle_packet(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
ret i32 0
}

LLVM IR (-O2):
define i32 @ph_irc_handle_packet(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bigimm(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, unsigned long);
int main(void) {
  printf("got 0x%lx, expected 0x%lx\n", bigimm(1), (1UL << 32) + 101);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <bigimm@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
movabs $0x100000065,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <bigimm@plt>
lea    0xece(%rip),%rdi
movabs $0x100000065,%rdx
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"got 0x%lx, expected 0x%lx\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @bigimm(i32 1)
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %2, i64 4294967397)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"got 0x%lx, expected 0x%lx\0A\00"
define i32 @main() {
%1 = tail call i32 @bigimm(i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1, i64 4294967397)
ret i32 0
}
const char *proginfo_name(void) { return "ordo"; }


x86 assembly (clang, -O0):
<proginfo_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<proginfo_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"ordo\00"
define i8* @proginfo_name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"ordo\00"
define i8* @proginfo_name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
void TIM3_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @TIM3_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ u_close(int);
int u_ftruncate(int, int);
int u_open(char *, int, int /*<<< orphan*/);
int u_truncate(const char *path, int length) {
  printf("DEBUG: u_truncate entered\n");
  int fd = u_open((char *)path, 0x0001, 0);
  int retval = u_ftruncate(fd, length);
  u_close(fd);
  return retval;
}


x86 assembly (clang, -O0):
<u_truncate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1050 <u_open@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <u_ftruncate@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
call   1060 <u_close@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_truncate>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xeb1(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1050 <u_open@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    %ebp,%esi
call   1030 <u_ftruncate@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1060 <u_close@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"DEBUG: u_truncate entered\0A\00"
define i32 @u_truncate(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %3
%9 = call i32 @u_open(i8* %8, i32 1, i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = call i32 @u_ftruncate(i32 %10, i32 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = call i32 @u_close(i32 %13)
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
@str = [26 x i8] c"DEBUG: u_truncate entered\00"
define i32 @u_truncate(i8* %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @u_open(i8* %0, i32 1, i32 0)
%5 = tail call i32 @u_ftruncate(i32 %4, i32 %1)
%6 = tail call i32 @u_close(i32 %4)
ret i32 %5
}
void _random_seed_init(void) {}


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

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

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

LLVM IR (-O2):
define void @_random_seed_init() {
ret void
}
void bpf_jit_free(struct sk_filter *fp) {}


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

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

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

LLVM IR (-O2):
%struct.sk_filter = type opaque
define void @bpf_jit_free(%struct.sk_filter* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int isatty(int file __attribute__((unused))) {
  errno = ENOSYS;
  return 0;
}


x86 assembly (clang, -O0):
<isatty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec1(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @isatty(i32 %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 0
}