// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x3a3a1(%rip), %rax     # 0x3dad8
movq (%rax), %rcx
movq %rcx, -0x48(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq 0x359a3(%rip), %rax     # 0x390f0
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq 0x35994(%rip), %rax     # 0x390f0
movq %rax, 0x359c5(%rip)     # 0x39128
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq %rcx, -0x30(%rbp)
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x51(%rbp)
je 0x379f
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
setne %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
testb $0x1, %al
jne 0x37ab
jmp 0x383a
movq -0x30(%rbp), %rax
movzbl 0x1a(%rax), %eax
movq -0x38(%rbp), %rcx
movzbl 0x1a(%rcx), %ecx
cmpl %ecx, %eax
jne 0x37d1
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x38(%rbp), %rcx
cmpq 0x20(%rcx), %rax
je 0x3812
movq -0x30(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x38(%rbp), %rdi
callq 0xddf0
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0xe0f0
movq %rax, %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x3a80
leaq 0x3a3ff(%rip), %rax     # 0x3dc00
cmpl $0x0, (%rax)
je 0x3810
movl $0x1, %edi
callq 0x12a40
jmp 0x382a
leaq 0x3a3e7(%rip), %rax     # 0x3dc00
cmpl $0x0, (%rax)
je 0x3828
movl $0x1, %edi
callq 0x12a40
jmp 0x382a
jmp 0x382c
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x376a
movq -0x28(%rbp), %rcx
movq 0x358e3(%rip), %rax     # 0x39128
movq %rcx, 0x10(%rax)
movq 0x358d8(%rip), %rcx     # 0x39128
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq $0x0, -0x20(%rbp)
leaq 0x35879(%rip), %rax     # 0x390e0
movq %rax, -0x28(%rbp)
xorl %eax, %eax
leaq 0x381c8(%rip), %rcx     # 0x3ba3c
cmpl $0x0, (%rcx)
movb %al, -0x61(%rbp)
jg 0x3887
cmpq $0x0, -0x28(%rbp)
setne %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x3893
jmp 0x3a5b
movq -0x28(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x70(%rbp)
subq $0xa, %rax
ja 0x3a29
movq -0x70(%rbp), %rax
leaq 0x2b77e(%rip), %rcx     # 0x2f030
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x3a48
movq -0x28(%rbp), %rcx
leaq 0x3a20d(%rip), %rax     # 0x3dad8
movq 0x18(%rcx), %rdx
movq %rdx, (%rax)
movq 0x20(%rcx), %rcx
movq %rcx, 0x8(%rax)
jmp 0x3a48
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
addq $0x18, %rdi
addq $0x28, %rdi
callq 0x2af00
movq -0x50(%rbp), %rax
cmpq $0x0, (%rax)
je 0x3966
movq -0x50(%rbp), %rax
movq (%rax), %rax
cmpl $0x0, 0x1c(%rax)
jg 0x394a
movq -0x50(%rbp), %rax
movq (%rax), %rax
movb 0x1b(%rax), %al
shrb $0x5, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x394a
leaq 0x3a2bb(%rip), %rax     # 0x3dc00
cmpl $0x0, (%rax)
je 0x3956
movq -0x50(%rbp), %rax
movq (%rax), %rdi
callq 0x2ade0
jmp 0x3958
movq -0x50(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x50(%rbp)
jmp 0x3910
jmp 0x3a48
movq -0x20(%rbp), %rdi
addq $0x18, %rdi
addq $0x28, %rdi
callq 0x2af20
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x3a48
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movzwl 0x18(%rax), %eax
movq -0x20(%rbp), %rcx
movswl 0x22(%rcx), %ecx
cmpl %ecx, %eax
jne 0x39a7
jmp 0x39c6
leaq 0x2b6c0(%rip), %rdi     # 0x2f06e
leaq 0x2b6df(%rip), %rsi     # 0x2f094
movl $0xc0, %edx
leaq 0x2b6e0(%rip), %rcx     # 0x2f0a1
callq 0x30c0
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2ade0
jmp 0x3a48
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x28(%rbp), %rax
movl 0x28(%rax), %edx
callq 0x2ae90
jmp 0x3a48
movq -0x28(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x3a00
jmp 0x3a48
jmp 0x3a02
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x3b20
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2afb0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x3a48
leaq 0x2b6a7(%rip), %rdi     # 0x2f0d7
leaq 0x2b65d(%rip), %rsi     # 0x2f094
movl $0xd2, %edx
leaq 0x2b65e(%rip), %rcx     # 0x2f0a1
callq 0x30c0
jmp 0x3a4a
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x386b
leaq 0x3a076(%rip), %rax     # 0x3dad8
movq -0x48(%rbp), %rcx
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
movq %rcx, 0x8(%rax)
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)