// File: /workspace/github_c_makefile_star2_O1/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 0x2f449
movq %rcx, %r14
testq %rcx, %rcx
je 0x2f449
movq %rdi, %rbx
cmpl $0xdb7c2712, 0x120(%rdi) # imm = 0xDB7C2712
jne 0x2f449
movl %edx, %r12d
movq %rsi, %r15
movq 0xf8(%rbx), %rdi
testq %rdi, %rdi
je 0x2f2f3
movq 0x67488(%rip), %rax     # 0x96778
callq *0x20(%rax)
cmpl $0x2, 0x6748e(%rip)     # 0x96788
jb 0x2f312
movl $0xfffffff6, %r13d      # imm = 0xFFFFFFF6
cmpl $0xdb7c2712, 0x120(%rbx) # imm = 0xDB7C2712
jne 0x2f449
movq 0xe0(%rbx), %r8
movl $0xffffffe8, %r13d      # imm = 0xFFFFFFE8
testq %r8, %r8
je 0x2f40a
cmpl $0xf874bcd7, 0x118(%r8) # imm = 0xF874BCD7
jne 0x2f40a
testq %r15, %r15
movl $0x1, %eax
cmovel %eax, %r12d
leaq 0x49bcf(%rip), %rax     # 0x78f1b
cmovneq %r15, %rax
testl %r12d, %r12d
jns 0x2f39c
cmpb $0x0, (%rax)
movq %rax, %r12
je 0x2f399
leaq 0x2(%rax), %r12
cmpb $0x0, -0x1(%r12)
je 0x2f391
cmpb $0x0, (%r12)
je 0x2f399
cmpb $0x0, 0x1(%r12)
je 0x2f396
leaq 0x4(%r12), %rcx
cmpb $0x0, 0x2(%r12)
movq %rcx, %r12
jne 0x2f361
addq $-0x2, %rcx
movq %rcx, %r12
jmp 0x2f399
decq %r12
jmp 0x2f399
incq %r12
subl %eax, %r12d
movq %rax, -0x40(%rbp)
movl %r12d, -0x38(%rbp)
movq 0xf0(%r8), %rdi
testq %rdi, %rdi
je 0x2f3c0
movq 0x67ce9(%rip), %rax     # 0x970a0
movq %r8, %r15
callq *0x20(%rax)
movq %r15, %r8
cmpl $0x2, 0x67ce9(%rip)     # 0x970b0
jb 0x2f3dc
movl $0xfffffff6, %r13d      # imm = 0xFFFFFFF6
cmpl $0xf874bcd7, 0x118(%r8) # imm = 0xF874BCD7
jne 0x2f40a
leaq -0x30(%rbp), %rsi
leaq -0x40(%rbp), %rdx
movq %r8, %rdi
xorl %ecx, %ecx
movq %r8, %r15
callq 0x48664
movl %eax, %r13d
movq 0xf0(%r15), %rdi
testq %rdi, %rdi
je 0x2f40a
movq 0x67c99(%rip), %rax     # 0x970a0
callq *0x30(%rax)
testl %r13d, %r13d
jne 0x2f433
movq -0x30(%rbp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2f45b
testl %eax, %eax
je 0x2f430
movl %eax, %r13d
movq -0x30(%rbp), %rdi
callq 0x2f5cf
jmp 0x2f433
xorl %r13d, %r13d
movq 0xf8(%rbx), %rdi
testq %rdi, %rdi
je 0x2f449
movq 0x67332(%rip), %rax     # 0x96778
callq *0x30(%rax)
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq