// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/header.c
// Function: sam_hrecs_update_hashes
static int sam_hrecs_update_hashes(sam_hrecs_t *hrecs,
                                   khint32_t type,
                                   sam_hrec_type_t *h_type) {
    /* Add to reference hash? */
    if (type == TYPEKEY("SQ")) {
        sam_hrec_tag_t *tag = h_type->tag;
        int nref = hrecs->nref;
        const char *name = NULL;
        const char *altnames = NULL;
        hts_pos_t len = -1;
        int r, invLN = 0;
        khint_t k;

        while (tag) {
            if (tag->str[0] == 'S' && tag->str[1] == 'N') {
                assert(tag->len >= 3);
                name = tag->str+3;
            } else if (tag->str[0] == 'L' && tag->str[1] == 'N') {
                assert(tag->len >= 3);
                hts_pos_t tmp = len;
                len = strtoll(tag->str+3, NULL, 10);
                if (tmp != -1 && tmp != len) {  //duplicate and different LN
                    invLN = 1;
                }
            } else if (tag->str[0] == 'A' && tag->str[1] == 'N') {
                assert(tag->len >= 3);
                altnames = tag->str+3;
            }
            tag = tag->next;
        }

        if (!name) {
            hts_log_error("Header includes @SQ line with no SN: tag");
            return -1; // SN should be present, according to spec.
        }

        if (len == -1) {
            hts_log_error("Header includes @SQ line \"%s\" with no LN: tag",
                          name);
            return -1; // LN should be present, according to spec.
        }

        if (invLN) {
            hts_log_error("Header includes @SQ line \"%s\" with multiple LN:"
            " tag with different values.", name);
            return -1; // LN should not be duplicated or be same
        }

        // Seen already?
        k = kh_get(m_s2i, hrecs->ref_hash, name);
        if (k < kh_end(hrecs->ref_hash)) {
            nref = kh_val(hrecs->ref_hash, k);
            int ref_changed_flag = 0;

            // Check for hash entry added by sam_hrecs_refs_from_targets_array()
            if (hrecs->ref[nref].ty == NULL) {
                // Attach header line to existing stub entry.
                hrecs->ref[nref].ty = h_type;
                // Check lengths match; correct if not.
                if (len != hrecs->ref[nref].len) {
                    char tmp[32];
                    snprintf(tmp, sizeof(tmp), "%" PRIhts_pos,
                             hrecs->ref[nref].len);
                    if (sam_hrecs_update(hrecs, h_type, "LN", tmp, NULL) < 0)
                        return -1;
                    ref_changed_flag = 1;
                }
                if (sam_hrecs_add_ref_altnames(hrecs, nref, altnames) < 0)
                    return -1;

                if (ref_changed_flag && (hrecs->refs_changed < 0 || hrecs->refs_changed > nref))
                    hrecs->refs_changed = nref;
                return 0;
            }

            // Check to see if an existing entry is being updated
            if (hrecs->ref[nref].ty == h_type) {
                if (hrecs->ref[nref].len != len) {
                    hrecs->ref[nref].len = len;
                    ref_changed_flag = 1;
                }
                if (!hrecs->ref[nref].name || strcmp(hrecs->ref[nref].name, name)) {
                    hrecs->ref[nref].name = name;
                    ref_changed_flag = 1;
                }
                if (sam_hrecs_add_ref_altnames(hrecs, nref, altnames) < 0)
                    return -1;

                if (ref_changed_flag && (hrecs->refs_changed < 0 || hrecs->refs_changed > nref))
                    hrecs->refs_changed = nref;
                return 0;
            }

            // If here, the name is a duplicate.
            // Check to see if it matches the SN: tag from the earlier record.
            if (strcmp(hrecs->ref[nref].name, name) == 0) {
                hts_log_error("Duplicate entry \"%s\" in sam header",
                                name);
                return -1;
            }

            // Clash with an already-seen altname
            // As SN: should be preferred to AN: add this as a new
            // record and update the hash entry to point to it.
            hts_log_warning("Ref name SN:\"%s\" is a duplicate of an existing AN key", name);
            nref = hrecs->nref;
        }

        if (nref == hrecs->ref_sz) {
            size_t new_sz = hrecs->ref_sz >= 4 ? hrecs->ref_sz + (hrecs->ref_sz / 4) : 32;
            sam_hrec_sq_t *new_ref = realloc(hrecs->ref, sizeof(*hrecs->ref) * new_sz);
            if (!new_ref)
                return -1;
            hrecs->ref = new_ref;
            hrecs->ref_sz = new_sz;
        }

        hrecs->ref[nref].name = name;
        hrecs->ref[nref].len  = len;
        hrecs->ref[nref].ty = h_type;

        k = kh_put(m_s2i, hrecs->ref_hash, hrecs->ref[nref].name, &r);
        if (-1 == r) return -1;
        kh_val(hrecs->ref_hash, k) = nref;

        if (sam_hrecs_add_ref_altnames(hrecs, nref, altnames) < 0)
            return -1;

        if (hrecs->refs_changed < 0 || hrecs->refs_changed > hrecs->nref)
            hrecs->refs_changed = hrecs->nref;
        hrecs->nref++;
    }

    /* Add to read-group hash? */
    if (type == TYPEKEY("RG")) {
        sam_hrec_tag_t *tag = sam_hrecs_find_key(h_type, "ID", NULL);
        int nrg = hrecs->nrg, r;
        khint_t k;

        if (!tag) {
            hts_log_error("Header includes @RG line with no ID: tag");
            return -1;  // ID should be present, according to spec.
        }
        assert(tag->str && tag->len >= 3);

        // Seen already?
        k = kh_get(m_s2i, hrecs->rg_hash, tag->str + 3);
        if (k < kh_end(hrecs->rg_hash)) {
            nrg = kh_val(hrecs->rg_hash, k);
            assert(hrecs->rg[nrg].ty != NULL);
            if (hrecs->rg[nrg].ty != h_type) {
                hts_log_warning("Duplicate entry \"%s\" in sam header",
                                tag->str + 3);
            } else {
                hrecs->rg[nrg].name = tag->str + 3;
                hrecs->rg[nrg].name_len = tag->len - 3;
            }
            return 0;
        }

        if (nrg == hrecs->rg_sz) {
            size_t new_sz = hrecs->rg_sz >= 4 ? hrecs->rg_sz + hrecs->rg_sz / 4 : 4;
            sam_hrec_rg_t *new_rg = realloc(hrecs->rg, sizeof(*hrecs->rg) * new_sz);
            if (!new_rg)
                return -1;
            hrecs->rg = new_rg;
            hrecs->rg_sz = new_sz;
        }

        hrecs->rg[nrg].name = tag->str + 3;
        hrecs->rg[nrg].name_len = tag->len - 3;
        hrecs->rg[nrg].ty   = h_type;
        hrecs->rg[nrg].id   = nrg;

        k = kh_put(m_s2i, hrecs->rg_hash, hrecs->rg[nrg].name, &r);
        if (-1 == r) return -1;
        kh_val(hrecs->rg_hash, k) = nrg;

        hrecs->nrg++;
    }

    /* Add to program hash? */
    if (type == TYPEKEY("PG")) {
        sam_hrec_tag_t *tag;
        sam_hrec_pg_t *new_pg;
        int npg = hrecs->npg;

        if (npg == hrecs->pg_sz) {
            size_t new_sz = hrecs->pg_sz >= 4 ? hrecs->pg_sz + hrecs->pg_sz / 4 : 4;
            new_pg = realloc(hrecs->pg, sizeof(*hrecs->pg) * new_sz);
            if (!new_pg)
                return -1;
            hrecs->pg = new_pg;
            hrecs->pg_sz = new_sz;
        }

        tag = h_type->tag;
        hrecs->pg[npg].name = NULL;
        hrecs->pg[npg].name_len = 0;
        hrecs->pg[npg].ty  = h_type;
        hrecs->pg[npg].id   = npg;
        hrecs->pg[npg].prev_id = -1;

        while (tag) {
            if (tag->str[0] == 'I' && tag->str[1] == 'D') {
                /* Avoid duplicate ID tags coming from other applications */
                if (!hrecs->pg[npg].name) {
                    assert(tag->len >= 3);
                    hrecs->pg[npg].name = tag->str + 3;
                    hrecs->pg[npg].name_len = tag->len - 3;
                } else {
                    hts_log_warning("PG line with multiple ID tags. The first encountered was preferred - ID:%s", hrecs->pg[npg].name);
                }
            } else if (tag->str[0] == 'P' && tag->str[1] == 'P') {
                // Resolve later if needed
                khint_t k;
                k = kh_get(m_s2i, hrecs->pg_hash, tag->str+3);

                if (k != kh_end(hrecs->pg_hash)) {
                    int p_id = kh_val(hrecs->pg_hash, k);
                    hrecs->pg[npg].prev_id = hrecs->pg[p_id].id;

                    /* Unmark previous entry as a PG termination */
                    if (hrecs->npg_end > 0 &&
                        hrecs->pg_end[hrecs->npg_end-1] == p_id) {
                        hrecs->npg_end--;
                    } else {
                        int i;
                        for (i = 0; i < hrecs->npg_end; i++) {
                            if (hrecs->pg_end[i] == p_id) {
                                memmove(&hrecs->pg_end[i], &hrecs->pg_end[i+1],
                                        (hrecs->npg_end-i-1)*sizeof(*hrecs->pg_end));
                                hrecs->npg_end--;
                            }
                        }
                    }
                } else {
                    hrecs->pg[npg].prev_id = -1;
                }
            }
            tag = tag->next;
        }

        if (hrecs->pg[npg].name) {
            khint_t k;
            int r;
            k = kh_put(m_s2i, hrecs->pg_hash, hrecs->pg[npg].name, &r);
            if (-1 == r) return -1;
            kh_val(hrecs->pg_hash, k) = npg;
        } else {
            return -1; // ID should be present, according to spec.
        }

        /* Add to npg_end[] array. Remove later if we find a PP line */
        if (hrecs->npg_end >= hrecs->npg_end_alloc) {
            int *new_pg_end;
            int  new_alloc = hrecs->npg_end_alloc ? hrecs->npg_end_alloc*2 : 4;

            new_pg_end = realloc(hrecs->pg_end, new_alloc * sizeof(int));
            if (!new_pg_end)
                return -1;
            hrecs->npg_end_alloc = new_alloc;
            hrecs->pg_end = new_pg_end;
        }
        hrecs->pg_end[hrecs->npg_end++] = npg;

        hrecs->npg++;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r14
movq %rdi, %rbx
cmpl $0x5047, %esi           # imm = 0x5047
je 0x6bd35
cmpl $0x5247, %esi           # imm = 0x5247
je 0x6bc85
xorl %r12d, %r12d
cmpl $0x5351, %esi           # imm = 0x5351
jne 0x6c153
movq 0x20(%r14), %r13
movl 0x28(%rbx), %eax
movl %eax, 0x10(%rsp)
pushq $-0x1
popq %rbp
xorl %r15d, %r15d
movq $0x0, 0x8(%rsp)
xorl %r12d, %r12d
testq %r13, %r13
je 0x6bd7c
movq 0x8(%r13), %rdi
movzbl (%rdi), %eax
cmpl $0x41, %eax
je 0x6bc62
cmpl $0x4c, %eax
je 0x6bc2b
cmpl $0x53, %eax
jne 0x6bc7c
cmpb $0x4e, 0x1(%rdi)
jne 0x6bc7c
cmpl $0x2, 0x10(%r13)
jle 0x6c301
addq $0x3, %rdi
movq %rdi, %r12
jmp 0x6bc7c
cmpb $0x4e, 0x1(%rdi)
jne 0x6bc7c
cmpl $0x2, 0x10(%r13)
jle 0x6c320
addq $0x3, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x40b0
movl %r15d, %ecx
cmpq %rax, %rbp
je 0x6bc55
pushq $0x1
popq %rcx
cmpq $-0x1, %rbp
cmovnel %ecx, %r15d
movq %rax, %rbp
jmp 0x6bc7c
cmpb $0x4e, 0x1(%rdi)
jne 0x6bc7c
cmpl $0x2, 0x10(%r13)
jle 0x6c33f
addq $0x3, %rdi
movq %rdi, 0x8(%rsp)
movq (%r13), %r13
jmp 0x6bbf2
leaq 0xe3ca(%rip), %rsi      # 0x7a056
movq %r14, %rdi
xorl %edx, %edx
callq 0x6b93e
testq %rax, %rax
je 0x6bf8d
movq %rax, %r12
movq %r14, 0x8(%rsp)
movq 0x8(%rax), %r15
testq %r15, %r15
je 0x6c37d
movl 0x10(%r12), %r14d
cmpl $0x2, %r14d
jle 0x6c37d
movl 0x40(%rbx), %ebp
movq 0x50(%rbx), %r13
leaq 0x3(%r15), %rsi
movq %r13, %rdi
movq %rsi, 0x10(%rsp)
callq 0x6b87d
cmpl (%r13), %eax
jae 0x6bfb7
movq 0x20(%r13), %rcx
movl %eax, %eax
movslq (%rcx,%rax,4), %rcx
movq 0x48(%rbx), %rax
imulq $0x18, %rcx, %rcx
movq 0x8(%rax,%rcx), %rdx
testq %rdx, %rdx
je 0x6c39c
cmpq 0x8(%rsp), %rdx
je 0x6c13b
leaq 0x18151(%rip), %rsi     # 0x83e68
leaq 0x181b9(%rip), %rdx     # 0x83ed7
xorl %r12d, %r12d
pushq $0x3
popq %rdi
movq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0x110c6
jmp 0x6c153
movl 0x58(%rbx), %ecx
cmpl 0x5c(%rbx), %ecx
jne 0x6bdab
movq %r14, %r15
movl %ecx, %eax
shrl $0x2, %eax
addl %ecx, %eax
movl %ecx, %ebp
cmpl $0x4, %ecx
pushq $0x4
popq %r14
cmovgel %eax, %r14d
movq 0x68(%rbx), %rdi
movq %r14, %rsi
shlq $0x5, %rsi
callq 0x4840
testq %rax, %rax
je 0x6c013
movq %rax, 0x68(%rbx)
movl %r14d, 0x5c(%rbx)
movq %r15, %r14
movl %ebp, %ecx
jmp 0x6bdaf
testq %r12, %r12
je 0x6bf9d
cmpq $-0x1, %rbp
je 0x6bff8
testl %r15d, %r15d
je 0x6c075
leaq 0x180c9(%rip), %rsi     # 0x83e68
leaq 0xe3ba(%rip), %rdx      # 0x7a160
jmp 0x6c006
movq 0x68(%rbx), %rax
movslq %ecx, %r15
movq 0x20(%r14), %rbp
shlq $0x5, %r15
andq $0x0, (%rax,%r15)
andl $0x0, 0x10(%rax,%r15)
movq %r14, 0x8(%rax,%r15)
movl %ecx, 0x8(%rsp)
movl %ecx, 0x14(%rax,%r15)
orl $-0x1, 0x18(%rax,%r15)
testq %rbp, %rbp
je 0x6bef9
movq 0x8(%rbp), %rsi
movzbl (%rsi), %eax
cmpl $0x50, %eax
je 0x6be2b
cmpl $0x49, %eax
jne 0x6beac
cmpb $0x44, 0x1(%rsi)
jne 0x6beac
movq 0x68(%rbx), %rax
movq (%rax,%r15), %rcx
testq %rcx, %rcx
je 0x6be8d
pushq $0x3
popq %rdi
leaq 0x18050(%rip), %rsi     # 0x83e68
leaq 0x1816e(%rip), %rdx     # 0x83f8d
xorl %eax, %eax
callq 0x110c6
jmp 0x6beac
cmpb $0x50, 0x1(%rsi)
jne 0x6beac
movq 0x70(%rbx), %r12
addq $0x3, %rsi
movq %r12, %rdi
callq 0x6b87d
cmpl (%r12), %eax
jne 0x6be53
movq 0x68(%rbx), %rax
orl $-0x1, 0x18(%rax,%r15)
jmp 0x6beac
movq 0x20(%r12), %rcx
movl %eax, %eax
movslq (%rcx,%rax,4), %r12
movq 0x68(%rbx), %rax
movq %r12, %rcx
shlq $0x5, %rcx
movl 0x14(%rax,%rcx), %ecx
movl %ecx, 0x18(%rax,%r15)
movslq 0x60(%rbx), %rax
testq %rax, %rax
jle 0x6beb5
movq 0x78(%rbx), %rcx
cmpl %r12d, -0x4(%rcx,%rax,4)
jne 0x6beb5
decl %eax
movl %eax, 0x60(%rbx)
jmp 0x6beac
movl 0x10(%rbp), %ecx
cmpl $0x2, %ecx
jle 0x6c35e
leaq (%rax,%r15), %rdx
addq $0x3, %rsi
movq %rsi, (%rdx)
addl $-0x3, %ecx
movl %ecx, 0x10(%rax,%r15)
movq (%rbp), %rbp
jmp 0x6bdd9
pushq $-0x1
popq %r14
xorl %r13d, %r13d
movslq %eax, %rcx
cmpq %rcx, %r13
jge 0x6beac
movq 0x78(%rbx), %rcx
cmpl %r12d, (%rcx,%r13,4)
jne 0x6bef1
leaq (%rcx,%r13,4), %rdi
leaq (%rcx,%r13,4), %rsi
addq $0x4, %rsi
addl %r14d, %eax
movslq %eax, %rdx
shlq $0x2, %rdx
callq 0x4830
movl 0x60(%rbx), %eax
decl %eax
movl %eax, 0x60(%rbx)
incq %r13
decl %r14d
jmp 0x6bebc
movq 0x68(%rbx), %rax
movq (%rax,%r15), %rsi
pushq $-0x1
popq %r12
testq %rsi, %rsi
je 0x6c153
movq 0x70(%rbx), %rdi
leaq 0x20(%rsp), %r14
movq %r14, %rdx
callq 0x6b9b4
cmpl $-0x1, (%r14)
je 0x6c153
movq 0x70(%rbx), %rcx
movq 0x20(%rcx), %rcx
movl %eax, %eax
movl 0x8(%rsp), %esi
movl %esi, (%rcx,%rax,4)
movl 0x60(%rbx), %ecx
movl 0x64(%rbx), %edx
movq 0x78(%rbx), %rax
cmpl %edx, %ecx
jl 0x6bf79
leal (%rdx,%rdx), %ecx
testl %edx, %edx
pushq $0x4
popq %rbp
cmovnel %ecx, %ebp
movslq %ebp, %rsi
shlq $0x2, %rsi
movq %rax, %rdi
callq 0x4840
testq %rax, %rax
je 0x6c153
movl %ebp, 0x64(%rbx)
movq %rax, 0x78(%rbx)
movl 0x60(%rbx), %ecx
movl 0x8(%rsp), %esi
leal 0x1(%rcx), %edx
movl %edx, 0x60(%rbx)
movslq %ecx, %rcx
movl %esi, (%rax,%rcx,4)
incl 0x58(%rbx)
jmp 0x6c150
leaq 0x17ed4(%rip), %rsi     # 0x83e68
leaq 0x17f95(%rip), %rdx     # 0x83f30
jmp 0x6bfab
leaq 0x17ec4(%rip), %rsi     # 0x83e68
leaq 0x17ed5(%rip), %rdx     # 0x83e80
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x110c6
jmp 0x6c013
cmpl 0x44(%rbx), %ebp
jne 0x6c01c
movl %ebp, %eax
shrl $0x2, %eax
addl %ebp, %eax
cmpl $0x4, %ebp
pushq $0x4
popq %r14
cmovgel %eax, %r14d
movq 0x48(%rbx), %rdi
imulq $0x18, %r14, %rsi
callq 0x4840
testq %rax, %rax
je 0x6c013
movq %rax, 0x48(%rbx)
movl %r14d, 0x44(%rbx)
movq 0x8(%r12), %r15
movl 0x10(%r12), %r14d
movq 0x50(%rbx), %r13
jmp 0x6c020
leaq 0x17e69(%rip), %rsi     # 0x83e68
leaq 0x17ea3(%rip), %rdx     # 0x83ea9
pushq $0x1
popq %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x110c6
pushq $-0x1
popq %r12
jmp 0x6c153
movq 0x48(%rbx), %rax
movslq %ebp, %rcx
addq $0x3, %r15
imulq $0x18, %rcx, %rcx
movq %r15, (%rax,%rcx)
addl $-0x3, %r14d
movl %r14d, 0x10(%rax,%rcx)
movq 0x8(%rsp), %rdx
movq %rdx, 0x8(%rax,%rcx)
movl %ebp, 0x14(%rax,%rcx)
leaq 0x20(%rsp), %r12
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x6b9b4
cmpl $-0x1, (%r12)
je 0x6c013
movq 0x50(%rbx), %rcx
movq 0x20(%rcx), %rcx
movl %eax, %eax
movl %ebp, (%rcx,%rax,4)
incl 0x40(%rbx)
jmp 0x6c150
movq 0x38(%rbx), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x6b87d
cmpl (%r13), %eax
jae 0x6c0f5
movq %r14, %r15
movq 0x20(%r13), %rcx
movl %eax, %eax
movl (%rcx,%rax,4), %r13d
movq 0x30(%rbx), %rax
movslq %r13d, %rcx
imulq $0x18, %rcx, %rcx
leaq (%rax,%rcx), %r14
movq 0x10(%rax,%rcx), %rdx
testq %rdx, %rdx
je 0x6c1e8
cmpq %r15, %rdx
je 0x6c286
movq (%r14), %rdi
movq %r12, %rsi
callq 0x46c0
leaq 0x17d99(%rip), %rsi     # 0x83e68
testl %eax, %eax
je 0x6c2f5
leaq 0x17e1c(%rip), %rdx     # 0x83efa
pushq $0x3
popq %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x110c6
movl 0x28(%rbx), %eax
movl %eax, 0x10(%rsp)
movq %r15, %r14
movl 0x10(%rsp), %r13d
cmpl 0x2c(%rbx), %r13d
jne 0x6c165
movq %r14, %r15
movl %r13d, %eax
shrl $0x2, %eax
addl %r13d, %eax
cmpl $0x4, %r13d
pushq $0x20
popq %r14
cmovgel %eax, %r14d
movq 0x30(%rbx), %rdi
imulq $0x18, %r14, %rsi
callq 0x4840
testq %rax, %rax
je 0x6c013
movq %rax, 0x30(%rbx)
movl %r14d, 0x2c(%rbx)
movq %r15, %r14
jmp 0x6c169
leaq (%rax,%rcx), %rdx
movq 0x10(%rsp), %rsi
movq %rsi, (%rdx)
addl $-0x3, %r14d
movl %r14d, 0x10(%rax,%rcx)
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x30(%rbx), %rax
movslq %r13d, %rcx
imulq $0x18, %rcx, %rcx
movq %r12, (%rax,%rcx)
movq %rbp, 0x8(%rax,%rcx)
movq %r14, 0x10(%rax,%rcx)
movq 0x38(%rbx), %rdi
leaq 0x1c(%rsp), %r14
movq %r12, %rsi
movq %r14, %rdx
callq 0x6b9b4
pushq $-0x1
popq %r12
cmpl $-0x1, (%r14)
je 0x6c153
movq 0x38(%rbx), %rcx
movq 0x20(%rcx), %rcx
movl %eax, %eax
movl %r13d, (%rcx,%rax,4)
movq %rbx, %rdi
movl %r13d, %esi
movq 0x8(%rsp), %rdx
callq 0x6e1a6
testl %eax, %eax
js 0x6c153
movl 0x28(%rbx), %eax
movl 0x94(%rbx), %ecx
testl %ecx, %ecx
sets %dl
cmpl %eax, %ecx
setg %cl
orb %dl, %cl
cmpb $0x1, %cl
jne 0x6c1de
movl %eax, 0x94(%rbx)
incl %eax
movl %eax, 0x28(%rbx)
jmp 0x6c150
movl %r13d, 0x10(%rsp)
movq %r15, 0x10(%r14)
movq 0x8(%rax,%rcx), %r13
cmpq %r13, %rbp
je 0x6c239
leaq 0xc3a0(%rip), %rdx      # 0x785a2
leaq 0x20(%rsp), %r12
pushq $0x20
popq %rsi
movq %r12, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x4800
leaq 0x1114a(%rip), %rdx     # 0x7d368
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rcx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x6e122
testl %eax, %eax
js 0x6c013
movq %rbx, %rdi
movl 0x10(%rsp), %esi
movq 0x8(%rsp), %rdx
callq 0x6e1a6
movl %eax, %r12d
sarl $0x1f, %r12d
cmpq %r13, %rbp
je 0x6c153
testl %eax, %eax
js 0x6c153
movl 0x94(%rbx), %eax
xorl %r12d, %r12d
testl %eax, %eax
movl 0x10(%rsp), %ecx
js 0x6c27b
cmpl %ecx, %eax
jle 0x6c153
movl %ecx, 0x94(%rbx)
jmp 0x6c153
xorl %r15d, %r15d
cmpq %rbp, 0x8(%r14)
je 0x6c297
movq %rbp, 0x8(%r14)
pushq $0x1
popq %r15
movq (%r14), %rdi
testq %rdi, %rdi
je 0x6c2ab
movq %r12, %rsi
callq 0x46c0
testl %eax, %eax
je 0x6c2b2
movq %r12, (%r14)
pushq $0x1
popq %r15
movq %rbx, %rdi
movl %r13d, %esi
movq 0x8(%rsp), %rdx
callq 0x6e1a6
testl %eax, %eax
js 0x6c013
xorl %r12d, %r12d
testl %r15d, %r15d
je 0x6c153
movl 0x94(%rbx), %eax
testl %eax, %eax
js 0x6c2e9
cmpl %r13d, %eax
jle 0x6c153
movl %r13d, 0x94(%rbx)
jmp 0x6c153
leaq 0x17bdb(%rip), %rdx     # 0x83ed7
jmp 0x6c006
leaq 0x17c5d(%rip), %rdi     # 0x83f65
leaq 0x1744c(%rip), %rsi     # 0x8375b
leaq 0x17b09(%rip), %rcx     # 0x83e1f
movl $0x99, %edx
callq 0x42f0
leaq 0x17c3e(%rip), %rdi     # 0x83f65
leaq 0x1742d(%rip), %rsi     # 0x8375b
leaq 0x17aea(%rip), %rcx     # 0x83e1f
movl $0x9c, %edx
callq 0x42f0
leaq 0x17c1f(%rip), %rdi     # 0x83f65
leaq 0x1740e(%rip), %rsi     # 0x8375b
leaq 0x17acb(%rip), %rcx     # 0x83e1f
movl $0xa3, %edx
callq 0x42f0
leaq 0x17c00(%rip), %rdi     # 0x83f65
leaq 0x173ef(%rip), %rsi     # 0x8375b
leaq 0x17aac(%rip), %rcx     # 0x83e1f
movl $0x159, %edx            # imm = 0x159
callq 0x42f0
leaq 0x17bd5(%rip), %rdi     # 0x83f59
leaq 0x173d0(%rip), %rsi     # 0x8375b
leaq 0x17a8d(%rip), %rcx     # 0x83e1f
movl $0x119, %edx            # imm = 0x119
callq 0x42f0
leaq 0x17bd0(%rip), %rdi     # 0x83f73
leaq 0x173b1(%rip), %rsi     # 0x8375b
leaq 0x17a6e(%rip), %rcx     # 0x83e1f
movl $0x11f, %edx            # imm = 0x11F
callq 0x42f0