// File: /workspace/github_cpp_makefile_star2_O1/sundale[P]gcode/rs274ngc/rs274ngc_pre.cc
// Function: Interp::init()
int Interp::init()
{
  int k;                        // starting index in parameters of origin offsets
  char filename[LINELEN];
  double *pars;                 // short name for _setup.parameters

  char *iniFileName;

  INIT_CANON();

  iniFileName = getenv("INI_FILE_NAME");

  // the default log file
  strcpy(&_setup.log_file[0], "emc_log");
  _setup.loggingLevel = 0;
  _setup.tool_change_at_g30 = 0;
  _setup.tool_change_quill_up = 0;
  _setup.tool_change_with_spindle_on = 0;
  _setup.a_axis_wrapped = 0;
  _setup.b_axis_wrapped = 0;
  _setup.c_axis_wrapped = 0;
  _setup.random_toolchanger = 0;

  // not clear -- but this is fn is called a second time without an INI.
  if(NULL == iniFileName)
  {
      logDebug("INI_FILE_NAME not found");
  }
  else
  {
      IniFile inifile;

      logDebug("iniFileName:%s:", iniFileName);

      if (inifile.Open(iniFileName) == false) {
          logDebug("Unable to open inifile:%s:", iniFileName);
      }
      else
      {
          const char *inistring;

          inifile.Find(&_setup.tool_change_at_g30, "TOOL_CHANGE_AT_G30", "EMCIO");
          inifile.Find(&_setup.tool_change_quill_up, "TOOL_CHANGE_QUILL_UP", "EMCIO");
          inifile.Find(&_setup.tool_change_with_spindle_on, "TOOL_CHANGE_WITH_SPINDLE_ON", "EMCIO");
          inifile.Find(&_setup.a_axis_wrapped, "WRAPPED_ROTARY", "AXIS_3");
          inifile.Find(&_setup.b_axis_wrapped, "WRAPPED_ROTARY", "AXIS_4");
          inifile.Find(&_setup.c_axis_wrapped, "WRAPPED_ROTARY", "AXIS_5");
          inifile.Find(&_setup.random_toolchanger, "RANDOM_TOOLCHANGER", "EMCIO");

          if(NULL != (inistring = inifile.Find("LOG_LEVEL", "RS274NGC")))
          {
              _setup.loggingLevel = atol(inistring);
          }

          if(NULL != (inistring = inifile.Find("LOG_FILE", "RS274NGC")))
          {
	    // found it
            if (realpath(inistring, &_setup.log_file[0]) == NULL) {
        	//realpath didn't find the file
        	//nothing to do, checking for log_file[0] will report it later
    	    }
          }

          _setup.use_lazy_close = 1;

	  _setup.wizard_root[0] = 0;
          if(NULL != (inistring = inifile.Find("WIZARD_ROOT", "WIZARD")))
          {
	    logDebug("[WIZARD]WIZARD_ROOT:%s\n", inistring);
            if (realpath(inistring, _setup.wizard_root) == NULL) {
        	//realpath didn't find the file
        	logDebug("realpath failed to find wizard_root:%s:\n", inistring);
            }
          }
          logDebug("_setup.wizard_root:%s:\n", _setup.wizard_root);

	  _setup.program_prefix[0] = 0;
          if(NULL != (inistring = inifile.Find("PROGRAM_PREFIX", "DISPLAY")))
          {
	    // found it
            if (realpath(inistring, _setup.program_prefix) == NULL){
        	//realpath didn't find the file
        	logDebug("realpath failed to find program_prefix:%s:\n", inistring);    
            }
            logDebug("program prefix:%s: prefix:%s:",
		     inistring, _setup.program_prefix);
          }
          else
          {
	      logDebug("PROGRAM_PREFIX not found");
          }
          logDebug("_setup.program_prefix:%s:\n", _setup.program_prefix);


          // close it
          inifile.Close();
      }
  }

  _setup.length_units = GET_EXTERNAL_LENGTH_UNIT_TYPE();
  USE_LENGTH_UNITS(_setup.length_units);
  GET_EXTERNAL_PARAMETER_FILE_NAME(filename, LINELEN);
  if (filename[0] == 0)
    strcpy(filename, RS274NGC_PARAMETER_FILE_NAME_DEFAULT);
  CHP(restore_parameters(filename));
  pars = _setup.parameters;
  _setup.origin_index = (int) (pars[5220] + 0.0001);
  if(_setup.origin_index < 1 || _setup.origin_index > 9) {
      _setup.origin_index = 1;
      pars[5220] = 1.0;
  }

  k = (5200 + (_setup.origin_index * 20));
  if (pars[5210]) {
      _setup.axis_offset_x = USER_TO_PROGRAM_LEN(pars[5211]);
      _setup.axis_offset_y = USER_TO_PROGRAM_LEN(pars[5212]);
      _setup.axis_offset_z = USER_TO_PROGRAM_LEN(pars[5213]);
      _setup.AA_axis_offset = USER_TO_PROGRAM_ANG(pars[5214]);
      _setup.BB_axis_offset = USER_TO_PROGRAM_ANG(pars[5215]);
      _setup.CC_axis_offset = USER_TO_PROGRAM_ANG(pars[5216]);
      _setup.u_axis_offset = USER_TO_PROGRAM_LEN(pars[5217]);
      _setup.v_axis_offset = USER_TO_PROGRAM_LEN(pars[5218]);
      _setup.w_axis_offset = USER_TO_PROGRAM_LEN(pars[5219]);
      SET_ORIGIN_OFFSETS(USER_TO_PROGRAM_LEN(pars[k + 1] + pars[5211]),
                         USER_TO_PROGRAM_LEN(pars[k + 2] + pars[5212]), 
                         USER_TO_PROGRAM_LEN(pars[k + 3] + pars[5213]),
                         USER_TO_PROGRAM_ANG(pars[k + 4] + pars[5214]),
                         USER_TO_PROGRAM_ANG(pars[k + 5] + pars[5215]),
                         USER_TO_PROGRAM_ANG(pars[k + 6] + pars[5216]),
                         USER_TO_PROGRAM_LEN(pars[k + 7] + pars[5217]),
                         USER_TO_PROGRAM_LEN(pars[k + 8] + pars[5218]),
                         USER_TO_PROGRAM_LEN(pars[k + 9] + pars[5219]));
  } else {
      _setup.axis_offset_x = 0.0;
      _setup.axis_offset_y = 0.0;
      _setup.axis_offset_z = 0.0;
      _setup.AA_axis_offset = 0.0;
      _setup.BB_axis_offset = 0.0;
      _setup.CC_axis_offset = 0.0;
      _setup.u_axis_offset = 0.0;
      _setup.v_axis_offset = 0.0;
      _setup.w_axis_offset = 0.0;
      SET_ORIGIN_OFFSETS(USER_TO_PROGRAM_LEN(pars[k + 1]),
                         USER_TO_PROGRAM_LEN(pars[k + 2]), 
                         USER_TO_PROGRAM_LEN(pars[k + 3]),
                         USER_TO_PROGRAM_ANG(pars[k + 4]),
                         USER_TO_PROGRAM_ANG(pars[k + 5]),
                         USER_TO_PROGRAM_ANG(pars[k + 6]),
                         USER_TO_PROGRAM_LEN(pars[k + 7]),
                         USER_TO_PROGRAM_LEN(pars[k + 8]),
                         USER_TO_PROGRAM_LEN(pars[k + 9]));
  }
  _setup.rotation_xy = pars[k+10];
  SET_XY_ROTATION(pars[k+10]);
  SET_FEED_REFERENCE(CANON_XYZ);
//_setup.Aa_current set in Interp::synch
  _setup.AA_origin_offset = USER_TO_PROGRAM_ANG(pars[k + 4]);
//_setup.Bb_current set in Interp::synch
  _setup.BB_origin_offset = USER_TO_PROGRAM_ANG(pars[k + 5]);
//_setup.Cc_current set in Interp::synch
  _setup.CC_origin_offset = USER_TO_PROGRAM_ANG(pars[k + 6]);
  _setup.u_origin_offset = USER_TO_PROGRAM_LEN(pars[k + 7]);
  _setup.v_origin_offset = USER_TO_PROGRAM_LEN(pars[k + 8]);
  _setup.w_origin_offset = USER_TO_PROGRAM_LEN(pars[k + 9]);
//_setup.active_g_codes initialized below
//_setup.active_m_codes initialized below
//_setup.active_settings initialized below
//_setup.block1 does not need initialization
  _setup.blocktext[0] = 0;
//_setup.current_slot set in Interp::synch
//_setup.current_x set in Interp::synch
//_setup.current_y set in Interp::synch
//_setup.current_z set in Interp::synch
  _setup.cutter_comp_side = OFF;
  _setup.arc_not_allowed = OFF;
//_setup.cycle values do not need initialization
  _setup.distance_mode = MODE_ABSOLUTE;
  _setup.ijk_distance_mode = MODE_INCREMENTAL;  // backwards compatability
  _setup.feed_mode = UNITS_PER_MINUTE;
//_setup.feed_override set in Interp::synch
//_setup.feed_rate set in Interp::synch
  _setup.filename[0] = 0;
  _setup.file_pointer = NULL;
//_setup.flood set in Interp::synch
  _setup.tool_offset_index = 1;
//_setup.length_units set in Interp::synch
  _setup.line_length = 0;
  _setup.linetext[0] = 0;
//_setup.mist set in Interp::synch
  _setup.motion_mode = G_80;
//_setup.origin_index set above
  _setup.origin_offset_x = USER_TO_PROGRAM_LEN(pars[k + 1]);
  _setup.origin_offset_y = USER_TO_PROGRAM_LEN(pars[k + 2]);
  _setup.origin_offset_z = USER_TO_PROGRAM_LEN(pars[k + 3]);
//_setup.parameters set above
//_setup.parameter_occurrence does not need initialization
//_setup.parameter_numbers does not need initialization
//_setup.parameter_values does not need initialization
//_setup.percent_flag does not need initialization
//_setup.plane set in Interp::synch
  _setup.probe_flag = OFF;
  _setup.toolchange_flag = OFF;
  _setup.input_flag = OFF;
  _setup.input_index = -1;
  _setup.input_digital = OFF;
  _setup.program_x = 0.;   /* for cutter comp */
  _setup.program_y = 0.;   /* for cutter comp */
  _setup.program_z = 0.;   /* for cutter comp */
  _setup.cutter_comp_firstmove = ON;
//_setup.retract_mode does not need initialization
//_setup.selected_tool_slot set in Interp::synch
  _setup.sequence_number = 0;   /*DOES THIS NEED TO BE AT TOP? */
//_setup.speed set in Interp::synch
  _setup.speed_feed_mode = CANON_INDEPENDENT;
//_setup.speed_override set in Interp::synch
//_setup.spindle_turning set in Interp::synch
//_setup.stack does not need initialization
//_setup.stack_index does not need initialization
   ZERO_EMC_POSE(_setup.tool_offset);
//_setup.tool_max set in Interp::synch
//_setup.tool_table set in Interp::synch
//_setup.traverse_rate set in Interp::synch
//_setup.adaptive_feed set in Interp::synch
//_setup.feed_hold set in Interp::synch

  // initialization stuff for subroutines and control structures
  _setup.call_level = 0;
  _setup.defining_sub = 0;
  _setup.skipping_o = 0;
  _setup.oword_labels = 0;

  _setup.lathe_diameter_mode = OFF;

  memcpy(_readers, default_readers, sizeof(default_readers));

  long axis_mask = GET_EXTERNAL_AXIS_MASK();
  if(!(axis_mask & AXIS_MASK_X)) _readers[(int)'x'] = 0;
  if(!(axis_mask & AXIS_MASK_Y)) _readers[(int)'y'] = 0;
  if(!(axis_mask & AXIS_MASK_Z)) _readers[(int)'z'] = 0;
  if(!(axis_mask & AXIS_MASK_A)) _readers[(int)'a'] = 0;
  if(!(axis_mask & AXIS_MASK_B)) _readers[(int)'b'] = 0;
  if(!(axis_mask & AXIS_MASK_C)) _readers[(int)'c'] = 0;
  if(!(axis_mask & AXIS_MASK_U)) _readers[(int)'u'] = 0;
  if(!(axis_mask & AXIS_MASK_V)) _readers[(int)'v'] = 0;
  if(!(axis_mask & AXIS_MASK_W)) _readers[(int)'w'] = 0;

  synch(); //synch first, then update the interface


  write_g_codes((block_pointer) NULL, &_setup);
  write_m_codes((block_pointer) NULL, &_setup);
  write_settings(&_setup);

  init_tool_parameters();
  // Synch rest of settings to external world
  return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x230, %rsp            # imm = 0x230
movq %rdi, %rbx
callq 0xa9f0
leaq 0xb181(%rip), %rdi      # 0x3dbe8
callq 0xad30
movq %rax, %r14
movq 0x114ea(%rip), %r15     # 0x43f60
movabsq $0x676f6c5f636d65, %rax # imm = 0x676F6C5F636D65
movq %rax, 0x1b6b8(%r15)
xorl %eax, %eax
movl %eax, 0x1b6b4(%r15)
movl %eax, 0xc6ac(%r15)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x1e6c0(%r15)
movq $0x0, 0x1e6d0(%r15)
testq %r14, %r14
je 0x32f32
leaq -0x140(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xb380
cmpl $0x0, 0x1b6b4(%r15)
jle 0x32afd
callq 0xaf80
movq %r14, (%rsp)
leaq 0xb114(%rip), %rsi      # 0x3dbf6
leaq 0xaf99(%rip), %r8       # 0x3da82
movq %rbx, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x18e, %r9d            # imm = 0x18E
xorl %eax, %eax
callq 0xb470
leaq -0x140(%rbp), %rdi
movq %r14, %rsi
callq 0xa650
testb %al, %al
je 0x32e6d
movl $0x1e6c0, %esi          # imm = 0x1E6C0
addq 0x11440(%rip), %rsi     # 0x43f60
leaq 0xb120(%rip), %rdx      # 0x3dc47
leaq 0xb12c(%rip), %rcx      # 0x3dc5a
leaq -0x140(%rbp), %rdi
movl $0x1, %r8d
callq 0xad60
movl $0x1e6c4, %esi          # imm = 0x1E6C4
addq 0x11414(%rip), %rsi     # 0x43f60
leaq 0xb10d(%rip), %rdx      # 0x3dc60
leaq 0xb100(%rip), %rcx      # 0x3dc5a
leaq -0x140(%rbp), %rdi
movl $0x1, %r8d
callq 0xad60
movl $0x1e6c8, %esi          # imm = 0x1E6C8
addq 0x113e8(%rip), %rsi     # 0x43f60
leaq 0xb0f6(%rip), %rdx      # 0x3dc75
leaq 0xb0d4(%rip), %rcx      # 0x3dc5a
leaq -0x140(%rbp), %rdi
movl $0x1, %r8d
callq 0xad60
movl $0x1e6cc, %esi          # imm = 0x1E6CC
addq 0x113bc(%rip), %rsi     # 0x43f60
leaq 0xb0e6(%rip), %rdx      # 0x3dc91
leaq 0xb0ee(%rip), %rcx      # 0x3dca0
leaq -0x140(%rbp), %rdi
movl $0x1, %r8d
callq 0xad60
movl $0x1e6d0, %esi          # imm = 0x1E6D0
addq 0x11390(%rip), %rsi     # 0x43f60
leaq 0xb0ba(%rip), %rdx      # 0x3dc91
leaq 0xb0c9(%rip), %rcx      # 0x3dca7
leaq -0x140(%rbp), %rdi
movl $0x1, %r8d
callq 0xad60
movl $0x1e6d4, %esi          # imm = 0x1E6D4
addq 0x11364(%rip), %rsi     # 0x43f60
leaq 0xb08e(%rip), %rdx      # 0x3dc91
leaq 0xb0a4(%rip), %rcx      # 0x3dcae
leaq -0x140(%rbp), %rdi
movl $0x1, %r8d
callq 0xad60
movl $0xc6ac, %esi           # imm = 0xC6AC
addq 0x11338(%rip), %rsi     # 0x43f60
leaq 0xb086(%rip), %rdx      # 0x3dcb5
leaq 0xb024(%rip), %rcx      # 0x3dc5a
leaq -0x140(%rbp), %rdi
movl $0x1, %r8d
callq 0xad60
leaq 0xb079(%rip), %rsi      # 0x3dcc8
leaq 0xb07c(%rip), %rdx      # 0x3dcd2
leaq -0x140(%rbp), %rdi
movl $0x1, %ecx
callq 0xa630
testq %rax, %rax
je 0x32c7b
movq %rax, %rdi
callq 0xad10
movl %eax, 0x1b6b4(%r15)
leaq 0xb059(%rip), %rsi      # 0x3dcdb
leaq 0xb049(%rip), %rdx      # 0x3dcd2
leaq -0x140(%rbp), %rdi
movl $0x1, %ecx
callq 0xa630
testq %rax, %rax
je 0x32cb3
movl $0x1b6b8, %esi          # imm = 0x1B6B8
addq 0x112b5(%rip), %rsi     # 0x43f60
movq %rax, %rdi
callq 0xa380
movl $0x1, 0x1d6b8(%r15)
movb $0x0, 0x1d6c0(%r15)
leaq 0xb017(%rip), %rsi      # 0x3dce4
leaq 0xb01c(%rip), %rdx      # 0x3dcf0
leaq -0x140(%rbp), %rdi
movl $0x1, %ecx
callq 0xa630
movq %rax, %r14
testq %rax, %rax
je 0x32d6b
cmpl $0x0, 0x1b6b4(%r15)
jle 0x32d22
callq 0xaf80
movq %r14, (%rsp)
leaq 0xaff0(%rip), %rsi      # 0x3dcf7
leaq 0xad74(%rip), %r8       # 0x3da82
movq %rbx, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x1b2, %r9d            # imm = 0x1B2
xorl %eax, %eax
callq 0xb470
leaq 0x1d6c0(%r15), %rsi
movq %r14, %rdi
callq 0xa380
testq %rax, %rax
jne 0x32d6b
cmpl $0x0, 0x1b6b4(%r15)
jle 0x32d6b
callq 0xaf80
movq %r14, (%rsp)
leaq 0xafd2(%rip), %rsi      # 0x3dd22
leaq 0xad2b(%rip), %r8       # 0x3da82
movq %rbx, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x1b5, %r9d            # imm = 0x1B5
xorl %eax, %eax
callq 0xb470
cmpl $0x0, 0x1b6b4(%r15)
jle 0x32dac
callq 0xaf80
movl $0x1d6c0, %ecx          # imm = 0x1D6C0
addq 0x111da(%rip), %rcx     # 0x43f60
movq %rcx, (%rsp)
leaq 0xafcd(%rip), %rsi      # 0x3dd5e
leaq 0xacea(%rip), %r8       # 0x3da82
movq %rbx, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x1b8, %r9d            # imm = 0x1B8
xorl %eax, %eax
callq 0xb470
movb $0x0, 0x1c6b8(%r15)
leaq 0xafce(%rip), %rsi      # 0x3dd89
leaq 0xafd6(%rip), %rdx      # 0x3dd98
leaq -0x140(%rbp), %rdi
movl $0x1, %ecx
callq 0xa630
movq %rax, %r14
testq %rax, %rax
je 0x32ea8
leaq 0x1c6b8(%r15), %rsi
movq %r14, %rdi
callq 0xa380
testq %rax, %rax
jne 0x32e28
cmpl $0x0, 0x1b6b4(%r15)
jle 0x32e28
callq 0xaf80
movq %r14, (%rsp)
leaq 0xaf93(%rip), %rsi      # 0x3dda0
leaq 0xac6e(%rip), %r8       # 0x3da82
movq %rbx, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x1c0, %r9d            # imm = 0x1C0
xorl %eax, %eax
callq 0xb470
cmpl $0x0, 0x1b6b4(%r15)
jle 0x32ed9
callq 0xaf80
movl $0x1c6b8, %ecx          # imm = 0x1C6B8
addq 0x11119(%rip), %rcx     # 0x43f60
movq %rcx, 0x8(%rsp)
movq %r14, (%rsp)
leaq 0xaf88(%rip), %rsi      # 0x3dddf
leaq 0xac24(%rip), %r8       # 0x3da82
movq %rbx, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x1c3, %r9d            # imm = 0x1C3
jmp 0x32ed2
cmpl $0x0, 0x1b6b4(%r15)
jle 0x32f26
callq 0xaf80
movq %r14, (%rsp)
leaq 0xad8e(%rip), %rsi      # 0x3dc19
leaq 0xabf0(%rip), %r8       # 0x3da82
movq %rbx, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x191, %r9d            # imm = 0x191
xorl %eax, %eax
callq 0xb470
jmp 0x32f26
cmpl $0x0, 0x1b6b4(%r15)
jle 0x32ed9
callq 0xaf80
leaq 0xaf52(%rip), %rsi      # 0x3de10
leaq 0xabbd(%rip), %r8       # 0x3da82
movq %rbx, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x1c7, %r9d            # imm = 0x1C7
xorl %eax, %eax
callq 0xb470
cmpl $0x0, 0x1b6b4(%r15)
jle 0x32f1a
callq 0xaf80
movl $0x1c6b8, %ecx          # imm = 0x1C6B8
addq 0x1106c(%rip), %rcx     # 0x43f60
movq %rcx, (%rsp)
leaq 0xaf3d(%rip), %rsi      # 0x3de3c
leaq 0xab7c(%rip), %r8       # 0x3da82
movq %rbx, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x1c9, %r9d            # imm = 0x1C9
xorl %eax, %eax
callq 0xb470
leaq -0x140(%rbp), %rdi
callq 0xa4b0
leaq -0x140(%rbp), %rdi
callq 0xa4b0
callq 0xb030
movl %eax, 0x1690(%r15)
movl %eax, %edi
callq 0xa880
leaq -0x240(%rbp), %r14
movq %r14, %rdi
movl $0xff, %esi
callq 0xa8e0
cmpb $0x0, (%r14)
jne 0x32f81
movabsq $0x7261762e63676e, %rax # imm = 0x7261762E63676E
movq %rax, -0x23b(%rbp)
movabsq $0x63676e3437327372, %rax # imm = 0x63676E3437327372
movq %rax, -0x240(%rbp)
leaq -0x240(%rbp), %rsi
movq %rbx, %rdi
callq 0xb440
testl %eax, %eax
je 0x32ffb
movl %eax, %r14d
movslq 0xd670(%r15), %rax
cmpq $0x30, %rax
jg 0x33cfb
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r15,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0xb1bd(%rip), %rsi      # 0x3e17f
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%r15), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r15,%rcx)
incl %eax
movl %eax, 0xd670(%r15)
movb %dl, 0xc720(%r15,%rcx)
jmp 0x33cfb
movsd 0xbae0(%r15), %xmm0
addsd 0x3854(%rip), %xmm0     # 0x36860
cvttsd2si %xmm0, %eax
movl %eax, 0x179c(%r15)
addl $-0xa, %eax
cmpl $-0xa, %eax
ja 0x3303b
movl $0x1, 0x179c(%r15)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0xbae0(%r15)
movslq 0x179c(%r15), %rax
shlq $0x2, %rax
leaq (%rax,%rax,4), %r12
movsd 0xba90(%r15), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movslq %r12d, %r14
jne 0x33066
jnp 0x33556
movsd 0xba98(%r15), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0xa990
movl 0x1690(%r15), %eax
movsd 0x3e38(%rip), %xmm1     # 0x36ec0
movsd %xmm1, -0x58(%rbp)
cmpl $0x3, %eax
je 0x3309a
movsd 0x3e06(%rip), %xmm1     # 0x36ea0
movsd -0x28(%rbp), %xmm2
divsd %xmm0, %xmm2
movsd 0x3e1d(%rip), %xmm0     # 0x36ec8
movsd %xmm0, -0x60(%rbp)
cmpl $0x1, %eax
je 0x330b9
movapd %xmm1, %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x118(%r15)
movsd 0xbaa0(%r15), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0xa990
movl 0x1690(%r15), %eax
movsd 0x3dd8(%rip), %xmm1     # 0x36ec0
cmpl $0x3, %eax
je 0x330f5
movsd 0x3dab(%rip), %xmm1     # 0x36ea0
movsd -0x28(%rbp), %xmm2
divsd %xmm0, %xmm2
movsd 0x3dc2(%rip), %xmm0     # 0x36ec8
cmpl $0x1, %eax
je 0x3310f
movapd %xmm1, %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x120(%r15)
movsd 0xbaa8(%r15), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0xa990
movl 0x1690(%r15), %eax
movsd 0x3d82(%rip), %xmm1     # 0x36ec0
cmpl $0x3, %eax
je 0x3314b
movsd 0x3d55(%rip), %xmm1     # 0x36ea0
movsd -0x28(%rbp), %xmm2
divsd %xmm0, %xmm2
movsd 0x3d6c(%rip), %xmm0     # 0x36ec8
cmpl $0x1, %eax
je 0x33165
movapd %xmm1, %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x128(%r15)
movsd 0xbab0(%r15), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0xaf60
movsd -0x28(%rbp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%r15)
movsd 0xbab8(%r15), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0xaf60
movsd -0x28(%rbp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x18(%r15)
movsd 0xbac0(%r15), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0xaf60
movsd -0x28(%rbp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x30(%r15)
movsd 0xbac8(%r15), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0xa990
movl 0x1690(%r15), %eax
movsd 0x3cc7(%rip), %xmm1     # 0x36ec0
cmpl $0x3, %eax
je 0x33206
movsd 0x3c9a(%rip), %xmm1     # 0x36ea0
movsd -0x28(%rbp), %xmm2
divsd %xmm0, %xmm2
movsd 0x3cb1(%rip), %xmm0     # 0x36ec8
cmpl $0x1, %eax
je 0x33220
movapd %xmm1, %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x48(%r15)
movsd 0xbad0(%r15), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0xa990
movl 0x1690(%r15), %eax
movsd 0x3c74(%rip), %xmm1     # 0x36ec0
cmpl $0x3, %eax
je 0x33259
movsd 0x3c47(%rip), %xmm1     # 0x36ea0
movsd -0x28(%rbp), %xmm2
divsd %xmm0, %xmm2
movsd 0x3c5e(%rip), %xmm0     # 0x36ec8
cmpl $0x1, %eax
je 0x33273
movapd %xmm1, %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x60(%r15)
movsd 0xbad8(%r15), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0xa990
movl 0x1690(%r15), %eax
movsd 0x3c21(%rip), %xmm1     # 0x36ec0
cmpl $0x3, %eax
je 0x332ac
movsd 0x3bf4(%rip), %xmm1     # 0x36ea0
movsd -0x28(%rbp), %xmm2
divsd %xmm0, %xmm2
movsd 0x3c0b(%rip), %xmm0     # 0x36ec8
cmpl $0x1, %eax
je 0x332c6
movapd %xmm1, %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x78(%r15)
movsd 0xba48(%r15,%r12,8), %xmm0
addsd 0xba98(%r15), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0xa990
movsd %xmm0, -0x40(%rbp)
movl 0x1690(%r15), %eax
movsd 0x3bbf(%rip), %xmm0     # 0x36ec0
cmpl $0x3, %eax
je 0x3330e
movsd 0x3b92(%rip), %xmm0     # 0x36ea0
movsd 0x3bb2(%rip), %xmm1     # 0x36ec8
cmpl $0x1, %eax
je 0x3331e
movaps %xmm0, %xmm1
movsd %xmm1, -0xd0(%rbp)
movsd 0xba50(%r15,%r12,8), %xmm0
addsd 0xbaa0(%r15), %xmm0
movsd %xmm0, -0x38(%rbp)
callq 0xa990
movsd %xmm0, -0xa8(%rbp)
movl 0x1690(%r15), %eax
movsd 0x3b66(%rip), %xmm0     # 0x36ec0
cmpl $0x3, %eax
je 0x33367
movsd 0x3b39(%rip), %xmm0     # 0x36ea0
movsd 0x3b59(%rip), %xmm1     # 0x36ec8
cmpl $0x1, %eax
je 0x33377
movaps %xmm0, %xmm1
movsd %xmm1, -0xc0(%rbp)
movsd 0xba58(%r15,%r12,8), %xmm0
addsd 0xbaa8(%r15), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0xa990
movsd %xmm0, -0x90(%rbp)
movl 0x1690(%r15), %eax
movsd 0x3b0d(%rip), %xmm0     # 0x36ec0
cmpl $0x3, %eax
je 0x333c0
movsd 0x3ae0(%rip), %xmm0     # 0x36ea0
movsd 0x3b00(%rip), %xmm1     # 0x36ec8
cmpl $0x1, %eax
je 0x333d0
movaps %xmm0, %xmm1
movsd %xmm1, -0xa0(%rbp)
movsd 0xba60(%r15,%r12,8), %xmm0
addsd 0xbab0(%r15), %xmm0
movsd %xmm0, -0xc8(%rbp)
callq 0xaf60
movsd %xmm0, -0x98(%rbp)
movsd 0xba68(%r15,%r12,8), %xmm0
addsd 0xbab8(%r15), %xmm0
movsd %xmm0, -0xb8(%rbp)
callq 0xaf60
movsd %xmm0, -0x88(%rbp)
movsd 0xba70(%r15,%r12,8), %xmm0
addsd 0xbac0(%r15), %xmm0
movsd %xmm0, -0xb0(%rbp)
callq 0xaf60
movsd %xmm0, -0x80(%rbp)
movsd 0xba78(%r15,%r12,8), %xmm0
addsd 0xbac8(%r15), %xmm0
movsd %xmm0, -0x50(%rbp)
callq 0xa990
movsd %xmm0, -0x70(%rbp)
movl 0x1690(%r15), %eax
movsd 0x3a42(%rip), %xmm0     # 0x36ec0
cmpl $0x3, %eax
je 0x3348b
movsd 0x3a15(%rip), %xmm0     # 0x36ea0
movsd 0x3a35(%rip), %xmm1     # 0x36ec8
cmpl $0x1, %eax
je 0x3349b
movaps %xmm0, %xmm1
movsd %xmm1, -0x78(%rbp)
movsd 0xba80(%r15,%r12,8), %xmm0
addsd 0xbad0(%r15), %xmm0
movsd %xmm0, -0x48(%rbp)
callq 0xa990
movl 0x1690(%r15), %eax
movsd 0x39f4(%rip), %xmm1     # 0x36ec0
cmpl $0x3, %eax
je 0x334d9
movsd 0x39c7(%rip), %xmm1     # 0x36ea0
movsd 0x39e7(%rip), %xmm4     # 0x36ec8
cmpl $0x1, %eax
movsd -0x30(%rbp), %xmm2
movsd -0x50(%rbp), %xmm3
je 0x334f3
movaps %xmm1, %xmm4
movsd %xmm4, -0x68(%rbp)
movsd -0x28(%rbp), %xmm1
divsd -0x40(%rbp), %xmm1
movsd %xmm1, -0x28(%rbp)
movsd -0x38(%rbp), %xmm1
divsd -0xa8(%rbp), %xmm1
movsd %xmm1, -0x38(%rbp)
divsd -0x90(%rbp), %xmm2
movsd %xmm2, -0x30(%rbp)
divsd -0x70(%rbp), %xmm3
movsd %xmm3, -0x50(%rbp)
movsd -0x48(%rbp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, -0x48(%rbp)
movsd 0xba88(%r15,%r12,8), %xmm0
addsd 0xbad8(%r15), %xmm0
jmp 0x337bd
xorl %eax, %eax
movq %rax, (%r15)
movq %rax, 0x18(%r15)
movq %rax, 0x30(%r15)
movq %rax, 0x48(%r15)
movq %rax, 0x60(%r15)
movq %rax, 0x78(%r15)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x118(%r15)
movq %rax, 0x128(%r15)
movsd 0xba48(%r15,%r14,8), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0xa990
movsd %xmm0, -0x40(%rbp)
movl 0x1690(%r15), %eax
movsd 0x3915(%rip), %xmm0     # 0x36ec0
movsd %xmm0, -0x58(%rbp)
cmpl $0x3, %eax
je 0x335bd
movsd 0x38e3(%rip), %xmm0     # 0x36ea0
movsd 0x3903(%rip), %xmm1     # 0x36ec8
movsd %xmm1, -0x60(%rbp)
cmpl $0x1, %eax
je 0x335d2
movaps %xmm0, %xmm1
movsd %xmm1, -0xd0(%rbp)
movsd 0xba50(%r15,%r14,8), %xmm0
movsd %xmm0, -0x38(%rbp)
callq 0xa990
movsd %xmm0, -0xa8(%rbp)
movl 0x1690(%r15), %eax
movsd 0x38bb(%rip), %xmm0     # 0x36ec0
cmpl $0x3, %eax
je 0x33612
movsd 0x388e(%rip), %xmm0     # 0x36ea0
movsd 0x38ae(%rip), %xmm1     # 0x36ec8
cmpl $0x1, %eax
je 0x33622
movaps %xmm0, %xmm1
movsd %xmm1, -0xc0(%rbp)
movsd 0xba58(%r15,%r14,8), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0xa990
movsd %xmm0, -0x90(%rbp)
movl 0x1690(%r15), %eax
movsd 0x386b(%rip), %xmm0     # 0x36ec0
cmpl $0x3, %eax
je 0x33662
movsd 0x383e(%rip), %xmm0     # 0x36ea0
movsd 0x385e(%rip), %xmm1     # 0x36ec8
cmpl $0x1, %eax
je 0x33672
movaps %xmm0, %xmm1
movsd %xmm1, -0xa0(%rbp)
movsd 0xba60(%r15,%r14,8), %xmm0
movsd %xmm0, -0xc8(%rbp)
callq 0xaf60
movsd %xmm0, -0x98(%rbp)
movsd 0xba68(%r15,%r14,8), %xmm0
movsd %xmm0, -0xb8(%rbp)
callq 0xaf60
movsd %xmm0, -0x88(%rbp)
movsd 0xba70(%r15,%r14,8), %xmm0
movsd %xmm0, -0xb0(%rbp)
callq 0xaf60
movsd %xmm0, -0x80(%rbp)
movsd 0xba78(%r15,%r14,8), %xmm0
movsd %xmm0, -0x50(%rbp)
callq 0xa990
movsd %xmm0, -0x70(%rbp)
movl 0x1690(%r15), %eax
movsd 0x37c4(%rip), %xmm0     # 0x36ec0
cmpl $0x3, %eax
je 0x33709
movsd 0x3797(%rip), %xmm0     # 0x36ea0
movsd 0x37b7(%rip), %xmm1     # 0x36ec8
cmpl $0x1, %eax
je 0x33719
movaps %xmm0, %xmm1
movsd %xmm1, -0x78(%rbp)
movsd 0xba80(%r15,%r14,8), %xmm0
movsd %xmm0, -0x48(%rbp)
callq 0xa990
movl 0x1690(%r15), %eax
movsd 0x377f(%rip), %xmm1     # 0x36ec0
cmpl $0x3, %eax
je 0x3374e
movsd 0x3752(%rip), %xmm1     # 0x36ea0
movsd 0x3772(%rip), %xmm4     # 0x36ec8
cmpl $0x1, %eax
movsd -0x30(%rbp), %xmm2
movsd -0x50(%rbp), %xmm3
je 0x33768
movaps %xmm1, %xmm4
movsd %xmm4, -0x68(%rbp)
movsd -0x28(%rbp), %xmm1
divsd -0x40(%rbp), %xmm1
movsd %xmm1, -0x28(%rbp)
movsd -0x38(%rbp), %xmm1
divsd -0xa8(%rbp), %xmm1
movsd %xmm1, -0x38(%rbp)
divsd -0x90(%rbp), %xmm2
movsd %xmm2, -0x30(%rbp)
divsd -0x70(%rbp), %xmm3
movsd %xmm3, -0x50(%rbp)
movsd -0x48(%rbp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, -0x48(%rbp)
movsd 0xba88(%r15,%r14,8), %xmm0
movsd %xmm0, -0x40(%rbp)
callq 0xa990
movl 0x1690(%r15), %eax
cmpl $0x3, %eax
je 0x337e0
movsd 0x36c5(%rip), %xmm1     # 0x36ea0
movsd %xmm1, -0x58(%rbp)
movsd -0x28(%rbp), %xmm8
divsd -0xd0(%rbp), %xmm8
movsd -0x38(%rbp), %xmm1
divsd -0xc0(%rbp), %xmm1
movsd -0x30(%rbp), %xmm2
divsd -0xa0(%rbp), %xmm2
movsd -0xc8(%rbp), %xmm3
divsd -0x98(%rbp), %xmm3
movsd -0xb8(%rbp), %xmm4
divsd -0x88(%rbp), %xmm4
movsd -0xb0(%rbp), %xmm5
divsd -0x80(%rbp), %xmm5
movsd -0x50(%rbp), %xmm6
divsd -0x78(%rbp), %xmm6
movsd -0x48(%rbp), %xmm7
divsd -0x68(%rbp), %xmm7
movsd -0x40(%rbp), %xmm9
divsd %xmm0, %xmm9
cmpl $0x1, %eax
je 0x33864
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
divsd -0x60(%rbp), %xmm9
movsd %xmm9, (%rsp)
movapd %xmm8, %xmm0
callq 0xa510
movsd 0xba90(%r15,%r14,8), %xmm0
movsd %xmm0, 0x17b8(%r15)
callq 0xae60
movl $0x2, %edi
callq 0xac70
movsd 0xba60(%r15,%r14,8), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0xaf60
movsd -0x28(%rbp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x10(%r15)
movsd 0xba68(%r15,%r14,8), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0xaf60
movsd -0x28(%rbp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x28(%r15)
movsd 0xba70(%r15,%r14,8), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0xaf60
movsd -0x28(%rbp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x40(%r15)
movsd 0xba78(%r15,%r14,8), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0xa990
movl 0x1690(%r15), %eax
movsd 0x3598(%rip), %xmm1     # 0x36ec0
movsd %xmm1, -0x38(%rbp)
cmpl $0x3, %eax
je 0x3393a
movsd 0x3566(%rip), %xmm1     # 0x36ea0
movsd -0x28(%rbp), %xmm2
divsd %xmm0, %xmm2
movsd 0x357d(%rip), %xmm0     # 0x36ec8
movsd %xmm0, -0x28(%rbp)
cmpl $0x1, %eax
je 0x33959
movapd %xmm1, %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x58(%r15)
movsd 0xba80(%r15,%r14,8), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0xa990
movl 0x1690(%r15), %eax
movsd 0x353a(%rip), %xmm1     # 0x36ec0
cmpl $0x3, %eax
je 0x33993
movsd 0x350d(%rip), %xmm1     # 0x36ea0
movsd -0x30(%rbp), %xmm2
divsd %xmm0, %xmm2
movsd 0x3524(%rip), %xmm0     # 0x36ec8
cmpl $0x1, %eax
je 0x339ad
movapd %xmm1, %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x70(%r15)
movsd 0xba88(%r15,%r14,8), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0xa990
movl 0x1690(%r15), %eax
movsd 0x34e6(%rip), %xmm1     # 0x36ec0
cmpl $0x3, %eax
je 0x339e7
movsd 0x34b9(%rip), %xmm1     # 0x36ea0
movsd -0x30(%rbp), %xmm2
divsd %xmm0, %xmm2
movsd 0x34d0(%rip), %xmm0     # 0x36ec8
cmpl $0x1, %eax
je 0x33a01
movapd %xmm1, %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x88(%r15)
xorl %r12d, %r12d
movb %r12b, 0x4f8(%r15)
movl %r12d, 0x624(%r15)
movb %r12b, 0x110(%r15)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x668(%r15)
movl %r12d, 0x670(%r15)
movb %r12b, 0x680(%r15)
movq %r12, 0x1680(%r15)
movl $0x1, 0x168c(%r15)
movl %r12d, 0x1694(%r15)
movb %r12b, 0x1698(%r15)
movl $0x320, 0x1798(%r15) # imm = 0x320
movsd 0xba48(%r15,%r14,8), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0xa990
movl 0x1690(%r15), %eax
movsd 0x342d(%rip), %xmm1     # 0x36ec0
cmpl $0x3, %eax
je 0x33aa0
movsd 0x3400(%rip), %xmm1     # 0x36ea0
movsd -0x30(%rbp), %xmm2
divsd %xmm0, %xmm2
movsd 0x3417(%rip), %xmm0     # 0x36ec8
cmpl $0x1, %eax
je 0x33aba
movapd %xmm1, %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x17a0(%r15)
movsd 0xba50(%r15,%r14,8), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0xa990
movl 0x1690(%r15), %eax
movsd 0x33d6(%rip), %xmm1     # 0x36ec0
cmpl $0x3, %eax
je 0x33af7
movsd 0x33a9(%rip), %xmm1     # 0x36ea0
movsd -0x30(%rbp), %xmm2
divsd %xmm0, %xmm2
movsd 0x33c0(%rip), %xmm0     # 0x36ec8
cmpl $0x1, %eax
je 0x33b11
movapd %xmm1, %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x17a8(%r15)
movsd 0xba58(%r15,%r14,8), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0xa990
movl 0x1690(%r15), %eax
cmpl $0x3, %eax
je 0x33b4b
movsd 0x335a(%rip), %xmm1     # 0x36ea0
movsd %xmm1, -0x38(%rbp)
movsd -0x30(%rbp), %xmm1
divsd %xmm0, %xmm1
cmpl $0x1, %eax
je 0x33b63
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
divsd -0x28(%rbp), %xmm1
movsd %xmm1, 0x17b0(%r15)
movw $0x0, 0xc680(%r15)
movb %r12b, 0xc682(%r15)
movl $0xffffffff, 0xc684(%r15) # imm = 0xFFFFFFFF
movw $0x100, 0xc688(%r15)    # imm = 0x100
xorpd %xmm0, %xmm0
movupd %xmm0, 0xc690(%r15)
movq %r12, 0xc6a0(%r15)
movl %r12d, 0xc6b4(%r15)
movl $0x2, 0xc6c4(%r15)
movl %r12d, 0xef90(%r15)
movl %r12d, 0xef50(%r15)
movq %r12, 0xef70(%r15)
movl %r12d, 0xfb28(%r15)
movb %r12b, 0x1e6d8(%r15)
leaq 0x8(%rbx), %rdi
movupd %xmm0, 0xd678(%r15)
movupd %xmm0, 0xd688(%r15)
movupd %xmm0, 0xd698(%r15)
movupd %xmm0, 0xd6a8(%r15)
movq %r12, 0xd6b8(%r15)
movq 0x103a2(%rip), %rsi     # 0x43fb8
movl $0x1000, %edx           # imm = 0x1000
callq 0xa8a0
callq 0xab20
movl %eax, %ecx
testb $0x1, %al
jne 0x33c37
xorpd %xmm0, %xmm0
movupd %xmm0, 0x788(%rbx)
testb $0x2, %cl
jne 0x33c48
xorpd %xmm0, %xmm0
movupd %xmm0, 0x798(%rbx)
testb $0x4, %cl
jne 0x33c59
xorpd %xmm0, %xmm0
movupd %xmm0, 0x7a8(%rbx)
testb $0x8, %cl
jne 0x33c6a
xorpd %xmm0, %xmm0
movupd %xmm0, 0x618(%rbx)
testb $0x10, %cl
jne 0x33c7b
xorpd %xmm0, %xmm0
movupd %xmm0, 0x628(%rbx)
testb $0x20, %cl
jne 0x33c8c
xorpd %xmm0, %xmm0
movupd %xmm0, 0x638(%rbx)
testb $0x40, %cl
jne 0x33c9d
xorpd %xmm0, %xmm0
movupd %xmm0, 0x758(%rbx)
testb %cl, %cl
js 0x33cad
xorpd %xmm0, %xmm0
movupd %xmm0, 0x768(%rbx)
btl $0x8, %ecx
jb 0x33cbf
xorpd %xmm0, %xmm0
movupd %xmm0, 0x778(%rbx)
movq %rbx, %rdi
callq 0xaad0
movq 0x10292(%rip), %r15     # 0x43f60
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0xb600
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0xb5c0
movq %rbx, %rdi
movq %r15, %rsi
callq 0xad40
callq 0xb270
movl %r14d, %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x33d29
jmp 0x33d12
movq %rax, %rbx
leaq -0x140(%rbp), %rdi
callq 0xa4b0
movq %rbx, %rdi
callq 0xb3b0
movq %rax, %rdi
callq 0x34af9
nop