LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: get_error_lines
static char *get_error_lines(char *loc) {
  int pos = 0;
  char *p = user_input;

  while (p != loc) {
    pos++;
    p++;
  }

  // locまできたら、その行の行末または文字列の最後まですすめる
  while (*p && *p != '\n') {
    pos++;
    p++;
  }

  return my_strndup(user_input, pos);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
leaq 0xf07e(%rip), %rax      # 0x155c8
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x8(%rbp), %rax
je 0x6572
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x6551
jmp 0x6574
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x19(%rbp)
je 0x6595
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
setne %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0x659e
jmp 0x65b5
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x6574
leaq 0xf00c(%rip), %rax      # 0x155c8
movq (%rax), %rdi
movl -0xc(%rbp), %esi
callq 0x6690
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: my_strndup
char *my_strndup(char *str, int len) {
  char *buf = calloc(len + 1, sizeof(char));

  int i;
  for (i = 0; i < len; i++) {
    buf[i] = str[i];
  }
  buf[i] = '\0';

  return buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
movl $0x1, %esi
callq 0x20e0
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x66e6
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x66bd
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: consume_end
bool consume_end() {
  if (consume("}")) {
    return true;
  }

  Token *tmp = token;
  if (consume(",") && consume("}")) {
    return true;;
  }
  token = tmp;
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x9b93(%rip), %rdi      # 0x102a2
callq 0x6780
cmpq $0x0, %rax
je 0x6720
movb $0x1, -0x1(%rbp)
jmp 0x676a
leaq 0xeea9(%rip), %rax      # 0x155d0
movq (%rax), %rax
movq %rax, -0x10(%rbp)
leaq 0x9ebc(%rip), %rdi      # 0x105f1
callq 0x6780
cmpq $0x0, %rax
je 0x6758
leaq 0x9b5b(%rip), %rdi      # 0x102a2
callq 0x6780
cmpq $0x0, %rax
je 0x6758
movb $0x1, -0x1(%rbp)
jmp 0x676a
movq -0x10(%rbp), %rcx
leaq 0xee6d(%rip), %rax      # 0x155d0
movq %rcx, (%rax)
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: consume
static Token *consume(char *op) {
  Token *tk = token;
  if (!peek_token(op)) {
    return NULL;
  }
  token = token->next;
  return tk;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
leaq 0xee3d(%rip), %rax      # 0x155d0
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x69d0
testb $0x1, %al
jne 0x67b1
movq $0x0, -0x8(%rbp)
jmp 0x67d1
leaq 0xee18(%rip), %rax      # 0x155d0
movq (%rax), %rax
movq 0x8(%rax), %rcx
leaq 0xee0a(%rip), %rax      # 0x155d0
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: peek_end
bool peek_end() {
  Token *tmp = token;
  bool result = false;

  if (consume("}")) {
    result = true;
  } else if (consume(",") && consume("}")) {
    result =  true;;
  }

  token = tmp;
  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xede1(%rip), %rax      # 0x155d0
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movb $0x0, -0x9(%rbp)
leaq 0x9aa1(%rip), %rdi      # 0x102a2
callq 0x6780
cmpq $0x0, %rax
je 0x6812
movb $0x1, -0x9(%rbp)
jmp 0x683c
leaq 0x9dd8(%rip), %rdi      # 0x105f1
callq 0x6780
cmpq $0x0, %rax
je 0x683a
leaq 0x9a77(%rip), %rdi      # 0x102a2
callq 0x6780
cmpq $0x0, %rax
je 0x683a
movb $0x1, -0x9(%rbp)
jmp 0x683c
movq -0x8(%rbp), %rcx
leaq 0xed89(%rip), %rax      # 0x155d0
movq %rcx, (%rax)
movb -0x9(%rbp), %al
andb $0x1, %al
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: program
Program *program() {
  Function head = {};
  Function *cur = &head;
  while (!at_eof()) {
    switch(next_decl()) {
      case NEXT_DECL_FUNCTION_DEF:
        {
          Function *f = function_def_or_decl();
          if (f) {
            cur->next = f;
            cur = cur->next;
          }
        }
        break;
      case NEXT_DECL_GLOBAL_VAR_OR_TYPEDEF:
        global_var_decl();
        break;
      default:
        // ここには来ないはず
        assert(false);
    }
  }
  Program *program = calloc(1, sizeof(Program));
  program->global_var = globals;
  program->functions = head.next;

  return program;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0x20c0
leaq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
callq 0x6a60
xorb $-0x1, %al
testb $0x1, %al
jne 0x688d
jmp 0x68f8
callq 0x6a80
movl %eax, %ecx
movl %ecx, -0x54(%rbp)
subl $0x1, %eax
je 0x68a8
jmp 0x689e
movl -0x54(%rbp), %eax
subl $0x2, %eax
je 0x68d0
jmp 0x68d7
callq 0xb030
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x68ce
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x68f6
callq 0xaee0
jmp 0x68f6
leaq 0x89a4(%rip), %rdi      # 0xf282
leaq 0x9d0e(%rip), %rsi      # 0x105f3
movl $0x3a9, %edx            # imm = 0x3A9
leaq 0x9d0b(%rip), %rcx      # 0x105fc
callq 0x20b0
jmp 0x6880
movl $0x1, %edi
movl $0x10, %esi
callq 0x20e0
movq %rax, -0x50(%rbp)
movq 0xec66(%rip), %rcx      # 0x15578
movq -0x50(%rbp), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x50(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: new_var_node
Node *new_var_node(Var *var, Token *tk) {
  Node *node = new_node(ND_VAR, tk);
  node->var = var;
  add_type(node);
  return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rsi
movl $0x17, %edi
callq 0x6980
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0x18(%rbp), %rdi
callq 0xdb80
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: new_node
static Node *new_node(NodeKind kind, Token *tok) {
  Node *node = calloc(1, sizeof(Node));
  node->kind = kind;
  node->tok = tok;
  return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, %edi
movl $0xc8, %esi
callq 0x20e0
movq %rax, -0x18(%rbp)
movl -0x4(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: peek_token
static bool peek_token(char *op) {
  if (token->kind != TK_RESERVED ||
      token->len != strlen(op) ||
      memcmp(token->str, op, token->len)) {
    return false;
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
leaq 0xebed(%rip), %rax      # 0x155d0
movq (%rax), %rax
cmpl $0x1, (%rax)
jne 0x6a3c
leaq 0xebde(%rip), %rax      # 0x155d0
movq (%rax), %rax
movslq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2090
movq %rax, %rcx
movq -0x18(%rbp), %rax
cmpq %rcx, %rax
jne 0x6a3c
leaq 0xebb7(%rip), %rax      # 0x155d0
movq (%rax), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rsi
leaq 0xeba5(%rip), %rax      # 0x155d0
movq (%rax), %rax
movslq 0x20(%rax), %rdx
callq 0x20d0
cmpl $0x0, %eax
je 0x6a42
movb $0x0, -0x1(%rbp)
jmp 0x6a46
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: next_decl
static next_decl_type next_decl() {
  // 先読みした結果今の位置に戻る用に今のtokenを保存
  Token *tmp = token;
  bool is_func = false;
  bool is_global_var = false;

  StorageClass sclass = 0;
  Type *ty = basetype(&sclass);

  if (sclass == TYPEDEF) {
    // typedefがあったら、それは関数ではないとみなす
    token = tmp;
    return NEXT_DECL_GLOBAL_VAR_OR_TYPEDEF;
  }

  // toplevelでは
  // int;
  // のような式も合法で、これらは単に無視される。ので、その対応。
  if (!consume(";")) {
    char *name = NULL;
    declarator(ty, &name);
    if (consume("(")) {
      token = tmp;
      return NEXT_DECL_FUNCTION_DEF;
    }
  }
  // 先読みした結果、関数定義かグローバル変数かわかったので、tokenを元に戻す
  token = tmp;
  // それ以外はグローバル変数
  return NEXT_DECL_GLOBAL_VAR_OR_TYPEDEF;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0xeb41(%rip), %rax      # 0x155d0
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
movb $0x0, -0x12(%rbp)
movl $0x0, -0x18(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x6b40
movq %rax, -0x20(%rbp)
cmpl $0x1, -0x18(%rbp)
jne 0x6acf
movq -0x10(%rbp), %rcx
leaq 0xeb0d(%rip), %rax      # 0x155d0
movq %rcx, (%rax)
movl $0x2, -0x4(%rbp)
jmp 0x6b36
leaq 0x9b39(%rip), %rdi      # 0x1060f
callq 0x6780
cmpq $0x0, %rax
jne 0x6b21
movq $0x0, -0x28(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x6ef0
leaq 0x9a05(%rip), %rdi      # 0x10502
callq 0x6780
cmpq $0x0, %rax
je 0x6b1f
movq -0x10(%rbp), %rcx
leaq 0xeabd(%rip), %rax      # 0x155d0
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x6b36
jmp 0x6b21
movq -0x10(%rbp), %rcx
leaq 0xeaa4(%rip), %rax      # 0x155d0
movq %rcx, (%rax)
movl $0x2, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: declarator
static Type *declarator(Type *ty, char **name) {
  while (consume("*")) {
    ty = pointer_to(ty);
  }
  if (consume("(")) {
    Type *placeholder = calloc(1, sizeof(Type));
    Type *new_ty = declarator(placeholder, name);
    expect(")");
    // 入れ子部分を全部パースした後に、その後に続く配列の [] などを含めた(type_suffix)型としてplaceholderを完成させる
    memcpy(placeholder, type_suffix(ty), sizeof(Type));
    return new_ty;
  }

  *name = expect_ident();
  return type_suffix(ty);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq 0x9f0d(%rip), %rdi      # 0x10e14
callq 0x6780
cmpq $0x0, %rax
je 0x6f21
movq -0x10(%rbp), %rdi
callq 0xd990
movq %rax, -0x10(%rbp)
jmp 0x6f00
leaq 0x95da(%rip), %rdi      # 0x10502
callq 0x6780
cmpq $0x0, %rax
je 0x6f8f
movl $0x1, %edi
movl $0x30, %esi
callq 0x20e0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x6ef0
movq %rax, -0x28(%rbp)
leaq 0x96af(%rip), %rdi      # 0x1060d
callq 0x7730
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8b70
movq -0x30(%rbp), %rdi
movq %rax, %rsi
movl $0x30, %edx
callq 0x2130
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x6fab
callq 0x79d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
callq 0x8b70
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: is_type
static bool is_type(Token *tk) {
  if (is_builtin_type(tk)) {
    return true;
  }

  // ビルトインでなくても、typedefか構造体かenumかtypedefされた型ならtrueを返す
  // 型の途中でtypedef/static/externが出てくる場合もあるのでtypedef/static/extern自体も型名の一つとしてtrueにしておき
  // 詳細はbasetype関数で判断する
  switch (tk->kind) {
    case TK_TYPEDEF:
    case TK_STRUCT:
    case TK_ENUM:
    case TK_STATIC:
    case TK_EXTERN:
      return true;
    default:
      return (bool)find_typedef(tk);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x70c0
testb $0x1, %al
jne 0x6fdb
jmp 0x6fe1
movb $0x1, -0x1(%rbp)
jmp 0x701c
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
addl $-0x10, %eax
subl $0x2, %eax
jb 0x7001
jmp 0x6ff4
movl -0x14(%rbp), %eax
addl $-0x15, %eax
subl $0x2, %eax
ja 0x7007
jmp 0x7001
movb $0x1, -0x1(%rbp)
jmp 0x701c
movq -0x10(%rbp), %rdi
callq 0x70f0
cmpq $0x0, %rax
setne %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: consume_kind
static Token *consume_kind(TokenKind kind) {
  if (!peek_kind(kind)) {
    return NULL;
  }

  Token *t = token;
  token = token->next;

  return t;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0xc(%rbp)
movl -0xc(%rbp), %edi
callq 0x7030
testb $0x1, %al
jne 0x7081
movq $0x0, -0x8(%rbp)
jmp 0x70af
leaq 0xe548(%rip), %rax      # 0x155d0
movq (%rax), %rax
movq %rax, -0x18(%rbp)
leaq 0xe53a(%rip), %rax      # 0x155d0
movq (%rax), %rax
movq 0x8(%rax), %rcx
leaq 0xe52c(%rip), %rax      # 0x155d0
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: is_builtin_type
static bool is_builtin_type(Token *tk) {
  switch (tk->kind) {
    case TK_VOID:
    case TK_BOOL:
    case TK_INT:
    case TK_CHAR:
    case TK_LONG:
    case TK_SHORT:
      return true;
    default:
      return false;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
addl $-0xa, %eax
subl $0x5, %eax
ja 0x70de
jmp 0x70d8
movb $0x1, -0x1(%rbp)
jmp 0x70e2
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: find_typedef
static Type *find_typedef(Token *tk) {
  for (VarScope *sc = var_scope; sc; sc = sc->next) {
    if (sc->var) {
      // var はtypedefじゃないので無視
      continue;
    }

    assert(sc);
    if (strlen(sc->name) == tk->len &&
        strncmp(sc->name, tk->str, tk->len) == 0) {
      return sc->type_def;
    }
  }
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq 0xe48d(%rip), %rax      # 0x15590
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x71a3
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x711f
jmp 0x7193
cmpq $0x0, -0x18(%rbp)
je 0x7128
jmp 0x7147
leaq 0x998f(%rip), %rdi      # 0x10abe
leaq 0x94bd(%rip), %rsi      # 0x105f3
movl $0x1d4, %edx            # imm = 0x1D4
leaq 0x997f(%rip), %rcx      # 0x10ac1
callq 0x20b0
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2090
movq -0x10(%rbp), %rcx
movslq 0x20(%rcx), %rcx
cmpq %rcx, %rax
jne 0x7191
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x10(%rbp), %rax
movslq 0x20(%rax), %rdx
callq 0x2060
cmpl $0x0, %eax
jne 0x7191
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x71ab
jmp 0x7193
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x7107
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: find_tag
static TagScope *find_tag(Token *tk) {
  for (TagScope *sc = tag_scope; sc; sc = sc->next) {
    if (strlen(sc->name) == tk->len && strncmp(sc->name, tk->str, tk->len) == 0) {
      // fprintf(stderr, "tag: %s, sc_name: %s\n", my_strndup(tk->str, tk->len), sc->name);
      return sc;
    }
  }
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq 0xe095(%rip), %rax      # 0x15588
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x7553
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2090
movq -0x10(%rbp), %rcx
movslq 0x20(%rcx), %rcx
cmpq %rcx, %rax
jne 0x7544
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x10(%rbp), %rax
movslq 0x20(%rax), %rdx
callq 0x2060
cmpl $0x0, %eax
jne 0x7544
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x755b
jmp 0x7546
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x74f7
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: push_tag_scope
static void push_tag_scope(Token *tag_tok, Type *type) {
  TagScope *sc = calloc(1, sizeof(TagScope));

  sc->name = my_strndup(tag_tok->str, tag_tok->len);
  sc->ty = type;
  sc->next = tag_scope;
  sc->depth = scope_depth;

  tag_scope = sc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, %edi
movl $0x20, %esi
callq 0x20e0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x20(%rax), %esi
callq 0x6690
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0xdfc3(%rip), %rcx      # 0x15588
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl 0xdfae(%rip), %ecx      # 0x15580
movq -0x18(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x18(%rbp), %rax
movq %rax, 0xdfa4(%rip)      # 0x15588
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: consume_ident
static Token *consume_ident() {
  if (token->kind == TK_IDENT) {
    Token *ret = token;
    token = token->next;

    return ret;
  }
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xdf95(%rip), %rax      # 0x155d0
movq (%rax), %rax
cmpl $0x2, (%rax)
jne 0x7673
leaq 0xdf86(%rip), %rax      # 0x155d0
movq (%rax), %rax
movq %rax, -0x10(%rbp)
leaq 0xdf78(%rip), %rax      # 0x155d0
movq (%rax), %rax
movq 0x8(%rax), %rcx
leaq 0xdf6a(%rip), %rax      # 0x155d0
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x767b
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: struct_member
static Member *struct_member() {
  Type *type = basetype(NULL);
  char *ident;
  Token *tk = token;
  type = declarator(type, &ident);
  if (type->is_incomplete) {
    error_at(tk->str, "incomplete element type(struct_member)");
  }
  expect(";");

  Member *m = calloc(1, sizeof(Member));
  m->name = ident;
  m->ty = type;

  return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
xorl %eax, %eax
movl %eax, %edi
callq 0x6b40
movq %rax, -0x8(%rbp)
leaq 0xdf24(%rip), %rax      # 0x155d0
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x6ef0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
testb $0x1, 0xc(%rax)
je 0x76e4
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x9047(%rip), %rsi      # 0x10724
movb $0x0, %al
callq 0x6370
leaq 0x8f24(%rip), %rdi      # 0x1060f
callq 0x7730
movl $0x1, %edi
movl $0x20, %esi
callq 0x20e0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: expect
static void expect(char *op) {
  if (token->kind != TK_RESERVED ||
      token->len != strlen(op) ||
      memcmp(token->str, op, token->len)) {
    error_at(token->str, "'%c'(token->kind: %s, token->len: %d, op: %s)ではありません", op, token_kind_to_s(token->kind), token->len, op);
  }
  token = token->next;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
leaq 0xde8d(%rip), %rax      # 0x155d0
movq (%rax), %rax
cmpl $0x1, (%rax)
jne 0x779c
leaq 0xde7e(%rip), %rax      # 0x155d0
movq (%rax), %rax
movslq 0x20(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2090
movq %rax, %rcx
movq -0x10(%rbp), %rax
cmpq %rcx, %rax
jne 0x779c
leaq 0xde57(%rip), %rax      # 0x155d0
movq (%rax), %rax
movq 0x18(%rax), %rdi
movq -0x8(%rbp), %rsi
leaq 0xde45(%rip), %rax      # 0x155d0
movq (%rax), %rax
movslq 0x20(%rax), %rdx
callq 0x20d0
cmpl $0x0, %eax
je 0x77f2
leaq 0xde2d(%rip), %rax      # 0x155d0
movq (%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
leaq 0xde13(%rip), %rax      # 0x155d0
movq (%rax), %rax
movl (%rax), %edi
callq 0xc640
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq %rax, %rcx
leaq 0xddf7(%rip), %rax      # 0x155d0
movq (%rax), %rax
movl 0x20(%rax), %r8d
movq -0x8(%rbp), %r9
leaq 0x8f60(%rip), %rsi      # 0x1074b
movb $0x0, %al
callq 0x6370
leaq 0xddd7(%rip), %rax      # 0x155d0
movq (%rax), %rax
movq 0x8(%rax), %rcx
leaq 0xddc9(%rip), %rax      # 0x155d0
movq %rcx, (%rax)
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: enum_decl
static Type *enum_decl() {
  expect_token(TK_ENUM);

  Token *bak = token;

  Token *tag_tk = consume_ident();

  if (tag_tk) {
    if (!peek_token("{")) {
      // 構造体と同じくenum tagの次に"{"がない定義済みenum型の変数宣言になるので、tag名で探す
      TagScope *sc = find_tag(tag_tk);
      if (!sc) {
        error_at(bak->str, "enum: %s が見つかりません", my_strndup(tag_tk->str, tag_tk->len));
      }
      if (sc->ty->kind != TY_ENUM) {
        error_at(bak->str, "%s はenumではありません", my_strndup(tag_tk->str, tag_tk->len));
      }
      return sc->ty;
    }
  }
  // ここに来た場合は新規のenumの定義
  expect("{");
  Type *ty = enum_type();
  int enum_value = 0;
  for (;;) {
    char *ident = expect_ident();
    if (consume("=")) {
      enum_value = const_expr();
    }
    push_enum_scope(ident, ty, enum_value++);

    if (consume_end()) {
      break;
    }
    expect(",");
  }

  if (tag_tk) {
    // enumのタグがあったらそのtag名で登録
    push_tag_scope(tag_tk, ty);
  }

  return ty;;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl $0x11, %edi
callq 0x7470
leaq 0xdda7(%rip), %rax      # 0x155d0
movq (%rax), %rax
movq %rax, -0x10(%rbp)
callq 0x7630
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x78f6
leaq 0x8a45(%rip), %rdi      # 0x10290
callq 0x69d0
testb $0x1, %al
jne 0x78f4
movq -0x18(%rbp), %rdi
callq 0x74e0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x78a1
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movl 0x20(%rax), %esi
callq 0x6690
movq -0x40(%rbp), %rdi
movq %rax, %rdx
leaq 0x8ef4(%rip), %rsi      # 0x1078e
movb $0x0, %al
callq 0x6370
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0xa, (%rax)
je 0x78e3
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movl 0x20(%rax), %esi
callq 0x6690
movq -0x48(%rbp), %rdi
movq %rax, %rdx
leaq 0x8ed4(%rip), %rsi      # 0x107b0
movb $0x0, %al
callq 0x6370
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x7984
jmp 0x78f6
leaq 0x8993(%rip), %rdi      # 0x10290
callq 0x7730
callq 0xdac0
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
callq 0x79d0
movq %rax, -0x38(%rbp)
leaq 0x8f34(%rip), %rdi      # 0x10856
callq 0x6780
cmpq $0x0, %rax
je 0x7935
callq 0x7a50
movl %eax, -0x2c(%rbp)
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x2c(%rbp), %edx
movl %edx, %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
callq 0x7990
callq 0x6700
testb $0x1, %al
jne 0x7958
jmp 0x795a
jmp 0x7968
leaq 0x8c90(%rip), %rdi      # 0x105f1
callq 0x7730
jmp 0x7912
cmpq $0x0, -0x18(%rbp)
je 0x797c
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x7570
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: expect_ident
static char *expect_ident() {
  if (token->kind != TK_IDENT) {
    error_at(token->str, "識別子ではありません。");
  }
  char *s = my_strndup(token->str, token->len);
  token = token->next;
  return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xdbf1(%rip), %rax      # 0x155d0
movq (%rax), %rax
cmpl $0x2, (%rax)
je 0x7a03
leaq 0xdbe2(%rip), %rax      # 0x155d0
movq (%rax), %rax
movq 0x18(%rax), %rdi
leaq 0x8dd4(%rip), %rsi      # 0x107d0
movb $0x0, %al
callq 0x6370
leaq 0xdbc6(%rip), %rax      # 0x155d0
movq (%rax), %rax
movq 0x18(%rax), %rdi
leaq 0xdbb8(%rip), %rax      # 0x155d0
movq (%rax), %rax
movl 0x20(%rax), %esi
callq 0x6690
movq %rax, -0x8(%rbp)
leaq 0xdba2(%rip), %rax      # 0x155d0
movq (%rax), %rax
movq 0x8(%rax), %rcx
leaq 0xdb94(%rip), %rax      # 0x155d0
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: ternary
static Node *ternary() {
  Token *tk;
  Node *node = logical_or();
  if (tk = consume("?")) {
    Node *true_expr = expr();
    expect(":");
    Node *false_expr = ternary();

    // ifと同じ構造で式になるのでthen, elsにstmtじゃなくてexprいれたら動いたので取り敢えずこれで
    Node *cond = node;
    node = new_node(ND_TERNARY, tk);
    node->cond = cond;
    node->then = true_expr;
    node->els = false_expr;

  }

  return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
callq 0x80e0
movq %rax, -0x10(%rbp)
leaq 0x87e0(%rip), %rdi      # 0x10848
callq 0x6780
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x80d3
callq 0xae60
movq %rax, -0x18(%rbp)
leaq 0x7412(%rip), %rdi      # 0xf499
callq 0x7730
callq 0x8050
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rsi
movl $0x30, %edi
callq 0x6980
movq %rax, -0x10(%rbp)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: logical_or
static Node *logical_or() {
  Token *tk;
  Node *node = logical_and();

  while (tk = consume("||")) {
    node = new_bin_node(ND_OR, node, logical_and(), tk);
  }

  return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
callq 0x81a0
movq %rax, -0x10(%rbp)
leaq 0x8752(%rip), %rdi      # 0x1084a
callq 0x6780
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x812f
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
callq 0x81a0
movq -0x18(%rbp), %rsi
movq %rax, %rdx
movq -0x8(%rbp), %rcx
movl $0xb, %edi
callq 0x8140
movq %rax, -0x10(%rbp)
jmp 0x80f1
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: new_bin_node
static Node *new_bin_node(NodeKind kind, Node *lhs, Node *rhs, Token *tk) {
  Node *node = new_node(kind, tk);
  node->lhs = lhs;
  node->rhs = rhs;

  add_type(node);

  return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl -0x4(%rbp), %edi
movq -0x20(%rbp), %rsi
callq 0x6980
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x28(%rbp), %rdi
callq 0xdb80
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: logical_and
static Node *logical_and() {
  Token *tk;
  Node *node = bit_or();

  while (tk = consume("&&")) {
    node = new_bin_node(ND_AND, node, bit_or(), tk);
  }

  return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
callq 0x8200
movq %rax, -0x10(%rbp)
leaq 0x8695(%rip), %rdi      # 0x1084d
callq 0x6780
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x81ef
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
callq 0x8200
movq -0x18(%rbp), %rsi
movq %rax, %rdx
movq -0x8(%rbp), %rcx
movl $0xc, %edi
callq 0x8140
movq %rax, -0x10(%rbp)
jmp 0x81b1
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: bit_or
static Node *bit_or() {
  Token *tk;
  Node *node = bit_xor();

  while (tk = consume("|")) {
    node = new_bin_node(ND_BIT_OR, node, bit_xor(), tk);
  }

  return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
callq 0x8260
movq %rax, -0x10(%rbp)
leaq 0x8633(%rip), %rdi      # 0x1084b
callq 0x6780
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x824f
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
callq 0x8260
movq -0x18(%rbp), %rsi
movq %rax, %rdx
movq -0x8(%rbp), %rcx
movl $0xd, %edi
callq 0x8140
movq %rax, -0x10(%rbp)
jmp 0x8211
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: bit_xor
static Node *bit_xor() {
  Token *tk;
  Node *node = bit_and();

  while (tk = consume("^")) {
    node = new_bin_node(ND_BIT_XOR, node, bit_and(), tk);
  }

  return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
callq 0x82c0
movq %rax, -0x10(%rbp)
leaq 0x85d8(%rip), %rdi      # 0x10850
callq 0x6780
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x82af
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
callq 0x82c0
movq -0x18(%rbp), %rsi
movq %rax, %rdx
movq -0x8(%rbp), %rcx
movl $0x11, %edi
callq 0x8140
movq %rax, -0x10(%rbp)
jmp 0x8271
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: bit_and
static Node *bit_and() {
  Token *tk;
  Node *node = equality();

  while (tk = consume("&")) {
    node = new_bin_node(ND_BIT_AND, node, equality(), tk);
  }

  return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
callq 0x8320
movq %rax, -0x10(%rbp)
leaq 0x8576(%rip), %rdi      # 0x1084e
callq 0x6780
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x830f
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
callq 0x8320
movq -0x18(%rbp), %rsi
movq %rax, %rdx
movq -0x8(%rbp), %rcx
movl $0xe, %edi
callq 0x8140
movq %rax, -0x10(%rbp)
jmp 0x82d1
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: equality
static Node *equality() {
  Token *tk;
  Node *node = relational();

  for (;;) {
    if (tk = consume("==")) {
      node = new_bin_node(ND_EQL, node, relational(), tk);
    } else if (tk = consume("!=")) {
      node = new_bin_node(ND_NOT_EQL, node, relational(), tk);
    } else {
      return node;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
callq 0x83c0
movq %rax, -0x10(%rbp)
leaq 0x851a(%rip), %rdi      # 0x10852
callq 0x6780
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x836f
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
callq 0x83c0
movq -0x18(%rbp), %rsi
movq %rax, %rdx
movq -0x8(%rbp), %rcx
movl $0x12, %edi
callq 0x8140
movq %rax, -0x10(%rbp)
jmp 0x83b9
leaq 0x84df(%rip), %rdi      # 0x10855
callq 0x6780
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x83ad
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
callq 0x83c0
movq -0x20(%rbp), %rsi
movq %rax, %rdx
movq -0x8(%rbp), %rcx
movl $0x13, %edi
callq 0x8140
movq %rax, -0x10(%rbp)
jmp 0x83b7
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
jmp 0x83b9
jmp 0x8331
nop
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: relational
static Node *relational() {
  Token *tk;
  Node *node = shift();

  for (;;) {
    if (tk = consume("<=")) {
      node = new_bin_node(ND_LTE, node, shift(), tk);
    } else if (tk = consume(">=")) {
      node = new_bin_node(ND_LTE, shift(), node, tk);
    } else if (tk = consume("<")) {
      node = new_bin_node(ND_LT, node, shift(), tk);
    } else if (tk = consume(">")) {
      node = new_bin_node(ND_LT, shift(), node, tk);
    } else {
      return node;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
callq 0x84e0
movq %rax, -0x10(%rbp)
leaq 0x8544(%rip), %rdi      # 0x1091c
callq 0x6780
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x8412
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
callq 0x84e0
movq -0x18(%rbp), %rsi
movq %rax, %rdx
movq -0x8(%rbp), %rcx
movl $0xa, %edi
callq 0x8140
movq %rax, -0x10(%rbp)
jmp 0x84cf
leaq 0x8507(%rip), %rdi      # 0x10920
callq 0x6780
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x844b
callq 0x84e0
movq %rax, %rsi
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rcx
movl $0xa, %edi
callq 0x8140
movq %rax, -0x10(%rbp)
jmp 0x84cd
leaq 0x8407(%rip), %rdi      # 0x10859
callq 0x6780
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x8489
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
callq 0x84e0
movq -0x20(%rbp), %rsi
movq %rax, %rdx
movq -0x8(%rbp), %rcx
movl $0x9, %edi
callq 0x8140
movq %rax, -0x10(%rbp)
jmp 0x84cb
leaq 0x8444(%rip), %rdi      # 0x108d4
callq 0x6780
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x84bf
callq 0x84e0
movq %rax, %rsi
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rcx
movl $0x9, %edi
callq 0x8140
movq %rax, -0x10(%rbp)
jmp 0x84c9
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
jmp 0x84cb
jmp 0x84cd
jmp 0x84cf
jmp 0x83d1
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: shift
static Node *shift() {
  Token *tk;
  Node *node = add();
  for (;;) {
    if (tk = consume("<<")) {
      node = new_bin_node(ND_A_LSHIFT, node, add(), tk);
    } else if (tk = consume(">>")) {
      node = new_bin_node(ND_A_RSHIFT, node, add(), tk);
    } else {
      return node;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
callq 0x8580
movq %rax, -0x10(%rbp)
leaq 0x8360(%rip), %rdi      # 0x10858
callq 0x6780
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x852f
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
callq 0x8580
movq -0x18(%rbp), %rsi
movq %rax, %rdx
movq -0x8(%rbp), %rcx
movl $0xf, %edi
callq 0x8140
movq %rax, -0x10(%rbp)
jmp 0x8579
leaq 0x8325(%rip), %rdi      # 0x1085b
callq 0x6780
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x856d
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
callq 0x8580
movq -0x20(%rbp), %rsi
movq %rax, %rdx
movq -0x8(%rbp), %rcx
movl $0x10, %edi
callq 0x8140
movq %rax, -0x10(%rbp)
jmp 0x8577
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
jmp 0x8579
jmp 0x84f1
nop
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: add
static Node *add() {
  Token *tk;
  Node *node = mul();

  for (;;) {
    if (tk = consume("+")) {
      node = new_add_node(node, mul(), tk);
    } else if (tk = consume("-")) {
      node = new_sub_node(node, mul(), tk);
    } else {
      return node;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
callq 0x8870
movq %rax, -0x10(%rbp)
leaq 0x82f0(%rip), %rdi      # 0x10888
callq 0x6780
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x85ca
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
callq 0x8870
movq -0x18(%rbp), %rdi
movq %rax, %rsi
movq -0x8(%rbp), %rdx
callq 0x8620
movq %rax, -0x10(%rbp)
jmp 0x860f
leaq 0x82ba(%rip), %rdi      # 0x1088b
callq 0x6780
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x8603
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
callq 0x8870
movq -0x20(%rbp), %rdi
movq %rax, %rsi
movq -0x8(%rbp), %rdx
callq 0x8750
movq %rax, -0x10(%rbp)
jmp 0x860d
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
jmp 0x860f
jmp 0x8591
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: new_add_node
static Node *new_add_node(Node *lhs, Node *rhs, Token *tk) {
  add_type(lhs);
  add_type(rhs);

  // int x
  // &x + 2
  // => & に intのサイズ(4) * 2 => xのアドレスの 8byte先
  //
  // int x
  // int *y = &x
  // int **z = &y
  // &z + 2
  // => & に intのポインタのサイズ(8) * 2 => zのアドレスの 16byte先
  if (is_integer(lhs->ty) && is_integer(rhs->ty)) {
    // num + num
    return new_bin_node(ND_ADD, lhs, rhs, tk);
  } else if (is_pointer(lhs->ty) && is_integer(rhs->ty)) {
    // ptr + num のケース
    return new_bin_node(ND_PTR_ADD, lhs, rhs, tk);
  } else if (is_integer(lhs->ty) && is_pointer(rhs->ty)){
    // num + ptrのケースなので、入れ替えてptr + num に正規化する
    return new_bin_node(ND_PTR_ADD, rhs, lhs, tk);
  }
  // ここに来た場合 ptr + ptr という不正なパターンになるので落とす
  error_at(token->str, "不正なaddパターンです。");
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0xdb80
movq -0x18(%rbp), %rdi
callq 0xdb80
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xdb40
testb $0x1, %al
jne 0x8659
jmp 0x868b
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xdb40
testb $0x1, %al
jne 0x866c
jmp 0x868b
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x1, %edi
callq 0x8140
movq %rax, -0x8(%rbp)
jmp 0x8737
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xdb10
testb $0x1, %al
jne 0x869e
jmp 0x86cd
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xdb40
testb $0x1, %al
jne 0x86b1
jmp 0x86cd
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x2, %edi
callq 0x8140
movq %rax, -0x8(%rbp)
jmp 0x8737
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xdb40
testb $0x1, %al
jne 0x86e0
jmp 0x870f
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xdb10
testb $0x1, %al
jne 0x86f3
jmp 0x870f
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x2, %edi
callq 0x8140
movq %rax, -0x8(%rbp)
jmp 0x8737
jmp 0x8711
jmp 0x8713
leaq 0xceb6(%rip), %rax      # 0x155d0
movq (%rax), %rax
movq 0x18(%rax), %rdi
leaq 0x8353(%rip), %rsi      # 0x10a7b
movb $0x0, %al
callq 0x6370
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: new_sub_node
static Node *new_sub_node(Node *lhs, Node *rhs, Token *tk) {
  add_type(lhs);
  add_type(rhs);

  if (is_integer(lhs->ty) && is_integer(rhs->ty)) {
    // num - num
    return new_bin_node(ND_SUB, lhs, rhs, tk);
  } else if (is_pointer(lhs->ty) && is_pointer(rhs->ty)) {
    //  ptr - ptr
    return new_bin_node(ND_PTR_DIFF, lhs, rhs, tk);
  } else if (is_pointer(lhs->ty) && is_integer(rhs->ty)) {
    // ptr - num
    return new_bin_node(ND_PTR_SUB, lhs, rhs, tk);
  }
  // ここに来た場合 num - ptr になってしまうので、エラーにする
  error("不正な演算です: num - ptr");
  return NULL; // error で落ちるので実際にはreturnされない
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0xdb80
movq -0x18(%rbp), %rdi
callq 0xdb80
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xdb40
testb $0x1, %al
jne 0x8789
jmp 0x87bb
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xdb40
testb $0x1, %al
jne 0x879c
jmp 0x87bb
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x3, %edi
callq 0x8140
movq %rax, -0x8(%rbp)
jmp 0x8859
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xdb10
testb $0x1, %al
jne 0x87ce
jmp 0x87fd
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xdb10
testb $0x1, %al
jne 0x87e1
jmp 0x87fd
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x5, %edi
callq 0x8140
movq %rax, -0x8(%rbp)
jmp 0x8859
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xdb10
testb $0x1, %al
jne 0x8810
jmp 0x883f
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xdb40
testb $0x1, %al
jne 0x8823
jmp 0x883f
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x4, %edi
callq 0x8140
movq %rax, -0x8(%rbp)
jmp 0x8859
jmp 0x8841
jmp 0x8843
leaq 0x8253(%rip), %rdi      # 0x10a9d
movb $0x0, %al
callq 0x65d0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: mul
static Node *mul() {
  Token *tk;
  Node *node = cast();

  for (;;) {
    if (tk = consume("*")) {
      node = new_bin_node(ND_MUL, node, cast(), tk);
    } else if (tk = consume("/")) {
      node = new_bin_node(ND_DIV, node, cast(), tk);
    } else if (tk = consume("%")) {
      node = new_bin_node(ND_MOD, node, cast(), tk);
    } else {
      return node;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
callq 0x8960
movq %rax, -0x10(%rbp)
leaq 0x858c(%rip), %rdi      # 0x10e14
callq 0x6780
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x88c2
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
callq 0x8960
movq -0x18(%rbp), %rsi
movq %rax, %rdx
movq -0x8(%rbp), %rcx
movl $0x6, %edi
callq 0x8140
movq %rax, -0x10(%rbp)
jmp 0x894c
leaq 0x854e(%rip), %rdi      # 0x10e17
callq 0x6780
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x8900
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
callq 0x8960
movq -0x20(%rbp), %rsi
movq %rax, %rdx
movq -0x8(%rbp), %rcx
movl $0x7, %edi
callq 0x8140
movq %rax, -0x10(%rbp)
jmp 0x894a
leaq 0x7f57(%rip), %rdi      # 0x1085e
callq 0x6780
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x893e
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
callq 0x8960
movq -0x28(%rbp), %rsi
movq %rax, %rdx
movq -0x8(%rbp), %rcx
movl $0x8, %edi
callq 0x8140
movq %rax, -0x10(%rbp)
jmp 0x8948
movq -0x10(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
jmp 0x894a
jmp 0x894c
jmp 0x8881
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: cast
static Node *cast() {
  Token *tk = token;
  if (consume("(")) {
    if (is_type(token)) {
      Type *ty = type_name();
      expect(")");
      if (!consume("{")) {
        // "{" が来た場合は、キャストではなくcompound-literaruの"(" typename ")" になるので、
        // この節はスキップして、token=tmpでもとに戻した上で、postfix側で処理する
        Node *node = new_unary_node(ND_CAST, cast(), tk);
        add_type(node->lhs);
        node->ty = ty;
        return node;
      }
    }
  }
  token = tk;
  Node *node = unary();
  add_type(node);

  return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0xcc61(%rip), %rax      # 0x155d0
movq (%rax), %rax
movq %rax, -0x10(%rbp)
leaq 0x7b85(%rip), %rdi      # 0x10502
callq 0x6780
cmpq $0x0, %rax
je 0x8a05
leaq 0xcc41(%rip), %rax      # 0x155d0
movq (%rax), %rdi
callq 0x6fc0
testb $0x1, %al
jne 0x899d
jmp 0x8a03
callq 0x8a40
movq %rax, -0x18(%rbp)
leaq 0x7c60(%rip), %rdi      # 0x1060d
callq 0x7730
leaq 0x78d7(%rip), %rdi      # 0x10290
callq 0x6780
cmpq $0x0, %rax
jne 0x8a01
callq 0x8960
movq %rax, %rsi
movq -0x10(%rbp), %rdx
movl $0x24, %edi
callq 0x8a80
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xdb80
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x8a2d
jmp 0x8a03
jmp 0x8a05
movq -0x10(%rbp), %rcx
leaq 0xcbc0(%rip), %rax      # 0x155d0
movq %rcx, (%rax)
callq 0x8c50
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xdb80
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: abstract_declarator
static Type *abstract_declarator(Type *ty) {
  while (consume("*")) {
    ty = pointer_to(ty);
  }
  if (consume("(")) {
    Type *placeholder = calloc(1, sizeof(Type));
    Type *new_ty = abstract_declarator(placeholder);
    expect(")");
    // 入れ子部分を全部パースした後に、その後に続く配列の [] などを含めた(type_suffix)型としてplaceholderを完成させる
    memcpy(placeholder, type_suffix(ty), sizeof(Type));
    return new_ty;
  }

  return type_suffix(ty);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
leaq 0x8341(%rip), %rdi      # 0x10e14
callq 0x6780
cmpq $0x0, %rax
je 0x8aed
movq -0x10(%rbp), %rdi
callq 0xd990
movq %rax, -0x10(%rbp)
jmp 0x8acc
leaq 0x7a0e(%rip), %rdi      # 0x10502
callq 0x6780
cmpq $0x0, %rax
je 0x8b57
movl $0x1, %edi
movl $0x30, %esi
callq 0x20e0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8ac0
movq %rax, -0x20(%rbp)
leaq 0x7ae7(%rip), %rdi      # 0x1060d
callq 0x7730
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8b70
movq -0x28(%rbp), %rdi
movq %rax, %rsi
movl $0x30, %edx
callq 0x2130
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x8b64
movq -0x10(%rbp), %rdi
callq 0x8b70
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/pocari[P]compilerbook-9cc/parser.c
// Function: type_suffix
static Type *type_suffix(Type *base) {
  if (!consume("[")) {
    return base;
  }

  int array_size = 0;
  int is_incomplete = true;
  if (!consume("]")) {
    //[の直後に"]"が来ていない場合、配列のサイズがあるはずなので、完全な方としてis_incompleteをfalseに
    is_incomplete = false;
    array_size = const_expr();
    expect("]");
  }

  Token *tk = token;
  base = type_suffix(base);
  // 不完全型許されるのは最初の配列の最初の次元のみなので、再帰で呼ばれた結果(=2次元以降)に関しては必ず完全になっていること
  if (base->is_incomplete) {
    error_at(tk->str, "incomplete element type(type_suffix)");
  }
  base = array_of(base, array_size);
  base->is_incomplete = is_incomplete;

  return base;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
leaq 0x7cdd(%rip), %rdi      # 0x10860
callq 0x6780
cmpq $0x0, %rax
jne 0x8b9b
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x8c3a
movl $0x0, -0x14(%rbp)
movl $0x1, -0x18(%rbp)
leaq 0x6b86(%rip), %rdi      # 0xf736
callq 0x6780
cmpq $0x0, %rax
jne 0x8bd6
movl $0x0, -0x18(%rbp)
callq 0x7a50
movl %eax, -0x14(%rbp)
leaq 0x6b65(%rip), %rdi      # 0xf736
callq 0x7730
leaq 0xc9f3(%rip), %rax      # 0x155d0
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8b70
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
testb $0x1, 0xc(%rax)
je 0x8c11
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x7c58(%rip), %rsi      # 0x10862
movb $0x0, %al
callq 0x6370
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xda20
movq %rax, -0x10(%rbp)
cmpl $0x0, -0x18(%rbp)
setne %cl
movq -0x10(%rbp), %rax
andb $0x1, %cl
movb %cl, 0xc(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)