// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: unqlite_create_constant
int unqlite_create_constant(unqlite_vm *pVm,const char *zName,void (*xExpand)(unqlite_value *, void *),void *pUserData)
{
	SyString sName;
	int rc;
	if( UNQLITE_VM_MISUSE(pVm) ){
		return UNQLITE_CORRUPT;
	}
	SyStringInitFromBuf(&sName, zName, SyStrlen(zName));
	/* Remove leading and trailing white spaces */
	SyStringFullTrim(&sName);
	if( sName.nByte < 1 ){
		/* Empty constant name */
		return UNQLITE_INVALID;
	}
	/* TICKET 1433-003: NULL pointer is harmless operation */
	if( xExpand == 0 ){
		return UNQLITE_INVALID;
	}
#if defined(UNQLITE_ENABLE_THREADS)
	 /* Acquire VM mutex */
	 SyMutexEnter(sUnqlMPGlobal.pMutexMethods, pVm->pMutex); /* NO-OP if sUnqlMPGlobal.nThreadingLevel != UNQLITE_THREAD_LEVEL_MULTI */
	 if( sUnqlMPGlobal.nThreadingLevel > UNQLITE_THREAD_LEVEL_SINGLE && 
		 UNQLITE_THRD_VM_RELEASE(pVm) ){
			 return UNQLITE_ABORT; /* Another thread have released this instance */
	 }
#endif
	 /* Install the foreign constant */
	 rc = jx9VmRegisterConstant(pVm->pJx9Vm,&sName,xExpand,pUserData);
#if defined(UNQLITE_ENABLE_THREADS)
	 /* Leave DB mutex */
	 SyMutexLeave(sUnqlMPGlobal.pMutexMethods,pVm->pMutex); /* NO-OP if sUnqlMPGlobal.nThreadingLevel != UNQLITE_THREAD_LEVEL_MULTI */
#endif
	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x5626f
movq -0x10(%rbp), %rax
cmpl $0xdead2bad, 0xf8(%rax) # imm = 0xDEAD2BAD
jne 0x5627b
movl $0xffffffe8, -0x4(%rbp) # imm = 0xFFFFFFE8
jmp 0x56415
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0x55d10
movl %eax, -0x30(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x30(%rbp)
movb %al, -0x3d(%rbp)
jbe 0x562d2
movq -0x38(%rbp), %rax
movzbl (%rax), %ecx
xorl %eax, %eax
cmpl $0xc0, %ecx
movb %al, -0x3d(%rbp)
jge 0x562d2
callq 0xd1f0
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
movb %al, -0x3d(%rbp)
movb -0x3d(%rbp), %al
testb $0x1, %al
jne 0x562db
jmp 0x562f2
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x5628f
jmp 0x562f4
xorl %eax, %eax
cmpl $0x0, -0x30(%rbp)
movb %al, -0x3e(%rbp)
jbe 0x56349
movq -0x38(%rbp), %rax
movl -0x30(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0xc0, %ecx
movb %al, -0x3e(%rbp)
jge 0x56349
callq 0xd1f0
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movl -0x30(%rbp), %edx
subl $0x1, %edx
movl %edx, %edx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
movb %al, -0x3e(%rbp)
movb -0x3e(%rbp), %al
testb $0x1, %al
jne 0x56352
jmp 0x5635d
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x562f4
cmpl $0x1, -0x30(%rbp)
jae 0x5636f
movl $0xfffffff7, -0x4(%rbp) # imm = 0xFFFFFFF7
jmp 0x56415
cmpq $0x0, -0x20(%rbp)
jne 0x56382
movl $0xfffffff7, -0x4(%rbp) # imm = 0xFFFFFFF7
jmp 0x56415
movq -0x10(%rbp), %rax
cmpq $0x0, 0xc0(%rax)
je 0x563a8
movq 0x984e1(%rip), %rax     # 0xee878
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0xc0(%rcx), %rdi
callq *%rax
cmpl $0x1, 0x984d9(%rip)     # 0xee888
jbe 0x563ca
movq -0x10(%rbp), %rax
cmpl $0xdead2bad, 0xf8(%rax) # imm = 0xDEAD2BAD
jne 0x563ca
movl $0xfffffff6, -0x4(%rbp) # imm = 0xFFFFFFF6
jmp 0x56415
movq -0x10(%rbp), %rax
movq 0xe0(%rax), %rdi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
leaq -0x38(%rbp), %rsi
callq 0x56420
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0xc0(%rax)
je 0x5640f
movq 0x9847a(%rip), %rax     # 0xee878
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0xc0(%rcx), %rdi
callq *%rax
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop