// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: ExtractPathInfo
static sxi32 ExtractPathInfo(const char *zPath, int nByte, path_info *pOut)
{
	const char *zPtr, *zEnd = &zPath[nByte - 1];
	SyString *pCur;
	int c, d;
	c = d = '/';
#ifdef __WINNT__
	d = '\\';
#endif
	/* Zero the structure */
	SyZero(pOut, sizeof(path_info));
	/* Handle special case */
	if( nByte == sizeof(char) && ( (int)zPath[0] == c || (int)zPath[0] == d ) ){
#ifdef __WINNT__
		SyStringInitFromBuf(&pOut->sDir, "\\", sizeof(char));
#else
		SyStringInitFromBuf(&pOut->sDir, "/", sizeof(char));
#endif
		return SXRET_OK;
	}
	/* Extract the basename */
	while( zEnd > zPath && ( (int)zEnd[0] != c && (int)zEnd[0] != d ) ){
		zEnd--;
	}
	zPtr = (zEnd > zPath) ? &zEnd[1] : zPath;
	zEnd = &zPath[nByte];
	/* dirname */
	pCur = &pOut->sDir;
	SyStringInitFromBuf(pCur, zPath, zPtr-zPath);
	if( pCur->nByte > 1 ){
		SyStringTrimTrailingChar(pCur, '/');
#ifdef __WINNT__
		SyStringTrimTrailingChar(pCur, '\\');
#endif
	}else if( (int)zPath[0] == c || (int)zPath[0] == d ){
#ifdef __WINNT__
		SyStringInitFromBuf(&pOut->sDir, "\\", sizeof(char));
#else
		SyStringInitFromBuf(&pOut->sDir, "/", sizeof(char));
#endif
	}
	/* basename/filename */
	pCur = &pOut->sBasename;
	SyStringInitFromBuf(pCur, zPtr, zEnd-zPtr);
	SyStringTrimLeadingChar(pCur, '/');
#ifdef __WINNT__
	SyStringTrimLeadingChar(pCur, '\\');
#endif
	SyStringDupPtr(&pOut->sFilename, pCur);
	if( pCur->nByte > 0 ){
		/* extension */
		zEnd--;
		while( zEnd > pCur->zString /*basename*/ && zEnd[0] != '.' ){
			zEnd--;
		}
		if( zEnd > pCur->zString ){
			zEnd++; /* Jump leading dot */
			SyStringInitFromBuf(&pOut->sExtension, zEnd, &zPath[nByte]-zEnd);
			/* Fix filename */
			pCur = &pOut->sFilename;
			if( pCur->nByte > SyStringLength(&pOut->sExtension) ){
				pCur->nByte -= 1 + SyStringLength(&pOut->sExtension);
			}
		}
	}
	return SXRET_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl $0x2f, -0x40(%rbp)
movl $0x2f, -0x3c(%rbp)
movq -0x20(%rbp), %rdi
movl $0x40, %esi
callq 0x54280
movslq -0x14(%rbp), %rax
cmpq $0x1, %rax
jne 0xa940a
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl -0x3c(%rbp), %eax
je 0xa93e5
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl -0x40(%rbp), %eax
jne 0xa940a
movq -0x20(%rbp), %rax
leaq 0x1eabc(%rip), %rcx     # 0xc7eac
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movl $0x1, 0x8(%rax)
movl $0x0, -0x4(%rbp)
jmp 0xa969f
jmp 0xa940c
movq -0x30(%rbp), %rcx
xorl %eax, %eax
cmpq -0x10(%rbp), %rcx
movb %al, -0x41(%rbp)
jbe 0xa9442
movq -0x30(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl -0x3c(%rbp), %ecx
movb %al, -0x42(%rbp)
je 0xa943c
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl -0x40(%rbp), %eax
setne %al
movb %al, -0x42(%rbp)
movb -0x42(%rbp), %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
testb $0x1, %al
jne 0xa944b
jmp 0xa9459
movq -0x30(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0xa940c
movq -0x30(%rbp), %rax
cmpq -0x10(%rbp), %rax
jbe 0xa9471
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0xa9479
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x38(%rbp), %rax
cmpl $0x1, 0x8(%rax)
jbe 0xa950c
jmp 0xa94c3
movq -0x38(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x8(%rcx)
movb %al, -0x51(%rbp)
jbe 0xa94f2
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x2f, %eax
sete %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
testb $0x1, %al
jne 0xa94fb
jmp 0xa950a
movq -0x38(%rbp), %rax
movl 0x8(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0xa94c3
jmp 0xa953f
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl -0x3c(%rbp), %eax
je 0xa9524
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl -0x40(%rbp), %eax
jne 0xa953d
movq -0x20(%rbp), %rax
leaq 0x1e97d(%rip), %rcx     # 0xc7eac
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movl $0x1, 0x8(%rax)
jmp 0xa953f
movq -0x20(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x38(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x8(%rcx)
movb %al, -0x52(%rbp)
jbe 0xa958c
movq -0x38(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
sete %al
movb %al, -0x52(%rbp)
movb -0x52(%rbp), %al
testb $0x1, %al
jne 0xa9595
jmp 0xa95b2
movq -0x38(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
movl 0x8(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0xa956a
movq -0x38(%rbp), %rax
movq (%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x38(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x38(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jbe 0xa9698
movq -0x30(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rdx
xorl %eax, %eax
cmpq (%rdx), %rcx
movb %al, -0x53(%rbp)
jbe 0xa960b
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
setne %al
movb %al, -0x53(%rbp)
movb -0x53(%rbp), %al
testb $0x1, %al
jne 0xa9614
jmp 0xa9622
movq -0x30(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0xa95e9
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
jbe 0xa9696
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq %rcx, %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x20(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jbe 0xa9694
movq -0x20(%rbp), %rax
movl 0x28(%rax), %edx
addl $0x1, %edx
movq -0x38(%rbp), %rax
movl 0x8(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x8(%rax)
jmp 0xa9696
jmp 0xa9698
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)