// File: /workspace/github_cpp_makefile_star2_O2/yhirose[P]fizzbuzzlang/./peglib.h
// Function: peg::Holder::parse_core(char const*, unsigned long, peg::SemanticValues&, peg::Context&, std::any&) const
inline size_t Holder::parse_core(const char *s, size_t n, SemanticValues &vs,
                                 Context &c, std::any &dt) const {
  if (!ope_) {
    throw std::logic_error("Uninitialized definition ope was used...");
  }

  // Macro reference
  if (outer_->is_macro) {
    c.rule_stack.push_back(outer_);
    auto len = ope_->parse(s, n, vs, c, dt);
    c.rule_stack.pop_back();
    return len;
  }

  size_t len;
  std::any val;

  c.packrat(s, outer_->id, len, val, [&](std::any &a_val) {
    if (outer_->enter) { outer_->enter(c, s, n, dt); }
    auto &chvs = c.push_semantic_values_scope();
    auto se = scope_exit([&]() {
      c.pop_semantic_values_scope();
      if (outer_->leave) { outer_->leave(c, s, n, len, a_val, dt); }
    });

    c.rule_stack.push_back(outer_);
    len = ope_->parse(s, n, chvs, c, dt);
    c.rule_stack.pop_back();

    // Invoke action
    if (success(len)) {
      chvs.sv_ = std::string_view(s, len);
      chvs.name_ = outer_->name;

      auto ope_ptr = ope_.get();
      {
        auto tok_ptr = dynamic_cast<const peg::TokenBoundary *>(ope_ptr);
        if (tok_ptr) { ope_ptr = tok_ptr->ope_.get(); }
      }
      if (!dynamic_cast<const peg::PrioritizedChoice *>(ope_ptr) &&
          !dynamic_cast<const peg::Dictionary *>(ope_ptr)) {
        chvs.choice_count_ = 0;
        chvs.choice_ = 0;
      }

      std::string msg;
      if (outer_->predicate && !outer_->predicate(chvs, dt, msg)) {
        if (c.log && !msg.empty() && c.error_info.message_pos < s) {
          c.error_info.message_pos = s;
          c.error_info.message = msg;
          c.error_info.label = outer_->name;
        }
        len = static_cast<size_t>(-1);
      }

      if (success(len)) {
        if (!c.recovered) { a_val = reduce(chvs, dt); }
      } else {
        if (c.log && !msg.empty() && c.error_info.message_pos < s) {
          c.error_info.message_pos = s;
          c.error_info.message = msg;
          c.error_info.label = outer_->name;
        }
      }
    } else {
      if (c.log && !outer_->error_message.empty() &&
          c.error_info.message_pos < s) {
        c.error_info.message_pos = s;
        c.error_info.message = outer_->error_message;
        c.error_info.label = outer_->name;
      }
    }
  });

  if (success(len)) {
    if (!outer_->ignoreSemanticValue) {
      vs.emplace_back(std::move(val));
      vs.tags.emplace_back(str2tag(outer_->name));
    }
  }

  return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rcx, -0x30(%rbp)
movq %rsi, -0x60(%rbp)
movq %rdx, -0x58(%rbp)
cmpq $0x0, 0x8(%rdi)
je 0xb509
movq %r8, %r15
movq %rsi, %r12
movq %rdi, %r14
leaq 0x18(%rdi), %r13
movq 0x18(%rdi), %rax
cmpb $0x1, 0xe9(%rax)
jne 0xb434
movq %rdx, %rbx
leaq 0xb8(%r15), %rdi
movq %r13, %rsi
movq %r9, %r13
callq 0xb55c
movq 0x8(%r14), %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq -0x30(%rbp), %rcx
movq %r15, %r8
movq %r13, %r9
callq 0xabc8
addq $-0x8, 0xc0(%r15)
jmp 0xb4f7
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %r8
movaps %xmm0, (%r8)
movq 0x58(%rax), %rdx
movq %r14, -0x98(%rbp)
movq %r15, -0x90(%rbp)
leaq -0x60(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x58(%rbp), %rax
movq %rax, -0x80(%rbp)
movq %r9, -0x78(%rbp)
leaq -0x38(%rbp), %rcx
movq %rcx, -0x70(%rbp)
movups -0x98(%rbp), %xmm0
movups -0x88(%rbp), %xmm1
movups -0x78(%rbp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xb580
movq -0x38(%rbp), %rbx
cmpq $-0x1, %rbx
je 0xb4e8
movq (%r13), %rax
cmpb $0x0, 0xc0(%rax)
jne 0xb4eb
leaq -0x50(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0xb6fc
movq (%r13), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdi
callq 0xb780
movq -0x30(%rbp), %rdi
addq $0x28, %rdi
leaq -0x64(%rbp), %rsi
movl %eax, (%rsi)
callq 0xb742
movq -0x38(%rbp), %rbx
jmp 0xb4eb
pushq $-0x1
popq %rbx
leaq -0x50(%rbp), %rdi
callq 0x1113a
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x9160
movq %rax, %r14
leaq 0x2dce1(%rip), %rsi     # 0x391fc
movq %rax, %rdi
callq 0x9380
movq 0x51a86(%rip), %rsi     # 0x5cfb0
movq 0x51a37(%rip), %rdx     # 0x5cf68
movq %r14, %rdi
callq 0x9420
jmp 0xb548
movq %rax, %rbx
movq %r14, %rdi
callq 0x9230
jmp 0xb554
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1113a
movq %rbx, %rdi
callq 0x9430