// File: /workspace/github_c_makefile_star2_O0/leiradel[P]zx48k-libretro/src/zx.h
// Function: zx_quickload
bool zx_quickload(zx_t* sys, const uint8_t* ptr, int num_bytes) {
    const uint8_t* end_ptr = ptr + num_bytes;
    if (_zx_overflow(ptr, sizeof(_zx_z80_header), end_ptr)) {
        return false;
    }
    const _zx_z80_header* hdr = (const _zx_z80_header*) ptr;
    ptr += sizeof(_zx_z80_header);
    const _zx_z80_ext_header* ext_hdr = 0;
    uint16_t pc = (hdr->PC_h<<8 | hdr->PC_l) & 0xFFFF;
    const bool is_version1 = 0 != pc;
    if (!is_version1) {
        if (_zx_overflow(ptr, sizeof(_zx_z80_ext_header), end_ptr)) {
            return false;
        }
        ext_hdr = (_zx_z80_ext_header*) ptr;
        int ext_hdr_len = (ext_hdr->len_h<<8)|ext_hdr->len_l;
        ptr += 2 + ext_hdr_len;
        if (ext_hdr->hw_mode < 3) {
            if (sys->type != ZX_TYPE_48K) {
                return false;
            }
        }
        else {
            if (sys->type != ZX_TYPE_128) {
                return false;
            }
        }
    }
    else {
        if (sys->type != ZX_TYPE_48K) {
            return false;
        }
    }
    const bool v1_compr = 0 != (hdr->flags0 & (1<<5));
    while (ptr < end_ptr) {
        int page_index = 0;
        int src_len = 0;
        if (is_version1) {
            src_len = num_bytes - sizeof(_zx_z80_header);
        }
        else {
            _zx_z80_page_header* phdr = (_zx_z80_page_header*) ptr;
            if (_zx_overflow(ptr, sizeof(_zx_z80_page_header), end_ptr)) {
                return false;
            }
            ptr += sizeof(_zx_z80_page_header);
            src_len = (phdr->len_h<<8 | phdr->len_l) & 0xFFFF;
            page_index = phdr->page_nr - 3;
            if ((sys->type == ZX_TYPE_48K) && (page_index == 5)) {
                page_index = 0;
            }
            if ((page_index < 0) || (page_index > 7)) {
                page_index = -1;
            }
        }
        uint8_t* dst_ptr;
        if (-1 == page_index) {
            dst_ptr = sys->junk;
        }
        else {
            dst_ptr = sys->ram[page_index];
        }
        if (0xFFFF == src_len) {
            /* FIXME: uncompressed not supported yet */
            return false;
        }
        else {
            /* compressed */
            int src_pos = 0;
            bool v1_done = false;
            uint8_t val[4];
            while ((src_pos < src_len) && !v1_done) {
                val[0] = ptr[src_pos];
                val[1] = ptr[src_pos+1];
                val[2] = ptr[src_pos+2];
                val[3] = ptr[src_pos+3];
                /* check for version 1 end marker */
                if (v1_compr && (0==val[0]) && (0xED==val[1]) && (0xED==val[2]) && (0==val[3])) {
                    v1_done = true;
                    src_pos += 4;
                }
                else if (0xED == val[0]) {
                    if (0xED == val[1]) {
                        uint8_t count = val[2];
                        CHIPS_ASSERT(0 != count);
                        uint8_t data = val[3];
                        src_pos += 4;
                        for (int i = 0; i < count; i++) {
                            *dst_ptr++ = data;
                        }
                    }
                    else {
                        /* single ED */
                        *dst_ptr++ = val[0];
                        src_pos++;
                    }
                }
                else {
                    /* any value */
                    *dst_ptr++ = val[0];
                    src_pos++;
                }
            }
            CHIPS_ASSERT(src_pos == src_len);
        }
        if (0xFFFF == src_len) {
            ptr += 0x4000;
        }
        else {
            ptr += src_len;
        }
    }

    /* start loaded image */
    z80_reset(&sys->cpu);
    z80_set_a(&sys->cpu, hdr->A); z80_set_f(&sys->cpu, hdr->F);
    z80_set_b(&sys->cpu, hdr->B); z80_set_c(&sys->cpu, hdr->C);
    z80_set_d(&sys->cpu, hdr->D); z80_set_e(&sys->cpu, hdr->E);
    z80_set_h(&sys->cpu, hdr->H); z80_set_l(&sys->cpu, hdr->L);
    z80_set_ix(&sys->cpu, hdr->IX_h<<8|hdr->IX_l);
    z80_set_iy(&sys->cpu, hdr->IY_h<<8|hdr->IY_l);
    z80_set_af_(&sys->cpu, hdr->A_<<8|hdr->F_);
    z80_set_bc_(&sys->cpu, hdr->B_<<8|hdr->C_);
    z80_set_de_(&sys->cpu, hdr->D_<<8|hdr->E_);
    z80_set_hl_(&sys->cpu, hdr->H_<<8|hdr->L_);
    z80_set_sp(&sys->cpu, hdr->SP_h<<8|hdr->SP_l);
    z80_set_i(&sys->cpu, hdr->I);
    z80_set_r(&sys->cpu, (hdr->R & 0x7F) | ((hdr->flags0 & 1)<<7));
    z80_set_iff2(&sys->cpu, hdr->IFF2 != 0);
    z80_set_ei_pending(&sys->cpu, hdr->EI != 0);
    if (hdr->flags1 != 0xFF) {
        z80_set_im(&sys->cpu, hdr->flags1 & 3);
    }
    else {
        z80_set_im(&sys->cpu, 1);
    }
    if (ext_hdr) {
        z80_set_pc(&sys->cpu, ext_hdr->PC_h<<8|ext_hdr->PC_l);
        if (sys->type == ZX_TYPE_128) {
            for (int i = 0; i < 16; i++) {
                /* latch AY-3-8912 register address */
                ay38910_iorq(&sys->ay, AY38910_BDIR|AY38910_BC1|(i<<16));
                /* write AY-3-8912 register value */
                ay38910_iorq(&sys->ay, AY38910_BDIR|(ext_hdr->audio[i]<<16));
            }
        }
        /* simulate an out of port 0xFFFD and 0x7FFD */
        uint64_t pins = Z80_IORQ|Z80_WR;
        Z80_SET_ADDR(pins, 0xFFFD);
        Z80_SET_DATA(pins, ext_hdr->out_fffd);
        _zx_tick(4, pins, sys);
        Z80_SET_ADDR(pins, 0x7FFD);
        Z80_SET_DATA(pins, ext_hdr->out_7ffd);
        _zx_tick(4, pins, sys);
    }
    else {
        z80_set_pc(&sys->cpu, hdr->PC_h<<8|hdr->PC_l);
    }
    sys->border_color = _zx_palette[(hdr->flags0>>1) & 7] & 0xFFD7D7D7;
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rdx
movl $0x1e, %esi
callq 0x22580
testb $0x1, %al
jne 0x21d9d
jmp 0x21da6
movb $0x0, -0x1(%rbp)
jmp 0x2256c
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
addq $0x1e, %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x30(%rbp), %rax
movzbl 0x7(%rax), %eax
shll $0x8, %eax
movq -0x30(%rbp), %rcx
movzbl 0x6(%rcx), %ecx
orl %ecx, %eax
andl $0xffff, %eax           # imm = 0xFFFF
movw %ax, -0x3a(%rbp)
movzwl -0x3a(%rbp), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
setne %al
andb $0x1, %al
movb %al, -0x3b(%rbp)
testb $0x1, -0x3b(%rbp)
jne 0x21e8d
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rdx
movl $0x38, %esi
callq 0x22580
testb $0x1, %al
jne 0x21e12
jmp 0x21e1b
movb $0x0, -0x1(%rbp)
jmp 0x2256c
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movzbl 0x1(%rax), %eax
shll $0x8, %eax
movq -0x38(%rbp), %rcx
movzbl (%rcx), %ecx
orl %ecx, %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %ecx
addl $0x2, %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x38(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x3, %eax
jge 0x21e73
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1114(%rax)
je 0x21e71
movb $0x0, -0x1(%rbp)
jmp 0x2256c
jmp 0x21e8b
movq -0x10(%rbp), %rax
cmpl $0x1, 0x1114(%rax)
je 0x21e89
movb $0x0, -0x1(%rbp)
jmp 0x2256c
jmp 0x21e8b
jmp 0x21ea5
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1114(%rax)
je 0x21ea3
movb $0x0, -0x1(%rbp)
jmp 0x2256c
jmp 0x21ea5
movq -0x30(%rbp), %rax
movzbl 0xc(%rax), %ecx
andl $0x20, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
setne %al
andb $0x1, %al
movb %al, -0x41(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x221b3
movl $0x0, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
testb $0x1, -0x3b(%rbp)
je 0x21eee
movslq -0x1c(%rbp), %rax
subq $0x1e, %rax
movl %eax, -0x4c(%rbp)
jmp 0x21f7c
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rdx
movl $0x3, %esi
callq 0x22580
testb $0x1, %al
jne 0x21f0e
jmp 0x21f17
movb $0x0, -0x1(%rbp)
jmp 0x2256c
movq -0x18(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x18(%rbp)
movq -0x58(%rbp), %rax
movzbl 0x1(%rax), %eax
shll $0x8, %eax
movq -0x58(%rbp), %rcx
movzbl (%rcx), %ecx
orl %ecx, %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0x4c(%rbp)
movq -0x58(%rbp), %rax
movzbl 0x2(%rax), %eax
subl $0x3, %eax
movl %eax, -0x48(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1114(%rax)
jne 0x21f67
cmpl $0x5, -0x48(%rbp)
jne 0x21f67
movl $0x0, -0x48(%rbp)
cmpl $0x0, -0x48(%rbp)
jl 0x21f73
cmpl $0x7, -0x48(%rbp)
jle 0x21f7a
movl $0xffffffff, -0x48(%rbp) # imm = 0xFFFFFFFF
jmp 0x21f7c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl -0x48(%rbp), %eax
jne 0x21f96
movq -0x10(%rbp), %rax
addq $0x2c230, %rax          # imm = 0x2C230
movq %rax, -0x60(%rbp)
jmp 0x21faf
movq -0x10(%rbp), %rax
addq $0x4230, %rax           # imm = 0x4230
movslq -0x48(%rbp), %rcx
shlq $0xe, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movl $0xffff, %eax           # imm = 0xFFFF
cmpl -0x4c(%rbp), %eax
jne 0x21fc2
movb $0x0, -0x1(%rbp)
jmp 0x2256c
movl $0x0, -0x64(%rbp)
movb $0x0, -0x65(%rbp)
movl -0x64(%rbp), %ecx
xorl %eax, %eax
cmpl -0x4c(%rbp), %ecx
movb %al, -0x81(%rbp)
jge 0x21fe8
movb -0x65(%rbp), %al
xorb $-0x1, %al
movb %al, -0x81(%rbp)
movb -0x81(%rbp), %al
testb $0x1, %al
jne 0x21ff7
jmp 0x22158
movq -0x18(%rbp), %rax
movslq -0x64(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x69(%rbp)
movq -0x18(%rbp), %rax
movl -0x64(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x68(%rbp)
movq -0x18(%rbp), %rax
movl -0x64(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x67(%rbp)
movq -0x18(%rbp), %rax
movl -0x64(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x66(%rbp)
testb $0x1, -0x41(%rbp)
je 0x22084
movzbl -0x69(%rbp), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x22084
movzbl -0x68(%rbp), %ecx
movl $0xed, %eax
cmpl %ecx, %eax
jne 0x22084
movzbl -0x67(%rbp), %ecx
movl $0xed, %eax
cmpl %ecx, %eax
jne 0x22084
movzbl -0x66(%rbp), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x22084
movb $0x1, -0x65(%rbp)
movl -0x64(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x64(%rbp)
jmp 0x22153
movzbl -0x69(%rbp), %ecx
movl $0xed, %eax
cmpl %ecx, %eax
jne 0x22134
movzbl -0x68(%rbp), %ecx
movl $0xed, %eax
cmpl %ecx, %eax
jne 0x22115
movb -0x67(%rbp), %al
movb %al, -0x6a(%rbp)
movzbl -0x6a(%rbp), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x220b4
jmp 0x220d3
leaq 0x33ff(%rip), %rdi      # 0x254ba
leaq 0x31a8(%rip), %rsi      # 0x2526a
movl $0x3a1, %edx            # imm = 0x3A1
leaq 0x33f7(%rip), %rcx      # 0x254c5
callq 0x3180
movb -0x66(%rbp), %al
movb %al, -0x6b(%rbp)
movl -0x64(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x64(%rbp)
movl $0x0, -0x70(%rbp)
movl -0x70(%rbp), %eax
movzbl -0x6a(%rbp), %ecx
cmpl %ecx, %eax
jge 0x22113
movb -0x6b(%rbp), %cl
movq -0x60(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x60(%rbp)
movb %cl, (%rax)
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x220e9
jmp 0x22132
movb -0x69(%rbp), %cl
movq -0x60(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x60(%rbp)
movb %cl, (%rax)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x22151
movb -0x69(%rbp), %cl
movq -0x60(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x60(%rbp)
movb %cl, (%rax)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x22153
jmp 0x21fcd
movl -0x64(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jne 0x22162
jmp 0x22181
leaq 0x338d(%rip), %rdi      # 0x254f6
leaq 0x30fa(%rip), %rsi      # 0x2526a
movl $0x3b4, %edx            # imm = 0x3B4
leaq 0x3349(%rip), %rcx      # 0x254c5
callq 0x3180
jmp 0x22183
movl $0xffff, %eax           # imm = 0xFFFF
cmpl -0x4c(%rbp), %eax
jne 0x2219d
movq -0x18(%rbp), %rax
addq $0x4000, %rax           # imm = 0x4000
movq %rax, -0x18(%rbp)
jmp 0x221ae
movl -0x4c(%rbp), %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
jmp 0x21ebc
movq -0x10(%rbp), %rdi
callq 0x3120
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl (%rax), %esi
callq 0x3150
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl 0x1(%rax), %esi
callq 0x34c0
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl 0x3(%rax), %esi
callq 0x3420
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl 0x2(%rax), %esi
callq 0x31d0
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl 0xe(%rax), %esi
callq 0x3490
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl 0xd(%rax), %esi
callq 0x31b0
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl 0x5(%rax), %esi
callq 0x34b0
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl 0x4(%rax), %esi
callq 0x34e0
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl 0x1a(%rax), %eax
shll $0x8, %eax
movq -0x30(%rbp), %rcx
movzbl 0x19(%rcx), %ecx
orl %ecx, %eax
movzwl %ax, %esi
callq 0x3310
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl 0x18(%rax), %eax
shll $0x8, %eax
movq -0x30(%rbp), %rcx
movzbl 0x17(%rcx), %ecx
orl %ecx, %eax
movzwl %ax, %esi
callq 0x30f0
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl 0x15(%rax), %eax
shll $0x8, %eax
movq -0x30(%rbp), %rcx
movzbl 0x16(%rcx), %ecx
orl %ecx, %eax
movzwl %ax, %esi
callq 0x34f0
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl 0x10(%rax), %eax
shll $0x8, %eax
movq -0x30(%rbp), %rcx
movzbl 0xf(%rcx), %ecx
orl %ecx, %eax
movzwl %ax, %esi
callq 0x3450
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl 0x12(%rax), %eax
shll $0x8, %eax
movq -0x30(%rbp), %rcx
movzbl 0x11(%rcx), %ecx
orl %ecx, %eax
movzwl %ax, %esi
callq 0x32b0
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl 0x14(%rax), %eax
shll $0x8, %eax
movq -0x30(%rbp), %rcx
movzbl 0x13(%rcx), %ecx
orl %ecx, %eax
movzwl %ax, %esi
callq 0x3390
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl 0x9(%rax), %eax
shll $0x8, %eax
movq -0x30(%rbp), %rcx
movzbl 0x8(%rcx), %ecx
orl %ecx, %eax
movzwl %ax, %esi
callq 0x3540
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl 0xa(%rax), %esi
callq 0x31e0
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl 0xb(%rax), %eax
andl $0x7f, %eax
movq -0x30(%rbp), %rcx
movzbl 0xc(%rcx), %ecx
andl $0x1, %ecx
shll $0x7, %ecx
orl %ecx, %eax
movzbl %al, %esi
callq 0x34d0
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl 0x1c(%rax), %eax
cmpl $0x0, %eax
setne %al
movzbl %al, %esi
andl $0x1, %esi
callq 0x32d0
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl 0x1b(%rax), %eax
cmpl $0x0, %eax
setne %al
movzbl %al, %esi
andl $0x1, %esi
callq 0x3480
movq -0x30(%rbp), %rax
movzbl 0x1d(%rax), %eax
cmpl $0xff, %eax
je 0x223c4
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl 0x1d(%rax), %eax
andl $0x3, %eax
movzbl %al, %esi
callq 0x3050
jmp 0x223d2
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x3050
cmpq $0x0, -0x38(%rbp)
je 0x2251d
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rax
movzbl 0x3(%rax), %eax
shll $0x8, %eax
movq -0x38(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
orl %ecx, %eax
movzwl %ax, %esi
callq 0x30d0
movq -0x10(%rbp), %rax
cmpl $0x1, 0x1114(%rax)
jne 0x2247b
movl $0x0, -0x74(%rbp)
cmpl $0x10, -0x74(%rbp)
jge 0x22479
movq -0x10(%rbp), %rdi
addq $0x870, %rdi            # imm = 0x870
movl -0x74(%rbp), %eax
shll $0x10, %eax
movslq %eax, %rsi
movabsq $0x30000000000, %rax    # imm = 0x30000000000
orq %rax, %rsi
callq 0x3160
movq -0x10(%rbp), %rdi
addq $0x870, %rdi            # imm = 0x870
movq -0x38(%rbp), %rax
movslq -0x74(%rbp), %rcx
movzbl 0x9(%rax,%rcx), %eax
shll $0x10, %eax
movslq %eax, %rsi
movabsq $0x10000000000, %rax    # imm = 0x10000000000
orq %rax, %rsi
callq 0x3160
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x22412
jmp 0x2247b
movq $0x14000000, -0x80(%rbp) # imm = 0x14000000
movq -0x80(%rbp), %rax
andq $-0x10000, %rax         # imm = 0xFFFF0000
orq $0xfffd, %rax           # imm = 0xFFFD
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
andq $-0xff0001, %rax        # imm = 0xFF00FFFF
movq -0x38(%rbp), %rcx
movzbl 0x8(%rcx), %ecx
shll $0x10, %ecx
movslq %ecx, %rcx
andq $0xff0000, %rcx         # imm = 0xFF0000
orq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rsi
movq -0x10(%rbp), %rdx
movl $0x4, %edi
callq 0x20960
movq -0x80(%rbp), %rax
andq $-0x10000, %rax         # imm = 0xFFFF0000
orq $0x7ffd, %rax           # imm = 0x7FFD
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
andq $-0xff0001, %rax        # imm = 0xFF00FFFF
movq -0x38(%rbp), %rcx
movzbl 0x5(%rcx), %ecx
shll $0x10, %ecx
movslq %ecx, %rcx
andq $0xff0000, %rcx         # imm = 0xFF0000
orq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rsi
movq -0x10(%rbp), %rdx
movl $0x4, %edi
callq 0x20960
jmp 0x2253e
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzbl 0x7(%rax), %eax
shll $0x8, %eax
movq -0x30(%rbp), %rcx
movzbl 0x6(%rcx), %ecx
orl %ecx, %eax
movzwl %ax, %esi
callq 0x30d0
movq -0x30(%rbp), %rax
movzbl 0xc(%rax), %eax
sarl %eax
andl $0x7, %eax
movslq %eax, %rcx
leaq 0x6e7b(%rip), %rax      # 0x293d0
movl (%rax,%rcx,4), %ecx
andl $0xffd7d7d7, %ecx       # imm = 0xFFD7D7D7
movq -0x10(%rbp), %rax
movl %ecx, 0x1140(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x90, %rsp
popq %rbp
retq
nopw (%rax,%rax)