// File: /workspace/github_c_makefile_star2_O1/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 0x5a9e
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movb (%rdi), %al
testb %al, %al
je 0x5bd9
movq %rsi, %rbx
testl %edx, %edx
setne %cl
cmpb $0x2d, %al
sete %bpl
andb %cl, %bpl
movzbl %bpl, %eax
addq %rax, %r14
leaq 0x496c(%rip), %rsi      # 0xa3dc
movq %r14, %rdi
callq 0x9a58
xorl %r15d, %r15d
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x2210
cmpl $0x1, %eax
jne 0x5aa1
movl %r15d, 0x8(%rsp)
movl %r15d, 0xc(%rsp)
jmp 0x5b0a
xorl %eax, %eax
retq
leaq 0x4938(%rip), %rsi      # 0xa3e0
movq %r14, %rdi
callq 0x9a58
leaq 0x10(%rsp), %rdx
leaq 0xc(%rsp), %rcx
movq %r14, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x2210
cmpl $0x2, %eax
jne 0x5ad6
movl $0x0, 0x8(%rsp)
jmp 0x5b0a
leaq 0x490a(%rip), %rsi      # 0xa3e7
movq %r14, %rdi
callq 0x9a58
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 0x5bc8
movq 0x10(%rsp), %rax
testq %rax, %rax
js 0x5bc8
movl 0xc(%rsp), %ecx
cmpl $0x3b, %ecx
ja 0x5bc8
movl 0x8(%rsp), %edx
cmpl $0x3d, %edx
jae 0x5bc8
movabsq $0x91a2b3c4d5e70, %rsi  # imm = 0x91A2B3C4D5E70
cmpq %rsi, %rax
jge 0x5bcd
cmpq $0x18, %rax
sete %al
andb 0x86ae(%rip), %al       # 0xe200
testl %ecx, %ecx
sete %cl
testl %edx, %edx
sete %dl
andb %cl, %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x5b71
leaq 0x4893(%rip), %rdi      # 0xa3ff
callq 0x5891
cmpb $0x1, 0x8688(%rip)      # 0xe200
jne 0x5b9c
cmpq $0x18, 0x10(%rsp)
jle 0x5b90
leaq 0x48a4(%rip), %rdi      # 0xa42d
callq 0x5891
jmp 0x5b9c
jne 0x5b9c
movl 0x8(%rsp), %eax
orl 0xc(%rsp), %eax
jne 0x5b82
imulq $0xe10, 0x10(%rsp), %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 0x5bdb
movq %rbx, %rdi
jmp 0x5bd4
leaq 0x481d(%rip), %rdi      # 0xa3f1
callq 0x2300
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq