#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*/ Rgsquareshort(double, double);
double Sdebye(int /*<<< orphan*/);
double Sexv_new(double, double, double);
double a_long(double, double, double);
double a_short(double, double, double, double);
double fmax(double, double);
double sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ square(double);
double Sk_WR(double q, double L, double b) {
  const double Rg_short = sqrt(Rgsquareshort(L, b));
  double q0short = fmax(1.9 / Rg_short, 3.0);
  double ans;
  if (L > 4 * b) {
    if (q * b <= 3.1) {
      ans = Sexv_new(q, L, b);
    } else {
      ans = a_long(q, L, b);
    }
  } else {
    if (q * b <= q0short) {
      ans = Sdebye(square(q * Rg_short));
    } else {
      ans = a_short(q, L, b, q0short);
    }
  }
  return ans;
}


x86 assembly (clang, -O0):
<Sk_WR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <Rgsquareshort@plt>
mov    %eax,%edi
call   1090 <sqrt@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xe66(%rip),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  0xe51(%rip),%xmm1
maxsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe33(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    1234 <Sk_WR+0xc4>
movsd  -0x8(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xe2a(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1216 <Sk_WR+0xa6>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1080 <Sexv_new@plt>
movsd  %xmm0,-0x30(%rbp)
jmp    122f <Sk_WR+0xbf>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1060 <a_long@plt>
movsd  %xmm0,-0x30(%rbp)
jmp    1290 <Sk_WR+0x120>
movsd  -0x8(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     126d <Sk_WR+0xfd>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
call   1040 <square@plt>
mov    %eax,%edi
call   1050 <Sdebye@plt>
movsd  %xmm0,-0x30(%rbp)
jmp    128b <Sk_WR+0x11b>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
call   1070 <a_short@plt>
movsd  %xmm0,-0x30(%rbp)
jmp    1290 <Sk_WR+0x120>
movsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sk_WR>:
sub    $0x18,%rsp
movsd  %xmm2,(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
movapd %xmm1,%xmm0
movaps %xmm2,%xmm1
call   1030 <Rgsquareshort@plt>
mov    %eax,%edi
call   1090 <sqrt@plt>
movsd  0x10(%rsp),%xmm5
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
movsd  0xe5f(%rip),%xmm3
mulsd  %xmm2,%xmm3
ucomisd %xmm3,%xmm1
movapd %xmm5,%xmm4
mulsd  %xmm2,%xmm4
jbe    11de <Sk_WR+0x6e>
movsd  0xe4d(%rip),%xmm0
ucomisd %xmm4,%xmm0
jae    1205 <Sk_WR+0x95>
movapd %xmm5,%xmm0
add    $0x18,%rsp
jmp    1060 <a_long@plt>
movsd  0xe1a(%rip),%xmm3
divsd  %xmm0,%xmm3
maxsd  0xe16(%rip),%xmm3
ucomisd %xmm4,%xmm3
jae    1212 <Sk_WR+0xa2>
movapd %xmm5,%xmm0
add    $0x18,%rsp
jmp    1070 <a_short@plt>
movapd %xmm5,%xmm0
add    $0x18,%rsp
jmp    1080 <Sexv_new@plt>
mulsd  %xmm5,%xmm0
call   1040 <square@plt>
mov    %eax,%edi
add    $0x18,%rsp
jmp    1050 <Sdebye@plt>

LLVM IR (-O0):
define double @Sk_WR(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%10 = load double, double* %5
%11 = load double, double* %6
%12 = call i32 @Rgsquareshort(double %10, double %11)
%13 = call double @sqrt(i32 %12)
store double %13, double* %7
%14 = load double, double* %7
%15 = fdiv double 1.900000e+00, %14
%16 = call double @llvm.maxnum.f64(double %15, double 3.000000e+00)
store double %16, double* %8
%17 = load double, double* %5
%18 = load double, double* %6
%19 = fmul double 4.000000e+00, %18
%20 = fcmp ogt double %17, %19
br i1 %20, label %21, label %37
21: ; preds = %3
%22 = load double, double* %4
%23 = load double, double* %6
%24 = fmul double %22, %23
%25 = fcmp ole double %24, 3.100000e+00
br i1 %25, label %26, label %31
26: ; preds = %21
%27 = load double, double* %4
%28 = load double, double* %5
%29 = load double, double* %6
%30 = call double @Sexv_new(double %27, double %28, double %29)
store double %30, double* %9
br label %36
31: ; preds = %21
%32 = load double, double* %4
%33 = load double, double* %5
%34 = load double, double* %6
%35 = call double @a_long(double %32, double %33, double %34)
store double %35, double* %9
br label %36
36: ; preds = %31, %26
br label %56
37: ; preds = %3
%38 = load double, double* %4
%39 = load double, double* %6
%40 = fmul double %38, %39
%41 = load double, double* %8
%42 = fcmp ole double %40, %41
br i1 %42, label %43, label %49
43: ; preds = %37
%44 = load double, double* %4
%45 = load double, double* %7
%46 = fmul double %44, %45
%47 = call i32 @square(double %46)
%48 = call double @Sdebye(i32 %47)
store double %48, double* %9
br label %55
49: ; preds = %37
%50 = load double, double* %4
%51 = load double, double* %5
%52 = load double, double* %6
%53 = load double, double* %8
%54 = call double @a_short(double %50, double %51, double %52, double %53)
store double %54, double* %9
br label %55
55: ; preds = %49, %43
br label %56
56: ; preds = %55, %36
%57 = load double, double* %9
ret double %57
}

LLVM IR (-O2):
define double @Sk_WR(double %0, double %1, double %2) {
%4 = tail call i32 @Rgsquareshort(double %1, double %2)
%5 = tail call double @sqrt(i32 %4)
%6 = fdiv double 1.900000e+00, %5
%7 = tail call double @llvm.maxnum.f64(double %6, double 3.000000e+00)
%8 = fmul double %2, 4.000000e+00
%9 = fcmp olt double %8, %1
%10 = fmul double %0, %2
br i1 %9, label %11, label %17
11: ; preds = %3
%12 = fcmp ugt double %10, 3.100000e+00
br i1 %12, label %15, label %13
13: ; preds = %11
%14 = tail call double @Sexv_new(double %0, double %1, double %2)
br label %25
15: ; preds = %11
%16 = tail call double @a_long(double %0, double %1, double %2)
br label %25
17: ; preds = %3
%18 = fcmp ugt double %10, %7
br i1 %18, label %23, label %19
19: ; preds = %17
%20 = fmul double %5, %0
%21 = tail call i32 @square(double %20)
%22 = tail call double @Sdebye(i32 %21)
br label %25
23: ; preds = %17
%24 = tail call double @a_short(double %0, double %1, double %2, double %7)
br label %25
25: ; preds = %19, %23, %13, %15
%26 = phi double [ %14, %13 ], [ %16, %15 ], [ %22, %19 ], [ %24, %23 ]
ret double %26
}