#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*/ ERI_RCSH_Coeff(int, double *, double *);
void ERI_RCSH_Coeff_Inverse(int m, double c[2], double d[2]) {
  double na, nb, a[2], b[2];
  if (0 == m) {
    c[0] = 1.0;
    c[1] = 0.0;
    d[0] = 0.0;
    d[1] = 0.0;
  } else {
    ERI_RCSH_Coeff(m, a, b);
    na = a[0] * a[0] + a[1] * a[1];
    nb = b[0] * b[0] + b[1] * b[1];
    c[0] = 0.5 * a[0] / na;
    c[1] = -0.5 * a[1] / na;
    d[0] = 0.5 * b[0] / nb;
    d[1] = -0.5 * b[1] / nb;
  }
}


x86 assembly (clang, -O0):
<ERI_RCSH_Coeff_Inverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jne    1166 <ERI_RCSH_Coeff_Inverse+0x56>
mov    -0x10(%rbp),%rax
movsd  0xed6(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
jmp    1222 <ERI_RCSH_Coeff_Inverse+0x112>
mov    -0x4(%rbp),%edi
lea    -0x40(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   1030 <ERI_RCSH_Coeff@plt>
movsd  -0x40(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe48(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xe26(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  0xe13(%rip),%xmm0
mulsd  -0x50(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xdf1(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ERI_RCSH_Coeff_Inverse>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
test   %edi,%edi
je     119e <ERI_RCSH_Coeff_Inverse+0x8e>
lea    0x10(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <ERI_RCSH_Coeff@plt>
movapd 0x10(%rsp),%xmm1
movapd %xmm1,%xmm0
mulpd  %xmm1,%xmm0
unpckhpd %xmm0,%xmm0
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movsd  (%rsp),%xmm3
movsd  0x8(%rsp),%xmm0
movapd %xmm0,%xmm4
mulsd  %xmm0,%xmm4
movapd %xmm3,%xmm5
mulsd  %xmm3,%xmm5
addsd  %xmm4,%xmm5
mulpd  0xe8d(%rip),%xmm1
unpcklpd %xmm2,%xmm2
divpd  %xmm2,%xmm1
movupd %xmm1,(%r14)
mulsd  0xe88(%rip),%xmm3
divsd  %xmm5,%xmm3
movsd  %xmm3,(%rbx)
mulsd  0xe80(%rip),%xmm0
divsd  %xmm5,%xmm0
jmp    11b6 <ERI_RCSH_Coeff_Inverse+0xa6>
movsd  0xe7a(%rip),%xmm0
movupd %xmm0,(%r14)
movq   $0x0,(%rbx)
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rbx)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ERI_RCSH_Coeff_Inverse(i32 %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca [2 x double]
%10 = alloca [2 x double]
store i32 %0, i32* %4
store double* %1, double** %5
store double* %2, double** %6
%11 = load i32, i32* %4
%12 = icmp eq i32 0, %11
br i1 %12, label %13, label %22
13: ; preds = %3
%14 = load double*, double** %5
%15 = getelementptr inbounds double, double* %14, i64 0
store double 1.000000e+00, double* %15
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 1
store double 0.000000e+00, double* %17
%18 = load double*, double** %6
%19 = getelementptr inbounds double, double* %18, i64 0
store double 0.000000e+00, double* %19
%20 = load double*, double** %6
%21 = getelementptr inbounds double, double* %20, i64 1
store double 0.000000e+00, double* %21
br label %75
22: ; preds = %3
%23 = load i32, i32* %4
%24 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
%25 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 0
%26 = call i32 @ERI_RCSH_Coeff(i32 %23, double* %24, double* %25)
%27 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
%28 = load double, double* %27
%29 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
%30 = load double, double* %29
%31 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 1
%32 = load double, double* %31
%33 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 1
%34 = load double, double* %33
%35 = fmul double %32, %34
%36 = call double @llvm.fmuladd.f64(double %28, double %30, double %35)
store double %36, double* %7
%37 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 0
%38 = load double, double* %37
%39 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 0
%40 = load double, double* %39
%41 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 1
%42 = load double, double* %41
%43 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 1
%44 = load double, double* %43
%45 = fmul double %42, %44
%46 = call double @llvm.fmuladd.f64(double %38, double %40, double %45)
store double %46, double* %8
%47 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
%48 = load double, double* %47
%49 = fmul double 5.000000e-01, %48
%50 = load double, double* %7
%51 = fdiv double %49, %50
%52 = load double*, double** %5
%53 = getelementptr inbounds double, double* %52, i64 0
store double %51, double* %53
%54 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 1
%55 = load double, double* %54
%56 = fmul double -5.000000e-01, %55
%57 = load double, double* %7
%58 = fdiv double %56, %57
%59 = load double*, double** %5
%60 = getelementptr inbounds double, double* %59, i64 1
store double %58, double* %60
%61 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 0
%62 = load double, double* %61
%63 = fmul double 5.000000e-01, %62
%64 = load double, double* %8
%65 = fdiv double %63, %64
%66 = load double*, double** %6
%67 = getelementptr inbounds double, double* %66, i64 0
store double %65, double* %67
%68 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 1
%69 = load double, double* %68
%70 = fmul double -5.000000e-01, %69
%71 = load double, double* %8
%72 = fdiv double %70, %71
%73 = load double*, double** %6
%74 = getelementptr inbounds double, double* %73, i64 1
store double %72, double* %74
br label %75
75: ; preds = %22, %13
ret void
}

LLVM IR (-O2):
define void @ERI_RCSH_Coeff_Inverse(i32 %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = alloca <2 x double>
%5 = alloca [2 x double]
%6 = bitcast <2 x double>* %4 to i8*
%7 = bitcast [2 x double]* %5 to i8*
%8 = icmp eq i32 %0, 0
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = bitcast double* %1 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 0.000000e+00>, <2 x double>* %10
store double 0.000000e+00, double* %2
br label %34
11: ; preds = %3
%12 = getelementptr inbounds <2 x double>, <2 x double>* %4, i64 0, i64 0
%13 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
%14 = call i32 @ERI_RCSH_Coeff(i32 %0, double* %12, double* %13)
%15 = load <2 x double>, <2 x double>* %4
%16 = fmul <2 x double> %15, %15
%17 = extractelement <2 x double> %16, i64 1
%18 = extractelement <2 x double> %15, i64 0
%19 = call double @llvm.fmuladd.f64(double %18, double %18, double %17)
%20 = load double, double* %13
%21 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 1
%22 = load double, double* %21
%23 = fmul double %22, %22
%24 = call double @llvm.fmuladd.f64(double %20, double %20, double %23)
%25 = fmul <2 x double> %15, <double 5.000000e-01, double -5.000000e-01>
%26 = insertelement <2 x double> poison, double %19, i64 0
%27 = shufflevector <2 x double> %26, <2 x double> poison, <2 x i32> zeroinitializer
%28 = fdiv <2 x double> %25, %27
%29 = bitcast double* %1 to <2 x double>*
store <2 x double> %28, <2 x double>* %29
%30 = fmul double %20, 5.000000e-01
%31 = fdiv double %30, %24
store double %31, double* %2
%32 = fmul double %22, -5.000000e-01
%33 = fdiv double %32, %24
br label %34
34: ; preds = %11, %9
%35 = phi double [ 0.000000e+00, %9 ], [ %33, %11 ]
%36 = getelementptr inbounds double, double* %2, i64 1
store double %35, double* %36
ret void
}