// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: unqlite_compile_file
int unqlite_compile_file(unqlite *pDb,const char *zPath,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_file(pDb->sDB.pJx9,zPath,&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 $0x38, %rsp
movl $0xffffffe8, %r15d      # imm = 0xFFFFFFE8
testq %rdi, %rdi
je 0x2f8ce
movq %rdx, %r14
testq %rdx, %rdx
je 0x2f8ce
movq %rdi, %rbx
cmpl $0xdb7c2712, 0x120(%rdi) # imm = 0xDB7C2712
jne 0x2f8ce
movq %rsi, %r12
movq 0xf8(%rbx), %rdi
testq %rdi, %rdi
je 0x2f766
movq 0x67015(%rip), %rax     # 0x96778
callq *0x20(%rax)
cmpl $0x2, 0x6701b(%rip)     # 0x96788
jb 0x2f785
movl $0xfffffff6, %r15d      # imm = 0xFFFFFFF6
cmpl $0xdb7c2712, 0x120(%rbx) # imm = 0xDB7C2712
jne 0x2f8ce
movq 0xe0(%rbx), %r13
movq $0x0, -0x30(%rbp)
movl $0xffffffe8, %r15d      # imm = 0xFFFFFFE8
testq %r13, %r13
je 0x2f88c
testq %r12, %r12
je 0x2f88c
cmpl $0xf874bcd7, 0x118(%r13) # imm = 0xF874BCD7
jne 0x2f88c
cmpb $0x0, (%r12)
je 0x2f88c
movq 0xf0(%r13), %rdi
testq %rdi, %rdi
je 0x2f7de
movq 0x678c5(%rip), %rax     # 0x970a0
callq *0x20(%rax)
cmpl $0x2, 0x678cb(%rip)     # 0x970b0
jb 0x2f7fe
movl $0xfffffff6, %r15d      # imm = 0xFFFFFFF6
cmpl $0xf874bcd7, 0x118(%r13) # imm = 0xF874BCD7
jne 0x2f88c
movq 0xb8(%r13), %rcx
movl $0xfffffffe, %r15d      # imm = 0xFFFFFFFE
testq %rcx, %rcx
je 0x2f876
movq 0x108(%rcx), %rax
testq %rax, %rax
je 0x2f876
movq %rcx, -0x48(%rbp)
xorl %ecx, %ecx
leaq -0x40(%rbp), %rsi
movq %rcx, (%rsi)
leaq -0x38(%rbp), %rdx
movq %rcx, (%rdx)
movq %r12, %rdi
callq *%rax
testl %eax, %eax
jne 0x2f876
movq -0x40(%rbp), %rax
leaq -0x58(%rbp), %rdx
movq %rax, (%rdx)
movl -0x38(%rbp), %eax
movl %eax, 0x8(%rdx)
leaq -0x30(%rbp), %rsi
movq %r13, %rdi
movq %r12, %rcx
callq 0x48664
movl %eax, %r15d
movq -0x48(%rbp), %rax
movq 0x110(%rax), %rax
testq %rax, %rax
je 0x2f876
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq *%rax
movq 0xf0(%r13), %rdi
testq %rdi, %rdi
je 0x2f88c
movq 0x67817(%rip), %rax     # 0x970a0
callq *0x30(%rax)
testl %r15d, %r15d
jne 0x2f8b8
movq -0x30(%rbp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2f45b
testl %eax, %eax
je 0x2f8b5
movq -0x30(%rbp), %rdi
callq 0x2f5cf
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x2f8b8
xorl %r15d, %r15d
movq 0xf8(%rbx), %rdi
testq %rdi, %rdi
je 0x2f8ce
movq 0x66ead(%rip), %rax     # 0x96778
callq *0x30(%rax)
movl %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq