// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/samtools-0.1.18/bam_sort.c
// Function: strnum_cmp
static inline int strnum_cmp(const char *a, const char *b)
{
	char *pa, *pb;
	pa = (char*)a; pb = (char*)b;
	while (*pa && *pb) {
		if (isdigit(*pa) && isdigit(*pb)) {
			long ai, bi;
			ai = strtol(pa, &pa, 10);
			bi = strtol(pb, &pb, 10);
			if (ai != bi) return ai<bi? -1 : ai>bi? 1 : 0;
		} else {
			if (*pa != *pb) break;
			++pa; ++pb;
		}
	}
	if (*pa == *pb)
		return (pa-a) < (pb-b)? -1 : (pa-a) > (pb-b)? 1 : 0;
	return *pa<*pb? -1 : *pa>*pb? 1 : 0;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0xf(%rsp)
je 0x489567
movq 0x20(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x489574
jmp 0x489670
callq 0x311d0
movq (%rax), %rax
movq 0x28(%rsp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x489639
callq 0x311d0
movq (%rax), %rax
movq 0x20(%rsp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x489639
movq 0x28(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movl $0xa, %edx
callq 0x31c30
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movl $0xa, %edx
callq 0x31c30
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0x489637
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
jge 0x48960f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x8(%rsp)
jmp 0x48962a
movq 0x18(%rsp), %rdx
movq 0x10(%rsp), %rsi
xorl %eax, %eax
movl $0x1, %ecx
cmpq %rsi, %rdx
cmovgl %ecx, %eax
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0x489727
jmp 0x48966b
movq 0x28(%rsp), %rax
movsbl (%rax), %eax
movq 0x20(%rsp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x48964f
jmp 0x489670
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x489542
movq 0x28(%rsp), %rax
movsbl (%rax), %eax
movq 0x20(%rsp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x4896e3
movq 0x28(%rsp), %rax
movq 0x38(%rsp), %rcx
subq %rcx, %rax
movq 0x20(%rsp), %rcx
movq 0x30(%rsp), %rdx
subq %rdx, %rcx
cmpq %rcx, %rax
jge 0x4896ae
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x4(%rsp)
jmp 0x4896d9
movq 0x28(%rsp), %rdx
movq 0x38(%rsp), %rax
subq %rax, %rdx
movq 0x20(%rsp), %rsi
movq 0x30(%rsp), %rax
subq %rax, %rsi
xorl %eax, %eax
movl $0x1, %ecx
cmpq %rsi, %rdx
cmovgl %ecx, %eax
movl %eax, 0x4(%rsp)
movl 0x4(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0x489727
movq 0x28(%rsp), %rax
movsbl (%rax), %eax
movq 0x20(%rsp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jge 0x489701
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, (%rsp)
jmp 0x489720
movq 0x28(%rsp), %rax
movsbl (%rax), %edx
movq 0x20(%rsp), %rax
movsbl (%rax), %esi
xorl %eax, %eax
movl $0x1, %ecx
cmpl %esi, %edx
cmovgl %ecx, %eax
movl %eax, (%rsp)
movl (%rsp), %eax
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq