#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 */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ debug(int, char *, int, int, int, int, int);
int /*<<< orphan*/ error(int, char *);
int /*<<< orphan*/ free(double *);
int /*<<< orphan*/ memset(double *, int /*<<< orphan*/, int);
void pgm_subplanes(unsigned char *subplane[2], unsigned char *raw, int w,
                   int h) {
  int bpl = (w + 7) / 8;
  int x, y;
  unsigned char byte;
  unsigned char ormask[8] = {128, 64, 32, 16, 8, 4, 2, 1};
  unsigned char andmask[8] = {0x7f, ~64, ~32, ~16, ~8, ~4, ~2, ~1};
  double *carry0, *carry1, *carrytmp;
  double sum;
  static int dir = 1;
  int xs, xe;
  static int cnt[4];
  int tot = 0;
  carry0 = (double *)calloc((w + 2), sizeof(*carry0));
  if (!carry0)
    error(1, "Could not allocate space for carries\n");
  carry1 = (double *)calloc((w + 2), sizeof(*carry0));
  if (!carry1)
    error(1, "Could not allocate space for carries\n");
  ++carry0;
  ++carry1;
  for (y = 0; y < h; ++y) {
    if (dir > 0) {
      dir = -1;
      xs = w - 1;
      xe = -1;
    } else {
      dir = 1;
      xs = 0;
      xe = w;
    }
    for (x = xs; x != xe; x += dir) {
      byte = 255 - raw[y * w + x];
      sum = byte + carry0[x];
      ++tot;
      if (byte == 255 || sum >= 255) {
        ++cnt[2];
        byte = 255;
        subplane[1][y * bpl + x / 8] |= ormask[x & 7];
        subplane[0][y * bpl + x / 8] &= andmask[x & 7];
      } else if (sum >= (70.0 / 100) * 255) {
        ++cnt[3];
        byte = 255;
        subplane[1][y * bpl + x / 8] |= ormask[x & 7];
        subplane[0][y * bpl + x / 8] |= ormask[x & 7];
      } else if (sum > 0) {
        ++cnt[1];
        byte = (40.0 / 100) * 255;
        subplane[1][y * bpl + x / 8] &= andmask[x & 7];
        subplane[0][y * bpl + x / 8] |= ormask[x & 7];
      } else {
        ++cnt[0];
        byte = 0;
        subplane[1][y * bpl + x / 8] &= andmask[x & 7];
        subplane[0][y * bpl + x / 8] &= andmask[x & 7];
      }
      sum -= byte;
      carry0[x + dir] += (sum * 7) / 16.0;
      carry1[x - dir] += (sum * 3) / 16.0;
      carry1[x] += (sum * 5) / 16.0;
      carry1[x + dir] += (sum * 1) / 16.0;
    }
    carrytmp = carry0;
    carry0 = carry1;
    carry1 = carrytmp;
    memset(carry1 - 1, 0, (w + 2) * sizeof(*carry1));
  }
  debug(1, "%d	%d %d %d %d\n", tot, cnt[3], cnt[2], cnt[1], cnt[0]);
  free(--carry0);
  free(--carry1);
}


x86 assembly (clang, -O0):
<pgm_subplanes>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x7,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x2d(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x35(%rbp)
movl   $0x0,-0x64(%rbp)
mov    -0x14(%rbp),%edi
add    $0x2,%edi
mov    $0x8,%esi
call   1060 <calloc@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    11c7 <pgm_subplanes+0x77>
mov    $0x1,%edi
lea    0xe86(%rip),%rsi
call   1070 <error@plt>
mov    -0x14(%rbp),%edi
add    $0x2,%edi
mov    $0x8,%esi
call   1060 <calloc@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    11f7 <pgm_subplanes+0xa7>
mov    $0x1,%edi
lea    0xe56(%rip),%rsi
call   1070 <error@plt>
mov    -0x40(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x40(%rbp)
mov    -0x48(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    16ad <pgm_subplanes+0x55d>
cmpl   $0x0,0x2e1f(%rip)
jle    124e <pgm_subplanes+0xfe>
movl   $0xffffffff,0x2e0f(%rip)
ff ff ff
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x5c(%rbp)
movl   $0xffffffff,-0x60(%rbp)
jmp    1265 <pgm_subplanes+0x115>
movl   $0x1,0x2df0(%rip)
movl   $0x0,-0x5c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x60(%rbp),%eax
je     166a <pgm_subplanes+0x51a>
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    -0x20(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%ecx
mov    $0xff,%eax
sub    %ecx,%eax
mov    %al,-0x25(%rbp)
movzbl -0x25(%rbp),%eax
cvtsi2sd %eax,%xmm0
mov    -0x40(%rbp),%rax
movslq -0x20(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
movzbl -0x25(%rbp),%eax
cmp    $0xff,%eax
je     12df <pgm_subplanes+0x18f>
movsd  -0x58(%rbp),%xmm0
movsd  0xd2b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1374 <pgm_subplanes+0x224>
mov    0x2d83(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2d7a(%rip)
movb   $0xff,-0x25(%rbp)
mov    -0x20(%rbp),%eax
and    $0x7,%eax
cltq
movzbl -0x2d(%rbp,%rax,1),%esi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x78(%rbp)
mov    -0x24(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    $0x8,%edi
cltd
idiv   %edi
mov    %eax,%edx
mov    -0x78(%rbp),%rax
add    %edx,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
and    $0x7,%eax
cltq
movzbl -0x35(%rbp,%rax,1),%esi
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x70(%rbp)
mov    -0x24(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    $0x8,%edi
cltd
idiv   %edi
mov    %eax,%edx
mov    -0x70(%rbp),%rax
add    %edx,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
and    %esi,%edx
mov    %dl,(%rax,%rcx,1)
jmp    157f <pgm_subplanes+0x42f>
movsd  -0x58(%rbp),%xmm0
movsd  0xc87(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1426 <pgm_subplanes+0x2d6>
mov    0x2cdb(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2cd2(%rip)
movb   $0xff,-0x25(%rbp)
mov    -0x20(%rbp),%eax
and    $0x7,%eax
cltq
movzbl -0x2d(%rbp,%rax,1),%esi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x88(%rbp)
mov    -0x24(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    $0x8,%edi
cltd
idiv   %edi
mov    %eax,%edx
mov    -0x88(%rbp),%rax
add    %edx,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
and    $0x7,%eax
cltq
movzbl -0x2d(%rbp,%rax,1),%esi
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x80(%rbp)
mov    -0x24(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    $0x8,%edi
cltd
idiv   %edi
mov    %eax,%edx
mov    -0x80(%rbp),%rax
add    %edx,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
jmp    157a <pgm_subplanes+0x42a>
movsd  -0x58(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    14d9 <pgm_subplanes+0x389>
mov    0x2c26(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2c1d(%rip)
movb   $0x66,-0x25(%rbp)
mov    -0x20(%rbp),%eax
and    $0x7,%eax
cltq
movzbl -0x35(%rbp,%rax,1),%esi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x98(%rbp)
mov    -0x24(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    $0x8,%edi
cltd
idiv   %edi
mov    %eax,%edx
mov    -0x98(%rbp),%rax
add    %edx,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
and    %esi,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
and    $0x7,%eax
cltq
movzbl -0x2d(%rbp,%rax,1),%esi
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x90(%rbp)
mov    -0x24(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    $0x8,%edi
cltd
idiv   %edi
mov    %eax,%edx
mov    -0x90(%rbp),%rax
add    %edx,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
jmp    1575 <pgm_subplanes+0x425>
mov    0x2b81(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2b78(%rip)
movb   $0x0,-0x25(%rbp)
mov    -0x20(%rbp),%eax
and    $0x7,%eax
cltq
movzbl -0x35(%rbp,%rax,1),%esi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0xa8(%rbp)
mov    -0x24(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    $0x8,%edi
cltd
idiv   %edi
mov    %eax,%edx
mov    -0xa8(%rbp),%rax
add    %edx,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
and    %esi,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
and    $0x7,%eax
cltq
movzbl -0x35(%rbp,%rax,1),%esi
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x24(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    $0x8,%edi
cltd
idiv   %edi
mov    %eax,%edx
mov    -0xa0(%rbp),%rax
add    %edx,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
and    %esi,%edx
mov    %dl,(%rax,%rcx,1)
jmp    157a <pgm_subplanes+0x42a>
jmp    157f <pgm_subplanes+0x42f>
movzbl -0x25(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  -0x58(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xa93(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  0xa66(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    0x2a8d(%rip),%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xa58(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  0xa33(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x48(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    0x2a5a(%rip),%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xa1d(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  0xa00(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x48(%rbp),%rax
movslq -0x20(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  0x9ea(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  0x9d5(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x48(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    0x29fc(%rip),%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x29e9(%rip),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    126b <pgm_subplanes+0x11b>
mov    -0x40(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
add    $0xfffffffffffffff8,%rdi
mov    -0x14(%rbp),%eax
add    $0x2,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1050 <memset@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1216 <pgm_subplanes+0xc6>
mov    -0x64(%rbp),%edx
mov    0x29b6(%rip),%ecx
mov    0x29ab(%rip),%r8d
mov    0x29a0(%rip),%r9d
mov    0x2996(%rip),%eax
mov    $0x1,%edi
lea    0x998(%rip),%rsi
mov    %eax,(%rsp)
call   1040 <debug@plt>
mov    -0x40(%rbp),%rdi
add    $0xfffffffffffffff8,%rdi
mov    %rdi,-0x40(%rbp)
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
add    $0xfffffffffffffff8,%rdi
mov    %rdi,-0x48(%rbp)
call   1030 <free@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgm_subplanes>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %ecx,0x30(%rsp)
mov    %rsi,%r15
mov    %rdi,%r12
lea    0x7(%rdx),%eax
lea    0xe(%rdx),%r13d
test   %eax,%eax
cmovns %eax,%r13d
mov    %rdx,0x40(%rsp)
lea    0x2(%rdx),%r14d
mov    %r14d,%edi
mov    $0x8,%esi
call   1060 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    11a7 <pgm_subplanes+0x57>
lea    0xeab(%rip),%rsi
mov    $0x1,%edi
call   1070 <error@plt>
mov    %r14d,%edi
mov    $0x8,%esi
call   1060 <calloc@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    11cd <pgm_subplanes+0x7d>
lea    0xe85(%rip),%rsi
mov    $0x1,%edi
call   1070 <error@plt>
add    $0x8,%rbx
add    $0x8,%rbp
mov    0x30(%rsp),%edx
test   %edx,%edx
jle    15ff <pgm_subplanes+0x4af>
sar    $0x3,%r13d
mov    0x40(%rsp),%rax
lea    -0x1(%rax),%ecx
mov    %ecx,0x38(%rsp)
shl    $0x3,%r14d
cltq
mov    %rax,0x58(%rsp)
movslq %r13d,%rax
mov    %rax,0x48(%rsp)
mov    %edx,%eax
mov    %rax,0x50(%rsp)
movsd  0xded(%rip),%xmm2
movsd  0xdfd(%rip),%xmm3
movsd  0xdfd(%rip),%xmm4
movsd  0xdfd(%rip),%xmm5
movsd  0xdfd(%rip),%xmm6
movsd  0xdcd(%rip),%xmm7
movsd  0xdcc(%rip),%xmm9
xor    %edi,%edi
xor    %r13d,%r13d
mov    %rbp,%rcx
mov    %r14d,0x3c(%rsp)
jmp    12ce <pgm_subplanes+0x17e>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x68(%rsp),%rbp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    0x3c(%rsp),%edx
call   1050 <memset@plt>
movsd  0xd93(%rip),%xmm9
movsd  0xd83(%rip),%xmm7
movsd  0xda3(%rip),%xmm6
movsd  0xd93(%rip),%xmm5
movsd  0xd83(%rip),%xmm4
movsd  0xd73(%rip),%xmm3
movsd  0xd53(%rip),%xmm2
mov    0x60(%rsp),%rdi
add    $0x1,%rdi
mov    0x70(%rsp),%r15
add    0x58(%rsp),%r15
mov    %rbp,%rcx
cmp    0x50(%rsp),%rdi
je     1602 <pgm_subplanes+0x4b2>
mov    0x2d8b(%rip),%r8b
test   %r8b,%r8b
mov    0x38(%rsp),%edx
mov    %edx,%ebp
mov    $0x0,%edx
cmovne %edx,%ebp
mov    $0xffffffff,%esi
cmovne 0x40(%rsp),%esi
mov    %rbx,%r9
mov    %rcx,%rbx
mov    %r8d,%edx
xor    $0x1,%dl
mov    %dl,0x2d5e(%rip)
cmp    %esi,%ebp
mov    %r15,0x70(%rsp)
mov    %r9,0x68(%rsp)
mov    %rdi,0x60(%rsp)
je     1260 <pgm_subplanes+0x110>
mov    0x2d69(%rip),%ecx
mov    0x2d5b(%rip),%eax
mov    %eax,0x18(%rsp)
mov    0x2d41(%rip),%eax
mov    %eax,0x14(%rsp)
mov    0x2d57(%rip),%eax
mov    %eax,0x1c(%rsp)
imul   0x48(%rsp),%rdi
mov    %rdi,0x20(%rsp)
movslq %ebp,%rax
movzbl %r8b,%r10d
lea    (%r10,%r10,1),%r8
add    $0xffffffffffffffff,%r8
movzbl %dl,%edx
lea    -0x1(%rbp,%rdx,2),%edi
shl    $0x20,%rdi
mov    %r8,0x90(%rsp)
shl    $0x20,%r8
mov    %r8,0x88(%rsp)
mov    %ebp,%r14d
lea    (%r9,%rax,8),%rdx
mov    %rdx,0x80(%rsp)
lea    (%rbx,%rax,8),%r8
lea    (%r15,%rax,1),%rdx
mov    %rdx,0x78(%rsp)
neg    %esi
add    %r14,%rsi
mov    %rax,0x30(%rsp)
lea    (%rax,%r10,2),%rax
add    $0xffffffffffffffff,%rax
lea    (%r9,%rax,8),%r10
lea    (%rbx,%rax,8),%r11
xor    %r15d,%r15d
xorpd  %xmm8,%xmm8
mov    %rsi,0x28(%rsp)
jmp    1493 <pgm_subplanes+0x343>
xchg   %ax,%ax
add    $0x1,%ecx
mov    %ecx,0x2cbf(%rip)
lea    (%r14,%r15,1),%eax
and    $0x7,%r9d
lea    0xc60(%rip),%rdx
movzbl (%r9,%rdx,1),%edx
lea    (%r14,%r15,1),%ebp
add    $0x7,%ebp
test   %eax,%eax
cmovns %eax,%ebp
mov    0x8(%r12),%rax
sar    $0x3,%ebp
movslq %ebp,%rbp
add    0x20(%rsp),%rbp
or     %dl,(%rax,%rbp,1)
lea    0xc3d(%rip),%rax
movzbl (%r9,%rax,1),%eax
mov    (%r12),%rdx
and    %al,(%rdx,%rbp,1)
movapd %xmm2,%xmm1
subsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm3,%xmm1
mulsd  %xmm4,%xmm1
addsd  (%r10,%r15,8),%xmm1
movsd  %xmm1,(%r10,%r15,8)
movapd %xmm0,%xmm1
mulsd  %xmm5,%xmm1
mulsd  %xmm4,%xmm1
mov    %rdi,%rax
sar    $0x1d,%rax
addsd  (%rbx,%rax,1),%xmm1
movsd  %xmm1,(%rbx,%rax,1)
movapd %xmm0,%xmm1
mulsd  %xmm6,%xmm1
mulsd  %xmm4,%xmm1
addsd  (%r8,%r15,8),%xmm1
movsd  %xmm1,(%r8,%r15,8)
mulsd  %xmm4,%xmm0
addsd  (%r11,%r15,8),%xmm0
movsd  %xmm0,(%r11,%r15,8)
add    0x90(%rsp),%r15
add    0x88(%rsp),%rdi
add    $0x1,%r13d
mov    %esi,%eax
add    %r15d,%eax
je     1260 <pgm_subplanes+0x110>
mov    0x78(%rsp),%rax
movzbl (%rax,%r15,1),%edx
mov    %edx,%eax
not    %al
movzbl %al,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0x30(%rsp),%rax
lea    (%rax,%r15,1),%r9
mov    0x80(%rsp),%rax
addsd  (%rax,%r15,8),%xmm0
test   %dl,%dl
je     13c0 <pgm_subplanes+0x270>
ucomisd %xmm2,%xmm0
jae    13c0 <pgm_subplanes+0x270>
ucomisd %xmm7,%xmm0
jae    1550 <pgm_subplanes+0x400>
ucomisd %xmm8,%xmm0
jbe    15a6 <pgm_subplanes+0x456>
mov    0x18(%rsp),%eax
add    $0x1,%eax
mov    %eax,0x18(%rsp)
mov    %eax,0x2b8a(%rip)
lea    (%r14,%r15,1),%eax
and    $0x7,%r9d
lea    0xb3b(%rip),%rdx
movzbl (%r9,%rdx,1),%edx
lea    (%r14,%r15,1),%esi
add    $0x7,%esi
test   %eax,%eax
cmovns %eax,%esi
mov    0x8(%r12),%rax
sar    $0x3,%esi
movslq %esi,%rsi
add    0x20(%rsp),%rsi
and    %dl,(%rax,%rsi,1)
lea    0xb08(%rip),%rax
movzbl (%r9,%rax,1),%eax
mov    (%r12),%rdx
or     %al,(%rdx,%rsi,1)
movapd %xmm9,%xmm1
jmp    15f5 <pgm_subplanes+0x4a5>
cs nopw 0x0(%rax,%rax,1)
mov    0x1c(%rsp),%eax
add    $0x1,%eax
mov    %eax,0x1c(%rsp)
mov    %eax,0x2b2f(%rip)
lea    (%r14,%r15,1),%eax
and    $0x7,%r9d
lea    0xac8(%rip),%rdx
movzbl (%r9,%rdx,1),%edx
mov    0x8(%r12),%rbp
lea    (%r14,%r15,1),%esi
add    $0x7,%esi
test   %eax,%eax
cmovns %eax,%esi
sar    $0x3,%esi
movslq %esi,%rax
add    0x20(%rsp),%rax
or     %dl,0x0(%rbp,%rax,1)
mov    (%r12),%rsi
or     %dl,(%rsi,%rax,1)
mov    0x28(%rsp),%rsi
jmp    140f <pgm_subplanes+0x2bf>
mov    0x14(%rsp),%eax
add    $0x1,%eax
mov    %eax,0x14(%rsp)
mov    %eax,0x2ab9(%rip)
lea    (%r14,%r15,1),%eax
and    $0x7,%r9d
lea    0xa7a(%rip),%rdx
movzbl (%r9,%rdx,1),%edx
lea    (%r14,%r15,1),%esi
add    $0x7,%esi
test   %eax,%eax
cmovns %eax,%esi
mov    0x8(%r12),%rax
sar    $0x3,%esi
movslq %esi,%rsi
add    0x20(%rsp),%rsi
and    %dl,(%rax,%rsi,1)
mov    (%r12),%rax
and    %dl,(%rax,%rsi,1)
xorpd  %xmm1,%xmm1
mov    0x28(%rsp),%rsi
jmp    1413 <pgm_subplanes+0x2c3>
xor    %r13d,%r13d
mov    0x2a88(%rip),%ecx
mov    0x2a79(%rip),%r8d
mov    0x2a6a(%rip),%r9d
mov    0x2a54(%rip),%eax
mov    %eax,(%rsp)
lea    0xa48(%rip),%rsi
mov    $0x1,%edi
mov    %r13d,%edx
call   1040 <debug@plt>
add    $0xfffffffffffffff8,%rbx
mov    %rbx,%rdi
call   1030 <free@plt>
add    $0xfffffffffffffff8,%rbp
mov    %rbp,%rdi
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

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

LLVM IR (-O2):
@__const.pgm_subplanes.ormask = [8 x i8] c"\80@ \10\08\04\02\01"
@__const.pgm_subplanes.andmask = [8 x i8] c"\7F\BF\DF\EF\F7\FB\FD\FE"
@pgm_subplanes.dir = internal unnamed_addr global i1 false
@pgm_subplanes.cnt.0 = internal unnamed_addr global i32 0
@pgm_subplanes.cnt.1 = internal unnamed_addr global i32 0
@pgm_subplanes.cnt.2 = internal unnamed_addr global i32 0
@pgm_subplanes.cnt.3 = internal unnamed_addr global i32 0
@.str = [38 x i8] c"Could not allocate space for carries\0A\00"
@.str.1 = [16 x i8] c"%d\09%d %d %d %d\0A\00"
define void @pgm_subplanes(i8** nocapture %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = add nsw i32 %2, 7
%6 = sdiv i32 %5, 8
%7 = add nsw i32 %2, 2
%8 = tail call i64 @calloc(i32 %7, i32 8)
%9 = inttoptr i64 %8 to double*
%10 = icmp eq i64 %8, 0
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = tail call i32 @error(i32 1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %4
%14 = tail call i64 @calloc(i32 %7, i32 8)
%15 = inttoptr i64 %14 to double*
%16 = icmp eq i64 %14, 0
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = tail call i32 @error(i32 1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %13
%20 = getelementptr inbounds double, double* %9, i64 1
%21 = getelementptr inbounds double, double* %15, i64 1
%22 = icmp sgt i32 %3, 0
br i1 %22, label %23, label %183
23: ; preds = %19
%24 = add nsw i32 %2, -1
%25 = getelementptr inbounds i8*, i8** %0, i64 1
%26 = shl i32 %7, 3
%27 = sext i32 %2 to i64
%28 = sext i32 %6 to i64
%29 = zext i32 %3 to i64
br label %30
30: ; preds = %23, %177
%31 = phi i64 [ 0, %23 ], [ %181, %177 ]
%32 = phi i32 [ 0, %23 ], [ %178, %177 ]
%33 = phi double* [ %21, %23 ], [ %34, %177 ]
%34 = phi double* [ %20, %23 ], [ %33, %177 ]
%35 = load i1, i1* @pgm_subplanes.dir
%36 = select i1 %35, i32 0, i32 %24
%37 = select i1 %35, i32 %2, i32 -1
%38 = xor i1 %35, true
store i1 %38, i1* @pgm_subplanes.dir
%39 = icmp eq i32 %36, %37
br i1 %39, label %177, label %40
40: ; preds = %30
%41 = load i32, i32* @pgm_subplanes.cnt.2
%42 = load i32, i32* @pgm_subplanes.cnt.1
%43 = load i32, i32* @pgm_subplanes.cnt.0
%44 = load i32, i32* @pgm_subplanes.cnt.3
%45 = mul nsw i64 %31, %27
%46 = mul nsw i64 %31, %28
%47 = select i1 %35, i64 4294967295, i64 1
%48 = sext i32 %36 to i64
%49 = select i1 %35, i64 1, i64 -1
br label %50
50: ; preds = %40, %145
%51 = phi i64 [ %48, %40 ], [ %154, %145 ]
%52 = phi i32 [ %32, %40 ], [ %65, %145 ]
%53 = phi i32 [ %44, %40 ], [ %149, %145 ]
%54 = phi i32 [ %43, %40 ], [ %148, %145 ]
%55 = phi i32 [ %42, %40 ], [ %147, %145 ]
%56 = phi i32 [ %41, %40 ], [ %146, %145 ]
%57 = add nsw i64 %51, %45
%58 = getelementptr inbounds i8, i8* %1, i64 %57
%59 = load i8, i8* %58
%60 = xor i8 %59, -1
%61 = uitofp i8 %60 to double
%62 = getelementptr inbounds double, double* %34, i64 %51
%63 = load double, double* %62
%64 = fadd double %63, %61
%65 = add nsw i32 %52, 1
%66 = icmp eq i8 %59, 0
%67 = fcmp oge double %64, 2.550000e+02
%68 = select i1 %66, i1 true, i1 %67
br i1 %68, label %69, label %88
69: ; preds = %50
%70 = add nsw i32 %56, 1
store i32 %70, i32* @pgm_subplanes.cnt.2
%71 = trunc i64 %51 to i32
%72 = and i64 %51, 7
%73 = getelementptr inbounds [8 x i8], [8 x i8]* @__const.pgm_subplanes.ormask, i64 0, i64 %72
%74 = load i8, i8* %73
%75 = load i8*, i8** %25
%76 = sdiv i32 %71, 8
%77 = sext i32 %76 to i64
%78 = add nsw i64 %46, %77
%79 = getelementptr inbounds i8, i8* %75, i64 %78
%80 = load i8, i8* %79
%81 = or i8 %80, %74
store i8 %81, i8* %79
%82 = getelementptr inbounds [8 x i8], [8 x i8]* @__const.pgm_subplanes.andmask, i64 0, i64 %72
%83 = load i8, i8* %82
%84 = load i8*, i8** %0
%85 = getelementptr inbounds i8, i8* %84, i64 %78
%86 = load i8, i8* %85
%87 = and i8 %86, %83
store i8 %87, i8* %85
br label %145
88: ; preds = %50
%89 = fcmp ult double %64, 1.785000e+02
br i1 %89, label %107, label %90
90: ; preds = %88
%91 = add nsw i32 %53, 1
store i32 %91, i32* @pgm_subplanes.cnt.3
%92 = trunc i64 %51 to i32
%93 = and i64 %51, 7
%94 = getelementptr inbounds [8 x i8], [8 x i8]* @__const.pgm_subplanes.ormask, i64 0, i64 %93
%95 = load i8, i8* %94
%96 = load i8*, i8** %25
%97 = sdiv i32 %92, 8
%98 = sext i32 %97 to i64
%99 = add nsw i64 %46, %98
%100 = getelementptr inbounds i8, i8* %96, i64 %99
%101 = load i8, i8* %100
%102 = or i8 %101, %95
store i8 %102, i8* %100
%103 = load i8*, i8** %0
%104 = getelementptr inbounds i8, i8* %103, i64 %99
%105 = load i8, i8* %104
%106 = or i8 %105, %95
store i8 %106, i8* %104
br label %145
107: ; preds = %88
%108 = fcmp ogt double %64, 0.000000e+00
br i1 %108, label %109, label %128
109: ; preds = %107
%110 = add nsw i32 %55, 1
store i32 %110, i32* @pgm_subplanes.cnt.1
%111 = trunc i64 %51 to i32
%112 = and i64 %51, 7
%113 = getelementptr inbounds [8 x i8], [8 x i8]* @__const.pgm_subplanes.andmask, i64 0, i64 %112
%114 = load i8, i8* %113
%115 = load i8*, i8** %25
%116 = sdiv i32 %111, 8
%117 = sext i32 %116 to i64
%118 = add nsw i64 %46, %117
%119 = getelementptr inbounds i8, i8* %115, i64 %118
%120 = load i8, i8* %119
%121 = and i8 %120, %114
store i8 %121, i8* %119
%122 = getelementptr inbounds [8 x i8], [8 x i8]* @__const.pgm_subplanes.ormask, i64 0, i64 %112
%123 = load i8, i8* %122
%124 = load i8*, i8** %0
%125 = getelementptr inbounds i8, i8* %124, i64 %118
%126 = load i8, i8* %125
%127 = or i8 %126, %123
store i8 %127, i8* %125
br label %145
128: ; preds = %107
%129 = add nsw i32 %54, 1
store i32 %129, i32* @pgm_subplanes.cnt.0
%130 = trunc i64 %51 to i32
%131 = and i64 %51, 7
%132 = getelementptr inbounds [8 x i8], [8 x i8]* @__const.pgm_subplanes.andmask, i64 0, i64 %131
%133 = load i8, i8* %132
%134 = load i8*, i8** %25
%135 = sdiv i32 %130, 8
%136 = sext i32 %135 to i64
%137 = add nsw i64 %46, %136
%138 = getelementptr inbounds i8, i8* %134, i64 %137
%139 = load i8, i8* %138
%140 = and i8 %139, %133
store i8 %140, i8* %138
%141 = load i8*, i8** %0
%142 = getelementptr inbounds i8, i8* %141, i64 %137
%143 = load i8, i8* %142
%144 = and i8 %143, %133
store i8 %144, i8* %142
br label %145
145: ; preds = %90, %128, %109, %69
%146 = phi i32 [ %56, %90 ], [ %56, %128 ], [ %56, %109 ], [ %70, %69 ]
%147 = phi i32 [ %55, %90 ], [ %55, %128 ], [ %110, %109 ], [ %55, %69 ]
%148 = phi i32 [ %54, %90 ], [ %129, %128 ], [ %54, %109 ], [ %54, %69 ]
%149 = phi i32 [ %91, %90 ], [ %53, %128 ], [ %53, %109 ], [ %53, %69 ]
%150 = phi double [ 2.550000e+02, %90 ], [ 0.000000e+00, %128 ], [ 1.020000e+02, %109 ], [ 2.550000e+02, %69 ]
%151 = fsub double %64, %150
%152 = fmul double %151, 7.000000e+00
%153 = fmul double %152, 6.250000e-02
%154 = add i64 %51, %49
%155 = getelementptr inbounds double, double* %34, i64 %154
%156 = load double, double* %155
%157 = fadd double %156, %153
store double %157, double* %155
%158 = fmul double %151, 3.000000e+00
%159 = fmul double %158, 6.250000e-02
%160 = add i64 %47, %51
%161 = shl i64 %160, 32
%162 = ashr exact i64 %161, 32
%163 = getelementptr inbounds double, double* %33, i64 %162
%164 = load double, double* %163
%165 = fadd double %159, %164
store double %165, double* %163
%166 = fmul double %151, 5.000000e+00
%167 = fmul double %166, 6.250000e-02
%168 = getelementptr inbounds double, double* %33, i64 %51
%169 = load double, double* %168
%170 = fadd double %167, %169
store double %170, double* %168
%171 = fmul double %151, 6.250000e-02
%172 = getelementptr inbounds double, double* %33, i64 %154
%173 = load double, double* %172
%174 = fadd double %171, %173
store double %174, double* %172
%175 = trunc i64 %154 to i32
%176 = icmp eq i32 %37, %175
br i1 %176, label %177, label %50
177: ; preds = %145, %30
%178 = phi i32 [ %32, %30 ], [ %65, %145 ]
%179 = getelementptr inbounds double, double* %34, i64 -1
%180 = tail call i32 @memset(double* %179, i32 0, i32 %26)
%181 = add nuw nsw i64 %31, 1
%182 = icmp eq i64 %181, %29
br i1 %182, label %183, label %30
183: ; preds = %177, %19
%184 = phi double* [ %20, %19 ], [ %33, %177 ]
%185 = phi double* [ %21, %19 ], [ %34, %177 ]
%186 = phi i32 [ 0, %19 ], [ %178, %177 ]
%187 = load i32, i32* @pgm_subplanes.cnt.3
%188 = load i32, i32* @pgm_subplanes.cnt.2
%189 = load i32, i32* @pgm_subplanes.cnt.1
%190 = load i32, i32* @pgm_subplanes.cnt.0
%191 = tail call i32 @debug(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %186, i32 %187, i32 %188, i32 %189, i32 %190)
%192 = getelementptr inbounds double, double* %184, i64 -1
%193 = tail call i32 @free(double* %192)
%194 = getelementptr inbounds double, double* %185, i64 -1
%195 = tail call i32 @free(double* %194)
ret void
}