// File: /workspace/github_cpp_makefile_star2_O2/yhirose[P]fizzbuzzlang/./peglib.h
// Function: peg::PrecedenceClimbing::parse_expression(char const*, unsigned long, peg::SemanticValues&, peg::Context&, std::any&, unsigned long) const
inline size_t PrecedenceClimbing::parse_expression(const char *s, size_t n,
                                                   SemanticValues &vs,
                                                   Context &c, std::any &dt,
                                                   size_t min_prec) const {
  auto len = atom_->parse(s, n, vs, c, dt);
  if (fail(len)) { return len; }

  std::string tok;
  auto &rule = get_reference_for_binop(c);
  auto action = std::move(rule.action);

  rule.action = [&](SemanticValues &vs2, std::any &dt2) {
    tok = vs2.token();
    if (action) {
      return action(vs2, dt2);
    } else if (!vs2.empty()) {
      return vs2[0];
    }
    return std::any();
  };
  auto action_se = scope_exit([&]() { rule.action = std::move(action); });

  auto i = len;
  while (i < n) {
    std::vector<std::any> save_values(vs.begin(), vs.end());
    auto save_tokens = vs.tokens;

    auto chvs = c.push_semantic_values_scope();
    auto chlen = binop_->parse(s + i, n - i, chvs, c, dt);
    c.pop_semantic_values_scope();

    if (fail(chlen)) { break; }

    auto it = info_.find(tok);
    if (it == info_.end()) { break; }

    auto level = std::get<0>(it->second);
    auto assoc = std::get<1>(it->second);

    if (level < min_prec) { break; }

    vs.emplace_back(std::move(chvs[0]));
    i += chlen;

    auto next_min_prec = level;
    if (assoc == 'L') { next_min_prec = level + 1; }

    chvs = c.push_semantic_values_scope();
    chlen = parse_expression(s + i, n - i, chvs, c, dt, next_min_prec);
    c.pop_semantic_values_scope();

    if (fail(chlen)) {
      vs.assign(save_values.begin(), save_values.end());
      vs.tokens = save_tokens;
      i = chlen;
      break;
    }

    vs.emplace_back(std::move(chvs[0]));
    i += chlen;

    std::any val;
    if (rule_.action) {
      vs.sv_ = std::string_view(s, i);
      val = rule_.action(vs, dt);
    } else if (!vs.empty()) {
      val = vs[0];
    }
    vs.clear();
    vs.emplace_back(std::move(val));
  }

  return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %r9, %r14
movq %r8, %r15
movq %rdi, %r12
movq 0x8(%rdi), %rdi
movq %rsi, -0x68(%rbp)
movq %rdx, -0x78(%rbp)
movq %rcx, -0x30(%rbp)
callq 0xabc8
cmpq $-0x1, %rax
je 0x324df
movq %rax, %rbx
leaq -0xf0(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq %r12, -0x48(%rbp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x3257a
movq %rax, %r12
leaq 0x60(%rax), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, -0xa0(%rbp)
andq $0x0, -0x90(%rbp)
movq 0x78(%rax), %rax
movq %rax, -0x88(%rbp)
movq 0x70(%r12), %rax
testq %rax, %rax
je 0x321e8
movq %r12, %rcx
addq $0x70, %rcx
movups (%rdi), %xmm1
movaps %xmm1, -0xa0(%rbp)
movq %rax, -0x90(%rbp)
movups %xmm0, (%rcx)
leaq -0x100(%rbp), %rsi
leaq -0xa0(%rbp), %r13
movq %r13, %rdx
callq 0x32638
movq %r12, -0xe0(%rbp)
movq %r13, -0xd8(%rbp)
movb $0x1, -0xd0(%rbp)
movq -0x30(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x70(%rbp)
movq -0x48(%rbp), %rax
leaq 0x28(%rax), %rcx
movq %rcx, -0xb0(%rbp)
addq $0x30, %rax
movq %rax, -0xa8(%rbp)
leaq -0x1c8(%rbp), %r13
movq %r14, -0x40(%rbp)
movq %r15, -0x38(%rbp)
movq -0x78(%rbp), %r12
subq %rbx, %r12
jbe 0x324b9
movq -0x30(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
leaq -0xc8(%rbp), %rdi
movq %r13, %rcx
callq 0x3267a
leaq -0x118(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x2ca80
movq %r15, %rdi
callq 0x31480
movq %r13, %rdi
movq %rax, %rsi
callq 0x326ac
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x68(%rbp), %rax
leaq (%rax,%rbx), %rsi
movq %r12, %rdx
movq %r13, %rcx
movq %r15, %r8
movq %r14, %r9
callq 0xabc8
movq %rax, %r12
decq 0xb0(%r15)
cmpq $-0x1, %rax
je 0x32304
movq -0x100(%rbp), %rax
movq -0xf8(%rbp), %rcx
movq %rcx, -0x60(%rbp)
movq %rax, -0x58(%rbp)
movq -0xb0(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x32db6
cmpq -0xa8(%rbp), %rax
je 0x32304
movq 0x30(%rax), %r13
cmpq 0x10(%rbp), %r13
jae 0x3230c
xorl %r12d, %r12d
jmp 0x3243c
xorl %r12d, %r12d
jmp 0x32490
movb 0x38(%rax), %r14b
movq -0x1c8(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0xb6fc
xorl %r15d, %r15d
cmpb $0x4c, %r14b
sete %r14b
movq -0x38(%rbp), %rdi
callq 0x31480
leaq -0x1c8(%rbp), %rdi
movq %rax, %rsi
callq 0x32750
addq %rbx, %r12
movb %r14b, %r15b
addq %r15, %r13
movq -0x68(%rbp), %rax
leaq (%rax,%r12), %rsi
movq -0x78(%rbp), %rdx
subq %r12, %rdx
movq %r13, (%rsp)
movq -0x48(%rbp), %rdi
leaq -0x1c8(%rbp), %rcx
movq -0x38(%rbp), %r8
movq -0x40(%rbp), %r9
callq 0x3213e
movq %rax, %rbx
movq -0x38(%rbp), %rax
decq 0xb0(%rax)
cmpq $-0x1, %rbx
je 0x32407
movq -0x1c8(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0xb6fc
addq %r12, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
movq -0x48(%rbp), %rcx
movq 0x58(%rcx), %rax
cmpq $0x0, 0x70(%rax)
je 0x32445
movq -0x30(%rbp), %rdx
movq %rbx, 0x60(%rdx)
movq -0x68(%rbp), %rax
movq %rax, 0x68(%rdx)
movq 0x58(%rcx), %rsi
addq $0x60, %rsi
leaq -0x128(%rbp), %r12
movq %r12, %rdi
movq -0x40(%rbp), %r14
movq %r14, %rcx
callq 0x3334e
movq -0x38(%rbp), %r15
leaq -0x1c8(%rbp), %r13
leaq -0x60(%rbp), %rdi
movq %r12, %rsi
callq 0x2cfc0
movq %r12, %rdi
callq 0x1113a
jmp 0x3246a
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0x331c2
movq -0x70(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x327b8
xorl %r12d, %r12d
pushq $-0x1
popq %rbx
movq -0x40(%rbp), %r14
movq -0x38(%rbp), %r15
leaq -0x1c8(%rbp), %r13
jmp 0x32490
movq -0x30(%rbp), %rax
movq (%rax), %rsi
cmpq 0x8(%rax), %rsi
movq -0x40(%rbp), %r14
movq -0x38(%rbp), %r15
leaq -0x1c8(%rbp), %r13
leaq -0x60(%rbp), %rdi
je 0x3246a
callq 0x3288e
movq -0x30(%rbp), %r12
movq %r12, %rdi
callq 0x3169a
movq %r12, %rdi
leaq -0x60(%rbp), %r12
movq %r12, %rsi
callq 0xb6fc
movq %r12, %rdi
callq 0x1113a
movb $0x1, %r12b
movq %r13, %rdi
callq 0xae2c
leaq -0x118(%rbp), %rdi
callq 0x11448
leaq -0xc8(%rbp), %rdi
callq 0x328c8
testb %r12b, %r12b
jne 0x32248
leaq -0xe0(%rbp), %rdi
callq 0x328f4
leaq -0xa0(%rbp), %rdi
callq 0x3209c
leaq -0x100(%rbp), %rdi
callq 0x9140
jmp 0x324e2
pushq $-0x1
popq %rbx
movq %rbx, %rax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x32559
movq %rax, %rbx
jmp 0x32565
jmp 0x32503
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x1113a
jmp 0x32524
jmp 0x32521
jmp 0x32521
jmp 0x32521
movq %rax, %rbx
jmp 0x32541
movq %rax, %rbx
jmp 0x3254d
movq %rax, %rbx
leaq -0x1c8(%rbp), %rdi
callq 0xae2c
jmp 0x32535
movq %rax, %rbx
leaq -0x118(%rbp), %rdi
callq 0x11448
leaq -0xc8(%rbp), %rdi
callq 0x328c8
leaq -0xe0(%rbp), %rdi
callq 0x328f4
leaq -0xa0(%rbp), %rdi
callq 0x3209c
leaq -0x100(%rbp), %rdi
callq 0x9140
movq %rbx, %rdi
callq 0x9430
nop