// File: /workspace/github_c_makefile_star2_O1/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 0x85d87
movq %r9, %r14
movl %r8d, %ebp
movq %rdi, %r13
movq %rdx, 0x40(%rsp)
movl %ecx, 0x20(%rsp)
movq %rsi, 0x48(%rsp)
movq %rsi, %rdi
callq 0x4930
movq %rax, %r12
movq 0x18(%r13), %rdi
movl 0x8(%rdi), %eax
cmpl 0xc(%rdi), %eax
movq %rdi, 0x8(%rsp)
jb 0x85dc5
movl (%rdi), %esi
movl 0x4(%rdi), %eax
addl %eax, %eax
cmpl %eax, %esi
jbe 0x85dac
decl %esi
jmp 0x85dae
leaq 0x1e484(%rip), %rsi     # 0xa4212
leaq 0x1e48e(%rip), %rdx     # 0xa4223
movl $0x1, %edi
xorl %eax, %eax
callq 0x14378
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x8603a
incl %esi
movq 0x8(%rsp), %rdi
callq 0x8604c
movq 0x8(%rsp), %rdi
testl %eax, %eax
js 0x85eaa
movl (%rdi), %edx
leal -0x1(%rdx), %r8d
movb (%r12), %cl
testb %cl, %cl
je 0x85df7
movq %r12, %rax
incq %rax
movl $0x811c9dc5, %r15d      # imm = 0x811C9DC5
movzbl %cl, %ecx
xorl %r15d, %ecx
imull $0x1000193, %ecx, %r15d # imm = 0x1000193
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x85ddf
jmp 0x85dfd
movl $0x811c9dc5, %r15d      # imm = 0x811C9DC5
movq %r13, 0x28(%rsp)
andl %r8d, %r15d
movq 0x10(%rdi), %rsi
movl %r15d, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %eax
leal (%r15,%r15), %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x85eeb
movq %r12, 0x30(%rsp)
movl %ebp, 0x1c(%rsp)
movq %r14, 0x38(%rsp)
movl $0x1, %r14d
movl %r15d, %ebx
movq %rdx, 0x10(%rsp)
movl %edx, %r13d
movq %rsi, 0x50(%rsp)
movl %r8d, 0x24(%rsp)
movl %ebx, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %ebp
leal (%rbx,%rbx), %r12d
andl $0x1e, %r12d
movl %ebp, %eax
movl %r12d, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x85eaf
testb $0x1, %al
jne 0x85e8f
movq 0x18(%rdi), %rax
movl %ebx, %ecx
movq (%rax,%rcx,8), %rdi
movq 0x30(%rsp), %rsi
callq 0x46c0
movl 0x24(%rsp), %r8d
movq 0x50(%rsp), %rsi
movq 0x8(%rsp), %rdi
testl %eax, %eax
je 0x85eaf
btl %r12d, %ebp
cmovbl %ebx, %r13d
addl %r14d, %ebx
andl %r8d, %ebx
incl %r14d
movl %r13d, %eax
cmpl %r15d, %ebx
jne 0x85e49
jmp 0x85eb4
movl (%rdi), %r15d
jmp 0x85f2e
movq 0x10(%rsp), %rax
movl %eax, %r15d
movq 0x10(%rsp), %rdx
cmpl %edx, %eax
movq 0x38(%rsp), %r14
movl 0x1c(%rsp), %ebp
movq 0x30(%rsp), %r12
jne 0x85eeb
movl %ebx, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %eax
leal (%rbx,%rbx), %ecx
shrl %cl, %eax
cmpl %edx, %r13d
cmovel %ebx, %r13d
testb $0x2, %al
cmovel %ebx, %r13d
movl %r13d, %r15d
movl %r15d, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %esi
leal (%r15,%r15), %ecx
andl $0x1e, %ecx
shrl %cl, %esi
testb $0x2, %sil
jne 0x85f32
movb $0x1, %dl
testb $0x1, %sil
movq 0x28(%rsp), %r13
je 0x85f5a
movq 0x18(%rdi), %rdx
movl %r15d, %esi
movq %r12, (%rdx,%rsi,8)
movl $0x3, %edx
shll %cl, %edx
notl %edx
movq 0x10(%rdi), %rcx
andl %edx, (%rcx,%rax,4)
incl 0x4(%rdi)
xorl %edx, %edx
jmp 0x85f5a
movq 0x18(%rdi), %rdx
movl %r15d, %esi
movq %r12, (%rdx,%rsi,8)
movl $0x3, %edx
shll %cl, %edx
notl %edx
movq 0x10(%rdi), %rcx
andl %edx, (%rcx,%rax,4)
incl 0x4(%rdi)
incl 0x8(%rdi)
xorl %edx, %edx
movq 0x28(%rsp), %r13
testb %dl, %dl
je 0x85f90
leaq 0x1e2ad(%rip), %rsi     # 0xa4212
leaq 0x1e2c6(%rip), %rdx     # 0xa4232
xorl %r15d, %r15d
movl $0x3, %edi
movq 0x48(%rsp), %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x14378
movq %r12, %rdi
callq 0x45c0
jmp 0x8603a
movq 0x18(%r13), %rax
movl %r15d, %ecx
leaq (%rcx,%rcx,4), %rbx
shlq $0x3, %rbx
addq 0x20(%rax), %rbx
movl 0xc(%r13), %eax
cmpl %eax, 0x8(%r13)
jne 0x85fff
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x10, %eax
cmovnel %ecx, %eax
movl %eax, 0xc(%r13)
movq 0x10(%r13), %rdi
movslq %eax, %rsi
shlq $0x3, %rsi
callq 0x4840
movq %rax, %r15
testq %rax, %rax
je 0x85fdc
movq %r15, 0x10(%r13)
jmp 0x85ff6
leaq 0x1e22f(%rip), %rsi     # 0xa4212
leaq 0x1469b(%rip), %rdx     # 0x9a685
movl $0x1, %edi
xorl %eax, %eax
callq 0x14378
testq %r15, %r15
je 0x85da1
movq 0x90(%rsp), %rax
movslq 0x8(%r13), %rcx
movl %ecx, (%rbx)
movq 0x10(%r13), %rdx
leal 0x1(%rcx), %esi
movl %esi, 0x8(%r13)
movq %r12, (%rdx,%rcx,8)
movq 0x40(%rsp), %rcx
movq %rcx, 0x10(%rbx)
movl 0x20(%rsp), %ecx
movl %ecx, 0x4(%rbx)
movl %ebp, 0x8(%rbx)
movq %r14, 0x18(%rbx)
movq %rax, 0x20(%rbx)
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq