// File: /workspace/github_c_makefile_star2_O1/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 0xa46a(%rip), %rbx      # 0xf3a0
movl (%rbx), %eax
leal -0x16(%rax), %ecx
cmpl $0x7, %ecx
ja 0x4f89
leaq 0x5e49(%rip), %rdx      # 0xad90
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
leaq 0xa449(%rip), %rdi      # 0xf3a0
callq 0x6a78
movl %r14d, %edi
callq 0x4f1b
movl $0x1, 0x18(%rax)
cmpl $0x20, 0x8(%rax)
jne 0x4f78
movl $0x30, 0x8(%rax)
movl 0x8(%rax), %esi
movq 0x10(%rax), %rdx
movl $0x2b, %edi
jmp 0x519a
cmpl $0xc, %eax
jne 0x4ff4
leaq 0xa40b(%rip), %rdi      # 0xf3a0
callq 0x6a78
movl %r14d, %edi
callq 0x4f1b
movq %rax, %r14
cmpl $0x1c, 0x4(%rax)
je 0x4fb7
leaq 0x5ed0(%rip), %rdi      # 0xae82
callq 0x688f
movq 0x38(%r14), %rax
cmpl $0x2, 0x20(%rax)
jne 0x4fcd
leaq 0x5ee7(%rip), %rdi      # 0xaeaf
callq 0x688f
movl $0x25, 0x4(%r14)
movl 0x8(%r14), %edi
callq 0x8dda
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 0x51b6
leaq 0x5da9(%rip), %rcx      # 0xadb0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x5fa7(%rip), %rdi      # 0xafbe
callq 0x688f
movq %rbx, %rdi
callq 0x6a78
cmpl $0x39, (%rbx)
je 0x5035
leaq 0x5fcb(%rip), %rdi      # 0xaffb
callq 0x688f
leaq 0xa364(%rip), %rdi      # 0xf3a0
callq 0x6a78
leaq -0x30(%rbp), %r14
leaq -0x34(%rbp), %rsi
movq %r14, %rdi
callq 0x3c44
movl %eax, %edi
callq 0x41a4
movq (%r14), %rsi
movl %eax, %edi
callq 0x8e29
movl %eax, %r14d
callq 0x684d
movl $0x1a, %edi
movl $0x30, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl %r14d, %r8d
callq 0x883b
movq %rax, %r14
jmp 0x530c
leaq 0xa311(%rip), %rdi      # 0xf3a0
callq 0x6a78
movl %r14d, %edi
callq 0x4f1b
movq %rax, %rbx
cmpl $0x1c, 0x4(%rax)
je 0x50b1
leaq 0x5e6b(%rip), %rdi      # 0xaf17
callq 0x688f
movl 0x8(%rbx), %esi
movq 0x10(%rbx), %rdx
movl $0x27, %edi
jmp 0x516e
leaq 0xa2d7(%rip), %rdi      # 0xf3a0
callq 0x6a78
movl %r14d, %edi
callq 0x4f1b
movl $0x1, 0x18(%rax)
movl 0x8(%rax), %esi
movq 0x10(%rax), %rdx
movl $0x2d, %edi
jmp 0x519a
leaq 0xa2ab(%rip), %rdi      # 0xf3a0
callq 0x6a78
movl %r14d, %edi
callq 0x4f1b
movq %rax, %rbx
cmpl $0x1c, 0x4(%rax)
je 0x5117
leaq 0x5e33(%rip), %rdi      # 0xaf45
callq 0x688f
movl 0x8(%rbx), %esi
movq 0x10(%rbx), %rdx
movl $0x28, %edi
jmp 0x516e
leaq 0xa274(%rip), %rdi      # 0xf3a0
callq 0x6a78
movl %r14d, %edi
callq 0x4f1b
movq %rax, %rbx
movl $0x1, 0x18(%rax)
movl 0x8(%rax), %edi
callq 0x8dcb
testl %eax, %eax
jne 0x515b
leaq 0x5d84(%rip), %rdi      # 0xaeda
callq 0x688f
movl 0x8(%rbx), %edi
callq 0x8e03
movq 0x10(%rbx), %rdx
movl $0x24, %edi
movl %eax, %esi
movq %rbx, %rcx
jmp 0x519d
leaq 0xa226(%rip), %rdi      # 0xf3a0
callq 0x6a78
movl %r14d, %edi
callq 0x4f1b
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 0x885b
movq 0x8(%rbx), %rsi
leaq 0x5ecf(%rip), %rdi      # 0xb090
callq 0x6797
jmp 0x5300
leaq 0xa1fe(%rip), %rdi      # 0xf3d0
callq 0x8393
testq %rax, %rax
je 0x54a8
movl (%rax), %r8d
jmp 0x5274
movq $0x0, -0x30(%rbp)
movq %rbx, %rdi
callq 0x6a78
movl (%rbx), %eax
xorl %r15d, %r15d
cmpq $0x36, %rax
ja 0x5228
movabsq $0x383c0000000, %rcx    # imm = 0x383C0000000
btq %rax, %rcx
jae 0x550b
leaq -0x30(%rbp), %rdi
callq 0x41d4
movl %eax, %r15d
callq 0x684d
movl %r14d, %edi
callq 0x4cc5
movq %rax, %r14
testl %r15d, %r15d
je 0x5501
movq -0x30(%rbp), %rdx
movl $0x34, %edi
movl %r15d, %esi
movq %r14, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x885b
jmp 0x5080
movl 0x10(%rbx), %r8d
cmpl $0xff, %r8d
ja 0x5274
movl $0x1a, %edi
movl $0x20, %esi
jmp 0x527e
movl $0x1a, %edi
movl $0x30, %esi
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0x52f8
leaq 0xa145(%rip), %rdi      # 0xf3d0
xorl %esi, %esi
callq 0x6138
movl %eax, %r14d
leaq 0xa11c(%rip), %r15      # 0xf3b8
movq %r15, %rdi
callq 0x6a78
cmpl $0x34, (%r15)
jne 0x52db
leaq 0xa11f(%rip), %r12      # 0xf3d0
leaq 0xa0e8(%rip), %r13      # 0xf3a0
movq %r12, %rdi
movl $0x1, %esi
callq 0x6138
movq %r13, %rdi
callq 0x6a78
movq %r15, %rdi
callq 0x6a78
cmpl $0x34, (%r15)
je 0x52b8
callq 0x6162
movl $0x20, %edi
callq 0x8dda
movl $0x1b, %edi
movl %eax, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl %r14d, %r8d
callq 0x883b
movq %rax, %r14
leaq 0xa099(%rip), %rdi      # 0xf3a0
callq 0x6a78
leaq 0x5c60(%rip), %r15      # 0xaf73
leaq 0x5c6d(%rip), %r12      # 0xaf87
leaq 0x5c89(%rip), %r13      # 0xafaa
movl (%rbx), %eax
cmpl $0x1a, %eax
jle 0x536b
cmpl $0x3a, %eax
jg 0x53a9
cmpl $0x1b, %eax
jne 0x4fe2
cmpl $0x1, 0x18(%r14)
jne 0x5345
movq %r13, %rdi
callq 0x688f
movq %rbx, %rdi
callq 0x6a78
movl 0x4(%r14), %eax
addl $-0x29, %eax
cmpl $0x1, %eax
ja 0x5361
movq %r12, %rdi
callq 0x688f
movl $0x2a, 0x4(%r14)
jmp 0x5321
jne 0x4fe2
cmpl $0x1, 0x18(%r14)
jne 0x5380
movq %r15, %rdi
callq 0x688f
movq %rbx, %rdi
callq 0x6a78
movl 0x4(%r14), %eax
addl $-0x29, %eax
cmpl $0x1, %eax
ja 0x539c
movq %r12, %rdi
callq 0x688f
movl $0x29, 0x4(%r14)
jmp 0x5321
cmpl $0x3f, %eax
je 0x5493
cmpl $0x3e, %eax
je 0x548c
cmpl $0x3b, %eax
jne 0x4fe2
movl 0x8(%r14), %edi
callq 0x8dcb
testl %eax, %eax
jne 0x53dd
leaq 0x5cf6(%rip), %rdi      # 0xb0ce
callq 0x688f
movq %rbx, %rdi
callq 0x6a78
xorl %edi, %edi
callq 0x4cc5
movq %rax, %r15
movl $0x3c, %edi
leaq 0x67ed(%rip), %rsi      # 0xbbe8
callq 0x6770
movl 0x8(%r15), %edi
callq 0x8db0
testl %eax, %eax
jne 0x5419
leaq 0x5cd2(%rip), %rdi      # 0xb0e6
callq 0x688f
movl $0x1, 0x18(%r14)
movl 0x8(%r14), %esi
movq 0x10(%r14), %rdx
movq %r15, %rdi
movl $0x15, %ecx
callq 0x8e42
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 0x87b0
addq $0x10, %rsp
movq %rax, %r14
movl 0x8(%rax), %edi
callq 0x8e03
movq 0x10(%r14), %rdx
movl $0x24, %edi
movl %eax, %esi
movq %r14, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x885b
movq %rax, %r14
leaq 0x5aec(%rip), %r15      # 0xaf73
jmp 0x5321
movq %r14, %rdi
xorl %esi, %esi
jmp 0x549b
movq %r14, %rdi
movl $0x1, %esi
callq 0x55f1
movq %rax, %r14
jmp 0x5321
leaq 0x9f21(%rip), %rdi      # 0xf3d0
callq 0x820b
movq %rax, %r14
testq %rax, %rax
jne 0x54cf
leaq 0x5b5f(%rip), %rdi      # 0xb022
leaq 0x9f06(%rip), %rsi      # 0xf3d0
callq 0x6797
movl 0x20(%r14), %eax
cmpl $0x2, %eax
je 0x555f
cmpl $0x1, %eax
je 0x5535
testl %eax, %eax
jne 0x5586
movl 0x10(%r14), %esi
movq 0x18(%r14), %rdx
movl $0x1c, %edi
movq %r14, %rcx
xorl %r8d, %r8d
jmp 0x52f8
callq 0x684d
jmp 0x530c
cmpq $0x36, %rax
jne 0x5228
leaq 0x9eb4(%rip), %rdi      # 0xf3d0
callq 0x83ac
testq %rax, %rax
jne 0x5217
xorl %r14d, %r14d
xorl %r15d, %r15d
jmp 0x5228
movq %rbx, %rdi
callq 0x6a78
cmpl $0x39, (%rbx)
je 0x5555
leaq 0x5af6(%rip), %rdi      # 0xb03f
leaq 0x9e80(%rip), %rsi      # 0xf3d0
callq 0x6797
callq 0x5712
jmp 0x5080
movl 0x10(%r14), %esi
movq 0x18(%r14), %rdx
movl $0x25, %edi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x883b
movq %rax, %r14
movl $0x1, 0x18(%rax)
jmp 0x5300
leaq 0x5ad9(%rip), %rdi      # 0xb066
leaq 0x9e3c(%rip), %rsi      # 0xf3d0
jmp 0x51c1