// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/lib/nib.c
// Function: nibParseName
void nibParseName(unsigned options, char *fileSpec, char *filePath,
                         char *name, unsigned *start, unsigned *end)
/* Parse the nib name, getting the file name, seq name to use, and
 * optionally the start and end positions. Zero is return for start
 * and end if they are not specified. Return the path to the file
 * and the name to use for the sequence. */
{
char *subrange = findNibSubrange(fileSpec);
if (subrange != NULL)
    {
    *subrange = '\0';
    parseSubrange(subrange, name, start, end);
    strcpy(filePath, fileSpec);
    *subrange = ':';
    if (strlen(name) == 0)
        {
        /* no name in spec, generate one */
        if (options & NIB_BASE_NAME)
            splitPath(filePath, NULL, name, NULL);
        else
            strcpy(name, filePath);
        sprintf(name+strlen(name), ":%u-%u", *start, *end);
        }
    }
else
    {
    *start = 0;
    *end = 0;
    strcpy(filePath, fileSpec);
    if (options & NIB_BASE_NAME)
        splitPath(fileSpec, NULL, name, NULL);
    else
        strcpy(name, fileSpec);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r14
movq %r8, %r15
movq %rcx, (%rsp)
movq %rdx, %rbp
movq %rsi, %r13
movl %edi, %ebx
movq %rsi, %rdi
movl $0x2f, %esi
callq 0x67c0
leaq 0x1(%rax), %rdi
testq %rax, %rax
cmoveq %r13, %rdi
movl $0x3a, %esi
callq 0x6270
testq %rax, %rax
je 0x31a15
movq %rax, %r12
movq %rbp, 0x8(%rsp)
movq %r14, 0x10(%rsp)
movb $0x0, (%rax)
movq %rax, %r14
incq %r14
movq %r14, %rdi
movl $0x3a, %esi
callq 0x6270
testq %rax, %rax
je 0x31a4b
movq %rax, %rbp
movb $0x0, (%rax)
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x6680
movb $0x3a, (%rbp)
incq %rbp
movq %rbp, %r14
jmp 0x31a52
xorl %eax, %eax
movl %eax, (%r15)
movl %eax, (%r14)
movq %rbp, %rdi
movq %r13, %rsi
callq 0x6680
testb $0x4, %bl
jne 0x31ad0
movq (%rsp), %rdi
movq %r13, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6680
movq (%rsp), %rax
movb $0x0, (%rax)
leaq 0x6119d(%rip), %rsi     # 0x92bf6
movq %r14, %rdi
movq %r15, %rbp
movq %r15, %rdx
movq 0x10(%rsp), %r14
movq %r14, %rcx
xorl %eax, %eax
callq 0x66d0
cmpl $0x2, %eax
jne 0x31a7e
movl (%rbp), %eax
cmpl (%r14), %eax
jbe 0x31a8f
leaq 0x611d3(%rip), %rdi     # 0x92c58
movq %r12, %rsi
xorl %eax, %eax
callq 0x26e94
movq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x6680
movb $0x3a, (%r12)
movq (%rsp), %r12
cmpb $0x0, (%r12)
je 0x31abe
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb $0x4, %bl
jne 0x31aee
movq %r12, %rdi
movq %r15, %rsi
callq 0x6680
jmp 0x31afd
movq %r13, %rdi
xorl %esi, %esi
movq (%rsp), %rdx
xorl %ecx, %ecx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x288ae
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x288ae
movq %r12, %rdi
callq 0x62d0
addq %rax, %r12
movl (%rbp), %edx
movl (%r14), %ecx
leaq 0x610e0(%rip), %rsi     # 0x92bf5
movq %r12, %rdi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6170