// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: sam_hdr_line_name
const char *sam_hdr_line_name(sam_hdr_t *bh,
                              const char *type,
                              int pos) {
    sam_hrecs_t *hrecs;
    if (!bh || !type || pos < 0)
        return NULL;

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

    switch (type[0]) {
    case 'S':
        if (type[1] == 'Q') {
            if (pos < hrecs->nref)
                return hrecs->ref[pos].name;
        } else {
            hts_log_warning("Type '%s' not supported. Only @SQ, @RG and @PG lines are indexed", type);
        }
        break;
    case 'R':
        if (type[1] == 'G') {
            if (pos < hrecs->nrg)
                return hrecs->rg[pos].name;
        } else {
            hts_log_warning("Type '%s' not supported. Only @SQ, @RG and @PG lines are indexed", type);
        }
        break;
    case 'P':
        if (type[1] == 'G') {
            if (pos < hrecs->npg)
                return hrecs->pg[pos].name;
        } 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 NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xdd137
cmpq $0x0, -0x18(%rbp)
je 0xdd137
cmpl $0x0, -0x1c(%rbp)
jge 0xdd144
movq $0x0, -0x8(%rbp)
jmp 0xdd2de
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0xdd17d
movq -0x10(%rbp), %rdi
callq 0xd7490
cmpl $0x0, %eax
je 0xdd171
movq $0x0, -0x8(%rbp)
jmp 0xdd2de
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x2c(%rbp)
subl $0x50, %eax
je 0xdd261
jmp 0xdd192
movl -0x2c(%rbp), %eax
subl $0x52, %eax
je 0xdd207
jmp 0xdd19c
movl -0x2c(%rbp), %eax
subl $0x53, %eax
jne 0xdd2b8
jmp 0xdd1aa
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x51, %eax
jne 0xdd1e4
movl -0x1c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jge 0xdd1e2
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0xdd2de
jmp 0xdd202
movq -0x18(%rbp), %rcx
movl $0x3, %edi
leaq 0x1b0bb(%rip), %rsi     # 0xf82af
leaq 0x1b073(%rip), %rdx     # 0xf826e
movb $0x0, %al
callq 0x1b030
jmp 0xdd2d6
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x47, %eax
jne 0xdd241
movl -0x1c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x40(%rcx), %eax
jge 0xdd23f
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0xdd2de
jmp 0xdd25f
movq -0x18(%rbp), %rcx
movl $0x3, %edi
leaq 0x1b05e(%rip), %rsi     # 0xf82af
leaq 0x1b016(%rip), %rdx     # 0xf826e
movb $0x0, %al
callq 0x1b030
jmp 0xdd2d6
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x47, %eax
jne 0xdd298
movl -0x1c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x58(%rcx), %eax
jge 0xdd296
movq -0x28(%rbp), %rax
movq 0x68(%rax), %rax
movslq -0x1c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0xdd2de
jmp 0xdd2b6
movq -0x18(%rbp), %rcx
movl $0x3, %edi
leaq 0x1b007(%rip), %rsi     # 0xf82af
leaq 0x1afbf(%rip), %rdx     # 0xf826e
movb $0x0, %al
callq 0x1b030
jmp 0xdd2d6
movq -0x18(%rbp), %rcx
movl $0x3, %edi
leaq 0x1afe7(%rip), %rsi     # 0xf82af
leaq 0x1af9f(%rip), %rdx     # 0xf826e
movb $0x0, %al
callq 0x1b030
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)