// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: unqlite_compile
int unqlite_compile(unqlite *pDb,const char *zJx9,int nByte,unqlite_vm **ppOut)
{
	jx9_vm *pVm;
	int rc;
	if( UNQLITE_DB_MISUSE(pDb) || ppOut == 0){
		return UNQLITE_CORRUPT;
	}
#if defined(UNQLITE_ENABLE_THREADS)
	 /* Acquire DB mutex */
	 SyMutexEnter(sUnqlMPGlobal.pMutexMethods, pDb->pMutex); /* NO-OP if sUnqlMPGlobal.nThreadingLevel != UNQLITE_THREAD_LEVEL_MULTI */
	 if( sUnqlMPGlobal.nThreadingLevel > UNQLITE_THREAD_LEVEL_SINGLE && 
		 UNQLITE_THRD_DB_RELEASE(pDb) ){
			 return UNQLITE_ABORT;
	 }
#endif
	 /* Compile the Jx9 script first */
	 rc = jx9_compile(pDb->sDB.pJx9,zJx9,nByte,&pVm);
	 if( rc == JX9_OK ){
		 /* Allocate a new unqlite VM instance */
		 rc = unqliteInitVm(pDb,pVm,ppOut);
		 if( rc != UNQLITE_OK ){
			 /* Release the Jx9 VM */
			 jx9_vm_release(pVm);
		 }
	 }
#if defined(UNQLITE_ENABLE_THREADS)
	 /* Leave DB mutex */
	 SyMutexLeave(sUnqlMPGlobal.pMutexMethods,pDb->pMutex); /* NO-OP if sUnqlMPGlobal.nThreadingLevel != UNQLITE_THREAD_LEVEL_MULTI */
#endif
	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl $0xffffffe8, %r13d      # imm = 0xFFFFFFE8
testq %rdi, %rdi
je 0x2ef6e
movq %rcx, %r14
testq %rcx, %rcx
je 0x2ef6e
movq %rdi, %rbx
cmpl $0xdb7c2712, 0x120(%rdi) # imm = 0xDB7C2712
jne 0x2ef6e
movl %edx, %r12d
movq %rsi, %r15
movq 0xf8(%rbx), %rdi
testq %rdi, %rdi
je 0x2ee15
movq 0x65966(%rip), %rax     # 0x94778
callq *0x20(%rax)
cmpl $0x2, 0x6596c(%rip)     # 0x94788
jb 0x2ee34
movl $0xfffffff6, %r13d      # imm = 0xFFFFFFF6
cmpl $0xdb7c2712, 0x120(%rbx) # imm = 0xDB7C2712
jne 0x2ef6e
movq 0xe0(%rbx), %r8
movl $0xffffffe8, %r13d      # imm = 0xFFFFFFE8
testq %r8, %r8
je 0x2ef58
cmpl $0xf874bcd7, 0x118(%r8) # imm = 0xF874BCD7
jne 0x2ef58
testq %r15, %r15
movl $0x1, %eax
cmovel %eax, %r12d
leaq 0x480b8(%rip), %rax     # 0x76f26
cmovneq %r15, %rax
testl %r12d, %r12d
jns 0x2eebe
cmpb $0x0, (%rax)
movq %rax, %r12
je 0x2eebb
leaq 0x2(%rax), %r12
cmpb $0x0, -0x1(%r12)
je 0x2eeb3
cmpb $0x0, (%r12)
je 0x2eebb
cmpb $0x0, 0x1(%r12)
je 0x2eeb8
leaq 0x4(%r12), %rcx
cmpb $0x0, 0x2(%r12)
movq %rcx, %r12
jne 0x2ee83
addq $-0x2, %rcx
movq %rcx, %r12
jmp 0x2eebb
decq %r12
jmp 0x2eebb
incq %r12
subl %eax, %r12d
movq %rax, -0x40(%rbp)
movl %r12d, -0x38(%rbp)
movq 0xf0(%r8), %rdi
testq %rdi, %rdi
je 0x2eee2
movq 0x661c7(%rip), %rax     # 0x950a0
movq %r8, %r15
callq *0x20(%rax)
movq %r15, %r8
cmpl $0x2, 0x661c7(%rip)     # 0x950b0
jb 0x2eefe
movl $0xfffffff6, %r13d      # imm = 0xFFFFFFF6
cmpl $0xf874bcd7, 0x118(%r8) # imm = 0xF874BCD7
jne 0x2ef58
leaq -0x30(%rbp), %rsi
leaq -0x40(%rbp), %rdx
movq %r8, %rdi
xorl %ecx, %ecx
movq %r8, %r15
callq 0x47609
movl %eax, %r13d
movq 0xf0(%r15), %rdi
testq %rdi, %rdi
je 0x2ef2c
movq 0x66177(%rip), %rax     # 0x950a0
callq *0x30(%rax)
testl %r13d, %r13d
jne 0x2ef58
movq -0x30(%rbp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2ef80
testl %eax, %eax
je 0x2ef55
movq -0x30(%rbp), %rdi
callq 0x2f0f4
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
jmp 0x2ef58
xorl %r13d, %r13d
movq 0xf8(%rbx), %rdi
testq %rdi, %rdi
je 0x2ef6e
movq 0x6580d(%rip), %rax     # 0x94778
callq *0x30(%rax)
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq