// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: unqliteConfigure
static int unqliteConfigure(unqlite *pDb,int nOp,va_list ap)
{
	int rc = UNQLITE_OK;
	switch(nOp){
	case UNQLITE_CONFIG_JX9_ERR_LOG:
		/* Jx9 compile-time error log */
		rc = jx9EngineConfig(pDb->sDB.pJx9,JX9_CONFIG_ERR_LOG,ap);
		break;
	case UNQLITE_CONFIG_MAX_PAGE_CACHE: {
		int max_page = va_arg(ap,int);
		/* Maximum number of page to cache (Simple hint). */
		rc = unqlitePagerSetCachesize(pDb->sDB.pPager,max_page);
		break;
										}
	case UNQLITE_CONFIG_ERR_LOG: {
		/* Database error log if any */
		const char **pzPtr = va_arg(ap, const char **);
		int *pLen = va_arg(ap, int *);
		if( pzPtr == 0 ){
			rc = JX9_CORRUPT;
			break;
		}
		/* NULL terminate the error-log buffer */
		SyBlobNullAppend(&pDb->sErr);
		/* Point to the error-log buffer */
		*pzPtr = (const char *)SyBlobData(&pDb->sErr);
		if( pLen ){
			if( SyBlobLength(&pDb->sErr) > 1 /* NULL '\0' terminator */ ){
				*pLen = (int)SyBlobLength(&pDb->sErr);
			}else{
				*pLen = 0;
			}
		}
		break;
								 }
	case UNQLITE_CONFIG_DISABLE_AUTO_COMMIT:{
		/* Disable auto-commit */
		pDb->iFlags |= UNQLITE_FL_DISABLE_AUTO_COMMIT;
		break;
											}
	case UNQLITE_CONFIG_GET_KV_NAME: {
		/* Name of the underlying KV storage engine */
		const char **pzPtr = va_arg(ap,const char **);
		if( pzPtr ){
			unqlite_kv_engine *pEngine;
			pEngine = unqlitePagerGetKvEngine(pDb);
			/* Point to the name */
			*pzPtr = pEngine->pIo->pMethods->zName;
		}
		break;
									 }
	default:
		/* Unknown configuration option */
		rc = UNQLITE_UNKNOWN;
		break;
	}
	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0xc(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x48(%rbp)
subl $0x5, %eax
ja 0x548ec
movq -0x48(%rbp), %rax
leaq 0x6be64(%rip), %rcx     # 0xc0500
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
movq 0xe0(%rax), %rdi
movq -0x18(%rbp), %rdx
movl $0x2, %esi
callq 0x6b6f0
movl %eax, -0x1c(%rbp)
jmp 0x548f3
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movl (%rax), %eax
movl %eax, -0x4c(%rbp)
cmpl $0x28, %eax
ja 0x546f1
movq -0x58(%rbp), %rcx
movl -0x4c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x60(%rbp)
jmp 0x54708
movq -0x58(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0xd8(%rax), %rdi
movl -0x20(%rbp), %esi
callq 0x6b840
movl %eax, -0x1c(%rbp)
jmp 0x548f3
movq -0x18(%rbp), %rax
movq %rax, -0x70(%rbp)
movl (%rax), %eax
movl %eax, -0x64(%rbp)
cmpl $0x28, %eax
ja 0x54757
movq -0x70(%rbp), %rcx
movl -0x64(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x78(%rbp)
jmp 0x5476e
movq -0x70(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x88(%rbp)
movl (%rax), %eax
movl %eax, -0x7c(%rbp)
cmpl $0x28, %eax
ja 0x547ad
movq -0x88(%rbp), %rcx
movl -0x7c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x90(%rbp)
jmp 0x547ca
movq -0x88(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x547eb
movl $0xffffffe8, -0x1c(%rbp) # imm = 0xFFFFFFE8
jmp 0x548f3
movq -0x8(%rbp), %rdi
addq $0xb8, %rdi
callq 0x6b880
movq -0x8(%rbp), %rax
movq 0xc0(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x30(%rbp)
je 0x5483f
movq -0x8(%rbp), %rax
cmpl $0x1, 0xc8(%rax)
jbe 0x54833
movq -0x8(%rbp), %rax
movl 0xc8(%rax), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
jmp 0x5483d
movq -0x30(%rbp), %rax
movl $0x0, (%rax)
jmp 0x5483f
jmp 0x548f3
movq -0x8(%rbp), %rax
movl 0x10c(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x10c(%rax)
jmp 0x548f3
movq -0x18(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl (%rax), %eax
movl %eax, -0x94(%rbp)
cmpl $0x28, %eax
ja 0x54896
movq -0xa0(%rbp), %rcx
movl -0x94(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0xa8(%rbp)
jmp 0x548b3
movq -0xa0(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x548ea
movq -0x8(%rbp), %rdi
callq 0x58930
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
jmp 0x548f3
movl $0xfffffff3, -0x1c(%rbp) # imm = 0xFFFFFFF3
movl -0x1c(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nop