// File: /workspace/github_c_makefile_star2_O2/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 $0x28, %rsp
movq %rdi, %r12
testl %esi, %esi
jle 0x4c33f
movq (%rdx), %rdi
testb $0x2, 0x8(%rdi)
je 0x4c330
callq 0x297ae
leaq -0x40(%rbp), %rdi
movq %rax, (%rdi)
callq 0xc7a0
testq %rax, %rax
jne 0x4c339
leaq -0x40(%rbp), %rdi
callq 0xc850
leaq -0x40(%rbp), %rdi
jmp 0x4c34e
leaq -0x40(%rbp), %rbx
movq %rbx, %rdi
callq 0xc850
movq %rbx, %rdi
callq 0xc7a0
movl 0x8(%rax), %ecx
movl %ecx, -0x2c(%rbp)
movl (%rax), %ebx
movl 0x4(%rax), %r13d
movl 0x10(%rax), %ecx
movq %rcx, -0x48(%rbp)
movl 0xc(%rax), %ecx
movl %ecx, -0x30(%rbp)
movl 0x14(%rax), %r14d
movl 0x1c(%rax), %ecx
movl %ecx, -0x34(%rbp)
movl 0x18(%rax), %eax
movl %eax, -0x38(%rbp)
movq %r12, %rdi
callq 0x2a26a
testq %rax, %rax
je 0x4c541
movq %rax, %r15
movq %r12, %rdi
callq 0x2a2b0
movq %r12, %rdi
testq %rax, %rax
je 0x4c544
movq %rax, %r12
addl $0x76c, %r14d           # imm = 0x76C
movq %rdi, -0x50(%rbp)
movq %r15, %rdi
movl %ebx, %esi
callq 0x29489
leaq 0x1abaf(%rip), %rsi     # 0x66f72
movq %r12, %rdi
movq %r15, %rdx
callq 0x29c6c
movq %r15, %rdi
movl %r13d, %esi
callq 0x29489
leaq 0x1ab9a(%rip), %rsi     # 0x66f7a
movq %r12, %rdi
movq %r15, %rdx
callq 0x29c6c
movq %r15, %rdi
movl -0x2c(%rbp), %esi
callq 0x29489
leaq 0x1ab85(%rip), %rsi     # 0x66f82
movq %r12, %rdi
movq %r15, %rdx
callq 0x29c6c
movq %r15, %rdi
movl -0x30(%rbp), %esi
callq 0x29489
leaq 0x1aceb(%rip), %rsi     # 0x67105
movq %r12, %rdi
movq %r15, %rdx
callq 0x29c6c
movq %r15, %rdi
movl -0x38(%rbp), %ebx
movl %ebx, %esi
callq 0x29489
leaq 0x1ace3(%rip), %rsi     # 0x6711c
movq %r12, %rdi
movq %r15, %rdx
callq 0x29c6c
movq -0x48(%rbp), %r13
leal 0x1(%r13), %esi
movq %r15, %rdi
callq 0x29489
leaq 0x1acb2(%rip), %rsi     # 0x6710d
movq %r12, %rdi
movq %r15, %rdx
callq 0x29c6c
movq %r15, %rdi
movl %r14d, %esi
callq 0x29489
leaq 0x1ac9c(%rip), %rsi     # 0x67114
movq %r12, %rdi
movq %r15, %rdx
callq 0x29c6c
movq %r15, %rdi
movl -0x34(%rbp), %esi
callq 0x29489
leaq 0x1ac8f(%rip), %rsi     # 0x67124
movq %r12, %rdi
movq %r15, %rdx
callq 0x29c6c
pushq $0x7
popq %rcx
movl %ebx, %eax
cltd
idivl %ecx
movslq %edx, %rax
leaq 0x39a2e(%rip), %rcx     # 0x85ee0
movq (%rcx,%rax,8), %rsi
pushq $-0x1
popq %rbx
movq %r15, %rdi
movl %ebx, %edx
callq 0x29588
leaq 0x1aabe(%rip), %rsi     # 0x66f88
movq %r12, %rdi
movq %r15, %rdx
callq 0x29c6c
movq %r15, %rdi
addq $0x18, %rdi
callq 0x31b1e
pushq $0xc
popq %rcx
movl %r13d, %eax
cltd
idivl %ecx
movslq %edx, %rax
leaq 0x39a2c(%rip), %rcx     # 0x85f20
movq (%rcx,%rax,8), %rsi
movq %r15, %rdi
movl %ebx, %edx
callq 0x29588
leaq 0x1aa87(%rip), %rsi     # 0x66f90
movq %r12, %rdi
movq %r15, %rdx
callq 0x29c6c
xorl %edi, %edi
callq 0xc850
movq %r15, %rdi
movq %rax, %rsi
callq 0x294c2
movq %r12, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x29c4b
movq -0x50(%rbp), %rdi
movq %r12, %rsi
callq 0x299d3
jmp 0x4c549
movq %r12, %rdi
callq 0x298e8
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq