// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: sam_hdr_line_index
int sam_hdr_line_index(sam_hdr_t *bh,
                       const char *type,
                       const char *key) {
    sam_hrecs_t *hrecs;
    if (!bh || !type || !key)
        return -2;

    if (!(hrecs = bh->hrecs)) {
        if (sam_hdr_fill_hrecs(bh) != 0)
            return -2;
        hrecs = bh->hrecs;
    }

    khint_t k;
    int idx = -1;
    switch (type[0]) {
    case 'S':
        if (type[1] == 'Q') {
            k = kh_get(m_s2i, hrecs->ref_hash, key);
            if (k != kh_end(hrecs->ref_hash))
                idx = kh_val(hrecs->ref_hash, k);
        } else {
            hts_log_warning("Type '%s' not supported. Only @SQ, @RG and @PG lines are indexed", type);
        }
        break;
    case 'R':
        if (type[1] == 'G') {
            k = kh_get(m_s2i, hrecs->rg_hash, key);
            if (k != kh_end(hrecs->rg_hash))
                idx = kh_val(hrecs->rg_hash, k);
        } else {
            hts_log_warning("Type '%s' not supported. Only @SQ, @RG and @PG lines are indexed", type);
        }
        break;
    case 'P':
        if (type[1] == 'G') {
            k = kh_get(m_s2i, hrecs->pg_hash, key);
            if (k != kh_end(hrecs->pg_hash))
                idx = kh_val(hrecs->pg_hash, k);
        } else {
            hts_log_warning("Type '%s' not supported. Only @SQ, @RG and @PG lines are indexed", type);
        }
        break;
    default:
        hts_log_warning("Type '%s' not supported. Only @SQ, @RG and @PG lines are indexed", type);
    }

    return idx;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xdcf29
cmpq $0x0, -0x18(%rbp)
je 0xdcf29
cmpq $0x0, -0x20(%rbp)
jne 0xdcf35
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0xdd100
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0xdcf6d
movq -0x10(%rbp), %rdi
callq 0xd7490
cmpl $0x0, %eax
je 0xdcf61
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0xdd100
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x28(%rbp)
movl $0xffffffff, -0x30(%rbp) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x34(%rbp)
subl $0x50, %eax
je 0xdd075
jmp 0xdcf89
movl -0x34(%rbp), %eax
subl $0x52, %eax
je 0xdd00b
jmp 0xdcf93
movl -0x34(%rbp), %eax
subl $0x53, %eax
jne 0xdd0dc
jmp 0xdcfa1
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x51, %eax
jne 0xdcfe8
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0xdae00
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x28(%rbp), %rcx
movq 0x38(%rcx), %rcx
cmpl (%rcx), %eax
je 0xdcfe6
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x20(%rax), %rax
movl -0x2c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x30(%rbp)
jmp 0xdd006
movq -0x18(%rbp), %rcx
movl $0x3, %edi
leaq 0x1b263(%rip), %rsi     # 0xf825b
leaq 0x1b26f(%rip), %rdx     # 0xf826e
movb $0x0, %al
callq 0x1b030
jmp 0xdd0fa
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x47, %eax
jne 0xdd052
movq -0x28(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0xdae00
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x28(%rbp), %rcx
movq 0x50(%rcx), %rcx
cmpl (%rcx), %eax
je 0xdd050
movq -0x28(%rbp), %rax
movq 0x50(%rax), %rax
movq 0x20(%rax), %rax
movl -0x2c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x30(%rbp)
jmp 0xdd070
movq -0x18(%rbp), %rcx
movl $0x3, %edi
leaq 0x1b1f9(%rip), %rsi     # 0xf825b
leaq 0x1b205(%rip), %rdx     # 0xf826e
movb $0x0, %al
callq 0x1b030
jmp 0xdd0fa
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x47, %eax
jne 0xdd0bc
movq -0x28(%rbp), %rax
movq 0x70(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0xdae00
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x28(%rbp), %rcx
movq 0x70(%rcx), %rcx
cmpl (%rcx), %eax
je 0xdd0ba
movq -0x28(%rbp), %rax
movq 0x70(%rax), %rax
movq 0x20(%rax), %rax
movl -0x2c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x30(%rbp)
jmp 0xdd0da
movq -0x18(%rbp), %rcx
movl $0x3, %edi
leaq 0x1b18f(%rip), %rsi     # 0xf825b
leaq 0x1b19b(%rip), %rdx     # 0xf826e
movb $0x0, %al
callq 0x1b030
jmp 0xdd0fa
movq -0x18(%rbp), %rcx
movl $0x3, %edi
leaq 0x1b16f(%rip), %rsi     # 0xf825b
leaq 0x1b17b(%rip), %rdx     # 0xf826e
movb $0x0, %al
callq 0x1b030
movl -0x30(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)