// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/sample.c
// Function: bam_smpl_rg2smid
int bam_smpl_rg2smid(const bam_sample_t *sm, const char *fn, const char *rg, kstring_t *str)
{
	khint_t k;
	khash_t(sm) *rg2smid = (khash_t(sm)*)sm->rg2smid;
	if (rg) {
		str->l = 0;
		kputs(fn, str); kputc('/', str); kputs(rg, str);
		k = kh_get(sm, rg2smid, str->s);
	} else k = kh_get(sm, rg2smid, fn);
	return k == kh_end(rg2smid)? -1 : kh_val(rg2smid, k);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq 0x10(%rdi), %r13
testq %rdx, %rdx
je 0x16de2
movq %rcx, %rbx
movq %rdx, %r15
movq $0x0, (%rcx)
movq %r14, %rdi
callq 0x3360
movslq %eax, %r12
leaq 0x1(%r12), %rax
cmpq 0x8(%rbx), %rax
jb 0x16c8b
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x3720
movq %rax, 0x10(%rbx)
movq 0x10(%rbx), %rdi
addq (%rbx), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x37d0
addq (%rbx), %r12
movq %r12, (%rbx)
movq 0x10(%rbx), %rax
movb $0x0, (%rax,%r12)
movq (%rbx), %rax
incq %rax
cmpq 0x8(%rbx), %rax
jb 0x16cfd
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x3720
movq %rax, 0x10(%rbx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rbx)
movb $0x2f, (%rcx,%rax)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
movq %r15, %rdi
callq 0x3360
movq (%rbx), %rcx
movslq %eax, %r14
leaq (%rcx,%r14), %rax
incq %rax
cmpq 0x8(%rbx), %rax
jb 0x16d7a
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x3720
movq %rax, 0x10(%rbx)
movq 0x10(%rbx), %rdi
addq (%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x37d0
addq (%rbx), %r14
movq %r14, (%rbx)
movq 0x10(%rbx), %rax
movb $0x0, (%rax,%r14)
movl (%r13), %eax
movq %rax, (%rsp)
testl %eax, %eax
je 0x16e2d
movq 0x10(%rbx), %rbx
movsbl (%rbx), %edi
xorl %r8d, %r8d
movl $0x0, %ecx
testl %edi, %edi
je 0x16e3c
movb 0x1(%rbx), %al
testb %al, %al
je 0x16e3a
leaq 0x2(%rbx), %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 0x16dcb
jmp 0x16e3c
movl (%r13), %eax
movq %rax, (%rsp)
testl %eax, %eax
je 0x16e2d
movsbl (%r14), %esi
xorl %edi, %edi
movl $0x0, %ecx
testl %esi, %esi
je 0x16edb
movb 0x1(%r14), %al
testb %al, %al
je 0x16ed9
leaq 0x2(%r14), %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 0x16e13
jmp 0x16edb
movq $0x0, (%rsp)
jmp 0x16f7c
movl %edi, %ecx
movl %ecx, %eax
xorl %edx, %edx
movq (%rsp), %rdi
divl %edi
movl %edx, %r12d
decl %edi
movl %ecx, %eax
xorl %edx, %edx
divl %edi
movl %edx, %r14d
incl %r14d
movq %r13, 0x8(%rsp)
movq 0x10(%r13), %rdi
movl %r12d, %r13d
movq %rdi, 0x10(%rsp)
movl %r13d, %eax
shrl $0x4, %eax
movl (%rdi,%rax,4), %ebp
leal (,%r13,2), %r15d
andl $0x1e, %r15d
movl %ebp, %eax
movl %r15d, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x16ecb
testb $0x1, %al
jne 0x16eb0
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %r13d, %ecx
movq (%rax,%rcx,8), %rdi
movq %rbx, %rsi
callq 0x35a0
movq 0x10(%rsp), %rdi
xorl %r8d, %r8d
testl %eax, %eax
je 0x16ecb
addl %r14d, %r13d
movq (%rsp), %rax
cmpl %eax, %r13d
cmovbl %r8d, %eax
subl %eax, %r13d
cmpl %r12d, %r13d
jne 0x16e68
jmp 0x16f77
movl %r15d, %ecx
shrl %cl, %ebp
testb $0x3, %bpl
jmp 0x16f6b
movl %esi, %ecx
movq %r14, 0x10(%rsp)
movl %ecx, %eax
xorl %edx, %edx
movq (%rsp), %rsi
divl %esi
movl %edx, %r14d
decl %esi
movl %ecx, %eax
xorl %edx, %edx
divl %esi
movl %edx, %r12d
incl %r12d
movq %r13, 0x8(%rsp)
movq 0x10(%r13), %rbp
movl %r14d, %r13d
movl %r13d, %eax
shrl $0x4, %eax
movl (%rbp,%rax,4), %ebx
leal (,%r13,2), %r15d
andl $0x1e, %r15d
movl %ebx, %eax
movl %r15d, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x16f63
testb $0x1, %al
jne 0x16f4c
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %r13d, %ecx
movq (%rax,%rcx,8), %rdi
movq 0x10(%rsp), %rsi
callq 0x35a0
xorl %edi, %edi
testl %eax, %eax
je 0x16f63
addl %r12d, %r13d
movq (%rsp), %rax
cmpl %eax, %r13d
cmovbl %edi, %eax
subl %eax, %r13d
cmpl %r14d, %r13d
jne 0x16f07
jmp 0x16f77
movl %r15d, %ecx
shrl %cl, %ebx
testb $0x3, %bl
movq (%rsp), %rax
cmovel %r13d, %eax
movq %rax, (%rsp)
movq 0x8(%rsp), %r13
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq (%rsp), %rcx
cmpl (%r13), %ecx
je 0x16f95
movq 0x20(%r13), %rax
movl (%rsp), %ecx
movl (%rax,%rcx,4), %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq