// File: /workspace/github_c_makefile_star2_O2/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 0x5448
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movb (%rdi), %al
testb %al, %al
je 0x54ff
movq %rsi, %rbx
testl %edx, %edx
setne %cl
cmpb $0x2d, %al
sete %bpl
andb %cl, %bpl
movzbl %bpl, %eax
addq %rax, %r14
leaq 0x3fe4(%rip), %rsi      # 0x93fe
movq %r14, %rdi
callq 0x8b4c
xorl %r15d, %r15d
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x2200
cmpl $0x1, %eax
jne 0x544b
andl $0x0, 0x8(%rsp)
andl $0x0, 0xc(%rsp)
jmp 0x54b5
xorl %eax, %eax
retq
leaq 0x3fb0(%rip), %rsi      # 0x9402
movq %r14, %rdi
callq 0x8b4c
xorl %r15d, %r15d
leaq 0x10(%rsp), %rdx
leaq 0xc(%rsp), %rcx
movq %r14, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x2200
cmpl $0x2, %eax
jne 0x5480
andl $0x0, 0x8(%rsp)
jmp 0x54b5
leaq 0x3f82(%rip), %rsi      # 0x9409
movq %r14, %rdi
callq 0x8b4c
leaq 0x10(%rsp), %rdx
leaq 0xc(%rsp), %rcx
leaq 0x8(%rsp), %r8
movq %r14, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x2200
cmpl $0x3, %eax
jne 0x54df
movl 0x8(%rsp), %r15d
movq 0x10(%rsp), %rax
testq %rax, %rax
sets %dl
movl 0xc(%rsp), %ecx
cmpl $0x3c, %ecx
setae %sil
cmpl $0x3d, %r15d
setae %dil
orb %sil, %dil
orb %dl, %dil
cmpb $0x1, %dil
jne 0x54e4
movq %rbx, %rdi
jmp 0x54fa
movabsq $0x91a2b3c4d5e70, %rdx  # imm = 0x91A2B3C4D5E70
cmpq %rdx, %rax
jb 0x550c
leaq 0x3f19(%rip), %rdi      # 0x9413
callq 0x5251
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movb 0x7cde(%rip), %dl       # 0xd1f0
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 0x5551
leaq 0x3ee5(%rip), %rdi      # 0x9421
callq 0x51bf
movq 0x10(%rsp), %rax
cmpb $0x0, 0x7ca3(%rip)      # 0xd1f0
jne 0x5556
jmp 0x557e
testb $0x1, %dl
je 0x557e
cmpq $0x18, %rax
jle 0x556f
leaq 0x3eec(%rip), %rdi      # 0x944f
callq 0x51bf
movq 0x10(%rsp), %rax
jmp 0x557e
jne 0x557e
movl 0x8(%rsp), %eax
orl 0xc(%rsp), %eax
jne 0x555c
pushq $0x18
popq %rax
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 0x5501