// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../source/input.c
// Function: input_fzero_ridder
int input_fzero_ridder(int (*func)(double x,
                                   void *param,
                                   double *y,
                                   ErrorMsg error_message),
                       double x1,
                       double x2,
                       double xtol,
                       void *param,
                       double *Fx1,
                       double *Fx2,
                       double *xzero,
                       int *fevals,
                       ErrorMsg error_message){

  /** Summary: */

  /** Define local variables */
  int j,MAXIT=1000;
  double ans,fh,fl,fm,fnew,s,xh,xl,xm,xnew;

  if ((Fx1!=NULL)&&(Fx2!=NULL)){
    fl = *Fx1;
    fh = *Fx2;
  }
  else{
    class_call((*func)(x1, param, &fl, error_message),
               error_message, error_message);
    class_call((*func)(x2, param, &fh, error_message),
               error_message, error_message);

    *fevals = (*fevals)+2;
  }
  if ((fl > 0.0 && fh < 0.0) || (fl < 0.0 && fh > 0.0)) {
    xl=x1;
    xh=x2;
    ans=-1.11e11;
    for (j=1;j<=MAXIT;j++) {
      xm=0.5*(xl+xh);
      class_call((*func)(xm, param, &fm, error_message),
                 error_message, error_message);
      *fevals = (*fevals)+1;
      s=sqrt(fm*fm-fl*fh);
      if (s == 0.0){
        *xzero = ans;
        return _SUCCESS_;
      }
      xnew=xm+(xm-xl)*((fl >= fh ? 1.0 : -1.0)*fm/s);
      if (fabs(xnew-ans) <= xtol) {
        *xzero = ans;
        return _SUCCESS_;
      }

      ans=xnew;
      class_call((*func)(ans, param, &fnew, error_message),
                 error_message, error_message);
      *fevals = (*fevals)+1;
      if (fnew == 0.0){
        *xzero = ans;
        return _SUCCESS_;
      }

      if (NRSIGN(fm,fnew) != fm) {
        xl=xm;
        fl=fm;
        xh=ans;
        fh=fnew;
      }
      else if (NRSIGN(fl,fnew) != fl) {
        xh=ans;
        fh=fnew;
      }
      else if (NRSIGN(fh,fnew) != fh) {
        xl=ans;
        fl=fnew;
      }
      else{
        return _FAILURE_;
      }
      if (fabs(xh-xl) <= xtol) {
        *xzero = ans;
        return _SUCCESS_;
      }
    }
    class_stop(error_message,"zriddr exceed maximum iterations");
  }

  else {
    if (fl == 0.0) return x1;
    if (fh == 0.0) return x2;
    class_stop(error_message,"root must be bracketed in zriddr.");
  }
  class_stop(error_message,"Failure in int.");
}

// Assembly:
subq $0x50c8, %rsp           # imm = 0x50C8
movq 0x50d0(%rsp), %rax
movq %rdi, 0x50b8(%rsp)
movsd %xmm0, 0x50b0(%rsp)
movsd %xmm1, 0x50a8(%rsp)
movsd %xmm2, 0x50a0(%rsp)
movq %rsi, 0x5098(%rsp)
movq %rdx, 0x5090(%rsp)
movq %rcx, 0x5088(%rsp)
movq %r8, 0x5080(%rsp)
movq %r9, 0x5078(%rsp)
movl $0x3e8, 0x5070(%rsp) # imm = 0x3E8
cmpq $0x0, 0x5090(%rsp)
je 0x7279a
cmpq $0x0, 0x5088(%rsp)
je 0x7279a
movq 0x5090(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x5058(%rsp)
movq 0x5088(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x5060(%rsp)
jmp 0x728cf
movq 0x50b8(%rsp), %rax
movsd 0x50b0(%rsp), %xmm0
movq 0x5098(%rsp), %rdi
movq 0x50d0(%rsp), %rdx
leaq 0x5058(%rsp), %rsi
callq *%rax
cmpl $0x1, %eax
jne 0x72829
leaq 0x4820(%rsp), %rdi
movq 0x50d0(%rsp), %rcx
leaq 0x15fbf7(%rip), %rsi    # 0x1d23d8
leaq 0x165928(%rip), %rdx    # 0x1d8110
movb $0x0, %al
callq 0x5b9c0
movq 0x50d0(%rsp), %rdi
leaq 0x4820(%rsp), %r8
leaq 0x15f82e(%rip), %rsi    # 0x1d2034
leaq 0x16592a(%rip), %rdx    # 0x1d8137
movl $0x546, %ecx            # imm = 0x546
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x50c4(%rsp)
jmp 0x73013
movq 0x50b8(%rsp), %rax
movsd 0x50a8(%rsp), %xmm0
movq 0x5098(%rsp), %rdi
movq 0x50d0(%rsp), %rdx
leaq 0x5060(%rsp), %rsi
callq *%rax
cmpl $0x1, %eax
jne 0x728b8
leaq 0x4020(%rsp), %rdi
movq 0x50d0(%rsp), %rcx
leaq 0x15fb68(%rip), %rsi    # 0x1d23d8
leaq 0x1658d3(%rip), %rdx    # 0x1d814a
movb $0x0, %al
callq 0x5b9c0
movq 0x50d0(%rsp), %rdi
leaq 0x4020(%rsp), %r8
leaq 0x15f79f(%rip), %rsi    # 0x1d2034
leaq 0x16589b(%rip), %rdx    # 0x1d8137
movl $0x548, %ecx            # imm = 0x548
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x50c4(%rsp)
jmp 0x73013
movq 0x5078(%rsp), %rax
movl (%rax), %ecx
addl $0x2, %ecx
movq 0x5078(%rsp), %rax
movl %ecx, (%rax)
movsd 0x5058(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x728ef
xorps %xmm0, %xmm0
ucomisd 0x5060(%rsp), %xmm0
ja 0x72917
xorps %xmm0, %xmm0
ucomisd 0x5058(%rsp), %xmm0
jbe 0x72f5b
movsd 0x5060(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x72f5b
movsd 0x50b0(%rsp), %xmm0
movsd %xmm0, 0x5030(%rsp)
movsd 0x50a8(%rsp), %xmm0
movsd %xmm0, 0x5038(%rsp)
movsd 0x162c75(%rip), %xmm0   # 0x1d55b8
movsd %xmm0, 0x5068(%rsp)
movl $0x1, 0x5074(%rsp)
movl 0x5074(%rsp), %eax
cmpl 0x5070(%rsp), %eax
jg 0x72eed
movsd 0x5030(%rsp), %xmm1
addsd 0x5038(%rsp), %xmm1
movsd 0x160303(%rip), %xmm0   # 0x1d2c88
mulsd %xmm1, %xmm0
movsd %xmm0, 0x5028(%rsp)
movq 0x50b8(%rsp), %rax
movsd 0x5028(%rsp), %xmm0
movq 0x5098(%rsp), %rdi
movq 0x50d0(%rsp), %rdx
leaq 0x5050(%rsp), %rsi
callq *%rax
cmpl $0x1, %eax
jne 0x72a21
leaq 0x3820(%rsp), %rdi
movq 0x50d0(%rsp), %rcx
leaq 0x15f9ff(%rip), %rsi    # 0x1d23d8
leaq 0x165791(%rip), %rdx    # 0x1d8171
movb $0x0, %al
callq 0x5b9c0
movq 0x50d0(%rsp), %rdi
leaq 0x3820(%rsp), %r8
leaq 0x15f636(%rip), %rsi    # 0x1d2034
leaq 0x165732(%rip), %rdx    # 0x1d8137
movl $0x553, %ecx            # imm = 0x553
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x50c4(%rsp)
jmp 0x73013
movq 0x5078(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movq 0x5078(%rsp), %rax
movl %ecx, (%rax)
movsd 0x5050(%rsp), %xmm0
movsd 0x5050(%rsp), %xmm2
movsd 0x5058(%rsp), %xmm1
mulsd 0x5060(%rsp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x82e0
movsd %xmm0, 0x5040(%rsp)
movsd 0x5040(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x72ac2
jp 0x72ac2
movsd 0x5068(%rsp), %xmm0
movq 0x5080(%rsp), %rax
movsd %xmm0, (%rax)
movl $0x0, 0x50c4(%rsp)
jmp 0x73013
movsd 0x5028(%rsp), %xmm1
movsd 0x5028(%rsp), %xmm0
subsd 0x5030(%rsp), %xmm0
movsd 0x5058(%rsp), %xmm3
movsd 0x5060(%rsp), %xmm2
movsd 0x15f751(%rip), %xmm5   # 0x1d2248
movsd 0x15fcd1(%rip), %xmm4   # 0x1d27d0
cmplesd %xmm3, %xmm2
movaps %xmm2, %xmm3
andpd %xmm5, %xmm3
andnpd %xmm4, %xmm2
orpd %xmm3, %xmm2
mulsd 0x5050(%rsp), %xmm2
divsd 0x5040(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x5020(%rsp)
movsd 0x5020(%rsp), %xmm1
subsd 0x5068(%rsp), %xmm1
movaps 0x15f6e1(%rip), %xmm0   # 0x1d2230
pand %xmm0, %xmm1
movsd 0x50a0(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x72b87
movsd 0x5068(%rsp), %xmm0
movq 0x5080(%rsp), %rax
movsd %xmm0, (%rax)
movl $0x0, 0x50c4(%rsp)
jmp 0x73013
movsd 0x5020(%rsp), %xmm0
movsd %xmm0, 0x5068(%rsp)
movq 0x50b8(%rsp), %rax
movsd 0x5068(%rsp), %xmm0
movq 0x5098(%rsp), %rdi
movq 0x50d0(%rsp), %rdx
leaq 0x5048(%rsp), %rsi
callq *%rax
cmpl $0x1, %eax
jne 0x72c28
leaq 0x3020(%rsp), %rdi
movq 0x50d0(%rsp), %rcx
leaq 0x15f7f8(%rip), %rsi    # 0x1d23d8
leaq 0x1655b1(%rip), %rdx    # 0x1d8198
movb $0x0, %al
callq 0x5b9c0
movq 0x50d0(%rsp), %rdi
leaq 0x3020(%rsp), %r8
leaq 0x15f42f(%rip), %rsi    # 0x1d2034
leaq 0x16552b(%rip), %rdx    # 0x1d8137
movl $0x562, %ecx            # imm = 0x562
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x50c4(%rsp)
jmp 0x73013
movq 0x5078(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movq 0x5078(%rsp), %rax
movl %ecx, (%rax)
movsd 0x5048(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x72c78
jp 0x72c78
movsd 0x5068(%rsp), %xmm0
movq 0x5080(%rsp), %rax
movsd %xmm0, (%rax)
movl $0x0, 0x50c4(%rsp)
jmp 0x73013
movsd 0x5048(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x72ca6
movsd 0x5050(%rsp), %xmm0
movaps 0x15f596(%rip), %xmm1   # 0x1d2230
pand %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
jmp 0x72cd7
movsd 0x5050(%rsp), %xmm0
movaps 0x15f57a(%rip), %xmm1   # 0x1d2230
pand %xmm1, %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x18(%rsp), %xmm0
ucomisd 0x5050(%rsp), %xmm0
jne 0x72cec
jp 0x72cec
jmp 0x72d39
movsd 0x5028(%rsp), %xmm0
movsd %xmm0, 0x5030(%rsp)
movsd 0x5050(%rsp), %xmm0
movsd %xmm0, 0x5058(%rsp)
movsd 0x5068(%rsp), %xmm0
movsd %xmm0, 0x5038(%rsp)
movsd 0x5048(%rsp), %xmm0
movsd %xmm0, 0x5060(%rsp)
jmp 0x72e84
movsd 0x5048(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x72d67
movsd 0x5058(%rsp), %xmm0
movaps 0x15f4d5(%rip), %xmm1   # 0x1d2230
pand %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
jmp 0x72d98
movsd 0x5058(%rsp), %xmm0
movaps 0x15f4b9(%rip), %xmm1   # 0x1d2230
pand %xmm1, %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%rsp), %xmm0
ucomisd 0x5058(%rsp), %xmm0
jne 0x72dad
jp 0x72dad
jmp 0x72dd6
movsd 0x5068(%rsp), %xmm0
movsd %xmm0, 0x5038(%rsp)
movsd 0x5048(%rsp), %xmm0
movsd %xmm0, 0x5060(%rsp)
jmp 0x72e82
movsd 0x5048(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x72e04
movsd 0x5060(%rsp), %xmm0
movaps 0x15f438(%rip), %xmm1   # 0x1d2230
pand %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x72e35
movsd 0x5060(%rsp), %xmm0
movaps 0x15f41c(%rip), %xmm1   # 0x1d2230
pand %xmm1, %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
ucomisd 0x5060(%rsp), %xmm0
jne 0x72e4a
jp 0x72e4a
jmp 0x72e70
movsd 0x5068(%rsp), %xmm0
movsd %xmm0, 0x5030(%rsp)
movsd 0x5048(%rsp), %xmm0
movsd %xmm0, 0x5058(%rsp)
jmp 0x72e80
movl $0x1, 0x50c4(%rsp)
jmp 0x73013
jmp 0x72e82
jmp 0x72e84
movsd 0x5038(%rsp), %xmm1
subsd 0x5030(%rsp), %xmm1
movaps 0x15f393(%rip), %xmm0   # 0x1d2230
pand %xmm0, %xmm1
movsd 0x50a0(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x72ed5
movsd 0x5068(%rsp), %xmm0
movq 0x5080(%rsp), %rax
movsd %xmm0, (%rax)
movl $0x0, 0x50c4(%rsp)
jmp 0x73013
jmp 0x72ed7
movl 0x5074(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5074(%rsp)
jmp 0x72957
leaq 0x2820(%rsp), %rdi
leaq 0x163343(%rip), %rsi    # 0x1d623f
movb $0x0, %al
callq 0x5b9c0
leaq 0x2020(%rsp), %rdi
leaq 0x2820(%rsp), %rdx
leaq 0x15f653(%rip), %rsi    # 0x1d256d
movb $0x0, %al
callq 0x5b9c0
movq 0x50d0(%rsp), %rdi
leaq 0x2020(%rsp), %r8
leaq 0x15f0fc(%rip), %rsi    # 0x1d2034
leaq 0x1651f8(%rip), %rdx    # 0x1d8137
movl $0x57f, %ecx            # imm = 0x57F
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x50c4(%rsp)
jmp 0x73013
movsd 0x5058(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x72f84
jp 0x72f84
cvttsd2si 0x50b0(%rsp), %eax
movl %eax, 0x50c4(%rsp)
jmp 0x73013
movsd 0x5060(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x72faa
jp 0x72faa
cvttsd2si 0x50a8(%rsp), %eax
movl %eax, 0x50c4(%rsp)
jmp 0x73013
leaq 0x1820(%rsp), %rdi
leaq 0x1632a7(%rip), %rsi    # 0x1d6260
movb $0x0, %al
callq 0x5b9c0
leaq 0x1020(%rsp), %rdi
leaq 0x1820(%rsp), %rdx
leaq 0x15f596(%rip), %rsi    # 0x1d256d
movb $0x0, %al
callq 0x5b9c0
movq 0x50d0(%rsp), %rdi
leaq 0x1020(%rsp), %r8
leaq 0x15f03f(%rip), %rsi    # 0x1d2034
leaq 0x16513b(%rip), %rdx    # 0x1d8137
movl $0x585, %ecx            # imm = 0x585
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x50c4(%rsp)
movl 0x50c4(%rsp), %eax
addq $0x50c8, %rsp           # imm = 0x50C8
retq
nopw %cs:(%rax,%rax)