// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: DateFormat
static sxi32 DateFormat(jx9_context *pCtx, const char *zIn, int nLen, Sytm *pTm)
{
	const char *zEnd = &zIn[nLen];
	const char *zCur;
	/* Start the format process */
	for(;;){
		if( zIn >= zEnd ){
			/* No more input to process */
			break;
		}
		switch(zIn[0]){
		case 'd':
			/* Day of the month, 2 digits with leading zeros */
			jx9_result_string_format(pCtx, "%02d", pTm->tm_mday);
			break;
		case 'D':
			/*A textual representation of a day, three letters*/
			zCur = SyTimeGetDay(pTm->tm_wday);
			jx9_result_string(pCtx, zCur, 3);
			break;
		case 'j':
			/*	Day of the month without leading zeros */
			jx9_result_string_format(pCtx, "%d", pTm->tm_mday);
			break;
		case 'l':
			/* A full textual representation of the day of the week */
			zCur = SyTimeGetDay(pTm->tm_wday);
			jx9_result_string(pCtx, zCur, -1/*Compute length automatically*/);
			break;
		case 'N':{
			/* ISO-8601 numeric representation of the day of the week */
			jx9_result_string_format(pCtx, "%d", aISO8601[pTm->tm_wday % 7 ]);
			break;
				 }
		case 'w':
			/*Numeric representation of the day of the week*/
			jx9_result_string_format(pCtx, "%d", pTm->tm_wday);
			break;
		case 'z':
			/*The day of the year*/
			jx9_result_string_format(pCtx, "%d", pTm->tm_yday);
			break;
		case 'F':
			/*A full textual representation of a month, such as January or March*/
			zCur = SyTimeGetMonth(pTm->tm_mon);
			jx9_result_string(pCtx, zCur, -1/*Compute length automatically*/);
			break;
		case 'm':
			/*Numeric representation of a month, with leading zeros*/
			jx9_result_string_format(pCtx, "%02d", pTm->tm_mon + 1);
			break;
		case 'M':
			/*A short textual representation of a month, three letters*/
			zCur = SyTimeGetMonth(pTm->tm_mon);
			jx9_result_string(pCtx, zCur, 3);
			break;
		case 'n':
			/*Numeric representation of a month, without leading zeros*/
			jx9_result_string_format(pCtx, "%d", pTm->tm_mon + 1);
			break;
		case 't':{
			static const int aMonDays[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
			int nDays = aMonDays[pTm->tm_mon % 12 ];
			if( pTm->tm_mon == 1 /* 'February' */ && !IS_LEAP_YEAR(pTm->tm_year) ){
				nDays = 28;
			}
			/*Number of days in the given month*/
			jx9_result_string_format(pCtx, "%d", nDays);
			break;
				 }
		case 'L':{
			int isLeap = IS_LEAP_YEAR(pTm->tm_year);
			/* Whether it's a leap year */
			jx9_result_string_format(pCtx, "%d", isLeap);
			break;
				 }
		case 'o':
			/* ISO-8601 year number.*/
			jx9_result_string_format(pCtx, "%4d", pTm->tm_year);
			break;
		case 'Y':
			/*	A full numeric representation of a year, 4 digits */
			jx9_result_string_format(pCtx, "%4d", pTm->tm_year);
			break;
		case 'y':
			/*A two digit representation of a year*/
			jx9_result_string_format(pCtx, "%02d", pTm->tm_year%100);
			break;
		case 'a':
			/*	Lowercase Ante meridiem and Post meridiem */
			jx9_result_string(pCtx, pTm->tm_hour > 12 ? "pm" : "am", 2);
			break;
		case 'A':
			/*	Uppercase Ante meridiem and Post meridiem */
			jx9_result_string(pCtx, pTm->tm_hour > 12 ? "PM" : "AM", 2);
			break;
		case 'g':
			/*	12-hour format of an hour without leading zeros*/
			jx9_result_string_format(pCtx, "%d", 1+(pTm->tm_hour%12));
			break;
		case 'G':
			/* 24-hour format of an hour without leading zeros */
			jx9_result_string_format(pCtx, "%d", pTm->tm_hour);
			break;
		case 'h':
			/* 12-hour format of an hour with leading zeros */
			jx9_result_string_format(pCtx, "%02d", 1+(pTm->tm_hour%12));
			break;
		case 'H':
			/*	24-hour format of an hour with leading zeros */
			jx9_result_string_format(pCtx, "%02d", pTm->tm_hour);
			break;
		case 'i':
			/* 	Minutes with leading zeros */
			jx9_result_string_format(pCtx, "%02d", pTm->tm_min);
			break;
		case 's':
			/* 	second with leading zeros */
			jx9_result_string_format(pCtx, "%02d", pTm->tm_sec);
			break;
		case 'u':
			/* 	Microseconds */
			jx9_result_string_format(pCtx, "%u", pTm->tm_sec * SX_USEC_PER_SEC);
			break;
		case 'S':{
			/* English ordinal suffix for the day of the month, 2 characters */
			static const char zSuffix[] = "thstndrdthththththth";
			int v = pTm->tm_mday;
			jx9_result_string(pCtx, &zSuffix[2 * (int)(v / 10 % 10 != 1 ? v % 10 : 0)], (int)sizeof(char) * 2);
			break;
				 }
		case 'e':
			/* 	Timezone identifier */
			zCur = pTm->tm_zone;
			if( zCur == 0 ){
				/* Assume GMT */
				zCur = "GMT";
			}
			jx9_result_string(pCtx, zCur, -1);
			break;
		case 'I':
			/* Whether or not the date is in daylight saving time */
#ifdef __WINNT__
#ifdef _MSC_VER
#ifndef _WIN32_WCE
			_get_daylight(&pTm->tm_isdst);
#endif
#endif
#endif
			jx9_result_string_format(pCtx, "%d", pTm->tm_isdst == 1);
			break;
		case 'r':
			/* RFC 2822 formatted date 	Example: Thu, 21 Dec 2000 16:01:07 */
			jx9_result_string_format(pCtx, "%.3s, %02d %.3s %4d %02d:%02d:%02d", 
				SyTimeGetDay(pTm->tm_wday), 
				pTm->tm_mday, 
				SyTimeGetMonth(pTm->tm_mon), 
				pTm->tm_year, 
				pTm->tm_hour, 
				pTm->tm_min, 
				pTm->tm_sec
				);
			break;
		case 'U':{
			time_t tt;
			/* Seconds since the Unix Epoch */
			time(&tt);
			jx9_result_string_format(pCtx, "%u", (unsigned int)tt);
			break;
				 }
		case 'O':
		case 'P':
			/* Difference to Greenwich time (GMT) in hours */
			jx9_result_string_format(pCtx, "%+05d", pTm->tm_gmtoff);
			break;
		case 'Z':
			/* Timezone offset in seconds. The offset for timezones west of UTC
			 * is always negative, and for those east of UTC is always positive.
			 */
			jx9_result_string_format(pCtx, "%+05d", pTm->tm_gmtoff);
			break;
		case 'c':
			/* 	ISO 8601 date */
			jx9_result_string_format(pCtx, "%4d-%02d-%02dT%02d:%02d:%02d%+05d", 
				pTm->tm_year, 
				pTm->tm_mon+1, 
				pTm->tm_mday, 
				pTm->tm_hour, 
				pTm->tm_min, 
				pTm->tm_sec, 
				pTm->tm_gmtoff
				);
			break;
		case '\\':
			zIn++;
			/* Expand verbatim */
			if( zIn < zEnd ){
				jx9_result_string(pCtx, zIn, (int)sizeof(char));
			}
			break;
		default:
			/* Unknown format specifer, expand verbatim */
			jx9_result_string(pCtx, zIn, (int)sizeof(char));
			break;
		}
		/* Point to the next character */
		zIn++;
	}
	return SXRET_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0x9d458
jmp 0x9db26
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
addl $-0x41, %eax
movl %eax, %ecx
movq %rcx, -0x50(%rbp)
subl $0x39, %eax
ja 0x9db03
movq -0x50(%rbp), %rax
leaq 0x239a8(%rip), %rcx     # 0xc0e24
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0xc(%rax), %edx
leaq 0x28113(%rip), %rsi     # 0xc55aa
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x20(%rbp), %rax
movl 0x18(%rax), %edi
callq 0x9d380
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl $0x3, %edx
callq 0x57180
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0xc(%rax), %edx
leaq 0x22ae9(%rip), %rsi     # 0xbffc5
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x20(%rbp), %rax
movl 0x18(%rax), %edi
callq 0x9d380
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x57180
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x18(%rax), %eax
movl $0x7, %ecx
cltd
idivl %ecx
movslq %edx, %rcx
leaq 0x24094(%rip), %rax     # 0xc15c0
movl (%rax,%rcx,4), %edx
leaq 0x22a8f(%rip), %rsi     # 0xbffc5
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x18(%rax), %edx
leaq 0x22a71(%rip), %rsi     # 0xbffc5
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x1c(%rax), %edx
leaq 0x22a53(%rip), %rsi     # 0xbffc5
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x20(%rbp), %rax
movl 0x10(%rax), %edi
callq 0x9d3a0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x57180
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x10(%rax), %edx
addl $0x1, %edx
leaq 0x27ff0(%rip), %rsi     # 0xc55aa
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x20(%rbp), %rax
movl 0x10(%rax), %edi
callq 0x9d3a0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl $0x3, %edx
callq 0x57180
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x10(%rax), %edx
addl $0x1, %edx
leaq 0x229c3(%rip), %rsi     # 0xbffc5
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
movl $0xc, %ecx
cltd
idivl %ecx
movslq %edx, %rcx
leaq 0x23fb9(%rip), %rax     # 0xc15e0
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jne 0x9d69a
movq -0x20(%rbp), %rax
movl 0x14(%rax), %eax
movl $0x190, %ecx            # imm = 0x190
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x9d68b
movq -0x20(%rbp), %rax
movl 0x14(%rax), %eax
movl $0x64, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x9d683
movq -0x20(%rbp), %rax
movl 0x14(%rax), %eax
movl $0x4, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x9d67b
xorl %eax, %eax
testb $0x1, %al
jne 0x9d69a
jmp 0x9d693
movb $0x1, %al
testb $0x1, %al
jne 0x9d69a
jmp 0x9d693
xorl %eax, %eax
testb $0x1, %al
jne 0x9d69a
jmp 0x9d693
movb $0x1, %al
testb $0x1, %al
jne 0x9d69a
jmp 0x9d693
movl $0x1c, -0x34(%rbp)
movq -0x8(%rbp), %rdi
movl -0x34(%rbp), %edx
leaq 0x2291d(%rip), %rsi     # 0xbffc5
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x20(%rbp), %rax
movl 0x14(%rax), %eax
movl $0x190, %ecx            # imm = 0x190
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x9d70c
movq -0x20(%rbp), %rax
movl 0x14(%rax), %eax
movl $0x64, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x9d6fd
movq -0x20(%rbp), %rax
movl 0x14(%rax), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl $0x1, %eax
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x54(%rbp)
jmp 0x9d704
xorl %eax, %eax
movl %eax, -0x54(%rbp)
jmp 0x9d704
movl -0x54(%rbp), %eax
movl %eax, -0x58(%rbp)
jmp 0x9d716
movl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x9d716
movl -0x58(%rbp), %eax
movl %eax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movl -0x38(%rbp), %edx
leaq 0x2289b(%rip), %rsi     # 0xbffc5
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x14(%rax), %edx
leaq 0x27ddb(%rip), %rsi     # 0xc5523
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x14(%rax), %edx
leaq 0x27dbd(%rip), %rsi     # 0xc5523
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x14(%rax), %eax
movl $0x64, %ecx
cltd
idivl %ecx
leaq 0x27e1e(%rip), %rsi     # 0xc55aa
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %ecx
leaq 0x21d1e(%rip), %rsi     # 0xbf4c8
leaq 0x27d76(%rip), %rax     # 0xc5527
cmpl $0xc, %ecx
cmovgq %rax, %rsi
movl $0x2, %edx
callq 0x57180
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %ecx
leaq 0x27d54(%rip), %rsi     # 0xc552d
leaq 0x27d4a(%rip), %rax     # 0xc552a
cmpl $0xc, %ecx
cmovgq %rax, %rsi
movl $0x2, %edx
callq 0x57180
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
movl $0xc, %ecx
cltd
idivl %ecx
addl $0x1, %edx
leaq 0x227b2(%rip), %rsi     # 0xbffc5
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %edx
leaq 0x22794(%rip), %rsi     # 0xbffc5
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
movl $0xc, %ecx
cltd
idivl %ecx
addl $0x1, %edx
leaq 0x27d50(%rip), %rsi     # 0xc55aa
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %edx
leaq 0x27d32(%rip), %rsi     # 0xc55aa
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x4(%rax), %edx
leaq 0x27d14(%rip), %rsi     # 0xc55aa
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl (%rax), %edx
leaq 0x27cf7(%rip), %rsi     # 0xc55aa
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
imull $0xf4240, (%rax), %edx  # imm = 0xF4240
leaq 0x27c5c(%rip), %rsi     # 0xc5530
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x20(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movl -0x3c(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl $0xa, %ecx
cltd
idivl %ecx
cmpl $0x1, %edx
je 0x9d91a
movl -0x3c(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %edx, -0x64(%rbp)
jmp 0x9d921
xorl %eax, %eax
movl %eax, -0x64(%rbp)
jmp 0x9d921
movq -0x60(%rbp), %rdi
movl -0x64(%rbp), %eax
shll %eax
cltq
leaq 0x23cdd(%rip), %rsi     # 0xc1610
addq %rax, %rsi
movl $0x2, %edx
callq 0x57180
jmp 0x9db15
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x9d963
leaq 0x217ff(%rip), %rax     # 0xbf15e
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x57180
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
cmpl $0x1, 0x20(%rax)
sete %al
andb $0x1, %al
movzbl %al, %edx
leaq 0x22630(%rip), %rsi     # 0xbffc5
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x20(%rbp), %rax
movl 0x18(%rax), %edi
callq 0x9d380
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x68(%rbp)
movq -0x20(%rbp), %rax
movl 0x10(%rax), %edi
callq 0x9d3a0
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rdx
movl -0x68(%rbp), %ecx
movq %rax, %r8
movq -0x20(%rbp), %rax
movl 0x14(%rax), %r9d
movq -0x20(%rbp), %rax
movl 0x8(%rax), %r11d
movq -0x20(%rbp), %rax
movl 0x4(%rax), %r10d
movq -0x20(%rbp), %rax
movl (%rax), %eax
leaq 0x27b31(%rip), %rsi     # 0xc5533
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
leaq -0x48(%rbp), %rdi
callq 0xd980
movq -0x8(%rbp), %rdi
movq -0x48(%rbp), %rax
movl %eax, %edx
leaq 0x27afb(%rip), %rsi     # 0xc5530
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rdx
leaq 0x27b1e(%rip), %rsi     # 0xc5572
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rdx
leaq 0x27aff(%rip), %rsi     # 0xc5572
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x14(%rax), %edx
movq -0x20(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl 0xc(%rax), %r8d
movq -0x20(%rbp), %rax
movl 0x8(%rax), %r9d
movq -0x20(%rbp), %rax
movl 0x4(%rax), %r11d
movq -0x20(%rbp), %rax
movl (%rax), %r10d
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rax
leaq 0x27a94(%rip), %rsi     # 0xc5556
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0x794a0
jmp 0x9db15
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x9db01
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %edx
callq 0x57180
jmp 0x9db15
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %edx
callq 0x57180
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x9d449
xorl %eax, %eax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)