// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20d8, %rsp           # imm = 0x20D8
movq %rsi, %rbx
movq %rdi, %r14
movq 0x20(%rsi), %r15
movq 0x30(%rsi), %rax
movq %rax, 0x40(%rsp)
leaq 0x750d9(%rip), %rdx     # 0xac1ab
xorl %esi, %esi
callq 0x2d3d9
movl %eax, %ebp
leaq 0x750c7(%rip), %rdx     # 0xac1a9
movq %r14, %rdi
xorl %esi, %esi
callq 0x2d3d9
movl %eax, 0x34(%rsp)
leaq 0x750ae(%rip), %rdx     # 0xac1a5
movq %r14, 0x50(%rsp)
movq %r14, %rdi
xorl %esi, %esi
callq 0x2d3d9
movl %eax, 0x18(%rsp)
movq 0x18(%rbx), %r14
movl %r14d, %edx
shrl $0x13, %edx
incl %edx
leaq 0xd0(%rsp), %rdi
xorl %esi, %esi
callq 0x4250
movl 0xbc(%rbx), %edi
testb $0x1, %dil
movq %rbx, 0x28(%rsp)
movl %ebp, 0x4c(%rsp)
movq %r14, 0x8(%rsp)
movl %edi, 0x48(%rsp)
movq %r15, 0xa8(%rsp)
jne 0x371a3
testb $0x2, 0xb0(%rbx)
jne 0x371a3
testq %r15, %r15
jle 0x372a2
movq 0x40(%rsp), %rbx
movzbl (%rbx), %edx
movl %edx, %eax
andl $0xf, %eax
cmpb $-0x11, %dl
jbe 0x372b5
movzbl 0x1(%rbx), %ecx
andl $0xf, %ecx
decl %ecx
cmpl $0x3, %ecx
ja 0x37f0d
leaq 0x73b20(%rip), %rdx     # 0xaacac
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
leaq 0x3(%rbx), %rsi
movsbq 0x2(%rbx), %rdx
jmp 0x372bc
movq $0x0, 0x20(%rsp)
movl $0x0, 0x10(%rsp)
cmpl $0x20000, %r14d         # imm = 0x20000
jb 0x37260
movq 0x8(%rsp), %r15
shrl $0x10, %r15d
movq 0x28(%rsp), %rax
movq 0x88(%rax), %rbx
movl $0x0, 0x10(%rsp)
movl $0x1, %ebp
leaq 0x75eb6(%rip), %r14     # 0xad0a0
leaq 0x75eb5(%rip), %r12     # 0xad0a6
movq $0x0, 0x20(%rsp)
movq (%rbx,%rbp,8), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x46e0
testl %eax, %eax
je 0x3723b
movq %r13, %rdi
movq %r12, %rsi
callq 0x46e0
testl %eax, %eax
je 0x3722f
movq %r13, %rdi
leaq 0x75e84(%rip), %rsi     # 0xad0aa
callq 0x46e0
testl %eax, %eax
jne 0x37258
movl $0x1, %eax
movq %rax, 0x20(%rsp)
jmp 0x37258
movl %ebp, %ecx
andb $0x7, %cl
movb $0x1, %al
shlb %cl, %al
movl %ebp, %ecx
shrl $0x3, %ecx
orb %al, 0xd0(%rsp,%rcx)
movl $0x1, 0x10(%rsp)
incq %rbp
cmpq %rbp, %r15
jne 0x371fa
movq 0x28(%rsp), %rcx
movslq 0xc0(%rcx), %rax
movslq 0xc4(%rcx), %r12
addq %rax, %r12
movq 0x40(%rsp), %rbx
addq %rbx, %r12
movq 0x8(%rsp), %rax
shrq $0x10, %rax
testw %ax, %ax
je 0x372ec
movq 0x88(%rcx), %rax
movq (%rax), %rdi
callq 0x41c0
movq %rax, 0x38(%rsp)
jmp 0x372f5
movq $0x0, 0x20(%rsp)
movq 0x40(%rsp), %rbx
movq %rbx, %r12
jmp 0x372e4
leaq 0x1(%rbx), %rsi
shrl $0x4, %edx
leaq 0x9625d(%rip), %rdi     # 0xcd520
movb (%rax,%rdi), %cl
shll %cl, %edx
movslq %edx, %r12
addq %rsi, %r12
cmpl $0x10000, %r14d         # imm = 0x10000
jae 0x37d27
movq $0x0, 0x20(%rsp)
movl $0x0, 0x10(%rsp)
movq $0x0, 0x38(%rsp)
addq 0xa8(%rsp), %rbx
movl 0x48(%rsp), %edi
testb $0x2, %dil
jne 0x37353
movq %rbx, %rsi
cmpq %rbx, %r12
movq 0x28(%rsp), %rbx
jae 0x3737c
movzbl (%r12), %edx
movl %edx, %eax
andl $0xf, %eax
cmpb $-0x11, %dl
jbe 0x37364
movzbl 0x1(%r12), %ecx
andl $0xf, %ecx
decl %ecx
cmpl $0x3, %ecx
ja 0x37eba
leaq 0x7398e(%rip), %rdx     # 0xaaccc
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movsbq 0x2(%r12), %rdx
addq $0x3, %r12
jmp 0x3736a
movq %rbx, %rsi
movq 0x28(%rsp), %rbx
movslq 0xc8(%rbx), %rax
jmp 0x37379
incq %r12
shrl $0x4, %edx
leaq 0x961af(%rip), %rcx     # 0xcd520
movb (%rax,%rcx), %cl
shll %cl, %edx
movslq %edx, %rax
addq %rax, %r12
movl 0x18(%rsp), %eax
testl %eax, 0x34(%rsp)
js 0x37873
testb $0x4, %dil
jne 0x37881
testb $0x8, 0xb0(%rbx)
jne 0x37881
cmpq %rsi, %r12
jae 0x37873
movq 0x8(%rsp), %r11
andl $0xffff, %r11d          # imm = 0xFFFF
je 0x37873
movq $0x0, 0x8(%rsp)
leaq 0x7397c(%rip), %rax     # 0xaad48
leaq 0x73985(%rip), %rsi     # 0xaad58
leaq 0x80(%rsp), %rdx
leaq 0x9613e(%rip), %rdi     # 0xcd520
leaq 0x7394f(%rip), %r8      # 0xaad38
leaq 0x58(%rsp), %r9
leaq 0x73907(%rip), %rbx     # 0xaacfc
leaq 0x738e0(%rip), %r10     # 0xaacdc
xorl %r14d, %r14d
xorl %r13d, %r13d
movzbl (%r12), %ecx
andl $0xf, %ecx
leal -0x1(%rcx), %r15d
cmpl $0x3, %r15d
ja 0x37450
movslq (%r10,%r15,4), %r15
addq %r10, %r15
jmpq *%r15
leaq 0x2(%r12), %r13
movsbq 0x1(%r12), %r15
jmp 0x37453
leaq 0x5(%r12), %r13
movl 0x1(%r12), %r15d
jmp 0x37453
leaq 0x9(%r12), %r13
movq 0x1(%r12), %r15
jmp 0x37453
leaq 0x3(%r12), %r13
movswq 0x1(%r12), %r15
jmp 0x37453
xorl %r15d, %r15d
cmpl %r15d, 0x18(%rsp)
jne 0x37481
movzbl %cl, %ecx
decl %ecx
cmpl $0x3, %ecx
ja 0x3752e
movslq (%r8,%rcx,4), %rcx
addq %r8, %rcx
jmpq *%rcx
leaq 0x2(%r12), %r13
movsbq 0x1(%r12), %rcx
jmp 0x37533
cmpl %r15d, 0x34(%rsp)
jne 0x374af
movzbl %cl, %ecx
decl %ecx
cmpl $0x3, %ecx
ja 0x37652
movslq (%rbx,%rcx,4), %rcx
addq %rbx, %rcx
jmpq *%rcx
leaq 0x2(%r12), %r13
movsbq 0x1(%r12), %rcx
jmp 0x37657
movzbl (%r13), %ecx
cmpb $-0x11, %cl
jbe 0x374eb
movzbl 0x1(%r13), %r15d
andl $0xf, %r15d
decl %r15d
cmpl $0x3, %r15d
ja 0x377f0
leaq 0x73816(%rip), %r12     # 0xaacec
movslq (%r12,%r15,4), %r15
addq %r12, %r15
jmpq *%r15
movsbq 0x2(%r13), %r15
addq $0x3, %r13
jmp 0x374f5
incq %r13
movl %ecx, %r15d
shrl $0x4, %r15d
andl $0xf, %ecx
movb (%rcx,%rdi), %cl
shll %cl, %r15d
movslq %r15d, %rcx
addq %rcx, %r13
jmp 0x37865
leaq 0x5(%r12), %r13
movl 0x1(%r12), %ecx
jmp 0x37533
leaq 0x9(%r12), %r13
movq 0x1(%r12), %rcx
jmp 0x37533
leaq 0x3(%r12), %r13
movswq 0x1(%r12), %rcx
jmp 0x37533
movq %r12, %r13
xorl %ecx, %ecx
movl %ecx, 0x80(%rsp)
movzbl (%r13), %ecx
andl $0xf, %ecx
movl %ecx, 0x84(%rsp)
movzbl (%r13), %r14d
cmpl $0xef, %r14d
jbe 0x37582
movzbl 0x1(%r13), %r14d
andl $0xf, %r14d
decl %r14d
cmpl $0x3, %r14d
ja 0x37719
movslq (%rax,%r14,4), %r14
addq %rax, %r14
jmpq *%r14
movsbq 0x2(%r13), %r14
addq $0x3, %r13
jmp 0x37589
incq %r13
shrl $0x4, %r14d
movl %r14d, 0xa0(%rsp)
movq %r13, 0x90(%rsp)
movl %r13d, %ebp
subl %r12d, %ebp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movl %ebp, 0x9c(%rsp)
movq $0x0, 0x88(%rsp)
cmpl $0x1, %r14d
jne 0x375f2
movzbl %cl, %ecx
movl $0x1, %r15d
decl %ecx
cmpl $0x6, %ecx
movq 0x8(%rsp), %r14
ja 0x3776d
movslq (%rsi,%rcx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
movsbq (%r13), %rcx
movq %rcx, 0x88(%rsp)
jmp 0x3776d
movslq %r14d, %r15
movb (%rcx,%rdi), %cl
shlq %cl, %r15
movq 0x8(%rsp), %r14
jmp 0x3776d
leaq 0x5(%r12), %r13
movl 0x1(%r12), %ecx
jmp 0x37657
movl 0x2(%r13), %r14d
addq $0x6, %r13
jmp 0x37589
leaq 0x9(%r12), %r13
movq 0x1(%r12), %rcx
jmp 0x37657
movq 0x2(%r13), %r14
addq $0xa, %r13
jmp 0x37589
leaq 0x3(%r12), %r13
movswq 0x1(%r12), %rcx
jmp 0x37657
movswq 0x2(%r13), %r14
addq $0x4, %r13
jmp 0x37589
movq %r12, %r13
xorl %ecx, %ecx
movl %ecx, 0x58(%rsp)
movzbl (%r13), %ecx
andl $0xf, %ecx
movl %ecx, 0x5c(%rsp)
movzbl (%r13), %r15d
cmpl $0xef, %r15d
jbe 0x376a8
movzbl 0x1(%r13), %r15d
andl $0xf, %r15d
decl %r15d
cmpl $0x3, %r15d
ja 0x377f8
leaq 0x7367a(%rip), %rbp     # 0xaad0c
movslq (%rbp,%r15,4), %r15
addq %rbp, %r15
jmpq *%r15
movsbq 0x2(%r13), %r15
addq $0x3, %r13
jmp 0x376af
incq %r13
shrl $0x4, %r15d
movl %r15d, 0x78(%rsp)
movq %r13, 0x68(%rsp)
movl %r13d, %ebp
subl %r12d, %ebp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movl %ebp, 0x74(%rsp)
movq $0x0, 0x60(%rsp)
cmpl $0x1, %r15d
jne 0x3770b
movzbl %cl, %ecx
movl $0x1, %r15d
decl %ecx
cmpl $0x6, %ecx
ja 0x37840
leaq 0x73629(%rip), %r12     # 0xaad1c
movslq (%r12,%rcx,4), %rcx
addq %r12, %rcx
jmpq *%rcx
movsbq (%r13), %rcx
movq %rcx, 0x60(%rsp)
jmp 0x37840
movslq %r15d, %r15
movb (%rcx,%rdi), %cl
shlq %cl, %r15
jmp 0x37840
xorl %r14d, %r14d
jmp 0x37589
movswq (%r13), %rcx
movq %rcx, 0x88(%rsp)
movl $0x2, %r15d
jmp 0x3776d
movss (%r13), %xmm0
movss %xmm0, 0x88(%rsp)
jmp 0x37753
movslq (%r13), %rcx
movq %rcx, 0x88(%rsp)
movl $0x4, %r15d
jmp 0x3776d
movq (%r13), %rcx
movq %rcx, 0x88(%rsp)
movl $0x8, %r15d
movl %r15d, 0x98(%rsp)
testq %r14, %r14
jne 0x37f17
movq %rdx, %r14
cmpl $0x0, 0x34(%rsp)
js 0x378b2
addq %r15, %r13
movq %rdx, %r14
movq $0x0, 0x8(%rsp)
jmp 0x37865
movl 0x2(%r13), %r15d
addq $0x6, %r13
jmp 0x374f5
movl 0x2(%r13), %r15d
addq $0x6, %r13
jmp 0x376af
movq 0x2(%r13), %r15
addq $0xa, %r13
jmp 0x374f5
movq 0x2(%r13), %r15
addq $0xa, %r13
jmp 0x376af
movswq 0x2(%r13), %r15
addq $0x4, %r13
jmp 0x374f5
movswq 0x2(%r13), %r15
addq $0x4, %r13
jmp 0x376af
xorl %r15d, %r15d
jmp 0x374f5
xorl %r15d, %r15d
jmp 0x376af
movswq (%r13), %rcx
movq %rcx, 0x60(%rsp)
movl $0x2, %r15d
jmp 0x37840
movss (%r13), %xmm0
movss %xmm0, 0x60(%rsp)
jmp 0x37829
movslq (%r13), %rcx
movq %rcx, 0x60(%rsp)
movl $0x4, %r15d
jmp 0x37840
movq (%r13), %rcx
movq %rcx, 0x60(%rsp)
movl $0x8, %r15d
movl %r15d, 0x70(%rsp)
testq %r14, %r14
jne 0x37fc5
movq %r9, 0x8(%rsp)
cmpl $0x0, 0x18(%rsp)
js 0x378b2
addq %r15, %r13
xorl %r14d, %r14d
movq %r9, 0x8(%rsp)
movq %r13, %r12
decl %r11d
jne 0x37402
jmp 0x378b2
xorl %r14d, %r14d
movq $0x0, 0x8(%rsp)
jmp 0x378b2
leaq 0x7491d(%rip), %rdx     # 0xac1a5
movq 0x50(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x40498
movq %rax, %r14
leaq 0x74907(%rip), %rdx     # 0xac1a9
movq %r15, %rdi
movq %rbx, %rsi
callq 0x40498
movq %rax, 0x8(%rsp)
movl 0x4c(%rsp), %ebx
testl %ebx, %ebx
setns %al
cmpl $0x0, 0x20(%rsp)
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x37901
movq 0x28(%rsp), %r15
testb $0x8, 0xbc(%r15)
movq 0x8(%rsp), %r12
jne 0x378e8
cmpl $0x0, 0xb4(%r15)
je 0x37952
leaq 0x748bc(%rip), %rdx     # 0xac1ab
movq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x403f9
movq %rax, %r13
jmp 0x3790e
xorl %r13d, %r13d
movq 0x28(%rsp), %r15
movq 0x8(%rsp), %r12
testq %r14, %r14
je 0x37944
cmpq $0x0, 0x10(%r14)
je 0x37944
movl 0x4(%r14), %ecx
decl %ecx
cmpl $0x3, %ecx
ja 0x37944
movq 0x8(%r14), %rax
leaq 0x73484(%rip), %rdx     # 0xaadb4
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
xorl %ecx, %ecx
cmpq $-0x80, %rax
jmp 0x37a7f
movq $0x0, 0x18(%rsp)
jmp 0x37a88
cmpq $0x0, 0x38(%r15)
jle 0x37e87
movq 0x18(%r15), %rdx
movq %rdx, %r8
shrq $0x20, %r8
andl $0xff, %r8d
je 0x37e87
movq 0x48(%r15), %rdi
shrq $0x28, %rdx
xorl %r13d, %r13d
leaq 0x733fd(%rip), %r9      # 0xaad84
leaq 0x95b92(%rip), %rsi     # 0xcd520
leaq 0x733df(%rip), %r10     # 0xaad74
xorl %r11d, %r11d
movzbl (%rdi), %eax
andl $0xf, %eax
leal -0x1(%rax), %ecx
cmpl $0x3, %ecx
ja 0x379d8
movslq (%r10,%rcx,4), %rcx
addq %r10, %rcx
jmpq *%rcx
leaq 0x2(%rdi), %r11
movsbq 0x1(%rdi), %rcx
jmp 0x379da
leaq 0x5(%rdi), %r11
movl 0x1(%rdi), %ecx
jmp 0x379da
leaq 0x9(%rdi), %r11
movq 0x1(%rdi), %rcx
jmp 0x379da
leaq 0x3(%rdi), %r11
movswq 0x1(%rdi), %rcx
jmp 0x379da
xorl %ecx, %ecx
cmpl %ecx, %ebx
je 0x37ec1
movzbl (%r11), %ecx
cmpb $-0x11, %cl
jbe 0x37a0e
movzbl 0x1(%r11), %eax
andl $0xf, %eax
decl %eax
cmpl $0x3, %eax
ja 0x37a56
movslq (%r9,%rax,4), %rax
addq %r9, %rax
jmpq *%rax
movsbq 0x2(%r11), %rax
addq $0x3, %r11
jmp 0x37a16
incq %r11
movl %ecx, %eax
shrl $0x4, %eax
andl $0xf, %ecx
imull %edx, %eax
movb (%rcx,%rsi), %cl
shll %cl, %eax
cltq
addq %rax, %r11
movq %r11, %rdi
decl %r8d
jne 0x37998
jmp 0x3790e
movl 0x2(%r11), %eax
addq $0x6, %r11
jmp 0x37a16
movq 0x2(%r11), %rax
addq $0xa, %r11
jmp 0x37a16
movswq 0x2(%r11), %rax
addq $0x4, %r11
jmp 0x37a16
xorl %eax, %eax
jmp 0x37a16
xorl %ecx, %ecx
cmpq $-0x80000000, %rax      # imm = 0x80000000
jmp 0x37a7f
xorl %edx, %edx
movq %rax, %rcx
negq %rcx
cmovnoq %rax, %rdx
movq %rdx, 0x18(%rsp)
jmp 0x37a88
xorl %ecx, %ecx
cmpq $-0x8000, %rax          # imm = 0x8000
cmovneq %rax, %rcx
movq %rcx, 0x18(%rsp)
movl 0x10(%rsp), %r14d
testq %r12, %r12
je 0x37b81
movq 0x10(%r12), %rcx
testq %rcx, %rcx
je 0x37b81
movslq 0x20(%r12), %rdi
xorl %r8d, %r8d
testq %rdi, %rdi
jle 0x37b81
movzwl 0x1a(%r15), %r9d
cmpl $0x1, %r9d
adcl $-0x1, %r9d
movabsq $-0x8000000000000000, %r10 # imm = 0x8000000000000000
leaq 0x732f1(%rip), %rdx     # 0xaadc4
xorl %r11d, %r11d
xorl %esi, %esi
cmpq %r11, %r9
je 0x37b83
movl 0x4(%r12), %eax
decl %eax
cmpl $0x3, %eax
ja 0x37b81
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movzbl (%rcx,%r11), %eax
cmpb $-0x80, %al
cmovel %r8d, %eax
movsbq %al, %rax
jmp 0x37b3f
movl (%rcx,%r11,4), %eax
movl %eax, %ebx
negl %ebx
cmovol %r8d, %eax
cltq
jmp 0x37b3f
movq (%rcx,%r11,8), %rbx
cmpq %r10, %rbx
movl $0x0, %eax
cmovneq %rbx, %rax
jmp 0x37b3f
movzwl (%rcx,%r11,2), %eax
cmpl $0x8000, %eax           # imm = 0x8000
cmovel %r8d, %eax
movswq %ax, %rax
testl %r14d, %r14d
je 0x37b62
movl %r11d, %ebx
shrl $0x3, %ebx
movzbl 0xd0(%rsp,%rbx), %ebx
leal 0x1(%r11), %ebp
movzbl %bpl, %ebp
andl $0x7, %ebp
btl %ebp, %ebx
jb 0x37b73
movq %rax, %rbx
negq %rbx
cmovsq %rax, %rbx
cmpq %rbx, %rsi
cmovleq %rbx, %rsi
incq %r11
cmpq %r11, %rdi
jne 0x37ad8
jmp 0x37b83
xorl %esi, %esi
movq (%r15), %rax
testq %r13, %r13
movq %r13, 0x28(%rsp)
movq %rax, 0x10(%rsp)
je 0x37bb4
movq 0x10(%r13), %rcx
movq %rcx, 0x20(%rsp)
testq %rcx, %rcx
je 0x37bb4
movq 0x18(%r15), %r10
xorl %r11d, %r11d
shrq $0x28, %r10
jne 0x37c42
xorl %r8d, %r8d
movq 0x10(%rsp), %r9
movq %r9, %rax
notq %rax
movq 0x18(%rsp), %rdi
addq %rdi, %rax
xorl %ecx, %ecx
movq %rdi, %rdx
subq %r9, %rdx
cmovleq %rcx, %rax
cmovleq %rcx, %rdx
testq %rdi, %rdi
cmoveq %rsi, %rax
cmoveq %r8, %rdx
testq %rsi, %rsi
cmoveq %rax, %rsi
cmpq $0x0, 0x8(%rsp)
cmoveq %rax, %rsi
leaq (%r9,%rsi), %rcx
testq %r8, %r8
cmoveq %rdx, %r8
cmpq $0x0, 0x28(%rsp)
leaq 0x1(%r9,%rsi), %rax
cmoveq %rdx, %r8
addq %r9, %r8
cmpq %rcx, %rdi
cmovgq %rdi, %rax
cmpq %r8, %rax
cmovleq %r8, %rax
subq %r9, %rax
movq 0x38(%rsp), %rcx
cmpq %rcx, %rax
cmovleq %rcx, %rax
addq $0x20d8, %rsp           # imm = 0x20D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x4(%r13), %edx
movslq 0xc(%r13), %rax
leaq 0x958cf(%rip), %rcx     # 0xcd520
movzbl (%rax,%rcx), %ecx
leal -0x1(%rax), %r15d
leaq 0x73174(%rip), %r12     # 0xaadd4
xorl %r13d, %r13d
xorl %r8d, %r8d
xorl %eax, %eax
xorl %ebp, %ebp
testl %edx, %edx
jle 0x37d01
movq 0x20(%rsp), %rdi
leaq (%rdi,%r13), %r9
testl %eax, %eax
sete %al
xorl %r14d, %r14d
cmpl $0x3, %r15d
ja 0x37d06
movslq (%r12,%r15,4), %rdi
addq %r12, %rdi
jmpq *%rdi
movzbl (%r9,%r14), %edi
cmpb $-0x80, %dil
cmovel %r11d, %edi
movsbq %dil, %rdi
jmp 0x37ce5
movl (%r9,%r14,4), %ebx
movl %ebx, %edi
negl %edi
cmovol %r11d, %ebx
movslq %ebx, %rdi
jmp 0x37ce5
movq (%r9,%r14,8), %rbx
movabsq $-0x8000000000000000, %rdi # imm = 0x8000000000000000
cmpq %rdi, %rbx
movl $0x0, %edi
cmovneq %rbx, %rdi
jmp 0x37ce5
movzwl (%r9,%r14,2), %edi
cmpl $0x8000, %edi           # imm = 0x8000
cmovel %r11d, %edi
movswq %di, %rdi
testb $0x1, %al
je 0x37d06
cmpq %rdi, %r8
cmovleq %rdi, %r8
incq %r14
movb $0x1, %al
cmpq %r14, %rdx
jne 0x37c83
xorl %eax, %eax
movl %edx, %r14d
jmp 0x37d0e
xorl %r14d, %r14d
jmp 0x37d0e
movl $0x1, %eax
xorl %r8d, %r8d
shll %cl, %r14d
movslq %r14d, %rdi
addq %rdi, %r13
incl %ebp
cmpl %r10d, %ebp
jne 0x37c6a
jmp 0x37bb7
shrl $0x10, %r14d
movq $0x0, 0x38(%rsp)
movl $0x0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
xorl %ebp, %ebp
movzbl (%r12), %r15d
cmpb $-0x11, %r15b
jbe 0x37d82
movzbl 0x1(%r12), %eax
andl $0xf, %eax
decl %eax
cmpl $0x3, %eax
ja 0x37e7f
leaq 0x72f4f(%rip), %rcx     # 0xaacbc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movsbq 0x2(%r12), %r13
addq $0x3, %r12
jmp 0x37d8c
incq %r12
movl %r15d, %r13d
shrl $0x4, %r13d
testl %ebp, %ebp
je 0x37de7
cmpl $0x3, %r13d
je 0x37e12
cmpl $0x9, %r13d
je 0x37df1
cmpl $0x5, %r13d
jne 0x37e33
movl $0x5, %edx
movq %r12, %rdi
leaq 0x752eb(%rip), %rsi     # 0xad0a0
callq 0x4200
testl %eax, %eax
jne 0x37dde
movl %ebp, %ecx
andb $0x7, %cl
movl $0x1, 0x10(%rsp)
movl $0x1, %eax
shll %cl, %eax
movl %ebp, %ecx
shrl $0x3, %ecx
orb %al, 0xd0(%rsp,%rcx)
leaq 0x9573b(%rip), %rdi     # 0xcd520
jmp 0x37e33
movslq %r13d, %rax
movq %rax, 0x38(%rsp)
jmp 0x37e33
movl $0x9, %edx
movq %r12, %rdi
leaq 0x752aa(%rip), %rsi     # 0xad0aa
callq 0x4200
leaq 0x95714(%rip), %rdi     # 0xcd520
testl %eax, %eax
jne 0x37e33
jmp 0x37e29
cmpb $0x3c, (%r12)
jne 0x37e33
cmpb $0x2a, 0x1(%r12)
jne 0x37e33
cmpb $0x3e, 0x2(%r12)
jne 0x37e33
movl $0x1, %eax
movq %rax, 0x20(%rsp)
andl $0xf, %r15d
movb (%r15,%rdi), %cl
shll %cl, %r13d
movslq %r13d, %rax
addq %rax, %r12
incl %ebp
cmpl %ebp, %r14d
jne 0x37d47
jmp 0x372f5
movl 0x2(%r12), %r13d
addq $0x6, %r12
jmp 0x37d8c
movq 0x2(%r12), %r13
addq $0xa, %r12
jmp 0x37d8c
movswq 0x2(%r12), %r13
addq $0x4, %r12
jmp 0x37d8c
xorl %r13d, %r13d
jmp 0x37d8c
xorl %r13d, %r13d
jmp 0x3790e
movl 0x2(%r12), %edx
addq $0x6, %r12
jmp 0x3736a
movq 0x2(%r12), %rdx
addq $0xa, %r12
jmp 0x3736a
movswq 0x2(%r12), %rdx
addq $0x4, %r12
jmp 0x3736a
xorl %edx, %edx
jmp 0x3736a
movzbl %al, %eax
decl %eax
cmpl $0x3, %eax
ja 0x37f3d
leaq 0x72ec2(%rip), %rcx     # 0xaad94
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x2(%rdi), %r8
movsbq 0x1(%rdi), %rax
jmp 0x37f42
leaq 0x6(%rbx), %rsi
movl 0x2(%rbx), %edx
jmp 0x372bc
leaq 0xa(%rbx), %rsi
movq 0x2(%rbx), %rdx
jmp 0x372bc
leaq 0x4(%rbx), %rsi
movswq 0x2(%rbx), %rdx
jmp 0x372bc
xorl %edx, %edx
movq %rbx, %rsi
jmp 0x372bc
movq %rdx, %r14
jmp 0x378b2
leaq 0x5(%rdi), %r8
movl 0x1(%rdi), %eax
jmp 0x37f42
leaq 0x9(%rdi), %r8
movq 0x1(%rdi), %rax
jmp 0x37f42
leaq 0x3(%rdi), %r8
movswq 0x1(%rdi), %rax
jmp 0x37f42
xorl %eax, %eax
movq %rdi, %r8
movl %eax, 0xb0(%rsp)
movzbl (%r8), %ecx
andl $0xf, %ecx
movl %ecx, 0xbc(%rsp)
movzbl (%r8), %eax
cmpl $0xef, %eax
jbe 0x37f8c
movzbl 0x1(%r8), %eax
andl $0xf, %eax
decl %eax
cmpl $0x3, %eax
ja 0x37fee
leaq 0x72e2c(%rip), %r9      # 0xaada4
movslq (%r9,%rax,4), %rax
addq %r9, %rax
jmpq *%rax
movsbq 0x2(%r8), %rax
addq $0x3, %r8
jmp 0x37f92
incq %r8
shrl $0x4, %eax
leaq 0xb0(%rsp), %r13
movl %eax, 0x4(%r13)
movb (%rcx,%rsi), %cl
shll %cl, %eax
movl %eax, 0x8(%r13)
movq %r8, 0x10(%r13)
subl %edi, %r8d
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movl %r8d, 0x1c(%r13)
imull %edx, %eax
movl %eax, 0x18(%r13)
jmp 0x3790e
movq %r9, 0x8(%rsp)
jmp 0x378b2
movl 0x2(%r8), %eax
addq $0x6, %r8
jmp 0x37f92
movq 0x2(%r8), %rax
addq $0xa, %r8
jmp 0x37f92
movswq 0x2(%r8), %rax
addq $0x4, %r8
jmp 0x37f92
xorl %eax, %eax
jmp 0x37f92