// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/header.c
// Function: sam_hrecs_remove_line
static int sam_hrecs_remove_line(sam_hrecs_t *hrecs, const char *type_name, sam_hrec_type_t *type_found, int remove_hash) {
    if (!hrecs || !type_name || !type_found)
        return -1;

    khint32_t itype = TYPEKEY(type_name);
    khint_t k = kh_get(sam_hrecs_t, hrecs->h, itype);
    if (k == kh_end(hrecs->h))
        return -1;

    // Remove from global list (remembering it could be the only line)
    if (hrecs->first_line == type_found) {
        hrecs->first_line = (type_found->global_next != type_found
                             ? type_found->global_next : NULL);
    }
    type_found->global_next->global_prev = type_found->global_prev;
    type_found->global_prev->global_next = type_found->global_next;

    /* single element in the list */
    if (type_found->prev == type_found || type_found->next == type_found) {
        kh_del(sam_hrecs_t, hrecs->h, k);
    } else {
        type_found->prev->next = type_found->next;
        type_found->next->prev = type_found->prev;
        if (kh_val(hrecs->h, k) == type_found) { //first element
            kh_val(hrecs->h, k) = type_found->next;
        }
    }

    if (remove_hash && (!strncmp(type_name, "SQ", 2) || !strncmp(type_name, "RG", 2)))
        sam_hrecs_remove_hash_entry(hrecs, itype, type_found);

    sam_hrecs_free_tags(hrecs, type_found->tag);
    pool_free(hrecs->type_pool, type_found);

    hrecs->dirty = 1;

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, %r8d
movq %rdx, %r14
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
testq %rdx, %rdx
sete %dl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
orb %cl, %dl
jne 0x88eee
movq %rsi, %r15
movq %rdi, %rbx
movzwl (%rsi), %ecx
rolw $0x8, %cx
movzwl %cx, %r13d
movq (%rdi), %rsi
movl (%rsi), %edi
testl %edi, %edi
je 0x88993
movl %r8d, 0x8(%rsp)
movq %r14, 0x10(%rsp)
movq %rbx, %r14
leal -0x1(%rdi), %r9d
movl %r9d, %r10d
andl %r13d, %r10d
movq 0x10(%rsi), %r11
movl $0x1, %ebx
movl %r10d, %edx
movl %edx, %ecx
shrl $0x4, %ecx
movl (%r11,%rcx,4), %ebp
leal (%rdx,%rdx), %ecx
andl $0x1e, %ecx
movl %ebp, %r12d
shrl %cl, %r12d
testb $0x2, %r12b
jne 0x8897b
testb $0x1, %r12b
jne 0x8896b
movq 0x18(%rsi), %r12
movl %r13d, %r8d
movl %edx, %r13d
cmpl %r8d, (%r12,%r13,4)
movl %r8d, %r13d
je 0x8897b
addl %ebx, %edx
andl %r9d, %edx
incl %ebx
cmpl %r10d, %edx
jne 0x88937
movl %edi, %edx
jmp 0x88984
shrl %cl, %ebp
testb $0x3, %bpl
cmovnel %edi, %edx
movq %r14, %rbx
movq 0x10(%rsp), %r14
movl 0x8(%rsp), %r8d
jmp 0x88995
xorl %edx, %edx
cmpl %edi, %edx
je 0x88eee
cmpq %r14, 0x8(%rbx)
jne 0x889b4
movq 0x10(%r14), %rax
xorl %ecx, %ecx
cmpq %r14, %rax
cmovneq %rax, %rcx
movq %rcx, 0x8(%rbx)
movq 0x10(%r14), %rax
movq 0x18(%r14), %rcx
movq %rcx, 0x18(%rax)
movq 0x18(%r14), %rcx
movq %rax, 0x10(%rcx)
movq 0x8(%r14), %rax
cmpq %r14, %rax
je 0x889f5
movq (%r14), %rcx
cmpq %r14, %rcx
je 0x889f5
movq %rcx, (%rax)
movq (%r14), %rcx
movq %rax, 0x8(%rcx)
movq 0x20(%rsi), %rax
movl %edx, %edx
cmpq %r14, (%rax,%rdx,8)
jne 0x88a20
movq %rcx, (%rax,%rdx,8)
jmp 0x88a20
movq 0x10(%rsi), %rax
movl %edx, %edi
shrl $0x4, %edi
movl (%rax,%rdi,4), %r9d
addl %edx, %edx
andl $0x1e, %edx
movl %r9d, %r10d
movl %edx, %ecx
shrl %cl, %r10d
testb $0x3, %r10b
jne 0x88a20
btsl %edx, %r9d
movl %r9d, (%rax,%rdi,4)
decl 0x4(%rsi)
testl %r8d, %r8d
je 0x88eca
leaq 0x1278b(%rip), %rsi     # 0x9b1bb
movl $0x2, %edx
movq %r15, %rdi
callq 0x4210
testl %eax, %eax
je 0x88a5d
leaq 0x1269d(%rip), %rsi     # 0x9b0e5
movl $0x2, %edx
movq %r15, %rdi
callq 0x4210
testl %eax, %eax
jne 0x88eca
cmpl $0x5247, %r13d          # imm = 0x5247
je 0x88ce5
cmpl $0x5351, %r13d          # imm = 0x5351
jne 0x88eca
movl %r13d, 0x28(%rsp)
movq %r14, 0x10(%rsp)
movq 0x20(%r14), %rax
testq %rax, %rax
je 0x88ae0
xorl %r15d, %r15d
xorl %r14d, %r14d
movq 0x8(%rax), %rcx
movzbl (%rcx), %edx
cmpl $0x41, %edx
je 0x88abf
cmpl $0x53, %edx
jne 0x88ad6
cmpb $0x4e, 0x1(%rcx)
jne 0x88aba
cmpl $0x2, 0x10(%rax)
jle 0x88f1c
addq $0x3, %rcx
movq %rcx, %r14
jmp 0x88ad6
cmpb $0x41, %dl
jne 0x88ad6
cmpb $0x4e, 0x1(%rcx)
jne 0x88ad6
cmpl $0x2, 0x10(%rax)
jle 0x88efd
addq $0x3, %rcx
movq %rcx, %r15
movq (%rax), %rax
testq %rax, %rax
jne 0x88a90
jmp 0x88ae6
xorl %r14d, %r14d
xorl %r15d, %r15d
testq %r14, %r14
je 0x88cd2
movq 0x38(%rbx), %rax
movq %rax, 0x8(%rsp)
movl (%rax), %eax
testl %eax, %eax
je 0x88b39
movq %r15, 0x40(%rsp)
movq %rax, 0x38(%rsp)
leal -0x1(%rax), %edx
movb (%r14), %cl
testb %cl, %cl
movq %rbx, 0x20(%rsp)
je 0x88b41
leaq 0x1(%r14), %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 0x88b21
jmp 0x88b47
xorl %r13d, %r13d
jmp 0x88be0
movl $0x811c9dc5, %r15d      # imm = 0x811C9DC5
andl %edx, %r15d
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rsi
movl $0x1, %ebx
movl %r15d, %r13d
movl %edx, 0x1c(%rsp)
movq %rsi, 0x30(%rsp)
movl %r13d, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %r12d
leal (,%r13,2), %ebp
andl $0x1e, %ebp
movl %r12d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x88bc4
testb $0x1, %al
jne 0x88bad
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %r13d, %ecx
movq (%rax,%rcx,8), %rdi
movq %r14, %rsi
callq 0x46c0
movq 0x30(%rsp), %rsi
movl 0x1c(%rsp), %edx
testl %eax, %eax
je 0x88bc4
addl %ebx, %r13d
andl %edx, %r13d
incl %ebx
cmpl %r15d, %r13d
jne 0x88b64
movq 0x38(%rsp), %rax
movl %eax, %r13d
jmp 0x88bd6
movl %ebp, %ecx
shrl %cl, %r12d
testb $0x3, %r12b
movq 0x38(%rsp), %rax
cmovnel %eax, %r13d
movq 0x20(%rsp), %rbx
movq 0x40(%rsp), %r15
cmpl %eax, %r13d
je 0x88cd2
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
movl %r13d, %ecx
movl (%rax,%rcx,4), %ebp
movslq %ebp, %rax
leaq 0x1(%rax), %rdx
movl 0x28(%rbx), %ecx
cmpl %ecx, %edx
jge 0x88c2e
movq 0x30(%rbx), %rsi
leaq (%rax,%rax,2), %rdi
leaq (%rsi,%rdi,8), %rdi
leaq (%rdx,%rdx,2), %rdx
leaq (%rsi,%rdx,8), %rsi
notl %eax
addl %eax, %ecx
movslq %ecx, %rax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rdx
callq 0x4830
testq %r15, %r15
je 0x88c40
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x8c78f
movq 0x38(%rbx), %rax
cmpl %r13d, (%rax)
je 0x88c76
movq 0x10(%rax), %rdx
movl %r13d, %esi
shrl $0x4, %esi
movl (%rdx,%rsi,4), %edi
addl %r13d, %r13d
andl $0x1e, %r13d
movl %edi, %r8d
movl %r13d, %ecx
shrl %cl, %r8d
testb $0x3, %r8b
jne 0x88c76
btsl %r13d, %edi
movl %edi, (%rdx,%rsi,4)
decl 0x4(%rax)
decl 0x28(%rbx)
movl 0x94(%rbx), %ecx
testl %ecx, %ecx
js 0x88c87
cmpl %ebp, %ecx
jle 0x88c8d
movl %ebp, 0x94(%rbx)
cmpl $0x0, (%rax)
je 0x88cd2
movq 0x10(%rax), %rdx
xorl %esi, %esi
xorl %edi, %edi
movl %edi, %ecx
shrl $0x4, %ecx
movl (%rdx,%rcx,4), %r8d
movl %esi, %ecx
andb $0x1e, %cl
shrl %cl, %r8d
testb $0x3, %r8b
jne 0x88cc5
movq 0x20(%rax), %rcx
movl (%rcx,%rdi,4), %r8d
cmpl %ebp, %r8d
jle 0x88cc5
decl %r8d
movl %r8d, (%rcx,%rdi,4)
incq %rdi
movl (%rax), %ecx
addl $0x2, %esi
cmpq %rcx, %rdi
jb 0x88c9a
cmpl $0x5247, 0x28(%rsp)     # imm = 0x5247
movq 0x10(%rsp), %r14
jne 0x88eca
movq 0x20(%r14), %rcx
testq %rcx, %rcx
je 0x88eca
movq 0x8(%rcx), %rax
cmpb $0x49, (%rax)
jne 0x88d01
cmpb $0x44, 0x1(%rax)
je 0x88d06
movq (%rcx), %rcx
jmp 0x88ce9
cmpl $0x2, 0x10(%rcx)
jle 0x88f3b
movq 0x50(%rbx), %rcx
movq %rcx, 0x10(%rsp)
movl (%rcx), %edx
testl %edx, %edx
je 0x88d5d
leaq 0x3(%rax), %rcx
leal -0x1(%rdx), %esi
movq %rcx, 0x8(%rsp)
movb (%rcx), %cl
testb %cl, %cl
movq %rbx, 0x20(%rsp)
movq %rdx, 0x28(%rsp)
je 0x88d65
addq $0x4, %rax
movl $0x811c9dc5, %r13d      # imm = 0x811C9DC5
movzbl %cl, %ecx
xorl %r13d, %ecx
imull $0x1000193, %ecx, %r13d # imm = 0x1000193
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x88d45
jmp 0x88d6b
xorl %r15d, %r15d
jmp 0x88dfd
movl $0x811c9dc5, %r13d      # imm = 0x811C9DC5
andl %esi, %r13d
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdx
movl $0x1, %ebx
movl %r13d, %r15d
movl %esi, 0x1c(%rsp)
movq %rdx, 0x30(%rsp)
movl %r15d, %eax
shrl $0x4, %eax
movl (%rdx,%rax,4), %r12d
leal (%r15,%r15), %ebp
andl $0x1e, %ebp
movl %r12d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x88de6
testb $0x1, %al
jne 0x88dcf
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rdi
movq 0x8(%rsp), %rsi
callq 0x46c0
movq 0x30(%rsp), %rdx
movl 0x1c(%rsp), %esi
testl %eax, %eax
je 0x88de6
addl %ebx, %r15d
andl %esi, %r15d
incl %ebx
cmpl %r13d, %r15d
jne 0x88d88
movq 0x28(%rsp), %rdx
movl %edx, %r15d
jmp 0x88df8
movl %ebp, %ecx
shrl %cl, %r12d
testb $0x3, %r12b
movq 0x28(%rsp), %rdx
cmovnel %edx, %r15d
movq 0x20(%rsp), %rbx
cmpl %edx, %r15d
je 0x88eca
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rax
movl %r15d, %ecx
movslq (%rax,%rcx,4), %r12
leaq 0x1(%r12), %rcx
movl 0x40(%rbx), %eax
cmpl %eax, %ecx
jge 0x88e4c
movq 0x48(%rbx), %rdx
leaq (%r12,%r12,2), %rsi
leaq (%rdx,%rsi,8), %rdi
leaq (%rcx,%rcx,2), %rcx
leaq (%rdx,%rcx,8), %rsi
movl %r12d, %ecx
notl %ecx
addl %ecx, %eax
cltq
shlq $0x3, %rax
leaq (%rax,%rax,2), %rdx
callq 0x4830
movq 0x50(%rbx), %rax
cmpl %r15d, (%rax)
je 0x88e82
movq 0x10(%rax), %rdx
movl %r15d, %esi
shrl $0x4, %esi
movl (%rdx,%rsi,4), %edi
addl %r15d, %r15d
andl $0x1e, %r15d
movl %edi, %r8d
movl %r15d, %ecx
shrl %cl, %r8d
testb $0x3, %r8b
jne 0x88e82
btsl %r15d, %edi
movl %edi, (%rdx,%rsi,4)
decl 0x4(%rax)
decl 0x40(%rbx)
cmpl $0x0, (%rax)
je 0x88eca
movq 0x10(%rax), %rdx
xorl %esi, %esi
xorl %edi, %edi
movl %edi, %ecx
shrl $0x4, %ecx
movl (%rdx,%rcx,4), %r8d
movl %esi, %ecx
andb $0x1e, %cl
shrl %cl, %r8d
testb $0x3, %r8b
jne 0x88ebd
movq 0x20(%rax), %rcx
movl (%rcx,%rdi,4), %r8d
cmpl %r12d, %r8d
jle 0x88ebd
decl %r8d
movl %r8d, (%rcx,%rdi,4)
incq %rdi
movl (%rax), %ecx
addl $0x2, %esi
cmpq %rcx, %rdi
jb 0x88e92
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x8d29c
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0x5a8fd
movl $0x1, 0x90(%rbx)
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1bff2(%rip), %rdi     # 0xa4ef6
leaq 0x1b7e1(%rip), %rsi     # 0xa46ec
leaq 0x1bdc8(%rip), %rcx     # 0xa4cda
movl $0x1ad, %edx            # imm = 0x1AD
callq 0x42f0
leaq 0x1bfd3(%rip), %rdi     # 0xa4ef6
leaq 0x1b7c2(%rip), %rsi     # 0xa46ec
leaq 0x1bda9(%rip), %rcx     # 0xa4cda
movl $0x1aa, %edx            # imm = 0x1AA
callq 0x42f0
leaq 0x1bfb4(%rip), %rdi     # 0xa4ef6
leaq 0x1b7a3(%rip), %rsi     # 0xa46ec
leaq 0x1bd8a(%rip), %rcx     # 0xa4cda
movl $0x1d0, %edx            # imm = 0x1D0
callq 0x42f0