// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x8048, %rsp           # imm = 0x8048
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x21a0
movq (%rbx), %r14
cmpl $0xfe, %eax
jne 0x7db2
movq 0x180(%rbx), %rdi
callq 0x2130
movq %rax, %r15
movq %r14, %rdi
callq 0x835d
movq %rax, %r14
movq (%rbx), %rdi
callq 0x835d
movq %rax, -0x30(%rbp)
testq %r14, %r14
je 0x8321
addl $0x31, %r15d
movslq %r15d, %rsi
pushq $0x1
popq %rdi
callq 0x21e0
movq %rax, %r12
movq 0x180(%rbx), %r14
callq 0x20f0
leaq 0xa9c0(%rip), %rsi      # 0x125fa
movq %r12, %rdi
movq %r14, %rdx
movl %eax, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0x2370
leaq 0xa6b5(%rip), %rsi      # 0x12308
movq %r12, %rdi
callq 0x2330
movq %rax, -0x58(%rbp)
testq %rax, %rax
je 0x7c7e
movq %rax, %r14
testq %r12, %r12
je 0x7ca3
movq %r12, %rdi
callq 0x2080
movq %r12, %rdi
callq 0x2050
jmp 0x7ca3
callq 0x21f0
movq %rax, %r14
andq $0x0, 0x106a0(%rbx)
movq %rax, -0x58(%rbp)
movq %r12, %rdi
callq 0x2050
testq %r14, %r14
je 0x830e
movq (%rbx), %rsi
pushq $0x11
popq %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x6776
movq (%rbx), %rdi
callq 0x2280
movq (%rbx), %rdi
callq 0x2260
movl %eax, %edi
callq 0x2180
movl %eax, %r15d
leaq 0xa933(%rip), %rsi      # 0x12607
movl %eax, %edi
callq 0x2100
movq %rax, -0x50(%rbp)
testq %rax, %rax
je 0x7d77
movq %r14, -0x40(%rbp)
xorl %r13d, %r13d
leaq -0x8070(%rbp), %r12
movq -0x30(%rbp), %r14
cmpq -0x30(%rbp), %r13
jge 0x7d91
movl $0x8000, %eax           # imm = 0x8000
cmpq %rax, %r14
movl $0x8000, %r15d          # imm = 0x8000
cmovlq %r14, %r15
movq -0x50(%rbp), %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x2200
cltq
cmpq %rax, %r15
jne 0x7d52
movq %r12, %rdi
movq %r15, %rsi
pushq $0x1
popq %rdx
movq -0x40(%rbp), %rcx
callq 0x2390
addq $0x8000, %r13           # imm = 0x8000
addq $-0x8000, %r14          # imm = 0x8000
cmpq $0x1, %rax
je 0x7cfa
movq -0x50(%rbp), %rdi
callq 0x2040
movq -0x40(%rbp), %r14
movq %r14, %rdi
callq 0x2280
movq (%rbx), %rdi
callq 0x2110
movq %r14, (%rbx)
jmp 0x8321
movl %r15d, %edi
callq 0x21b0
movq %r14, %rdi
callq 0x2280
movq (%rbx), %rdi
callq 0x2110
jmp 0x7daf
movq -0x50(%rbp), %rdi
callq 0x2040
movq -0x40(%rbp), %rdi
callq 0x2280
movq (%rbx), %rdi
callq 0x2110
movq -0x58(%rbp), %r14
movq %r14, (%rbx)
pushq $0x2
popq %rcx
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x6776
movq (%rbx), %rdi
callq 0x20b0
movq %rax, -0x50(%rbp)
leaq 0x7b(%rbx), %rax
movq %rax, -0x70(%rbp)
leaq 0xfc(%rbx), %rax
movq %rax, -0x68(%rbp)
movb $0x1, %r13b
xorl %r15d, %r15d
movl $0x0, -0x30(%rbp)
movq $0x0, -0x40(%rbp)
xorl %r12d, %r12d
cmpq -0x50(%rbp), %r12
jge 0x82de
movq (%rbx), %rsi
movq %rbx, %rdi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x6776
movq (%rbx), %rdi
callq 0x21a0
movl %eax, %r14d
movq (%rbx), %rdi
callq 0x835d
cmpl $-0x1, %r14d
je 0x82de
movq %rax, %rdx
cmpl $0x0, -0x30(%rbp)
sete %al
testq %rdx, %rdx
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x82de
testl %r14d, %r14d
setne %al
testb %al, %r13b
jne 0x8321
cmpl $0x8, %r14d
ja 0x82c6
movl %r14d, %eax
leaq 0xa362(%rip), %rcx      # 0x121d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, -0x30(%rbp)
movq -0x40(%rbp), %r13
je 0x7eb2
movq (%rbx), %rdi
movl %r15d, %r14d
movq %rdx, %r15
callq 0x835d
movq %rax, -0x38(%rbp)
movq (%rbx), %rdi
callq 0x835d
movq %r15, %rdx
movl %r14d, %r15d
movq %rax, 0x18(%rbx)
testq %r13, %r13
jne 0x7eb2
movq -0x38(%rbp), %rax
movq %rax, 0x10(%rbx)
incq %r13
movq %r13, -0x40(%rbp)
jmp 0x82c6
orb $0x40, 0x7a(%rbx)
jmp 0x7ee3
cmpl $0x0, -0x30(%rbp)
je 0x8053
pushq $0x1
popq %rax
movl %eax, -0x30(%rbp)
jmp 0x82c6
orb $0x10, 0x7a(%rbx)
jmp 0x7ee3
orb $0x60, 0x7a(%rbx)
movq (%rbx), %rdi
movq %rdx, %r14
callq 0x20b0
movq %r14, %rdx
movq %rax, 0x190(%rbx)
jmp 0x82c6
movl %r15d, -0x44(%rbp)
movq %rdx, -0x38(%rbp)
movq (%rbx), %rdi
callq 0x7490
movl %eax, 0x198(%rbx)
movq 0x1a0(%rbx), %rdi
callq 0x2050
movl 0x198(%rbx), %edi
pushq $0x8
popq %rsi
callq 0x21e0
movq %rax, 0x1a0(%rbx)
movq 0x1a8(%rbx), %rdi
callq 0x2050
movl 0x198(%rbx), %r14d
movq %r14, %rdi
pushq $0x1
popq %rsi
callq 0x21e0
movq %rax, 0x1a8(%rbx)
xorl %r15d, %r15d
xorl %r13d, %r13d
movl %r14d, %eax
cmpq %rax, %r15
jae 0x82be
movq (%rbx), %rdi
callq 0x21a0
testl %eax, %eax
movq 0x1a8(%rbx), %rax
setne (%rax,%r15)
movq (%rbx), %rdi
callq 0x741b
addq %rax, %r13
movq 0x1a0(%rbx), %rax
movq %r13, (%rax,%r15,8)
incq %r15
movl 0x198(%rbx), %r14d
jmp 0x7f5f
testb $0x1, %r13b
je 0x804a
movq %rdx, -0x38(%rbp)
movq (%rbx), %rdi
callq 0x835d
movq %rax, 0x10(%rbx)
movq (%rbx), %rdi
callq 0x835d
movq %rax, 0x18(%rbx)
movl $0x0, -0x30(%rbp)
orq 0x10(%rbx), %rax
sete %r14b
movq (%rbx), %rcx
leaq -0x8070(%rbp), %rdi
pushq $0x8
popq %rsi
pushq $0x1
popq %r13
movq %r13, %rdx
callq 0x20c0
movsd -0x8070(%rbp), %xmm0
movsd 0xa2ff(%rip), %xmm1     # 0x12300
ucomisd %xmm1, %xmm0
setnp %al
sete %cl
andb %al, %cl
movb 0x7a(%rbx), %al
addb %cl, %cl
andb $-0x3, %al
orb %cl, %al
ucomisd %xmm1, %xmm0
movb %al, 0x7a(%rbx)
jne 0x8025
jnp 0x80e6
leaq -0x58(%rbp), %rax
pushq $0x8
popq %rdx
movq %rdx, %rcx
subq $0x1, %rcx
jb 0x80cd
movb -0x8071(%rbp,%rdx), %dl
movb %dl, (%rax)
incq %rax
movq %rcx, %rdx
jmp 0x802f
pushq $0x1
popq %r15
jmp 0x82c6
movq %rdx, -0x38(%rbp)
leaq -0x18(%rdx), %r14
movq (%rbx), %rdi
callq 0x835d
movq %rax, %r13
movq %rax, %rdi
callq 0x2270
movq %rax, -0x30(%rbp)
orb $0x8, 0x7a(%rbx)
movq (%rbx), %rdi
callq 0x835d
movl %eax, 0x38(%rbx)
movl $0x20, 0x68(%rbx)
movq 0x60(%rbx), %rdi
callq 0x2050
movl 0x38(%rbx), %esi
addl $0x7, %esi
shrl $0x3, %esi
pushq $0x1
popq %rdi
callq 0x21e0
movq %rax, 0x60(%rbx)
cmpq %r13, %r14
movl %r15d, -0x44(%rbp)
jne 0x81a0
movq (%rbx), %rcx
movq -0x30(%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
pushq $0x1
popq %rdx
callq 0x20c0
jmp 0x81f1
movsd -0x58(%rbp), %xmm0
ucomisd 0xa226(%rip), %xmm0     # 0x12300
jne 0x8321
jp 0x8321
movl -0x30(%rbp), %eax
movb %r14b, %al
movl %eax, -0x30(%rbp)
movq (%rbx), %rdi
callq 0x835d
movq %rax, 0x20(%rbx)
movq (%rbx), %rdi
callq 0x835d
movq %rax, 0x28(%rbx)
movq (%rbx), %rdi
callq 0x835d
movq %rax, 0x30(%rbx)
movq (%rbx), %rdi
callq 0x835d
movl %eax, 0x38(%rbx)
movq (%rbx), %rdi
movq 0x30(%rbx), %rcx
movl %eax, %eax
subq %rax, %rcx
movq %rcx, 0x40(%rbx)
callq 0x835d
movq %rax, 0x48(%rbx)
movq (%rbx), %rdi
callq 0x21a0
movb %al, 0x78(%rbx)
movq (%rbx), %rcx
movl $0x80, %esi
movq -0x70(%rbp), %rdi
movq %r13, %rdx
callq 0x20c0
xorl %r14d, %r14d
movb %r14b, 0xfb(%rbx)
movq (%rbx), %rcx
movq -0x68(%rbp), %rdi
pushq $0x77
popq %rsi
movq %r13, %rdx
callq 0x20c0
movb %r14b, 0x173(%rbx)
movq (%rbx), %rdi
callq 0x21a0
movb %al, 0x79(%rbx)
movq (%rbx), %rdi
callq 0x835d
movq %rax, 0x178(%rbx)
pushq $0x1
popq %r15
movq -0x38(%rbp), %rdx
jmp 0x82c6
movq %r14, %rdi
callq 0x2270
movq %r14, %rsi
movq %r14, -0x60(%rbp)
movq %rax, %r14
movq %r13, -0x8070(%rbp)
movq (%rbx), %rcx
movq %rax, %rdi
pushq $0x1
popq %rdx
callq 0x20c0
movq -0x30(%rbp), %r13
movq %r13, %rdi
leaq -0x8070(%rbp), %rsi
movq %r14, %rdx
movq -0x60(%rbp), %rcx
callq 0x2120
testl %eax, %eax
jne 0x8339
movq %r14, %rdi
callq 0x2050
movq 0x50(%rbx), %rdi
callq 0x2050
movl 0x38(%rbx), %edi
shlq $0x2, %rdi
callq 0x2270
movq %rax, 0x50(%rbx)
movq 0x58(%rbx), %rdi
callq 0x2050
movl 0x38(%rbx), %r14d
movq %r14, %rdi
callq 0x2270
movq %rax, 0x58(%rbx)
xorl %r15d, %r15d
movl %r14d, %eax
cmpq %rax, %r15
jae 0x8297
movq %r13, %rdi
leaq -0x8070(%rbp), %rsi
callq 0x8398
movslq -0x8070(%rbp), %rcx
testl %eax, %eax
je 0x8276
cmpl $-0x1, %eax
movl $0x0, %edx
cmovel %edx, %eax
movq 0x50(%rbx), %rdx
movl %eax, (%rdx,%r15,4)
movq 0x58(%rbx), %rax
movb $0x10, (%rax,%r15)
movq 0x50(%rbx), %rax
movl (%rax,%r15,4), %eax
cmpl 0x68(%rbx), %eax
jbe 0x828b
movl %eax, 0x68(%rbx)
jmp 0x828b
movq 0x50(%rbx), %rax
movl $0x8, (%rax,%r15,4)
movq 0x58(%rbx), %rax
movb $0x3, (%rax,%r15)
addq %rcx, %r13
incq %r15
movl 0x38(%rbx), %r14d
jmp 0x8226
movq 0x70(%rbx), %rdi
callq 0x2050
movl 0x68(%rbx), %edi
incl %edi
callq 0x2270
movq %rax, 0x70(%rbx)
movq -0x30(%rbp), %rdi
callq 0x2050
movl $0x0, -0x30(%rbp)
movq -0x38(%rbp), %rdx
movl -0x44(%rbp), %r15d
incq %r12
addq %rdx, %r12
xorl %r13d, %r13d
testl %r15d, %r15d
pushq $0x1
popq %r15
jne 0x7df9
jmp 0x8324
testb $0x1, %r13b
movl $0x0, %r13d
jne 0x8324
movq -0x40(%rbp), %rax
cmpq %rax, 0x48(%rbx)
je 0x82f8
movq %rax, 0x48(%rbx)
pushq $0x1
popq %r13
testb $0x8, 0x7a(%rbx)
jne 0x8324
movq %rbx, %rdi
xorl %esi, %esi
callq 0x74d5
jmp 0x8324
addq $0x106a0, %rbx          # imm = 0x106A0
leaq -0x58(%rbp), %rdi
movq %rbx, %rsi
callq 0x3811
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x8048, %rsp           # imm = 0x8048
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xdcb8(%rip), %rcx      # 0x15ff8
movq (%rcx), %rdi
leaq 0xa2c0(%rip), %rsi      # 0x1260a
movl %eax, %edx
xorl %eax, %eax
callq 0x2210
movl $0xff, %edi
callq 0x2380