// File: /workspace/github_c_makefile_star2_O0/ccxvii[P]mujs/./jsdate.c
// Function: parseDateTime
static double parseDateTime(const char *s)
{
	int y = 1970, m = 1, d = 1, H = 0, M = 0, S = 0, ms = 0;
	int tza = 0;
	double t;

	/* Parse ISO 8601 formatted date and time: */
	/* YYYY("-"MM("-"DD)?)?("T"HH":"mm(":"ss("."sss)?)?("Z"|[+-]HH(":"mm)?)?)? */

	if (!toint(&s, 4, &y)) return NAN;
	if (*s == '-') {
		s += 1;
		if (!toint(&s, 2, &m)) return NAN;
		if (*s == '-') {
			s += 1;
			if (!toint(&s, 2, &d)) return NAN;
		}
	}

	if (*s == 'T') {
		s += 1;
		if (!toint(&s, 2, &H)) return NAN;
		if (*s != ':') return NAN;
		s += 1;
		if (!toint(&s, 2, &M)) return NAN;
		if (*s == ':') {
			s += 1;
			if (!toint(&s, 2, &S)) return NAN;
			if (*s == '.') {
				s += 1;
				if (!toint(&s, 3, &ms)) return NAN;
			}
		}
		if (*s == 'Z') {
			s += 1;
			tza = 0;
		} else if (*s == '+' || *s == '-') {
			int tzh = 0, tzm = 0;
			int tzs = *s == '+' ? 1 : -1;
			s += 1;
			if (!toint(&s, 2, &tzh)) return NAN;
			if (*s == ':') {
				s += 1;
				if (!toint(&s, 2, &tzm)) return NAN;
			}
			if (tzh > 23 || tzm > 59) return NAN;
			tza = tzs * (tzh * msPerHour + tzm * msPerMinute);
		} else {
			tza = LocalTZA();
		}
	}

	if (*s) return NAN;

	if (m < 1 || m > 12) return NAN;
	if (d < 1 || d > 31) return NAN;
	if (H < 0 || H > 24) return NAN;
	if (M < 0 || M > 59) return NAN;
	if (S < 0 || S > 59) return NAN;
	if (ms < 0 || ms > 999) return NAN;
	if (H == 24 && (M != 0 || S != 0 || ms != 0)) return NAN;

	/* TODO: DaylightSavingTA on local times */
	t = MakeDate(MakeDay(y, m-1, d), MakeTime(H, M, S, ms));
	return t - tza;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl $0x7b2, -0x14(%rbp)     # imm = 0x7B2
movl $0x1, -0x18(%rbp)
movl $0x1, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
leaq -0x10(%rbp), %rdi
movl $0x4, %esi
leaq -0x14(%rbp), %rdx
callq 0x240a0
cmpl $0x0, %eax
jne 0x23c4d
movsd 0xf7cd(%rip), %xmm0     # 0x33410
movsd %xmm0, -0x8(%rbp)
jmp 0x2408c
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x23cd3
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
leaq -0x10(%rbp), %rdi
movl $0x2, %esi
leaq -0x18(%rbp), %rdx
callq 0x240a0
cmpl $0x0, %eax
jne 0x23c8e
movsd 0xf78c(%rip), %xmm0     # 0x33410
movsd %xmm0, -0x8(%rbp)
jmp 0x2408c
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x23cd1
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
leaq -0x10(%rbp), %rdi
movl $0x2, %esi
leaq -0x1c(%rbp), %rdx
callq 0x240a0
cmpl $0x0, %eax
jne 0x23ccf
movsd 0xf74b(%rip), %xmm0     # 0x33410
movsd %xmm0, -0x8(%rbp)
jmp 0x2408c
jmp 0x23cd1
jmp 0x23cd3
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x54, %eax
jne 0x23f37
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
leaq -0x10(%rbp), %rdi
movl $0x2, %esi
leaq -0x20(%rbp), %rdx
callq 0x240a0
cmpl $0x0, %eax
jne 0x23d18
movsd 0xf702(%rip), %xmm0     # 0x33410
movsd %xmm0, -0x8(%rbp)
jmp 0x2408c
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
je 0x23d36
movsd 0xf6e4(%rip), %xmm0     # 0x33410
movsd %xmm0, -0x8(%rbp)
jmp 0x2408c
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
leaq -0x10(%rbp), %rdi
movl $0x2, %esi
leaq -0x24(%rbp), %rdx
callq 0x240a0
cmpl $0x0, %eax
jne 0x23d6b
movsd 0xf6af(%rip), %xmm0     # 0x33410
movsd %xmm0, -0x8(%rbp)
jmp 0x2408c
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
jne 0x23df1
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
leaq -0x10(%rbp), %rdi
movl $0x2, %esi
leaq -0x28(%rbp), %rdx
callq 0x240a0
cmpl $0x0, %eax
jne 0x23dac
movsd 0xf66e(%rip), %xmm0     # 0x33410
movsd %xmm0, -0x8(%rbp)
jmp 0x2408c
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x23def
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
leaq -0x10(%rbp), %rdi
movl $0x3, %esi
leaq -0x2c(%rbp), %rdx
callq 0x240a0
cmpl $0x0, %eax
jne 0x23ded
movsd 0xf62d(%rip), %xmm0     # 0x33410
movsd %xmm0, -0x8(%rbp)
jmp 0x2408c
jmp 0x23def
jmp 0x23df1
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5a, %eax
jne 0x23e15
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x30(%rbp)
jmp 0x23f35
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
je 0x23e31
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x23f27
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0x1, %ecx
cmpl $0x2b, %edx
cmovel %ecx, %eax
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
leaq -0x10(%rbp), %rdi
movl $0x2, %esi
leaq -0x3c(%rbp), %rdx
callq 0x240a0
cmpl $0x0, %eax
jne 0x23e8e
movsd 0xf58c(%rip), %xmm0     # 0x33410
movsd %xmm0, -0x8(%rbp)
jmp 0x2408c
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
jne 0x23ed1
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
leaq -0x10(%rbp), %rdi
movl $0x2, %esi
leaq -0x40(%rbp), %rdx
callq 0x240a0
cmpl $0x0, %eax
jne 0x23ecf
movsd 0xf54b(%rip), %xmm0     # 0x33410
movsd %xmm0, -0x8(%rbp)
jmp 0x2408c
jmp 0x23ed1
cmpl $0x17, -0x3c(%rbp)
jg 0x23edd
cmpl $0x3b, -0x40(%rbp)
jle 0x23eef
movsd 0xf52b(%rip), %xmm0     # 0x33410
movsd %xmm0, -0x8(%rbp)
jmp 0x2408c
cvtsi2sdl -0x44(%rbp), %xmm0
cvtsi2sdl -0x3c(%rbp), %xmm1
cvtsi2sdl -0x40(%rbp), %xmm2
movsd 0xf572(%rip), %xmm3     # 0x33478
mulsd %xmm3, %xmm2
movsd 0xf626(%rip), %xmm3     # 0x33538
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x30(%rbp)
jmp 0x23f33
callq 0x22ec0
cvttsd2si %xmm0, %eax
movl %eax, -0x30(%rbp)
jmp 0x23f35
jmp 0x23f37
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x23f52
movsd 0xf4c8(%rip), %xmm0     # 0x33410
movsd %xmm0, -0x8(%rbp)
jmp 0x2408c
cmpl $0x1, -0x18(%rbp)
jl 0x23f5e
cmpl $0xc, -0x18(%rbp)
jle 0x23f70
movsd 0xf4aa(%rip), %xmm0     # 0x33410
movsd %xmm0, -0x8(%rbp)
jmp 0x2408c
cmpl $0x1, -0x1c(%rbp)
jl 0x23f7c
cmpl $0x1f, -0x1c(%rbp)
jle 0x23f8e
movsd 0xf48c(%rip), %xmm0     # 0x33410
movsd %xmm0, -0x8(%rbp)
jmp 0x2408c
cmpl $0x0, -0x20(%rbp)
jl 0x23f9a
cmpl $0x18, -0x20(%rbp)
jle 0x23fac
movsd 0xf46e(%rip), %xmm0     # 0x33410
movsd %xmm0, -0x8(%rbp)
jmp 0x2408c
cmpl $0x0, -0x24(%rbp)
jl 0x23fb8
cmpl $0x3b, -0x24(%rbp)
jle 0x23fca
movsd 0xf450(%rip), %xmm0     # 0x33410
movsd %xmm0, -0x8(%rbp)
jmp 0x2408c
cmpl $0x0, -0x28(%rbp)
jl 0x23fd6
cmpl $0x3b, -0x28(%rbp)
jle 0x23fe8
movsd 0xf432(%rip), %xmm0     # 0x33410
movsd %xmm0, -0x8(%rbp)
jmp 0x2408c
cmpl $0x0, -0x2c(%rbp)
jl 0x23ff7
cmpl $0x3e7, -0x2c(%rbp)     # imm = 0x3E7
jle 0x24009
movsd 0xf411(%rip), %xmm0     # 0x33410
movsd %xmm0, -0x8(%rbp)
jmp 0x2408c
cmpl $0x18, -0x20(%rbp)
jne 0x24030
cmpl $0x0, -0x24(%rbp)
jne 0x24021
cmpl $0x0, -0x28(%rbp)
jne 0x24021
cmpl $0x0, -0x2c(%rbp)
je 0x24030
movsd 0xf3e7(%rip), %xmm0     # 0x33410
movsd %xmm0, -0x8(%rbp)
jmp 0x2408c
cvtsi2sdl -0x14(%rbp), %xmm0
movl -0x18(%rbp), %eax
subl $0x1, %eax
cvtsi2sd %eax, %xmm1
cvtsi2sdl -0x1c(%rbp), %xmm2
callq 0x23a60
movsd %xmm0, -0x50(%rbp)
cvtsi2sdl -0x20(%rbp), %xmm0
cvtsi2sdl -0x24(%rbp), %xmm1
cvtsi2sdl -0x28(%rbp), %xmm2
cvtsi2sdl -0x2c(%rbp), %xmm3
callq 0x23a00
movaps %xmm0, %xmm1
movsd -0x50(%rbp), %xmm0
callq 0x239d0
movsd %xmm0, -0x38(%rbp)
movsd -0x38(%rbp), %xmm0
cvtsi2sdl -0x30(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)