// File: /workspace/github_cpp_makefile_star2_O3/Falldog[P]dcinja/src/include/inja/inja.hpp
// Function: inja::Lexer::scan_body(std::basic_string_view<char, std::char_traits<char>>, inja::Token::Kind, std::basic_string_view<char, std::char_traits<char>>, bool)
Token scan_body(nonstd::string_view close, Token::Kind closeKind, nonstd::string_view close_trim = nonstd::string_view(), bool trim = false) {
  again:
    // skip whitespace (except for \n as it might be a close)
    if (tok_start >= m_in.size()) {
      return make_token(Token::Kind::Eof);
    }
    char ch = m_in[tok_start];
    if (ch == ' ' || ch == '\t' || ch == '\r') {
      tok_start += 1;
      goto again;
    }

    // check for close
    if (!close_trim.empty() && inja::string_view::starts_with(m_in.substr(tok_start), close_trim)) {
      state = State::Text;
      pos = tok_start + close_trim.size();
      Token tok = make_token(closeKind);
      skip_whitespaces_and_newlines();
      return tok;
    }

    if (inja::string_view::starts_with(m_in.substr(tok_start), close)) {
      state = State::Text;
      pos = tok_start + close.size();
      Token tok = make_token(closeKind);
      if (trim) {
        skip_whitespaces_and_first_newline();
      }
      return tok;
    }

    // skip \n
    if (ch == '\n') {
      tok_start += 1;
      goto again;
    }

    pos = tok_start + 1;
    if (std::isalpha(ch)) {
      minus_state = MinusState::Operator;
      return scan_id();
    }

    MinusState current_minus_state = minus_state;
    if (minus_state == MinusState::Operator) {
      minus_state = MinusState::Number;
    }

    switch (ch) {
    case '+':
      return make_token(Token::Kind::Plus);
    case '-':
      if (current_minus_state == MinusState::Operator) {
        return make_token(Token::Kind::Minus);
      }
      return scan_number();
    case '*':
      return make_token(Token::Kind::Times);
    case '/':
      return make_token(Token::Kind::Slash);
    case '^':
      return make_token(Token::Kind::Power);
    case '%':
      return make_token(Token::Kind::Percent);
    case '.':
      return make_token(Token::Kind::Dot);
    case ',':
      return make_token(Token::Kind::Comma);
    case ':':
      return make_token(Token::Kind::Colon);
    case '(':
      return make_token(Token::Kind::LeftParen);
    case ')':
      minus_state = MinusState::Operator;
      return make_token(Token::Kind::RightParen);
    case '[':
      return make_token(Token::Kind::LeftBracket);
    case ']':
      minus_state = MinusState::Operator;
      return make_token(Token::Kind::RightBracket);
    case '{':
      return make_token(Token::Kind::LeftBrace);
    case '}':
      minus_state = MinusState::Operator;
      return make_token(Token::Kind::RightBrace);
    case '>':
      if (pos < m_in.size() && m_in[pos] == '=') {
        pos += 1;
        return make_token(Token::Kind::GreaterEqual);
      }
      return make_token(Token::Kind::GreaterThan);
    case '<':
      if (pos < m_in.size() && m_in[pos] == '=') {
        pos += 1;
        return make_token(Token::Kind::LessEqual);
      }
      return make_token(Token::Kind::LessThan);
    case '=':
      if (pos < m_in.size() && m_in[pos] == '=') {
        pos += 1;
        return make_token(Token::Kind::Equal);
      }
      return make_token(Token::Kind::Unknown);
    case '!':
      if (pos < m_in.size() && m_in[pos] == '=') {
        pos += 1;
        return make_token(Token::Kind::NotEqual);
      }
      return make_token(Token::Kind::Unknown);
    case '\"':
      return scan_string();
    case '0':
    case '1':
    case '2':
    case '3':
    case '4':
    case '5':
    case '6':
    case '7':
    case '8':
    case '9':
      minus_state = MinusState::Operator;
      return scan_number();
    case '_':
      minus_state = MinusState::Operator;
      return scan_id();
    default:
      return make_token(Token::Kind::Unknown);
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbx
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, (%rsp)
movq 0x10(%rsi), %rcx
movq 0x20(%rsi), %rdx
cmpq %rcx, %rdx
jae 0x1f3f6
movl %r9d, 0xc(%rsp)
movl %r8d, 0x8(%rsp)
leaq 0x60(%rsp), %rax
movq (%rax), %r12
movq 0x8(%rax), %rax
movq %rax, 0x20(%rsp)
movabsq $0x100002200, %rbp      # imm = 0x100002200
movq 0x18(%r14), %rax
movzbl (%rax,%rdx), %r15d
cmpq $0x20, %r15
ja 0x1f358
btq %r15, %rbp
jb 0x1f3e6
testq %r12, %r12
je 0x1f39c
addq %rdx, %rax
movq %rcx, %rsi
subq %rdx, %rsi
movq %rsi, 0x10(%rsp)
movq %rax, 0x18(%rsp)
cmpq %r12, %rsi
jb 0x1f39c
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r12, %rcx
movq 0x20(%rsp), %r8
callq 0x1eb9a
movq 0x10(%r14), %rcx
movq 0x20(%r14), %rdx
testl %eax, %eax
je 0x1f50d
movq %rcx, %rax
subq %rdx, %rax
jb 0x1fb49
addq 0x18(%r14), %rdx
movq %rax, 0x10(%rsp)
movq %rdx, 0x18(%rsp)
cmpq %r13, %rax
jb 0x1f3d8
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r13, %rcx
movq %rbx, %r8
callq 0x1eb9a
testl %eax, %eax
je 0x1f459
cmpb $0xa, %r15b
jne 0x1f423
movq 0x10(%r14), %rcx
movq 0x20(%r14), %rdx
incq %rdx
movq %rdx, 0x20(%r14)
cmpq %rcx, %rdx
jb 0x1f33f
addq 0x18(%r14), %rcx
movq (%rsp), %r15
movl $0x22, (%r15)
movq $0x0, 0x8(%r15)
movq %rcx, 0x10(%r15)
movq %r15, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsbl %r15b, %edi
movq 0x20(%r14), %rbx
leaq 0x1(%rbx), %r12
movq %r12, 0x28(%r14)
callq 0x96e0
testl %eax, %eax
je 0x1f4c1
movl $0x0, 0xc(%r14)
movq (%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x1fbc8
jmp 0x1f411
movl $0x0, 0x8(%r14)
movq 0x10(%r14), %rax
movq 0x20(%r14), %rcx
addq %rcx, %r13
movq %r13, 0x28(%r14)
cmpq %rcx, %rax
cmovbq %rax, %rcx
cmpq %r13, %rcx
cmovaq %rcx, %r13
cmpq %rax, %r13
cmovaeq %rax, %r13
subq %rcx, %r13
subq %rcx, %rax
cmpq %r13, %rax
cmovaeq %r13, %rax
addq 0x18(%r14), %rcx
movq (%rsp), %r15
movl 0x8(%rsp), %edx
movl %edx, (%r15)
movq %rax, 0x8(%r15)
movq %rcx, 0x10(%r15)
cmpb $0x0, 0xc(%rsp)
je 0x1f411
movq %r14, %rdi
callq 0x1fb5e
jmp 0x1f411
movl 0xc(%r14), %eax
testl %eax, %eax
jne 0x1f4d1
movl $0x1, 0xc(%r14)
movzbl %r15b, %ecx
leal -0x21(%rcx), %edx
cmpl $0x3e, %edx
ja 0x1f5b1
leaq 0x34d8c(%rip), %rcx     # 0x54274
movslq (%rcx,%rdx,4), %rdx
addq %rcx, %rdx
movq (%rsp), %r15
jmpq *%rdx
movl $0x0, 0xc(%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x1fc64
jmp 0x1f411
movl $0x0, 0x8(%r14)
leaq (%rdx,%r12), %rsi
cmpq %rdx, %rcx
movq %rdx, %rdi
cmovbq %rcx, %rdi
cmpq %rsi, %rdi
movq %rsi, %r8
cmovaq %rdi, %r8
movq %rsi, 0x28(%r14)
cmpq %rcx, %r8
cmovaeq %rcx, %r8
movq 0x18(%r14), %rax
subq %rdi, %r8
movq %rcx, %r9
subq %rdi, %r9
cmpq %r8, %r9
cmovaeq %r8, %r9
addq %rax, %rdi
movq (%rsp), %r15
movl 0x8(%rsp), %r8d
movl %r8d, (%r15)
movq %r9, 0x8(%r15)
movq %rdi, 0x10(%r15)
cmpq %rcx, %rsi
jae 0x1f411
negq %rcx
addq %r12, %rdx
incq %rdx
movabsq $0x100002600, %rsi      # imm = 0x100002600
movzbl -0x1(%rax,%rdx), %edi
cmpq $0x20, %rdi
ja 0x1f411
btq %rdi, %rsi
jae 0x1f411
movq %rdx, 0x28(%r14)
leaq (%rcx,%rdx), %rdi
incq %rdi
incq %rdx
cmpq $0x1, %rdi
jne 0x1f57f
jmp 0x1f411
cmpl $0x7b, %ecx
movq (%rsp), %r15
je 0x1faa4
cmpl $0x7d, %ecx
jne 0x1f601
movl $0x0, 0xc(%r14)
movq 0x10(%r14), %rax
cmpq %rbx, %rax
cmovbq %rax, %rbx
cmpq %r12, %rbx
cmovaq %rbx, %r12
cmpq %rax, %r12
cmovaeq %rax, %r12
subq %rbx, %r12
subq %rbx, %rax
cmpq %r12, %rax
cmovaeq %r12, %rax
addq 0x18(%r14), %rbx
movl $0x1a, (%r15)
jmp 0x1fad5
movq 0x10(%r14), %rax
cmpq %rbx, %rax
cmovbq %rax, %rbx
cmpq %r12, %rbx
cmovaq %rbx, %r12
cmpq %rax, %r12
cmovaeq %rax, %r12
subq %rbx, %r12
subq %rbx, %rax
cmpq %r12, %rax
cmovaeq %r12, %rax
addq 0x18(%r14), %rbx
movl $0x21, (%r15)
jmp 0x1fad5
movq 0x10(%r14), %rcx
movq 0x18(%r14), %rax
cmpq %rcx, %r12
jae 0x1fae2
cmpb $0x3d, (%rax,%r12)
jne 0x1fae2
leaq 0x2(%rbx), %rdx
movq %rdx, 0x28(%r14)
cmpq %rbx, %rcx
cmovbq %rcx, %rbx
cmpq %rdx, %rbx
cmovaq %rbx, %rdx
cmpq %rcx, %rdx
cmovaeq %rcx, %rdx
subq %rbx, %rdx
subq %rbx, %rcx
cmpq %rdx, %rcx
cmovaeq %rdx, %rcx
addq %rbx, %rax
movl $0x20, (%r15)
jmp 0x1fb3c
movq 0x10(%r14), %rax
cmpq %rbx, %rax
cmovbq %rax, %rbx
cmpq %r12, %rbx
cmovaq %rbx, %r12
cmpq %rax, %r12
cmovaeq %rax, %r12
subq %rbx, %r12
subq %rbx, %rax
cmpq %r12, %rax
cmovaeq %r12, %rax
addq 0x18(%r14), %rbx
movl $0x14, (%r15)
jmp 0x1fad5
movq 0x10(%r14), %rax
cmpq %rbx, %rax
cmovbq %rax, %rbx
cmpq %r12, %rbx
cmovaq %rbx, %r12
cmpq %rax, %r12
cmovaeq %rax, %r12
subq %rbx, %r12
subq %rbx, %rax
cmpq %r12, %rax
cmovaeq %r12, %rax
addq 0x18(%r14), %rbx
movl $0xf, (%r15)
jmp 0x1fad5
movq 0x10(%r14), %rax
cmpq %rbx, %rax
cmovbq %rax, %rbx
cmpq %r12, %rbx
cmovaq %rbx, %r12
cmpq %rax, %r12
cmovaeq %rax, %r12
subq %rbx, %r12
subq %rbx, %rax
cmpq %r12, %rax
cmovaeq %r12, %rax
addq 0x18(%r14), %rbx
movl $0x10, (%r15)
jmp 0x1fad5
movq 0x10(%r14), %rcx
movq 0x18(%r14), %rax
cmpq %rcx, %r12
jae 0x1f88a
cmpb $0x3d, (%rax,%r12)
jne 0x1f88a
leaq 0x2(%rbx), %rdx
movq %rdx, 0x28(%r14)
cmpq %rbx, %rcx
cmovbq %rcx, %rbx
cmpq %rdx, %rbx
cmovaq %rbx, %rdx
cmpq %rcx, %rdx
cmovaeq %rcx, %rdx
subq %rbx, %rdx
subq %rbx, %rcx
cmpq %rdx, %rcx
cmovaeq %rdx, %rcx
addq %rbx, %rax
movl $0x1b, (%r15)
jmp 0x1fb3c
movq %r15, %rdi
movq %r14, %rsi
callq 0x1fcf0
jmp 0x1f411
testl %eax, %eax
jne 0x1f4fd
movq 0x10(%r14), %rax
cmpq %rbx, %rax
cmovbq %rax, %rbx
cmpq %r12, %rbx
cmovaq %rbx, %r12
cmpq %rax, %r12
cmovaeq %rax, %r12
subq %rbx, %r12
subq %rbx, %rax
cmpq %r12, %rax
cmovaeq %r12, %rax
addq 0x18(%r14), %rbx
movl $0xd, (%r15)
jmp 0x1fad5
movq 0x10(%r14), %rax
cmpq %rbx, %rax
cmovbq %rax, %rbx
cmpq %r12, %rbx
cmovaq %rbx, %r12
cmpq %rax, %r12
cmovaeq %rax, %r12
subq %rbx, %r12
subq %rbx, %rax
cmpq %r12, %rax
cmovaeq %r12, %rax
addq 0x18(%r14), %rbx
movl $0x12, (%r15)
jmp 0x1fad5
movq 0x10(%r14), %rax
cmpq %rbx, %rax
cmovbq %rax, %rbx
cmpq %r12, %rbx
cmovaq %rbx, %r12
cmpq %rax, %r12
cmovaeq %rax, %r12
subq %rbx, %r12
subq %rbx, %rax
cmpq %r12, %rax
cmovaeq %r12, %rax
addq 0x18(%r14), %rbx
movl $0x11, (%r15)
jmp 0x1fad5
movq 0x10(%r14), %rcx
movq 0x18(%r14), %rax
cmpq %rcx, %r12
jae 0x1f88a
cmpb $0x3d, (%rax,%r12)
jne 0x1f88a
leaq 0x2(%rbx), %rdx
movq %rdx, 0x28(%r14)
cmpq %rbx, %rcx
cmovbq %rcx, %rbx
cmpq %rdx, %rbx
cmovaq %rbx, %rdx
cmpq %rcx, %rdx
cmovaeq %rcx, %rdx
subq %rbx, %rdx
subq %rbx, %rcx
cmpq %rdx, %rcx
cmovaeq %rdx, %rcx
addq %rbx, %rax
movl $0x1c, (%r15)
jmp 0x1fb3c
cmpq %rbx, %rcx
cmovbq %rcx, %rbx
cmpq %r12, %rbx
cmovaq %rbx, %r12
cmpq %rcx, %r12
cmovaeq %rcx, %r12
subq %rbx, %r12
subq %rbx, %rcx
cmpq %r12, %rcx
cmovaeq %r12, %rcx
addq %rbx, %rax
movl $0x21, (%r15)
jmp 0x1fb3c
movl $0x0, 0xc(%r14)
movq 0x10(%r14), %rax
cmpq %rbx, %rax
cmovbq %rax, %rbx
cmpq %r12, %rbx
cmovaq %rbx, %r12
cmpq %rax, %r12
cmovaeq %rax, %r12
subq %rbx, %r12
subq %rbx, %rax
cmpq %r12, %rax
cmovaeq %r12, %rax
addq 0x18(%r14), %rbx
movl $0x16, (%r15)
jmp 0x1fad5
movl $0x0, 0xc(%r14)
jmp 0x1f44c
movq 0x10(%r14), %rax
cmpq %rbx, %rax
cmovbq %rax, %rbx
cmpq %r12, %rbx
cmovaq %rbx, %r12
cmpq %rax, %r12
cmovaeq %rax, %r12
subq %rbx, %r12
subq %rbx, %rax
cmpq %r12, %rax
cmovaeq %r12, %rax
addq 0x18(%r14), %rbx
movl $0x15, (%r15)
jmp 0x1fad5
movq 0x10(%r14), %rax
cmpq %rbx, %rax
cmovbq %rax, %rbx
cmpq %r12, %rbx
cmovaq %rbx, %r12
cmpq %rax, %r12
cmovaeq %rax, %r12
subq %rbx, %r12
subq %rbx, %rax
cmpq %r12, %rax
cmovaeq %r12, %rax
addq 0x18(%r14), %rbx
movl $0xe, (%r15)
jmp 0x1fad5
movq 0x10(%r14), %rax
cmpq %rbx, %rax
cmovbq %rax, %rbx
cmpq %r12, %rbx
cmovaq %rbx, %r12
cmpq %rax, %r12
cmovaeq %rax, %r12
subq %rbx, %r12
subq %rbx, %rax
cmpq %r12, %rax
cmovaeq %r12, %rax
addq 0x18(%r14), %rbx
movl $0xc, (%r15)
jmp 0x1fad5
movq 0x10(%r14), %rax
cmpq %rbx, %rax
cmovbq %rax, %rbx
cmpq %r12, %rbx
cmovaq %rbx, %r12
cmpq %rax, %r12
cmovaeq %rax, %r12
subq %rbx, %r12
subq %rbx, %rax
cmpq %r12, %rax
cmovaeq %r12, %rax
addq 0x18(%r14), %rbx
movl $0x17, (%r15)
jmp 0x1fad5
movq 0x10(%r14), %rax
cmpq %rbx, %rax
cmovbq %rax, %rbx
cmpq %r12, %rbx
cmovaq %rbx, %r12
cmpq %rax, %r12
cmovaeq %rax, %r12
subq %rbx, %r12
subq %rbx, %rax
cmpq %r12, %rax
cmovaeq %r12, %rax
addq 0x18(%r14), %rbx
movl $0x13, (%r15)
jmp 0x1fad5
movq 0x10(%r14), %rcx
movq 0x18(%r14), %rax
cmpq %rcx, %r12
jae 0x1fb10
cmpb $0x3d, (%rax,%r12)
jne 0x1fb10
leaq 0x2(%rbx), %rdx
movq %rdx, 0x28(%r14)
cmpq %rbx, %rcx
cmovbq %rcx, %rbx
cmpq %rdx, %rbx
cmovaq %rbx, %rdx
cmpq %rcx, %rdx
cmovaeq %rcx, %rdx
subq %rbx, %rdx
subq %rbx, %rcx
cmpq %rdx, %rcx
cmovaeq %rdx, %rcx
addq %rbx, %rax
movl $0x1e, (%r15)
jmp 0x1fb3c
movl $0x0, 0xc(%r14)
movq 0x10(%r14), %rax
cmpq %rbx, %rax
cmovbq %rax, %rbx
cmpq %r12, %rbx
cmovaq %rbx, %r12
cmpq %rax, %r12
cmovaeq %rax, %r12
subq %rbx, %r12
subq %rbx, %rax
cmpq %r12, %rax
cmovaeq %r12, %rax
addq 0x18(%r14), %rbx
movl $0x18, (%r15)
jmp 0x1fad5
movq 0x10(%r14), %rax
cmpq %rbx, %rax
cmovbq %rax, %rbx
cmpq %r12, %rbx
cmovaq %rbx, %r12
cmpq %rax, %r12
cmovaeq %rax, %r12
subq %rbx, %r12
subq %rbx, %rax
cmpq %r12, %rax
cmovaeq %r12, %rax
addq 0x18(%r14), %rbx
movl $0x19, (%r15)
movq %rax, 0x8(%r15)
movq %rbx, 0x10(%r15)
jmp 0x1f411
cmpq %rbx, %rcx
cmovbq %rcx, %rbx
cmpq %r12, %rbx
cmovaq %rbx, %r12
cmpq %rcx, %r12
cmovaeq %rcx, %r12
subq %rbx, %r12
subq %rbx, %rcx
cmpq %r12, %rcx
cmovaeq %r12, %rcx
addq %rbx, %rax
movl $0x1f, (%r15)
jmp 0x1fb3c
cmpq %rbx, %rcx
cmovbq %rcx, %rbx
cmpq %r12, %rbx
cmovaq %rbx, %r12
cmpq %rcx, %r12
cmovaeq %rcx, %r12
subq %rbx, %r12
subq %rbx, %rcx
cmpq %r12, %rcx
cmovaeq %r12, %rcx
addq %rbx, %rax
movl $0x1d, (%r15)
movq %rcx, 0x8(%r15)
movq %rax, 0x10(%r15)
jmp 0x1f411
leaq 0x3601b(%rip), %rdi     # 0x55b6b
leaq 0x35ffa(%rip), %rsi     # 0x55b51
xorl %eax, %eax
callq 0x9670