#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 _fq(double, double, double const, double, double, double);
double sqrt(double);
double square(double const);
double Iqac(double qab, double qc, double sld, double solvent_sld,
            double radius, double radius_cap, double length) {
  const double h = -sqrt(square(radius_cap) - square(radius));
  const double Aq = _fq(qab, qc, h, radius_cap, radius, 0.5 * length);
  const double s = (sld - solvent_sld);
  return 1.0e-4 * square(s * Aq);
}


x86 assembly (clang, -O0):
<Iqac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <square@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1040 <square@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
subsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  0xe46(%rip),%xmm5
mulsd  -0x38(%rbp),%xmm5
call   1030 <_fq@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
call   1040 <square@plt>
movaps %xmm0,%xmm1
movsd  0xe06(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Iqac>:
sub    $0x48,%rsp
movsd  %xmm6,0x30(%rsp)
movsd  %xmm4,0x8(%rsp)
movsd  %xmm3,0x38(%rsp)
movsd  %xmm2,0x40(%rsp)
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x18(%rsp)
movsd  %xmm5,0x28(%rsp)
movaps %xmm5,%xmm0
call   1040 <square@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <square@plt>
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
movapd %xmm1,%xmm0
jb     1198 <Iqac+0x68>
xorps  %xmm2,%xmm2
sqrtsd %xmm0,%xmm2
jmp    11a1 <Iqac+0x71>
call   1050 <sqrt@plt>
movapd %xmm0,%xmm2
xorpd  0xe57(%rip),%xmm2
movsd  0x30(%rsp),%xmm5
mulsd  0xe59(%rip),%xmm5
movsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
movsd  0x28(%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
call   1030 <_fq@plt>
movsd  0x40(%rsp),%xmm1
subsd  0x38(%rsp),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <square@plt>
mulsd  0xe27(%rip),%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define double @Iqac(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double %5, double* %13
store double %6, double* %14
%18 = load double, double* %13
%19 = call double @square(double %18)
%20 = load double, double* %12
%21 = call double @square(double %20)
%22 = fsub double %19, %21
%23 = call double @sqrt(double %22)
%24 = fneg double %23
store double %24, double* %15
%25 = load double, double* %8
%26 = load double, double* %9
%27 = load double, double* %15
%28 = load double, double* %13
%29 = load double, double* %12
%30 = load double, double* %14
%31 = fmul double 5.000000e-01, %30
%32 = call double @_fq(double %25, double %26, double %27, double %28, double %29, double %31)
store double %32, double* %16
%33 = load double, double* %10
%34 = load double, double* %11
%35 = fsub double %33, %34
store double %35, double* %17
%36 = load double, double* %17
%37 = load double, double* %16
%38 = fmul double %36, %37
%39 = call double @square(double %38)
%40 = fmul double 1.000000e-04, %39
ret double %40
}

LLVM IR (-O2):
define double @Iqac(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = tail call double @square(double %5)
%9 = tail call double @square(double %4)
%10 = fsub double %8, %9
%11 = tail call double @sqrt(double %10)
%12 = fneg double %11
%13 = fmul double %6, 5.000000e-01
%14 = tail call double @_fq(double %0, double %1, double %12, double %5, double %4, double %13)
%15 = fsub double %2, %3
%16 = fmul double %15, %14
%17 = tail call double @square(double %16)
%18 = fmul double %17, 1.000000e-04
ret double %18
}