// File: yhirose[P]fizzbuzzlang/./peglib.h
// Function: peg::ReferenceChecker::visit(peg::Reference&)
inline void ReferenceChecker::visit(Reference &ope) {
  auto it = std::find(params_.begin(), params_.end(), ope.name_);
  if (it != params_.end()) { return; }

  if (!grammar_.count(ope.name_)) {
    error_s[ope.name_] = ope.s_;
    error_message[ope.name_] = "'" + ope.name_ + "' is not defined.";
  } else {
    if (!referenced.count(ope.name_)) { referenced.insert(ope.name_); }
    const auto &rule = grammar_.at(ope.name_);
    if (rule.is_macro) {
      if (!ope.is_macro_ || ope.args_.size() != rule.params.size()) {
        error_s[ope.name_] = ope.s_;
        error_message[ope.name_] = "incorrect number of arguments.";
      }
    } else if (ope.is_macro_) {
      error_s[ope.name_] = ope.s_;
      error_message[ope.name_] = "'" + ope.name_ + "' is not macro.";
    }
    for (auto arg : ope.args_) {
      arg->accept(*this);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x108(%rbp)
movq 0xb8(%rax), %rdi
callq 0x12570
movq %rax, %rcx
movq -0x108(%rbp), %rax
movq %rcx, -0x20(%rbp)
movq 0xb8(%rax), %rdi
callq 0x125a0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdx
addq $0x20, %rdx
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x12520
movq %rax, %rcx
movq -0x108(%rbp), %rax
movq %rcx, -0x18(%rbp)
movq 0xb8(%rax), %rdi
callq 0x125a0
movq %rax, -0x30(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x125d0
testb $0x1, %al
jne 0x1211e
jmp 0x12123
jmp 0x12503
movq -0x108(%rbp), %rax
movq 0xb0(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
callq 0x12610
cmpq $0x0, %rax
jne 0x12226
movq -0x108(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq 0x40(%rsi), %rax
movq %rax, -0x118(%rbp)
addq $0x8, %rdi
addq $0x20, %rsi
callq 0x12640
movq -0x118(%rbp), %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rdx
addq $0x20, %rdx
leaq 0x8fbc5(%rip), %rsi     # 0xa1d49
leaq -0x70(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x10030
movq -0x110(%rbp), %rsi
leaq 0x8f680(%rip), %rdx     # 0xa1822
leaq -0x50(%rbp), %rdi
callq 0xffe0
jmp 0x121ad
movq -0x108(%rbp), %rdi
addq $0x40, %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
callq 0x12670
movq %rax, -0x120(%rbp)
jmp 0x121ce
movq -0x120(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xa4a0
leaq -0x50(%rbp), %rdi
callq 0xa250
leaq -0x70(%rbp), %rdi
callq 0xa250
jmp 0x12503
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x12218
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xa250
leaq -0x70(%rbp), %rdi
callq 0xa250
jmp 0x1250c
movq -0x108(%rbp), %rdi
addq $0x78, %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
callq 0x11770
cmpq $0x0, %rax
jne 0x12269
movq -0x108(%rbp), %rdi
addq $0x78, %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
callq 0x117a0
movq %rax, -0x90(%rbp)
movb %dl, -0x88(%rbp)
movq -0x108(%rbp), %rax
movq 0xb0(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
callq 0x126a0
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
testb $0x1, 0xe9(%rax)
je 0x1233c
movq -0x10(%rbp), %rax
testb $0x1, 0x48(%rax)
je 0x122df
movq -0x10(%rbp), %rdi
addq $0x50, %rdi
callq 0x126d0
movq %rax, -0x128(%rbp)
movq -0x98(%rbp), %rdi
addq $0xf0, %rdi
callq 0x126f0
movq %rax, %rcx
movq -0x128(%rbp), %rax
cmpq %rcx, %rax
je 0x12337
movq -0x108(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x130(%rbp)
addq $0x8, %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
callq 0x12640
movq -0x130(%rbp), %rcx
movq -0x108(%rbp), %rdi
movq %rcx, (%rax)
addq $0x40, %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
callq 0x12670
movq %rax, %rdi
leaq 0x8f502(%rip), %rsi     # 0xa1834
callq 0xa510
jmp 0x1243c
movq -0x10(%rbp), %rax
testb $0x1, 0x48(%rax)
je 0x1243a
movq -0x108(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq 0x40(%rsi), %rax
movq %rax, -0x140(%rbp)
addq $0x8, %rdi
addq $0x20, %rsi
callq 0x12640
movq -0x140(%rbp), %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rdx
addq $0x20, %rdx
leaq 0x8f9c3(%rip), %rsi     # 0xa1d49
leaq -0xd8(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x10030
movq -0x138(%rbp), %rsi
leaq 0x8f4ac(%rip), %rdx     # 0xa1853
leaq -0xb8(%rbp), %rdi
callq 0xffe0
jmp 0x123b5
movq -0x108(%rbp), %rdi
addq $0x40, %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
callq 0x12670
movq %rax, -0x148(%rbp)
jmp 0x123d6
movq -0x148(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0xa4a0
leaq -0xb8(%rbp), %rdi
callq 0xa250
leaq -0xd8(%rbp), %rdi
callq 0xa250
jmp 0x1243a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x12429
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0xa250
leaq -0xd8(%rbp), %rdi
callq 0xa250
jmp 0x1250c
jmp 0x1243c
movq -0x10(%rbp), %rax
addq $0x50, %rax
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rdi
callq 0xf870
movq %rax, -0xe8(%rbp)
movq -0xe0(%rbp), %rdi
callq 0xf8a0
movq %rax, -0xf0(%rbp)
leaq -0xe8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0xf8d0
testb $0x1, %al
jne 0x1248a
jmp 0x12501
leaq -0xe8(%rbp), %rdi
callq 0xf910
movq %rax, %rsi
leaq -0x100(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0xf930
movq -0x150(%rbp), %rdi
callq 0xded0
movq -0x108(%rbp), %rsi
movq %rax, %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
jmp 0x124cd
leaq -0x100(%rbp), %rdi
callq 0xda50
leaq -0xe8(%rbp), %rdi
callq 0xf9e0
jmp 0x12471
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x100(%rbp), %rdi
callq 0xda50
jmp 0x1250c
jmp 0x12503
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0xa650
nopw %cs:(%rax,%rax)
nop