// File: /workspace/github_c_makefile_star2_O3/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, -0x30(%rbp)
testl %esi, %esi
jle 0x589fe
movq %rdx, %r14
movq (%rdx), %rdi
testb $0x1, 0x8(%rdi)
jne 0x58a34
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rbx
movq %rbx, %rdi
callq 0x30465
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 -0x78(%rbp), %r12
movq %r12, %rsi
callq 0x30577
movq %rax, %rbx
cmpl $0x0, (%r12)
jg 0x58a77
movq -0x30(%rbp), %rax
movq 0x8(%rax), %r12
movq %r12, %rdi
callq 0x30465
movq $0x0, (%r12)
movl $0xfffffe90, %eax       # imm = 0xFFFFFE90
andl 0x8(%r12), %eax
orl $0x8, %eax
movl %eax, 0x8(%r12)
cmpl $0x1, %r15d
jne 0x58a8e
leaq -0x68(%rbp), %r14
movq %r14, %rdi
callq 0xc820
movq %r14, %rdi
jmp 0x58ac2
movq 0x8(%r14), %r14
testb $0x2, 0x8(%r14)
je 0x58ab5
movq %r14, %rdi
callq 0x3f362
movq (%r14), %rax
leaq -0x68(%rbp), %rdi
movq %rax, (%rdi)
callq 0xc770
testq %rax, %rax
jne 0x58abe
leaq -0x68(%rbp), %rdi
callq 0xc820
leaq -0x68(%rbp), %rdi
callq 0xc770
movl 0x8(%rax), %edx
movl (%rax), %ecx
movq %rcx, -0x58(%rbp)
movl 0x4(%rax), %ecx
movq %rcx, -0x50(%rbp)
movl 0x10(%rax), %ecx
movl 0xc(%rax), %esi
movl %esi, -0x34(%rbp)
movl 0x14(%rax), %esi
movl 0x1c(%rax), %edi
movl %edi, -0x5c(%rbp)
movl 0x18(%rax), %edi
addl $0x76c, %esi            # imm = 0x76C
movslq -0x78(%rbp), %r15
addq %rbx, %r15
leal 0x1(%rcx), %eax
movl %eax, -0x38(%rbp)
movl %esi, -0x44(%rbp)
movslq %esi, %rsi
imulq $0x51eb851f, %rsi, %r14 # imm = 0x51EB851F
movq %r14, %rax
shrq $0x3f, %rax
shrq $0x20, %r14
sarl $0x5, %r14d
addl %eax, %r14d
imull $0x64, %r14d, %eax
subl %eax, %esi
movq %rsi, -0x90(%rbp)
movl %edx, -0x3c(%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
cmpl $0xd, %eax
leaq 0x1e4fa(%rip), %rsi     # 0x77051
leaq 0x1e4f6(%rip), %r8      # 0x77054
cmovgeq %rsi, %r8
movq %r8, -0x80(%rbp)
leaq 0x1e4e1(%rip), %rsi     # 0x7704e
leaq 0x1897a(%rip), %r8      # 0x714ee
cmovgeq %rsi, %r8
movq %r8, -0x98(%rbp)
addl %edx, %eax
incl %eax
movl %eax, -0x40(%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, -0x88(%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, -0x74(%rbp)
addl %edi, %eax
cltq
movq %rax, -0x70(%rbp)
leaq 0x19c75(%rip), %r12     # 0x72858
cmpq %r15, %rbx
jae 0x58c16
movq %rbx, %r13
cmpb $0x25, (%r13)
je 0x58bfa
incq %r13
cmpq %r15, %r13
jb 0x58beb
cmpq %rbx, %r13
jbe 0x58c19
movl %r13d, %edx
subl %ebx, %edx
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq %rbx, %rsi
callq 0x302f6
jmp 0x58c19
movq %rbx, %r13
leaq 0x1(%r13), %rax
cmpq %r15, %rax
jae 0x58ef8
movzbl (%rax), %eax
addl $-0x25, %eax
cmpl $0x55, %eax
ja 0x58eec
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
leaq 0x1e48c(%rip), %rsi     # 0x770d1
movq -0x30(%rbp), %rdi
movl -0x38(%rbp), %edx
jmp 0x58e59
leaq 0x3a2b8(%rip), %rax     # 0x92f10
movq -0x88(%rbp), %rcx
jmp 0x58eaf
leaq 0x1e3df(%rip), %rsi     # 0x7704a
movq -0x30(%rbp), %rdi
movl -0x44(%rbp), %edx
jmp 0x58e59
leaq 0x1e43c(%rip), %rsi     # 0x770ba
movq -0x30(%rbp), %rdi
movl -0x38(%rbp), %edx
movl -0x34(%rbp), %ecx
movq -0x90(%rbp), %r8
jmp 0x58cd2
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x184e4(%rip), %rsi     # 0x71184
jmp 0x58d79
leaq 0x1e3f3(%rip), %rsi     # 0x7709f
movq -0x30(%rbp), %rdi
movq -0x90(%rbp), %rdx
jmp 0x58e49
leaq 0x1b8ef(%rip), %rsi     # 0x745b2
movq -0x30(%rbp), %rdi
movl -0x3c(%rbp), %edx
movq -0x50(%rbp), %rcx
movq -0x58(%rbp), %r8
jmp 0x58dab
leaq 0x1a2c2(%rip), %rax     # 0x72fa0
movq -0x70(%rbp), %rcx
movl (%rax,%rcx,4), %edx
leaq 0x19309(%rip), %rsi     # 0x71ff5
jmp 0x58e13
leaq 0x1e3b0(%rip), %rsi     # 0x770a8
movq -0x30(%rbp), %rdi
movl -0x40(%rbp), %edx
movq -0x50(%rbp), %rcx
movq -0x58(%rbp), %r8
movq -0x80(%rbp), %r9
xorl %eax, %eax
callq 0x44e00
jmp 0x58eec
leaq 0x1e3b3(%rip), %rsi     # 0x770d1
movq -0x30(%rbp), %rdi
movq -0x58(%rbp), %rdx
jmp 0x58e49
leaq 0x192c3(%rip), %rsi     # 0x71ff5
movq -0x30(%rbp), %rdi
movl -0x74(%rbp), %edx
jmp 0x58e59
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x1ab14(%rip), %rsi     # 0x73861
jmp 0x58ee2
leaq 0x3a177(%rip), %rax     # 0x92ed0
movq -0x70(%rbp), %rcx
jmp 0x58d6d
leaq 0x3a1aa(%rip), %rax     # 0x92f10
movq -0x88(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
jmp 0x58ee7
leaq 0x1e347(%rip), %rsi     # 0x770d1
movq -0x30(%rbp), %rdi
movl -0x3c(%rbp), %edx
jmp 0x58e59
leaq 0x1e32c(%rip), %rsi     # 0x770c9
movq -0x30(%rbp), %rdi
movl -0x44(%rbp), %edx
movl -0x38(%rbp), %ecx
movl -0x34(%rbp), %r8d
xorl %eax, %eax
callq 0x44e00
jmp 0x58eec
leaq 0x1b7f9(%rip), %rsi     # 0x745b7
movq -0x30(%rbp), %rdi
movl -0x3c(%rbp), %edx
movq -0x50(%rbp), %rcx
xorl %eax, %eax
callq 0x44e00
jmp 0x58eec
leaq 0x1e2c3(%rip), %rsi     # 0x7709f
movq -0x30(%rbp), %rdi
movl %r14d, %edx
jmp 0x58e59
leaq 0x1e2e5(%rip), %rsi     # 0x770d1
jmp 0x58e52
leaq 0x1e2aa(%rip), %rsi     # 0x7709f
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %edx
jmp 0x58e59
leaq -0x68(%rbp), %rbx
movq %rbx, %rdi
callq 0xc820
movl (%rbx), %edx
leaq 0x1e244(%rip), %rsi     # 0x77057
movq -0x30(%rbp), %rdi
jmp 0x58e59
leaq 0x1e283(%rip), %rsi     # 0x770a3
movq -0x30(%rbp), %rdi
movl -0x5c(%rbp), %edx
jmp 0x58e59
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x98(%rbp), %rsi
jmp 0x58e71
leaq 0x1e290(%rip), %rsi     # 0x770d1
movq -0x30(%rbp), %rdi
movq -0x50(%rbp), %rdx
jmp 0x58e59
leaq 0x1e24d(%rip), %rsi     # 0x7709f
movq -0x30(%rbp), %rdi
movl -0x40(%rbp), %edx
xorl %eax, %eax
callq 0x44e00
jmp 0x58eec
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x80(%rbp), %rsi
movl $0x2, %edx
jmp 0x58ee7
leaq 0x1e257(%rip), %rsi     # 0x770d6
movq -0x30(%rbp), %rdi
movl -0x44(%rbp), %edx
movl -0x38(%rbp), %ecx
movl -0x34(%rbp), %r8d
movl -0x3c(%rbp), %r9d
xorl %eax, %eax
pushq -0x58(%rbp)
pushq -0x50(%rbp)
callq 0x44e00
addq $0x10, %rsp
jmp 0x58eec
leaq 0x3a025(%rip), %rax     # 0x92ed0
movq -0x70(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x3, %edx
jmp 0x58ee7
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x1f410(%rip), %rsi     # 0x782e1
jmp 0x58ee2
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x184e0(%rip), %rsi     # 0x713c2
movl $0x1, %edx
callq 0x302f6
addq $0x2, %r13
movq %r13, %rbx
jmp 0x58be3
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rbx
cmpl $0x0, 0x28(%rbx)
jne 0x58a23
jmp 0x58a06