// File: /workspace/github_c_makefile_star2_O3/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 0x2f3ec
movq %rdx, %r14
testq %rdx, %rdx
je 0x2f3ec
movq %rdi, %rbx
cmpl $0xdb7c2712, 0x120(%rdi) # imm = 0xDB7C2712
jne 0x2f3ec
movq %rsi, %r12
movq 0xf8(%rbx), %rdi
testq %rdi, %rdi
je 0x2f284
movq 0x654f7(%rip), %rax     # 0x94778
callq *0x20(%rax)
cmpl $0x2, 0x654fd(%rip)     # 0x94788
jb 0x2f2a3
movl $0xfffffff6, %r15d      # imm = 0xFFFFFFF6
cmpl $0xdb7c2712, 0x120(%rbx) # imm = 0xDB7C2712
jne 0x2f3ec
movq 0xe0(%rbx), %r13
movq $0x0, -0x30(%rbp)
movl $0xffffffe8, %r15d      # imm = 0xFFFFFFE8
testq %r13, %r13
je 0x2f3d6
testq %r12, %r12
je 0x2f3d6
cmpl $0xf874bcd7, 0x118(%r13) # imm = 0xF874BCD7
jne 0x2f3d6
cmpb $0x0, (%r12)
je 0x2f3d6
movq 0xf0(%r13), %rdi
testq %rdi, %rdi
je 0x2f2fc
movq 0x65da7(%rip), %rax     # 0x950a0
callq *0x20(%rax)
cmpl $0x2, 0x65dad(%rip)     # 0x950b0
jb 0x2f31c
movl $0xfffffff6, %r15d      # imm = 0xFFFFFFF6
cmpl $0xf874bcd7, 0x118(%r13) # imm = 0xF874BCD7
jne 0x2f3d6
movq 0xb8(%r13), %rcx
movl $0xfffffffe, %r15d      # imm = 0xFFFFFFFE
testq %rcx, %rcx
je 0x2f394
movq 0x108(%rcx), %rax
testq %rax, %rax
je 0x2f394
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 0x2f394
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 0x47609
movl %eax, %r15d
movq -0x48(%rbp), %rax
movq 0x110(%rax), %rax
testq %rax, %rax
je 0x2f394
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq *%rax
movq 0xf0(%r13), %rdi
testq %rdi, %rdi
je 0x2f3aa
movq 0x65cf9(%rip), %rax     # 0x950a0
callq *0x30(%rax)
testl %r15d, %r15d
jne 0x2f3d6
movq -0x30(%rbp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2ef80
testl %eax, %eax
je 0x2f3d3
movq -0x30(%rbp), %rdi
callq 0x2f0f4
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x2f3d6
xorl %r15d, %r15d
movq 0xf8(%rbx), %rdi
testq %rdi, %rdi
je 0x2f3ec
movq 0x6538f(%rip), %rax     # 0x94778
callq *0x30(%rax)
movl %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq