// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/filePath.c
// Function: splitPath
void splitPath(char *path, char dir[PATH_LEN], char name[FILENAME_LEN],
	       char extension[FILEEXT_LEN])
/* Split a full path into components.  The dir component will include the
 * trailing / if any.  The extension component will include the starting
 * . if any.   Pass in NULL for dir, name, or extension if you don't care about
 * that part. */
{
char *dirStart, *nameStart, *extStart, *extEnd;
int dirSize, nameSize, extSize;

undosPath(path);
dirStart = path;
nameStart = strrchr(path,'/');
if (nameStart == NULL)
    nameStart = path;
else
    nameStart += 1;
extStart = strrchr(nameStart, '.');
if (extStart == NULL)
    extStart = nameStart + strlen(nameStart);
extEnd = extStart + strlen(extStart);
if ((dirSize = (nameStart - dirStart)) >= PATH_LEN)
    errAbort("Directory too long in %s", path);
if ((nameSize = (extStart - nameStart)) >= FILENAME_LEN)
    errAbort("Name too long in %s", path);
if ((extSize = (extEnd - extStart)) >= FILEEXT_LEN)
    errAbort("Extension too long in %s", path);
if (dir != NULL)
    {
    memcpy(dir, dirStart, dirSize);
    dir[dirSize] = 0;
    }
if (name != NULL)
    {
    memcpy(name, nameStart, nameSize);
    name[nameSize] = 0;
    }
if (extension != NULL)
    {
    memcpy(extension, extStart, extSize);
    extension[extSize] = 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x38590
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2f, %esi
callq 0x67b0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x3861c
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x38628
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movl $0x2e, %esi
callq 0x67b0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x38660
movq -0x30(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rdi
callq 0x62c0
movq %rax, %rcx
movq -0x58(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x38(%rbp), %rdi
callq 0x62c0
movq %rax, %rcx
movq -0x60(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x44(%rbp)
cmpl $0x200, %eax            # imm = 0x200
jl 0x386a6
movq -0x8(%rbp), %rsi
leaq 0xa23bc(%rip), %rdi     # 0xdaa5b
movb $0x0, %al
callq 0x35d40
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x48(%rbp)
cmpl $0x80, %eax
jl 0x386cd
movq -0x8(%rbp), %rsi
leaq 0xa23ae(%rip), %rdi     # 0xdaa74
movb $0x0, %al
callq 0x35d40
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x4c(%rbp)
cmpl $0x40, %eax
jl 0x386f2
movq -0x8(%rbp), %rsi
leaq 0xa239d(%rip), %rdi     # 0xdaa88
movb $0x0, %al
callq 0x35d40
cmpq $0x0, -0x10(%rbp)
je 0x38716
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movslq -0x44(%rbp), %rdx
callq 0x6570
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
movb $0x0, (%rax,%rcx)
cmpq $0x0, -0x18(%rbp)
je 0x3873a
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
movslq -0x48(%rbp), %rdx
callq 0x6570
movq -0x18(%rbp), %rax
movslq -0x48(%rbp), %rcx
movb $0x0, (%rax,%rcx)
cmpq $0x0, -0x20(%rbp)
je 0x3875e
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rsi
movslq -0x4c(%rbp), %rdx
callq 0x6570
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)