#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*/ scalars_nonewald_poly(int /*<<< orphan*/, double, double,
                                         double, double *);
void scalars_minv_f_poly(double r, double aa, double ab, double *scalar_f) {
  double scalar[11];
  scalars_nonewald_poly(0, r, aa, ab, scalar);
  double xa12, ya12;
  xa12 = scalar[0];
  ya12 = scalar[1];
  double xa21, ya21;
  xa21 = xa12;
  ya21 = ya12;
  double xa11, ya11;
  xa11 = 1.0 / aa;
  ya11 = 1.0 / aa;
  double xa22, ya22;
  xa22 = 1.0 / ab;
  ya22 = 1.0 / ab;
  double det;
  double XA11, XA12, XA21, XA22;
  det = xa11 * xa22 - xa12 * xa21;
  XA11 = xa22 / det;
  XA12 = -xa12 / det;
  XA21 = -xa21 / det;
  XA22 = xa11 / det;
  double YA11, YA12, YA21, YA22;
  det = ya11 * ya22 - ya12 * ya21;
  YA11 = ya22 / det;
  YA12 = -ya12 / det;
  YA21 = -ya21 / det;
  YA22 = ya11 / det;
  scalar_f[0] = XA11;
  scalar_f[1] = XA12;
  scalar_f[2] = XA21;
  scalar_f[3] = XA22;
  scalar_f[4] = YA11;
  scalar_f[5] = YA12;
  scalar_f[6] = YA21;
  scalar_f[7] = YA22;
}


x86 assembly (clang, -O0):
<scalars_minv_f_poly>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    -0x80(%rbp),%rsi
xor    %edi,%edi
call   1030 <scalars_nonewald_poly@plt>
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xe76(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xe61(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xe4c(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0xe37(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0xb8(%rbp),%xmm2
ff
movsd  -0x88(%rbp),%xmm1
ff
mulsd  -0x98(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
divsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
divsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  -0xc0(%rbp),%xmm2
ff
movsd  -0x90(%rbp),%xmm1
ff
mulsd  -0xa0(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
divsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
divsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0xd8(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0xe0(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0xe8(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x18(%rax)
movsd  -0xf0(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movsd  -0xf8(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x28(%rax)
movsd  -0x100(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x30(%rax)
movsd  -0x108(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x38(%rax)
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalars_minv_f_poly>:
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%rbx
movaps %xmm2,(%rsp)
movaps %xmm1,0x10(%rsp)
lea    0x20(%rsp),%rsi
xor    %edi,%edi
call   1030 <scalars_nonewald_poly@plt>
movapd 0x20(%rsp),%xmm0
movapd 0x10(%rsp),%xmm2
unpcklpd (%rsp),%xmm2
movapd 0xeb7(%rip),%xmm1
divpd  %xmm2,%xmm1
movapd 0xebb(%rip),%xmm2
xorpd  %xmm0,%xmm2
mulpd  %xmm0,%xmm0
movapd %xmm1,%xmm3
unpcklpd %xmm1,%xmm3
movapd %xmm1,%xmm4
unpckhpd %xmm1,%xmm4
mulpd  %xmm3,%xmm4
subpd  %xmm0,%xmm4
movapd %xmm1,%xmm0
shufpd $0x1,%xmm2,%xmm0
movapd %xmm4,%xmm3
unpcklpd %xmm4,%xmm3
divpd  %xmm3,%xmm0
shufpd $0x1,%xmm1,%xmm2
divpd  %xmm4,%xmm1
unpckhpd %xmm4,%xmm4
divpd  %xmm4,%xmm2
movupd %xmm0,(%rbx)
movhpd %xmm0,0x10(%rbx)
movupd %xmm1,0x18(%rbx)
movlpd %xmm2,0x28(%rbx)
movupd %xmm2,0x30(%rbx)
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @scalars_minv_f_poly(double %0, double %1, double %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double*
%9 = alloca [11 x 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
%25 = alloca double
%26 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double* %3, double** %8
%27 = load double, double* %5
%28 = load double, double* %6
%29 = load double, double* %7
%30 = getelementptr inbounds [11 x double], [11 x double]* %9, i64 0, i64 0
%31 = call i32 @scalars_nonewald_poly(i32 0, double %27, double %28, double %29, double* %30)
%32 = getelementptr inbounds [11 x double], [11 x double]* %9, i64 0, i64 0
%33 = load double, double* %32
store double %33, double* %10
%34 = getelementptr inbounds [11 x double], [11 x double]* %9, i64 0, i64 1
%35 = load double, double* %34
store double %35, double* %11
%36 = load double, double* %10
store double %36, double* %12
%37 = load double, double* %11
store double %37, double* %13
%38 = load double, double* %6
%39 = fdiv double 1.000000e+00, %38
store double %39, double* %14
%40 = load double, double* %6
%41 = fdiv double 1.000000e+00, %40
store double %41, double* %15
%42 = load double, double* %7
%43 = fdiv double 1.000000e+00, %42
store double %43, double* %16
%44 = load double, double* %7
%45 = fdiv double 1.000000e+00, %44
store double %45, double* %17
%46 = load double, double* %14
%47 = load double, double* %16
%48 = load double, double* %10
%49 = load double, double* %12
%50 = fmul double %48, %49
%51 = fneg double %50
%52 = call double @llvm.fmuladd.f64(double %46, double %47, double %51)
store double %52, double* %18
%53 = load double, double* %16
%54 = load double, double* %18
%55 = fdiv double %53, %54
store double %55, double* %19
%56 = load double, double* %10
%57 = fneg double %56
%58 = load double, double* %18
%59 = fdiv double %57, %58
store double %59, double* %20
%60 = load double, double* %12
%61 = fneg double %60
%62 = load double, double* %18
%63 = fdiv double %61, %62
store double %63, double* %21
%64 = load double, double* %14
%65 = load double, double* %18
%66 = fdiv double %64, %65
store double %66, double* %22
%67 = load double, double* %15
%68 = load double, double* %17
%69 = load double, double* %11
%70 = load double, double* %13
%71 = fmul double %69, %70
%72 = fneg double %71
%73 = call double @llvm.fmuladd.f64(double %67, double %68, double %72)
store double %73, double* %18
%74 = load double, double* %17
%75 = load double, double* %18
%76 = fdiv double %74, %75
store double %76, double* %23
%77 = load double, double* %11
%78 = fneg double %77
%79 = load double, double* %18
%80 = fdiv double %78, %79
store double %80, double* %24
%81 = load double, double* %13
%82 = fneg double %81
%83 = load double, double* %18
%84 = fdiv double %82, %83
store double %84, double* %25
%85 = load double, double* %15
%86 = load double, double* %18
%87 = fdiv double %85, %86
store double %87, double* %26
%88 = load double, double* %19
%89 = load double*, double** %8
%90 = getelementptr inbounds double, double* %89, i64 0
store double %88, double* %90
%91 = load double, double* %20
%92 = load double*, double** %8
%93 = getelementptr inbounds double, double* %92, i64 1
store double %91, double* %93
%94 = load double, double* %21
%95 = load double*, double** %8
%96 = getelementptr inbounds double, double* %95, i64 2
store double %94, double* %96
%97 = load double, double* %22
%98 = load double*, double** %8
%99 = getelementptr inbounds double, double* %98, i64 3
store double %97, double* %99
%100 = load double, double* %23
%101 = load double*, double** %8
%102 = getelementptr inbounds double, double* %101, i64 4
store double %100, double* %102
%103 = load double, double* %24
%104 = load double*, double** %8
%105 = getelementptr inbounds double, double* %104, i64 5
store double %103, double* %105
%106 = load double, double* %25
%107 = load double*, double** %8
%108 = getelementptr inbounds double, double* %107, i64 6
store double %106, double* %108
%109 = load double, double* %26
%110 = load double*, double** %8
%111 = getelementptr inbounds double, double* %110, i64 7
store double %109, double* %111
ret void
}

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