// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_record_check
static int bcf_record_check(const bcf_hdr_t *hdr, bcf1_t *rec) {
    uint8_t *ptr, *end;
    size_t bytes;
    uint32_t err = 0;
    int type = 0;
    int num  = 0;
    uint32_t i, reports;
    const uint32_t is_integer = ((1 << BCF_BT_INT8)  |
                                 (1 << BCF_BT_INT16) |
#ifdef VCF_ALLOW_INT64
                                 (1 << BCF_BT_INT64) |
#endif
                                 (1 << BCF_BT_INT32));
    const uint32_t is_valid_type = (is_integer          |
                                    (1 << BCF_BT_NULL)  |
                                    (1 << BCF_BT_FLOAT) |
                                    (1 << BCF_BT_CHAR));
    int32_t max_id = hdr ? hdr->n[BCF_DT_ID] : 0;

    // Check for valid contig ID
    if (rec->rid < 0
        || (hdr && (rec->rid >= hdr->n[BCF_DT_CTG]
                    || hdr->id[BCF_DT_CTG][rec->rid].key == NULL))) {
        hts_log_warning("Bad BCF record at %"PRIhts_pos": Invalid %s id %d", rec->pos+1, "CONTIG", rec->rid);
        err |= BCF_ERR_CTG_INVALID;
    }

    // Check ID
    ptr = (uint8_t *) rec->shared.s;
    end = ptr + rec->shared.l;
    if (bcf_dec_size_safe(ptr, end, &ptr, &num, &type) != 0) goto bad_shared;
    if (type != BCF_BT_CHAR) {
        hts_log_warning("Bad BCF record at %s:%"PRIhts_pos": Invalid %s type %d (%s)", bcf_seqname_safe(hdr,rec), rec->pos+1, "ID", type, get_type_name(type));
        err |= BCF_ERR_TAG_INVALID;
    }
    bytes = (size_t) num << bcf_type_shift[type];
    if (end - ptr < bytes) goto bad_shared;
    ptr += bytes;

    // Check REF and ALT
    if (rec->n_allele < 1) {
        hts_log_warning("Bad BCF record at %s:%"PRIhts_pos": No REF allele",
                        bcf_seqname_safe(hdr,rec), rec->pos+1);
        err |= BCF_ERR_TAG_UNDEF;
    }

    reports = 0;
    for (i = 0; i < rec->n_allele; i++) {
        if (bcf_dec_size_safe(ptr, end, &ptr, &num, &type) != 0) goto bad_shared;
        if (type != BCF_BT_CHAR) {
            if (!reports++ || hts_verbose >= HTS_LOG_DEBUG)
                hts_log_warning("Bad BCF record at %s:%"PRIhts_pos": Invalid %s type %d (%s)", bcf_seqname_safe(hdr,rec), rec->pos+1, "REF/ALT", type, get_type_name(type));
            err |= BCF_ERR_CHAR;
        }
        bytes = (size_t) num << bcf_type_shift[type];
        if (end - ptr < bytes) goto bad_shared;
        ptr += bytes;
    }

    // Check FILTER
    reports = 0;
    if (bcf_dec_size_safe(ptr, end, &ptr, &num, &type) != 0) goto bad_shared;
    if (num > 0) {
        bytes = (size_t) num << bcf_type_shift[type];
        if (((1 << type) & is_integer) == 0) {
            hts_log_warning("Bad BCF record at %s:%"PRIhts_pos": Invalid %s type %d (%s)", bcf_seqname_safe(hdr,rec), rec->pos+1, "FILTER", type, get_type_name(type));
            err |= BCF_ERR_TAG_INVALID;
            if (end - ptr < bytes) goto bad_shared;
            ptr += bytes;
        } else {
            if (end - ptr < bytes) goto bad_shared;
            for (i = 0; i < num; i++) {
                int32_t key = bcf_dec_int1(ptr, type, &ptr);
                if (key < 0
                    || (hdr && (key >= max_id
                                || hdr->id[BCF_DT_ID][key].key == NULL))) {
                    if (!reports++ || hts_verbose >= HTS_LOG_DEBUG)
                        hts_log_warning("Bad BCF record at %s:%"PRIhts_pos": Invalid %s id %d", bcf_seqname_safe(hdr,rec), rec->pos+1, "FILTER", key);
                    err |= BCF_ERR_TAG_UNDEF;
                }
            }
        }
    }

    // Check INFO
    reports = 0;
    bcf_idpair_t *id_tmp = hdr ? hdr->id[BCF_DT_ID] : NULL;
    for (i = 0; i < rec->n_info; i++) {
        int32_t key = -1;
        if (bcf_dec_typed_int1_safe(ptr, end, &ptr, &key) != 0) goto bad_shared;
        if (key < 0 || (hdr && (key >= max_id
                                || id_tmp[key].key == NULL))) {
            if (!reports++ || hts_verbose >= HTS_LOG_DEBUG)
                hts_log_warning("Bad BCF record at %s:%"PRIhts_pos": Invalid %s id %d", bcf_seqname_safe(hdr,rec), rec->pos+1, "INFO", key);
            err |= BCF_ERR_TAG_UNDEF;
        }
        if (bcf_dec_size_safe(ptr, end, &ptr, &num, &type) != 0) goto bad_shared;
        if (((1 << type) & is_valid_type) == 0
            || (type == BCF_BT_NULL && num > 0)) {
            if (!reports++ || hts_verbose >= HTS_LOG_DEBUG)
                hts_log_warning("Bad BCF record at %s:%"PRIhts_pos": Invalid %s type %d (%s)", bcf_seqname_safe(hdr,rec), rec->pos+1, "INFO", type, get_type_name(type));
            err |= BCF_ERR_TAG_INVALID;
        }
        bytes = (size_t) num << bcf_type_shift[type];
        if (end - ptr < bytes) goto bad_shared;
        ptr += bytes;
    }

    // Check FORMAT and individual information
    ptr = (uint8_t *) rec->indiv.s;
    end = ptr + rec->indiv.l;
    reports = 0;
    for (i = 0; i < rec->n_fmt; i++) {
        int32_t key = -1;
        if (bcf_dec_typed_int1_safe(ptr, end, &ptr, &key) != 0) goto bad_indiv;
        if (key < 0
            || (hdr && (key >= max_id
                        || id_tmp[key].key == NULL))) {
            bcf_record_check_err(hdr, rec, "id", &reports, key);
            err |= BCF_ERR_TAG_UNDEF;
        }
        if (bcf_dec_size_safe(ptr, end, &ptr, &num, &type) != 0) goto bad_indiv;
        if (((1 << type) & is_valid_type) == 0
            || (type == BCF_BT_NULL && num > 0)) {
            bcf_record_check_err(hdr, rec, "type", &reports, type);
            err |= BCF_ERR_TAG_INVALID;
        }
        bytes = ((size_t) num << bcf_type_shift[type]) * rec->n_sample;
        if (end - ptr < bytes) goto bad_indiv;
        ptr += bytes;
    }

    if (!err && rec->rlen < 0) {
        // Treat bad rlen as a warning instead of an error, and try to
        // fix up by using the length of the stored REF allele.
        static int warned = 0;
        if (!warned) {
            hts_log_warning("BCF record at %s:%"PRIhts_pos" has invalid RLEN (%"PRIhts_pos"). "
                            "Only one invalid RLEN will be reported.",
                            bcf_seqname_safe(hdr,rec), rec->pos+1, rec->rlen);
            warned = 1;
        }
        //find rlen considering reflen, END, SVLEN, fmt LEN
        hts_pos_t len = get_rlen(hdr, rec);
        rec->rlen = len >= 0 ? len : 0;
    }

    rec->errcode |= err;

    return err ? -2 : 0; // Return -2 so bcf_read() reports an error

 bad_shared:
    hts_log_error("Bad BCF record at %s:%"PRIhts_pos" - shared section malformed or too short", bcf_seqname_safe(hdr,rec), rec->pos+1);
    return -2;

 bad_indiv:
    hts_log_error("Bad BCF record at %s:%"PRIhts_pos" - individuals section malformed or too short", bcf_seqname_safe(hdr,rec), rec->pos+1);
    return -2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorl %ebp, %ebp
movl %ebp, 0x24(%rsp)
movl %ebp, 0x1c(%rsp)
testq %rdi, %rdi
je 0x310aa
movl (%r14), %ebp
movslq 0x10(%rbx), %r9
testq %r9, %r9
js 0x310d2
xorl %edx, %edx
testq %r14, %r14
je 0x310fe
cmpl 0x4(%r14), %r9d
jge 0x310d2
movq 0x18(%r14), %rax
movq %r9, %rcx
shlq $0x4, %rcx
cmpq $0x0, (%rax,%rcx)
jne 0x310fe
movq (%rbx), %rcx
incq %rcx
leaq 0x7e662(%rip), %rsi     # 0xaf741
leaq 0x7e66c(%rip), %rdx     # 0xaf752
leaq 0x7e68d(%rip), %r8      # 0xaf77a
movl $0x3, %edi
xorl %eax, %eax
callq 0x9774
movl $0x20, %edx
movl %ebp, 0x2c(%rsp)
movl %edx, 0xc(%rsp)
movq 0x30(%rbx), %rdi
leaq 0x10(%rsp), %rdx
movq %rdi, (%rdx)
movq 0x20(%rbx), %r15
addq %rdi, %r15
leaq 0x1c(%rsp), %rcx
leaq 0x24(%rsp), %r8
movq %r15, %rsi
callq 0x424e7
testl %eax, %eax
jne 0x3156f
movslq 0x24(%rsp), %r12
cmpq $0x7, %r12
je 0x311d1
testq %rbx, %rbx
je 0x3114c
movl 0x10(%rbx), %eax
jmp 0x31151
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %r14, %r14
sete %cl
testl %eax, %eax
sets %dl
orb %cl, %dl
jne 0x31176
cmpl %eax, 0x4(%r14)
jle 0x31176
movq 0x18(%r14), %rcx
movl %eax, %eax
shlq $0x4, %rax
movq (%rcx,%rax), %rax
jmp 0x31178
xorl %eax, %eax
testq %rax, %rax
leaq 0x7e7dd(%rip), %rcx     # 0xaf95f
cmovneq %rax, %rcx
movq (%rbx), %r8
incq %r8
cmpl $0x8, %r12d
movl $0x8, %r10d
cmovbl %r12d, %r10d
leaq 0x9d60f(%rip), %r11     # 0xce7b0
leaq 0x7e599(%rip), %rsi     # 0xaf741
leaq 0x7e5d2(%rip), %rdx     # 0xaf781
leaq 0x7bba1(%rip), %r9      # 0xacd57
movl $0x3, %edi
xorl %eax, %eax
pushq (%r11,%r10,8)
pushq %r12
callq 0x9774
addq $0x10, %rsp
addl $0x40, 0xc(%rsp)
movslq 0x1c(%rsp), %rax
leaq 0x9e343(%rip), %rcx     # 0xcf520
movb (%r12,%rcx), %cl
shlq %cl, %rax
movq 0x10(%rsp), %rcx
movq %r15, %rdx
subq %rcx, %rdx
cmpq %rax, %rdx
jb 0x3156f
addq %rax, %rcx
movq %rcx, 0x10(%rsp)
cmpw $0x0, 0x1a(%rbx)
jne 0x31276
testq %rbx, %rbx
je 0x31211
movl 0x10(%rbx), %eax
jmp 0x31216
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %r14, %r14
sete %cl
testl %eax, %eax
sets %dl
orb %cl, %dl
movl 0xc(%rsp), %ebp
jne 0x3123f
cmpl %eax, 0x4(%r14)
jle 0x3123f
movq 0x18(%r14), %rcx
movl %eax, %eax
shlq $0x4, %rax
movq (%rcx,%rax), %rax
jmp 0x31241
xorl %eax, %eax
testq %rax, %rax
leaq 0x7e714(%rip), %rcx     # 0xaf95f
cmovneq %rax, %rcx
movq (%rbx), %r8
incq %r8
leaq 0x7e4e5(%rip), %rsi     # 0xaf741
leaq 0x7e550(%rip), %rdx     # 0xaf7b3
movl $0x3, %edi
xorl %eax, %eax
callq 0x9774
orl $0x2, %ebp
movl %ebp, 0xc(%rsp)
movl $0x0, 0x20(%rsp)
cmpw $0x0, 0x1a(%rbx)
je 0x313a6
xorl %r13d, %r13d
xorl %r12d, %r12d
movq 0x10(%rsp), %rdi
movq %r15, %rsi
leaq 0x10(%rsp), %rdx
leaq 0x1c(%rsp), %rcx
leaq 0x24(%rsp), %r8
callq 0x424e7
testl %eax, %eax
jne 0x3156a
movslq 0x24(%rsp), %rbp
cmpq $0x7, %rbp
je 0x31367
testl %r12d, %r12d
je 0x312d7
leaq 0x9e232(%rip), %rax     # 0xcf500
cmpl $0x5, (%rax)
jl 0x3135f
testq %rbx, %rbx
je 0x312e1
movl 0x10(%rbx), %eax
jmp 0x312e6
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %r14, %r14
sete %cl
testl %eax, %eax
sets %dl
orb %cl, %dl
jne 0x3130b
cmpl %eax, 0x4(%r14)
jle 0x3130b
movq 0x18(%r14), %rcx
movl %eax, %eax
shlq $0x4, %rax
movq (%rcx,%rax), %rcx
jmp 0x3130d
xorl %ecx, %ecx
testq %rcx, %rcx
leaq 0x7e648(%rip), %rax     # 0xaf95f
cmoveq %rax, %rcx
movq (%rbx), %r8
incq %r8
cmpl $0x8, %ebp
movl $0x8, %r10d
cmovbl %ebp, %r10d
movl $0x3, %edi
leaq 0x7e407(%rip), %rsi     # 0xaf741
leaq 0x7e440(%rip), %rdx     # 0xaf781
leaq 0x7e493(%rip), %r9      # 0xaf7db
xorl %eax, %eax
leaq 0x9d45f(%rip), %r11     # 0xce7b0
pushq (%r11,%r10,8)
pushq %rbp
callq 0x9774
addq $0x10, %rsp
incl %r12d
orl $0x10, 0xc(%rsp)
movslq 0x1c(%rsp), %rax
leaq 0x9e1ad(%rip), %rcx     # 0xcf520
movb (%rbp,%rcx), %cl
shlq %cl, %rax
movq 0x10(%rsp), %rcx
movq %r15, %rdx
subq %rcx, %rdx
cmpq %rax, %rdx
jb 0x3156a
addq %rax, %rcx
movq %rcx, 0x10(%rsp)
incl %r13d
movzwl 0x1a(%rbx), %eax
cmpl %eax, %r13d
jb 0x3128f
movl $0x0, 0x20(%rsp)
leaq 0x10(%rsp), %rdx
movq (%rdx), %rdi
leaq 0x1c(%rsp), %rcx
leaq 0x24(%rsp), %r8
movq %r15, %rsi
callq 0x424e7
testl %eax, %eax
jne 0x3156f
movslq 0x1c(%rsp), %r12
testq %r12, %r12
jle 0x31546
movslq 0x24(%rsp), %r10
leaq 0x9e136(%rip), %rax     # 0xcf520
movb (%r10,%rax), %cl
movq %r12, %r13
shlq %cl, %r13
movl $0xe, %eax
btl %r10d, %eax
jae 0x319b6
movq %r15, %rax
subq 0x10(%rsp), %rax
cmpq %r13, %rax
jb 0x3156f
movq 0x10(%rsp), %r13
movl 0x20(%rsp), %ebp
leal -0x1(%r10), %edx
leaq 0x7c87c(%rip), %rsi     # 0xadca4
movq %rdx, 0x30(%rsp)
cmpl $0x3, %edx
ja 0x31464
movslq (%rsi,%rdx,4), %rax
addq %rsi, %rax
jmpq *%rax
movsbq (%r13), %r10
incq %r13
jmp 0x31467
movl (%r13), %r10d
addq $0x4, %r13
jmp 0x31467
movq (%r13), %r10
addq $0x8, %r13
jmp 0x31467
movswq (%r13), %r10
addq $0x2, %r13
jmp 0x31467
xorl %r10d, %r10d
testl %r10d, %r10d
js 0x31498
testq %r14, %r14
je 0x31534
cmpl %r10d, 0x2c(%rsp)
jle 0x31498
movq 0x10(%r14), %rax
movl %r10d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
shlq $0x4, %rcx
cmpq $0x0, (%rax,%rcx)
jne 0x31534
testl %ebp, %ebp
je 0x314ac
leaq 0x9e05d(%rip), %rax     # 0xcf500
cmpl $0x5, (%rax)
jl 0x3152d
testq %rbx, %rbx
je 0x314b6
movl 0x10(%rbx), %eax
jmp 0x314bb
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %r14, %r14
sete %cl
testl %eax, %eax
sets %dl
orb %cl, %dl
jne 0x314e0
cmpl %eax, 0x4(%r14)
jle 0x314e0
movq 0x18(%r14), %rcx
movl %eax, %eax
shlq $0x4, %rax
movq (%rcx,%rax), %rcx
jmp 0x314e2
xorl %ecx, %ecx
testq %rcx, %rcx
leaq 0x7e473(%rip), %rax     # 0xaf95f
cmoveq %rax, %rcx
movq (%rbx), %r8
incq %r8
subq $0x8, %rsp
movl $0x3, %edi
leaq 0x7e23b(%rip), %rsi     # 0xaf741
leaq 0x7e2d6(%rip), %rdx     # 0xaf7e3
leaq 0x798ad(%rip), %r9      # 0xaadc1
xorl %eax, %eax
pushq %r10
callq 0x9774
addq $0x10, %rsp
movq 0x30(%rsp), %rdx
leaq 0x7c777(%rip), %rsi     # 0xadca4
incl %ebp
orl $0x2, 0xc(%rsp)
decl %r12d
jne 0x3142d
movq %r13, 0x10(%rsp)
movl %ebp, 0x20(%rsp)
movl 0xc(%rsp), %r12d
movl $0x0, 0x20(%rsp)
testq %r14, %r14
je 0x315e7
movq 0x10(%r14), %rax
movq %rax, 0x30(%rsp)
jmp 0x315f0
movl %r12d, 0x20(%rsp)
testq %rbx, %rbx
je 0x31579
movl 0x10(%rbx), %eax
jmp 0x3157e
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %r14, %r14
sete %cl
testl %eax, %eax
sets %dl
orb %cl, %dl
jne 0x315a3
cmpl %eax, 0x4(%r14)
jle 0x315a3
movq 0x18(%r14), %rcx
movl %eax, %eax
shlq $0x4, %rax
movq (%rcx,%rax), %rax
jmp 0x315a5
xorl %eax, %eax
testq %rax, %rax
leaq 0x7e3b0(%rip), %rcx     # 0xaf95f
cmovneq %rax, %rcx
movq (%rbx), %r8
incq %r8
leaq 0x7e181(%rip), %rsi     # 0xaf741
leaq 0x7e29c(%rip), %rdx     # 0xaf863
movl $0x1, %edi
xorl %eax, %eax
callq 0x9774
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x0, 0x30(%rsp)
movl 0x20(%rsp), %ebp
cmpw $0x0, 0x18(%rbx)
je 0x3182d
xorl %r13d, %r13d
movl $0xffffffff, 0x28(%rsp) # imm = 0xFFFFFFFF
movq 0x10(%rsp), %rdi
movq %r15, %rsi
leaq 0x10(%rsp), %rdx
leaq 0x28(%rsp), %rcx
callq 0x4252c
testl %eax, %eax
jne 0x31705
movslq 0x28(%rsp), %r10
testq %r10, %r10
js 0x3165a
testq %r14, %r14
je 0x316e5
cmpl 0x2c(%rsp), %r10d
jge 0x3165a
movq %r10, %rax
shlq $0x4, %rax
movq 0x30(%rsp), %rcx
cmpq $0x0, (%rcx,%rax)
jne 0x316e5
testl %ebp, %ebp
je 0x3166a
leaq 0x9de9b(%rip), %rax     # 0xcf500
cmpl $0x5, (%rax)
jl 0x316df
testq %rbx, %rbx
je 0x31674
movl 0x10(%rbx), %eax
jmp 0x31679
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %r14, %r14
sete %cl
testl %eax, %eax
sets %dl
orb %cl, %dl
jne 0x3169e
cmpl %eax, 0x4(%r14)
jle 0x3169e
movq 0x18(%r14), %rcx
movl %eax, %eax
shlq $0x4, %rax
movq (%rcx,%rax), %rcx
jmp 0x316a0
xorl %ecx, %ecx
testq %rcx, %rcx
leaq 0x7e2b5(%rip), %rax     # 0xaf95f
cmoveq %rax, %rcx
movq (%rbx), %r8
incq %r8
subq $0x8, %rsp
movl $0x3, %edi
leaq 0x7e07d(%rip), %rsi     # 0xaf741
leaq 0x7e118(%rip), %rdx     # 0xaf7e3
leaq 0x7cdf0(%rip), %r9      # 0xae4c2
xorl %eax, %eax
pushq %r10
callq 0x9774
addq $0x10, %rsp
incl %ebp
orl $0x2, %r12d
movq 0x10(%rsp), %rdi
movq %r15, %rsi
leaq 0x10(%rsp), %rdx
leaq 0x1c(%rsp), %rcx
leaq 0x24(%rsp), %r8
callq 0x424e7
testl %eax, %eax
je 0x31724
xorl %eax, %eax
testb %al, %al
je 0x319c0
incl %r13d
movzwl 0x18(%rbx), %eax
cmpl %eax, %r13d
jb 0x31602
jmp 0x3182d
movl %r12d, 0xc(%rsp)
movslq 0x24(%rsp), %r12
movl $0xaf, %eax
btl %r12d, %eax
jae 0x3174d
testl %r12d, %r12d
jne 0x317f2
cmpl $0x0, 0x1c(%rsp)
jle 0x317f2
testl %ebp, %ebp
je 0x31761
leaq 0x9dda8(%rip), %rax     # 0xcf500
cmpl $0x5, (%rax)
jl 0x317eb
testq %rbx, %rbx
je 0x3176b
movl 0x10(%rbx), %eax
jmp 0x31770
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %r14, %r14
sete %cl
testl %eax, %eax
sets %dl
orb %cl, %dl
jne 0x31795
cmpl %eax, 0x4(%r14)
jle 0x31795
movq 0x18(%r14), %rcx
movl %eax, %eax
shlq $0x4, %rax
movq (%rcx,%rax), %rcx
jmp 0x31797
xorl %ecx, %ecx
testq %rcx, %rcx
leaq 0x7e1be(%rip), %rax     # 0xaf95f
cmoveq %rax, %rcx
movq (%rbx), %r8
incq %r8
cmpl $0x8, %r12d
movl $0x8, %r10d
cmovbl %r12d, %r10d
movl $0x3, %edi
leaq 0x7df7c(%rip), %rsi     # 0xaf741
leaq 0x7dfb5(%rip), %rdx     # 0xaf781
leaq 0x7ccef(%rip), %r9      # 0xae4c2
xorl %eax, %eax
leaq 0x9cfd4(%rip), %r11     # 0xce7b0
pushq (%r11,%r10,8)
pushq %r12
callq 0x9774
addq $0x10, %rsp
incl %ebp
orl $0x40, 0xc(%rsp)
movslq 0x1c(%rsp), %rax
leaq 0x9dd22(%rip), %rcx     # 0xcf520
movb (%r12,%rcx), %cl
shlq %cl, %rax
movq 0x10(%rsp), %rcx
movq %r15, %rdx
subq %rcx, %rdx
cmpq %rax, %rdx
jae 0x31819
xorl %eax, %eax
jmp 0x31823
addq %rax, %rcx
movq %rcx, 0x10(%rsp)
movb $0x1, %al
movl 0xc(%rsp), %r12d
jmp 0x31707
movl %r12d, 0xc(%rsp)
movl %ebp, 0x20(%rsp)
movq 0x48(%rbx), %r15
movq %r15, 0x10(%rsp)
addq 0x38(%rbx), %r15
movl $0x0, 0x20(%rsp)
cmpb $0x0, 0x1c(%rbx)
je 0x31978
xorl %r13d, %r13d
leaq 0x10(%rsp), %rbp
movl $0xffffffff, 0x28(%rsp) # imm = 0xFFFFFFFF
movq 0x10(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
leaq 0x28(%rsp), %rcx
callq 0x4252c
movl $0xf, %r12d
testl %eax, %eax
jne 0x31963
movslq 0x28(%rsp), %r8
testq %r8, %r8
js 0x318b1
testq %r14, %r14
je 0x318cd
cmpl 0x2c(%rsp), %r8d
jge 0x318b1
movq %r8, %rax
shlq $0x4, %rax
movq 0x30(%rsp), %rcx
cmpq $0x0, (%rcx,%rax)
jne 0x318cd
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x7b8ba(%rip), %rdx     # 0xad178
leaq 0x20(%rsp), %rcx
callq 0x425ac
orl $0x2, 0xc(%rsp)
movq 0x10(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
leaq 0x1c(%rsp), %rcx
leaq 0x24(%rsp), %r8
callq 0x424e7
testl %eax, %eax
jne 0x31963
movslq 0x24(%rsp), %rbp
movl $0xaf, %eax
btl %ebp, %eax
jae 0x31905
testl %ebp, %ebp
jne 0x31924
cmpl $0x0, 0x1c(%rsp)
jle 0x31924
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x87ca3(%rip), %rdx     # 0xb95b5
leaq 0x20(%rsp), %rcx
movl %ebp, %r8d
callq 0x425ac
orl $0x40, 0xc(%rsp)
movslq 0x1c(%rsp), %rdx
leaq 0x9dbf0(%rip), %rax     # 0xcf520
movb (%rbp,%rax), %cl
shlq %cl, %rdx
movq 0x18(%rbx), %rax
shrq $0x28, %rax
imulq %rdx, %rax
movq 0x10(%rsp), %rcx
movq %r15, %rdx
subq %rcx, %rdx
cmpq %rax, %rdx
jb 0x3195e
addq %rax, %rcx
movq %rcx, 0x10(%rsp)
xorl %r12d, %r12d
leaq 0x10(%rsp), %rbp
testl %r12d, %r12d
jne 0x319c9
incl %r13d
movzbl 0x1c(%rbx), %eax
cmpl %eax, %r13d
jb 0x3185d
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
movl 0xc(%rsp), %ebp
testl %ebp, %ebp
jne 0x31b5e
movq 0x8(%rbx), %r9
xorl %eax, %eax
testq %r9, %r9
jns 0x31b5e
cmpb $0x0, 0x9e46d(%rip)     # 0xcfe0c
jne 0x31b43
testq %rbx, %rbx
je 0x31ae2
movl 0x10(%rbx), %eax
jmp 0x31ae7
testq %rbx, %rbx
je 0x319e5
movl 0x10(%rbx), %eax
jmp 0x319ea
movl %ebp, 0x20(%rsp)
jmp 0x3156f
cmpl $0xf, %r12d
jne 0x319e0
testq %rbx, %rbx
je 0x31a8f
movl 0x10(%rbx), %eax
jmp 0x31a94
jmp 0x315d8
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %r14, %r14
sete %cl
testl %eax, %eax
sets %dl
orb %cl, %dl
jne 0x31a0f
cmpl %eax, 0x4(%r14)
jle 0x31a0f
movq 0x18(%r14), %rcx
movl %eax, %eax
shlq $0x4, %rax
movq (%rcx,%rax), %rax
jmp 0x31a11
xorl %eax, %eax
testq %rax, %rax
leaq 0x7df44(%rip), %rcx     # 0xaf95f
cmovneq %rax, %rcx
movq (%rbx), %r8
incq %r8
cmpl $0x8, %r10d
movl $0x8, %r11d
cmovbl %r10d, %r11d
leaq 0x9cd76(%rip), %r12     # 0xce7b0
leaq 0x7dd00(%rip), %rsi     # 0xaf741
leaq 0x7dd39(%rip), %rdx     # 0xaf781
leaq 0x79372(%rip), %r9      # 0xaadc1
movl $0x3, %edi
xorl %eax, %eax
pushq (%r12,%r11,8)
pushq %r10
callq 0x9774
addq $0x10, %rsp
movq 0x10(%rsp), %rax
movq %r15, %rcx
subq %rax, %rcx
cmpq %r13, %rcx
jb 0x3156f
movl 0xc(%rsp), %r12d
orl $0x40, %r12d
addq %r13, %rax
movq %rax, 0x10(%rsp)
jmp 0x3154b
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %r14, %r14
sete %cl
testl %eax, %eax
sets %dl
orb %cl, %dl
jne 0x31ab9
cmpl %eax, 0x4(%r14)
jle 0x31ab9
movq 0x18(%r14), %rcx
movl %eax, %eax
shlq $0x4, %rax
movq (%rcx,%rax), %rax
jmp 0x31abb
xorl %eax, %eax
testq %rax, %rax
leaq 0x7de9a(%rip), %rcx     # 0xaf95f
cmovneq %rax, %rcx
movq (%rbx), %r8
incq %r8
leaq 0x7dc6b(%rip), %rsi     # 0xaf741
leaq 0x7ddc7(%rip), %rdx     # 0xaf8a4
jmp 0x315c7
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %r14, %r14
sete %cl
testl %eax, %eax
sets %dl
orb %cl, %dl
jne 0x31b0c
cmpl %eax, 0x4(%r14)
jle 0x31b0c
movq 0x18(%r14), %rcx
movl %eax, %eax
shlq $0x4, %rax
movq (%rcx,%rax), %rax
jmp 0x31b0e
xorl %eax, %eax
testq %rax, %rax
leaq 0x7de47(%rip), %rcx     # 0xaf95f
cmovneq %rax, %rcx
movq (%rbx), %r8
incq %r8
leaq 0x7dc18(%rip), %rsi     # 0xaf741
leaq 0x7dcde(%rip), %rdx     # 0xaf80e
movl $0x3, %edi
xorl %eax, %eax
callq 0x9774
movb $0x1, 0x9e2c9(%rip)     # 0xcfe0c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x37d95
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
cmovleq %rax, %rcx
movq %rcx, 0x8(%rbx)
orl %ebp, 0xcc(%rbx)
jmp 0x315d8