// File: /workspace/github_c_makefile_star2_O3/lyda[P]tz/zic.c
// Function: gethms
static long
gethms(string, errstring, signable)
const char *		string;
const char * const	errstring;
const int		signable;
{
	long	hh;
	int	mm, ss, sign;

	if (string == NULL || *string == '\0')
		return 0;
	if (!signable)
		sign = 1;
	else if (*string == '-') {
		sign = -1;
		++string;
	} else	sign = 1;
	if (sscanf(string, scheck(string, "%ld"), &hh) == 1)
		mm = ss = 0;
	else if (sscanf(string, scheck(string, "%ld:%d"), &hh, &mm) == 2)
		ss = 0;
	else if (sscanf(string, scheck(string, "%ld:%d:%d"),
		&hh, &mm, &ss) != 3) {
			error(errstring);
			return 0;
	}
	if (hh < 0 ||
		mm < 0 || mm >= MINSPERHOUR ||
		ss < 0 || ss > SECSPERMIN) {
			error(errstring);
			return 0;
	}
	if (LONG_MAX / SECSPERHOUR < hh) {
		error(_("time overflow"));
		return 0;
	}
	if (noise && hh == HOURSPERDAY && mm == 0 && ss == 0)
		warning(_("24:00 not handled by pre-1998 versions of zic"));
	if (noise && (hh > HOURSPERDAY ||
		(hh == HOURSPERDAY && (mm != 0 || ss != 0))))
warning(_("values over 24 hours not handled by pre-2007 versions of zic"));
	return oadd(eitol(sign) * hh * eitol(SECSPERHOUR),
		    eitol(sign) * (eitol(mm) * eitol(SECSPERMIN) + eitol(ss)));
}

// Assembly:
testq %rdi, %rdi
je 0x5c9a
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movb (%rdi), %al
testb %al, %al
je 0x5df5
movq %rsi, %rbx
testl %edx, %edx
setne %cl
cmpb $0x2d, %al
sete %bpl
andb %cl, %bpl
movzbl %bpl, %eax
addq %rax, %r14
leaq 0x47e2(%rip), %rsi      # 0xa44e
movq %r14, %rdi
callq 0x9b34
xorl %r15d, %r15d
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x2210
cmpl $0x1, %eax
jne 0x5c9d
movl %r15d, 0x8(%rsp)
movl %r15d, 0xc(%rsp)
jmp 0x5d0e
xorl %eax, %eax
retq
leaq 0x47ae(%rip), %rsi      # 0xa452
movq %r14, %rdi
callq 0x9b34
xorl %r15d, %r15d
leaq 0x10(%rsp), %rdx
leaq 0xc(%rsp), %rcx
movq %r14, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x2210
cmpl $0x2, %eax
jne 0x5cd5
movl $0x0, 0x8(%rsp)
jmp 0x5d0e
leaq 0x477d(%rip), %rsi      # 0xa459
movq %r14, %rdi
callq 0x9b34
leaq 0x10(%rsp), %rdx
leaq 0xc(%rsp), %rcx
leaq 0x8(%rsp), %r8
movq %r14, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x2210
cmpl $0x3, %eax
jne 0x5de4
movl 0x8(%rsp), %r15d
movq 0x10(%rsp), %rax
testq %rax, %rax
js 0x5de4
movl 0xc(%rsp), %ecx
cmpl $0x3b, %ecx
ja 0x5de4
cmpl $0x3d, %r15d
jae 0x5de4
movabsq $0x91a2b3c4d5e70, %rdx  # imm = 0x91A2B3C4D5E70
cmpq %rdx, %rax
jae 0x5de9
movb 0x84b4(%rip), %dl       # 0xe200
cmpq $0x18, %rax
sete %sil
andb %dl, %sil
testl %ecx, %ecx
sete %cl
testl %r15d, %r15d
sete %dil
andb %cl, %dil
andb %sil, %dil
cmpb $0x1, %dil
jne 0x5d8b
leaq 0x46fb(%rip), %rdi      # 0xa471
callq 0x5a8d
movq 0x10(%rsp), %rax
cmpb $0x0, 0x8479(%rip)      # 0xe200
jne 0x5d90
jmp 0x5dba
testb $0x1, %dl
je 0x5dba
cmpq $0x18, %rax
jle 0x5da9
leaq 0x4702(%rip), %rdi      # 0xa49f
callq 0x5a8d
movq 0x10(%rsp), %rax
jmp 0x5dba
jne 0x5dba
movl 0x8(%rsp), %ecx
movl $0x18, %eax
orl 0xc(%rsp), %ecx
jne 0x5d96
imulq $0xe10, %rax, %rax      # imm = 0xE10
movslq 0xc(%rsp), %rcx
imulq $0x3c, %rcx, %rcx
movslq 0x8(%rsp), %rdx
addq %rax, %rdx
addq %rcx, %rdx
movq %rdx, %rax
negq %rax
testb %bpl, %bpl
cmoveq %rdx, %rax
jmp 0x5df7
movq %rbx, %rdi
jmp 0x5df0
leaq 0x4673(%rip), %rdi      # 0xa463
callq 0x2300
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq