#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 uint8_t;

/* Variables and functions */
double abs(double);
double aae_factor(uint8_t *orig, uint8_t *cmp, int orig_stride, int cmp_stride,
                  int width, int height, uint8_t max) {
  uint8_t *old, *new;
  double ret;
  double sum;
  double cfmax, cf;
  int i, j;
  int cnt;
  sum = 0.0;
  cnt = 0;
  old = orig;
  new = cmp;
  for (i = 0; i < height; i++) {
    for (j = 7; j < width - 1; j += 8) {
      double calc;
      cnt++;
      calc = abs((abs(old[j] - new[j])) - (abs(old[j + 1] - new[j + 1])));
      calc /= (abs((abs(old[j - 1] - new[j - 1])) - (abs(old[j] - new[j]))) +
               abs((abs(old[j + 1] - new[j + 1])) -
                   (abs(old[j + 2] - new[j + 2]))) +
               0.0001) /
              2.0;
      if (calc > 5.0)
        sum += 1.0;
      else if (calc > 2.0)
        sum += (calc - 2.0) / (5.0 - 2.0);
    }
    old += orig_stride;
    new += cmp_stride;
  }
  old = orig + 7 * orig_stride;
  new = cmp + 7 * cmp_stride;
  for (i = 7; i < height - 1; i += 8) {
    for (j = 0; j < width; j++) {
      double calc;
      cnt++;
      calc = abs((abs(old[j] - new[j])) -
                 (abs(old[j + 1 * orig_stride] - new[j + 1 * cmp_stride])));
      calc /= (abs((abs(old[j + -1 * orig_stride] - new[j + -1 * cmp_stride])) -
                   (abs(old[j] - new[j]))) +
               abs((abs(old[j + 1 * orig_stride] - new[j + 1 * cmp_stride])) -
                   (abs(old[j + 2 * orig_stride] - new[j + 2 * cmp_stride]))) +
               0.0001) /
              2.0;
      if (calc > 5.0)
        sum += 1.0;
      else if (calc > 2.0)
        sum += (calc - 2.0) / (5.0 - 2.0);
    }
    old += 8 * orig_stride;
    new += 8 * cmp_stride;
  }
  ret = 1 - (sum / (double)cnt);
  if (max > 128)
    cfmax = 0.65;
  else
    cfmax = 0.65 + 0.35 * ((128.0 - (double)max) / 128.0);
  cf = (cfmax > (1 < 0.25 + (1000.0 * (double)cnt) / sum
                     ? 1
                     : 0.25 + (1000.0 * (double)cnt) / sum)
            ? cfmax
            : (1 < 0.25 + (1000.0 * (double)cnt) / sum
                   ? 1
                   : 0.25 + (1000.0 * (double)cnt) / sum));
  return ret * cf;
}


x86 assembly (clang, -O0):
<aae_factor>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x5c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    13ac <aae_factor+0x29c>
movl   $0x7,-0x58(%rbp)
mov    -0x58(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1374 <aae_factor+0x264>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x58(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x30(%rbp),%rcx
movslq -0x58(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x28(%rbp),%rax
mov    -0x58(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x30(%rbp),%rcx
mov    -0x58(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movaps %xmm0,%xmm1
movsd  -0x90(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
call   1030 <abs@plt>
movsd  %xmm0,-0x68(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x58(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x30(%rbp),%rcx
mov    -0x58(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x28(%rbp),%rax
movslq -0x58(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x30(%rbp),%rcx
movslq -0x58(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movaps %xmm0,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
call   1030 <abs@plt>
movsd  %xmm0,-0x78(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x58(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x30(%rbp),%rcx
mov    -0x58(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movsd  %xmm0,-0x80(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x58(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x30(%rbp),%rcx
mov    -0x58(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
subsd  %xmm1,%xmm0
call   1030 <abs@plt>
movsd  -0x78(%rbp),%xmm1
addsd  %xmm0,%xmm1
movsd  0xd6e(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xd5a(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  0xd33(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    131e <aae_factor+0x20e>
movsd  0xcf1(%rip),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1361 <aae_factor+0x251>
movsd  -0x68(%rbp),%xmm0
movsd  0xd0d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    135c <aae_factor+0x24c>
movsd  -0x68(%rbp),%xmm0
movsd  0xcf6(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xcfa(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1361 <aae_factor+0x251>
jmp    1366 <aae_factor+0x256>
mov    -0x58(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x58(%rbp)
jmp    116d <aae_factor+0x5d>
mov    -0x14(%rbp),%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    115a <aae_factor+0x4a>
mov    -0x8(%rbp),%rax
imul   $0x7,-0x14(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
imul   $0x7,-0x18(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
movl   $0x7,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    166d <aae_factor+0x55d>
movl   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    162f <aae_factor+0x51f>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x58(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x30(%rbp),%rcx
movslq -0x58(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movsd  %xmm0,-0xb0(%rbp)
ff
mov    -0x28(%rbp),%rax
mov    -0x58(%rbp),%ecx
mov    -0x14(%rbp),%edx
shl    $0x0,%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x30(%rbp),%rcx
mov    -0x58(%rbp),%edx
mov    -0x18(%rbp),%esi
shl    $0x0,%esi
add    %esi,%edx
movslq %edx,%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
call   1030 <abs@plt>
movsd  %xmm0,-0x70(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   $0xffffffff,-0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x30(%rbp),%rcx
mov    -0x58(%rbp),%edx
imul   $0xffffffff,-0x18(%rbp),%esi
add    %esi,%edx
movslq %edx,%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x28(%rbp),%rax
movslq -0x58(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x30(%rbp),%rcx
movslq -0x58(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
call   1030 <abs@plt>
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x28(%rbp),%rax
mov    -0x58(%rbp),%ecx
mov    -0x14(%rbp),%edx
shl    $0x0,%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x30(%rbp),%rcx
mov    -0x58(%rbp),%edx
mov    -0x18(%rbp),%esi
shl    $0x0,%esi
add    %esi,%edx
movslq %edx,%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x28(%rbp),%rax
mov    -0x58(%rbp),%ecx
mov    -0x14(%rbp),%edx
shl    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x30(%rbp),%rcx
mov    -0x58(%rbp),%edx
mov    -0x18(%rbp),%esi
shl    $0x1,%esi
add    %esi,%edx
movslq %edx,%rdx
sub    (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movaps %xmm0,%xmm1
movsd  -0xa0(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
call   1030 <abs@plt>
movsd  -0x98(%rbp),%xmm1
ff
addsd  %xmm0,%xmm1
movsd  0xab3(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xa9f(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  0xa78(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    15d9 <aae_factor+0x4c9>
movsd  0xa36(%rip),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    161c <aae_factor+0x50c>
movsd  -0x70(%rbp),%xmm0
movsd  0xa52(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1617 <aae_factor+0x507>
movsd  -0x70(%rbp),%xmm0
movsd  0xa3b(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xa3f(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    161c <aae_factor+0x50c>
jmp    1621 <aae_factor+0x511>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    13f7 <aae_factor+0x2e7>
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%ecx
shl    $0x3,%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x54(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x54(%rbp)
jmp    13df <aae_factor+0x2cf>
movsd  -0x40(%rbp),%xmm1
cvtsi2sdl -0x5c(%rbp),%xmm0
divsd  %xmm0,%xmm1
movsd  0x97d(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
cmpl   $0x80,0x10(%rbp)
jle    16ab <aae_factor+0x59b>
movsd  0x96f(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    16e5 <aae_factor+0x5d5>
cvtsi2sdl 0x10(%rbp),%xmm1
movsd  0x960(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  0x954(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0x938(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x934(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
cvtsi2sdl -0x5c(%rbp),%xmm0
movsd  0x929(%rip),%xmm1
mulsd  %xmm0,%xmm1
divsd  -0x40(%rbp),%xmm1
movsd  0x910(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0x8e4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    173b <aae_factor+0x62b>
movsd  0x8d2(%rip),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
jmp    1765 <aae_factor+0x655>
cvtsi2sdl -0x5c(%rbp),%xmm0
movsd  0x8e0(%rip),%xmm1
mulsd  %xmm0,%xmm1
divsd  -0x40(%rbp),%xmm1
movsd  0x8c7(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  -0xc0(%rbp),%xmm1
ff
ucomisd %xmm1,%xmm0
jbe    1791 <aae_factor+0x681>
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
jmp    1814 <aae_factor+0x704>
cvtsi2sdl -0x5c(%rbp),%xmm0
movsd  0x88a(%rip),%xmm1
mulsd  %xmm0,%xmm1
divsd  -0x40(%rbp),%xmm1
movsd  0x871(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0x845(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    17da <aae_factor+0x6ca>
movsd  0x833(%rip),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
jmp    1804 <aae_factor+0x6f4>
cvtsi2sdl -0x5c(%rbp),%xmm0
movsd  0x841(%rip),%xmm1
mulsd  %xmm0,%xmm1
divsd  -0x40(%rbp),%xmm1
movsd  0x828(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aae_factor>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
test   %r9d,%r9d
jle    15bb <aae_factor+0x4ab>
mov    %r9d,0xc(%rsp)
mov    %r8,%rax
mov    %r8,0x40(%rsp)
lea    -0x1(%r8),%eax
movslq %edx,%rdx
movslq %ecx,%rcx
movslq %eax,%r12
mov    %rcx,0x50(%rsp)
lea    0x0(,%rcx,4),%rax
mov    %rax,0x30(%rsp)
mov    %rdx,0x58(%rsp)
lea    0x0(,%rdx,4),%rax
mov    %rax,0x28(%rsp)
xorpd  %xmm6,%xmm6
xor    %r14d,%r14d
mov    %rdi,0x38(%rsp)
mov    %rdi,%rbx
mov    %rsi,0x48(%rsp)
mov    %rsi,%rbp
xor    %r13d,%r13d
jmp    11a9 <aae_factor+0x99>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r13d
add    0x30(%rsp),%rbp
add    0x28(%rsp),%rbx
cmp    0xc(%rsp),%r13d
je     132b <aae_factor+0x21b>
cmpl   $0x9,0x40(%rsp)
jl     1190 <aae_factor+0x80>
mov    $0x9,%r15d
jmp    11e2 <aae_factor+0xd2>
nopl   0x0(%rax,%rax,1)
movsd  0x20(%rsp),%xmm6
addsd  0xe62(%rip),%xmm6
lea    0x8(%r15),%rax
add    $0x6,%r15
add    $0x1,%r14d
cmp    %r12,%r15
mov    %rax,%r15
jge    1190 <aae_factor+0x80>
movsd  %xmm6,0x20(%rsp)
mov    -0x8(%rbx,%r15,4),%eax
sub    -0x8(%rbp,%r15,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movsd  %xmm0,0x18(%rsp)
mov    -0x4(%rbx,%r15,4),%eax
sub    -0x4(%rbp,%r15,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movsd  0x18(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <abs@plt>
movsd  %xmm0,0x18(%rsp)
mov    -0xc(%rbx,%r15,4),%eax
sub    -0xc(%rbp,%r15,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movsd  %xmm0,0x10(%rsp)
mov    -0x8(%rbx,%r15,4),%eax
sub    -0x8(%rbp,%r15,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <abs@plt>
movsd  %xmm0,0x10(%rsp)
mov    -0x4(%rbx,%r15,4),%eax
sub    -0x4(%rbp,%r15,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movsd  %xmm0,0x60(%rsp)
mov    (%rbx,%r15,4),%eax
sub    0x0(%rbp,%r15,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movsd  0x60(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <abs@plt>
addsd  0x10(%rsp),%xmm0
addsd  0xd30(%rip),%xmm0
mulsd  0xd30(%rip),%xmm0
movsd  0x18(%rsp),%xmm1
divsd  %xmm0,%xmm1
ucomisd 0xd26(%rip),%xmm1
ja     11c0 <aae_factor+0xb0>
movapd %xmm1,%xmm0
ucomisd 0xd1c(%rip),%xmm1
jbe    1320 <aae_factor+0x210>
addsd  0xd1a(%rip),%xmm0
divsd  0xd1a(%rip),%xmm0
movsd  0x20(%rsp),%xmm6
addsd  %xmm0,%xmm6
jmp    11ce <aae_factor+0xbe>
nopl   (%rax)
movsd  0x20(%rsp),%xmm6
jmp    11ce <aae_factor+0xbe>
mov    0xc(%rsp),%edi
cmp    $0x9,%edi
jl     15c2 <aae_factor+0x4b2>
add    $0xffffffff,%edi
mov    0x50(%rsp),%r8
lea    0x0(,%r8,8),%eax
movslq %eax,%r9
sub    %r8d,%eax
cltq
mov    0x48(%rsp),%r11
lea    (%r11,%rax,4),%r13
mov    0x58(%rsp),%rbp
lea    0x0(,%rbp,8),%ecx
movslq %ecx,%r10
sub    %ebp,%ecx
movslq %ecx,%rcx
mov    0x38(%rsp),%rbx
lea    (%rbx,%rcx,4),%r15
lea    (%r8,%r8,1),%edx
movslq %edx,%rdx
add    %rax,%rdx
mov    %r8,%rsi
add    %rax,%rsi
lea    0x0(%rbp,%rbp,1),%eax
cltq
lea    (%r11,%rdx,4),%rdx
mov    %rdx,0x30(%rsp)
add    %rcx,%rax
lea    (%r11,%rsi,4),%r12
mov    %rbp,%rdx
add    %rcx,%rdx
mov    0x40(%rsp),%rcx
mov    %ecx,%esi
mov    %rsi,0x48(%rsp)
shl    $0x2,%r9
mov    %r9,0x70(%rsp)
lea    (%rbx,%rax,4),%rax
mov    %rax,0x28(%rsp)
shl    $0x2,%r10
mov    %r10,0x68(%rsp)
lea    (%rbx,%rdx,4),%rbx
neg    %r8d
mov    %r8,0x50(%rsp)
neg    %ebp
mov    %rbp,0x58(%rsp)
mov    $0x7,%esi
mov    %edi,0xc(%rsp)
jmp    142b <aae_factor+0x31b>
nopw   0x0(%rax,%rax,1)
mov    0x40(%rsp),%rcx
add    %ecx,%r14d
mov    0xc(%rsp),%edi
mov    0x38(%rsp),%esi
mov    0x68(%rsp),%rdx
add    %rdx,%r15
mov    0x70(%rsp),%rax
add    %rax,%r13
add    $0x8,%esi
add    %rax,0x30(%rsp)
add    %rdx,0x28(%rsp)
add    %rax,%r12
add    %rdx,%rbx
cmp    %edi,%esi
jge    15c2 <aae_factor+0x4b2>
test   %ecx,%ecx
jle    1400 <aae_factor+0x2f0>
mov    %esi,0x38(%rsp)
xor    %ebp,%ebp
jmp    1459 <aae_factor+0x349>
nopw   0x0(%rax,%rax,1)
movsd  0x20(%rsp),%xmm6
addsd  0xbe2(%rip),%xmm6
add    $0x1,%rbp
cmp    %rbp,0x48(%rsp)
je     13f0 <aae_factor+0x2e0>
movsd  %xmm6,0x20(%rsp)
mov    (%r15,%rbp,4),%eax
sub    0x0(%r13,%rbp,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movsd  %xmm0,0x18(%rsp)
mov    (%rbx,%rbp,4),%eax
sub    (%r12,%rbp,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movsd  0x18(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <abs@plt>
movsd  %xmm0,0x18(%rsp)
mov    0x58(%rsp),%rax
add    %ebp,%eax
cltq
mov    (%r15,%rax,4),%eax
mov    0x50(%rsp),%rcx
add    %ebp,%ecx
movslq %ecx,%rcx
sub    0x0(%r13,%rcx,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movsd  %xmm0,0x10(%rsp)
mov    (%r15,%rbp,4),%eax
sub    0x0(%r13,%rbp,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <abs@plt>
movsd  %xmm0,0x10(%rsp)
mov    (%rbx,%rbp,4),%eax
sub    (%r12,%rbp,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movsd  %xmm0,0x60(%rsp)
mov    0x28(%rsp),%rax
mov    (%rax,%rbp,4),%eax
mov    0x30(%rsp),%rcx
sub    (%rcx,%rbp,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1030 <abs@plt>
movsd  0x60(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <abs@plt>
addsd  0x10(%rsp),%xmm0
addsd  0xaa8(%rip),%xmm0
mulsd  0xaa8(%rip),%xmm0
movsd  0x18(%rsp),%xmm1
divsd  %xmm0,%xmm1
ucomisd 0xa9e(%rip),%xmm1
ja     1440 <aae_factor+0x330>
movapd %xmm1,%xmm0
ucomisd 0xa94(%rip),%xmm1
jbe    15b0 <aae_factor+0x4a0>
addsd  0xa92(%rip),%xmm0
divsd  0xa92(%rip),%xmm0
movsd  0x20(%rsp),%xmm6
addsd  %xmm0,%xmm6
jmp    144e <aae_factor+0x33e>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  0x20(%rsp),%xmm6
jmp    144e <aae_factor+0x33e>
xor    %r14d,%r14d
xorpd  %xmm6,%xmm6
xorps  %xmm1,%xmm1
cvtsi2sd %r14d,%xmm1
mov    0xb0(%rsp),%eax
cmp    $0x80,%eax
jle    15e2 <aae_factor+0x4d2>
movsd  0xa58(%rip),%xmm2
jmp    160d <aae_factor+0x4fd>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xa4f(%rip),%xmm2
subsd  %xmm0,%xmm2
mulsd  0xa4b(%rip),%xmm2
mulsd  0xa4b(%rip),%xmm2
addsd  0xa2b(%rip),%xmm2
movsd  0xa43(%rip),%xmm3
mulsd  %xmm1,%xmm3
divsd  %xmm6,%xmm3
addsd  0xa3b(%rip),%xmm3
movsd  0xa03(%rip),%xmm0
movapd %xmm0,%xmm4
minsd  %xmm3,%xmm4
ucomisd %xmm4,%xmm2
cmpltsd %xmm2,%xmm4
andpd  %xmm4,%xmm2
andnpd %xmm0,%xmm4
orpd   %xmm2,%xmm4
movapd %xmm0,%xmm2
cmpltsd %xmm3,%xmm2
movapd %xmm2,%xmm5
andpd  %xmm4,%xmm5
ja     1661 <aae_factor+0x551>
movapd %xmm3,%xmm4
andnpd %xmm4,%xmm2
orpd   %xmm5,%xmm2
divsd  %xmm1,%xmm6
subsd  %xmm6,%xmm0
mulsd  %xmm2,%xmm0
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @aae_factor(i32* %0, i32* %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca double
%25 = alloca double
store i32* %0, i32** %8
store i32* %1, i32** %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
store double 0.000000e+00, double* %18
store i32 0, i32* %23
%26 = load i32*, i32** %8
store i32* %26, i32** %15
%27 = load i32*, i32** %9
store i32* %27, i32** %16
store i32 0, i32* %21
br label %28
28: ; preds = %166, %7
%29 = load i32, i32* %21
%30 = load i32, i32* %13
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %169
32: ; preds = %28
store i32 7, i32* %22
br label %33
33: ; preds = %154, %32
%34 = load i32, i32* %22
%35 = load i32, i32* %12
%36 = sub nsw i32 %35, 1
%37 = icmp slt i32 %34, %36
br i1 %37, label %38, label %157
38: ; preds = %33
%39 = load i32, i32* %23
%40 = add nsw i32 %39, 1
store i32 %40, i32* %23
%41 = load i32*, i32** %15
%42 = load i32, i32* %22
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i32, i32* %41, i64 %43
%45 = load i32, i32* %44
%46 = load i32*, i32** %16
%47 = load i32, i32* %22
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i32, i32* %46, i64 %48
%50 = load i32, i32* %49
%51 = sub nsw i32 %45, %50
%52 = sitofp i32 %51 to double
%53 = call double @abs(double %52)
%54 = load i32*, i32** %15
%55 = load i32, i32* %22
%56 = add nsw i32 %55, 1
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i32, i32* %54, i64 %57
%59 = load i32, i32* %58
%60 = load i32*, i32** %16
%61 = load i32, i32* %22
%62 = add nsw i32 %61, 1
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i32, i32* %60, i64 %63
%65 = load i32, i32* %64
%66 = sub nsw i32 %59, %65
%67 = sitofp i32 %66 to double
%68 = call double @abs(double %67)
%69 = fsub double %53, %68
%70 = call double @abs(double %69)
store double %70, double* %24
%71 = load i32*, i32** %15
%72 = load i32, i32* %22
%73 = sub nsw i32 %72, 1
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i32, i32* %71, i64 %74
%76 = load i32, i32* %75
%77 = load i32*, i32** %16
%78 = load i32, i32* %22
%79 = sub nsw i32 %78, 1
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds i32, i32* %77, i64 %80
%82 = load i32, i32* %81
%83 = sub nsw i32 %76, %82
%84 = sitofp i32 %83 to double
%85 = call double @abs(double %84)
%86 = load i32*, i32** %15
%87 = load i32, i32* %22
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i32, i32* %86, i64 %88
%90 = load i32, i32* %89
%91 = load i32*, i32** %16
%92 = load i32, i32* %22
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i32, i32* %91, i64 %93
%95 = load i32, i32* %94
%96 = sub nsw i32 %90, %95
%97 = sitofp i32 %96 to double
%98 = call double @abs(double %97)
%99 = fsub double %85, %98
%100 = call double @abs(double %99)
%101 = load i32*, i32** %15
%102 = load i32, i32* %22
%103 = add nsw i32 %102, 1
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i32, i32* %101, i64 %104
%106 = load i32, i32* %105
%107 = load i32*, i32** %16
%108 = load i32, i32* %22
%109 = add nsw i32 %108, 1
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds i32, i32* %107, i64 %110
%112 = load i32, i32* %111
%113 = sub nsw i32 %106, %112
%114 = sitofp i32 %113 to double
%115 = call double @abs(double %114)
%116 = load i32*, i32** %15
%117 = load i32, i32* %22
%118 = add nsw i32 %117, 2
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds i32, i32* %116, i64 %119
%121 = load i32, i32* %120
%122 = load i32*, i32** %16
%123 = load i32, i32* %22
%124 = add nsw i32 %123, 2
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds i32, i32* %122, i64 %125
%127 = load i32, i32* %126
%128 = sub nsw i32 %121, %127
%129 = sitofp i32 %128 to double
%130 = call double @abs(double %129)
%131 = fsub double %115, %130
%132 = call double @abs(double %131)
%133 = fadd double %100, %132
%134 = fadd double %133, 1.000000e-04
%135 = fdiv double %134, 2.000000e+00
%136 = load double, double* %24
%137 = fdiv double %136, %135
store double %137, double* %24
%138 = load double, double* %24
%139 = fcmp ogt double %138, 5.000000e+00
br i1 %139, label %140, label %143
140: ; preds = %38
%141 = load double, double* %18
%142 = fadd double %141, 1.000000e+00
store double %142, double* %18
br label %153
143: ; preds = %38
%144 = load double, double* %24
%145 = fcmp ogt double %144, 2.000000e+00
br i1 %145, label %146, label %152
146: ; preds = %143
%147 = load double, double* %24
%148 = fsub double %147, 2.000000e+00
%149 = fdiv double %148, 3.000000e+00
%150 = load double, double* %18
%151 = fadd double %150, %149
store double %151, double* %18
br label %152
152: ; preds = %146, %143
br label %153
153: ; preds = %152, %140
br label %154
154: ; preds = %153
%155 = load i32, i32* %22
%156 = add nsw i32 %155, 8
store i32 %156, i32* %22
br label %33
157: ; preds = %33
%158 = load i32, i32* %10
%159 = load i32*, i32** %15
%160 = sext i32 %158 to i64
%161 = getelementptr inbounds i32, i32* %159, i64 %160
store i32* %161, i32** %15
%162 = load i32, i32* %11
%163 = load i32*, i32** %16
%164 = sext i32 %162 to i64
%165 = getelementptr inbounds i32, i32* %163, i64 %164
store i32* %165, i32** %16
br label %166
166: ; preds = %157
%167 = load i32, i32* %21
%168 = add nsw i32 %167, 1
store i32 %168, i32* %21
br label %28
169: ; preds = %28
%170 = load i32*, i32** %8
%171 = load i32, i32* %10
%172 = mul nsw i32 7, %171
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds i32, i32* %170, i64 %173
store i32* %174, i32** %15
%175 = load i32*, i32** %9
%176 = load i32, i32* %11
%177 = mul nsw i32 7, %176
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds i32, i32* %175, i64 %178
store i32* %179, i32** %16
store i32 7, i32* %21
br label %180
180: ; preds = %336, %169
%181 = load i32, i32* %21
%182 = load i32, i32* %13
%183 = sub nsw i32 %182, 1
%184 = icmp slt i32 %181, %183
br i1 %184, label %185, label %339
185: ; preds = %180
store i32 0, i32* %22
br label %186
186: ; preds = %322, %185
%187 = load i32, i32* %22
%188 = load i32, i32* %12
%189 = icmp slt i32 %187, %188
br i1 %189, label %190, label %325
190: ; preds = %186
%191 = load i32, i32* %23
%192 = add nsw i32 %191, 1
store i32 %192, i32* %23
%193 = load i32*, i32** %15
%194 = load i32, i32* %22
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds i32, i32* %193, i64 %195
%197 = load i32, i32* %196
%198 = load i32*, i32** %16
%199 = load i32, i32* %22
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds i32, i32* %198, i64 %200
%202 = load i32, i32* %201
%203 = sub nsw i32 %197, %202
%204 = sitofp i32 %203 to double
%205 = call double @abs(double %204)
%206 = load i32*, i32** %15
%207 = load i32, i32* %22
%208 = load i32, i32* %10
%209 = mul nsw i32 1, %208
%210 = add nsw i32 %207, %209
%211 = sext i32 %210 to i64
%212 = getelementptr inbounds i32, i32* %206, i64 %211
%213 = load i32, i32* %212
%214 = load i32*, i32** %16
%215 = load i32, i32* %22
%216 = load i32, i32* %11
%217 = mul nsw i32 1, %216
%218 = add nsw i32 %215, %217
%219 = sext i32 %218 to i64
%220 = getelementptr inbounds i32, i32* %214, i64 %219
%221 = load i32, i32* %220
%222 = sub nsw i32 %213, %221
%223 = sitofp i32 %222 to double
%224 = call double @abs(double %223)
%225 = fsub double %205, %224
%226 = call double @abs(double %225)
store double %226, double* %25
%227 = load i32*, i32** %15
%228 = load i32, i32* %22
%229 = load i32, i32* %10
%230 = mul nsw i32 -1, %229
%231 = add nsw i32 %228, %230
%232 = sext i32 %231 to i64
%233 = getelementptr inbounds i32, i32* %227, i64 %232
%234 = load i32, i32* %233
%235 = load i32*, i32** %16
%236 = load i32, i32* %22
%237 = load i32, i32* %11
%238 = mul nsw i32 -1, %237
%239 = add nsw i32 %236, %238
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds i32, i32* %235, i64 %240
%242 = load i32, i32* %241
%243 = sub nsw i32 %234, %242
%244 = sitofp i32 %243 to double
%245 = call double @abs(double %244)
%246 = load i32*, i32** %15
%247 = load i32, i32* %22
%248 = sext i32 %247 to i64
%249 = getelementptr inbounds i32, i32* %246, i64 %248
%250 = load i32, i32* %249
%251 = load i32*, i32** %16
%252 = load i32, i32* %22
%253 = sext i32 %252 to i64
%254 = getelementptr inbounds i32, i32* %251, i64 %253
%255 = load i32, i32* %254
%256 = sub nsw i32 %250, %255
%257 = sitofp i32 %256 to double
%258 = call double @abs(double %257)
%259 = fsub double %245, %258
%260 = call double @abs(double %259)
%261 = load i32*, i32** %15
%262 = load i32, i32* %22
%263 = load i32, i32* %10
%264 = mul nsw i32 1, %263
%265 = add nsw i32 %262, %264
%266 = sext i32 %265 to i64
%267 = getelementptr inbounds i32, i32* %261, i64 %266
%268 = load i32, i32* %267
%269 = load i32*, i32** %16
%270 = load i32, i32* %22
%271 = load i32, i32* %11
%272 = mul nsw i32 1, %271
%273 = add nsw i32 %270, %272
%274 = sext i32 %273 to i64
%275 = getelementptr inbounds i32, i32* %269, i64 %274
%276 = load i32, i32* %275
%277 = sub nsw i32 %268, %276
%278 = sitofp i32 %277 to double
%279 = call double @abs(double %278)
%280 = load i32*, i32** %15
%281 = load i32, i32* %22
%282 = load i32, i32* %10
%283 = mul nsw i32 2, %282
%284 = add nsw i32 %281, %283
%285 = sext i32 %284 to i64
%286 = getelementptr inbounds i32, i32* %280, i64 %285
%287 = load i32, i32* %286
%288 = load i32*, i32** %16
%289 = load i32, i32* %22
%290 = load i32, i32* %11
%291 = mul nsw i32 2, %290
%292 = add nsw i32 %289, %291
%293 = sext i32 %292 to i64
%294 = getelementptr inbounds i32, i32* %288, i64 %293
%295 = load i32, i32* %294
%296 = sub nsw i32 %287, %295
%297 = sitofp i32 %296 to double
%298 = call double @abs(double %297)
%299 = fsub double %279, %298
%300 = call double @abs(double %299)
%301 = fadd double %260, %300
%302 = fadd double %301, 1.000000e-04
%303 = fdiv double %302, 2.000000e+00
%304 = load double, double* %25
%305 = fdiv double %304, %303
store double %305, double* %25
%306 = load double, double* %25
%307 = fcmp ogt double %306, 5.000000e+00
br i1 %307, label %308, label %311
308: ; preds = %190
%309 = load double, double* %18
%310 = fadd double %309, 1.000000e+00
store double %310, double* %18
br label %321
311: ; preds = %190
%312 = load double, double* %25
%313 = fcmp ogt double %312, 2.000000e+00
br i1 %313, label %314, label %320
314: ; preds = %311
%315 = load double, double* %25
%316 = fsub double %315, 2.000000e+00
%317 = fdiv double %316, 3.000000e+00
%318 = load double, double* %18
%319 = fadd double %318, %317
store double %319, double* %18
br label %320
320: ; preds = %314, %311
br label %321
321: ; preds = %320, %308
br label %322
322: ; preds = %321
%323 = load i32, i32* %22
%324 = add nsw i32 %323, 1
store i32 %324, i32* %22
br label %186
325: ; preds = %186
%326 = load i32, i32* %10
%327 = mul nsw i32 8, %326
%328 = load i32*, i32** %15
%329 = sext i32 %327 to i64
%330 = getelementptr inbounds i32, i32* %328, i64 %329
store i32* %330, i32** %15
%331 = load i32, i32* %11
%332 = mul nsw i32 8, %331
%333 = load i32*, i32** %16
%334 = sext i32 %332 to i64
%335 = getelementptr inbounds i32, i32* %333, i64 %334
store i32* %335, i32** %16
br label %336
336: ; preds = %325
%337 = load i32, i32* %21
%338 = add nsw i32 %337, 8
store i32 %338, i32* %21
br label %180
339: ; preds = %180
%340 = load double, double* %18
%341 = load i32, i32* %23
%342 = sitofp i32 %341 to double
%343 = fdiv double %340, %342
%344 = fsub double 1.000000e+00, %343
store double %344, double* %17
%345 = load i32, i32* %14
%346 = icmp sgt i32 %345, 128
br i1 %346, label %347, label %348
347: ; preds = %339
store double 6.500000e-01, double* %19
br label %354
348: ; preds = %339
%349 = load i32, i32* %14
%350 = sitofp i32 %349 to double
%351 = fsub double 1.280000e+02, %350
%352 = fdiv double %351, 1.280000e+02
%353 = call double @llvm.fmuladd.f64(double 3.500000e-01, double %352, double 6.500000e-01)
store double %353, double* %19
br label %354
354: ; preds = %348, %347
%355 = load double, double* %19
%356 = load i32, i32* %23
%357 = sitofp i32 %356 to double
%358 = fmul double 1.000000e+03, %357
%359 = load double, double* %18
%360 = fdiv double %358, %359
%361 = fadd double 2.500000e-01, %360
%362 = fcmp olt double 1.000000e+00, %361
br i1 %362, label %363, label %364
363: ; preds = %354
br label %371
364: ; preds = %354
%365 = load i32, i32* %23
%366 = sitofp i32 %365 to double
%367 = fmul double 1.000000e+03, %366
%368 = load double, double* %18
%369 = fdiv double %367, %368
%370 = fadd double 2.500000e-01, %369
br label %371
371: ; preds = %364, %363
%372 = phi double [ 1.000000e+00, %363 ], [ %370, %364 ]
%373 = fcmp ogt double %355, %372
br i1 %373, label %374, label %376
374: ; preds = %371
%375 = load double, double* %19
br label %394
376: ; preds = %371
%377 = load i32, i32* %23
%378 = sitofp i32 %377 to double
%379 = fmul double 1.000000e+03, %378
%380 = load double, double* %18
%381 = fdiv double %379, %380
%382 = fadd double 2.500000e-01, %381
%383 = fcmp olt double 1.000000e+00, %382
br i1 %383, label %384, label %385
384: ; preds = %376
br label %392
385: ; preds = %376
%386 = load i32, i32* %23
%387 = sitofp i32 %386 to double
%388 = fmul double 1.000000e+03, %387
%389 = load double, double* %18
%390 = fdiv double %388, %389
%391 = fadd double 2.500000e-01, %390
br label %392
392: ; preds = %385, %384
%393 = phi double [ 1.000000e+00, %384 ], [ %391, %385 ]
br label %394
394: ; preds = %392, %374
%395 = phi double [ %375, %374 ], [ %393, %392 ]
store double %395, double* %20
%396 = load double, double* %17
%397 = load double, double* %20
%398 = fmul double %396, %397
ret double %398
}

LLVM IR (-O2):
define double @aae_factor(i32* nocapture %0, i32* nocapture %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = icmp sgt i32 %5, 0
br i1 %8, label %9, label %209
9: ; preds = %7
%10 = add nsw i32 %4, -1
%11 = icmp sgt i32 %4, 8
%12 = sext i32 %2 to i64
%13 = sext i32 %3 to i64
%14 = sext i32 %10 to i64
br label %15
15: ; preds = %9, %92
%16 = phi i32 [ 0, %9 ], [ %94, %92 ]
%17 = phi i32 [ 0, %9 ], [ %97, %92 ]
%18 = phi i32* [ %0, %9 ], [ %95, %92 ]
%19 = phi double [ 0.000000e+00, %9 ], [ %93, %92 ]
%20 = phi i32* [ %1, %9 ], [ %96, %92 ]
br i1 %11, label %21, label %92
21: ; preds = %15, %88
%22 = phi i64 [ %90, %88 ], [ 7, %15 ]
%23 = phi i32 [ %25, %88 ], [ %16, %15 ]
%24 = phi double [ %89, %88 ], [ %19, %15 ]
%25 = add nsw i32 %23, 1
%26 = getelementptr inbounds i32, i32* %18, i64 %22
%27 = load i32, i32* %26
%28 = getelementptr inbounds i32, i32* %20, i64 %22
%29 = load i32, i32* %28
%30 = sub nsw i32 %27, %29
%31 = sitofp i32 %30 to double
%32 = tail call double @abs(double %31)
%33 = add nsw i64 %22, 1
%34 = and i64 %33, 4294967295
%35 = getelementptr inbounds i32, i32* %18, i64 %34
%36 = load i32, i32* %35
%37 = getelementptr inbounds i32, i32* %20, i64 %34
%38 = load i32, i32* %37
%39 = sub nsw i32 %36, %38
%40 = sitofp i32 %39 to double
%41 = tail call double @abs(double %40)
%42 = fsub double %32, %41
%43 = tail call double @abs(double %42)
%44 = add nsw i64 %22, -1
%45 = getelementptr inbounds i32, i32* %18, i64 %44
%46 = load i32, i32* %45
%47 = getelementptr inbounds i32, i32* %20, i64 %44
%48 = load i32, i32* %47
%49 = sub nsw i32 %46, %48
%50 = sitofp i32 %49 to double
%51 = tail call double @abs(double %50)
%52 = load i32, i32* %26
%53 = load i32, i32* %28
%54 = sub nsw i32 %52, %53
%55 = sitofp i32 %54 to double
%56 = tail call double @abs(double %55)
%57 = fsub double %51, %56
%58 = tail call double @abs(double %57)
%59 = load i32, i32* %35
%60 = load i32, i32* %37
%61 = sub nsw i32 %59, %60
%62 = sitofp i32 %61 to double
%63 = tail call double @abs(double %62)
%64 = add i64 %22, 2
%65 = and i64 %64, 4294967295
%66 = getelementptr inbounds i32, i32* %18, i64 %65
%67 = load i32, i32* %66
%68 = getelementptr inbounds i32, i32* %20, i64 %65
%69 = load i32, i32* %68
%70 = sub nsw i32 %67, %69
%71 = sitofp i32 %70 to double
%72 = tail call double @abs(double %71)
%73 = fsub double %63, %72
%74 = tail call double @abs(double %73)
%75 = fadd double %58, %74
%76 = fadd double %75, 1.000000e-04
%77 = fmul double %76, 5.000000e-01
%78 = fdiv double %43, %77
%79 = fcmp ogt double %78, 5.000000e+00
br i1 %79, label %80, label %82
80: ; preds = %21
%81 = fadd double %24, 1.000000e+00
br label %88
82: ; preds = %21
%83 = fcmp ogt double %78, 2.000000e+00
br i1 %83, label %84, label %88
84: ; preds = %82
%85 = fadd double %78, -2.000000e+00
%86 = fdiv double %85, 3.000000e+00
%87 = fadd double %24, %86
br label %88
88: ; preds = %82, %84, %80
%89 = phi double [ %81, %80 ], [ %87, %84 ], [ %24, %82 ]
%90 = add nuw i64 %22, 8
%91 = icmp slt i64 %90, %14
br i1 %91, label %21, label %92
92: ; preds = %88, %15
%93 = phi double [ %19, %15 ], [ %89, %88 ]
%94 = phi i32 [ %16, %15 ], [ %25, %88 ]
%95 = getelementptr inbounds i32, i32* %18, i64 %12
%96 = getelementptr inbounds i32, i32* %20, i64 %13
%97 = add nuw nsw i32 %17, 1
%98 = icmp eq i32 %97, %5
br i1 %98, label %99, label %15
99: ; preds = %92
%100 = add nsw i32 %5, -1
%101 = icmp sgt i32 %5, 8
br i1 %101, label %102, label %209
102: ; preds = %99
%103 = mul nsw i32 %3, 7
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i32, i32* %1, i64 %104
%106 = mul nsw i32 %2, 7
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i32, i32* %0, i64 %107
%109 = icmp sgt i32 %4, 0
%110 = shl nsw i32 %2, 1
%111 = shl nsw i32 %3, 1
%112 = shl nsw i32 %2, 3
%113 = sext i32 %112 to i64
%114 = shl nsw i32 %3, 3
%115 = sext i32 %114 to i64
%116 = sext i32 %2 to i64
%117 = sext i32 %3 to i64
%118 = sext i32 %110 to i64
%119 = sext i32 %111 to i64
%120 = zext i32 %4 to i64
br label %121
121: ; preds = %102, %202
%122 = phi i32 [ %94, %102 ], [ %204, %202 ]
%123 = phi i32 [ 7, %102 ], [ %207, %202 ]
%124 = phi i32* [ %108, %102 ], [ %205, %202 ]
%125 = phi double [ %93, %102 ], [ %203, %202 ]
%126 = phi i32* [ %105, %102 ], [ %206, %202 ]
br i1 %109, label %127, label %202
127: ; preds = %121, %196
%128 = phi i64 [ %198, %196 ], [ 0, %121 ]
%129 = phi double [ %197, %196 ], [ %125, %121 ]
%130 = getelementptr inbounds i32, i32* %124, i64 %128
%131 = load i32, i32* %130
%132 = getelementptr inbounds i32, i32* %126, i64 %128
%133 = load i32, i32* %132
%134 = sub nsw i32 %131, %133
%135 = sitofp i32 %134 to double
%136 = tail call double @abs(double %135)
%137 = add nsw i64 %128, %116
%138 = getelementptr inbounds i32, i32* %124, i64 %137
%139 = load i32, i32* %138
%140 = add nsw i64 %128, %117
%141 = getelementptr inbounds i32, i32* %126, i64 %140
%142 = load i32, i32* %141
%143 = sub nsw i32 %139, %142
%144 = sitofp i32 %143 to double
%145 = tail call double @abs(double %144)
%146 = fsub double %136, %145
%147 = tail call double @abs(double %146)
%148 = trunc i64 %128 to i32
%149 = sub i32 %148, %2
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds i32, i32* %124, i64 %150
%152 = load i32, i32* %151
%153 = sub i32 %148, %3
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds i32, i32* %126, i64 %154
%156 = load i32, i32* %155
%157 = sub nsw i32 %152, %156
%158 = sitofp i32 %157 to double
%159 = tail call double @abs(double %158)
%160 = load i32, i32* %130
%161 = load i32, i32* %132
%162 = sub nsw i32 %160, %161
%163 = sitofp i32 %162 to double
%164 = tail call double @abs(double %163)
%165 = fsub double %159, %164
%166 = tail call double @abs(double %165)
%167 = load i32, i32* %138
%168 = load i32, i32* %141
%169 = sub nsw i32 %167, %168
%170 = sitofp i32 %169 to double
%171 = tail call double @abs(double %170)
%172 = add nsw i64 %128, %118
%173 = getelementptr inbounds i32, i32* %124, i64 %172
%174 = load i32, i32* %173
%175 = add nsw i64 %128, %119
%176 = getelementptr inbounds i32, i32* %126, i64 %175
%177 = load i32, i32* %176
%178 = sub nsw i32 %174, %177
%179 = sitofp i32 %178 to double
%180 = tail call double @abs(double %179)
%181 = fsub double %171, %180
%182 = tail call double @abs(double %181)
%183 = fadd double %166, %182
%184 = fadd double %183, 1.000000e-04
%185 = fmul double %184, 5.000000e-01
%186 = fdiv double %147, %185
%187 = fcmp ogt double %186, 5.000000e+00
br i1 %187, label %188, label %190
188: ; preds = %127
%189 = fadd double %129, 1.000000e+00
br label %196
190: ; preds = %127
%191 = fcmp ogt double %186, 2.000000e+00
br i1 %191, label %192, label %196
192: ; preds = %190
%193 = fadd double %186, -2.000000e+00
%194 = fdiv double %193, 3.000000e+00
%195 = fadd double %129, %194
br label %196
196: ; preds = %190, %192, %188
%197 = phi double [ %189, %188 ], [ %195, %192 ], [ %129, %190 ]
%198 = add nuw nsw i64 %128, 1
%199 = icmp eq i64 %198, %120
br i1 %199, label %200, label %127
200: ; preds = %196
%201 = add i32 %122, %4
br label %202
202: ; preds = %200, %121
%203 = phi double [ %125, %121 ], [ %197, %200 ]
%204 = phi i32 [ %122, %121 ], [ %201, %200 ]
%205 = getelementptr inbounds i32, i32* %124, i64 %113
%206 = getelementptr inbounds i32, i32* %126, i64 %115
%207 = add nuw nsw i32 %123, 8
%208 = icmp slt i32 %207, %100
br i1 %208, label %121, label %209
209: ; preds = %202, %7, %99
%210 = phi double [ %93, %99 ], [ 0.000000e+00, %7 ], [ %203, %202 ]
%211 = phi i32 [ %94, %99 ], [ 0, %7 ], [ %204, %202 ]
%212 = sitofp i32 %211 to double
%213 = icmp sgt i32 %6, 128
br i1 %213, label %219, label %214
214: ; preds = %209
%215 = sitofp i32 %6 to double
%216 = fsub double 1.280000e+02, %215
%217 = fmul double %216, 7.812500e-03
%218 = tail call double @llvm.fmuladd.f64(double %217, double 3.500000e-01, double 6.500000e-01)
br label %219
219: ; preds = %209, %214
%220 = phi double [ %218, %214 ], [ 6.500000e-01, %209 ]
%221 = fmul double %212, 1.000000e+03
%222 = fdiv double %221, %210
%223 = fadd double %222, 2.500000e-01
%224 = fcmp ogt double %223, 1.000000e+00
%225 = select i1 %224, double 1.000000e+00, double %223
%226 = fcmp ogt double %220, %225
%227 = or i1 %224, %226
%228 = select i1 %226, double %220, double 1.000000e+00
%229 = select i1 %227, double %228, double %223
%230 = fdiv double %210, %212
%231 = fsub double 1.000000e+00, %230
%232 = fmul double %231, %229
ret double %232
}