void _drawline(unsigned char *in_im, unsigned int *lbl_im,
               unsigned int curr_lbl, unsigned char *out_im, const double theta,
               const double phi, const int cen_i, const int cen_j,
               const int cen_k, const int dimx, const int dimy, const int dimz,
               unsigned char lbl) {
  double x, y, z;
  double prec_x, prec_y, prec_z;
  double end_x1, end_y1, end_z1;
  double end_x2, end_y2, end_z2;
  unsigned char prec_status, curr_status;
  double r_0, r_1, r_2;
  double normr_0, normr_1, normr_2;
  r_0 = cos(phi) * sin(theta);
  r_1 = sin(phi) * sin(theta);
  r_2 = cos(theta);
  if ((fabs(r_0) >= fabs(r_1)) && (fabs(r_0) >= fabs(r_2))) {
    normr_0 = 1.0;
    normr_1 = r_1 / r_0;
    normr_2 = r_2 / r_0;
  } else if ((fabs(r_1) >= fabs(r_0)) && (fabs(r_1) >= fabs(r_2))) {
    normr_1 = 1.0;
    normr_0 = r_0 / r_1;
    normr_2 = r_2 / r_1;
  } else {
    normr_2 = 1.0;
    normr_0 = r_0 / r_2;
    normr_1 = r_1 / r_2;
  }
  normr_0 = (r_0 > 0) ? fabs(normr_0) : (-fabs(normr_0));
  normr_1 = (r_1 > 0) ? fabs(normr_1) : (-fabs(normr_1));
  normr_2 = (r_2 > 0) ? fabs(normr_2) : (-fabs(normr_2));
  x = cen_i;
  y = cen_j;
  z = cen_k;
  prec_status =
      in_im[(((int)y) * (dimx) + ((int)x) + ((int)z) * (dimx) * (dimy))];
  curr_status =
      in_im[(((int)y) * (dimx) + ((int)x) + ((int)z) * (dimx) * (dimy))];
  prec_x = x;
  prec_y = y;
  prec_z = z;
  while ((x >= 0) && (x < dimx) && (y >= 0) && (y < dimy) && (z >= 0) &&
         (z < dimz) &&
         (lbl_im[(((int)y) * (dimx) + ((int)x) + ((int)z) * (dimx) * (dimy))] ==
          curr_lbl)) {
    out_im[(((int)y) * (dimx) + ((int)x) + ((int)z) * (dimx) * (dimy))] = lbl;
    curr_status =
        in_im[(((int)y) * (dimx) + ((int)x) + ((int)z) * (dimx) * (dimy))];
    if (curr_status != prec_status) {
      prec_status = curr_status;
    }
    prec_x = x;
    prec_y = y;
    prec_z = z;
    x = x + normr_0;
    y = y + normr_1;
    z = z + normr_2;
  }
  end_x1 = prec_x;
  end_y1 = prec_y;
  end_z1 = prec_z;
  x = cen_i;
  y = cen_j;
  z = cen_k;
  prec_status =
      in_im[(((int)y) * (dimx) + ((int)x) + ((int)z) * (dimx) * (dimy))];
  curr_status =
      in_im[(((int)y) * (dimx) + ((int)x) + ((int)z) * (dimx) * (dimy))];
  prec_x = x;
  prec_y = y;
  prec_z = z;
  while ((x >= 0) && (x < dimx) && (y >= 0) && (y < dimy) && (z >= 0) &&
         (z < dimz) &&
         (lbl_im[(((int)y) * (dimx) + ((int)x) + ((int)z) * (dimx) * (dimy))] ==
          curr_lbl)) {
    out_im[(((int)y) * (dimx) + ((int)x) + ((int)z) * (dimx) * (dimy))] = lbl;
    curr_status =
        in_im[(((int)y) * (dimx) + ((int)x) + ((int)z) * (dimx) * (dimy))];
    if (curr_status != prec_status) {
      prec_status = curr_status;
    }
    prec_x = x;
    prec_y = y;
    prec_z = z;
    x = x - normr_0;
    y = y - normr_1;
    z = z - normr_2;
  }
  end_x2 = prec_x;
  end_y2 = prec_y;
  end_z2 = prec_z;
}


x86 assembly (clang, -O0):
<_drawline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    0x30(%rbp),%al
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
mov    %r8d,-0x34(%rbp)
mov    %r9d,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xe0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xd8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movaps 0xe1e(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0xb0(%rbp),%xmm1
ff
movaps 0xe0b(%rip),%xmm2
pand   %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     1278 <_drawline+0x158>
movsd  -0xa8(%rbp),%xmm0
ff
movaps 0xdee(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0xb8(%rbp),%xmm1
ff
movaps 0xddb(%rip),%xmm2
pand   %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     1278 <_drawline+0x158>
movsd  0xdd5(%rip),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
divsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
divsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
jmp    1362 <_drawline+0x242>
movsd  -0xb0(%rbp),%xmm0
ff
movaps 0xd79(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0xa8(%rbp),%xmm1
ff
movaps 0xd66(%rip),%xmm2
pand   %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     131d <_drawline+0x1fd>
movsd  -0xb0(%rbp),%xmm0
ff
movaps 0xd49(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0xb8(%rbp),%xmm1
ff
movaps 0xd36(%rip),%xmm2
pand   %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     131d <_drawline+0x1fd>
movsd  0xd30(%rip),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
divsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
divsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
jmp    135d <_drawline+0x23d>
movsd  0xceb(%rip),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
divsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
divsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
jmp    1362 <_drawline+0x242>
movsd  -0xa8(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1397 <_drawline+0x277>
movsd  -0xc0(%rbp),%xmm0
ff
movaps 0xc7a(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
jmp    13c9 <_drawline+0x2a9>
movsd  -0xc0(%rbp),%xmm0
ff
movaps 0xc5a(%rip),%xmm1
pand   %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0xe8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    140e <_drawline+0x2ee>
movsd  -0xc8(%rbp),%xmm0
ff
movaps 0xc03(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
jmp    1440 <_drawline+0x320>
movsd  -0xc8(%rbp),%xmm0
ff
movaps 0xbe3(%rip),%xmm1
pand   %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0xf0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1485 <_drawline+0x365>
movsd  -0xd0(%rbp),%xmm0
ff
movaps 0xb8c(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
jmp    14b7 <_drawline+0x397>
movsd  -0xd0(%rbp),%xmm0
ff
movaps 0xb6c(%rip),%xmm1
pand   %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0xf8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
cvtsi2sdl -0x34(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
cvtsi2sdl -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
cvtsi2sdl 0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si -0x48(%rbp),%ecx
imul   0x18(%rbp),%ecx
cvttsd2si -0x40(%rbp),%edx
add    %edx,%ecx
cvttsd2si -0x50(%rbp),%edx
imul   0x18(%rbp),%edx
imul   0x20(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x99(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si -0x48(%rbp),%ecx
imul   0x18(%rbp),%ecx
cvttsd2si -0x40(%rbp),%edx
add    %edx,%ecx
cvttsd2si -0x50(%rbp),%edx
imul   0x18(%rbp),%edx
imul   0x20(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x9a(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xf9(%rbp)
jb     1638 <_drawline+0x518>
movsd  -0x40(%rbp),%xmm1
cvtsi2sdl 0x18(%rbp),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0xf9(%rbp)
jbe    1638 <_drawline+0x518>
movsd  -0x48(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xf9(%rbp)
jb     1638 <_drawline+0x518>
movsd  -0x48(%rbp),%xmm1
cvtsi2sdl 0x20(%rbp),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0xf9(%rbp)
jbe    1638 <_drawline+0x518>
movsd  -0x50(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xf9(%rbp)
jb     1638 <_drawline+0x518>
movsd  -0x50(%rbp),%xmm1
cvtsi2sdl 0x28(%rbp),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0xf9(%rbp)
jbe    1638 <_drawline+0x518>
mov    -0x10(%rbp),%rax
cvttsd2si -0x48(%rbp),%ecx
imul   0x18(%rbp),%ecx
cvttsd2si -0x40(%rbp),%edx
add    %edx,%ecx
cvttsd2si -0x50(%rbp),%edx
imul   0x18(%rbp),%edx
imul   0x20(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
sete   %al
mov    %al,-0xf9(%rbp)
mov    -0xf9(%rbp),%al
test   $0x1,%al
jne    164b <_drawline+0x52b>
jmp    1721 <_drawline+0x601>
mov    0x30(%rbp),%dl
mov    -0x20(%rbp),%rax
cvttsd2si -0x48(%rbp),%ecx
imul   0x18(%rbp),%ecx
cvttsd2si -0x40(%rbp),%esi
add    %esi,%ecx
cvttsd2si -0x50(%rbp),%esi
imul   0x18(%rbp),%esi
imul   0x20(%rbp),%esi
add    %esi,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
cvttsd2si -0x48(%rbp),%ecx
imul   0x18(%rbp),%ecx
cvttsd2si -0x40(%rbp),%edx
add    %edx,%ecx
cvttsd2si -0x50(%rbp),%edx
imul   0x18(%rbp),%edx
imul   0x20(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x9a(%rbp)
movzbl -0x9a(%rbp),%eax
movzbl -0x99(%rbp),%ecx
cmp    %ecx,%eax
je     16c8 <_drawline+0x5a8>
mov    -0x9a(%rbp),%al
mov    %al,-0x99(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
addsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0x40(%rbp)
movsd  -0x48(%rbp),%xmm0
addsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm0
addsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0x50(%rbp)
jmp    1561 <_drawline+0x441>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
cvtsi2sdl -0x34(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
cvtsi2sdl -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
cvtsi2sdl 0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si -0x48(%rbp),%ecx
imul   0x18(%rbp),%ecx
cvttsd2si -0x40(%rbp),%edx
add    %edx,%ecx
cvttsd2si -0x50(%rbp),%edx
imul   0x18(%rbp),%edx
imul   0x20(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x99(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si -0x48(%rbp),%ecx
imul   0x18(%rbp),%ecx
cvttsd2si -0x40(%rbp),%edx
add    %edx,%ecx
cvttsd2si -0x50(%rbp),%edx
imul   0x18(%rbp),%edx
imul   0x20(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x9a(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xfa(%rbp)
jb     18b0 <_drawline+0x790>
movsd  -0x40(%rbp),%xmm1
cvtsi2sdl 0x18(%rbp),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0xfa(%rbp)
jbe    18b0 <_drawline+0x790>
movsd  -0x48(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xfa(%rbp)
jb     18b0 <_drawline+0x790>
movsd  -0x48(%rbp),%xmm1
cvtsi2sdl 0x20(%rbp),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0xfa(%rbp)
jbe    18b0 <_drawline+0x790>
movsd  -0x50(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xfa(%rbp)
jb     18b0 <_drawline+0x790>
movsd  -0x50(%rbp),%xmm1
cvtsi2sdl 0x28(%rbp),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0xfa(%rbp)
jbe    18b0 <_drawline+0x790>
mov    -0x10(%rbp),%rax
cvttsd2si -0x48(%rbp),%ecx
imul   0x18(%rbp),%ecx
cvttsd2si -0x40(%rbp),%edx
add    %edx,%ecx
cvttsd2si -0x50(%rbp),%edx
imul   0x18(%rbp),%edx
imul   0x20(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
sete   %al
mov    %al,-0xfa(%rbp)
mov    -0xfa(%rbp),%al
test   $0x1,%al
jne    18c3 <_drawline+0x7a3>
jmp    1999 <_drawline+0x879>
mov    0x30(%rbp),%dl
mov    -0x20(%rbp),%rax
cvttsd2si -0x48(%rbp),%ecx
imul   0x18(%rbp),%ecx
cvttsd2si -0x40(%rbp),%esi
add    %esi,%ecx
cvttsd2si -0x50(%rbp),%esi
imul   0x18(%rbp),%esi
imul   0x20(%rbp),%esi
add    %esi,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
cvttsd2si -0x48(%rbp),%ecx
imul   0x18(%rbp),%ecx
cvttsd2si -0x40(%rbp),%edx
add    %edx,%ecx
cvttsd2si -0x50(%rbp),%edx
imul   0x18(%rbp),%edx
imul   0x20(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x9a(%rbp)
movzbl -0x9a(%rbp),%eax
movzbl -0x99(%rbp),%ecx
cmp    %ecx,%eax
je     1940 <_drawline+0x820>
mov    -0x9a(%rbp),%al
mov    %al,-0x99(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
subsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0x40(%rbp)
movsd  -0x48(%rbp),%xmm0
subsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm0
subsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0x50(%rbp)
jmp    17d9 <_drawline+0x6b9>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_drawline>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x40,%rsp
mov    %r9d,%r12d
mov    %r8d,%r15d
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    %rcx,%r14
mov    %edx,%ebp
mov    %rsi,%rbx
movaps %xmm1,%xmm0
call   1040 <cos@plt>
movaps %xmm0,0x30(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movapd 0x30(%rsp),%xmm1
unpcklpd 0x10(%rsp),%xmm1
movapd 0x20(%rsp),%xmm2
unpcklpd %xmm0,%xmm2
mulpd  %xmm1,%xmm2
movapd %xmm2,0x20(%rsp)
movq   0x8(%rsp),%xmm0
call   1040 <cos@plt>
movdqa 0x20(%rsp),%xmm5
movdqa 0xe49(%rip),%xmm1
movdqa %xmm5,%xmm3
pand   %xmm1,%xmm3
pshufd $0xee,%xmm3,%xmm2
ucomisd %xmm2,%xmm3
pand   %xmm0,%xmm1
jb     11fe <_drawline+0xde>
ucomisd %xmm1,%xmm3
jb     11fe <_drawline+0xde>
movdqa %xmm5,%xmm1
punpckhqdq %xmm5,%xmm1
divsd  %xmm5,%xmm1
movdqa %xmm0,%xmm3
divsd  %xmm5,%xmm3
movapd 0xe20(%rip),%xmm2
unpcklpd %xmm1,%xmm2
test   %r15d,%r15d
jns    1256 <_drawline+0x136>
jmp    13c9 <_drawline+0x2a9>
ucomisd %xmm3,%xmm2
jb     1235 <_drawline+0x115>
ucomisd %xmm1,%xmm2
jb     1235 <_drawline+0x115>
movapd %xmm5,%xmm1
unpckhpd %xmm5,%xmm1
movapd %xmm5,%xmm2
divsd  %xmm1,%xmm2
movdqa %xmm0,%xmm3
divsd  %xmm1,%xmm3
shufpd $0x2,0xdf5(%rip),%xmm2
test   %r15d,%r15d
jns    1256 <_drawline+0x136>
jmp    13c9 <_drawline+0x2a9>
movdqa %xmm0,%xmm1
punpcklqdq %xmm0,%xmm1
movapd %xmm5,%xmm2
divpd  %xmm1,%xmm2
movsd  0xdf3(%rip),%xmm3
test   %r15d,%r15d
js     13c9 <_drawline+0x2a9>
mov    0x90(%rsp),%r8b
mov    0x80(%rsp),%ecx
mov    0x78(%rsp),%edx
xorpd  %xmm4,%xmm4
cmpltpd %xmm5,%xmm4
movapd 0xd86(%rip),%xmm5
movapd 0xdae(%rip),%xmm6
movapd %xmm2,%xmm7
orpd   %xmm6,%xmm7
movapd %xmm5,%xmm1
andpd  %xmm4,%xmm1
andnpd %xmm7,%xmm4
andpd  %xmm2,%xmm1
orpd   %xmm4,%xmm1
orpd   %xmm3,%xmm6
xorpd  %xmm7,%xmm7
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm5
andpd  %xmm3,%xmm5
andnpd %xmm6,%xmm2
orpd   %xmm5,%xmm2
movd   %r12d,%xmm0
movd   %r15d,%xmm3
punpckldq %xmm0,%xmm3
cvtdq2pd %xmm3,%xmm4
xorps  %xmm6,%xmm6
cvtsi2sdl 0x70(%rsp),%xmm6
cvtsi2sd %edx,%xmm10
cvtsi2sd %ecx,%xmm9
cvtsi2sdl 0x88(%rsp),%xmm8
movapd %xmm6,%xmm3
movapd %xmm4,%xmm5
cs nopw 0x0(%rax,%rax,1)
ucomisd %xmm5,%xmm10
jbe    1359 <_drawline+0x239>
movapd %xmm5,%xmm0
unpckhpd %xmm5,%xmm0
ucomisd %xmm7,%xmm0
jb     1359 <_drawline+0x239>
ucomisd %xmm0,%xmm9
jbe    1359 <_drawline+0x239>
ucomisd %xmm7,%xmm3
jb     1359 <_drawline+0x239>
ucomisd %xmm3,%xmm8
jbe    1359 <_drawline+0x239>
cvttsd2si %xmm0,%esi
cvttsd2si %xmm5,%edi
cvttsd2si %xmm3,%eax
imul   %ecx,%eax
add    %esi,%eax
imul   %edx,%eax
add    %edi,%eax
movslq %eax,%rsi
cmp    %ebp,(%rbx,%rsi,4)
jne    1359 <_drawline+0x239>
mov    %r8b,(%r14,%rsi,1)
addpd  %xmm1,%xmm5
addsd  %xmm2,%xmm3
ucomisd %xmm7,%xmm5
jae    1300 <_drawline+0x1e0>
test   %r15d,%r15d
js     13c9 <_drawline+0x2a9>
xorpd  %xmm7,%xmm7
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
ucomisd %xmm4,%xmm10
jbe    13c9 <_drawline+0x2a9>
movapd %xmm4,%xmm0
unpckhpd %xmm4,%xmm0
ucomisd %xmm7,%xmm0
jb     13c9 <_drawline+0x2a9>
ucomisd %xmm0,%xmm9
jbe    13c9 <_drawline+0x2a9>
ucomisd %xmm7,%xmm6
jb     13c9 <_drawline+0x2a9>
ucomisd %xmm6,%xmm8
jbe    13c9 <_drawline+0x2a9>
cvttsd2si %xmm0,%eax
cvttsd2si %xmm4,%esi
cvttsd2si %xmm6,%edi
imul   %ecx,%edi
add    %eax,%edi
imul   %edx,%edi
add    %esi,%edi
movslq %edi,%rsi
cmp    %ebp,(%rbx,%rsi,4)
jne    13c9 <_drawline+0x2a9>
mov    %r8b,(%r14,%rsi,1)
subpd  %xmm1,%xmm4
subsd  %xmm2,%xmm6
ucomisd %xmm7,%xmm4
jae    1370 <_drawline+0x250>
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @_drawline(i8* nocapture %0, i32* nocapture %1, i32 %2, i8* nocapture writeonly %3, double %4, double %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i8 zeroext %12) {
%14 = tail call double @cos(double %5)
%15 = tail call double @sin(double %4)
%16 = tail call double @sin(double %5)
%17 = tail call double @sin(double %4)
%18 = insertelement <2 x double> poison, double %14, i64 0
%19 = insertelement <2 x double> %18, double %16, i64 1
%20 = insertelement <2 x double> poison, double %15, i64 0
%21 = insertelement <2 x double> %20, double %17, i64 1
%22 = fmul <2 x double> %19, %21
%23 = tail call double @cos(double %4)
%24 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %22)
%25 = extractelement <2 x double> %24, i64 0
%26 = extractelement <2 x double> %24, i64 1
%27 = fcmp ult double %25, %26
%28 = tail call double @llvm.fabs.f64(double %23)
%29 = fcmp ult double %25, %28
%30 = select i1 %27, i1 true, i1 %29
br i1 %30, label %37, label %31
31: ; preds = %13
%32 = extractelement <2 x double> %22, i64 0
%33 = extractelement <2 x double> %22, i64 1
%34 = fdiv double %33, %32
%35 = fdiv double %23, %32
%36 = insertelement <2 x double> <double 1.000000e+00, double poison>, double %34, i64 1
br label %51
37: ; preds = %13
%38 = fcmp ult double %26, %25
%39 = fcmp ult double %26, %28
%40 = select i1 %38, i1 true, i1 %39
br i1 %40, label %47, label %41
41: ; preds = %37
%42 = extractelement <2 x double> %22, i64 0
%43 = extractelement <2 x double> %22, i64 1
%44 = fdiv double %42, %43
%45 = fdiv double %23, %43
%46 = insertelement <2 x double> <double poison, double 1.000000e+00>, double %44, i64 0
br label %51
47: ; preds = %37
%48 = insertelement <2 x double> poison, double %23, i64 0
%49 = shufflevector <2 x double> %48, <2 x double> poison, <2 x i32> zeroinitializer
%50 = fdiv <2 x double> %22, %49
br label %51
51: ; preds = %41, %47, %31
%52 = phi double [ %35, %31 ], [ %45, %41 ], [ 1.000000e+00, %47 ]
%53 = phi <2 x double> [ %36, %31 ], [ %46, %41 ], [ %50, %47 ]
%54 = fcmp ogt <2 x double> %22, zeroinitializer
%55 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %53)
%56 = fneg <2 x double> %55
%57 = select <2 x i1> %54, <2 x double> %55, <2 x double> %56
%58 = fcmp ogt double %23, 0.000000e+00
%59 = tail call double @llvm.fabs.f64(double %52)
%60 = fneg double %59
%61 = select i1 %58, double %59, double %60
%62 = insertelement <2 x i32> poison, i32 %6, i64 0
%63 = insertelement <2 x i32> %62, i32 %7, i64 1
%64 = sitofp <2 x i32> %63 to <2 x double>
%65 = sitofp i32 %8 to double
%66 = icmp slt i32 %6, 0
br i1 %66, label %140, label %67
67: ; preds = %51
%68 = sitofp i32 %9 to double
%69 = sitofp i32 %10 to double
%70 = sitofp i32 %11 to double
br label %71
71: ; preds = %67, %97
%72 = phi double [ %65, %67 ], [ %100, %97 ]
%73 = phi <2 x double> [ %64, %67 ], [ %99, %97 ]
%74 = extractelement <2 x double> %73, i64 0
%75 = fcmp olt double %74, %68
%76 = extractelement <2 x double> %73, i64 1
%77 = fcmp oge double %76, 0.000000e+00
%78 = select i1 %75, i1 %77, i1 false
br i1 %78, label %79, label %103
79: ; preds = %71
%80 = fcmp olt double %76, %69
%81 = fcmp oge double %72, 0.000000e+00
%82 = select i1 %80, i1 %81, i1 false
%83 = fcmp olt double %72, %70
%84 = select i1 %82, i1 %83, i1 false
br i1 %84, label %85, label %103
85: ; preds = %79
%86 = fptosi double %76 to i32
%87 = fptosi double %74 to i32
%88 = fptosi double %72 to i32
%89 = mul i32 %88, %10
%90 = add i32 %89, %86
%91 = mul i32 %90, %9
%92 = add i32 %91, %87
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i32, i32* %1, i64 %93
%95 = load i32, i32* %94
%96 = icmp eq i32 %95, %2
br i1 %96, label %97, label %103
97: ; preds = %85
%98 = getelementptr inbounds i8, i8* %3, i64 %93
store i8 %12, i8* %98
%99 = fadd <2 x double> %57, %73
%100 = fadd double %61, %72
%101 = extractelement <2 x double> %99, i64 0
%102 = fcmp ult double %101, 0.000000e+00
br i1 %102, label %103, label %71
103: ; preds = %85, %79, %71, %97
br i1 %66, label %140, label %104
104: ; preds = %103
%105 = sitofp i32 %9 to double
%106 = sitofp i32 %10 to double
%107 = sitofp i32 %11 to double
br label %108
108: ; preds = %104, %134
%109 = phi double [ %65, %104 ], [ %137, %134 ]
%110 = phi <2 x double> [ %64, %104 ], [ %136, %134 ]
%111 = extractelement <2 x double> %110, i64 0
%112 = fcmp olt double %111, %105
%113 = extractelement <2 x double> %110, i64 1
%114 = fcmp oge double %113, 0.000000e+00
%115 = select i1 %112, i1 %114, i1 false
br i1 %115, label %116, label %140
116: ; preds = %108
%117 = fcmp olt double %113, %106
%118 = fcmp oge double %109, 0.000000e+00
%119 = select i1 %117, i1 %118, i1 false
%120 = fcmp olt double %109, %107
%121 = select i1 %119, i1 %120, i1 false
br i1 %121, label %122, label %140
122: ; preds = %116
%123 = fptosi double %113 to i32
%124 = fptosi double %111 to i32
%125 = fptosi double %109 to i32
%126 = mul i32 %125, %10
%127 = add i32 %126, %123
%128 = mul i32 %127, %9
%129 = add i32 %128, %124
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds i32, i32* %1, i64 %130
%132 = load i32, i32* %131
%133 = icmp eq i32 %132, %2
br i1 %133, label %134, label %140
134: ; preds = %122
%135 = getelementptr inbounds i8, i8* %3, i64 %130
store i8 %12, i8* %135
%136 = fsub <2 x double> %110, %57
%137 = fsub double %109, %61
%138 = extractelement <2 x double> %136, i64 0
%139 = fcmp ult double %138, 0.000000e+00
br i1 %139, label %140, label %108
140: ; preds = %122, %116, %108, %134, %51, %103
ret void
}