// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9_release
JX9_PRIVATE int jx9_release(jx9 *pEngine)
{
	int rc;
	if( JX9_ENGINE_MISUSE(pEngine) ){
		return JX9_CORRUPT;
	}
#if defined(JX9_ENABLE_THREADS)
	 /* Acquire engine mutex */
	 SyMutexEnter(sJx9MPGlobal.pMutexMethods, pEngine->pMutex); /* NO-OP if sJx9MPGlobal.nThreadingLevel != JX9_THREAD_LEVEL_MULTI */
	 if( sJx9MPGlobal.nThreadingLevel > JX9_THREAD_LEVEL_SINGLE && 
		 JX9_THRD_ENGINE_RELEASE(pEngine) ){
			 return JX9_ABORT; /* Another thread have released this instance */
	 }
#endif
	/* Release the engine */
	rc = EngineRelease(&(*pEngine));
#if defined(JX9_ENABLE_THREADS)
	 /* Leave engine mutex */
	 SyMutexLeave(sJx9MPGlobal.pMutexMethods, pEngine->pMutex); /* NO-OP if sJx9MPGlobal.nThreadingLevel != JX9_THREAD_LEVEL_MULTI */
	 /* Release engine mutex */
	 SyMutexRelease(sJx9MPGlobal.pMutexMethods, pEngine->pMutex) /* NO-OP if sJx9MPGlobal.nThreadingLevel != JX9_THREAD_LEVEL_MULTI */
#endif
#if defined(JX9_ENABLE_THREADS)
	/* Enter the global mutex */
	 SyMutexEnter(sJx9MPGlobal.pMutexMethods, sJx9MPGlobal.pMutex); /* NO-OP if sJx9MPGlobal.nThreadingLevel == JX9_THREAD_LEVEL_SINGLE */
#endif
	/* Unlink from the list of active engines */
	MACRO_LD_REMOVE(sJx9MPGlobal.pEngines, pEngine);
	sJx9MPGlobal.nEngine--;
#if defined(JX9_ENABLE_THREADS)
	/* Leave the global mutex */
	 SyMutexLeave(sJx9MPGlobal.pMutexMethods, sJx9MPGlobal.pMutex); /* NO-OP if sJx9MPGlobal.nThreadingLevel == JX9_THREAD_LEVEL_SINGLE */
#endif
	/* Release the memory chunk allocated to this engine */
	SyMemBackendPoolFree(&sJx9MPGlobal.sAllocator, pEngine);
	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x6b9d3
movq -0x10(%rbp), %rax
cmpl $0xf874bcd7, 0x118(%rax) # imm = 0xF874BCD7
je 0x6b9df
movl $0xffffffe8, -0x4(%rbp) # imm = 0xFFFFFFE8
jmp 0x6bb69
movq -0x10(%rbp), %rax
cmpq $0x0, 0xf0(%rax)
je 0x6ba05
movq 0x83aa4(%rip), %rax     # 0xef498
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0xf0(%rcx), %rdi
callq *%rax
cmpl $0x1, 0x83a9c(%rip)     # 0xef4a8
jbe 0x6ba2a
movq -0x10(%rbp), %rax
cmpl $0xf874bcd7, 0x118(%rax) # imm = 0xF874BCD7
je 0x6ba2a
movl $0xfffffff6, -0x4(%rbp) # imm = 0xFFFFFFF6
jmp 0x6bb69
movq -0x10(%rbp), %rdi
callq 0x66b20
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0xf0(%rax)
je 0x6ba5c
movq 0x83a4d(%rip), %rax     # 0xef498
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0xf0(%rcx), %rdi
callq *%rax
movq -0x10(%rbp), %rax
cmpq $0x0, 0xf0(%rax)
je 0x6ba90
movq 0x83a27(%rip), %rax     # 0xef498
cmpq $0x0, 0x18(%rax)
je 0x6ba90
movq 0x83a19(%rip), %rax     # 0xef498
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0xf0(%rcx), %rdi
callq *%rax
cmpq $0x0, 0x83a08(%rip)     # 0xef4a0
je 0x6baae
movq 0x839f7(%rip), %rax     # 0xef498
movq 0x20(%rax), %rax
movq 0x839f4(%rip), %rdi     # 0xef4a0
callq *%rax
movq 0x83a0b(%rip), %rax     # 0xef4c0
cmpq -0x10(%rbp), %rax
jne 0x6bad0
movq 0x839fe(%rip), %rax     # 0xef4c0
movq 0x108(%rax), %rax
movq %rax, 0x839f0(%rip)     # 0xef4c0
movq -0x10(%rbp), %rax
cmpq $0x0, 0x110(%rax)
je 0x6bafb
movq -0x10(%rbp), %rax
movq 0x108(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x110(%rax), %rax
movq %rcx, 0x108(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x108(%rax)
je 0x6bb26
movq -0x10(%rbp), %rax
movq 0x110(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x108(%rax), %rax
movq %rcx, 0x110(%rax)
movl 0x8398c(%rip), %eax     # 0xef4b8
addl $-0x1, %eax
movl %eax, 0x83983(%rip)     # 0xef4b8
cmpq $0x0, 0x83963(%rip)     # 0xef4a0
je 0x6bb53
movq 0x83952(%rip), %rax     # 0xef498
movq 0x30(%rax), %rax
movq 0x8394f(%rip), %rdi     # 0xef4a0
callq *%rax
movq -0x10(%rbp), %rsi
leaq 0x83882(%rip), %rdi     # 0xef3e0
callq 0x54490
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)