// File: yhirose[P]fizzbuzzlang/./peglib.h
// Function: peg::Recovery::parse_core(char const*, unsigned long, peg::SemanticValues&, peg::Context&, std::any&) const
inline size_t Recovery::parse_core(const char *s, size_t n,
                                   SemanticValues & /*vs*/, Context &c,
                                   std::any & /*dt*/) const {
  const auto &rule = dynamic_cast<Reference &>(*ope_);

  // Custom error message
  if (c.log) {
    auto label = dynamic_cast<Reference *>(rule.args_[0].get());
    if (label && !label->rule_->error_message.empty()) {
      c.error_info.message_pos = s;
      c.error_info.message = label->rule_->error_message;
      c.error_info.label = label->rule_->name;
    }
  }

  // Recovery
  auto len = static_cast<size_t>(-1);
  {
    auto save_log = c.log;
    c.log = nullptr;
    auto se = scope_exit([&]() { c.log = save_log; });

    SemanticValues dummy_vs;
    std::any dummy_dt;

    len = rule.parse(s, n, dummy_vs, c, dummy_dt);
  }

  if (success(len)) {
    c.recovered = true;

    if (c.log) {
      c.error_info.output_log(c.log, c.s, c.l);
      c.error_info.clear();
    }
  }

  // Cut
  if (!c.cut_stack.empty()) {
    c.cut_stack.back() = true;

    if (c.cut_stack.size() == 1) {
      // TODO: Remove unneeded entries in packrat memoise table
    }
  }

  return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
callq 0x104b0
movq %rax, %rdi
leaq 0xe29de(%rip), %rsi     # 0xf2b58
leaq 0xe29f7(%rip), %rdx     # 0xf2b78
xorl %eax, %eax
movl %eax, %ecx
callq 0xa480
movq %rax, -0x168(%rbp)
cmpq $0x0, %rax
jne 0x1019c
callq 0xa6c0
movq -0x168(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
addq $0x248, %rdi            # imm = 0x248
callq 0x104e0
testb $0x1, %al
jne 0x101c0
jmp 0x10289
movq -0x38(%rbp), %rdi
addq $0x50, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xfbd0
movq %rax, %rdi
callq 0x10500
movq %rax, -0x170(%rbp)
cmpq $0x0, %rax
je 0x1020d
movq -0x170(%rbp), %rdi
leaq 0xe2964(%rip), %rsi     # 0xf2b58
leaq 0xe297d(%rip), %rdx     # 0xf2b78
xorl %eax, %eax
movl %eax, %ecx
callq 0xa480
movq %rax, -0x178(%rbp)
jmp 0x10218
xorl %eax, %eax
movq %rax, -0x178(%rbp)
jmp 0x10218
movq -0x178(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x10287
movq -0x40(%rbp), %rax
movq 0x68(%rax), %rdi
addq $0x198, %rdi            # imm = 0x198
callq 0xa610
testb $0x1, %al
jne 0x10287
movq -0x10(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x40(%rbp), %rax
movq 0x68(%rax), %rsi
addq $0x198, %rsi            # imm = 0x198
movq -0x28(%rbp), %rdi
addq $0x18, %rdi
addq $0x28, %rdi
callq 0xa040
movq -0x40(%rbp), %rax
movq 0x68(%rax), %rsi
movq -0x28(%rbp), %rdi
addq $0x18, %rdi
addq $0x48, %rdi
callq 0xa040
jmp 0x10289
movq $-0x1, -0x48(%rbp)
movq -0x28(%rbp), %rsi
addq $0x248, %rsi            # imm = 0x248
leaq -0x68(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0x10520
movq -0x28(%rbp), %rdi
addq $0x248, %rdi            # imm = 0x248
xorl %eax, %eax
movl %eax, %esi
callq 0x105d0
movq -0x180(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, -0x90(%rbp)
movq %rax, -0x88(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x10630
jmp 0x102eb
leaq -0x140(%rbp), %rdi
movq %rdi, -0x198(%rbp)
callq 0xd2c0
leaq -0x150(%rbp), %rdi
movq %rdi, -0x190(%rbp)
callq 0xda70
movq -0x198(%rbp), %rcx
movq -0x190(%rbp), %r9
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x28(%rbp), %r8
callq 0xdaf0
movq %rax, -0x188(%rbp)
jmp 0x1033d
movq -0x188(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x150(%rbp), %rdi
callq 0xd9f0
leaq -0x140(%rbp), %rdi
callq 0xde10
leaq -0x80(%rbp), %rdi
callq 0x10660
leaq -0x68(%rbp), %rdi
callq 0xd9d0
movq -0x48(%rbp), %rdi
callq 0xe9a0
testb $0x1, %al
jne 0x10384
jmp 0x10433
movq -0x28(%rbp), %rax
movb $0x1, 0x90(%rax)
movq -0x28(%rbp), %rdi
addq $0x248, %rdi            # imm = 0x248
callq 0x104e0
testb $0x1, %al
jne 0x103a8
jmp 0x10431
movq -0x28(%rbp), %rdi
addq $0x18, %rdi
movq -0x28(%rbp), %rsi
addq $0x248, %rsi            # imm = 0x248
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rcx
callq 0x106a0
movq -0x28(%rbp), %rdi
addq $0x18, %rdi
callq 0x10e20
jmp 0x10431
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x10426
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x150(%rbp), %rdi
callq 0xd9f0
leaq -0x140(%rbp), %rdi
callq 0xde10
leaq -0x80(%rbp), %rdi
callq 0x10660
leaq -0x68(%rbp), %rdi
callq 0xd9d0
jmp 0x1049d
jmp 0x10433
movq -0x28(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
callq 0x10e60
testb $0x1, %al
jne 0x10490
movq -0x28(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
callq 0x10ee0
movq %rax, -0x160(%rbp)
movq %rdx, -0x158(%rbp)
leaq -0x160(%rbp), %rdi
movl $0x1, %esi
callq 0x10f50
movq -0x28(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
callq 0x10fa0
cmpq $0x1, %rax
jne 0x1048e
jmp 0x1048e
jmp 0x10490
movq -0x48(%rbp), %rax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
movq -0x98(%rbp), %rdi
callq 0xa650
nopl (%rax)