// File: /workspace/github_c_makefile_star2_O0/sisshiki1969[P]monocc/src/parse.c
// Function: parse_postfix_expr
Node *parse_postfix_expr() {
  Node *node = parse_prim_expr();
  while (true) {
    Token *op_token = token;
    if (consume_if(TK_OP_PAREN)) {
      /*
      if (node->kind != ND_IDENT)
        error_at_node(node, "Currently, callee must be an identifier.");*/
      Function *fn = find_func(node->token);
      if (!fn) error_at_node(node, "Undefined identifier.");
      node->type = fn->type->ptr_to;
      Vector *vec = vec_new();
      Token *op_token = token;
      MemberInfo *param = fn->type->params;
      while (!peek(TK_CL_PAREN)) {
        if (!param && !fn->type->variadic)
          error_at_token(token, "Too many arguments in func call.");
        Node *arg = parse_assign_expr();
        if (is_array(type(arg)))
          arg = new_node_expr(ND_ADDR, arg, NULL, arg->token);
        if (param && !is_compatible_type(param->type, type(arg))) {
          error_types(param->type, type(arg));
          error_at_node(arg, "The type of an argument is mismatch %s",
                        "with func parameter.");
        }
        if (param) {
          Type *ty_from = type(arg);
          Type *ty_to = param->type;
          arg = new_node_cast(arg, ty_to, arg->token);
        }

        vec_push(vec, arg);
        if (param) param = param->next;
        if (!consume_if(TK_COMMA)) break;
      }
      if (param) error_at_token(token, "Too few arguments in func call.");
      expect(TK_CL_PAREN);
      node = new_node_call(node, vec, node->token);
    } else if (consume_if(TK_OP_BRACKET)) {
      // ary[index] -> *(ary + index * sizeof(ary))
      if (!is_array(type(node)) && !is_ptr(type(node)))
        error_at_node(node, "Subscripted value is neither array nor pointer.");
      Node *offset = parse_expr();
      node = pointer_add(node, offset, token);
      /*int size = sizeof_type(type(node)->ptr_to);
      offset =
          new_node_binary(ND_MUL, offset, new_node_num(size, token), token);
      node = new_node_binary(ND_ADD, node, offset, token);*/
      node = new_node_expr(ND_DEREF, node, NULL, token);
      expect(TK_CL_BRACKET);
    } else if (consume_if(TK_INC)) {
      Node *rhs =
          new_node_binary(ND_ADD, node, new_node_num(1, op_token), op_token);
      node = new_node_expr(ND_ASSIGN, node, rhs, op_token);
      node = new_node_binary(ND_SUB, node, new_node_num(1, op_token), op_token);
    } else if (consume_if(TK_DEC)) {
      Node *rhs =
          new_node_binary(ND_SUB, node, new_node_num(1, op_token), op_token);
      node = new_node_expr(ND_ASSIGN, node, rhs, op_token);
      node = new_node_binary(ND_ADD, node, new_node_num(1, op_token), op_token);
    } else if (consume_if(TK_DOT)) {
      if (!is_struct(type(node)))
        error_at_node(
            node,
            "Request for member 'a' in something not a structure or union.");
      node = new_node_member(node, consume_ident());
    } else if (consume_if(TK_ARROW)) {
      if (!is_ptr(type(node)) || !is_struct(type(node)->ptr_to))
        error_at_node(node, "Invalid type argument of '->'.");
      node = new_node_binary(ND_DEREF, node, NULL, op_token);
      node = new_node_member(node, consume_ident());
    } else
      return node;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
callq 0x8030
movq %rax, -0x8(%rbp)
leaq 0xce1d(%rip), %rax      # 0x15218
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movl $0x1d, %edi
callq 0x7860
testb $0x1, %al
jne 0x8415
jmp 0x8616
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x7de0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x843f
movq -0x8(%rbp), %rdi
leaq 0x80a4(%rip), %rsi      # 0x104dc
movb $0x0, %al
callq 0x6040
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x58(%rax)
movb $0x0, %al
callq 0x3fb0
movq %rax, -0x20(%rbp)
leaq 0xcdb3(%rip), %rax      # 0x15218
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
movl $0x1e, %edi
callq 0x77d0
xorb $-0x1, %al
testb $0x1, %al
jne 0x8491
jmp 0x85cf
cmpq $0x0, -0x30(%rbp)
jne 0x84be
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
testb $0x1, 0x38(%rax)
jne 0x84be
leaq 0xcd6b(%rip), %rax      # 0x15218
movq (%rax), %rdi
leaq 0x803b(%rip), %rsi      # 0x104f2
movb $0x0, %al
callq 0x5d20
callq 0x9320
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0xdda0
movq %rax, %rdi
callq 0xd370
testb $0x1, %al
jne 0x84de
jmp 0x84fc
movq -0x38(%rbp), %rsi
movq -0x38(%rbp), %rax
movq 0x50(%rax), %rcx
movl $0x16, %edi
xorl %eax, %eax
movl %eax, %edx
callq 0x6f70
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x8562
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x38(%rbp), %rdi
callq 0xdda0
movq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0xdac0
testb $0x1, %al
jne 0x8562
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x38(%rbp), %rdi
callq 0xdda0
movq -0x70(%rbp), %rdi
movq %rax, %rsi
callq 0xe240
movq -0x38(%rbp), %rdi
leaq 0x7fbf(%rip), %rsi      # 0x10513
leaq 0x7fdf(%rip), %rdx      # 0x1053a
movb $0x0, %al
callq 0x6040
cmpq $0x0, -0x30(%rbp)
je 0x859b
movq -0x38(%rbp), %rdi
callq 0xdda0
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x38(%rbp), %rax
movq 0x50(%rax), %rdx
callq 0x71f0
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x4020
cmpq $0x0, -0x30(%rbp)
je 0x85ba
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movl $0x23, %edi
callq 0x7860
testb $0x1, %al
jne 0x85ca
jmp 0x85cf
jmp 0x847c
cmpq $0x0, -0x30(%rbp)
je 0x85ee
leaq 0xcc3b(%rip), %rax      # 0x15218
movq (%rax), %rdi
leaq 0x7f68(%rip), %rsi      # 0x1054f
movb $0x0, %al
callq 0x5d20
movl $0x1e, %edi
callq 0x7980
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdx
callq 0x7240
movq %rax, -0x8(%rbp)
jmp 0x88e5
movl $0x21, %edi
callq 0x7860
testb $0x1, %al
jne 0x8629
jmp 0x86b8
movq -0x8(%rbp), %rdi
callq 0xdda0
movq %rax, %rdi
callq 0xd370
testb $0x1, %al
jne 0x8665
movq -0x8(%rbp), %rdi
callq 0xdda0
movq %rax, %rdi
callq 0xd350
testb $0x1, %al
jne 0x8665
movq -0x8(%rbp), %rdi
leaq 0x7f11(%rip), %rsi      # 0x1056f
movb $0x0, %al
callq 0x6040
callq 0x9480
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rsi
leaq 0xcb9b(%rip), %rax      # 0x15218
movq (%rax), %rdx
callq 0x8300
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rsi
leaq 0xcb84(%rip), %rax      # 0x15218
movq (%rax), %rcx
movl $0x17, %edi
xorl %eax, %eax
movl %eax, %edx
callq 0x6f70
movq %rax, -0x8(%rbp)
movl $0x22, %edi
callq 0x7980
jmp 0x88e3
movl $0x12, %edi
callq 0x7860
testb $0x1, %al
jne 0x86c8
jmp 0x8745
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rsi
movl $0x1, %edi
callq 0x69f0
movq -0x80(%rbp), %rsi
movq %rax, %rdx
movq -0x10(%rbp), %rcx
movl $0x4, %edi
callq 0x6e30
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x10(%rbp), %rcx
movl $0x15, %edi
callq 0x6f70
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rsi
movl $0x1, %edi
callq 0x69f0
movq -0x78(%rbp), %rsi
movq %rax, %rdx
movq -0x10(%rbp), %rcx
movl $0x5, %edi
callq 0x6e30
movq %rax, -0x8(%rbp)
jmp 0x88e1
movl $0x13, %edi
callq 0x7860
testb $0x1, %al
jne 0x8758
jmp 0x87e1
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rsi
movl $0x1, %edi
callq 0x69f0
movq -0x90(%rbp), %rsi
movq %rax, %rdx
movq -0x10(%rbp), %rcx
movl $0x5, %edi
callq 0x6e30
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq -0x10(%rbp), %rcx
movl $0x15, %edi
callq 0x6f70
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rsi
movl $0x1, %edi
callq 0x69f0
movq -0x88(%rbp), %rsi
movq %rax, %rdx
movq -0x10(%rbp), %rcx
movl $0x4, %edi
callq 0x6e30
movq %rax, -0x8(%rbp)
jmp 0x88df
movl $0x25, %edi
callq 0x7860
testb $0x1, %al
jne 0x87f1
jmp 0x8840
movq -0x8(%rbp), %rdi
callq 0xdda0
movq %rax, %rdi
callq 0xd3b0
testb $0x1, %al
jne 0x8818
movq -0x8(%rbp), %rdi
leaq 0x7d8e(%rip), %rsi      # 0x1059f
movb $0x0, %al
callq 0x6040
movq -0x8(%rbp), %rax
movq %rax, -0x98(%rbp)
callq 0x7920
movq -0x98(%rbp), %rdi
movq %rax, %rsi
callq 0x6fe0
movq %rax, -0x8(%rbp)
jmp 0x88dd
movl $0x26, %edi
callq 0x7860
testb $0x1, %al
jne 0x8850
jmp 0x88ce
movq -0x8(%rbp), %rdi
callq 0xdda0
movq %rax, %rdi
callq 0xd350
testb $0x1, %al
jne 0x8867
jmp 0x887d
movq -0x8(%rbp), %rdi
callq 0xdda0
movq 0x8(%rax), %rdi
callq 0xd3b0
testb $0x1, %al
jne 0x888f
movq -0x8(%rbp), %rdi
leaq 0x7d55(%rip), %rsi      # 0x105dd
movb $0x0, %al
callq 0x6040
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rcx
movl $0x17, %edi
xorl %eax, %eax
movl %eax, %edx
callq 0x6e30
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
callq 0x7920
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
callq 0x6fe0
movq %rax, -0x8(%rbp)
jmp 0x88db
movq -0x8(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
jmp 0x88dd
jmp 0x88df
jmp 0x88e1
jmp 0x88e3
jmp 0x88e5
jmp 0x83f4
nopw (%rax,%rax)