// File: /workspace/github_c_makefile_star2_O2/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, %r13d
leaq 0x8b91(%rip), %rax      # 0xcf30
cmpl $0x2, (%rax)
movl %esi, %ebx
movslq %edi, %r12
jl 0x43c8
leaq 0xab90(%rip), %rax      # 0xef40
movzwl (%rax,%r12,2), %ecx
leaq 0x520e(%rip), %rdi      # 0x95ca
movl %r12d, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x30c0
cmpw $0xbff, %r14w           # imm = 0xBFF
jbe 0x43d6
pushq $-0x1
popq %r15
jmp 0x43f6
movsbl %bl, %r15d
andl %r13d, %r15d
movl %r14d, %eax
andl $0x7f, %eax
andl $0xf80, %r15d           # imm = 0xF80
orl %eax, %r15d
btl $0x8, %r14d
setae %bpl
cmpw $0x0, 0xcb62(%rip)      # 0x10f60
je 0x4427
leaq 0x51ed(%rip), %rdi      # 0x95f4
movl %ebx, %esi
xorl %eax, %eax
callq 0x30c0
andw $0x0, 0xcb48(%rip)      # 0x10f60
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorps %xmm0, %xmm0
movaps %xmm0, 0xcb3f(%rip)     # 0x10f70
andq $0x0, 0xcb47(%rip)      # 0x10f80
movaps %xmm0, 0xcb60(%rip)     # 0x10fa0
andq $0x0, 0xcb66(%rip)      # 0x10fae
movaps %xmm0, 0xcb41(%rip)     # 0x10f90
leaq 0xaaea(%rip), %rax      # 0xef40
movzwl (%rax,%r12,2), %eax
testb $0x4, %al
je 0x447c
leaq 0x51a8(%rip), %rdi      # 0x960e
movl %r12d, %esi
xorl %eax, %eax
callq 0x30c0
leaq 0xaac9(%rip), %rax      # 0xef40
movzwl (%rax,%r12,2), %eax
movzwl %ax, %ecx
testb $0x2, %cl
jne 0x44c8
movl %ecx, 0xc(%rsp)
testb $0x1, %cl
je 0x46ec
movl %r13d, %ecx
andl $0xff8, %ecx            # imm = 0xFF8
cmpl $0x8, %ecx
jne 0x4672
movl %r13d, %esi
andl $0x7, %esi
leaq 0x8a90(%rip), %rax      # 0xcf40
movswl (%rax,%r12,2), %edx
leaq 0x5178(%rip), %rdi      # 0x9634
xorl %eax, %eax
callq 0x30c0
jmp 0x46ec
pushq $0xa
popq %rdi
callq 0x3040
leaq 0x579f(%rip), %rdi      # 0x9c76
callq 0x3090
leaq 0x518e(%rip), %r14      # 0x9671
movq %r14, %rdi
callq 0x3090
leaq 0x5124(%rip), %rdi      # 0x9616
movl %r13d, %ebx
movl %r13d, %esi
xorl %eax, %eax
callq 0x30c0
movq %r14, %rdi
callq 0x3090
leaq 0xaa32(%rip), %rdx      # 0xef40
leaq 0x8a2b(%rip), %r14      # 0xcf40
pushq $-0x1
popq %r12
pushq $-0x1
popq %r15
xorl %r13d, %r13d
xorl %ebp, %ebp
cmpq $0x1000, %r13           # imm = 0x1000
je 0x4610
movzwl (%r14,%r13,2), %eax
testw %ax, %ax
js 0x4608
testb $0x1, (%rdx,%r13,2)
jne 0x4608
movl %eax, %ecx
andl $0xf00, %ecx            # imm = 0xF00
cmpl $0x900, %ecx            # imm = 0x900
je 0x4587
cmpl $0x800, %ecx            # imm = 0x800
jne 0x4608
movl %r15d, %ecx
cmpw $0xbff, %ax             # imm = 0xBFF
ja 0x457e
movsbl %al, %ecx
andl %r13d, %ecx
andl $0x7f, %eax
andl $0xf80, %ecx            # imm = 0xF80
orl %eax, %ecx
cmpl %ebx, %ecx
je 0x45bb
jmp 0x4608
movq %r12, %rcx
cmpw $0xbff, %ax             # imm = 0xBFF
ja 0x45a1
movsbl %al, %ecx
andl %r13d, %ecx
andl $0x7f, %eax
andl $0xf80, %ecx            # imm = 0xF80
orl %eax, %ecx
testb $0x1, 0x1(%rdx,%rcx,2)
jne 0x4608
movswl (%r14,%rcx,2), %eax
testl %eax, %eax
sets %cl
cmpl %ebx, %eax
setne %al
orb %cl, %al
jne 0x4608
testl %ebp, %ebp
jne 0x45cd
leaq 0x5487(%rip), %rdi      # 0x9a4d
xorl %eax, %eax
callq 0x30c0
leaq 0x50dc(%rip), %rdi      # 0x96b0
movl %r13d, %esi
xorl %eax, %eax
callq 0x30c0
incl %ebp
movl %ebp, %eax
cltd
pushq $0xf
popq %rcx
idivl %ecx
testl %edx, %edx
leaq 0xa94f(%rip), %rdx      # 0xef40
jne 0x4608
leaq 0x5461(%rip), %rdi      # 0x9a5b
xorl %eax, %eax
callq 0x30c0
leaq 0xa938(%rip), %rdx      # 0xef40
incq %r13
jmp 0x4522
testl %ebp, %ebp
je 0x4630
pushq $0xa
popq %rdi
callq 0x3040
leaq 0x543c(%rip), %rdi      # 0x9a5f
movl %ebp, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x30c0
jmp 0x463c
leaq 0x5457(%rip), %rdi      # 0x9a8e
callq 0x3090
leaq 0x5633(%rip), %rdi      # 0x9c76
callq 0x3090
leaq 0x4fdd(%rip), %rdi      # 0x962c
movl %ebx, %esi
xorl %eax, %eax
callq 0x30c0
leaq 0x5419(%rip), %rdi      # 0x9a78
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 0x469c
leaq 0x4fd5(%rip), %rdi      # 0x9658
movl %r13d, %esi
xorl %eax, %eax
callq 0x30c0
leaq 0xa8ac(%rip), %rax      # 0xef40
movzwl (%rax,%r12,2), %eax
movzwl %ax, %ecx
xorl %esi, %esi
btl $0x8, %ecx
adcl $0x43, %esi
btl $0x9, %ecx
pushq $0x4b
popq %rcx
cmovbl %ecx, %esi
btl $0x9, %eax
movl %r13d, %edx
jae 0x46c4
leaq 0x8881(%rip), %rax      # 0xcf40
movswl (%rax,%r12,2), %edx
leaq 0x4f95(%rip), %rdi      # 0x9660
xorl %eax, %eax
callq 0x30c0
leaq 0x8867(%rip), %rax      # 0xcf40
movswl (%rax,%r12,2), %esi
leaq 0x4f84(%rip), %rdi      # 0x9669
xorl %eax, %eax
callq 0x30c0
movl %r14d, %eax
shrl $0x9, %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x6, %ecx
jae 0x47d4
movl %ebx, 0x14(%rsp)
movl %r13d, 0x10(%rsp)
movl %eax, %eax
leaq 0x2392(%rip), %rcx      # 0x6aa4
movslq (%rcx,%rax,4), %rdx
addq %rcx, %rdx
leaq 0xc850(%rip), %r13      # 0x10f70
leaq 0x4f4c(%rip), %rsi      # 0x9673
movq %r13, %rdi
xorl %eax, %eax
callq 0x31a0
movq %r13, %rdi
callq 0x30b0
addq %r13, %rax
testb $0x1, %bpl
je 0x474d
movb $0x0, 0x2(%rax)
movw $0x2020, (%rax)         # imm = 0x2020
jmp 0x4756
movb $0x0, 0x2(%rax)
movw $0x2049, (%rax)         # imm = 0x2049
leaq 0xa7e3(%rip), %rax      # 0xef40
movslq %r15d, %rcx
movq %rcx, %rbx
movzwl (%rax,%rcx,2), %ebp
testb $0x2, %bpl
jne 0x47c0
testb $0x4, %bpl
jne 0x47f0
movl %r15d, %eax
andl $0xff8, %eax            # imm = 0xFF8
movq %r13, %rdi
cmpl $0x8, %eax
jne 0x48ab
callq 0x30b0
movw $0x4941, (%rax,%r13)    # imm = 0x4941
movb $0x0, 0x2(%rax,%r13)
leaq 0xc7f0(%rip), %rbp      # 0x10f90
movq %rbp, %rdi
callq 0x30b0
movups 0x4ecb(%rip), %xmm0     # 0x967a
movups %xmm0, (%rax,%rbp)
movl $0x524554, 0x10(%rax,%rbp) # imm = 0x524554
jmp 0x48c9
movq %r13, %rdi
callq 0x30b0
movw $0x53, (%rax,%r13)
jmp 0x48c9
jne 0x4804
leaq 0xc793(%rip), %rsi      # 0x10f70
leaq 0xc7ac(%rip), %rdx      # 0x10f90
movl %ebx, %edi
callq 0x5363
jmp 0x499d
movq %r13, %rdi
callq 0x30b0
movw $0x4c, (%rax,%r13)
jmp 0x48c9
movzwl %r14w, %eax
leal -0xed5(%rax), %ecx
cmpl $0x15, %ecx
movl 0xc(%rsp), %ebp
jbe 0x4acf
leal -0xec0(%rax), %ecx
cmpl $0x7, %ecx
jbe 0x4b21
leal -0xf80(%rax), %ecx
cmpl $0x8, %ecx
jbe 0x4b6c
cmpl $0xf91, %eax            # imm = 0xF91
je 0x4f8a
cmpl $0xe21, %eax            # imm = 0xE21
je 0x500e
cmpl $0xe50, %eax            # imm = 0xE50
je 0x4fbe
cmpl $0xe84, %eax            # imm = 0xE84
je 0x4fff
cmpl $0xea0, %eax            # imm = 0xEA0
je 0x4fcd
cmpl $0xf00, %eax            # imm = 0xF00
je 0x4f74
cmpl $0xf01, %eax            # imm = 0xF01
je 0x4fa8
cmpl $0xf08, %eax            # imm = 0xF08
je 0x4f99
cmpl $0xe00, %eax            # imm = 0xE00
jne 0x4b92
movl $0x504f4e, 0xc6ca(%rip) # imm = 0x504F4E
jmp 0x49de
callq 0x30b0
xorl %ecx, %ecx
btl $0x8, %ebp
adcw $0x43, %cx
btl $0x9, %ebp
pushq $0x4b
popq %rdx
cmovael %ecx, %edx
movw %dx, (%rax,%r13)
leaq 0xa670(%rip), %rax      # 0xef40
testb $0x8, (%rax,%r12,2)
jne 0x4916
andl $0xf00, %r14d           # imm = 0xF00
cmpl $0xb00, %r14d           # imm = 0xB00
je 0x4935
cmpl $0x900, %r14d           # imm = 0x900
jne 0x4963
leaq 0xc699(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
addq %rax, %r14
leaq 0x8637(%rip), %rax      # 0xcf40
movswl (%rax,%rbx,2), %edx
leaq 0x4d7a(%rip), %rsi      # 0x968e
jmp 0x4959
leaq 0xc673(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movabsq $0x206e7275746572, %rcx # imm = 0x206E7275746572
movq %rcx, (%rax,%r14)
jmp 0x4963
leaq 0xc654(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
addq %rax, %r14
leaq 0x85f2(%rip), %rax      # 0xcf40
movswl (%rax,%rbx,2), %edx
leaq 0x4d49(%rip), %rsi      # 0x96a2
movq %r14, %rdi
xorl %eax, %eax
callq 0x31a0
movl %r15d, %ebp
andl $0xff8, %ebp            # imm = 0xFF8
movq %r13, %rdi
callq 0x30b0
addq %r13, %rax
cmpl $0x8, %ebp
jne 0x49a3
andl $0x7, %r15d
leaq 0x4d2f(%rip), %rsi      # 0x96b6
movq %rax, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x31a0
movl 0x10(%rsp), %r13d
movl 0x14(%rsp), %ebx
movl 0xc(%rsp), %ebp
jmp 0x49de
leaq 0xa596(%rip), %rcx      # 0xef40
testb $0x2, 0x1(%rcx,%rbx,2)
movl 0x10(%rsp), %r13d
movl 0xc(%rsp), %ebp
je 0x49c6
leaq 0x857f(%rip), %rcx      # 0xcf40
movswl (%rcx,%rbx,2), %r15d
leaq 0x4ce3(%rip), %rsi      # 0x96b0
movq %rax, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x31a0
movl 0x14(%rsp), %ebx
movzwl 0xc57a(%rip), %r14d     # 0x10f60
testw %r14w, %r14w
je 0x4a02
leaq 0xc57d(%rip), %r14      # 0x10f70
movq %r14, %rdi
callq 0x30b0
movw $0x2b, (%rax,%r14)
leaq 0xc567(%rip), %r14      # 0x10f70
cmpb $0x0, 0xc560(%rip)      # 0x10f70
je 0x4a2a
movq %r14, %rdi
callq 0x30b0
cmpb $0x20, -0x1(%rax,%r14)
jne 0x4a2a
movb $0x0, -0x1(%rax,%r14)
jmp 0x4a09
testb $0x1, %bpl
jne 0x4a9c
leaq 0xc539(%rip), %r14      # 0x10f70
pushq $0x18
popq %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x53fe
leaq 0x4eec(%rip), %rdi      # 0x9937
movq %r14, %rsi
xorl %eax, %eax
callq 0x30c0
leaq 0x4edf(%rip), %rdi      # 0x993b
xorl %eax, %eax
callq 0x30c0
leaq 0xc526(%rip), %r14      # 0x10f90
pushq $0x2
popq %rsi
pushq $0x28
popq %rdx
movq %r14, %rdi
callq 0x53fe
leaq 0x4ebf(%rip), %rdi      # 0x993e
movq %r14, %rsi
movl %r13d, %edx
movl %ebx, %ecx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x30c0
leaq 0xc4cd(%rip), %rbx      # 0x10f70
pushq $0x2
popq %rsi
pushq $0x28
popq %rdx
movq %rbx, %rdi
callq 0x53fe
leaq 0x4e95(%rip), %rdi      # 0x994d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x30c0
pushq $0xa
popq %rdi
callq 0x3040
jmp 0x4410
leaq 0x1f16(%rip), %rax      # 0x69ec
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movups 0x4c53(%rip), %xmm0     # 0x9739
movaps %xmm0, 0xc483(%rip)     # 0x10f70
movl $0x4c4152, 0xc489(%rip) # imm = 0x4C4152
leaq 0xc492(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movabsq $0x303030203d204341, %rcx # imm = 0x303030203D204341
movq %rcx, (%rax,%r14)
movw $0x33, 0x8(%rax,%r14)
jmp 0x49de
leaq 0x1ea4(%rip), %rax      # 0x69cc
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movabsq $0x4c4c4320414c43, %rax # imm = 0x4C4C4320414C43
movq %rax, 0xc42e(%rip)      # 0x10f70
leaq 0xc447(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movabsq $0x303030203d204341, %rcx # imm = 0x303030203D204341
movq %rcx, (%rax,%r14)
movw $0x30, 0x8(%rax,%r14)
jmp 0x49de
leaq 0x1ed1(%rip), %rax      # 0x6a44
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movb $0x0, 0xc3f1(%rip)      # 0x10f74
movl $0x30303637, 0xc3e3(%rip) # imm = 0x30303637
jmp 0x49de
movl %r14d, %eax
andl $0x101, %eax            # imm = 0x101
cmpl $0x2, %eax
jae 0x501d
testb %bl, %bl
jns 0x4bc4
leaq 0xc3c2(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20414c43, (%rax,%r15) # imm = 0x20414C43
movb $0x0, 0x4(%rax,%r15)
testb $0x40, %bl
je 0x4be6
leaq 0xc3a0(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x204c4c43, (%rax,%r15) # imm = 0x204C4C43
movb $0x0, 0x4(%rax,%r15)
testb $0x20, %bl
je 0x4c08
leaq 0xc37e(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20414d43, (%rax,%r15) # imm = 0x20414D43
movb $0x0, 0x4(%rax,%r15)
testb $0x10, %bl
je 0x4c2a
leaq 0xc35c(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x204c4d43, (%rax,%r15) # imm = 0x204C4D43
movb $0x0, 0x4(%rax,%r15)
testb $0x1, %bl
je 0x4c4c
leaq 0xc33a(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20434149, (%rax,%r15) # imm = 0x20434149
movb $0x0, 0x4(%rax,%r15)
testb $0x8, %bl
je 0x511a
leaq 0xc314(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
addq %r15, %rax
testb $0x2, %bl
jne 0x5110
movb $0x0, 0x4(%rax)
movl $0x20524152, (%rax)     # imm = 0x20524152
jmp 0x511a
movups 0x4a99(%rip), %xmm0     # 0x971f
jmp 0x4e8a
movabsq $0x204c4c4320414c43, %rax # imm = 0x204C4C4320414C43
movq %rax, 0xc2d4(%rip)      # 0x10f70
movl $0x434149, 0xc2d2(%rip) # imm = 0x434149
leaq 0xc2e3(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movabsq $0x303030203d204341, %rcx # imm = 0x303030203D204341
movq %rcx, (%rax,%r14)
movw $0x31, 0x8(%rax,%r14)
jmp 0x49de
movups 0x4a29(%rip), %xmm0     # 0x9700
movaps %xmm0, 0xc292(%rip)     # 0x10f70
leaq 0xc2ab(%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 0x49de
movups 0x4a51(%rip), %xmm0     # 0x9767
movaps %xmm0, 0xc253(%rip)     # 0x10f70
leaq 0xc26c(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movabsq $0x303030203d204341, %rcx # imm = 0x303030203D204341
movq %rcx, (%rax,%r14)
movw $0x34, 0x8(%rax,%r14)
jmp 0x49de
movabsq $0x414c4320504b53, %rax # imm = 0x414C4320504B53
movq %rax, 0xc218(%rip)      # 0x10f70
jmp 0x49de
movb $0x0, 0xc210(%rip)      # 0x10f74
movl $0x31303637, 0xc202(%rip) # imm = 0x31303637
jmp 0x49de
movl $0x53414c, 0xc1f3(%rip) # imm = 0x53414C
jmp 0x49de
movups 0x4ad3(%rip), %xmm0     # 0x985c
movaps %xmm0, 0xc1e0(%rip)     # 0x10f70
leaq 0xc1f9(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movups 0x4ac6(%rip), %xmm0     # 0x986c
jmp 0x4e1e
movups 0x4a8b(%rip), %xmm0     # 0x983a
movaps %xmm0, 0xc1ba(%rip)     # 0x10f70
leaq 0xc1d3(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movups 0x4a7e(%rip), %xmm0     # 0x984a
jmp 0x4fed
movups 0x4a40(%rip), %xmm0     # 0x9818
movaps %xmm0, 0xc191(%rip)     # 0x10f70
leaq 0xc1aa(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movups 0x4a33(%rip), %xmm0     # 0x9828
jmp 0x4fed
movups 0x49cc(%rip), %xmm0     # 0x97cd
movaps %xmm0, 0xc168(%rip)     # 0x10f70
leaq 0xc181(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movups 0x49bf(%rip), %xmm0     # 0x97dd
movups %xmm0, (%rax,%r14)
movb $0x0, 0x10(%rax,%r14)
jmp 0x49de
movups 0x496a(%rip), %xmm0     # 0x979f
movaps %xmm0, 0xc134(%rip)     # 0x10f70
leaq 0xc14d(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movups 0x495d(%rip), %xmm0     # 0x97af
movups %xmm0, (%rax,%r14)
movups 0x495f(%rip), %xmm0     # 0x97bd
jmp 0x4f69
movabsq $0x204c4c4320414c43, %rax # imm = 0x204C4C4320414C43
movq %rax, 0xc0fc(%rip)      # 0x10f70
movl $0x414d43, 0xc0fa(%rip) # imm = 0x414D43
jmp 0x4fd7
movups 0x48cd(%rip), %xmm0     # 0x9757
movaps %xmm0, 0xc0df(%rip)     # 0x10f70
leaq 0xc0f8(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movabsq $0x303030203d204341, %rcx # imm = 0x303030203D204341
movq %rcx, (%rax,%r14)
movw $0x32, 0x8(%rax,%r14)
jmp 0x49de
movups 0x48bf(%rip), %xmm0     # 0x9781
movaps %xmm0, 0xc0a7(%rip)     # 0x10f70
movl $0x4c5452, 0xc0ad(%rip) # imm = 0x4C5452
leaq 0xc0b6(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movabsq $0x303030203d204341, %rcx # imm = 0x303030203D204341
movq %rcx, (%rax,%r14)
movw $0x36, 0x8(%rax,%r14)
jmp 0x49de
movups 0x487d(%rip), %xmm0     # 0x9781
movaps %xmm0, 0xc065(%rip)     # 0x10f70
movl $0x4c5452, 0xc06b(%rip) # imm = 0x4C5452
leaq 0xc074(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movups 0x48c3(%rip), %xmm0     # 0x97ee
movups %xmm0, (%rax,%r14)
movups 0x48c5(%rip), %xmm0     # 0x97fc
jmp 0x4f69
movups 0x493d(%rip), %xmm0     # 0x987d
movaps %xmm0, 0xc029(%rip)     # 0x10f70
leaq 0xc042(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movups 0x4930(%rip), %xmm0     # 0x988d
movups %xmm0, (%rax,%r14)
movups 0x4932(%rip), %xmm0     # 0x989b
movups %xmm0, 0xe(%rax,%r14)
jmp 0x49de
movb $0x0, 0xbff9(%rip)      # 0x10f74
movl $0x30303437, 0xbfeb(%rip) # imm = 0x30303437
jmp 0x49de
movl $0x4d4143, 0xbfdc(%rip) # imm = 0x4D4143
jmp 0x49de
movl $0x504b53, 0xbfcd(%rip) # imm = 0x504B53
jmp 0x49de
movb $0x0, 0xbfc5(%rip)      # 0x10f74
movl $0x31303437, 0xbfb7(%rip) # imm = 0x31303437
jmp 0x49de
movl $0x4c5453, 0xbfa8(%rip) # imm = 0x4C5453
jmp 0x49de
movl $0x415453, 0xbf99(%rip) # imm = 0x415453
leaq 0xbfb2(%rip), %r14      # 0x10f90
movq %r14, %rdi
callq 0x30b0
movups 0x46e1(%rip), %xmm0     # 0x96ce
movups %xmm0, (%rax,%r14)
movw $0x29, 0x10(%rax,%r14)
jmp 0x49de
movl $0x4b4c47, 0xbf67(%rip) # imm = 0x4B4C47
jmp 0x49de
movl $0x414943, 0xbf58(%rip) # imm = 0x414943
jmp 0x49de
cmpl $0x100, %eax            # imm = 0x100
jne 0x5057
testb $0x40, %bl
je 0x5180
leaq 0xbf3c(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
addq %r15, %rax
testb $0x8, %bl
jne 0x5176
movb $0x0, 0x4(%rax)
movl $0x20414d53, (%rax)     # imm = 0x20414D53
jmp 0x5180
testb %bl, %bl
jns 0x5078
leaq 0xbf0e(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20414c43, (%rax,%r15) # imm = 0x20414C43
movb $0x0, 0x4(%rax,%r15)
testb $0x40, %bl
je 0x509a
leaq 0xbeec(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x2041514d, (%rax,%r15) # imm = 0x2041514D
movb $0x0, 0x4(%rax,%r15)
testb $0x20, %bl
je 0x50bc
leaq 0xbeca(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20414353, (%rax,%r15) # imm = 0x20414353
movb $0x0, 0x4(%rax,%r15)
testb $0x10, %bl
je 0x50de
leaq 0xbea8(%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 0x197d(%rip), %rcx      # 0x6a68
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xbe75(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x204c4353, (%rax,%r15) # imm = 0x204C4353
jmp 0x52f4
movb $0x0, 0x4(%rax)
movl $0x20525452, (%rax)     # imm = 0x20525452
testb $0x4, %bl
je 0x514c
leaq 0xbe4a(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
addq %r15, %rax
testb $0x2, %bl
jne 0x5142
movb $0x0, 0x4(%rax)
movl $0x204c4152, (%rax)     # imm = 0x204C4152
jmp 0x514c
movb $0x0, 0x4(%rax)
movl $0x204c5452, (%rax)     # imm = 0x204C5452
andl $0xe, %r14d
cmpl $0x2, %r14d
jne 0x49de
leaq 0xbe0f(%rip), %r14      # 0x10f70
movq %r14, %rdi
callq 0x30b0
movl $0x20575342, (%rax,%r14) # imm = 0x20575342
jmp 0x526e
movb $0x0, 0x4(%rax)
movl $0x20415053, (%rax)     # imm = 0x20415053
testb $0x20, %bl
je 0x51b2
leaq 0xbde4(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
addq %r15, %rax
testb $0x8, %bl
jne 0x51a8
movb $0x0, 0x4(%rax)
movl $0x20415a53, (%rax)     # imm = 0x20415A53
jmp 0x51b2
movb $0x0, 0x4(%rax)
movl $0x20414e53, (%rax)     # imm = 0x20414E53
testb $0x10, %bl
je 0x51e4
leaq 0xbdb2(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
addq %r15, %rax
testb $0x8, %bl
jne 0x51da
movb $0x0, 0x4(%rax)
movl $0x204c4e53, (%rax)     # imm = 0x204C4E53
jmp 0x51e4
movb $0x0, 0x4(%rax)
movl $0x204c5a53, (%rax)     # imm = 0x204C5A53
andl $0x78, %r14d
cmpl $0x8, %r14d
jne 0x520b
leaq 0xbd7b(%rip), %r14      # 0x10f70
movq %r14, %rdi
callq 0x30b0
movl $0x20504b53, (%rax,%r14) # imm = 0x20504B53
movb $0x0, 0x4(%rax,%r14)
testb %bl, %bl
jns 0x522c
leaq 0xbd5a(%rip), %r14      # 0x10f70
movq %r14, %rdi
callq 0x30b0
movl $0x20414c43, (%rax,%r14) # imm = 0x20414C43
movb $0x0, 0x4(%rax,%r14)
testb $0x4, %bl
je 0x524e
leaq 0xbd38(%rip), %r14      # 0x10f70
movq %r14, %rdi
callq 0x30b0
movl $0x2052534f, (%rax,%r14) # imm = 0x2052534F
movb $0x0, 0x4(%rax,%r14)
testb $0x2, %bl
je 0x49de
leaq 0xbd12(%rip), %r14      # 0x10f70
movq %r14, %rdi
callq 0x30b0
movl $0x20544c48, (%rax,%r14) # imm = 0x20544C48
movb $0x0, 0x4(%rax,%r14)
jmp 0x49de
leaq 0xbcf0(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20495644, (%rax,%r15) # imm = 0x20495644
jmp 0x52f4
leaq 0xbcd7(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x2052534c, (%rax,%r15) # imm = 0x2052534C
jmp 0x52f4
leaq 0xbcbe(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x2059554d, (%rax,%r15) # imm = 0x2059554D
jmp 0x52f4
leaq 0xbca5(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x204c4853, (%rax,%r15) # imm = 0x204C4853
jmp 0x52f4
leaq 0xbc8c(%rip), %r15      # 0x10f70
movq %r15, %rdi
callq 0x30b0
movl $0x20525341, (%rax,%r15) # imm = 0x20525341
movb $0x0, 0x4(%rax,%r15)
movw %r14w, 0xbc5e(%rip)     # 0x10f60
jmp 0x49e6
leaq 0xbc62(%rip), %r14      # 0x10f70
movq %r14, %rdi
callq 0x30b0
movl $0x494d4e, (%rax,%r14)  # imm = 0x494D4E
jmp 0x49de