// File: /workspace/github_c_makefile_star2_O2/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
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x28421(%rip), %rax     # 0x2b938
movups (%rax), %xmm0
movaps %xmm0, (%rsp)
movq 0x24bdb(%rip), %rax     # 0x28100
movq 0x10(%rax), %r12
movq %rax, 0x24c08(%rip)     # 0x28138
xorl %r13d, %r13d
pushq $0x1
popq %rbp
movq (%rbx,%r13), %r15
testq %r15, %r15
je 0x3590
movq (%r14,%r13), %rdi
testq %rdi, %rdi
je 0x3590
movb 0x1a(%r15), %al
cmpb 0x1a(%rdi), %al
jne 0x355b
movq 0x20(%r15), %rax
cmpq 0x20(%rdi), %rax
je 0x3577
callq 0x93b4
movq %r15, %rdi
movq %rax, %rsi
callq 0x952e
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x376d
leaq 0x284b2(%rip), %rax     # 0x2ba30
cmpl $0x0, (%rax)
je 0x358a
movl %ebp, %edi
callq 0xbd3d
addq $0x8, %r13
jmp 0x3536
movq 0x24ba1(%rip), %rax     # 0x28138
movq %r12, 0x10(%rax)
movq %rax, 0x8(%r12)
leaq 0x24b49(%rip), %rbx     # 0x280f0
xorl %r12d, %r12d
leaq 0x262fb(%rip), %r14     # 0x298ac
leaq 0x18a78(%rip), %r15     # 0x1c030
movl $0xfffffe20, %ebp       # imm = 0xFFFFFE20
cmpl $0x0, (%r14)
jg 0x36f3
testq %rbx, %rbx
je 0x36f3
movl (%rbx), %eax
cmpq $0xa, %rax
ja 0x374e
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movq 0x28(%rbx), %r13
movq %r12, 0x18(%rbx)
leaq 0x40(%rbx), %rdi
callq 0x195c7
leaq 0x28433(%rip), %r12     # 0x2ba30
movq (%r13), %rdi
testq %rdi, %rdi
je 0x367c
cmpl $0x0, 0x1c(%rdi)
jle 0x3617
callq 0x19518
addq $0x8, %r13
jmp 0x35fd
testb $0x20, 0x1b(%rdi)
jne 0x360c
cmpl $0x0, (%r12)
je 0x3611
jmp 0x360c
movups 0x18(%rbx), %xmm0
leaq 0x28307(%rip), %rax     # 0x2b938
movups %xmm0, (%rax)
jmp 0x36ea
movq 0x18(%rbx), %rdi
movzwl 0x18(%rdi), %eax
movswl 0x22(%r12), %ecx
cmpl %ecx, %eax
jne 0x372f
callq 0x19518
jmp 0x36ea
movq 0x18(%rbx), %rdi
movq 0x20(%rbx), %rsi
movl 0x28(%rbx), %edx
callq 0x19584
jmp 0x36ea
leaq 0x40(%r12), %rdi
callq 0x195d0
movq 0x18(%r12), %r12
jmp 0x36ea
movq %rbx, %r12
jmp 0x36ea
cmpq $0x0, 0x18(%rbx)
je 0x36ea
leaq 0x18(%rbx), %r13
movq %r13, %rax
movq (%rax), %rax
testq %rax, %rax
je 0x36dd
movl (%rax), %ecx
addl %ebp, %ecx
shrl $0x4, %ecx
cmpl $0x6, %ecx
jae 0x36bd
movq 0x8(%rax), %rdx
testq %rdx, %rdx
je 0x3710
leaq 0x8(%rax), %rcx
movq 0x50(%rdx), %rdx
movq %rdx, (%rcx)
addq $0x30, %rax
jmp 0x368f
cmpl $0x7, %ecx
je 0x36a3
cmpl $0x6, %ecx
jne 0x36b7
movq 0x20(%rax), %rcx
cmpl $0x107, (%rcx)          # imm = 0x107
jne 0x36b7
movq 0x8(%rcx), %rdx
addq $0x8, %rcx
jmp 0x36b0
movq (%r13), %rdi
callq 0x19637
movq %rax, (%r13)
movq 0x10(%rbx), %rbx
jmp 0x35bd
movaps (%rsp), %xmm0
leaq 0x2823a(%rip), %rax     # 0x2b938
movups %xmm0, (%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18b74(%rip), %rdi     # 0x1c28b
leaq 0x18a3a(%rip), %rsi     # 0x1c158
leaq 0x18b71(%rip), %rcx     # 0x1c296
movl $0x8d, %edx
callq 0x30d0
leaq 0x189fc(%rip), %rdi     # 0x1c132
leaq 0x18a1b(%rip), %rsi     # 0x1c158
leaq 0x18a21(%rip), %rcx     # 0x1c165
movl $0xc0, %edx
callq 0x30d0
leaq 0x18a46(%rip), %rdi     # 0x1c19b
leaq 0x189fc(%rip), %rsi     # 0x1c158
leaq 0x18a02(%rip), %rcx     # 0x1c165
movl $0xd2, %edx
callq 0x30d0