// File: /workspace/github_c_makefile_star2_O3/ejunjsh[P]mycc/expr.c
// Function: prefix
static struct ASTnode *prefix(int ptp) {
  struct ASTnode *tree;
  switch (Token.token) {
  case T_AMPER:
    // 获取下个token，然后解析它
    // 递归执行
    scan(&Token);
    tree = prefix(ptp);

    // 保证是标识符
    if (tree->op != A_IDENT)
      fatal("& operator must be followed by an identifier");

    // 防止'&'用在数组上
    if (tree->sym->stype == S_ARRAY)
      fatal("& operator cannot be performed on an array");

    // 改变操作为A_ADDR，类型改成指向原来类型的指针
    tree->op = A_ADDR;
    tree->type = pointer_to(tree->type);
    break;
  case T_STAR:
    // 获取下个token，然后解析它
    // 递归执行
    // 标记为右值
    scan(&Token);
    tree = prefix(ptp);
    tree->rvalue= 1;

    // 保证树的类型是指针
    if (!ptrtype(tree->type))
      fatal("* operator must be followed by an expression of pointer type");

    // 创建A_DEREF节点
    tree =
      mkastunary(A_DEREF, value_at(tree->type), tree->ctype, tree, NULL, 0);
    break;
  case T_MINUS:
    // 获取下个token，然后解析它
    // 递归执行
    scan(&Token);
    tree = prefix(ptp);

    // 创建A_NEGATE节点
    // 标记为右值
    // 由于字符类型是无符号的，所以在这里要转成整型
    tree->rvalue = 1;
    if (tree->type == P_CHAR)
      tree->type = P_INT;
    tree = mkastunary(A_NEGATE, tree->type, tree->ctype, tree, NULL, 0);
    break;
  case T_INVERT:
    // 获取下个token，然后解析它
    // 递归执行
    scan(&Token);
    tree = prefix(ptp);

    // 创建A_INVERT节点
    // 标记为右值
    tree->rvalue = 1;
    tree = mkastunary(A_INVERT, tree->type, tree->ctype, tree, NULL, 0);
    break;
  case T_LOGNOT:
    // 获取下个token，然后解析它
    // 递归执行
    scan(&Token);
    tree = prefix(ptp);

    // 创建A_LOGNOT节点
    // 标记为右值
    tree->rvalue = 1;
    tree = mkastunary(A_LOGNOT, tree->type, tree->ctype, tree, NULL, 0);
    break;
  case T_INC:
    // 获取下个token，然后解析它
    // 递归执行
    scan(&Token);
    tree = prefix(ptp);

    // 保证是标识符
    if (tree->op != A_IDENT)
      fatal("++ operator must be followed by an identifier");

    // 创建A_PREINC节点
    tree = mkastunary(A_PREINC, tree->type, tree->ctype, tree, NULL, 0);
    break;
  case T_DEC:
    // 获取下个token，然后解析它
    // 递归执行
    scan(&Token);
    tree = prefix(ptp);

    // 保证是标识符
    if (tree->op != A_IDENT)
      fatal("-- operator must be followed by an identifier");

    // 创建A_PREDEC节点
    tree = mkastunary(A_PREDEC, tree->type, tree->ctype, tree, NULL, 0);
    break;
  default:
    tree = postfix(ptp);
  }
  return (tree);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edi, %r14d
leaq 0xa3c4(%rip), %rbx      # 0xf3a0
movl (%rbx), %eax
leal -0x16(%rax), %ecx
cmpl $0x7, %ecx
ja 0x5033
leaq 0x5da3(%rip), %rdx      # 0xad90
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
leaq 0xa3a3(%rip), %rdi      # 0xf3a0
callq 0x6b20
movl %r14d, %edi
callq 0x4fc1
movl $0x1, 0x18(%rax)
movl 0x8(%rax), %esi
cmpl $0x20, %esi
jne 0x5025
movl $0x30, 0x8(%rax)
movl $0x30, %esi
movq 0x10(%rax), %rdx
movl $0x2b, %edi
jmp 0x5244
cmpl $0xc, %eax
jne 0x509e
leaq 0xa361(%rip), %rdi      # 0xf3a0
callq 0x6b20
movl %r14d, %edi
callq 0x4fc1
movq %rax, %r14
cmpl $0x1c, 0x4(%rax)
je 0x5061
leaq 0x5e26(%rip), %rdi      # 0xae82
callq 0x6937
movq 0x38(%r14), %rax
cmpl $0x2, 0x20(%rax)
jne 0x5077
leaq 0x5e3d(%rip), %rdi      # 0xaeaf
callq 0x6937
movl $0x25, 0x4(%r14)
movl 0x8(%r14), %edi
callq 0x8e52
movl %eax, 0x8(%r14)
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addl $-0x2b, %eax
cmpl $0xe, %eax
ja 0x5260
leaq 0x5cff(%rip), %rcx      # 0xadb0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x5efd(%rip), %rdi      # 0xafbe
callq 0x6937
movq %rbx, %rdi
callq 0x6b20
cmpl $0x39, (%rbx)
je 0x50df
leaq 0x5f21(%rip), %rdi      # 0xaffb
callq 0x6937
leaq 0xa2ba(%rip), %rdi      # 0xf3a0
callq 0x6b20
leaq -0x30(%rbp), %r14
leaq -0x34(%rbp), %rsi
movq %r14, %rdi
callq 0x3c7c
movl %eax, %edi
callq 0x41f9
movq (%r14), %rsi
movl %eax, %edi
callq 0x8ea1
movl %eax, %r14d
callq 0x68f5
movl $0x1a, %edi
movl $0x30, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl %r14d, %r8d
callq 0x88b3
movq %rax, %r14
jmp 0x53b7
leaq 0xa267(%rip), %rdi      # 0xf3a0
callq 0x6b20
movl %r14d, %edi
callq 0x4fc1
movq %rax, %rbx
cmpl $0x1c, 0x4(%rax)
je 0x515b
leaq 0x5dc1(%rip), %rdi      # 0xaf17
callq 0x6937
movl 0x8(%rbx), %esi
movq 0x10(%rbx), %rdx
movl $0x27, %edi
jmp 0x5218
leaq 0xa22d(%rip), %rdi      # 0xf3a0
callq 0x6b20
movl %r14d, %edi
callq 0x4fc1
movl $0x1, 0x18(%rax)
movl 0x8(%rax), %esi
movq 0x10(%rax), %rdx
movl $0x2d, %edi
jmp 0x5244
leaq 0xa201(%rip), %rdi      # 0xf3a0
callq 0x6b20
movl %r14d, %edi
callq 0x4fc1
movq %rax, %rbx
cmpl $0x1c, 0x4(%rax)
je 0x51c1
leaq 0x5d89(%rip), %rdi      # 0xaf45
callq 0x6937
movl 0x8(%rbx), %esi
movq 0x10(%rbx), %rdx
movl $0x28, %edi
jmp 0x5218
leaq 0xa1ca(%rip), %rdi      # 0xf3a0
callq 0x6b20
movl %r14d, %edi
callq 0x4fc1
movq %rax, %rbx
movl $0x1, 0x18(%rax)
movl 0x8(%rax), %edi
callq 0x8e43
testl %eax, %eax
jne 0x5205
leaq 0x5cda(%rip), %rdi      # 0xaeda
callq 0x6937
movl 0x8(%rbx), %edi
callq 0x8e7b
movq 0x10(%rbx), %rdx
movl $0x24, %edi
movl %eax, %esi
movq %rbx, %rcx
jmp 0x5247
leaq 0xa17c(%rip), %rdi      # 0xf3a0
callq 0x6b20
movl %r14d, %edi
callq 0x4fc1
movl $0x1, 0x18(%rax)
movl 0x8(%rax), %esi
movq 0x10(%rax), %rdx
movl $0x2c, %edi
movq %rax, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x88d3
movq 0x8(%rbx), %rsi
leaq 0x5e25(%rip), %rdi      # 0xb090
callq 0x683f
jmp 0x53ab
leaq 0xa154(%rip), %rdi      # 0xf3d0
callq 0x83ff
testq %rax, %rax
je 0x5553
movl (%rax), %r8d
jmp 0x531f
movq $0x0, -0x30(%rbp)
movq %rbx, %rdi
callq 0x6b20
movl (%rbx), %eax
cmpq $0x36, %rax
ja 0x55ca
movabsq $0x383c0000000, %rcx    # imm = 0x383C0000000
btq %rax, %rcx
jae 0x55ac
leaq -0x30(%rbp), %rdi
callq 0x4229
movl %eax, %r15d
callq 0x68f5
movl %r14d, %edi
callq 0x4d39
movq %rax, %r14
testl %r15d, %r15d
je 0x55d5
movq -0x30(%rbp), %rdx
movl $0x34, %edi
movl %r15d, %esi
movq %r14, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x88d3
jmp 0x512a
movl 0x10(%rbx), %r8d
cmpl $0xff, %r8d
ja 0x531f
movl $0x1a, %edi
movl $0x20, %esi
jmp 0x5329
movl $0x1a, %edi
movl $0x30, %esi
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0x53a3
leaq 0xa09a(%rip), %rdi      # 0xf3d0
xorl %esi, %esi
callq 0x61fd
movl %eax, %r14d
leaq 0xa071(%rip), %r15      # 0xf3b8
movq %r15, %rdi
callq 0x6b20
cmpl $0x34, (%r15)
jne 0x5386
leaq 0xa074(%rip), %r12      # 0xf3d0
leaq 0xa03d(%rip), %r13      # 0xf3a0
movq %r12, %rdi
movl $0x1, %esi
callq 0x61fd
movq %r13, %rdi
callq 0x6b20
movq %r15, %rdi
callq 0x6b20
cmpl $0x34, (%r15)
je 0x5363
callq 0x6227
movl $0x20, %edi
callq 0x8e52
movl $0x1b, %edi
movl %eax, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl %r14d, %r8d
callq 0x88b3
movq %rax, %r14
leaq 0x9fee(%rip), %rdi      # 0xf3a0
callq 0x6b20
leaq 0x5bb5(%rip), %r15      # 0xaf73
leaq 0x5bc2(%rip), %r12      # 0xaf87
leaq 0x5bde(%rip), %r13      # 0xafaa
movl (%rbx), %eax
cmpl $0x1a, %eax
jle 0x5416
cmpl $0x3a, %eax
jg 0x5454
cmpl $0x1b, %eax
jne 0x508c
cmpl $0x1, 0x18(%r14)
jne 0x53f0
movq %r13, %rdi
callq 0x6937
movq %rbx, %rdi
callq 0x6b20
movl 0x4(%r14), %eax
addl $-0x29, %eax
cmpl $0x1, %eax
ja 0x540c
movq %r12, %rdi
callq 0x6937
movl $0x2a, 0x4(%r14)
jmp 0x53cc
jne 0x508c
cmpl $0x1, 0x18(%r14)
jne 0x542b
movq %r15, %rdi
callq 0x6937
movq %rbx, %rdi
callq 0x6b20
movl 0x4(%r14), %eax
addl $-0x29, %eax
cmpl $0x1, %eax
ja 0x5447
movq %r12, %rdi
callq 0x6937
movl $0x29, 0x4(%r14)
jmp 0x53cc
cmpl $0x3f, %eax
je 0x553e
cmpl $0x3e, %eax
je 0x5537
cmpl $0x3b, %eax
jne 0x508c
movl 0x8(%r14), %edi
callq 0x8e43
testl %eax, %eax
jne 0x5488
leaq 0x5c4b(%rip), %rdi      # 0xb0ce
callq 0x6937
movq %rbx, %rdi
callq 0x6b20
xorl %edi, %edi
callq 0x4d39
movq %rax, %r15
movl $0x3c, %edi
leaq 0x6742(%rip), %rsi      # 0xbbe8
callq 0x6818
movl 0x8(%r15), %edi
callq 0x8e28
testl %eax, %eax
jne 0x54c4
leaq 0x5c27(%rip), %rdi      # 0xb0e6
callq 0x6937
movl $0x1, 0x18(%r14)
movl 0x8(%r14), %esi
movq 0x10(%r14), %rdx
movq %r15, %rdi
movl $0x15, %ecx
callq 0x8eba
movl 0x8(%r14), %esi
movq 0x10(%r14), %rdx
movl $0x15, %edi
movq %r14, %rcx
xorl %r8d, %r8d
movq %rax, %r9
pushq $0x0
pushq $0x0
callq 0x8828
addq $0x10, %rsp
movq %rax, %r14
movl 0x8(%rax), %edi
callq 0x8e7b
movq 0x10(%r14), %rdx
movl $0x24, %edi
movl %eax, %esi
movq %r14, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x88d3
movq %rax, %r14
leaq 0x5a41(%rip), %r15      # 0xaf73
jmp 0x53cc
movq %r14, %rdi
xorl %esi, %esi
jmp 0x5546
movq %r14, %rdi
movl $0x1, %esi
callq 0x56a4
movq %rax, %r14
jmp 0x53cc
leaq 0x9e76(%rip), %rdi      # 0xf3d0
callq 0x8288
movq %rax, %r14
testq %rax, %rax
jne 0x557a
leaq 0x5ab4(%rip), %rdi      # 0xb022
leaq 0x9e5b(%rip), %rsi      # 0xf3d0
callq 0x683f
movl 0x20(%r14), %eax
cmpl $0x2, %eax
je 0x5609
cmpl $0x1, %eax
je 0x55df
testl %eax, %eax
jne 0x5630
movl 0x10(%r14), %esi
movq 0x18(%r14), %rdx
movl $0x1c, %edi
movq %r14, %rcx
xorl %r8d, %r8d
jmp 0x53a3
cmpq $0x36, %rax
jne 0x55ca
leaq 0x9e17(%rip), %rdi      # 0xf3d0
callq 0x8418
testq %rax, %rax
jne 0x52c2
xorl %r14d, %r14d
movl %r14d, %edi
callq 0x4d39
movq %rax, %r14
callq 0x68f5
jmp 0x53b7
movq %rbx, %rdi
callq 0x6b20
cmpl $0x39, (%rbx)
je 0x55ff
leaq 0x5a4c(%rip), %rdi      # 0xb03f
leaq 0x9dd6(%rip), %rsi      # 0xf3d0
callq 0x683f
callq 0x57b7
jmp 0x512a
movl 0x10(%r14), %esi
movq 0x18(%r14), %rdx
movl $0x25, %edi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x88b3
movq %rax, %r14
movl $0x1, 0x18(%rax)
jmp 0x53ab
leaq 0x5a2f(%rip), %rdi      # 0xb066
leaq 0x9d92(%rip), %rsi      # 0xf3d0
jmp 0x526b