// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movq %r9, -0x30(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xd6020
movl $0x1, %edi
leaq 0x21c78(%rip), %rsi     # 0xf7c7e
leaq 0x21c82(%rip), %rdx     # 0xf7c8f
movb $0x0, %al
callq 0x1b030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd6198
movq -0x18(%rbp), %rdi
callq 0x4920
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x38(%rbp), %rsi
leaq -0x3c(%rbp), %rdx
callq 0xd6310
movl %eax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movl -0x40(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0xd609c
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %r8
movl $0x3, %edi
leaq 0x21c05(%rip), %rsi     # 0xf7c7e
leaq 0x21c1e(%rip), %rdx     # 0xf7c9e
movb $0x0, %al
callq 0x1b030
movq -0x38(%rbp), %rdi
callq 0x45a0
movl $0x0, -0x4(%rbp)
jmp 0xd6198
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jne 0xd612a
movq -0x10(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0xd60c4
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
shll %eax
movl %eax, -0x54(%rbp)
jmp 0xd60ce
movl $0x10, %eax
movl %eax, -0x54(%rbp)
jmp 0xd60ce
movl -0x54(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movslq 0xc(%rax), %rsi
shlq $0x3, %rsi
callq 0x4820
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
jne 0xd611e
movl $0x1, %edi
leaq 0x21b77(%rip), %rsi     # 0xf7c7e
leaq 0x1baa2(%rip), %rdx     # 0xf1bb0
movb $0x0, %al
callq 0x1b030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd6198
movq -0x50(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x48(%rbp), %rax
movl %ecx, (%rax)
movq -0x38(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rsi
movl 0x8(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x8(%rsi)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x20(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x24(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x28(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x30(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x18(%rax)
movq 0x10(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x20(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)