// File: 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
subq $0x270, %rsp            # imm = 0x270
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x238(%rbp)
cmpq $0x0, 0x20(%rax)
je 0x10a35
movq -0x238(%rbp), %rcx
movq 0x20(%rcx), %rax
cmpq 0x68(%rcx), %rax
jbe 0x10a30
movq -0x238(%rbp), %rax
movq 0x20(%rax), %rcx
movq %rcx, 0x68(%rax)
movq -0x18(%rbp), %rdi
movq 0x20(%rax), %rsi
callq 0x21040
movq %rax, -0x30(%rbp)
movq %rdx, -0x28(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xa520
movq -0x238(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq 0x20(%rsi), %r8
leaq -0x70(%rbp), %rdi
callq 0x210f0
jmp 0x10731
leaq -0x70(%rbp), %rdi
callq 0xa610
testb $0x1, %al
jne 0x109cb
movq -0x238(%rbp), %rsi
addq $0x28, %rsi
leaq -0xc0(%rbp), %rdi
callq 0xa170
jmp 0x1075b
leaq -0xe1(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0xa660
movq -0x240(%rbp), %rdx
leaq 0x9159f(%rip), %rsi     # 0xa1d1b
leaq -0xe0(%rbp), %rdi
callq 0x18be0
jmp 0x1078a
movq -0x238(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rdx
leaq -0xe0(%rbp), %rcx
leaq -0x70(%rbp), %r8
callq 0x212a0
jmp 0x107b1
leaq -0x50(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
movq %rsi, -0x260(%rbp)
callq 0xa4a0
movq -0x260(%rbp), %rdi
callq 0xa250
leaq -0xe0(%rbp), %rdi
callq 0xa250
leaq -0xe1(%rbp), %rdi
callq 0xa410
leaq -0xc0(%rbp), %rdi
callq 0xa250
leaq -0x70(%rbp), %rdi
movq %rdi, -0x258(%rbp)
callq 0xa220
movq -0x258(%rbp), %rdi
movq %rax, -0x250(%rbp)
callq 0xa2d0
movq -0x250(%rbp), %rdi
movq %rax, %rsi
callq 0x21340
movq %rax, -0x248(%rbp)
jmp 0x10833
movq -0x248(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x108(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xa3d0
jmp 0x10850
leaq -0x148(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xa170
jmp 0x10862
leaq -0x169(%rbp), %rdi
movq %rdi, -0x268(%rbp)
callq 0xa660
movq -0x268(%rbp), %rdx
leaq 0x9149b(%rip), %rsi     # 0xa1d1e
leaq -0x168(%rbp), %rdi
callq 0x18be0
jmp 0x10891
movq -0x238(%rbp), %rsi
leaq -0x128(%rbp), %rdi
leaq -0x148(%rbp), %rdx
leaq -0x168(%rbp), %rcx
leaq -0x108(%rbp), %r8
callq 0x212a0
jmp 0x108bb
leaq -0x50(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0xa4a0
leaq -0x128(%rbp), %rdi
callq 0xa250
leaq -0x168(%rbp), %rdi
callq 0xa250
leaq -0x169(%rbp), %rdi
callq 0xa410
leaq -0x148(%rbp), %rdi
callq 0xa250
leaq -0x108(%rbp), %rdi
callq 0xa250
jmp 0x109e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x10a22
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x10a19
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x10954
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0xa250
leaq -0xe1(%rbp), %rdi
callq 0xa410
leaq -0xc0(%rbp), %rdi
callq 0xa250
jmp 0x10a19
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x109bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x109a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x168(%rbp), %rdi
callq 0xa250
leaq -0x169(%rbp), %rdi
callq 0xa410
leaq -0x148(%rbp), %rdi
callq 0xa250
leaq -0x108(%rbp), %rdi
callq 0xa250
jmp 0x10a19
movq -0x238(%rbp), %rsi
addq $0x28, %rsi
leaq -0x50(%rbp), %rdi
callq 0xa040
jmp 0x109e1
jmp 0x109e3
leaq -0x70(%rbp), %rdi
callq 0xa250
movq -0x238(%rbp), %r8
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
addq $0x48, %r8
leaq -0x50(%rbp), %rcx
callq 0x21400
jmp 0x10a0e
leaq -0x50(%rbp), %rdi
callq 0xa250
jmp 0x10a30
leaq -0x70(%rbp), %rdi
callq 0xa250
leaq -0x50(%rbp), %rdi
callq 0xa250
jmp 0x10e17
jmp 0x10e0e
movq -0x238(%rbp), %rax
cmpq $0x0, (%rax)
je 0x10e0c
movq -0x238(%rbp), %rcx
movq (%rcx), %rax
cmpq 0x68(%rcx), %rax
jbe 0x10e0a
movq -0x238(%rbp), %rax
movq (%rax), %rcx
movq %rcx, 0x68(%rax)
movq -0x18(%rbp), %rdi
movq (%rax), %rsi
callq 0x21040
movq %rax, -0x180(%rbp)
movq %rdx, -0x178(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0xa520
movq -0x238(%rbp), %rdi
addq $0x8, %rdi
callq 0x21460
testb $0x1, %al
jne 0x10aa4
jmp 0x10acf
leaq 0x91276(%rip), %rsi     # 0xa1d21
leaq -0x1a0(%rbp), %rdi
callq 0xa510
jmp 0x10ab9
jmp 0x10dc3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x10dfc
leaq 0x91259(%rip), %rsi     # 0xa1d2f
leaq -0x1a0(%rbp), %rdi
callq 0xa510
jmp 0x10ae4
movq -0x238(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq (%rsi), %r8
leaq -0x1c0(%rbp), %rdi
callq 0x210f0
jmp 0x10b04
leaq -0x1c0(%rbp), %rdi
callq 0xa610
testb $0x1, %al
jne 0x10b72
leaq 0x91221(%rip), %rsi     # 0xa1d3c
leaq -0x1a0(%rbp), %rdi
callq 0xa390
jmp 0x10b29
leaq -0x1a0(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0xa4c0
jmp 0x10b3e
leaq 0x91204(%rip), %rsi     # 0xa1d49
leaq -0x1a0(%rbp), %rdi
callq 0xa390
jmp 0x10b53
jmp 0x10b72
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0xa250
jmp 0x10dfc
leaq -0x1c0(%rbp), %rdi
callq 0xa250
movb $0x1, -0x1c1(%rbp)
movq $0x0, -0x1d0(%rbp)
movq -0x238(%rbp), %rdi
movq -0x1d0(%rbp), %rax
movq %rax, -0x270(%rbp)
addq $0x8, %rdi
callq 0x1aa00
movq %rax, %rcx
movq -0x270(%rbp), %rax
cmpq %rcx, %rax
jae 0x10dac
movq -0x238(%rbp), %rdi
addq $0x8, %rdi
movq -0x1d0(%rbp), %rsi
callq 0x214a0
movq (%rax), %rcx
movq %rcx, -0x1e0(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x1d8(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x214c0
movq %rax, -0x1e8(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x214e0
movq %rax, -0x1f0(%rbp)
movq -0x1f0(%rbp), %rax
cmpq $0x0, (%rax)
je 0x10c3f
movq -0x1f0(%rbp), %rax
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa440
movsbl (%rax), %eax
cmpl $0x5f, %eax
je 0x10d95
movb -0x1c1(%rbp), %cl
leaq 0x910ff(%rip), %rax     # 0xa1d4b
leaq 0x91105(%rip), %rsi     # 0xa1d58
testb $0x1, %cl
cmovneq %rax, %rsi
leaq -0x1a0(%rbp), %rdi
callq 0xa390
jmp 0x10c68
movq -0x1e8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x10cbc
leaq 0x910cd(%rip), %rsi     # 0xa1d49
leaq -0x1a0(%rbp), %rdi
callq 0xa390
jmp 0x10c8a
movq -0x1e8(%rbp), %rax
movq (%rax), %rsi
leaq -0x1a0(%rbp), %rdi
callq 0xa390
jmp 0x10ca2
leaq 0x910a0(%rip), %rsi     # 0xa1d49
leaq -0x1a0(%rbp), %rdi
callq 0xa390
jmp 0x10cb7
jmp 0x10d8e
movq -0x1f0(%rbp), %rax
movq (%rax), %rdx
leaq 0x9108e(%rip), %rsi     # 0xa1d5b
leaq -0x230(%rbp), %rdi
callq 0x10030
jmp 0x10cdb
leaq 0x9107b(%rip), %rdx     # 0xa1d5d
leaq -0x210(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0xffe0
jmp 0x10cf7
leaq -0x1a0(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0xa4c0
jmp 0x10d0c
leaq -0x210(%rbp), %rdi
callq 0xa250
leaq -0x230(%rbp), %rdi
callq 0xa250
movq -0x238(%rbp), %rdi
addq $0x48, %rdi
callq 0xa610
testb $0x1, %al
jne 0x10d3a
jmp 0x10d8c
movq -0x238(%rbp), %rdi
movq -0x1f0(%rbp), %rax
movq (%rax), %rsi
addq $0x48, %rdi
callq 0xa040
jmp 0x10d56
jmp 0x10d8c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x10d7e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x210(%rbp), %rdi
callq 0xa250
leaq -0x230(%rbp), %rdi
callq 0xa250
jmp 0x10dfc
jmp 0x10d8e
movb $0x0, -0x1c1(%rbp)
movq -0x1d0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1d0(%rbp)
jmp 0x10b90
leaq 0x91687(%rip), %rsi     # 0xa243a
leaq -0x1a0(%rbp), %rdi
callq 0xa390
jmp 0x10dc1
jmp 0x10dc3
movq -0x238(%rbp), %r8
movq -0x10(%rbp), %rdi
movq -0x180(%rbp), %rsi
movq -0x178(%rbp), %rdx
addq $0x48, %r8
leaq -0x1a0(%rbp), %rcx
callq 0x21400
jmp 0x10dee
leaq -0x1a0(%rbp), %rdi
callq 0xa250
jmp 0x10e0a
leaq -0x1a0(%rbp), %rdi
callq 0xa250
jmp 0x10e17
jmp 0x10e0c
jmp 0x10e0e
addq $0x270, %rsp            # imm = 0x270
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0xa650