// File: /workspace/github_c_makefile_star2_O3/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 0xa7d0
movq 0x180(%rbx), %rdi
callq 0x2130
movq %rax, %r12
movq %r14, %rdi
callq 0xadc0
movq %rax, %r14
movq (%rbx), %rdi
callq 0xadc0
movq %rax, -0x38(%rbp)
testq %r14, %r14
je 0xada1
addl $0x31, %r12d
movslq %r12d, %rsi
movl $0x1, %edi
callq 0x21e0
movq %rax, %r12
movq 0x180(%rbx), %r14
callq 0x20f0
leaq 0x9f82(%rip), %rsi      # 0x145fa
movq %r12, %rdi
movq %r14, %rdx
movl %eax, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0x2370
leaq 0x9c77(%rip), %rsi      # 0x14308
movq %r12, %rdi
callq 0x2330
testq %rax, %rax
je 0xa6b8
movq %rax, %r14
testq %r12, %r12
je 0xa6e0
movq %r12, %rdi
callq 0x2080
movq %r12, %rdi
callq 0x2050
jmp 0xa6e0
callq 0x21f0
movq %rax, %r14
movq $0x0, 0x106a0(%rbx)
movq %rax, -0x58(%rbp)
movq %r12, %rdi
callq 0x2050
testq %r14, %r14
je 0xad8e
movq (%rbx), %rdi
movl $0x11, %esi
xorl %edx, %edx
callq 0x2320
testl %eax, %eax
jns 0xa6fa
orb $0x1, 0x697(%rbx)
movq (%rbx), %rdi
callq 0x2280
movq (%rbx), %rdi
callq 0x2260
movl %eax, %edi
callq 0x2180
movl %eax, %r15d
leaq 0x9eec(%rip), %rsi      # 0x14607
movl %eax, %edi
callq 0x2100
movq %rax, -0x30(%rbp)
testq %rax, %rax
je 0xa7b5
movq %r14, -0x48(%rbp)
cmpq $0x0, -0x38(%rbp)
jle 0xa7a6
xorl %r13d, %r13d
leaq -0x8070(%rbp), %r14
movq -0x38(%rbp), %r12
movl $0x8000, %eax           # imm = 0x8000
cmpq %rax, %r12
movl $0x8000, %r15d          # imm = 0x8000
cmovlq %r12, %r15
movq -0x30(%rbp), %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x2200
cltq
cmpq %rax, %r15
jne 0xad6c
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
movq -0x48(%rbp), %rcx
callq 0x2390
cmpq $0x1, %rax
jne 0xad6c
addq $0x8000, %r13           # imm = 0x8000
addq $-0x8000, %r12          # imm = 0x8000
cmpq -0x38(%rbp), %r13
jl 0xa748
movq -0x30(%rbp), %rdi
callq 0x2040
movq -0x48(%rbp), %r14
jmp 0xa7bd
movl %r15d, %edi
callq 0x21b0
movq %r14, %rdi
callq 0x2280
movq (%rbx), %rdi
callq 0x2110
movq %r14, (%rbx)
movq %r14, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x2320
testl %eax, %eax
jns 0xa7ea
orb $0x1, 0x697(%rbx)
movq (%rbx), %rdi
callq 0x20b0
movq %rax, -0x48(%rbp)
leaq 0x7b(%rbx), %rax
movq %rax, -0x70(%rbp)
leaq 0xfc(%rbx), %rax
movq %rax, -0x68(%rbp)
movb $0x1, %r12b
movabsq $0x100000000, %r15      # imm = 0x100000000
xorl %eax, %eax
movl $0x0, -0x30(%rbp)
movq $0x0, -0x50(%rbp)
xorl %r13d, %r13d
movl %eax, -0x38(%rbp)
cmpq -0x48(%rbp), %r13
jge 0xad3a
movq (%rbx), %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x2320
testl %eax, %eax
jns 0xa84f
orb $0x1, 0x697(%rbx)
movq (%rbx), %rdi
callq 0x21a0
movl %eax, %r14d
movq (%rbx), %rdi
callq 0xadc0
cmpl $-0x1, %r14d
je 0xad3a
movq %rax, %rdx
cmpl $0x0, -0x30(%rbp)
sete %al
testq %rdx, %rdx
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0xad3a
testl %r14d, %r14d
setne %al
testb %al, %r12b
jne 0xada1
cmpl $0x8, %r14d
ja 0xa929
movl %r14d, %eax
leaq 0x9926(%rip), %rcx      # 0x141d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, -0x30(%rbp)
movq -0x50(%rbp), %r12
je 0xa8e8
movq (%rbx), %rdi
movq %rdx, %r14
callq 0xadc0
movq %rax, -0x40(%rbp)
movq (%rbx), %rdi
callq 0xadc0
movq %r14, %rdx
movq %rax, 0x18(%rbx)
testq %r12, %r12
jne 0xa8e8
movq -0x40(%rbp), %rax
movq %rax, 0x10(%rbx)
incq %r12
movq %r12, -0x50(%rbp)
jmp 0xa929
orb $0x40, 0x7a(%rbx)
jmp 0xa914
cmpl $0x0, -0x30(%rbp)
je 0xab66
movl $0x1, -0x30(%rbp)
jmp 0xa929
orb $0x10, 0x7a(%rbx)
jmp 0xa914
orb $0x60, 0x7a(%rbx)
movq (%rbx), %rdi
movq %rdx, %r14
callq 0x20b0
movq %r14, %rdx
movq %rax, 0x190(%rbx)
movl -0x38(%rbp), %eax
incq %r13
addq %rdx, %r13
xorl %r12d, %r12d
testl %eax, %eax
movl $0x1, %eax
jne 0xa82a
jmp 0xada4
movq %rdx, -0x40(%rbp)
movq (%rbx), %rdi
callq 0x9de5
movl %eax, 0x198(%rbx)
movq 0x1a0(%rbx), %rdi
callq 0x2050
movl 0x198(%rbx), %edi
movl $0x8, %esi
callq 0x21e0
movq %rax, 0x1a0(%rbx)
movq 0x1a8(%rbx), %rdi
callq 0x2050
movl 0x198(%rbx), %r14d
movl $0x1, %esi
movq %r14, %rdi
callq 0x21e0
movq %rax, 0x1a8(%rbx)
testq %r14, %r14
je 0xad2e
xorl %r14d, %r14d
xorl %r12d, %r12d
movq (%rbx), %rdi
callq 0x21a0
testl %eax, %eax
movq 0x1a8(%rbx), %rax
setne (%rax,%r14)
movq (%rbx), %rdi
callq 0x9d9d
addq %rax, %r12
movq 0x1a0(%rbx), %rax
movq %r12, (%rax,%r14,8)
incq %r14
movl 0x198(%rbx), %eax
cmpq %rax, %r14
jb 0xa9b2
jmp 0xad2e
movl $0x1, %eax
testb $0x1, %r12b
je 0xa92c
movq %rdx, %r12
movq (%rbx), %rdi
callq 0xadc0
movq %rax, 0x10(%rbx)
movq (%rbx), %rdi
callq 0xadc0
movq %rax, 0x18(%rbx)
movl $0x0, -0x30(%rbp)
orq 0x10(%rbx), %rax
sete %r14b
movq (%rbx), %rcx
movl $0x8, %esi
movl $0x1, %edx
leaq -0x8070(%rbp), %rdi
callq 0x20c0
movsd -0x8070(%rbp), %xmm0
movsd 0x98ad(%rip), %xmm1     # 0x14300
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 0xaa73
jnp 0xaaa6
movl $0x8, %eax
leaq -0x58(%rbp), %rcx
movb -0x8071(%rbp,%rax), %dl
movb %dl, (%rcx)
incq %rcx
decq %rax
jne 0xaa7c
movsd -0x58(%rbp), %xmm0
ucomisd 0x9866(%rip), %xmm0     # 0x14300
jne 0xada1
jp 0xada1
movl -0x30(%rbp), %eax
movb %r14b, %al
movl %eax, -0x30(%rbp)
movq (%rbx), %rdi
callq 0xadc0
movq %rax, 0x20(%rbx)
movq (%rbx), %rdi
callq 0xadc0
movq %rax, 0x28(%rbx)
movq (%rbx), %rdi
callq 0xadc0
movq %rax, 0x30(%rbx)
movq (%rbx), %rdi
callq 0xadc0
movl %eax, 0x38(%rbx)
movq (%rbx), %rdi
movq 0x30(%rbx), %rcx
movl %eax, %eax
subq %rax, %rcx
movq %rcx, 0x40(%rbx)
callq 0xadc0
movq %rax, 0x48(%rbx)
movq (%rbx), %rdi
callq 0x21a0
movb %al, 0x78(%rbx)
movq (%rbx), %rcx
movl $0x80, %esi
movl $0x1, %edx
movq -0x70(%rbp), %rdi
callq 0x20c0
xorl %r14d, %r14d
movb %r14b, 0xfb(%rbx)
movq (%rbx), %rcx
movl $0x77, %esi
movl $0x1, %edx
movq -0x68(%rbp), %rdi
callq 0x20c0
movb %r14b, 0x173(%rbx)
movq (%rbx), %rdi
callq 0x21a0
movb %al, 0x79(%rbx)
movq (%rbx), %rdi
callq 0xadc0
movq %rax, 0x178(%rbx)
movl $0x1, %eax
movq %r12, %rdx
jmp 0xa92c
movq %rdx, -0x40(%rbp)
leaq -0x18(%rdx), %r14
movq (%rbx), %rdi
callq 0xadc0
movq %rax, %r12
movq %rax, %rdi
callq 0x2270
movq %rax, -0x30(%rbp)
orb $0x8, 0x7a(%rbx)
movq (%rbx), %rdi
callq 0xadc0
movl %eax, 0x38(%rbx)
movl $0x20, 0x68(%rbx)
movq 0x60(%rbx), %rdi
callq 0x2050
movl 0x38(%rbx), %esi
addl $0x7, %esi
shrl $0x3, %esi
movl $0x1, %edi
callq 0x21e0
movq %rax, 0x60(%rbx)
cmpq %r12, %r14
jne 0xabd9
movq (%rbx), %rcx
movl $0x1, %edx
movq -0x30(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x20c0
jmp 0xac2c
movq %r14, %rdi
callq 0x2270
movq %r14, %rsi
movq %r14, -0x60(%rbp)
movq %rax, %r14
movq %r12, -0x8070(%rbp)
movq (%rbx), %rcx
movl $0x1, %edx
movq %rax, %rdi
callq 0x20c0
movq -0x30(%rbp), %r12
movq %r12, %rdi
leaq -0x8070(%rbp), %rsi
movq %r14, %rdx
movq -0x60(%rbp), %rcx
callq 0x2120
testl %eax, %eax
jne 0xadb9
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)
testq %r14, %r14
movl $0x0, %r10d
je 0xad08
xorl %eax, %eax
movq %r12, %rcx
leaq -0x1(%rcx), %rsi
movl $0x1, %r8d
xorl %edx, %edx
movq %rsi, %r9
addq %r15, %rdx
cmpb $0x0, 0x1(%r9)
movq %r8, %rdi
leaq 0x1(%r9), %r9
leaq 0x1(%r8), %r8
js 0xac81
xorl %r8d, %r8d
movl %r8d, %r9d
shll $0x7, %r9d
movzbl (%rsi,%rdi), %r8d
andl $0x7f, %r8d
orl %r9d, %r8d
decq %rdi
jne 0xac99
testl %r8d, %r8d
je 0xacdf
cmpl $-0x1, %r8d
cmovel %r10d, %r8d
movq 0x50(%rbx), %rsi
movl %r8d, (%rsi,%rax,4)
movq 0x58(%rbx), %rsi
movb $0x10, (%rsi,%rax)
movq 0x50(%rbx), %rsi
movl (%rsi,%rax,4), %esi
cmpl 0x68(%rbx), %esi
jbe 0xacf2
movl %esi, 0x68(%rbx)
jmp 0xacf2
movq 0x50(%rbx), %rsi
movl $0x8, (%rsi,%rax,4)
movq 0x58(%rbx), %rsi
movb $0x3, (%rsi,%rax)
sarq $0x20, %rdx
addq %rdx, %rcx
incq %rax
movl 0x38(%rbx), %edx
cmpq %rdx, %rax
jb 0xac72
movq 0x70(%rbx), %rdi
callq 0x2050
movl 0x68(%rbx), %edi
incl %edi
callq 0x2270
movq %rax, 0x70(%rbx)
movq %r12, %rdi
callq 0x2050
movl $0x0, -0x30(%rbp)
movl -0x38(%rbp), %eax
movq -0x40(%rbp), %rdx
jmp 0xa92c
testb $0x1, %r12b
movl $0x0, %r12d
jne 0xada4
movq -0x50(%rbp), %rax
cmpq %rax, 0x48(%rbx)
je 0xad54
movq %rax, 0x48(%rbx)
movl $0x1, %r12d
testb $0x8, 0x7a(%rbx)
jne 0xada4
movq %rbx, %rdi
xorl %esi, %esi
callq 0x9e2a
jmp 0xada4
movq -0x30(%rbp), %rdi
callq 0x2040
movq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x2280
movq (%rbx), %rdi
callq 0x2110
movq %r14, (%rbx)
jmp 0xada1
addq $0x106a0, %rbx          # imm = 0x106A0
leaq -0x58(%rbp), %rdi
movq %rbx, %rsi
callq 0x5894
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x8048, %rsp           # imm = 0x8048
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x2aa6