// File: /workspace/github_c_makefile_star2_O2/ejunjsh[P]mycc/tree.c
// Function: dumpAST
void dumpAST(struct ASTnode *n, int label, int level) {
  int Lfalse, Lstart, Lend;
  int i;

  switch (n->op) {
    case A_IF:
      Lfalse = gendumplabel();
      for (i = 0; i < level; i++)
	      fprintf(stdout, " ");
      fprintf(stdout, "A_IF");
      if (n->right) {
	      Lend = gendumplabel();
	      fprintf(stdout, ", end L%d", Lend);
      }
      fprintf(stdout, "\n");
      dumpAST(n->left, Lfalse, level + 2);
      dumpAST(n->mid, NOLABEL, level + 2);
      if (n->right)
	      dumpAST(n->right, NOLABEL, level + 2);
      return;
    case A_WHILE:
      Lstart = gendumplabel();
      for (i = 0; i < level; i++)
	      fprintf(stdout, " ");
      fprintf(stdout, "A_WHILE, start L%d\n", Lstart);
      Lend = gendumplabel();
      dumpAST(n->left, Lend, level + 2);
      dumpAST(n->right, NOLABEL, level + 2);
      return;
  }

  // 为A_GLUE重设层级为-2
  if (n->op == A_GLUE)
    level = -2;

  // 通用语法树节点处理
  if (n->left)
    dumpAST(n->left, NOLABEL, level + 2);
  if (n->right)
    dumpAST(n->right, NOLABEL, level + 2);


  for (i = 0; i < level; i++)
    fprintf(stdout, " ");
  switch (n->op) {
    case A_GLUE:
      fprintf(stdout, "\n\n");
      return;
    case A_FUNCTION:
      fprintf(stdout, "A_FUNCTION %s\n", n->sym->name);
      return;
    case A_ADD:
      fprintf(stdout, "A_ADD\n");
      return;
    case A_SUBTRACT:
      fprintf(stdout, "A_SUBTRACT\n");
      return;
    case A_MULTIPLY:
      fprintf(stdout, "A_MULTIPLY\n");
      return;
    case A_DIVIDE:
      fprintf(stdout, "A_DIVIDE\n");
      return;
    case A_EQ:
      fprintf(stdout, "A_EQ\n");
      return;
    case A_NE:
      fprintf(stdout, "A_NE\n");
      return;
    case A_LT:
      fprintf(stdout, "A_LE\n");
      return;
    case A_GT:
      fprintf(stdout, "A_GT\n");
      return;
    case A_LE:
      fprintf(stdout, "A_LE\n");
      return;
    case A_GE:
      fprintf(stdout, "A_GE\n");
      return;
    case A_INTLIT:
      fprintf(stdout, "A_INTLIT %d\n", n->atu.a_intvalue);
      return;
    case A_STRLIT:
      fprintf(stdout, "A_STRLIT rval label L%d\n", n->atu.a_intvalue);
      return;
    case A_IDENT:
      if (n->rvalue)
	      fprintf(stdout, "A_IDENT rval %s\n", n->sym->name);
      else
	      fprintf(stdout, "A_IDENT %s\n", n->sym->name);
      return;
    case A_ASSIGN:
      fprintf(stdout, "A_ASSIGN\n");
      return;
    case A_WIDEN:
      fprintf(stdout, "A_WIDEN\n");
      return;
    case A_RETURN:
      fprintf(stdout, "A_RETURN\n");
      return;
    case A_FUNCCALL:
      fprintf(stdout, "A_FUNCCALL %s\n", n->sym->name);
      return;
    case A_ADDR:
      fprintf(stdout, "A_ADDR %s\n", n->sym->name);
      return;
    case A_DEREF:
      if (n->rvalue)
	      fprintf(stdout, "A_DEREF rval\n");
      else
	      fprintf(stdout, "A_DEREF\n");
      return;
    case A_SCALE:
      fprintf(stdout, "A_SCALE %d\n", n->atu.a_size);
      return;
    case A_PREINC:
      fprintf(stdout, "A_PREINC %s\n", n->sym->name);
      return;
    case A_PREDEC:
      fprintf(stdout, "A_PREDEC %s\n", n->sym->name);
      return;
    case A_POSTINC:
      fprintf(stdout, "A_POSTINC\n");
      return;
    case A_POSTDEC:
      fprintf(stdout, "A_POSTDEC\n");
      return;
    case A_NEGATE:
      fprintf(stdout, "A_NEGATE\n");
      return;
    case A_BREAK:
      fprintf(stdout, "A_BREAK\n");
      return;
    case A_CONTINUE:
      fprintf(stdout, "A_CONTINUE\n");
      return;
    case A_CASE:
      fprintf(stdout, "A_CASE %d\n", n->atu.a_intvalue);
      return;
    case A_DEFAULT:
      fprintf(stdout, "A_DEFAULT\n");
      return;
    case A_SWITCH:
      fprintf(stdout, "A_SWITCH\n");
      return;
    case A_CAST:
      fprintf(stdout, "A_CAST %d\n", n->type);
      return;
    case A_ASPLUS:
      fprintf(stdout, "A_ASPLUS\n");
      return;
    case A_ASMINUS:
      fprintf(stdout, "A_ASMINUS\n");
      return;
    case A_ASSTAR:
      fprintf(stdout, "A_ASSTAR\n");
      return;
    case A_ASSLASH:
      fprintf(stdout, "A_ASSLASH\n");
      return;
    case A_TOBOOL:
      fprintf(stdout, "A_TOBOOL\n");
      return;
    case A_LOGOR:
      fprintf(stdout, "A_LOGOR\n");
      return;
    case A_LOGAND:
      fprintf(stdout, "A_LOGAND\n");
      return;
    case A_AND:
      fprintf(stdout, "A_AND\n");
      return;
    case A_ASMOD:
      fprintf(stdout, "A_ASMOD\n");
      return;
    case A_INVERT:
      fprintf(stdout, "A_INVERT\n");
      return;
    case A_LOGNOT:
      fprintf(stdout, "A_LOGNOT\n");
      return;
    case A_LSHIFT:
      fprintf(stdout, "A_LSHIFT\n");
      return;
    case A_MOD:
      fprintf(stdout, "A_MOD\n");
      return;
    case A_OR:
      fprintf(stdout, "A_OR\n");
      return;
    case A_RSHIFT:
      fprintf(stdout, "A_RSHIFT\n");
      return;
    case A_TERNARY:
      fprintf(stdout, "A_TERNARY\n");
      return;
    case A_XOR:
      fprintf(stdout, "A_XOR\n");
      return;
    default:
      fatald("Unknown dumpAST operator", n->op);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rdi, %rbx
movq 0x5def(%rip), %r13      # 0xdfd0
pushq $0x20
popq %r12
movl 0x4(%rbx), %eax
cmpl $0x1e, %eax
je 0x825a
cmpl $0x1f, %eax
jne 0x8302
movl 0x610c(%rip), %eax      # 0xe308
movq %rax, -0x30(%rbp)
incl %eax
movl %eax, 0x6100(%rip)      # 0xe308
testl %r14d, %r14d
movl $0x0, %r15d
cmovgl %r14d, %r15d
movq (%r13), %rsi
subl $0x1, %r15d
jb 0x8229
movl %r12d, %edi
callq 0x20e0
jmp 0x8215
movq %rsi, %rdi
leaq 0x2b68(%rip), %rsi      # 0xad9b
movq -0x30(%rbp), %rdx
xorl %eax, %eax
callq 0x2100
incl 0x60c4(%rip)            # 0xe308
movq 0x20(%rbx), %rdi
addl $0x2, %r14d
movl %r14d, %edx
callq 0x81c6
movq 0x30(%rbx), %rbx
jmp 0x81e5
incl 0x60a8(%rip)            # 0xe308
testl %r14d, %r14d
movl $0x0, %r15d
cmovgl %r14d, %r15d
movq (%r13), %rcx
subl $0x1, %r15d
jb 0x8284
movl %r12d, %edi
movq %rcx, %rsi
callq 0x20e0
jmp 0x826d
leaq 0x2b01(%rip), %rdi      # 0xad8c
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
callq 0x2180
cmpq $0x0, 0x30(%rbx)
je 0x82be
movl 0x6065(%rip), %edx      # 0xe308
leal 0x1(%rdx), %eax
movl %eax, 0x605c(%rip)      # 0xe308
movq (%r13), %rdi
leaq 0x2ada(%rip), %rsi      # 0xad91
xorl %eax, %eax
callq 0x2100
movq (%r13), %rsi
pushq $0xa
popq %rdi
callq 0x20e0
movq 0x20(%rbx), %rdi
addl $0x2, %r14d
movl %r14d, %edx
callq 0x81c6
movq 0x28(%rbx), %rdi
movl %r14d, %edx
callq 0x81c6
movq 0x30(%rbx), %rbx
testq %rbx, %rbx
jne 0x81e5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x1d, %eax
jne 0x830b
pushq $-0x2
popq %r14
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x831d
leal 0x2(%r14), %edx
callq 0x81c6
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x832f
leal 0x2(%r14), %edx
callq 0x81c6
xorl %r15d, %r15d
testl %r14d, %r14d
cmovgl %r14d, %r15d
pushq $0x20
popq %r14
subl $0x1, %r15d
jb 0x8351
movq (%r13), %rsi
movl %r14d, %edi
callq 0x20e0
jmp 0x833d
movl 0x4(%rbx), %esi
leal -0x1(%rsi), %eax
cmpl $0x33, %eax
ja 0x86d1
leaq 0x2935(%rip), %rcx      # 0xac9c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%r13), %rcx
leaq 0x2a78(%rip), %rdi      # 0xadf3
jmp 0x8660
movq (%r13), %rcx
leaq 0x2bbb(%rip), %rdi      # 0xaf46
jmp 0x8672
movq (%r13), %rdi
movl 0x8(%rbx), %edx
leaq 0x2b73(%rip), %rsi      # 0xaf11
jmp 0x86bc
movq (%r13), %rdi
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rdx
leaq 0x2aaf(%rip), %rsi      # 0xae65
jmp 0x8712
movq (%r13), %rcx
leaq 0x2b01(%rip), %rdi      # 0xaec7
jmp 0x85b4
movq (%r13), %rcx
leaq 0x2ae6(%rip), %rdi      # 0xaebc
jmp 0x85b4
movq (%r13), %rdi
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rdx
leaq 0x2ab4(%rip), %rsi      # 0xaea2
jmp 0x8712
movq (%r13), %rdi
movl (%rbx), %edx
leaq 0x2a12(%rip), %rsi      # 0xae12
jmp 0x86bc
movq (%r13), %rcx
leaq 0x2acc(%rip), %rdi      # 0xaedc
jmp 0x86f2
movq (%r13), %rcx
leaq 0x2b67(%rip), %rdi      # 0xaf87
jmp 0x8672
cmpl $0x0, 0x18(%rbx)
movq (%r13), %rcx
je 0x86eb
leaq 0x2a45(%rip), %rdi      # 0xae7f
pushq $0xd
jmp 0x86f4
movq (%r13), %rcx
leaq 0x2979(%rip), %rdi      # 0xadc5
jmp 0x8585
movq (%r13), %rcx
leaq 0x2991(%rip), %rdi      # 0xaded
jmp 0x8660
movq (%r13), %rdi
movl (%rbx), %edx
leaq 0x2997(%rip), %rsi      # 0xae05
jmp 0x86bc
movq (%r13), %rcx
leaq 0x2adb(%rip), %rdi      # 0xaf59
jmp 0x8672
movq (%r13), %rcx
leaq 0x2b1a(%rip), %rdi      # 0xafa8
jmp 0x85b4
movq (%r13), %rcx
leaq 0x293f(%rip), %rdi      # 0xaddd
jmp 0x8672
movq (%r13), %rcx
leaq 0x2a24(%rip), %rdi      # 0xaed2
jmp 0x8672
movq (%r13), %rcx
leaq 0x2af5(%rip), %rdi      # 0xafb3
jmp 0x8681
movq (%r13), %rcx
leaq 0xd7a(%rip), %rdi       # 0x9248
pushq $0x2
jmp 0x86f4
movq (%r13), %rcx
leaq 0x2a51(%rip), %rdi      # 0xaf31
jmp 0x8672
movq (%r13), %rdi
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rdx
leaq 0x28b7(%rip), %rsi      # 0xadaf
jmp 0x8712
movq (%r13), %rcx
leaq 0x2953(%rip), %rdi      # 0xae5b
jmp 0x8672
movq (%r13), %rcx
leaq 0x2a0e(%rip), %rdi      # 0xaf26
jmp 0x85b4
movq (%r13), %rcx
leaq 0x28a9(%rip), %rdi      # 0xadd1
jmp 0x8585
movq (%r13), %rcx
leaq 0x28b2(%rip), %rdi      # 0xade7
jmp 0x8660
movq (%r13), %rcx
leaq 0x2a59(%rip), %rdi      # 0xaf9e
jmp 0x8672
movq (%r13), %rcx
leaq 0x28f3(%rip), %rdi      # 0xae48
jmp 0x8672
movq (%r13), %rcx
leaq 0x29fe(%rip), %rdi      # 0xaf63
jmp 0x8681
movq (%r13), %rcx
leaq 0x29fe(%rip), %rdi      # 0xaf73
jmp 0x8672
movq (%r13), %rcx
leaq 0x2960(%rip), %rdi      # 0xaee5
pushq $0xb
jmp 0x86f4
movq (%r13), %rcx
leaq 0x29a4(%rip), %rdi      # 0xaf3b
jmp 0x85b4
movq (%r13), %rcx
leaq 0x2978(%rip), %rdi      # 0xaf1c
jmp 0x8672
movq (%r13), %rcx
leaq 0x2948(%rip), %rdi      # 0xaefc
pushq $0xa
jmp 0x86f4
movq (%r13), %rcx
leaq 0x29cb(%rip), %rdi      # 0xaf91
jmp 0x8681
movq (%r13), %rcx
leaq 0x2931(%rip), %rdi      # 0xaf07
jmp 0x8672
movq (%r13), %rcx
leaq 0x2984(%rip), %rdi      # 0xaf6a
jmp 0x86f2
movq (%r13), %rdi
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rdx
leaq 0x28b1(%rip), %rsi      # 0xaeaf
jmp 0x8712
movq (%r13), %rcx
leaq 0x2844(%rip), %rdi      # 0xae52
jmp 0x86f2
movq (%r13), %rcx
leaq 0x2932(%rip), %rdi      # 0xaf50
jmp 0x86f2
movq (%r13), %rcx
leaq 0x296a(%rip), %rdi      # 0xaf98
jmp 0x8660
movq (%r13), %rdi
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rdx
leaq 0x2831(%rip), %rsi      # 0xae74
jmp 0x8712
movq (%r13), %rcx
leaq 0x27ac(%rip), %rdi      # 0xadff
jmp 0x8660
movq (%r13), %rcx
leaq 0x2799(%rip), %rdi      # 0xadf9
pushq $0x5
jmp 0x86f4
movq (%r13), %rcx
leaq 0x290b(%rip), %rdi      # 0xaf7d
pushq $0x9
jmp 0x86f4
movq (%r13), %rcx
leaq 0x273d(%rip), %rdi      # 0xadbe
pushq $0x6
jmp 0x86f4
cmpl $0x0, 0x18(%rbx)
movq (%r13), %rdi
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rdx
je 0x870b
leaq 0x278d(%rip), %rsi      # 0xae2b
jmp 0x8712
movq (%r13), %rdi
movl (%rbx), %edx
leaq 0x27e9(%rip), %rsi      # 0xae96
jmp 0x86bc
movq (%r13), %rdi
movl (%rbx), %edx
leaq 0x2835(%rip), %rsi      # 0xaef1
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2100
leaq 0x28e2(%rip), %rdi      # 0xafba
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x656d
leaq 0x279b(%rip), %rdi      # 0xae8d
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2180
leaq 0x272a(%rip), %rsi      # 0xae3c
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2100
nop