// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/vcf.c
// Function: get_rlen
static int64_t get_rlen(const bcf_hdr_t *h, bcf1_t *v)
{
    uint8_t *f = (uint8_t*)v->shared.s, *t = NULL,
        *e = (uint8_t*)v->shared.s + v->shared.l;
    int size, type, id, lenid, endid, svlenid, i, bad, gvcf = 0, haveins = 0;
    bcf_info_t *endinfo = NULL, *svleninfo = NULL, end_lcl, svlen_lcl;
    bcf_fmt_t *lenfmt = NULL, len_lcl;

    //holds <ins> allele status for the max no of alleles
    uint8_t insals[8192];
    //pos from info END, fmt LEN, info SVLEN
    hts_pos_t end = 0, end_fmtlen = 0, end_svlen = 0, hpos;
    int64_t len_ref = 0, len = 0, tmp;
    lenid = bcf_hdr_id2int(h, BCF_DT_ID, "LEN");
    svlenid = bcf_hdr_id2int(h, BCF_DT_ID, "SVLEN");
    endid = bcf_hdr_id2int(h, BCF_DT_ID, "END");

    //initialise bytes which are to be used
    memset(insals, 0, 1 + v->n_allele / 8);

    //use decoded data where ever available and where not, get from stream
    if (v->unpacked & BCF_UN_STR || v->d.shared_dirty & BCF1_DIRTY_ALS) {
        for (i = 1; i < v->n_allele; ++i) {
            //checks only alt alleles, with NUL
            if (!strcmp(v->d.allele[i], "<INS>")) {
                //ins allele, note to skip corresponding svlen val
                insals[i >> 3] |= 1 << (i & 7);
                haveins = 1;
            } else if (!strcmp(v->d.allele[i], "<*>") ||
                         !strcmp(v->d.allele[i], "<NON_REF>")) {
                gvcf = 1;   //gvcf present, have to check for LEN field
            }
        }
        f += v->unpack_size[0] + v->unpack_size[1];
        len_ref = v->n_allele ? strlen(v->d.allele[0]) : 0;
    } else if (f < e) {
        //skip ID
        size = bcf_dec_size(f, &f, &type);
        f += size << bcf_type_shift[type];
        // REF, ALT
        for (i = 0; i < v->n_allele; ++i) {
            //check all alleles, w/o NUL
            size = bcf_dec_size(f, &f, &type);
            if (!i) {   //REF length
                len_ref = size;
            } else {
                if (size == 5 && !strncmp((char*)f, "<INS>", size)) {
                    //ins allele, note to skip corresponding svlen val
                    insals[i >> 3] |= 1 << (i & 7);
                    haveins = 1;
                } else if ((size == 3 && !strncmp((char*)f, "<*>", size)) ||
                    (size == 9 && !strncmp((char*)f, "<NON_REF>", size))) {
                    gvcf = 1;   //gvcf present, have to check for LEN field
                }
            }
            f += size << bcf_type_shift[type];
        }
    }
    // FILTER
    if (v->unpacked & BCF_UN_FLT) {
        f += v->unpack_size[2];
    } else if (f < e) {
        size = bcf_dec_size(f, &f, &type);
        f += size << bcf_type_shift[type];
    }
    // INFO
    if (svlenid >= 0 || endid >= 0 ) {  //only if end/svlen present
        if (v->unpacked & BCF_UN_INFO || v->d.shared_dirty & BCF1_DIRTY_INF) {
            endinfo = bcf_get_info(h, v, "END");
            svleninfo = bcf_get_info(h, v, "SVLEN");
        } else if (f < e) {
            for (i = 0; i < v->n_info; ++i) {
                id = bcf_dec_typed_int1(f, &t);
                if (id == endid) {  //END
                    t = bcf_unpack_info_core1(f, &end_lcl);
                    endinfo = &end_lcl;
                    if (svleninfo || svlenid < 0) {
                        break;  //already got svlen or no need to search further
                    }
                } else if (id == svlenid) { //SVLEN
                    t = bcf_unpack_info_core1(f, &svlen_lcl);
                    svleninfo = &svlen_lcl;
                    if (endinfo || endid < 0 ) {
                        break;  //already got end or no need to search further
                    }
                } else {
                    f = t;
                    size = bcf_dec_size(f, &t, &type);
                    t += size << bcf_type_shift[type];
                }
                f = t;
            }
        }
    }
    // FORMAT
    if (lenid >= 0 && gvcf) {
        //with LEN and has gvcf allele
        f = (uint8_t*)v->indiv.s; t = NULL; e = (uint8_t*)v->indiv.s + v->indiv.l;
        if (v->unpacked & BCF_UN_FMT || v->d.indiv_dirty) {
            lenfmt = bcf_get_fmt(h, v, "LEN");
        } else if (f < e) {
            for (i = 0; i < v->n_fmt; ++i) {
                id = bcf_dec_typed_int1(f, &t);
                if (id == lenid) {
                        t = bcf_unpack_fmt_core1(f, v->n_sample, &len_lcl);
                    lenfmt = &len_lcl;
                    break;  //that's all needed
                } else {
                    f = t;
                    size = bcf_dec_size(f, &t, &type);
                    t += size * v->n_sample << bcf_type_shift[type];
                }
                f = t;
            }
        }
    }
    //got required data, find end and rlen
    if (endinfo && endinfo->vptr) { //end position given by info END
        //end info exists, not being deleted
        end = endinfo->v1.i;
        switch(endinfo->type) {
            case BCF_BT_INT8:  end = end == bcf_int8_missing ? 0 : end;  break;
            case BCF_BT_INT16: end = end == bcf_int16_missing ? 0 : end; break;
            case BCF_BT_INT32: end = end == bcf_int32_missing ? 0 : end; break;
            case BCF_BT_INT64: end = end == bcf_int64_missing ? 0 : end; break;
            default: end = 0; break; //invalid
        }
    }

    if (svleninfo && svleninfo->vptr) {
        //svlen info exists, not being deleted
        bad = 0;
        //get largest svlen, except <ins>; expects to be . for non SV alleles
        for (i = 0; i < svleninfo->len && i + 1 < v->n_allele; ++i) {
            switch(svleninfo->type) {
                case BCF_BT_INT8:
                    tmp = ((int8_t*)svleninfo->vptr)[i];
                    tmp = tmp == bcf_int8_missing ? 0 : tmp;
                break;
                case BCF_BT_INT16:
                    tmp = ((int16_t*)svleninfo->vptr)[i];
                    tmp = tmp == bcf_int16_missing ? 0 : tmp;
                break;
                case BCF_BT_INT32:
                    tmp = ((int32_t*)svleninfo->vptr)[i];
                    tmp = tmp == bcf_int32_missing ? 0 : tmp;
                break;
                case BCF_BT_INT64:
                    tmp = ((int64_t*)svleninfo->vptr)[i];
                    tmp = tmp == bcf_int64_missing ? 0 : tmp;
                break;
                default: //invalid
                    tmp = 0;
                    bad = 1;
                break;
            }
            if (bad) {  //stop svlen check
                len = 0;
                break;
            }
            //expects only SV will have valid svlen and rest have '.'
            if ((haveins) && (insals[i >> 3] & (1 << ((i + 1) & 7)))) {
                continue;   //skip svlen for <ins>
            }
            tmp = tmp < 0 ? llabs(tmp) : tmp;
            if (len < tmp) len = tmp;
        }
    }
    if ((!svleninfo || !len) && end) { //no svlen, infer from end
        len = end > v->pos ? end - v->pos - 1 : 0;
    }
    end_svlen = v->pos + len + 1;   //end position found from SVLEN

    len = 0;
    if (lenfmt && lenfmt->p) {
        //fmt len exists, not being deleted, has gvcf and version >= 4.5
        int j = 0;
        int64_t offset = 0;
        bad = 0;
        for (i = 0; i < v->n_sample; ++i) {
            for (j = 0; j < lenfmt->n; ++j) {
                switch(lenfmt->type) {
                case BCF_BT_INT8:
                    tmp = (((int8_t*)lenfmt->p + offset))[j];
                    tmp = tmp == bcf_int8_missing ? 0 : tmp;
                break;
                case BCF_BT_INT16:
                    tmp = ((int16_t*)(lenfmt->p + offset))[j];
                    tmp = tmp == bcf_int16_missing ? 0 : tmp;
                break;
                case BCF_BT_INT32:
                    tmp = ((int32_t*)(lenfmt->p + offset))[j];
                    tmp = tmp == bcf_int32_missing ? 0 : tmp;
                break;
                case BCF_BT_INT64:
                    tmp = ((int64_t*)(lenfmt->p + offset))[j];
                    tmp = tmp == bcf_int64_missing ? 0 : tmp;
                break;
                default: //invalid
                    bad = 1;
                break;
                }
                if (bad) {  //stop LEN check
                    len = 0;
                    break;
                }
                //assumes only gvcf have valid LEN
                if (len < tmp) len = tmp;
            }
            offset += j << bcf_type_shift[lenfmt->type];
        }
    }
    if ((!lenfmt || !len) && end) { //no fmt len, infer from end
        len = end > v->pos ? end - v->pos : 0;
    }
    end_fmtlen = v->pos + len;  //end position found from LEN

    //get largest pos, based on END, SVLEN, fmt LEN and length using it
    hpos = end < end_svlen ?
            end_svlen < end_fmtlen ? end_fmtlen : end_svlen :
            end < end_fmtlen ? end_fmtlen : end;
    len = hpos - v->pos;

    //NOTE: 'end' calculation be in sync with tbx.c:tbx_parse1

    /* rlen to be calculated based on version, END, SVLEN, fmt LEN, ref len.
    Relevance of these fields vary across different vcf versions.
    Many times, these info/fmt fields are used without version updates;
    hence these fields are used for calculation disregarding vcf version */
    return len < len_ref ? len_ref : len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x21f0, %rsp           # imm = 0x21F0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
addq 0x20(%rcx), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x4c(%rbp)
movl $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0xb8(%rbp)
movq $0x0, -0x20e8(%rbp)
movq $0x0, -0x20f0(%rbp)
movq $0x0, -0x20f8(%rbp)
movq $0x0, -0x2108(%rbp)
movq $0x0, -0x2110(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
leaq 0xc1393(%rip), %rdx     # 0x10827b
callq 0x3e820
movl %eax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
leaq 0xc137c(%rip), %rdx     # 0x108279
callq 0x3e820
movl %eax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
leaq 0xc1363(%rip), %rdx     # 0x108275
callq 0x3e820
movl %eax, -0x3c(%rbp)
leaq -0x20e0(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x10, %rax
andq $0xffff, %rax           # imm = 0xFFFF
movl $0x8, %ecx
cltd
idivl %ecx
addl $0x1, %eax
movslq %eax, %rdx
xorl %esi, %esi
callq 0x4240
movq -0x10(%rbp), %rax
movl 0xbc(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x46f70
movq -0x10(%rbp), %rax
movl 0xb0(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x470bc
movl $0x1, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
shrq $0x10, %rcx
andq $0xffff, %rcx           # imm = 0xFFFF
cmpl %ecx, %eax
jge 0x47049
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0x44(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xc21c1(%rip), %rsi     # 0x109170
callq 0x46b0
cmpl $0x0, %eax
jne 0x46fe8
movl -0x44(%rbp), %ecx
andl $0x7, %ecx
movl $0x1, %edx
shll %cl, %edx
movl -0x44(%rbp), %eax
sarl $0x3, %eax
cltq
movzbl -0x20e0(%rbp,%rax), %ecx
orl %edx, %ecx
movb %cl, -0x20e0(%rbp,%rax)
movl $0x1, -0x50(%rbp)
jmp 0x47039
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0x44(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xc2174(%rip), %rsi     # 0x109176
callq 0x46b0
cmpl $0x0, %eax
je 0x47030
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0x44(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xc2154(%rip), %rsi     # 0x10917a
callq 0x46b0
cmpl $0x0, %eax
jne 0x47037
movl $0x1, -0x4c(%rbp)
jmp 0x47039
jmp 0x4703b
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x46f77
movq -0x10(%rbp), %rax
movl 0xc0(%rax), %ecx
movq -0x10(%rbp), %rax
addl 0xc4(%rax), %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x10, %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpl $0x0, %eax
je 0x4709e
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movq (%rax), %rdi
callq 0x41a0
movq %rax, -0x2130(%rbp)
jmp 0x470a9
xorl %eax, %eax
movq %rax, -0x2130(%rbp)
jmp 0x470a9
movq -0x2130(%rbp), %rax
movq %rax, -0x2108(%rbp)
jmp 0x4721e
movq -0x18(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x4721c
movq -0x18(%rbp), %rdi
leaq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x454d0
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movslq -0x30(%rbp), %rdx
leaq 0xde564(%rip), %rcx     # 0x125650
movzbl (%rcx,%rdx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
shrq $0x10, %rcx
andq $0xffff, %rcx           # imm = 0xFFFF
cmpl %ecx, %eax
jge 0x4721a
movq -0x18(%rbp), %rdi
leaq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x454d0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x44(%rbp)
jne 0x47151
movslq -0x2c(%rbp), %rax
movq %rax, -0x2108(%rbp)
jmp 0x471e8
cmpl $0x5, -0x2c(%rbp)
jne 0x4719f
movq -0x18(%rbp), %rdi
movslq -0x2c(%rbp), %rdx
leaq 0xc200a(%rip), %rsi     # 0x109170
callq 0x41f0
cmpl $0x0, %eax
jne 0x4719f
movl -0x44(%rbp), %ecx
andl $0x7, %ecx
movl $0x1, %edx
shll %cl, %edx
movl -0x44(%rbp), %eax
sarl $0x3, %eax
cltq
movzbl -0x20e0(%rbp,%rax), %ecx
orl %edx, %ecx
movb %cl, -0x20e0(%rbp,%rax)
movl $0x1, -0x50(%rbp)
jmp 0x471e6
cmpl $0x3, -0x2c(%rbp)
jne 0x471be
movq -0x18(%rbp), %rdi
movslq -0x2c(%rbp), %rdx
leaq 0xc1fc2(%rip), %rsi     # 0x109176
callq 0x41f0
cmpl $0x0, %eax
je 0x471dd
cmpl $0x9, -0x2c(%rbp)
jne 0x471e4
movq -0x18(%rbp), %rdi
movslq -0x2c(%rbp), %rdx
leaq 0xc1fa7(%rip), %rsi     # 0x10917a
callq 0x41f0
cmpl $0x0, %eax
jne 0x471e4
movl $0x1, -0x4c(%rbp)
jmp 0x471e6
jmp 0x471e8
movl -0x2c(%rbp), %eax
movslq -0x30(%rbp), %rdx
leaq 0xde45a(%rip), %rcx     # 0x125650
movzbl (%rcx,%rdx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x47109
jmp 0x4721c
jmp 0x4721e
movq -0x10(%rbp), %rax
movl 0xbc(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x4724a
movq -0x10(%rbp), %rax
movl 0xc8(%rax), %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
jmp 0x4728e
movq -0x18(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x4728c
movq -0x18(%rbp), %rdi
leaq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x454d0
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movslq -0x30(%rbp), %rdx
leaq 0xde3da(%rip), %rcx     # 0x125650
movzbl (%rcx,%rdx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
jmp 0x4728e
cmpl $0x0, -0x40(%rbp)
jge 0x4729e
cmpl $0x0, -0x3c(%rbp)
jl 0x47407
movq -0x10(%rbp), %rax
movl 0xbc(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x472c2
movq -0x10(%rbp), %rax
movl 0xb0(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x472f7
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq 0xc0fa4(%rip), %rdx     # 0x108275
callq 0x4fe90
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq 0xc0f90(%rip), %rdx     # 0x108279
callq 0x4fe90
movq %rax, -0x60(%rbp)
jmp 0x47405
movq -0x18(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x47403
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
andq $0xffff, %rcx           # imm = 0xFFFF
cmpl %ecx, %eax
jge 0x47401
movq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x49e70
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jne 0x47371
movq -0x18(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x48900
movq %rax, -0x20(%rbp)
leaq -0x88(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x4736a
cmpl $0x0, -0x40(%rbp)
jge 0x4736f
jmp 0x47401
jmp 0x473eb
movl -0x34(%rbp), %eax
cmpl -0x40(%rbp), %eax
jne 0x473a9
movq -0x18(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x48900
movq %rax, -0x20(%rbp)
leaq -0xb0(%rbp), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x473a5
cmpl $0x0, -0x3c(%rbp)
jge 0x473a7
jmp 0x47401
jmp 0x473e9
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x454d0
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movslq -0x30(%rbp), %rdx
leaq 0xde27d(%rip), %rcx     # 0x125650
movzbl (%rcx,%rdx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
jmp 0x473eb
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x4730c
jmp 0x47403
jmp 0x47405
jmp 0x47407
cmpl $0x0, -0x38(%rbp)
jl 0x4756a
cmpl $0x0, -0x4c(%rbp)
je 0x4756a
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x10(%rbp), %rcx
addq 0x38(%rcx), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl 0xbc(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x47462
movq -0x10(%rbp), %rax
cmpl $0x0, 0xb4(%rax)
je 0x47482
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq 0xc0e0a(%rip), %rdx     # 0x10827b
callq 0x4fd40
movq %rax, -0xb8(%rbp)
jmp 0x47568
movq -0x18(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x47566
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
shrq $0x20, %rcx
andq $0xff, %rcx
cmpl %ecx, %eax
jge 0x47564
movq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x49e70
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x38(%rbp), %eax
jne 0x474ff
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x28, %rax
movl %eax, %esi
leaq -0xd8(%rbp), %rdx
callq 0x414a0
movq %rax, -0x20(%rbp)
leaq -0xd8(%rbp), %rax
movq %rax, -0xb8(%rbp)
jmp 0x47564
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x454d0
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
shrq $0x28, %rcx
imull %ecx, %eax
movslq -0x30(%rbp), %rdx
leaq 0xde118(%rip), %rcx     # 0x125650
movzbl (%rcx,%rdx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x47497
jmp 0x47566
jmp 0x47568
jmp 0x4756a
cmpq $0x0, -0x58(%rbp)
je 0x476b0
movq -0x58(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x476b0
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20e8(%rbp)
movq -0x58(%rbp), %rax
movl 0x4(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x2138(%rbp)
subl $0x3, %eax
ja 0x476a3
movq -0x2138(%rbp), %rax
leaq 0xbf9b8(%rip), %rcx     # 0x106f74
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpq $-0x80, -0x20e8(%rbp)
jne 0x475da
xorl %eax, %eax
movq %rax, -0x2140(%rbp)
jmp 0x475e8
movq -0x20e8(%rbp), %rax
movq %rax, -0x2140(%rbp)
movq -0x2140(%rbp), %rax
movq %rax, -0x20e8(%rbp)
jmp 0x476ae
cmpq $-0x8000, -0x20e8(%rbp) # imm = 0x8000
jne 0x47613
xorl %eax, %eax
movq %rax, -0x2148(%rbp)
jmp 0x47621
movq -0x20e8(%rbp), %rax
movq %rax, -0x2148(%rbp)
movq -0x2148(%rbp), %rax
movq %rax, -0x20e8(%rbp)
jmp 0x476ae
cmpq $-0x80000000, -0x20e8(%rbp) # imm = 0x80000000
jne 0x47649
xorl %eax, %eax
movq %rax, -0x2150(%rbp)
jmp 0x47657
movq -0x20e8(%rbp), %rax
movq %rax, -0x2150(%rbp)
movq -0x2150(%rbp), %rax
movq %rax, -0x20e8(%rbp)
jmp 0x476ae
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
cmpq %rax, -0x20e8(%rbp)
jne 0x47685
xorl %eax, %eax
movq %rax, -0x2158(%rbp)
jmp 0x47693
movq -0x20e8(%rbp), %rax
movq %rax, -0x2158(%rbp)
movq -0x2158(%rbp), %rax
movq %rax, -0x20e8(%rbp)
jmp 0x476ae
movq $0x0, -0x20e8(%rbp)
jmp 0x476b0
cmpq $0x0, -0x60(%rbp)
je 0x47959
movq -0x60(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x47959
movl $0x0, -0x48(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %ecx
movq -0x60(%rbp), %rdx
xorl %eax, %eax
cmpl 0x20(%rdx), %ecx
movb %al, -0x2159(%rbp)
jge 0x47710
movl -0x44(%rbp), %eax
addl $0x1, %eax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
shrq $0x10, %rcx
andq $0xffff, %rcx           # imm = 0xFFFF
cmpl %ecx, %eax
setl %al
movb %al, -0x2159(%rbp)
movb -0x2159(%rbp), %al
testb $0x1, %al
jne 0x4771f
jmp 0x47957
movq -0x60(%rbp), %rax
movl 0x4(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x2168(%rbp)
subl $0x3, %eax
ja 0x47890
movq -0x2168(%rbp), %rax
leaq 0xbf83c(%rip), %rcx     # 0x106f84
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x44(%rbp), %rcx
movsbq (%rax,%rcx), %rax
movq %rax, -0x2118(%rbp)
cmpq $-0x80, -0x2118(%rbp)
jne 0x4777e
xorl %eax, %eax
movq %rax, -0x2170(%rbp)
jmp 0x4778c
movq -0x2118(%rbp), %rax
movq %rax, -0x2170(%rbp)
movq -0x2170(%rbp), %rax
movq %rax, -0x2118(%rbp)
jmp 0x478a2
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x44(%rbp), %rcx
movswq (%rax,%rcx,2), %rax
movq %rax, -0x2118(%rbp)
cmpq $-0x8000, -0x2118(%rbp) # imm = 0x8000
jne 0x477cf
xorl %eax, %eax
movq %rax, -0x2178(%rbp)
jmp 0x477dd
movq -0x2118(%rbp), %rax
movq %rax, -0x2178(%rbp)
movq -0x2178(%rbp), %rax
movq %rax, -0x2118(%rbp)
jmp 0x478a2
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x44(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
movq %rax, -0x2118(%rbp)
cmpq $-0x80000000, -0x2118(%rbp) # imm = 0x80000000
jne 0x4781f
xorl %eax, %eax
movq %rax, -0x2180(%rbp)
jmp 0x4782d
movq -0x2118(%rbp), %rax
movq %rax, -0x2180(%rbp)
movq -0x2180(%rbp), %rax
movq %rax, -0x2118(%rbp)
jmp 0x478a2
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x44(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x2118(%rbp)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
cmpq %rax, -0x2118(%rbp)
jne 0x47872
xorl %eax, %eax
movq %rax, -0x2188(%rbp)
jmp 0x47880
movq -0x2118(%rbp), %rax
movq %rax, -0x2188(%rbp)
movq -0x2188(%rbp), %rax
movq %rax, -0x2118(%rbp)
jmp 0x478a2
movq $0x0, -0x2118(%rbp)
movl $0x1, -0x48(%rbp)
cmpl $0x0, -0x48(%rbp)
je 0x478b8
movq $0x0, -0x2110(%rbp)
jmp 0x47957
cmpl $0x0, -0x50(%rbp)
je 0x478e9
movl -0x44(%rbp), %eax
sarl $0x3, %eax
cltq
movzbl -0x20e0(%rbp,%rax), %eax
movl -0x44(%rbp), %ecx
addl $0x1, %ecx
andl $0x7, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x478e9
jmp 0x47949
cmpq $0x0, -0x2118(%rbp)
jge 0x4790d
movq -0x2118(%rbp), %rax
movq %rax, %rcx
negq %rcx
cmovnsq %rcx, %rax
movq %rax, -0x2190(%rbp)
jmp 0x4791b
movq -0x2118(%rbp), %rax
movq %rax, -0x2190(%rbp)
movq -0x2190(%rbp), %rax
movq %rax, -0x2118(%rbp)
movq -0x2110(%rbp), %rax
cmpq -0x2118(%rbp), %rax
jge 0x47947
movq -0x2118(%rbp), %rax
movq %rax, -0x2110(%rbp)
jmp 0x47949
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x476d8
jmp 0x47959
cmpq $0x0, -0x60(%rbp)
je 0x4796a
cmpq $0x0, -0x2110(%rbp)
jne 0x479b8
cmpq $0x0, -0x20e8(%rbp)
je 0x479b8
movq -0x20e8(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jle 0x4799f
movq -0x20e8(%rbp), %rax
movq -0x10(%rbp), %rcx
subq (%rcx), %rax
subq $0x1, %rax
movq %rax, -0x2198(%rbp)
jmp 0x479aa
xorl %eax, %eax
movq %rax, -0x2198(%rbp)
jmp 0x479aa
movq -0x2198(%rbp), %rax
movq %rax, -0x2110(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
addq -0x2110(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20f8(%rbp)
movq $0x0, -0x2110(%rbp)
cmpq $0x0, -0xb8(%rbp)
je 0x47c8a
movq -0xb8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x47c8a
movl $0x0, -0x211c(%rbp)
movq $0x0, -0x2128(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
shrq $0x28, %rcx
cmpl %ecx, %eax
jge 0x47c88
movl $0x0, -0x211c(%rbp)
movl -0x211c(%rbp), %eax
movq -0xb8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x47c4c
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x21a0(%rbp)
subl $0x3, %eax
ja 0x47bfe
movq -0x21a0(%rbp), %rax
leaq 0xbf512(%rip), %rcx     # 0x106f94
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0xb8(%rbp), %rax
movq 0x10(%rax), %rax
addq -0x2128(%rbp), %rax
movslq -0x211c(%rbp), %rcx
movsbq (%rax,%rcx), %rax
movq %rax, -0x2118(%rbp)
cmpq $-0x80, -0x2118(%rbp)
jne 0x47ac5
xorl %eax, %eax
movq %rax, -0x21a8(%rbp)
jmp 0x47ad3
movq -0x2118(%rbp), %rax
movq %rax, -0x21a8(%rbp)
movq -0x21a8(%rbp), %rax
movq %rax, -0x2118(%rbp)
jmp 0x47c05
movq -0xb8(%rbp), %rax
movq 0x10(%rax), %rax
addq -0x2128(%rbp), %rax
movslq -0x211c(%rbp), %rcx
movswq (%rax,%rcx,2), %rax
movq %rax, -0x2118(%rbp)
cmpq $-0x8000, -0x2118(%rbp) # imm = 0x8000
jne 0x47b23
xorl %eax, %eax
movq %rax, -0x21b0(%rbp)
jmp 0x47b31
movq -0x2118(%rbp), %rax
movq %rax, -0x21b0(%rbp)
movq -0x21b0(%rbp), %rax
movq %rax, -0x2118(%rbp)
jmp 0x47c05
movq -0xb8(%rbp), %rax
movq 0x10(%rax), %rax
addq -0x2128(%rbp), %rax
movslq -0x211c(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
movq %rax, -0x2118(%rbp)
cmpq $-0x80000000, -0x2118(%rbp) # imm = 0x80000000
jne 0x47b80
xorl %eax, %eax
movq %rax, -0x21b8(%rbp)
jmp 0x47b8e
movq -0x2118(%rbp), %rax
movq %rax, -0x21b8(%rbp)
movq -0x21b8(%rbp), %rax
movq %rax, -0x2118(%rbp)
jmp 0x47c05
movq -0xb8(%rbp), %rax
movq 0x10(%rax), %rax
addq -0x2128(%rbp), %rax
movslq -0x211c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x2118(%rbp)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
cmpq %rax, -0x2118(%rbp)
jne 0x47be0
xorl %eax, %eax
movq %rax, -0x21c0(%rbp)
jmp 0x47bee
movq -0x2118(%rbp), %rax
movq %rax, -0x21c0(%rbp)
movq -0x21c0(%rbp), %rax
movq %rax, -0x2118(%rbp)
jmp 0x47c05
movl $0x1, -0x48(%rbp)
cmpl $0x0, -0x48(%rbp)
je 0x47c18
movq $0x0, -0x2110(%rbp)
jmp 0x47c4c
movq -0x2110(%rbp), %rax
cmpq -0x2118(%rbp), %rax
jge 0x47c36
movq -0x2118(%rbp), %rax
movq %rax, -0x2110(%rbp)
jmp 0x47c38
movl -0x211c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x211c(%rbp)
jmp 0x47a40
movl -0x211c(%rbp), %eax
movq -0xb8(%rbp), %rcx
movslq 0xc(%rcx), %rdx
leaq 0xdd9ec(%rip), %rcx     # 0x125650
movzbl (%rcx,%rdx), %ecx
shll %cl, %eax
cltq
addq -0x2128(%rbp), %rax
movq %rax, -0x2128(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x47a1f
jmp 0x47c8a
cmpq $0x0, -0xb8(%rbp)
je 0x47c9e
cmpq $0x0, -0x2110(%rbp)
jne 0x47ce8
cmpq $0x0, -0x20e8(%rbp)
je 0x47ce8
movq -0x20e8(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jle 0x47ccf
movq -0x20e8(%rbp), %rax
movq -0x10(%rbp), %rcx
subq (%rcx), %rax
movq %rax, -0x21c8(%rbp)
jmp 0x47cda
xorl %eax, %eax
movq %rax, -0x21c8(%rbp)
jmp 0x47cda
movq -0x21c8(%rbp), %rax
movq %rax, -0x2110(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
addq -0x2110(%rbp), %rax
movq %rax, -0x20f0(%rbp)
movq -0x20e8(%rbp), %rax
cmpq -0x20f8(%rbp), %rax
jge 0x47d4b
movq -0x20f8(%rbp), %rax
cmpq -0x20f0(%rbp), %rax
jge 0x47d2d
movq -0x20f0(%rbp), %rax
movq %rax, -0x21d0(%rbp)
jmp 0x47d3b
movq -0x20f8(%rbp), %rax
movq %rax, -0x21d0(%rbp)
movq -0x21d0(%rbp), %rax
movq %rax, -0x21d8(%rbp)
jmp 0x47d87
movq -0x20e8(%rbp), %rax
cmpq -0x20f0(%rbp), %rax
jge 0x47d6b
movq -0x20f0(%rbp), %rax
movq %rax, -0x21e0(%rbp)
jmp 0x47d79
movq -0x20e8(%rbp), %rax
movq %rax, -0x21e0(%rbp)
movq -0x21e0(%rbp), %rax
movq %rax, -0x21d8(%rbp)
movq -0x21d8(%rbp), %rax
movq %rax, -0x2100(%rbp)
movq -0x2100(%rbp), %rax
movq -0x10(%rbp), %rcx
subq (%rcx), %rax
movq %rax, -0x2110(%rbp)
movq -0x2110(%rbp), %rax
cmpq -0x2108(%rbp), %rax
jge 0x47dca
movq -0x2108(%rbp), %rax
movq %rax, -0x21e8(%rbp)
jmp 0x47dd8
movq -0x2110(%rbp), %rax
movq %rax, -0x21e8(%rbp)
movq -0x21e8(%rbp), %rax
addq $0x21f0, %rsp           # imm = 0x21F0
popq %rbp
retq
nopl (%rax,%rax)