// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/faidx.c
// Function: fai_insert_index
static inline int fai_insert_index(faidx_t *idx, const char *name, uint64_t len, uint32_t line_len, uint32_t line_blen, uint64_t seq_offset, uint64_t qual_offset)
{
    if (!name) {
        hts_log_error("Malformed line");
        return -1;
    }

    char *name_key = strdup(name);
    int absent;
    khint_t k = kh_put(s, idx->hash, name_key, &absent);
    faidx1_t *v = &kh_value(idx->hash, k);

    if (! absent) {
        hts_log_warning("Ignoring duplicate sequence \"%s\" at byte offset %" PRIu64, name, seq_offset);
        free(name_key);
        return 0;
    }

    if (idx->n == idx->m) {
        char **tmp;
        idx->m = idx->m? idx->m<<1 : 16;
        if (!(tmp = (char**)realloc(idx->name, sizeof(char*) * idx->m))) {
            hts_log_error("Out of memory");
            return -1;
        }
        idx->name = tmp;
    }
    v->id = idx->n;
    idx->name[idx->n++] = name_key;
    v->len = len;
    v->line_len = line_len;
    v->line_blen = line_blen;
    v->seq_offset = seq_offset;
    v->qual_offset = qual_offset;

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
testq %rsi, %rsi
je 0x83850
movq %r9, %r15
movl %r8d, %r12d
movl %ecx, %r14d
movq %rsi, %rbp
movq %rdi, %rbx
movq %rdx, 0x40(%rsp)
movq %rsi, %rdi
callq 0x4930
movq %rax, %r13
movq 0x18(%rbx), %rdi
movl 0x8(%rdi), %eax
cmpl 0xc(%rdi), %eax
movq %rdi, 0x8(%rsp)
movq %rbx, 0x48(%rsp)
jb 0x8388d
movl (%rdi), %esi
movl 0x4(%rdi), %eax
addl %eax, %eax
cmpl %eax, %esi
jbe 0x83874
decl %esi
jmp 0x83876
leaq 0x1e14b(%rip), %rsi     # 0xa19a2
leaq 0x1e155(%rip), %rdx     # 0xa19b3
movl $0x1, %edi
xorl %eax, %eax
callq 0x13de5
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x83af6
incl %esi
movq 0x8(%rsp), %rdi
callq 0x83b1a
movq 0x8(%rsp), %rdi
testl %eax, %eax
js 0x83994
movl %r14d, 0x14(%rsp)
movl (%rdi), %eax
movq %rax, 0x18(%rsp)
leal -0x1(%rax), %edx
movb (%r13), %cl
testb %cl, %cl
je 0x838c8
movq %r13, %rax
incq %rax
movl $0x811c9dc5, %r14d      # imm = 0x811C9DC5
movzbl %cl, %ecx
xorl %r14d, %ecx
imull $0x1000193, %ecx, %r14d # imm = 0x1000193
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x838b0
jmp 0x838ce
movl $0x811c9dc5, %r14d      # imm = 0x811C9DC5
movq %rbp, 0x38(%rsp)
andl %edx, %r14d
movq 0x10(%rdi), %rsi
movl %r14d, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %eax
leal (%r14,%r14), %ecx
shrl %cl, %eax
testb $0x2, %al
je 0x838f5
movl %r14d, %ebp
jmp 0x839cc
movq %r13, 0x20(%rsp)
movl %r12d, 0x10(%rsp)
movq %r15, 0x30(%rsp)
movl $0x1, %r13d
movl %r14d, %ebx
movq 0x18(%rsp), %rbp
movq %rsi, 0x50(%rsp)
movl %edx, 0x2c(%rsp)
movl %ebx, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %r15d
leal (%rbx,%rbx), %r12d
andl $0x1e, %r12d
movl %r15d, %eax
movl %r12d, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x8399b
testb $0x1, %al
jne 0x83962
movq 0x18(%rdi), %rax
movl %ebx, %ecx
movq (%rax,%rcx,8), %rdi
movq 0x20(%rsp), %rsi
callq 0x46c0
movl 0x2c(%rsp), %edx
movq 0x50(%rsp), %rsi
movq 0x8(%rsp), %rdi
testl %eax, %eax
je 0x8399b
btl %r12d, %r15d
cmovbl %ebx, %ebp
addl %r13d, %ebx
andl %edx, %ebx
incl %r13d
cmpl %r14d, %ebx
jne 0x8391b
movb $0x1, %al
movq 0x18(%rsp), %rdx
movl %edx, %ecx
cmpl %edx, %ebp
movq 0x30(%rsp), %r15
movl 0x10(%rsp), %r12d
movq 0x20(%rsp), %r13
je 0x839bc
jmp 0x839cc
movl (%rdi), %ebp
jmp 0x83a70
movl %r12d, %ecx
shrl %cl, %r15d
testb $0x2, %r15b
sete %al
movl %ebp, %ecx
movl %ebx, %r14d
movq 0x30(%rsp), %r15
movl 0x10(%rsp), %r12d
movq 0x20(%rsp), %r13
cmpl 0x18(%rsp), %ecx
cmovel %r14d, %ecx
testb %al, %al
cmovnel %r14d, %ecx
movl %ecx, %ebp
movl %ebp, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %edx
leal (,%rbp,2), %ecx
andl $0x1e, %ecx
shrl %cl, %edx
testb $0x2, %dl
jne 0x83a20
testb $0x1, %dl
movl 0x14(%rsp), %r14d
jne 0x83a53
leaq 0x1dfac(%rip), %rsi     # 0xa19a2
leaq 0x1dfc5(%rip), %rdx     # 0xa19c2
xorl %ebp, %ebp
movl $0x3, %edi
movq 0x38(%rsp), %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x13de5
movq %r13, %rdi
callq 0x45c0
jmp 0x83af6
movq 0x18(%rdi), %rdx
movl %ebp, %esi
movq %r13, (%rdx,%rsi,8)
movl $0x3, %edx
shll %cl, %edx
notl %edx
movq 0x10(%rdi), %rcx
andl %edx, (%rcx,%rax,4)
movq 0x4(%rdi), %xmm0
pcmpeqd %xmm1, %xmm1
psubd %xmm1, %xmm0
movq %xmm0, 0x4(%rdi)
movl 0x14(%rsp), %r14d
jmp 0x83a70
movq 0x18(%rdi), %rdx
movl %ebp, %esi
movq %r13, (%rdx,%rsi,8)
movl $0x3, %edx
shll %cl, %edx
notl %edx
movq 0x10(%rdi), %rcx
andl %edx, (%rcx,%rax,4)
incl 0x4(%rdi)
movq 0x48(%rsp), %rdx
movq 0x18(%rdx), %rax
movl %ebp, %ecx
movq %rdx, %rbp
leaq (%rcx,%rcx,4), %rbx
shlq $0x3, %rbx
addq 0x20(%rax), %rbx
movl 0x8(%rdx), %ecx
cmpl 0xc(%rdx), %ecx
jne 0x83ac0
leal (%rcx,%rcx), %eax
testl %ecx, %ecx
movl $0x10, %ecx
cmovnel %eax, %ecx
movl %ecx, 0xc(%rbp)
movq 0x10(%rbp), %rdi
movslq %ecx, %rsi
shlq $0x3, %rsi
callq 0x4840
testq %rax, %rax
je 0x83b07
movq %rax, 0x10(%rbp)
movl 0x8(%rbp), %ecx
jmp 0x83ac4
movq 0x10(%rbp), %rax
movq 0x90(%rsp), %rdx
movl %ecx, (%rbx)
leal 0x1(%rcx), %esi
movl %esi, 0x8(%rbp)
movslq %ecx, %rcx
movq %r13, (%rax,%rcx,8)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rbx)
movl %r14d, 0x4(%rbx)
movl %r12d, 0x8(%rbx)
movq %r15, 0x18(%rbx)
movq %rdx, 0x20(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1de94(%rip), %rsi     # 0xa19a2
leaq 0x13b80(%rip), %rdx     # 0x97695
jmp 0x8385e