// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9Strftime
static int jx9Strftime(
	jx9_context *pCtx,  /* Call context */
	const char *zIn,    /* Input string */
	int nLen,           /* Input length */
	Sytm *pTm           /* Parse of the given time */
	)
{
	const char *zCur, *zEnd = &zIn[nLen];
	int c;
	/* Start the format process */
	for(;;){
		zCur = zIn;
		while(zIn < zEnd && zIn[0] != '%' ){
			zIn++;
		}
		if( zIn > zCur ){
			/* Consume input verbatim */
			jx9_result_string(pCtx, zCur, (int)(zIn-zCur));
		}
		zIn++; /* Jump the percent sign */
		if( zIn >= zEnd ){
			/* No more input to process */
			break;
		}
		c = zIn[0];
		/* Act according to the current specifer */
		switch(c){
		case '%':
			/* A literal percentage character ("%") */
			jx9_result_string(pCtx, "%", (int)sizeof(char));
			break;
		case 't':
			/* A Tab character */
			jx9_result_string(pCtx, "\t", (int)sizeof(char));
			break;
		case 'n':
			/* A newline character */
			jx9_result_string(pCtx, "\n", (int)sizeof(char));
			break;
		case 'a':
			/* An abbreviated textual representation of the day */
			jx9_result_string(pCtx, SyTimeGetDay(pTm->tm_wday), (int)sizeof(char)*3);
			break;
		case 'A':
			/* A full textual representation of the day */
			jx9_result_string(pCtx, SyTimeGetDay(pTm->tm_wday), -1/*Compute length automatically*/);
			break;
		case 'e':
			/* Day of the month, 2 digits with leading space for single digit*/
			jx9_result_string_format(pCtx, "%2d", pTm->tm_mday);
			break;
		case 'd':
			/* Two-digit day of the month (with leading zeros) */
			jx9_result_string_format(pCtx, "%02d", pTm->tm_mon+1);
			break;
		case 'j':
			/*The day of the year, 3 digits with leading zeros*/
			jx9_result_string_format(pCtx, "%03d", pTm->tm_yday);
			break;
		case 'u':
			/* 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 'b':
		case 'h':
			/*A short textual representation of a month, three letters (Not based on locale)*/
			jx9_result_string(pCtx, SyTimeGetMonth(pTm->tm_mon), (int)sizeof(char)*3);
			break;
		case 'B':
			/* Full month name (Not based on locale) */
			jx9_result_string(pCtx, SyTimeGetMonth(pTm->tm_mon), -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 'C':
			/* Two digit representation of the century */
			jx9_result_string_format(pCtx, "%2d", pTm->tm_year/100);
			break;
		case 'y':
		case 'g':
			/* Two digit representation of the year */
			jx9_result_string_format(pCtx, "%2d", pTm->tm_year%100);
			break;
		case 'Y':
		case 'G':
			/* Four digit representation of the year */
			jx9_result_string_format(pCtx, "%4d", pTm->tm_year);
			break;
		case 'I':
			/* 12-hour format of an hour with leading zeros */
			jx9_result_string_format(pCtx, "%02d", 1+(pTm->tm_hour%12));
			break;
		case 'l':
			/* 12-hour format of an hour with leading space */
			jx9_result_string_format(pCtx, "%2d", 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 'M':
			/* Minutes with leading zeros */
			jx9_result_string_format(pCtx, "%02d", pTm->tm_min);
			break;
		case 'S':
			/* Seconds with leading zeros */
			jx9_result_string_format(pCtx, "%02d", pTm->tm_sec);
			break;
		case 'z':
		case 'Z':
			/* 	Timezone identifier */
			zCur = pTm->tm_zone;
			if( zCur == 0 ){
				/* Assume GMT */
				zCur = "GMT";
			}
			jx9_result_string(pCtx, zCur, -1);
			break;
		case 'T':
		case 'X':
			/* Same as "%H:%M:%S" */
			jx9_result_string_format(pCtx, "%02d:%02d:%02d", pTm->tm_hour, pTm->tm_min, pTm->tm_sec);
			break;
		case 'R':
			/* Same as "%H:%M" */
			jx9_result_string_format(pCtx, "%02d:%02d", pTm->tm_hour, pTm->tm_min);
			break;
		case 'P':
			/*	Lowercase Ante meridiem and Post meridiem */
			jx9_result_string(pCtx, pTm->tm_hour > 12 ? "pm" : "am", (int)sizeof(char)*2);
			break;
		case 'p':
			/*	Uppercase Ante meridiem and Post meridiem */
			jx9_result_string(pCtx, pTm->tm_hour > 12 ? "PM" : "AM", (int)sizeof(char)*2);
			break;
		case 'r':
			/* Same as "%I:%M:%S %p" */
			jx9_result_string_format(pCtx, "%02d:%02d:%02d %s", 
				1+(pTm->tm_hour%12), 
				pTm->tm_min, 
				pTm->tm_sec, 
				pTm->tm_hour > 12 ? "PM" : "AM"
				);
			break;
		case 'D':
		case 'x':
			/* Same as "%m/%d/%y" */
			jx9_result_string_format(pCtx, "%02d/%02d/%02d", 
				pTm->tm_mon+1, 
				pTm->tm_mday, 
				pTm->tm_year%100
				);
			break;
		case 'F':
			/* Same as "%Y-%m-%d" */
			jx9_result_string_format(pCtx, "%d-%02d-%02d", 
				pTm->tm_year, 
				pTm->tm_mon+1, 
				pTm->tm_mday
				);
			break;
		case 'c':
			jx9_result_string_format(pCtx, "%d-%02d-%02d %02d:%02d:%02d", 
				pTm->tm_year, 
				pTm->tm_mon+1, 
				pTm->tm_mday, 
				pTm->tm_hour, 
				pTm->tm_min, 
				pTm->tm_sec
				);
			break;
		case 's':{
			time_t tt;
			/* Seconds since the Unix Epoch */
			time(&tt);
			jx9_result_string_format(pCtx, "%u", (unsigned int)tt);
			break;
				 }
		default:
			/* unknown specifer, simply ignore*/
			break;
		}
		/* Advance the cursor */
		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, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpq -0x30(%rbp), %rcx
movb %al, -0x41(%rbp)
jae 0x9db90
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
setne %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
testb $0x1, %al
jne 0x9db99
jmp 0x9dba7
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x9db71
movq -0x10(%rbp), %rax
cmpq -0x28(%rbp), %rax
jbe 0x9dbcb
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rcx, %rax
movl %eax, %edx
callq 0x57180
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x30(%rbp), %rax
jb 0x9dbe6
jmp 0x9e11a
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
addl $-0x25, %eax
movl %eax, %ecx
movq %rcx, -0x50(%rbp)
subl $0x55, %eax
ja 0x9e107
movq -0x50(%rbp), %rax
leaq 0x232fc(%rip), %rcx     # 0xc0f0c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
leaq 0x2410e(%rip), %rsi     # 0xc1d32
movl $0x1, %edx
callq 0x57180
jmp 0x9e109
movq -0x8(%rbp), %rdi
leaq 0x2175e(%rip), %rsi     # 0xbf39c
movl $0x1, %edx
callq 0x57180
jmp 0x9e109
movq -0x8(%rbp), %rdi
leaq 0x28f81(%rip), %rsi     # 0xc6bd9
movl $0x1, %edx
callq 0x57180
jmp 0x9e109
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
movl 0x18(%rax), %edi
callq 0x9d380
movq -0x58(%rbp), %rdi
movq %rax, %rsi
movl $0x3, %edx
callq 0x57180
jmp 0x9e109
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x20(%rbp), %rax
movl 0x18(%rax), %edi
callq 0x9d380
movq -0x60(%rbp), %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x57180
jmp 0x9e109
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0xc(%rax), %edx
leaq 0x278ab(%rip), %rsi     # 0xc5578
movb $0x0, %al
callq 0x794a0
jmp 0x9e109
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x10(%rax), %edx
addl $0x1, %edx
leaq 0x278bc(%rip), %rsi     # 0xc55aa
movb $0x0, %al
callq 0x794a0
jmp 0x9e109
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x1c(%rax), %edx
leaq 0x27870(%rip), %rsi     # 0xc557c
movb $0x0, %al
callq 0x794a0
jmp 0x9e109
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x18(%rax), %eax
movl $0x7, %ecx
cltd
idivl %ecx
movslq %edx, %rcx
leaq 0x2388b(%rip), %rax     # 0xc15c0
movl (%rax,%rcx,4), %edx
leaq 0x22286(%rip), %rsi     # 0xbffc5
movb $0x0, %al
callq 0x794a0
jmp 0x9e109
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x18(%rax), %edx
leaq 0x22268(%rip), %rsi     # 0xbffc5
movb $0x0, %al
callq 0x794a0
jmp 0x9e109
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rax
movl 0x10(%rax), %edi
callq 0x9d3a0
movq -0x68(%rbp), %rdi
movq %rax, %rsi
movl $0x3, %edx
callq 0x57180
jmp 0x9e109
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rax
movl 0x10(%rax), %edi
callq 0x9d3a0
movq -0x70(%rbp), %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x57180
jmp 0x9e109
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x10(%rax), %edx
addl $0x1, %edx
leaq 0x277d8(%rip), %rsi     # 0xc55aa
movb $0x0, %al
callq 0x794a0
jmp 0x9e109
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x14(%rax), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movl %eax, %edx
leaq 0x2777e(%rip), %rsi     # 0xc5578
movb $0x0, %al
callq 0x794a0
jmp 0x9e109
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x14(%rax), %eax
movl $0x64, %ecx
cltd
idivl %ecx
leaq 0x27758(%rip), %rsi     # 0xc5578
movb $0x0, %al
callq 0x794a0
jmp 0x9e109
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x14(%rax), %edx
leaq 0x276e5(%rip), %rsi     # 0xc5523
movb $0x0, %al
callq 0x794a0
jmp 0x9e109
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
movl $0xc, %ecx
cltd
idivl %ecx
addl $0x1, %edx
leaq 0x27743(%rip), %rsi     # 0xc55aa
movb $0x0, %al
callq 0x794a0
jmp 0x9e109
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
movl $0xc, %ecx
cltd
idivl %ecx
addl $0x1, %edx
leaq 0x276e8(%rip), %rsi     # 0xc5578
movb $0x0, %al
callq 0x794a0
jmp 0x9e109
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %edx
leaq 0x276fc(%rip), %rsi     # 0xc55aa
movb $0x0, %al
callq 0x794a0
jmp 0x9e109
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x4(%rax), %edx
leaq 0x276de(%rip), %rsi     # 0xc55aa
movb $0x0, %al
callq 0x794a0
jmp 0x9e109
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl (%rax), %edx
leaq 0x276c1(%rip), %rsi     # 0xc55aa
movb $0x0, %al
callq 0x794a0
jmp 0x9e109
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x9df13
leaq 0x2124f(%rip), %rax     # 0xbf15e
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x57180
jmp 0x9e109
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %edx
movq -0x20(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x20(%rbp), %rax
movl (%rax), %r8d
leaq 0x24b39(%rip), %rsi     # 0xc2a83
movb $0x0, %al
callq 0x794a0
jmp 0x9e109
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %edx
movq -0x20(%rbp), %rax
movl 0x4(%rax), %ecx
leaq 0x24b19(%rip), %rsi     # 0xc2a88
movb $0x0, %al
callq 0x794a0
jmp 0x9e109
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %ecx
leaq 0x2153b(%rip), %rsi     # 0xbf4c8
leaq 0x27593(%rip), %rax     # 0xc5527
cmpl $0xc, %ecx
cmovgq %rax, %rsi
movl $0x2, %edx
callq 0x57180
jmp 0x9e109
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %ecx
leaq 0x27571(%rip), %rsi     # 0xc552d
leaq 0x27567(%rip), %rax     # 0xc552a
cmpl $0xc, %ecx
cmovgq %rax, %rsi
movl $0x2, %edx
callq 0x57180
jmp 0x9e109
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
movl $0xc, %ecx
cltd
idivl %ecx
addl $0x1, %edx
movq -0x20(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x20(%rbp), %rax
movl (%rax), %r8d
movq -0x20(%rbp), %rax
movl 0x8(%rax), %esi
leaq 0x27522(%rip), %r9      # 0xc552d
leaq 0x27518(%rip), %rax     # 0xc552a
cmpl $0xc, %esi
cmovgq %rax, %r9
leaq 0x27561(%rip), %rsi     # 0xc5581
movb $0x0, %al
callq 0x794a0
jmp 0x9e109
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
movq -0x20(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x20(%rbp), %rax
movl 0x14(%rax), %eax
movl $0x64, %esi
cltd
idivl %esi
movl %edx, %r8d
movl -0x74(%rbp), %edx
leaq 0x27533(%rip), %rsi     # 0xc5593
movb $0x0, %al
callq 0x794a0
jmp 0x9e109
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
leaq 0x27512(%rip), %rsi     # 0xc55a2
movb $0x0, %al
callq 0x794a0
jmp 0x9e109
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), %r10d
movq -0x20(%rbp), %rax
movl (%rax), %eax
leaq 0x274dc(%rip), %rsi     # 0xc55af
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x794a0
jmp 0x9e109
leaq -0x40(%rbp), %rdi
callq 0xd980
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movl %eax, %edx
leaq 0x27432(%rip), %rsi     # 0xc5530
movb $0x0, %al
callq 0x794a0
jmp 0x9e109
jmp 0x9e109
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x9db69
xorl %eax, %eax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)