// File: sundale[P]gcode/rs274ngc/interp_convert.cc
// Function: Interp::convert_home(int, block_struct*, setup_struct*)
int Interp::convert_home(int move,       //!< G code, must be G_28 or G_30            
                        block_pointer block,    //!< pointer to a block of RS274 instructions
                        setup_pointer settings) //!< pointer to machine settings             
{
  double end_x;
  double end_y;
  double end_z;
  double AA_end;
  double BB_end;
  double CC_end;
  double u_end;
  double v_end;
  double w_end;
  double end_x_home;
  double end_y_home;
  double end_z_home;
  double AA_end_home;
  double BB_end_home;
  double CC_end_home;
  double u_end_home;
  double v_end_home;
  double w_end_home;
  double *parameters;

  parameters = settings->parameters;
  CHP(find_ends(block, settings, &end_x, &end_y, &end_z,
                &AA_end, &BB_end, &CC_end, 
                &u_end, &v_end, &w_end));

  CHKS((settings->cutter_comp_side != OFF),
      NCE_CANNOT_USE_G28_OR_G30_WITH_CUTTER_RADIUS_COMP);

  // waypoint is in currently active coordinate system

  STRAIGHT_TRAVERSE(block->line_number, end_x, end_y, end_z,
                    AA_end, BB_end, CC_end,
                    u_end, v_end, w_end);

  if (move == G_28) {
      find_relative(USER_TO_PROGRAM_LEN(parameters[5161]),
                    USER_TO_PROGRAM_LEN(parameters[5162]),
                    USER_TO_PROGRAM_LEN(parameters[5163]),
                    USER_TO_PROGRAM_ANG(parameters[5164]),
                    USER_TO_PROGRAM_ANG(parameters[5165]),
                    USER_TO_PROGRAM_ANG(parameters[5166]),
                    USER_TO_PROGRAM_LEN(parameters[5167]),
                    USER_TO_PROGRAM_LEN(parameters[5168]),
                    USER_TO_PROGRAM_LEN(parameters[5169]),
                    &end_x_home, &end_y_home, &end_z_home,
                    &AA_end_home, &BB_end_home, &CC_end_home, 
                    &u_end_home, &v_end_home, &w_end_home, settings);
  } else if (move == G_30) {
      find_relative(USER_TO_PROGRAM_LEN(parameters[5181]),
                    USER_TO_PROGRAM_LEN(parameters[5182]),
                    USER_TO_PROGRAM_LEN(parameters[5183]),
                    USER_TO_PROGRAM_ANG(parameters[5184]),
                    USER_TO_PROGRAM_ANG(parameters[5185]),
                    USER_TO_PROGRAM_ANG(parameters[5186]),
                    USER_TO_PROGRAM_LEN(parameters[5187]),
                    USER_TO_PROGRAM_LEN(parameters[5188]),
                    USER_TO_PROGRAM_LEN(parameters[5189]),
                    &end_x_home, &end_y_home, &end_z_home,
                    &AA_end_home, &BB_end_home, &CC_end_home, 
                    &u_end_home, &v_end_home, &w_end_home, settings);
  } else
    ERS(NCE_BUG_CODE_NOT_G28_OR_G30);
  
  // if any axes are specified, home only those axes after the waypoint 
  // (both fanuc & haas, contrary to emc historical operation)

  if (block->x_flag == ON) end_x = end_x_home;  
  if (block->y_flag == ON) end_y = end_y_home;  
  if (block->z_flag == ON) end_z = end_z_home;  
  if (block->a_flag == ON) AA_end = AA_end_home;
  if (block->b_flag == ON) BB_end = BB_end_home;
  if (block->c_flag == ON) CC_end = CC_end_home;
  if (block->u_flag == ON) u_end = u_end_home;  
  if (block->v_flag == ON) v_end = v_end_home;  
  if (block->w_flag == ON) w_end = w_end_home;  

  // but, if no axes are specified, home all of them 
  // (haas does this, emc historical did, throws an error in fanuc)

  if (block->x_flag == OFF && block->y_flag == OFF && block->z_flag == OFF &&
      block->a_flag == OFF && block->b_flag == OFF && block->c_flag == OFF &&
      block->u_flag == OFF && block->v_flag == OFF && block->w_flag == OFF) {
      end_x = end_x_home;  
      end_y = end_y_home;  
      end_z = end_z_home;  
      AA_end = AA_end_home;
      BB_end = BB_end_home;
      CC_end = CC_end_home;
      u_end = u_end_home;  
      v_end = v_end_home;  
      w_end = w_end_home;  
  }

  STRAIGHT_TRAVERSE(block->line_number, end_x, end_y, end_z,
                    AA_end, BB_end, CC_end,
                    u_end, v_end, w_end);
  settings->current_x = end_x;
  settings->current_y = end_y;
  settings->current_z = end_z;
  settings->AA_current = AA_end;
  settings->BB_current = BB_end;
  settings->CC_current = CC_end;
  settings->u_current = u_end;
  settings->v_current = v_end;
  settings->w_current = w_end;
  
  return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x398, %rsp            # imm = 0x398
movq %rdi, -0x28(%rbp)
movl %esi, -0x2c(%rbp)
movq %rdx, -0x38(%rbp)
movq %rcx, -0x40(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x40(%rbp), %rax
addq $0x17c0, %rax           # imm = 0x17C0
movq %rax, -0xd8(%rbp)
movq -0xe8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq -0x48(%rbp), %rcx
leaq -0x50(%rbp), %r8
leaq -0x58(%rbp), %r9
leaq -0x60(%rbp), %r15
leaq -0x68(%rbp), %r14
leaq -0x70(%rbp), %rbx
leaq -0x78(%rbp), %r11
leaq -0x80(%rbp), %r10
leaq -0x88(%rbp), %rax
movq %r15, (%rsp)
movq %r14, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq %r11, 0x18(%rsp)
movq %r10, 0x20(%rsp)
movq %rax, 0x28(%rsp)
callq 0x11150
movl %eax, -0xdc(%rbp)
cmpl $0x0, -0xdc(%rbp)
je 0x25b86
jmp 0x25ac8
movq 0x61491(%rip), %rax     # 0x86f60
cmpl $0x31, 0xd670(%rax)
jge 0x25b78
movq 0x6147d(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x6146f(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x54934(%rip), %rsi     # 0x7a43a
movl $0x50, %edx
callq 0x10840
movq 0x61449(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x6143b(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x61423(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x61413(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x61406(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x613f8(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl -0xdc(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x26c9f
jmp 0x25b88
jmp 0x25b8a
movq -0x40(%rbp), %rax
cmpl $0x0, 0x624(%rax)
je 0x25c73
jmp 0x25b9d
leaq 0x548d2(%rip), %rdi     # 0x7a476
callq 0x10380
movq -0xe8(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x6139f(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x6138e(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x61380(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x54845(%rip), %rsi     # 0x7a43a
movl $0x50, %edx
callq 0x10840
movq 0x6135a(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x6134c(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x61334(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x61324(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x61317(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x61309(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x1c(%rbp)
jmp 0x26c9f
jmp 0x25c75
movq -0x38(%rbp), %rax
movl 0x1d0(%rax), %edi
movsd -0x48(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
movsd -0x58(%rbp), %xmm2
movsd -0x60(%rbp), %xmm3
movsd -0x68(%rbp), %xmm4
movsd -0x70(%rbp), %xmm5
movsd -0x78(%rbp), %xmm6
movsd -0x80(%rbp), %xmm7
movsd -0x88(%rbp), %xmm8
movsd %xmm8, (%rsp)
callq 0x10ef0
cmpl $0x118, -0x2c(%rbp)     # imm = 0x118
jne 0x262a1
movq -0xd8(%rbp), %rax
movsd 0xa148(%rax), %xmm0
movsd %xmm0, -0xf8(%rbp)
callq 0x11030
movaps %xmm0, %xmm1
movsd -0xf8(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0xf0(%rbp)
movq 0x6125e(%rip), %rax     # 0x86f60
cmpl $0x1, 0x1690(%rax)
jne 0x25d1d
movsd 0x53135(%rip), %xmm0    # 0x78e48
movsd %xmm0, -0x100(%rbp)
jmp 0x25d6f
movq 0x6123c(%rip), %rax     # 0x86f60
movl 0x1690(%rax), %eax
movsd 0x5310e(%rip), %xmm0    # 0x78e40
movsd 0x530d6(%rip), %xmm1    # 0x78e10
movsd %xmm1, -0x110(%rbp)
cmpl $0x3, %eax
movsd %xmm0, -0x108(%rbp)
je 0x25d5f
movsd -0x110(%rbp), %xmm0
movsd %xmm0, -0x108(%rbp)
movsd -0x108(%rbp), %xmm0
movsd %xmm0, -0x100(%rbp)
movsd -0xf0(%rbp), %xmm0
movsd -0x100(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x128(%rbp)
movq -0xd8(%rbp), %rax
movsd 0xa150(%rax), %xmm0
movsd %xmm0, -0x120(%rbp)
callq 0x11030
movaps %xmm0, %xmm1
movsd -0x120(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x118(%rbp)
movq 0x6119b(%rip), %rax     # 0x86f60
cmpl $0x1, 0x1690(%rax)
jne 0x25de0
movsd 0x53072(%rip), %xmm0    # 0x78e48
movsd %xmm0, -0x130(%rbp)
jmp 0x25e32
movq 0x61179(%rip), %rax     # 0x86f60
movl 0x1690(%rax), %eax
movsd 0x5304b(%rip), %xmm0    # 0x78e40
movsd 0x53013(%rip), %xmm1    # 0x78e10
movsd %xmm1, -0x140(%rbp)
cmpl $0x3, %eax
movsd %xmm0, -0x138(%rbp)
je 0x25e22
movsd -0x140(%rbp), %xmm0
movsd %xmm0, -0x138(%rbp)
movsd -0x138(%rbp), %xmm0
movsd %xmm0, -0x130(%rbp)
movsd -0x118(%rbp), %xmm0
movsd -0x130(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x158(%rbp)
movq -0xd8(%rbp), %rax
movsd 0xa158(%rax), %xmm0
movsd %xmm0, -0x150(%rbp)
callq 0x11030
movaps %xmm0, %xmm1
movsd -0x150(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x148(%rbp)
movq 0x610d8(%rip), %rax     # 0x86f60
cmpl $0x1, 0x1690(%rax)
jne 0x25ea3
movsd 0x52faf(%rip), %xmm0    # 0x78e48
movsd %xmm0, -0x160(%rbp)
jmp 0x25ef5
movq 0x610b6(%rip), %rax     # 0x86f60
movl 0x1690(%rax), %eax
movsd 0x52f88(%rip), %xmm0    # 0x78e40
movsd 0x52f50(%rip), %xmm1    # 0x78e10
movsd %xmm1, -0x170(%rbp)
cmpl $0x3, %eax
movsd %xmm0, -0x168(%rbp)
je 0x25ee5
movsd -0x170(%rbp), %xmm0
movsd %xmm0, -0x168(%rbp)
movsd -0x168(%rbp), %xmm0
movsd %xmm0, -0x160(%rbp)
movsd -0x148(%rbp), %xmm0
movsd -0x160(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x1b8(%rbp)
movq -0xd8(%rbp), %rax
movsd 0xa160(%rax), %xmm0
movsd %xmm0, -0x1b0(%rbp)
callq 0x11920
movaps %xmm0, %xmm1
movsd -0x1b0(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x1a8(%rbp)
movq -0xd8(%rbp), %rax
movsd 0xa168(%rax), %xmm0
movsd %xmm0, -0x1a0(%rbp)
callq 0x11920
movaps %xmm0, %xmm1
movsd -0x1a0(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x198(%rbp)
movq -0xd8(%rbp), %rax
movsd 0xa170(%rax), %xmm0
movsd %xmm0, -0x190(%rbp)
callq 0x11920
movaps %xmm0, %xmm1
movsd -0x190(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x188(%rbp)
movq -0xd8(%rbp), %rax
movsd 0xa178(%rax), %xmm0
movsd %xmm0, -0x180(%rbp)
callq 0x11030
movaps %xmm0, %xmm1
movsd -0x180(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x178(%rbp)
movq 0x60f7c(%rip), %rax     # 0x86f60
cmpl $0x1, 0x1690(%rax)
jne 0x25fff
movsd 0x52e53(%rip), %xmm0    # 0x78e48
movsd %xmm0, -0x1c0(%rbp)
jmp 0x26051
movq 0x60f5a(%rip), %rax     # 0x86f60
movl 0x1690(%rax), %eax
movsd 0x52e2c(%rip), %xmm0    # 0x78e40
movsd 0x52df4(%rip), %xmm1    # 0x78e10
movsd %xmm1, -0x1d0(%rbp)
cmpl $0x3, %eax
movsd %xmm0, -0x1c8(%rbp)
je 0x26041
movsd -0x1d0(%rbp), %xmm0
movsd %xmm0, -0x1c8(%rbp)
movsd -0x1c8(%rbp), %xmm0
movsd %xmm0, -0x1c0(%rbp)
movsd -0x178(%rbp), %xmm0
movsd -0x1c0(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x1e8(%rbp)
movq -0xd8(%rbp), %rax
movsd 0xa180(%rax), %xmm0
movsd %xmm0, -0x1e0(%rbp)
callq 0x11030
movaps %xmm0, %xmm1
movsd -0x1e0(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x1d8(%rbp)
movq 0x60eb9(%rip), %rax     # 0x86f60
cmpl $0x1, 0x1690(%rax)
jne 0x260c2
movsd 0x52d90(%rip), %xmm0    # 0x78e48
movsd %xmm0, -0x1f0(%rbp)
jmp 0x26114
movq 0x60e97(%rip), %rax     # 0x86f60
movl 0x1690(%rax), %eax
movsd 0x52d69(%rip), %xmm0    # 0x78e40
movsd 0x52d31(%rip), %xmm1    # 0x78e10
movsd %xmm1, -0x200(%rbp)
cmpl $0x3, %eax
movsd %xmm0, -0x1f8(%rbp)
je 0x26104
movsd -0x200(%rbp), %xmm0
movsd %xmm0, -0x1f8(%rbp)
movsd -0x1f8(%rbp), %xmm0
movsd %xmm0, -0x1f0(%rbp)
movsd -0x1d8(%rbp), %xmm0
movsd -0x1f0(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x218(%rbp)
movq -0xd8(%rbp), %rax
movsd 0xa188(%rax), %xmm0
movsd %xmm0, -0x210(%rbp)
callq 0x11030
movaps %xmm0, %xmm1
movsd -0x210(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x208(%rbp)
movq 0x60df6(%rip), %rax     # 0x86f60
cmpl $0x1, 0x1690(%rax)
jne 0x26185
movsd 0x52ccd(%rip), %xmm0    # 0x78e48
movsd %xmm0, -0x220(%rbp)
jmp 0x261d7
movq 0x60dd4(%rip), %rax     # 0x86f60
movl 0x1690(%rax), %eax
movsd 0x52ca6(%rip), %xmm0    # 0x78e40
movsd 0x52c6e(%rip), %xmm1    # 0x78e10
movsd %xmm1, -0x230(%rbp)
cmpl $0x3, %eax
movsd %xmm0, -0x228(%rbp)
je 0x261c7
movsd -0x230(%rbp), %xmm0
movsd %xmm0, -0x228(%rbp)
movsd -0x228(%rbp), %xmm0
movsd %xmm0, -0x220(%rbp)
movsd -0x218(%rbp), %xmm7
movsd -0x1e8(%rbp), %xmm6
movsd -0x188(%rbp), %xmm5
movsd -0x198(%rbp), %xmm4
movsd -0x1a8(%rbp), %xmm3
movsd -0x1b8(%rbp), %xmm2
movsd -0x158(%rbp), %xmm1
movsd -0x128(%rbp), %xmm0
movq -0xe8(%rbp), %rdi
movsd -0x208(%rbp), %xmm8
movsd -0x220(%rbp), %xmm9
divsd %xmm9, %xmm8
movq -0x40(%rbp), %rax
leaq -0x90(%rbp), %rsi
leaq -0x98(%rbp), %rdx
leaq -0xa0(%rbp), %rcx
leaq -0xa8(%rbp), %r8
leaq -0xb0(%rbp), %r9
leaq -0xb8(%rbp), %r14
leaq -0xc0(%rbp), %rbx
leaq -0xc8(%rbp), %r11
leaq -0xd0(%rbp), %r10
movsd %xmm8, (%rsp)
movq %r14, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq %r11, 0x18(%rsp)
movq %r10, 0x20(%rsp)
movq %rax, 0x28(%rsp)
callq 0x10630
jmp 0x26961
cmpl $0x12c, -0x2c(%rbp)     # imm = 0x12C
jne 0x26887
movq -0xd8(%rbp), %rax
movsd 0xa1e8(%rax), %xmm0
movsd %xmm0, -0x240(%rbp)
callq 0x11030
movaps %xmm0, %xmm1
movsd -0x240(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x238(%rbp)
movq 0x60c78(%rip), %rax     # 0x86f60
cmpl $0x1, 0x1690(%rax)
jne 0x26303
movsd 0x52b4f(%rip), %xmm0    # 0x78e48
movsd %xmm0, -0x248(%rbp)
jmp 0x26355
movq 0x60c56(%rip), %rax     # 0x86f60
movl 0x1690(%rax), %eax
movsd 0x52b28(%rip), %xmm0    # 0x78e40
movsd 0x52af0(%rip), %xmm1    # 0x78e10
movsd %xmm1, -0x258(%rbp)
cmpl $0x3, %eax
movsd %xmm0, -0x250(%rbp)
je 0x26345
movsd -0x258(%rbp), %xmm0
movsd %xmm0, -0x250(%rbp)
movsd -0x250(%rbp), %xmm0
movsd %xmm0, -0x248(%rbp)
movsd -0x238(%rbp), %xmm0
movsd -0x248(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x270(%rbp)
movq -0xd8(%rbp), %rax
movsd 0xa1f0(%rax), %xmm0
movsd %xmm0, -0x268(%rbp)
callq 0x11030
movaps %xmm0, %xmm1
movsd -0x268(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x260(%rbp)
movq 0x60bb5(%rip), %rax     # 0x86f60
cmpl $0x1, 0x1690(%rax)
jne 0x263c6
movsd 0x52a8c(%rip), %xmm0    # 0x78e48
movsd %xmm0, -0x278(%rbp)
jmp 0x26418
movq 0x60b93(%rip), %rax     # 0x86f60
movl 0x1690(%rax), %eax
movsd 0x52a65(%rip), %xmm0    # 0x78e40
movsd 0x52a2d(%rip), %xmm1    # 0x78e10
movsd %xmm1, -0x288(%rbp)
cmpl $0x3, %eax
movsd %xmm0, -0x280(%rbp)
je 0x26408
movsd -0x288(%rbp), %xmm0
movsd %xmm0, -0x280(%rbp)
movsd -0x280(%rbp), %xmm0
movsd %xmm0, -0x278(%rbp)
movsd -0x260(%rbp), %xmm0
movsd -0x278(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x2a0(%rbp)
movq -0xd8(%rbp), %rax
movsd 0xa1f8(%rax), %xmm0
movsd %xmm0, -0x298(%rbp)
callq 0x11030
movaps %xmm0, %xmm1
movsd -0x298(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x290(%rbp)
movq 0x60af2(%rip), %rax     # 0x86f60
cmpl $0x1, 0x1690(%rax)
jne 0x26489
movsd 0x529c9(%rip), %xmm0    # 0x78e48
movsd %xmm0, -0x2a8(%rbp)
jmp 0x264db
movq 0x60ad0(%rip), %rax     # 0x86f60
movl 0x1690(%rax), %eax
movsd 0x529a2(%rip), %xmm0    # 0x78e40
movsd 0x5296a(%rip), %xmm1    # 0x78e10
movsd %xmm1, -0x2b8(%rbp)
cmpl $0x3, %eax
movsd %xmm0, -0x2b0(%rbp)
je 0x264cb
movsd -0x2b8(%rbp), %xmm0
movsd %xmm0, -0x2b0(%rbp)
movsd -0x2b0(%rbp), %xmm0
movsd %xmm0, -0x2a8(%rbp)
movsd -0x290(%rbp), %xmm0
movsd -0x2a8(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x300(%rbp)
movq -0xd8(%rbp), %rax
movsd 0xa200(%rax), %xmm0
movsd %xmm0, -0x2f8(%rbp)
callq 0x11920
movaps %xmm0, %xmm1
movsd -0x2f8(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x2f0(%rbp)
movq -0xd8(%rbp), %rax
movsd 0xa208(%rax), %xmm0
movsd %xmm0, -0x2e8(%rbp)
callq 0x11920
movaps %xmm0, %xmm1
movsd -0x2e8(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x2e0(%rbp)
movq -0xd8(%rbp), %rax
movsd 0xa210(%rax), %xmm0
movsd %xmm0, -0x2d8(%rbp)
callq 0x11920
movaps %xmm0, %xmm1
movsd -0x2d8(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x2d0(%rbp)
movq -0xd8(%rbp), %rax
movsd 0xa218(%rax), %xmm0
movsd %xmm0, -0x2c8(%rbp)
callq 0x11030
movaps %xmm0, %xmm1
movsd -0x2c8(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x2c0(%rbp)
movq 0x60996(%rip), %rax     # 0x86f60
cmpl $0x1, 0x1690(%rax)
jne 0x265e5
movsd 0x5286d(%rip), %xmm0    # 0x78e48
movsd %xmm0, -0x308(%rbp)
jmp 0x26637
movq 0x60974(%rip), %rax     # 0x86f60
movl 0x1690(%rax), %eax
movsd 0x52846(%rip), %xmm0    # 0x78e40
movsd 0x5280e(%rip), %xmm1    # 0x78e10
movsd %xmm1, -0x318(%rbp)
cmpl $0x3, %eax
movsd %xmm0, -0x310(%rbp)
je 0x26627
movsd -0x318(%rbp), %xmm0
movsd %xmm0, -0x310(%rbp)
movsd -0x310(%rbp), %xmm0
movsd %xmm0, -0x308(%rbp)
movsd -0x2c0(%rbp), %xmm0
movsd -0x308(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x330(%rbp)
movq -0xd8(%rbp), %rax
movsd 0xa220(%rax), %xmm0
movsd %xmm0, -0x328(%rbp)
callq 0x11030
movaps %xmm0, %xmm1
movsd -0x328(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x320(%rbp)
movq 0x608d3(%rip), %rax     # 0x86f60
cmpl $0x1, 0x1690(%rax)
jne 0x266a8
movsd 0x527aa(%rip), %xmm0    # 0x78e48
movsd %xmm0, -0x338(%rbp)
jmp 0x266fa
movq 0x608b1(%rip), %rax     # 0x86f60
movl 0x1690(%rax), %eax
movsd 0x52783(%rip), %xmm0    # 0x78e40
movsd 0x5274b(%rip), %xmm1    # 0x78e10
movsd %xmm1, -0x348(%rbp)
cmpl $0x3, %eax
movsd %xmm0, -0x340(%rbp)
je 0x266ea
movsd -0x348(%rbp), %xmm0
movsd %xmm0, -0x340(%rbp)
movsd -0x340(%rbp), %xmm0
movsd %xmm0, -0x338(%rbp)
movsd -0x320(%rbp), %xmm0
movsd -0x338(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x360(%rbp)
movq -0xd8(%rbp), %rax
movsd 0xa228(%rax), %xmm0
movsd %xmm0, -0x358(%rbp)
callq 0x11030
movaps %xmm0, %xmm1
movsd -0x358(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x350(%rbp)
movq 0x60810(%rip), %rax     # 0x86f60
cmpl $0x1, 0x1690(%rax)
jne 0x2676b
movsd 0x526e7(%rip), %xmm0    # 0x78e48
movsd %xmm0, -0x368(%rbp)
jmp 0x267bd
movq 0x607ee(%rip), %rax     # 0x86f60
movl 0x1690(%rax), %eax
movsd 0x526c0(%rip), %xmm0    # 0x78e40
movsd 0x52688(%rip), %xmm1    # 0x78e10
movsd %xmm1, -0x378(%rbp)
cmpl $0x3, %eax
movsd %xmm0, -0x370(%rbp)
je 0x267ad
movsd -0x378(%rbp), %xmm0
movsd %xmm0, -0x370(%rbp)
movsd -0x370(%rbp), %xmm0
movsd %xmm0, -0x368(%rbp)
movsd -0x360(%rbp), %xmm7
movsd -0x330(%rbp), %xmm6
movsd -0x2d0(%rbp), %xmm5
movsd -0x2e0(%rbp), %xmm4
movsd -0x2f0(%rbp), %xmm3
movsd -0x300(%rbp), %xmm2
movsd -0x2a0(%rbp), %xmm1
movsd -0x270(%rbp), %xmm0
movq -0xe8(%rbp), %rdi
movsd -0x350(%rbp), %xmm8
movsd -0x368(%rbp), %xmm9
divsd %xmm9, %xmm8
movq -0x40(%rbp), %rax
leaq -0x90(%rbp), %rsi
leaq -0x98(%rbp), %rdx
leaq -0xa0(%rbp), %rcx
leaq -0xa8(%rbp), %r8
leaq -0xb0(%rbp), %r9
leaq -0xb8(%rbp), %r14
leaq -0xc0(%rbp), %rbx
leaq -0xc8(%rbp), %r11
leaq -0xd0(%rbp), %r10
movsd %xmm8, (%rsp)
movq %r14, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq %r11, 0x18(%rsp)
movq %r10, 0x20(%rsp)
movq %rax, 0x28(%rsp)
callq 0x10630
jmp 0x2695f
jmp 0x26889
leaq 0x53c14(%rip), %rdi     # 0x7a4a4
callq 0x10380
movq -0xe8(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x606b3(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x606a2(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x60694(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x53b59(%rip), %rsi     # 0x7a43a
movl $0x50, %edx
callq 0x10840
movq 0x6066e(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x60660(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x60648(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x60638(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x6062b(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x6061d(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x1c(%rbp)
jmp 0x26c9f
jmp 0x26961
movq -0x38(%rbp), %rax
movb 0x270(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x26982
movsd -0x90(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x38(%rbp), %rax
movb 0x280(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x269a3
movsd -0x98(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x38(%rbp), %rax
movb 0x290(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x269c4
movsd -0xa0(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x38(%rbp), %rax
movb (%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x269e1
movsd -0xa8(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movq -0x38(%rbp), %rax
movb 0x10(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x269ff
movsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movq -0x38(%rbp), %rax
movb 0x20(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x26a1d
movsd -0xb8(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x38(%rbp), %rax
movb 0x244(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x26a3e
movsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
movq -0x38(%rbp), %rax
movb 0x250(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x26a5f
movsd -0xc8(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
movq -0x38(%rbp), %rax
movb 0x260(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x26a83
movsd -0xd0(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movq -0x38(%rbp), %rax
movb 0x270(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x26bc5
movq -0x38(%rbp), %rax
movb 0x280(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x26bc5
movq -0x38(%rbp), %rax
movb 0x290(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x26bc5
movq -0x38(%rbp), %rax
movb (%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x26bc5
movq -0x38(%rbp), %rax
movb 0x10(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x26bc5
movq -0x38(%rbp), %rax
movb 0x20(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x26bc5
movq -0x38(%rbp), %rax
movb 0x244(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x26bc5
movq -0x38(%rbp), %rax
movb 0x250(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x26bc5
movq -0x38(%rbp), %rax
movb 0x260(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x26bc5
movsd -0x90(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x98(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0xa0(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0xa8(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0xb8(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0xc8(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0xd0(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movq -0x38(%rbp), %rax
movl 0x1d0(%rax), %edi
movsd -0x48(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
movsd -0x58(%rbp), %xmm2
movsd -0x60(%rbp), %xmm3
movsd -0x68(%rbp), %xmm4
movsd -0x70(%rbp), %xmm5
movsd -0x78(%rbp), %xmm6
movsd -0x80(%rbp), %xmm7
movsd -0x88(%rbp), %xmm8
movsd %xmm8, (%rsp)
callq 0x10ef0
movsd -0x48(%rbp), %xmm0
movq -0x40(%rbp), %rax
movsd %xmm0, 0x600(%rax)
movsd -0x50(%rbp), %xmm0
movq -0x40(%rbp), %rax
movsd %xmm0, 0x608(%rax)
movsd -0x58(%rbp), %xmm0
movq -0x40(%rbp), %rax
movsd %xmm0, 0x610(%rax)
movsd -0x60(%rbp), %xmm0
movq -0x40(%rbp), %rax
movsd %xmm0, 0x8(%rax)
movsd -0x68(%rbp), %xmm0
movq -0x40(%rbp), %rax
movsd %xmm0, 0x20(%rax)
movsd -0x70(%rbp), %xmm0
movq -0x40(%rbp), %rax
movsd %xmm0, 0x38(%rax)
movsd -0x78(%rbp), %xmm0
movq -0x40(%rbp), %rax
movsd %xmm0, 0x50(%rax)
movsd -0x80(%rbp), %xmm0
movq -0x40(%rbp), %rax
movsd %xmm0, 0x68(%rax)
movsd -0x88(%rbp), %xmm0
movq -0x40(%rbp), %rax
movsd %xmm0, 0x80(%rax)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
addq $0x398, %rsp            # imm = 0x398
popq %rbx
popq %r14
popq %r15
popq %rbp
retq