// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9Builtin_mktime
static int jx9Builtin_mktime(jx9_context *pCtx, int nArg, jx9_value **apArg)
{
	const char *zFunction;
	jx9_int64 iVal = 0;
	struct tm *pTm;
	time_t t;
	/* Extract function name */
	zFunction = jx9_function_name(pCtx);
	/* Get the current time */
	time(&t);
	if( zFunction[0] == 'g' /* gmmktime */ ){
		pTm = gmtime(&t);
	}else{
		/* localtime */
		pTm = localtime(&t);
	}
	if( nArg > 0 ){
		int iVal;
		/* Hour */
		iVal = jx9_value_to_int(apArg[0]);
		pTm->tm_hour = iVal;
		if( nArg > 1 ){
			/* Minutes */
			iVal = jx9_value_to_int(apArg[1]);
			pTm->tm_min = iVal;
			if( nArg > 2 ){
				/* Seconds */
				iVal = jx9_value_to_int(apArg[2]);
				pTm->tm_sec = iVal;
				if( nArg > 3 ){
					/* Month */
					iVal = jx9_value_to_int(apArg[3]);
					pTm->tm_mon = iVal - 1;
					if( nArg > 4 ){
						/* mday */
						iVal = jx9_value_to_int(apArg[4]);
						pTm->tm_mday = iVal;
						if( nArg > 5 ){
							/* Year */
							iVal = jx9_value_to_int(apArg[5]);
							if( iVal > 1900 ){
								iVal -= 1900;
							}
							pTm->tm_year = iVal;
							if( nArg > 6 ){
								/* is_dst */
								iVal = jx9_value_to_bool(apArg[6]);
								pTm->tm_isdst = iVal;
							}
						}
					}
				}
			}
		}
	}
	/* Make the time */
	iVal = (jx9_int64)mktime(pTm);
	/* Return the timesatmp as a 64bit integer */
	jx9_result_int64(pCtx, iVal);
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x584d0
movq %rax, -0x20(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xd980
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x67, %eax
jne 0x989fc
leaq -0x38(%rbp), %rdi
callq 0xd3a0
movq %rax, -0x30(%rbp)
jmp 0x98a09
leaq -0x38(%rbp), %rdi
callq 0xd8b0
movq %rax, -0x30(%rbp)
cmpl $0x0, -0xc(%rbp)
jle 0x98b1a
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x56c90
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x8(%rax)
cmpl $0x1, -0xc(%rbp)
jle 0x98b18
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x56c90
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x4(%rax)
cmpl $0x2, -0xc(%rbp)
jle 0x98b16
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x56c90
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
cmpl $0x3, -0xc(%rbp)
jle 0x98b14
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x56c90
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %ecx
subl $0x1, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x10(%rax)
cmpl $0x4, -0xc(%rbp)
jle 0x98b12
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x56c90
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0xc(%rax)
cmpl $0x5, -0xc(%rbp)
jle 0x98b10
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x56c90
movl %eax, -0x3c(%rbp)
cmpl $0x76c, -0x3c(%rbp)     # imm = 0x76C
jle 0x98ae4
movl -0x3c(%rbp), %eax
subl $0x76c, %eax            # imm = 0x76C
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x14(%rax)
cmpl $0x6, -0xc(%rbp)
jle 0x98b0e
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x56cf0
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x20(%rax)
jmp 0x98b10
jmp 0x98b12
jmp 0x98b14
jmp 0x98b16
jmp 0x98b18
jmp 0x98b1a
movq -0x30(%rbp), %rdi
callq 0xd540
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x57010
xorl %eax, %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)