// File: /workspace/github_c_makefile_star2_O2/oridb[P]mc/parse/dump.c
// Function: outnode
static void
outnode(Node *n, FILE *fd, int depth)
{
	size_t i;
	char *ty;
	char *tr;
	int tid;
	char buf[1024];

	if (!n) {
		findentf(fd, depth, "Nil\n");
		return;
	}
	findentf(fd, depth, "%s.%zd@%i", nodestr[n->type], n->nid, lnum(n->loc));
	switch (n->type) {
	case Ndecl:
		tr = "";
		if (n->decl.trait)
			tr = namestr(n->decl.trait->name);
		fprintf(fd, "(did = %zd, trait=%s, vis = %d)\n", n->decl.did, tr, n->decl.vis);
		findentf(fd, depth + 1, "isglobl=%d\n", n->decl.isglobl);
		findentf(fd, depth + 1, "isconst=%d\n", n->decl.isconst);
		findentf(fd, depth + 1, "isgeneric=%d\n", n->decl.isgeneric);
		findentf(fd, depth + 1, "isextern=%d\n", n->decl.isextern);
		findentf(fd, depth + 1, "ispkglocal=%d\n", n->decl.ispkglocal);
		findentf(fd, depth + 1, "ishidden=%d\n", n->decl.ishidden);
		findentf(fd, depth + 1, "isimport=%d\n", n->decl.isimport);
		findentf(fd, depth + 1, "isnoret=%d\n", n->decl.isnoret);
		findentf(fd, depth + 1, "isexportval=%d\n", n->decl.isexportval);
		findentf(fd, depth, ")\n");
		outsym(n, fd, depth + 1);
		outnode(n->decl.init, fd, depth + 1);
		break;
	case Nblock:
		fprintf(fd, "\n");
		outstab(n->block.scope, fd, depth + 1);
		for (i = 0; i < n->block.nstmts; i++)
			outnode(n->block.stmts[i], fd, depth + 1);
		break;
	case Nifstmt:
		fprintf(fd, "\n");
		outnode(n->ifstmt.cond, fd, depth + 1);
		outnode(n->ifstmt.iftrue, fd, depth + 1);
		outnode(n->ifstmt.iffalse, fd, depth + 1);
		break;
	case Nloopstmt:
		fprintf(fd, "\n");
		outnode(n->loopstmt.init, fd, depth + 1);
		outnode(n->loopstmt.cond, fd, depth + 1);
		outnode(n->loopstmt.step, fd, depth + 1);
		outnode(n->loopstmt.body, fd, depth + 1);
		break;
	case Niterstmt:
		fprintf(fd, "\n");
		outnode(n->iterstmt.elt, fd, depth + 1);
		outnode(n->iterstmt.seq, fd, depth + 1);
		outnode(n->iterstmt.body, fd, depth + 1);
		break;
	case Nmatchstmt:
		fprintf(fd, "\n");
		outnode(n->matchstmt.val, fd, depth + 1);
		for (i = 0; i < n->matchstmt.nmatches; i++)
			outnode(n->matchstmt.matches[i], fd, depth + 1);
		break;
	case Nmatch:
		fprintf(fd, "\n");
		outnode(n->match.pat, fd, depth + 1);
		outnode(n->match.block, fd, depth + 1);
		break;
	case Nuse:	fprintf(fd, " (name = %s, islocal = %d)\n", n->use.name, n->use.islocal);	break;
	case Nexpr:
		   if (exprop(n) == Ovar)
			   assert(decls[n->expr.did]->decl.did == n->expr.did);
		   ty = tystr(n->expr.type);
		   if (n->expr.type)
			   tid = n->expr.type->tid;
		   else
			   tid = -1;
		   fprintf(fd, " (type = %s [tid %d], op = %s, isconst = %d, did=%zd)\n", ty, tid,
				   opstr[n->expr.op], n->expr.isconst, n->expr.did);
		   free(ty);
		   outnode(n->expr.idx, fd, depth + 1);
		   for (i = 0; i < n->expr.nargs; i++)
			   outnode(n->expr.args[i], fd, depth + 1);
		   break;
	case Nlit:
		   switch (n->lit.littype) {
		   case Lvoid:	fprintf(fd, " Lvoid\n");	break;
		   case Lchr:	fprintf(fd, " Lchr %c\n", n->lit.chrval);	break;
		   case Lbool:	fprintf(fd, " Lbool %s\n", n->lit.boolval ? "true" : "false");	break;
		   case Lint:	fprintf(fd, " Lint %llu\n", n->lit.intval);	break;
		   case Lflt:	fprintf(fd, " Lflt %lf\n", n->lit.fltval);	break;
		   case Llbl:	fprintf(fd, " Llbl %s\n", n->lit.lblval);	break;
		   case Lstr:
				fprintf(fd, " Lstr %.*s\n", (int)n->lit.strval.len, n->lit.strval.buf);
				break;
		   case Lfunc:
				fprintf(fd, " lfunc\n");
				outnode(n->lit.fnval, fd, depth + 1);
				break;
		   }
		   break;
	case Nfunc:
		   fprintf(fd, " (args =\n");
		   for (i = 0; i < n->func.nargs; i++)
			   outnode(n->func.args[i], fd, depth + 1);
		   findentf(fd, depth, ")\n");
		   outstab(n->func.scope, fd, depth + 1);
		   outnode(n->func.body, fd, depth + 1);
		   break;
	case Nname:
		   fprintf(fd, "(");
		   if (n->name.ns)
			   fprintf(fd, "%s.", n->name.ns);
		   fprintf(fd, "%s", n->name.name);
		   fprintf(fd, ")\n");
		   break;
	case Nimpl:
		   fprintf(fd, "(name = %s, type = %s)\n", namestr(n->impl.traitname),
				   tyfmt(buf, sizeof buf, n->impl.type));
		   findentf(fd, depth, "");
		   outnode(n->impl.traitname, fd, depth + 1);
		   for (i = 0; i < n->impl.ndecls; i++)
			   outnode(n->impl.decls[i], fd, depth + 1);
		   break;
	case Nnone:
		   fprintf(stderr, "Nnone not a real node type!");
		   fprintf(fd, "Nnone\n");
		   break;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movl %edx, %r15d
movq %rsi, %rbx
testq %rdi, %rdi
je 0x11a0f
movq %rdi, %r14
movl 0x8(%rdi), %eax
leaq 0x4c310(%rip), %rcx     # 0x5dca0
movq (%rcx,%rax,8), %r12
movl 0xc(%rdi), %ebp
movq (%rdi), %rdi
callq 0x1b508
leaq 0x1d21b(%rip), %rdx     # 0x2ebc1
movq %rbx, %rdi
movl %r15d, %esi
movq %r12, %rcx
movl %ebp, %r8d
movl %eax, %r9d
xorl %eax, %eax
callq 0x2ad06
movl 0x8(%r14), %eax
cmpq $0xd, %rax
ja 0x11ee1
leaq 0x1d12f(%rip), %rcx     # 0x2eb00
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0xa
popq %rdi
movq %rbx, %rsi
callq 0x41f0
movq 0x18(%r14), %rdi
incl %r15d
movq %rbx, %rsi
movl %r15d, %edx
callq 0x11963
movq 0x20(%r14), %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x11963
movq 0x28(%r14), %rdi
jmp 0x11c49
leaq 0x1d1a6(%rip), %rdx     # 0x2ebbc
movq %rbx, %rdi
movl %r15d, %esi
xorl %eax, %eax
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2ad06
movq %r14, %rdi
callq 0x1b5e6
cmpl $0x33, %eax
jne 0x11a5d
leaq 0x4cf20(%rip), %rax     # 0x5e968
movq (%rax), %rax
movq 0x38(%r14), %rcx
movq (%rax,%rcx,8), %rax
cmpq %rcx, 0x18(%rax)
jne 0x11ffc
movq 0x20(%r14), %rdi
callq 0x21009
movq %rax, %r12
movq 0x20(%r14), %rax
testq %rax, %rax
je 0x11e74
movl 0x4(%rax), %ecx
jmp 0x11e77
leaq 0x1d29a(%rip), %rdi     # 0x2ed1f
pushq $0x9
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x4330
leal 0x1(%r15), %ebp
xorl %r12d, %r12d
cmpq 0x30(%r14), %r12
jae 0x11ab7
movq 0x38(%r14), %rax
movq (%rax,%r12,8), %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x11963
incq %r12
jmp 0x11a9a
leaq 0x1d0dc(%rip), %rdx     # 0x2eb9a
movq %rbx, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x2ad06
movq 0x20(%r14), %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x11639
movq 0x40(%r14), %rdi
jmp 0x11e59
movq 0x20(%r14), %rdx
movl 0x18(%r14), %ecx
leaq 0x1d173(%rip), %rsi     # 0x2ec64
movq %rbx, %rdi
xorl %eax, %eax
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4240
pushq $0xa
popq %rdi
movq %rbx, %rsi
callq 0x41f0
movq 0x18(%r14), %rdi
incl %r15d
movq %rbx, %rsi
movl %r15d, %edx
callq 0x11963
xorl %r12d, %r12d
cmpq 0x20(%r14), %r12
jae 0x11ee1
movq 0x28(%r14), %rax
movq (%rax,%r12,8), %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x11963
incq %r12
jmp 0x11b2c
pushq $0xa
popq %rdi
movq %rbx, %rsi
callq 0x41f0
movq 0x18(%r14), %rdi
incl %r15d
movq %rbx, %rsi
movl %r15d, %edx
callq 0x11639
xorl %r12d, %r12d
cmpq 0x20(%r14), %r12
jae 0x11ee1
movq 0x28(%r14), %rax
movq (%rax,%r12,8), %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x11963
incq %r12
jmp 0x11b6e
pushq $0x28
popq %rdi
movq %rbx, %rsi
callq 0x41f0
movq 0x18(%r14), %rdx
testq %rdx, %rdx
je 0x11bb5
leaq 0x1cfcd(%rip), %rsi     # 0x2eb78
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4240
movq 0x20(%r14), %rdi
movq %rbx, %rsi
callq 0x4190
leaq 0x1cfd2(%rip), %rdi     # 0x2eb9a
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4330
pushq $0xa
popq %rdi
movq %rbx, %rsi
callq 0x41f0
movq 0x18(%r14), %rdi
incl %r15d
movq %rbx, %rsi
movl %r15d, %edx
callq 0x11963
movq 0x20(%r14), %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x11963
movq 0x28(%r14), %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x11963
movq 0x30(%r14), %rdi
jmp 0x11c49
pushq $0xa
popq %rdi
movq %rbx, %rsi
callq 0x41f0
movq 0x18(%r14), %rdi
incl %r15d
movq %rbx, %rsi
movl %r15d, %edx
callq 0x11963
movq 0x20(%r14), %rdi
movq %rbx, %rsi
movl %r15d, %edx
jmp 0x11e5e
movl 0x18(%r14), %eax
cmpq $0x7, %rax
ja 0x11ee1
leaq 0x1cecf(%rip), %rcx     # 0x2eb38
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x30(%r14), %edx
leaq 0x23071(%rip), %rsi     # 0x34cee
movq %rbx, %rdi
xorl %eax, %eax
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4240
movq 0x40(%r14), %rax
testq %rax, %rax
je 0x11d37
movq 0x10(%rax), %rdi
callq 0x1c0c8
movq %rax, %rcx
jmp 0x11d3e
movq 0x18(%r14), %rdi
callq 0x1c0c8
movq %rax, %r12
movq 0x28(%r14), %rdx
leaq 0x10(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x20783
leaq 0x1d04d(%rip), %rsi     # 0x2ed29
xorl %r13d, %r13d
movq %rbx, %rdi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x4240
leaq 0x1c154(%rip), %rdx     # 0x2de4a
movq %rbx, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x2ad06
movq 0x18(%r14), %rdi
incl %r15d
movq %rbx, %rsi
movl %r15d, %edx
callq 0x11963
cmpq 0x50(%r14), %r13
jae 0x11ee1
movq 0x48(%r14), %rax
movq (%rax,%r13,8), %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x11963
incq %r13
jmp 0x11d15
leaq 0x1c10c(%rip), %rcx     # 0x2de4a
movq 0x18(%r14), %rdx
movsbl 0x70(%r14), %r8d
leaq 0x1ce7d(%rip), %rsi     # 0x2ebcb
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4240
leal 0x1(%r15), %ebp
movsbl 0x71(%r14), %ecx
leaq 0x1ce84(%rip), %rdx     # 0x2ebec
movq %rbx, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2ad06
movsbl 0x72(%r14), %ecx
leaq 0x1ce78(%rip), %rdx     # 0x2ebf8
movq %rbx, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2ad06
movsbl 0x73(%r14), %ecx
leaq 0x1ce6c(%rip), %rdx     # 0x2ec04
movq %rbx, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2ad06
movsbl 0x74(%r14), %ecx
leaq 0x1ce62(%rip), %rdx     # 0x2ec12
movq %rbx, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2ad06
movsbl 0x75(%r14), %ecx
leaq 0x1ce57(%rip), %rdx     # 0x2ec1f
movq %rbx, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2ad06
movsbl 0x76(%r14), %ecx
leaq 0x1ce4e(%rip), %rdx     # 0x2ec2e
movq %rbx, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2ad06
movsbl 0x77(%r14), %ecx
leaq 0x1ce43(%rip), %rdx     # 0x2ec3b
movq %rbx, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2ad06
movsbl 0x78(%r14), %ecx
leaq 0x1ce38(%rip), %rdx     # 0x2ec48
movq %rbx, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2ad06
movsbl 0x79(%r14), %ecx
leaq 0x1ce2c(%rip), %rdx     # 0x2ec54
movq %rbx, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2ad06
leaq 0x1cd5f(%rip), %rdx     # 0x2eb9a
movq %rbx, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x2ad06
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x115c4
movq 0x30(%r14), %rdi
movq %rbx, %rsi
movl %ebp, %edx
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x11963
pushq $-0x1
popq %rcx
movl 0x18(%r14), %eax
movl 0x30(%r14), %r9d
leaq 0x4b51a(%rip), %rdx     # 0x5d3a0
movq (%rdx,%rax,8), %r8
movq 0x38(%r14), %rax
movq %rax, (%rsp)
leaq 0x1ce3c(%rip), %rsi     # 0x2ecd5
xorl %r13d, %r13d
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x4240
movq %r12, %rdi
callq 0x4040
movq 0x48(%r14), %rdi
incl %r15d
movq %rbx, %rsi
movl %r15d, %edx
callq 0x11963
cmpq 0x40(%r14), %r13
jae 0x11ee1
movq 0x50(%r14), %rax
movq (%rax,%r13,8), %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x11963
incq %r13
jmp 0x11ec3
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x30(%r14), %edx
movq 0x38(%r14), %rcx
leaq 0x22e24(%rip), %rsi     # 0x34d26
movq %rbx, %rdi
xorl %eax, %eax
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4240
movq 0x30(%r14), %rdx
leaq 0x22de1(%rip), %rsi     # 0x34d09
jmp 0x11faf
movsd 0x30(%r14), %xmm0
leaq 0x22dde(%rip), %rsi     # 0x34d18
movq %rbx, %rdi
movb $0x1, %al
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4240
leaq 0x22d87(%rip), %rdi     # 0x34ce3
pushq $0x7
jmp 0x11bca
cmpl $0x0, 0x30(%r14)
leaq 0x1cda2(%rip), %rax     # 0x2ed11
leaq 0x1cd96(%rip), %rdx     # 0x2ed0c
cmoveq %rax, %rdx
leaq 0x22d7a(%rip), %rsi     # 0x34cfb
jmp 0x11faf
leaq 0x1cd8d(%rip), %rdi     # 0x2ed17
pushq $0x7
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x4330
movq 0x30(%r14), %rdi
incl %r15d
jmp 0x11c49
movq 0x30(%r14), %rdx
leaq 0x22d86(%rip), %rsi     # 0x34d35
movq %rbx, %rdi
xorl %eax, %eax
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4240
movq 0x2f01f(%rip), %rax     # 0x40ff0
movq (%rax), %rcx
leaq 0x1cd66(%rip), %rdi     # 0x2ed41
pushq $0x1b
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
callq 0x4330
leaq 0x1cd6c(%rip), %rdi     # 0x2ed5d
pushq $0x6
popq %rsi
movq %r14, %rdx
jmp 0x11bce
leaq 0x1cc7d(%rip), %rdi     # 0x2ec80
leaq 0x1cca2(%rip), %rsi     # 0x2ecac
leaq 0x1cca2(%rip), %rcx     # 0x2ecb3
movl $0xe0, %edx
callq 0x4180