// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9Builtin_localtime
static int jx9Builtin_localtime(jx9_context *pCtx, int nArg, jx9_value **apArg)
{
	jx9_value *pValue, *pArray;
	int isAssoc = 0;
	Sytm sTm;
	if( nArg < 1 ){
#ifdef __WINNT__
		SYSTEMTIME sOS;
		GetSystemTime(&sOS); /* TODO(chems): GMT not local */
		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;
		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;
	}
	if( nArg > 1 ){
		isAssoc = jx9_value_to_bool(apArg[1]); 
	}
	/* Fill the array */
	/* Seconds */
	jx9_value_int(pValue, sTm.tm_sec);
	if( isAssoc ){
		jx9_array_add_strkey_elem(pArray, "tm_sec", pValue);
	}else{
		jx9_array_add_elem(pArray, 0/* Automatic index */, pValue);
	}
	/* Minutes */
	jx9_value_int(pValue, sTm.tm_min);
	if( isAssoc ){
		jx9_array_add_strkey_elem(pArray, "tm_min", pValue);
	}else{
		jx9_array_add_elem(pArray, 0/* Automatic index */, pValue);
	}
	/* Hours */
	jx9_value_int(pValue, sTm.tm_hour);
	if( isAssoc ){
		jx9_array_add_strkey_elem(pArray, "tm_hour", pValue);
	}else{
		jx9_array_add_elem(pArray, 0/* Automatic index */, pValue);
	}
	/* mday */
	jx9_value_int(pValue, sTm.tm_mday);
	if( isAssoc ){
		jx9_array_add_strkey_elem(pArray, "tm_mday", pValue);
	}else{
		jx9_array_add_elem(pArray, 0/* Automatic index */, pValue);
	}
	/* mon */
	jx9_value_int(pValue, sTm.tm_mon);
	if( isAssoc ){
		jx9_array_add_strkey_elem(pArray, "tm_mon", pValue);
	}else{
		jx9_array_add_elem(pArray, 0/* Automatic index */, pValue);
	}
	/* year since 1900 */
	jx9_value_int(pValue, sTm.tm_year-1900);
	if( isAssoc ){
		jx9_array_add_strkey_elem(pArray, "tm_year", pValue);
	}else{
		jx9_array_add_elem(pArray, 0/* Automatic index */, pValue);
	}
	/* wday */
	jx9_value_int(pValue, sTm.tm_wday);
	if( isAssoc ){
		jx9_array_add_strkey_elem(pArray, "tm_wday", pValue);
	}else{
		jx9_array_add_elem(pArray, 0/* Automatic index */, pValue);
	}
	/* yday */
	jx9_value_int(pValue, sTm.tm_yday);
	if( isAssoc ){
		jx9_array_add_strkey_elem(pArray, "tm_yday", pValue);
	}else{
		jx9_array_add_elem(pArray, 0/* Automatic index */, pValue);
	}
	/* isdst */
#ifdef __WINNT__
#ifdef _MSC_VER
#ifndef _WIN32_WCE
			_get_daylight(&sTm.tm_isdst);
#endif
#endif
#endif
	jx9_value_int(pValue, sTm.tm_isdst);
	if( isAssoc ){
		jx9_array_add_strkey_elem(pArray, "tm_isdst", pValue);
	}else{
		jx9_array_add_elem(pArray, 0/* Automatic index */, pValue);
	}
	/* Return the array */
	jx9_result_value(pCtx, pArray);
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x34(%rbp)
cmpl $0x1, -0x14(%rbp)
jge 0x98620
leaq -0x80(%rbp), %rdi
callq 0xd980
leaq -0x80(%rbp), %rdi
callq 0xd8b0
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x68(%rbp)
movq -0x78(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x6c(%rbp)
movq -0x78(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x70(%rbp)
movq -0x78(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x60(%rbp)
movq -0x78(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x78(%rbp), %rax
movl 0x14(%rax), %eax
addl $0x76c, %eax            # imm = 0x76C
movl %eax, -0x5c(%rbp)
movq -0x78(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x54(%rbp)
movq -0x78(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x58(%rbp)
movq -0x78(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
jmp 0x98717
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x57390
cmpl $0x0, %eax
je 0x9866f
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x56d50
movq %rax, -0x88(%rbp)
leaq -0x88(%rbp), %rdi
callq 0xd8b0
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x90(%rbp)
jne 0x9866d
leaq -0x88(%rbp), %rdi
callq 0xd980
jmp 0x9867b
leaq -0x88(%rbp), %rdi
callq 0xd980
leaq -0x88(%rbp), %rdi
callq 0xd8b0
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x68(%rbp)
movq -0x90(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x6c(%rbp)
movq -0x90(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x70(%rbp)
movq -0x90(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x60(%rbp)
movq -0x90(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x90(%rbp), %rax
movl 0x14(%rax), %eax
addl $0x76c, %eax            # imm = 0x76C
movl %eax, -0x5c(%rbp)
movq -0x90(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x54(%rbp)
movq -0x90(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x58(%rbp)
movq -0x90(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x10(%rbp), %rdi
callq 0x58510
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x98740
movq -0x10(%rbp), %rdi
callq 0x57120
movl $0x0, -0x4(%rbp)
jmp 0x9899a
movq -0x10(%rbp), %rdi
callq 0x58570
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x98769
movq -0x10(%rbp), %rdi
callq 0x57120
movl $0x0, -0x4(%rbp)
jmp 0x9899a
cmpl $0x1, -0x14(%rbp)
jle 0x9877f
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x56cf0
movl %eax, -0x34(%rbp)
movq -0x28(%rbp), %rdi
movl -0x70(%rbp), %esi
callq 0x56700
cmpl $0x0, -0x34(%rbp)
je 0x987a7
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x2ce45(%rip), %rsi     # 0xc55e5
callq 0x579b0
jmp 0x987b8
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x57920
movq -0x28(%rbp), %rdi
movl -0x6c(%rbp), %esi
callq 0x56700
cmpl $0x0, -0x34(%rbp)
je 0x987e0
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x2ce13(%rip), %rsi     # 0xc55ec
callq 0x579b0
jmp 0x987f1
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x57920
movq -0x28(%rbp), %rdi
movl -0x68(%rbp), %esi
callq 0x56700
cmpl $0x0, -0x34(%rbp)
je 0x98819
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x2cde1(%rip), %rsi     # 0xc55f3
callq 0x579b0
jmp 0x9882a
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x57920
movq -0x28(%rbp), %rdi
movl -0x64(%rbp), %esi
callq 0x56700
cmpl $0x0, -0x34(%rbp)
je 0x98852
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x2cdb0(%rip), %rsi     # 0xc55fb
callq 0x579b0
jmp 0x98863
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x57920
movq -0x28(%rbp), %rdi
movl -0x60(%rbp), %esi
callq 0x56700
cmpl $0x0, -0x34(%rbp)
je 0x9888b
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x2cd7f(%rip), %rsi     # 0xc5603
callq 0x579b0
jmp 0x9889c
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x57920
movq -0x28(%rbp), %rdi
movl -0x5c(%rbp), %esi
subl $0x76c, %esi            # imm = 0x76C
callq 0x56700
cmpl $0x0, -0x34(%rbp)
je 0x988ca
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x2cd47(%rip), %rsi     # 0xc560a
callq 0x579b0
jmp 0x988db
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x57920
movq -0x28(%rbp), %rdi
movl -0x58(%rbp), %esi
callq 0x56700
cmpl $0x0, -0x34(%rbp)
je 0x98903
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x2cd16(%rip), %rsi     # 0xc5612
callq 0x579b0
jmp 0x98914
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x57920
movq -0x28(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x56700
cmpl $0x0, -0x34(%rbp)
je 0x9893c
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x2cce5(%rip), %rsi     # 0xc561a
callq 0x579b0
jmp 0x9894d
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x57920
movq -0x28(%rbp), %rdi
movl -0x50(%rbp), %esi
callq 0x56700
cmpl $0x0, -0x34(%rbp)
je 0x98975
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x2ccb4(%rip), %rsi     # 0xc5622
callq 0x579b0
jmp 0x98986
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x57920
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x572c0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)