// File: /workspace/github_c_makefile_star2_O0/mist64[P]cbm6502asm/src/direct2.c
// Function: dir2equ
int dir2equ() {
	/* handle the various forms of equates */

	long l;
	int i;
	char *sym = 0, *equal = 0, *exp = 0, localsym[34];

	if (!strchr(p1, '=') && !strchr(p2, '=') && *s3 != '=')
		return 0;                 /* not equate */
	if (!(equal = strchr(line, '='))) /* search for = */
		return 0;                 /* this isn't an equate */
	exp = strchr(line, ';');          /* check for comments */
	if (exp && exp < equal) return 0; /* there was ; before = */
	for (exp = equal + 1; isspace(*exp) && *exp; exp++)
		; /* point to expression */
	for (sym = equal - 1; isspace(*sym) && sym >= line; sym--)
		; /* find non-space */
	for (; !isspace(*sym) && sym >= line; sym--)
		; /* find space */
	sym++;    /* point to symbol */

	if (sym != line && !isspace(*line)) /* optional label on line */
		if (good_label(s1)) get_label(s1, 1);

	known = evaluate(exp, &l); /* evaluate expression */
	equ = TRUE;
	if (*sym == '*')
		if (sym[1] != '=' && !isspace(sym[1]))
			display_error(error = 'S');
		else if (known)
			loc_cntr = l;
		else
			display_error(error = 'U');
	else {
		if (isdigit(*sym)) {
			for (i = 0; isdigit(*sym); sym++)
				i = i * 10 + *sym - '0';
			makelocal(i, localsym);
			insert_symbol(localsym, l, 1, expdef, TRUE);
		} else {
			for (i = 0; i < 32; i++)
				if (isspace(sym[i]) || sym[i] == '=') {
					localsym[i] = 0;
					break;
				} else
					localsym[i] = toupper(sym[i]);
			insert_symbol(localsym, l, 1, expdef, FALSE);
		}
		ptr->value = l;
		ptr->known |= known;
		ptr->equate = TRUE;
	}
	data = 2;
	d[0] = l >> 8 & 255;
	d[1] = l & 255;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
leaq 0xcac9(%rip), %rdi      # 0x109f0
movl $0x3d, %esi
callq 0x10c0
cmpq $0x0, %rax
jne 0x3f6c
leaq 0xd032(%rip), %rdi      # 0x10f70
movl $0x3d, %esi
callq 0x10c0
cmpq $0x0, %rax
jne 0x3f6c
leaq 0xd13b(%rip), %rax      # 0x11090
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x3d, %eax
je 0x3f6c
movl $0x0, -0x4(%rbp)
jmp 0x43b5
leaq 0xd12d(%rip), %rdi      # 0x110a0
movl $0x3d, %esi
callq 0x10c0
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x3f93
movl $0x0, -0x4(%rbp)
jmp 0x43b5
leaq 0xd106(%rip), %rdi      # 0x110a0
movl $0x3b, %esi
callq 0x10c0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x3fc5
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x3fc5
movl $0x0, -0x4(%rbp)
jmp 0x43b5
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
callq 0x1200
movq (%rax), %rax
movq -0x30(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x2000, %ecx           # imm = 0x2000
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x61(%rbp)
je 0x4007
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x4010
jmp 0x4020
jmp 0x4012
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x3fd1
movq -0x28(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
callq 0x1200
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x2000, %ecx           # imm = 0x2000
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x62(%rbp)
je 0x4063
leaq 0xd047(%rip), %rax      # 0x110a0
cmpq %rax, -0x20(%rbp)
setae %al
movb %al, -0x62(%rbp)
movb -0x62(%rbp), %al
testb $0x1, %al
jne 0x406c
jmp 0x407c
jmp 0x406e
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x402c
jmp 0x407e
callq 0x1200
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x2000, %ecx           # imm = 0x2000
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x63(%rbp)
jne 0x40b5
leaq 0xcff5(%rip), %rax      # 0x110a0
cmpq %rax, -0x20(%rbp)
setae %al
movb %al, -0x63(%rbp)
movb -0x63(%rbp), %al
testb $0x1, %al
jne 0x40be
jmp 0x40ce
jmp 0x40c0
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x407e
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
leaq 0xcfbf(%rip), %rax      # 0x110a0
cmpq %rax, -0x20(%rbp)
je 0x4134
callq 0x1200
movq (%rax), %rax
leaq 0xcfaa(%rip), %rcx      # 0x110a0
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x4134
leaq 0xc967(%rip), %rax      # 0x10a78
movq (%rax), %rdi
callq 0xafb0
cmpl $0x0, %eax
je 0x4132
leaq 0xc953(%rip), %rax      # 0x10a78
movq (%rax), %rdi
movl $0x1, %esi
callq 0xb100
jmp 0x4134
movq -0x30(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x6690
movb %al, %cl
leaq 0xd169(%rip), %rax      # 0x112b3
movb %cl, (%rax)
leaq 0xd15f(%rip), %rax      # 0x112b2
movb $0x1, (%rax)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
jne 0x41dd
movq -0x20(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x3d, %eax
je 0x41a6
callq 0x1200
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movsbl 0x1(%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x41a6
leaq 0xcc49(%rip), %rax      # 0x10de0
movb $0x53, (%rax)
movl $0x53, %edi
callq 0x2350
jmp 0x41d8
leaq 0xd106(%rip), %rax      # 0x112b3
cmpb $0x0, (%rax)
je 0x41c2
movq -0x10(%rbp), %rcx
leaq 0xc643(%rip), %rax      # 0x10800
movq %rcx, (%rax)
jmp 0x41d6
leaq 0xcc17(%rip), %rax      # 0x10de0
movb $0x55, (%rax)
movl $0x55, %edi
callq 0x2350
jmp 0x41d8
jmp 0x4375
callq 0x1200
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x4275
movl $0x0, -0x14(%rbp)
callq 0x1200
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x4245
imull $0xa, -0x14(%rbp), %eax
movq -0x20(%rbp), %rcx
movsbl (%rcx), %ecx
addl %ecx, %eax
subl $0x30, %eax
movl %eax, -0x14(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x4204
movl -0x14(%rbp), %edi
leaq -0x60(%rbp), %rsi
callq 0xc280
leaq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq 0xcb68(%rip), %rax      # 0x10dc8
movl (%rax), %ecx
movl $0x1, %r8d
movl %r8d, %edx
callq 0xc340
jmp 0x4309
movl $0x0, -0x14(%rbp)
cmpl $0x20, -0x14(%rbp)
jge 0x42eb
callq 0x1200
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movslq -0x14(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x42b8
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3d, %eax
jne 0x42c3
movslq -0x14(%rbp), %rax
movb $0x0, -0x60(%rbp,%rax)
jmp 0x42eb
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x1080
movb %al, %cl
movslq -0x14(%rbp), %rax
movb %cl, -0x60(%rbp,%rax)
jmp 0x42e0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x427c
leaq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq 0xcace(%rip), %rax      # 0x10dc8
movl (%rax), %ecx
movl $0x1, %edx
xorl %r8d, %r8d
callq 0xc340
movq -0x10(%rbp), %rcx
leaq 0xc91c(%rip), %rax      # 0x10c30
movq (%rax), %rax
movq %rcx, 0x18(%rax)
leaq 0xcf91(%rip), %rax      # 0x112b3
movsbl (%rax), %edx
leaq 0xc904(%rip), %rax      # 0x10c30
movq (%rax), %rax
movw 0x20(%rax), %cx
shrw $0x8, %cx
andw $0x1, %cx
movzwl %cx, %ecx
orl %edx, %ecx
movw %cx, %dx
movw 0x20(%rax), %cx
andw $0x1, %dx
shlw $0x8, %dx
andw $0xfeff, %cx            # imm = 0xFEFF
orw %dx, %cx
movw %cx, 0x20(%rax)
leaq 0xc8ce(%rip), %rax      # 0x10c30
movq (%rax), %rax
movw 0x20(%rax), %cx
andw $-0x21, %cx
orw $0x20, %cx
movw %cx, 0x20(%rax)
leaq 0xcf35(%rip), %rax      # 0x112b1
movb $0x2, (%rax)
movq -0x10(%rbp), %rax
sarq $0x8, %rax
andq $0xff, %rax
movb %al, %cl
leaq 0xce1a(%rip), %rax      # 0x111b0
movb %cl, (%rax)
movq -0x10(%rbp), %rax
andq $0xff, %rax
movb %al, %cl
leaq 0xce05(%rip), %rax      # 0x111b0
movb %cl, 0x1(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nop