// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/rs274ngc/interp_convert.cc
// Function: Interp::convert_m(block_struct*, setup_struct*)
int Interp::convert_m(block_pointer block,       //!< pointer to a block of RS274/NGC instructions
                     setup_pointer settings)    //!< pointer to machine settings                 
{
  int type;
  double timeout;               // timeout for M66
  double *pars;                 /* short name for settings->parameters            */

  pars = settings->parameters;

  /* The M62-65 commands are used for DIO */
  /* M62 sets a DIO synched with motion
     M63 clears a DIO synched with motion
     M64 sets a DIO imediately
     M65 clears a DIO imediately 
     M66 waits for an input
     M67 reads a digital input
     M68 reads an analog input*/

  if (block->m_modes[5] == 62) {
      CHKS((settings->cutter_comp_side != OFF),
           (_("Cannot set motion output with cutter radius compensation on")));  // XXX
      CHKS((block->p_flag == OFF), _("No valid P word with M62"));
      SET_MOTION_OUTPUT_BIT(round_to_int(block->p_number));
  } else if (block->m_modes[5] == 63) {
      CHKS((settings->cutter_comp_side != OFF),
           (_("Cannot set motion digital output with cutter radius compensation on")));  // XXX
      CHKS((block->p_flag == OFF), _("No valid P word with M63"));
      CLEAR_MOTION_OUTPUT_BIT(round_to_int(block->p_number));
  } else if (block->m_modes[5] == 64) {
      CHKS((settings->cutter_comp_side != OFF),
           (_("Cannot set auxiliary digital output with cutter radius compensation on")));  // XXX
      CHKS((block->p_flag == OFF), _("No valid P word with M64"));
      SET_AUX_OUTPUT_BIT(round_to_int(block->p_number));
  } else if (block->m_modes[5] == 65) {
      CHKS((settings->cutter_comp_side != OFF),
           (_("Cannot set auxiliary digital output with cutter radius compensation on")));  // XXX
      CHKS((block->p_flag == OFF), _("No valid P word with M65"));
      CLEAR_AUX_OUTPUT_BIT(round_to_int(block->p_number));
  } else if (block->m_modes[5] == 66) {
    //P-word = digital channel
    //E-word = analog channel
    //L-word = wait type (immediate, rise, fall, high, low)
    //Q-word = timeout
    // it is an error if:

    // P and E word are specified together
    CHKS(((block->p_flag == ON) && (block->e_flag == ON)),
	NCE_BOTH_DIGITAL_AND_ANALOG_INPUT_SELECTED);

    // L-word not 0, and timeout <= 0 
    CHKS(((block->q_number <= 0) && (block->l_flag == ON) && (round_to_int(block->l_number) > 0)),
	NCE_ZERO_TIMEOUT_WITH_WAIT_NOT_IMMEDIATE);
	
    // E-word specified (analog input) and wait type not immediate
    CHKS(((block->e_flag == ON) && (block->l_flag == ON) && (round_to_int(block->l_number) != 0)),
	NCE_ANALOG_INPUT_WITH_WAIT_NOT_IMMEDIATE);

    // missing P or E (or invalid = negative)
    CHKS( ((block->p_flag == ON) && (round_to_int(block->p_number) < 0)) || 
         ((block->e_flag == ON) && (round_to_int(block->e_number) < 0)) ||
	 ((block->p_flag == OFF) && (block->e_flag == OFF)) ,
	NCE_INVALID_OR_MISSING_P_AND_E_WORDS_FOR_WAIT_INPUT);

    if (block->p_flag == ON) { // got a digital input
	if (round_to_int(block->p_number) < 0) // safety check for negative words
	    ERS("invalid P-word with M66");
	    
	if (block->l_flag == ON) {
	    type = round_to_int(block->l_number);
	} else {
	    type = WAIT_MODE_IMMEDIATE;
        }
	    
	if (block->q_number > 0) {
	    timeout = block->q_number;
	} else {
	    timeout = 0;
        }

        CHKS((settings->cutter_comp_side != OFF),
             (_("Cannot wait for digital input with cutter radius compensation on")));

	int ret = WAIT(round_to_int(block->p_number), DIGITAL_INPUT, type, timeout);
	//WAIT returns 0 on success, -1 for out of bounds
	CHKS((ret == -1), NCE_DIGITAL_INPUT_INVALID_ON_M66);
	if (ret == 0) {
	    settings->input_flag = ON;
	    settings->input_index = round_to_int(block->p_number);
	    settings->input_digital = ON;
	}
    } else if (round_to_int(block->e_number) >= 0) { // got an analog input
        CHKS((settings->cutter_comp_side != OFF),
             (_("Cannot wait for analog input with cutter radius compensation on")));

	int ret = WAIT(round_to_int(block->e_number), ANALOG_INPUT, 0, 0); //WAIT returns 0 on success, -1 for out of bounds
	CHKS((ret == -1), NCE_ANALOG_INPUT_INVALID_ON_M66);
	if (ret == 0) {
	    settings->input_flag = ON;
	    settings->input_index = round_to_int(block->e_number);
	    settings->input_digital = OFF;
	}
    } 
  } else if (block->m_modes[5] == 67) {
    //E-word = analog channel
    //Q-word = analog value
      CHKS((settings->cutter_comp_side != OFF),
           (_("Cannot set motion analog output with cutter radius compensation on")));  // XXX
      CHKS((block->e_flag == OFF) || (round_to_int(block->e_number) < 0), (_("Invalid analog index with M67")));
      SET_MOTION_OUTPUT_VALUE(round_to_int(block->e_number), block->q_number);
  } else if (block->m_modes[5] == 68) {
    //E-word = analog channel
    //Q-word = analog value
      CHKS((settings->cutter_comp_side != OFF),
           (_("Cannot set auxiliary analog output with cutter radius compensation on")));  // XXX
      CHKS((block->e_flag == OFF) || (round_to_int(block->e_number) < 0), (_("Invalid analog index with M68")));
      SET_AUX_OUTPUT_VALUE(round_to_int(block->e_number), block->q_number);
  }    
  
  if (block->m_modes[6] != -1) {
    // when we have M6 do the actual toolchange
    if (block->m_modes[6] == 6)
	CHP(convert_tool_change(settings));
	
    // when we have M61 we only change the number of the loaded tool (for example on startup)
    if (block->m_modes[6] == 61) {
	CHKS((round_to_int(block->q_number) < 0), (_("Need positive Q-word to specify tool number with M61")));
	settings->current_pocket = round_to_int(block->q_number);
	CHANGE_TOOL_NUMBER(round_to_int(block->q_number));
    }    
#ifdef DEBATABLE
    // I would like this, but it's a big change.  It changes the
    // operation of legal ngc programs, but it could be argued that
    // those programs are buggy or likely to be not what the author
    // intended.

    // It would allow you to turn on G43 after loading the first tool,
    // and then not worry about it through the program.  When you
    // finally unload the last tool, G43 mode is canceled.

    if(settings->active_g_codes[9] == G_43) {
        if(settings->selected_tool_slot > 0) {
            struct block_struct g43;
            init_block(&g43);
            block->g_modes[_gees[G_43]] = G_43;
            CHP(convert_tool_length_offset(G_43, &g43, settings));
        } else {
            struct block_struct g49;
            init_block(&g49);
            block->g_modes[_gees[G_49]] = G_49;
            CHP(convert_tool_length_offset(G_49, &g49, settings));
        }
    }
#endif
  }

  if (block->m_modes[7] == 3) {
      enqueue_START_SPINDLE_CLOCKWISE();
      settings->spindle_turning = CANON_CLOCKWISE;
  } else if (block->m_modes[7] == 4) {
      enqueue_START_SPINDLE_COUNTERCLOCKWISE();
      settings->spindle_turning = CANON_COUNTERCLOCKWISE;
  } else if (block->m_modes[7] == 5) {
      enqueue_STOP_SPINDLE_TURNING();
      settings->spindle_turning = CANON_STOPPED;
  }

  if (block->m_modes[8] == 7) {
      enqueue_MIST_ON();
      settings->mist = ON;
  } else if (block->m_modes[8] == 8) {
      enqueue_FLOOD_ON();
      settings->flood = ON;
  } else if (block->m_modes[8] == 9) {
      enqueue_MIST_OFF();
      settings->mist = OFF;
      enqueue_FLOOD_OFF();
      settings->flood = OFF;
  }

/* No axis clamps in this version
  if (block->m_modes[2] == 26)
    {
#ifdef DEBUG_EMC
      COMMENT("interpreter: automatic A-axis clamping turned on");
#endif
      settings->a_axis_clamping = ON;
    }
  else if (block->m_modes[2] == 27)
    {
#ifdef DEBUG_EMC
      COMMENT("interpreter: automatic A-axis clamping turned off");
#endif
      settings->a_axis_clamping = OFF;
    }
*/

  if (block->m_modes[9] == 48) {
    CHKS((settings->cutter_comp_side != OFF),
         (_("Cannot enable overrides with cutter radius compensation on")));  // XXX
    ENABLE_FEED_OVERRIDE();
    ENABLE_SPEED_OVERRIDE();
    settings->feed_override = ON;
    settings->speed_override = ON;
  } else if (block->m_modes[9] == 49) {
    CHKS((settings->cutter_comp_side != OFF),
         (_("Cannot disable overrides with cutter radius compensation on")));  // XXX
    DISABLE_FEED_OVERRIDE();
    DISABLE_SPEED_OVERRIDE();
    settings->feed_override = OFF;
    settings->speed_override = OFF;
  }

  if (block->m_modes[9] == 50) {
    if (block->p_number != 0) {
        CHKS((settings->cutter_comp_side != OFF),
             (_("Cannot enable overrides with cutter radius compensation on")));  // XXX
	ENABLE_FEED_OVERRIDE();
	settings->feed_override = ON;
    } else {
        CHKS((settings->cutter_comp_side != OFF),
             (_("Cannot disable overrides with cutter radius compensation on")));  // XXX
        DISABLE_FEED_OVERRIDE();
	settings->feed_override = OFF;
    }
  }

  if (block->m_modes[9] == 51) {
    if (block->p_number != 0) {
        CHKS((settings->cutter_comp_side != OFF),
             (_("Cannot enable overrides with cutter radius compensation on")));  // XXX
	ENABLE_SPEED_OVERRIDE();
	settings->speed_override = ON;
    } else {
        CHKS((settings->cutter_comp_side != OFF),
             (_("Cannot disable overrides with cutter radius compensation on")));  // XXX
	DISABLE_SPEED_OVERRIDE();
	settings->speed_override = OFF;
    }
  }
  
  if (block->m_modes[9] == 52) {
    if (block->p_number != 0) {
        CHKS((settings->cutter_comp_side != OFF),
             (_("Cannot enable overrides with cutter radius compensation on")));  // XXX
	ENABLE_ADAPTIVE_FEED();
	settings->adaptive_feed = ON;
    } else {
        CHKS((settings->cutter_comp_side != OFF),
             (_("Cannot disable overrides with cutter radius compensation on")));  // XXX
	DISABLE_ADAPTIVE_FEED();
	settings->adaptive_feed = OFF;
    }
  }
  
  if (block->m_modes[9] == 53) {
    if (block->p_number != 0) {
        CHKS((settings->cutter_comp_side != OFF),
             (_("Cannot enable overrides with cutter radius compensation on")));  // XXX
	ENABLE_FEED_HOLD();
	settings->feed_hold = ON;
    } else {
        CHKS((settings->cutter_comp_side != OFF),
             (_("Cannot disable overrides with cutter radius compensation on")));  // XXX
	DISABLE_FEED_HOLD();
	settings->feed_hold = OFF;
    }
  }

  /* user-defined M codes */
  if (block->m_modes[10] != -1) {
    int index = block->m_modes[10];
    if (USER_DEFINED_FUNCTION[index - 100] == 0) {
      CHKS(1, NCE_UNKNOWN_M_CODE_USED);
    }
    enqueue_M_USER_COMMAND(index,block->p_number,block->q_number);
  }
  return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movl 0x1f4(%rsi), %eax
addl $-0x3e, %eax
cmpl $0x6, %eax
ja 0x14750
leaq 0x1bd9d(%rip), %rcx     # 0x2ffe0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, 0x624(%r15)
je 0x144eb
leaq 0x1d844(%rip), %rdi     # 0x31aa5
jmp 0x14a2c
movb 0x218(%r14), %al
cmpb $0x1, %al
jne 0x1433f
cmpb $0x1, 0x139(%r14)
jne 0x1433f
leaq 0x1d946(%rip), %rdi     # 0x31bd0
jmp 0x14a2c
cmpl $0x0, 0x624(%r15)
jne 0x142e5
cmpb $0x0, 0x218(%r14)
je 0x14611
movsd 0x210(%r14), %xmm0
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x1bcdc(%rip), %rcx     # 0x2ffa0
addsd (%rcx,%rax,8), %xmm0
cvttsd2si %xmm0, %edi
callq 0xc1c0
jmp 0x14750
cmpl $0x0, 0x624(%r15)
je 0x144ad
leaq 0x1d86b(%rip), %rdi     # 0x31b57
jmp 0x14a2c
cmpl $0x0, 0x624(%r15)
je 0x14529
leaq 0x1d7f4(%rip), %rdi     # 0x31afa
jmp 0x14a2c
cmpl $0x0, 0x624(%r15)
je 0x14567
leaq 0x1da76(%rip), %rdi     # 0x31d96
jmp 0x14a2c
cmpl $0x0, 0x624(%r15)
je 0x145b2
leaq 0x1dabd(%rip), %rdi     # 0x31df7
jmp 0x14a2c
movsd 0x220(%r14), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jb 0x1438a
cmpb $0x1, 0x1cc(%r14)
jne 0x1438a
movl 0x1c8(%r14), %ecx
cvtsi2sd %ecx, %xmm1
shrl $0x1f, %ecx
leaq 0x1bc2f(%rip), %rdx     # 0x2ffa0
addsd (%rdx,%rcx,8), %xmm1
cvttsd2si %xmm1, %ecx
testl %ecx, %ecx
jle 0x1438a
leaq 0x1d889(%rip), %rdi     # 0x31c0e
jmp 0x14a2c
movb 0x139(%r14), %cl
cmpb $0x1, %cl
jne 0x143ce
cmpb $0x1, 0x1cc(%r14)
jne 0x143ce
movl 0x1c8(%r14), %edx
cvtsi2sd %edx, %xmm1
shrl $0x1f, %edx
leaq 0x1bbeb(%rip), %rsi     # 0x2ffa0
addsd (%rsi,%rdx,8), %xmm1
cvttsd2si %xmm1, %edx
testl %edx, %edx
je 0x143ce
leaq 0x1d875(%rip), %rdi     # 0x31c3e
jmp 0x14a2c
testb %al, %al
je 0x14400
movsd 0x210(%r14), %xmm1
xorpd %xmm2, %xmm2
xorl %edx, %edx
ucomisd %xmm1, %xmm2
seta %dl
leaq 0x1bbb1(%rip), %rsi     # 0x2ffa0
addsd (%rsi,%rdx,8), %xmm1
cvttsd2si %xmm1, %edx
testl %edx, %edx
js 0x1468a
testb %cl, %cl
je 0x14432
movsd 0x140(%r14), %xmm1
xorpd %xmm2, %xmm2
xorl %edx, %edx
ucomisd %xmm1, %xmm2
seta %dl
leaq 0x1bb7f(%rip), %rsi     # 0x2ffa0
addsd (%rsi,%rdx,8), %xmm1
cvttsd2si %xmm1, %edx
testl %edx, %edx
js 0x1468a
testb %al, %al
je 0x14641
je 0x14645
movsd 0x210(%r14), %xmm1
xorpd %xmm2, %xmm2
xorl %eax, %eax
ucomisd %xmm1, %xmm2
seta %al
leaq 0x1bb43(%rip), %r12     # 0x2ffa0
addsd (%r12,%rax,8), %xmm1
cvttsd2si %xmm1, %edi
testl %edi, %edi
js 0x146ed
xorl %edx, %edx
cmpb $0x1, 0x1cc(%r14)
jne 0x14493
movl 0x1c8(%r14), %eax
cvtsi2sd %eax, %xmm1
shrl $0x1f, %eax
addsd (%r12,%rax,8), %xmm1
cvttsd2si %xmm1, %edx
cmpl $0x0, 0x624(%r15)
je 0x146fc
leaq 0x1d824(%rip), %rdi     # 0x31ccc
jmp 0x14a2c
cmpb $0x0, 0x218(%r14)
je 0x1461d
movsd 0x210(%r14), %xmm0
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x1bac8(%rip), %rcx     # 0x2ffa0
addsd (%rcx,%rax,8), %xmm0
cvttsd2si %xmm0, %edi
callq 0xbbf0
jmp 0x14750
cmpb $0x0, 0x218(%r14)
je 0x14629
movsd 0x210(%r14), %xmm0
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x1ba8a(%rip), %rcx     # 0x2ffa0
addsd (%rcx,%rax,8), %xmm0
cvttsd2si %xmm0, %edi
callq 0xc660
jmp 0x14750
cmpb $0x0, 0x218(%r14)
je 0x14635
movsd 0x210(%r14), %xmm0
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x1ba4c(%rip), %rcx     # 0x2ffa0
addsd (%rcx,%rax,8), %xmm0
cvttsd2si %xmm0, %edi
callq 0xb610
jmp 0x14750
cmpb $0x0, 0x139(%r14)
je 0x145f9
movsd 0x140(%r14), %xmm0
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x1ba0e(%rip), %rcx     # 0x2ffa0
addsd (%rcx,%rax,8), %xmm0
cvttsd2si %xmm0, %edi
testl %edi, %edi
js 0x145f9
movsd 0x220(%r14), %xmm0
callq 0xbd10
jmp 0x14750
cmpb $0x0, 0x139(%r14)
je 0x14605
movsd 0x140(%r14), %xmm0
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x1b9c7(%rip), %rcx     # 0x2ffa0
addsd (%rcx,%rax,8), %xmm0
cvttsd2si %xmm0, %edi
testl %edi, %edi
js 0x14605
movsd 0x220(%r14), %xmm0
callq 0xc410
jmp 0x14750
leaq 0x1d7d9(%rip), %rdi     # 0x31dd9
jmp 0x14a2c
leaq 0x1d831(%rip), %rdi     # 0x31e3d
jmp 0x14a2c
leaq 0x1d586(%rip), %rdi     # 0x31b9e
jmp 0x14a2c
leaq 0x1d593(%rip), %rdi     # 0x31bb7
jmp 0x14a2c
leaq 0x1d4b1(%rip), %rdi     # 0x31ae1
jmp 0x14a2c
leaq 0x1d502(%rip), %rdi     # 0x31b3e
jmp 0x14a2c
testb %cl, %cl
je 0x1468a
movsd 0x140(%r14), %xmm0
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x1b93e(%rip), %r12     # 0x2ffa0
addsd (%r12,%rax,8), %xmm0
cvttsd2si %xmm0, %edi
testl %edi, %edi
js 0x14750
cmpl $0x0, 0x624(%r15)
je 0x14696
leaq 0x1d6ad(%rip), %rdi     # 0x31d32
jmp 0x14a2c
leaq 0x1d5ea(%rip), %rdi     # 0x31c7b
jmp 0x14a2c
xorpd %xmm0, %xmm0
xorl %esi, %esi
xorl %edx, %edx
callq 0xb6d0
cmpl $-0x1, %eax
je 0x14adb
testl %eax, %eax
jne 0x14750
movb $0x1, 0xc681(%r15)
movsd 0x140(%r14), %xmm0
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
addsd (%r12,%rax,8), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0xc684(%r15)
movb $0x0, 0xc688(%r15)
jmp 0x14750
leaq 0x1d5c0(%rip), %rsi     # 0x31cb4
movq %rbx, %rdi
jmp 0x14a37
xorpd %xmm1, %xmm1
maxsd %xmm1, %xmm0
pushq $0x1
popq %rsi
callq 0xb6d0
cmpl $-0x1, %eax
je 0x14ae7
testl %eax, %eax
jne 0x14750
movb $0x1, %al
movb %al, 0xc681(%r15)
movsd 0x210(%r14), %xmm0
xorpd %xmm1, %xmm1
xorl %ecx, %ecx
ucomisd %xmm0, %xmm1
seta %cl
addsd (%r12,%rcx,8), %xmm0
cvttsd2si %xmm0, %ecx
movl %ecx, 0xc684(%r15)
movb %al, 0xc688(%r15)
movl 0x1f8(%r14), %eax
cmpl $-0x1, %eax
je 0x1481b
cmpl $0x6, %eax
jne 0x147dc
movq %rbx, %rdi
movq %r15, %rsi
callq 0xc400
testl %eax, %eax
je 0x147d5
movl %eax, %r12d
movq 0x287e2(%rip), %rbx     # 0x3cf60
movslq 0xd670(%rbx), %rax
cmpq $0x30, %rax
jg 0x14a71
imulq $0x50, %rax, %rax
leaq (%rbx,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x1c0e2(%rip), %rsi     # 0x30887
pushq $0x50
popq %rdx
callq 0xb940
movslq 0xd670(%rbx), %rax
imulq $0x50, %rax, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%rbx,%rcx)
incl %eax
movl %eax, 0xd670(%rbx)
movb %dl, 0xc720(%rbx,%rcx)
jmp 0x14a71
movl 0x1f8(%r14), %eax
cmpl $0x3d, %eax
jne 0x1481b
movsd 0x220(%r14), %xmm0
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x1b7a2(%rip), %rcx     # 0x2ffa0
addsd (%rcx,%rax,8), %xmm0
cvttsd2si %xmm0, %edi
testl %edi, %edi
js 0x14932
movl %edi, 0x5fc(%r15)
callq 0xc4a0
movl 0x1fc(%r14), %eax
cmpl $0x5, %eax
je 0x14845
cmpl $0x4, %eax
je 0x1483a
cmpl $0x3, %eax
jne 0x14855
callq 0xc440
pushq $0x2
jmp 0x14841
callq 0xc7c0
pushq $0x3
popq %r12
jmp 0x1484e
pushq $0x1
popq %r12
callq 0xc740
movl %r12d, 0xc6cc(%r15)
movl 0x200(%r14), %eax
cmpl $0x9, %eax
je 0x14889
cmpl $0x8, %eax
je 0x1487a
cmpl $0x7, %eax
jne 0x148a4
callq 0xb400
movb $0x1, 0x1797(%r15)
jmp 0x148a4
callq 0xc5f0
movb $0x1, 0x1688(%r15)
jmp 0x148a4
callq 0xc6d0
xorl %r12d, %r12d
movb %r12b, 0x1797(%r15)
callq 0xbf70
movb %r12b, 0x1688(%r15)
movl 0x204(%r14), %eax
cmpl $0x31, %eax
je 0x148d1
cmpl $0x30, %eax
jne 0x14900
cmpl $0x0, 0x624(%r15)
jne 0x14a18
callq 0xb5b0
callq 0xc830
movb $0x1, %al
jmp 0x148eb
cmpl $0x0, 0x624(%r15)
jne 0x14a25
callq 0xb360
callq 0xc150
xorl %eax, %eax
movb %al, 0x674(%r15)
movb %al, 0xc6c8(%r15)
movl 0x204(%r14), %eax
cmpl $0x32, %eax
jne 0x14954
movsd 0x210(%r14), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movl 0x624(%r15), %eax
jne 0x14921
jnp 0x1493e
testl %eax, %eax
jne 0x14a18
callq 0xb5b0
movb $0x1, %al
jmp 0x1494d
leaq 0x1d522(%rip), %rdi     # 0x31e5b
jmp 0x14a2c
testl %eax, %eax
jne 0x14a25
callq 0xb360
xorl %eax, %eax
movb %al, 0x674(%r15)
movl 0x204(%r14), %eax
cmpl $0x33, %eax
jne 0x149aa
movsd 0x210(%r14), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movl 0x624(%r15), %eax
jne 0x1497c
jnp 0x1498d
testl %eax, %eax
jne 0x14a18
callq 0xc830
movb $0x1, %al
jmp 0x1499c
testl %eax, %eax
jne 0x14a25
callq 0xc150
xorl %eax, %eax
movb %al, 0xc6c8(%r15)
movl 0x204(%r14), %eax
cmpl $0x34, %eax
jne 0x149ea
movsd 0x210(%r14), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movl 0x624(%r15), %eax
jne 0x149cb
jnp 0x149d8
testl %eax, %eax
jne 0x14a18
callq 0xc490
movb $0x1, %al
jmp 0x149e3
testl %eax, %eax
jne 0x14a25
callq 0xc510
xorl %eax, %eax
movb %al, 0x1b6b0(%r15)
cmpl $0x35, 0x204(%r14)
jne 0x14a94
movsd 0x210(%r14), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movl 0x624(%r15), %eax
jne 0x14a14
jnp 0x14a21
testl %eax, %eax
je 0x14a7d
leaq 0x1d471(%rip), %rdi     # 0x31e90
jmp 0x14a2c
testl %eax, %eax
je 0x14a86
leaq 0x1d49f(%rip), %rdi     # 0x31ecb
callq 0xb220
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0xb8e0
movq 0x2851b(%rip), %rbx     # 0x3cf60
leaq 0xc6d0(%rbx), %rdi
leaq 0x1be34(%rip), %rsi     # 0x30887
pushq $0x50
popq %rdx
callq 0xb940
andw $0x0, 0xc71f(%rbx)
movl $0x1, 0xd670(%rbx)
pushq $0x5
popq %r12
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0xc6a0
movb $0x1, %al
jmp 0x14a8d
callq 0xc360
xorl %eax, %eax
movb %al, 0x1b6b1(%r15)
movslq 0x208(%r14), %rdi
xorl %r12d, %r12d
cmpq $-0x1, %rdi
je 0x14a71
movq 0x2852d(%rip), %rax     # 0x3cfd8
cmpq $0x0, -0x320(%rax,%rdi,8)
je 0x14acf
movsd 0x210(%r14), %xmm0
movsd 0x220(%r14), %xmm1
callq 0xbae0
jmp 0x14a71
leaq 0x1d431(%rip), %rdi     # 0x31f07
jmp 0x14a2c
leaq 0x1d290(%rip), %rdi     # 0x31d72
jmp 0x14a2c
leaq 0x1d21f(%rip), %rdi     # 0x31d0d
jmp 0x14a2c
nop