#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 */
float exp(float);
double fabs(float);
double fabsf(float);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(float *);
float const log(float const);
float *malloc(int);
float pow(float, float const);
int /*<<< orphan*/ stderr;
int CPML_coeff(float NPOWER, float k_max_CPML, float FPML, float VPPML,
               float dh, float dt, int NAB, float *K_i, float *b_i, float *a_i,
               float *K_i_half, float *b_i_half, float *a_i_half) {
  int state = 0;
  int i, l, i1;
  float *d_i = NULL, *d_i_half = NULL;
  float *alpha_prime_i, *alpha_prime_i_half;
  const float npower = NPOWER;
  const float alpha_max_PML =
      2.0 * (3.141592653589793238462643383279502884197169) * (FPML / 2.0);
  const float Rcoef = 0.0008;
  const float a = 0.25, b = 0.75, c = 0.0;
  float d0_i, position_norm, position_in_PML;
  d_i = malloc(sizeof(float) * 2 * NAB);
  d_i_half = malloc(sizeof(float) * 2 * NAB);
  alpha_prime_i = malloc(sizeof(float) * 2 * NAB);
  alpha_prime_i_half = malloc(sizeof(float) * 2 * NAB);
  d0_i = -(npower + 1) * VPPML * log(Rcoef) / (2.0 * NAB * dh);
  for (i = 0; i <= NAB; i++) {
    K_i[i] = 1.0;
    position_in_PML = (NAB - i) * dh;
    position_norm = position_in_PML / (NAB * dh);
    d_i[i] = d0_i * (a * position_norm + b * pow(position_norm, npower) +
                     c * pow(position_norm, (4)));
    K_i[i] = 1.0 + (k_max_CPML - 1.0) * pow(position_norm, npower);
    alpha_prime_i[i] = alpha_max_PML * (1.0 - position_norm);
    if (alpha_prime_i[i] < 0.0) {
      state = 1;
      fprintf(stderr, "ERROR: alpha_prime_i[i] < 0.0, i %d", i);
    }
    b_i[i] = exp(-(d_i[i] / K_i[i] + alpha_prime_i[i]) * dt);
    if (fabsf(d_i[i]) > 1.0e-6) {
      a_i[i] = d_i[i] * (b_i[i] - 1.0) /
               (K_i[i] * (d_i[i] + K_i[i] * alpha_prime_i[i]));
    } else
      a_i[i] = 0.0;
    if (i <= NAB - 1) {
      position_in_PML = (NAB - i + 0.5 - 1.0) * dh;
      position_norm = position_in_PML / (NAB * dh);
      i1 = i;
      K_i_half[i1] = 1.0;
      d_i_half[i1] =
          d0_i * (a * position_norm + b * pow(position_norm, npower) +
                  c * pow(position_norm, (4)));
      if (position_in_PML < 0.0) {
        state = 1;
        fprintf(stderr, "ERROR: Position in PML (x-boundary) smaller 0");
      }
      K_i_half[i1] = 1.0 + (k_max_CPML - 1.0) * pow(position_norm, npower);
      alpha_prime_i_half[i1] = alpha_max_PML * (1.0 - position_norm);
      if (alpha_prime_i_half[i1] < 0.0) {
        state = 1;
        fprintf(stderr, "ERROR: alpha_prime_i_half[i] < 0.0, i %d", i);
      }
      b_i_half[i1] =
          exp(-(d_i_half[i1] / K_i_half[i1] + alpha_prime_i_half[i1]) * dt);
      if (fabs(d_i_half[i1]) > 1.0e-6) {
        a_i_half[i1] = d_i_half[i1] * (b_i_half[i1] - 1.0) /
                       (K_i_half[i1] *
                        (d_i_half[i1] + K_i_half[i1] * alpha_prime_i_half[i1]));
      }
      l = 2 * NAB - i - 1;
      if (i > 0) {
        K_i[l + 1] = K_i[i];
        b_i[l + 1] = b_i[i];
        if (fabs(d_i[i]) > 1.0e-6) {
          a_i[l + 1] = a_i[i];
        }
      }
      K_i_half[l] = K_i_half[i];
      b_i_half[l] = b_i_half[i];
      if (fabs(d_i[i]) > 1.0e-6) {
        a_i_half[l] = a_i_half[i];
      }
    }
  }
  free(d_i);
  free(d_i_half);
  free(alpha_prime_i);
  free(alpha_prime_i_half);
  return state;
}


x86 assembly (clang, -O0):
<CPML_coeff>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    0x10(%rbp),%rax
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %r8,-0x40(%rbp)
mov    %r9,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
movq   $0x0,-0x60(%rbp)
movq   $0x0,-0x68(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x7c(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe0a(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe06(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x80(%rbp)
movss  0xe11(%rip),%xmm0
movss  %xmm0,-0x84(%rbp)
ff
movss  0xe0d(%rip),%xmm0
movss  %xmm0,-0x88(%rbp)
ff
movss  0xdf9(%rip),%xmm0
movss  %xmm0,-0x8c(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0x90(%rbp)
ff
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x60(%rbp)
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x68(%rbp)
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x70(%rbp)
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x78(%rbp)
movss  0xd8e(%rip),%xmm0
addss  -0x7c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0xa0(%rbp)
ff
movss  0xd63(%rip),%xmm0
call   1090 <log@plt>
movaps %xmm0,%xmm1
movss  -0xa0(%rbp),%xmm0
ff
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm2
movsd  0xd16(%rip),%xmm1
mulsd  %xmm2,%xmm1
movss  -0x14(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x94(%rbp)
ff
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1a48 <CPML_coeff+0x8c8>
mov    -0x28(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  0xcfe(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
sub    -0x50(%rbp),%eax
cvtsi2ss %eax,%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x9c(%rbp)
ff
movss  -0x9c(%rbp),%xmm0
ff
cvtsi2ssl -0x1c(%rbp),%xmm1
mulss  -0x14(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x98(%rbp)
ff
movss  -0x94(%rbp),%xmm0
ff
movss  %xmm0,-0xac(%rbp)
ff
movss  -0x98(%rbp),%xmm0
ff
movss  %xmm0,-0xb4(%rbp)
ff
movss  -0x98(%rbp),%xmm0
ff
movss  -0x7c(%rbp),%xmm1
call   10a0 <pow@plt>
movaps %xmm0,%xmm2
movss  -0xb4(%rbp),%xmm0
ff
movss  0xc83(%rip),%xmm1
mulss  %xmm2,%xmm1
movss  0xc7b(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xb0(%rbp)
ff
movss  -0x98(%rbp),%xmm0
ff
movss  0xc5f(%rip),%xmm1
call   10a0 <pow@plt>
movss  -0xb0(%rbp),%xmm2
ff
movaps %xmm0,%xmm1
movss  -0xac(%rbp),%xmm0
ff
xorps  %xmm3,%xmm3
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
mov    -0x60(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xbf2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movss  -0x98(%rbp),%xmm0
ff
movss  -0x7c(%rbp),%xmm1
call   10a0 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xbb9(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x80(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x98(%rbp),%xmm1
ff
cvtss2sd %xmm1,%xmm2
movsd  0xb87(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x70(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x70(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    14e1 <CPML_coeff+0x361>
movl   $0x1,-0x4c(%rbp)
mov    0x2b12(%rip),%rax
mov    (%rax),%edi
mov    -0x50(%rbp),%edx
lea    0xb62(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x60(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x50(%rbp),%rcx
divss  (%rax,%rcx,4),%xmm0
mov    -0x70(%rbp),%rax
movslq -0x50(%rbp),%rcx
addss  (%rax,%rcx,4),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0x18(%rbp),%xmm0
call   1080 <exp@plt>
mov    -0x30(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x60(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1040 <fabsf@plt>
movsd  0xad2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    15e0 <CPML_coeff+0x460>
mov    -0x60(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x30(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xa96(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
mov    -0x60(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm3
mov    -0x28(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm2
mov    -0x70(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm4
mulss  %xmm4,%xmm2
addss  %xmm3,%xmm2
mulss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x38(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
jmp    15f0 <CPML_coeff+0x470>
mov    -0x38(%rbp),%rax
movslq -0x50(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x50(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1a35 <CPML_coeff+0x8b5>
mov    -0x1c(%rbp),%eax
sub    -0x50(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xa0d(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0x9f1(%rip),%xmm1
subsd  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x9c(%rbp)
ff
movss  -0x9c(%rbp),%xmm0
ff
cvtsi2ssl -0x1c(%rbp),%xmm1
mulss  -0x14(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x98(%rbp)
ff
mov    -0x50(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x40(%rbp),%rax
movslq -0x58(%rbp),%rcx
movss  0x9bc(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,4)
movss  -0x94(%rbp),%xmm0
ff
movss  %xmm0,-0xb8(%rbp)
ff
movss  -0x98(%rbp),%xmm0
ff
movss  %xmm0,-0xc0(%rbp)
ff
movss  -0x98(%rbp),%xmm0
ff
movss  -0x7c(%rbp),%xmm1
call   10a0 <pow@plt>
movaps %xmm0,%xmm2
movss  -0xc0(%rbp),%xmm0
ff
movss  0x976(%rip),%xmm1
mulss  %xmm2,%xmm1
movss  0x96e(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xbc(%rbp)
ff
movss  -0x98(%rbp),%xmm0
ff
movss  0x952(%rip),%xmm1
call   10a0 <pow@plt>
movss  -0xbc(%rbp),%xmm2
ff
movaps %xmm0,%xmm1
movss  -0xb8(%rbp),%xmm0
ff
xorps  %xmm3,%xmm3
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
mov    -0x68(%rbp),%rax
movslq -0x58(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x9c(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1751 <CPML_coeff+0x5d1>
movl   $0x1,-0x4c(%rbp)
mov    0x289f(%rip),%rax
mov    (%rax),%edi
lea    0x916(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x8ae(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movss  -0x98(%rbp),%xmm0
ff
movss  -0x7c(%rbp),%xmm1
call   10a0 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x875(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x40(%rbp),%rax
movslq -0x58(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x80(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x98(%rbp),%xmm1
ff
cvtss2sd %xmm1,%xmm2
movsd  0x843(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x78(%rbp),%rax
movslq -0x58(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x78(%rbp),%rax
movslq -0x58(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1825 <CPML_coeff+0x6a5>
movl   $0x1,-0x4c(%rbp)
mov    0x27ce(%rip),%rax
mov    (%rax),%edi
mov    -0x50(%rbp),%edx
lea    0x870(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x68(%rbp),%rax
movslq -0x58(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x58(%rbp),%rcx
divss  (%rax,%rcx,4),%xmm0
mov    -0x78(%rbp),%rax
movslq -0x58(%rbp),%rcx
addss  (%rax,%rcx,4),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0x18(%rbp),%xmm0
call   1080 <exp@plt>
mov    -0x48(%rbp),%rax
movslq -0x58(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x68(%rbp),%rax
movslq -0x58(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1050 <fabs@plt>
movsd  0x78e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    191f <CPML_coeff+0x79f>
mov    -0x68(%rbp),%rax
movslq -0x58(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x48(%rbp),%rax
movslq -0x58(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0x752(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
movslq -0x58(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
mov    -0x68(%rbp),%rax
movslq -0x58(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm3
mov    -0x40(%rbp),%rax
movslq -0x58(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm2
mov    -0x78(%rbp),%rax
movslq -0x58(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm4
mulss  %xmm4,%xmm2
addss  %xmm3,%xmm2
mulss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    0x10(%rbp),%rax
movslq -0x58(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
shl    $0x1,%eax
sub    -0x50(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x54(%rbp)
cmpl   $0x0,-0x50(%rbp)
jle    19be <CPML_coeff+0x83e>
mov    -0x28(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x30(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x60(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1050 <fabs@plt>
movsd  0x688(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    19b9 <CPML_coeff+0x839>
mov    -0x38(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
jmp    19be <CPML_coeff+0x83e>
mov    -0x40(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x54(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x48(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x54(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x60(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1050 <fabs@plt>
movsd  0x60c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1a30 <CPML_coeff+0x8b0>
mov    0x10(%rbp),%rax
movslq -0x50(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
jmp    1a35 <CPML_coeff+0x8b5>
jmp    1a3a <CPML_coeff+0x8ba>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1312 <CPML_coeff+0x192>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4c(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CPML_coeff>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %r9,%r12
mov    %r8,%rbp
mov    %rcx,%r15
mov    %rdx,0x28(%rsp)
mov    %rsi,%r13
mov    %edi,%ebx
movss  %xmm5,0x24(%rsp)
movss  %xmm4,0x18(%rsp)
movss  %xmm3,0x30(%rsp)
movss  %xmm2,0x4(%rsp)
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0xc(%rsp)
lea    0x0(,%rbx,8),%r14d
mov    %r14d,%edi
call   1070 <malloc@plt>
mov    %rax,0x60(%rsp)
mov    %r14d,%edi
call   1070 <malloc@plt>
mov    %rax,0x48(%rsp)
mov    %r14d,%edi
call   1070 <malloc@plt>
mov    %rax,0x58(%rsp)
mov    %r14d,%edi
call   1070 <malloc@plt>
mov    %rax,0x40(%rsp)
test   %ebx,%ebx
js     1809 <CPML_coeff+0x699>
movss  0xdfc(%rip),%xmm0
movss  0xc(%rsp),%xmm4
addss  %xmm4,%xmm0
mulss  0x30(%rsp),%xmm0
mulss  0xde8(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
addsd  %xmm1,%xmm1
movss  0x18(%rsp),%xmm3
xorps  %xmm2,%xmm2
cvtss2sd %xmm3,%xmm2
movsd  %xmm2,0xb0(%rsp)
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x20(%rsp)
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xdb3(%rip),%xmm0
mulsd  0xdb3(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %ebx,%xmm1
mov    0x100(%rsp),%rcx
movss  0x8(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
addsd  0xd96(%rip),%xmm2
movsd  %xmm2,0x78(%rsp)
mulss  %xmm3,%xmm1
movss  %xmm1,0x1c(%rsp)
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x70(%rsp)
lea    (%rbx,%rbx,1),%eax
mov    %ebx,%edx
mov    %rdx,0x30(%rsp)
cltq
add    $0x1,%ebx
lea    -0x4(,%rax,4),%rdx
ff
add    %rbp,%rdx
mov    %rdx,0xa8(%rsp)
lea    -0x4(%r12,%rax,4),%rdx
mov    %rdx,0xa0(%rsp)
lea    -0x4(%rcx,%rax,4),%rcx
mov    %rcx,0x88(%rsp)
lea    0x0(%r13,%rax,4),%rcx
mov    %rcx,0x98(%rsp)
mov    0x28(%rsp),%rdx
lea    (%rdx,%rax,4),%rcx
mov    %rcx,0x90(%rsp)
mov    %r15,0x68(%rsp)
lea    (%r15,%rax,4),%rax
mov    %rax,0x80(%rsp)
xor    %r14d,%r14d
xor    %r15d,%r15d
movl   $0x0,0x10(%rsp)
movaps %xmm3,%xmm2
movaps %xmm4,%xmm1
mov    %rdx,%rax
mov    %rbp,0xc0(%rsp)
mov    %r12,0xb8(%rsp)
mov    %rbx,0x50(%rsp)
jmp    1372 <CPML_coeff+0x202>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r13,%rax
mov    %rbx,%r13
mov    0x50(%rsp),%rbx
movss  0x18(%rsp),%xmm2
add    $0x1,%r15
add    $0xffffffffffffffff,%r14
cmp    %r15,%rbx
je     1811 <CPML_coeff+0x6a1>
mov    %r13,%rbp
mov    %rax,%r13
mov    0x30(%rsp),%rax
lea    (%rax,%r14,1),%r12
xorps  %xmm0,%xmm0
cvtsi2ss %r12d,%xmm0
mulss  %xmm2,%xmm0
divss  0x1c(%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
call   1090 <pow@plt>
mulss  0xc62(%rip),%xmm0
movss  0x4(%rsp),%xmm1
movaps %xmm1,%xmm2
mulss  0xc55(%rip),%xmm2
addss  %xmm0,%xmm2
movss  %xmm2,0x8(%rsp)
movaps %xmm1,%xmm0
movss  0xc44(%rip),%xmm1
call   1090 <pow@plt>
xorps  %xmm1,%xmm1
mulss  %xmm1,%xmm0
addss  0x8(%rsp),%xmm0
mulss  0x20(%rsp),%xmm0
mov    0x60(%rsp),%rax
movss  %xmm0,0x8(%rsp)
movss  %xmm0,(%rax,%r15,4)
movss  0x4(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
call   1090 <pow@plt>
cvtss2sd %xmm0,%xmm0
mulsd  0x78(%rsp),%xmm0
movsd  0xc18(%rip),%xmm2
addsd  %xmm2,%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
subsd  %xmm0,%xmm2
mulsd  0x70(%rsp),%xmm2
cvtsd2ss %xmm2,%xmm2
mov    %rbp,%rbx
movss  %xmm1,0x0(%rbp,%r15,4)
mov    0x58(%rsp),%rax
movss  %xmm2,(%rax,%r15,4)
xorps  %xmm0,%xmm0
ucomiss %xmm2,%xmm0
movss  %xmm2,0x4(%rsp)
jbe    148c <CPML_coeff+0x31c>
mov    0x2b7b(%rip),%rax
mov    (%rax),%edi
lea    0xbe2(%rip),%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
movss  0x4(%rsp),%xmm2
movss  (%rbx,%r15,4),%xmm1
movl   $0x1,0x10(%rsp)
movss  0x8(%rsp),%xmm0
divss  %xmm1,%xmm0
addss  %xmm2,%xmm0
xorps  0xb9f(%rip),%xmm0
mulss  0x24(%rsp),%xmm0
call   1080 <exp@plt>
movss  %xmm0,0x0(%r13,%r15,4)
movss  0x8(%rsp),%xmm0
call   1040 <fabsf@plt>
xorps  %xmm1,%xmm1
ucomisd 0xb6f(%rip),%xmm0
jbe    1516 <CPML_coeff+0x3a6>
movss  0x8(%rsp),%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
movss  0x0(%r13,%r15,4),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  0xb3d(%rip),%xmm1
mulsd  %xmm0,%xmm1
movss  (%rbx,%r15,4),%xmm0
movss  0x4(%rsp),%xmm3
mulss  %xmm0,%xmm3
addss  %xmm2,%xmm3
mulss  %xmm0,%xmm3
xorps  %xmm0,%xmm0
cvtss2sd %xmm3,%xmm0
divsd  %xmm0,%xmm1
cvtsd2ss %xmm1,%xmm1
mov    0x68(%rsp),%rax
movss  %xmm1,(%rax,%r15,4)
cmp    0x30(%rsp),%r15
movss  0xc(%rsp),%xmm1
jae    1350 <CPML_coeff+0x1e0>
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
addsd  0xad6(%rip),%xmm0
addsd  0xade(%rip),%xmm0
mulsd  0xb0(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x3c(%rsp)
divss  0x1c(%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
mov    0xc0(%rsp),%rbp
movl   $0x3f800000,0x0(%rbp,%r15,4)
80 3f
call   1090 <pow@plt>
mulss  0xa81(%rip),%xmm0
movss  0x4(%rsp),%xmm2
movaps %xmm2,%xmm1
mulss  0xa74(%rip),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x14(%rsp)
movaps %xmm2,%xmm0
movss  0xa63(%rip),%xmm1
call   1090 <pow@plt>
xorps  %xmm1,%xmm1
mulss  %xmm1,%xmm0
addss  0x14(%rsp),%xmm0
mulss  0x20(%rsp),%xmm0
mov    0x48(%rsp),%rax
movss  %xmm0,0x14(%rsp)
movss  %xmm0,(%rax,%r15,4)
ucomiss 0x3c(%rsp),%xmm1
jbe    15fc <CPML_coeff+0x48c>
mov    0x29fc(%rip),%rax
mov    (%rax),%edi
lea    0xa87(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
movl   $0x1,0x10(%rsp)
movss  0x4(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
call   1090 <pow@plt>
cvtss2sd %xmm0,%xmm0
mulsd  0x78(%rsp),%xmm0
movsd  0xa11(%rip),%xmm2
addsd  %xmm2,%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
subsd  %xmm0,%xmm2
mulsd  0x70(%rsp),%xmm2
cvtsd2ss %xmm2,%xmm2
movss  %xmm1,0x0(%rbp,%r15,4)
mov    0x40(%rsp),%rax
movss  %xmm2,(%rax,%r15,4)
xorps  %xmm0,%xmm0
ucomiss %xmm2,%xmm0
mov    0xb8(%rsp),%r12
movss  %xmm2,0x4(%rsp)
jbe    1699 <CPML_coeff+0x529>
mov    0x296f(%rip),%rax
mov    (%rax),%edi
lea    0xa28(%rip),%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
movss  0x4(%rsp),%xmm2
movss  0x0(%rbp,%r15,4),%xmm1
movl   $0x1,0x10(%rsp)
movss  0x14(%rsp),%xmm0
divss  %xmm1,%xmm0
addss  %xmm2,%xmm0
xorps  0x992(%rip),%xmm0
mulss  0x24(%rsp),%xmm0
call   1080 <exp@plt>
movss  %xmm0,(%r12,%r15,4)
movss  0x14(%rsp),%xmm0
call   1050 <fabs@plt>
ucomisd 0x966(%rip),%xmm0
mov    %rbx,%r13
jbe    1733 <CPML_coeff+0x5c3>
movss  0x14(%rsp),%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
movss  (%r12,%r15,4),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  0x932(%rip),%xmm1
mulsd  %xmm0,%xmm1
movss  0x0(%rbp,%r15,4),%xmm0
movss  0x4(%rsp),%xmm3
mulss  %xmm0,%xmm3
addss  %xmm2,%xmm3
mulss  %xmm0,%xmm3
xorps  %xmm0,%xmm0
cvtss2sd %xmm3,%xmm0
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
mov    0x100(%rsp),%rax
movss  %xmm0,(%rax,%r15,4)
test   %r15,%r15
mov    0x50(%rsp),%rbx
je     1799 <CPML_coeff+0x629>
movss  0x0(%r13,%r15,4),%xmm0
mov    0x98(%rsp),%rax
movss  %xmm0,(%rax,%r14,4)
mov    0x28(%rsp),%rax
movss  (%rax,%r15,4),%xmm0
mov    0x90(%rsp),%rax
movss  %xmm0,(%rax,%r14,4)
movss  0x8(%rsp),%xmm0
call   1050 <fabs@plt>
ucomisd 0x8ba(%rip),%xmm0
jbe    1799 <CPML_coeff+0x629>
mov    0x68(%rsp),%rax
movss  (%rax,%r15,4),%xmm0
mov    0x80(%rsp),%rax
movss  %xmm0,(%rax,%r14,4)
movss  0x0(%rbp,%r15,4),%xmm0
mov    0xa8(%rsp),%rax
movss  %xmm0,(%rax,%r14,4)
movss  (%r12,%r15,4),%xmm0
mov    0xa0(%rsp),%rax
movss  %xmm0,(%rax,%r14,4)
movss  0x8(%rsp),%xmm0
call   1050 <fabs@plt>
ucomisd 0x863(%rip),%xmm0
jbe    17f3 <CPML_coeff+0x683>
mov    0x100(%rsp),%rax
movss  (%rax,%r15,4),%xmm0
mov    0x88(%rsp),%rax
movss  %xmm0,(%rax,%r14,4)
movss  0x18(%rsp),%xmm2
movss  0xc(%rsp),%xmm1
mov    0x28(%rsp),%rax
jmp    1361 <CPML_coeff+0x1f1>
movl   $0x0,0x10(%rsp)
mov    0x60(%rsp),%rdi
call   1030 <free@plt>
mov    0x48(%rsp),%rdi
call   1030 <free@plt>
mov    0x58(%rsp),%rdi
call   1030 <free@plt>
mov    0x40(%rsp),%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"ERROR: alpha_prime_i[i] < 0.0, i %d\00"
@.str.1 = [46 x i8] c"ERROR: Position in PML (x-boundary) smaller 0\00"
@.str.2 = [41 x i8] c"ERROR: alpha_prime_i_half[i] < 0.0, i %d\00"
define i32 @CPML_coeff(float %0, float %1, float %2, float %3, float %4, float %5, i32 %6, float* %7, float* %8, float* %9, float* %10, float* %11, float* %12) {
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca i32
%21 = alloca float*
%22 = alloca float*
%23 = alloca float*
%24 = alloca float*
%25 = alloca float*
%26 = alloca float*
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca float*
%32 = alloca float*
%33 = alloca float*
%34 = alloca float*
%35 = alloca float
%36 = alloca float
%37 = alloca float
%38 = alloca float
%39 = alloca float
%40 = alloca float
%41 = alloca float
%42 = alloca float
%43 = alloca float
store float %0, float* %14
store float %1, float* %15
store float %2, float* %16
store float %3, float* %17
store float %4, float* %18
store float %5, float* %19
store i32 %6, i32* %20
store float* %7, float** %21
store float* %8, float** %22
store float* %9, float** %23
store float* %10, float** %24
store float* %11, float** %25
store float* %12, float** %26
store i32 0, i32* %27
store float* null, float** %31
store float* null, float** %32
%44 = load float, float* %14
store float %44, float* %35
%45 = load float, float* %16
%46 = fpext float %45 to double
%47 = fdiv double %46, 2.000000e+00
%48 = fmul double 0x401921FB54442D18, %47
%49 = fptrunc double %48 to float
store float %49, float* %36
store float 0x3F4A36E2E0000000, float* %37
store float 2.500000e-01, float* %38
store float 7.500000e-01, float* %39
store float 0.000000e+00, float* %40
%50 = load i32, i32* %20
%51 = sext i32 %50 to i64
%52 = mul i64 8, %51
%53 = trunc i64 %52 to i32
%54 = call float* @malloc(i32 %53)
store float* %54, float** %31
%55 = load i32, i32* %20
%56 = sext i32 %55 to i64
%57 = mul i64 8, %56
%58 = trunc i64 %57 to i32
%59 = call float* @malloc(i32 %58)
store float* %59, float** %32
%60 = load i32, i32* %20
%61 = sext i32 %60 to i64
%62 = mul i64 8, %61
%63 = trunc i64 %62 to i32
%64 = call float* @malloc(i32 %63)
store float* %64, float** %33
%65 = load i32, i32* %20
%66 = sext i32 %65 to i64
%67 = mul i64 8, %66
%68 = trunc i64 %67 to i32
%69 = call float* @malloc(i32 %68)
store float* %69, float** %34
%70 = load float, float* %35
%71 = fadd float %70, 1.000000e+00
%72 = fneg float %71
%73 = load float, float* %17
%74 = fmul float %72, %73
%75 = call float @log(float 0x3F4A36E2E0000000)
%76 = fmul float %74, %75
%77 = fpext float %76 to double
%78 = load i32, i32* %20
%79 = sitofp i32 %78 to double
%80 = fmul double 2.000000e+00, %79
%81 = load float, float* %18
%82 = fpext float %81 to double
%83 = fmul double %80, %82
%84 = fdiv double %77, %83
%85 = fptrunc double %84 to float
store float %85, float* %41
store i32 0, i32* %28
br label %86
86: ; preds = %486, %13
%87 = load i32, i32* %28
%88 = load i32, i32* %20
%89 = icmp sle i32 %87, %88
br i1 %89, label %90, label %489
90: ; preds = %86
%91 = load float*, float** %21
%92 = load i32, i32* %28
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds float, float* %91, i64 %93
store float 1.000000e+00, float* %94
%95 = load i32, i32* %20
%96 = load i32, i32* %28
%97 = sub nsw i32 %95, %96
%98 = sitofp i32 %97 to float
%99 = load float, float* %18
%100 = fmul float %98, %99
store float %100, float* %43
%101 = load float, float* %43
%102 = load i32, i32* %20
%103 = sitofp i32 %102 to float
%104 = load float, float* %18
%105 = fmul float %103, %104
%106 = fdiv float %101, %105
store float %106, float* %42
%107 = load float, float* %41
%108 = load float, float* %42
%109 = load float, float* %42
%110 = load float, float* %35
%111 = call float @pow(float %109, float %110)
%112 = fmul float 7.500000e-01, %111
%113 = call float @llvm.fmuladd.f32(float 2.500000e-01, float %108, float %112)
%114 = load float, float* %42
%115 = call float @pow(float %114, float 4.000000e+00)
%116 = call float @llvm.fmuladd.f32(float 0.000000e+00, float %115, float %113)
%117 = fmul float %107, %116
%118 = load float*, float** %31
%119 = load i32, i32* %28
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds float, float* %118, i64 %120
store float %117, float* %121
%122 = load float, float* %15
%123 = fpext float %122 to double
%124 = fsub double %123, 1.000000e+00
%125 = load float, float* %42
%126 = load float, float* %35
%127 = call float @pow(float %125, float %126)
%128 = fpext float %127 to double
%129 = call double @llvm.fmuladd.f64(double %124, double %128, double 1.000000e+00)
%130 = fptrunc double %129 to float
%131 = load float*, float** %21
%132 = load i32, i32* %28
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds float, float* %131, i64 %133
store float %130, float* %134
%135 = load float, float* %36
%136 = fpext float %135 to double
%137 = load float, float* %42
%138 = fpext float %137 to double
%139 = fsub double 1.000000e+00, %138
%140 = fmul double %136, %139
%141 = fptrunc double %140 to float
%142 = load float*, float** %33
%143 = load i32, i32* %28
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds float, float* %142, i64 %144
store float %141, float* %145
%146 = load float*, float** %33
%147 = load i32, i32* %28
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds float, float* %146, i64 %148
%150 = load float, float* %149
%151 = fpext float %150 to double
%152 = fcmp olt double %151, 0.000000e+00
br i1 %152, label %153, label %157
153: ; preds = %90
store i32 1, i32* %27
%154 = load i32, i32* @stderr
%155 = load i32, i32* %28
%156 = call i32 (i32, i8*, ...) @fprintf(i32 %154, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %155)
br label %157
157: ; preds = %153, %90
%158 = load float*, float** %31
%159 = load i32, i32* %28
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds float, float* %158, i64 %160
%162 = load float, float* %161
%163 = load float*, float** %21
%164 = load i32, i32* %28
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds float, float* %163, i64 %165
%167 = load float, float* %166
%168 = fdiv float %162, %167
%169 = load float*, float** %33
%170 = load i32, i32* %28
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds float, float* %169, i64 %171
%173 = load float, float* %172
%174 = fadd float %168, %173
%175 = fneg float %174
%176 = load float, float* %19
%177 = fmul float %175, %176
%178 = call float @exp(float %177)
%179 = load float*, float** %22
%180 = load i32, i32* %28
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds float, float* %179, i64 %181
store float %178, float* %182
%183 = load float*, float** %31
%184 = load i32, i32* %28
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds float, float* %183, i64 %185
%187 = load float, float* %186
%188 = call double @fabsf(float %187)
%189 = fcmp ogt double %188, 0x3EB0C6F7A0B5ED8D
br i1 %189, label %190, label %234
190: ; preds = %157
%191 = load float*, float** %31
%192 = load i32, i32* %28
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds float, float* %191, i64 %193
%195 = load float, float* %194
%196 = fpext float %195 to double
%197 = load float*, float** %22
%198 = load i32, i32* %28
%199 = sext i32 %198 to i64
%200 = getelementptr inbounds float, float* %197, i64 %199
%201 = load float, float* %200
%202 = fpext float %201 to double
%203 = fsub double %202, 1.000000e+00
%204 = fmul double %196, %203
%205 = load float*, float** %21
%206 = load i32, i32* %28
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds float, float* %205, i64 %207
%209 = load float, float* %208
%210 = load float*, float** %31
%211 = load i32, i32* %28
%212 = sext i32 %211 to i64
%213 = getelementptr inbounds float, float* %210, i64 %212
%214 = load float, float* %213
%215 = load float*, float** %21
%216 = load i32, i32* %28
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds float, float* %215, i64 %217
%219 = load float, float* %218
%220 = load float*, float** %33
%221 = load i32, i32* %28
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds float, float* %220, i64 %222
%224 = load float, float* %223
%225 = call float @llvm.fmuladd.f32(float %219, float %224, float %214)
%226 = fmul float %209, %225
%227 = fpext float %226 to double
%228 = fdiv double %204, %227
%229 = fptrunc double %228 to float
%230 = load float*, float** %23
%231 = load i32, i32* %28
%232 = sext i32 %231 to i64
%233 = getelementptr inbounds float, float* %230, i64 %232
store float %229, float* %233
br label %239
234: ; preds = %157
%235 = load float*, float** %23
%236 = load i32, i32* %28
%237 = sext i32 %236 to i64
%238 = getelementptr inbounds float, float* %235, i64 %237
store float 0.000000e+00, float* %238
br label %239
239: ; preds = %234, %190
%240 = load i32, i32* %28
%241 = load i32, i32* %20
%242 = sub nsw i32 %241, 1
%243 = icmp sle i32 %240, %242
br i1 %243, label %244, label %485
244: ; preds = %239
%245 = load i32, i32* %20
%246 = load i32, i32* %28
%247 = sub nsw i32 %245, %246
%248 = sitofp i32 %247 to double
%249 = fadd double %248, 5.000000e-01
%250 = fsub double %249, 1.000000e+00
%251 = load float, float* %18
%252 = fpext float %251 to double
%253 = fmul double %250, %252
%254 = fptrunc double %253 to float
store float %254, float* %43
%255 = load float, float* %43
%256 = load i32, i32* %20
%257 = sitofp i32 %256 to float
%258 = load float, float* %18
%259 = fmul float %257, %258
%260 = fdiv float %255, %259
store float %260, float* %42
%261 = load i32, i32* %28
store i32 %261, i32* %30
%262 = load float*, float** %24
%263 = load i32, i32* %30
%264 = sext i32 %263 to i64
%265 = getelementptr inbounds float, float* %262, i64 %264
store float 1.000000e+00, float* %265
%266 = load float, float* %41
%267 = load float, float* %42
%268 = load float, float* %42
%269 = load float, float* %35
%270 = call float @pow(float %268, float %269)
%271 = fmul float 7.500000e-01, %270
%272 = call float @llvm.fmuladd.f32(float 2.500000e-01, float %267, float %271)
%273 = load float, float* %42
%274 = call float @pow(float %273, float 4.000000e+00)
%275 = call float @llvm.fmuladd.f32(float 0.000000e+00, float %274, float %272)
%276 = fmul float %266, %275
%277 = load float*, float** %32
%278 = load i32, i32* %30
%279 = sext i32 %278 to i64
%280 = getelementptr inbounds float, float* %277, i64 %279
store float %276, float* %280
%281 = load float, float* %43
%282 = fpext float %281 to double
%283 = fcmp olt double %282, 0.000000e+00
br i1 %283, label %284, label %287
284: ; preds = %244
store i32 1, i32* %27
%285 = load i32, i32* @stderr
%286 = call i32 (i32, i8*, ...) @fprintf(i32 %285, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
br label %287
287: ; preds = %284, %244
%288 = load float, float* %15
%289 = fpext float %288 to double
%290 = fsub double %289, 1.000000e+00
%291 = load float, float* %42
%292 = load float, float* %35
%293 = call float @pow(float %291, float %292)
%294 = fpext float %293 to double
%295 = call double @llvm.fmuladd.f64(double %290, double %294, double 1.000000e+00)
%296 = fptrunc double %295 to float
%297 = load float*, float** %24
%298 = load i32, i32* %30
%299 = sext i32 %298 to i64
%300 = getelementptr inbounds float, float* %297, i64 %299
store float %296, float* %300
%301 = load float, float* %36
%302 = fpext float %301 to double
%303 = load float, float* %42
%304 = fpext float %303 to double
%305 = fsub double 1.000000e+00, %304
%306 = fmul double %302, %305
%307 = fptrunc double %306 to float
%308 = load float*, float** %34
%309 = load i32, i32* %30
%310 = sext i32 %309 to i64
%311 = getelementptr inbounds float, float* %308, i64 %310
store float %307, float* %311
%312 = load float*, float** %34
%313 = load i32, i32* %30
%314 = sext i32 %313 to i64
%315 = getelementptr inbounds float, float* %312, i64 %314
%316 = load float, float* %315
%317 = fpext float %316 to double
%318 = fcmp olt double %317, 0.000000e+00
br i1 %318, label %319, label %323
319: ; preds = %287
store i32 1, i32* %27
%320 = load i32, i32* @stderr
%321 = load i32, i32* %28
%322 = call i32 (i32, i8*, ...) @fprintf(i32 %320, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i32 %321)
br label %323
323: ; preds = %319, %287
%324 = load float*, float** %32
%325 = load i32, i32* %30
%326 = sext i32 %325 to i64
%327 = getelementptr inbounds float, float* %324, i64 %326
%328 = load float, float* %327
%329 = load float*, float** %24
%330 = load i32, i32* %30
%331 = sext i32 %330 to i64
%332 = getelementptr inbounds float, float* %329, i64 %331
%333 = load float, float* %332
%334 = fdiv float %328, %333
%335 = load float*, float** %34
%336 = load i32, i32* %30
%337 = sext i32 %336 to i64
%338 = getelementptr inbounds float, float* %335, i64 %337
%339 = load float, float* %338
%340 = fadd float %334, %339
%341 = fneg float %340
%342 = load float, float* %19
%343 = fmul float %341, %342
%344 = call float @exp(float %343)
%345 = load float*, float** %25
%346 = load i32, i32* %30
%347 = sext i32 %346 to i64
%348 = getelementptr inbounds float, float* %345, i64 %347
store float %344, float* %348
%349 = load float*, float** %32
%350 = load i32, i32* %30
%351 = sext i32 %350 to i64
%352 = getelementptr inbounds float, float* %349, i64 %351
%353 = load float, float* %352
%354 = call double @fabs(float %353)
%355 = fcmp ogt double %354, 0x3EB0C6F7A0B5ED8D
br i1 %355, label %356, label %400
356: ; preds = %323
%357 = load float*, float** %32
%358 = load i32, i32* %30
%359 = sext i32 %358 to i64
%360 = getelementptr inbounds float, float* %357, i64 %359
%361 = load float, float* %360
%362 = fpext float %361 to double
%363 = load float*, float** %25
%364 = load i32, i32* %30
%365 = sext i32 %364 to i64
%366 = getelementptr inbounds float, float* %363, i64 %365
%367 = load float, float* %366
%368 = fpext float %367 to double
%369 = fsub double %368, 1.000000e+00
%370 = fmul double %362, %369
%371 = load float*, float** %24
%372 = load i32, i32* %30
%373 = sext i32 %372 to i64
%374 = getelementptr inbounds float, float* %371, i64 %373
%375 = load float, float* %374
%376 = load float*, float** %32
%377 = load i32, i32* %30
%378 = sext i32 %377 to i64
%379 = getelementptr inbounds float, float* %376, i64 %378
%380 = load float, float* %379
%381 = load float*, float** %24
%382 = load i32, i32* %30
%383 = sext i32 %382 to i64
%384 = getelementptr inbounds float, float* %381, i64 %383
%385 = load float, float* %384
%386 = load float*, float** %34
%387 = load i32, i32* %30
%388 = sext i32 %387 to i64
%389 = getelementptr inbounds float, float* %386, i64 %388
%390 = load float, float* %389
%391 = call float @llvm.fmuladd.f32(float %385, float %390, float %380)
%392 = fmul float %375, %391
%393 = fpext float %392 to double
%394 = fdiv double %370, %393
%395 = fptrunc double %394 to float
%396 = load float*, float** %26
%397 = load i32, i32* %30
%398 = sext i32 %397 to i64
%399 = getelementptr inbounds float, float* %396, i64 %398
store float %395, float* %399
br label %400
400: ; preds = %356, %323
%401 = load i32, i32* %20
%402 = mul nsw i32 2, %401
%403 = load i32, i32* %28
%404 = sub nsw i32 %402, %403
%405 = sub nsw i32 %404, 1
store i32 %405, i32* %29
%406 = load i32, i32* %28
%407 = icmp sgt i32 %406, 0
br i1 %407, label %408, label %448
408: ; preds = %400
%409 = load float*, float** %21
%410 = load i32, i32* %28
%411 = sext i32 %410 to i64
%412 = getelementptr inbounds float, float* %409, i64 %411
%413 = load float, float* %412
%414 = load float*, float** %21
%415 = load i32, i32* %29
%416 = add nsw i32 %415, 1
%417 = sext i32 %416 to i64
%418 = getelementptr inbounds float, float* %414, i64 %417
store float %413, float* %418
%419 = load float*, float** %22
%420 = load i32, i32* %28
%421 = sext i32 %420 to i64
%422 = getelementptr inbounds float, float* %419, i64 %421
%423 = load float, float* %422
%424 = load float*, float** %22
%425 = load i32, i32* %29
%426 = add nsw i32 %425, 1
%427 = sext i32 %426 to i64
%428 = getelementptr inbounds float, float* %424, i64 %427
store float %423, float* %428
%429 = load float*, float** %31
%430 = load i32, i32* %28
%431 = sext i32 %430 to i64
%432 = getelementptr inbounds float, float* %429, i64 %431
%433 = load float, float* %432
%434 = call double @fabs(float %433)
%435 = fcmp ogt double %434, 0x3EB0C6F7A0B5ED8D
br i1 %435, label %436, label %447
436: ; preds = %408
%437 = load float*, float** %23
%438 = load i32, i32* %28
%439 = sext i32 %438 to i64
%440 = getelementptr inbounds float, float* %437, i64 %439
%441 = load float, float* %440
%442 = load float*, float** %23
%443 = load i32, i32* %29
%444 = add nsw i32 %443, 1
%445 = sext i32 %444 to i64
%446 = getelementptr inbounds float, float* %442, i64 %445
store float %441, float* %446
br label %447
447: ; preds = %436, %408
br label %448
448: ; preds = %447, %400
%449 = load float*, float** %24
%450 = load i32, i32* %28
%451 = sext i32 %450 to i64
%452 = getelementptr inbounds float, float* %449, i64 %451
%453 = load float, float* %452
%454 = load float*, float** %24
%455 = load i32, i32* %29
%456 = sext i32 %455 to i64
%457 = getelementptr inbounds float, float* %454, i64 %456
store float %453, float* %457
%458 = load float*, float** %25
%459 = load i32, i32* %28
%460 = sext i32 %459 to i64
%461 = getelementptr inbounds float, float* %458, i64 %460
%462 = load float, float* %461
%463 = load float*, float** %25
%464 = load i32, i32* %29
%465 = sext i32 %464 to i64
%466 = getelementptr inbounds float, float* %463, i64 %465
store float %462, float* %466
%467 = load float*, float** %31
%468 = load i32, i32* %28
%469 = sext i32 %468 to i64
%470 = getelementptr inbounds float, float* %467, i64 %469
%471 = load float, float* %470
%472 = call double @fabs(float %471)
%473 = fcmp ogt double %472, 0x3EB0C6F7A0B5ED8D
br i1 %473, label %474, label %484
474: ; preds = %448
%475 = load float*, float** %26
%476 = load i32, i32* %28
%477 = sext i32 %476 to i64
%478 = getelementptr inbounds float, float* %475, i64 %477
%479 = load float, float* %478
%480 = load float*, float** %26
%481 = load i32, i32* %29
%482 = sext i32 %481 to i64
%483 = getelementptr inbounds float, float* %480, i64 %482
store float %479, float* %483
br label %484
484: ; preds = %474, %448
br label %485
485: ; preds = %484, %239
br label %486
486: ; preds = %485
%487 = load i32, i32* %28
%488 = add nsw i32 %487, 1
store i32 %488, i32* %28
br label %86
489: ; preds = %86
%490 = load float*, float** %31
%491 = call i32 @free(float* %490)
%492 = load float*, float** %32
%493 = call i32 @free(float* %492)
%494 = load float*, float** %33
%495 = call i32 @free(float* %494)
%496 = load float*, float** %34
%497 = call i32 @free(float* %496)
%498 = load i32, i32* %27
ret i32 %498
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"ERROR: alpha_prime_i[i] < 0.0, i %d\00"
@.str.1 = [46 x i8] c"ERROR: Position in PML (x-boundary) smaller 0\00"
@.str.2 = [41 x i8] c"ERROR: alpha_prime_i_half[i] < 0.0, i %d\00"
define i32 @CPML_coeff(float %0, float %1, float %2, float %3, float %4, float %5, i32 %6, float* nocapture %7, float* nocapture %8, float* nocapture %9, float* nocapture %10, float* nocapture %11, float* nocapture %12) {
%14 = shl i32 %6, 3
%15 = tail call float* @malloc(i32 %14)
%16 = tail call float* @malloc(i32 %14)
%17 = tail call float* @malloc(i32 %14)
%18 = tail call float* @malloc(i32 %14)
%19 = fadd float %0, 1.000000e+00
%20 = fneg float %19
%21 = fmul float %20, %3
%22 = fmul float %21, 0xC01C860A60000000
%23 = fpext float %22 to double
%24 = sitofp i32 %6 to double
%25 = fmul double %24, 2.000000e+00
%26 = fpext float %4 to double
%27 = fmul double %25, %26
%28 = fdiv double %23, %27
%29 = fptrunc double %28 to float
%30 = icmp slt i32 %6, 0
br i1 %30, label %193, label %31
31: ; preds = %13
%32 = fpext float %2 to double
%33 = fmul double %32, 5.000000e-01
%34 = fmul double %33, 0x401921FB54442D18
%35 = fptrunc double %34 to float
%36 = sitofp i32 %6 to float
%37 = fmul float %36, %4
%38 = fpext float %1 to double
%39 = fadd double %38, -1.000000e+00
%40 = fpext float %35 to double
%41 = shl nuw nsw i32 %6, 1
%42 = zext i32 %6 to i64
%43 = sext i32 %41 to i64
%44 = add nuw i32 %6, 1
%45 = zext i32 %44 to i64
br label %46
46: ; preds = %31, %189
%47 = phi i64 [ 0, %31 ], [ %191, %189 ]
%48 = phi i32 [ 0, %31 ], [ %190, %189 ]
%49 = getelementptr inbounds float, float* %7, i64 %47
%50 = trunc i64 %47 to i32
%51 = sub i32 %6, %50
%52 = sitofp i32 %51 to float
%53 = fmul float %52, %4
%54 = fdiv float %53, %37
%55 = tail call float @pow(float %54, float %0)
%56 = fmul float %55, 7.500000e-01
%57 = tail call float @llvm.fmuladd.f32(float %54, float 2.500000e-01, float %56)
%58 = tail call float @pow(float %54, float 4.000000e+00)
%59 = tail call float @llvm.fmuladd.f32(float %58, float 0.000000e+00, float %57)
%60 = fmul float %59, %29
%61 = getelementptr inbounds float, float* %15, i64 %47
store float %60, float* %61
%62 = tail call float @pow(float %54, float %0)
%63 = fpext float %62 to double
%64 = tail call double @llvm.fmuladd.f64(double %39, double %63, double 1.000000e+00)
%65 = fptrunc double %64 to float
store float %65, float* %49
%66 = fpext float %54 to double
%67 = fsub double 1.000000e+00, %66
%68 = fmul double %67, %40
%69 = fptrunc double %68 to float
%70 = getelementptr inbounds float, float* %17, i64 %47
store float %69, float* %70
%71 = fcmp olt float %69, 0.000000e+00
br i1 %71, label %72, label %77
72: ; preds = %46
%73 = load i32, i32* @stderr
%74 = trunc i64 %47 to i32
%75 = tail call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %74)
%76 = load float, float* %49
br label %77
77: ; preds = %72, %46
%78 = phi float [ %76, %72 ], [ %65, %46 ]
%79 = phi i32 [ 1, %72 ], [ %48, %46 ]
%80 = fdiv float %60, %78
%81 = fadd float %80, %69
%82 = fneg float %81
%83 = fmul float %82, %5
%84 = tail call float @exp(float %83)
%85 = getelementptr inbounds float, float* %8, i64 %47
store float %84, float* %85
%86 = tail call double @fabsf(float %60)
%87 = fcmp ogt double %86, 0x3EB0C6F7A0B5ED8D
br i1 %87, label %88, label %100
88: ; preds = %77
%89 = fpext float %60 to double
%90 = load float, float* %85
%91 = fpext float %90 to double
%92 = fadd double %91, -1.000000e+00
%93 = fmul double %92, %89
%94 = load float, float* %49
%95 = tail call float @llvm.fmuladd.f32(float %94, float %69, float %60)
%96 = fmul float %94, %95
%97 = fpext float %96 to double
%98 = fdiv double %93, %97
%99 = fptrunc double %98 to float
br label %100
100: ; preds = %77, %88
%101 = phi float [ %99, %88 ], [ 0.000000e+00, %77 ]
%102 = getelementptr inbounds float, float* %9, i64 %47
store float %101, float* %102
%103 = icmp ult i64 %47, %42
br i1 %103, label %104, label %189
104: ; preds = %100
%105 = sitofp i32 %51 to double
%106 = fadd double %105, 5.000000e-01
%107 = fadd double %106, -1.000000e+00
%108 = fmul double %107, %26
%109 = fptrunc double %108 to float
%110 = fdiv float %109, %37
%111 = getelementptr inbounds float, float* %10, i64 %47
store float 1.000000e+00, float* %111
%112 = tail call float @pow(float %110, float %0)
%113 = fmul float %112, 7.500000e-01
%114 = tail call float @llvm.fmuladd.f32(float %110, float 2.500000e-01, float %113)
%115 = tail call float @pow(float %110, float 4.000000e+00)
%116 = tail call float @llvm.fmuladd.f32(float %115, float 0.000000e+00, float %114)
%117 = fmul float %116, %29
%118 = getelementptr inbounds float, float* %16, i64 %47
store float %117, float* %118
%119 = fcmp olt float %109, 0.000000e+00
br i1 %119, label %120, label %123
120: ; preds = %104
%121 = load i32, i32* @stderr
%122 = tail call i32 (i32, i8*, ...) @fprintf(i32 %121, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
br label %123
123: ; preds = %120, %104
%124 = phi i32 [ 1, %120 ], [ %79, %104 ]
%125 = tail call float @pow(float %110, float %0)
%126 = fpext float %125 to double
%127 = tail call double @llvm.fmuladd.f64(double %39, double %126, double 1.000000e+00)
%128 = fptrunc double %127 to float
store float %128, float* %111
%129 = fpext float %110 to double
%130 = fsub double 1.000000e+00, %129
%131 = fmul double %130, %40
%132 = fptrunc double %131 to float
%133 = getelementptr inbounds float, float* %18, i64 %47
store float %132, float* %133
%134 = fcmp olt float %132, 0.000000e+00
br i1 %134, label %135, label %140
135: ; preds = %123
%136 = load i32, i32* @stderr
%137 = trunc i64 %47 to i32
%138 = tail call i32 (i32, i8*, ...) @fprintf(i32 %136, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i32 %137)
%139 = load float, float* %111
br label %140
140: ; preds = %135, %123
%141 = phi float [ %139, %135 ], [ %128, %123 ]
%142 = phi i32 [ 1, %135 ], [ %124, %123 ]
%143 = fdiv float %117, %141
%144 = fadd float %143, %132
%145 = fneg float %144
%146 = fmul float %145, %5
%147 = tail call float @exp(float %146)
%148 = getelementptr inbounds float, float* %11, i64 %47
store float %147, float* %148
%149 = tail call double @fabs(float %117)
%150 = fcmp ogt double %149, 0x3EB0C6F7A0B5ED8D
br i1 %150, label %151, label %164
151: ; preds = %140
%152 = fpext float %117 to double
%153 = load float, float* %148
%154 = fpext float %153 to double
%155 = fadd double %154, -1.000000e+00
%156 = fmul double %155, %152
%157 = load float, float* %111
%158 = tail call float @llvm.fmuladd.f32(float %157, float %132, float %117)
%159 = fmul float %157, %158
%160 = fpext float %159 to double
%161 = fdiv double %156, %160
%162 = fptrunc double %161 to float
%163 = getelementptr inbounds float, float* %12, i64 %47
store float %162, float* %163
br label %164
164: ; preds = %151, %140
%165 = sub nsw i64 %43, %47
%166 = add nsw i64 %165, -1
%167 = icmp eq i64 %47, 0
br i1 %167, label %178, label %168
168: ; preds = %164
%169 = load float, float* %49
%170 = getelementptr inbounds float, float* %7, i64 %165
store float %169, float* %170
%171 = load float, float* %85
%172 = getelementptr inbounds float, float* %8, i64 %165
store float %171, float* %172
%173 = tail call double @fabs(float %60)
%174 = fcmp ogt double %173, 0x3EB0C6F7A0B5ED8D
br i1 %174, label %175, label %178
175: ; preds = %168
%176 = load float, float* %102
%177 = getelementptr inbounds float, float* %9, i64 %165
store float %176, float* %177
br label %178
178: ; preds = %168, %175, %164
%179 = load float, float* %111
%180 = getelementptr inbounds float, float* %10, i64 %166
store float %179, float* %180
%181 = load float, float* %148
%182 = getelementptr inbounds float, float* %11, i64 %166
store float %181, float* %182
%183 = tail call double @fabs(float %60)
%184 = fcmp ogt double %183, 0x3EB0C6F7A0B5ED8D
br i1 %184, label %185, label %189
185: ; preds = %178
%186 = getelementptr inbounds float, float* %12, i64 %47
%187 = load float, float* %186
%188 = getelementptr inbounds float, float* %12, i64 %166
store float %187, float* %188
br label %189
189: ; preds = %100, %185, %178
%190 = phi i32 [ %142, %185 ], [ %142, %178 ], [ %79, %100 ]
%191 = add nuw nsw i64 %47, 1
%192 = icmp eq i64 %191, %45
br i1 %192, label %193, label %46
193: ; preds = %189, %13
%194 = phi i32 [ 0, %13 ], [ %190, %189 ]
%195 = tail call i32 @free(float* %15)
%196 = tail call i32 @free(float* %16)
%197 = tail call i32 @free(float* %17)
%198 = tail call i32 @free(float* %18)
ret i32 %194
}