// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9Builtin_base_convert
static int jx9Builtin_base_convert(jx9_context *pCtx, int nArg, jx9_value **apArg)
{
	int nLen, iFbase, iTobase;
	const char *zNum;
	jx9_int64 iNum;
	if( nArg < 3 ){
		/* Return the empty string*/
		jx9_result_string(pCtx, "", 0);
		return JX9_OK;
	}
	/* Base numbers */
	iFbase  = jx9_value_to_int(apArg[1]);
	iTobase = jx9_value_to_int(apArg[2]);
	if( jx9_value_is_string(apArg[0]) ){
		/* Extract the target number */
		zNum = jx9_value_to_string(apArg[0], &nLen);
		if( nLen < 1 ){
			/* Return the empty string*/
			jx9_result_string(pCtx, "", 0);
			return JX9_OK;
		}
		/* Base conversion */
		switch(iFbase){
		case 16:
			/* Hex */
			SyHexStrToInt64(zNum, (sxu32)nLen, (void *)&iNum, 0);
			break;
		case 8:
			/* Octal */
			SyOctalStrToInt64(zNum, (sxu32)nLen, (void *)&iNum, 0);
			break;
		case 2:
			/* Binary */
			SyBinaryStrToInt64(zNum, (sxu32)nLen, (void *)&iNum, 0);
			break;
		default:
			/* Decimal */
			SyStrToInt64(zNum, (sxu32)nLen, (void *)&iNum, 0);
			break;
		}
	}else{
		iNum = jx9_value_to_int64(apArg[0]);
	}
	switch(iTobase){
	case 16:
		/* Hex */
		jx9_result_string_format(pCtx, "%qx", iNum); /* Quad hex */
		break;
	case 8:
		/* Octal */
		jx9_result_string_format(pCtx, "%qo", iNum); /* Quad octal */
		break;
	case 2:
		/* Binary */
		jx9_result_string_format(pCtx, "%qB", iNum); /* Quad binary */
		break;
	default:
		/* Decimal */
		jx9_result_string_format(pCtx, "%qd", iNum); /* Quad decimal */
		break;
	}
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
cmpl $0x3, -0x14(%rbp)
jge 0x91947
movq -0x10(%rbp), %rdi
leaq 0x34217(%rip), %rsi     # 0xc5b4b
xorl %edx, %edx
callq 0x57180
movl $0x0, -0x4(%rbp)
jmp 0x91ac3
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x56c90
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x56c90
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x57480
cmpl $0x0, %eax
je 0x91a2d
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq -0x24(%rbp), %rsi
callq 0x56e20
movq %rax, -0x38(%rbp)
cmpl $0x1, -0x24(%rbp)
jge 0x919b4
movq -0x10(%rbp), %rdi
leaq 0x341aa(%rip), %rsi     # 0xc5b4b
xorl %edx, %edx
callq 0x57180
movl $0x0, -0x4(%rbp)
jmp 0x91ac3
movl -0x28(%rbp), %eax
movl %eax, -0x44(%rbp)
subl $0x2, %eax
je 0x91a01
jmp 0x919c1
movl -0x44(%rbp), %eax
subl $0x8, %eax
je 0x919eb
jmp 0x919cb
movl -0x44(%rbp), %eax
subl $0x10, %eax
jne 0x91a17
jmp 0x919d5
movq -0x38(%rbp), %rdi
movl -0x24(%rbp), %esi
leaq -0x40(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x71220
jmp 0x91a2b
movq -0x38(%rbp), %rdi
movl -0x24(%rbp), %esi
leaq -0x40(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x71960
jmp 0x91a2b
movq -0x38(%rbp), %rdi
movl -0x24(%rbp), %esi
leaq -0x40(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x715e0
jmp 0x91a2b
movq -0x38(%rbp), %rdi
movl -0x24(%rbp), %esi
leaq -0x40(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x71ce0
jmp 0x91a3d
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x56d50
movq %rax, -0x40(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x48(%rbp)
subl $0x2, %eax
je 0x91a8e
jmp 0x91a4a
movl -0x48(%rbp), %eax
subl $0x8, %eax
je 0x91a76
jmp 0x91a54
movl -0x48(%rbp), %eax
subl $0x10, %eax
jne 0x91aa6
jmp 0x91a5e
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rdx
leaq 0x3394f(%rip), %rsi     # 0xc53bc
movb $0x0, %al
callq 0x794a0
jmp 0x91abc
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rdx
leaq 0x3393b(%rip), %rsi     # 0xc53c0
movb $0x0, %al
callq 0x794a0
jmp 0x91abc
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rdx
leaq 0x33927(%rip), %rsi     # 0xc53c4
movb $0x0, %al
callq 0x794a0
jmp 0x91abc
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rdx
leaq 0x30af7(%rip), %rsi     # 0xc25ac
movb $0x0, %al
callq 0x794a0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)