// File: /workspace/github_c_makefile_star2_O3/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, %r14d
movl %edi, %ebx
leaq 0x89fe(%rip), %rax      # 0xcf30
cmpl $0x2, (%rax)
movl %esi, %r13d
jl 0x4559
movslq %ebx, %rsi
leaq 0xa9fc(%rip), %rax      # 0xef40
movzwl (%rax,%rsi,2), %ecx
leaq 0x50bb(%rip), %rdi      # 0x960a
movl %r13d, %edx
xorl %eax, %eax
callq 0x30c0
movzwl %r14w, %r12d
cmpl $0xbff, %r12d           # imm = 0xBFF
jbe 0x456e
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x458e
movsbl %r13b, %r15d
andl %ebx, %r15d
movl %r14d, %eax
andl $0x7f, %eax
andl $0xf80, %r15d           # imm = 0xF80
orl %eax, %r15d
btl $0x8, %r14d
setae %bpl
cmpw $0x0, 0xc9ca(%rip)      # 0x10f60
je 0x45c1
leaq 0x5095(%rip), %rdi      # 0x9634
movl %r13d, %esi
xorl %eax, %eax
callq 0x30c0
movw $0x0, 0xc9ae(%rip)      # 0x10f60
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r13d, 0x8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xc9a0(%rip)     # 0x10f70
xorl %eax, %eax
movq %rax, 0xc9a7(%rip)      # 0x10f80
movaps %xmm0, 0xc9b0(%rip)     # 0x10f90
movaps %xmm0, 0xc9b9(%rip)     # 0x10fa0
movq %rax, 0xc9c0(%rip)      # 0x10fae
movl %ebx, 0x4(%rsp)
movslq %ebx, %r13
leaq 0xa944(%rip), %rbx      # 0xef40
movzwl (%rbx,%r13,2), %eax
testb $0x4, %al
je 0x461c
leaq 0x5042(%rip), %rdi      # 0x964e
movl 0x4(%rsp), %esi
xorl %eax, %eax
callq 0x30c0
movzwl (%rbx,%r13,2), %eax
movzwl %ax, %ecx
testb $0x2, %cl
jne 0x4668
movl %ecx, 0xc(%rsp)
testb $0x1, %cl
je 0x48b9
movl 0x4(%rsp), %esi
movl %esi, %ecx
andl $0xff8, %ecx            # imm = 0xFF8
cmpl $0x8, %ecx
jne 0x4842
andl $0x7, %esi
leaq 0x88f0(%rip), %rax      # 0xcf40
movswl (%rax,%r13,2), %edx
leaq 0x5018(%rip), %rdi      # 0x9674
xorl %eax, %eax
callq 0x30c0
jmp 0x48b9
movl $0xa, %edi
callq 0x3040
leaq 0x563d(%rip), %rdi      # 0x9cb6
callq 0x3090
leaq 0x502c(%rip), %r14      # 0x96b1
movq %r14, %rdi
callq 0x3090
leaq 0x4fc2(%rip), %rdi      # 0x9656
movl 0x4(%rsp), %esi
xorl %eax, %eax
callq 0x30c0
movq %r14, %rdi
callq 0x3090
leaq 0x8892(%rip), %r14      # 0xcf40
leaq 0x503b(%rip), %r15      # 0x96f0
leaq 0x53df(%rip), %r12      # 0x9a9b
xorl %r13d, %r13d
xorl %ebp, %ebp
movzwl (%r14,%r13,2), %eax
testw %ax, %ax
js 0x47ca
testb $0x1, (%rbx,%r13,2)
jne 0x47ca
movl %eax, %ecx
andl $0xf00, %ecx            # imm = 0xF00
cmpl $0x900, %ecx            # imm = 0x900
je 0x4752
cmpl $0x800, %ecx            # imm = 0x800
jne 0x47ca
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $0xbff, %eax            # imm = 0xBFF
ja 0x4713
movsbl %al, %ecx
andl %r13d, %ecx
andl $0x7f, %eax
andl $0xf80, %ecx            # imm = 0xF80
orl %eax, %ecx
cmpl 0x4(%rsp), %ecx
jne 0x47ca
testl %ebp, %ebp
jne 0x472f
leaq 0x5365(%rip), %rdi      # 0x9a8d
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 0x47ca
jmp 0x47c0
movq $-0x1, %rcx
cmpl $0xbff, %eax            # imm = 0xBFF
ja 0x4771
movsbl %al, %ecx
andl %r13d, %ecx
andl $0x7f, %eax
andl $0xf80, %ecx            # imm = 0xF80
orl %eax, %ecx
testb $0x1, 0x1(%rbx,%rcx,2)
jne 0x47ca
movswl (%r14,%rcx,2), %eax
testl %eax, %eax
sets %cl
cmpl 0x4(%rsp), %eax
setne %al
orb %cl, %al
jne 0x47ca
testl %ebp, %ebp
jne 0x479f
leaq 0x52f5(%rip), %rdi      # 0x9a8d
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 0x47ca
movq %r12, %rdi
xorl %eax, %eax
callq 0x30c0
incq %r13
cmpq $0x1000, %r13           # imm = 0x1000
jne 0x46c1
testl %ebp, %ebp
je 0x47fc
movl $0xa, %edi
callq 0x3040
leaq 0x52b0(%rip), %rdi      # 0x9a9f
movl %ebp, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x30c0
jmp 0x4808
leaq 0x52cb(%rip), %rdi      # 0x9ace
callq 0x3090
movl 0x4(%rsp), %ebx
leaq 0x54a3(%rip), %rdi      # 0x9cb6
callq 0x3090
leaq 0x4e4d(%rip), %rdi      # 0x966c
movl %ebx, %esi
xorl %eax, %eax
callq 0x30c0
leaq 0x5289(%rip), %rdi      # 0x9ab8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3090
movl 0xc(%rsp), %ecx
btl $0xa, %ecx
jae 0x4866
leaq 0x4e45(%rip), %rdi      # 0x9698
movl 0x4(%rsp), %esi
xorl %eax, %eax
callq 0x30c0
movzwl (%rbx,%r13,2), %eax
movzwl %ax, %ecx
xorl %edx, %edx
btl $0x8, %ecx
adcl $0x43, %edx
btl $0x9, %ecx
movl $0x4b, %esi
cmovael %edx, %esi
btl $0x9, %eax
movl 0x4(%rsp), %edx
jae 0x4891
leaq 0x86b4(%rip), %rax      # 0xcf40
movswl (%rax,%r13,2), %edx
leaq 0x4e08(%rip), %rdi      # 0x96a0
xorl %eax, %eax
callq 0x30c0
leaq 0x869a(%rip), %rax      # 0xcf40
movswl (%rax,%r13,2), %esi
leaq 0x4df7(%rip), %rdi      # 0x96a9
xorl %eax, %eax
callq 0x30c0
movl %r14d, %eax
shrl $0x9, %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x6, %ecx
jae 0x4997
movl %eax, %eax
leaq 0x220e(%rip), %rcx      # 0x6ae4
movslq (%rcx,%rax,4), %rdx
addq %rcx, %rdx
leaq 0xc68c(%rip), %r12      # 0x10f70
leaq 0x4dc8(%rip), %rsi      # 0x96b3
movq %r12, %rdi
xorl %eax, %eax
callq 0x31a0
movq %r12, %rdi
callq 0x30b0
addq %r12, %rax
testb $0x1, %bpl
je 0x4911
movb $0x0, 0x2(%rax)
movw $0x2020, (%rax)         # imm = 0x2020
jmp 0x491a
movb $0x0, 0x2(%rax)
movw $0x2049, (%rax)         # imm = 0x2049
movslq %r15d, %rax
movzwl (%rbx,%rax,2), %ebp
testb $0x2, %bpl
movq %rax, 0x10(%rsp)
jne 0x4983
testb $0x4, %bpl
jne 0x49b9
movl %r15d, %eax
andl $0xff8, %eax            # imm = 0xFF8
movq %r12, %rdi
cmpl $0x8, %eax
jne 0x4a53
callq 0x30b0
movw $0x4941, (%rax,%r12)    # imm = 0x4941
movb $0x0, 0x2(%rax,%r12)
leaq 0xc62d(%rip), %rbp      # 0x10f90
movq %rbp, %rdi
callq 0x30b0
movups 0x4d48(%rip), %xmm0     # 0x96ba
movups %xmm0, (%rax,%rbp)
movl $0x524554, 0x10(%rax,%rbp) # imm = 0x524554
jmp 0x4a73
movq %r12, %rdi
callq 0x30b0
movw $0x53, (%rax,%r12)
jmp 0x4a73
jne 0x49cd
leaq 0xc5d0(%rip), %rsi      # 0x10f70
leaq 0xc5e9(%rip), %rdx      # 0x10f90
movl 0x8(%rsp), %r13d
movl %r13d, %edi
callq 0x5586
jmp 0x4b70
movq %r12, %rdi
callq 0x30b0
movw $0x4c, (%rax,%r12)
jmp 0x4a73
cmpl $0xed4, %r12d           # imm = 0xED4
movl 0x4(%rsp), %ebx
movl 0x8(%rsp), %r13d
jle 0x4c79
cmpl $0xf00, %r12d           # imm = 0xF00
jg 0x4cb8
leal -0xed5(%r12), %eax
cmpl $0x15, %eax
ja 0x4e31
leaq 0x2024(%rip), %rcx      # 0x6a2c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movups 0x4d61(%rip), %xmm0     # 0x9779
movaps %xmm0, 0xc551(%rip)     # 0x10f70
movl $0x4c4152, 0xc557(%rip) # imm = 0x4C4152
leaq 0xc560(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movabsq $0x303030203d204341, %rcx # imm = 0x303030203D204341
movq %rcx, (%rax,%r14)
movw $0x33, 0x8(%rax,%r14)
jmp 0x4b74
callq 0x30b0
xorl %ecx, %ecx
btl $0x8, %ebp
adcw $0x43, %cx
btl $0x9, %ebp
movl $0x4b, %edx
cmovael %ecx, %edx
movw %dx, (%rax,%r12)
testb $0x8, (%rbx,%r13,2)
jne 0x4ac7
andl $0xf00, %r14d           # imm = 0xF00
cmpl $0xb00, %r14d           # imm = 0xB00
movl 0x8(%rsp), %r13d
je 0x4aeb
cmpl $0x900, %r14d           # imm = 0x900
jne 0x4b1e
leaq 0xc4ed(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
addq %rax, %r14
leaq 0x848b(%rip), %rax      # 0xcf40
movq 0x10(%rsp), %rcx
movswl (%rax,%rcx,2), %edx
leaq 0x4c09(%rip), %rsi      # 0x96ce
jmp 0x4b14
leaq 0xc4c2(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movabsq $0x206e7275746572, %rcx # imm = 0x206E7275746572
movq %rcx, (%rax,%r14)
movl 0x8(%rsp), %r13d
jmp 0x4b1e
leaq 0xc49e(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
addq %rax, %r14
leaq 0x843c(%rip), %rax      # 0xcf40
movq 0x10(%rsp), %rcx
movswl (%rax,%rcx,2), %edx
leaq 0x4bce(%rip), %rsi      # 0x96e2
movq %r14, %rdi
xorl %eax, %eax
callq 0x31a0
movl %r15d, %ebp
andl $0xff8, %ebp            # imm = 0xFF8
movq %r12, %rdi
callq 0x30b0
addq %r12, %rax
cmpl $0x8, %ebp
jne 0x4b44
andl $0x7, %r15d
leaq 0x4bb4(%rip), %rsi      # 0x96f6
jmp 0x4b63
movq 0x10(%rsp), %rdx
testb $0x2, 0x1(%rbx,%rdx,2)
je 0x4b5c
leaq 0x83e9(%rip), %rcx      # 0xcf40
movswl (%rcx,%rdx,2), %r15d
leaq 0x4b8d(%rip), %rsi      # 0x96f0
movq %rax, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x31a0
movl 0x4(%rsp), %ebx
movzwl 0xc3e4(%rip), %r14d     # 0x10f60
testw %r14w, %r14w
je 0x4b98
leaq 0xc3e7(%rip), %r14      # 0x10f70
movq %r14, %rdi
callq 0x30b0
movw $0x2b, (%rax,%r14)
cmpb $0x0, 0xc3d1(%rip)      # 0x10f70
je 0x4bc7
leaq 0xc3c8(%rip), %r14      # 0x10f70
movq %r14, %rdi
callq 0x30b0
cmpb $0x20, -0x1(%rax,%r14)
jne 0x4bc7
movb $0x0, -0x1(%rax,%r14)
cmpb $0x0, 0xc3ab(%rip)      # 0x10f70
jne 0x4ba8
testb $0x1, 0xc(%rsp)
jne 0x4c40
leaq 0xc39b(%rip), %r14      # 0x10f70
movq %r14, %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x5626
leaq 0x4d8c(%rip), %rdi      # 0x9977
movq %r14, %rsi
xorl %eax, %eax
callq 0x30c0
leaq 0x4d7f(%rip), %rdi      # 0x997b
xorl %eax, %eax
callq 0x30c0
leaq 0xc386(%rip), %r14      # 0x10f90
movq %r14, %rdi
movl $0x2, %esi
movl $0x28, %edx
callq 0x5626
leaq 0x4d5b(%rip), %rdi      # 0x997e
movq %r14, %rsi
movl %ebx, %edx
movl %r13d, %ecx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x30c0
leaq 0xc329(%rip), %rbx      # 0x10f70
movq %rbx, %rdi
movl $0x2, %esi
movl $0x28, %edx
callq 0x5626
leaq 0x4d2d(%rip), %rdi      # 0x998d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x30c0
movl $0xa, %edi
callq 0x3040
jmp 0x45a9
cmpl $0xe83, %r12d           # imm = 0xE83
jg 0x4cfc
cmpl $0xe00, %r12d           # imm = 0xE00
je 0x4d90
cmpl $0xe21, %r12d           # imm = 0xE21
je 0x4d81
cmpl $0xe50, %r12d           # imm = 0xE50
jne 0x4e50
movl $0x4c5453, 0xc2bd(%rip) # imm = 0x4C5453
jmp 0x4b74
cmpl $0xf7f, %r12d           # imm = 0xF7F
jle 0x4d58
leal -0xf80(%r12), %eax
cmpl $0x8, %eax
ja 0x4dc8
leaq 0x1da7(%rip), %rcx      # 0x6a84
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x0, 0xc287(%rip)      # 0x10f74
movl $0x30303637, 0xc279(%rip) # imm = 0x30303637
jmp 0x4b74
leal -0xec0(%r12), %eax
cmpl $0x7, %eax
ja 0x4d9f
leaq 0x1cf8(%rip), %rcx      # 0x6a0c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movabsq $0x4c4c4320414c43, %rax # imm = 0x4C4C4320414C43
movq %rax, 0xc242(%rip)      # 0x10f70
leaq 0xc25b(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movabsq $0x303030203d204341, %rcx # imm = 0x303030203D204341
movq %rcx, (%rax,%r14)
movw $0x30, 0x8(%rax,%r14)
jmp 0x4b74
cmpl $0xf01, %r12d           # imm = 0xF01
je 0x4e1b
cmpl $0xf08, %r12d           # imm = 0xF08
jne 0x4e50
movl $0x504b53, 0xc1f4(%rip) # imm = 0x504B53
jmp 0x4b74
movl $0x414943, 0xc1e5(%rip) # imm = 0x414943
jmp 0x4b74
movl $0x504f4e, 0xc1d6(%rip) # imm = 0x504F4E
jmp 0x4b74
cmpl $0xe84, %r12d           # imm = 0xE84
je 0x5221
cmpl $0xea0, %r12d           # imm = 0xEA0
jne 0x4e50
movl $0x415453, 0xc1ad(%rip) # imm = 0x415453
jmp 0x4f94
cmpl $0xf91, %r12d           # imm = 0xF91
jne 0x4e50
movl $0x4d4143, 0xc195(%rip) # imm = 0x4D4143
jmp 0x4b74
movl $0x53414c, 0xc186(%rip) # imm = 0x53414C
jmp 0x4b74
movb $0x0, 0xc17e(%rip)      # 0x10f74
movl $0x31303637, 0xc170(%rip) # imm = 0x31303637
jmp 0x4b74
movabsq $0x414c4320504b53, %rax # imm = 0x414C4320504B53
movq %rax, 0xc15a(%rip)      # 0x10f70
jmp 0x4b74
movb $0x0, 0xc152(%rip)      # 0x10f74
movl $0x31303437, 0xc144(%rip) # imm = 0x31303437
jmp 0x4b74
cmpl $0xf00, %r12d           # imm = 0xF00
jne 0x4e50
movb $0x0, 0xc133(%rip)      # 0x10f74
movl $0x30303437, 0xc125(%rip) # imm = 0x30303437
jmp 0x4b74
movl %r14d, %eax
andl $0x101, %eax            # imm = 0x101
cmpl $0x2, %eax
jae 0x5230
testb %r13b, %r13b
jns 0x4e83
leaq 0xc103(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20414c43, (%rax,%r15) # imm = 0x20414C43
movb $0x0, 0x4(%rax,%r15)
testb $0x40, %r13b
je 0x4ea6
leaq 0xc0e0(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x204c4c43, (%rax,%r15) # imm = 0x204C4C43
movb $0x0, 0x4(%rax,%r15)
testb $0x20, %r13b
je 0x4ec9
leaq 0xc0bd(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20414d43, (%rax,%r15) # imm = 0x20414D43
movb $0x0, 0x4(%rax,%r15)
testb $0x10, %r13b
je 0x4eec
leaq 0xc09a(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x204c4d43, (%rax,%r15) # imm = 0x204C4D43
movb $0x0, 0x4(%rax,%r15)
testb $0x1, %r13b
je 0x4f0f
leaq 0xc077(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20434149, (%rax,%r15) # imm = 0x20434149
movb $0x0, 0x4(%rax,%r15)
testb $0x8, %r13b
je 0x5333
leaq 0xc050(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
addq %r15, %rax
testb $0x2, %r13b
jne 0x5329
movb $0x0, 0x4(%rax)
movl $0x20524152, (%rax)     # imm = 0x20524152
jmp 0x5333
movups 0x4972(%rip), %xmm0     # 0x98bd
movaps %xmm0, 0xc01e(%rip)     # 0x10f70
leaq 0xc037(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movups 0x4965(%rip), %xmm0     # 0x98cd
movups %xmm0, (%rax,%r14)
movups 0x4967(%rip), %xmm0     # 0x98db
jmp 0x5122
movabsq $0x204c4c4320414c43, %rax # imm = 0x204C4C4320414C43
movq %rax, 0xbfe6(%rip)      # 0x10f70
movl $0x414d43, 0xbfe4(%rip) # imm = 0x414D43
leaq 0xbff5(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movups 0x4764(%rip), %xmm0     # 0x970e
jmp 0x50e0
movups 0x47e1(%rip), %xmm0     # 0x9797
jmp 0x51ab
movups 0x48b8(%rip), %xmm0     # 0x987a
movaps %xmm0, 0xbfa7(%rip)     # 0x10f70
leaq 0xbfc0(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movups 0x48ab(%rip), %xmm0     # 0x988a
jmp 0x50e0
movups 0x47d6(%rip), %xmm0     # 0x97c1
movaps %xmm0, 0xbf7e(%rip)     # 0x10f70
movl $0x4c5452, 0xbf84(%rip) # imm = 0x4C5452
leaq 0xbf8d(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movabsq $0x303030203d204341, %rcx # imm = 0x303030203D204341
movq %rcx, (%rax,%r14)
movw $0x36, 0x8(%rax,%r14)
jmp 0x4b74
movups 0x47e0(%rip), %xmm0     # 0x980d
movaps %xmm0, 0xbf3c(%rip)     # 0x10f70
leaq 0xbf55(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movups 0x47d3(%rip), %xmm0     # 0x981d
jmp 0x5070
movups 0x4849(%rip), %xmm0     # 0x989c
movaps %xmm0, 0xbf16(%rip)     # 0x10f70
leaq 0xbf2f(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movups 0x483c(%rip), %xmm0     # 0x98ac
movups %xmm0, (%rax,%r14)
movb $0x0, 0x10(%rax,%r14)
jmp 0x4b74
movups 0x473a(%rip), %xmm0     # 0x97c1
movaps %xmm0, 0xbee2(%rip)     # 0x10f70
movl $0x4c5452, 0xbee8(%rip) # imm = 0x4C5452
leaq 0xbef1(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movups 0x4780(%rip), %xmm0     # 0x982e
movups %xmm0, (%rax,%r14)
movups 0x4782(%rip), %xmm0     # 0x983c
jmp 0x5122
movups 0x4795(%rip), %xmm0     # 0x9858
movaps %xmm0, 0xbea6(%rip)     # 0x10f70
leaq 0xbebf(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movups 0x4788(%rip), %xmm0     # 0x9868
movups %xmm0, (%rax,%r14)
movw $0x29, 0x10(%rax,%r14)
jmp 0x4b74
movups 0x46e6(%rip), %xmm0     # 0x97df
movaps %xmm0, 0xbe70(%rip)     # 0x10f70
leaq 0xbe89(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movups 0x46d9(%rip), %xmm0     # 0x97ef
movups %xmm0, (%rax,%r14)
movups 0x46db(%rip), %xmm0     # 0x97fd
movups %xmm0, 0xe(%rax,%r14)
jmp 0x4b74
movups 0x460c(%rip), %xmm0     # 0x9740
movaps %xmm0, 0xbe35(%rip)     # 0x10f70
leaq 0xbe4e(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movabsq $0x303130203d204341, %rcx # imm = 0x303130203D204341
movq %rcx, (%rax,%r14)
movabsq $0x29343628203030, %rcx # imm = 0x29343628203030
movq %rcx, 0x7(%rax,%r14)
jmp 0x4b74
movups 0x4634(%rip), %xmm0     # 0x97a7
movaps %xmm0, 0xbdf6(%rip)     # 0x10f70
leaq 0xbe0f(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movabsq $0x303030203d204341, %rcx # imm = 0x303030203D204341
movq %rcx, (%rax,%r14)
movw $0x34, 0x8(%rax,%r14)
jmp 0x4b74
movups 0x45b4(%rip), %xmm0     # 0x975f
movaps %xmm0, 0xbdbe(%rip)     # 0x10f70
leaq 0xbdd7(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movabsq $0x303030203d204341, %rcx # imm = 0x303030203D204341
movq %rcx, (%rax,%r14)
movw $0x32, 0x8(%rax,%r14)
jmp 0x4b74
movabsq $0x204c4c4320414c43, %rax # imm = 0x204C4C4320414C43
movq %rax, 0xbd83(%rip)      # 0x10f70
movl $0x434149, 0xbd81(%rip) # imm = 0x434149
leaq 0xbd92(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movabsq $0x303030203d204341, %rcx # imm = 0x303030203D204341
movq %rcx, (%rax,%r14)
movw $0x31, 0x8(%rax,%r14)
jmp 0x4b74
movl $0x4b4c47, 0xbd45(%rip) # imm = 0x4B4C47
jmp 0x4b74
cmpl $0x100, %eax            # imm = 0x100
jne 0x526c
testb $0x40, %r13b
je 0x539b
leaq 0xbd28(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
addq %r15, %rax
testb $0x8, %r13b
jne 0x5391
movb $0x0, 0x4(%rax)
movl $0x20414d53, (%rax)     # imm = 0x20414D53
jmp 0x539b
testb %r13b, %r13b
jns 0x528e
leaq 0xbcf8(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20414c43, (%rax,%r15) # imm = 0x20414C43
movb $0x0, 0x4(%rax,%r15)
testb $0x40, %r13b
je 0x52b1
leaq 0xbcd5(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x2041514d, (%rax,%r15) # imm = 0x2041514D
movb $0x0, 0x4(%rax,%r15)
testb $0x20, %r13b
je 0x52d4
leaq 0xbcb2(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20414353, (%rax,%r15) # imm = 0x20414353
movb $0x0, 0x4(%rax,%r15)
testb $0x10, %r13b
je 0x52f7
leaq 0xbc8f(%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 0x17a4(%rip), %rcx      # 0x6aa8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xbc5c(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x204c4353, (%rax,%r15) # imm = 0x204C4353
jmp 0x5516
movb $0x0, 0x4(%rax)
movl $0x20525452, (%rax)     # imm = 0x20525452
testb $0x4, %r13b
je 0x5367
leaq 0xbc30(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
addq %r15, %rax
testb $0x2, %r13b
jne 0x535d
movb $0x0, 0x4(%rax)
movl $0x204c4152, (%rax)     # imm = 0x204C4152
jmp 0x5367
movb $0x0, 0x4(%rax)
movl $0x204c5452, (%rax)     # imm = 0x204C5452
andl $0xe, %r14d
cmpl $0x2, %r14d
jne 0x4b74
leaq 0xbbf4(%rip), %r14      # 0x10f70
movq %r14, %rdi
callq 0x30b0
movl $0x20575342, (%rax,%r14) # imm = 0x20575342
jmp 0x5490
movb $0x0, 0x4(%rax)
movl $0x20415053, (%rax)     # imm = 0x20415053
testb $0x20, %r13b
je 0x53cf
leaq 0xbbc8(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
addq %r15, %rax
testb $0x8, %r13b
jne 0x53c5
movb $0x0, 0x4(%rax)
movl $0x20415a53, (%rax)     # imm = 0x20415A53
jmp 0x53cf
movb $0x0, 0x4(%rax)
movl $0x20414e53, (%rax)     # imm = 0x20414E53
testb $0x10, %r13b
je 0x5403
leaq 0xbb94(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
addq %r15, %rax
testb $0x8, %r13b
jne 0x53f9
movb $0x0, 0x4(%rax)
movl $0x204c4e53, (%rax)     # imm = 0x204C4E53
jmp 0x5403
movb $0x0, 0x4(%rax)
movl $0x204c5a53, (%rax)     # imm = 0x204C5A53
andl $0x78, %r14d
cmpl $0x8, %r14d
jne 0x542a
leaq 0xbb5c(%rip), %r14      # 0x10f70
movq %r14, %rdi
callq 0x30b0
movl $0x20504b53, (%rax,%r14) # imm = 0x20504B53
movb $0x0, 0x4(%rax,%r14)
testb %r13b, %r13b
jns 0x544c
leaq 0xbb3a(%rip), %r14      # 0x10f70
movq %r14, %rdi
callq 0x30b0
movl $0x20414c43, (%rax,%r14) # imm = 0x20414C43
movb $0x0, 0x4(%rax,%r14)
testb $0x4, %r13b
je 0x546f
leaq 0xbb17(%rip), %r14      # 0x10f70
movq %r14, %rdi
callq 0x30b0
movl $0x2052534f, (%rax,%r14) # imm = 0x2052534F
movb $0x0, 0x4(%rax,%r14)
testb $0x2, %r13b
je 0x4b74
leaq 0xbaf0(%rip), %r14      # 0x10f70
movq %r14, %rdi
callq 0x30b0
movl $0x20544c48, (%rax,%r14) # imm = 0x20544C48
movb $0x0, 0x4(%rax,%r14)
jmp 0x4b74
leaq 0xbace(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20495644, (%rax,%r15) # imm = 0x20495644
jmp 0x5516
leaq 0xbab5(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x2052534c, (%rax,%r15) # imm = 0x2052534C
jmp 0x5516
leaq 0xba9c(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x2059554d, (%rax,%r15) # imm = 0x2059554D
jmp 0x5516
leaq 0xba83(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x204c4853, (%rax,%r15) # imm = 0x204C4853
jmp 0x5516
leaq 0xba6a(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20525341, (%rax,%r15) # imm = 0x20525341
movb $0x0, 0x4(%rax,%r15)
movw %r14w, 0xba3c(%rip)     # 0x10f60
jmp 0x4b7c
leaq 0xba40(%rip), %r14      # 0x10f70
movq %r14, %rdi
callq 0x30b0
movl $0x494d4e, (%rax,%r14)  # imm = 0x494D4E
jmp 0x4b74