// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bam_sort.c
// Function: strnum_cmp
static int strnum_cmp(const char *_a, const char *_b)
{
	const unsigned char *a = (const unsigned char*)_a, *b = (const unsigned char*)_b;
	const unsigned char *pa = a, *pb = b;
	while (*pa && *pb) {
		if (isdigit(*pa) && isdigit(*pb)) {
			while (*pa == '0') ++pa;
			while (*pb == '0') ++pb;
			while (isdigit(*pa) && isdigit(*pb) && *pa == *pb) ++pa, ++pb;
			if (isdigit(*pa) && isdigit(*pb)) {
				int i = 0;
				while (isdigit(pa[i]) && isdigit(pb[i])) ++i;
				return isdigit(pa[i])? 1 : isdigit(pb[i])? -1 : (int)*pa - (int)*pb;
			} else if (isdigit(*pa)) return 1;
			else if (isdigit(*pb)) return -1;
			else if (pa - a != pb - b) return pa - a < pb - b? 1 : -1;
		} else {
			if (*pa != *pb) return (int)*pa - (int)*pb;
			++pa; ++pb;
		}
	}
	return *pa? 1 : *pb? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movb (%rdi), %bpl
testb %bpl, %bpl
sete %dil
je 0x35fc5
movb (%rbx), %r15b
testb %r15b, %r15b
je 0x35fb0
callq 0x33c0
movq (%rax), %rcx
movq %r14, %rsi
movq %rbx, %rdx
movzbl %bpl, %eax
testb $0x8, 0x1(%rcx,%rax,2)
je 0x35eac
movzbl %r15b, %edi
testb $0x8, 0x1(%rcx,%rdi,2)
jne 0x35ec0
cmpb %r15b, %bpl
jne 0x35fd6
incq %rsi
incq %rdx
jmp 0x35f96
leaq -0x1(%rsi), %rax
incq %rsi
movq %rsi, %rdi
movq %rax, %rsi
movq %rdi, %rax
cmpb $0x30, 0x1(%rsi)
leaq 0x1(%rsi), %rsi
leaq 0x1(%rdi), %rdi
je 0x35ecd
leaq -0x1(%rdx), %r8
incq %rdx
movq %rdx, %rdi
movq %r8, %rdx
movq %rdi, %r8
cmpb $0x30, 0x1(%rdx)
leaq 0x1(%rdx), %rdx
leaq 0x1(%rdi), %rdi
je 0x35eeb
movzbl (%rsi), %edi
testb $0x8, 0x1(%rcx,%rdi,2)
sete %r9b
je 0x35f7b
movzbl (%rdx), %r10d
cmpb %r10b, %dil
jne 0x35f56
movzwl (%rcx,%r10,2), %r10d
andl $0x800, %r10d           # imm = 0x800
je 0x35f56
movzbl (%rax), %edi
testb $0x8, 0x1(%rcx,%rdi,2)
sete %r9b
je 0x35f75
movzbl (%r8), %edx
incq %rax
incq %r8
cmpb %dl, %dil
jne 0x35f4a
movzwl (%rcx,%rdx,2), %edx
andl $0x800, %edx            # imm = 0x800
jne 0x35f21
decq %rax
decq %r8
movq %r8, %rdx
movq %rax, %rsi
testb %r9b, %r9b
jne 0x35f7b
movzbl (%rdx), %r8d
testb $0x8, 0x1(%rcx,%r8,2)
jne 0x35ff4
testb %r9b, %r9b
jne 0x35f7b
jmp 0x36007
movq %rax, %rsi
movq %r8, %rdx
movzbl (%rdx), %eax
testb $0x8, 0x1(%rcx,%rax,2)
jne 0x35fde
movq %rsi, %rax
subq %r14, %rax
movq %rdx, %rdi
subq %rbx, %rdi
cmpq %rdi, %rax
jne 0x35fe5
movb (%rsi), %bpl
testb %bpl, %bpl
sete %dil
je 0x35fc2
movb (%rdx), %r15b
testb %r15b, %r15b
jne 0x35e96
jmp 0x35fb3
movq %rbx, %rdx
movl $0x1, %eax
movq %rdx, %rbx
testb %dil, %dil
jne 0x35fc5
jmp 0x35fcb
movq %rdx, %rbx
xorl %eax, %eax
cmpb (%rbx), %al
sbbl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movzbl %r15b, %ecx
subl %ecx, %eax
jmp 0x35fcb
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x35fcb
setl %al
movzbl %al, %eax
leal -0x1(,%rax,2), %eax
jmp 0x35fcb
movzbl (%rsi), %eax
testb $0x8, 0x1(%rcx,%rax,2)
sete %r10b
jne 0x3600e
xorl %r9d, %r9d
jmp 0x36053
movl $0x1, %eax
jmp 0x35fcb
movzbl (%rdx), %eax
testb $0x8, 0x1(%rcx,%rax,2)
jne 0x3601d
xorl %r9d, %r9d
jmp 0x36045
movl $0x1, %r9d
movzbl (%rsi,%r9), %eax
testb $0x8, 0x1(%rcx,%rax,2)
sete %r10b
je 0x36053
movzbl (%rdx,%r9), %eax
incq %r9
testb $0x8, 0x1(%rcx,%rax,2)
jne 0x36023
decq %r9
movl $0x1, %eax
testb %r10b, %r10b
je 0x35fcb
movzbl (%rdx,%r9), %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb $0x8, 0x1(%rcx,%rdx,2)
jne 0x35fcb
movzbl %dil, %eax
subl %r8d, %eax
jmp 0x35fcb