// File: /workspace/github_cpp_makefile_star2_O1/sundale[P]gcode/rs274ngc/interp_execute.cc
// Function: Interp::execute_block(block_struct*, setup_struct*)
int Interp::execute_block(block_pointer block,   //!< pointer to a block of RS274/NGC instructions
                         setup_pointer settings)        //!< pointer to machine settings                 
{
  int status;

  block->line_number = settings->sequence_number;

  if (block->comment[0] != 0) {
    CHP(convert_comment(block->comment));
  }
  if (block->g_modes[14] != -1) {
    CHP(convert_spindle_mode(block, settings));
  }
  if (block->g_modes[5] != -1) {
    CHP(convert_feed_mode(block->g_modes[5], settings));
  }
  if (block->f_number > -1.0) {
    if (settings->feed_mode != INVERSE_TIME) {
      CHP(convert_feed_rate(block, settings));
    }
    /* INVERSE_TIME is handled elsewhere */
  }
  if (block->s_number > -1.0) {
    CHP(convert_speed(block, settings));
  }
  if (block->t_number != -1) {
    CHP(convert_tool_select(block, settings));
  }
  CHP(convert_m(block, settings));
  CHP(convert_g(block, settings));
  if (block->m_modes[4] != -1) {        /* converts m0, m1, m2, m30, or m60 */
    status = convert_stop(block, settings);
    if (status == INTERP_EXIT)
      return INTERP_EXIT;
    else if (status != INTERP_OK)
      ERP(status);
  }
  if (settings->probe_flag == ON)
    return INTERP_EXECUTE_FINISH;

  if (settings->input_flag == ON)
    return INTERP_EXECUTE_FINISH;

  if (settings->toolchange_flag == ON)
    return INTERP_EXECUTE_FINISH;

  return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0xc6b4(%rdx), %eax
movl %eax, 0x1d0(%rsi)
cmpb $0x0, 0x30(%rsi)
je 0x266ac
leaq 0x30(%r14), %rsi
movq %r15, %rdi
callq 0xb400
movl %eax, %r12d
testl %eax, %eax
je 0x266ac
movq 0x1d915(%rip), %rbx     # 0x43f60
movslq 0xd670(%rbx), %rax
cmpq $0x30, %rax
jg 0x26ab6
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%rbx,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x14039(%rip), %rsi     # 0x3a6af
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%rbx), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%rbx,%rcx)
incl %eax
movl %eax, 0xd670(%rbx)
movb %dl, 0xc720(%rbx,%rcx)
jmp 0x26ab6
cmpl $-0x1, 0x188(%r14)
je 0x26740
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xae40
movl %eax, %r13d
testl %eax, %eax
je 0x26737
movq 0x1d88a(%rip), %r12     # 0x43f60
movslq 0xd670(%r12), %rax
cmpq $0x30, %rax
jg 0x26734
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r12,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x13fb1(%rip), %rsi     # 0x3a6af
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%r12), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r12,%rcx)
incl %eax
movl %eax, 0xd670(%r12)
movb %dl, 0xc720(%r12,%rcx)
movl %r13d, %r12d
testl %r13d, %r13d
jne 0x26ab6
movl 0x164(%r14), %esi
cmpl $-0x1, %esi
je 0x267d3
movq %r15, %rdi
movq %rbx, %rdx
callq 0xa8f0
movl %eax, %r13d
testl %eax, %eax
je 0x267ca
movq 0x1d7f7(%rip), %r12     # 0x43f60
movslq 0xd670(%r12), %rax
cmpq $0x30, %rax
jg 0x267c7
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r12,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x13f1e(%rip), %rsi     # 0x3a6af
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%r12), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r12,%rcx)
incl %eax
movl %eax, 0xd670(%r12)
movb %dl, 0xc720(%r12,%rcx)
movl %r13d, %r12d
testl %r13d, %r13d
jne 0x26ab6
movsd 0x148(%r14), %xmm0
ucomisd 0x1008c(%rip), %xmm0    # 0x36870
jbe 0x2687d
cmpl $0x1, 0x670(%rbx)
je 0x2687d
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xb540
movl %eax, %r13d
testl %eax, %eax
je 0x26874
movq 0x1d74d(%rip), %r12     # 0x43f60
movslq 0xd670(%r12), %rax
cmpq $0x30, %rax
jg 0x26871
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r12,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x13e74(%rip), %rsi     # 0x3a6af
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%r12), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r12,%rcx)
incl %eax
movl %eax, 0xd670(%r12)
movb %dl, 0xc720(%r12,%rcx)
movl %r13d, %r12d
testl %r13d, %r13d
jne 0x26ab6
movsd 0x238(%r14), %xmm0
ucomisd 0xffe2(%rip), %xmm0     # 0x36870
jbe 0x2691a
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xa740
movl %eax, %r13d
testl %eax, %eax
je 0x26911
movq 0x1d6b0(%rip), %r12     # 0x43f60
movslq 0xd670(%r12), %rax
cmpq $0x30, %rax
jg 0x2690e
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r12,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x13dd7(%rip), %rsi     # 0x3a6af
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%r12), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r12,%rcx)
incl %eax
movl %eax, 0xd670(%r12)
movb %dl, 0xc720(%r12,%rcx)
movl %r13d, %r12d
testl %r13d, %r13d
jne 0x26ab6
cmpl $-0x1, 0x240(%r14)
je 0x269ae
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xb3d0
movl %eax, %r13d
testl %eax, %eax
je 0x269a5
movq 0x1d61c(%rip), %r12     # 0x43f60
movslq 0xd670(%r12), %rax
cmpq $0x30, %rax
jg 0x269a2
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r12,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x13d43(%rip), %rsi     # 0x3a6af
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%r12), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r12,%rcx)
incl %eax
movl %eax, 0xd670(%r12)
movb %dl, 0xc720(%r12,%rcx)
movl %r13d, %r12d
testl %r13d, %r13d
jne 0x26ab6
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xada0
movl %eax, %r13d
testl %eax, %eax
je 0x26a2b
movq 0x1d596(%rip), %r12     # 0x43f60
movslq 0xd670(%r12), %rax
cmpq $0x30, %rax
jg 0x26a28
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r12,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x13cbd(%rip), %rsi     # 0x3a6af
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%r12), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r12,%rcx)
incl %eax
movl %eax, 0xd670(%r12)
movb %dl, 0xc720(%r12,%rcx)
movl %r13d, %r12d
testl %r13d, %r13d
jne 0x26ab6
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xa150
movl %eax, %r13d
testl %eax, %eax
je 0x26ab1
movq 0x1d510(%rip), %r12     # 0x43f60
movslq 0xd670(%r12), %rax
cmpq $0x30, %rax
jg 0x26aae
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r12,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x13c37(%rip), %rsi     # 0x3a6af
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%r12), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r12,%rcx)
incl %eax
movl %eax, 0xd670(%r12)
movb %dl, 0xc720(%r12,%rcx)
movl %r13d, %r12d
testl %r13d, %r13d
je 0x26ac8
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $-0x1, 0x1f0(%r14)
je 0x26af1
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xb230
testl %eax, %eax
je 0x26af1
movl %eax, %r12d
cmpl $0x1, %eax
je 0x26ab6
jmp 0x26644
movl $0x2, %r12d
cmpb $0x0, 0xc680(%rbx)
jne 0x26ab6
cmpb $0x0, 0xc681(%rbx)
jne 0x26ab6
movzbl 0xc682(%rbx), %r12d
addl %r12d, %r12d
jmp 0x26ab6