// File: /workspace/github_c_makefile_star2_O1/AK6DN[P]dec-utilities-for-pdp/d8tape/dasm.c
// Function: dasm8
void
dasm8 (int addr, unsigned short int buf)
{
    int     ind, cur;
    int     eff_addr;
    int     primary;                        // is primary disassembly 'c'ode or 'd'ata?

    if (optv > 1) {
        printf ("dasm8 (addr 0%04o word 0%04o tag 0x%04x)\n", addr, buf, tags [addr]);
    }

    eff_addr = ea (addr, buf, &ind, &cur);

    if (two_word) {
        printf ("\t%04o /\t\t\t\t\t / (operand)\n", buf);
        two_word = 0;
        return;
    }

    // prepare buffer areas for disassembly and comments.
    memset (disbuf, 0, sizeof (disbuf));
    memset (combuf, 0, sizeof (combuf));

    primary = 'c';                          // default to code disassembly

    if (tags [addr] & TAG_LABEL) {
        printf ("L%04o,\n", addr);
    }

    if (tags [addr] & TAG_SUB) {
        printf ("\n");
        printf ("////////////////////////////////////////////////////////////////////////////////\n");
        printf ("/\n");
        printf ("/\tSUBROUTINE:  S%04o\n", addr);
        printf ("/\n");
        xrefs (addr);
        printf ("////////////////////////////////////////////////////////////////////////////////\n");
        printf ("S%04o,\n", addr);
        printf ("\t0\t\t\t\t\t\t/ return area\n");
        // done; can't be SUB and anything else (except label, perhaps)
        return;
    }

    if (tags [addr] & TAG_DATA) {
        // if it's data, set primary as data
        primary = 'd';
        if ((addr & 07770) == 00010) {  // addresses 0010 -> 0017 are autoindex
            printf ("AI%o,\t%04o\t\t\t\t/ AUTO-INDEX REGISTER", addr & 7, core [addr]);
        } else {
            if (tags [addr] & TAG_INDIRECTFC) {
                printf ("C%04o,\n", addr);
            }
            printf ("%c%04o,\t", tags [addr] & TAG_KONSTANT ? 'K' : tags [addr] & TAG_WRITABLE ? 'D' : 'C', tags [addr] & TAG_KONSTANT ? core [addr] : addr);
            printf ("%04o\t\t\t\t/", core [addr]);
        }
    }

    switch (buf & 07000) {
    case    00000:          // AND
    case    01000:          // TAD
    case    02000:          // ISZ
    case    03000:          // DCA
    case    04000:          // JMS
    case    05000:          // JMP
        sprintf (disbuf, "%s ", codes [buf >> 9]);

        if (ind) {
            strcat (disbuf, "I ");
        } else {
            strcat (disbuf, "  ");
        }

        if (tags [eff_addr] & TAG_SUB) {
            strcat (disbuf, "S");
        } else if (tags [eff_addr] & TAG_LABEL) {
            strcat (disbuf, "L");
        } else {
            if ((eff_addr & 07770) == 00010) {  // addresses 0010 -> 0017
                strcat (disbuf, "AI");
                strcat (combuf, "AUTO INDEX REGISTER");
            } else {
                strcat (disbuf, (tags [eff_addr] & TAG_KONSTANT) ? "K" : tags [eff_addr] & TAG_WRITABLE ? "D" : "C");
            }
        }

        if (tags [addr] & TAG_RETURN) {
            strcat (combuf, "return ");
        } else {
            // comment indirect flow control change to reflect ultimate target
            switch (buf & 07400) {
            case    04400:
                sprintf (combuf + strlen (combuf), "long call to S%04o ", core [eff_addr]);
                break;
            case    05400:
                sprintf (combuf + strlen (combuf), "long jump to L%04o ", core [eff_addr]);
                break;
            }
        }

        if ((eff_addr & 07770) == 00010) {      // address 0010 -> 0017
            sprintf (disbuf + strlen (disbuf), "%o ", eff_addr & 7);
        } else {
            sprintf (disbuf + strlen (disbuf), "%04o ", (tags [eff_addr] & TAG_KONSTANT) ? core [eff_addr] : eff_addr);
        }

        break;

    case    06000:          // IOT
        fetch_iot (buf, disbuf, combuf);
        break;

    case    07000:          // OPR
        // perform "short form" OPRs here first...
        switch (buf) {
            case    07000: sprintf (disbuf, "NOP");                                                                     break;
#ifdef DNN1
//          case    07002: sprintf (disbuf, "BSW");                                                                     break;
            case    07600: sprintf (disbuf, "7600");                                                                    break;
#endif // DNN1
#ifdef DNN2
            case    07400: sprintf (disbuf, "7400");                                                                    break;
            case    07401: sprintf (disbuf, "7401");                                                                    break;
            case    07601: sprintf (disbuf, "7601");                                                                    break;
#endif // DNN2
            case    07041: sprintf (disbuf, "CIA");                                                                     break;
            case    07120: sprintf (disbuf, "STL");                                                                     break;
            case    07204: sprintf (disbuf, "GLK");                                                                     break;
            case    07240: sprintf (disbuf, "STA");                 strcat (combuf, "AC = 7777 (-0001)");               break;
            case    07300: sprintf (disbuf, "CLA CLL");             strcat (combuf, "AC = 0000");                       break;
            case    07301: sprintf (disbuf, "CLA CLL IAC");         strcat (combuf, "AC = 0001");                       break;
            case    07303: sprintf (disbuf, "CLA CLL IAC BSW");     strcat (combuf, "AC = 0100 (64)");                  break;
            case    07305: sprintf (disbuf, "CLA CLL IAC RAL");     strcat (combuf, "AC = 0002");                       break;
            case    07325: sprintf (disbuf, "CLA CLL CML IAC RAL"); strcat (combuf, "AC = 0003");                       break;
            case    07326: sprintf (disbuf, "CLA CLL CML RTL");     strcat (combuf, "AC = 0002");                       break;
            case    07307: sprintf (disbuf, "CLA CLL IAC RTL");     strcat (combuf, "AC = 0004");                       break;
            case    07327: sprintf (disbuf, "CLA CLL CML IAC RTL"); strcat (combuf, "AC = 0006");                       break;
            case    07330: sprintf (disbuf, "CLA CLL CML RAR");     strcat (combuf, "AC = 4000 (-4000 = -2048 dec)");   break;
            case    07332: sprintf (disbuf, "CLA CLL CML RTR");     strcat (combuf, "AC = 2000 (1024)");                break;
            case    07333: sprintf (disbuf, "CLA CLL CML IAC RTL"); strcat (combuf, "AC = 6000 (-2000 = -1024 dec)");   break;
            case    07340: sprintf (disbuf, "CLA CLL CMA");         strcat (combuf, "AC = 7777 (-0001)");               break;
            case    07344: sprintf (disbuf, "CLA CLL CMA RAL");     strcat (combuf, "AC = 7776 (-0002)");               break;
            case    07346: sprintf (disbuf, "CLA CLL CMA RTL");     strcat (combuf, "AC = 7775 (-0003)");               break;
            case    07350: sprintf (disbuf, "CLA CLL CMA RAR");     strcat (combuf, "AC = 3777 (2047)");                break;
            case    07352: sprintf (disbuf, "CLA CLL CMA RTR");     strcat (combuf, "AC = 5777 (-2001 = -1025 dec)");   break;
#ifndef DNN2
            case    07401: sprintf (disbuf, "NOP");                                                                     break;
#endif // !DNN1
            case    07410: sprintf (disbuf, "SKP");                                                                     break;
            case    07610: sprintf (disbuf, "SKP CLA");                                                                 break;
            case    07604: sprintf (disbuf, "LAS");                                                                     break;
            case    07621: sprintf (disbuf, "CAM");                                                                     break;
            default:

                // determine group (0401 is 0000/0001 for group 1, 0400 for group 2, 0401 for EAE)
                switch (buf & 00401) {
                case    00000:  // group 1
                case    00001:  // group 1
                    // sequence 1
                    if (buf & 00200) {
                        strcat (disbuf, "CLA ");
                    }
                    if (buf & 00100) {
                        strcat (disbuf, "CLL ");
                    }
                    // sequence 2
                    if (buf & 00040) {
                        strcat (disbuf, "CMA ");
                    }
                    if (buf & 00020) {
                        strcat (disbuf, "CML ");
                    }
                    // sequence 3
                    if (buf & 00001) {
                        strcat (disbuf, "IAC ");
                    }
                    // sequence 4
                    if (buf & 00010) {
                        if (buf & 00002) {
                            strcat (disbuf, "RTR ");
                        } else {
                            strcat (disbuf, "RAR ");
                        }
                    }
                    if (buf & 00004) {
                        if (buf & 00002) {
                            strcat (disbuf, "RTL ");
                        } else {
                            strcat (disbuf, "RAL ");
                        }
                    }
#ifdef DNN2
		    if ((buf & 00016) == 00002) {
			strcat (disbuf, "BSW ");
		    }
#endif // DNN2
                    break;

                case    00400:  // group 2
                    // sequence 1
                    if (buf & 00100) {
                        if (buf & 00010) {
                            strcat (disbuf, "SPA ");
                        } else {
                            strcat (disbuf, "SMA ");
                        }
                    }
                    if (buf & 00040) {
                        if (buf & 00010) {
                            strcat (disbuf, "SNA ");
                        } else {
                            strcat (disbuf, "SZA ");
                        }
                    }
                    if (buf & 00020) {
                        if (buf & 00010) {
                            strcat (disbuf, "SZL ");
                        } else {
                            strcat (disbuf, "SNL ");
                        }
                    }
#ifdef DNN2
		    if ((buf & 00170) == 00010) {
			strcat (disbuf, "SKP ");
		    }
#endif // DNN2
                    // sequence 2
                    if (buf & 00200) {
                        strcat (disbuf, "CLA ");
                    }
                    // sequence 3
                    if (buf & 00004) {
                        strcat (disbuf, "OSR ");
                    }
                    if (buf & 00002) {
                        strcat (disbuf, "HLT ");
                    }
                    break;
                case    00401:  // EAE
                    // sequence 1
                    if (buf & 00200) {
                        strcat (disbuf, "CLA ");
                    }
                    // sequence 2
                    if (buf & 00100) {
                        strcat (disbuf, "MQA ");
                    }
                    if (buf & 00040) {
                        strcat (disbuf, "SCA ");
                    }
                    if (buf & 00020) {
                        strcat (disbuf, "MQL ");
                    }
                    // sequence 3
                    switch (buf & 00016) {
                    case    0:      // no further ops, done
                        break;
                    case    002:
                        strcat (disbuf, "SCL ");
                        two_word = buf;
                        break;
                    case    004:
                        strcat (disbuf, "MUY ");
                        two_word = buf;
                        break;
                    case    006:
                        strcat (disbuf, "DVI ");
                        two_word = buf;
                        break;
                    case    010:
                        strcat (disbuf, "NMI");
                        break;
                    case    012:
                        strcat (disbuf, "SHL ");
                        two_word = buf;
                        break;
                    case    014:
                        strcat (disbuf, "ASR ");
                        two_word = buf;
                        break;
                    case    016:
                        strcat (disbuf, "LSR ");
                        two_word = buf;
                        break;
                    }
                    break;
                }
                break;
        }
        break;
    }
    if (two_word) {
        strcat (disbuf, "+");
    }
    // trim any trailing spaces
    while (*disbuf && disbuf [strlen (disbuf) - 1] == ' ') {
        disbuf [strlen (disbuf) - 1] = 0;
    }

    if (primary == 'c') {               // if primary is code, then spill data too
        pad (disbuf, 0, COMSTART - 4);  // add tabs to get disassembly to comment start (one tab less because we print it next)
        printf ("\t%s", disbuf);        // print disassembly so far
        printf ("/ ");                  // print comment start
        pad (combuf, 2, DATASTART);     // pad comment buffer to get to data area
        printf ("%s@@%04o=%04o\n", combuf, addr, buf);  // print comment, address and opcode
    } else {                            // else we've already spilled both, just terminate the line
        pad (disbuf, 2, DATASTART);
        printf (" %s", disbuf);
        printf ("\n");
        two_word = 0;                   // we don't care that it's a two-word when we're printing it as data
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movl %edi, %ebx
leaq 0x8a7f(%rip), %rax      # 0xcf30
cmpl $0x2, (%rax)
movzwl %bp, %r14d
jl 0x44d9
movslq %ebx, %rsi
leaq 0xaa7c(%rip), %rax      # 0xef40
movzwl (%rax,%rsi,2), %ecx
leaq 0x50fb(%rip), %rdi      # 0x95ca
movl %r14d, %edx
xorl %eax, %eax
callq 0x30c0
cmpl $0xbff, %r14d           # imm = 0xBFF
jbe 0x44ea
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x450a
movsbl %r14b, %r15d
andl %ebx, %r15d
movl %r14d, %eax
andl $0x7f, %eax
andl $0xf80, %r15d           # imm = 0xF80
orl %eax, %r15d
btl $0x8, %r14d
setae %r12b
cmpw $0x0, 0xca4e(%rip)      # 0x10f60
je 0x453d
leaq 0x50d9(%rip), %rdi      # 0x95f4
movl %r14d, %esi
xorl %eax, %eax
callq 0x30c0
movw $0x0, 0xca32(%rip)      # 0x10f60
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorps %xmm0, %xmm0
movaps %xmm0, 0xca29(%rip)     # 0x10f70
xorl %eax, %eax
movq %rax, 0xca30(%rip)      # 0x10f80
movaps %xmm0, 0xca39(%rip)     # 0x10f90
movaps %xmm0, 0xca42(%rip)     # 0x10fa0
movq %rax, 0xca49(%rip)      # 0x10fae
movl %ebx, 0x8(%rsp)
movslq %ebx, %r13
leaq 0xa9cd(%rip), %rbx      # 0xef40
testb $0x4, (%rbx,%r13,2)
je 0x458c
leaq 0x508d(%rip), %rdi      # 0x960e
movl 0x8(%rsp), %esi
xorl %eax, %eax
callq 0x30c0
movzwl (%rbx,%r13,2), %eax
testb $0x2, %al
jne 0x45d7
movl %eax, 0xc(%rsp)
testb $0x1, %al
je 0x4827
movl 0x8(%rsp), %esi
movl %esi, %eax
andl $0xff8, %eax            # imm = 0xFF8
cmpl $0x8, %eax
jne 0x47b9
andl $0x7, %esi
leaq 0x8981(%rip), %rax      # 0xcf40
movswl (%rax,%r13,2), %edx
leaq 0x5069(%rip), %rdi      # 0x9634
xorl %eax, %eax
callq 0x30c0
jmp 0x4827
movl $0xa, %edi
callq 0x3040
leaq 0x568e(%rip), %rdi      # 0x9c76
callq 0x3090
leaq 0x507d(%rip), %r14      # 0x9671
movq %r14, %rdi
callq 0x3090
leaq 0x5013(%rip), %rdi      # 0x9616
movl 0x8(%rsp), %esi
xorl %eax, %eax
callq 0x30c0
movq %r14, %rdi
callq 0x3090
leaq 0x8923(%rip), %r14      # 0xcf40
leaq 0x508c(%rip), %r15      # 0x96b0
leaq 0x5430(%rip), %r12      # 0x9a5b
xorl %r13d, %r13d
xorl %ebp, %ebp
movzwl (%r14,%r13,2), %eax
testw %ax, %ax
js 0x4741
testb $0x1, (%rbx,%r13,2)
jne 0x4741
movl %eax, %ecx
andl $0xf00, %ecx            # imm = 0xF00
cmpl $0x900, %ecx            # imm = 0x900
je 0x46c5
cmpl $0x800, %ecx            # imm = 0x800
jne 0x4741
movswl %ax, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $0xbff, %edx            # imm = 0xBFF
jg 0x4686
movsbl %al, %ecx
andl %r13d, %ecx
andl $0x7f, %eax
andl $0xf80, %ecx            # imm = 0xF80
orl %eax, %ecx
cmpl 0x8(%rsp), %ecx
jne 0x4741
testl %ebp, %ebp
jne 0x46a2
leaq 0x53b2(%rip), %rdi      # 0x9a4d
xorl %eax, %eax
callq 0x30c0
movq %r15, %rdi
movl %r13d, %esi
xorl %eax, %eax
callq 0x30c0
imull $0xeeeeeeef, %ebp, %eax # imm = 0xEEEEEEEF
incl %ebp
addl $0xf7777777, %eax       # imm = 0xF7777777
cmpl $0x11111111, %eax       # imm = 0x11111111
jae 0x4741
jmp 0x4737
movswl %ax, %edx
movq $-0x1, %rcx
cmpl $0xbff, %edx            # imm = 0xBFF
jg 0x46e8
movsbl %al, %ecx
andl %r13d, %ecx
andl $0x7f, %eax
andl $0xf80, %ecx            # imm = 0xF80
orl %eax, %ecx
testb $0x1, 0x1(%rbx,%rcx,2)
jne 0x4741
movswl (%r14,%rcx,2), %eax
testl %eax, %eax
sets %cl
cmpl 0x8(%rsp), %eax
setne %al
orb %cl, %al
jne 0x4741
testl %ebp, %ebp
jne 0x4716
leaq 0x533e(%rip), %rdi      # 0x9a4d
xorl %eax, %eax
callq 0x30c0
movq %r15, %rdi
movl %r13d, %esi
xorl %eax, %eax
callq 0x30c0
imull $0xeeeeeeef, %ebp, %eax # imm = 0xEEEEEEEF
incl %ebp
addl $0xf7777777, %eax       # imm = 0xF7777777
cmpl $0x11111110, %eax       # imm = 0x11111110
ja 0x4741
movq %r12, %rdi
xorl %eax, %eax
callq 0x30c0
incq %r13
cmpq $0x1000, %r13           # imm = 0x1000
jne 0x4630
testl %ebp, %ebp
je 0x4773
movl $0xa, %edi
callq 0x3040
leaq 0x52f9(%rip), %rdi      # 0x9a5f
movl %ebp, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x30c0
jmp 0x477f
leaq 0x5314(%rip), %rdi      # 0x9a8e
callq 0x3090
movl 0x8(%rsp), %ebx
leaq 0x54ec(%rip), %rdi      # 0x9c76
callq 0x3090
leaq 0x4e96(%rip), %rdi      # 0x962c
movl %ebx, %esi
xorl %eax, %eax
callq 0x30c0
leaq 0x52d2(%rip), %rdi      # 0x9a78
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3090
btl $0xa, 0xc(%rsp)
jae 0x47d3
leaq 0x4e90(%rip), %rdi      # 0x9658
movl 0x8(%rsp), %esi
xorl %eax, %eax
callq 0x30c0
movzwl (%rbx,%r13,2), %eax
xorl %ecx, %ecx
btl $0x8, %eax
adcl $0x43, %ecx
btl $0x9, %eax
movl $0x4b, %esi
cmovael %ecx, %esi
movl 0x8(%rsp), %edx
jae 0x47ff
leaq 0x8746(%rip), %rax      # 0xcf40
movswl (%rax,%r13,2), %edx
leaq 0x4e5a(%rip), %rdi      # 0x9660
xorl %eax, %eax
callq 0x30c0
leaq 0x872c(%rip), %rax      # 0xcf40
movswl (%rax,%r13,2), %esi
leaq 0x4e49(%rip), %rdi      # 0x9669
xorl %eax, %eax
callq 0x30c0
movl %r14d, %eax
shrl $0x9, %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x6, %ecx
jae 0x4901
movl %eax, %eax
leaq 0x2260(%rip), %rcx      # 0x6aa4
movslq (%rcx,%rax,4), %rdx
addq %rcx, %rdx
leaq 0xc71e(%rip), %rbp      # 0x10f70
leaq 0x4e1a(%rip), %rsi      # 0x9673
movq %rbp, %rdi
xorl %eax, %eax
callq 0x31a0
movq %rbp, %rdi
callq 0x30b0
addq %rbp, %rax
testb $0x1, %r12b
je 0x487f
movb $0x0, 0x2(%rax)
movw $0x2020, (%rax)         # imm = 0x2020
jmp 0x4888
movb $0x0, 0x2(%rax)
movw $0x2049, (%rax)         # imm = 0x2049
movslq %r15d, %rax
movzwl (%rbx,%rax,2), %r12d
testb $0x2, %r12b
movq %rax, 0x10(%rsp)
jne 0x48ee
testb $0x4, %r12b
jne 0x491e
movl %r15d, %eax
andl $0xff8, %eax            # imm = 0xFF8
movq %rbp, %rdi
cmpl $0x8, %eax
jne 0x49b1
callq 0x30b0
movw $0x4941, (%rax,%rbp)    # imm = 0x4941
movb $0x0, 0x2(%rax,%rbp)
leaq 0xc6c4(%rip), %r12      # 0x10f90
movq %r12, %rdi
callq 0x30b0
movups 0x4d9f(%rip), %xmm0     # 0x967a
movups %xmm0, (%rax,%r12)
movl $0x524554, 0x10(%rax,%r12) # imm = 0x524554
jmp 0x49d2
movq %rbp, %rdi
callq 0x30b0
movw $0x53, (%rax,%rbp)
jmp 0x49d2
jne 0x4931
leaq 0xc666(%rip), %rsi      # 0x10f70
leaq 0xc67f(%rip), %rdx      # 0x10f90
movl %r14d, %edi
callq 0x54d1
jmp 0x4ac0
movq %rbp, %rdi
callq 0x30b0
movw $0x4c, (%rax,%rbp)
jmp 0x49d2
cmpl $0xed4, %r14d           # imm = 0xED4
movl 0x8(%rsp), %ebx
jle 0x4bc5
cmpl $0xf00, %r14d           # imm = 0xF00
jg 0x4c04
leal -0xed5(%r14), %eax
cmpl $0x15, %eax
ja 0x4d7b
leaq 0x2086(%rip), %rcx      # 0x69ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movups 0x4dc3(%rip), %xmm0     # 0x9739
movaps %xmm0, 0xc5f3(%rip)     # 0x10f70
movl $0x4c4152, 0xc5f9(%rip) # imm = 0x4C4152
leaq 0xc602(%rip), %r15      # 0x10f90
movq %r15, %rdi
callq 0x30b0
movabsq $0x303030203d204341, %rcx # imm = 0x303030203D204341
movq %rcx, (%rax,%r15)
movw $0x33, 0x8(%rax,%r15)
jmp 0x4ac4
callq 0x30b0
xorl %ecx, %ecx
btl $0x8, %r12d
adcw $0x43, %cx
btl $0x9, %r12d
movl $0x4b, %edx
cmovael %ecx, %edx
movw %dx, (%rax,%rbp)
testb $0x8, (%rbx,%r13,2)
jne 0x4a1a
movl %r14d, %eax
andl $0xf00, %eax            # imm = 0xF00
cmpl $0xb00, %eax            # imm = 0xB00
je 0x4a39
cmpl $0x900, %eax            # imm = 0x900
jne 0x4a6c
leaq 0xc59a(%rip), %r13      # 0x10f90
movq %r13, %rdi
callq 0x30b0
addq %rax, %r13
leaq 0x8538(%rip), %rax      # 0xcf40
movq 0x10(%rsp), %rcx
movswl (%rax,%rcx,2), %edx
leaq 0x4c76(%rip), %rsi      # 0x968e
jmp 0x4a62
leaq 0xc56f(%rip), %r13      # 0x10f90
movq %r13, %rdi
callq 0x30b0
movabsq $0x206e7275746572, %rcx # imm = 0x206E7275746572
movq %rcx, (%rax,%r13)
jmp 0x4a6c
leaq 0xc550(%rip), %r13      # 0x10f90
movq %r13, %rdi
callq 0x30b0
addq %rax, %r13
leaq 0x84ee(%rip), %rax      # 0xcf40
movq 0x10(%rsp), %rcx
movswl (%rax,%rcx,2), %edx
leaq 0x4c40(%rip), %rsi      # 0x96a2
movq %r13, %rdi
xorl %eax, %eax
callq 0x31a0
movl %r15d, %r12d
andl $0xff8, %r12d           # imm = 0xFF8
movq %rbp, %rdi
callq 0x30b0
addq %rbp, %rax
cmpl $0x8, %r12d
jne 0x4a94
andl $0x7, %r15d
leaq 0x4c24(%rip), %rsi      # 0x96b6
jmp 0x4ab3
movq 0x10(%rsp), %rdx
testb $0x2, 0x1(%rbx,%rdx,2)
je 0x4aac
leaq 0x8499(%rip), %rcx      # 0xcf40
movswl (%rcx,%rdx,2), %r15d
leaq 0x4bfd(%rip), %rsi      # 0x96b0
movq %rax, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x31a0
movl 0x8(%rsp), %ebx
cmpw $0x0, 0xc494(%rip)      # 0x10f60
je 0x4ae4
leaq 0xc49b(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movw $0x2b, (%rax,%r15)
cmpb $0x0, 0xc485(%rip)      # 0x10f70
je 0x4b13
leaq 0xc47c(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
cmpb $0x20, -0x1(%rax,%r15)
jne 0x4b13
movb $0x0, -0x1(%rax,%r15)
cmpb $0x0, 0xc45f(%rip)      # 0x10f70
jne 0x4af4
testb $0x1, 0xc(%rsp)
jne 0x4b8c
leaq 0xc44f(%rip), %r15      # 0x10f70
movq %r15, %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x5571
leaq 0x4e00(%rip), %rdi      # 0x9937
movq %r15, %rsi
xorl %eax, %eax
callq 0x30c0
leaq 0x4df3(%rip), %rdi      # 0x993b
xorl %eax, %eax
callq 0x30c0
leaq 0xc43a(%rip), %r15      # 0x10f90
movq %r15, %rdi
movl $0x2, %esi
movl $0x28, %edx
callq 0x5571
leaq 0x4dcf(%rip), %rdi      # 0x993e
movq %r15, %rsi
movl %ebx, %edx
movl %r14d, %ecx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x30c0
leaq 0xc3dd(%rip), %rbx      # 0x10f70
movq %rbx, %rdi
movl $0x2, %esi
movl $0x28, %edx
callq 0x5571
leaq 0x4da1(%rip), %rdi      # 0x994d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x30c0
movl $0xa, %edi
callq 0x3040
jmp 0x4525
cmpl $0xe83, %r14d           # imm = 0xE83
jg 0x4c47
cmpl $0xe00, %r14d           # imm = 0xE00
je 0x4cda
cmpl $0xe21, %r14d           # imm = 0xE21
je 0x4ccb
cmpl $0xe50, %r14d           # imm = 0xE50
jne 0x4d9a
movl $0x4c5453, 0xc371(%rip) # imm = 0x4C5453
jmp 0x4ac4
cmpl $0xf7f, %r14d           # imm = 0xF7F
jle 0x4ca2
leal -0xf80(%r14), %eax
cmpl $0x8, %eax
ja 0x4d12
leaq 0x1e1c(%rip), %rcx      # 0x6a44
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x0, 0xc33c(%rip)      # 0x10f74
movl $0x30303637, 0xc32e(%rip) # imm = 0x30303637
jmp 0x4ac4
leal -0xec0(%r14), %eax
cmpl $0x7, %eax
ja 0x4ce9
leaq 0x1d6e(%rip), %rcx      # 0x69cc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movabsq $0x4c4c4320414c43, %rax # imm = 0x4C4C4320414C43
movq %rax, 0xc2f8(%rip)      # 0x10f70
leaq 0xc311(%rip), %r15      # 0x10f90
movq %r15, %rdi
callq 0x30b0
movabsq $0x303030203d204341, %rcx # imm = 0x303030203D204341
movq %rcx, (%rax,%r15)
movw $0x30, 0x8(%rax,%r15)
jmp 0x4ac4
cmpl $0xf01, %r14d           # imm = 0xF01
je 0x4d65
cmpl $0xf08, %r14d           # imm = 0xF08
jne 0x4d9a
movl $0x504b53, 0xc2aa(%rip) # imm = 0x504B53
jmp 0x4ac4
movl $0x414943, 0xc29b(%rip) # imm = 0x414943
jmp 0x4ac4
movl $0x504f4e, 0xc28c(%rip) # imm = 0x504F4E
jmp 0x4ac4
cmpl $0xe84, %r14d           # imm = 0xE84
je 0x516b
cmpl $0xea0, %r14d           # imm = 0xEA0
jne 0x4d9a
movl $0x415453, 0xc263(%rip) # imm = 0x415453
jmp 0x4ede
cmpl $0xf91, %r14d           # imm = 0xF91
jne 0x4d9a
movl $0x4d4143, 0xc24b(%rip) # imm = 0x4D4143
jmp 0x4ac4
movl $0x53414c, 0xc23c(%rip) # imm = 0x53414C
jmp 0x4ac4
movb $0x0, 0xc234(%rip)      # 0x10f74
movl $0x31303637, 0xc226(%rip) # imm = 0x31303637
jmp 0x4ac4
movabsq $0x414c4320504b53, %rax # imm = 0x414C4320504B53
movq %rax, 0xc210(%rip)      # 0x10f70
jmp 0x4ac4
movb $0x0, 0xc208(%rip)      # 0x10f74
movl $0x31303437, 0xc1fa(%rip) # imm = 0x31303437
jmp 0x4ac4
cmpl $0xf00, %r14d           # imm = 0xF00
jne 0x4d9a
movb $0x0, 0xc1e9(%rip)      # 0x10f74
movl $0x30303437, 0xc1db(%rip) # imm = 0x30303437
jmp 0x4ac4
movl %r14d, %eax
andl $0x101, %eax            # imm = 0x101
cmpl $0x2, %eax
jae 0x517a
testb %r14b, %r14b
jns 0x4dcd
leaq 0xc1b9(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20414c43, (%rax,%r15) # imm = 0x20414C43
movb $0x0, 0x4(%rax,%r15)
testb $0x40, %r14b
je 0x4df0
leaq 0xc196(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x204c4c43, (%rax,%r15) # imm = 0x204C4C43
movb $0x0, 0x4(%rax,%r15)
testb $0x20, %r14b
je 0x4e13
leaq 0xc173(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20414d43, (%rax,%r15) # imm = 0x20414D43
movb $0x0, 0x4(%rax,%r15)
testb $0x10, %r14b
je 0x4e36
leaq 0xc150(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x204c4d43, (%rax,%r15) # imm = 0x204C4D43
movb $0x0, 0x4(%rax,%r15)
testb $0x1, %r14b
je 0x4e59
leaq 0xc12d(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20434149, (%rax,%r15) # imm = 0x20434149
movb $0x0, 0x4(%rax,%r15)
testb $0x8, %r14b
je 0x527d
leaq 0xc106(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
addq %r15, %rax
testb $0x2, %r14b
jne 0x5273
movb $0x0, 0x4(%rax)
movl $0x20524152, (%rax)     # imm = 0x20524152
jmp 0x527d
movups 0x49e8(%rip), %xmm0     # 0x987d
movaps %xmm0, 0xc0d4(%rip)     # 0x10f70
leaq 0xc0ed(%rip), %r15      # 0x10f90
movq %r15, %rdi
callq 0x30b0
movups 0x49db(%rip), %xmm0     # 0x988d
movups %xmm0, (%rax,%r15)
movups 0x49dd(%rip), %xmm0     # 0x989b
jmp 0x506c
movabsq $0x204c4c4320414c43, %rax # imm = 0x204C4C4320414C43
movq %rax, 0xc09c(%rip)      # 0x10f70
movl $0x414d43, 0xc09a(%rip) # imm = 0x414D43
leaq 0xc0ab(%rip), %r15      # 0x10f90
movq %r15, %rdi
callq 0x30b0
movups 0x47da(%rip), %xmm0     # 0x96ce
jmp 0x502a
movups 0x4857(%rip), %xmm0     # 0x9757
jmp 0x50f5
movups 0x492e(%rip), %xmm0     # 0x983a
movaps %xmm0, 0xc05d(%rip)     # 0x10f70
leaq 0xc076(%rip), %r15      # 0x10f90
movq %r15, %rdi
callq 0x30b0
movups 0x4921(%rip), %xmm0     # 0x984a
jmp 0x502a
movups 0x484c(%rip), %xmm0     # 0x9781
movaps %xmm0, 0xc034(%rip)     # 0x10f70
movl $0x4c5452, 0xc03a(%rip) # imm = 0x4C5452
leaq 0xc043(%rip), %r15      # 0x10f90
movq %r15, %rdi
callq 0x30b0
movabsq $0x303030203d204341, %rcx # imm = 0x303030203D204341
movq %rcx, (%rax,%r15)
movw $0x36, 0x8(%rax,%r15)
jmp 0x4ac4
movups 0x4856(%rip), %xmm0     # 0x97cd
movaps %xmm0, 0xbff2(%rip)     # 0x10f70
leaq 0xc00b(%rip), %r15      # 0x10f90
movq %r15, %rdi
callq 0x30b0
movups 0x4849(%rip), %xmm0     # 0x97dd
jmp 0x4fba
movups 0x48bf(%rip), %xmm0     # 0x985c
movaps %xmm0, 0xbfcc(%rip)     # 0x10f70
leaq 0xbfe5(%rip), %r15      # 0x10f90
movq %r15, %rdi
callq 0x30b0
movups 0x48b2(%rip), %xmm0     # 0x986c
movups %xmm0, (%rax,%r15)
movb $0x0, 0x10(%rax,%r15)
jmp 0x4ac4
movups 0x47b0(%rip), %xmm0     # 0x9781
movaps %xmm0, 0xbf98(%rip)     # 0x10f70
movl $0x4c5452, 0xbf9e(%rip) # imm = 0x4C5452
leaq 0xbfa7(%rip), %r15      # 0x10f90
movq %r15, %rdi
callq 0x30b0
movups 0x47f6(%rip), %xmm0     # 0x97ee
movups %xmm0, (%rax,%r15)
movups 0x47f8(%rip), %xmm0     # 0x97fc
jmp 0x506c
movups 0x480b(%rip), %xmm0     # 0x9818
movaps %xmm0, 0xbf5c(%rip)     # 0x10f70
leaq 0xbf75(%rip), %r15      # 0x10f90
movq %r15, %rdi
callq 0x30b0
movups 0x47fe(%rip), %xmm0     # 0x9828
movups %xmm0, (%rax,%r15)
movw $0x29, 0x10(%rax,%r15)
jmp 0x4ac4
movups 0x475c(%rip), %xmm0     # 0x979f
movaps %xmm0, 0xbf26(%rip)     # 0x10f70
leaq 0xbf3f(%rip), %r15      # 0x10f90
movq %r15, %rdi
callq 0x30b0
movups 0x474f(%rip), %xmm0     # 0x97af
movups %xmm0, (%rax,%r15)
movups 0x4751(%rip), %xmm0     # 0x97bd
movups %xmm0, 0xe(%rax,%r15)
jmp 0x4ac4
movups 0x4682(%rip), %xmm0     # 0x9700
movaps %xmm0, 0xbeeb(%rip)     # 0x10f70
leaq 0xbf04(%rip), %r15      # 0x10f90
movq %r15, %rdi
callq 0x30b0
movabsq $0x303130203d204341, %rcx # imm = 0x303130203D204341
movq %rcx, (%rax,%r15)
movabsq $0x29343628203030, %rcx # imm = 0x29343628203030
movq %rcx, 0x7(%rax,%r15)
jmp 0x4ac4
movups 0x46aa(%rip), %xmm0     # 0x9767
movaps %xmm0, 0xbeac(%rip)     # 0x10f70
leaq 0xbec5(%rip), %r15      # 0x10f90
movq %r15, %rdi
callq 0x30b0
movabsq $0x303030203d204341, %rcx # imm = 0x303030203D204341
movq %rcx, (%rax,%r15)
movw $0x34, 0x8(%rax,%r15)
jmp 0x4ac4
movups 0x462a(%rip), %xmm0     # 0x971f
movaps %xmm0, 0xbe74(%rip)     # 0x10f70
leaq 0xbe8d(%rip), %r15      # 0x10f90
movq %r15, %rdi
callq 0x30b0
movabsq $0x303030203d204341, %rcx # imm = 0x303030203D204341
movq %rcx, (%rax,%r15)
movw $0x32, 0x8(%rax,%r15)
jmp 0x4ac4
movabsq $0x204c4c4320414c43, %rax # imm = 0x204C4C4320414C43
movq %rax, 0xbe39(%rip)      # 0x10f70
movl $0x434149, 0xbe37(%rip) # imm = 0x434149
leaq 0xbe48(%rip), %r15      # 0x10f90
movq %r15, %rdi
callq 0x30b0
movabsq $0x303030203d204341, %rcx # imm = 0x303030203D204341
movq %rcx, (%rax,%r15)
movw $0x31, 0x8(%rax,%r15)
jmp 0x4ac4
movl $0x4b4c47, 0xbdfb(%rip) # imm = 0x4B4C47
jmp 0x4ac4
cmpl $0x100, %eax            # imm = 0x100
jne 0x51b6
testb $0x40, %r14b
je 0x52e6
leaq 0xbdde(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
addq %r15, %rax
testb $0x8, %r14b
jne 0x52dc
movb $0x0, 0x4(%rax)
movl $0x20414d53, (%rax)     # imm = 0x20414D53
jmp 0x52e6
testb %r14b, %r14b
jns 0x51d8
leaq 0xbdae(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20414c43, (%rax,%r15) # imm = 0x20414C43
movb $0x0, 0x4(%rax,%r15)
testb $0x40, %r14b
je 0x51fb
leaq 0xbd8b(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x2041514d, (%rax,%r15) # imm = 0x2041514D
movb $0x0, 0x4(%rax,%r15)
testb $0x20, %r14b
je 0x521e
leaq 0xbd68(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20414353, (%rax,%r15) # imm = 0x20414353
movb $0x0, 0x4(%rax,%r15)
testb $0x10, %r14b
je 0x5241
leaq 0xbd45(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x204c514d, (%rax,%r15) # imm = 0x204C514D
movb $0x0, 0x4(%rax,%r15)
movl %r14d, %eax
andl $0xe, %eax
leaq 0x181a(%rip), %rcx      # 0x6a68
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xbd12(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x204c4353, (%rax,%r15) # imm = 0x204C4353
jmp 0x5462
movb $0x0, 0x4(%rax)
movl $0x20525452, (%rax)     # imm = 0x20525452
testb $0x4, %r14b
je 0x52b1
leaq 0xbce6(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
addq %r15, %rax
testb $0x2, %r14b
jne 0x52a7
movb $0x0, 0x4(%rax)
movl $0x204c4152, (%rax)     # imm = 0x204C4152
jmp 0x52b1
movb $0x0, 0x4(%rax)
movl $0x204c5452, (%rax)     # imm = 0x204C5452
movl %r14d, %eax
andl $0xe, %eax
cmpl $0x2, %eax
jne 0x4ac4
leaq 0xbca9(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20575342, (%rax,%r15) # imm = 0x20575342
jmp 0x53dc
movb $0x0, 0x4(%rax)
movl $0x20415053, (%rax)     # imm = 0x20415053
testb $0x20, %r14b
je 0x531a
leaq 0xbc7d(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
addq %r15, %rax
testb $0x8, %r14b
jne 0x5310
movb $0x0, 0x4(%rax)
movl $0x20415a53, (%rax)     # imm = 0x20415A53
jmp 0x531a
movb $0x0, 0x4(%rax)
movl $0x20414e53, (%rax)     # imm = 0x20414E53
testb $0x10, %r14b
je 0x534e
leaq 0xbc49(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
addq %r15, %rax
testb $0x8, %r14b
jne 0x5344
movb $0x0, 0x4(%rax)
movl $0x204c4e53, (%rax)     # imm = 0x204C4E53
jmp 0x534e
movb $0x0, 0x4(%rax)
movl $0x204c5a53, (%rax)     # imm = 0x204C5A53
movl %r14d, %eax
andl $0x78, %eax
cmpl $0x8, %eax
jne 0x5376
leaq 0xbc10(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20504b53, (%rax,%r15) # imm = 0x20504B53
movb $0x0, 0x4(%rax,%r15)
testb %r14b, %r14b
jns 0x5398
leaq 0xbbee(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20414c43, (%rax,%r15) # imm = 0x20414C43
movb $0x0, 0x4(%rax,%r15)
testb $0x4, %r14b
je 0x53bb
leaq 0xbbcb(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x2052534f, (%rax,%r15) # imm = 0x2052534F
movb $0x0, 0x4(%rax,%r15)
testb $0x2, %r14b
je 0x4ac4
leaq 0xbba4(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20544c48, (%rax,%r15) # imm = 0x20544C48
movb $0x0, 0x4(%rax,%r15)
jmp 0x4ac4
leaq 0xbb82(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20495644, (%rax,%r15) # imm = 0x20495644
jmp 0x5462
leaq 0xbb69(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x2052534c, (%rax,%r15) # imm = 0x2052534C
jmp 0x5462
leaq 0xbb50(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x2059554d, (%rax,%r15) # imm = 0x2059554D
jmp 0x5462
leaq 0xbb37(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x204c4853, (%rax,%r15) # imm = 0x204C4853
jmp 0x5462
leaq 0xbb1e(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20525341, (%rax,%r15) # imm = 0x20525341
movb $0x0, 0x4(%rax,%r15)
movw %bp, 0xbaf1(%rip)       # 0x10f60
jmp 0x4ac4
leaq 0xbaf5(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x494d4e, (%rax,%r15)  # imm = 0x494D4E
jmp 0x4ac4