#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;
int exp(double);
int log(int);
double sigma_iim_(double *rr, double *YY, double *lamf, double *x0f,
                  double *rf) {
  double r = *rr;
  double Y = *YY;
  if (Y <= 0)
    return 0.0;
  double N0 = 0.7;
  double kappa = 9.9;
  double gc = 0.6275;
  double lambda = *lamf;
  double x0 = *x0f;
  double Rp2 = *rf * (*rf);
  double Qs2 = exp(lambda * (Y + log(x0)));
  double lQs = 0.5 * log(Qs2);
  double z = -log(r / 2.0) - lQs;
  double a = gc * N0 / (1 - N0);
  a = a * a / log(1 / (1 - N0));
  double lrqsb = z - (1 - N0) / gc / N0 * log(1 / (1 - N0));
  return 2.0 * M_PI * Rp2 *
         ((z > 0) ? N0 * exp(-2.0 * z * (gc + z / (kappa * lambda * Y)))
                  : 1 - exp(-a * lrqsb * lrqsb));
}


x86 assembly (clang, -O0):
<sigma_iim_>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x40(%rbp),%xmm0
jb     1174 <sigma_iim_+0x54>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1467 <sigma_iim_+0x347>
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe97(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe82(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
cvttsd2si -0x68(%rbp),%edi
call   1040 <log@plt>
movsd  -0xc8(%rbp),%xmm1
ff
movsd  -0xc0(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x78(%rbp)
cvttsd2si -0x78(%rbp),%edi
call   1040 <log@plt>
cvtsi2sd %eax,%xmm1
movsd  0xde2(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xdbc(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <log@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
subsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  0xd8e(%rip),%xmm1
subsd  -0x48(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0xd5d(%rip),%xmm1
subsd  -0x48(%rbp),%xmm1
movsd  0xd50(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <log@plt>
movsd  -0xb8(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xd13(%rip),%xmm0
subsd  -0x48(%rbp),%xmm0
divsd  -0x58(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xcf4(%rip),%xmm1
subsd  -0x48(%rbp),%xmm1
movsd  0xce7(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <log@plt>
movsd  -0xb0(%rbp),%xmm0
ff
movsd  -0xa8(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xc8f(%rip),%xmm0
mov    0x2c70(%rip),%rax
mulsd  (%rax),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1405 <sigma_iim_+0x2e5>
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  0xc7d(%rip),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
movsd  -0x58(%rbp),%xmm1
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0x50(%rbp),%xmm3
mulsd  -0x60(%rbp),%xmm3
mulsd  -0x40(%rbp),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  -0xd8(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
jmp    144e <sigma_iim_+0x32e>
movsd  -0x90(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
mulsd  -0x98(%rbp),%xmm0
ff
call   1030 <exp@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0xd0(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigma_iim_>:
push   %rbx
sub    $0x30,%rsp
movsd  (%rsi),%xmm1
xorpd  %xmm0,%xmm0
movsd  %xmm1,0x20(%rsp)
ucomisd %xmm1,%xmm0
jae    129a <sigma_iim_+0x17a>
movsd  (%rdx),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  (%r8),%xmm0
cvttsd2si (%rcx),%eax
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%rdi),%xmm1
mulsd  0xe9a(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
mov    %eax,%edi
call   1040 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x20(%rsp),%xmm0
mulsd  0x18(%rsp),%xmm0
call   1030 <exp@plt>
mov    %eax,%edi
call   1040 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xe5f(%rip),%xmm0
movsd  %xmm0,0x28(%rsp)
cvttsd2si 0x8(%rsp),%edi
call   1040 <log@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
subsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x3,%edi
call   1040 <log@plt>
mov    %eax,%ebx
mov    $0x3,%edi
call   1040 <log@plt>
movsd  0x8(%rsp),%xmm0
mov    0x2dfe(%rip),%rcx
movsd  (%rcx),%xmm1
addsd  %xmm1,%xmm1
mulsd  0x10(%rsp),%xmm1
movsd  %xmm1,0x10(%rsp)
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1252 <sigma_iim_+0x132>
movsd  0xe08(%rip),%xmm3
mulsd  %xmm0,%xmm3
movsd  0x18(%rsp),%xmm2
mulsd  0xdfe(%rip),%xmm2
movsd  0x20(%rsp),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
addsd  0xdf0(%rip),%xmm0
mulsd  %xmm3,%xmm0
call   1030 <exp@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0xde0(%rip),%xmm1
jmp    1290 <sigma_iim_+0x170>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0xda7(%rip),%xmm1
addsd  %xmm0,%xmm1
cvtsi2sd %ebx,%xmm2
movsd  0xd9f(%rip),%xmm0
divsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @sigma_iim_(double* %0, double* %1, double* %2, double* %3, double* %4) {
%6 = alloca double
%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
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = 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
%25 = load double*, double** %7
%26 = load double, double* %25
store double %26, double* %12
%27 = load double*, double** %8
%28 = load double, double* %27
store double %28, double* %13
%29 = load double, double* %13
%30 = fcmp ole double %29, 0.000000e+00
br i1 %30, label %31, label %32
31: ; preds = %5
store double 0.000000e+00, double* %6
br label %132
32: ; preds = %5
store double 0x3FE6666666666666, double* %14
store double 9.900000e+00, double* %15
store double 6.275000e-01, double* %16
%33 = load double*, double** %9
%34 = load double, double* %33
store double %34, double* %17
%35 = load double*, double** %10
%36 = load double, double* %35
store double %36, double* %18
%37 = load double*, double** %11
%38 = load double, double* %37
%39 = load double*, double** %11
%40 = load double, double* %39
%41 = fmul double %38, %40
store double %41, double* %19
%42 = load double, double* %17
%43 = load double, double* %13
%44 = load double, double* %18
%45 = fptosi double %44 to i32
%46 = call i32 @log(i32 %45)
%47 = sitofp i32 %46 to double
%48 = fadd double %43, %47
%49 = fmul double %42, %48
%50 = call i32 @exp(double %49)
%51 = sitofp i32 %50 to double
store double %51, double* %20
%52 = load double, double* %20
%53 = fptosi double %52 to i32
%54 = call i32 @log(i32 %53)
%55 = sitofp i32 %54 to double
%56 = fmul double 5.000000e-01, %55
store double %56, double* %21
%57 = load double, double* %12
%58 = fdiv double %57, 2.000000e+00
%59 = fptosi double %58 to i32
%60 = call i32 @log(i32 %59)
%61 = sub nsw i32 0, %60
%62 = sitofp i32 %61 to double
%63 = load double, double* %21
%64 = fsub double %62, %63
store double %64, double* %22
%65 = load double, double* %16
%66 = load double, double* %14
%67 = fmul double %65, %66
%68 = load double, double* %14
%69 = fsub double 1.000000e+00, %68
%70 = fdiv double %67, %69
store double %70, double* %23
%71 = load double, double* %23
%72 = load double, double* %23
%73 = fmul double %71, %72
%74 = load double, double* %14
%75 = fsub double 1.000000e+00, %74
%76 = fdiv double 1.000000e+00, %75
%77 = fptosi double %76 to i32
%78 = call i32 @log(i32 %77)
%79 = sitofp i32 %78 to double
%80 = fdiv double %73, %79
store double %80, double* %23
%81 = load double, double* %22
%82 = load double, double* %14
%83 = fsub double 1.000000e+00, %82
%84 = load double, double* %16
%85 = fdiv double %83, %84
%86 = load double, double* %14
%87 = fdiv double %85, %86
%88 = load double, double* %14
%89 = fsub double 1.000000e+00, %88
%90 = fdiv double 1.000000e+00, %89
%91 = fptosi double %90 to i32
%92 = call i32 @log(i32 %91)
%93 = sitofp i32 %92 to double
%94 = fneg double %87
%95 = call double @llvm.fmuladd.f64(double %94, double %93, double %81)
store double %95, double* %24
%96 = load double, double* @M_PI
%97 = fmul double 2.000000e+00, %96
%98 = load double, double* %19
%99 = fmul double %97, %98
%100 = load double, double* %22
%101 = fcmp ogt double %100, 0.000000e+00
br i1 %101, label %102, label %119
102: ; preds = %32
%103 = load double, double* %14
%104 = load double, double* %22
%105 = fmul double -2.000000e+00, %104
%106 = load double, double* %16
%107 = load double, double* %22
%108 = load double, double* %15
%109 = load double, double* %17
%110 = fmul double %108, %109
%111 = load double, double* %13
%112 = fmul double %110, %111
%113 = fdiv double %107, %112
%114 = fadd double %106, %113
%115 = fmul double %105, %114
%116 = call i32 @exp(double %115)
%117 = sitofp i32 %116 to double
%118 = fmul double %103, %117
br label %129
119: ; preds = %32
%120 = load double, double* %23
%121 = fneg double %120
%122 = load double, double* %24
%123 = fmul double %121, %122
%124 = load double, double* %24
%125 = fmul double %123, %124
%126 = call i32 @exp(double %125)
%127 = sub nsw i32 1, %126
%128 = sitofp i32 %127 to double
br label %129
129: ; preds = %119, %102
%130 = phi double [ %118, %102 ], [ %128, %119 ]
%131 = fmul double %99, %130
store double %131, double* %6
br label %132
132: ; preds = %129, %31
%133 = load double, double* %6
ret double %133
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @sigma_iim_(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, double* nocapture %4) {
%6 = load double, double* %1
%7 = fcmp ugt double %6, 0.000000e+00
br i1 %7, label %8, label %58
8: ; preds = %5
%9 = load double, double* %0
%10 = load double, double* %2
%11 = load double, double* %3
%12 = load double, double* %4
%13 = fmul double %12, %12
%14 = fptosi double %11 to i32
%15 = tail call i32 @log(i32 %14)
%16 = sitofp i32 %15 to double
%17 = fadd double %6, %16
%18 = fmul double %10, %17
%19 = tail call i32 @exp(double %18)
%20 = tail call i32 @log(i32 %19)
%21 = sitofp i32 %20 to double
%22 = fmul double %21, 5.000000e-01
%23 = fmul double %9, 5.000000e-01
%24 = fptosi double %23 to i32
%25 = tail call i32 @log(i32 %24)
%26 = sub nsw i32 0, %25
%27 = sitofp i32 %26 to double
%28 = fsub double %27, %22
%29 = tail call i32 @log(i32 3)
%30 = tail call i32 @log(i32 3)
%31 = sitofp i32 %30 to double
%32 = tail call double @llvm.fmuladd.f64(double %31, double 0xBFE5DAFDD08037F5, double %28)
%33 = load double, double* @M_PI
%34 = fmul double %33, 2.000000e+00
%35 = fmul double %13, %34
%36 = fcmp ogt double %28, 0.000000e+00
br i1 %36, label %37, label %47
37: ; preds = %8
%38 = fmul double %28, -2.000000e+00
%39 = fmul double %10, 9.900000e+00
%40 = fmul double %6, %39
%41 = fdiv double %28, %40
%42 = fadd double %41, 6.275000e-01
%43 = fmul double %38, %42
%44 = tail call i32 @exp(double %43)
%45 = sitofp i32 %44 to double
%46 = fmul double %45, 0x3FE6666666666666
br label %55
47: ; preds = %8
%48 = sitofp i32 %29 to double
%49 = fdiv double 0xC00126783D87F10F, %48
%50 = fmul double %49, %32
%51 = fmul double %32, %50
%52 = tail call i32 @exp(double %51)
%53 = sub nsw i32 1, %52
%54 = sitofp i32 %53 to double
br label %55
55: ; preds = %47, %37
%56 = phi double [ %46, %37 ], [ %54, %47 ]
%57 = fmul double %35, %56
br label %58
58: ; preds = %5, %55
%59 = phi double [ %57, %55 ], [ 0.000000e+00, %5 ]
ret double %59
}