// File: Falldog[P]dcinja/src/include/inja/inja.hpp
// Function: inja::Parser::parse_into(inja::Template&, std::basic_string_view<char, std::char_traits<char>>)
void parse_into(Template &tmpl, nonstd::string_view path) {
    lexer.start(tmpl.content);
    current_block = &tmpl.root;

    for (;;) {
      get_next_token();
      switch (tok.kind) {
      case Token::Kind::Eof: {
        if (!if_statement_stack.empty()) {
          throw_parser_error("unmatched if");
        }
        if (!for_statement_stack.empty()) {
          throw_parser_error("unmatched for");
        }
      } return;
      case Token::Kind::Text: {
        current_block->nodes.emplace_back(std::make_shared<TextNode>(tok.text.data() - tmpl.content.c_str(), tok.text.size()));
      } break;
      case Token::Kind::StatementOpen: {
        get_next_token();
        if (!parse_statement(tmpl, Token::Kind::StatementClose, path)) {
          throw_parser_error("expected statement, got '" + tok.describe() + "'");
        }
        if (tok.kind != Token::Kind::StatementClose) {
          throw_parser_error("expected statement close, got '" + tok.describe() + "'");
        }
      } break;
      case Token::Kind::LineStatementOpen: {
        get_next_token();
        if (!parse_statement(tmpl, Token::Kind::LineStatementClose, path)) {
          throw_parser_error("expected statement, got '" + tok.describe() + "'");
        }
        if (tok.kind != Token::Kind::LineStatementClose && tok.kind != Token::Kind::Eof) {
          throw_parser_error("expected line statement close, got '" + tok.describe() + "'");
        }
      } break;
      case Token::Kind::ExpressionOpen: {
        get_next_token();

        auto expression_list_node = std::make_shared<ExpressionListNode>(tok.text.data() - tmpl.content.c_str());
        current_block->nodes.emplace_back(expression_list_node);
        current_expression_list = expression_list_node.get();

        if (!parse_expression(tmpl, Token::Kind::ExpressionClose)) {
          throw_parser_error("expected expression, got '" + tok.describe() + "'");
        }

        if (tok.kind != Token::Kind::ExpressionClose) {
          throw_parser_error("expected expression close, got '" + tok.describe() + "'");
        }
      } break;
      case Token::Kind::CommentOpen: {
        get_next_token();
        if (tok.kind != Token::Kind::CommentClose) {
          throw_parser_error("expected comment close, got '" + tok.describe() + "'");
        }
      } break;
      default: {
        throw_parser_error("unexpected token '" + tok.describe() + "'");
      } break;
      }
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x480, %rsp            # imm = 0x480
movq %rdx, -0x10(%rbp)
movq %rcx, -0x8(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x3f0(%rbp)
addq $0x8, %rax
movq %rax, -0x3f8(%rbp)
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
callq 0xb610
movq -0x3f8(%rbp), %rdi
movq %rax, -0x30(%rbp)
movq %rdx, -0x28(%rbp)
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x32f90
movq -0x3f0(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, 0xa8(%rax)
movq -0x3f0(%rbp), %rdi
callq 0x33060
movq -0x3f0(%rbp), %rax
movl 0x48(%rax), %eax
movq %rax, -0x400(%rbp)
subq $0x22, %rax
ja 0x32a22
movq -0x400(%rbp), %rax
leaq 0x8e08f(%rip), %rcx     # 0xc0070
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x3f0(%rbp), %rdi
addq $0x158, %rdi            # imm = 0x158
callq 0x330d0
testb $0x1, %al
jne 0x32085
leaq -0x51(%rbp), %rdi
movq %rdi, -0x408(%rbp)
callq 0xba70
movq -0x408(%rbp), %rdx
leaq 0x906cf(%rip), %rsi     # 0xc26f2
leaq -0x50(%rbp), %rdi
callq 0x10b90
jmp 0x3202e
movq -0x3f0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x330f0
jmp 0x32040
leaq -0x50(%rbp), %rdi
callq 0xbb98
leaq -0x51(%rbp), %rdi
callq 0xb600
jmp 0x32085
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x32077
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xbb98
leaq -0x51(%rbp), %rdi
callq 0xb600
jmp 0x32b06
movq -0x3f0(%rbp), %rdi
addq $0x1a8, %rdi            # imm = 0x1A8
callq 0x331a0
testb $0x1, %al
jne 0x32135
leaq -0x89(%rbp), %rdi
movq %rdi, -0x410(%rbp)
callq 0xba70
movq -0x410(%rbp), %rdx
leaq 0x9063e(%rip), %rsi     # 0xc26ff
leaq -0x88(%rbp), %rdi
callq 0x10b90
jmp 0x320cf
movq -0x3f0(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x330f0
jmp 0x320e4
leaq -0x88(%rbp), %rdi
callq 0xbb98
leaq -0x89(%rbp), %rdi
callq 0xb600
jmp 0x32135
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x32124
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x88(%rbp), %rdi
callq 0xbb98
leaq -0x89(%rbp), %rdi
callq 0xb600
jmp 0x32b06
addq $0x480, %rsp            # imm = 0x480
popq %rbp
retq
movq -0x3f0(%rbp), %rdi
movq 0xa8(%rdi), %rax
addq $0x10, %rax
movq %rax, -0x420(%rbp)
addq $0x50, %rdi
movq %rdi, -0x430(%rbp)
callq 0x332c0
movq %rax, -0x428(%rbp)
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
callq 0xb1f0
movq -0x430(%rbp), %rdi
movq %rax, %rcx
movq -0x428(%rbp), %rax
subq %rcx, %rax
movq %rax, -0xa8(%rbp)
callq 0x332e0
movq %rax, -0xb0(%rbp)
leaq -0xa0(%rbp), %rdi
movq %rdi, -0x418(%rbp)
leaq -0xa8(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
callq 0x33240
movq -0x420(%rbp), %rdi
movq -0x418(%rbp), %rsi
callq 0x331c0
jmp 0x321d8
leaq -0xa0(%rbp), %rdi
callq 0x33300
jmp 0x32b01
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x33300
jmp 0x32b06
movq -0x3f0(%rbp), %rdi
callq 0x33060
movq -0x3f0(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xc0(%rbp), %rcx
movq -0xb8(%rbp), %r8
movl $0x6, %edx
callq 0x33320
testb $0x1, %al
jne 0x32335
movq -0x3f0(%rbp), %rsi
addq $0x48, %rsi
leaq -0x120(%rbp), %rdi
movq %rdi, -0x438(%rbp)
callq 0x34da0
movq -0x438(%rbp), %rdx
leaq 0x9048e(%rip), %rsi     # 0xc270d
leaq -0x100(%rbp), %rdi
callq 0x34d50
jmp 0x3228d
leaq 0x9301c(%rip), %rdx     # 0xc52b0
leaq -0xe0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x1fa80
jmp 0x322a9
movq -0x3f0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x330f0
jmp 0x322be
leaq -0xe0(%rbp), %rdi
callq 0xbb98
leaq -0x100(%rbp), %rdi
callq 0xbb98
leaq -0x120(%rbp), %rdi
callq 0xbb98
jmp 0x32335
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x32324
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x32318
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0xbb98
leaq -0x100(%rbp), %rdi
callq 0xbb98
leaq -0x120(%rbp), %rdi
callq 0xbb98
jmp 0x32b06
movq -0x3f0(%rbp), %rax
cmpl $0x6, 0x48(%rax)
je 0x32428
movq -0x3f0(%rbp), %rsi
addq $0x48, %rsi
leaq -0x180(%rbp), %rdi
movq %rdi, -0x440(%rbp)
callq 0x34da0
movq -0x440(%rbp), %rdx
leaq 0x903b5(%rip), %rsi     # 0xc2727
leaq -0x160(%rbp), %rdi
callq 0x34d50
jmp 0x32380
leaq 0x92f29(%rip), %rdx     # 0xc52b0
leaq -0x140(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x1fa80
jmp 0x3239c
movq -0x3f0(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x330f0
jmp 0x323b1
leaq -0x140(%rbp), %rdi
callq 0xbb98
leaq -0x160(%rbp), %rdi
callq 0xbb98
leaq -0x180(%rbp), %rdi
callq 0xbb98
jmp 0x32428
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x32417
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3240b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x140(%rbp), %rdi
callq 0xbb98
leaq -0x160(%rbp), %rdi
callq 0xbb98
leaq -0x180(%rbp), %rdi
callq 0xbb98
jmp 0x32b06
jmp 0x32b01
movq -0x3f0(%rbp), %rdi
callq 0x33060
movq -0x3f0(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rax
movq %rax, -0x190(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x190(%rbp), %rcx
movq -0x188(%rbp), %r8
movl $0x4, %edx
callq 0x33320
testb $0x1, %al
jne 0x3255c
movq -0x3f0(%rbp), %rsi
addq $0x48, %rsi
leaq -0x1f0(%rbp), %rdi
movq %rdi, -0x448(%rbp)
callq 0x34da0
movq -0x448(%rbp), %rdx
leaq 0x90267(%rip), %rsi     # 0xc270d
leaq -0x1d0(%rbp), %rdi
callq 0x34d50
jmp 0x324b4
leaq 0x92df5(%rip), %rdx     # 0xc52b0
leaq -0x1b0(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x1fa80
jmp 0x324d0
movq -0x3f0(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x330f0
jmp 0x324e5
leaq -0x1b0(%rbp), %rdi
callq 0xbb98
leaq -0x1d0(%rbp), %rdi
callq 0xbb98
leaq -0x1f0(%rbp), %rdi
callq 0xbb98
jmp 0x3255c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3254b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3253f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0xbb98
leaq -0x1d0(%rbp), %rdi
callq 0xbb98
leaq -0x1f0(%rbp), %rdi
callq 0xbb98
jmp 0x32b06
movq -0x3f0(%rbp), %rax
cmpl $0x4, 0x48(%rax)
je 0x32660
movq -0x3f0(%rbp), %rax
cmpl $0x22, 0x48(%rax)
je 0x32660
movq -0x3f0(%rbp), %rsi
addq $0x48, %rsi
leaq -0x250(%rbp), %rdi
movq %rdi, -0x450(%rbp)
callq 0x34da0
movq -0x450(%rbp), %rdx
leaq 0x9019d(%rip), %rsi     # 0xc2747
leaq -0x230(%rbp), %rdi
callq 0x34d50
jmp 0x325b8
leaq 0x92cf1(%rip), %rdx     # 0xc52b0
leaq -0x210(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x1fa80
jmp 0x325d4
movq -0x3f0(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x330f0
jmp 0x325e9
leaq -0x210(%rbp), %rdi
callq 0xbb98
leaq -0x230(%rbp), %rdi
callq 0xbb98
leaq -0x250(%rbp), %rdi
callq 0xbb98
jmp 0x32660
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3264f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x32643
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x210(%rbp), %rdi
callq 0xbb98
leaq -0x230(%rbp), %rdi
callq 0xbb98
leaq -0x250(%rbp), %rdi
callq 0xbb98
jmp 0x32b06
jmp 0x32b01
movq -0x3f0(%rbp), %rdi
callq 0x33060
movq -0x3f0(%rbp), %rdi
addq $0x50, %rdi
callq 0x332c0
movq %rax, -0x460(%rbp)
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
callq 0xb1f0
movq %rax, %rcx
movq -0x460(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x268(%rbp)
leaq -0x260(%rbp), %rdi
movq %rdi, -0x458(%rbp)
leaq -0x268(%rbp), %rsi
callq 0x34f30
movq -0x3f0(%rbp), %rax
movq -0x458(%rbp), %rsi
movq 0xa8(%rax), %rdi
addq $0x10, %rdi
callq 0x34fa0
jmp 0x326e3
leaq -0x260(%rbp), %rdi
callq 0x35020
movq -0x3f0(%rbp), %rdi
movq %rax, 0xb0(%rdi)
movq -0x20(%rbp), %rsi
movl $0x2, %edx
callq 0x35040
movb %al, -0x461(%rbp)
jmp 0x32713
movb -0x461(%rbp), %al
testb $0x1, %al
jne 0x32811
jmp 0x32723
movq -0x3f0(%rbp), %rsi
addq $0x48, %rsi
leaq -0x2c8(%rbp), %rdi
callq 0x34da0
jmp 0x3273c
leaq 0x90029(%rip), %rsi     # 0xc276c
leaq -0x2a8(%rbp), %rdi
leaq -0x2c8(%rbp), %rdx
callq 0x34d50
jmp 0x32758
leaq 0x92b51(%rip), %rdx     # 0xc52b0
leaq -0x288(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0x1fa80
jmp 0x32774
movq -0x3f0(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0x330f0
jmp 0x32789
leaq -0x288(%rbp), %rdi
callq 0xbb98
leaq -0x2a8(%rbp), %rdi
callq 0xbb98
leaq -0x2c8(%rbp), %rdi
callq 0xbb98
jmp 0x32811
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3290d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x32800
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x327f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x288(%rbp), %rdi
callq 0xbb98
leaq -0x2a8(%rbp), %rdi
callq 0xbb98
leaq -0x2c8(%rbp), %rdi
callq 0xbb98
jmp 0x3290d
movq -0x3f0(%rbp), %rax
cmpl $0x2, 0x48(%rax)
je 0x328fc
movq -0x3f0(%rbp), %rsi
addq $0x48, %rsi
leaq -0x328(%rbp), %rdi
callq 0x34da0
jmp 0x3283b
leaq 0x8ff45(%rip), %rsi     # 0xc2787
leaq -0x308(%rbp), %rdi
leaq -0x328(%rbp), %rdx
callq 0x34d50
jmp 0x32857
leaq 0x92a52(%rip), %rdx     # 0xc52b0
leaq -0x2e8(%rbp), %rdi
leaq -0x308(%rbp), %rsi
callq 0x1fa80
jmp 0x32873
movq -0x3f0(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
callq 0x330f0
jmp 0x32888
leaq -0x2e8(%rbp), %rdi
callq 0xbb98
leaq -0x308(%rbp), %rdi
callq 0xbb98
leaq -0x328(%rbp), %rdi
callq 0xbb98
jmp 0x328fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x328ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x328e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0xbb98
leaq -0x308(%rbp), %rdi
callq 0xbb98
leaq -0x328(%rbp), %rdi
callq 0xbb98
jmp 0x3290d
leaq -0x260(%rbp), %rdi
callq 0x366e0
jmp 0x32b01
leaq -0x260(%rbp), %rdi
callq 0x366e0
jmp 0x32b06
movq -0x3f0(%rbp), %rdi
callq 0x33060
movq -0x3f0(%rbp), %rax
cmpl $0x8, 0x48(%rax)
je 0x32a1d
movq -0x3f0(%rbp), %rsi
addq $0x48, %rsi
leaq -0x388(%rbp), %rdi
movq %rdi, -0x470(%rbp)
callq 0x34da0
movq -0x470(%rbp), %rdx
leaq 0x8fe41(%rip), %rsi     # 0xc27a8
leaq -0x368(%rbp), %rdi
callq 0x34d50
jmp 0x32975
leaq 0x92934(%rip), %rdx     # 0xc52b0
leaq -0x348(%rbp), %rdi
leaq -0x368(%rbp), %rsi
callq 0x1fa80
jmp 0x32991
movq -0x3f0(%rbp), %rdi
leaq -0x348(%rbp), %rsi
callq 0x330f0
jmp 0x329a6
leaq -0x348(%rbp), %rdi
callq 0xbb98
leaq -0x368(%rbp), %rdi
callq 0xbb98
leaq -0x388(%rbp), %rdi
callq 0xbb98
jmp 0x32a1d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x32a0c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x32a00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x348(%rbp), %rdi
callq 0xbb98
leaq -0x368(%rbp), %rdi
callq 0xbb98
leaq -0x388(%rbp), %rdi
callq 0xbb98
jmp 0x32b06
jmp 0x32b01
movq -0x3f0(%rbp), %rsi
addq $0x48, %rsi
leaq -0x3e8(%rbp), %rdi
movq %rdi, -0x478(%rbp)
callq 0x34da0
movq -0x478(%rbp), %rdx
leaq 0x8fd78(%rip), %rsi     # 0xc27c6
leaq -0x3c8(%rbp), %rdi
callq 0x34d50
jmp 0x32a5c
leaq 0x9284d(%rip), %rdx     # 0xc52b0
leaq -0x3a8(%rbp), %rdi
leaq -0x3c8(%rbp), %rsi
callq 0x1fa80
jmp 0x32a78
movq -0x3f0(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
callq 0x330f0
jmp 0x32a8d
leaq -0x3a8(%rbp), %rdi
callq 0xbb98
leaq -0x3c8(%rbp), %rdi
callq 0xbb98
leaq -0x3e8(%rbp), %rdi
callq 0xbb98
jmp 0x32b01
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x32af3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x32ae7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x3a8(%rbp), %rdi
callq 0xbb98
leaq -0x3c8(%rbp), %rdi
callq 0xbb98
leaq -0x3e8(%rbp), %rdi
callq 0xbb98
jmp 0x32b06
jmp 0x31fac
movq -0x60(%rbp), %rdi
callq 0xba60
nop