// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/sample.c
// Function: add_pair
static void add_pair(bam_sample_t *sm, khash_t(sm) *sm2id, const char *key, const char *val)
{
	khint_t k_rg, k_sm;
	int ret;
	khash_t(sm) *rg2smid = (khash_t(sm)*)sm->rg2smid;
	k_rg = kh_get(sm, rg2smid, key);
	if (k_rg != kh_end(rg2smid)) return; // duplicated @RG-ID
	k_rg = kh_put(sm, rg2smid, strdup(key), &ret);
	k_sm = kh_get(sm, sm2id, val);
	if (k_sm == kh_end(sm2id)) { // absent
		if (sm->n == sm->m) {
			sm->m = sm->m? sm->m<<1 : 1;
			sm->smpl = realloc(sm->smpl, sizeof(void*) * sm->m);
		}
		sm->smpl[sm->n] = strdup(val);
		k_sm = kh_put(sm, sm2id, sm->smpl[sm->n], &ret);
		kh_val(sm2id, k_sm) = sm->n++;
	}
	kh_val(rg2smid, k_rg) = kh_val(sm2id, k_sm);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, 0x18(%rsp)
movq %rdx, %r13
movq %rsi, 0x10(%rsp)
movq %rdi, 0x30(%rsp)
movq 0x10(%rdi), %rax
movq %rax, 0x20(%rsp)
movl (%rax), %r14d
testl %r14d, %r14d
je 0x16c76
movsbl (%r13), %esi
xorl %edi, %edi
movl $0x0, %ecx
testl %esi, %esi
je 0x16c7f
movb 0x1(%r13), %al
testb %al, %al
je 0x16c7d
leaq 0x2(%r13), %rdx
movl %esi, %ecx
movl %ecx, %esi
shll $0x5, %esi
subl %ecx, %esi
movsbl %al, %ecx
addl %esi, %ecx
movb (%rdx), %al
incq %rdx
testb %al, %al
jne 0x16c5f
jmp 0x16c7f
xorl %ebx, %ebx
jmp 0x16d10
movl %esi, %ecx
movl %ecx, %eax
xorl %edx, %edx
divl %r14d
movl %edx, %r12d
leal -0x1(%r14), %esi
movl %ecx, %eax
xorl %edx, %edx
divl %esi
incl %edx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rsi
movl %r12d, %ebx
movl %edx, 0x4(%rsp)
movq %rsi, 0x8(%rsp)
movl %ebx, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %ebp
leal (%rbx,%rbx), %r15d
andl $0x1e, %r15d
movl %ebp, %eax
movl %r15d, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x16d03
testb $0x1, %al
jne 0x16cef
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
movl %ebx, %ecx
movq (%rax,%rcx,8), %rdi
movq %r13, %rsi
callq 0x35a0
movq 0x8(%rsp), %rsi
movl 0x4(%rsp), %edx
xorl %edi, %edi
testl %eax, %eax
je 0x16d03
addl %edx, %ebx
cmpl %r14d, %ebx
movl %r14d, %eax
cmovbl %edi, %eax
subl %eax, %ebx
cmpl %r12d, %ebx
jne 0x16caa
jmp 0x16d19
movl %r15d, %ecx
shrl %cl, %ebp
testb $0x3, %bpl
cmovnel %r14d, %ebx
cmpl %r14d, %ebx
jne 0x16ec7
movq %r13, %rdi
callq 0x3570
leaq 0x2c(%rsp), %rdx
movq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x17277
movl %eax, %r8d
movq 0x10(%rsp), %rax
movl (%rax), %r14d
testl %r14d, %r14d
movl %r8d, 0x8(%rsp)
je 0x16d80
movq 0x18(%rsp), %rsi
movsbl (%rsi), %edi
xorl %r9d, %r9d
movl $0x0, %ecx
testl %edi, %edi
je 0x16d8e
movb 0x1(%rsi), %al
testb %al, %al
je 0x16d8c
leaq 0x2(%rsi), %rdx
movl %edi, %ecx
movl %ecx, %edi
shll $0x5, %edi
subl %ecx, %edi
movsbl %al, %ecx
addl %edi, %ecx
movb (%rdx), %al
incq %rdx
testb %al, %al
jne 0x16d69
jmp 0x16d8e
xorl %ebp, %ebp
movq 0x18(%rsp), %rsi
jmp 0x16e1d
movl %edi, %ecx
movl %ecx, %eax
xorl %edx, %edx
divl %r14d
movl %edx, %ebx
leal -0x1(%r14), %edi
movl %ecx, %eax
xorl %edx, %edx
divl %edi
incl %edx
movq 0x10(%rsp), %rax
movq 0x10(%rax), %r12
movl %ebx, %ebp
movl %edx, 0x4(%rsp)
movl %ebp, %eax
shrl $0x4, %eax
movl (%r12,%rax,4), %r13d
leal (,%rbp,2), %r15d
andl $0x1e, %r15d
movl %r13d, %eax
movl %r15d, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x16e0f
testb $0x1, %al
jne 0x16dfb
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movl %ebp, %ecx
movq (%rax,%rcx,8), %rdi
callq 0x35a0
movl 0x4(%rsp), %edx
xorl %r9d, %r9d
movq 0x18(%rsp), %rsi
testl %eax, %eax
je 0x16e0f
addl %edx, %ebp
cmpl %r14d, %ebp
movl %r14d, %eax
cmovbl %r9d, %eax
subl %eax, %ebp
cmpl %ebx, %ebp
jne 0x16db2
jmp 0x16e22
movl %r15d, %ecx
shrl %cl, %r13d
testb $0x3, %r13b
cmovnel %r14d, %ebp
cmpl %r14d, %ebp
jne 0x16e62
movq 0x30(%rsp), %r14
movl (%r14), %ebx
cmpl 0x4(%r14), %ebx
jne 0x16e76
leal (%rbx,%rbx), %eax
testl %ebx, %ebx
movl $0x1, %ecx
cmovnel %eax, %ecx
movl %ecx, 0x4(%r14)
movq 0x8(%r14), %rdi
movslq %ecx, %rsi
shlq $0x3, %rsi
callq 0x3720
movq 0x18(%rsp), %rsi
movq %rax, %r15
movq %rax, 0x8(%r14)
movl (%r14), %ebx
jmp 0x16e7a
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rax
movl %ebp, %ecx
movl (%rax,%rcx,4), %ecx
movl 0x8(%rsp), %ebp
jmp 0x16eb9
movq 0x8(%r14), %r15
movl 0x8(%rsp), %ebp
movq %rsi, %rdi
callq 0x3570
movslq %ebx, %rcx
movq %rax, (%r15,%rcx,8)
movq 0x8(%r14), %rax
movq (%rax,%rcx,8), %rsi
leaq 0x2c(%rsp), %rdx
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x17277
movl (%r14), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%r14)
movq 0x20(%rbx), %rdx
movl %eax, %eax
movl %ecx, (%rdx,%rax,4)
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movl %ebp, %edx
movl %ecx, (%rax,%rdx,4)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq