// File: /workspace/github_c_makefile_star2_O0/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderInit
int fstReaderInit(struct fstReaderContext *xc)
{
off_t blkpos = 0;
off_t endfile;
uint64_t seclen;
int sectype;
uint64_t vc_section_count_actual = 0;
int hdr_incomplete = 0;
int hdr_seen = 0;
int gzread_pass_status = 1;

sectype = fgetc(xc->f);
if(sectype == FST_BL_ZWRAPPER)
        {
        FILE *fcomp;
        off_t offpnt, uclen;
        char gz_membuf[FST_GZIO_LEN];
        gzFile zhandle;
        int zfd;
        int flen = strlen(xc->filename);
        char *hf;

        seclen = fstReaderUint64(xc->f);
        uclen = fstReaderUint64(xc->f);

        if(!seclen) return(0); /* not finished compressing, this is a failed read */

        hf = (char *)calloc(1, flen + 16 + 32 + 1);

        sprintf(hf, "%s.upk_%d_%p", xc->filename, getpid(), (void *)xc);
        fcomp = fopen(hf, "w+b");
        if(!fcomp)
                {
                fcomp = tmpfile_open(&xc->f_nam);
                free(hf); hf = NULL;
                if(!fcomp) { tmpfile_close(&fcomp, &xc->f_nam); return(0); }
                }

#if defined(FST_MACOSX)
        setvbuf(fcomp, (char *)NULL, _IONBF, 0);   /* keeps gzip from acting weird in tandem with fopen */
#endif

#ifdef __MINGW32__
        setvbuf(fcomp, (char *)NULL, _IONBF, 0);   /* keeps gzip from acting weird in tandem with fopen */
        xc->filename_unpacked = hf;
#else
        if(hf)
                {
                unlink(hf);
                free(hf);
                }
#endif

        fstReaderFseeko(xc, xc->f, 1+8+8, SEEK_SET);
#ifndef __MINGW32__
        fflush(xc->f);
#endif

        zfd = dup(fileno(xc->f));
        zhandle = gzdopen(zfd, "rb");
        if(zhandle)
                {
                for(offpnt = 0; offpnt < uclen; offpnt += FST_GZIO_LEN)
                        {
                        size_t this_len = ((uclen - offpnt) > FST_GZIO_LEN) ? FST_GZIO_LEN : (uclen - offpnt);
                        size_t gzreadlen = gzread(zhandle, gz_membuf, this_len);
                        size_t fwlen;

                        if(gzreadlen != this_len)
                                {
                                gzread_pass_status = 0;
                                break;
                                }
                        fwlen = fstFwrite(gz_membuf, this_len, 1, fcomp);
                        if(fwlen != 1)
                                {
                                gzread_pass_status = 0;
                                break;
                                }
                        }
                gzclose(zhandle);
                }
                else
                {
                close(zfd);
                }
        fflush(fcomp);
        fclose(xc->f);
        xc->f = fcomp;
        }

if(gzread_pass_status)
        {
        fstReaderFseeko(xc, xc->f, 0, SEEK_END);
        endfile = ftello(xc->f);

        while(blkpos < endfile)
                {
                fstReaderFseeko(xc, xc->f, blkpos, SEEK_SET);

                sectype = fgetc(xc->f);
                seclen = fstReaderUint64(xc->f);

                if(sectype == EOF)
                        {
                        break;
                        }

                if((hdr_incomplete) && (!seclen))
                        {
                        break;
                        }

                if(!hdr_seen && (sectype != FST_BL_HDR))
                        {
                        break;
                        }

                blkpos++;
                if(sectype == FST_BL_HDR)
                        {
                        if(!hdr_seen)
                                {
                                int ch;
                                double dcheck;

                                xc->start_time = fstReaderUint64(xc->f);
                                xc->end_time = fstReaderUint64(xc->f);

                                hdr_incomplete = (xc->start_time == 0) && (xc->end_time == 0);

                                fstFread(&dcheck, 8, 1, xc->f);
                                xc->double_endian_match = (dcheck == FST_DOUBLE_ENDTEST);
                                if(!xc->double_endian_match)
                                        {
                                        union   {
                                                unsigned char rvs_buf[8];
                                                double d;
                                                } vu;

                                        unsigned char *dcheck_alias = (unsigned char *)&dcheck;
                                        int rvs_idx;

                                        for(rvs_idx=0;rvs_idx<8;rvs_idx++)
                                                {
                                                vu.rvs_buf[rvs_idx] = dcheck_alias[7-rvs_idx];
                                                }
                                        if(vu.d != FST_DOUBLE_ENDTEST)
                                                {
                                                break; /* either corrupt file or wrong architecture (offset +33 also functions as matchword) */
                                                }
                                        }

                                hdr_seen = 1;

                                xc->mem_used_by_writer = fstReaderUint64(xc->f);
                                xc->scope_count = fstReaderUint64(xc->f);
                                xc->var_count = fstReaderUint64(xc->f);
                                xc->maxhandle = fstReaderUint64(xc->f);
                                xc->num_alias = xc->var_count - xc->maxhandle;
                                xc->vc_section_count = fstReaderUint64(xc->f);
                                ch = fgetc(xc->f);
                                xc->timescale = (signed char)ch;
                                fstFread(xc->version, FST_HDR_SIM_VERSION_SIZE, 1, xc->f);
                                xc->version[FST_HDR_SIM_VERSION_SIZE] = 0;
                                fstFread(xc->date, FST_HDR_DATE_SIZE, 1, xc->f);
                                xc->date[FST_HDR_DATE_SIZE] = 0;
                                ch = fgetc(xc->f);
                                xc->filetype = (unsigned char)ch;
                                xc->timezero = fstReaderUint64(xc->f);
                                }
                        }
                else if((sectype == FST_BL_VCDATA) || (sectype == FST_BL_VCDATA_DYN_ALIAS) || (sectype == FST_BL_VCDATA_DYN_ALIAS2))
                        {
                        if(hdr_incomplete)
                                {
                                uint64_t bt = fstReaderUint64(xc->f);
                                xc->end_time = fstReaderUint64(xc->f);

                                if(!vc_section_count_actual) { xc->start_time = bt; }
                                }

                        vc_section_count_actual++;
                        }
                else if(sectype == FST_BL_GEOM)
                        {
                        if(!hdr_incomplete)
                                {
                                uint64_t clen = seclen - 24;
                                uint64_t uclen = fstReaderUint64(xc->f);
                                unsigned char *ucdata = (unsigned char *)malloc(uclen);
                                unsigned char *pnt = ucdata;
                                unsigned int i;

                                xc->contains_geom_section = 1;
                                xc->maxhandle = fstReaderUint64(xc->f);
                                xc->longest_signal_value_len = 32; /* arbitrarily set at 32...this is much longer than an expanded double */

                                free(xc->process_mask);
                                xc->process_mask = (unsigned char *)calloc(1, (xc->maxhandle+7)/8);

                                if(clen != uclen)
                                        {
                                        unsigned char *cdata = (unsigned char *)malloc(clen);
                                        unsigned long destlen = uclen;
                                        unsigned long sourcelen = clen;
                                        int rc;

                                        fstFread(cdata, clen, 1, xc->f);
                                        rc = uncompress(ucdata, &destlen, cdata, sourcelen);

                                        if(rc != Z_OK)
                                                {
                                                fprintf(stderr, FST_APIMESS "fstReaderInit(), geom uncompress rc = %d, exiting.\n", rc);
                                                exit(255);
                                                }

                                        free(cdata);
                                        }
                                        else
                                        {
                                        fstFread(ucdata, uclen, 1, xc->f);
                                        }

                                free(xc->signal_lens);
                                xc->signal_lens = (uint32_t *)malloc(sizeof(uint32_t) * xc->maxhandle);
                                free(xc->signal_typs);
                                xc->signal_typs = (unsigned char *)malloc(sizeof(unsigned char) * xc->maxhandle);

                                for(i=0;i<xc->maxhandle;i++)
                                        {
                                        int skiplen;
                                        uint64_t val = fstGetVarint32(pnt, &skiplen);

                                        pnt += skiplen;

                                        if(val)
                                                {
                                                xc->signal_lens[i] = (val != 0xFFFFFFFF) ? val : 0;
                                                xc->signal_typs[i] = FST_VT_VCD_WIRE;
                                                if(xc->signal_lens[i] > xc->longest_signal_value_len)
                                                        {
                                                        xc->longest_signal_value_len = xc->signal_lens[i];
                                                        }
                                                }
                                                else
                                                {
                                                xc->signal_lens[i] = 8; /* backpatch in real */
                                                xc->signal_typs[i] = FST_VT_VCD_REAL;
                                                /* xc->longest_signal_value_len handled above by overly large init size */
                                                }
                                        }

                                free(xc->temp_signal_value_buf);
                                xc->temp_signal_value_buf = (unsigned char *)malloc(xc->longest_signal_value_len + 1);

                                free(ucdata);
                                }
                        }
                else if(sectype == FST_BL_HIER)
                        {
                        xc->contains_hier_section = 1;
                        xc->hier_pos = ftello(xc->f);
                        }
                else if(sectype == FST_BL_HIER_LZ4DUO)
                        {
                        xc->contains_hier_section_lz4    = 1;
                        xc->contains_hier_section_lz4duo = 1;
                        xc->hier_pos = ftello(xc->f);
                        }
                else if(sectype == FST_BL_HIER_LZ4)
                        {
                        xc->contains_hier_section_lz4 = 1;
                        xc->hier_pos = ftello(xc->f);
                        }
                else if(sectype == FST_BL_BLACKOUT)
                        {
                        uint32_t i;
                        uint64_t cur_bl = 0;
                        uint64_t delta;

                        xc->num_blackouts = fstReaderVarint32(xc->f);
                        free(xc->blackout_times);
                        xc->blackout_times = (uint64_t *)calloc(xc->num_blackouts, sizeof(uint64_t));
                        free(xc->blackout_activity);
                        xc->blackout_activity = (unsigned char *)calloc(xc->num_blackouts, sizeof(unsigned char));

                        for(i=0;i<xc->num_blackouts;i++)
                                {
                                xc->blackout_activity[i] = fgetc(xc->f) != 0;
                                delta = fstReaderVarint64(xc->f);
                                cur_bl += delta;
                                xc->blackout_times[i] = cur_bl;
                                }
                        }

                blkpos += seclen;
                if(!hdr_seen) break;
                }

        if(hdr_seen)
                {
                if(xc->vc_section_count != vc_section_count_actual)
                        {
                        xc->vc_section_count = vc_section_count_actual;
                        }

                if(!xc->contains_geom_section)
                        {
                        fstReaderProcessHier(xc, NULL); /* recreate signal_lens/signal_typs info */
                        }
                }
        }

return(hdr_seen);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x8150, %rsp           # imm = 0x8150
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x1, -0x44(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x21a0
movl %eax, -0x2c(%rbp)
cmpl $0xfe, -0x2c(%rbp)
jne 0xcb3d
movq -0x10(%rbp), %rax
movq 0x180(%rax), %rdi
callq 0x2130
movl %eax, -0x8070(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xd4c0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xd4c0
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xc8c9
movl $0x0, -0x4(%rbp)
jmp 0xd4a8
movl -0x8070(%rbp), %eax
addl $0x10, %eax
addl $0x20, %eax
addl $0x1, %eax
movslq %eax, %rsi
movl $0x1, %edi
callq 0x21f0
movq %rax, -0x8078(%rbp)
movq -0x8078(%rbp), %rax
movq %rax, -0x8138(%rbp)
movq -0x10(%rbp), %rax
movq 0x180(%rax), %rax
movq %rax, -0x8130(%rbp)
callq 0x20f0
movq -0x8138(%rbp), %rdi
movq -0x8130(%rbp), %rdx
movl %eax, %ecx
movq -0x10(%rbp), %r8
leaq 0x1e8e2(%rip), %rsi     # 0x2b20e
movb $0x0, %al
callq 0x2370
movq -0x8078(%rbp), %rdi
leaq 0x1e5db(%rip), %rsi     # 0x2af1c
callq 0x2330
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0xc9a5
movq -0x10(%rbp), %rdi
addq $0x106a0, %rdi          # imm = 0x106A0
callq 0x4bd0
movq %rax, -0x50(%rbp)
movq -0x8078(%rbp), %rdi
callq 0x2040
movq $0x0, -0x8078(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0xc9a3
movq -0x10(%rbp), %rsi
addq $0x106a0, %rsi          # imm = 0x106A0
leaq -0x50(%rbp), %rdi
callq 0x4df0
movl $0x0, -0x4(%rbp)
jmp 0xd4a8
jmp 0xc9a5
cmpq $0x0, -0x8078(%rbp)
je 0xc9c7
movq -0x8078(%rbp), %rdi
callq 0x2070
movq -0x8078(%rbp), %rdi
callq 0x2040
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movl $0x11, %edx
xorl %ecx, %ecx
callq 0xa3d0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2290
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2270
movl %eax, %edi
callq 0x2180
movl %eax, -0x806c(%rbp)
movl -0x806c(%rbp), %edi
leaq 0x1e80b(%rip), %rsi     # 0x2b21b
callq 0x2100
movq %rax, -0x8068(%rbp)
cmpq $0x0, -0x8068(%rbp)
je 0xcb12
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x60(%rbp), %rax
jge 0xcb04
movq -0x60(%rbp), %rax
subq -0x58(%rbp), %rax
cmpq $0x8000, %rax           # imm = 0x8000
jle 0xca5e
movl $0x8000, %eax           # imm = 0x8000
movq %rax, -0x8140(%rbp)
jmp 0xca6d
movq -0x60(%rbp), %rax
subq -0x58(%rbp), %rax
movq %rax, -0x8140(%rbp)
movq -0x8140(%rbp), %rax
movq %rax, -0x8080(%rbp)
movq -0x8068(%rbp), %rdi
leaq -0x8060(%rbp), %rsi
movq -0x8080(%rbp), %rax
movl %eax, %edx
callq 0x2210
cltq
movq %rax, -0x8088(%rbp)
movq -0x8088(%rbp), %rax
cmpq -0x8080(%rbp), %rax
je 0xcab9
movl $0x0, -0x44(%rbp)
jmp 0xcb04
leaq -0x8060(%rbp), %rdi
movq -0x8080(%rbp), %rsi
movq -0x50(%rbp), %rcx
movl $0x1, %edx
callq 0x78b0
movq %rax, -0x8090(%rbp)
cmpq $0x1, -0x8090(%rbp)
je 0xcaef
movl $0x0, -0x44(%rbp)
jmp 0xcb04
jmp 0xcaf1
movq -0x58(%rbp), %rax
addq $0x8000, %rax           # imm = 0x8000
movq %rax, -0x58(%rbp)
jmp 0xca32
movq -0x8068(%rbp), %rdi
callq 0x2030
jmp 0xcb1d
movl -0x806c(%rbp), %edi
callq 0x21b0
movq -0x50(%rbp), %rdi
callq 0x2290
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2110
movq -0x50(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
cmpl $0x0, -0x44(%rbp)
je 0xd4a2
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x2, %ecx
callq 0xa3d0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x20a0
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0xd45d
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x18(%rbp), %rdx
xorl %ecx, %ecx
callq 0xa3d0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x21a0
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xd4c0
movq %rax, -0x28(%rbp)
cmpl $-0x1, -0x2c(%rbp)
jne 0xcbbe
jmp 0xd45d
cmpl $0x0, -0x3c(%rbp)
je 0xcbd0
cmpq $0x0, -0x28(%rbp)
jne 0xcbd0
jmp 0xd45d
cmpl $0x0, -0x40(%rbp)
jne 0xcbe1
cmpl $0x0, -0x2c(%rbp)
je 0xcbe1
jmp 0xd45d
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0xce8a
cmpl $0x0, -0x40(%rbp)
jne 0xce85
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xd4c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xd4c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, 0x10(%rcx)
movb %al, -0x8141(%rbp)
jne 0xcc54
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
sete %al
movb %al, -0x8141(%rbp)
movb -0x8141(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
leaq -0x80a0(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x7990
movsd -0x80a0(%rbp), %xmm0
movsd 0x1d419(%rip), %xmm1    # 0x2a0a8
ucomisd %xmm1, %xmm0
sete %al
setnp %cl
andb %cl, %al
andb $0x1, %al
movzbl %al, %ecx
movq -0x10(%rbp), %rax
movb %cl, %dl
movb 0x7a(%rax), %cl
andb $0x1, %dl
shlb %dl
andb $-0x3, %cl
orb %dl, %cl
movb %cl, 0x7a(%rax)
movq -0x10(%rbp), %rax
movb 0x7a(%rax), %al
shrb %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xcd42
leaq -0x80a0(%rbp), %rax
movq %rax, -0x80b0(%rbp)
movl $0x0, -0x80b4(%rbp)
cmpl $0x8, -0x80b4(%rbp)
jge 0xcd21
movq -0x80b0(%rbp), %rax
movl $0x7, %ecx
subl -0x80b4(%rbp), %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %cl
movslq -0x80b4(%rbp), %rax
movb %cl, -0x80a8(%rbp,%rax)
movl -0x80b4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80b4(%rbp)
jmp 0xcce1
movsd -0x80a8(%rbp), %xmm0
movsd 0x1d377(%rip), %xmm1    # 0x2a0a8
ucomisd %xmm1, %xmm0
jne 0xcd3b
jp 0xcd3b
jmp 0xcd40
jmp 0xd45d
jmp 0xcd42
movl $0x1, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xd4c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xd4c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xd4c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xd4c0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x10(%rbp), %rax
movl 0x38(%rax), %eax
subq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xd4c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x21a0
movl %eax, -0x8094(%rbp)
movl -0x8094(%rbp), %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x78(%rax)
movq -0x10(%rbp), %rdi
addq $0x7b, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl $0x80, %esi
movl $0x1, %edx
callq 0x7990
movq -0x10(%rbp), %rax
movb $0x0, 0xfb(%rax)
movq -0x10(%rbp), %rdi
addq $0xfc, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl $0x77, %esi
movl $0x1, %edx
callq 0x7990
movq -0x10(%rbp), %rax
movb $0x0, 0x173(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x21a0
movl %eax, -0x8094(%rbp)
movl -0x8094(%rbp), %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x79(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xd4c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x178(%rax)
jmp 0xd444
cmpl $0x1, -0x2c(%rbp)
je 0xce9c
cmpl $0x5, -0x2c(%rbp)
je 0xce9c
cmpl $0x8, -0x2c(%rbp)
jne 0xcef5
cmpl $0x0, -0x3c(%rbp)
je 0xcee4
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xd4c0
movq %rax, -0x80c0(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xd4c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
cmpq $0x0, -0x38(%rbp)
jne 0xcee2
movq -0x80c0(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0xcee4
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xd442
cmpl $0x3, -0x2c(%rbp)
jne 0xd24d
cmpl $0x0, -0x3c(%rbp)
jne 0xd248
movq -0x28(%rbp), %rax
subq $0x18, %rax
movq %rax, -0x80c8(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xd4c0
movq %rax, -0x80d0(%rbp)
movq -0x80d0(%rbp), %rdi
callq 0x2280
movq %rax, -0x80d8(%rbp)
movq -0x80d8(%rbp), %rax
movq %rax, -0x80e0(%rbp)
movq -0x10(%rbp), %rax
movb 0x7a(%rax), %cl
andb $-0x9, %cl
orb $0x8, %cl
movb %cl, 0x7a(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xd4c0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x10(%rbp), %rax
movl $0x20, 0x68(%rax)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rdi
callq 0x2040
movq -0x10(%rbp), %rax
movl 0x38(%rax), %eax
addl $0x7, %eax
shrl $0x3, %eax
movl %eax, %eax
movl %eax, %esi
movl $0x1, %edi
callq 0x21f0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x80c8(%rbp), %rax
cmpq -0x80d0(%rbp), %rax
je 0xd077
movq -0x80c8(%rbp), %rdi
callq 0x2280
movq %rax, -0x80f0(%rbp)
movq -0x80d0(%rbp), %rax
movq %rax, -0x80f8(%rbp)
movq -0x80c8(%rbp), %rax
movq %rax, -0x8100(%rbp)
movq -0x80f0(%rbp), %rdi
movq -0x80c8(%rbp), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl $0x1, %edx
callq 0x7990
movq -0x80d8(%rbp), %rdi
movq -0x80f0(%rbp), %rdx
movq -0x8100(%rbp), %rcx
leaq -0x80f8(%rbp), %rsi
callq 0x2120
movl %eax, -0x8104(%rbp)
cmpl $0x0, -0x8104(%rbp)
je 0xd069
movq 0x21fa8(%rip), %rax     # 0x2eff0
movq (%rax), %rdi
movl -0x8104(%rbp), %edx
leaq 0x1e1c6(%rip), %rsi     # 0x2b21e
movb $0x0, %al
callq 0x2220
movl $0xff, %edi
callq 0x2380
movq -0x80f0(%rbp), %rdi
callq 0x2040
jmp 0xd096
movq -0x80d8(%rbp), %rdi
movq -0x80d0(%rbp), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl $0x1, %edx
callq 0x7990
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x2040
movq -0x10(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, %edi
shlq $0x2, %rdi
callq 0x2280
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
callq 0x2040
movq -0x10(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, %edi
shlq $0x0, %rdi
callq 0x2280
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x58(%rax)
movl $0x0, -0x80e4(%rbp)
movl -0x80e4(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jae 0xd211
movq -0x80e0(%rbp), %rdi
leaq -0x8108(%rbp), %rsi
callq 0xd530
movl %eax, %eax
movq %rax, -0x8110(%rbp)
movl -0x8108(%rbp), %ecx
movq -0x80e0(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x80e0(%rbp)
cmpq $0x0, -0x8110(%rbp)
je 0xd1d4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, -0x8110(%rbp)
je 0xd169
movq -0x8110(%rbp), %rax
movq %rax, -0x8150(%rbp)
jmp 0xd174
xorl %eax, %eax
movq %rax, -0x8150(%rbp)
jmp 0xd174
movq -0x8150(%rbp), %rax
movl %eax, %edx
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x80e4(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl -0x80e4(%rbp), %ecx
movb $0x10, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x80e4(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
cmpl 0x68(%rcx), %eax
jbe 0xd1d2
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x80e4(%rbp), %ecx
movl (%rax,%rcx,4), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x68(%rax)
jmp 0xd1fb
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x80e4(%rbp), %ecx
movl $0x8, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl -0x80e4(%rbp), %ecx
movb $0x3, (%rax,%rcx)
jmp 0xd1fd
movl -0x80e4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80e4(%rbp)
jmp 0xd0f4
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0x2040
movq -0x10(%rbp), %rax
movl 0x68(%rax), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
callq 0x2280
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x80d8(%rbp), %rdi
callq 0x2040
jmp 0xd440
cmpl $0x4, -0x2c(%rbp)
jne 0xd282
movq -0x10(%rbp), %rax
movb 0x7a(%rax), %cl
andb $-0x11, %cl
orb $0x10, %cl
movb %cl, 0x7a(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x20a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x190(%rax)
jmp 0xd43e
cmpl $0x7, -0x2c(%rbp)
jne 0xd2c7
movq -0x10(%rbp), %rax
movb 0x7a(%rax), %cl
andb $-0x41, %cl
orb $0x40, %cl
movb %cl, 0x7a(%rax)
movq -0x10(%rbp), %rax
movb 0x7a(%rax), %cl
andb $-0x21, %cl
orb $0x20, %cl
movb %cl, 0x7a(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x20a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x190(%rax)
jmp 0xd43c
cmpl $0x6, -0x2c(%rbp)
jne 0xd2fc
movq -0x10(%rbp), %rax
movb 0x7a(%rax), %cl
andb $-0x41, %cl
orb $0x40, %cl
movb %cl, 0x7a(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x20a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x190(%rax)
jmp 0xd43a
cmpl $0x2, -0x2c(%rbp)
jne 0xd438
movq $0x0, -0x8120(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xbcf0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x198(%rax)
movq -0x10(%rbp), %rax
movq 0x1a0(%rax), %rdi
callq 0x2040
movq -0x10(%rbp), %rax
movl 0x198(%rax), %eax
movl %eax, %edi
movl $0x8, %esi
callq 0x21f0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x1a0(%rax)
movq -0x10(%rbp), %rax
movq 0x1a8(%rax), %rdi
callq 0x2040
movq -0x10(%rbp), %rax
movl 0x198(%rax), %eax
movl %eax, %edi
movl $0x1, %esi
callq 0x21f0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x1a8(%rax)
movl $0x0, -0x8114(%rbp)
movl -0x8114(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x198(%rcx), %eax
jae 0xd436
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x21a0
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movq 0x1a8(%rax), %rax
movl -0x8114(%rbp), %ecx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xbbb0
movq %rax, -0x8128(%rbp)
movq -0x8128(%rbp), %rax
addq -0x8120(%rbp), %rax
movq %rax, -0x8120(%rbp)
movq -0x8120(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x1a0(%rax), %rax
movl -0x8114(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x8114(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8114(%rbp)
jmp 0xd39b
jmp 0xd438
jmp 0xd43a
jmp 0xd43c
jmp 0xd43e
jmp 0xd440
jmp 0xd442
jmp 0xd444
movq -0x28(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpl $0x0, -0x40(%rbp)
jne 0xd458
jmp 0xd45d
jmp 0xcb70
cmpl $0x0, -0x40(%rbp)
je 0xd4a0
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
cmpq -0x38(%rbp), %rax
je 0xd47d
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
movb 0x7a(%rax), %al
shrb $0x3, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xd49e
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xbd90
jmp 0xd4a0
jmp 0xd4a2
movl -0x40(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x8150, %rsp           # imm = 0x8150
popq %rbp
retq
nopw %cs:(%rax,%rax)