#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 */
int /*<<< orphan*/ Rgsquare(double, double);
double Sdebye(double const);
double const Sexv(double, double, double);
double exp(double const);
double pow(double, double);
double sqrt(int /*<<< orphan*/);
double w_WR(double const);
double Sexv_new(double q, double L, double b) {
  const double qr = q * sqrt(Rgsquare(L, b));
  const double qr2 = qr * qr;
  const double C = (L / b > 10.0) ? 3.06 * pow(L / b, -0.44) : 1.0;
  const double t9 =
      C * b / L * (4.0 - exp(-qr2) * (11.0 + 7.0 / qr2) + 7.0 / qr2) / 15.0;
  const double Sexv_orig = Sexv(q, L, b);
  const double del = 1.05;
  const double qdel = (Sexv(q * del, L, b) - Sexv_orig) / (q * (del - 1.0));
  if (qdel < 0) {
    return t9 + Sexv_orig;
  } else {
    const double w = w_WR(qr);
    const double t10 = Sdebye(qr * qr) * (1.0 - w);
    return t9 + t10;
  }
}


x86 assembly (clang, -O0):
<Sexv_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1050 <Rgsquare@plt>
mov    %eax,%edi
call   1090 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  0xe24(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1216 <Sexv_new+0xa6>
movsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  0xe20(%rip),%xmm1
call   1070 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe08(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    1228 <Sexv_new+0xb8>
movsd  0xdea(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    1228 <Sexv_new+0xb8>
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
movsd  0xdc1(%rip),%xmm3
divsd  -0x30(%rbp),%xmm3
movsd  0xdc4(%rip),%xmm2
addsd  %xmm3,%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xd95(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  0xd81(%rip),%xmm2
divsd  -0x30(%rbp),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd64(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1080 <Sexv@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  0xd32(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xd25(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1080 <Sexv@plt>
subsd  -0x48(%rbp),%xmm0
movsd  0xcfc(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    1354 <Sexv_new+0x1e4>
movsd  -0x40(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1397 <Sexv_new+0x227>
movsd  -0x28(%rbp),%xmm0
call   1030 <w_WR@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <Sdebye@plt>
movsd  0xc8e(%rip),%xmm1
subsd  -0x60(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sexv_new>:
sub    $0x58,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,(%rsp)
movapd %xmm1,%xmm0
movaps %xmm2,%xmm1
call   1050 <Rgsquare@plt>
mov    %eax,%edi
call   1090 <sqrt@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x38(%rsp)
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
ucomisd 0xe49(%rip),%xmm0
movapd %xmm1,0x20(%rsp)
jbe    11e4 <Sexv_new+0x74>
movsd  0xe41(%rip),%xmm1
call   1070 <pow@plt>
movapd 0x20(%rsp),%xmm1
mulsd  0xe36(%rip),%xmm0
jmp    11ec <Sexv_new+0x7c>
movsd  0xe14(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
movapd 0xe56(%rip),%xmm0
xorpd  %xmm1,%xmm0
call   1060 <exp@plt>
movsd  %xmm0,0x48(%rsp)
movsd  0xe0f(%rip),%xmm0
divsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x50(%rsp)
movsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
call   1080 <Sexv@plt>
movsd  %xmm0,0x40(%rsp)
movsd  0xde7(%rip),%xmm0
mulsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
call   1080 <Sexv@plt>
movsd  0x40(%rsp),%xmm4
subsd  %xmm4,%xmm0
movsd  (%rsp),%xmm1
mulsd  0xdc2(%rip),%xmm1
divsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     12a8 <Sexv_new+0x138>
movsd  0x38(%rsp),%xmm0
call   1030 <w_WR@plt>
movsd  %xmm0,(%rsp)
movapd 0x20(%rsp),%xmm0
call   1040 <Sdebye@plt>
movsd  0xd61(%rip),%xmm4
subsd  (%rsp),%xmm4
mulsd  %xmm0,%xmm4
movsd  0x18(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
divsd  0x10(%rsp),%xmm1
movsd  0xd76(%rip),%xmm0
movsd  0x50(%rsp),%xmm2
addsd  %xmm2,%xmm0
movsd  0x48(%rsp),%xmm3
mulsd  %xmm0,%xmm3
movsd  0xd62(%rip),%xmm0
subsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
divsd  0xd56(%rip),%xmm0
addsd  %xmm4,%xmm0
add    $0x58,%rsp
ret

LLVM IR (-O0):
define double @Sexv_new(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
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%17 = load double, double* %5
%18 = load double, double* %6
%19 = load double, double* %7
%20 = call i32 @Rgsquare(double %18, double %19)
%21 = call double @sqrt(i32 %20)
%22 = fmul double %17, %21
store double %22, double* %8
%23 = load double, double* %8
%24 = load double, double* %8
%25 = fmul double %23, %24
store double %25, double* %9
%26 = load double, double* %6
%27 = load double, double* %7
%28 = fdiv double %26, %27
%29 = fcmp ogt double %28, 1.000000e+01
br i1 %29, label %30, label %36
30: ; preds = %3
%31 = load double, double* %6
%32 = load double, double* %7
%33 = fdiv double %31, %32
%34 = call double @pow(double %33, double -4.400000e-01)
%35 = fmul double 3.060000e+00, %34
br label %37
36: ; preds = %3
br label %37
37: ; preds = %36, %30
%38 = phi double [ %35, %30 ], [ 1.000000e+00, %36 ]
store double %38, double* %10
%39 = load double, double* %10
%40 = load double, double* %7
%41 = fmul double %39, %40
%42 = load double, double* %6
%43 = fdiv double %41, %42
%44 = load double, double* %9
%45 = fneg double %44
%46 = call double @exp(double %45)
%47 = load double, double* %9
%48 = fdiv double 7.000000e+00, %47
%49 = fadd double 1.100000e+01, %48
%50 = fneg double %46
%51 = call double @llvm.fmuladd.f64(double %50, double %49, double 4.000000e+00)
%52 = load double, double* %9
%53 = fdiv double 7.000000e+00, %52
%54 = fadd double %51, %53
%55 = fmul double %43, %54
%56 = fdiv double %55, 1.500000e+01
store double %56, double* %11
%57 = load double, double* %5
%58 = load double, double* %6
%59 = load double, double* %7
%60 = call double @Sexv(double %57, double %58, double %59)
store double %60, double* %12
store double 1.050000e+00, double* %13
%61 = load double, double* %5
%62 = fmul double %61, 1.050000e+00
%63 = load double, double* %6
%64 = load double, double* %7
%65 = call double @Sexv(double %62, double %63, double %64)
%66 = load double, double* %12
%67 = fsub double %65, %66
%68 = load double, double* %5
%69 = fmul double %68, 0x3FA99999999999A0
%70 = fdiv double %67, %69
store double %70, double* %14
%71 = load double, double* %14
%72 = fcmp olt double %71, 0.000000e+00
br i1 %72, label %73, label %77
73: ; preds = %37
%74 = load double, double* %11
%75 = load double, double* %12
%76 = fadd double %74, %75
store double %76, double* %4
br label %90
77: ; preds = %37
%78 = load double, double* %8
%79 = call double @w_WR(double %78)
store double %79, double* %15
%80 = load double, double* %8
%81 = load double, double* %8
%82 = fmul double %80, %81
%83 = call double @Sdebye(double %82)
%84 = load double, double* %15
%85 = fsub double 1.000000e+00, %84
%86 = fmul double %83, %85
store double %86, double* %16
%87 = load double, double* %11
%88 = load double, double* %16
%89 = fadd double %87, %88
store double %89, double* %4
br label %90
90: ; preds = %77, %73
%91 = load double, double* %4
ret double %91
}

LLVM IR (-O2):
define double @Sexv_new(double %0, double %1, double %2) {
%4 = tail call i32 @Rgsquare(double %1, double %2)
%5 = tail call double @sqrt(i32 %4)
%6 = fmul double %5, %0
%7 = fmul double %6, %6
%8 = fdiv double %1, %2
%9 = fcmp ogt double %8, 1.000000e+01
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = tail call double @pow(double %8, double -4.400000e-01)
%12 = fmul double %11, 3.060000e+00
br label %13
13: ; preds = %3, %10
%14 = phi double [ %12, %10 ], [ 1.000000e+00, %3 ]
%15 = fneg double %7
%16 = tail call double @exp(double %15)
%17 = fdiv double 7.000000e+00, %7
%18 = tail call double @Sexv(double %0, double %1, double %2)
%19 = fmul double %0, 1.050000e+00
%20 = tail call double @Sexv(double %19, double %1, double %2)
%21 = fsub double %20, %18
%22 = fmul double %0, 0x3FA99999999999A0
%23 = fdiv double %21, %22
%24 = fcmp olt double %23, 0.000000e+00
br i1 %24, label %30, label %25
25: ; preds = %13
%26 = tail call double @w_WR(double %6)
%27 = tail call double @Sdebye(double %7)
%28 = fsub double 1.000000e+00, %26
%29 = fmul double %27, %28
br label %30
30: ; preds = %13, %25
%31 = phi double [ %29, %25 ], [ %18, %13 ]
%32 = fmul double %14, %2
%33 = fdiv double %32, %1
%34 = fneg double %16
%35 = fadd double %17, 1.100000e+01
%36 = tail call double @llvm.fmuladd.f64(double %34, double %35, double 4.000000e+00)
%37 = fadd double %17, %36
%38 = fmul double %33, %37
%39 = fdiv double %38, 1.500000e+01
%40 = fadd double %39, %31
ret double %40
}