// File: /workspace/github_c_makefile_star2_O1/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), %r12
movl $0x0, -0x2c(%rbp)
movl 0x8(%r12), %r14d
testq %r14, %r14
je 0x5002f
movq (%r12), %r13
leaq -0x2c(%rbp), %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x50201
movq (%rbx), %rdi
testl %eax, %eax
je 0x50040
leaq -0x2c(%rbp), %rsi
callq 0x49175
testq %rax, %rax
je 0x5006a
movq %rax, %r15
movq %r12, -0x40(%rbp)
addq %r13, %r14
movq (%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r15)
movups %xmm0, 0x30(%r15)
movups %xmm0, (%r15)
movups %xmm0, 0x20(%r15)
movq %r15, %rcx
addq $0x20, %rcx
movq %rcx, -0x38(%rbp)
movq %rax, 0x10(%r15)
movq %rax, 0x18(%r15)
movl $0x0, 0x30(%r15)
movl $0x1, 0x8(%r15)
movq %r13, %r12
cmpb $0x5c, (%r12)
je 0x4ff87
incq %r12
cmpq %r14, %r12
jb 0x4ff78
cmpq %r13, %r12
jbe 0x4ff9d
movl %r12d, %edx
subl %r13d, %edx
movq %r15, %rdi
movq %r13, %rsi
callq 0x3f7f6
leaq 0x1(%r12), %rax
cmpq %r14, %rax
jae 0x4ffdb
movzbl (%rax), %eax
movq %r15, %rdi
cmpl $0x27, %eax
je 0x4ffc0
cmpl $0x5c, %eax
jne 0x4ffce
leaq 0x23461(%rip), %rsi     # 0x7341f
jmp 0x4ffc7
leaq 0x28374(%rip), %rsi     # 0x7833b
movl $0x1, %edx
jmp 0x4ffd6
movq %r12, %rsi
movl $0x2, %edx
callq 0x3f7f6
addq $0x2, %r12
movq %r12, %r13
cmpq %r14, %r12
jb 0x4ff78
movq (%rbx), %rdi
movl -0x2c(%rbp), %ecx
xorl %r12d, %r12d
movl $0x4, %esi
xorl %edx, %edx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x493c1
movq -0x40(%rbp), %rax
cmpl $0x3ff, 0x8(%rax)       # imm = 0x3FF
ja 0x50058
movl 0x28(%r15), %edx
testl %edx, %edx
je 0x50058
movl -0x2c(%rbp), %ecx
addq $0x8, %rbx
movq -0x38(%rbp), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x4542b
jmp 0x50058
movq (%rbx), %rdi
xorl %r12d, %r12d
movl $0x4, %esi
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0x5004d
movl -0x2c(%rbp), %ecx
xorl %r12d, %r12d
movl $0x4, %esi
xorl %edx, %edx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x493c1
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x27c19(%rip), %rcx     # 0x77c8a
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x49434
movl $0xfffffff6, %r12d      # imm = 0xFFFFFFF6
jmp 0x50058