// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: SyStrIsNumeric
JX9_PRIVATE sxi32 SyStrIsNumeric(const char *zSrc, sxu32 nLen, sxu8 *pReal, const char  **pzTail)
{
	const char *zCur, *zEnd;
#ifdef UNTRUST
	if( SX_EMPTY_STR(zSrc) ){
		return SXERR_EMPTY;
	}
#endif
	zEnd = &zSrc[nLen];
	/* Jump leading white spaces */
	while( zSrc < zEnd && (unsigned char)zSrc[0] < 0xc0  && SyisSpace(zSrc[0]) ){
		zSrc++;
	}
	if( zSrc < zEnd && (zSrc[0] == '+' || zSrc[0] == '-') ){
		zSrc++;
	}
	zCur = zSrc;
	if( pReal ){
		*pReal = FALSE;
	}
	for(;;){
		if( zSrc >= zEnd || (unsigned char)zSrc[0] >= 0xc0 || !SyisDigit(zSrc[0]) ){ break; } zSrc++;
		if( zSrc >= zEnd || (unsigned char)zSrc[0] >= 0xc0 || !SyisDigit(zSrc[0]) ){ break; } zSrc++;
		if( zSrc >= zEnd || (unsigned char)zSrc[0] >= 0xc0 || !SyisDigit(zSrc[0]) ){ break; } zSrc++;
		if( zSrc >= zEnd || (unsigned char)zSrc[0] >= 0xc0 || !SyisDigit(zSrc[0]) ){ break; } zSrc++;
	};
	if( zSrc < zEnd && zSrc > zCur ){
		int c = zSrc[0];
		if( c == '.' ){
			zSrc++;
			if( pReal ){
				*pReal = TRUE;
			}
			if( pzTail ){
				while( zSrc < zEnd && (unsigned char)zSrc[0] < 0xc0 && SyisDigit(zSrc[0]) ){
					zSrc++;
				}
				if( zSrc < zEnd && (zSrc[0] == 'e' || zSrc[0] == 'E') ){
					zSrc++;
					if( zSrc < zEnd && (zSrc[0] == '+' || zSrc[0] == '-') ){
						zSrc++;
					}
					while( zSrc < zEnd && (unsigned char)zSrc[0] < 0xc0 && SyisDigit(zSrc[0]) ){
						zSrc++;
					}
				}
			}
		}else if( c == 'e' || c == 'E' ){
			zSrc++;
			if( pReal ){
				*pReal = TRUE;
			}
			if( pzTail ){
				if( zSrc < zEnd && (zSrc[0] == '+' || zSrc[0] == '-') ){
					zSrc++;
				}
				while( zSrc < zEnd && (unsigned char)zSrc[0] < 0xc0 && SyisDigit(zSrc[0]) ){
					zSrc++;
				}
			}
		}
	}
	if( pzTail ){
		/* Point to the non numeric part */
		*pzTail = zSrc;
	}
	return zSrc > zCur ? SXRET_OK /* String prefix is numeric */ : SXERR_INVALID /* Not a digit stream */;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
movl %esi, %r15d
addq %rdi, %r15
cmpq %r15, %rbx
jae 0x3b862
movsbq (%rbx), %r12
cmpq $-0x41, %r12
ja 0x3b850
callq 0xc190
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r12,2)
je 0x3b850
incq %rbx
jmp 0x3b82c
cmpb $0x2b, %r12b
je 0x3b85f
movzbl %r12b, %eax
cmpl $0x2d, %eax
jne 0x3b862
incq %rbx
testq %r14, %r14
je 0x3b86b
movb $0x0, (%r14)
movq %r14, -0x30(%rbp)
leaq 0x3(%rbx), %r12
movq %rbx, %r13
leaq -0x3(%r12), %rax
cmpq %r15, %rax
jae 0x3b911
movsbq (%rax), %r14
cmpq $-0x41, %r14
ja 0x3b904
callq 0xc190
movq (%rax), %rcx
testb $0x8, 0x1(%rcx,%r14,2)
je 0x3b904
leaq 0x1(%r13), %rax
leaq -0x2(%r12), %rdx
cmpq %r15, %rdx
jae 0x3b911
movsbq (%rdx), %rsi
cmpq $-0x41, %rsi
ja 0x3b911
testb $0x8, 0x1(%rcx,%rsi,2)
je 0x3b909
leaq 0x2(%r13), %rax
leaq -0x1(%r12), %rdx
cmpq %r15, %rdx
jae 0x3b911
movsbq (%rdx), %rsi
cmpq $-0x41, %rsi
ja 0x3b911
testb $0x8, 0x1(%rcx,%rsi,2)
je 0x3b909
cmpq %r15, %r12
jae 0x3b90e
leaq 0x3(%r13), %rax
movsbq (%r12), %rdx
cmpq $-0x41, %rdx
ja 0x3b911
testb $0x8, 0x1(%rcx,%rdx,2)
je 0x3b911
addq $0x4, %r13
addq $0x4, %r12
jmp 0x3b876
movq %r13, %rax
jmp 0x3b911
movq %rdx, %rax
jmp 0x3b911
movq %r12, %rax
cmpq %r15, %rax
setb %cl
cmpq %rbx, %rax
seta %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x3b94b
movb (%rax), %cl
cmpb $0x2e, %cl
jne 0x3b934
incq %rax
movq -0x30(%rbp), %rcx
jmp 0x3b943
andb $-0x21, %cl
cmpb $0x45, %cl
movq -0x30(%rbp), %rcx
jne 0x3b94b
incq %rax
testq %rcx, %rcx
je 0x3b94b
movb $0x1, (%rcx)
xorl %ecx, %ecx
cmpq %rbx, %rax
seta %cl
leal (%rcx,%rcx,8), %eax
addl $-0x9, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq