// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9Builtin_strftime
static int jx9Builtin_strftime(jx9_context *pCtx, int nArg, jx9_value **apArg)
{
	const char *zFormat;
	int nLen;
	Sytm sTm;
	if( nArg < 1 || !jx9_value_is_string(apArg[0]) ){
		/* Missing/Invalid argument, return FALSE */
		jx9_result_bool(pCtx, 0);
		return JX9_OK;
	}
	zFormat = jx9_value_to_string(apArg[0], &nLen);
	if( nLen < 1 ){
		/* Don't bother processing return FALSE */
		jx9_result_bool(pCtx, 0);
	}
	if( nArg < 2 ){
#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;
		if( jx9_value_is_int(apArg[1]) ){
			t = (time_t)jx9_value_to_int64(apArg[1]);
			pTm = localtime(&t);
			if( pTm == 0 ){
				time(&t);
			}
		}else{
			time(&t);
		}
		pTm = localtime(&t);
		STRUCT_TM_TO_SYTM(pTm, &sTm);
	}
	/* Format the given string */
	jx9Strftime(pCtx, zFormat, nLen, &sTm);
	if( jx9_context_result_buf_length(pCtx) < 1 ){
		/* Nothing was formatted, return FALSE */
		jx9_result_bool(pCtx, 0);
	}
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
testl %esi, %esi
jle 0x5a1b9
movq %rdx, %r14
movq (%rdx), %rdi
testb $0x1, 0x8(%rdi)
jne 0x5a1eb
movq 0x8(%rbx), %rbx
movq %rbx, %rdi
callq 0x309f2
movq $0x0, (%rbx)
movl $0xfffffe90, %eax       # imm = 0xFFFFFE90
andl 0x8(%rbx), %eax
orl $0x8, %eax
movl %eax, 0x8(%rbx)
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %esi, %r15d
leaq -0x70(%rbp), %r13
movq %r13, %rsi
callq 0x30b04
movq %rax, %r12
cmpl $0x0, (%r13)
jg 0x5a228
movq 0x8(%rbx), %r13
movq %r13, %rdi
callq 0x309f2
movq $0x0, (%r13)
movl $0xfffffe90, %eax       # imm = 0xFFFFFE90
andl 0x8(%r13), %eax
orl $0x8, %eax
movl %eax, 0x8(%r13)
cmpl $0x1, %r15d
jne 0x5a23f
leaq -0x60(%rbp), %r14
movq %r14, %rdi
callq 0xc820
movq %r14, %rdi
jmp 0x5a273
movq 0x8(%r14), %r14
testb $0x2, 0x8(%r14)
je 0x5a266
movq %r14, %rdi
callq 0x3fd5f
movq (%r14), %rax
leaq -0x60(%rbp), %rdi
movq %rax, (%rdi)
callq 0xc770
testq %rax, %rax
jne 0x5a26f
leaq -0x60(%rbp), %rdi
callq 0xc820
leaq -0x60(%rbp), %rdi
callq 0xc770
movl 0x8(%rax), %edx
movl (%rax), %ecx
movq %rcx, -0x50(%rbp)
movl 0x4(%rax), %ecx
movq %rcx, -0x48(%rbp)
movl 0x10(%rax), %ecx
movl 0xc(%rax), %esi
movl %esi, -0x2c(%rbp)
movl 0x14(%rax), %esi
movl 0x1c(%rax), %edi
movl %edi, -0x54(%rbp)
movl 0x18(%rax), %edi
addl $0x76c, %esi            # imm = 0x76C
movslq -0x70(%rbp), %r15
addq %r12, %r15
leal 0x1(%rcx), %eax
movl %eax, -0x30(%rbp)
movl %esi, -0x3c(%rbp)
movslq %esi, %rsi
imulq $0x51eb851f, %rsi, %r8  # imm = 0x51EB851F
movq %r8, %rax
shrq $0x3f, %rax
shrq $0x20, %r8
sarl $0x5, %r8d
addl %eax, %r8d
movq %r8, -0x98(%rbp)
imull $0x64, %r8d, %eax
subl %eax, %esi
movq %rsi, -0x88(%rbp)
movl %edx, -0x34(%rbp)
movslq %edx, %rax
imulq $0x2aaaaaab, %rax, %rdx # imm = 0x2AAAAAAB
movq %rdx, %rsi
shrq $0x3f, %rsi
shrq $0x21, %rdx
addl %esi, %edx
shll $0x2, %edx
leal (%rdx,%rdx,2), %edx
negl %edx
addl %eax, %edx
incl %edx
movl %edx, -0x38(%rbp)
cmpl $0xd, %eax
leaq 0x1ed30(%rip), %rax     # 0x79046
leaq 0x1ed2c(%rip), %rdx     # 0x79049
cmovgeq %rax, %rdx
movq %rdx, -0x78(%rbp)
leaq 0x1ed17(%rip), %rax     # 0x79043
leaq 0x191bb(%rip), %rdx     # 0x734ee
cmovgeq %rax, %rdx
movq %rdx, -0x90(%rbp)
movslq %ecx, %rax
imulq $0x2aaaaaab, %rax, %rcx # imm = 0x2AAAAAAB
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x21, %rcx
addl %edx, %ecx
shll $0x2, %ecx
leal (%rcx,%rcx,2), %ecx
subl %ecx, %eax
cltq
movq %rax, -0x80(%rbp)
movslq %edi, %rax
imulq $-0x6db6db6d, %rax, %rax # imm = 0x92492493
shrq $0x20, %rax
addl %edi, %eax
movl %eax, %ecx
shrl $0x1f, %ecx
sarl $0x2, %eax
addl %ecx, %eax
leal (,%rax,8), %ecx
subl %ecx, %eax
movl %edi, -0x6c(%rbp)
addl %edi, %eax
cltq
movq %rax, -0x68(%rbp)
leaq 0x1a4b4(%rip), %r14     # 0x7484c
movq %r12, %r13
cmpq %r15, %r12
jae 0x5a3b2
movq %r12, %r13
cmpb $0x25, (%r13)
je 0x5a3b2
incq %r13
cmpq %r15, %r13
jb 0x5a3a3
cmpq %r12, %r13
jbe 0x5a3c9
movl %r13d, %edx
subl %r12d, %edx
movq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0x3087c
leaq 0x1(%r13), %rax
cmpq %r15, %rax
jae 0x5a673
movzbl (%rax), %eax
addl $-0x25, %eax
cmpl $0x55, %eax
ja 0x5a667
movslq (%r14,%rax,4), %rax
addq %r14, %rax
jmpq *%rax
leaq 0x1ecd1(%rip), %rsi     # 0x790c6
movq %rbx, %rdi
movl -0x30(%rbp), %edx
jmp 0x5a5e8
leaq 0x3ab09(%rip), %rax     # 0x94f10
movq -0x80(%rbp), %rcx
jmp 0x5a636
leaq 0x1ec28(%rip), %rsi     # 0x7903f
movq %rbx, %rdi
movl -0x3c(%rbp), %edx
jmp 0x5a5e8
leaq 0x1ec86(%rip), %rsi     # 0x790af
movq %rbx, %rdi
movl -0x30(%rbp), %edx
movl -0x2c(%rbp), %ecx
movq -0x88(%rbp), %r8
jmp 0x5a476
movq 0x8(%rbx), %rdi
leaq 0x18d3e(%rip), %rsi     # 0x73184
jmp 0x5a50f
leaq 0x1ec42(%rip), %rsi     # 0x79094
movq %rbx, %rdi
movq -0x88(%rbp), %rdx
jmp 0x5a5d9
leaq 0x1c142(%rip), %rsi     # 0x765aa
movq %rbx, %rdi
movl -0x34(%rbp), %edx
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %r8
jmp 0x5a53f
leaq 0x1ab0e(%rip), %rax     # 0x74f90
movq -0x68(%rbp), %rcx
movl (%rax,%rcx,4), %edx
leaq 0x19b75(%rip), %rsi     # 0x74005
jmp 0x5a5aa
leaq 0x1ec01(%rip), %rsi     # 0x7909d
movq %rbx, %rdi
movl -0x38(%rbp), %edx
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %r8
movq -0x78(%rbp), %r9
xorl %eax, %eax
callq 0x45c53
jmp 0x5a667
leaq 0x1ec05(%rip), %rsi     # 0x790c6
movq %rbx, %rdi
movq -0x50(%rbp), %rdx
jmp 0x5a5d9
leaq 0x19b31(%rip), %rsi     # 0x74005
movq %rbx, %rdi
movl -0x6c(%rbp), %edx
jmp 0x5a5e8
movq 0x8(%rbx), %rdi
leaq 0x1b36f(%rip), %rsi     # 0x75859
jmp 0x5a65d
leaq 0x3a9da(%rip), %rax     # 0x94ed0
movq -0x68(%rbp), %rcx
jmp 0x5a507
leaq 0x3aa0d(%rip), %rax     # 0x94f10
movq -0x80(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq 0x8(%rbx), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
jmp 0x5a662
leaq 0x1eba6(%rip), %rsi     # 0x790c6
movq %rbx, %rdi
movl -0x34(%rbp), %edx
jmp 0x5a5e8
leaq 0x1eb8c(%rip), %rsi     # 0x790be
movq %rbx, %rdi
movl -0x3c(%rbp), %edx
movl -0x30(%rbp), %ecx
movl -0x2c(%rbp), %r8d
xorl %eax, %eax
callq 0x45c53
jmp 0x5a667
leaq 0x1c05d(%rip), %rsi     # 0x765af
movq %rbx, %rdi
movl -0x34(%rbp), %edx
movq -0x48(%rbp), %rcx
xorl %eax, %eax
callq 0x45c53
jmp 0x5a667
leaq 0x1eb25(%rip), %rsi     # 0x79094
movq %rbx, %rdi
movq -0x98(%rbp), %rdx
jmp 0x5a5d9
leaq 0x1eb44(%rip), %rsi     # 0x790c6
jmp 0x5a5e2
leaq 0x1eb09(%rip), %rsi     # 0x79094
movq %rbx, %rdi
movl -0x2c(%rbp), %edx
jmp 0x5a5e8
leaq -0x60(%rbp), %r12
movq %r12, %rdi
callq 0xc820
movl (%r12), %edx
leaq 0x1eaa2(%rip), %rsi     # 0x7904c
movq %rbx, %rdi
jmp 0x5a5e8
leaq 0x1eae2(%rip), %rsi     # 0x79098
movq %rbx, %rdi
movl -0x54(%rbp), %edx
jmp 0x5a5e8
movq 0x8(%rbx), %rdi
movq -0x90(%rbp), %rsi
jmp 0x5a5f9
leaq 0x1eaf4(%rip), %rsi     # 0x790c6
movq %rbx, %rdi
movq -0x48(%rbp), %rdx
jmp 0x5a5e8
leaq 0x1eab2(%rip), %rsi     # 0x79094
movq %rbx, %rdi
movl -0x38(%rbp), %edx
xorl %eax, %eax
callq 0x45c53
jmp 0x5a667
movq 0x8(%rbx), %rdi
movq -0x78(%rbp), %rsi
movl $0x2, %edx
jmp 0x5a662
leaq 0x1eac4(%rip), %rsi     # 0x790cb
movq %rbx, %rdi
movl -0x3c(%rbp), %edx
movl -0x30(%rbp), %ecx
movl -0x2c(%rbp), %r8d
movl -0x34(%rbp), %r9d
xorl %eax, %eax
pushq -0x50(%rbp)
pushq -0x48(%rbp)
callq 0x45c53
addq $0x10, %rsp
jmp 0x5a667
leaq 0x3a89e(%rip), %rax     # 0x94ed0
movq -0x68(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq 0x8(%rbx), %rdi
movl $0x3, %edx
jmp 0x5a662
movq 0x8(%rbx), %rdi
leaq 0x1fc91(%rip), %rsi     # 0x7a2e1
jmp 0x5a65d
movq 0x8(%rbx), %rdi
leaq 0x18d65(%rip), %rsi     # 0x733c2
movl $0x1, %edx
callq 0x3087c
addq $0x2, %r13
movq %r13, %r12
jmp 0x5a39b
movq 0x8(%rbx), %rbx
cmpl $0x0, 0x28(%rbx)
jne 0x5a1da
jmp 0x5a1bd