#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 exp(double);
double pow(double, double);
double square(double);
double Iq(double q, double guinier_scale, double lorentz_scale, double rg,
          double fractal_dim, double cor_length) {
  double lorentzian_term = square(q * cor_length);
  lorentzian_term = 1.0 + ((fractal_dim + 1.0) / 3.0) * lorentzian_term;
  lorentzian_term = pow(lorentzian_term, fractal_dim / 2.0);
  double exp_term = square(q * rg);
  exp_term = exp(-exp_term / 3.0);
  double result = lorentz_scale / lorentzian_term + guinier_scale * exp_term;
  return result;
}


x86 assembly (clang, -O0):
<Iq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%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  -0x8(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1030 <square@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  0xe9e(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  0xe81(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe7c(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  0xe59(%rip),%xmm2
divsd  %xmm2,%xmm1
call   1050 <pow@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
call   1030 <square@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe0b(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <exp@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm1
divsd  -0x38(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Iq>:
sub    $0x28,%rsp
movsd  %xmm4,(%rsp)
movsd  %xmm3,0x10(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x8(%rsp)
mulsd  %xmm0,%xmm5
movapd %xmm5,%xmm0
call   1030 <square@plt>
movsd  0xe9a(%rip),%xmm1
movsd  (%rsp),%xmm3
movapd %xmm3,%xmm2
addsd  %xmm1,%xmm2
divsd  0xe8d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  0xe85(%rip),%xmm3
movapd %xmm3,%xmm1
call   1050 <pow@plt>
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
call   1030 <square@plt>
divsd  0xe66(%rip),%xmm0
call   1040 <exp@plt>
movsd  0x18(%rsp),%xmm1
divsd  (%rsp),%xmm1
mulsd  0x20(%rsp),%xmm0
addsd  %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @Iq(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%16 = load double, double* %7
%17 = load double, double* %12
%18 = fmul double %16, %17
%19 = call double @square(double %18)
store double %19, double* %13
%20 = load double, double* %11
%21 = fadd double %20, 1.000000e+00
%22 = fdiv double %21, 3.000000e+00
%23 = load double, double* %13
%24 = call double @llvm.fmuladd.f64(double %22, double %23, double 1.000000e+00)
store double %24, double* %13
%25 = load double, double* %13
%26 = load double, double* %11
%27 = fdiv double %26, 2.000000e+00
%28 = call double @pow(double %25, double %27)
store double %28, double* %13
%29 = load double, double* %7
%30 = load double, double* %10
%31 = fmul double %29, %30
%32 = call double @square(double %31)
store double %32, double* %14
%33 = load double, double* %14
%34 = fneg double %33
%35 = fdiv double %34, 3.000000e+00
%36 = call double @exp(double %35)
store double %36, double* %14
%37 = load double, double* %9
%38 = load double, double* %13
%39 = fdiv double %37, %38
%40 = load double, double* %8
%41 = load double, double* %14
%42 = call double @llvm.fmuladd.f64(double %40, double %41, double %39)
store double %42, double* %15
%43 = load double, double* %15
ret double %43
}

LLVM IR (-O2):
define double @Iq(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fmul double %0, %5
%8 = tail call double @square(double %7)
%9 = fadd double %4, 1.000000e+00
%10 = fdiv double %9, 3.000000e+00
%11 = tail call double @llvm.fmuladd.f64(double %10, double %8, double 1.000000e+00)
%12 = fmul double %4, 5.000000e-01
%13 = tail call double @pow(double %11, double %12)
%14 = fmul double %0, %3
%15 = tail call double @square(double %14)
%16 = fdiv double %15, -3.000000e+00
%17 = tail call double @exp(double %16)
%18 = fdiv double %2, %13
%19 = tail call double @llvm.fmuladd.f64(double %1, double %17, double %18)
ret double %19
}