// File: /workspace/github_cpp_makefile_star2_O3/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 $0xb8, %rsp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbp
movq (%rsi), %rax
movq 0x18(%rax), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
leaq 0x10(%rbp), %r14
movq 0x10(%rbp), %rdx
movq 0x18(%rbp), %rcx
cmpq %rcx, %rdx
je 0x779ab
movl %eax, 0xc(%rsp)
movq %rdx, 0x28(%rsp)
movq %r14, 0x18(%rsp)
movq %rcx, 0x20(%rsp)
leaq -0x58(%rcx), %rbx
movq %r15, %rdi
callq 0x41f40
movq 0x8(%rax), %rdi
cmpq 0x2b6ca(%rip), %rdi     # 0xa2d20
je 0x7766d
cmpb $0x2a, (%rdi)
je 0x77683
movq 0x2b6bc(%rip), %rsi     # 0xa2d20
callq 0x41370
testl %eax, %eax
jne 0x77683
movq 0x18(%rsp), %rax
movq (%rax), %r13
movq 0x30(%r13), %rax
cmpq 0x38(%r13), %rax
je 0x77b5f
movq %rbx, 0x50(%rsp)
movq 0x10(%rbp), %rax
movabsq $0x2e8ba2e8ba2e8ba3, %rbx # imm = 0x2E8BA2E8BA2E8BA3
movq %rbp, 0x10(%rsp)
cmpq %rax, 0x18(%rbp)
movq 0x18(%rsp), %r13
je 0x7781e
xorl %ebp, %ebp
xorl %r14d, %r14d
movq %r12, 0xb0(%rsp)
movq (%rax,%rbp), %rax
cmpq 0x8(%r12), %rax
jne 0x777b5
movq %r15, %rdi
callq 0x41f40
movq 0x8(%rax), %rdi
cmpq 0x2b737(%rip), %rdi     # 0xa2e10
je 0x776f8
cmpb $0x2a, (%rdi)
je 0x777b5
movq 0x2b725(%rip), %rsi     # 0xa2e10
callq 0x41370
testl %eax, %eax
jne 0x777b5
movq %r15, %rdi
movq %rbx, %r12
movq (%r13), %rbx
callq 0x3ff50
testq %rax, %rax
je 0x77dfd
leaq 0x68(%rsp), %rcx
movq %rcx, 0x58(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %rdi
callq 0x3f8e0
movq 0x18(%rbx,%rbp), %rdx
cmpq 0x60(%rsp), %rdx
jne 0x77758
movq 0x58(%rsp), %r13
testq %rdx, %rdx
je 0x77761
movq 0x10(%rbx,%rbp), %rdi
movq %r13, %rsi
callq 0x408c0
testl %eax, %eax
sete %bl
jmp 0x77763
movq 0x58(%rsp), %r13
xorl %ebx, %ebx
jmp 0x77763
movb $0x1, %bl
leaq 0x68(%rsp), %rax
cmpq %rax, %r13
je 0x7777d
movq 0x68(%rsp), %rsi
incq %rsi
movq %r13, %rdi
callq 0x40880
movq 0x18(%rsp), %r13
movq (%r13), %rax
testb %bl, %bl
jne 0x77d3b
leaq (%rax,%rbp), %rdi
addq $0x10, %rdi
leaq 0x9a53(%rip), %rsi      # 0x811f0
callq 0x3f590
testl %eax, %eax
movq %r12, %rbx
movq 0xb0(%rsp), %r12
je 0x77d4c
movq (%r13), %rax
movq (%rax,%rbp), %rax
cmpq 0x8(%r12), %rax
jne 0x777f6
movq %r15, %rdi
callq 0x41f40
movq 0x8(%rax), %rdi
cmpq 0x2b549(%rip), %rdi     # 0xa2d20
je 0x77c01
cmpb $0x2a, (%rdi)
je 0x777f6
movq 0x2b537(%rip), %rsi     # 0xa2d20
callq 0x41370
testl %eax, %eax
je 0x77c01
incq %r14
movq 0x10(%rsp), %rcx
movq 0x10(%rcx), %rax
movq 0x18(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
imulq %rbx, %rcx
addq $0x58, %rbp
cmpq %rcx, %r14
jne 0x776b7
leaq 0x78(%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)
movq 0x8(%r12), %rcx
movq %rcx, -0x20(%rax)
movslq 0xc(%rsp), %rcx
movq %rcx, -0x18(%rax)
movq %r15, %rdi
callq 0x41f40
movq 0x8(%rax), %rdi
cmpq 0x2b5ac(%rip), %rdi     # 0xa2e10
movq 0x10(%rsp), %rbp
je 0x77880
cmpb $0x2a, (%rdi)
je 0x778e1
movq 0x2b599(%rip), %rsi     # 0xa2e10
callq 0x41370
testl %eax, %eax
jne 0x778e1
movq %r15, %rdi
callq 0x3ff50
testq %rax, %rax
je 0x77e0c
movq %rbx, %r14
leaq 0x40(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0x3f8e0
leaq 0x68(%rsp), %rdi
leaq 0x30(%rsp), %r13
movq %r13, %rsi
callq 0x40db0
movq (%r13), %rdi
cmpq %rbx, %rdi
je 0x778d9
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x40880
movq 0x18(%rsp), %r13
movq %r14, %rbx
movq %r15, %rdi
callq 0x41f40
movq 0x8(%rax), %rdi
cmpq 0x2b42c(%rip), %rdi     # 0xa2d20
je 0x7790b
cmpb $0x2a, (%rdi)
je 0x77951
movq 0x2b41e(%rip), %rsi     # 0xa2d20
callq 0x41370
testl %eax, %eax
jne 0x77951
movq %r15, %rdi
callq 0x41220
testq %rax, %rax
je 0x77e11
xorps %xmm0, %xmm0
leaq 0x30(%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 0x41010
leaq 0x88(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x423e0
movq 0x10(%rbp), %r14
movq 0x18(%rbp), %rcx
movq 0x8(%r12), %rax
subq %r14, %rcx
movq %r14, %r15
testq %rcx, %rcx
jle 0x77999
shrq $0x3, %rcx
imulq %rbx, %rcx
movq %r14, %r15
movq %rcx, %rdx
shrq %rdx
imulq $0x58, %rdx, %rsi
cmpq %rax, (%r15,%rsi)
jae 0x77991
notq %rdx
addq %rcx, %rdx
addq %rsi, %r15
addq $0x58, %r15
movq %rdx, %rcx
testq %rdx, %rdx
jg 0x77977
cmpq %rax, (%r15)
jne 0x77aea
movq %r15, 0x28(%rbp)
jmp 0x77dcb
leaq 0x78(%rsp), %rdx
movq %rdx, -0x10(%rdx)
xorl %ecx, %ecx
movq %rcx, -0x8(%rdx)
movb $0x0, (%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdx)
movups %xmm0, 0x20(%rdx)
movq %rcx, 0x30(%rdx)
movslq %eax, %rcx
movq %rcx, -0x18(%rdx)
movq 0x8(%r12), %rcx
movq %rcx, -0x20(%rdx)
movq %r15, %rdi
callq 0x41f40
movq 0x8(%rax), %rdi
cmpq 0x2b421(%rip), %rdi     # 0xa2e10
je 0x77a06
cmpb $0x2a, (%rdi)
je 0x77a5c
movq 0x2b413(%rip), %rsi     # 0xa2e10
callq 0x41370
testl %eax, %eax
jne 0x77a5c
movq %r15, %rdi
callq 0x3ff50
testq %rax, %rax
je 0x77e02
leaq 0x40(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0x3f8e0
leaq 0x68(%rsp), %rdi
leaq 0x30(%rsp), %r12
movq %r12, %rsi
callq 0x40db0
movq (%r12), %rdi
cmpq %rbx, %rdi
je 0x77a5c
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x40880
movq %r15, %rdi
callq 0x41f40
movq 0x8(%rax), %rdi
cmpq 0x2b2b1(%rip), %rdi     # 0xa2d20
je 0x77a86
cmpb $0x2a, (%rdi)
je 0x77acc
movq 0x2b2a3(%rip), %rsi     # 0xa2d20
callq 0x41370
testl %eax, %eax
jne 0x77acc
movq %r15, %rdi
callq 0x41220
testq %rax, %rax
je 0x77e07
xorps %xmm0, %xmm0
leaq 0x30(%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 0x41010
leaq 0x88(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x423e0
leaq 0x58(%rsp), %rsi
movq %r14, %rdi
callq 0x41fc0
movq 0x18(%rbp), %rax
addq $-0x58, %rax
movq %rax, 0x28(%rbp)
jmp 0x77dcb
leaq 0x58(%rsp), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x41190
subq %r14, %r15
movq 0x10(%rbp), %rcx
leaq (%rcx,%r15), %rax
testq %r15, %r15
leaq -0x58(%rcx,%r15), %rsi
cmovleq %rax, %rsi
movq 0x18(%rbp), %rdx
movq %rsi, 0x28(%rbp)
movq 0x30(%rbp), %rax
testq %rax, %rax
je 0x77c7b
movq 0x28(%rsp), %rdi
movq %rdi, %rsi
xorq %rcx, %rsi
movq 0x20(%rsp), %r8
xorq %rdx, %r8
orq %rsi, %r8
je 0x77dc7
subq %rdi, %rcx
subq 0x50(%rsp), %rdx
addq $-0x58, %rdx
cmpq %rdx, %rcx
jbe 0x77dc4
addq %rcx, %rax
jmp 0x77dc7
movq %r15, %rdi
callq 0x41220
testq %rax, %rax
je 0x77dfd
addq $0x30, %r13
xorps %xmm0, %xmm0
leaq 0x58(%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 0x41010
movq %r13, %rdi
movq %r14, %rsi
callq 0x423e0
movslq 0xc(%rsp), %rax
movq 0x10(%rbp), %rcx
movq %rax, 0x8(%rcx)
movq %rcx, 0x28(%rbp)
movq 0x30(%rbp), %rax
testq %rax, %rax
je 0x77c82
movq 0x18(%rbp), %rdx
movq 0x28(%rsp), %rdi
movq %rdi, %rsi
xorq %rcx, %rsi
movq 0x20(%rsp), %r8
xorq %rdx, %r8
orq %rsi, %r8
je 0x77dea
subq %rdi, %rcx
subq %rbx, %rdx
addq $-0x58, %rdx
cmpq %rdx, %rcx
jbe 0x77de7
addq %rcx, %rax
jmp 0x77dea
movq %r15, %rdi
callq 0x41220
testq %rax, %rax
je 0x77dfd
xorps %xmm0, %xmm0
leaq 0x58(%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 0x41010
movq (%r13), %rax
movq 0x30(%rax,%rbp), %rdi
movq 0x38(%rax,%rbp), %rsi
movq %r12, %rdx
callq 0x42490
movq (%r13), %rbx
cmpq 0x38(%rbx,%rbp), %rax
je 0x77c89
leaq 0x58(%rsp), %rdi
callq 0x3f120
movq 0x10(%rsp), %rax
addq 0x10(%rax), %rbp
movq %rbp, 0x28(%rax)
jmp 0x77dd5
xorl %eax, %eax
jmp 0x77dc7
xorl %eax, %eax
jmp 0x77dea
movq %r15, %rdi
callq 0x41220
testq %rax, %rax
je 0x77dfd
leaq (%rbx,%rbp), %r14
addq $0x30, %r14
xorps %xmm0, %xmm0
leaq 0x30(%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 0x41010
movq %r14, %rdi
movq %r15, %rsi
callq 0x423e0
movslq 0xc(%rsp), %rax
movq 0x10(%rsp), %rdi
movq 0x10(%rdi), %rcx
leaq (%rcx,%rbp), %rdx
movq %rax, 0x8(%rcx,%rbp)
movq %rdx, 0x28(%rdi)
movq 0x30(%rdi), %rax
testq %rax, %rax
je 0x77df0
movq 0x18(%rdi), %rdx
movq 0x28(%rsp), %r8
movq %r8, %rsi
xorq %rcx, %rsi
movq 0x20(%rsp), %r9
xorq %rdx, %r9
orq %rsi, %r9
je 0x77df7
subq %r8, %rcx
subq 0x50(%rsp), %rdx
addq $-0x58, %rdx
cmpq %rdx, %rcx
jbe 0x77df4
addq %rcx, %rax
jmp 0x77df7
addq %rbp, %rax
movq 0x10(%rsp), %rcx
movq %rax, 0x28(%rcx)
jmp 0x77dd5
movq %r15, %rdi
callq 0x3ff50
testq %rax, %rax
movl 0xc(%rsp), %ebx
je 0x77dfd
leaq 0x58(%rsp), %r15
leaq 0x68(%rsp), %r14
movq %r14, (%r15)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x3f8e0
movq (%r13), %rax
leaq (%rax,%rbp), %rdi
addq $0x10, %rdi
movq %r15, %rsi
callq 0x40db0
movq (%r15), %rdi
cmpq %r14, %rdi
je 0x77da9
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x40880
movslq %ebx, %rax
movq 0x10(%rsp), %rsi
movq 0x10(%rsi), %rcx
leaq (%rcx,%rbp), %rdx
movq %rax, 0x8(%rcx,%rbp)
movq %rdx, 0x28(%rsi)
jmp 0x77dd5
addq %rdx, %rax
movq %rax, 0x30(%rbp)
leaq 0x58(%rsp), %rdi
callq 0x3ffe0
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq %rdx, %rax
movq %rax, 0x30(%rbp)
jmp 0x77dd5
xorl %eax, %eax
jmp 0x77df7
addq %rdx, %rax
movq %rax, 0x30(%rdi)
jmp 0x77dd5
callq 0x40de0
callq 0x40de0
callq 0x40de0
callq 0x40de0
callq 0x40de0
jmp 0x77e45
jmp 0x77e45
jmp 0x77e45
jmp 0x77e45
jmp 0x77e45
jmp 0x77e45
jmp 0x77e30
jmp 0x77e45
jmp 0x77e45
jmp 0x77e30
jmp 0x77e30
jmp 0x77e30
jmp 0x77e30
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3ffe0
movq %rbx, %rdi
callq 0x41f10
movq %rax, %rdi
callq 0x47736
nop