// File: /workspace/github_cpp_makefile_star2_O2/suzukiplan[P]M6502/test/./../m6502.hpp
// Function: M6502::execute(int, bool)
int execute(int clocks, bool executeUntilNMI = false)
    {
        this->clockConsumed = 0;
        while (this->clockConsumed < clocks || executeUntilNMI) {
            R.tickCount++;
            for (auto bp : CB.breakPoints) {
                if (bp->addr == R.pc) {
                    bp->callback(CB.arg);
                }
            }
            DD.pc = R.pc;
            DD.mne[0] = '\0';
            DD.opp[0] = '\0';
            unsigned char opcode = fetch();
            for (auto bo : CB.breakOperands) {
                if (bo->operand == opcode) {
                    bo->callback(CB.arg);
                }
            }
            void (*operand)(M6502*) = operands[opcode];
            if (operand) {
                operand(this);
                if (CB.debugMessage) {
                    char buf[1024];
                    sprintf(buf, "[$%04X] %s %s", DD.pc, DD.mne, DD.opp);
                    CB.debugMessage(CB.arg, buf);
                }
            } else {
                if (CB.onError) CB.onError(CB.arg, M6502_ERROR_UNKNOWN_OPERAND);
            }
            if (R.interrupt & 0b01) {
                if (R.interrupt & 0b10) {
                    if (CB.debugMessage) CB.debugMessage(CB.arg, "EXECUTE NMI");
                    consumeClock();
                    executeInterrupt(0xFFFA, false);
                    consumeClock();
                    executeUntilNMI = false;
                } else if (!getStatusI()) {
                    if (CB.debugMessage) CB.debugMessage(CB.arg, "EXECUTE IRQ");
                    consumeClock();
                    executeInterrupt(0xFFFE, false);
                    consumeClock();
                }
                R.interrupt = 0;
            }
        }
        return this->clockConsumed;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movl %edx, %r13d
movl %esi, -0x2c(%rbp)
movq %rdi, %r14
andl $0x0, 0x88(%rdi)
leaq 0x62(%rdi), %rax
movq %rax, -0x40(%rbp)
leaq 0x66(%rdi), %rax
movq %rax, -0x38(%rbp)
xorl %eax, %eax
cmpl -0x2c(%rbp), %eax
setl %cl
orb %r13b, %cl
testb $0x1, %cl
je 0x12014
incl 0x894(%r14)
movq 0x28(%r14), %r15
movq 0x30(%r14), %r12
cmpq %r12, %r15
je 0x11ee5
movq (%r15), %rax
movzwl (%rax), %ecx
cmpw 0x898(%r14), %cx
jne 0x11edf
movq 0x58(%r14), %rdi
callq *0x8(%rax)
addq $0x8, %r15
jmp 0x11ec3
movzwl 0x898(%r14), %eax
movw %ax, 0x60(%r14)
xorl %eax, %eax
movb %al, 0x62(%r14)
movb %al, 0x66(%r14)
movq %r14, %rdi
callq 0x145be
movl %eax, %r15d
movq 0x40(%r14), %r12
movq 0x48(%r14), %rbx
cmpq %rbx, %r12
je 0x11f2a
movq (%r12), %rax
cmpb %r15b, (%rax)
jne 0x11f24
movq 0x58(%r14), %rdi
callq *0x8(%rax)
addq $0x8, %r12
jmp 0x11f0f
movzbl %r15b, %eax
movq 0x90(%r14,%rax,8), %rax
testq %rax, %rax
je 0x11f79
movq %r14, %rdi
callq *%rax
cmpq $0x0, 0x10(%r14)
je 0x11f8d
movzwl 0x60(%r14), %edx
leaq -0x440(%rbp), %rbx
movq %rbx, %rdi
leaq 0x545b(%rip), %rsi      # 0x173b8
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %r8
xorl %eax, %eax
callq 0x1040
movq 0x58(%r14), %rdi
movq %rbx, %rsi
callq *0x10(%r14)
jmp 0x11f8d
movq 0x20(%r14), %rax
testq %rax, %rax
je 0x11f8d
movq 0x58(%r14), %rdi
movl $0xdead0001, %esi       # imm = 0xDEAD0001
callq *%rax
movzbl 0x89f(%r14), %eax
testb $0x1, %al
je 0x12008
testb $0x2, %al
jne 0x11fc4
testb $0x4, 0x89d(%r14)
jne 0x12000
movq 0x10(%r14), %rax
movw $0xfffe, %r15w          # imm = 0xFFFE
testq %rax, %rax
je 0x11fe2
movq 0x58(%r14), %rdi
leaq 0x5412(%rip), %rsi      # 0x173d2
callq *%rax
jmp 0x11fe2
movq 0x10(%r14), %rax
movw $0xfffa, %r15w          # imm = 0xFFFA
testq %rax, %rax
je 0x11fdf
movq 0x58(%r14), %rdi
leaq 0x53e9(%rip), %rsi      # 0x173c6
callq *%rax
xorl %r13d, %r13d
movq %r14, %rdi
callq 0x14598
movzwl %r15w, %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0x15566
movq %r14, %rdi
callq 0x14598
movb $0x0, 0x89f(%r14)
movl 0x88(%r14), %eax
jmp 0x11ea2
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq