// File: /workspace/github_c_makefile_star2_O0/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
subq $0xe0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x10000, -0x48(%rbp)   # imm = 0x10000
cmpq $0x0, -0x20(%rbp)
jne 0xbdc5
movl $0x0, -0x4(%rbp)
jmp 0xc7c1
movq -0x20(%rbp), %rax
movl $0x20, 0x68(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0xbdf7
movq -0x20(%rbp), %rdi
callq 0xb000
cmpl $0x0, %eax
jne 0xbdf5
movl $0x0, -0x4(%rbp)
jmp 0xc7c1
jmp 0xbdf7
movl $0x11001, %edi          # imm = 0x11001
callq 0x2280
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xbfc1
leaq -0x5e(%rbp), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x2190
movl $0x1, -0x64(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
addq $0xfc, %rdx
leaq 0x1f2ae(%rip), %rsi     # 0x2b0eb
movb $0x0, %al
callq 0x2220
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
addq $0x7b, %rdx
leaq 0x1f2a4(%rip), %rsi     # 0x2b0fb
movb $0x0, %al
callq 0x2220
movq -0x20(%rbp), %rax
cmpq $0x0, 0x178(%rax)
je 0xbe89
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x178(%rax), %rdx
leaq 0x1f28c(%rip), %rsi     # 0x2b10e
movb $0x0, %al
callq 0x2220
movq -0x20(%rbp), %rax
movsbl 0x78(%rax), %eax
addl $0x15, %eax
movl %eax, %ecx
movq %rcx, -0xc0(%rbp)
subl $0x17, %eax
ja 0xbf9b
movq -0xc0(%rbp), %rax
leaq 0x1ea70(%rip), %rcx     # 0x2a924
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x64, -0x64(%rbp)
movb $0x0, -0x5e(%rbp)
jmp 0xbf9f
movl $0xa, -0x64(%rbp)
movb $0x0, -0x5e(%rbp)
jmp 0xbf9f
movl $0x64, -0x64(%rbp)
movb $0x6d, -0x5e(%rbp)
jmp 0xbf9f
movl $0xa, -0x64(%rbp)
movb $0x6d, -0x5e(%rbp)
jmp 0xbf9f
movl $0x64, -0x64(%rbp)
movb $0x75, -0x5e(%rbp)
jmp 0xbf9f
movl $0xa, -0x64(%rbp)
movb $0x75, -0x5e(%rbp)
jmp 0xbf9f
movl $0x64, -0x64(%rbp)
movb $0x70, -0x5e(%rbp)
jmp 0xbf9f
movl $0xa, -0x64(%rbp)
movb $0x70, -0x5e(%rbp)
jmp 0xbf9f
movl $0x64, -0x64(%rbp)
movb $0x66, -0x5e(%rbp)
jmp 0xbf9f
movl $0xa, -0x64(%rbp)
movb $0x66, -0x5e(%rbp)
jmp 0xbf9f
movl $0x64, -0x64(%rbp)
movb $0x61, -0x5e(%rbp)
jmp 0xbf9f
movl $0xa, -0x64(%rbp)
movb $0x61, -0x5e(%rbp)
jmp 0xbf9f
movl $0x64, -0x64(%rbp)
movb $0x7a, -0x5e(%rbp)
jmp 0xbf9f
movl $0xa, -0x64(%rbp)
movb $0x7a, -0x5e(%rbp)
jmp 0xbf9f
movl $0x64, -0x64(%rbp)
movb $0x6e, -0x5e(%rbp)
jmp 0xbf9f
movl $0xa, -0x64(%rbp)
jmp 0xbf9b
movb $0x6e, -0x5e(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xbfbf
movq -0x18(%rbp), %rdi
movl -0x64(%rbp), %edx
leaq -0x5e(%rbp), %rcx
leaq 0x1f16b(%rip), %rsi     # 0x2b123
movb $0x0, %al
callq 0x2220
jmp 0xbfc1
movq -0x20(%rbp), %rax
movl $0x0, 0x38(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x20(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x2040
movl -0x48(%rbp), %eax
movl %eax, %edi
shlq $0x2, %rdi
callq 0x2280
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rdi
callq 0x2040
movl -0x48(%rbp), %eax
movl %eax, %edi
shlq $0x0, %rdi
callq 0x2280
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x20(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
callq 0xa3d0
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2230
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xc059
jmp 0xc6b4
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x21a0
movl %eax, -0x68(%rbp)
movl -0x68(%rbp), %eax
movq %rax, -0xc8(%rbp)
subq $0xff, %rax
ja 0xc6ad
movq -0xc8(%rbp), %rax
leaq 0x1e8f7(%rip), %rcx     # 0x2a984
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x21a0
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
jl 0xc0b2
cmpl $0x15, -0x38(%rbp)
jle 0xc0b9
movl $0x0, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x21a0
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
je 0xc0ee
movl -0x34(%rbp), %eax
movb %al, %cl
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x30(%rbp)
movb %cl, (%rax)
jmp 0xc0c1
movq -0x30(%rbp), %rax
movb $0x0, (%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x21a0
cmpl $0x0, %eax
je 0xc109
jmp 0xc0f5
cmpq $0x0, -0x18(%rbp)
je 0xc135
movq -0x18(%rbp), %rdi
movslq -0x38(%rbp), %rcx
leaq 0x230d1(%rip), %rax     # 0x2f1f0
movq (%rax,%rcx,8), %rdx
movq -0x28(%rbp), %rcx
leaq 0x1f00d(%rip), %rsi     # 0x2b13b
movb $0x0, %al
callq 0x2220
jmp 0xc6af
cmpq $0x0, -0x18(%rbp)
je 0xc153
movq -0x18(%rbp), %rdi
leaq 0x1f002(%rip), %rsi     # 0x2b14e
movb $0x0, %al
callq 0x2220
jmp 0xc6af
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x21a0
movl %eax, -0x4c(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x21a0
movl %eax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x21a0
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
je 0xc1ad
movl -0x34(%rbp), %eax
movb %al, %cl
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x30(%rbp)
movb %cl, (%rax)
jmp 0xc180
movq -0x30(%rbp), %rax
movb $0x0, (%rax)
movq -0x28(%rbp), %rax
cmpb $0x0, (%rax)
jne 0xc1cd
movq -0x28(%rbp), %rdi
leaq 0x1ef95(%rip), %rsi     # 0x2b15d
callq 0x2090
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xbbb0
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xc3c7
movq -0x20(%rbp), %rax
movb 0x7a(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0xc3c7
movl -0x4c(%rbp), %eax
movq %rax, -0xd0(%rbp)
subq $0x3, %rax
ja 0xc31b
movq -0xd0(%rbp), %rax
leaq 0x1eb64(%rip), %rcx     # 0x2ad84
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, -0x50(%rbp)
jl 0xc235
cmpl $0x3, -0x50(%rbp)
jle 0xc23c
movl $0x0, -0x50(%rbp)
movq -0x18(%rbp), %rdi
movslq -0x4c(%rbp), %rcx
leaq 0x23055(%rip), %rax     # 0x2f2a0
movq (%rax,%rcx,8), %rdx
movslq -0x50(%rbp), %rcx
leaq 0x23066(%rip), %rax     # 0x2f2c0
movq (%rax,%rcx,8), %rcx
movq -0x28(%rbp), %r8
movq -0x58(%rbp), %r9
leaq 0x1eef3(%rip), %rsi     # 0x2b160
movb $0x0, %al
callq 0x2220
jmp 0xc3c5
cmpl $0x0, -0x50(%rbp)
jl 0xc285
cmpl $0xf, -0x50(%rbp)
jle 0xc28c
movl $0x0, -0x50(%rbp)
movq -0x18(%rbp), %rdi
movslq -0x4c(%rbp), %rcx
leaq 0x23005(%rip), %rax     # 0x2f2a0
movq (%rax,%rcx,8), %rdx
movslq -0x50(%rbp), %rcx
leaq 0x23036(%rip), %rax     # 0x2f2e0
movq (%rax,%rcx,8), %rcx
movq -0x28(%rbp), %r8
movq -0x58(%rbp), %r9
leaq 0x1eea3(%rip), %rsi     # 0x2b160
movb $0x0, %al
callq 0x2220
jmp 0xc3c5
cmpl $0x0, -0x50(%rbp)
jl 0xc2d5
cmpl $0x3, -0x50(%rbp)
jle 0xc2dc
movl $0x0, -0x50(%rbp)
movq -0x18(%rbp), %rdi
movslq -0x4c(%rbp), %rcx
leaq 0x22fb5(%rip), %rax     # 0x2f2a0
movq (%rax,%rcx,8), %rdx
movslq -0x50(%rbp), %rcx
leaq 0x23056(%rip), %rax     # 0x2f350
movq (%rax,%rcx,8), %rcx
movq -0x28(%rbp), %r8
movq -0x58(%rbp), %r9
leaq 0x1ee53(%rip), %rsi     # 0x2b160
movb $0x0, %al
callq 0x2220
jmp 0xc3c5
jmp 0xc31b
movl $0x0, -0x4c(%rbp)
cmpl $0x0, -0x50(%rbp)
jne 0xc343
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x1ee47(%rip), %rsi     # 0x2b17e
movb $0x0, %al
callq 0x2220
jmp 0xc3c3
cmpl $0x4, -0x50(%rbp)
je 0xc34f
cmpl $0x5, -0x50(%rbp)
jne 0xc395
movl $0x0, -0x6c(%rbp)
movq -0x28(%rbp), %rdi
leaq -0x6c(%rbp), %rsi
callq 0xbc50
movq %rax, -0x78(%rbp)
movq -0x18(%rbp), %rdi
movslq -0x4c(%rbp), %rcx
leaq 0x22f2a(%rip), %rax     # 0x2f2a0
movq (%rax,%rcx,8), %rdx
movl -0x50(%rbp), %ecx
movq -0x78(%rbp), %r8
movq -0x58(%rbp), %r9
leaq 0x1ee05(%rip), %rsi     # 0x2b191
movb $0x0, %al
callq 0x2220
jmp 0xc3c1
movq -0x18(%rbp), %rdi
movslq -0x4c(%rbp), %rcx
leaq 0x22efc(%rip), %rax     # 0x2f2a0
movq (%rax,%rcx,8), %rdx
movl -0x50(%rbp), %ecx
movq -0x28(%rbp), %r8
movq -0x58(%rbp), %r9
leaq 0x1edf8(%rip), %rsi     # 0x2b1b2
movb $0x0, %al
callq 0x2220
jmp 0xc3c3
jmp 0xc3c5
jmp 0xc3c7
jmp 0xc6af
cmpq $0x0, -0x18(%rbp)
je 0xc3f6
movq -0x20(%rbp), %rax
movb 0x7a(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0xc3f6
movq -0x18(%rbp), %rdi
leaq 0x1ede3(%rip), %rsi     # 0x2b1d2
movb $0x0, %al
callq 0x2220
jmp 0xc6af
movl -0x68(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x21a0
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x21a0
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
je 0xc443
movl -0x34(%rbp), %eax
movb %al, %cl
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x30(%rbp)
movb %cl, (%rax)
jmp 0xc416
movq -0x30(%rbp), %rax
movb $0x0, (%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xbcf0
movl %eax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xbcf0
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jne 0xc5e0
movq -0x20(%rbp), %rax
movl 0x38(%rax), %eax
cmpl -0x48(%rbp), %eax
jne 0xc4ca
movl -0x48(%rbp), %eax
shll %eax
movl %eax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq 0x50(%rax), %rdi
movl -0x48(%rbp), %eax
movl %eax, %esi
shlq $0x2, %rsi
callq 0x22c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rdi
movl -0x48(%rbp), %eax
movl %eax, %esi
shlq $0x0, %rsi
callq 0x22c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x58(%rax)
movl -0x40(%rbp), %edx
movq -0x20(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x20(%rbp), %rcx
movl 0x38(%rcx), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
movb %al, %dl
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x20(%rbp), %rcx
movl 0x38(%rcx), %ecx
movb %dl, (%rax,%rcx)
movl -0x40(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x68(%rcx), %eax
jbe 0xc50c
movl -0x40(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x68(%rax)
cmpl $0x3, -0x3c(%rbp)
je 0xc524
cmpl $0x4, -0x3c(%rbp)
je 0xc524
cmpl $0x14, -0x3c(%rbp)
je 0xc524
cmpl $0x1d, -0x3c(%rbp)
jne 0xc54d
movl -0x3c(%rbp), %edx
movl $0x20, %eax
movl $0x40, %ecx
cmpl $0x1d, %edx
cmovnel %ecx, %eax
movl %eax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x20(%rbp), %rcx
movl 0x38(%rcx), %ecx
movb $0x3, (%rax,%rcx)
cmpq $0x0, -0x18(%rbp)
je 0xc5ce
cmpl $0x12, -0x3c(%rbp)
je 0xc565
movl -0x40(%rbp), %eax
movl %eax, -0xd4(%rbp)
jmp 0xc57a
movl -0x40(%rbp), %eax
subl $0x2, %eax
movl $0x3, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
movl %eax, -0x94(%rbp)
leaq -0x90(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x38(%rax), %esi
addl $0x1, %esi
callq 0xc7d0
movq -0x18(%rbp), %rdi
movslq -0x3c(%rbp), %rcx
leaq 0x22dc5(%rip), %rax     # 0x2f370
movq (%rax,%rcx,8), %rdx
movl -0x94(%rbp), %ecx
leaq -0x90(%rbp), %r8
movq -0x28(%rbp), %r9
leaq 0x1ec1a(%rip), %rsi     # 0x2b1e1
movb $0x0, %al
callq 0x2220
movq -0x20(%rbp), %rax
movl 0x38(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x38(%rax)
jmp 0xc6ab
cmpl $0x3, -0x3c(%rbp)
je 0xc5f8
cmpl $0x4, -0x3c(%rbp)
je 0xc5f8
cmpl $0x14, -0x3c(%rbp)
je 0xc5f8
cmpl $0x1d, -0x3c(%rbp)
jne 0xc621
movl -0x3c(%rbp), %edx
movl $0x20, %eax
movl $0x40, %ecx
cmpl $0x1d, %edx
cmovnel %ecx, %eax
movl %eax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x20(%rbp), %rcx
movl 0x38(%rcx), %ecx
movb $0x3, (%rax,%rcx)
cmpq $0x0, -0x18(%rbp)
je 0xc69b
cmpl $0x12, -0x3c(%rbp)
je 0xc639
movl -0x40(%rbp), %eax
movl %eax, -0xd8(%rbp)
jmp 0xc64e
movl -0x40(%rbp), %eax
subl $0x2, %eax
movl $0x3, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, -0xd8(%rbp)
movl -0xd8(%rbp), %eax
movl %eax, -0xb4(%rbp)
leaq -0xb0(%rbp), %rdi
movl -0x44(%rbp), %esi
callq 0xc7d0
movq -0x18(%rbp), %rdi
movslq -0x3c(%rbp), %rcx
leaq 0x22cf8(%rip), %rax     # 0x2f370
movq (%rax,%rcx,8), %rdx
movl -0xb4(%rbp), %ecx
leaq -0xb0(%rbp), %r8
movq -0x28(%rbp), %r9
leaq 0x1eb4d(%rip), %rsi     # 0x2b1e1
movb $0x0, %al
callq 0x2220
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x40(%rax)
jmp 0xc6af
jmp 0xc6af
jmp 0xc03b
cmpq $0x0, -0x18(%rbp)
je 0xc6cd
movq -0x18(%rbp), %rdi
leaq 0x1eb32(%rip), %rsi     # 0x2b1f8
movb $0x0, %al
callq 0x2220
movq -0x20(%rbp), %rax
cmpl $0x0, 0x38(%rax)
je 0xc6e6
movq -0x20(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, -0xdc(%rbp)
jmp 0xc6f3
movl $0x1, %eax
movl %eax, -0xdc(%rbp)
jmp 0xc6f3
movl -0xdc(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq -0x20(%rbp), %rax
movq 0x50(%rax), %rdi
movl -0x5c(%rbp), %eax
movl %eax, %esi
shlq $0x2, %rsi
callq 0x22c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rdi
movl -0x5c(%rbp), %eax
movl %eax, %esi
shlq $0x0, %rsi
callq 0x22c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x20(%rbp), %rax
movq 0x60(%rax), %rdi
callq 0x2040
movl -0x5c(%rbp), %eax
addl $0x7, %eax
shrl $0x3, %eax
movl %eax, %eax
movl %eax, %esi
movl $0x1, %edi
callq 0x21f0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x20(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0x2040
movq -0x20(%rbp), %rax
movl 0x68(%rax), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
callq 0x2280
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x20(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, %ecx
movq -0x20(%rbp), %rax
addq 0x40(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x28(%rbp), %rdi
callq 0x2040
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax)