// File: /workspace/github_c_makefile_star2_O0/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
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
cmpl $0x1, -0x14(%rbp)
jl 0x97d0d
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x57480
cmpl $0x0, %eax
jne 0x97d24
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x57070
movl $0x0, -0x4(%rbp)
jmp 0x97efa
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x56e20
movq %rax, -0x28(%rbp)
cmpl $0x1, -0x2c(%rbp)
jge 0x97d49
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x57070
cmpl $0x2, -0x14(%rbp)
jge 0x97ddc
leaq -0x78(%rbp), %rdi
callq 0xd980
leaq -0x78(%rbp), %rdi
callq 0xd8b0
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x60(%rbp)
movq -0x70(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x70(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x68(%rbp)
movq -0x70(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x58(%rbp)
movq -0x70(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x5c(%rbp)
movq -0x70(%rbp), %rax
movl 0x14(%rax), %eax
addl $0x76c, %eax            # imm = 0x76C
movl %eax, -0x54(%rbp)
movq -0x70(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x4c(%rbp)
movq -0x70(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x50(%rbp)
movq -0x70(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x48(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
jmp 0x97ec6
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x57390
cmpl $0x0, %eax
je 0x97e24
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x56d50
movq %rax, -0x80(%rbp)
leaq -0x80(%rbp), %rdi
callq 0xd8b0
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x88(%rbp)
jne 0x97e22
leaq -0x80(%rbp), %rdi
callq 0xd980
jmp 0x97e2d
leaq -0x80(%rbp), %rdi
callq 0xd980
leaq -0x80(%rbp), %rdi
callq 0xd8b0
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x60(%rbp)
movq -0x88(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x88(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x68(%rbp)
movq -0x88(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x58(%rbp)
movq -0x88(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x5c(%rbp)
movq -0x88(%rbp), %rax
movl 0x14(%rax), %eax
addl $0x76c, %eax            # imm = 0x76C
movl %eax, -0x54(%rbp)
movq -0x88(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x4c(%rbp)
movq -0x88(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x50(%rbp)
movq -0x88(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x48(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x2c(%rbp), %edx
leaq -0x68(%rbp), %rcx
callq 0x9db40
movq -0x10(%rbp), %rdi
callq 0x58490
cmpl $0x1, %eax
jae 0x97ef3
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x57070
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)