// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9Builtin_getdate
static int jx9Builtin_getdate(jx9_context *pCtx, int nArg, jx9_value **apArg)
{
	jx9_value *pValue, *pArray;
	Sytm sTm;
	if( nArg < 1 ){
#ifdef __WINNT__
		SYSTEMTIME sOS;
		GetSystemTime(&sOS);
		SYSTEMTIME_TO_SYTM(&sOS, &sTm);
#else
		struct tm *pTm;
		time_t t;
		time(&t);
		pTm = localtime(&t);
		STRUCT_TM_TO_SYTM(pTm, &sTm);
#endif
	}else{
		/* Use the given timestamp */
		time_t t;
		struct tm *pTm;
#ifdef __WINNT__
#ifdef _MSC_VER
#if _MSC_VER >= 1400 /* Visual Studio 2005 and up */
#pragma warning(disable:4996) /* _CRT_SECURE...*/
#endif
#endif
#endif
		if( jx9_value_is_int(apArg[0]) ){
			t = (time_t)jx9_value_to_int64(apArg[0]);
			pTm = localtime(&t);
			if( pTm == 0 ){
				time(&t);
			}
		}else{
			time(&t);
		}
		pTm = localtime(&t);
		STRUCT_TM_TO_SYTM(pTm, &sTm);
	}
	/* Element value */
	pValue = jx9_context_new_scalar(pCtx);
	if( pValue == 0 ){
		/* Return NULL */
		jx9_result_null(pCtx);
		return JX9_OK;
	}
	/* Create a new array */
	pArray = jx9_context_new_array(pCtx);
	if( pArray == 0 ){
		/* Return NULL */
		jx9_result_null(pCtx);
		return JX9_OK;
	}
	/* Fill the array */
	/* Seconds */
	jx9_value_int(pValue, sTm.tm_sec);
	jx9_array_add_strkey_elem(pArray, "seconds", pValue);
	/* Minutes */
	jx9_value_int(pValue, sTm.tm_min);
	jx9_array_add_strkey_elem(pArray, "minutes", pValue);
	/* Hours */
	jx9_value_int(pValue, sTm.tm_hour);
	jx9_array_add_strkey_elem(pArray, "hours", pValue);
	/* mday */
	jx9_value_int(pValue, sTm.tm_mday);
	jx9_array_add_strkey_elem(pArray, "mday", pValue);
	/* wday */
	jx9_value_int(pValue, sTm.tm_wday);
	jx9_array_add_strkey_elem(pArray, "wday", pValue);
	/* mon */
	jx9_value_int(pValue, sTm.tm_mon+1);
	jx9_array_add_strkey_elem(pArray, "mon", pValue);
	/* year */
	jx9_value_int(pValue, sTm.tm_year);
	jx9_array_add_strkey_elem(pArray, "year", pValue);
	/* yday */
	jx9_value_int(pValue, sTm.tm_yday);
	jx9_array_add_strkey_elem(pArray, "yday", pValue);
	/* Weekday */
	jx9_value_string(pValue, SyTimeGetDay(sTm.tm_wday), -1);
	jx9_array_add_strkey_elem(pArray, "weekday", pValue);
	/* Month */
	jx9_value_reset_string_cursor(pValue);
	jx9_value_string(pValue, SyTimeGetMonth(sTm.tm_mon), -1);
	jx9_array_add_strkey_elem(pArray, "month", pValue);
	/* Seconds since the epoch */
	jx9_value_int64(pValue, (jx9_int64)time(0));
	jx9_array_add_elem(pArray, 0 /* Index zero */, pValue);
	/* Return the freshly created array */
	jx9_result_value(pCtx, pArray);
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
testl %esi, %esi
jle 0x58464
movq (%rdx), %r14
testb $0x2, 0x8(%r14)
je 0x58455
movq %r14, %rdi
callq 0x3f362
movq (%r14), %rax
leaq -0x48(%rbp), %rdi
movq %rax, (%rdi)
callq 0xc770
testq %rax, %rax
jne 0x5845e
leaq -0x48(%rbp), %rdi
callq 0xc820
leaq -0x48(%rbp), %rdi
jmp 0x58473
leaq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0xc820
movq %r14, %rdi
callq 0xc770
movl 0x8(%rax), %ecx
movl %ecx, -0x30(%rbp)
movl (%rax), %r13d
movl 0x4(%rax), %ecx
movl %ecx, -0x2c(%rbp)
movl 0x10(%rax), %ecx
movq %rcx, -0x40(%rbp)
movl 0xc(%rax), %ecx
movl %ecx, -0x34(%rbp)
movl 0x14(%rax), %r12d
movl 0x1c(%rax), %r15d
movl 0x18(%rax), %eax
movl %eax, -0x38(%rbp)
movq %rbx, %rdi
callq 0x311eb
testq %rax, %rax
je 0x5876e
movq %rax, %r14
movl %r15d, -0x50(%rbp)
movq %rbx, %rdi
callq 0x31231
testq %rax, %rax
je 0x5876e
movq %rax, %r15
movq %rbx, -0x58(%rbp)
addl $0x76c, %r12d           # imm = 0x76C
movl %r12d, -0x4c(%rbp)
movq %r14, %rdi
callq 0x30465
movslq %r13d, %rax
movq %rax, (%r14)
movl $0xfffffe90, %r13d      # imm = 0xFFFFFE90
movl 0x8(%r14), %eax
andl %r13d, %eax
orl $0x2, %eax
movl %eax, 0x8(%r14)
leaq 0x1ea8c(%rip), %rsi     # 0x76f92
movq %r15, %rdi
movq %r14, %rdx
callq 0x30ad3
movq %r14, %rdi
callq 0x30465
movslq -0x2c(%rbp), %rax
movq %rax, (%r14)
movl 0x8(%r14), %eax
andl %r13d, %eax
orl $0x2, %eax
movl %eax, 0x8(%r14)
leaq 0x1ea65(%rip), %rsi     # 0x76f9a
movq %r15, %rdi
movq %r14, %rdx
callq 0x30ad3
movq %r14, %rdi
callq 0x30465
movslq -0x30(%rbp), %rax
movq %rax, (%r14)
movl 0x8(%r14), %eax
andl %r13d, %eax
orl $0x2, %eax
movl %eax, 0x8(%r14)
leaq 0x1ea3e(%rip), %rsi     # 0x76fa2
movq %r15, %rdi
movq %r14, %rdx
callq 0x30ad3
movq %r14, %rdi
callq 0x30465
movslq -0x34(%rbp), %rax
movq %rax, (%r14)
movl 0x8(%r14), %eax
andl %r13d, %eax
orl $0x2, %eax
movl %eax, 0x8(%r14)
leaq 0x1eb92(%rip), %rsi     # 0x77125
movq %r15, %rdi
movq %r14, %rdx
callq 0x30ad3
movq %r14, %rdi
callq 0x30465
movslq -0x38(%rbp), %r12
movq %r12, (%r14)
movl 0x8(%r14), %eax
andl %r13d, %eax
orl $0x2, %eax
movl %eax, 0x8(%r14)
leaq 0x1eb7a(%rip), %rsi     # 0x7713c
movq %r15, %rdi
movq %r14, %rdx
callq 0x30ad3
movq -0x40(%rbp), %rax
leal 0x1(%rax), %ebx
movq %r14, %rdi
callq 0x30465
movslq %ebx, %rax
movq %rax, (%r14)
movl 0x8(%r14), %eax
andl %r13d, %eax
orl $0x2, %eax
movl %eax, 0x8(%r14)
leaq 0x1eb36(%rip), %rsi     # 0x7712d
movq %r15, %rdi
movq %r14, %rdx
callq 0x30ad3
movq %r14, %rdi
callq 0x30465
movslq -0x4c(%rbp), %rax
movq %rax, (%r14)
movl 0x8(%r14), %eax
andl %r13d, %eax
orl $0x2, %eax
movl %eax, 0x8(%r14)
leaq 0x1eb0e(%rip), %rsi     # 0x77134
movq %r15, %rdi
movq %r14, %rdx
callq 0x30ad3
movq %r14, %rdi
callq 0x30465
movslq -0x50(%rbp), %rax
movq %rax, (%r14)
movl 0x8(%r14), %eax
andl %r13d, %eax
orl $0x2, %eax
movl %eax, 0x8(%r14)
leaq 0x1eaef(%rip), %rsi     # 0x77144
movq %r15, %rdi
movq %r14, %rdx
callq 0x30ad3
imulq $-0x6db6db6d, %r12, %rax # imm = 0x92492493
shrq $0x20, %rax
addl %r12d, %eax
movl %eax, %ecx
shrl $0x1f, %ecx
sarl $0x2, %eax
addl %ecx, %eax
leal (,%rax,8), %ecx
subl %ecx, %eax
addl %r12d, %eax
cltq
leaq 0x3a843(%rip), %rcx     # 0x92ed0
movq (%rcx,%rax,8), %rsi
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x302f6
leaq 0x1e903(%rip), %rsi     # 0x76fa8
movq %r15, %rdi
movq %r14, %rdx
callq 0x30ad3
movl $0x0, 0x28(%r14)
movl 0x30(%r14), %eax
testb $0x4, %al
je 0x586d7
movq $0x0, 0x20(%r14)
movl $0x0, 0x2c(%r14)
andl $-0x5, %eax
movl %eax, 0x30(%r14)
movq -0x40(%rbp), %rdx
movslq %edx, %rax
imulq $0x2aaaaaab, %rax, %rax # imm = 0x2AAAAAAB
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x21, %rax
addl %ecx, %eax
shll $0x2, %eax
leal (%rax,%rax,2), %eax
subl %eax, %edx
movslq %edx, %rax
leaq 0x3a80c(%rip), %rcx     # 0x92f10
movq (%rcx,%rax,8), %rsi
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x302f6
leaq 0x1e894(%rip), %rsi     # 0x76fb0
movq %r15, %rdi
movq %r14, %rdx
callq 0x30ad3
xorl %edi, %edi
callq 0xc820
movq %rax, %r12
movq %r14, %rdi
callq 0x30465
movq %r12, (%r14)
andl 0x8(%r14), %r13d
orl $0x2, %r13d
movl %r13d, 0x8(%r14)
testb $0x40, 0x8(%r15)
movq -0x58(%rbp), %rbx
je 0x58760
movq (%r15), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3ef1d
movq 0x8(%rbx), %rsi
movq %r15, %rdi
callq 0x3e19f
jmp 0x58777
movq 0x8(%rbx), %rdi
callq 0x30465
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq