#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 */
typedef int /*<<< orphan*/ complex;

/* Variables and functions */
int /*<<< orphan*/ compresp(int, double *, int, int /*<<< orphan*/ *, int,
                            int /*<<< orphan*/ *, double, double **, float **);
double *double_alloc(int);
int /*<<< orphan*/ firstparams(double, double, int, int /*<<< orphan*/ *, int,
                               int /*<<< orphan*/ *, double, double *, double *,
                               double *);
float *float_alloc(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(void *);
scalar_t__ isfinite(double);
int /*<<< orphan*/ lsqenp_(int *, int *, int *, float *, float *, float *,
                           int *, int *, int *, int *, int *, int *);
double pow(double, double);
int /*<<< orphan*/ printf(char *, double, double, double, ...);
int /*<<< orphan*/ readpzfile(char *, int *, int /*<<< orphan*/ **, int *,
                              int /*<<< orphan*/ **, double *, int *);
double rmsestimates(double, double, double, int, double *, double *);
int /*<<< orphan*/ stderr;
void plzr2resp(char *pzfilename, double tolerance, double fl, double fh, int nf,
               double fref, double *gain_factor, double *fc, double *h,
               double *s2, int *ierror) {
  int i, nz, np, mp, mv, ip, ib[3], idvt, icon, iquit, iprnt;
  double *f, *y, sg;
  float *yl, *x, *b;
  complex *zr, *pl;
  *ierror = 0;
  mp = 3;
  mv = 1;
  ip = 1;
  ib[0] = 1;
  ib[1] = 0;
  ib[2] = 0;
  idvt = 1;
  icon = 1;
  iquit = 0;
  iprnt = 0;
  f = double_alloc(nf);
  x = float_alloc(nf);
  for (i = 0; i < nf; i++) {
    f[i] = pow(fh / fl, (double)i / (double)(nf - 1)) * fl;
    x[i] = (float)f[i];
  }
  readpzfile(pzfilename, &nz, &zr, &np, &pl, &sg, ierror);
  if (*ierror == 99)
    return;
  compresp(nf, f, nz, zr, np, pl, sg, &y, &yl);
  firstparams(fref, fl, nz, zr, np, pl, sg, gain_factor, fc, h);
  if (isfinite(*gain_factor) && isfinite(*fc) && isfinite(*h))
    printf(" 1st approx. GF, fc and h =    %.7e  %.7e  %.7f\n", *gain_factor,
           *fc, *h);
  else {
    fprintf(
        stderr,
        "WARNING (make_resp_lookup_table): Non-Finite a priori GF, fc or h\n");
    fprintf(stderr, "          pz : %s ; GF=%e ; fc=%e ; h=%e\n", pzfilename,
            *gain_factor, *fc, *h);
    *ierror = 1;
    return;
  }
  b = float_alloc(3);
  b[0] = (float)*gain_factor;
  b[1] = (float)*fc;
  b[2] = (float)*h;
  lsqenp_(&nf, &mp, &mv, yl, x, b, &ip, ib, &idvt, &icon, &iquit, &iprnt);
  *gain_factor = (double)b[0];
  *fc = (double)b[1];
  *h = (double)b[2];
  *s2 = rmsestimates(*gain_factor, *fc, *h, nf, f, y);
  printf(" lsq :  GF, fc, h and rms =    %.7e  %.7e  %.7f      %.7e\n",
         *gain_factor, *fc, *h, *s2);
  if (*s2 >= tolerance) {
    fprintf(stderr, "%s misfit too large (=%f)\n", pzfilename, *s2);
    *ierror = 1;
  }
  free((void *)b);
  free((void *)zr);
  free((void *)pl);
  free((void *)f);
  free((void *)y);
  free((void *)yl);
  free((void *)x);
}


x86 assembly (clang, -O0):
<plzr2resp>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0xf8,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
movsd  %xmm2,-0x38(%rbp)
mov    %esi,-0x3c(%rbp)
movsd  %xmm3,-0x48(%rbp)
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x58(%rbp)
mov    %r8,-0x60(%rbp)
mov    %r9,-0x68(%rbp)
mov    0x10(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x3,-0x78(%rbp)
movl   $0x1,-0x7c(%rbp)
movl   $0x1,-0x80(%rbp)
movl   $0x1,-0x8c(%rbp)
movl   $0x0,-0x88(%rbp)
movl   $0x0,-0x84(%rbp)
movl   $0x1,-0x90(%rbp)
movl   $0x1,-0x94(%rbp)
movl   $0x0,-0x98(%rbp)
movl   $0x0,-0x9c(%rbp)
mov    -0x3c(%rbp),%edi
call   10b0 <double_alloc@plt>
mov    %rax,-0xa8(%rbp)
mov    -0x3c(%rbp),%edi
call   1040 <float_alloc@plt>
mov    %rax,-0xc8(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    12fe <plzr2resp+0x13e>
movsd  -0x38(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
cvtsi2sdl -0x6c(%rbp),%xmm1
mov    -0x3c(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm2
divsd  %xmm2,%xmm1
call   10c0 <pow@plt>
mulsd  -0x30(%rbp),%xmm0
mov    -0xa8(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xa8(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0xc8(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    1289 <plzr2resp+0xc9>
mov    -0x20(%rbp),%rdi
mov    0x10(%rbp),%rax
lea    -0x70(%rbp),%rsi
lea    -0xd8(%rbp),%rdx
lea    -0x74(%rbp),%rcx
lea    -0xe0(%rbp),%r8
lea    -0xb8(%rbp),%r9
mov    %rax,(%rsp)
call   1050 <readpzfile@plt>
mov    0x10(%rbp),%rax
cmpl   $0x63,(%rax)
jne    133e <plzr2resp+0x17e>
jmp    1686 <plzr2resp+0x4c6>
mov    -0x3c(%rbp),%edi
mov    -0xa8(%rbp),%rsi
mov    -0x70(%rbp),%edx
mov    -0xd8(%rbp),%rcx
mov    -0x74(%rbp),%r8d
mov    -0xe0(%rbp),%r9
movsd  -0xb8(%rbp),%xmm0
ff
lea    -0xb0(%rbp),%r10
lea    -0xc0(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   10a0 <compresp@plt>
movsd  -0x48(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mov    -0x70(%rbp),%edi
mov    -0xd8(%rbp),%rsi
mov    -0x74(%rbp),%edx
mov    -0xe0(%rbp),%rcx
movsd  -0xb8(%rbp),%xmm2
ff
mov    -0x50(%rbp),%r8
mov    -0x58(%rbp),%r9
mov    -0x60(%rbp),%rax
mov    %rax,(%rsp)
call   10e0 <firstparams@plt>
mov    -0x50(%rbp),%rax
movsd  (%rax),%xmm0
call   1090 <isfinite@plt>
cmp    $0x0,%rax
je     142c <plzr2resp+0x26c>
mov    -0x58(%rbp),%rax
movsd  (%rax),%xmm0
call   1090 <isfinite@plt>
cmp    $0x0,%rax
je     142c <plzr2resp+0x26c>
mov    -0x60(%rbp),%rax
movsd  (%rax),%xmm0
call   1090 <isfinite@plt>
cmp    $0x0,%rax
je     142c <plzr2resp+0x26c>
mov    -0x50(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x58(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x60(%rbp),%rax
movsd  (%rax),%xmm2
lea    0xbe0(%rip),%rdi
mov    $0x3,%al
call   1060 <printf@plt>
jmp    1485 <plzr2resp+0x2c5>
mov    0x2bad(%rip),%rax
mov    (%rax),%edi
lea    0xbf5(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2b96(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
mov    -0x50(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x58(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x60(%rbp),%rax
movsd  (%rax),%xmm2
lea    0xc05(%rip),%rsi
mov    $0x3,%al
call   1070 <fprintf@plt>
mov    0x10(%rbp),%rax
movl   $0x1,(%rax)
jmp    1686 <plzr2resp+0x4c6>
mov    $0x3,%edi
call   1040 <float_alloc@plt>
mov    %rax,-0xd0(%rbp)
mov    -0x50(%rbp),%rax
movsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0xd0(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x58(%rbp),%rax
movsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0xd0(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x60(%rbp),%rax
movsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0xd0(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0xc0(%rbp),%rcx
mov    -0xc8(%rbp),%r8
mov    -0xd0(%rbp),%r9
lea    -0x8c(%rbp),%r14
lea    -0x3c(%rbp),%rdi
lea    -0x78(%rbp),%rsi
lea    -0x7c(%rbp),%rdx
lea    -0x80(%rbp),%r15
lea    -0x90(%rbp),%rbx
lea    -0x94(%rbp),%r11
lea    -0x98(%rbp),%r10
lea    -0x9c(%rbp),%rax
mov    %r15,(%rsp)
mov    %r14,0x8(%rsp)
mov    %rbx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %rax,0x28(%rsp)
call   10d0 <lsqenp_@plt>
mov    -0xd0(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x50(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0xd0(%rbp),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x58(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0xd0(%rbp),%rax
movss  0x8(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x60(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x50(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x58(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x60(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x3c(%rbp),%edi
mov    -0xa8(%rbp),%rsi
mov    -0xb0(%rbp),%rdx
call   1080 <rmsestimates@plt>
mov    -0x68(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x50(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x58(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x60(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x68(%rbp),%rax
movsd  (%rax),%xmm3
lea    0xab3(%rip),%rdi
mov    $0x4,%al
call   1060 <printf@plt>
mov    -0x68(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd -0x28(%rbp),%xmm0
jb     1632 <plzr2resp+0x472>
mov    0x29d4(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
mov    -0x68(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xab8(%rip),%rsi
mov    $0x1,%al
call   1070 <fprintf@plt>
mov    0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0xd0(%rbp),%rdi
call   1030 <free@plt>
mov    -0xd8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xe0(%rbp),%rdi
call   1030 <free@plt>
mov    -0xa8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xb0(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc0(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc8(%rbp),%rdi
call   1030 <free@plt>
add    $0xf8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<plzr2resp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
mov    %r9,0x98(%rsp)
mov    %r8,0x68(%rsp)
mov    %rcx,0x60(%rsp)
mov    %rdx,0x20(%rsp)
movsd  %xmm3,0xa0(%rsp)
mov    %esi,%r14d
movsd  %xmm2,(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x90(%rsp)
mov    %rdi,%r13
mov    0xf0(%rsp),%r12
mov    %esi,0x1c(%rsp)
movl   $0x0,(%r12)
movl   $0x3,0x5c(%rsp)
movl   $0x1,0x58(%rsp)
movl   $0x1,0x54(%rsp)
movq   $0x1,0xac(%rsp)
movl   $0x0,0xb4(%rsp)
movl   $0x1,0x50(%rsp)
movl   $0x1,0x4c(%rsp)
movl   $0x0,0x48(%rsp)
movl   $0x0,0x44(%rsp)
mov    %esi,%edi
call   10b0 <double_alloc@plt>
mov    %rax,%rbx
mov    %r14d,%edi
call   1040 <float_alloc@plt>
mov    %rax,%r15
test   %r14d,%r14d
mov    %r13,0x28(%rsp)
jle    138a <plzr2resp+0x1ca>
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
lea    -0x1(%r14),%eax
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
mov    %r14d,%r13d
cmp    $0x1,%r14d
jne    12bf <plzr2resp+0xff>
movapd %xmm1,%xmm0
xor    %ebp,%ebp
jmp    135a <plzr2resp+0x19a>
mov    %r13d,%r12d
and    $0xfffffffe,%r12d
xor    %ebp,%ebp
movsd  %xmm1,(%rsp)
movsd  %xmm2,0x70(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
divsd  %xmm2,%xmm1
movsd  (%rsp),%xmm0
call   10c0 <pow@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r15,%rbp,4)
lea    0x1(%rbp),%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
divsd  0x70(%rsp),%xmm1
movsd  (%rsp),%xmm0
call   10c0 <pow@plt>
movsd  0x70(%rsp),%xmm2
mulsd  0x8(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
movsd  %xmm0,0x8(%rbx,%rbp,8)
movss  %xmm1,0x4(%r15,%rbp,4)
add    $0x2,%rbp
cmp    %r12,%rbp
jne    12e0 <plzr2resp+0x120>
movsd  (%rsp),%xmm0
mov    0xf0(%rsp),%r12
test   $0x1,%r13b
mov    0x28(%rsp),%r13
je     138a <plzr2resp+0x1ca>
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
divsd  %xmm2,%xmm1
call   10c0 <pow@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r15,%rbp,4)
sub    $0x8,%rsp
lea    0x20(%rsp),%rsi
lea    0x40(%rsp),%rdx
lea    0x1c(%rsp),%rcx
lea    0x38(%rsp),%r8
lea    0x88(%rsp),%r9
mov    %r13,%rdi
push   %r12
call   1050 <readpzfile@plt>
add    $0x10,%rsp
cmpl   $0x63,(%r12)
je     167f <plzr2resp+0x4bf>
mov    0x18(%rsp),%edx
mov    0x38(%rsp),%rcx
mov    0x14(%rsp),%r8d
mov    0x30(%rsp),%r9
movsd  0x80(%rsp),%xmm0
lea    0x78(%rsp),%rax
lea    0x88(%rsp),%rbp
mov    %r14d,%edi
mov    %rbx,%rsi
push   %rax
push   %rbp
call   10a0 <compresp@plt>
add    $0x10,%rsp
mov    0x18(%rsp),%edi
mov    0x38(%rsp),%rsi
mov    0x14(%rsp),%edx
mov    0x30(%rsp),%rcx
movsd  0x80(%rsp),%xmm2
sub    $0x8,%rsp
movsd  0xa8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    0x28(%rsp),%r14
mov    %r14,%r8
mov    0x68(%rsp),%r13
mov    %r13,%r9
mov    0x70(%rsp),%rbp
push   %rbp
call   10e0 <firstparams@plt>
add    $0x10,%rsp
movsd  (%r14),%xmm0
mov    %r13,%r14
call   1090 <isfinite@plt>
test   %rax,%rax
je     1638 <plzr2resp+0x478>
movsd  (%r14),%xmm0
call   1090 <isfinite@plt>
test   %rax,%rax
je     1638 <plzr2resp+0x478>
movsd  0x0(%rbp),%xmm0
call   1090 <isfinite@plt>
test   %rax,%rax
je     1638 <plzr2resp+0x478>
mov    0x20(%rsp),%r12
movsd  (%r12),%xmm0
movsd  (%r14),%xmm1
movsd  0x0(%rbp),%xmm2
lea    0xb5e(%rip),%rdi
mov    $0x3,%al
call   1060 <printf@plt>
mov    $0x3,%edi
call   1040 <float_alloc@plt>
mov    %rax,%r13
movsd  (%r12),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rax)
movsd  (%r14),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
movsd  0x0(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
mov    0x78(%rsp),%rcx
lea    0x44(%rsp),%rax
lea    0x48(%rsp),%r10
lea    0x4c(%rsp),%r11
mov    %r14,%rbp
lea    0x50(%rsp),%r14
lea    0x1c(%rsp),%rdi
lea    0x5c(%rsp),%rsi
lea    0x58(%rsp),%rdx
mov    %r15,%r8
mov    %r13,%r9
push   %rax
push   %r10
push   %r11
push   %r14
lea    0xcc(%rsp),%rax
push   %rax
lea    0x7c(%rsp),%rax
push   %rax
call   10d0 <lsqenp_@plt>
add    $0x30,%rsp
movss  0x0(%r13),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,(%r12)
movss  0x4(%r13),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbp,%rax
movsd  %xmm0,0x0(%rbp)
movss  0x8(%r13),%xmm0
xorps  %xmm2,%xmm2
cvtss2sd %xmm0,%xmm2
mov    0x68(%rsp),%rbp
movsd  %xmm2,0x0(%rbp)
movsd  (%r12),%xmm0
movsd  (%rax),%xmm1
mov    0x1c(%rsp),%edi
mov    0x88(%rsp),%rdx
mov    %rbx,%rsi
call   1080 <rmsestimates@plt>
movaps %xmm0,%xmm3
mov    0x98(%rsp),%r14
movsd  %xmm0,(%r14)
movsd  (%r12),%xmm0
mov    0x60(%rsp),%rax
movsd  (%rax),%xmm1
movsd  0x0(%rbp),%xmm2
lea    0xaec(%rip),%rdi
mov    $0x4,%al
call   1060 <printf@plt>
movsd  (%r14),%xmm0
ucomisd 0x90(%rsp),%xmm0
jb     15f3 <plzr2resp+0x433>
mov    0x2a10(%rip),%rax
mov    (%rax),%edi
lea    0xb00(%rip),%rsi
mov    0x28(%rsp),%rdx
mov    $0x1,%al
call   1070 <fprintf@plt>
mov    0xf0(%rsp),%rax
movl   $0x1,(%rax)
mov    %r13,%rdi
call   1030 <free@plt>
mov    0x38(%rsp),%rdi
call   1030 <free@plt>
mov    0x30(%rsp),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x88(%rsp),%rdi
call   1030 <free@plt>
mov    0x78(%rsp),%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
jmp    167f <plzr2resp+0x4bf>
mov    0x29a1(%rip),%rbx
mov    (%rbx),%edi
lea    0x9e9(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%rbx),%edi
mov    0x20(%rsp),%rax
movsd  (%rax),%xmm0
movsd  (%r14),%xmm1
movsd  0x0(%rbp),%xmm2
lea    0xa09(%rip),%rsi
mov    0x28(%rsp),%rdx
mov    $0x3,%al
call   1070 <fprintf@plt>
movl   $0x1,(%r12)
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [49 x i8] c" 1st approx. GF, fc and h = %.7e %.7e %.7f\0A\00"
@stderr = global i32 0
@.str.1 = [67 x i8] c"WARNING (make_resp_lookup_table): Non-Finite a priori GF, fc or h\0A\00"
@.str.2 = [42 x i8] c" pz : %s ; GF=%e ; fc=%e ; h=%e\0A\00"
@.str.3 = [59 x i8] c" lsq : GF, fc, h and rms = %.7e %.7e %.7f %.7e\0A\00"
@.str.4 = [27 x i8] c"%s misfit too large (=%f)\0A\00"
define void @plzr2resp(i8* %0, double %1, double %2, double %3, i32 %4, double %5, double* %6, double* %7, double* %8, double* %9, i32* %10) {
%12 = alloca i8*
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca i32
%17 = alloca double
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca double*
%22 = alloca i32*
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca [3 x i32]
%30 = alloca i32
%31 = alloca i32
%32 = alloca i32
%33 = alloca i32
%34 = alloca double*
%35 = alloca double*
%36 = alloca double
%37 = alloca float*
%38 = alloca float*
%39 = alloca float*
%40 = alloca i32*
%41 = alloca i32*
store i8* %0, i8** %12
store double %1, double* %13
store double %2, double* %14
store double %3, double* %15
store i32 %4, i32* %16
store double %5, double* %17
store double* %6, double** %18
store double* %7, double** %19
store double* %8, double** %20
store double* %9, double** %21
store i32* %10, i32** %22
%42 = load i32*, i32** %22
store i32 0, i32* %42
store i32 3, i32* %26
store i32 1, i32* %27
store i32 1, i32* %28
%43 = getelementptr inbounds [3 x i32], [3 x i32]* %29, i64 0, i64 0
store i32 1, i32* %43
%44 = getelementptr inbounds [3 x i32], [3 x i32]* %29, i64 0, i64 1
store i32 0, i32* %44
%45 = getelementptr inbounds [3 x i32], [3 x i32]* %29, i64 0, i64 2
store i32 0, i32* %45
store i32 1, i32* %30
store i32 1, i32* %31
store i32 0, i32* %32
store i32 0, i32* %33
%46 = load i32, i32* %16
%47 = call double* @double_alloc(i32 %46)
store double* %47, double** %34
%48 = load i32, i32* %16
%49 = call float* @float_alloc(i32 %48)
store float* %49, float** %38
store i32 0, i32* %23
br label %50
50: ; preds = %81, %11
%51 = load i32, i32* %23
%52 = load i32, i32* %16
%53 = icmp slt i32 %51, %52
br i1 %53, label %54, label %84
54: ; preds = %50
%55 = load double, double* %15
%56 = load double, double* %14
%57 = fdiv double %55, %56
%58 = load i32, i32* %23
%59 = sitofp i32 %58 to double
%60 = load i32, i32* %16
%61 = sub nsw i32 %60, 1
%62 = sitofp i32 %61 to double
%63 = fdiv double %59, %62
%64 = call double @pow(double %57, double %63)
%65 = load double, double* %14
%66 = fmul double %64, %65
%67 = load double*, double** %34
%68 = load i32, i32* %23
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds double, double* %67, i64 %69
store double %66, double* %70
%71 = load double*, double** %34
%72 = load i32, i32* %23
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds double, double* %71, i64 %73
%75 = load double, double* %74
%76 = fptrunc double %75 to float
%77 = load float*, float** %38
%78 = load i32, i32* %23
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds float, float* %77, i64 %79
store float %76, float* %80
br label %81
81: ; preds = %54
%82 = load i32, i32* %23
%83 = add nsw i32 %82, 1
store i32 %83, i32* %23
br label %50
84: ; preds = %50
%85 = load i8*, i8** %12
%86 = load i32*, i32** %22
%87 = call i32 @readpzfile(i8* %85, i32* %24, i32** %40, i32* %25, i32** %41, double* %36, i32* %86)
%88 = load i32*, i32** %22
%89 = load i32, i32* %88
%90 = icmp eq i32 %89, 99
br i1 %90, label %91, label %92
91: ; preds = %84
br label %237
92: ; preds = %84
%93 = load i32, i32* %16
%94 = load double*, double** %34
%95 = load i32, i32* %24
%96 = load i32*, i32** %40
%97 = load i32, i32* %25
%98 = load i32*, i32** %41
%99 = load double, double* %36
%100 = call i32 @compresp(i32 %93, double* %94, i32 %95, i32* %96, i32 %97, i32* %98, double %99, double** %35, float** %37)
%101 = load double, double* %17
%102 = load double, double* %14
%103 = load i32, i32* %24
%104 = load i32*, i32** %40
%105 = load i32, i32* %25
%106 = load i32*, i32** %41
%107 = load double, double* %36
%108 = load double*, double** %18
%109 = load double*, double** %19
%110 = load double*, double** %20
%111 = call i32 @firstparams(double %101, double %102, i32 %103, i32* %104, i32 %105, i32* %106, double %107, double* %108, double* %109, double* %110)
%112 = load double*, double** %18
%113 = load double, double* %112
%114 = call i64 @isfinite(double %113)
%115 = icmp ne i64 %114, 0
br i1 %115, label %116, label %134
116: ; preds = %92
%117 = load double*, double** %19
%118 = load double, double* %117
%119 = call i64 @isfinite(double %118)
%120 = icmp ne i64 %119, 0
br i1 %120, label %121, label %134
121: ; preds = %116
%122 = load double*, double** %20
%123 = load double, double* %122
%124 = call i64 @isfinite(double %123)
%125 = icmp ne i64 %124, 0
br i1 %125, label %126, label %134
126: ; preds = %121
%127 = load double*, double** %18
%128 = load double, double* %127
%129 = load double*, double** %19
%130 = load double, double* %129
%131 = load double*, double** %20
%132 = load double, double* %131
%133 = call i32 (i8*, double, double, double, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), double %128, double %130, double %132)
br label %147
134: ; preds = %121, %116, %92
%135 = load i32, i32* @stderr
%136 = call i32 (i32, i8*, ...) @fprintf(i32 %135, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%137 = load i32, i32* @stderr
%138 = load i8*, i8** %12
%139 = load double*, double** %18
%140 = load double, double* %139
%141 = load double*, double** %19
%142 = load double, double* %141
%143 = load double*, double** %20
%144 = load double, double* %143
%145 = call i32 (i32, i8*, ...) @fprintf(i32 %137, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* %138, double %140, double %142, double %144)
%146 = load i32*, i32** %22
store i32 1, i32* %146
br label %237
147: ; preds = %126
%148 = call float* @float_alloc(i32 3)
store float* %148, float** %39
%149 = load double*, double** %18
%150 = load double, double* %149
%151 = fptrunc double %150 to float
%152 = load float*, float** %39
%153 = getelementptr inbounds float, float* %152, i64 0
store float %151, float* %153
%154 = load double*, double** %19
%155 = load double, double* %154
%156 = fptrunc double %155 to float
%157 = load float*, float** %39
%158 = getelementptr inbounds float, float* %157, i64 1
store float %156, float* %158
%159 = load double*, double** %20
%160 = load double, double* %159
%161 = fptrunc double %160 to float
%162 = load float*, float** %39
%163 = getelementptr inbounds float, float* %162, i64 2
store float %161, float* %163
%164 = load float*, float** %37
%165 = load float*, float** %38
%166 = load float*, float** %39
%167 = getelementptr inbounds [3 x i32], [3 x i32]* %29, i64 0, i64 0
%168 = call i32 @lsqenp_(i32* %16, i32* %26, i32* %27, float* %164, float* %165, float* %166, i32* %28, i32* %167, i32* %30, i32* %31, i32* %32, i32* %33)
%169 = load float*, float** %39
%170 = getelementptr inbounds float, float* %169, i64 0
%171 = load float, float* %170
%172 = fpext float %171 to double
%173 = load double*, double** %18
store double %172, double* %173
%174 = load float*, float** %39
%175 = getelementptr inbounds float, float* %174, i64 1
%176 = load float, float* %175
%177 = fpext float %176 to double
%178 = load double*, double** %19
store double %177, double* %178
%179 = load float*, float** %39
%180 = getelementptr inbounds float, float* %179, i64 2
%181 = load float, float* %180
%182 = fpext float %181 to double
%183 = load double*, double** %20
store double %182, double* %183
%184 = load double*, double** %18
%185 = load double, double* %184
%186 = load double*, double** %19
%187 = load double, double* %186
%188 = load double*, double** %20
%189 = load double, double* %188
%190 = load i32, i32* %16
%191 = load double*, double** %34
%192 = load double*, double** %35
%193 = call double @rmsestimates(double %185, double %187, double %189, i32 %190, double* %191, double* %192)
%194 = load double*, double** %21
store double %193, double* %194
%195 = load double*, double** %18
%196 = load double, double* %195
%197 = load double*, double** %19
%198 = load double, double* %197
%199 = load double*, double** %20
%200 = load double, double* %199
%201 = load double*, double** %21
%202 = load double, double* %201
%203 = call i32 (i8*, double, double, double, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.3, i64 0, i64 0), double %196, double %198, double %200, double %202)
%204 = load double*, double** %21
%205 = load double, double* %204
%206 = load double, double* %13
%207 = fcmp oge double %205, %206
br i1 %207, label %208, label %215
208: ; preds = %147
%209 = load i32, i32* @stderr
%210 = load i8*, i8** %12
%211 = load double*, double** %21
%212 = load double, double* %211
%213 = call i32 (i32, i8*, ...) @fprintf(i32 %209, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8* %210, double %212)
%214 = load i32*, i32** %22
store i32 1, i32* %214
br label %215
215: ; preds = %208, %147
%216 = load float*, float** %39
%217 = bitcast float* %216 to i8*
%218 = call i32 @free(i8* %217)
%219 = load i32*, i32** %40
%220 = bitcast i32* %219 to i8*
%221 = call i32 @free(i8* %220)
%222 = load i32*, i32** %41
%223 = bitcast i32* %222 to i8*
%224 = call i32 @free(i8* %223)
%225 = load double*, double** %34
%226 = bitcast double* %225 to i8*
%227 = call i32 @free(i8* %226)
%228 = load double*, double** %35
%229 = bitcast double* %228 to i8*
%230 = call i32 @free(i8* %229)
%231 = load float*, float** %37
%232 = bitcast float* %231 to i8*
%233 = call i32 @free(i8* %232)
%234 = load float*, float** %38
%235 = bitcast float* %234 to i8*
%236 = call i32 @free(i8* %235)
br label %237
237: ; preds = %215, %134, %91
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c" 1st approx. GF, fc and h = %.7e %.7e %.7f\0A\00"
@stderr = global i32 0
@.str.1 = [67 x i8] c"WARNING (make_resp_lookup_table): Non-Finite a priori GF, fc or h\0A\00"
@.str.2 = [42 x i8] c" pz : %s ; GF=%e ; fc=%e ; h=%e\0A\00"
@.str.3 = [59 x i8] c" lsq : GF, fc, h and rms = %.7e %.7e %.7f %.7e\0A\00"
@.str.4 = [27 x i8] c"%s misfit too large (=%f)\0A\00"
define void @plzr2resp(i8* %0, double %1, double %2, double %3, i32 %4, double %5, double* %6, double* %7, double* %8, double* nocapture %9, i32* %10) {
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca [3 x i32]
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca double*
%24 = alloca double
%25 = alloca float*
%26 = alloca i32*
%27 = alloca i32*
store i32 %4, i32* %12
%28 = bitcast i32* %13 to i8*
%29 = bitcast i32* %14 to i8*
%30 = bitcast i32* %15 to i8*
%31 = bitcast i32* %16 to i8*
%32 = bitcast i32* %17 to i8*
%33 = bitcast [3 x i32]* %18 to i8*
%34 = bitcast i32* %19 to i8*
%35 = bitcast i32* %20 to i8*
%36 = bitcast i32* %21 to i8*
%37 = bitcast i32* %22 to i8*
%38 = bitcast double** %23 to i8*
%39 = bitcast double* %24 to i8*
%40 = bitcast float** %25 to i8*
%41 = bitcast i32** %26 to i8*
%42 = bitcast i32** %27 to i8*
store i32 0, i32* %10
store i32 3, i32* %15
store i32 1, i32* %16
store i32 1, i32* %17
%43 = getelementptr inbounds [3 x i32], [3 x i32]* %18, i64 0, i64 0
store i32 1, i32* %43
%44 = getelementptr inbounds [3 x i32], [3 x i32]* %18, i64 0, i64 1
store i32 0, i32* %44
%45 = getelementptr inbounds [3 x i32], [3 x i32]* %18, i64 0, i64 2
store i32 0, i32* %45
store i32 1, i32* %19
store i32 1, i32* %20
store i32 0, i32* %21
store i32 0, i32* %22
%46 = tail call double* @double_alloc(i32 %4)
%47 = tail call float* @float_alloc(i32 %4)
%48 = icmp sgt i32 %4, 0
br i1 %48, label %49, label %93
49: ; preds = %11
%50 = fdiv double %3, %2
%51 = add nsw i32 %4, -1
%52 = sitofp i32 %51 to double
%53 = zext i32 %4 to i64
%54 = and i64 %53, 1
%55 = icmp eq i32 %4, 1
br i1 %55, label %81, label %56
56: ; preds = %49
%57 = and i64 %53, 4294967294
br label %58
58: ; preds = %58, %56
%59 = phi i64 [ 0, %56 ], [ %78, %58 ]
%60 = phi i64 [ 0, %56 ], [ %79, %58 ]
%61 = trunc i64 %59 to i32
%62 = sitofp i32 %61 to double
%63 = fdiv double %62, %52
%64 = tail call double @pow(double %50, double %63)
%65 = fmul double %64, %2
%66 = getelementptr inbounds double, double* %46, i64 %59
store double %65, double* %66
%67 = fptrunc double %65 to float
%68 = getelementptr inbounds float, float* %47, i64 %59
store float %67, float* %68
%69 = or i64 %59, 1
%70 = trunc i64 %69 to i32
%71 = sitofp i32 %70 to double
%72 = fdiv double %71, %52
%73 = tail call double @pow(double %50, double %72)
%74 = fmul double %73, %2
%75 = getelementptr inbounds double, double* %46, i64 %69
store double %74, double* %75
%76 = fptrunc double %74 to float
%77 = getelementptr inbounds float, float* %47, i64 %69
store float %76, float* %77
%78 = add nuw nsw i64 %59, 2
%79 = add i64 %60, 2
%80 = icmp eq i64 %79, %57
br i1 %80, label %81, label %58
81: ; preds = %58, %49
%82 = phi i64 [ 0, %49 ], [ %78, %58 ]
%83 = icmp eq i64 %54, 0
br i1 %83, label %93, label %84
84: ; preds = %81
%85 = trunc i64 %82 to i32
%86 = sitofp i32 %85 to double
%87 = fdiv double %86, %52
%88 = tail call double @pow(double %50, double %87)
%89 = fmul double %88, %2
%90 = getelementptr inbounds double, double* %46, i64 %82
store double %89, double* %90
%91 = fptrunc double %89 to float
%92 = getelementptr inbounds float, float* %47, i64 %82
store float %91, float* %92
br label %93
93: ; preds = %84, %81, %11
%94 = call i32 @readpzfile(i8* %0, i32* %13, i32** %26, i32* %14, i32** %27, double* %24, i32* %10)
%95 = load i32, i32* %10
%96 = icmp eq i32 %95, 99
br i1 %96, label %184, label %97
97: ; preds = %93
%98 = load i32, i32* %13
%99 = load i32*, i32** %26
%100 = load i32, i32* %14
%101 = load i32*, i32** %27
%102 = load double, double* %24
%103 = call i32 @compresp(i32 %4, double* %46, i32 %98, i32* %99, i32 %100, i32* %101, double %102, double** %23, float** %25)
%104 = load i32, i32* %13
%105 = load i32*, i32** %26
%106 = load i32, i32* %14
%107 = load i32*, i32** %27
%108 = load double, double* %24
%109 = call i32 @firstparams(double %5, double %2, i32 %104, i32* %105, i32 %106, i32* %107, double %108, double* %6, double* %7, double* %8)
%110 = load double, double* %6
%111 = call i64 @isfinite(double %110)
%112 = icmp eq i64 %111, 0
br i1 %112, label %154, label %113
113: ; preds = %97
%114 = load double, double* %7
%115 = call i64 @isfinite(double %114)
%116 = icmp eq i64 %115, 0
br i1 %116, label %154, label %117
117: ; preds = %113
%118 = load double, double* %8
%119 = call i64 @isfinite(double %118)
%120 = icmp eq i64 %119, 0
br i1 %120, label %154, label %121
121: ; preds = %117
%122 = load double, double* %6
%123 = load double, double* %7
%124 = load double, double* %8
%125 = call i32 (i8*, double, double, double, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), double %122, double %123, double %124)
%126 = call float* @float_alloc(i32 3)
%127 = load double, double* %6
%128 = fptrunc double %127 to float
store float %128, float* %126
%129 = load double, double* %7
%130 = fptrunc double %129 to float
%131 = getelementptr inbounds float, float* %126, i64 1
store float %130, float* %131
%132 = load double, double* %8
%133 = fptrunc double %132 to float
%134 = getelementptr inbounds float, float* %126, i64 2
store float %133, float* %134
%135 = load float*, float** %25
%136 = call i32 @lsqenp_(i32* %12, i32* %15, i32* %16, float* %135, float* %47, float* %126, i32* %17, i32* %43, i32* %19, i32* %20, i32* %21, i32* %22)
%137 = load float, float* %126
%138 = fpext float %137 to double
store double %138, double* %6
%139 = load float, float* %131
%140 = fpext float %139 to double
store double %140, double* %7
%141 = load float, float* %134
%142 = fpext float %141 to double
store double %142, double* %8
%143 = load double, double* %6
%144 = load double, double* %7
%145 = load i32, i32* %12
%146 = load double*, double** %23
%147 = call double @rmsestimates(double %143, double %144, double %142, i32 %145, double* %46, double* %146)
store double %147, double* %9
%148 = load double, double* %6
%149 = load double, double* %7
%150 = load double, double* %8
%151 = call i32 (i8*, double, double, double, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.3, i64 0, i64 0), double %148, double %149, double %150, double %147)
%152 = load double, double* %9
%153 = fcmp ult double %152, %1
br i1 %153, label %165, label %162
154: ; preds = %117, %113, %97
%155 = load i32, i32* @stderr
%156 = call i32 (i32, i8*, ...) @fprintf(i32 %155, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%157 = load i32, i32* @stderr
%158 = load double, double* %6
%159 = load double, double* %7
%160 = load double, double* %8
%161 = call i32 (i32, i8*, ...) @fprintf(i32 %157, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* %0, double %158, double %159, double %160)
store i32 1, i32* %10
br label %184
162: ; preds = %121
%163 = load i32, i32* @stderr
%164 = call i32 (i32, i8*, ...) @fprintf(i32 %163, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8* %0, double %152)
store i32 1, i32* %10
br label %165
165: ; preds = %162, %121
%166 = bitcast float* %126 to i8*
%167 = call i32 @free(i8* %166)
%168 = bitcast i32** %26 to i8**
%169 = load i8*, i8** %168
%170 = call i32 @free(i8* %169)
%171 = bitcast i32** %27 to i8**
%172 = load i8*, i8** %171
%173 = call i32 @free(i8* %172)
%174 = bitcast double* %46 to i8*
%175 = call i32 @free(i8* %174)
%176 = bitcast double** %23 to i8**
%177 = load i8*, i8** %176
%178 = call i32 @free(i8* %177)
%179 = bitcast float** %25 to i8**
%180 = load i8*, i8** %179
%181 = call i32 @free(i8* %180)
%182 = bitcast float* %47 to i8*
%183 = call i32 @free(i8* %182)
br label %184
184: ; preds = %93, %165, %154
ret void
}