// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/twoBit.c
// Function: twoBitParseRange
boolean twoBitParseRange(char *rangeSpec, char **retFile, 
	char **retSeq, int *retStart, int *retEnd)
/* Parse out something in format
 *    file/path/name:seqName:start-end
 * or
 *    file/path/name:seqName
 * or
 *    file/path/name:seqName1,seqName2,seqName3,...
 * This will destroy the input 'rangeSpec' in the process.  Returns FALSE if
 * it doesn't fit this format, setting retFile to rangeSpec, and retSet to
 * null.  If it is the shorter form then start and end will both be returned
 * as zero, which is ok by twoBitReadSeqFrag.  Any of the return arguments
 * maybe NULL.
 */
{
char *s, *e;
int n;

/* default returns */
if (retFile != NULL)
    *retFile = rangeSpec;
if (retSeq != NULL)
    *retSeq = NULL;
if (retStart != NULL)
    *retStart = 0;
if (retEnd != NULL)
    *retEnd = 0;

/* start with final name  */
s = strrchr(rangeSpec, '/');
if (s == NULL)
    s = rangeSpec;
else
    s++;

/* Grab seqName, zero terminate fileName. */
s = strchr(s, ':');
if (s == NULL)
    return FALSE;
*s++ = 0;
if (retSeq != NULL)
    *retSeq = s;

/* Grab start, zero terminate seqName. */
s = strchr(s, ':');
if (s == NULL)
    return TRUE;  /* no range spec */
*s++ = 0;
n = strtol(s, &e, 0);
if (*e != '-')
    return FALSE; /* not a valid range */
if (retStart != NULL)
    *retStart = n;
s = e+1;

/* Grab end. */
n = strtol(s, &e, 0);
if (*e != '\0')
    return FALSE; /* not a valid range */
if (retEnd != NULL)
    *retEnd = n;
return TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x5ab2e
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x20(%rbp)
je 0x5ab40
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
cmpq $0x0, -0x28(%rbp)
je 0x5ab51
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
cmpq $0x0, -0x30(%rbp)
je 0x5ab62
movq -0x30(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rdi
movl $0x2f, %esi
callq 0x67b0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x5ab85
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x5ab91
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movl $0x3a, %esi
callq 0x6260
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x5abb6
movl $0x0, -0x4(%rbp)
jmp 0x5ac92
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb $0x0, (%rax)
cmpq $0x0, -0x20(%rbp)
je 0x5abda
movq -0x38(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rdi
movl $0x3a, %esi
callq 0x6260
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x5abff
movl $0x1, -0x4(%rbp)
jmp 0x5ac92
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb $0x0, (%rax)
movq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
xorl %edx, %edx
callq 0x6a50
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0x5ac38
movl $0x0, -0x4(%rbp)
jmp 0x5ac92
cmpq $0x0, -0x28(%rbp)
je 0x5ac48
movl -0x44(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
xorl %edx, %edx
callq 0x6a50
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x5ac7b
movl $0x0, -0x4(%rbp)
jmp 0x5ac92
cmpq $0x0, -0x30(%rbp)
je 0x5ac8b
movl -0x44(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)