// File: /workspace/github_c_makefile_star2_O3/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 %r12
pushq %rbx
subq $0x410, %rsp            # imm = 0x410
movl %edx, %r15d
movq %rsi, %rbx
testq %rdi, %rdi
je 0x131e1
movq %rdi, %r14
movl 0x8(%rdi), %eax
leaq 0x4db40(%rip), %rcx     # 0x60ca0
movq (%rcx,%rax,8), %r12
movl 0xc(%rdi), %ebp
movq (%rdi), %rdi
callq 0x1d330
leaq 0x1fa7b(%rip), %rdx     # 0x32bf1
movq %rbx, %rdi
movl %r15d, %esi
movq %r12, %rcx
movl %ebp, %r8d
movl %eax, %r9d
xorl %eax, %eax
callq 0x2e308
movl 0x8(%r14), %eax
cmpq $0xd, %rax
ja 0x136f2
leaq 0x1f98f(%rip), %rcx     # 0x32b30
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0xa, %edi
movq %rbx, %rsi
callq 0x41f0
movq 0x18(%r14), %rdi
incl %r15d
movq %rbx, %rsi
movl %r15d, %edx
callq 0x13135
movq 0x20(%r14), %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x13135
movq 0x28(%r14), %rdi
jmp 0x1341e
leaq 0x1fa04(%rip), %rdx     # 0x32bec
movq %rbx, %rdi
movl %r15d, %esi
xorl %eax, %eax
addq $0x410, %rsp            # imm = 0x410
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2e308
movq %r14, %rdi
callq 0x1d422
cmpl $0x33, %eax
jne 0x1322d
leaq 0x4e750(%rip), %rax     # 0x61968
movq (%rax), %rax
movq 0x38(%r14), %rcx
movq (%rax,%rcx,8), %rax
cmpq %rcx, 0x18(%rax)
jne 0x137e7
movq 0x20(%r14), %rdi
callq 0x2398e
movq %rax, %r12
movq 0x20(%r14), %rax
testq %rax, %rax
je 0x1367e
movl 0x4(%rax), %ecx
jmp 0x13683
leaq 0x1fafa(%rip), %rdi     # 0x32d4f
movl $0x9, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x4330
cmpq $0x0, 0x30(%r14)
je 0x13514
leal 0x1(%r15), %ebp
xorl %r12d, %r12d
movq 0x38(%r14), %rax
movq (%rax,%r12,8), %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x13135
incq %r12
cmpq 0x30(%r14), %r12
jb 0x13279
jmp 0x13518
movq 0x20(%r14), %rdx
movl 0x18(%r14), %ecx
leaq 0x1f9ec(%rip), %rsi     # 0x32c94
movq %rbx, %rdi
xorl %eax, %eax
addq $0x410, %rsp            # imm = 0x410
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4240
movl $0xa, %edi
movq %rbx, %rsi
callq 0x41f0
movq 0x18(%r14), %rdi
incl %r15d
movq %rbx, %rsi
movl %r15d, %edx
callq 0x13135
cmpq $0x0, 0x20(%r14)
je 0x136f2
xorl %r12d, %r12d
movq 0x28(%r14), %rax
movq (%rax,%r12,8), %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x13135
incq %r12
cmpq 0x20(%r14), %r12
jb 0x132ee
jmp 0x136f2
movl $0xa, %edi
movq %rbx, %rsi
callq 0x41f0
movq 0x18(%r14), %rdi
incl %r15d
movq %rbx, %rsi
movl %r15d, %edx
callq 0x12de1
cmpq $0x0, 0x20(%r14)
je 0x136f2
xorl %r12d, %r12d
movq 0x28(%r14), %rax
movq (%rax,%r12,8), %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x13135
incq %r12
cmpq 0x20(%r14), %r12
jb 0x1333c
jmp 0x136f2
movl $0x28, %edi
movq %rbx, %rsi
callq 0x41f0
movq 0x18(%r14), %rdx
testq %rdx, %rdx
je 0x13384
leaq 0x1f82e(%rip), %rsi     # 0x32ba8
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4240
movq 0x20(%r14), %rdi
movq %rbx, %rsi
callq 0x4190
leaq 0x1f833(%rip), %rdi     # 0x32bca
movl $0x2, %esi
movl $0x1, %edx
movq %rbx, %rcx
addq $0x410, %rsp            # imm = 0x410
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4330
movl $0xa, %edi
movq %rbx, %rsi
callq 0x41f0
movq 0x18(%r14), %rdi
incl %r15d
movq %rbx, %rsi
movl %r15d, %edx
callq 0x13135
movq 0x20(%r14), %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x13135
movq 0x28(%r14), %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x13135
movq 0x30(%r14), %rdi
jmp 0x1341e
movl $0xa, %edi
movq %rbx, %rsi
callq 0x41f0
movq 0x18(%r14), %rdi
incl %r15d
movq %rbx, %rsi
movl %r15d, %edx
callq 0x13135
movq 0x20(%r14), %rdi
movq %rbx, %rsi
movl %r15d, %edx
jmp 0x1366a
movl 0x18(%r14), %eax
cmpq $0x7, %rax
ja 0x136f2
leaq 0x1f72a(%rip), %rcx     # 0x32b68
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x30(%r14), %edx
leaq 0x25878(%rip), %rsi     # 0x38cca
movq %rbx, %rdi
xorl %eax, %eax
addq $0x410, %rsp            # imm = 0x410
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4240
movq 0x40(%r14), %rax
testq %rax, %rax
je 0x13543
movq 0x10(%rax), %rdi
callq 0x1e4eb
movq %rax, %rcx
jmp 0x1354a
movq 0x18(%r14), %rdi
callq 0x1e4eb
movq %rax, %r12
movq 0x28(%r14), %rdx
leaq 0x10(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x23321
leaq 0x1f8aa(%rip), %rsi     # 0x32d59
movq %rbx, %rdi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x4240
leaq 0x1e984(%rip), %rdx     # 0x31e4a
movq %rbx, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x2e308
movq 0x18(%r14), %rdi
incl %r15d
movq %rbx, %rsi
movl %r15d, %edx
callq 0x13135
cmpq $0x0, 0x50(%r14)
je 0x136f2
xorl %r12d, %r12d
movq 0x48(%r14), %rax
movq (%rax,%r12,8), %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x13135
incq %r12
cmpq 0x50(%r14), %r12
jb 0x134f3
jmp 0x136f2
leal 0x1(%r15), %ebp
leaq 0x1f6ab(%rip), %rdx     # 0x32bca
movq %rbx, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x2e308
movq 0x20(%r14), %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x12de1
movq 0x40(%r14), %rdi
jmp 0x13665
leaq 0x1e900(%rip), %rcx     # 0x31e4a
movq 0x18(%r14), %rdx
movsbl 0x70(%r14), %r8d
leaq 0x1f6a1(%rip), %rsi     # 0x32bfb
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4240
leal 0x1(%r15), %ebp
movsbl 0x71(%r14), %ecx
leaq 0x1f6a8(%rip), %rdx     # 0x32c1c
movq %rbx, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2e308
movsbl 0x72(%r14), %ecx
leaq 0x1f69c(%rip), %rdx     # 0x32c28
movq %rbx, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2e308
movsbl 0x73(%r14), %ecx
leaq 0x1f690(%rip), %rdx     # 0x32c34
movq %rbx, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2e308
movsbl 0x74(%r14), %ecx
leaq 0x1f686(%rip), %rdx     # 0x32c42
movq %rbx, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2e308
movsbl 0x75(%r14), %ecx
leaq 0x1f67b(%rip), %rdx     # 0x32c4f
movq %rbx, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2e308
movsbl 0x76(%r14), %ecx
leaq 0x1f672(%rip), %rdx     # 0x32c5e
movq %rbx, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2e308
movsbl 0x77(%r14), %ecx
leaq 0x1f667(%rip), %rdx     # 0x32c6b
movq %rbx, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2e308
movsbl 0x78(%r14), %ecx
leaq 0x1f65c(%rip), %rdx     # 0x32c78
movq %rbx, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2e308
movsbl 0x79(%r14), %ecx
leaq 0x1f650(%rip), %rdx     # 0x32c84
movq %rbx, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2e308
leaq 0x1f583(%rip), %rdx     # 0x32bca
movq %rbx, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x2e308
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x12d6c
movq 0x30(%r14), %rdi
movq %rbx, %rsi
movl %ebp, %edx
addq $0x410, %rsp            # imm = 0x410
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x13135
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl 0x18(%r14), %eax
movl 0x30(%r14), %r9d
leaq 0x4cd0e(%rip), %rdx     # 0x603a0
movq (%rdx,%rax,8), %r8
movq 0x38(%r14), %rax
movq %rax, (%rsp)
leaq 0x1f660(%rip), %rsi     # 0x32d05
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 0x13135
cmpq $0x0, 0x40(%r14)
je 0x136f2
xorl %r12d, %r12d
movq 0x50(%r14), %rax
movq (%rax,%r12,8), %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x13135
incq %r12
cmpq 0x40(%r14), %r12
jb 0x136d6
addq $0x410, %rsp            # imm = 0x410
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0x30(%r14), %edx
movq 0x38(%r14), %rcx
leaq 0x255f1(%rip), %rsi     # 0x38d02
movq %rbx, %rdi
xorl %eax, %eax
addq $0x410, %rsp            # imm = 0x410
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4240
movq 0x30(%r14), %rdx
leaq 0x255b0(%rip), %rsi     # 0x38ce5
jmp 0x137c1
movsd 0x30(%r14), %xmm0
leaq 0x255ad(%rip), %rsi     # 0x38cf4
movq %rbx, %rdi
movb $0x1, %al
addq $0x410, %rsp            # imm = 0x410
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4240
leaq 0x25558(%rip), %rdi     # 0x38cbf
movl $0x7, %esi
jmp 0x1339c
cmpl $0x0, 0x30(%r14)
leaq 0x1f5c4(%rip), %rax     # 0x32d41
leaq 0x1f5b8(%rip), %rdx     # 0x32d3c
cmoveq %rax, %rdx
leaq 0x25548(%rip), %rsi     # 0x38cd7
jmp 0x137c1
leaq 0x1f5af(%rip), %rdi     # 0x32d47
movl $0x7, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x4330
movq 0x30(%r14), %rdi
incl %r15d
jmp 0x1341e
movq 0x30(%r14), %rdx
leaq 0x25550(%rip), %rsi     # 0x38d11
movq %rbx, %rdi
xorl %eax, %eax
addq $0x410, %rsp            # imm = 0x410
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4240
movq %rbx, %rdi
callq 0x43f9
jmp 0x136f2
leaq 0x1f4c2(%rip), %rdi     # 0x32cb0
leaq 0x1f4e7(%rip), %rsi     # 0x32cdc
leaq 0x1f4e7(%rip), %rcx     # 0x32ce3
movl $0xe0, %edx
callq 0x4180