int clip3d(x1, y1, z1, x2, y2, z2, x1p, y1p, z1p, x2p, y2p, z2p)
float x1, y1, z1, x2, y2, z2, *x1p, *y1p, *z1p, *x2p, *y2p, *z2p;
{
  int istack, ix1 = 0, ix2 = 0, iy1 = 0, iy2 = 0, iz1 = 0, iz2 = 0, iflag = 0;
  float wh, wv, wo, xhat, yhat, zhat, del;
  istack = 1;
  *x1p = x1;
  *y1p = y1;
  *z1p = z1;
  *x2p = x2;
  *y2p = y2;
  *z2p = z2;
  if (x1 < -1.)
    ix1 = -1;
  if (x1 > 1.)
    ix1 = 1;
  if (x2 < -1.)
    ix2 = -1;
  if (x2 > 1.)
    ix2 = 1;
  if (y1 < -1.)
    iy1 = -1;
  if (y1 > 1.)
    iy1 = 1;
  if (y2 < -1.)
    iy2 = -1;
  if (y2 > 1.)
    iy2 = 1;
  if (z1 < -1.)
    iz1 = -1;
  if (z1 > 1.)
    iz1 = 1;
  if (z2 < -1.)
    iz2 = -1;
  if (z2 > 1.)
    iz2 = 1;
  if ((abs(ix1) + abs(ix2) + abs(iy1) + abs(iy2) + abs(iz1) + abs(iz2)) == 0)
    return (1);
  if ((ix1 == ix2) && (ix1 != 0))
    return (0);
  if ((iy1 == iy2) && (iy1 != 0))
    return (0);
  if ((iz1 == iz2) && (iz1 != 0))
    return (0);
  if (ix1 == 0)
    goto C2;
  wv = -1;
  if (ix1 > 0)
    wv = 1;
  *x1p = wv;
  del = (wv - x2) / (x1 - x2);
  yhat = (y1 - y2) * del + y2;
  zhat = (z1 - z2) * del + z2;
  if (fabs(zhat) <= 1.000001 && fabs(yhat) <= 1.000001) {
    *y1p = yhat;
    *z1p = zhat;
    iflag = 1;
    goto C3;
  }
  istack = 0;
C2:
  if (iy1 == 0)
    goto C22;
  wh = -1;
  if (iy1 > 0)
    wh = 1;
  *y1p = wh;
  del = (wh - y2) / (y1 - y2);
  xhat = (x1 - x2) * del + x2;
  zhat = (z1 - z2) * del + z2;
  if (fabs(zhat) <= 1.000001 && fabs(xhat) <= 1.000001) {
    *x1p = xhat;
    *z1p = zhat;
    iflag = 1;
    goto C3;
  }
  istack = 0;
C22:
  if (iz1 == 0)
    goto C3;
  wo = -1;
  if (iz1 > 0)
    wo = 1;
  *z1p = wo;
  del = (wo - z2) / (z1 - z2);
  xhat = del * (x1 - x2) + x2;
  yhat = del * (y1 - y2) + y2;
  if (fabs(xhat) <= 1.000001 && fabs(yhat) <= 1.000001) {
    *x1p = xhat;
    *y1p = yhat;
    iflag = 1;
  } else
    istack = 0;
C3:
  istack += iflag;
  if ((ix2 == 0) || (istack == 0))
    goto C44;
  wv = -1;
  if (ix2 > 0)
    wv = 1;
  *x2p = wv;
  del = (wv - x1) / (x2 - x1);
  yhat = (y2 - y1) * del + y1;
  zhat = (z2 - z1) * del + z1;
  if (fabs(yhat) <= 1.000001 && fabs(zhat) <= 1.000001) {
    *y2p = yhat;
    *z2p = zhat;
    return (1);
  }
C44:
  if (iy2 == 0 || istack == 0)
    goto C4;
  wh = -1;
  if (iy2 > 0)
    wh = 1;
  *y2p = wh;
  del = (wh - y1) / (y2 - y1);
  xhat = (x2 - x1) * del + x1;
  zhat = (z2 - z1) * del + z1;
  if (fabs(xhat) <= 1.000001 && fabs(zhat) <= 1.000001) {
    *z2p = zhat;
    *x2p = xhat;
    return (1);
  }
C4:
  if (iz2 == 0 || istack == 0)
    return (iflag);
  wo = -1;
  if (iz2 > 0)
    wo = 1;
  *z2p = wo;
  del = (wo - z1) / (z2 - z1);
  xhat = (x2 - x1) * del + x1;
  yhat = (y2 - y1) * del + y1;
  if (fabs(xhat) <= 1.000001 && fabs(yhat) <= 1.000001) {
    *x2p = xhat;
    *y2p = yhat;
    return (1);
  }
  return (iflag);
}


x86 assembly (clang, -O0):
<clip3d>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movsd  %xmm5,-0x98(%rbp)
ff
movsd  %xmm4,-0xa0(%rbp)
ff
movsd  %xmm3,-0xa8(%rbp)
ff
movaps %xmm2,%xmm3
movsd  -0xa8(%rbp),%xmm2
ff
movaps %xmm1,%xmm4
movsd  -0xa0(%rbp),%xmm1
ff
movaps %xmm0,%xmm5
movsd  -0x98(%rbp),%xmm0
ff
cvtsd2ss %xmm5,%xmm5
cvtsd2ss %xmm4,%xmm4
cvtsd2ss %xmm3,%xmm3
cvtsd2ss %xmm2,%xmm2
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm5,-0x8(%rbp)
movss  %xmm4,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
mov    %rdi,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
mov    %rdx,-0x38(%rbp)
mov    %rcx,-0x40(%rbp)
mov    %r8,-0x48(%rbp)
mov    %r9,-0x50(%rbp)
movl   $0x0,-0x58(%rbp)
movl   $0x0,-0x5c(%rbp)
movl   $0x0,-0x60(%rbp)
movl   $0x0,-0x64(%rbp)
movl   $0x0,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
movl   $0x0,-0x70(%rbp)
movl   $0x1,-0x54(%rbp)
movss  -0x8(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x18(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x1c(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdc7(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    124a <clip3d+0x13a>
movl   $0xffffffff,-0x58(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdad(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    126c <clip3d+0x15c>
movl   $0x1,-0x58(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd83(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    128e <clip3d+0x17e>
movl   $0xffffffff,-0x5c(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd69(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12b0 <clip3d+0x1a0>
movl   $0x1,-0x5c(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd3f(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    12d2 <clip3d+0x1c2>
movl   $0xffffffff,-0x60(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd25(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12f4 <clip3d+0x1e4>
movl   $0x1,-0x60(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xcfb(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1316 <clip3d+0x206>
movl   $0xffffffff,-0x64(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xce1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1338 <clip3d+0x228>
movl   $0x1,-0x64(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xcb7(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    135a <clip3d+0x24a>
movl   $0xffffffff,-0x68(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc9d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    137c <clip3d+0x26c>
movl   $0x1,-0x68(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xc73(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    139e <clip3d+0x28e>
movl   $0xffffffff,-0x6c(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc59(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    13c0 <clip3d+0x2b0>
movl   $0x1,-0x6c(%rbp)
mov    -0x58(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0xbc(%rbp)
mov    -0x5c(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0xbc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xb8(%rbp)
mov    -0x60(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0xb8(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xb4(%rbp)
mov    -0x64(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0xb4(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xb0(%rbp)
mov    -0x68(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0xb0(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xac(%rbp)
mov    -0x6c(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0xac(%rbp),%eax
add    %ecx,%eax
cmp    $0x0,%eax
jne    1455 <clip3d+0x345>
movl   $0x1,-0x4(%rbp)
jmp    1bf6 <clip3d+0xae6>
mov    -0x58(%rbp),%eax
cmp    -0x5c(%rbp),%eax
jne    1477 <clip3d+0x367>
cmpl   $0x0,-0x58(%rbp)
je     1477 <clip3d+0x367>
movl   $0x0,-0x4(%rbp)
jmp    1bf6 <clip3d+0xae6>
mov    -0x60(%rbp),%eax
cmp    -0x64(%rbp),%eax
jne    1499 <clip3d+0x389>
cmpl   $0x0,-0x60(%rbp)
je     1499 <clip3d+0x389>
movl   $0x0,-0x4(%rbp)
jmp    1bf6 <clip3d+0xae6>
mov    -0x68(%rbp),%eax
cmp    -0x6c(%rbp),%eax
jne    14bb <clip3d+0x3ab>
cmpl   $0x0,-0x68(%rbp)
je     14bb <clip3d+0x3ab>
movl   $0x0,-0x4(%rbp)
jmp    1bf6 <clip3d+0xae6>
cmpl   $0x0,-0x58(%rbp)
jne    14ca <clip3d+0x3ba>
jmp    15ee <clip3d+0x4de>
movss  0xb46(%rip),%xmm0
movss  %xmm0,-0x78(%rbp)
cmpl   $0x0,-0x58(%rbp)
jle    14ee <clip3d+0x3de>
movss  0xb33(%rip),%xmm0
movss  %xmm0,-0x78(%rbp)
movss  -0x78(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x78(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
subss  -0x14(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8c(%rbp)
ff
movss  -0xc(%rbp),%xmm0
subss  -0x18(%rbp),%xmm0
movss  -0x8c(%rbp),%xmm2
ff
movss  -0x18(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x84(%rbp)
ff
movss  -0x10(%rbp),%xmm0
subss  -0x1c(%rbp),%xmm0
movss  -0x8c(%rbp),%xmm2
ff
movss  -0x1c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x88(%rbp)
ff
movss  -0x88(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm1
movaps 0xaa4(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xa88(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     15e7 <clip3d+0x4d7>
movss  -0x84(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm1
movaps 0xa7b(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xa5f(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     15e7 <clip3d+0x4d7>
movss  -0x84(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x88(%rbp),%xmm0
ff
mov    -0x38(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x1,-0x70(%rbp)
jmp    1847 <clip3d+0x737>
movl   $0x0,-0x54(%rbp)
cmpl   $0x0,-0x60(%rbp)
jne    15fd <clip3d+0x4ed>
jmp    1718 <clip3d+0x608>
movss  0xa13(%rip),%xmm0
movss  %xmm0,-0x74(%rbp)
cmpl   $0x0,-0x60(%rbp)
jle    1621 <clip3d+0x511>
movss  0xa00(%rip),%xmm0
movss  %xmm0,-0x74(%rbp)
movss  -0x74(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x74(%rbp),%xmm0
subss  -0x18(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
subss  -0x18(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8c(%rbp)
ff
movss  -0x8(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
movss  -0x8c(%rbp),%xmm2
ff
movss  -0x14(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x80(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x1c(%rbp),%xmm0
movss  -0x8c(%rbp),%xmm2
ff
movss  -0x1c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x88(%rbp)
ff
movss  -0x88(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm1
movaps 0x974(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0x958(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1711 <clip3d+0x601>
movss  -0x80(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movaps 0x94e(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0x932(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1711 <clip3d+0x601>
movss  -0x80(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x88(%rbp),%xmm0
ff
mov    -0x38(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x1,-0x70(%rbp)
jmp    1847 <clip3d+0x737>
movl   $0x0,-0x54(%rbp)
cmpl   $0x0,-0x68(%rbp)
jne    1727 <clip3d+0x617>
jmp    1847 <clip3d+0x737>
movss  0x8e9(%rip),%xmm0
movss  %xmm0,-0x7c(%rbp)
cmpl   $0x0,-0x68(%rbp)
jle    174b <clip3d+0x63b>
movss  0x8d6(%rip),%xmm0
movss  %xmm0,-0x7c(%rbp)
movss  -0x7c(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x7c(%rbp),%xmm0
subss  -0x1c(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
subss  -0x1c(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8c(%rbp)
ff
movss  -0x8c(%rbp),%xmm0
ff
movss  -0x8(%rbp),%xmm2
subss  -0x14(%rbp),%xmm2
movss  -0x14(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x80(%rbp)
movss  -0x8c(%rbp),%xmm0
ff
movss  -0xc(%rbp),%xmm2
subss  -0x18(%rbp),%xmm2
movss  -0x18(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x84(%rbp)
ff
movss  -0x80(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movaps 0x84d(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0x831(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     183b <clip3d+0x72b>
movss  -0x84(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm1
movaps 0x824(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0x808(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     183b <clip3d+0x72b>
movss  -0x80(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x84(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x1,-0x70(%rbp)
jmp    1842 <clip3d+0x732>
movl   $0x0,-0x54(%rbp)
jmp    1847 <clip3d+0x737>
mov    -0x70(%rbp),%eax
add    -0x54(%rbp),%eax
mov    %eax,-0x54(%rbp)
cmpl   $0x0,-0x5c(%rbp)
je     1864 <clip3d+0x754>
cmpl   $0x0,-0x54(%rbp)
jne    1869 <clip3d+0x759>
jmp    198b <clip3d+0x87b>
movss  0x7a7(%rip),%xmm0
movss  %xmm0,-0x78(%rbp)
cmpl   $0x0,-0x5c(%rbp)
jle    188d <clip3d+0x77d>
movss  0x794(%rip),%xmm0
movss  %xmm0,-0x78(%rbp)
movss  -0x78(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x78(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
subss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8c(%rbp)
ff
movss  -0x18(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  -0x8c(%rbp),%xmm2
ff
movss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x84(%rbp)
ff
movss  -0x1c(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
movss  -0x8c(%rbp),%xmm2
ff
movss  -0x10(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x88(%rbp)
ff
movss  -0x84(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm1
movaps 0x705(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0x6e9(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1986 <clip3d+0x876>
movss  -0x88(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm1
movaps 0x6dc(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0x6c0(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1986 <clip3d+0x876>
movss  -0x84(%rbp),%xmm0
ff
mov    -0x48(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x88(%rbp),%xmm0
ff
mov    -0x50(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1bf6 <clip3d+0xae6>
jmp    198b <clip3d+0x87b>
cmpl   $0x0,-0x64(%rbp)
je     199f <clip3d+0x88f>
cmpl   $0x0,-0x54(%rbp)
jne    19a4 <clip3d+0x894>
jmp    1abd <clip3d+0x9ad>
movss  0x66c(%rip),%xmm0
movss  %xmm0,-0x74(%rbp)
cmpl   $0x0,-0x64(%rbp)
jle    19c8 <clip3d+0x8b8>
movss  0x659(%rip),%xmm0
movss  %xmm0,-0x74(%rbp)
movss  -0x74(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x74(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
subss  -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8c(%rbp)
ff
movss  -0x14(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  -0x8c(%rbp),%xmm2
ff
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x80(%rbp)
movss  -0x1c(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
movss  -0x8c(%rbp),%xmm2
ff
movss  -0x10(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x88(%rbp)
ff
movss  -0x80(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movaps 0x5d0(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0x5b4(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1ab8 <clip3d+0x9a8>
movss  -0x88(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm1
movaps 0x5a7(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0x58b(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1ab8 <clip3d+0x9a8>
movss  -0x88(%rbp),%xmm0
ff
mov    -0x50(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x80(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1bf6 <clip3d+0xae6>
jmp    1abd <clip3d+0x9ad>
cmpl   $0x0,-0x6c(%rbp)
je     1ad1 <clip3d+0x9c1>
cmpl   $0x0,-0x54(%rbp)
jne    1adc <clip3d+0x9cc>
mov    -0x70(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1bf6 <clip3d+0xae6>
movss  0x534(%rip),%xmm0
movss  %xmm0,-0x7c(%rbp)
cmpl   $0x0,-0x6c(%rbp)
jle    1b00 <clip3d+0x9f0>
movss  0x521(%rip),%xmm0
movss  %xmm0,-0x7c(%rbp)
movss  -0x7c(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x7c(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
subss  -0x10(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8c(%rbp)
ff
movss  -0x14(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  -0x8c(%rbp),%xmm2
ff
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x80(%rbp)
movss  -0x18(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  -0x8c(%rbp),%xmm2
ff
movss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x84(%rbp)
ff
movss  -0x80(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movaps 0x498(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0x47c(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1bf0 <clip3d+0xae0>
movss  -0x84(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm1
movaps 0x46f(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0x453(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1bf0 <clip3d+0xae0>
movss  -0x80(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x84(%rbp),%xmm0
ff
mov    -0x48(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1bf6 <clip3d+0xae6>
mov    -0x70(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clip3d>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
cvtsd2ss %xmm0,%xmm7
cvtsd2ss %xmm1,%xmm6
cvtsd2ss %xmm2,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm3,%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm4,%xmm1
xorps  %xmm3,%xmm3
cvtsd2ss %xmm5,%xmm3
movss  0xecd(%rip),%xmm4
xor    %r14d,%r14d
ucomiss %xmm7,%xmm4
seta   %r14b
neg    %r14d
movss  0xebc(%rip),%xmm5
ucomiss %xmm5,%xmm7
mov    $0x1,%ebp
cmova  %ebp,%r14d
xor    %r11d,%r11d
ucomiss %xmm0,%xmm4
seta   %r11b
neg    %r11d
ucomiss %xmm5,%xmm0
cmova  %ebp,%r11d
xor    %r12d,%r12d
ucomiss %xmm6,%xmm4
seta   %r12b
neg    %r12d
ucomiss %xmm5,%xmm6
cmova  %ebp,%r12d
xor    %eax,%eax
ucomiss %xmm1,%xmm4
seta   %al
neg    %eax
ucomiss %xmm5,%xmm1
cmova  %ebp,%eax
xor    %r10d,%r10d
ucomiss %xmm2,%xmm4
seta   %r10b
neg    %r10d
ucomiss %xmm5,%xmm2
cmova  %ebp,%r10d
xor    %r15d,%r15d
ucomiss %xmm3,%xmm4
seta   %r15b
neg    %r15d
ucomiss %xmm5,%xmm3
cmova  %ebp,%r15d
mov    %r14d,%ebp
neg    %ebp
cmovs  %r14d,%ebp
mov    %r11d,%ebx
neg    %ebx
mov    %r11d,-0x4(%rsp)
cmovs  %r11d,%ebx
mov    %r12d,%r13d
neg    %r13d
mov    %r12d,-0xc(%rsp)
cmovs  %r12d,%r13d
mov    %eax,%r11d
neg    %r11d
mov    %eax,-0x8(%rsp)
cmovs  %eax,%r11d
mov    %r10d,%r12d
neg    %r12d
mov    %r10d,-0x10(%rsp)
cmovs  %r10d,%r12d
add    %ebp,%r13d
add    %r12d,%r13d
add    %ebx,%r13d
movss  %xmm7,(%rdi)
movss  %xmm6,(%rsi)
movss  %xmm2,(%rdx)
movss  %xmm0,(%rcx)
movss  %xmm1,(%r8)
movss  %xmm3,(%r9)
add    %r11d,%r13d
mov    %r15d,%ebp
neg    %ebp
cmovs  %r15d,%ebp
add    %r13d,%ebp
mov    $0x1,%eax
je     16a6 <clip3d+0x5a6>
ucomiss 0xdc9(%rip),%xmm7
setbe  %bpl
ucomiss %xmm7,%xmm4
setbe  %bl
xor    %eax,%eax
test   %bl,%bpl
jne    1257 <clip3d+0x157>
cmp    -0x4(%rsp),%r14d
je     16a6 <clip3d+0x5a6>
ucomiss 0xda6(%rip),%xmm6
setbe  %bpl
ucomiss %xmm6,%xmm4
setbe  %bl
test   %bl,%bpl
jne    127b <clip3d+0x17b>
mov    -0xc(%rsp),%ebp
cmp    -0x8(%rsp),%ebp
je     16a6 <clip3d+0x5a6>
ucomiss 0xd82(%rip),%xmm2
setbe  %bpl
ucomiss %xmm2,%xmm4
setbe  %bl
test   %bl,%bpl
mov    %r15d,%ebp
jne    129e <clip3d+0x19e>
cmp    %ebp,-0x10(%rsp)
je     16a6 <clip3d+0x5a6>
test   %r14d,%r14d
je     1309 <clip3d+0x209>
xor    %eax,%eax
ucomiss 0xd58(%rip),%xmm7
seta   %al
lea    0xd52(%rip),%rbp
movss  0x0(%rbp,%rax,4),%xmm10
movss  %xmm10,(%rdi)
subss  %xmm0,%xmm10
movaps %xmm7,%xmm4
subss  %xmm0,%xmm4
divss  %xmm4,%xmm10
movaps %xmm2,%xmm4
subss  %xmm3,%xmm4
mulss  %xmm10,%xmm4
addss  %xmm3,%xmm4
movaps 0xd36(%rip),%xmm5
andps  %xmm4,%xmm5
cvtss2sd %xmm5,%xmm5
xor    %r14d,%r14d
movsd  0xd13(%rip),%xmm9
ucomisd %xmm5,%xmm9
jae    1311 <clip3d+0x211>
mov    %r15d,%ebp
jmp    1341 <clip3d+0x241>
mov    $0x1,%r14d
jmp    1341 <clip3d+0x241>
movaps %xmm6,%xmm8
subss  %xmm1,%xmm8
mulss  %xmm10,%xmm8
addss  %xmm1,%xmm8
movaps 0xcf5(%rip),%xmm5
andps  %xmm8,%xmm5
cvtss2sd %xmm5,%xmm5
ucomisd %xmm5,%xmm9
mov    %r15d,%ebp
jae    1494 <clip3d+0x394>
cmpl   $0x0,-0xc(%rsp)
je     13ad <clip3d+0x2ad>
xor    %eax,%eax
ucomiss 0xcb3(%rip),%xmm6
seta   %al
lea    0xcad(%rip),%rbp
movss  0x0(%rbp,%rax,4),%xmm10
movss  %xmm10,(%rsi)
subss  %xmm1,%xmm10
movaps %xmm6,%xmm4
subss  %xmm1,%xmm4
divss  %xmm4,%xmm10
movaps %xmm2,%xmm4
subss  %xmm3,%xmm4
mulss  %xmm10,%xmm4
addss  %xmm3,%xmm4
movaps 0xc91(%rip),%xmm5
andps  %xmm4,%xmm5
cvtss2sd %xmm5,%xmm5
xor    %ebx,%ebx
movsd  0xc6f(%rip),%xmm9
ucomisd %xmm5,%xmm9
jae    13b2 <clip3d+0x2b2>
mov    %r15d,%ebp
jmp    13e2 <clip3d+0x2e2>
mov    %r14d,%ebx
jmp    13e2 <clip3d+0x2e2>
movaps %xmm7,%xmm8
subss  %xmm0,%xmm8
mulss  %xmm10,%xmm8
addss  %xmm0,%xmm8
movaps 0xc54(%rip),%xmm5
andps  %xmm8,%xmm5
cvtss2sd %xmm5,%xmm5
ucomisd %xmm5,%xmm9
mov    %r15d,%ebp
jae    14a5 <clip3d+0x3a5>
cmpl   $0x0,-0x10(%rsp)
je     1451 <clip3d+0x351>
xor    %eax,%eax
ucomiss 0xc12(%rip),%xmm2
seta   %al
lea    0xc0c(%rip),%rbp
movss  0x0(%rbp,%rax,4),%xmm4
movss  %xmm4,(%rdx)
subss  %xmm3,%xmm4
movaps %xmm2,%xmm5
subss  %xmm3,%xmm5
divss  %xmm5,%xmm4
movaps %xmm7,%xmm9
subss  %xmm0,%xmm9
mulss  %xmm4,%xmm9
addss  %xmm0,%xmm9
movaps 0xbf1(%rip),%xmm5
andps  %xmm9,%xmm5
cvtss2sd %xmm5,%xmm5
xor    %r14d,%r14d
movsd  0xbcd(%rip),%xmm8
ucomisd %xmm5,%xmm8
jae    1455 <clip3d+0x355>
xor    %eax,%eax
mov    %r15d,%ebp
jmp    14b3 <clip3d+0x3b3>
xor    %eax,%eax
jmp    148f <clip3d+0x38f>
movaps %xmm6,%xmm5
subss  %xmm1,%xmm5
mulss  %xmm5,%xmm4
addss  %xmm1,%xmm4
movaps 0xbb5(%rip),%xmm5
andps  %xmm4,%xmm5
cvtss2sd %xmm5,%xmm5
ucomisd %xmm5,%xmm8
mov    $0x0,%eax
mov    %r15d,%ebp
jb     14b3 <clip3d+0x3b3>
movss  %xmm9,(%rdi)
movss  %xmm4,(%rsi)
mov    $0x1,%eax
mov    %ebx,%r14d
jmp    14b3 <clip3d+0x3b3>
movss  %xmm8,(%rsi)
movss  %xmm4,(%rdx)
mov    $0x1,%r14d
jmp    14ae <clip3d+0x3ae>
movss  %xmm8,(%rdi)
movss  %xmm4,(%rdx)
mov    $0x1,%eax
mov    %eax,%edx
neg    %edx
cmpl   $0x0,-0x4(%rsp)
je     1559 <clip3d+0x459>
cmp    %edx,%r14d
je     1559 <clip3d+0x459>
xor    %edi,%edi
ucomiss 0xb30(%rip),%xmm0
seta   %dil
lea    0xb29(%rip),%rsi
movss  (%rsi,%rdi,4),%xmm10
mov    %r15d,%ebp
movss  %xmm10,(%rcx)
subss  %xmm7,%xmm10
movaps %xmm0,%xmm4
subss  %xmm7,%xmm4
divss  %xmm4,%xmm10
movaps %xmm1,%xmm4
subss  %xmm6,%xmm4
mulss  %xmm10,%xmm4
addss  %xmm6,%xmm4
movaps 0xb0b(%rip),%xmm5
andps  %xmm4,%xmm5
cvtss2sd %xmm5,%xmm5
movsd  0xaeb(%rip),%xmm9
ucomisd %xmm5,%xmm9
jb     1559 <clip3d+0x459>
movaps %xmm3,%xmm8
subss  %xmm2,%xmm8
mulss  %xmm10,%xmm8
addss  %xmm2,%xmm8
movaps 0xada(%rip),%xmm5
andps  %xmm8,%xmm5
cvtss2sd %xmm5,%xmm5
ucomisd %xmm5,%xmm9
jae    168c <clip3d+0x58c>
cmpl   $0x0,-0x8(%rsp)
je     15fb <clip3d+0x4fb>
cmp    %edx,%r14d
je     15fb <clip3d+0x4fb>
xor    %edi,%edi
ucomiss 0xa8e(%rip),%xmm1
seta   %dil
lea    0xa87(%rip),%rsi
movss  (%rsi,%rdi,4),%xmm10
mov    %r15d,%ebp
movss  %xmm10,(%r8)
subss  %xmm6,%xmm10
movaps %xmm1,%xmm4
subss  %xmm6,%xmm4
divss  %xmm4,%xmm10
movaps %xmm0,%xmm4
subss  %xmm7,%xmm4
mulss  %xmm10,%xmm4
addss  %xmm7,%xmm4
movaps 0xa69(%rip),%xmm5
andps  %xmm4,%xmm5
cvtss2sd %xmm5,%xmm5
movsd  0xa49(%rip),%xmm8
ucomisd %xmm5,%xmm8
jb     15fb <clip3d+0x4fb>
movaps %xmm3,%xmm9
subss  %xmm2,%xmm9
mulss  %xmm10,%xmm9
addss  %xmm2,%xmm9
movaps 0xa38(%rip),%xmm5
andps  %xmm9,%xmm5
cvtss2sd %xmm5,%xmm5
ucomisd %xmm5,%xmm8
jae    1698 <clip3d+0x598>
test   %ebp,%ebp
je     16a6 <clip3d+0x5a6>
cmp    %edx,%r14d
je     16a6 <clip3d+0x5a6>
xor    %esi,%esi
ucomiss 0x9ef(%rip),%xmm3
seta   %sil
lea    0x9e8(%rip),%rdx
movss  (%rdx,%rsi,4),%xmm4
movss  %xmm4,(%r9)
subss  %xmm2,%xmm4
subss  %xmm2,%xmm3
divss  %xmm3,%xmm4
subss  %xmm7,%xmm0
mulss  %xmm4,%xmm0
addss  %xmm7,%xmm0
movaps 0x9d7(%rip),%xmm2
andps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
cvtss2sd %xmm2,%xmm3
movsd  0x9b5(%rip),%xmm2
ucomisd %xmm3,%xmm2
jb     16a6 <clip3d+0x5a6>
subss  %xmm6,%xmm1
mulss  %xmm4,%xmm1
addss  %xmm6,%xmm1
movaps 0x9ac(%rip),%xmm3
andps  %xmm1,%xmm3
cvtss2sd %xmm3,%xmm3
ucomisd %xmm3,%xmm2
jb     16a6 <clip3d+0x5a6>
movss  %xmm0,(%rcx)
movss  %xmm1,(%r8)
jmp    16a1 <clip3d+0x5a1>
movss  %xmm4,(%r8)
movss  %xmm8,(%r9)
jmp    16a1 <clip3d+0x5a1>
movss  %xmm9,(%r9)
movss  %xmm4,(%rcx)
mov    $0x1,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @clip3d(double %0, double %1, double %2, double %3, double %4, double %5, float* nocapture writeonly %6, float* nocapture writeonly %7, float* nocapture writeonly %8, float* nocapture writeonly %9, float* nocapture writeonly %10, float* nocapture writeonly %11) {
%13 = fptrunc double %0 to float
%14 = fptrunc double %1 to float
%15 = fptrunc double %2 to float
%16 = fptrunc double %3 to float
%17 = fptrunc double %4 to float
%18 = fptrunc double %5 to float
store float %13, float* %6
store float %14, float* %7
store float %15, float* %8
store float %16, float* %9
store float %17, float* %10
store float %18, float* %11
%19 = fcmp olt float %13, -1.000000e+00
%20 = sext i1 %19 to i32
%21 = fcmp ogt float %13, 1.000000e+00
%22 = select i1 %21, i32 1, i32 %20
%23 = fcmp olt float %16, -1.000000e+00
%24 = sext i1 %23 to i32
%25 = fcmp ogt float %16, 1.000000e+00
%26 = select i1 %25, i32 1, i32 %24
%27 = fcmp olt float %14, -1.000000e+00
%28 = sext i1 %27 to i32
%29 = fcmp ogt float %14, 1.000000e+00
%30 = select i1 %29, i32 1, i32 %28
%31 = fcmp olt float %17, -1.000000e+00
%32 = sext i1 %31 to i32
%33 = fcmp ogt float %17, 1.000000e+00
%34 = select i1 %33, i32 1, i32 %32
%35 = fcmp olt float %15, -1.000000e+00
%36 = sext i1 %35 to i32
%37 = fcmp ogt float %15, 1.000000e+00
%38 = select i1 %37, i32 1, i32 %36
%39 = fcmp olt float %18, -1.000000e+00
%40 = sext i1 %39 to i32
%41 = fcmp ogt float %18, 1.000000e+00
%42 = select i1 %41, i32 1, i32 %40
%43 = tail call i32 @llvm.abs.i32(i32 %22, i1 true)
%44 = tail call i32 @llvm.abs.i32(i32 %26, i1 true)
%45 = tail call i32 @llvm.abs.i32(i32 %30, i1 true)
%46 = tail call i32 @llvm.abs.i32(i32 %34, i1 true)
%47 = tail call i32 @llvm.abs.i32(i32 %38, i1 true)
%48 = add nuw nsw i32 %45, %43
%49 = add nuw nsw i32 %48, %47
%50 = add nuw nsw i32 %49, %44
%51 = add nuw nsw i32 %50, %46
%52 = tail call i32 @llvm.abs.i32(i32 %42, i1 true)
%53 = sub nsw i32 0, %52
%54 = icmp eq i32 %51, %53
br i1 %54, label %190, label %55
55: ; preds = %12
%56 = icmp eq i32 %22, %26
%57 = or i1 %21, %19
%58 = and i1 %57, %56
br i1 %58, label %190, label %59
59: ; preds = %55
%60 = icmp eq i32 %30, %34
%61 = or i1 %29, %27
%62 = and i1 %61, %60
br i1 %62, label %190, label %63
63: ; preds = %59
%64 = icmp eq i32 %38, %42
%65 = or i1 %37, %35
%66 = and i1 %65, %64
br i1 %66, label %190, label %67
67: ; preds = %63
%68 = icmp eq i32 %22, 0
br i1 %68, label %86, label %69
69: ; preds = %67
%70 = select i1 %21, float 1.000000e+00, float -1.000000e+00
store float %70, float* %6
%71 = fsub float %70, %16
%72 = fsub float %13, %16
%73 = fdiv float %71, %72
%74 = fsub float %14, %17
%75 = tail call float @llvm.fmuladd.f32(float %74, float %73, float %17)
%76 = fsub float %15, %18
%77 = tail call float @llvm.fmuladd.f32(float %76, float %73, float %18)
%78 = tail call float @llvm.fabs.f32(float %77)
%79 = fpext float %78 to double
%80 = fcmp ugt double %79, 0x3FF000010C6F7A0B
br i1 %80, label %86, label %81
81: ; preds = %69
%82 = tail call float @llvm.fabs.f32(float %75)
%83 = fpext float %82 to double
%84 = fcmp ugt double %83, 0x3FF000010C6F7A0B
br i1 %84, label %86, label %85
85: ; preds = %81
store float %75, float* %7
store float %77, float* %8
br label %126
86: ; preds = %69, %81, %67
%87 = phi i32 [ 1, %67 ], [ 0, %81 ], [ 0, %69 ]
%88 = icmp eq i32 %30, 0
br i1 %88, label %106, label %89
89: ; preds = %86
%90 = select i1 %29, float 1.000000e+00, float -1.000000e+00
store float %90, float* %7
%91 = fsub float %90, %17
%92 = fsub float %14, %17
%93 = fdiv float %91, %92
%94 = fsub float %13, %16
%95 = tail call float @llvm.fmuladd.f32(float %94, float %93, float %16)
%96 = fsub float %15, %18
%97 = tail call float @llvm.fmuladd.f32(float %96, float %93, float %18)
%98 = tail call float @llvm.fabs.f32(float %97)
%99 = fpext float %98 to double
%100 = fcmp ugt double %99, 0x3FF000010C6F7A0B
br i1 %100, label %106, label %101
101: ; preds = %89
%102 = tail call float @llvm.fabs.f32(float %95)
%103 = fpext float %102 to double
%104 = fcmp ugt double %103, 0x3FF000010C6F7A0B
br i1 %104, label %106, label %105
105: ; preds = %101
store float %95, float* %6
store float %97, float* %8
br label %126
106: ; preds = %89, %101, %86
%107 = phi i32 [ %87, %86 ], [ 0, %101 ], [ 0, %89 ]
%108 = icmp eq i32 %38, 0
br i1 %108, label %126, label %109
109: ; preds = %106
%110 = select i1 %37, float 1.000000e+00, float -1.000000e+00
store float %110, float* %8
%111 = fsub float %110, %18
%112 = fsub float %15, %18
%113 = fdiv float %111, %112
%114 = fsub float %13, %16
%115 = tail call float @llvm.fmuladd.f32(float %113, float %114, float %16)
%116 = fsub float %14, %17
%117 = tail call float @llvm.fmuladd.f32(float %113, float %116, float %17)
%118 = tail call float @llvm.fabs.f32(float %115)
%119 = fpext float %118 to double
%120 = fcmp ugt double %119, 0x3FF000010C6F7A0B
br i1 %120, label %126, label %121
121: ; preds = %109
%122 = tail call float @llvm.fabs.f32(float %117)
%123 = fpext float %122 to double
%124 = fcmp ugt double %123, 0x3FF000010C6F7A0B
br i1 %124, label %126, label %125
125: ; preds = %121
store float %115, float* %6
store float %117, float* %7
br label %126
126: ; preds = %109, %121, %125, %106, %105, %85
%127 = phi i32 [ %107, %106 ], [ %107, %125 ], [ %87, %105 ], [ 1, %85 ], [ 0, %121 ], [ 0, %109 ]
%128 = phi i32 [ 0, %106 ], [ 1, %125 ], [ 1, %105 ], [ 1, %85 ], [ 0, %121 ], [ 0, %109 ]
%129 = icmp eq i32 %26, 0
%130 = sub nsw i32 0, %128
%131 = icmp eq i32 %127, %130
%132 = select i1 %129, i1 true, i1 %131
br i1 %132, label %150, label %133
133: ; preds = %126
%134 = select i1 %25, float 1.000000e+00, float -1.000000e+00
store float %134, float* %9
%135 = fsub float %134, %13
%136 = fsub float %16, %13
%137 = fdiv float %135, %136
%138 = fsub float %17, %14
%139 = tail call float @llvm.fmuladd.f32(float %138, float %137, float %14)
%140 = fsub float %18, %15
%141 = tail call float @llvm.fmuladd.f32(float %140, float %137, float %15)
%142 = tail call float @llvm.fabs.f32(float %139)
%143 = fpext float %142 to double
%144 = fcmp ugt double %143, 0x3FF000010C6F7A0B
br i1 %144, label %150, label %145
145: ; preds = %133
%146 = tail call float @llvm.fabs.f32(float %141)
%147 = fpext float %146 to double
%148 = fcmp ugt double %147, 0x3FF000010C6F7A0B
br i1 %148, label %150, label %149
149: ; preds = %145
store float %139, float* %10
store float %141, float* %11
br label %190
150: ; preds = %133, %145, %126
%151 = icmp eq i32 %34, 0
%152 = select i1 %151, i1 true, i1 %131
br i1 %152, label %170, label %153
153: ; preds = %150
%154 = select i1 %33, float 1.000000e+00, float -1.000000e+00
store float %154, float* %10
%155 = fsub float %154, %14
%156 = fsub float %17, %14
%157 = fdiv float %155, %156
%158 = fsub float %16, %13
%159 = tail call float @llvm.fmuladd.f32(float %158, float %157, float %13)
%160 = fsub float %18, %15
%161 = tail call float @llvm.fmuladd.f32(float %160, float %157, float %15)
%162 = tail call float @llvm.fabs.f32(float %159)
%163 = fpext float %162 to double
%164 = fcmp ugt double %163, 0x3FF000010C6F7A0B
br i1 %164, label %170, label %165
165: ; preds = %153
%166 = tail call float @llvm.fabs.f32(float %161)
%167 = fpext float %166 to double
%168 = fcmp ugt double %167, 0x3FF000010C6F7A0B
br i1 %168, label %170, label %169
169: ; preds = %165
store float %161, float* %11
store float %159, float* %9
br label %190
170: ; preds = %153, %165, %150
%171 = icmp eq i32 %42, 0
%172 = select i1 %171, i1 true, i1 %131
br i1 %172, label %190, label %173
173: ; preds = %170
%174 = select i1 %41, float 1.000000e+00, float -1.000000e+00
store float %174, float* %11
%175 = fsub float %174, %15
%176 = fsub float %18, %15
%177 = fdiv float %175, %176
%178 = fsub float %16, %13
%179 = tail call float @llvm.fmuladd.f32(float %178, float %177, float %13)
%180 = fsub float %17, %14
%181 = tail call float @llvm.fmuladd.f32(float %180, float %177, float %14)
%182 = tail call float @llvm.fabs.f32(float %179)
%183 = fpext float %182 to double
%184 = fcmp ugt double %183, 0x3FF000010C6F7A0B
br i1 %184, label %190, label %185
185: ; preds = %173
%186 = tail call float @llvm.fabs.f32(float %181)
%187 = fpext float %186 to double
%188 = fcmp ugt double %187, 0x3FF000010C6F7A0B
br i1 %188, label %190, label %189
189: ; preds = %185
store float %179, float* %9
store float %181, float* %10
br label %190
190: ; preds = %173, %185, %170, %63, %59, %55, %12, %189, %169, %149
%191 = phi i32 [ 1, %189 ], [ 1, %169 ], [ 1, %149 ], [ 1, %12 ], [ 0, %55 ], [ 0, %59 ], [ 0, %63 ], [ %128, %170 ], [ %128, %185 ], [ %128, %173 ]
ret i32 %191
}