#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
unsigned long dickmanlocal(double const, double const);
scalar_t__ isprime(unsigned long);
double const log(unsigned long const);
double dickmanmu_sum(const unsigned long B1, const unsigned long B2,
                     const double x) {
  double s = 0.;
  const double logB1 = 1. / log(B1);
  const double logx = log(x);
  unsigned long p;
  for (p = B1 + 1; p <= B2; p++)
    if (isprime(p))
      s += dickmanlocal((logx - log(p)) * logB1, x / p) / p;
  return (s);
}


x86 assembly (clang, -O0):
<dickmanmu_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  0xe9f(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe91(%rip),%xmm2
movaps %xmm0,%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rax
cvttsd2si %xmm0,%rdi
mov    %rdi,%rcx
sar    $0x3f,%rcx
and    %rcx,%rax
or     %rax,%rdi
call   1040 <log@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     127a <dickmanmu_sum+0x14a>
mov    -0x38(%rbp),%rdi
call   1030 <isprime@plt>
cmp    $0x0,%rax
je     1264 <dickmanmu_sum+0x134>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x38(%rbp),%rdi
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movq   -0x38(%rbp),%xmm2
movaps 0xe0b(%rip),%xmm3
movaps %xmm3,-0x60(%rbp)
punpckldq %xmm3,%xmm2
movapd 0xe0b(%rip),%xmm3
movaps %xmm3,-0x50(%rbp)
subpd  %xmm3,%xmm2
movaps %xmm2,%xmm3
unpckhpd %xmm2,%xmm2
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
call   1050 <dickmanlocal@plt>
movaps -0x60(%rbp),%xmm2
movaps -0x50(%rbp),%xmm1
mov    -0x38(%rbp),%rcx
xor    %edx,%edx
div    %rcx
movq   %rax,%xmm0
punpckldq %xmm2,%xmm0
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1269 <dickmanmu_sum+0x139>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    11ab <dickmanmu_sum+0x7b>
movsd  -0x20(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dickmanmu_sum>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movaps %xmm0,0x20(%rsp)
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <log@plt>
movapd 0x20(%rsp),%xmm1
cvttsd2si %xmm1,%rax
movsd  %xmm0,0x10(%rsp)
mov    %rax,%rcx
sar    $0x3f,%rcx
movapd %xmm1,%xmm0
subsd  0xe9d(%rip),%xmm0
cvttsd2si %xmm0,%rdi
and    %rcx,%rdi
or     %rax,%rdi
call   1040 <log@plt>
movsd  %xmm0,0x18(%rsp)
add    $0x1,%rbx
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
cmp    %r14,%rbx
jbe    11a2 <dickmanmu_sum+0x72>
movsd  0x8(%rsp),%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret
movsd  0xe56(%rip),%xmm0
divsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
jmp    120f <dickmanmu_sum+0xdf>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %edx,%edx
div    %rbx
movq   %rax,%xmm0
punpckldq 0xe2e(%rip),%xmm0
subpd  0xe36(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
add    $0x1,%rbx
cmp    %r14,%rbx
ja     1194 <dickmanmu_sum+0x64>
mov    %rbx,%rdi
call   1030 <isprime@plt>
test   %rax,%rax
je     1206 <dickmanmu_sum+0xd6>
mov    %rbx,%rdi
call   1040 <log@plt>
movsd  0x18(%rsp),%xmm2
subsd  %xmm0,%xmm2
mulsd  0x10(%rsp),%xmm2
movq   %rbx,%xmm0
punpckldq 0xdcf(%rip),%xmm0
subpd  0xdd7(%rip),%xmm0
movapd %xmm0,%xmm3
unpckhpd %xmm0,%xmm3
addsd  %xmm0,%xmm3
movapd 0x20(%rsp),%xmm1
divsd  %xmm3,%xmm1
movapd %xmm2,%xmm0
call   1050 <dickmanlocal@plt>
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
jne    11d0 <dickmanmu_sum+0xa0>
xor    %edx,%edx
div    %ebx
jmp    11d5 <dickmanmu_sum+0xa5>

LLVM IR (-O0):
define double @dickmanmu_sum(i64 %0, i64 %1, double %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store double %2, double* %6
store double 0.000000e+00, double* %7
%11 = load i64, i64* %4
%12 = call double @log(i64 %11)
%13 = fdiv double 1.000000e+00, %12
store double %13, double* %8
%14 = load double, double* %6
%15 = fptoui double %14 to i64
%16 = call double @log(i64 %15)
store double %16, double* %9
%17 = load i64, i64* %4
%18 = add i64 %17, 1
store i64 %18, i64* %10
br label %19
19: ; preds = %45, %3
%20 = load i64, i64* %10
%21 = load i64, i64* %5
%22 = icmp ule i64 %20, %21
br i1 %22, label %23, label %48
23: ; preds = %19
%24 = load i64, i64* %10
%25 = call i64 @isprime(i64 %24)
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %44
27: ; preds = %23
%28 = load double, double* %9
%29 = load i64, i64* %10
%30 = call double @log(i64 %29)
%31 = fsub double %28, %30
%32 = load double, double* %8
%33 = fmul double %31, %32
%34 = load double, double* %6
%35 = load i64, i64* %10
%36 = uitofp i64 %35 to double
%37 = fdiv double %34, %36
%38 = call i64 @dickmanlocal(double %33, double %37)
%39 = load i64, i64* %10
%40 = udiv i64 %38, %39
%41 = uitofp i64 %40 to double
%42 = load double, double* %7
%43 = fadd double %42, %41
store double %43, double* %7
br label %44
44: ; preds = %27, %23
br label %45
45: ; preds = %44
%46 = load i64, i64* %10
%47 = add i64 %46, 1
store i64 %47, i64* %10
br label %19
48: ; preds = %19
%49 = load double, double* %7
ret double %49
}

LLVM IR (-O2):
define double @dickmanmu_sum(i64 %0, i64 %1, double %2) {
%4 = tail call double @log(i64 %0)
%5 = fdiv double 1.000000e+00, %4
%6 = fptoui double %2 to i64
%7 = tail call double @log(i64 %6)
%8 = add i64 %0, 1
%9 = icmp ugt i64 %8, %1
br i1 %9, label %29, label %10
10: ; preds = %3, %25
%11 = phi i64 [ %27, %25 ], [ %8, %3 ]
%12 = phi double [ %26, %25 ], [ 0.000000e+00, %3 ]
%13 = tail call i64 @isprime(i64 %11)
%14 = icmp eq i64 %13, 0
br i1 %14, label %25, label %15
15: ; preds = %10
%16 = tail call double @log(i64 %11)
%17 = fsub double %7, %16
%18 = fmul double %5, %17
%19 = uitofp i64 %11 to double
%20 = fdiv double %2, %19
%21 = tail call i64 @dickmanlocal(double %18, double %20)
%22 = udiv i64 %21, %11
%23 = uitofp i64 %22 to double
%24 = fadd double %12, %23
br label %25
25: ; preds = %10, %15
%26 = phi double [ %24, %15 ], [ %12, %10 ]
%27 = add i64 %11, 1
%28 = icmp ugt i64 %27, %1
br i1 %28, label %29, label %10
29: ; preds = %25, %3
%30 = phi double [ 0.000000e+00, %3 ], [ %26, %25 ]
ret double %30
}