// File: /workspace/github_c_makefile_star2_O1/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 0x59c20
movq (%rdx), %r14
testb $0x2, 0x8(%r14)
je 0x59c11
movq %r14, %rdi
callq 0x3fd5f
movq (%r14), %rax
leaq -0x48(%rbp), %rdi
movq %rax, (%rdi)
callq 0xc770
testq %rax, %rax
jne 0x59c1a
leaq -0x48(%rbp), %rdi
callq 0xc820
leaq -0x48(%rbp), %rdi
jmp 0x59c2f
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 0x317a5
testq %rax, %rax
je 0x59f2a
movq %rax, %r14
movl %r15d, -0x50(%rbp)
movq %rbx, %rdi
callq 0x317eb
testq %rax, %rax
je 0x59f2a
movq %rax, %r15
movq %rbx, -0x58(%rbp)
addl $0x76c, %r12d           # imm = 0x76C
movl %r12d, -0x4c(%rbp)
movq %r14, %rdi
callq 0x309f2
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 0x1f2c5(%rip), %rsi     # 0x78f87
movq %r15, %rdi
movq %r14, %rdx
callq 0x3106a
movq %r14, %rdi
callq 0x309f2
movslq -0x2c(%rbp), %rax
movq %rax, (%r14)
movl 0x8(%r14), %eax
andl %r13d, %eax
orl $0x2, %eax
movl %eax, 0x8(%r14)
leaq 0x1f29e(%rip), %rsi     # 0x78f8f
movq %r15, %rdi
movq %r14, %rdx
callq 0x3106a
movq %r14, %rdi
callq 0x309f2
movslq -0x30(%rbp), %rax
movq %rax, (%r14)
movl 0x8(%r14), %eax
andl %r13d, %eax
orl $0x2, %eax
movl %eax, 0x8(%r14)
leaq 0x1f277(%rip), %rsi     # 0x78f97
movq %r15, %rdi
movq %r14, %rdx
callq 0x3106a
movq %r14, %rdi
callq 0x309f2
movslq -0x34(%rbp), %rax
movq %rax, (%r14)
movl 0x8(%r14), %eax
andl %r13d, %eax
orl $0x2, %eax
movl %eax, 0x8(%r14)
leaq 0x1f3cb(%rip), %rsi     # 0x7911a
movq %r15, %rdi
movq %r14, %rdx
callq 0x3106a
movq %r14, %rdi
callq 0x309f2
movslq -0x38(%rbp), %r12
movq %r12, (%r14)
movl 0x8(%r14), %eax
andl %r13d, %eax
orl $0x2, %eax
movl %eax, 0x8(%r14)
leaq 0x1f3b3(%rip), %rsi     # 0x79131
movq %r15, %rdi
movq %r14, %rdx
callq 0x3106a
movq -0x40(%rbp), %rax
leal 0x1(%rax), %ebx
movq %r14, %rdi
callq 0x309f2
movslq %ebx, %rax
movq %rax, (%r14)
movl 0x8(%r14), %eax
andl %r13d, %eax
orl $0x2, %eax
movl %eax, 0x8(%r14)
leaq 0x1f36f(%rip), %rsi     # 0x79122
movq %r15, %rdi
movq %r14, %rdx
callq 0x3106a
movq %r14, %rdi
callq 0x309f2
movslq -0x4c(%rbp), %rax
movq %rax, (%r14)
movl 0x8(%r14), %eax
andl %r13d, %eax
orl $0x2, %eax
movl %eax, 0x8(%r14)
leaq 0x1f347(%rip), %rsi     # 0x79129
movq %r15, %rdi
movq %r14, %rdx
callq 0x3106a
movq %r14, %rdi
callq 0x309f2
movslq -0x50(%rbp), %rax
movq %rax, (%r14)
movl 0x8(%r14), %eax
andl %r13d, %eax
orl $0x2, %eax
movl %eax, 0x8(%r14)
leaq 0x1f328(%rip), %rsi     # 0x79139
movq %r15, %rdi
movq %r14, %rdx
callq 0x3106a
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 0x3b087(%rip), %rcx     # 0x94ed0
movq (%rcx,%rax,8), %rsi
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3087c
leaq 0x1f13c(%rip), %rsi     # 0x78f9d
movq %r15, %rdi
movq %r14, %rdx
callq 0x3106a
movl $0x0, 0x28(%r14)
movl 0x30(%r14), %eax
testb $0x4, %al
je 0x59e93
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 0x3b050(%rip), %rcx     # 0x94f10
movq (%rcx,%rax,8), %rsi
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3087c
leaq 0x1f0cd(%rip), %rsi     # 0x78fa5
movq %r15, %rdi
movq %r14, %rdx
callq 0x3106a
xorl %edi, %edi
callq 0xc820
movq %rax, %r12
movq %r14, %rdi
callq 0x309f2
movq %r12, (%r14)
andl 0x8(%r14), %r13d
orl $0x2, %r13d
movl %r13d, 0x8(%r14)
testb $0x40, 0x8(%r15)
movq -0x58(%rbp), %rbx
je 0x59f1c
movq (%r15), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3f924
movq 0x8(%rbx), %rsi
movq %r15, %rdi
callq 0x3ebc8
jmp 0x59f33
movq 0x8(%rbx), %rdi
callq 0x309f2
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq