// File: /workspace/github_c_makefile_star2_O1/kyz[P]amostools/./amoslib.c
// Function: AMOS_print_source
int AMOS_print_source(uint8_t *src, size_t len, FILE *out,
                      struct AMOS_token *table[AMOS_TOKEN_TABLE_SIZE])
{
    uint32_t token, linelen=0, inpos, i, compiled_len = 0;
    uint8_t *line, *endline, add_space, start_of_line, label_at_eol = 0;
    int err = 0;

    /* while we have remaining input bytes */
    for (inpos = 0; inpos < len;) {
        /* skip compiled procedures */
        if (compiled_len) {
            fprintf(out, "   ' COMPILED PROCEDURE -- can't convert this to AMOS code\n");
            inpos += compiled_len + 8 - linelen;
            if (inpos > len) break;
            compiled_len = 0;
        }

        line = &src[inpos];
        linelen = line[0] * 2;
        inpos += linelen;

        /* stop if line claims to be zero length (bad data) */
        if (linelen == 0) {
            err |= 1;
            break;
        }

        /* if the line is said to be longer than we actually have bytes for,
         * mark this as an error, but continue with the bytes we have. */
        if (inpos > len) {
            err |= 1;
            linelen = len - (inpos - linelen);
        }

        //printf("LINE: ");for(i=0;i<linelen;i+=2)printf("%02X%02X ",line[i],line[i+1]);puts("");

        /* start the line with the given indent level */
        if ((i = line[1]) > 1) {
            while (i-- > 1) putc(' ', out);
        }
        add_space = 0;

        /* decode this line */
        endline = &line[linelen];
        line += 2;
        start_of_line = 1;

        while ((line < endline) && (token = amos_deek(line))) {
            line += 2;
            label_at_eol = 0;

            if (token <= 0x0018) {
                /* Tokens 0x0000 to 0x0018 are "variable" tokens. These represent
                 * variable, label and procedure names:
                 * - 0x0006 = TkVar, variable reference e.g. "X" in "Print X".
                 * - 0x000C = TkLab, label, e.g. "X:" or "190" (at the start of a line)
                 * - 0x0012 = TkPro, procedure reference, e.g. "X" in "X[42]"
                 * - 0x0018 = TkLGo, label reference, e.g. "X" in "Goto X"
                 *
                 * All these tokens have the following format:
                 * - 2 bytes: unknown purpose
                 * - 1 byte:  length of ASCII string for variable/label name
                 * - 1 byte:  flags. For TkVar, TkPro and TkLGo:
                 *            - flags & 0x01 = this is a floating point ref (eg "X#")
                 *            - flags & 0x02 = this is a string ref (eg "X$")
                 * - n bytes: ASCII string, with the above-given string length,
                 *            rounded to a multiple of two, null terminated.
                 */
                if (add_space) putc(' ', out);
                for (i = 0; i < line[2]; i++) {
                    uint8_t c = line[4+i];
                    if (!c) break;
                    if (c >= 'a' && c <= 'z') c -= ('a'-'A'); /* to uppercase */
                    putc(c, out);
                }
                if (token == 0x000C) {
                    /* if not a "line number" label, the label needs a colon */
                    if (!(line[4] >= '0' && line[4] <= '9')) putc(':', out);
                    add_space = 1;
                    label_at_eol = 1;
                }
                else {
                    if (line[3] & 0x01) putc('#', out);
                    else if (line[3] & 0x02) putc('$', out);
                    add_space = 0;
                }
                /* advance to the next token */
                line += ((line[2] & 1) ? 5 : 4) + line[2];
            }
            else if (token < 0x004E || token == 0x2B6A) {
                /* Tokens 0x0019 to 0x004D (and 0x2B6A) are "constant" tokens.
                 * They represent literal numbers and strings:
                 *
                 * - 0x001E = TkBin, a binary integer, e.g. %100101
                 * - 0x0026 = TkCh1, a string with double quotes, e.g. "hello"
                 * - 0x002E = TkCh2, a string with single quotes, e.g. 'hello'
                 * - 0x0036 = TkHex, a hexidecimal integer, e.g. $80FAA010
                 * - 0x003E = TkEnt, a decimal integer, e.g. 1234567890
                 * - 0x0046 = TkFl,  a floating-point number, e.g 3.142
                 * - 0x2B6A = TkDFl, a double-precision float, e.g. 3.1415926543
                 *
                 * TkBin, TkHex, TkEnt, TkFl have this format:
                 * - 4 bytes: the value
                 *
                 * TkDFl has this format:
                 * - 8 bytes: the value
                 *
                 * TkCh1 and TkCh2 have this format:
                 * - 2 bytes: the length of the string
                 * - n bytes: the string, for the above number of bytes rounded up
                 *            to a multiple of two bytes and padded with nulls.
                 */
                if (add_space) { putc(' ', out); add_space = 0; }
                switch (token) {
                case 0x001E: /* TkBin */
                    print_binary(out, amos_leek(line)); line += 4;
                    break;
                case 0x0026: /* TkCh1 */
                    line += print_string(out, line, '\"');
                    break;
                case 0x002E: /* TkCh2 */
                    line += print_string(out, line, '\'');
                    break;
                case 0x0036: /* TkHex */
                    fprintf(out, "$%X", amos_leek(line)); line += 4;
                    break;
                case 0x003E: /* TkEnt */
                    fprintf(out, "%d", (int) amos_leek(line)); line += 4;
                    break;
                case 0x0046: /* TkFl */
                    print_float(out, amos_leek(line)); line += 4;
                    break;
                case 0x2B6A:
                    print_double(out, amos_leek(line), amos_leek(line+4)); line += 8;
                    break;
                default:
                    fprintf(out, "Illegal_Constant_%04X", token);
                    err |= 2;
                }
            }
            else {
                char *tok = NULL;
                int key;
                /* all other tokens: 0x004E to 0xFFFF
                 *
                 * other than the extension tokens, these are actual instructions,
                 * functions or system variables which reside in AMOS's token table.
                 * The offset given leads to the handlers for these instructions,
                 * as well as their name and what would be correct parameters.
                 *
                 * AMOS allows "extensions" to the language. They have a token table
                 * just like AMOS, each extension has its own table.
                 *
                 * The extension token is token 0x004E and has this format:
                 * - 1 byte:  extension number [1-25]
                 * - 1 byte:  unused
                 * - 2 bytes: offset into extension's token table
                 *
                 * Other than this, some tokens in the core language have a special
                 * format. They are:
                 *
                 * TkRem1 (0x064A) and TkRem2 (0x0652):
                 * - 1 byte:  unused
                 * - 1 byte:  length of the remark
                 * - n bytes: the remark -- ASCII text, null terminated,
                 *            padded to a multiple of two bytes.
                 *
                 * TkFor (0x023C), TkRpt (0x0250), TkWhl (0x0268), TkDo (0x027E),
                 * TkIf (0x02BE), TkElse (0x02D0), TkData (0x0404) and AMOS Pro's
                 * TkElsI (0x25A4)
                 * - 2 bytes: unknown purpose
                 *
                 * TkExIf (0x0290), TkExit (0x029E) and TkOn (0x0316):
                 * - 4 bytes: unknown purpose
                 *
                 * TkProc (0x0376)
                 * - 4 bytes: number of bytes to corresponding ENDPROC line
                 *            (start of line + 8 + above = start of ENDPROC line)
                 *            (start of line + 8 + 6 + above = line _after_ ENDPROC)
                 * - 2 bytes: part of seed for encryption
                 * - 1 byte: flags:
                 *   - flags & 0x80 -- procedure is folded
                 *   - flags & 0x40 -- procedure is locked and should not be unfolded
                 *   - flags & 0x20 -- procedure is currently encrypted
                 *   - flags & 0x10 -- procedure contains compiled code, not tokens
                 * - 1 byte: part of seed for encryption
                 *
                 * TkEqu (0x2A40), TkLVO (0x2A4A), TkStru (0x2A54), TkStruS (0x2A64)
                 * - 4 bytes: value of the equate
                 * - 1 byte: type of the equate (0-7)
                 * - 1 byte: unknown purpose
                 */
                if (token == 0x004E) {
                    key = line[0] << 16 | amos_deek(&line[2]);
                    line += 4;
                }
                else {
                    key = token; /* slot 0 */
                }

                /* lookup token */
                int tidx = (key >> 1) % AMOS_TOKEN_TABLE_SIZE;
                for (struct AMOS_token *e = table[tidx]; e; e = e->next) {
                    if (e->key == key) {
                        tok = e->text;
                        break;
                    }
                }

                if (tok) {
                    char type = *tok++;
                    char is_paren = (token == 0x0074);
                    char is_func = (type == 'O' || type == '0' || type == '1' ||
                                    type == '2' || type == 'V');
                    if (!is_func && !start_of_line) add_space = 1;
                    if (!is_paren && add_space && *tok != ' ') putc(' ', out);
                    fprintf(out, "%s", tok);
                    add_space = (type == 'I');
                }
                else {
                    /* unknown token */
                    fprintf(out, " Extension_%d_%04X", key >> 16, key & 0xFFFF);
                    add_space = 1;
                    err |= 4;
                }


                /* special tokens in the core language with extra data after them */
                switch (token) {
                case 0x064A: /* TkRem1 */
                case 0x0652: /* TkRem2 */
                    fprintf(out, "%s", &line[2]);
                    i = line[1]; line += 2 + i; if (i & 1) line++;
                    break;

                case 0x023C: /* TkFor */
                case 0x0250: /* TkRpt */
                case 0x0268: /* TkWhl */
                case 0x027E: /* TkDo */
                case 0x02BE: /* TkIf */
                case 0x02D0: /* TkElse */
                case 0x0404: /* TkData */
                case 0x25A4: /* TkElsI */
                    line += 2;
                    break;

                case 0x0290: /* TkExIf */
                case 0x029E: /* TkExit */
                case 0x0316: /* TkOn */
                    line += 4;
                    break;

                case 0x0376: /* TkProc */
                    if (line[6] & 0x20) AMOS_decrypt_procedure(line-4, len - (inpos-linelen));
                    if (line[6] & 0x10) compiled_len = amos_leek(&line[0]);
                    line += 8;
                    break;

                case 0x2A40: /* Equ */
                case 0x2A4A: /* Lvo */
                case 0x2A54: /* Struc */
                case 0x2A64: /* Struct */
                    line += 6;
                    break;
                }
            }
            start_of_line = 0;
        }
        if (add_space && !label_at_eol) putc(' ', out);
        putc('\n', out);
    }
    return err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, 0x48(%rsp)
testq %rsi, %rsi
je 0x1c48
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %rbx
xorl %ebp, %ebp
movl $0x0, 0xc(%rsp)
xorl %r12d, %r12d
movl $0x0, 0x8(%rsp)
xorl %r15d, %r15d
movq %rsi, 0x20(%rsp)
movq %rdi, 0x40(%rsp)
testl %r12d, %r12d
je 0x14d2
movl $0x3b, %esi
movl $0x1, %edx
leaq 0x1b66(%rip), %rdi      # 0x301a
movq %r14, %rcx
callq 0x11f0
addl 0xc(%rsp), %r12d
subl %ebp, %r12d
addl $0x8, %r12d
cmpq %r13, %r12
jbe 0x14d9
jmp 0x1c57
movl 0xc(%rsp), %eax
movl %eax, %r12d
movq %r12, %rdx
movl %edx, %r12d
movzbl (%rbx,%r12), %eax
testl %eax, %eax
je 0x1c52
addq %rbx, %r12
movl %eax, %ecx
addl %eax, %ecx
leal (%rdx,%rax,2), %eax
movl %eax, 0xc(%rsp)
movl %eax, %esi
movl %r13d, %eax
subl %edx, %eax
xorl %ebx, %ebx
movq %rsi, 0x50(%rsp)
cmpq %r13, %rsi
cmovbel %ecx, %eax
movl %eax, 0x1c(%rsp)
seta %bpl
movzbl 0x1(%r12), %r13d
cmpl $0x2, %r13d
jb 0x1538
decl %r13d
movl $0x20, %edi
movq %r14, %rsi
callq 0x1150
cmpl $0x1, %r13d
ja 0x1522
movb %bpl, %bl
orl %ebx, 0x8(%rsp)
movq $0x0, 0x28(%rsp)
movb $0x1, %al
movl 0x1c(%rsp), %ebp
cmpl $0x3, %ebp
jb 0x1c08
movzwl 0x2(%r12), %ecx
rolw $0x8, %cx
testw %cx, %cx
movq 0x20(%rsp), %r13
je 0x1c0d
movl %ebp, %eax
addq %r12, %rax
movq %rax, 0x58(%rsp)
addq $0x2, %r12
movl 0xc(%rsp), %eax
subl %ebp, %eax
subq %rax, %r13
movq %r13, 0x38(%rsp)
movzwl %cx, %ebx
xorl %r13d, %r13d
xorl %eax, %eax
movq $0x0, 0x28(%rsp)
leaq 0x2(%r12), %rbp
cmpl $0x18, %ebx
ja 0x1618
testb %r13b, %r13b
je 0x15b8
movl $0x20, %edi
movq %r14, %rsi
callq 0x1150
cmpb $0x0, 0x4(%r12)
je 0x15f7
xorl %r15d, %r15d
movb 0x6(%r12,%r15), %al
testb %al, %al
je 0x15f7
leal -0x61(%rax), %ecx
leal -0x20(%rax), %edx
cmpb $0x1a, %cl
movzbl %al, %eax
movzbl %dl, %ecx
cmovael %eax, %ecx
movzbl %cl, %edi
movq %r14, %rsi
callq 0x1150
incq %r15
movzbl 0x4(%r12), %eax
cmpq %rax, %r15
jb 0x15c3
cmpl $0xc, %ebx
jne 0x167a
movb 0x6(%r12), %al
addb $-0x30, %al
movl $0x3a, %edi
movb $0x1, %r13b
cmpb $0xa, %al
jae 0x176f
jmp 0x1777
cmpl $0x4e, %ebx
setae %cl
cmpl $0x2b6a, %ebx           # imm = 0x2B6A
setne %dl
testb %dl, %cl
jne 0x169d
testb %r13b, %r13b
je 0x163d
movl $0x20, %edi
movq %r14, %rsi
callq 0x1150
cmpl $0x35, %ebx
jle 0x1793
cmpl $0x45, %ebx
jg 0x1859
cmpl $0x36, %ebx
je 0x1a2f
cmpl $0x3e, %ebx
jne 0x1a0f
movl 0x2(%r12), %edx
bswapl %edx
xorl %r13d, %r13d
movq %r14, %rdi
leaq 0x19e5(%rip), %rsi      # 0x305a
jmp 0x1a43
movzbl 0x5(%r12), %eax
testb $0x1, %al
jne 0x1767
movl $0x24, %edi
xorl %r13d, %r13d
testb $0x2, %al
jne 0x176f
jmp 0x1777
movl %ebx, %ecx
cmpl $0x4e, %ebx
jne 0x16c7
movzbl 0x2(%r12), %edx
shll $0x10, %edx
movzbl 0x4(%r12), %esi
shll $0x8, %esi
movzbl 0x5(%r12), %ecx
orl %edx, %ecx
orl %esi, %ecx
addq $0x6, %r12
movq %r12, %rbp
movl %ecx, %edx
shrl %edx
imulq $0x7e6150b, %rdx, %rsi  # imm = 0x7E6150B
shrq $0x28, %rsi
imull $0x2069, %esi, %esi     # imm = 0x2069
subl %esi, %edx
movq 0x48(%rsp), %rsi
leaq (%rsi,%rdx,8), %r12
movq (%r12), %r12
testq %r12, %r12
je 0x16fd
cmpl %ecx, 0x8(%r12)
jne 0x16e7
addq $0xc, %r12
jmp 0x1700
xorl %r12d, %r12d
testq %r12, %r12
je 0x17be
movb (%r12), %r15b
incq %r12
leal -0x30(%r15), %ecx
cmpb $0x27, %cl
setae %dl
movabsq $0x3f7ffffff8, %rsi     # imm = 0x3F7FFFFFF8
shrq %cl, %rsi
testb %r13b, %r13b
setne %cl
cmpl $0x74, %ebx
je 0x1752
orb %sil, %dl
andb %dl, %al
orb %al, %cl
testb $0x1, %cl
je 0x1752
cmpb $0x20, (%r12)
je 0x1752
movl $0x20, %edi
movq %r14, %rsi
callq 0x1150
movq %r12, %rdi
movq %r14, %rsi
callq 0x1120
cmpb $0x49, %r15b
sete %r13b
jmp 0x17df
movl $0x23, %edi
xorl %r13d, %r13d
movq %r14, %rsi
callq 0x1150
movzbl 0x4(%r12), %eax
movl %eax, %ecx
andl $0x1, %ecx
addl %eax, %ecx
addq %rcx, %rbp
addq $0x4, %rbp
movl %r13d, %r15d
jmp 0x1bd7
cmpl $0x1e, %ebx
je 0x19c6
cmpl $0x26, %ebx
je 0x1aaa
cmpl $0x2e, %ebx
jne 0x1a0f
movq %r14, %rdi
movq %rbp, %rsi
movl $0x27, %edx
jmp 0x1ab5
movl %ecx, %edx
shrl $0x10, %edx
movzwl %cx, %ecx
movq %r14, %rdi
leaq 0x18a3(%rip), %rsi      # 0x3073
xorl %eax, %eax
callq 0x1170
orl $0x4, 0x8(%rsp)
movb $0x1, %r13b
movzwl %bx, %eax
xorl %r15d, %r15d
cmpl $0x375, %eax            # imm = 0x375
jg 0x1828
cmpl $0x28f, %eax            # imm = 0x28F
jle 0x196b
cmpl $0x2bd, %eax            # imm = 0x2BD
jle 0x1ac7
cmpl $0x2be, %eax            # imm = 0x2BE
je 0x1b4a
cmpl $0x2d0, %eax            # imm = 0x2D0
je 0x1b4a
cmpl $0x316, %eax            # imm = 0x316
je 0x1ad9
jmp 0x1bd7
cmpl $0x651, %eax            # imm = 0x651
jg 0x199a
cmpl $0x376, %eax            # imm = 0x376
je 0x1ae2
cmpl $0x404, %eax            # imm = 0x404
je 0x1b4a
cmpl $0x64a, %eax            # imm = 0x64A
je 0x1b21
jmp 0x1bd7
cmpl $0x46, %ebx
je 0x1a53
cmpl $0x2b6a, %ebx           # imm = 0x2B6A
jne 0x1a0f
movzbl 0x2(%r12), %ebx
shll $0x18, %ebx
movzbl 0x3(%r12), %r15d
shll $0x10, %r15d
orl %r15d, %ebx
movzbl 0x4(%r12), %r13d
movzbl 0x5(%r12), %ebp
shrl $0x14, %ebx
xorpd %xmm1, %xmm1
xorpd %xmm0, %xmm0
andl $0x7ff, %ebx            # imm = 0x7FF
je 0x18d5
movl 0x6(%r12), %eax
bswapl %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x10(%rsp)
leal -0x433(%rbx), %edi
movsd 0x1742(%rip), %xmm0     # 0x3008
callq 0x1060
xorpd %xmm1, %xmm1
mulsd 0x10(%rsp), %xmm0
testl %ebx, %ebx
je 0x1928
shll $0x8, %r13d
orl %ebp, %r13d
andl $0xf0000, %r15d         # imm = 0xF0000
leal (%r15,%r13), %eax
addl $0x100000, %eax         # imm = 0x100000
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd %xmm1, 0x30(%rsp)
addl $0xfffffbed, %ebx       # imm = 0xFFFFFBED
movsd %xmm0, 0x10(%rsp)
movsd 0x16f7(%rip), %xmm0     # 0x3008
movl %ebx, %edi
callq 0x1060
movapd %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
mulsd 0x30(%rsp), %xmm1
addsd %xmm1, %xmm0
movl $0x1e, %esi
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
leaq 0x194d(%rip), %rdx      # 0x328d
movb $0x1, %al
callq 0x1100
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1120
movzbl (%rbx), %ecx
testl %ecx, %ecx
je 0x1b53
cmpl $0x2e, %ecx
je 0x1b6c
incq %rbx
jmp 0x1952
leal -0x23c(%rax), %ecx
cmpl $0x2c, %ecx
ja 0x198a
movabsq $0x100000100001, %rdx   # imm = 0x100000100001
btq %rcx, %rdx
jb 0x1b4a
cmpl $0x27e, %eax            # imm = 0x27E
je 0x1b4a
jmp 0x1bd7
leal -0x2a40(%rax), %ecx
cmpl $0x24, %ecx
ja 0x1b0f
movabsq $0x1000100401, %rdx     # imm = 0x1000100401
btq %rcx, %rdx
jae 0x1b0f
addq $0x6, %rbp
jmp 0x1bd4
movl 0x2(%r12), %eax
bswapl %eax
movb $0x0, 0x80(%rsp)
leaq 0x80(%rsp), %rdx
movl %eax, %ecx
movl %eax, %esi
andb $0x1, %sil
orb $0x30, %sil
movb %sil, -0x1(%rdx)
decq %rdx
shrl %ecx
cmpl $0x1, %eax
movl %ecx, %eax
ja 0x19df
xorl %r13d, %r13d
movq %r14, %rdi
leaq 0x186f(%rip), %rsi      # 0x3275
xorl %eax, %eax
callq 0x1170
jmp 0x1a4a
xorl %r13d, %r13d
movq %r14, %rdi
leaq 0x1641(%rip), %rsi      # 0x305d
movl %ebx, %edx
xorl %eax, %eax
callq 0x1170
orl $0x2, 0x8(%rsp)
jmp 0x1bd4
movl 0x2(%r12), %edx
bswapl %edx
xorl %r13d, %r13d
movq %r14, %rdi
leaq 0x1613(%rip), %rsi      # 0x3056
xorl %eax, %eax
callq 0x1170
addq $0x6, %r12
jmp 0x1bd1
movzbl 0x5(%r12), %edi
andl $0x7f, %edi
je 0x1b72
movzbl 0x2(%r12), %eax
shll $0x10, %eax
movzbl 0x3(%r12), %ecx
shll $0x8, %ecx
orl %eax, %ecx
movzbl 0x4(%r12), %eax
orl %ecx, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x10(%rsp)
addl $-0x58, %edi
movss 0x157a(%rip), %xmm0     # 0x3010
callq 0x11e0
mulss 0x10(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
jmp 0x1b75
movq %r14, %rdi
movq %rbp, %rsi
movl $0x22, %edx
callq 0x1c6d
movl %eax, %eax
addq %rax, %rbp
xorl %r13d, %r13d
jmp 0x1bd4
cmpl $0x290, %eax            # imm = 0x290
je 0x1ad9
cmpl $0x29e, %eax            # imm = 0x29E
jne 0x1bd7
addq $0x4, %rbp
jmp 0x1bd4
testb $0x20, 0x6(%rbp)
je 0x1af6
leaq -0x4(%rbp), %rdi
movq 0x38(%rsp), %rsi
callq 0x1ce1
testb $0x10, 0x6(%rbp)
je 0x1b06
movl (%rbp), %eax
bswapl %eax
movq %rax, 0x28(%rsp)
addq $0x8, %rbp
jmp 0x1bd4
cmpl $0x25a4, %eax           # imm = 0x25A4
je 0x1b4a
cmpl $0x652, %eax            # imm = 0x652
jne 0x1bd7
leaq 0x2(%rbp), %rdi
movq %r14, %rsi
callq 0x1120
movzbl 0x1(%rbp), %eax
leaq (%rax,%rbp), %rcx
addq $0x2, %rcx
andl $0x1, %eax
addq %rcx, %rax
xorl %r15d, %r15d
movq %rax, %rbp
jmp 0x1bd7
addq $0x2, %rbp
jmp 0x1bd4
movl $0x2, %esi
movl $0x1, %edx
leaq 0x1726(%rip), %rdi      # 0x328a
movq %r14, %rcx
callq 0x11f0
addq $0xa, %r12
jmp 0x1bce
xorps %xmm0, %xmm0
movl $0x14, %esi
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
leaq 0x16fe(%rip), %rdx      # 0x3287
movb $0x1, %al
callq 0x1100
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1120
movzbl (%rbx), %ecx
testl %ecx, %ecx
je 0x1bb1
cmpl $0x2e, %ecx
je 0x1bca
cmpl $0x45, %ecx
je 0x1bca
incq %rbx
jmp 0x1b9b
movl $0x2, %esi
movl $0x1, %edx
leaq 0x16c8(%rip), %rdi      # 0x328a
movq %r14, %rcx
callq 0x11f0
addq $0x6, %r12
xorl %r13d, %r13d
movq %r12, %rbp
xorl %r15d, %r15d
cmpq 0x58(%rsp), %rbp
jae 0x1bf7
movzwl (%rbp), %eax
rolw $0x8, %ax
movzwl %ax, %ebx
movb $0x1, %al
movq %rbp, %r12
testw %bx, %bx
jne 0x159c
testb %r13b, %r13b
sete %al
movq 0x20(%rsp), %r13
movl 0x1c(%rsp), %ebp
jmp 0x1c0d
movq 0x20(%rsp), %r13
testb %r15b, %r15b
setne %cl
orb %al, %cl
movq 0x40(%rsp), %rbx
movq 0x28(%rsp), %r12
jne 0x1c2e
movl $0x20, %edi
movq %r14, %rsi
callq 0x1150
movl $0xa, %edi
movq %r14, %rsi
callq 0x1150
cmpq %r13, 0x50(%rsp)
jb 0x149e
jmp 0x1c57
movl $0x0, 0x8(%rsp)
jmp 0x1c57
orl $0x1, 0x8(%rsp)
movl 0x8(%rsp), %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq