// File: /workspace/github_c_makefile_star2_O0/lyda[P]tz/zic.c
// Function: stringzone
static void
stringzone(result, zpfirst, zonecount)
char *				result;
const struct zone * const	zpfirst;
const int			zonecount;
{
	register const struct zone *	zp;
	register struct rule *		rp;
	register struct rule *		stdrp;
	register struct rule *		dstrp;
	register int			i;
	register const char *		abbrvar;

	result[0] = '\0';
	zp = zpfirst + zonecount - 1;
	stdrp = dstrp = NULL;
	for (i = 0; i < zp->z_nrules; ++i) {
		rp = &zp->z_rules[i];
		if (rp->r_hiwasnum || rp->r_hiyear != INT_MAX)
			continue;
		if (rp->r_yrtype != NULL)
			continue;
		if (rp->r_stdoff == 0) {
			if (stdrp == NULL)
				stdrp = rp;
			else	return;
		} else {
			if (dstrp == NULL)
				dstrp = rp;
			else	return;
		}
	}
	if (stdrp == NULL && dstrp == NULL) {
		/*
		** There are no rules running through "max".
		** Let's find the latest rule.
		*/
		for (i = 0; i < zp->z_nrules; ++i) {
			rp = &zp->z_rules[i];
			if (stdrp == NULL || rp->r_hiyear > stdrp->r_hiyear ||
				(rp->r_hiyear == stdrp->r_hiyear &&
				rp->r_month > stdrp->r_month))
					stdrp = rp;
		}
		if (stdrp != NULL && stdrp->r_stdoff != 0)
			return;	/* We end up in DST (a POSIX no-no). */
		/*
		** Horrid special case: if year is 2037,
		** presume this is a zone handled on a year-by-year basis;
		** do not try to apply a rule to the zone.
		*/
		if (stdrp != NULL && stdrp->r_hiyear == 2037)
			return;
	}
	if (stdrp == NULL && (zp->z_nrules != 0 || zp->z_stdoff != 0))
		return;
	abbrvar = (stdrp == NULL) ? "" : stdrp->r_abbrvar;
	doabbr(result, zp->z_format, abbrvar, FALSE, TRUE);
	if (stringoffset(end(result), -zp->z_gmtoff) != 0) {
		result[0] = '\0';
		return;
	}
	if (dstrp == NULL)
		return;
	doabbr(end(result), zp->z_format, dstrp->r_abbrvar, TRUE, TRUE);
	if (dstrp->r_stdoff != SECSPERMIN * MINSPERHOUR)
		if (stringoffset(end(result),
			-(zp->z_gmtoff + dstrp->r_stdoff)) != 0) {
				result[0] = '\0';
				return;
		}
	(void) strcat(result, ",");
	if (stringrule(result, dstrp, dstrp->r_stdoff, zp->z_gmtoff) != 0) {
		result[0] = '\0';
		return;
	}
	(void) strcat(result, ",");
	if (stringrule(result, stdrp, dstrp->r_stdoff, zp->z_gmtoff) != 0) {
		result[0] = '\0';
		return;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
imulq $0xc0, %rcx, %rcx
addq %rcx, %rax
addq $-0xc0, %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x40(%rcx), %eax
jge 0x6935
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, 0x2c(%rax)
jne 0x68db
movq -0x28(%rbp), %rax
cmpl $0x7fffffff, 0x1c(%rax) # imm = 0x7FFFFFFF
je 0x68dd
jmp 0x6927
movq -0x28(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x68ea
jmp 0x6927
movq -0x28(%rbp), %rax
cmpq $0x0, 0x50(%rax)
jne 0x690d
cmpq $0x0, -0x30(%rbp)
jne 0x6906
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x690b
jmp 0x6b7d
jmp 0x6925
cmpq $0x0, -0x38(%rbp)
jne 0x691e
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x6923
jmp 0x6b7d
jmp 0x6925
jmp 0x6927
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x689d
cmpq $0x0, -0x30(%rbp)
jne 0x69f3
cmpq $0x0, -0x38(%rbp)
jne 0x69f3
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x40(%rcx), %eax
jge 0x69c1
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x69ac
movq -0x28(%rbp), %rax
movl 0x1c(%rax), %eax
movq -0x30(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jg 0x69ac
movq -0x28(%rbp), %rax
movl 0x1c(%rax), %eax
movq -0x30(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jne 0x69b4
movq -0x28(%rbp), %rax
movl 0x30(%rax), %eax
movq -0x30(%rbp), %rcx
cmpl 0x30(%rcx), %eax
jle 0x69b4
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x69b6
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x6952
cmpq $0x0, -0x30(%rbp)
je 0x69d8
movq -0x30(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x69d8
jmp 0x6b7d
cmpq $0x0, -0x30(%rbp)
je 0x69f1
movq -0x30(%rbp), %rax
cmpl $0x7f5, 0x1c(%rax)      # imm = 0x7F5
jne 0x69f1
jmp 0x6b7d
jmp 0x69f3
cmpq $0x0, -0x30(%rbp)
jne 0x6a14
movq -0x20(%rbp), %rax
cmpl $0x0, 0x40(%rax)
jne 0x6a0f
movq -0x20(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x6a14
jmp 0x6b7d
cmpq $0x0, -0x30(%rbp)
jne 0x6a28
leaq 0x79aa(%rip), %rax      # 0xe3cc
movq %rax, -0x50(%rbp)
jmp 0x6a34
movq -0x30(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x48(%rbp), %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x6b90
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x20f0
movq %rax, %rdi
movq -0x20(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %esi
subq 0x18(%rax), %rsi
callq 0x8480
cmpl $0x0, %eax
je 0x6a89
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
jmp 0x6b7d
cmpq $0x0, -0x38(%rbp)
jne 0x6a95
jmp 0x6b7d
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x20f0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x38(%rbp), %rax
movq 0x58(%rax), %rdx
movl $0x1, %r8d
movl %r8d, %ecx
callq 0x6b90
movq -0x38(%rbp), %rax
cmpq $0xe10, 0x50(%rax)      # imm = 0xE10
je 0x6b09
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x20f0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x38(%rbp), %rcx
addq 0x50(%rcx), %rax
xorl %ecx, %ecx
movl %ecx, %esi
subq %rax, %rsi
callq 0x8480
cmpl $0x0, %eax
je 0x6b07
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
jmp 0x6b7d
jmp 0x6b09
movq -0x8(%rbp), %rdi
leaq 0x80f1(%rip), %rsi      # 0xec05
callq 0x2240
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x38(%rbp), %rax
movq 0x50(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
callq 0x85a0
cmpl $0x0, %eax
je 0x6b44
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
jmp 0x6b7d
movq -0x8(%rbp), %rdi
leaq 0x80b6(%rip), %rsi      # 0xec05
callq 0x2240
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rax
movq 0x50(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
callq 0x85a0
cmpl $0x0, %eax
je 0x6b7d
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)