// File: /workspace/github_c_makefile_star2_O0/zhou-lab[P]tbmate/htslib/faidx.c
// Function: fai_insert_index
static inline int fai_insert_index(faidx_t *idx, const char *name, int len, int line_len, int line_blen, uint64_t offset)
{
    if (!name) {
        fprintf(stderr, "[fai_build_core] malformed line\n");
        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) {
        fprintf(stderr, "[fai_build_core] ignoring duplicate sequence \"%s\" at byte offset %"PRIu64"\n", name, 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))) {
            fprintf(stderr, "[fai_build_core] out of memory\n");
            return -1;
        }
        idx->name = tmp;
    }
    idx->name[idx->n++] = name_key;
    v->len = len;
    v->line_len = line_len;
    v->line_blen = line_blen;
    v->offset = offset;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq %r9, -0x30(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x3eaa9
movq 0x4655c(%rip), %rax     # 0x84fe8
movq (%rax), %rdi
leaq 0x3a011(%rip), %rsi     # 0x78aa7
movb $0x0, %al
callq 0x37f0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3ec03
movq -0x18(%rbp), %rdi
callq 0x35f0
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x38(%rbp), %rsi
leaq -0x3c(%rbp), %rdx
callq 0x401e0
movl %eax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movl -0x40(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x3eb23
movq 0x464f3(%rip), %rax     # 0x84fe8
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %rcx
leaq 0x39fc1(%rip), %rsi     # 0x78ac8
movb $0x0, %al
callq 0x37f0
movq -0x38(%rbp), %rdi
callq 0x3370
movl $0x0, -0x4(%rbp)
jmp 0x3ec03
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jne 0x3ebaf
movq -0x10(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0x3eb4b
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
shll %eax
movl %eax, -0x54(%rbp)
jmp 0x3eb55
movl $0x10, %eax
movl %eax, -0x54(%rbp)
jmp 0x3eb55
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 0x37c0
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
jne 0x3eba3
movq 0x4645f(%rip), %rax     # 0x84fe8
movq (%rax), %rdi
leaq 0x39f7b(%rip), %rsi     # 0x78b0e
movb $0x0, %al
callq 0x37f0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3ec03
movq -0x50(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%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)
movslq -0x1c(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x8(%rax)
movl -0x20(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, (%rax)
movl -0x24(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x10(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)