// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9CompileSimpleString
JX9_PRIVATE sxi32 jx9CompileSimpleString(jx9_gen_state *pGen, sxi32 iCompileFlag)
{
	SyString *pStr = &pGen->pIn->sData; /* Constant string literal */
	const char *zIn, *zCur, *zEnd;
	jx9_value *pObj;
	sxu32 nIdx;
	nIdx = 0; /* Prevent compiler warning */
	/* Delimit the string */
	zIn  = pStr->zString;
	zEnd = &zIn[pStr->nByte];
	if( zIn >= zEnd ){
		/* Empty string, load NULL */
		jx9VmEmitInstr(pGen->pVm, JX9_OP_LOADC, 0, 0, 0, 0);
		return SXRET_OK;
	}
	if( SXRET_OK == GenStateFindLiteral(&(*pGen), pStr, &nIdx) ){
		/* Already processed, emit the load constant instruction
		 * and return.
		 */
		jx9VmEmitInstr(pGen->pVm, JX9_OP_LOADC, 0, nIdx, 0, 0);
		return SXRET_OK;
	}
	/* Reserve a new constant */
	pObj = jx9VmReserveConstObj(pGen->pVm, &nIdx);
	if( pObj == 0 ){
		jx9GenCompileError(&(*pGen), E_ERROR, 1, "JX9 engine is running out of memory");
		SXUNUSED(iCompileFlag); /* cc warning */
		return SXERR_ABORT;
	}
	jx9MemObjInitFromString(pGen->pVm, pObj, 0);
	/* Compile the node */
	for(;;){
		if( zIn >= zEnd ){
			/* End of input */
			break;
		}
		zCur = zIn;
		while( zIn < zEnd && zIn[0] != '\\' ){
			zIn++;
		}
		if( zIn > zCur ){
			/* Append raw contents*/
			jx9MemObjStringAppend(pObj, zCur, (sxu32)(zIn-zCur));
		}
		zIn++;
		if( zIn < zEnd ){
			if( zIn[0] == '\\' ){
				/* A literal backslash */
				jx9MemObjStringAppend(pObj, "\\", sizeof(char));
			}else if( zIn[0] == '\'' ){
				/* A single quote */
				jx9MemObjStringAppend(pObj, "'", sizeof(char));
			}else{
				/* verbatim copy */
				zIn--;
				jx9MemObjStringAppend(pObj, zIn, sizeof(char)*2);
				zIn++;
			}
		}
		/* Advance the stream cursor */
		zIn++;
	}
	/* Emit the load constant instruction */
	jx9VmEmitInstr(pGen->pVm, JX9_OP_LOADC, 0, nIdx, 0, 0);
	if( pStr->nByte < 1024 ){
		/* Install in the literal table */
		GenStateInstallLiteral(pGen, pObj, nIdx);
	}
	/* Node successfully compiled */
	return SXRET_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x158(%rdi), %r13
movl $0x0, -0x2c(%rbp)
movl 0x8(%r13), %r14d
testq %r14, %r14
je 0x4ea45
movq (%r13), %r12
cmpl $0x0, 0x30(%rbx)
je 0x4e939
leaq 0x8(%rbx), %rdi
movq %r12, %rsi
movl %r14d, %edx
callq 0x448fa
testq %rax, %rax
je 0x4e939
movl 0x10(%rax), %ecx
movq (%rbx), %rdi
xorl %r14d, %r14d
movl $0x4, %esi
xorl %edx, %edx
jmp 0x4ea54
movq (%rbx), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x480f1
testq %rax, %rax
je 0x4ea71
movq %rax, %r15
movq %r13, -0x40(%rbp)
addq %r12, %r14
movq (%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r15)
movups %xmm0, (%r15)
movups %xmm0, 0x30(%r15)
movups %xmm0, 0x20(%r15)
movq %r15, %rcx
addq $0x20, %rcx
movq %rcx, -0x38(%rbp)
movq %rax, 0x10(%r15)
movq %rax, 0x18(%r15)
movl $0x1, 0x8(%r15)
movq %r12, %r13
cmpb $0x5c, (%r13)
je 0x4e99e
incq %r13
cmpq %r14, %r13
jb 0x4e98f
cmpq %r12, %r13
jbe 0x4e9b4
movl %r13d, %edx
subl %r12d, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x3edf3
leaq 0x1(%r13), %rax
cmpq %r14, %rax
jae 0x4e9f1
movzbl (%rax), %eax
movq %r15, %rdi
cmpl $0x27, %eax
je 0x4e9d6
cmpl $0x5c, %eax
jne 0x4e9e4
leaq 0x22a4b(%rip), %rsi     # 0x7141f
jmp 0x4e9dd
leaq 0x27969(%rip), %rsi     # 0x76346
movl $0x1, %edx
jmp 0x4e9ec
movq %r13, %rsi
movl $0x2, %edx
callq 0x3edf3
addq $0x2, %r13
movq %r13, %r12
cmpq %r14, %r13
jb 0x4e98f
movq (%rbx), %rdi
movl -0x2c(%rbp), %ecx
xorl %r14d, %r14d
movl $0x4, %esi
xorl %edx, %edx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x48365
movq -0x40(%rbp), %rax
cmpl $0x3ff, 0x8(%rax)       # imm = 0x3FF
ja 0x4ea5f
movl 0x28(%r15), %edx
testl %edx, %edx
je 0x4ea5f
movl -0x2c(%rbp), %ecx
addq $0x8, %rbx
movq -0x38(%rbp), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x445f4
jmp 0x4ea5f
movq (%rbx), %rdi
xorl %r14d, %r14d
movl $0x4, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x48365
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2721d(%rip), %rcx     # 0x75c95
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x483d1
movl $0xfffffff6, %r14d      # imm = 0xFFFFFFF6
jmp 0x4ea5f