#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 */
double GetEigOmega(int, double **);
int /*<<< orphan*/ GetOmegaMap(double, int, int, double ***, double ***,
                               double **, int *, double *, int, int, double **,
                               double *, double *, int *);
double fabs(double);
void FindC(double lower, double upper, double Omega, int method, int p, int K,
           double ***li, double ***di, double **const1, int *fix, double *pars,
           int lim, double(*c), double **OmegaMap, double(*BarOmega),
           double(*MaxOmega), double(*EigOmega), int *rcMax) {
  double diff, eps;
  int sch, asympt, stopIter;
  eps = pars[0];
  diff = 1e+140;
  stopIter = 1000;
  sch = 0;
  while (fabs(diff) > eps) {
    (*c) = (lower + upper) / 2.0;
    asympt = 0;
    GetOmegaMap((*c), p, K, li, di, const1, fix, pars, lim, asympt, OmegaMap,
                &(*BarOmega), &(*MaxOmega), rcMax);
    if (method == 0) {
      if ((*BarOmega) < Omega) {
        lower = (*c);
      } else {
        upper = (*c);
      }
      diff = (*BarOmega) - Omega;
    } else {
      if (method == 1) {
        if ((*MaxOmega) < Omega) {
          lower = (*c);
        } else {
          upper = (*c);
        }
        diff = (*MaxOmega) - Omega;
      } else {
        (*EigOmega) = GetEigOmega(K, OmegaMap);
        if ((*EigOmega) < Omega) {
          lower = (*c);
        } else {
          upper = (*c);
        }
        diff = (*EigOmega) - Omega;
      }
    }
    sch = sch + 1;
    if (sch == stopIter) {
      (*c) = 0.0;
      break;
    }
  }
  if ((method == 0) | (method == 1))
    (*EigOmega) = GetEigOmega(K, OmegaMap);
}


x86 assembly (clang, -O0):
<FindC>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xa0,%rsp
mov    0x50(%rbp),%rax
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
movsd  %xmm2,-0x38(%rbp)
mov    %edi,-0x3c(%rbp)
mov    %esi,-0x40(%rbp)
mov    %edx,-0x44(%rbp)
mov    %rcx,-0x50(%rbp)
mov    %r8,-0x58(%rbp)
mov    %r9,-0x60(%rbp)
mov    0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xe72(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x3e8,-0x7c(%rbp)
movl   $0x0,-0x74(%rbp)
movsd  -0x68(%rbp),%xmm0
movaps 0xe63(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x70(%rbp),%xmm0
jbe    137b <FindC+0x25b>
movsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  0xe3a(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x0,-0x78(%rbp)
mov    0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x40(%rbp),%edi
mov    -0x44(%rbp),%esi
mov    -0x50(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    -0x60(%rbp),%r8
mov    0x10(%rbp),%r9
mov    0x18(%rbp),%r12
mov    0x20(%rbp),%r15d
mov    -0x78(%rbp),%r14d
mov    0x30(%rbp),%rbx
mov    0x38(%rbp),%r11
mov    0x40(%rbp),%r10
mov    0x50(%rbp),%rax
mov    %r12,(%rsp)
mov    %r15d,0x8(%rsp)
mov    %r14d,0x10(%rsp)
mov    %rbx,0x18(%rsp)
mov    %r11,0x20(%rsp)
mov    %r10,0x28(%rsp)
mov    %rax,0x30(%rsp)
call   1030 <GetOmegaMap@plt>
cmpl   $0x0,-0x3c(%rbp)
jne    1299 <FindC+0x179>
mov    0x38(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x38(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1275 <FindC+0x155>
mov    0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1282 <FindC+0x162>
mov    0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0x38(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1351 <FindC+0x231>
cmpl   $0x1,-0x3c(%rbp)
jne    12f0 <FindC+0x1d0>
mov    0x40(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x38(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    12cc <FindC+0x1ac>
mov    0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    12d9 <FindC+0x1b9>
mov    0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0x40(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    134c <FindC+0x22c>
mov    -0x44(%rbp),%edi
mov    0x30(%rbp),%rsi
call   1040 <GetEigOmega@plt>
mov    0x48(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x48(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x38(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    132d <FindC+0x20d>
mov    0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    133a <FindC+0x21a>
mov    0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0x48(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1351 <FindC+0x231>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0x7c(%rbp),%eax
jne    1376 <FindC+0x256>
mov    0x28(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    137b <FindC+0x25b>
jmp    11a1 <FindC+0x81>
cmpl   $0x0,-0x3c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x1,-0x3c(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
cmp    $0x0,%eax
je     13b3 <FindC+0x293>
mov    -0x44(%rbp),%edi
mov    0x30(%rbp),%rsi
call   1040 <GetEigOmega@plt>
mov    0x48(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0xa0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<FindC>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9,0x28(%rsp)
mov    %r8,0x20(%rsp)
mov    %rcx,%r12
mov    %edx,%ebx
mov    %esi,%r13d
mov    %edi,%ebp
movapd %xmm0,%xmm5
mov    0x88(%rsp),%r14
mov    0x78(%rsp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0xe9b(%rip),%xmm0
mov    $0x3e8,%r15d
movsd  %xmm2,(%rsp)
jmp    11a9 <FindC+0x89>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movapd %xmm0,%xmm3
cmpltsd %xmm2,%xmm3
movapd 0x10(%rsp),%xmm1
andpd  %xmm3,%xmm1
andnpd %xmm4,%xmm3
orpd   %xmm3,%xmm1
subsd  %xmm2,%xmm0
add    $0xffffffff,%r15d
je     12ce <FindC+0x1ae>
andpd  0xe5f(%rip),%xmm0
ucomisd 0x30(%rsp),%xmm0
jbe    12d5 <FindC+0x1b5>
movapd %xmm1,0x10(%rsp)
movapd %xmm1,%xmm0
movsd  %xmm5,0x8(%rsp)
addsd  %xmm5,%xmm0
mulsd  0xe2f(%rip),%xmm0
movsd  %xmm0,(%r14)
sub    $0x8,%rsp
mov    %r13d,%edi
mov    %ebx,%esi
mov    %r12,%rdx
mov    0x28(%rsp),%rcx
mov    0x30(%rsp),%r8
mov    0x78(%rsp),%r9
push   0xb8(%rsp)
push   0xb0(%rsp)
push   0xb0(%rsp)
push   0xb0(%rsp)
push   $0x0
mov    0xb0(%rsp),%eax
push   %rax
push   0xb0(%rsp)
call   1030 <GetOmegaMap@plt>
add    $0x40,%rsp
cmp    $0x1,%ebp
je     1280 <FindC+0x160>
test   %ebp,%ebp
jne    1290 <FindC+0x170>
mov    0x98(%rsp),%rax
movsd  (%rax),%xmm0
movsd  (%rsp),%xmm2
ucomisd %xmm0,%xmm2
movsd  (%r14),%xmm4
movapd %xmm4,%xmm5
movapd 0x10(%rsp),%xmm1
ja     1264 <FindC+0x144>
movsd  0x8(%rsp),%xmm5
movapd %xmm0,%xmm3
cmpltsd %xmm2,%xmm3
jmp    118f <FindC+0x6f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0xa0(%rsp),%rax
movsd  (%rax),%xmm0
jmp    12ab <FindC+0x18b>
xchg   %ax,%ax
mov    %ebx,%edi
mov    0x90(%rsp),%rsi
call   1040 <GetEigOmega@plt>
mov    0xa8(%rsp),%rax
movsd  %xmm0,(%rax)
movsd  (%rsp),%xmm2
ucomisd %xmm0,%xmm2
movsd  (%r14),%xmm4
movapd %xmm4,%xmm5
ja     1180 <FindC+0x60>
movsd  0x8(%rsp),%xmm5
jmp    1180 <FindC+0x60>
movq   $0x0,(%r14)
cmp    $0x1,%ebp
ja     12f5 <FindC+0x1d5>
mov    %ebx,%edi
mov    0x90(%rsp),%rsi
call   1040 <GetEigOmega@plt>
mov    0xa8(%rsp),%rax
movsd  %xmm0,(%rax)
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @FindC(double %0, double %1, double %2, i32 %3, i32 %4, i32 %5, double*** %6, double*** %7, double** %8, i32* %9, double* %10, i32 %11, double* %12, double** %13, double* %14, double* %15, double* %16, i32* %17) {
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca double***
%26 = alloca double***
%27 = alloca double**
%28 = alloca i32*
%29 = alloca double*
%30 = alloca i32
%31 = alloca double*
%32 = alloca double**
%33 = alloca double*
%34 = alloca double*
%35 = alloca double*
%36 = alloca i32*
%37 = alloca double
%38 = alloca double
%39 = alloca i32
%40 = alloca i32
%41 = alloca i32
store double %0, double* %19
store double %1, double* %20
store double %2, double* %21
store i32 %3, i32* %22
store i32 %4, i32* %23
store i32 %5, i32* %24
store double*** %6, double**** %25
store double*** %7, double**** %26
store double** %8, double*** %27
store i32* %9, i32** %28
store double* %10, double** %29
store i32 %11, i32* %30
store double* %12, double** %31
store double** %13, double*** %32
store double* %14, double** %33
store double* %15, double** %34
store double* %16, double** %35
store i32* %17, i32** %36
%42 = load double*, double** %29
%43 = getelementptr inbounds double, double* %42, i64 0
%44 = load double, double* %43
store double %44, double* %38
store double 1.000000e+140, double* %37
store i32 1000, i32* %41
store i32 0, i32* %39
br label %45
45: ; preds = %138, %18
%46 = load double, double* %37
%47 = call double @llvm.fabs.f64(double %46)
%48 = load double, double* %38
%49 = fcmp ogt double %47, %48
br i1 %49, label %50, label %139
50: ; preds = %45
%51 = load double, double* %19
%52 = load double, double* %20
%53 = fadd double %51, %52
%54 = fdiv double %53, 2.000000e+00
%55 = load double*, double** %31
store double %54, double* %55
store i32 0, i32* %40
%56 = load double*, double** %31
%57 = load double, double* %56
%58 = load i32, i32* %23
%59 = load i32, i32* %24
%60 = load double***, double**** %25
%61 = load double***, double**** %26
%62 = load double**, double*** %27
%63 = load i32*, i32** %28
%64 = load double*, double** %29
%65 = load i32, i32* %30
%66 = load i32, i32* %40
%67 = load double**, double*** %32
%68 = load double*, double** %33
%69 = load double*, double** %34
%70 = load i32*, i32** %36
%71 = call i32 @GetOmegaMap(double %57, i32 %58, i32 %59, double*** %60, double*** %61, double** %62, i32* %63, double* %64, i32 %65, i32 %66, double** %67, double* %68, double* %69, i32* %70)
%72 = load i32, i32* %22
%73 = icmp eq i32 %72, 0
br i1 %73, label %74, label %90
74: ; preds = %50
%75 = load double*, double** %33
%76 = load double, double* %75
%77 = load double, double* %21
%78 = fcmp olt double %76, %77
br i1 %78, label %79, label %82
79: ; preds = %74
%80 = load double*, double** %31
%81 = load double, double* %80
store double %81, double* %19
br label %85
82: ; preds = %74
%83 = load double*, double** %31
%84 = load double, double* %83
store double %84, double* %20
br label %85
85: ; preds = %82, %79
%86 = load double*, double** %33
%87 = load double, double* %86
%88 = load double, double* %21
%89 = fsub double %87, %88
store double %89, double* %37
br label %130
90: ; preds = %50
%91 = load i32, i32* %22
%92 = icmp eq i32 %91, 1
br i1 %92, label %93, label %109
93: ; preds = %90
%94 = load double*, double** %34
%95 = load double, double* %94
%96 = load double, double* %21
%97 = fcmp olt double %95, %96
br i1 %97, label %98, label %101
98: ; preds = %93
%99 = load double*, double** %31
%100 = load double, double* %99
store double %100, double* %19
br label %104
101: ; preds = %93
%102 = load double*, double** %31
%103 = load double, double* %102
store double %103, double* %20
br label %104
104: ; preds = %101, %98
%105 = load double*, double** %34
%106 = load double, double* %105
%107 = load double, double* %21
%108 = fsub double %106, %107
store double %108, double* %37
br label %129
109: ; preds = %90
%110 = load i32, i32* %24
%111 = load double**, double*** %32
%112 = call double @GetEigOmega(i32 %110, double** %111)
%113 = load double*, double** %35
store double %112, double* %113
%114 = load double*, double** %35
%115 = load double, double* %114
%116 = load double, double* %21
%117 = fcmp olt double %115, %116
br i1 %117, label %118, label %121
118: ; preds = %109
%119 = load double*, double** %31
%120 = load double, double* %119
store double %120, double* %19
br label %124
121: ; preds = %109
%122 = load double*, double** %31
%123 = load double, double* %122
store double %123, double* %20
br label %124
124: ; preds = %121, %118
%125 = load double*, double** %35
%126 = load double, double* %125
%127 = load double, double* %21
%128 = fsub double %126, %127
store double %128, double* %37
br label %129
129: ; preds = %124, %104
br label %130
130: ; preds = %129, %85
%131 = load i32, i32* %39
%132 = add nsw i32 %131, 1
store i32 %132, i32* %39
%133 = load i32, i32* %39
%134 = load i32, i32* %41
%135 = icmp eq i32 %133, %134
br i1 %135, label %136, label %138
136: ; preds = %130
%137 = load double*, double** %31
store double 0.000000e+00, double* %137
br label %139
138: ; preds = %130
br label %45
139: ; preds = %136, %45
%140 = load i32, i32* %22
%141 = icmp eq i32 %140, 0
%142 = zext i1 %141 to i32
%143 = load i32, i32* %22
%144 = icmp eq i32 %143, 1
%145 = zext i1 %144 to i32
%146 = or i32 %142, %145
%147 = icmp ne i32 %146, 0
br i1 %147, label %148, label %153
148: ; preds = %139
%149 = load i32, i32* %24
%150 = load double**, double*** %32
%151 = call double @GetEigOmega(i32 %149, double** %150)
%152 = load double*, double** %35
store double %151, double* %152
br label %153
153: ; preds = %148, %139
ret void
}

LLVM IR (-O2):
define void @FindC(double %0, double %1, double %2, i32 %3, i32 %4, i32 %5, double*** %6, double*** %7, double** %8, i32* %9, double* %10, i32 %11, double* nocapture %12, double** %13, double* %14, double* %15, double* nocapture %16, i32* %17) {
%19 = load double, double* %10
br label %20
20: ; preds = %49, %18
%21 = phi double [ 1.000000e+140, %18 ], [ %53, %49 ]
%22 = phi i32 [ 0, %18 ], [ %54, %49 ]
%23 = phi double [ %1, %18 ], [ %51, %49 ]
%24 = phi double [ %0, %18 ], [ %52, %49 ]
%25 = tail call double @llvm.fabs.f64(double %21)
%26 = fcmp ogt double %25, %19
br i1 %26, label %27, label %57
27: ; preds = %20
%28 = fadd double %23, %24
%29 = fmul double %28, 5.000000e-01
store double %29, double* %12
%30 = tail call i32 @GetOmegaMap(double %29, i32 %4, i32 %5, double*** %6, double*** %7, double** %8, i32* %9, double* %10, i32 %11, i32 0, double** %13, double* %14, double* %15, i32* %17)
switch i32 %3, label %43 [
i32 0, label %31
i32 1, label %37
]
31: ; preds = %27
%32 = load double, double* %14
%33 = fcmp olt double %32, %2
%34 = load double, double* %12
%35 = select i1 %33, double %23, double %34
%36 = select i1 %33, double %34, double %24
br label %49
37: ; preds = %27
%38 = load double, double* %15
%39 = fcmp olt double %38, %2
%40 = load double, double* %12
%41 = select i1 %39, double %23, double %40
%42 = select i1 %39, double %40, double %24
br label %49
43: ; preds = %27
%44 = tail call double @GetEigOmega(i32 %5, double** %13)
store double %44, double* %16
%45 = fcmp olt double %44, %2
%46 = load double, double* %12
%47 = select i1 %45, double %23, double %46
%48 = select i1 %45, double %46, double %24
br label %49
49: ; preds = %43, %37, %31
%50 = phi double [ %32, %31 ], [ %38, %37 ], [ %44, %43 ]
%51 = phi double [ %35, %31 ], [ %41, %37 ], [ %47, %43 ]
%52 = phi double [ %36, %31 ], [ %42, %37 ], [ %48, %43 ]
%53 = fsub double %50, %2
%54 = add nuw nsw i32 %22, 1
%55 = icmp eq i32 %54, 1000
br i1 %55, label %56, label %20
56: ; preds = %49
store double 0.000000e+00, double* %12
br label %57
57: ; preds = %20, %56
%58 = icmp ult i32 %3, 2
br i1 %58, label %59, label %61
59: ; preds = %57
%60 = tail call double @GetEigOmega(i32 %5, double** %13)
store double %60, double* %16
br label %61
61: ; preds = %59, %57
ret void
}