// File: /workspace/github_c_makefile_star2_O2/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 0x97d7(%rip), %rbx      # 0xe3a0
movl (%rbx), %eax
leal -0x16(%rax), %ecx
cmpl $0x7, %ecx
ja 0x4c1b
leaq 0x51b6(%rip), %rdx      # 0x9d90
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
leaq 0x97b6(%rip), %rdi      # 0xe3a0
callq 0x66f4
movl %r14d, %edi
callq 0x4bae
movl $0x1, 0x18(%rax)
movl 0x8(%rax), %esi
cmpl $0x20, %esi
jne 0x4c10
movl $0x30, 0x8(%rax)
pushq $0x30
popq %rsi
movq 0x10(%rax), %rdx
pushq $0x2b
jmp 0x4e18
cmpl $0xc, %eax
jne 0x4c86
leaq 0x9779(%rip), %rdi      # 0xe3a0
callq 0x66f4
movl %r14d, %edi
callq 0x4bae
movq %rax, %r14
cmpl $0x1c, 0x4(%rax)
je 0x4c49
leaq 0x523e(%rip), %rdi      # 0x9e82
callq 0x6515
movq 0x38(%r14), %rax
cmpl $0x2, 0x20(%rax)
jne 0x4c5f
leaq 0x5255(%rip), %rdi      # 0x9eaf
callq 0x6515
movl $0x25, 0x4(%r14)
movl 0x8(%r14), %edi
callq 0x8752
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 0x4e35
leaq 0x5117(%rip), %rcx      # 0x9db0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x5315(%rip), %rdi      # 0x9fbe
callq 0x6515
movq %rbx, %rdi
callq 0x66f4
cmpl $0x39, (%rbx)
je 0x4cc7
leaq 0x5339(%rip), %rdi      # 0x9ffb
callq 0x6515
leaq 0x96d2(%rip), %rdi      # 0xe3a0
callq 0x66f4
leaq -0x30(%rbp), %r14
leaq -0x38(%rbp), %rsi
movq %r14, %rdi
callq 0x39b8
movl %eax, %edi
callq 0x3f2c
movq (%r14), %rsi
movl %eax, %edi
callq 0x87a1
movl %eax, %r14d
callq 0x64d3
pushq $0x1a
popq %rdi
pushq $0x30
popq %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movl %r14d, %r8d
callq 0x818c
movq %rax, %r14
jmp 0x4f6d
leaq 0x9683(%rip), %rdi      # 0xe3a0
callq 0x66f4
movl %r14d, %edi
callq 0x4bae
movq %rax, %rbx
cmpl $0x1c, 0x4(%rax)
je 0x4d3f
leaq 0x51dd(%rip), %rdi      # 0x9f17
callq 0x6515
movl 0x8(%rbx), %esi
movq 0x10(%rbx), %rdx
pushq $0x27
jmp 0x4da5
leaq 0x964f(%rip), %rdi      # 0xe3a0
callq 0x66f4
movl %r14d, %edi
callq 0x4bae
movl $0x1, 0x18(%rax)
movl 0x8(%rax), %esi
movq 0x10(%rax), %rdx
pushq $0x2d
jmp 0x4e18
leaq 0x9626(%rip), %rdi      # 0xe3a0
callq 0x66f4
movl %r14d, %edi
callq 0x4bae
movq %rax, %rbx
cmpl $0x1c, 0x4(%rax)
je 0x4d9c
leaq 0x51ae(%rip), %rdi      # 0x9f45
callq 0x6515
movl 0x8(%rbx), %esi
movq 0x10(%rbx), %rdx
pushq $0x28
popq %rdi
jmp 0x4def
leaq 0x95f1(%rip), %rdi      # 0xe3a0
callq 0x66f4
movl %r14d, %edi
callq 0x4bae
movq %rax, %rbx
movl $0x1, 0x18(%rax)
movl 0x8(%rax), %edi
callq 0x8743
testl %eax, %eax
jne 0x4dde
leaq 0x5101(%rip), %rdi      # 0x9eda
callq 0x6515
movl 0x8(%rbx), %edi
callq 0x877b
movq 0x10(%rbx), %rdx
pushq $0x24
popq %rdi
movl %eax, %esi
movq %rbx, %rcx
jmp 0x4e1c
leaq 0x95a5(%rip), %rdi      # 0xe3a0
callq 0x66f4
movl %r14d, %edi
callq 0x4bae
movl $0x1, 0x18(%rax)
movl 0x8(%rax), %esi
movq 0x10(%rax), %rdx
pushq $0x2c
popq %rdi
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 0x81aa
movq 0x8(%rbx), %rsi
leaq 0x5250(%rip), %rdi      # 0xa090
callq 0x641f
jmp 0x4f61
leaq 0x957f(%rip), %rdi      # 0xe3d0
callq 0x7d08
testq %rax, %rax
je 0x50ef
movl (%rax), %r8d
jmp 0x4ee9
andq $0x0, -0x30(%rbp)
movq %rbx, %rdi
callq 0x66f4
movl (%rbx), %eax
xorl %r15d, %r15d
cmpq $0x36, %rax
ja 0x4ea4
movabsq $0x383c0000000, %rcx    # imm = 0x383C0000000
btq %rax, %rcx
jae 0x5146
leaq -0x30(%rbp), %rdi
callq 0x3f5f
movl %eax, %r15d
callq 0x64d3
movl %r14d, %edi
callq 0x49b5
movq %rax, %r14
testl %r15d, %r15d
je 0x51e5
movq -0x30(%rbp), %rdx
pushq $0x34
popq %rdi
movl %r15d, %esi
movq %r14, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x81aa
jmp 0x4d0e
movl 0x10(%rbx), %r8d
cmpl $0xff, %r8d
ja 0x4ee9
pushq $0x1a
popq %rdi
pushq $0x20
jmp 0x4eee
pushq $0x1a
popq %rdi
pushq $0x30
popq %rsi
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0x4f59
leaq 0x94d4(%rip), %r15      # 0xe3d0
movq %r15, %rdi
xorl %esi, %esi
callq 0x5d75
movl %eax, -0x34(%rbp)
leaq 0x94a8(%rip), %r12      # 0xe3b8
pushq $0x1
popq %r13
leaq 0x9485(%rip), %r14      # 0xe3a0
movq %r12, %rdi
callq 0x66f4
cmpl $0x34, (%r12)
jne 0x4f3f
movq %r15, %rdi
movl %r13d, %esi
callq 0x5d75
movq %r14, %rdi
callq 0x66f4
jmp 0x4f1b
callq 0x5d9f
pushq $0x20
popq %rdi
callq 0x8752
pushq $0x1b
popq %rdi
movl %eax, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl -0x34(%rbp), %r8d
callq 0x818c
movq %rax, %r14
leaq 0x9438(%rip), %rdi      # 0xe3a0
callq 0x66f4
leaq 0x4fff(%rip), %r15      # 0x9f73
leaq 0x500c(%rip), %r12      # 0x9f87
leaq 0x5028(%rip), %r13      # 0x9faa
movl (%rbx), %eax
cmpl $0x1a, %eax
je 0x4fc3
cmpl $0x1b, %eax
jne 0x4ff8
cmpl $0x1, 0x18(%r14)
jne 0x4f9d
movq %r13, %rdi
callq 0x6515
movq %rbx, %rdi
callq 0x66f4
movl 0x4(%r14), %eax
addl $-0x29, %eax
cmpl $0x1, %eax
ja 0x4fb9
movq %r12, %rdi
callq 0x6515
movl $0x2a, 0x4(%r14)
jmp 0x4f82
cmpl $0x1, 0x18(%r14)
jne 0x4fd2
movq %r15, %rdi
callq 0x6515
movq %rbx, %rdi
callq 0x66f4
movl 0x4(%r14), %eax
addl $-0x29, %eax
cmpl $0x1, %eax
ja 0x4fee
movq %r12, %rdi
callq 0x6515
movl $0x29, 0x4(%r14)
jmp 0x4f82
cmpl $0x3f, %eax
je 0x50dc
cmpl $0x3e, %eax
je 0x50d5
cmpl $0x3b, %eax
jne 0x4c74
movl 0x8(%r14), %edi
callq 0x8743
testl %eax, %eax
jne 0x502c
leaq 0x50a7(%rip), %rdi      # 0xa0ce
callq 0x6515
movq %rbx, %rdi
callq 0x66f4
xorl %edi, %edi
callq 0x49b5
movq %rax, %r15
pushq $0x3c
popq %rdi
leaq 0x5ba0(%rip), %rsi      # 0xabe8
callq 0x63f8
movl 0x8(%r15), %edi
callq 0x8728
testl %eax, %eax
jne 0x5066
leaq 0x5085(%rip), %rdi      # 0xa0e6
callq 0x6515
movl $0x1, 0x18(%r14)
movl 0x8(%r14), %esi
movq 0x10(%r14), %rdx
movq %r15, %rdi
pushq $0x15
popq %r15
movl %r15d, %ecx
callq 0x87ba
movl 0x8(%r14), %esi
movq 0x10(%r14), %rdx
movl %r15d, %edi
movq %r14, %rcx
xorl %r8d, %r8d
movq %rax, %r9
pushq $0x0
pushq $0x0
callq 0x8108
popq %rcx
popq %rdx
movq %rax, %r14
movl 0x8(%rax), %edi
callq 0x877b
movq 0x10(%r14), %rdx
pushq $0x24
popq %rdi
movl %eax, %esi
movq %r14, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x81aa
movq %rax, %r14
leaq 0x4ea3(%rip), %r15      # 0x9f73
jmp 0x4f82
movq %r14, %rdi
xorl %esi, %esi
jmp 0x50e2
movq %r14, %rdi
pushq $0x1
popq %rsi
callq 0x52aa
movq %rax, %r14
jmp 0x4f82
leaq 0x92da(%rip), %rdi      # 0xe3d0
callq 0x7c48
movq %rax, %r14
testq %rax, %rax
jne 0x5116
leaq 0x4f18(%rip), %rdi      # 0xa022
leaq 0x92bf(%rip), %rsi      # 0xe3d0
callq 0x641f
movl 0x20(%r14), %eax
cmpl $0x2, %eax
je 0x51ef
cmpl $0x1, %eax
je 0x516e
testl %eax, %eax
jne 0x5214
movl 0x10(%r14), %esi
movq 0x18(%r14), %rdx
pushq $0x1c
popq %rdi
movq %r14, %rcx
xorl %r8d, %r8d
jmp 0x4f59
cmpq $0x36, %rax
jne 0x4ea4
leaq 0x9279(%rip), %rdi      # 0xe3d0
callq 0x7d21
testq %rax, %rax
jne 0x4e93
xorl %edi, %edi
callq 0x49b5
jmp 0x51e2
movq %rbx, %rdi
callq 0x66f4
cmpl $0x39, (%rbx)
je 0x518e
leaq 0x4ebd(%rip), %rdi      # 0xa03f
leaq 0x9247(%rip), %rsi      # 0xe3d0
callq 0x641f
leaq 0x923b(%rip), %rdi      # 0xe3d0
callq 0x7c48
movq %rax, %r14
testq %rax, %rax
je 0x51a9
cmpl $0x1, 0x20(%r14)
je 0x51bc
leaq 0x4f0a(%rip), %rdi      # 0xa0ba
leaq 0x9219(%rip), %rsi      # 0xe3d0
callq 0x641f
callq 0x64bd
pushq $0x3a
popq %rdi
callq 0x493c
movl 0x10(%r14), %esi
movq 0x18(%r14), %rdx
pushq $0x23
popq %rdi
movq %rax, %rcx
movq %r14, %r8
xorl %r9d, %r9d
callq 0x81aa
movq %rax, %r14
callq 0x64d3
jmp 0x4f6d
movl 0x10(%r14), %esi
movq 0x18(%r14), %rdx
pushq $0x25
popq %rdi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x818c
movq %rax, %r14
movl $0x1, 0x18(%rax)
jmp 0x4f61
leaq 0x4e4b(%rip), %rdi      # 0xa066
leaq 0x91ae(%rip), %rsi      # 0xe3d0
jmp 0x4e40