// File: jstaursky[P]hutch/src/Sleigh/emulate.cc
// Function: Emulate::executeCurrentOp()
void Emulate::executeCurrentOp(void)

{
  if (currentBehave == (OpBehavior *)0) {	// Presumably a NO-OP
    fallthruOp();
    return;
  }
  if (currentBehave->isSpecial()) {
    switch(currentBehave->getOpcode()) {
    case CPUI_LOAD:
      executeLoad();
      fallthruOp();
      break;
    case CPUI_STORE:
      executeStore();
      fallthruOp();
      break;
    case CPUI_BRANCH:
      executeBranch();
      break;
    case CPUI_CBRANCH:
      if (executeCbranch())
	executeBranch();
      else
	fallthruOp();
      break;
    case CPUI_BRANCHIND:
      executeBranchind();
      break;
    case CPUI_CALL:
      executeCall();
      break;
    case CPUI_CALLIND:
      executeCallind();
      break;
    case CPUI_CALLOTHER:
      executeCallother();
      break;
    case CPUI_RETURN:
      executeBranchind();
      break;
    case CPUI_MULTIEQUAL:
      executeMultiequal();
      fallthruOp();
      break;
    case CPUI_INDIRECT:
      executeIndirect();
      fallthruOp();
      break;
    case CPUI_SEGMENTOP:
      executeSegmentOp();
      fallthruOp();
      break;
    case CPUI_CPOOLREF:
      executeCpoolRef();
      fallthruOp();
      break;
    case CPUI_NEW:
      executeNew();
      fallthruOp();
      break;
    default:
      throw LowlevelError("Bad special op");
    }
  }
  else if (currentBehave->isUnary()) {	// Unary operation
    executeUnary();
    fallthruOp();
  }
  else {			// Binary operation
    executeBinary();
    fallthruOp();		// All binary ops are fallthrus
  }
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x10(%rax)
jne 0x15eb2a
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x78(%rax)
jmp 0x15edbc
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0xd41c0
testb $0x1, %al
jne 0x15eb41
jmp 0x15ed79
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0xd0e00
addl $-0x2, %eax
movl %eax, %ecx
movq %rcx, 0x18(%rsp)
subl $0x43, %eax
ja 0x15ecc2
movq 0x18(%rsp), %rax
leaq 0x2adb6(%rip), %rcx     # 0x189924
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x78(%rax)
jmp 0x15ed77
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x78(%rax)
jmp 0x15ed77
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x20(%rax)
jmp 0x15ed77
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
testb $0x1, %al
jne 0x15ebce
jmp 0x15ebdb
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x20(%rax)
jmp 0x15ebe6
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x78(%rax)
jmp 0x15ed77
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x30(%rax)
jmp 0x15ed77
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
jmp 0x15ed77
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
jmp 0x15ed77
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x48(%rax)
jmp 0x15ed77
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x30(%rax)
jmp 0x15ed77
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x50(%rax)
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x78(%rax)
jmp 0x15ed77
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x78(%rax)
jmp 0x15ed77
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x60(%rax)
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x78(%rax)
jmp 0x15ed77
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x68(%rax)
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x78(%rax)
jmp 0x15ed77
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x70(%rax)
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x78(%rax)
jmp 0x15ed77
movb $0x1, 0x2b(%rsp)
movl $0x20, %edi
callq 0xd2b40
movq %rax, 0x8(%rsp)
leaq 0x3f(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xe0c80
movq 0x10(%rsp), %rdx
leaq 0x2ad9f(%rip), %rsi     # 0x189a90
leaq 0x40(%rsp), %rdi
callq 0xe00a0
jmp 0x15ecfd
movq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xd1ae0
jmp 0x15ed0e
movq 0x8(%rsp), %rdi
movb $0x0, 0x2b(%rsp)
movq 0x69171(%rip), %rsi     # 0x1c7e90
movq 0x68eaa(%rip), %rdx     # 0x1c7bd0
callq 0xe01f0
jmp 0x15edcb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
jmp 0x15ed58
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
leaq 0x40(%rsp), %rdi
callq 0xd4550
leaq 0x3f(%rsp), %rdi
callq 0xd8ec0
testb $0x1, 0x2b(%rsp)
jne 0x15ed6b
jmp 0x15ed75
movq 0x8(%rsp), %rdi
callq 0xd5400
jmp 0x15edc1
jmp 0x15edbc
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0xd1cd0
testb $0x1, %al
jne 0x15ed8d
jmp 0x15eda4
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *(%rax)
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x78(%rax)
jmp 0x15edba
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x78(%rax)
jmp 0x15edbc
addq $0x68, %rsp
retq
movq 0x30(%rsp), %rdi
callq 0xe0be0
nopl (%rax,%rax)