// File: /workspace/github_c_makefile_star2_O3/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 0x29273(%rip), %rax     # 0x2c938
movups (%rax), %xmm0
movaps %xmm0, (%rsp)
movq 0x25a2d(%rip), %rax     # 0x29100
movq 0x10(%rax), %r12
movq %rax, 0x25a5a(%rip)     # 0x29138
movq (%rsi), %r15
testq %r15, %r15
je 0x3753
movq %rsi, %rbx
movq %rdi, %r14
xorl %r13d, %r13d
leaq 0x2933a(%rip), %rbp     # 0x2ca30
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 0x9d8b
movq %r15, %rdi
movq %rax, %rsi
callq 0x9f07
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x394a
cmpl $0x0, (%rbp)
je 0x373e
movl $0x1, %edi
callq 0xca14
movq 0x8(%rbx,%r13), %r15
addq $0x8, %r13
testq %r15, %r15
jne 0x36f6
movq 0x259e5(%rip), %rax     # 0x29138
movq %r12, 0x10(%rax)
movq %rax, 0x8(%r12)
leaq 0x27149(%rip), %rbx     # 0x2a8ac
cmpl $0x0, (%rbx)
jle 0x3785
movaps (%rsp), %xmm0
leaq 0x291c5(%rip), %rax     # 0x2c938
movups %xmm0, (%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x25964(%rip), %r14     # 0x290f0
xorl %r12d, %r12d
leaq 0x1a89a(%rip), %r15     # 0x1e030
movl $0xfffffe20, %ebp       # imm = 0xFFFFFE20
movl (%r14), %eax
cmpq $0xa, %rax
ja 0x392b
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movq 0x28(%r14), %r13
movq %r12, 0x18(%r14)
leaq 0x40(%r14), %rdi
callq 0x1ab0f
movq (%r13), %rdi
movq %r14, %r12
testq %rdi, %rdi
je 0x38cd
addq $0x8, %r13
leaq 0x29253(%rip), %r12     # 0x2ca30
cmpl $0x0, 0x1c(%rdi)
jle 0x37fa
callq 0x1aa39
movq (%r13), %rdi
addq $0x8, %r13
testq %rdi, %rdi
jne 0x37dd
jmp 0x38e8
testb $0x20, 0x1b(%rdi)
jne 0x37e3
cmpl $0x0, (%r12)
je 0x37e8
jmp 0x37e3
movups 0x18(%r14), %xmm0
leaq 0x29123(%rip), %rax     # 0x2c938
movups %xmm0, (%rax)
jmp 0x38cd
movq 0x18(%r14), %rdi
movzwl 0x18(%rdi), %eax
movswl 0x22(%r12), %ecx
cmpl %ecx, %eax
jne 0x390c
callq 0x1aa39
jmp 0x38cd
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
movl 0x28(%r14), %edx
callq 0x1aacc
jmp 0x38cd
leaq 0x40(%r12), %rdi
callq 0x1ab18
movq 0x18(%r12), %r12
jmp 0x38cd
cmpq $0x0, 0x18(%r14)
je 0x38cd
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x38c2
movl (%rax), %ecx
addl %ebp, %ecx
shrl $0x4, %ecx
cmpl $0x6, %ecx
jae 0x389c
movq 0x8(%rax), %rdx
testq %rdx, %rdx
je 0x38ed
leaq 0x8(%rax), %rcx
movq 0x50(%rdx), %rdx
movq %rdx, (%rcx)
movq 0x30(%rax), %rax
testq %rax, %rax
jne 0x3871
jmp 0x38bc
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
jmp 0x38c4
xorl %edi, %edi
callq 0x1ab7f
movq %rax, 0x18(%r14)
cmpl $0x0, (%rbx)
jg 0x3768
movq 0x10(%r14), %r14
testq %r14, %r14
jne 0x379b
jmp 0x3768
movq %r14, %r12
jmp 0x38cd
leaq 0x1a997(%rip), %rdi     # 0x1e28b
leaq 0x1a85d(%rip), %rsi     # 0x1e158
leaq 0x1a994(%rip), %rcx     # 0x1e296
movl $0x8d, %edx
callq 0x30d0
leaq 0x1a81f(%rip), %rdi     # 0x1e132
leaq 0x1a83e(%rip), %rsi     # 0x1e158
leaq 0x1a844(%rip), %rcx     # 0x1e165
movl $0xc0, %edx
callq 0x30d0
leaq 0x1a869(%rip), %rdi     # 0x1e19b
leaq 0x1a81f(%rip), %rsi     # 0x1e158
leaq 0x1a825(%rip), %rcx     # 0x1e165
movl $0xd2, %edx
callq 0x30d0