// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/debug.c
// Function: node_debug
void node_debug(struct node *n)
{
	static char depth_str[256] = { 0 };
	static int di = 0;
	if (di > 250) {
		di = 0;
	}
	if (!n)
		return;
	if (di)
		printf("%.*s`--", di - 1, depth_str);
	switch (n->type) {
	case node_ident:
		printf("ident: %s\n", IDENT(n));
		break;
	case node_cnum:
		printf("cnum: %ld\n", CNUM(n));
		break;
	case node_unop:
		printf("unop \'%s\'\n", operator_str[UNOP(n)->op]);
		depth_str[di++] = ' ';
		depth_str[di++] = ' ';
		node_debug(UNOP(n)->term);
		di -= 2;
		break;
	case node_binop:
		printf("binop \'%s\':\n", operator_str[BINOP(n)->op]);
		depth_str[di++] = ' ';
		depth_str[di++] = '|';
		node_debug(BINOP(n)->lhs);
		depth_str[di - 1] = ' ';
		node_debug(BINOP(n)->rhs);
		di -= 2;
		break;
	case node_unit:
		for (int i = 0; i < UNIT(n)->num_decls; i++)
			node_debug(UNIT(n)->edecls[i]);
		break;
	case node_block:
		printf("block:\n");
		depth_str[di++] = ' ';
		depth_str[di++] = '|';
		for (int i = 0; i < BLOCK(n)->num_stmt; i++) {
			if ((i + 1) >= BLOCK(n)->num_stmt)
				depth_str[di - 1] = ' ';
			node_debug(BLOCK(n)->stmt_list[i]);
		}
		di -= 2;
		break;
	case node_cond:
		printf("conditional:\n");
		depth_str[di++] = '|';
		depth_str[di++] = ' ';
		node_debug(COND(n)->condition);
		if (!COND(n)->otherwise)
			depth_str[di - 2] = ' ';
		node_debug(COND(n)->body);
		depth_str[di - 2] = ' ';
		if (COND(n)->otherwise)
			node_debug(COND(n)->otherwise);
		di -= 2;;
		break;
	case node_loop:
		printf("loop:\n");
		depth_str[di++] = ' ';
		depth_str[di++] = '|';
		node_debug(LOOP(n)->init);
		node_debug(LOOP(n)->condition);
		if (!LOOP(n)->body)
			depth_str[di - 1] = ' ';
		node_debug(LOOP(n)->iter);
		depth_str[di - 1] = ' ';
		node_debug(LOOP(n)->body);
		di -= 2;
		break;
	case node_func:
		printf("func %s: ", FUNC(n)->ident);
		print_type(FUNC(n)->ftype);
		printf("\n");
		depth_str[di++] = ' ';
		depth_str[di++] = ' ';
		node_debug(FUNC(n)->body);
		di -= 2;
		break;
	case node_call:
		printf("call\n");
		depth_str[di++] = ' ';
		depth_str[di++] = '|';
		node_debug(CALL(n)->func);
		for (int i = 0; i < CALL(n)->argc;i++) {
			if ((i + 1) >= CALL(n)->argc)
				depth_str[di - 1] = ' ';
			node_debug(CALL(n)->argv[i]);
		}
		depth_str[di-1] = ' ';
		di -= 2;

		break;
	case node_decl:
		printf("decl:");
		print_type(DECL(n)->type);
		printf(" %s\n", DECL(n)->ident);
		depth_str[di++] = ' ';
		depth_str[di++] = ' ';
		if (DECL(n)->initializer) {
			node_debug(DECL(n)->initializer);
		}
		di -= 2;
		break;
	case node_empty:
		printf("empty\n");
		break;
	case node_break:
		printf("break\n");
		break;
	case node_continue:
		printf("continue\n");
		break;
	case node_return:
		printf("return\n");
		depth_str[di++] = ' ';
		depth_str[di++] = ' ';
		node_debug(RET(n));
		di -= 2;
		break;
	case node_cast:
		printf("cast: ");
		print_type(TYPE(n));
		printf("\n");
		depth_str[di++] = ' ';
		depth_str[di++] = ' ';
		node_debug(n->child);
		di -= 2;
		break;
	default:
		break;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0xc037(%rip), %esi      # 0xe710
cmpl $0xfa, %esi
jle 0x26f5
movl $0x0, 0xc025(%rip)      # 0xe710
testq %rbx, %rbx
jne 0x2719
jmp 0x2bb3
testq %rbx, %rbx
je 0x2bb3
testl %esi, %esi
je 0x2719
decl %esi
leaq 0x6a83(%rip), %rdi      # 0x918e
leaq 0xbefe(%rip), %rdx      # 0xe610
xorl %eax, %eax
callq 0x2080
movl (%rbx), %eax
cmpq $0xf, %rax
ja 0x2bb3
leaq 0x68fc(%rip), %rcx      # 0x9028
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x6aec(%rip), %rdi      # 0x9228
jmp 0x2a57
leaq 0x73d3(%rip), %rdi      # 0x9b1b
jmp 0x2a57
leaq 0x6ada(%rip), %rdi      # 0x922e
callq 0x2060
movslq 0xbfb0(%rip), %rax      # 0xe710
leaq 0xbea9(%rip), %r14      # 0xe610
movw $0x7c20, (%rax,%r14)    # imm = 0x7C20
addl $0x2, %eax
movl %eax, 0xbf99(%rip)      # 0xe710
movq 0x8(%rbx), %rax
movq (%rax), %rdi
callq 0x26cb
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rdi
callq 0x26cb
movq 0x8(%rbx), %rax
cmpq $0x0, 0x18(%rax)
jne 0x27ac
movslq 0xbf6e(%rip), %rax      # 0xe710
movb $0x20, -0x1(%rax,%r14)
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rdi
callq 0x26cb
movslq 0xbf54(%rip), %rax      # 0xe710
movb $0x20, -0x1(%rax,%r14)
movq 0x8(%rbx), %rax
movq 0x18(%rax), %rdi
jmp 0x2b9b
movq 0x8(%rbx), %rax
movq (%rax), %rsi
leaq 0x69c4(%rip), %rdi      # 0x91a1
jmp 0x291a
leaq 0x69e5(%rip), %rdi      # 0x91ce
xorl %eax, %eax
callq 0x2080
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rdi
callq 0x815b
movq 0x8(%rbx), %rax
movq (%rax), %rsi
leaq 0x6991(%rip), %rdi      # 0x919c
xorl %eax, %eax
callq 0x2080
movslq 0xbef7(%rip), %rax      # 0xe710
leaq 0xbdf0(%rip), %rcx      # 0xe610
movw $0x2020, (%rax,%rcx)    # imm = 0x2020
leal 0x2(%rax), %ecx
movl %ecx, 0xbee1(%rip)      # 0xe710
movq 0x8(%rbx), %rcx
movq 0x10(%rcx), %rdi
testq %rdi, %rdi
jne 0x2b3a
jmp 0x2bad
leaq 0x69f5(%rip), %rdi      # 0x9241
callq 0x2060
movslq 0xbeb8(%rip), %rcx      # 0xe710
leaq 0xbdb1(%rip), %r14      # 0xe610
movw $0x7c20, (%rcx,%r14)    # imm = 0x7C20
leal 0x2(%rcx), %eax
movl %eax, 0xbea1(%rip)      # 0xe710
movq 0x8(%rbx), %rax
movl 0x8(%rax), %edx
testl %edx, %edx
jle 0x28be
xorl %ecx, %ecx
leaq 0x1(%rcx), %r15
movslq %edx, %rdx
cmpq %rdx, %r15
jl 0x2899
movslq 0xbe81(%rip), %rax      # 0xe710
movb $0x20, -0x1(%rax,%r14)
movq 0x8(%rbx), %rax
movq (%rax), %rax
movq (%rax,%rcx,8), %rdi
callq 0x26cb
movq 0x8(%rbx), %rax
movslq 0x8(%rax), %rdx
movq %r15, %rcx
cmpq %rdx, %r15
jl 0x287c
movl 0xbe55(%rip), %ecx      # 0xe710
addl $-0x2, %ecx
movl %ecx, 0xbe4c(%rip)      # 0xe710
jmp 0x2bb3
movq 0x8(%rbx), %rax
cmpl $0x0, 0x8(%rax)
jle 0x2bb3
xorl %r14d, %r14d
movq (%rax), %rax
movq (%rax,%r14,8), %rdi
callq 0x26cb
incq %r14
movq 0x8(%rbx), %rax
movslq 0x8(%rax), %rcx
cmpq %rcx, %r14
jl 0x28da
jmp 0x2bb3
leaq 0x723a(%rip), %rdi      # 0x9b3c
callq 0x2060
jmp 0x29e1
movq 0x8(%rbx), %rax
movq (%rax), %rsi
leaq 0x687c(%rip), %rdi      # 0x9196
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x2080
leaq 0x701e(%rip), %rdi      # 0x994b
callq 0x2060
movslq 0xbdd7(%rip), %rax      # 0xe710
leaq 0xbcd0(%rip), %r14      # 0xe610
movw $0x7c20, (%rax,%r14)    # imm = 0x7C20
addl $0x2, %eax
movl %eax, 0xbdc0(%rip)      # 0xe710
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rdi
callq 0x26cb
movq 0x8(%rbx), %rax
movl (%rax), %edx
testl %edx, %edx
jle 0x29a2
xorl %ecx, %ecx
leaq 0x1(%rcx), %r15
movslq %edx, %rdx
cmpq %rdx, %r15
jl 0x2986
movslq 0xbd94(%rip), %rax      # 0xe710
movb $0x20, -0x1(%rax,%r14)
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rax
movq (%rax,%rcx,8), %rdi
callq 0x26cb
movq 0x8(%rbx), %rax
movslq (%rax), %rdx
movq %r15, %rcx
cmpq %rdx, %r15
jl 0x2969
movslq 0xbd67(%rip), %rax      # 0xe710
movb $0x20, -0x1(%rax,%r14)
addl $-0x2, %eax
movl %eax, 0xbd58(%rip)      # 0xe710
jmp 0x2bb3
leaq 0x6810(%rip), %rdi      # 0x91d4
xorl %eax, %eax
callq 0x2080
movq 0x10(%rbx), %rax
movq (%rax), %rdi
callq 0x815b
movl $0xa, %edi
callq 0x2040
movslq 0xbd28(%rip), %rax      # 0xe710
leaq 0xbc21(%rip), %rcx      # 0xe610
movw $0x2020, (%rax,%rcx)    # imm = 0x2020
addl $0x2, %eax
movl %eax, 0xbd12(%rip)      # 0xe710
movq 0x8(%rbx), %rdi
jmp 0x2b9b
movq 0x8(%rbx), %rax
movl 0x8(%rax), %eax
leaq 0xba9b(%rip), %rcx      # 0xe4b0
movq (%rcx,%rax,8), %rsi
leaq 0x678c(%rip), %rdi      # 0x91ac
xorl %eax, %eax
callq 0x2080
movslq 0xbce2(%rip), %rax      # 0xe710
leaq 0xbbdb(%rip), %rcx      # 0xe610
movw $0x2020, (%rax,%rcx)    # imm = 0x2020
addl $0x2, %eax
movl %eax, 0xbccc(%rip)      # 0xe710
movq 0x8(%rbx), %rax
movq (%rax), %rdi
jmp 0x2b9b
leaq 0x70a6(%rip), %rdi      # 0x9afd
popq %rbx
popq %r14
popq %r15
jmp 0x2060
movq 0x8(%rbx), %rax
movl 0x10(%rax), %eax
leaq 0xba41(%rip), %rcx      # 0xe4b0
movq (%rcx,%rax,8), %rsi
leaq 0x673d(%rip), %rdi      # 0x91b7
xorl %eax, %eax
callq 0x2080
movslq 0xbc88(%rip), %rax      # 0xe710
leaq 0xbb81(%rip), %r14      # 0xe610
movw $0x7c20, (%rax,%r14)    # imm = 0x7C20
addl $0x2, %eax
movl %eax, 0xbc71(%rip)      # 0xe710
movq 0x8(%rbx), %rax
movq (%rax), %rdi
callq 0x26cb
movslq 0xbc5e(%rip), %rax      # 0xe710
movb $0x20, -0x1(%rax,%r14)
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rdi
jmp 0x2b9b
leaq 0x6768(%rip), %rdi      # 0x9234
callq 0x2060
movslq 0xbc38(%rip), %rax      # 0xe710
leaq 0xbb31(%rip), %r14      # 0xe610
movw $0x207c, (%rax,%r14)    # imm = 0x207C
addl $0x2, %eax
movl %eax, 0xbc21(%rip)      # 0xe710
movq 0x8(%rbx), %rax
movq (%rax), %rdi
callq 0x26cb
movq 0x8(%rbx), %rax
cmpq $0x0, 0x10(%rax)
jne 0x2b17
movslq 0xbc03(%rip), %rax      # 0xe710
movb $0x20, -0x2(%rax,%r14)
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rdi
callq 0x26cb
movslq 0xbbe9(%rip), %rax      # 0xe710
movb $0x20, -0x2(%rax,%r14)
movq 0x8(%rbx), %rcx
movq 0x10(%rcx), %rdi
testq %rdi, %rdi
je 0x2ba9
callq 0x26cb
movl 0xbbcb(%rip), %eax      # 0xe710
addl $-0x2, %eax
jmp 0x2bad
movq 0x8(%rbx), %rax
movq (%rax), %rsi
leaq 0x666c(%rip), %rdi      # 0x91c4
xorl %eax, %eax
callq 0x2080
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rdi
callq 0x815b
movl $0xa, %edi
callq 0x2040
movslq 0xbb93(%rip), %rax      # 0xe710
leaq 0xba8c(%rip), %rcx      # 0xe610
movw $0x2020, (%rax,%rcx)    # imm = 0x2020
addl $0x2, %eax
movl %eax, 0xbb7d(%rip)      # 0xe710
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rdi
callq 0x26cb
addl $-0x2, 0xbb69(%rip)     # 0xe710
jmp 0x2bb3
addq $-0x2, %rax
movl %eax, 0xbb5d(%rip)      # 0xe710
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)