// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/hutch.cpp
// Function: Hutch_Instructions::storeInstruction(Address const&, std::any)
void Hutch_Instructions::storeInstruction (Address const& addr, any insn)
{
    auto len = addr.getSpace ()->getTrans ()->instructionLength (addr);

    // Keep track of vector relocations for Hutch_Instructions::mark.
    auto ofront = (!instructions.empty ()) ? instructions.data () : 0;
    auto oback = (!instructions.empty ()) ?
                     instructions.data () + instructions.size () - 1 :
                     0;
    size_t fdiff, bdiff;

    // Do not need to track very initial run (when instructions.empty ())
    if (instructions.empty ()) {
        Instruction instr;
        instr.bytelength = len;
        instr.address = addr.getOffset ();
        if (insn.type () == typeid (string)) {
            instr.assembly = any_cast<string> (insn);
        }
        if (insn.type () == typeid (PcodeData)) {
            instr.pcode.push_back (any_cast<PcodeData> (insn));
        }
        instructions.push_back (instr);
        this->currentinsn = &instructions.back ();
        return;
    } else if ((insn.type () == typeid (PcodeData)) and
               (instructions.front ().pcode.empty ())) {
        instructions.front ().pcode.push_back (any_cast<PcodeData> (insn));
        instructions.front ().bytelength = len;
        this->currentinsn = &instructions.front ();

        // Move mark if vector instructions has moved.
        fdiff = instructions.data () - ofront;
        bdiff = (instructions.data () + instructions.size () - 1) - oback;
        mark = (mark != nullptr) ?
                     (fdiff != 0) || (bdiff != 0) ?
                     (fdiff > bdiff) ? mark + fdiff : mark + bdiff :
                     mark :
                     nullptr;
        return;
    }

    for (auto i = 0; i != instructions.size (); ++i) {
        if ((instructions[i].address == addr.getOffset ()) and
            (insn.type () == typeid (string))) {
            if (instructions[i].assembly == any_cast<string> (insn)) {
                this->currentinsn = &instructions[i];
                return;
            }
            if (instructions[i].assembly == "") {
                instructions[i].assembly = any_cast<string> (insn);
                instructions[i].bytelength = len;
                this->currentinsn = &instructions[i];
                return;
            }
        }
        if ((instructions[i].address == addr.getOffset ()) and
            (insn.type () == typeid (PcodeData))) {
            auto pcode = any_cast<PcodeData> (insn);
            if (find (instructions[i].pcode.begin (),
                      instructions[i].pcode.end (),
                      pcode) != instructions[i].pcode.end ()) {
                pcode.release ();
                this->currentinsn = &instructions[i];
                return;
            } else {
                instructions[i].pcode.push_back (any_cast<PcodeData> (insn));
                instructions[i].bytelength = len;
                this->currentinsn = &instructions[i];
                // Move mark if vector instructions has moved.
                fdiff = instructions.data () - ofront;
                bdiff =
                    (instructions.data () + instructions.size () - 1) - oback;
                mark = (mark != nullptr) ?
                             (fdiff != 0) || (bdiff != 0) ?
                             (fdiff > bdiff) ? mark + fdiff : mark + bdiff :
                             mark :
                             nullptr;
                return;
            }
        }
    }

    Instruction instr;

    instr.address = addr.getOffset ();
    instr.bytelength = len;

    if (insn.type () == typeid (string))
        instr.assembly = any_cast<string> (insn);
    if (insn.type () == typeid (PcodeData))
        instr.pcode.push_back (any_cast<PcodeData> (insn));

    auto index = distance (
        instructions.begin (),
        lower_bound (instructions.begin (), instructions.end (),
                     addr.getOffset (),
                     [](const Instruction& lhs, const uintb& rhs) -> bool {
                         return lhs.address < rhs;
                     }));

    if (instructions[index].address != addr.getOffset ()) {
        instructions.insert (instructions.begin () + index, instr);
        if (index > 0)
            this->currentinsn = &instructions[index - 1];
        else
            this->currentinsn = &instructions[index];
        // Move mark if vector instructions has moved.
        fdiff = instructions.data () - ofront;
        bdiff = (instructions.data () + instructions.size () - 1) - oback;
        mark = (mark != nullptr) ?
                     (fdiff != 0) || (bdiff != 0) ?
                     (fdiff > bdiff) ? mark + fdiff : mark + bdiff :
                     mark :
                     nullptr;
        return;
    }
    this->currentinsn = &instructions[index];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %rbx
movq (%rsi), %rax
movq 0x18(%rax), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movl %eax, %ebp
leaq 0x10(%rbx), %r14
movq 0x10(%rbx), %r15
movq 0x18(%rbx), %rax
leaq -0x58(%rax), %rdx
xorl %ecx, %ecx
cmpq %rax, %r15
cmoveq %rcx, %r15
cmoveq %rcx, %rdx
movq %r13, 0x8(%rsp)
je 0x77d77
movq %rdx, 0x10(%rsp)
movq %r13, %rdi
callq 0x41f30
movq 0x8(%rax), %rdi
cmpq 0x2b2e9(%rip), %rdi     # 0xa2d20
je 0x77a4e
cmpb $0x2a, (%rdi)
je 0x77a5f
movq 0x2b2db(%rip), %rsi     # 0xa2d20
callq 0x41360
testl %eax, %eax
jne 0x77a5f
movq (%r14), %r13
movq 0x30(%r13), %rax
cmpq 0x38(%r13), %rax
je 0x77f28
movl %ebp, 0x4(%rsp)
movq %r15, 0x38(%rsp)
movq 0x10(%rbx), %rax
cmpq %rax, 0x18(%rbx)
movq 0x8(%rsp), %r15
je 0x77bdf
xorl %r13d, %r13d
xorl %ebp, %ebp
movq (%rax,%r13), %rax
cmpq 0x8(%r12), %rax
jne 0x77b72
movq %r15, %rdi
callq 0x41f30
movq 0x8(%rax), %rdi
cmpq 0x2b36e(%rip), %rdi     # 0xa2e10
je 0x77ac1
cmpb $0x2a, (%rdi)
je 0x77b72
movq 0x2b35c(%rip), %rsi     # 0xa2e10
callq 0x41360
testl %eax, %eax
jne 0x77b72
movq %r15, %rdi
movq %r14, %r15
movq (%r14), %r14
callq 0x3ff40
testq %rax, %rax
je 0x7817f
leaq 0x50(%rsp), %rcx
movq %rcx, 0x40(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x40(%rsp), %rdi
callq 0x3f8e0
movq 0x18(%r14,%r13), %rdx
cmpq 0x48(%rsp), %rdx
jne 0x77b1e
testq %rdx, %rdx
je 0x77b23
movq 0x40(%rsp), %rsi
movq 0x10(%r14,%r13), %rdi
callq 0x408b0
testl %eax, %eax
sete %r14b
jmp 0x77b26
xorl %r14d, %r14d
jmp 0x77b26
movb $0x1, %r14b
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x77b42
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x40870
movq (%r15), %rax
testb %r14b, %r14b
jne 0x780d5
leaq (%rax,%r13), %rdi
addq $0x10, %rdi
leaq 0x9693(%rip), %rsi      # 0x811f0
callq 0x3f590
testl %eax, %eax
movq %r15, %r14
movq 0x8(%rsp), %r15
je 0x780e1
movq (%r14), %rax
movq (%rax,%r13), %rax
cmpq 0x8(%r12), %rax
jne 0x77bb2
movq %r15, %rdi
callq 0x41f30
movq 0x8(%rax), %rdi
cmpq 0x2b18d(%rip), %rdi     # 0xa2d20
je 0x77fb2
cmpb $0x2a, (%rdi)
je 0x77bb2
movq 0x2b17b(%rip), %rsi     # 0xa2d20
callq 0x41360
testl %eax, %eax
je 0x77fb2
incq %rbp
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $0x2e8ba2e8ba2e8ba3, %rdx # imm = 0x2E8BA2E8BA2E8BA3
imulq %rdx, %rcx
addq $0x58, %r13
cmpq %rcx, %rbp
jne 0x77a80
xorl %eax, %eax
leaq 0x60(%rsp), %rcx
movq %rax, -0x18(%rcx)
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb $0x0, (%rcx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rcx)
movups %xmm0, 0x20(%rcx)
movq %rax, 0x30(%rcx)
movq 0x8(%r12), %rax
movq %rax, -0x20(%rcx)
movslq 0x4(%rsp), %rax
movq %rax, -0x18(%rcx)
movq %r15, %rdi
callq 0x41f30
movq 0x8(%rax), %rdi
cmpq 0x2b1e7(%rip), %rdi     # 0xa2e10
je 0x77c40
cmpb $0x2a, (%rdi)
je 0x77ca1
movq 0x2b1d9(%rip), %rsi     # 0xa2e10
callq 0x41360
testl %eax, %eax
jne 0x77ca1
movq %r15, %rdi
callq 0x3ff40
testq %rax, %rax
je 0x7818e
movq %r14, %r15
leaq 0x28(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x18(%rsp), %rdi
callq 0x3f8e0
leaq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %r13
movq %r13, %rsi
callq 0x40da0
movq (%r13), %rdi
cmpq %r14, %rdi
je 0x77c99
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x40870
movq %r15, %r14
movq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x41f30
movq 0x8(%rax), %rdi
cmpq 0x2b06c(%rip), %rdi     # 0xa2d20
je 0x77ccb
cmpb $0x2a, (%rdi)
je 0x77d0e
movq 0x2b05e(%rip), %rsi     # 0xa2d20
callq 0x41360
testl %eax, %eax
jne 0x77d0e
movq %r15, %rdi
callq 0x41210
testq %rax, %rax
je 0x78193
xorps %xmm0, %xmm0
leaq 0x18(%rsp), %rdi
movups %xmm0, 0x8(%rdi)
movl (%rax), %ecx
movl %ecx, (%rdi)
movl 0x18(%rax), %ecx
movl %ecx, 0x18(%rdi)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
callq 0x41000
leaq 0x70(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x423d0
movq 0x10(%rbx), %r13
movq 0x18(%rbx), %rcx
movq 0x8(%r12), %rax
subq %r13, %rcx
movq %r13, %r15
testq %rcx, %rcx
movq 0x38(%rsp), %r12
jle 0x77d65
shrq $0x3, %rcx
movabsq $0x2e8ba2e8ba2e8ba3, %rdx # imm = 0x2E8BA2E8BA2E8BA3
imulq %rdx, %rcx
movq %r13, %r15
movq %rcx, %rdx
shrq %rdx
imulq $0x58, %rdx, %rsi
cmpq %rax, (%r15,%rsi)
jae 0x77d5d
notq %rdx
addq %rcx, %rdx
addq %rsi, %r15
addq $0x58, %r15
movq %rdx, %rcx
testq %rdx, %rdx
jg 0x77d43
cmpq %rax, (%r15)
jne 0x77ebe
movq %r15, 0x28(%rbx)
jmp 0x7815a
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
xorl %ecx, %ecx
movq %rcx, -0x8(%rax)
movb $0x0, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movq %rcx, 0x30(%rax)
movslq %ebp, %rcx
movq %rcx, -0x18(%rax)
movq 0x8(%r12), %rcx
movq %rcx, -0x20(%rax)
movq %r13, %rdi
callq 0x41f30
movq 0x8(%rax), %rdi
cmpq 0x2b055(%rip), %rdi     # 0xa2e10
je 0x77dd2
cmpb $0x2a, (%rdi)
je 0x77e33
movq 0x2b047(%rip), %rsi     # 0xa2e10
callq 0x41360
testl %eax, %eax
jne 0x77e33
movq %r13, %rdi
callq 0x3ff40
testq %rax, %rax
je 0x78184
movq %r14, %r15
leaq 0x28(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x18(%rsp), %rdi
callq 0x3f8e0
leaq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %r12
movq %r12, %rsi
callq 0x40da0
movq (%r12), %rdi
cmpq %r14, %rdi
je 0x77e2b
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x40870
movq %r15, %r14
movq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0x41f30
movq 0x8(%rax), %rdi
cmpq 0x2aeda(%rip), %rdi     # 0xa2d20
je 0x77e5d
cmpb $0x2a, (%rdi)
je 0x77ea0
movq 0x2aecc(%rip), %rsi     # 0xa2d20
callq 0x41360
testl %eax, %eax
jne 0x77ea0
movq %r13, %rdi
callq 0x41210
testq %rax, %rax
je 0x78189
xorps %xmm0, %xmm0
leaq 0x18(%rsp), %rdi
movups %xmm0, 0x8(%rdi)
movl (%rax), %ecx
movl %ecx, (%rdi)
movl 0x18(%rax), %ecx
movl %ecx, 0x18(%rdi)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
callq 0x41000
leaq 0x70(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x423d0
leaq 0x40(%rsp), %rsi
movq %r14, %rdi
callq 0x41fb0
movq 0x18(%rbx), %rax
addq $-0x58, %rax
movq %rax, 0x28(%rbx)
jmp 0x7815a
leaq 0x40(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x41180
subq %r13, %r15
movq 0x10(%rbx), %rcx
leaq (%rcx,%r15), %rax
testq %r15, %r15
leaq -0x58(%rcx,%r15), %rsi
cmovleq %rax, %rsi
movq 0x18(%rbx), %rdx
movq %rsi, 0x28(%rbx)
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0x7802a
addq $-0x58, %rdx
cmpq %rcx, %r12
movq 0x10(%rsp), %rsi
jne 0x77f11
cmpq %rdx, %rsi
je 0x78156
subq %r12, %rcx
subq %rsi, %rdx
cmpq %rdx, %rcx
jbe 0x78153
addq %rcx, %rax
jmp 0x78156
movq 0x8(%rsp), %rdi
callq 0x41210
testq %rax, %rax
je 0x7817f
addq $0x30, %r13
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %r14
movups %xmm0, 0x8(%r14)
movl (%rax), %ecx
movl %ecx, (%r14)
movl 0x18(%rax), %ecx
movl %ecx, 0x18(%r14)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %r14, %rdi
callq 0x41000
movq %r13, %rdi
movq %r14, %rsi
callq 0x423d0
movslq %ebp, %rax
movq 0x10(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq %rcx, 0x28(%rbx)
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0x780ce
movq 0x18(%rbx), %rdx
addq $-0x58, %rdx
cmpq %rcx, %r15
movq 0x10(%rsp), %rsi
jne 0x77faa
cmpq %rdx, %rsi
je 0x78179
subq %r15, %rcx
jmp 0x780ba
movq %r15, %rdi
callq 0x41210
testq %rax, %rax
movq 0x38(%rsp), %rbp
je 0x7817f
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %r12
movups %xmm0, 0x8(%r12)
movl (%rax), %ecx
movl %ecx, (%r12)
movl 0x18(%rax), %ecx
movl %ecx, 0x18(%r12)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %r12, %rdi
callq 0x41000
movq (%r14), %rax
movq 0x30(%rax,%r13), %rdi
movq 0x38(%rax,%r13), %rsi
movq %r12, %rdx
callq 0x42480
movq (%r14), %r14
cmpq 0x38(%r14,%r13), %rax
je 0x78031
leaq 0x40(%rsp), %rdi
callq 0x3f120
addq 0x10(%rbx), %r13
movq %r13, 0x28(%rbx)
jmp 0x78164
xorl %eax, %eax
jmp 0x78156
movq %r15, %rdi
callq 0x41210
testq %rax, %rax
je 0x7817f
addq %r13, %r14
addq $0x30, %r14
xorps %xmm0, %xmm0
leaq 0x18(%rsp), %r15
movups %xmm0, 0x8(%r15)
movl (%rax), %ecx
movl %ecx, (%r15)
movl 0x18(%rax), %ecx
movl %ecx, 0x18(%r15)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %r15, %rdi
callq 0x41000
movq %r14, %rdi
movq %r15, %rsi
callq 0x423d0
movslq 0x4(%rsp), %rax
movq 0x10(%rbx), %rcx
leaq (%rcx,%r13), %rdx
movq %rax, 0x8(%rcx,%r13)
movq %rdx, 0x28(%rbx)
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0x780ce
movq 0x18(%rbx), %rdx
addq $-0x58, %rdx
cmpq %rcx, %rbp
movq 0x10(%rsp), %rsi
jne 0x780b7
cmpq %rdx, %rsi
je 0x78179
subq %rbp, %rcx
subq %rsi, %rdx
cmpq %rdx, %rcx
jbe 0x78176
addq %rcx, %rax
jmp 0x78179
xorl %eax, %eax
jmp 0x78179
addq %r13, %rax
movq %rax, 0x28(%rbx)
jmp 0x78164
movq %r15, %rdi
callq 0x3ff40
testq %rax, %rax
movl 0x4(%rsp), %ebp
je 0x7817f
leaq 0x40(%rsp), %r15
leaq 0x50(%rsp), %r12
movq %r12, (%r15)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x3f8e0
movq (%r14), %rax
leaq (%rax,%r13), %rdi
addq $0x10, %rdi
movq %r15, %rsi
callq 0x40da0
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x7813d
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x40870
movslq %ebp, %rax
movq 0x10(%rbx), %rcx
leaq (%rcx,%r13), %rdx
movq %rax, 0x8(%rcx,%r13)
movq %rdx, 0x28(%rbx)
jmp 0x78164
addq %rdx, %rax
movq %rax, 0x30(%rbx)
leaq 0x40(%rsp), %rdi
callq 0x3ffd0
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq %rdx, %rax
movq %rax, 0x30(%rbx)
jmp 0x78164
callq 0x40dd0
callq 0x40dd0
callq 0x40dd0
callq 0x40dd0
callq 0x40dd0
jmp 0x781c7
jmp 0x781c7
jmp 0x781c7
jmp 0x781c7
jmp 0x781c7
jmp 0x781c7
jmp 0x781b2
jmp 0x781c7
jmp 0x781c7
jmp 0x781b2
jmp 0x781b2
jmp 0x781b2
jmp 0x781b2
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x3ffd0
movq %rbx, %rdi
callq 0x41f00
movq %rax, %rdi
callq 0x477f0
nop