// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/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, %r15
movq 0x80(%rdi), %rax
movq %rax, (%rsp)
movl (%rax), %eax
testl %eax, %eax
movq %rsi, 0x8(%rsp)
movq %rdi, 0x10(%rsp)
je 0x4122e
movq %rax, 0x18(%rsp)
leal -0x1(%rax), %esi
movsbl (%r15), %ebx
testl %ebx, %ebx
je 0x41239
movb 0x1(%r15), %al
testb %al, %al
je 0x4123b
leaq 0x2(%r15), %rcx
movl %ebx, %edx
shll $0x5, %edx
subl %ebx, %edx
movsbl %al, %ebx
addl %edx, %ebx
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x41217
jmp 0x4123b
movq %rdi, %r12
xorl %r14d, %r14d
jmp 0x412c7
xorl %ebx, %ebx
andl %esi, %ebx
movq (%rsp), %rax
movq 0x10(%rax), %r15
movl $0x1, %r12d
movl %ebx, %r14d
movl %esi, 0x20(%rsp)
movl %r14d, %eax
shrl $0x4, %eax
movl (%r15,%rax,4), %r13d
leal (%r14,%r14), %ebp
andl $0x1e, %ebp
movl %r13d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x412ab
testb $0x1, %al
jne 0x41293
movq (%rsp), %rax
movq 0x18(%rax), %rax
movl %r14d, %ecx
movq (%rax,%rcx,8), %rdi
movq 0x8(%rsp), %rsi
callq 0x4750
movl 0x20(%rsp), %esi
testl %eax, %eax
je 0x412ab
addl %r12d, %r14d
andl %esi, %r14d
incl %r12d
cmpl %ebx, %r14d
jne 0x41252
movq 0x18(%rsp), %rax
movl %eax, %r14d
jmp 0x412bd
movl %ebp, %ecx
shrl %cl, %r13d
testb $0x3, %r13b
movq 0x18(%rsp), %rax
cmovnel %eax, %r14d
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %r12
cmpl %eax, %r14d
je 0x4140a
leaq 0x94(%r12), %rax
movq %rax, (%rsp)
leaq 0x96(%r12), %rax
movq %rax, 0x30(%rsp)
movl 0x494(%r12), %ecx
leal 0x1(%rcx), %eax
movl %eax, 0x494(%r12)
xorl %r13d, %r13d
movq (%rsp), %rdi
leaq 0x14481(%rip), %rsi     # 0x5578b
movq %r15, %rdx
xorl %eax, %eax
callq 0x4110
movq 0x80(%r12), %rax
movq %rax, 0x20(%rsp)
movl (%rax), %esi
testl %esi, %esi
je 0x413fd
movq (%rsp), %rax
movsbl (%rax), %ebx
testl %ebx, %ebx
je 0x4135e
movb 0x95(%r12), %al
testb %al, %al
je 0x41360
movq 0x30(%rsp), %rcx
movl %ebx, %edx
shll $0x5, %edx
subl %ebx, %edx
movsbl %al, %ebx
addl %edx, %ebx
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x41347
jmp 0x41360
xorl %ebx, %ebx
movq %rsi, 0x28(%rsp)
leal -0x1(%rsi), %r15d
andl %r15d, %ebx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rsi
movl $0x1, %r12d
movl %ebx, %r13d
movq %rsi, 0x18(%rsp)
movl %r13d, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %r14d
leal (,%r13,2), %ebp
andl $0x1e, %ebp
movl %r14d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x413e1
testb $0x1, %al
jne 0x413c9
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
movl %r13d, %ecx
movq (%rax,%rcx,8), %rdi
movq (%rsp), %rsi
callq 0x4750
movq 0x18(%rsp), %rsi
testl %eax, %eax
je 0x413e1
addl %r12d, %r13d
andl %r15d, %r13d
incl %r12d
cmpl %ebx, %r13d
jne 0x41383
movq 0x28(%rsp), %rsi
movl %esi, %r13d
jmp 0x413f3
movl %ebp, %ecx
shrl %cl, %r14d
testb $0x3, %r14b
movq 0x28(%rsp), %rsi
cmovnel %esi, %r13d
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %r12
cmpl %esi, %r13d
jne 0x412e9
movq (%rsp), %r15
movq %r15, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq