// File: /workspace/github_cpp_makefile_star2_O2/yhirose[P]fizzbuzzlang/./peglib.h
// Function: peg::ErrorInfo::output_log(std::function<void (unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)> const&, char const*, unsigned long)
inline void ErrorInfo::output_log(const Log &log, const char *s, size_t n) {
  if (message_pos) {
    if (message_pos > last_output_pos) {
      last_output_pos = message_pos;
      auto line = line_info(s, message_pos);
      std::string msg;
      if (auto unexpected_token = heuristic_error_token(s, n, message_pos);
          !unexpected_token.empty()) {
        msg = replace_all(message, "%t", unexpected_token);

        auto unexpected_char = unexpected_token.substr(
            0,
            codepoint_length(unexpected_token.data(), unexpected_token.size()));

        msg = replace_all(msg, "%c", unexpected_char);
      } else {
        msg = message;
      }
      log(line.first, line.second, msg, label);
    }
  } else if (error_pos) {
    if (error_pos > last_output_pos) {
      last_output_pos = error_pos;
      auto line = line_info(s, error_pos);

      std::string msg;
      if (expected_tokens.empty()) {
        msg = "syntax error.";
      } else {
        msg = "syntax error";

        // unexpected token
        if (auto unexpected_token = heuristic_error_token(s, n, error_pos);
            !unexpected_token.empty()) {
          msg += ", unexpected '";
          msg += unexpected_token;
          msg += "'";
        }

        auto first_item = true;
        size_t i = 0;
        while (i < expected_tokens.size()) {
          auto [error_literal, error_rule] = expected_tokens[i];

          // Skip rules start with '_'
          if (!(error_rule && error_rule->name[0] == '_')) {
            msg += (first_item ? ", expecting " : ", ");
            if (error_literal) {
              msg += "'";
              msg += error_literal;
              msg += "'";
            } else {
              msg += "<" + error_rule->name + ">";
              if (label.empty()) { label = error_rule->name; }
            }
            first_item = false;
          }

          i++;
        }
        msg += ".";
      }
      log(line.first, line.second, msg, label);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rcx, %r14
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %rbx
movq 0x20(%rdi), %rsi
testq %rsi, %rsi
je 0xc241
cmpq 0x68(%rbx), %rsi
jbe 0xc4af
movq %r15, -0x58(%rbp)
movq %rsi, 0x68(%rbx)
movq %r13, %rdi
callq 0x11bfa
leaq -0x40(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movq %rax, %r15
movq %rdx, %r12
movb $0x0, (%rcx)
movq 0x20(%rbx), %r8
leaq -0x80(%rbp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x11c3e
cmpq $0x0, -0x78(%rbp)
je 0xc426
leaq 0x28(%rbx), %rsi
leaq -0x140(%rbp), %rdi
callq 0x9360
leaq 0x2d618(%rip), %rsi     # 0x3973f
leaq -0xe0(%rbp), %rdi
leaq -0x100(%rbp), %rdx
callq 0xff44
leaq -0xa8(%rbp), %rdi
leaq -0x140(%rbp), %rdx
leaq -0xe0(%rbp), %rcx
leaq -0x80(%rbp), %r8
movq %rbx, %rsi
callq 0x11d1a
leaq -0x50(%rbp), %rdi
leaq -0xa8(%rbp), %r14
movq %r14, %rsi
callq 0x9310
movq %r14, %rdi
callq 0x9140
leaq -0xe0(%rbp), %rdi
callq 0x9140
leaq -0x140(%rbp), %rdi
callq 0x9140
leaq -0x80(%rbp), %r14
movq (%r14), %rdi
movq 0x8(%r14), %rsi
callq 0x11d84
leaq -0xa8(%rbp), %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x92d0
leaq -0x120(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x9360
leaq 0x2d579(%rip), %rsi     # 0x39742
leaq -0x100(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0xff44
leaq -0xe0(%rbp), %rdi
leaq -0x120(%rbp), %rdx
leaq -0x100(%rbp), %rcx
leaq -0xa8(%rbp), %r8
movq %rbx, %rsi
callq 0x11d1a
leaq -0x50(%rbp), %rdi
leaq -0xe0(%rbp), %r14
movq %r14, %rsi
callq 0x9310
movq %r14, %rdi
callq 0x9140
leaq -0x100(%rbp), %rdi
callq 0x9140
leaq -0x120(%rbp), %rdi
callq 0x9140
leaq -0xa8(%rbp), %rdi
callq 0x9140
jmp 0xc433
movq (%rbx), %rsi
testq %rsi, %rsi
je 0xc4af
cmpq 0x68(%rbx), %rsi
jbe 0xc4af
movq %rsi, 0x68(%rbx)
movq %r13, %rdi
callq 0x11bfa
movq %rax, %r12
movq %rdx, -0xb8(%rbp)
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x8(%rbx), %rax
cmpq 0x10(%rbx), %rax
je 0xc479
leaq 0x2d4c1(%rip), %rsi     # 0x39753
leaq -0x50(%rbp), %rdi
callq 0x94a0
movq (%rbx), %r8
leaq -0x80(%rbp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x11c3e
movq %r12, -0xb0(%rbp)
movq %r15, -0x58(%rbp)
cmpq $0x0, -0x78(%rbp)
je 0xc2ef
leaq 0x2d497(%rip), %rsi     # 0x39760
leaq -0x50(%rbp), %rdi
callq 0x9490
leaq -0x50(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x94c0
leaq 0x2d487(%rip), %rsi     # 0x3976d
leaq -0x50(%rbp), %rdi
callq 0x9490
leaq -0x80(%rbp), %rdi
callq 0x9140
movq %rbx, -0x60(%rbp)
leaq 0x48(%rbx), %rax
movq %rax, -0xc0(%rbp)
movb $0x1, %al
pushq $0x8
popq %rcx
movq %rcx, -0x88(%rbp)
xorl %esi, %esi
leaq -0x50(%rbp), %rbx
movq -0x60(%rbp), %rdx
movq 0x8(%rdx), %rcx
movq 0x10(%rdx), %rdx
subq %rcx, %rdx
sarq $0x4, %rdx
cmpq %rdx, %rsi
jae 0xc458
movq %rsi, %r14
movq -0x88(%rbp), %rdx
movq -0x8(%rcx,%rdx), %r15
movq (%rcx,%rdx), %r13
testq %r13, %r13
je 0xc35a
movq (%r13), %rcx
cmpb $0x5f, (%rcx)
je 0xc413
testb $0x1, %al
leaq 0x2d419(%rip), %rsi     # 0x3977c
leaq 0x2d405(%rip), %rax     # 0x3976f
cmovneq %rax, %rsi
movq %rbx, %rdi
callq 0x9490
testq %r15, %r15
je 0xc3a9
movq %rbx, %r13
movq %rbx, %rdi
leaq 0x2d3e5(%rip), %rsi     # 0x3976d
callq 0x9490
movq %r13, %rdi
movq %r15, %rsi
callq 0x9490
movq %r13, %rdi
leaq 0x2d3cb(%rip), %rsi     # 0x3976d
callq 0x9490
jmp 0xc411
leaq -0xa8(%rbp), %r12
movq %r12, %rdi
leaq 0x2d3c5(%rip), %rsi     # 0x3977f
movq %r13, %rdx
callq 0xbd74
leaq -0x80(%rbp), %r15
movq %r15, %rdi
movq %r12, %rsi
leaq 0x2d3ae(%rip), %rdx     # 0x39781
callq 0xbd4b
movq %rbx, %rdi
movq %r15, %rsi
callq 0x94c0
movq %r15, %rdi
callq 0x9140
leaq -0xa8(%rbp), %rdi
callq 0x9140
movq -0x60(%rbp), %rax
cmpq $0x0, 0x50(%rax)
jne 0xc411
movq -0xc0(%rbp), %rdi
movq %r13, %rsi
callq 0x9190
xorl %eax, %eax
movq %r14, %rsi
incq %rsi
addq $0x10, -0x88(%rbp)
jmp 0xc319
leaq 0x28(%rbx), %rsi
leaq -0x50(%rbp), %rdi
callq 0x9190
leaq -0x80(%rbp), %rdi
callq 0x9140
addq $0x48, %rbx
leaq -0x50(%rbp), %rcx
movq -0x58(%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbx, %r8
callq 0x11e10
jmp 0xc4a6
leaq 0x2d9ff(%rip), %rsi     # 0x39e5e
leaq -0x50(%rbp), %rdi
callq 0x9490
movq -0x58(%rbp), %r15
movq -0xb0(%rbp), %r12
movq -0x60(%rbp), %rbx
jmp 0xc489
leaq 0x2d2c5(%rip), %rsi     # 0x39745
leaq -0x50(%rbp), %rdi
callq 0x94a0
addq $0x48, %rbx
leaq -0x50(%rbp), %rcx
movq %r15, %rdi
movq %r12, %rsi
movq -0xb8(%rbp), %rdx
movq %rbx, %r8
callq 0x11e10
leaq -0x50(%rbp), %rdi
callq 0x9140
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc551
jmp 0xc551
jmp 0xc521
jmp 0xc521
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x9140
jmp 0xc4e3
movq %rax, %rbx
leaq -0x120(%rbp), %rdi
callq 0x9140
jmp 0xc4f4
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
jmp 0xc51a
jmp 0xc521
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x9140
jmp 0xc513
movq %rax, %rbx
leaq -0x140(%rbp), %rdi
callq 0x9140
jmp 0xc524
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
jmp 0xc54a
jmp 0xc551
jmp 0xc551
jmp 0xc551
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x9140
jmp 0xc543
jmp 0xc551
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
callq 0x9140
jmp 0xc554
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x9140
movq %rbx, %rdi
callq 0x9430
nop