// File: /workspace/github_cpp_makefile_star2_O1/sundale[P]gcode/rs274ngc/interp_convert.cc
// Function: Interp::convert_setup(block_struct*, setup_struct*)
int Interp::convert_setup(block_pointer block,   //!< pointer to a block of RS274/NGC instructions
                         setup_pointer settings)        //!< pointer to machine settings                 
{
  double x;
  double y;
  double z;
  double a;
  double b;
  double c;
  double u, v, w;
  double r;
  double *parameters;
  int p_int;

  double cx, cy, cz, ca, cb, cc, cu, cv, cw;

  CHKS((block->i_flag || block->j_flag), _("I J words not allowed with G10 L2"));

  parameters = settings->parameters;
  p_int = (int) (block->p_number + 0.0001);

  CHKS((block->l_number == 20 && block->a_flag && settings->a_axis_wrapped && 
        (block->a_number <= -360.0 || block->a_number >= 360.0)), 
       (_("Invalid absolute position %5.2f for wrapped rotary axis %c")), block->a_number, 'A');
  CHKS((block->l_number == 20 && block->b_flag && settings->b_axis_wrapped && 
        (block->b_number <= -360.0 || block->b_number >= 360.0)), 
       (_("Invalid absolute position %5.2f for wrapped rotary axis %c")), block->b_number, 'B');
  CHKS((block->l_number == 20 && block->c_flag && settings->c_axis_wrapped && 
        (block->c_number <= -360.0 || block->c_number >= 360.0)), 
       (_("Invalid absolute position %5.2f for wrapped rotary axis %c")), block->c_number, 'C');

  CHKS((settings->cutter_comp_side && p_int == settings->origin_index),
       (_("Cannot change the active coordinate system with cutter radius compensation on")));

  find_current_in_system(settings, p_int,
                         &cx, &cy, &cz,
                         &ca, &cb, &cc,
                         &cu, &cv, &cw);

  if (block->r_flag == ON) {
    CHKS((block->l_number == 20), "R not allowed in G10 L20");
    r = block->r_number;
    parameters[5210 + (p_int * 20)] = r;
  } else
    r = parameters[5210 + (p_int * 20)];

  if (block->l_number == 20) {
      // old position in rotated system
      double oldx = cx, oldy = cy;

      // find new desired position in rotated system
      x = cx;
      y = cy;

      if (block->x_flag == ON) {
          x = block->x_number;
      }      
      if (block->y_flag == ON) {
          y = block->y_number;
      }

      // move old current position into the unrotated system
      rotate(&oldx, &oldy, r);
      // move desired position into the unrotated system
      rotate(&x, &y, r);

      // find new offset
      x = oldx + USER_TO_PROGRAM_LEN(parameters[5201 + (p_int * 20)]) - x;
      y = oldy + USER_TO_PROGRAM_LEN(parameters[5202 + (p_int * 20)]) - y;

      // parameters are not rotated
      parameters[5201 + (p_int * 20)] = PROGRAM_TO_USER_LEN(x);
      parameters[5202 + (p_int * 20)] = PROGRAM_TO_USER_LEN(y);

      if (p_int == settings->origin_index) {
          // let the code below fix up the current coordinates correctly
          rotate(&settings->current_x, &settings->current_y, settings->rotation_xy);
          settings->rotation_xy = 0;
      }
  } else {
      if (block->x_flag == ON) {
          x = block->x_number;
          parameters[5201 + (p_int * 20)] = PROGRAM_TO_USER_LEN(x);
      } else {
          x = USER_TO_PROGRAM_LEN(parameters[5201 + (p_int * 20)]);
      }
      if (block->y_flag == ON) {
          y = block->y_number;
          parameters[5202 + (p_int * 20)] = PROGRAM_TO_USER_LEN(y);
      } else {
          y = USER_TO_PROGRAM_LEN(parameters[5202 + (p_int * 20)]);
      }
  }

  if (block->z_flag == ON) {
    z = block->z_number;
    if (block->l_number == 20) z = cz + USER_TO_PROGRAM_LEN(parameters[5203 + (p_int * 20)]) - z;
    parameters[5203 + (p_int * 20)] = PROGRAM_TO_USER_LEN(z);
  } else
    z = USER_TO_PROGRAM_LEN(parameters[5203 + (p_int * 20)]);

  if (block->a_flag == ON) {
    a = block->a_number;
    if (block->l_number == 20) a = ca + USER_TO_PROGRAM_ANG(parameters[5204 + (p_int * 20)]) - a;
    parameters[5204 + (p_int * 20)] = PROGRAM_TO_USER_ANG(a);
  } else
    a = USER_TO_PROGRAM_ANG(parameters[5204 + (p_int * 20)]);

  if (block->b_flag == ON) {
    b = block->b_number;
    if (block->l_number == 20) b = cb + USER_TO_PROGRAM_ANG(parameters[5205 + (p_int * 20)]) - b;
    parameters[5205 + (p_int * 20)] = PROGRAM_TO_USER_ANG(b);
  } else
    b = USER_TO_PROGRAM_ANG(parameters[5205 + (p_int * 20)]);

  if (block->c_flag == ON) {
    c = block->c_number;
    if (block->l_number == 20) c = cc + USER_TO_PROGRAM_ANG(parameters[5206 + (p_int * 20)]) - c;
    parameters[5206 + (p_int * 20)] = PROGRAM_TO_USER_ANG(c);
  } else
    c = USER_TO_PROGRAM_ANG(parameters[5206 + (p_int * 20)]);

  if (block->u_flag == ON) {
    u = block->u_number;
    if (block->l_number == 20) u = cu + USER_TO_PROGRAM_LEN(parameters[5207 + (p_int * 20)]) - u;
    parameters[5207 + (p_int * 20)] = PROGRAM_TO_USER_LEN(u);
  } else
    u = USER_TO_PROGRAM_LEN(parameters[5207 + (p_int * 20)]);

  if (block->v_flag == ON) {
    v = block->v_number;
    if (block->l_number == 20) v = cv + USER_TO_PROGRAM_LEN(parameters[5208 + (p_int * 20)]) - v;
    parameters[5208 + (p_int * 20)] = PROGRAM_TO_USER_LEN(v);
  } else
    v = USER_TO_PROGRAM_LEN(parameters[5208 + (p_int * 20)]);

  if (block->w_flag == ON) {
    w = block->w_number;
    if (block->l_number == 20) w = cw + USER_TO_PROGRAM_LEN(parameters[5209 + (p_int * 20)]) - w;
    parameters[5209 + (p_int * 20)] = PROGRAM_TO_USER_LEN(w);
  } else
    w = USER_TO_PROGRAM_LEN(parameters[5209 + (p_int * 20)]);

  if (p_int == settings->origin_index) {        /* system is currently used */

    rotate(&settings->current_x, &settings->current_y, settings->rotation_xy);
      
    settings->current_x += settings->origin_offset_x;
    settings->current_y += settings->origin_offset_y;
    settings->current_z += settings->origin_offset_z;
    settings->AA_current += settings->AA_origin_offset;
    settings->BB_current += settings->BB_origin_offset;
    settings->CC_current += settings->CC_origin_offset;
    settings->u_current += settings->u_origin_offset;
    settings->v_current += settings->v_origin_offset;
    settings->w_current += settings->w_origin_offset;

    settings->origin_offset_x = x;
    settings->origin_offset_y = y;
    settings->origin_offset_z = z;
    settings->AA_origin_offset = a;
    settings->BB_origin_offset = b;
    settings->CC_origin_offset = c;
    settings->u_origin_offset = u;
    settings->v_origin_offset = v;
    settings->w_origin_offset = w;

    settings->current_x -= x;
    settings->current_y -= y;
    settings->current_z -= z;
    settings->AA_current -= a;
    settings->BB_current -= b;
    settings->CC_current -= c;
    settings->u_current -= u;
    settings->v_current -= v;
    settings->w_current -= w;

    SET_ORIGIN_OFFSETS(x + settings->axis_offset_x,
                       y + settings->axis_offset_y,
                       z + settings->axis_offset_z,
                       a + settings->AA_axis_offset,
                       b + settings->BB_axis_offset,
                       c + settings->CC_axis_offset,
                       u + settings->u_axis_offset,
                       v + settings->v_axis_offset,
                       w + settings->w_axis_offset);

    rotate(&settings->current_x, &settings->current_y, - r);
    settings->rotation_xy = r;
    SET_XY_ROTATION(settings->rotation_xy);

  }
#ifdef DEBUG_EMC
  else
    enqueue_COMMENT("interpreter: setting coordinate system origin");
#endif
  return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %r12
cmpb $0x0, 0x198(%rsi)
jne 0x158c6
movq %rsi, %r15
cmpb $0x1, 0x1a8(%rsi)
jne 0x15932
leaq 0x2385d(%rip), %rdi     # 0x3912a
callq 0xa1f0
movq %r12, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0xa850
movq 0x2e67a(%rip), %rbx     # 0x43f60
movl $0x0, 0xd670(%rbx)
leaq 0xc6d0(%rbx), %rdi
leaq 0x2207c(%rip), %rsi     # 0x3797a
movl $0x50, %edx
callq 0xa8a0
movw $0x0, 0xc71f(%rbx)
movl $0x1, 0xd670(%rbx)
movl $0x5, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %rbx
movsd 0x210(%r15), %xmm0
movl 0x1c8(%r15), %eax
cmpl $0x14, %eax
jne 0x159db
cmpb $0x1, (%r15)
jne 0x15979
cmpl $0x0, 0x1e6cc(%rbx)
je 0x15979
movsd 0x8(%r15), %xmm1
andpd 0x1f6b5(%rip), %xmm1    # 0x35020
ucomisd 0x21545(%rip), %xmm1    # 0x36eb8
jae 0x15efc
cmpl $0x14, %eax
jne 0x159db
cmpb $0x1, 0x10(%r15)
jne 0x159aa
cmpl $0x0, 0x1e6d0(%rbx)
je 0x159aa
movsd 0x18(%r15), %xmm1
andpd 0x1f684(%rip), %xmm1    # 0x35020
ucomisd 0x21514(%rip), %xmm1    # 0x36eb8
jae 0x16bc6
cmpl $0x14, %eax
jne 0x159db
cmpb $0x1, 0x20(%r15)
jne 0x159db
cmpl $0x0, 0x1e6d4(%rbx)
je 0x159db
movsd 0x28(%r15), %xmm1
andpd 0x1f653(%rip), %xmm1    # 0x35020
ucomisd 0x214e3(%rip), %xmm1    # 0x36eb8
jae 0x16be5
addsd 0x20e7d(%rip), %xmm0    # 0x36860
cvttsd2si %xmm0, %r14d
cmpl $0x0, 0x624(%rbx)
je 0x15a06
cmpl %r14d, 0x179c(%rbx)
jne 0x15a06
leaq 0x2374b(%rip), %rdi     # 0x3914c
jmp 0x158cd
leaq -0xa8(%rbp), %rax
leaq -0xb0(%rbp), %r10
leaq -0xb8(%rbp), %r11
leaq -0xc0(%rbp), %r13
leaq -0xe8(%rbp), %rcx
leaq -0xe0(%rbp), %r8
leaq -0xd8(%rbp), %r9
movq %r12, %rdi
movq %rbx, %rsi
movl %r14d, %edx
pushq %rax
pushq %r10
pushq %r11
pushq %r13
leaq -0xc8(%rbp), %rax
pushq %rax
leaq -0xd0(%rbp), %rax
pushq %rax
callq 0xb670
addq $0x30, %rsp
cmpb $0x1, 0x229(%r15)
jne 0x15a83
cmpl $0x14, 0x1c8(%r15)
jne 0x15a9b
leaq 0x2371f(%rip), %rsi     # 0x3919a
movq %r12, %rdi
jmp 0x158d8
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd 0xba90(%rbx,%rax,8), %xmm3
jmp 0x15aba
movsd 0x230(%r15), %xmm3
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd %xmm3, 0xba90(%rbx,%rax,8)
cmpl $0x14, 0x1c8(%r15)
movsd %xmm3, -0xa0(%rbp)
jne 0x15e68
movsd -0xe8(%rbp), %xmm1
cmpb $0x1, 0x270(%r15)
movaps %xmm1, %xmm2
jne 0x15aee
movsd 0x278(%r15), %xmm2
movsd %xmm2, -0x40(%rbp)
movsd %xmm1, -0x48(%rbp)
movsd -0xe0(%rbp), %xmm1
cmpb $0x1, 0x280(%r15)
movsd %xmm1, -0x38(%rbp)
jne 0x15b18
movsd 0x288(%r15), %xmm1
movsd %xmm1, -0x68(%rbp)
movsd 0x213ab(%rip), %xmm0    # 0x36ed0
mulsd %xmm3, %xmm0
divsd 0x213a7(%rip), %xmm0    # 0x36ed8
movsd %xmm0, -0x30(%rbp)
callq 0xb550
movsd %xmm0, -0x58(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0xa1d0
mulsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x58(%rbp), %xmm0
mulsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0xa1d0
movsd %xmm0, -0x50(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0xb550
movsd %xmm0, -0x80(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0xb550
movsd %xmm0, -0x70(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0xa1d0
movsd %xmm0, -0x98(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0xa1d0
movsd %xmm0, -0x78(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0xb550
movsd %xmm0, -0x90(%rbp)
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
movslq %eax, %r12
movsd 0xba48(%rbx,%r12,8), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0xa990
movq 0x2e371(%rip), %r13     # 0x43f60
movl 0x1690(%r13), %eax
movsd 0x212c2(%rip), %xmm1    # 0x36ec0
movsd %xmm1, -0x60(%rbp)
cmpl $0x3, %eax
je 0x15c10
movsd 0x21290(%rip), %xmm1    # 0x36ea0
movsd -0x98(%rbp), %xmm4
mulsd -0x68(%rbp), %xmm4
movsd -0x70(%rbp), %xmm3
mulsd -0x40(%rbp), %xmm3
movsd -0x58(%rbp), %xmm2
subsd -0x88(%rbp), %xmm2
movsd -0x30(%rbp), %xmm5
divsd %xmm0, %xmm5
movsd 0x21283(%rip), %xmm0    # 0x36ec8
movsd %xmm0, -0x30(%rbp)
cmpl $0x1, %eax
je 0x15c53
movapd %xmm1, %xmm0
divsd %xmm0, %xmm5
addsd %xmm5, %xmm2
movsd %xmm2, -0x58(%rbp)
movsd -0x38(%rbp), %xmm0
mulsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x48(%rbp), %xmm0
mulsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
subsd %xmm4, %xmm3
movsd %xmm3, -0x70(%rbp)
movsd 0xba50(%rbx,%r12,8), %xmm0
movsd %xmm0, -0x50(%rbp)
callq 0xa990
movl 0x1690(%r13), %eax
movsd 0x21216(%rip), %xmm1    # 0x36ec0
cmpl $0x3, %eax
je 0x15cb7
movsd 0x211e9(%rip), %xmm1    # 0x36ea0
movsd -0x68(%rbp), %xmm5
mulsd -0x90(%rbp), %xmm5
movsd -0x40(%rbp), %xmm4
mulsd -0x78(%rbp), %xmm4
movsd -0x48(%rbp), %xmm3
addsd -0x38(%rbp), %xmm3
movsd -0x58(%rbp), %xmm2
subsd -0x70(%rbp), %xmm2
movsd -0x50(%rbp), %xmm6
divsd %xmm0, %xmm6
movsd 0x211d5(%rip), %xmm0    # 0x36ec8
cmpl $0x1, %eax
je 0x15cfc
movapd %xmm1, %xmm0
addsd %xmm5, %xmm4
movsd %xmm4, -0x40(%rbp)
divsd %xmm0, %xmm6
addsd %xmm6, %xmm3
movsd %xmm3, -0x48(%rbp)
movsd %xmm2, -0x58(%rbp)
mulsd %xmm2, %xmm0
movsd %xmm0, -0x38(%rbp)
callq 0xa990
mulsd -0x38(%rbp), %xmm0
movsd %xmm0, 0xba48(%rbx,%r12,8)
movl 0x1690(%r13), %eax
cmpl $0x3, %eax
je 0x15d4d
movsd 0x21158(%rip), %xmm0    # 0x36ea0
movsd %xmm0, -0x60(%rbp)
movsd -0x48(%rbp), %xmm0
subsd -0x40(%rbp), %xmm0
cmpl $0x1, %eax
je 0x15d66
movsd -0x60(%rbp), %xmm1
movsd %xmm1, -0x30(%rbp)
movsd %xmm0, -0x48(%rbp)
movsd -0x30(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
callq 0xa990
mulsd -0x30(%rbp), %xmm0
movsd %xmm0, 0xba50(%rbx,%r12,8)
cmpl %r14d, 0x179c(%rbx)
jne 0x16040
movsd 0x17b8(%rbx), %xmm0
mulsd 0x21126(%rip), %xmm0    # 0x36ed0
divsd 0x21126(%rip), %xmm0    # 0x36ed8
movsd %xmm0, -0x30(%rbp)
movsd 0x600(%rbx), %xmm1
movsd %xmm1, -0x38(%rbp)
callq 0xb550
movsd %xmm0, -0x40(%rbp)
movsd 0x608(%rbx), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0xa1d0
mulsd -0x70(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
mulsd -0x38(%rbp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, -0x40(%rbp)
movsd 0x600(%rbx), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0xa1d0
movsd %xmm0, -0x70(%rbp)
movsd 0x608(%rbx), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0xb550
mulsd -0x68(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
mulsd -0x38(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd -0x40(%rbp), %xmm0
movsd %xmm0, 0x600(%rbx)
movsd %xmm1, 0x608(%rbx)
movq $0x0, 0x17b8(%rbx)
jmp 0x16040
cmpb $0x1, 0x270(%r15)
jne 0x15ea9
movsd 0x278(%r15), %xmm1
movq 0x2e0de(%rip), %rax     # 0x43f60
movl 0x1690(%rax), %edx
xorl %eax, %eax
cmpl $0x3, %edx
sete %cl
cmpl $0x1, %edx
je 0x15f1e
movb %cl, %al
leaq 0x210ee(%rip), %rcx     # 0x36f90
movsd (%rcx,%rax,8), %xmm0
jmp 0x15f26
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd 0xba48(%rbx,%rax,8), %xmm0
movsd %xmm0, -0x58(%rbp)
callq 0xa990
movsd -0x58(%rbp), %xmm1
divsd %xmm0, %xmm1
movq 0x2e087(%rip), %rax     # 0x43f60
movl 0x1690(%rax), %edx
xorl %eax, %eax
cmpl $0x3, %edx
sete %cl
cmpl $0x1, %edx
je 0x15f56
movb %cl, %al
leaq 0x2109b(%rip), %rcx     # 0x36f90
movsd (%rcx,%rax,8), %xmm0
jmp 0x15f5e
leaq 0x224a2(%rip), %rdi     # 0x383a5
callq 0xa1f0
movsd 0x8(%r15), %xmm0
movq %r12, %rdi
movq %rax, %rsi
movl $0x41, %edx
jmp 0x16c02
movsd 0x20fa2(%rip), %xmm0    # 0x36ec8
movsd %xmm1, -0x58(%rbp)
mulsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
callq 0xa990
mulsd -0x48(%rbp), %xmm0
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd %xmm0, 0xba48(%rbx,%rax,8)
jmp 0x15f67
movsd 0x20f6a(%rip), %xmm0    # 0x36ec8
divsd %xmm0, %xmm1
movsd %xmm1, -0x58(%rbp)
cmpb $0x1, 0x280(%r15)
jne 0x15fa4
movsd 0x288(%r15), %xmm0
movq 0x2dfdf(%rip), %rax     # 0x43f60
movl 0x1690(%rax), %edx
xorl %eax, %eax
cmpl $0x3, %edx
sete %cl
cmpl $0x1, %edx
je 0x15ff7
movb %cl, %al
leaq 0x20ff3(%rip), %rcx     # 0x36f90
movsd (%rcx,%rax,8), %xmm1
jmp 0x15fff
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd 0xba50(%rbx,%rax,8), %xmm0
movsd %xmm0, -0x48(%rbp)
callq 0xa990
movsd -0x48(%rbp), %xmm1
divsd %xmm0, %xmm1
movq 0x2df8c(%rip), %rax     # 0x43f60
movl 0x1690(%rax), %edx
xorl %eax, %eax
cmpl $0x3, %edx
sete %cl
cmpl $0x1, %edx
je 0x1602f
movb %cl, %al
leaq 0x20fa0(%rip), %rcx     # 0x36f90
movsd (%rcx,%rax,8), %xmm0
jmp 0x16037
movsd 0x20ec9(%rip), %xmm1    # 0x36ec8
movsd %xmm0, -0x48(%rbp)
mulsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
callq 0xa990
mulsd -0x30(%rbp), %xmm0
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd %xmm0, 0xba50(%rbx,%rax,8)
jmp 0x16040
movsd 0x20e91(%rip), %xmm0    # 0x36ec8
divsd %xmm0, %xmm1
movsd %xmm1, -0x48(%rbp)
cmpb $0x1, 0x290(%r15)
jne 0x160c6
movsd 0x298(%r15), %xmm0
cmpl $0x14, 0x1c8(%r15)
jne 0x1614a
movsd %xmm0, -0x70(%rbp)
movsd -0xd8(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd 0xba58(%rbx,%rax,8), %xmm0
movsd %xmm0, -0x40(%rbp)
callq 0xa990
movsd -0x40(%rbp), %xmm2
divsd %xmm0, %xmm2
movq 0x2debd(%rip), %rax     # 0x43f60
movl 0x1690(%rax), %edx
xorl %eax, %eax
cmpl $0x3, %edx
sete %cl
cmpl $0x1, %edx
je 0x1612c
movb %cl, %al
leaq 0x20ed1(%rip), %rcx     # 0x36f90
movsd (%rcx,%rax,8), %xmm0
jmp 0x16134
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd 0xba58(%rbx,%rax,8), %xmm0
movsd %xmm0, -0x70(%rbp)
callq 0xa990
movsd -0x70(%rbp), %xmm1
divsd %xmm0, %xmm1
movq 0x2de6a(%rip), %rax     # 0x43f60
movl 0x1690(%rax), %edx
xorl %eax, %eax
cmpl $0x3, %edx
sete %cl
cmpl $0x1, %edx
je 0x16119
movb %cl, %al
leaq 0x20e7e(%rip), %rcx     # 0x36f90
movsd (%rcx,%rax,8), %xmm0
jmp 0x16121
movsd 0x20da7(%rip), %xmm0    # 0x36ec8
divsd %xmm0, %xmm1
movsd %xmm1, -0x70(%rbp)
jmp 0x161aa
movsd 0x20d94(%rip), %xmm0    # 0x36ec8
movsd -0x70(%rbp), %xmm1
divsd %xmm0, %xmm2
movsd -0x30(%rbp), %xmm0
addsd %xmm2, %xmm0
subsd %xmm1, %xmm0
movq 0x2de0f(%rip), %rax     # 0x43f60
movl 0x1690(%rax), %edx
xorl %eax, %eax
cmpl $0x3, %edx
sete %cl
cmpl $0x1, %edx
je 0x16174
movb %cl, %al
leaq 0x20e23(%rip), %rcx     # 0x36f90
movsd (%rcx,%rax,8), %xmm1
jmp 0x1617c
movsd 0x20d4c(%rip), %xmm1    # 0x36ec8
movsd %xmm0, -0x70(%rbp)
mulsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
callq 0xa990
mulsd -0x30(%rbp), %xmm0
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd %xmm0, 0xba58(%rbx,%rax,8)
cmpb $0x1, (%r15)
jne 0x16234
movsd 0x8(%r15), %xmm0
cmpl $0x14, 0x1c8(%r15)
movsd %xmm0, -0x30(%rbp)
jne 0x1620e
movsd -0xd0(%rbp), %xmm1
movsd %xmm1, -0x40(%rbp)
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd 0xba60(%rbx,%rax,8), %xmm1
movsd %xmm1, -0x38(%rbp)
callq 0xaf60
movsd -0x38(%rbp), %xmm1
divsd %xmm0, %xmm1
addsd -0x40(%rbp), %xmm1
subsd -0x30(%rbp), %xmm1
movsd %xmm1, -0x30(%rbp)
callq 0xaf60
movsd -0x30(%rbp), %xmm1
mulsd %xmm1, %xmm0
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd %xmm0, 0xba60(%rbx,%rax,8)
jmp 0x1625d
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd 0xba60(%rbx,%rax,8), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0xaf60
movsd -0x30(%rbp), %xmm1
divsd %xmm0, %xmm1
cmpb $0x1, 0x10(%r15)
movsd %xmm1, -0x30(%rbp)
jne 0x162ed
movsd 0x18(%r15), %xmm0
cmpl $0x14, 0x1c8(%r15)
movsd %xmm0, -0x40(%rbp)
jne 0x162c7
movsd -0xc8(%rbp), %xmm1
movsd %xmm1, -0x38(%rbp)
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd 0xba68(%rbx,%rax,8), %xmm1
movsd %xmm1, -0x68(%rbp)
callq 0xaf60
movsd -0x68(%rbp), %xmm1
divsd %xmm0, %xmm1
addsd -0x38(%rbp), %xmm1
subsd -0x40(%rbp), %xmm1
movsd %xmm1, -0x40(%rbp)
callq 0xaf60
movsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm0
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd %xmm0, 0xba68(%rbx,%rax,8)
jmp 0x16316
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd 0xba68(%rbx,%rax,8), %xmm0
movsd %xmm0, -0x40(%rbp)
callq 0xaf60
movsd -0x40(%rbp), %xmm1
divsd %xmm0, %xmm1
cmpb $0x1, 0x20(%r15)
movsd %xmm1, -0x40(%rbp)
jne 0x1639e
movsd 0x28(%r15), %xmm0
cmpl $0x14, 0x1c8(%r15)
movsd %xmm0, -0x38(%rbp)
jne 0x1637c
movsd -0xc0(%rbp), %xmm1
movsd %xmm1, -0x68(%rbp)
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd 0xba70(%rbx,%rax,8), %xmm1
movsd %xmm1, -0x60(%rbp)
callq 0xaf60
movsd -0x60(%rbp), %xmm1
divsd %xmm0, %xmm1
addsd -0x68(%rbp), %xmm1
subsd -0x38(%rbp), %xmm1
movsd %xmm1, -0x38(%rbp)
callq 0xaf60
mulsd -0x38(%rbp), %xmm0
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd %xmm0, 0xba70(%rbx,%rax,8)
jmp 0x163cc
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd 0xba70(%rbx,%rax,8), %xmm0
movsd %xmm0, -0x38(%rbp)
callq 0xaf60
movsd -0x38(%rbp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, -0x38(%rbp)
cmpb $0x1, 0x244(%r15)
jne 0x16452
movsd 0x248(%r15), %xmm0
cmpl $0x14, 0x1c8(%r15)
jne 0x164d6
movsd %xmm0, -0x68(%rbp)
movsd -0xb8(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd 0xba78(%rbx,%rax,8), %xmm0
movsd %xmm0, -0x50(%rbp)
callq 0xa990
movsd -0x50(%rbp), %xmm2
divsd %xmm0, %xmm2
movq 0x2db31(%rip), %rax     # 0x43f60
movl 0x1690(%rax), %edx
xorl %eax, %eax
cmpl $0x3, %edx
sete %cl
cmpl $0x1, %edx
je 0x164b8
movb %cl, %al
leaq 0x20b45(%rip), %rcx     # 0x36f90
movsd (%rcx,%rax,8), %xmm0
jmp 0x164c0
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd 0xba78(%rbx,%rax,8), %xmm0
movsd %xmm0, -0x68(%rbp)
callq 0xa990
movsd -0x68(%rbp), %xmm1
divsd %xmm0, %xmm1
movq 0x2dade(%rip), %rax     # 0x43f60
movl 0x1690(%rax), %edx
xorl %eax, %eax
cmpl $0x3, %edx
sete %cl
cmpl $0x1, %edx
je 0x164a5
movb %cl, %al
leaq 0x20af2(%rip), %rcx     # 0x36f90
movsd (%rcx,%rax,8), %xmm0
jmp 0x164ad
movsd 0x20a1b(%rip), %xmm0    # 0x36ec8
divsd %xmm0, %xmm1
movsd %xmm1, -0x68(%rbp)
jmp 0x16536
movsd 0x20a08(%rip), %xmm0    # 0x36ec8
movsd -0x68(%rbp), %xmm1
divsd %xmm0, %xmm2
movsd -0x60(%rbp), %xmm0
addsd %xmm2, %xmm0
subsd %xmm1, %xmm0
movq 0x2da83(%rip), %rax     # 0x43f60
movl 0x1690(%rax), %edx
xorl %eax, %eax
cmpl $0x3, %edx
sete %cl
cmpl $0x1, %edx
je 0x16500
movb %cl, %al
leaq 0x20a97(%rip), %rcx     # 0x36f90
movsd (%rcx,%rax,8), %xmm1
jmp 0x16508
movsd 0x209c0(%rip), %xmm1    # 0x36ec8
movsd %xmm0, -0x68(%rbp)
mulsd %xmm0, %xmm1
movsd %xmm1, -0x60(%rbp)
callq 0xa990
mulsd -0x60(%rbp), %xmm0
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd %xmm0, 0xba78(%rbx,%rax,8)
cmpb $0x1, 0x250(%r15)
jne 0x165bc
movsd 0x258(%r15), %xmm0
cmpl $0x14, 0x1c8(%r15)
jne 0x16640
movsd %xmm0, -0x60(%rbp)
movsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd 0xba80(%rbx,%rax,8), %xmm0
movsd %xmm0, -0x78(%rbp)
callq 0xa990
movsd -0x78(%rbp), %xmm2
divsd %xmm0, %xmm2
movq 0x2d9c7(%rip), %rax     # 0x43f60
movl 0x1690(%rax), %edx
xorl %eax, %eax
cmpl $0x3, %edx
sete %cl
cmpl $0x1, %edx
je 0x16622
movb %cl, %al
leaq 0x209db(%rip), %rcx     # 0x36f90
movsd (%rcx,%rax,8), %xmm0
jmp 0x1662a
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd 0xba80(%rbx,%rax,8), %xmm0
movsd %xmm0, -0x60(%rbp)
callq 0xa990
movsd -0x60(%rbp), %xmm1
divsd %xmm0, %xmm1
movq 0x2d974(%rip), %rax     # 0x43f60
movl 0x1690(%rax), %edx
xorl %eax, %eax
cmpl $0x3, %edx
sete %cl
cmpl $0x1, %edx
je 0x1660f
movb %cl, %al
leaq 0x20988(%rip), %rcx     # 0x36f90
movsd (%rcx,%rax,8), %xmm0
jmp 0x16617
movsd 0x208b1(%rip), %xmm0    # 0x36ec8
divsd %xmm0, %xmm1
movsd %xmm1, -0x60(%rbp)
jmp 0x166a0
movsd 0x2089e(%rip), %xmm0    # 0x36ec8
movsd -0x60(%rbp), %xmm1
divsd %xmm0, %xmm2
movsd -0x50(%rbp), %xmm0
addsd %xmm2, %xmm0
subsd %xmm1, %xmm0
movq 0x2d919(%rip), %rax     # 0x43f60
movl 0x1690(%rax), %edx
xorl %eax, %eax
cmpl $0x3, %edx
sete %cl
cmpl $0x1, %edx
je 0x1666a
movb %cl, %al
leaq 0x2092d(%rip), %rcx     # 0x36f90
movsd (%rcx,%rax,8), %xmm1
jmp 0x16672
movsd 0x20856(%rip), %xmm1    # 0x36ec8
movsd %xmm0, -0x60(%rbp)
mulsd %xmm0, %xmm1
movsd %xmm1, -0x50(%rbp)
callq 0xa990
mulsd -0x50(%rbp), %xmm0
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd %xmm0, 0xba80(%rbx,%rax,8)
cmpb $0x1, 0x260(%r15)
jne 0x16726
movsd 0x268(%r15), %xmm0
cmpl $0x14, 0x1c8(%r15)
jne 0x167aa
movsd %xmm0, -0x50(%rbp)
movsd -0xa8(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd 0xba88(%rbx,%rax,8), %xmm0
movsd %xmm0, -0x80(%rbp)
callq 0xa990
movsd -0x80(%rbp), %xmm2
divsd %xmm0, %xmm2
movq 0x2d85d(%rip), %rax     # 0x43f60
movl 0x1690(%rax), %edx
xorl %eax, %eax
cmpl $0x3, %edx
sete %cl
cmpl $0x1, %edx
je 0x1678c
movb %cl, %al
leaq 0x20871(%rip), %rcx     # 0x36f90
movsd (%rcx,%rax,8), %xmm0
jmp 0x16794
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd 0xba88(%rbx,%rax,8), %xmm0
movsd %xmm0, -0x50(%rbp)
callq 0xa990
movsd -0x50(%rbp), %xmm1
divsd %xmm0, %xmm1
movq 0x2d80a(%rip), %rax     # 0x43f60
movl 0x1690(%rax), %edx
xorl %eax, %eax
cmpl $0x3, %edx
sete %cl
cmpl $0x1, %edx
je 0x16779
movb %cl, %al
leaq 0x2081e(%rip), %rcx     # 0x36f90
movsd (%rcx,%rax,8), %xmm0
jmp 0x16781
movsd 0x20747(%rip), %xmm0    # 0x36ec8
divsd %xmm0, %xmm1
movsd %xmm1, -0x50(%rbp)
jmp 0x1680a
movsd 0x20734(%rip), %xmm0    # 0x36ec8
movsd -0x50(%rbp), %xmm1
divsd %xmm0, %xmm2
movsd -0x78(%rbp), %xmm0
addsd %xmm2, %xmm0
subsd %xmm1, %xmm0
movq 0x2d7af(%rip), %rax     # 0x43f60
movl 0x1690(%rax), %edx
xorl %eax, %eax
cmpl $0x3, %edx
sete %cl
cmpl $0x1, %edx
je 0x167d4
movb %cl, %al
leaq 0x207c3(%rip), %rcx     # 0x36f90
movsd (%rcx,%rax,8), %xmm1
jmp 0x167dc
movsd 0x206ec(%rip), %xmm1    # 0x36ec8
movsd %xmm0, -0x50(%rbp)
mulsd %xmm0, %xmm1
movsd %xmm1, -0x78(%rbp)
callq 0xa990
mulsd -0x78(%rbp), %xmm0
leal (,%r14,4), %eax
leal (%rax,%rax,4), %eax
cltq
movsd %xmm0, 0xba88(%rbx,%rax,8)
cmpl %r14d, 0x179c(%rbx)
jne 0x16bb3
movsd 0x17b8(%rbx), %xmm0
mulsd 0x206a9(%rip), %xmm0    # 0x36ed0
divsd 0x206a9(%rip), %xmm0    # 0x36ed8
movsd %xmm0, -0x80(%rbp)
movsd 0x600(%rbx), %xmm1
movsd %xmm1, -0x78(%rbp)
callq 0xb550
movsd %xmm0, -0x90(%rbp)
movsd 0x608(%rbx), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x80(%rbp), %xmm0
callq 0xa1d0
mulsd -0x88(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
mulsd -0x78(%rbp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, -0x90(%rbp)
movsd 0x600(%rbx), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x80(%rbp), %xmm0
callq 0xa1d0
movsd %xmm0, -0x78(%rbp)
movsd 0x608(%rbx), %xmm0
movsd %xmm0, -0x98(%rbp)
movsd -0x80(%rbp), %xmm0
callq 0xb550
mulsd -0x98(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
mulsd -0x88(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd -0x90(%rbp), %xmm15
addsd 0x17a0(%rbx), %xmm15
movsd %xmm15, 0x600(%rbx)
addsd 0x17a8(%rbx), %xmm1
movsd %xmm1, -0x78(%rbp)
movsd %xmm1, 0x608(%rbx)
movsd 0x17b0(%rbx), %xmm8
addsd 0x610(%rbx), %xmm8
movsd %xmm8, 0x610(%rbx)
movsd 0x10(%rbx), %xmm9
movsd 0x28(%rbx), %xmm14
addsd 0x8(%rbx), %xmm9
movsd %xmm9, 0x8(%rbx)
addsd 0x20(%rbx), %xmm14
movsd %xmm14, 0x20(%rbx)
movsd 0x40(%rbx), %xmm10
addsd 0x38(%rbx), %xmm10
movsd %xmm10, 0x38(%rbx)
movsd 0x58(%rbx), %xmm11
addsd 0x50(%rbx), %xmm11
movsd %xmm11, 0x50(%rbx)
movsd 0x70(%rbx), %xmm12
addsd 0x68(%rbx), %xmm12
movsd %xmm12, 0x68(%rbx)
movsd 0x88(%rbx), %xmm13
addsd 0x80(%rbx), %xmm13
movsd %xmm13, 0x80(%rbx)
movsd -0x58(%rbp), %xmm0
movsd %xmm0, 0x17a0(%rbx)
movsd %xmm0, -0x58(%rbp)
movsd -0x48(%rbp), %xmm1
movsd %xmm1, 0x17a8(%rbx)
movsd -0x70(%rbp), %xmm2
movsd %xmm2, 0x17b0(%rbx)
movsd -0x30(%rbp), %xmm3
movsd %xmm3, 0x10(%rbx)
movsd -0x40(%rbp), %xmm4
movsd %xmm4, 0x28(%rbx)
movsd -0x38(%rbp), %xmm5
movsd %xmm5, 0x40(%rbx)
movsd -0x68(%rbp), %xmm6
movsd %xmm6, 0x58(%rbx)
movsd -0x60(%rbp), %xmm7
movsd %xmm7, 0x70(%rbx)
movsd -0x50(%rbp), %xmm1
movsd %xmm1, 0x88(%rbx)
subsd %xmm0, %xmm15
movsd %xmm15, 0x600(%rbx)
movsd -0x78(%rbp), %xmm15
movsd -0x48(%rbp), %xmm0
subsd %xmm0, %xmm15
movsd %xmm15, 0x608(%rbx)
subsd %xmm2, %xmm8
movsd %xmm8, 0x610(%rbx)
subsd %xmm3, %xmm9
movsd %xmm9, 0x8(%rbx)
subsd %xmm4, %xmm14
movsd %xmm14, 0x20(%rbx)
subsd %xmm5, %xmm10
movsd %xmm10, 0x38(%rbx)
subsd %xmm6, %xmm11
movsd %xmm11, 0x50(%rbx)
subsd %xmm7, %xmm12
movsd %xmm12, 0x68(%rbx)
subsd %xmm1, %xmm13
movsd %xmm13, 0x80(%rbx)
movsd -0x58(%rbp), %xmm8
addsd 0x118(%rbx), %xmm8
movapd %xmm0, %xmm9
addsd 0x120(%rbx), %xmm9
addsd 0x128(%rbx), %xmm2
addsd (%rbx), %xmm3
addsd 0x18(%rbx), %xmm4
addsd 0x30(%rbx), %xmm5
addsd 0x48(%rbx), %xmm6
addsd 0x60(%rbx), %xmm7
addsd 0x78(%rbx), %xmm1
subq $0x10, %rsp
movsd %xmm1, (%rsp)
movapd %xmm8, %xmm0
movapd %xmm9, %xmm1
callq 0xa510
addq $0x10, %rsp
movsd 0x20402(%rip), %xmm0    # 0x36ee8
mulsd -0xa0(%rbp), %xmm0
divsd 0x203e2(%rip), %xmm0    # 0x36ed8
movsd %xmm0, -0x48(%rbp)
movsd 0x600(%rbx), %xmm1
movsd %xmm1, -0x30(%rbp)
callq 0xb550
movsd %xmm0, -0x58(%rbp)
movsd 0x608(%rbx), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x48(%rbp), %xmm0
callq 0xa1d0
mulsd -0x40(%rbp), %xmm0
movsd -0x58(%rbp), %xmm1
mulsd -0x30(%rbp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, -0x58(%rbp)
movsd 0x600(%rbx), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x48(%rbp), %xmm0
callq 0xa1d0
movsd %xmm0, -0x40(%rbp)
movsd 0x608(%rbx), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x48(%rbp), %xmm0
callq 0xb550
mulsd -0x38(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
mulsd -0x30(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd -0x58(%rbp), %xmm0
movsd %xmm0, 0x600(%rbx)
movsd %xmm1, 0x608(%rbx)
movsd -0xa0(%rbp), %xmm0
movsd %xmm0, 0x17b8(%rbx)
callq 0xae60
jmp 0x16bbf
leaq 0x225f9(%rip), %rdi     # 0x391b3
callq 0xb370
xorl %eax, %eax
jmp 0x15920
leaq 0x217d8(%rip), %rdi     # 0x383a5
callq 0xa1f0
movsd 0x18(%r15), %xmm0
movq %r12, %rdi
movq %rax, %rsi
movl $0x42, %edx
jmp 0x16c02
leaq 0x217b9(%rip), %rdi     # 0x383a5
callq 0xa1f0
movsd 0x28(%r15), %xmm0
movq %r12, %rdi
movq %rax, %rsi
movl $0x43, %edx
movb $0x1, %al
callq 0xa850
jmp 0x158df