// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: SyOctalStrToInt64
JX9_PRIVATE sxi32 SyOctalStrToInt64(const char *zSrc, sxu32 nLen, void * pOutVal, const char **zRest)
{
	const char *zIn, *zEnd;
	int isNeg = FALSE;
	sxi64 nVal = 0;
	int c;
#if defined(UNTRUST)
	if( SX_EMPTY_STR(zSrc) ){
		if( pOutVal ){
			*(sxi32 *)pOutVal = 0;
		}
		return SXERR_EMPTY;
	}
#endif
	zEnd = &zSrc[nLen];
	while(zSrc < zEnd && SyisSpace(zSrc[0]) ){
		zSrc++;
	}
	if( zSrc < zEnd && ( zSrc[0] == '-' || zSrc[0] == '+' ) ){
		isNeg = (zSrc[0] == '-') ? TRUE :FALSE;
		zSrc++;
	}
	/* Skip leading zero */
	while(zSrc < zEnd && zSrc[0] == '0' ){
		zSrc++; 
	}
	zIn = zSrc;
	for(;;){
		if(zSrc >= zEnd || !SyisDigit(zSrc[0])){ break; } if( (c=zSrc[0]-'0') > 7 || (int)(zSrc-zIn) > 20){ break;} nVal = nVal * 8 +  c; zSrc++;
		if(zSrc >= zEnd || !SyisDigit(zSrc[0])){ break; } if( (c=zSrc[0]-'0') > 7 || (int)(zSrc-zIn) > 20){ break;} nVal = nVal * 8 +  c; zSrc++;
		if(zSrc >= zEnd || !SyisDigit(zSrc[0])){ break; } if( (c=zSrc[0]-'0') > 7 || (int)(zSrc-zIn) > 20){ break;} nVal = nVal * 8 +  c; zSrc++;
		if(zSrc >= zEnd || !SyisDigit(zSrc[0])){ break; } if( (c=zSrc[0]-'0') > 7 || (int)(zSrc-zIn) > 20){ break;} nVal = nVal * 8 +  c; zSrc++;
	}
	/* Skip trailing spaces */
	while(zSrc < zEnd && SyisSpace(zSrc[0])){
		zSrc++;
	}
	if( zRest ){
		*zRest = zSrc;
	}	
	if( pOutVal ){
		if( isNeg == TRUE && nVal != 0 ){
			nVal = -nVal;
		}
		*(sxi64 *)pOutVal = nVal;
	}
	return (zSrc >= zEnd) ? SXRET_OK : SXERR_SYNTAX;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x34(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpq -0x30(%rbp), %rcx
movb %al, -0x45(%rbp)
jae 0x719c7
callq 0xd1f0
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
movb %al, -0x45(%rbp)
movb -0x45(%rbp), %al
testb $0x1, %al
jne 0x719d0
jmp 0x719de
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x71994
movq -0x8(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x71a23
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0x71a00
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0x71a23
movq -0x8(%rbp), %rax
movsbl (%rax), %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x2d, %edx
cmovel %ecx, %eax
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x71a25
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpq -0x30(%rbp), %rcx
movb %al, -0x46(%rbp)
jae 0x71a44
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
sete %al
movb %al, -0x46(%rbp)
movb -0x46(%rbp), %al
testb $0x1, %al
jne 0x71a4d
jmp 0x71a5b
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x71a25
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x71a8d
callq 0xd1f0
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0x71a92
jmp 0x71c36
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
movl %eax, -0x44(%rbp)
cmpl $0x7, %eax
jg 0x71ab4
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rcx, %rax
cmpl $0x14, %eax
jle 0x71ab9
jmp 0x71c36
movq -0x40(%rbp), %rax
shlq $0x3, %rax
movslq -0x44(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x71b02
callq 0xd1f0
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0x71b07
jmp 0x71c36
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
movl %eax, -0x44(%rbp)
cmpl $0x7, %eax
jg 0x71b29
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rcx, %rax
cmpl $0x14, %eax
jle 0x71b2e
jmp 0x71c36
movq -0x40(%rbp), %rax
shlq $0x3, %rax
movslq -0x44(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x71b77
callq 0xd1f0
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0x71b7c
jmp 0x71c36
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
movl %eax, -0x44(%rbp)
cmpl $0x7, %eax
jg 0x71b9e
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rcx, %rax
cmpl $0x14, %eax
jle 0x71ba3
jmp 0x71c36
movq -0x40(%rbp), %rax
shlq $0x3, %rax
movslq -0x44(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x71bec
callq 0xd1f0
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0x71bee
jmp 0x71c36
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
movl %eax, -0x44(%rbp)
cmpl $0x7, %eax
jg 0x71c10
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rcx, %rax
cmpl $0x14, %eax
jle 0x71c12
jmp 0x71c36
movq -0x40(%rbp), %rax
shlq $0x3, %rax
movslq -0x44(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x71a63
jmp 0x71c38
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpq -0x30(%rbp), %rcx
movb %al, -0x47(%rbp)
jae 0x71c6b
callq 0xd1f0
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
movb %al, -0x47(%rbp)
movb -0x47(%rbp), %al
testb $0x1, %al
jne 0x71c74
jmp 0x71c82
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x71c38
cmpq $0x0, -0x20(%rbp)
je 0x71c94
movq -0x8(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x18(%rbp)
je 0x71cbd
cmpl $0x1, -0x34(%rbp)
jne 0x71cb2
cmpq $0x0, -0x40(%rbp)
je 0x71cb2
xorl %eax, %eax
subq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rdx
movq -0x30(%rbp), %rsi
movl $0xfffffff4, %eax       # imm = 0xFFFFFFF4
xorl %ecx, %ecx
cmpq %rsi, %rdx
cmovael %ecx, %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)