#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 */
double M_PI;
double exp(double);
double log(double);
double sqrt(double);
double particle_volume_frequency(double r, double mean, double sigma) {
  double alpha;
  double beta;
  alpha = log(mean) - 0.5 * log(sigma * sigma / (mean * mean) + 1.0);
  beta = sqrt(log(sigma * sigma / (mean * mean) + 1.0));
  double k0 = (log(r) - alpha) / beta;
  double k1 = 1.0 / (r * beta * sqrt(2.0 * M_PI));
  return k1 * exp(-0.5 * k0 * k0);
}


x86 assembly (clang, -O0):
<particle_volume_frequency>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe92(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <log@plt>
movsd  -0x50(%rbp),%xmm1
movsd  0xe74(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe4f(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <log@plt>
call   1050 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <log@plt>
subsd  -0x20(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe14(%rip),%xmm0
mov    0x2de5(%rip),%rax
mulsd  (%rax),%xmm0
call   1050 <sqrt@plt>
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xdeb(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xdc8(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<particle_volume_frequency>:
sub    $0x28,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x10(%rsp)
movaps %xmm1,%xmm0
call   1040 <log@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  %xmm1,%xmm1
divsd  %xmm1,%xmm0
addsd  0xe8c(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1040 <log@plt>
mulsd  0xe81(%rip),%xmm0
addsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <log@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11ae <particle_volume_frequency+0x7e>
sqrtsd %xmm0,%xmm0
jmp    11b3 <particle_volume_frequency+0x83>
call   1050 <sqrt@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <log@plt>
movapd %xmm0,%xmm2
subsd  0x18(%rsp),%xmm2
movsd  0x8(%rsp),%xmm1
divsd  %xmm1,%xmm2
mulsd  0x10(%rsp),%xmm1
mov    0x2e03(%rip),%rax
movsd  (%rax),%xmm0
addsd  %xmm0,%xmm0
ucomisd 0xe1b(%rip),%xmm0
jb     11fd <particle_volume_frequency+0xcd>
sqrtsd %xmm0,%xmm0
jmp    121a <particle_volume_frequency+0xea>
movsd  %xmm1,0x8(%rsp)
movsd  %xmm2,0x10(%rsp)
call   1050 <sqrt@plt>
movsd  0x10(%rsp),%xmm2
movsd  0x8(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xdda(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xdd0(%rip),%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm0
call   1030 <exp@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @particle_volume_frequency(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%11 = load double, double* %5
%12 = call double @log(double %11)
%13 = load double, double* %6
%14 = load double, double* %6
%15 = fmul double %13, %14
%16 = load double, double* %5
%17 = load double, double* %5
%18 = fmul double %16, %17
%19 = fdiv double %15, %18
%20 = fadd double %19, 1.000000e+00
%21 = call double @log(double %20)
%22 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %21, double %12)
store double %22, double* %7
%23 = load double, double* %6
%24 = load double, double* %6
%25 = fmul double %23, %24
%26 = load double, double* %5
%27 = load double, double* %5
%28 = fmul double %26, %27
%29 = fdiv double %25, %28
%30 = fadd double %29, 1.000000e+00
%31 = call double @log(double %30)
%32 = call double @sqrt(double %31)
store double %32, double* %8
%33 = load double, double* %4
%34 = call double @log(double %33)
%35 = load double, double* %7
%36 = fsub double %34, %35
%37 = load double, double* %8
%38 = fdiv double %36, %37
store double %38, double* %9
%39 = load double, double* %4
%40 = load double, double* %8
%41 = fmul double %39, %40
%42 = load double, double* @M_PI
%43 = fmul double 2.000000e+00, %42
%44 = call double @sqrt(double %43)
%45 = fmul double %41, %44
%46 = fdiv double 1.000000e+00, %45
store double %46, double* %10
%47 = load double, double* %10
%48 = load double, double* %9
%49 = fmul double -5.000000e-01, %48
%50 = load double, double* %9
%51 = fmul double %49, %50
%52 = call double @exp(double %51)
%53 = fmul double %47, %52
ret double %53
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @particle_volume_frequency(double %0, double %1, double %2) {
%4 = tail call double @log(double %1)
%5 = fmul double %2, %2
%6 = fmul double %1, %1
%7 = fdiv double %5, %6
%8 = fadd double %7, 1.000000e+00
%9 = tail call double @log(double %8)
%10 = tail call double @llvm.fmuladd.f64(double %9, double -5.000000e-01, double %4)
%11 = tail call double @log(double %8)
%12 = tail call double @sqrt(double %11)
%13 = tail call double @log(double %0)
%14 = fsub double %13, %10
%15 = fdiv double %14, %12
%16 = fmul double %12, %0
%17 = load double, double* @M_PI
%18 = fmul double %17, 2.000000e+00
%19 = tail call double @sqrt(double %18)
%20 = fmul double %16, %19
%21 = fdiv double 1.000000e+00, %20
%22 = fmul double %15, -5.000000e-01
%23 = fmul double %15, %22
%24 = tail call double @exp(double %23)
%25 = fmul double %24, %21
ret double %25
}