// File: /workspace/github_cpp_makefile_star2_O2/jstaursky[P]hutch/src/Sleigh/sleigh.cc
// Function: Sleigh::resolve(ParserContext&) const
void Sleigh::resolve (ParserContext& pos) const
// Resolve ALL the constructors involved in the
{
    // instruction at this address
    loader->loadFill (pos.getBuffer (), 16, pos.getAddr ());
    ParserWalkerChange walker (&pos);
    // Clear the previous resolve and initialize the walker
    pos.deallocateState (walker);
    Constructor *ct, *subct;
    uint4 off;
    int4 oper, numoper;

    pos.setDelaySlot (0);
    walker.setOffset (0);        // Initial offset
    pos.clearCommits ();         // Clear any old context commits
    pos.loadContext ();          // Get context for current address
    ct = root->resolve (walker); // Base constructor
    walker.setConstructor (ct);
    ct->applyContext (walker);
    while (walker.isState ()) {
        ct = walker.getConstructor ();
        oper = walker.getOperand ();
        numoper = ct->getNumOperands ();
        while (oper < numoper) {
            OperandSymbol* sym = ct->getOperand (oper);
            off = walker.getOffset (sym->getOffsetBase ()) +
                  sym->getRelativeOffset ();
            // Descend into new operand and reserve space
            pos.allocateOperand (oper, walker);
            walker.setOffset (off);
            TripleSymbol* tsym = sym->getDefiningSymbol ();
            if (tsym != (TripleSymbol*)0) {
                subct = tsym->resolve (walker);
                if (subct != (Constructor*)0) {
                    walker.setConstructor (subct);
                    subct->applyContext (walker);
                    break;
                }
            }
            walker.setCurrentLength (sym->getMinimumLength ());
            walker.popOperand ();
            oper += 1;
        }
        if (oper >= numoper) { // Finished processing constructor
            walker.calcCurrentLength (ct->getMinimumLength (), numoper);
            walker.popOperand ();
            // Check for use of delayslot
            ConstructTpl* templ = ct->getTempl ();
            if ((templ != (ConstructTpl*)0) && (templ->delaySlot () > 0))
                pos.setDelaySlot (templ->delaySlot ());
        }
    }
    // Update Naddr to pointer after instruction
    pos.setNaddr (pos.getAddr () + pos.getLength ());
    pos.setParserState (ParserContext::disassembly);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x1e0(%rdi), %rdi
addq $0x10, %rsi
leaq 0x50(%r14), %rcx
movq (%rdi), %rax
pushq $0x10
popq %rdx
movq %rcx, (%rsp)
callq *0x10(%rax)
movq %r14, 0x10(%rsp)
andq $0x0, 0x18(%rsp)
movl $0x1, 0xa0(%r14)
movq %r14, 0xb0(%rsp)
movq 0x98(%r14), %rax
movq %rax, 0x20(%rsp)
andq $0x0, 0x28(%rsp)
andl $0x0, 0xa4(%r14)
andl $0x0, 0x64(%rax)
movq 0x38(%r14), %rax
cmpq %rax, 0x40(%r14)
je 0x642e3
movq %rax, 0x40(%r14)
movq %r14, %r15
movq %r14, %rdi
callq 0x4d620
movq 0x190(%rbx), %rdi
movq (%rdi), %rax
leaq 0x10(%rsp), %rbx
movq %rbx, %rsi
callq *0x30(%rax)
movq 0x10(%rbx), %rcx
movq %rax, (%rcx)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x50770
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x6442e
movq (%rax), %rbp
movslq 0x28(%rsp), %rcx
movslq 0x2c(%rsp,%rcx,4), %r13
movq 0x20(%rbp), %rcx
subq 0x18(%rbp), %rcx
shrq $0x3, %rcx
movq %rcx, 0x8(%rsp)
movslq %ecx, %r14
cmpq %r14, %r13
jge 0x643db
movq 0x18(%rbp), %rcx
movq (%rcx,%r13,8), %r12
movslq 0x34(%r12), %rcx
testq %rcx, %rcx
js 0x6436f
movq 0x40(%rax), %rax
movq (%rax,%rcx,8), %rax
movl 0x60(%rax), %ebx
addl 0x64(%rax), %ebx
jmp 0x64372
movl 0x64(%rax), %ebx
addl 0x30(%r12), %ebx
movq %r15, %rdi
movl %r13d, %esi
leaq 0x10(%rsp), %rdx
callq 0x4f6c0
movq 0x20(%rsp), %rcx
movl %ebx, 0x64(%rcx)
movq 0x48(%r12), %rdi
testq %rdi, %rdi
je 0x643ae
movq (%rdi), %rax
leaq 0x10(%rsp), %rsi
callq *0x30(%rax)
movq 0x20(%rsp), %rcx
testq %rax, %rax
jne 0x643cb
movl 0x38(%r12), %eax
movl %eax, 0x60(%rcx)
movq 0x58(%rcx), %rax
movq %rax, 0x20(%rsp)
decl 0x28(%rsp)
incq %r13
jmp 0x64344
movq %rax, (%rcx)
movq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0x50770
movq 0x8(%rsp), %rdx
cmpl %edx, %r13d
jl 0x64315
movl 0x80(%rbp), %esi
leaq 0x10(%rsp), %rdi
callq 0x51fb0
movq 0x20(%rsp), %rax
movq 0x58(%rax), %rax
movq %rax, 0x20(%rsp)
decl 0x28(%rsp)
movq 0x60(%rbp), %rax
testq %rax, %rax
je 0x64315
movl (%rax), %eax
testl %eax, %eax
je 0x64315
movl %eax, 0xa4(%r15)
jmp 0x64315
movq %r15, %rbx
movq 0x98(%r15), %rax
movl 0x60(%rax), %edx
leaq 0xb8(%rsp), %r15
movq %r15, %rdi
movq (%rsp), %rsi
callq 0x4f560
movq (%r15), %rax
movq %rax, 0x60(%rbx)
movq 0x8(%r15), %rax
movq %rax, 0x68(%rbx)
movl $0x1, (%rbx)
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq