// File: /workspace/github_c_makefile_star2_O1/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: fstReaderProcessHier
int fstReaderProcessHier(void *ctx, FILE *fv)
{
struct fstReaderContext *xc = (struct fstReaderContext *)ctx;
char *str;
char *pnt;
int ch, scopetype;
int vartype;
uint32_t len, alias;
/* uint32_t maxvalpos=0; */
unsigned int num_signal_dyn = 65536;
int attrtype, subtype;
uint64_t attrarg;
fstHandle maxhandle_scanbuild;

if(!xc) return(0);

xc->longest_signal_value_len = 32; /* arbitrarily set at 32...this is much longer than an expanded double */

if(!xc->fh)
        {
        if(!fstReaderRecreateHierFile(xc))
                {
                return(0);
                }
        }

str = (char *)malloc(FST_ID_NAM_ATTR_SIZ+1);

if(fv)
        {
        char time_dimension[2] = {0, 0};
        int time_scale = 1;

        fprintf(fv, "$date\n\t%s\n$end\n", xc->date);
        fprintf(fv, "$version\n\t%s\n$end\n", xc->version);
        if(xc->timezero) fprintf(fv, "$timezero\n\t%" PRId64 "\n$end\n", xc->timezero);

        switch(xc->timescale)
                {
                case  2:        time_scale = 100;               time_dimension[0] = 0;   break;
                case  1:        time_scale = 10; /* fallthrough */
                case  0:                                        time_dimension[0] = 0;   break;

                case -1:        time_scale = 100;               time_dimension[0] = 'm'; break;
                case -2:        time_scale = 10; /* fallthrough */
                case -3:                                        time_dimension[0] = 'm'; break;

                case -4:        time_scale = 100;               time_dimension[0] = 'u'; break;
                case -5:        time_scale = 10; /* fallthrough */
                case -6:                                        time_dimension[0] = 'u'; break;

                case -10:       time_scale = 100;               time_dimension[0] = 'p'; break;
                case -11:       time_scale = 10; /* fallthrough */
                case -12:                                       time_dimension[0] = 'p'; break;

                case -13:       time_scale = 100;               time_dimension[0] = 'f'; break;
                case -14:       time_scale = 10; /* fallthrough */
                case -15:                                       time_dimension[0] = 'f'; break;

                case -16:       time_scale = 100;               time_dimension[0] = 'a'; break;
                case -17:       time_scale = 10; /* fallthrough */
                case -18:                                       time_dimension[0] = 'a'; break;

                case -19:       time_scale = 100;               time_dimension[0] = 'z'; break;
                case -20:       time_scale = 10; /* fallthrough */
                case -21:                                       time_dimension[0] = 'z'; break;

                case -7:        time_scale = 100;               time_dimension[0] = 'n'; break;
                case -8:        time_scale = 10; /* fallthrough */
                case -9:
                default:                                        time_dimension[0] = 'n'; break;
                }

        if(fv) fprintf(fv, "$timescale\n\t%d%ss\n$end\n", time_scale, time_dimension);
        }

xc->maxhandle = 0;
xc->num_alias = 0;

free(xc->signal_lens);
xc->signal_lens = (uint32_t *)malloc(num_signal_dyn*sizeof(uint32_t));

free(xc->signal_typs);
xc->signal_typs = (unsigned char *)malloc(num_signal_dyn*sizeof(unsigned char));

fstReaderFseeko(xc, xc->fh, 0, SEEK_SET);
while(!feof(xc->fh))
        {
        int tag = fgetc(xc->fh);
        switch(tag)
                {
                case FST_ST_VCD_SCOPE:
                        scopetype = fgetc(xc->fh);
                        if((scopetype < FST_ST_MIN) || (scopetype > FST_ST_MAX)) scopetype = FST_ST_VCD_MODULE;
                        pnt = str;
                        while((ch = fgetc(xc->fh)))
                                {
                                *(pnt++) = ch;
                                }; /* scopename */
                        *pnt = 0;
                        while(fgetc(xc->fh)) { }; /* scopecomp */

                        if(fv) fprintf(fv, "$scope %s %s $end\n", modtypes[scopetype], str);
                        break;

                case FST_ST_VCD_UPSCOPE:
                        if(fv) fprintf(fv, "$upscope $end\n");
                        break;

                case FST_ST_GEN_ATTRBEGIN:
                        attrtype = fgetc(xc->fh);
                        subtype = fgetc(xc->fh);
                        pnt = str;
                        while((ch = fgetc(xc->fh)))
                                {
                                *(pnt++) = ch;
                                }; /* attrname */
                        *pnt = 0;

                        if(!str[0]) { strcpy(str, "\"\""); }

                        attrarg = fstReaderVarint64(xc->fh);

                        if(fv && xc->use_vcd_extensions)
                                {
                                switch(attrtype)
                                        {
                                        case FST_AT_ARRAY:      if((subtype < FST_AR_NONE) || (subtype > FST_AR_MAX)) subtype = FST_AR_NONE;
                                                                fprintf(fv, "$attrbegin %s %s %s %" PRId64 " $end\n", attrtypes[attrtype], arraytypes[subtype], str, attrarg);
                                                                break;
                                        case FST_AT_ENUM:       if((subtype < FST_EV_SV_INTEGER) || (subtype > FST_EV_MAX)) subtype = FST_EV_SV_INTEGER;
                                                                fprintf(fv, "$attrbegin %s %s %s %" PRId64 " $end\n", attrtypes[attrtype], enumvaluetypes[subtype], str, attrarg);
                                                                break;
                                        case FST_AT_PACK:       if((subtype < FST_PT_NONE) || (subtype > FST_PT_MAX)) subtype = FST_PT_NONE;
                                                                fprintf(fv, "$attrbegin %s %s %s %" PRId64 " $end\n", attrtypes[attrtype], packtypes[subtype], str, attrarg);
                                                                break;
                                        case FST_AT_MISC:
                                        default:                attrtype = FST_AT_MISC;
                                                                if(subtype == FST_MT_COMMENT)
                                                                        {
                                                                        fprintf(fv, "$comment\n\t%s\n$end\n", str);
                                                                        }
                                                                        else
                                                                        {
                                                                        if((subtype == FST_MT_SOURCESTEM)||(subtype == FST_MT_SOURCEISTEM))
                                                                                {
                                                                                int sidx_skiplen_dummy = 0;
                                                                                uint64_t sidx = fstGetVarint64((unsigned char *)str, &sidx_skiplen_dummy);

                                                                                fprintf(fv, "$attrbegin %s %02x %" PRId64 " %" PRId64 " $end\n", attrtypes[attrtype], subtype, sidx, attrarg);
                                                                                }
                                                                                else
                                                                                {
                                                                                fprintf(fv, "$attrbegin %s %02x %s %" PRId64 " $end\n", attrtypes[attrtype], subtype, str, attrarg);
                                                                                }
                                                                        }
                                                                break;
                                        }
                                }
                        break;

                case FST_ST_GEN_ATTREND:
                        if(fv && xc->use_vcd_extensions) fprintf(fv, "$attrend $end\n");
                        break;

                case FST_VT_VCD_EVENT:
                case FST_VT_VCD_INTEGER:
                case FST_VT_VCD_PARAMETER:
                case FST_VT_VCD_REAL:
                case FST_VT_VCD_REAL_PARAMETER:
                case FST_VT_VCD_REG:
                case FST_VT_VCD_SUPPLY0:
                case FST_VT_VCD_SUPPLY1:
                case FST_VT_VCD_TIME:
                case FST_VT_VCD_TRI:
                case FST_VT_VCD_TRIAND:
                case FST_VT_VCD_TRIOR:
                case FST_VT_VCD_TRIREG:
                case FST_VT_VCD_TRI0:
                case FST_VT_VCD_TRI1:
                case FST_VT_VCD_WAND:
                case FST_VT_VCD_WIRE:
                case FST_VT_VCD_WOR:
                case FST_VT_VCD_PORT:
                case FST_VT_VCD_SPARRAY:
                case FST_VT_VCD_REALTIME:
                case FST_VT_GEN_STRING:
                case FST_VT_SV_BIT:
                case FST_VT_SV_LOGIC:
                case FST_VT_SV_INT:
                case FST_VT_SV_SHORTINT:
                case FST_VT_SV_LONGINT:
                case FST_VT_SV_BYTE:
                case FST_VT_SV_ENUM:
                case FST_VT_SV_SHORTREAL:
                        vartype = tag;
                        /* vardir = */ fgetc(xc->fh); /* unused in VCD reader, but need to advance read pointer */
                        pnt = str;
                        while((ch = fgetc(xc->fh)))
                                {
                                *(pnt++) = ch;
                                }; /* varname */
                        *pnt = 0;
                        len = fstReaderVarint32(xc->fh);
                        alias = fstReaderVarint32(xc->fh);

                        if(!alias)
                                {
                                if(xc->maxhandle == num_signal_dyn)
                                        {
                                        num_signal_dyn *= 2;
                                        xc->signal_lens = (uint32_t *)realloc(xc->signal_lens, num_signal_dyn*sizeof(uint32_t));
                                        xc->signal_typs = (unsigned char *)realloc(xc->signal_typs, num_signal_dyn*sizeof(unsigned char));
                                        }
                                xc->signal_lens[xc->maxhandle] = len;
                                xc->signal_typs[xc->maxhandle] = vartype;

                                /* maxvalpos+=len; */
                                if(len > xc->longest_signal_value_len)
                                        {
                                        xc->longest_signal_value_len = len;
                                        }

                                if((vartype == FST_VT_VCD_REAL) || (vartype == FST_VT_VCD_REAL_PARAMETER) || (vartype == FST_VT_VCD_REALTIME) || (vartype == FST_VT_SV_SHORTREAL))
                                        {
                                        len = (vartype != FST_VT_SV_SHORTREAL) ? 64 : 32;
                                        xc->signal_typs[xc->maxhandle] = FST_VT_VCD_REAL;
                                        }
                                if(fv)
                                        {
                                        char vcdid_buf[16];
                                        uint32_t modlen = (vartype != FST_VT_VCD_PORT) ? len : ((len - 2) / 3);
                                        fstVcdID(vcdid_buf, xc->maxhandle+1);
                                        fprintf(fv, "$var %s %" PRIu32 " %s %s $end\n", vartypes[vartype], modlen, vcdid_buf, str);
                                        }
                                xc->maxhandle++;
                                }
                                else
                                {
                                if((vartype == FST_VT_VCD_REAL) || (vartype == FST_VT_VCD_REAL_PARAMETER) || (vartype == FST_VT_VCD_REALTIME) || (vartype == FST_VT_SV_SHORTREAL))
                                        {
                                        len = (vartype != FST_VT_SV_SHORTREAL) ? 64 : 32;
                                        xc->signal_typs[xc->maxhandle] = FST_VT_VCD_REAL;
                                        }
                                if(fv)
                                        {
                                        char vcdid_buf[16];
                                        uint32_t modlen = (vartype != FST_VT_VCD_PORT) ? len : ((len - 2) / 3);
                                        fstVcdID(vcdid_buf, alias);
                                        fprintf(fv, "$var %s %" PRIu32 " %s %s $end\n", vartypes[vartype], modlen, vcdid_buf, str);
                                        }
                                xc->num_alias++;
                                }

                        break;

                default:
                        break;
                }
        }
if(fv) fprintf(fv, "$enddefinitions $end\n");

maxhandle_scanbuild = xc->maxhandle ? xc->maxhandle : 1; /*scan-build warning suppression, in reality we have at least one signal */

xc->signal_lens = (uint32_t *)realloc(xc->signal_lens, maxhandle_scanbuild*sizeof(uint32_t));
xc->signal_typs = (unsigned char *)realloc(xc->signal_typs, maxhandle_scanbuild*sizeof(unsigned char));

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

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

xc->var_count = xc->maxhandle + xc->num_alias;

free(str);
return(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
xorl %r14d, %r14d
testq %rdi, %rdi
je 0x869d
movq %rsi, %r15
movq %rdi, %rbx
movl $0x20, 0x68(%rdi)
cmpq $0x0, 0x8(%rdi)
jne 0x8453
movq %rbx, %rdi
callq 0x7b43
testl %eax, %eax
je 0x869d
movl $0x11001, %edi          # imm = 0x11001
callq 0x2270
movq %rax, %r14
testq %r15, %r15
je 0x8591
movw $0x0, -0x40(%rbp)
leaq 0xfc(%rbx), %rdx
leaq 0xd05a(%rip), %rsi      # 0x154d7
movq %r15, %rdi
xorl %eax, %eax
callq 0x2210
leaq 0x7b(%rbx), %rdx
leaq 0xd055(%rip), %rsi      # 0x154e7
movq %r15, %rdi
xorl %eax, %eax
callq 0x2210
movq 0x178(%rbx), %rdx
testq %rdx, %rdx
je 0x84b9
leaq 0xd04b(%rip), %rsi      # 0x154fa
movq %r15, %rdi
xorl %eax, %eax
callq 0x2210
movzbl 0x78(%rbx), %eax
movl $0x1, %edx
cmpl $0xea, %eax
jle 0x84f1
addl $0xffffff15, %eax       # imm = 0xFFFFFF15
cmpl $0x14, %eax
ja 0x8534
leaq 0xcc92(%rip), %rcx      # 0x1516c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0xa, %edx
movb $0x7a, -0x40(%rbp)
jmp 0x857c
testl %eax, %eax
je 0x8bd8
cmpl $0x1, %eax
je 0x8bd3
cmpl $0x2, %eax
jne 0x8534
movb $0x0, -0x40(%rbp)
jmp 0x8577
movl $0xa, %edx
movb $0x6d, -0x40(%rbp)
jmp 0x857c
movb $0x75, -0x40(%rbp)
jmp 0x8577
movb $0x70, -0x40(%rbp)
jmp 0x8577
movl $0xa, %edx
movb $0x75, -0x40(%rbp)
jmp 0x857c
movl $0xa, %edx
movb $0x6e, -0x40(%rbp)
jmp 0x857c
movb $0x66, -0x40(%rbp)
jmp 0x8577
movb $0x61, -0x40(%rbp)
jmp 0x8577
movb $0x7a, -0x40(%rbp)
jmp 0x8577
movb $0x6e, -0x40(%rbp)
jmp 0x8577
movl $0xa, %edx
movb $0x61, -0x40(%rbp)
jmp 0x857c
movl $0xa, %edx
movb $0x66, -0x40(%rbp)
jmp 0x857c
movl $0xa, %edx
movb $0x70, -0x40(%rbp)
jmp 0x857c
movb $0x6d, -0x40(%rbp)
movl $0x64, %edx
leaq 0xcf8c(%rip), %rsi      # 0x1550f
leaq -0x40(%rbp), %rcx
movq %r15, %rdi
xorl %eax, %eax
callq 0x2210
movq %r15, -0x30(%rbp)
movl $0x0, 0x38(%rbx)
movq $0x0, 0x40(%rbx)
movq 0x50(%rbx), %rdi
callq 0x2050
movl $0x40000, %edi          # imm = 0x40000
callq 0x2270
movq %rax, 0x50(%rbx)
movq 0x58(%rbx), %rdi
callq 0x2050
movl $0x10000, %edi          # imm = 0x10000
callq 0x2270
movq %rax, 0x58(%rbx)
movq 0x8(%rbx), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2320
testl %eax, %eax
jns 0x85ea
orb $0x1, 0x697(%rbx)
movq 0x8(%rbx), %rdi
callq 0x2220
testl %eax, %eax
je 0x86af
movq -0x30(%rbp), %rcx
testq %rcx, %rcx
je 0x861a
leaq 0xcfd9(%rip), %rdi      # 0x155e4
movl $0x15, %esi
movl $0x1, %edx
callq 0x2390
movl 0x38(%rbx), %r15d
cmpl $0x1, %r15d
adcl $0x0, %r15d
movq 0x50(%rbx), %rdi
leaq (,%r15,4), %rsi
callq 0x22c0
movq %rax, 0x50(%rbx)
movq 0x58(%rbx), %rdi
movq %r15, %rsi
callq 0x22c0
movq %rax, 0x58(%rbx)
movq 0x60(%rbx), %rdi
callq 0x2050
addl $0x7, %r15d
shrl $0x3, %r15d
movl $0x1, %edi
movq %r15, %rsi
callq 0x21e0
movq %rax, 0x60(%rbx)
movq 0x70(%rbx), %rdi
callq 0x2050
movl 0x68(%rbx), %edi
incl %edi
callq 0x2270
movq %rax, 0x70(%rbx)
movl 0x38(%rbx), %eax
addq 0x40(%rbx), %rax
movq %rax, 0x30(%rbx)
movq %r14, %rdi
callq 0x2050
movl $0x1, %r14d
movl %r14d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rax
decq %rax
movq %rax, -0x58(%rbp)
movl $0x10000, %eax          # imm = 0x10000
movq %rax, -0x50(%rbp)
leaq -0x40(%rbp), %r15
movq 0x8(%rbx), %rdi
callq 0x21a0
movl %eax, %r13d
cmpl $0x1e, %eax
jae 0x8907
movq 0x8(%rbx), %rdi
callq 0x21a0
movq 0x8(%rbx), %rdi
callq 0x21a0
movq %r14, %r12
testl %eax, %eax
je 0x870b
movq %r14, %r12
movb %al, (%r12)
incq %r12
movq 0x8(%rbx), %rdi
callq 0x21a0
testl %eax, %eax
jne 0x86f7
movb $0x0, (%r12)
movq 0x8(%rbx), %rdi
callq 0x83cd
movl %eax, %r12d
movq 0x8(%rbx), %rdi
callq 0x83cd
testl %eax, %eax
je 0x87dd
cmpl $0x1d, %r13d
ja 0x875c
movl $0x20100018, %ecx       # imm = 0x20100018
btl %r13d, %ecx
jae 0x875c
xorl %r12d, %r12d
cmpl $0x1d, %r13d
setne %r12b
shll $0x5, %r12d
addl $0x20, %r12d
movq 0x58(%rbx), %rcx
movl 0x38(%rbx), %edx
movb $0x3, (%rcx,%rdx)
cmpq $0x0, -0x30(%rbp)
je 0x87d4
cmpl $0x12, %r13d
jne 0x877a
addl $-0x2, %r12d
movl $0xaaaaaaab, %ecx       # imm = 0xAAAAAAAB
imulq %rcx, %r12
shrq $0x21, %r12
movl $0xae4c415d, %r8d       # imm = 0xAE4C415D
movq %r15, %rcx
decl %eax
movq %rax, %rdx
imulq %r8, %rdx
shrq $0x26, %rdx
imull $0x5e, %edx, %esi
movl %eax, %edi
subl %esi, %edi
addb $0x21, %dil
movb %dil, (%rcx)
incq %rcx
cmpl $0x5d, %eax
movl %edx, %eax
ja 0x8783
movb $0x0, (%rcx)
movslq %r13d, %rax
leaq 0x1053b(%rip), %rcx     # 0x18cf0
movq (%rcx,%rax,8), %rdx
movq -0x30(%rbp), %rdi
leaq 0xce09(%rip), %rsi      # 0x155cd
movl %r12d, %ecx
movq %r15, %r8
movq %r14, %r9
xorl %eax, %eax
callq 0x2210
incq 0x40(%rbx)
jmp 0x88f1
movq %r14, %r15
movq -0x50(%rbp), %r14
cmpl %r14d, 0x38(%rbx)
jne 0x8816
addl %r14d, %r14d
movq 0x50(%rbx), %rdi
leaq (,%r14,4), %rsi
callq 0x22c0
movq %rax, 0x50(%rbx)
movq 0x58(%rbx), %rdi
movq %r14, -0x50(%rbp)
movq %r14, %rsi
callq 0x22c0
movq %rax, 0x58(%rbx)
movq 0x50(%rbx), %rax
movl 0x38(%rbx), %ecx
movl %r12d, (%rax,%rcx,4)
movq 0x58(%rbx), %rax
movl 0x38(%rbx), %ecx
movb %r13b, (%rax,%rcx)
cmpl 0x68(%rbx), %r12d
movq %r15, %r14
jbe 0x8839
movl %r12d, 0x68(%rbx)
cmpl $0x1d, %r13d
leaq -0x40(%rbp), %r15
ja 0x886c
movl $0x20100018, %eax       # imm = 0x20100018
btl %r13d, %eax
jae 0x886c
xorl %r12d, %r12d
cmpl $0x1d, %r13d
setne %r12b
shll $0x5, %r12d
addl $0x20, %r12d
movq 0x58(%rbx), %rax
movl 0x38(%rbx), %ecx
movb $0x3, (%rax,%rcx)
cmpq $0x0, -0x30(%rbp)
je 0x88ee
cmpl $0x12, %r13d
jne 0x888a
addl $-0x2, %r12d
movl $0xaaaaaaab, %eax       # imm = 0xAAAAAAAB
imulq %rax, %r12
shrq $0x21, %r12
movl $0xae4c415d, %r8d       # imm = 0xAE4C415D
movl 0x38(%rbx), %eax
movq %r15, %rcx
incl %eax
je 0x88c2
movq %r15, %rcx
decl %eax
movq %rax, %rdx
imulq %r8, %rdx
shrq $0x26, %rdx
imull $0x5e, %edx, %esi
movl %eax, %edi
subl %esi, %edi
addb $0x21, %dil
movb %dil, (%rcx)
incq %rcx
cmpl $0x5d, %eax
movl %edx, %eax
ja 0x889d
movb $0x0, (%rcx)
movslq %r13d, %rax
leaq 0x10421(%rip), %rcx     # 0x18cf0
movq (%rcx,%rax,8), %rdx
movq -0x30(%rbp), %rdi
leaq 0xccef(%rip), %rsi      # 0x155cd
movl %r12d, %ecx
movq %r15, %r8
movq %r14, %r9
xorl %eax, %eax
callq 0x2210
incl 0x38(%rbx)
movq 0x8(%rbx), %rdi
callq 0x2220
testl %eax, %eax
je 0x86c6
jmp 0x85fb
addl $0xffffff04, %r13d      # imm = 0xFFFFFF04
cmpl $0x3, %r13d
ja 0x88f1
leaq 0xc8a5(%rip), %rcx      # 0x151c0
movslq (%rcx,%r13,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%rbx), %rdi
callq 0x21a0
movl %eax, %r13d
movq 0x8(%rbx), %rdi
callq 0x21a0
movq %rax, -0x48(%rbp)
movq 0x8(%rbx), %rdi
callq 0x21a0
movq %r14, %r12
testl %eax, %eax
je 0x8963
movq %r12, %r14
movb %al, (%r14)
incq %r14
movq 0x8(%rbx), %rdi
callq 0x21a0
testl %eax, %eax
jne 0x8950
movb $0x0, (%r14)
movq %r12, %r14
cmpb $0x0, (%r12)
jne 0x897c
movb $0x0, 0x2(%r14)
movw $0x2222, (%r14)         # imm = 0x2222
movq 0x8(%rbx), %rdi
callq 0x8385
cmpq $0x0, -0x30(%rbp)
je 0x88f1
testb $0x1, 0x7a(%rbx)
je 0x88f1
cmpl $0x3, %r13d
movq -0x58(%rbp), %rdi
je 0x8afa
cmpl $0x2, %r13d
je 0x8ac9
cmpl $0x1, %r13d
jne 0x8b3b
movq -0x48(%rbp), %rsi
cmpl $0x4, %esi
movl $0x0, %ecx
cmovael %ecx, %esi
leaq 0xc8d2(%rip), %rdx      # 0x152a4
movslq (%rdx,%rsi,4), %rcx
addq %rdx, %rcx
movq -0x30(%rbp), %rdi
leaq 0xcb68(%rip), %rsi      # 0x1554c
leaq 0xd0b4(%rip), %rdx      # 0x15a9f
jmp 0x8b29
movq 0x8(%rbx), %rdi
callq 0x21a0
movl %eax, %r12d
cmpl $0x16, %eax
movl $0x0, %eax
cmovael %eax, %r12d
movq 0x8(%rbx), %rdi
callq 0x21a0
movq %r14, %r13
testl %eax, %eax
je 0x8a2f
movq %r14, %r13
movb %al, (%r13)
incq %r13
movq 0x8(%rbx), %rdi
callq 0x21a0
testl %eax, %eax
jne 0x8a1b
movb $0x0, (%r13)
movq 0x8(%rbx), %rdi
callq 0x21a0
testl %eax, %eax
jne 0x8a34
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x88f1
movl %r12d, %eax
leaq 0xc7f4(%rip), %rcx      # 0x1524c
movslq (%rcx,%rax,4), %rdx
addq %rcx, %rdx
leaq 0xcac1(%rip), %rsi      # 0x15527
movq %r14, %rcx
xorl %eax, %eax
callq 0x2210
jmp 0x88f1
movq -0x30(%rbp), %rcx
testq %rcx, %rcx
je 0x88f1
movl $0xe, %esi
movl $0x1, %edx
leaq 0xcaa7(%rip), %rdi      # 0x1553a
jmp 0x8abf
cmpq $0x0, -0x30(%rbp)
je 0x88f1
testb $0x1, 0x7a(%rbx)
je 0x88f1
movl $0xe, %esi
movl $0x1, %edx
leaq 0xcb03(%rip), %rdi      # 0x155be
movq -0x30(%rbp), %rcx
callq 0x2390
jmp 0x88f1
movq -0x48(%rbp), %rsi
cmpl $0x10, %esi
movl $0x0, %ecx
cmovael %ecx, %esi
leaq 0xc7d5(%rip), %rdx      # 0x152b4
movslq (%rdx,%rsi,4), %rcx
addq %rdx, %rcx
movq -0x30(%rbp), %rdi
leaq 0xca5b(%rip), %rsi      # 0x1554c
leaq 0xc58d(%rip), %rdx      # 0x15085
jmp 0x8b29
movq -0x48(%rbp), %rsi
cmpl $0x4, %esi
movl $0x0, %ecx
cmovael %ecx, %esi
leaq 0xc7dc(%rip), %rdx      # 0x152ec
movslq (%rdx,%rsi,4), %rcx
addq %rdx, %rcx
movq -0x30(%rbp), %rdi
leaq 0xca2a(%rip), %rsi      # 0x1554c
leaq 0xcde4(%rip), %rdx      # 0x1590d
movq %r14, %r8
movq %rax, %r9
xorl %eax, %eax
callq 0x2210
jmp 0x88f1
movq -0x48(%rbp), %rcx
testl %ecx, %ecx
je 0x8b95
movl %ecx, %edx
andl $-0x2, %edx
cmpl $0x4, %edx
jne 0x8baf
movl $0x1, %edx
movq %rdi, %rsi
cmpb $0x0, 0x1(%rsi)
movq %rdx, %r9
leaq 0x1(%rsi), %rsi
leaq 0x1(%rdx), %rdx
js 0x8b55
xorl %r8d, %r8d
movq %r8, %rdx
shlq $0x7, %rdx
movzbl (%rdi,%r9), %r8d
andl $0x7f, %r8d
orq %rdx, %r8
decq %r9
jne 0x8b69
movq -0x30(%rbp), %rdi
leaq 0xc9f1(%rip), %rsi      # 0x1557d
leaq 0xce23(%rip), %rdx      # 0x159b6
jmp 0x8bc4
movq -0x30(%rbp), %rdi
leaq 0xc9ca(%rip), %rsi      # 0x1556a
movq %r14, %rdx
xorl %eax, %eax
callq 0x2210
jmp 0x88f1
movq -0x30(%rbp), %rdi
leaq 0xc9e4(%rip), %rsi      # 0x1559e
leaq 0xcdf5(%rip), %rdx      # 0x159b6
movq %r14, %r8
movq %rax, %r9
xorl %eax, %eax
callq 0x2210
jmp 0x88f1
movl $0xa, %edx
movb $0x0, -0x40(%rbp)
jmp 0x857c