#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*/
coulomb_transport_coefficients(double, double, int, double const *,
                               long double const *, long double const *,
                               long double const *, double *);
double coulomb_restricted_cs(double mu, double fspin, int n_parameters,
                             const double *screening, const long double *a,
                             const long double *b, const long double *c) {
  if ((mu >= 1.) || (mu >= 1E+06 * screening[n_parameters - 1]))
    return 0.;
  double coefficients[2];
  coulomb_transport_coefficients(1., fspin, n_parameters, screening, a, b, c,
                                 coefficients);
  double cs0 = coefficients[0];
  coulomb_transport_coefficients(mu, fspin, n_parameters, screening, a, b, c,
                                 coefficients);
  if (coefficients[0] > cs0)
    return 0;
  else
    return cs0 - coefficients[0];
}


x86 assembly (clang, -O0):
<coulomb_restricted_cs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %r8,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xebe(%rip),%xmm1
ucomisd %xmm1,%xmm0
jae    1175 <coulomb_restricted_cs+0x65>
movsd  -0x10(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xea2(%rip),%xmm1
mulsd  (%rax,%rcx,8),%xmm1
ucomisd %xmm1,%xmm0
jb     1182 <coulomb_restricted_cs+0x72>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1207 <coulomb_restricted_cs+0xf7>
movsd  -0x18(%rbp),%xmm1
mov    -0x1c(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x40(%rbp),%r8
lea    -0x50(%rbp),%r9
movsd  0xe5a(%rip),%xmm0
call   1030 <coulomb_transport_coefficients@plt>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x1c(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x40(%rbp),%r8
lea    -0x50(%rbp),%r9
call   1030 <coulomb_transport_coefficients@plt>
movsd  -0x50(%rbp),%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    11f8 <coulomb_restricted_cs+0xe8>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1207 <coulomb_restricted_cs+0xf7>
movsd  -0x58(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coulomb_restricted_cs>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
movapd %xmm0,%xmm3
xorpd  %xmm0,%xmm0
ucomisd 0xed2(%rip),%xmm3
jae    11cb <coulomb_restricted_cs+0xbb>
mov    %rsi,%rbx
mov    %edi,%ebp
movslq %edi,%rax
movsd  -0x8(%rsi,%rax,8),%xmm2
mulsd  0xebe(%rip),%xmm2
ucomisd %xmm2,%xmm3
jae    11cb <coulomb_restricted_cs+0xbb>
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
movsd  0xe9f(%rip),%xmm0
lea    0x10(%rsp),%r13
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r13,%r9
movsd  %xmm1,0x8(%rsp)
movsd  %xmm3,(%rsp)
call   1030 <coulomb_transport_coefficients@plt>
movsd  0x10(%rsp),%xmm0
movaps %xmm0,0x20(%rsp)
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r8
mov    %r13,%r9
call   1030 <coulomb_transport_coefficients@plt>
movsd  0x10(%rsp),%xmm0
movapd 0x20(%rsp),%xmm2
movapd %xmm2,%xmm1
subsd  %xmm0,%xmm1
cmpltsd %xmm0,%xmm2
andnpd %xmm1,%xmm2
movapd %xmm2,%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @coulomb_restricted_cs(double %0, double %1, i32 %2, double* %3, x86_fp80* %4, x86_fp80* %5, x86_fp80* %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca i32
%12 = alloca double*
%13 = alloca x86_fp80*
%14 = alloca x86_fp80*
%15 = alloca x86_fp80*
%16 = alloca [2 x double]
%17 = alloca double
store double %0, double* %9
store double %1, double* %10
store i32 %2, i32* %11
store double* %3, double** %12
store x86_fp80* %4, x86_fp80** %13
store x86_fp80* %5, x86_fp80** %14
store x86_fp80* %6, x86_fp80** %15
%18 = load double, double* %9
%19 = fcmp oge double %18, 1.000000e+00
br i1 %19, label %30, label %20
20: ; preds = %7
%21 = load double, double* %9
%22 = load double*, double** %12
%23 = load i32, i32* %11
%24 = sub nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %22, i64 %25
%27 = load double, double* %26
%28 = fmul double 1.000000e+06, %27
%29 = fcmp oge double %21, %28
br i1 %29, label %30, label %31
30: ; preds = %20, %7
store double 0.000000e+00, double* %8
br label %61
31: ; preds = %20
%32 = load double, double* %10
%33 = load i32, i32* %11
%34 = load double*, double** %12
%35 = load x86_fp80*, x86_fp80** %13
%36 = load x86_fp80*, x86_fp80** %14
%37 = load x86_fp80*, x86_fp80** %15
%38 = getelementptr inbounds [2 x double], [2 x double]* %16, i64 0, i64 0
%39 = call i32 @coulomb_transport_coefficients(double 1.000000e+00, double %32, i32 %33, double* %34, x86_fp80* %35, x86_fp80* %36, x86_fp80* %37, double* %38)
%40 = getelementptr inbounds [2 x double], [2 x double]* %16, i64 0, i64 0
%41 = load double, double* %40
store double %41, double* %17
%42 = load double, double* %9
%43 = load double, double* %10
%44 = load i32, i32* %11
%45 = load double*, double** %12
%46 = load x86_fp80*, x86_fp80** %13
%47 = load x86_fp80*, x86_fp80** %14
%48 = load x86_fp80*, x86_fp80** %15
%49 = getelementptr inbounds [2 x double], [2 x double]* %16, i64 0, i64 0
%50 = call i32 @coulomb_transport_coefficients(double %42, double %43, i32 %44, double* %45, x86_fp80* %46, x86_fp80* %47, x86_fp80* %48, double* %49)
%51 = getelementptr inbounds [2 x double], [2 x double]* %16, i64 0, i64 0
%52 = load double, double* %51
%53 = load double, double* %17
%54 = fcmp ogt double %52, %53
br i1 %54, label %55, label %56
55: ; preds = %31
store double 0.000000e+00, double* %8
br label %61
56: ; preds = %31
%57 = load double, double* %17
%58 = getelementptr inbounds [2 x double], [2 x double]* %16, i64 0, i64 0
%59 = load double, double* %58
%60 = fsub double %57, %59
store double %60, double* %8
br label %61
61: ; preds = %56, %55, %30
%62 = load double, double* %8
ret double %62
}

LLVM IR (-O2):
define double @coulomb_restricted_cs(double %0, double %1, i32 %2, double* %3, x86_fp80* %4, x86_fp80* %5, x86_fp80* %6) {
%8 = alloca [2 x double]
%9 = fcmp ult double %0, 1.000000e+00
br i1 %9, label %10, label %27
10: ; preds = %7
%11 = add nsw i32 %2, -1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds double, double* %3, i64 %12
%14 = load double, double* %13
%15 = fmul double %14, 1.000000e+06
%16 = fcmp ugt double %15, %0
br i1 %16, label %17, label %27
17: ; preds = %10
%18 = bitcast [2 x double]* %8 to i8*
%19 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%20 = call i32 @coulomb_transport_coefficients(double 1.000000e+00, double %1, i32 %2, double* %3, x86_fp80* %4, x86_fp80* %5, x86_fp80* %6, double* %19)
%21 = load double, double* %19
%22 = call i32 @coulomb_transport_coefficients(double %0, double %1, i32 %2, double* %3, x86_fp80* %4, x86_fp80* %5, x86_fp80* %6, double* %19)
%23 = load double, double* %19
%24 = fcmp ogt double %23, %21
%25 = fsub double %21, %23
%26 = select i1 %24, double 0.000000e+00, double %25
br label %27
27: ; preds = %7, %10, %17
%28 = phi double [ %26, %17 ], [ 0.000000e+00, %10 ], [ 0.000000e+00, %7 ]
ret double %28
}