// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9_create_constant
JX9_PRIVATE int jx9_create_constant(jx9_vm *pVm, const char *zName, void (*xExpand)(jx9_value *, void *), void *pUserData)
{
	SyString sName;
	int rc;
	/* Ticket 1433-002: NULL VM is harmless operation */
	if ( JX9_VM_MISUSE(pVm) ){
		return JX9_CORRUPT;
	}
	SyStringInitFromBuf(&sName, zName, SyStrlen(zName));
	/* Remove leading and trailing white spaces */
	SyStringFullTrim(&sName);
	if( sName.nByte < 1 ){
		/* Empty constant name */
		return JX9_CORRUPT;
	}
	/* TICKET 1433-003: NULL pointer is harmless operation */
	if( xExpand == 0 ){
		return JX9_CORRUPT;
	}
#if defined(JX9_ENABLE_THREADS)
	 /* Acquire VM mutex */
	 SyMutexEnter(sJx9MPGlobal.pMutexMethods, pVm->pMutex); /* NO-OP if sJx9MPGlobal.nThreadingLevel != JX9_THREAD_LEVEL_MULTI */
	 if( sJx9MPGlobal.nThreadingLevel > JX9_THREAD_LEVEL_SINGLE && 
		 JX9_THRD_VM_RELEASE(pVm) ){
			 return JX9_ABORT; /* Another thread have released this instance */
	 }
#endif
	/* Perform the registration */
	rc = jx9VmRegisterConstant(&(*pVm), &sName, xExpand, pUserData);
#if defined(JX9_ENABLE_THREADS)
	 /* Leave VM mutex */
	 SyMutexLeave(sJx9MPGlobal.pMutexMethods, pVm->pMutex); /* NO-OP if sJx9MPGlobal.nThreadingLevel != JX9_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 0x8eadf
movq -0x10(%rbp), %rax
cmpl $0xdead2bad, 0x6e8(%rax) # imm = 0xDEAD2BAD
jne 0x8eaeb
movl $0xffffffe8, -0x4(%rbp) # imm = 0xFFFFFFE8
jmp 0x8ec7e
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 0x8eb42
movq -0x38(%rbp), %rax
movzbl (%rax), %ecx
xorl %eax, %eax
cmpl $0xc0, %ecx
movb %al, -0x3d(%rbp)
jge 0x8eb42
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 0x8eb4b
jmp 0x8eb62
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x8eaff
jmp 0x8eb64
xorl %eax, %eax
cmpl $0x0, -0x30(%rbp)
movb %al, -0x3e(%rbp)
jbe 0x8ebb9
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 0x8ebb9
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 0x8ebc2
jmp 0x8ebcd
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x8eb64
cmpl $0x1, -0x30(%rbp)
jae 0x8ebdf
movl $0xffffffe8, -0x4(%rbp) # imm = 0xFFFFFFE8
jmp 0x8ec7e
cmpq $0x0, -0x20(%rbp)
jne 0x8ebf2
movl $0xffffffe8, -0x4(%rbp) # imm = 0xFFFFFFE8
jmp 0x8ec7e
movq -0x10(%rbp), %rax
cmpq $0x0, 0xb8(%rax)
je 0x8ec18
movq 0x60891(%rip), %rax     # 0xef498
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0xb8(%rcx), %rdi
callq *%rax
cmpl $0x1, 0x60889(%rip)     # 0xef4a8
jbe 0x8ec3a
movq -0x10(%rbp), %rax
cmpl $0xdead2bad, 0x6e8(%rax) # imm = 0xDEAD2BAD
jne 0x8ec3a
movl $0xfffffff6, -0x4(%rbp) # imm = 0xFFFFFFF6
jmp 0x8ec7e
movq -0x10(%rbp), %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, 0xb8(%rax)
je 0x8ec78
movq 0x60831(%rip), %rax     # 0xef498
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0xb8(%rcx), %rdi
callq *%rax
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)