// File: /workspace/github_c_makefile_star2_O2/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 0x68a71
movq %r9, %r14
movl %r8d, %r13d
movl %ecx, %ebp
movq %rdi, %rbx
movq %rdx, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rsi, %rdi
callq 0x4930
movq %rax, %r15
movq 0x18(%rbx), %r12
movl 0x8(%r12), %eax
cmpl 0xc(%r12), %eax
movq %rbx, 0x48(%rsp)
jb 0x68aa3
movl (%r12), %esi
movl 0x4(%r12), %eax
addl %eax, %eax
cmpl %eax, %esi
jbe 0x68a91
decl %esi
jmp 0x68a93
leaq 0x1a81a(%rip), %rsi     # 0x83292
leaq 0x1a824(%rip), %rdx     # 0x832a3
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x110c6
pushq $-0x1
popq %rbx
jmp 0x68cf1
incl %esi
movq %r12, %rdi
callq 0x68d15
testl %eax, %eax
js 0x68b86
movl %ebp, 0xc(%rsp)
movl (%r12), %ebx
leal -0x1(%rbx), %ebp
movq %r15, %rdi
callq 0x6900a
movl %eax, %edi
andl %ebp, %edi
movq %r12, 0x18(%rsp)
movq 0x10(%r12), %rdx
movl %edi, %eax
shrl $0x4, %eax
movl (%rdx,%rax,4), %eax
leal (%rdi,%rdi), %ecx
shrl %cl, %eax
testb $0x2, %al
je 0x68add
movl %edi, %r12d
jmp 0x68bc2
movl %r13d, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movq %r14, 0x30(%rsp)
pushq $0x1
popq %r15
movl %edi, %r14d
movq %rbx, 0x28(%rsp)
movl %ebx, %r12d
movq %rdi, 0x50(%rsp)
movl %ebp, 0x24(%rsp)
movl %r14d, %eax
shrl $0x4, %eax
movl (%rdx,%rax,4), %r13d
leal (%r14,%r14), %ebx
andl $0x1e, %ebx
movl %r13d, %eax
movl %ebx, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x68b8f
testb $0x1, %al
jne 0x68b51
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movl %r14d, %ecx
movq (%rax,%rcx,8), %rdi
movq 0x10(%rsp), %rsi
movq %rdx, %rbp
callq 0x46c0
movq 0x50(%rsp), %rdi
movq %rbp, %rdx
movl 0x24(%rsp), %ebp
testl %eax, %eax
je 0x68b8f
btl %ebx, %r13d
cmovbl %r14d, %r12d
addl %r15d, %r14d
andl %ebp, %r14d
incl %r15d
cmpl %edi, %r14d
jne 0x68b04
movb $0x1, %al
movq 0x28(%rsp), %rsi
movl %esi, %ecx
cmpl %esi, %r12d
movq 0x30(%rsp), %r14
movq 0x10(%rsp), %r15
movl 0x8(%rsp), %r13d
je 0x68bb5
jmp 0x68bc2
movl (%r12), %r12d
jmp 0x68c68
movl %ebx, %ecx
shrl %cl, %r13d
testb $0x2, %r13b
sete %al
movl %r12d, %ecx
movl %r14d, %edi
movq 0x30(%rsp), %r14
movq 0x10(%rsp), %r15
movl 0x8(%rsp), %r13d
movq 0x28(%rsp), %rsi
cmpl %esi, %ecx
cmovel %edi, %ecx
testb %al, %al
cmovnel %edi, %ecx
movl %ecx, %r12d
movl %r12d, %eax
shrl $0x4, %eax
movl (%rdx,%rax,4), %edx
leal (%r12,%r12), %ecx
andl $0x1e, %ecx
shrl %cl, %edx
testb $0x2, %dl
jne 0x68c11
testb $0x1, %dl
movl 0xc(%rsp), %ebp
jne 0x68c47
leaq 0x1a6a9(%rip), %rsi     # 0x83292
leaq 0x1a6c2(%rip), %rdx     # 0x832b2
xorl %ebx, %ebx
pushq $0x3
popq %rdi
movq 0x38(%rsp), %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x110c6
movq %r15, %rdi
callq 0x45c0
jmp 0x68cf1
movq 0x18(%rsp), %rdi
movq 0x18(%rdi), %rdx
movl %r12d, %esi
movq %r15, (%rdx,%rsi,8)
pushq $0x3
popq %rdx
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 0xc(%rsp), %ebp
jmp 0x68c68
movq 0x18(%rsp), %rdi
movq 0x18(%rdi), %rdx
movl %r12d, %esi
movq %r15, (%rdx,%rsi,8)
pushq $0x3
popq %rdx
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 %r12d, %ecx
movq %rdx, %r12
imulq $0x28, %rcx, %rbx
addq 0x20(%rax), %rbx
movl 0x8(%rdx), %ecx
cmpl 0xc(%rdx), %ecx
jne 0x68cb9
leal (%rcx,%rcx), %eax
testl %ecx, %ecx
pushq $0x10
popq %rcx
cmovnel %eax, %ecx
movl %ecx, 0xc(%r12)
movq 0x10(%r12), %rdi
movslq %ecx, %rsi
shlq $0x3, %rsi
callq 0x4840
testq %rax, %rax
je 0x68d02
movq %rax, 0x10(%r12)
movl 0x8(%r12), %ecx
jmp 0x68cbe
movq 0x10(%r12), %rax
movq 0x90(%rsp), %rdx
movl %ecx, (%rbx)
leal 0x1(%rcx), %esi
movl %esi, 0x8(%r12)
movslq %ecx, %rcx
movq %r15, (%rax,%rcx,8)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rbx)
movl %ebp, 0x4(%rbx)
movl %r13d, 0x8(%rbx)
movq %r14, 0x18(%rbx)
movq %rdx, 0x20(%rbx)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1a589(%rip), %rsi     # 0x83292
leaq 0x108d5(%rip), %rdx     # 0x795e5
jmp 0x68a7f