// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: Jx9CoreConfigure
static sxi32 Jx9CoreConfigure(sxi32 nOp, va_list ap)
{
	int rc = JX9_OK;
	switch(nOp){
	    case JX9_LIB_CONFIG_VFS:{
			/* Install a virtual file system */
			const jx9_vfs *pVfs = va_arg(ap, const jx9_vfs *);
			sJx9MPGlobal.pVfs = pVfs;
			break;
								}
		case JX9_LIB_CONFIG_USER_MALLOC: {
			/* Use an alternative low-level memory allocation routines */
			const SyMemMethods *pMethods = va_arg(ap, const SyMemMethods *);
			/* Save the memory failure callback (if available) */
			ProcMemError xMemErr = sJx9MPGlobal.sAllocator.xMemError;
			void *pMemErr = sJx9MPGlobal.sAllocator.pUserData;
			if( pMethods == 0 ){
				/* Use the built-in memory allocation subsystem */
				rc = SyMemBackendInit(&sJx9MPGlobal.sAllocator, xMemErr, pMemErr);
			}else{
				rc = SyMemBackendInitFromOthers(&sJx9MPGlobal.sAllocator, pMethods, xMemErr, pMemErr);
			}
			break;
										  }
		case JX9_LIB_CONFIG_MEM_ERR_CALLBACK: {
			/* Memory failure callback */
			ProcMemError xMemErr = va_arg(ap, ProcMemError);
			void *pUserData = va_arg(ap, void *);
			sJx9MPGlobal.sAllocator.xMemError = xMemErr;
			sJx9MPGlobal.sAllocator.pUserData = pUserData;
			break;
												 }	  
		case JX9_LIB_CONFIG_USER_MUTEX: {
#if defined(JX9_ENABLE_THREADS)
			/* Use an alternative low-level mutex subsystem */
			const SyMutexMethods *pMethods = va_arg(ap, const SyMutexMethods *);
#if defined (UNTRUST)
			if( pMethods == 0 ){
				rc = JX9_CORRUPT;
			}
#endif
			/* Sanity check */
			if( pMethods->xEnter == 0 || pMethods->xLeave == 0 || pMethods->xNew == 0){
				/* At least three criticial callbacks xEnter(), xLeave() and xNew() must be supplied */
				rc = JX9_CORRUPT;
				break;
			}
			if( sJx9MPGlobal.pMutexMethods ){
				/* Overwrite the previous mutex subsystem */
				SyMutexRelease(sJx9MPGlobal.pMutexMethods, sJx9MPGlobal.pMutex);
				if( sJx9MPGlobal.pMutexMethods->xGlobalRelease ){
					sJx9MPGlobal.pMutexMethods->xGlobalRelease();
				}
				sJx9MPGlobal.pMutex = 0;
			}
			/* Initialize and install the new mutex subsystem */
			if( pMethods->xGlobalInit ){
				rc = pMethods->xGlobalInit();
				if ( rc != JX9_OK ){
					break;
				}
			}
			/* Create the global mutex */
			sJx9MPGlobal.pMutex = pMethods->xNew(SXMUTEX_TYPE_FAST);
			if( sJx9MPGlobal.pMutex == 0 ){
				/*
				 * If the supplied mutex subsystem is so sick that we are unable to
				 * create a single mutex, there is no much we can do here.
				 */
				if( pMethods->xGlobalRelease ){
					pMethods->xGlobalRelease();
				}
				rc = JX9_CORRUPT;
				break;
			}
			sJx9MPGlobal.pMutexMethods = pMethods;			
			if( sJx9MPGlobal.nThreadingLevel == 0 ){
				/* Set a default threading level */
				sJx9MPGlobal.nThreadingLevel = JX9_THREAD_LEVEL_MULTI; 
			}
#endif
			break;
										   }
		case JX9_LIB_CONFIG_THREAD_LEVEL_SINGLE:
#if defined(JX9_ENABLE_THREADS)
			/* Single thread mode(Only one thread is allowed to play with the library) */
			sJx9MPGlobal.nThreadingLevel = JX9_THREAD_LEVEL_SINGLE;
#endif
			break;
		case JX9_LIB_CONFIG_THREAD_LEVEL_MULTI:
#if defined(JX9_ENABLE_THREADS)
			/* Multi-threading mode (library is thread safe and JX9 engines and virtual machines
			 * may be shared between multiple threads).
			 */
			sJx9MPGlobal.nThreadingLevel = JX9_THREAD_LEVEL_MULTI;
#endif
			break;
		default:
			/* Unknown configuration option */
			rc = JX9_CORRUPT;
			break;
	}
	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x4(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x58(%rbp)
subl $0x5, %eax
ja 0x5b3d7
movq -0x58(%rbp), %rax
leaq 0x654b0(%rip), %rcx     # 0xc0518
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movl (%rax), %eax
movl %eax, -0x5c(%rbp)
cmpl $0x28, %eax
ja 0x5b09c
movq -0x68(%rbp), %rcx
movl -0x5c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x70(%rbp)
jmp 0x5b0b3
movq -0x68(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, 0x943e7(%rip)     # 0xef4b0
jmp 0x5b3de
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movl (%rax), %eax
movl %eax, -0x74(%rbp)
cmpl $0x28, %eax
ja 0x5b0fc
movq -0x80(%rbp), %rcx
movl -0x74(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x88(%rbp)
jmp 0x5b116
movq -0x80(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq 0x942d5(%rip), %rax     # 0xef400
movq %rax, -0x30(%rbp)
movq 0x942d2(%rip), %rax     # 0xef408
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x5b15a
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
leaq 0x94290(%rip), %rdi     # 0xef3e0
callq 0x5a990
movl %eax, -0x14(%rbp)
jmp 0x5b175
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
leaq 0x94273(%rip), %rdi     # 0xef3e0
callq 0x5aa30
movl %eax, -0x14(%rbp)
jmp 0x5b3de
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
movl (%rax), %eax
movl %eax, -0x8c(%rbp)
cmpl $0x28, %eax
ja 0x5b1b4
movq -0x98(%rbp), %rcx
movl -0x8c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0xa0(%rbp)
jmp 0x5b1d1
movq -0x98(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xb0(%rbp)
movl (%rax), %eax
movl %eax, -0xa4(%rbp)
cmpl $0x28, %eax
ja 0x5b219
movq -0xb0(%rbp), %rcx
movl -0xa4(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0xb8(%rbp)
jmp 0x5b236
movq -0xb0(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq %rax, 0x941b1(%rip)     # 0xef400
movq -0x48(%rbp), %rax
movq %rax, 0x941ae(%rip)     # 0xef408
jmp 0x5b3de
movq -0x10(%rbp), %rax
movq %rax, -0xc8(%rbp)
movl (%rax), %eax
movl %eax, -0xbc(%rbp)
cmpl $0x28, %eax
ja 0x5b299
movq -0xc8(%rbp), %rcx
movl -0xbc(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0xd0(%rbp)
jmp 0x5b2b6
movq -0xc8(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x5b2e5
movq -0x50(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x5b2e5
movq -0x50(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x5b2f1
movl $0xffffffe8, -0x14(%rbp) # imm = 0xFFFFFFE8
jmp 0x5b3de
cmpq $0x0, 0x9419f(%rip)     # 0xef498
je 0x5b34a
cmpq $0x0, 0x9419d(%rip)     # 0xef4a0
je 0x5b327
movq 0x9418c(%rip), %rax     # 0xef498
cmpq $0x0, 0x18(%rax)
je 0x5b327
movq 0x9417e(%rip), %rax     # 0xef498
movq 0x18(%rax), %rax
movq 0x9417b(%rip), %rdi     # 0xef4a0
callq *%rax
movq 0x9416a(%rip), %rax     # 0xef498
cmpq $0x0, 0x8(%rax)
je 0x5b33f
movq 0x9415c(%rip), %rax     # 0xef498
callq *0x8(%rax)
movq $0x0, 0x94156(%rip) # 0xef4a0
movq -0x50(%rbp), %rax
cmpq $0x0, (%rax)
je 0x5b367
movq -0x50(%rbp), %rax
callq *(%rax)
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x5b365
jmp 0x5b3de
jmp 0x5b367
movq -0x50(%rbp), %rax
movl $0x1, %edi
callq *0x10(%rax)
movq %rax, 0x94126(%rip)     # 0xef4a0
cmpq $0x0, 0x9411e(%rip)     # 0xef4a0
jne 0x5b39f
movq -0x50(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x5b396
movq -0x50(%rbp), %rax
callq *0x8(%rax)
movl $0xffffffe8, -0x14(%rbp) # imm = 0xFFFFFFE8
jmp 0x5b3de
movq -0x50(%rbp), %rax
movq %rax, 0x940ee(%rip)     # 0xef498
cmpl $0x0, 0x940f7(%rip)     # 0xef4a8
jne 0x5b3bd
movl $0x2, 0x940eb(%rip)     # 0xef4a8
jmp 0x5b3de
movl $0x1, 0x940df(%rip)     # 0xef4a8
jmp 0x5b3de
movl $0x2, 0x940d3(%rip)     # 0xef4a8
jmp 0x5b3de
movl $0xffffffe8, -0x14(%rbp) # imm = 0xFFFFFFE8
movl -0x14(%rbp), %eax
addq $0xd0, %rsp
popq %rbp
retq
nopw (%rax,%rax)