// File: /workspace/github_c_makefile_star2_O0/excess-c64[P]lib1541img/src/lib/1541img/filename.c
// Function: Filename_setFull
SOLOCAL void Filename_setFull(Filename *self, const char *full)
{
    free(self->full);
    free(self->dir);
    free(self->base);
    free(self->ext);
    memset(self, 0, sizeof *self);
    if (!full) return;
    self->full = copystr(full);
#ifdef _WIN32
    for (char *c = self->full; *c; ++c)
    {
        if (*c == '/') *c = PATHSEP;
    }
#endif
    const char *pathsep = strrchr(self->full, PATHSEP);
    const char *base;
    if (pathsep)
    {
	size_t dirlen = pathsep - self->full;
	self->dir = xmalloc(dirlen + 1);
	strncpy(self->dir, self->full, dirlen);
	self->dir[dirlen] = 0;
	base = pathsep+1;
    }
    else
    {
	base = self->full;
    }

    const char *extsep = *base ? strrchr(base, '.') : 0;
    if (extsep)
    {
	self->ext = copystr(extsep+1);
	size_t baselen = extsep - base;
	self->base = xmalloc(baselen + 1);
	strncpy(self->base, base, baselen);
	self->base[baselen] = 0;
    }
    else
    {
	self->base = *base ? copystr(base) : 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x5070
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x5070
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x5070
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x5070
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x5340
cmpq $0x0, -0x10(%rbp)
jne 0x729f
jmp 0x7405
movq -0x10(%rbp), %rdi
callq 0x5960
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl $0x2f, %esi
callq 0x52d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x732e
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
subq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
addq $0x1, %rdi
callq 0x58d0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movq -0x28(%rbp), %rdx
callq 0x50b0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x28(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x7339
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x7359
movq -0x20(%rbp), %rdi
movl $0x2e, %esi
callq 0x52d0
movq %rax, -0x40(%rbp)
jmp 0x7361
xorl %eax, %eax
movq %rax, -0x40(%rbp)
jmp 0x7361
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x73d6
movq -0x30(%rbp), %rdi
addq $0x1, %rdi
callq 0x5960
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
addq $0x1, %rdi
callq 0x58d0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x50b0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x7405
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x73f1
movq -0x20(%rbp), %rdi
callq 0x5960
movq %rax, -0x48(%rbp)
jmp 0x73f9
xorl %eax, %eax
movq %rax, -0x48(%rbp)
jmp 0x73f9
movq -0x48(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)