// File: /workspace/github_c_makefile_star2_O3/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
xorl %eax, %eax
movl %eax, 0x14(%rsp)
movl %eax, 0x4(%rsp)
testq %rdi, %rdi
movq %rdi, 0x18(%rsp)
je 0x2ff02
movl (%rdi), %eax
movl %eax, 0x2c(%rsp)
leaq 0x10(%rbx), %rax
movq %rax, 0x20(%rsp)
movslq 0x10(%rbx), %r9
testq %r9, %r9
js 0x2ff21
cmpl 0x4(%rdi), %r9d
jge 0x2ff21
movq 0x18(%rdi), %rax
movq %r9, %rcx
shlq $0x4, %rcx
xorl %edx, %edx
cmpq $0x0, (%rax,%rcx)
jne 0x2ff4d
jmp 0x2ff21
movl $0x0, 0x2c(%rsp)
leaq 0x10(%rbx), %rax
movq %rax, 0x20(%rsp)
movl 0x10(%rbx), %r9d
movl $0x0, %edx
testl %r9d, %r9d
jns 0x2ff4d
movq (%rbx), %rcx
incq %rcx
leaq 0x7c7c3(%rip), %rsi     # 0xac6f1
leaq 0x7c7cd(%rip), %rdx     # 0xac702
leaq 0x7c7ee(%rip), %r8      # 0xac72a
movl $0x3, %edi
xorl %eax, %eax
callq 0x942d
movl $0x20, %edx
movl %edx, (%rsp)
movq 0x30(%rbx), %rdi
leaq 0x8(%rsp), %rdx
movq %rdi, (%rdx)
movq 0x20(%rbx), %r15
addq %rdi, %r15
leaq 0x4(%rsp), %rcx
leaq 0x14(%rsp), %r8
movq %r15, %rsi
callq 0x415e2
testl %eax, %eax
jne 0x303a2
movslq 0x14(%rsp), %r14
cmpq $0x7, %r14
je 0x3001b
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
sete %cl
movq 0x20(%rsp), %rax
movslq (%rax), %rax
testq %rax, %rax
sets %dl
orb %cl, %dl
movl (%rsp), %ebp
jne 0x2ffbf
cmpl %eax, 0x4(%rsi)
jle 0x2ffbf
movq 0x18(%rsi), %rcx
shlq $0x4, %rax
movq (%rcx,%rax), %rax
jmp 0x2ffc1
xorl %eax, %eax
testq %rax, %rax
leaq 0x7c944(%rip), %rcx     # 0xac90f
cmovneq %rax, %rcx
movq (%rbx), %r8
incq %r8
cmpl $0x8, %r14d
movl $0x8, %r10d
cmovbl %r14d, %r10d
leaq 0x9c7f6(%rip), %r11     # 0xcc7e0
leaq 0x7c700(%rip), %rsi     # 0xac6f1
leaq 0x7c739(%rip), %rdx     # 0xac731
leaq 0x79d0b(%rip), %r9      # 0xa9d0a
movl $0x3, %edi
xorl %eax, %eax
pushq (%r11,%r10,8)
pushq %r14
callq 0x942d
addq $0x10, %rsp
orl $0x40, %ebp
movl %ebp, (%rsp)
movslq 0x4(%rsp), %rax
leaq 0x9d4f9(%rip), %rcx     # 0xcd520
movb (%r14,%rcx), %cl
shlq %cl, %rax
movq 0x8(%rsp), %r14
movq %r15, %rcx
subq %r14, %rcx
cmpq %rax, %rcx
jb 0x303a2
addq %rax, %r14
movq %r14, 0x8(%rsp)
cmpw $0x0, 0x1a(%rbx)
je 0x3005e
movl $0x0, 0x10(%rsp)
jmp 0x300e2
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
sete %cl
movq 0x20(%rsp), %rax
movslq (%rax), %rax
testq %rax, %rax
sets %dl
orb %cl, %dl
je 0x30082
xorl %eax, %eax
movl (%rsp), %ebp
jmp 0x3009a
cmpl %eax, 0x4(%rsi)
movl (%rsp), %ebp
jle 0x30098
movq 0x18(%rsi), %rcx
shlq $0x4, %rax
movq (%rcx,%rax), %rax
jmp 0x3009a
xorl %eax, %eax
testq %rax, %rax
leaq 0x7c86b(%rip), %rcx     # 0xac90f
cmovneq %rax, %rcx
movq (%rbx), %r8
incq %r8
leaq 0x7c63c(%rip), %rsi     # 0xac6f1
leaq 0x7c6a7(%rip), %rdx     # 0xac763
movl $0x3, %edi
xorl %eax, %eax
callq 0x942d
orl $0x2, %ebp
movl %ebp, (%rsp)
movzwl 0x1a(%rbx), %eax
movl $0x0, 0x10(%rsp)
testl %eax, %eax
je 0x30205
xorl %ebp, %ebp
xorl %r12d, %r12d
movq %r14, %rdi
movq %r15, %rsi
leaq 0x8(%rsp), %rdx
leaq 0x4(%rsp), %rcx
leaq 0x14(%rsp), %r8
callq 0x415e2
testl %eax, %eax
jne 0x303a2
movslq 0x14(%rsp), %r14
cmpq $0x7, %r14
jne 0x3011c
movl %ebp, %r13d
jmp 0x301c3
leal 0x1(%rbp), %r13d
movl %r13d, 0x10(%rsp)
testl %ebp, %ebp
je 0x30139
leaq 0x9d3d0(%rip), %rax     # 0xcd500
cmpl $0x5, (%rax)
jl 0x301bf
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
sete %cl
movq 0x20(%rsp), %rax
movslq (%rax), %rax
testq %rax, %rax
sets %dl
orb %cl, %dl
jne 0x30169
cmpl %eax, 0x4(%rsi)
jle 0x30169
movq 0x18(%rsi), %rcx
shlq $0x4, %rax
movq (%rcx,%rax), %rcx
jmp 0x3016b
xorl %ecx, %ecx
testq %rcx, %rcx
leaq 0x7c79a(%rip), %rax     # 0xac90f
cmoveq %rax, %rcx
movq (%rbx), %r8
incq %r8
cmpl $0x8, %r14d
movl $0x8, %r10d
cmovbl %r14d, %r10d
movl $0x3, %edi
leaq 0x7c558(%rip), %rsi     # 0xac6f1
leaq 0x7c591(%rip), %rdx     # 0xac731
leaq 0x7c5e4(%rip), %r9      # 0xac78b
xorl %eax, %eax
leaq 0x9c630(%rip), %r11     # 0xcc7e0
pushq (%r11,%r10,8)
pushq %r14
callq 0x942d
addq $0x10, %rsp
orl $0x10, (%rsp)
movslq 0x4(%rsp), %rax
leaq 0x9d351(%rip), %rcx     # 0xcd520
movb (%r14,%rcx), %cl
shlq %cl, %rax
movq 0x8(%rsp), %r14
movq %r15, %rcx
subq %r14, %rcx
cmpq %rax, %rcx
jb 0x3039d
addq %rax, %r14
movq %r14, 0x8(%rsp)
incl %r12d
movzwl 0x1a(%rbx), %eax
movl %r13d, %ebp
cmpl %eax, %r12d
jb 0x300e7
movl $0x0, 0x10(%rsp)
leaq 0x8(%rsp), %rdx
leaq 0x4(%rsp), %rcx
leaq 0x14(%rsp), %r8
movq %r14, %rdi
movq %r15, %rsi
callq 0x415e2
testl %eax, %eax
jne 0x303a2
movslq 0x4(%rsp), %r14
testq %r14, %r14
jle 0x304bc
movslq 0x14(%rsp), %r10
leaq 0x9d2d7(%rip), %rax     # 0xcd520
movb (%r10,%rax), %cl
movq %r14, %r13
shlq %cl, %r13
movl $0xe, %eax
btl %r10d, %eax
jae 0x30416
movq 0x8(%rsp), %r12
movq %r15, %rax
subq %r12, %rax
cmpq %r13, %rax
jb 0x303a2
leal -0x1(%r10), %r13d
leaq 0x7a9ef(%rip), %rsi     # 0xaac70
xorl %eax, %eax
cmpl $0x3, %r13d
movq 0x18(%rsp), %rdx
ja 0x302c8
movslq (%rsi,%r13,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
movsbq (%r12), %r10
incq %r12
jmp 0x302be
movl (%r12), %r10d
addq $0x4, %r12
jmp 0x302be
movq (%r12), %r10
addq $0x8, %r12
jmp 0x302be
movswq (%r12), %r10
addq $0x2, %r12
movq %r10, %rcx
testl %r10d, %r10d
jns 0x302cd
jmp 0x302f5
xorl %r10d, %r10d
xorl %ecx, %ecx
testq %rdx, %rdx
je 0x302ee
cmpl %r10d, 0x2c(%rsp)
jle 0x302f5
movq 0x10(%rdx), %rdx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
shlq $0x4, %rcx
cmpq $0x0, (%rdx,%rcx)
je 0x302f5
movl %eax, %ebp
jmp 0x30388
leal 0x1(%rax), %ebp
movl %ebp, 0x10(%rsp)
testl %eax, %eax
je 0x3030c
leaq 0x9d1f9(%rip), %rax     # 0xcd500
cmpl $0x5, (%rax)
jl 0x30384
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
sete %cl
movq 0x20(%rsp), %rax
movslq (%rax), %rax
testq %rax, %rax
sets %dl
orb %cl, %dl
jne 0x3033c
cmpl %eax, 0x4(%rsi)
jle 0x3033c
movq 0x18(%rsi), %rcx
shlq $0x4, %rax
movq (%rcx,%rax), %rcx
jmp 0x3033e
xorl %ecx, %ecx
testq %rcx, %rcx
leaq 0x7c5c7(%rip), %rax     # 0xac90f
cmoveq %rax, %rcx
movq (%rbx), %r8
incq %r8
subq $0x8, %rsp
movl $0x3, %edi
leaq 0x7c38f(%rip), %rsi     # 0xac6f1
leaq 0x7c42a(%rip), %rdx     # 0xac793
leaq 0x77ab1(%rip), %r9      # 0xa7e21
xorl %eax, %eax
pushq %r10
callq 0x942d
addq $0x10, %rsp
leaq 0x7a8ec(%rip), %rsi     # 0xaac70
orl $0x2, (%rsp)
movl %ebp, %eax
decl %r14d
jne 0x30283
movq %r12, 0x8(%rsp)
jmp 0x304bc
testq %rbx, %rbx
je 0x303d2
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
sete %cl
movq 0x20(%rsp), %rax
movslq (%rax), %rax
testq %rax, %rax
sets %dl
orb %cl, %dl
jne 0x303d2
cmpl %eax, 0x4(%rsi)
jle 0x303d2
movq 0x18(%rsi), %rcx
shlq $0x4, %rax
movq (%rcx,%rax), %rax
jmp 0x303d4
xorl %eax, %eax
testq %rax, %rax
leaq 0x7c531(%rip), %rcx     # 0xac90f
cmovneq %rax, %rcx
movq (%rbx), %r8
incq %r8
leaq 0x7c302(%rip), %rsi     # 0xac6f1
leaq 0x7c41d(%rip), %rdx     # 0xac813
movl $0x1, %edi
xorl %eax, %eax
callq 0x942d
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
sete %cl
movq 0x20(%rsp), %rax
movslq (%rax), %rax
testq %rax, %rax
sets %dl
orb %cl, %dl
jne 0x30446
cmpl %eax, 0x4(%rsi)
jle 0x30446
movq 0x18(%rsi), %rcx
shlq $0x4, %rax
movq (%rcx,%rax), %rax
jmp 0x30448
xorl %eax, %eax
testq %rax, %rax
leaq 0x7c4bd(%rip), %rcx     # 0xac90f
cmovneq %rax, %rcx
movq (%rbx), %r8
incq %r8
cmpl $0x8, %r10d
movl $0x8, %r11d
cmovbl %r10d, %r11d
leaq 0x9c36f(%rip), %r14     # 0xcc7e0
leaq 0x7c279(%rip), %rsi     # 0xac6f1
leaq 0x7c2b2(%rip), %rdx     # 0xac731
leaq 0x7799b(%rip), %r9      # 0xa7e21
movl $0x3, %edi
xorl %eax, %eax
pushq (%r14,%r11,8)
pushq %r10
callq 0x942d
addq $0x10, %rsp
movq 0x8(%rsp), %rax
movq %r15, %rcx
subq %rax, %rcx
cmpq %r13, %rcx
jb 0x303a2
orl $0x40, (%rsp)
addq %r13, %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movl $0x0, 0x10(%rsp)
testq %rax, %rax
je 0x304d9
movq 0x10(%rax), %rax
movq %rax, 0x30(%rsp)
jmp 0x304e2
movq $0x0, 0x30(%rsp)
movq 0x18(%rbx), %rax
testw %ax, %ax
je 0x30722
leaq 0x8(%rsp), %rax
movq (%rax), %rdi
xorl %r13d, %r13d
xorl %r14d, %r14d
movl $0xffffffff, 0x28(%rsp) # imm = 0xFFFFFFFF
movq %r15, %rsi
leaq 0x8(%rsp), %rdx
leaq 0x28(%rsp), %rcx
callq 0x41634
testl %eax, %eax
jne 0x303a2
movslq 0x28(%rsp), %r10
testq %r10, %r10
js 0x30553
cmpq $0x0, 0x18(%rsp)
je 0x3054b
cmpl 0x2c(%rsp), %r10d
jge 0x30553
movq %r10, %rax
shlq $0x4, %rax
movq 0x30(%rsp), %rcx
cmpq $0x0, (%rcx,%rax)
je 0x30553
movl %r13d, %ebp
jmp 0x305e9
leal 0x1(%r13), %ebp
movl %ebp, 0x10(%rsp)
testl %r13d, %r13d
movl (%rsp), %r12d
je 0x30570
leaq 0x9cf95(%rip), %rax     # 0xcd500
cmpl $0x5, (%rax)
jl 0x305e1
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
sete %cl
movq 0x20(%rsp), %rax
movslq (%rax), %rax
testq %rax, %rax
sets %dl
orb %cl, %dl
jne 0x305a0
cmpl %eax, 0x4(%rsi)
jle 0x305a0
movq 0x18(%rsi), %rcx
shlq $0x4, %rax
movq (%rcx,%rax), %rcx
jmp 0x305a2
xorl %ecx, %ecx
testq %rcx, %rcx
leaq 0x7c363(%rip), %rax     # 0xac90f
cmoveq %rax, %rcx
movq (%rbx), %r8
incq %r8
subq $0x8, %rsp
movl $0x3, %edi
leaq 0x7c12b(%rip), %rsi     # 0xac6f1
leaq 0x7c1c6(%rip), %rdx     # 0xac793
leaq 0x7ae9e(%rip), %r9      # 0xab472
xorl %eax, %eax
pushq %r10
callq 0x942d
addq $0x10, %rsp
orl $0x2, %r12d
movl %r12d, (%rsp)
movq 0x8(%rsp), %rdi
movq %r15, %rsi
leaq 0x8(%rsp), %rdx
leaq 0x4(%rsp), %rcx
leaq 0x14(%rsp), %r8
callq 0x415e2
testl %eax, %eax
jne 0x303a2
movslq 0x14(%rsp), %r12
movl $0xaf, %eax
btl %r12d, %eax
jae 0x30633
testl %r12d, %r12d
sete %cl
movl 0x4(%rsp), %eax
testl %eax, %eax
setg %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x30680
leal 0x1(%rbp), %r13d
movl %r13d, 0x10(%rsp)
testl %ebp, %ebp
je 0x30650
leaq 0x9ceb9(%rip), %rax     # 0xcd500
cmpl $0x5, (%rax)
jl 0x306db
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
sete %cl
movq 0x20(%rsp), %rax
movslq (%rax), %rax
testq %rax, %rax
sets %dl
orb %cl, %dl
jne 0x30685
cmpl %eax, 0x4(%rsi)
jle 0x30685
movq 0x18(%rsi), %rcx
shlq $0x4, %rax
movq (%rcx,%rax), %rcx
jmp 0x30687
movl %ebp, %r13d
jmp 0x306e3
xorl %ecx, %ecx
testq %rcx, %rcx
leaq 0x7c27e(%rip), %rax     # 0xac90f
cmoveq %rax, %rcx
movq (%rbx), %r8
incq %r8
cmpl $0x8, %r12d
movl $0x8, %r10d
cmovbl %r12d, %r10d
movl $0x3, %edi
leaq 0x7c03c(%rip), %rsi     # 0xac6f1
leaq 0x7c075(%rip), %rdx     # 0xac731
leaq 0x7adaf(%rip), %r9      # 0xab472
xorl %eax, %eax
leaq 0x9c114(%rip), %r11     # 0xcc7e0
pushq (%r11,%r10,8)
pushq %r12
callq 0x942d
addq $0x10, %rsp
orl $0x40, (%rsp)
movl 0x4(%rsp), %eax
cltq
leaq 0x9ce34(%rip), %rcx     # 0xcd520
movb (%r12,%rcx), %cl
shlq %cl, %rax
movq 0x8(%rsp), %rdi
movq %r15, %rcx
subq %rdi, %rcx
cmpq %rax, %rcx
jb 0x303a2
addq %rax, %rdi
movq %rdi, 0x8(%rsp)
incl %r14d
movq 0x18(%rbx), %rax
movzwl %ax, %ecx
cmpl %ecx, %r14d
jb 0x304fd
movq 0x48(%rbx), %rdi
movq %rdi, 0x8(%rsp)
movq 0x38(%rbx), %r15
addq %rdi, %r15
movl $0x0, 0x10(%rsp)
shrq $0x20, %rax
testb %al, %al
je 0x30873
xorl %r13d, %r13d
leaq 0x8(%rsp), %r12
movq 0x18(%rsp), %r14
movl $0xffffffff, 0x28(%rsp) # imm = 0xFFFFFFFF
movq %r15, %rsi
movq %r12, %rdx
leaq 0x28(%rsp), %rcx
callq 0x41634
testl %eax, %eax
jne 0x308dc
movslq 0x28(%rsp), %r8
testq %r8, %r8
js 0x3079c
testq %r14, %r14
je 0x307b7
cmpl 0x2c(%rsp), %r8d
jge 0x3079c
movq %r8, %rax
shlq $0x4, %rax
movq 0x30(%rsp), %rcx
cmpq $0x0, (%rcx,%rax)
jne 0x307b7
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x7997a(%rip), %rdx     # 0xaa123
leaq 0x10(%rsp), %rcx
callq 0x416b4
orl $0x2, (%rsp)
movq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
leaq 0x4(%rsp), %rcx
leaq 0x14(%rsp), %r8
callq 0x415e2
testl %eax, %eax
jne 0x308d0
movslq 0x14(%rsp), %r14
movl $0xaf, %eax
btl %r14d, %eax
movslq 0x4(%rsp), %rbp
jae 0x30800
testl %r14d, %r14d
sete %al
testl %ebp, %ebp
setg %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x30820
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
leaq 0x864e3(%rip), %rdx     # 0xb6cf2
leaq 0x10(%rsp), %rcx
movl %r14d, %r8d
callq 0x416b4
orl $0x40, (%rsp)
leaq 0x9ccf9(%rip), %rax     # 0xcd520
movb (%r14,%rax), %cl
shlq %cl, %rbp
movq 0x18(%rbx), %rax
movq %rax, %rcx
shrq $0x28, %rcx
imulq %rbp, %rcx
movq 0x8(%rsp), %rdi
movq %r15, %rdx
subq %rdi, %rdx
cmpq %rcx, %rdx
jb 0x308d7
addq %rcx, %rdi
movq %rdi, 0x8(%rsp)
incl %r13d
shrq $0x20, %rax
movzbl %al, %eax
cmpl %eax, %r13d
movq 0x18(%rsp), %r14
jb 0x30753
jmp 0x30878
movq 0x18(%rsp), %r14
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
movl (%rsp), %ebp
testl %ebp, %ebp
jne 0x30983
movq 0x8(%rbx), %r9
xorl %eax, %eax
testq %r9, %r9
jns 0x30983
cmpb $0x0, 0x9d56e(%rip)     # 0xcde0c
jne 0x30968
testq %r14, %r14
sete %cl
movq 0x20(%rsp), %rax
movslq (%rax), %rax
testq %rax, %rax
sets %dl
orb %cl, %dl
jne 0x30931
cmpl %eax, 0x4(%r14)
jle 0x30931
movq 0x18(%r14), %rcx
shlq $0x4, %rax
movq (%rcx,%rax), %rax
jmp 0x30933
testq %rbx, %rbx
jne 0x308dc
jmp 0x30908
movq 0x18(%rsp), %r14
testq %r14, %r14
sete %cl
movq 0x20(%rsp), %rax
movslq (%rax), %rax
testq %rax, %rax
sets %dl
orb %cl, %dl
jne 0x30908
cmpl %eax, 0x4(%r14)
jle 0x30908
movq 0x18(%r14), %rcx
shlq $0x4, %rax
movq (%rcx,%rax), %rax
jmp 0x3090a
xorl %eax, %eax
testq %rax, %rax
leaq 0x7bffb(%rip), %rcx     # 0xac90f
cmovneq %rax, %rcx
movq (%rbx), %r8
incq %r8
leaq 0x7bdcc(%rip), %rsi     # 0xac6f1
leaq 0x7bf28(%rip), %rdx     # 0xac854
jmp 0x303f6
xorl %eax, %eax
testq %rax, %rax
leaq 0x7bfd2(%rip), %rcx     # 0xac90f
cmovneq %rax, %rcx
movq (%rbx), %r8
incq %r8
leaq 0x7bda3(%rip), %rsi     # 0xac6f1
leaq 0x7be69(%rip), %rdx     # 0xac7be
movl $0x3, %edi
xorl %eax, %eax
callq 0x942d
movb $0x1, 0x9d4a4(%rip)     # 0xcde0c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x370a7
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
cmovleq %rax, %rcx
movq %rcx, 0x8(%rbx)
orl %ebp, 0xcc(%rbx)
jmp 0x30407