// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/htslib/cram/sam_header.c
// Function: sam_hdr_PG_ID
const char *sam_hdr_PG_ID(SAM_hdr *sh, const char *name) {
    khint_t k = kh_get(m_s2i, sh->pg_hash, name);
    if (k == kh_end(sh->pg_hash))
	return name;

    do {
	sprintf(sh->ID_buf, "%.1000s.%d", name, sh->ID_cnt++);
	k = kh_get(m_s2i, sh->pg_hash, sh->ID_buf);
    } while (k != kh_end(sh->pg_hash));

    return sh->ID_buf;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r8
movq 0x80(%rdi), %rax
movq %rax, (%rsp)
movl (%rax), %eax
testl %eax, %eax
movq %rsi, 0x20(%rsp)
movq %rdi, 0x18(%rsp)
je 0x64521
leal -0x1(%rax), %esi
movsbl (%r8), %r14d
testl %r14d, %r14d
movq %rax, 0x10(%rsp)
je 0x6452b
movb 0x1(%r8), %al
testb %al, %al
je 0x6452e
leaq 0x2(%r8), %rcx
movl %r14d, %edx
shll $0x5, %edx
subl %r14d, %edx
movsbl %al, %r14d
addl %edx, %r14d
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x64506
jmp 0x6452e
movq %rdi, %r15
xorl %ebx, %ebx
jmp 0x645af
xorl %r14d, %r14d
andl %esi, %r14d
movq (%rsp), %rax
movq 0x10(%rax), %r15
movl $0x1, %r12d
movl %r14d, %ebx
movl %esi, 0x8(%rsp)
movl %ebx, %eax
shrl $0x4, %eax
movl (%r15,%rax,4), %r13d
leal (%rbx,%rbx), %ebp
andl $0x1e, %ebp
movl %r13d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x64599
testb $0x1, %al
jne 0x64587
movq (%rsp), %rax
movq 0x18(%rax), %rax
movl %ebx, %ecx
movq (%rax,%rcx,8), %rdi
movq %r8, %rsi
callq 0x6a50
movl 0x8(%rsp), %esi
movq 0x20(%rsp), %r8
testl %eax, %eax
je 0x64599
addl %r12d, %ebx
andl %esi, %ebx
incl %r12d
cmpl %r14d, %ebx
jne 0x64546
jmp 0x646ea
movl %ebp, %ecx
shrl %cl, %r13d
testb $0x3, %r13b
movq 0x10(%rsp), %rax
cmovnel %eax, %ebx
movq 0x18(%rsp), %r15
cmpl %eax, %ebx
je 0x646ea
leaq 0x94(%r15), %rax
movq %rax, (%rsp)
leaq 0x96(%r15), %rax
movq %rax, 0x28(%rsp)
leaq 0x35574(%rip), %r14     # 0x99b49
movl 0x494(%r15), %ecx
leal 0x1(%rcx), %eax
movl %eax, 0x494(%r15)
xorl %ebx, %ebx
movq (%rsp), %rdi
movq %r14, %rsi
movq %r8, %rdx
xorl %eax, %eax
callq 0x6170
movq 0x80(%r15), %rax
movq %rax, 0x8(%rsp)
movl (%rax), %esi
testl %esi, %esi
je 0x646d9
movq (%rsp), %rax
movsbl (%rax), %r14d
testl %r14d, %r14d
je 0x64647
movb 0x95(%r15), %al
testb %al, %al
je 0x6464a
movq 0x28(%rsp), %rcx
movl %r14d, %edx
shll $0x5, %edx
subl %r14d, %edx
movsbl %al, %r14d
addl %edx, %r14d
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x6462c
jmp 0x6464a
xorl %r14d, %r14d
movq %rsi, 0x30(%rsp)
leal -0x1(%rsi), %r15d
andl %r15d, %r14d
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rsi
movl $0x1, %r12d
movl %r14d, %ebx
movq %rsi, 0x10(%rsp)
movl %ebx, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %r13d
leal (%rbx,%rbx), %ebp
andl $0x1e, %ebp
movl %r13d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x646bc
testb $0x1, %al
jne 0x646ac
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %ebx, %ecx
movq (%rax,%rcx,8), %rdi
movq (%rsp), %rsi
callq 0x6a50
movq 0x10(%rsp), %rsi
testl %eax, %eax
je 0x646bc
addl %r12d, %ebx
andl %r15d, %ebx
incl %r12d
cmpl %r14d, %ebx
jne 0x6466d
jmp 0x646e6
movl %ebp, %ecx
shrl %cl, %r13d
testb $0x3, %r13b
movq 0x30(%rsp), %rsi
cmovnel %esi, %ebx
movq 0x18(%rsp), %r15
leaq 0x35470(%rip), %r14     # 0x99b49
cmpl %esi, %ebx
movq 0x20(%rsp), %r8
jne 0x645d5
movq (%rsp), %r8
movq %r8, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq