// File: /workspace/github_c_makefile_star2_O1/Oric4ever[P]lcc65/6502/build/../src/dag.c
// Function: gencode
void gencode(Symbol caller[], Symbol callee[]) {
	int i;
	Code bp, cp;
	Symbol p, q;
	Coordinate save;

	save = src;
	cp = codehead.next->next;
	codelist = codehead.next;
	for (i = 0; (p = callee[i]) && (q = caller[i]); i++)
		if (p->sclass != q->sclass || p->type != q->type) {
			walk(asgn(p, idnode(q)), 0, 0);
			if (glevel) {
				stabsym(p);
				stabsym(q);
				swtoseg(CODE);
			}
		} else if (glevel) {
			stabsym(p);
			swtoseg(CODE);
		}
	codelist->next = cp;
	cp->prev = codelist;
	for (bp = 0, cp = &codehead; errcnt <= 0 && cp; cp = cp->next)
		switch (cp->kind) {
		case Start: case Asm: case Switch:
			break;
		case Defpoint:
			src = cp->u.point.src;
			break;
		case Blockbeg: {
			Symbol *p = cp->u.block.locals;
			cp->u.block.prev = bp;
			bp = cp;
			blockbeg(&bp->u.block.x);
			for ( ; *p; p++)
				if ((*p)->ref > 0 || (*p)->initialized || glevel)
					local(*p);
			break;
			}
		case Blockend:
			blockend(&bp->u.block.x);
			bp = bp->u.block.prev;
			break;
		case Local:
			assert(cp->u.var->scope == bp->u.block.level);
			local(cp->u.var);
			break;
		case Address:
			address(cp->u.addr.sym, cp->u.addr.base, cp->u.addr.offset);
			break;
		case Jump:
			if (cp->u.node == 0)
				break;
			/* else fall thru */
		case Gen: case Label:
			fixup(cp->u.node);
#ifdef NODAG
			cp->u.node = gen(undag(cp->u.node));
#else
			cp->u.node = gen(cp->u.node);
#endif
			break;
		default:assert(0);
		}
	src = save;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x28273(%rip), %rax     # 0x2b938
movups (%rax), %xmm0
movaps %xmm0, (%rsp)
movq 0x24a2d(%rip), %rax     # 0x28100
movq 0x10(%rax), %r12
movq %rax, 0x24a5a(%rip)     # 0x28138
movq (%rsi), %r15
testq %r15, %r15
je 0x374c
movq %rsi, %rbx
movq %rdi, %r14
xorl %r13d, %r13d
leaq 0x2833a(%rip), %rbp     # 0x2ba30
movq (%r14,%r13), %rdi
testq %rdi, %rdi
je 0x374c
movb 0x1a(%r15), %al
cmpb 0x1a(%rdi), %al
jne 0x3712
movq 0x20(%r15), %rax
cmpq 0x20(%rdi), %rax
je 0x372e
callq 0x9d77
movq %r15, %rdi
movq %rax, %rsi
callq 0x9efb
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3941
cmpl $0x0, (%rbp)
je 0x373e
movl $0x1, %edi
callq 0xca48
movq 0x8(%rbx,%r13), %r15
addq $0x8, %r13
testq %r15, %r15
jne 0x36f6
movq 0x249e5(%rip), %rax     # 0x28138
movq %r12, 0x10(%rax)
movq %rax, 0x8(%r12)
leaq 0x26149(%rip), %rbx     # 0x298ac
cmpl $0x0, (%rbx)
jle 0x3785
movaps (%rsp), %xmm0
leaq 0x281c5(%rip), %rax     # 0x2b938
movups %xmm0, (%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x24964(%rip), %r14     # 0x280f0
xorl %r12d, %r12d
leaq 0x1a89a(%rip), %r15     # 0x1e030
movl $0xfffffe20, %ebp       # imm = 0xFFFFFE20
movl (%r14), %eax
cmpq $0xa, %rax
ja 0x3922
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movq 0x28(%r14), %r13
movq %r12, 0x18(%r14)
leaq 0x40(%r14), %rdi
callq 0x1ad5a
movq (%r13), %rdi
movq %r14, %r12
testq %rdi, %rdi
je 0x38c4
addq $0x8, %r13
leaq 0x28253(%rip), %r12     # 0x2ba30
cmpl $0x0, 0x1c(%rdi)
jle 0x37fa
callq 0x1ac84
movq (%r13), %rdi
addq $0x8, %r13
testq %rdi, %rdi
jne 0x37dd
jmp 0x38df
testb $0x20, 0x1b(%rdi)
jne 0x37e3
cmpl $0x0, (%r12)
je 0x37e8
jmp 0x37e3
movups 0x18(%r14), %xmm0
leaq 0x28123(%rip), %rax     # 0x2b938
movups %xmm0, (%rax)
jmp 0x38c4
movq 0x18(%r14), %rdi
movzwl 0x18(%rdi), %eax
movswl 0x22(%r12), %ecx
cmpl %ecx, %eax
jne 0x3903
callq 0x1ac84
jmp 0x38c4
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
movl 0x28(%r14), %edx
callq 0x1ad17
jmp 0x38c4
leaq 0x40(%r12), %rdi
callq 0x1ad63
movq 0x18(%r12), %r12
jmp 0x38c4
cmpq $0x0, 0x18(%r14)
je 0x38c4
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x38b7
movl (%rax), %ecx
addl %ebp, %ecx
shrl $0x4, %ecx
cmpl $0x6, %ecx
jae 0x3897
movq 0x8(%rax), %rdx
testq %rdx, %rdx
je 0x38e4
leaq 0x8(%rax), %rcx
movq 0x50(%rdx), %rdx
movq %rdx, (%rcx)
movq 0x30(%rax), %rax
jmp 0x386c
cmpl $0x7, %ecx
je 0x387d
cmpl $0x6, %ecx
jne 0x3891
movq 0x20(%rax), %rcx
cmpl $0x107, (%rcx)          # imm = 0x107
jne 0x3891
movq 0x8(%rcx), %rdx
addq $0x8, %rcx
jmp 0x388a
movq 0x18(%r14), %rdi
callq 0x1adca
movq %rax, 0x18(%r14)
cmpl $0x0, (%rbx)
jg 0x3768
movq 0x10(%r14), %r14
testq %r14, %r14
jne 0x379b
jmp 0x3768
movq %r14, %r12
jmp 0x38c4
leaq 0x1a9a0(%rip), %rdi     # 0x1e28b
leaq 0x1a866(%rip), %rsi     # 0x1e158
leaq 0x1a99d(%rip), %rcx     # 0x1e296
movl $0x8d, %edx
callq 0x30d0
leaq 0x1a828(%rip), %rdi     # 0x1e132
leaq 0x1a847(%rip), %rsi     # 0x1e158
leaq 0x1a84d(%rip), %rcx     # 0x1e165
movl $0xc0, %edx
callq 0x30d0
leaq 0x1a872(%rip), %rdi     # 0x1e19b
leaq 0x1a828(%rip), %rsi     # 0x1e158
leaq 0x1a82e(%rip), %rcx     # 0x1e165
movl $0xd2, %edx
callq 0x30d0