// File: /workspace/github_cpp_makefile_star2_O2/cyamonide[P]md2html/./src/md2html.cpp
// Function: Md2html::resolveNextLine()
void Md2html::resolveNextLine()
{
    smatch match;
    string* line = &buffer[0];
    string* lastLine = &buffer[1];

    if (!regex_match(*line, R_CODEBLOCK_FENCED) && !state.empty() && state.top().type == "pre")
    { // <pre> codeblock is active
        // Take this line at face value
    }
    else if (regex_match(*line, R_HEADING))
    { // Heading matched using #'s
        // Close all open tags
        closeAllTags();
        // Count #'s to determine heading level
        regex_search(*line, match, regex("#{1,6}"));
        int heading_level = match.str().length();
        // Write tag
        *line = wrapTags("h" + to_string(heading_level),
                          resolveInline(line->substr(heading_level + 1)));
    }
    else if (regex_match(*line, R_HEADING_ALT))
    { // Alternate heading matched, e.g. === or ---
        // Determine if previous line was heading-compatible
        if (regex_match(*lastLine, regex("<p>.*")))
        { // Parsed as <p> (compatible)
            // Remove <p> state
            state.pop();
            // Strip <p> open tag from previous line
            *lastLine = lastLine->substr(3, lastLine->length());
            // Write first or second level heading
            string tag = (*line)[0]=='='?"h1":"h2";
            *lastLine = wrapTags(tag, lastLine->substr(3, lastLine->length() - 7));
            // Remove line of = or -
            buffer.pop_front();
            // Close all open tags
            closeAllTags();
        }
        else if (!state.empty() && state.top().type == "p")
        { // Paragraph tag already open
            // Continue paragraph
            *lastLine += " " + *line;
            buffer.pop_front();
        }
        else
        { // Line on its own
            // Start a new paragraph
            *line = ot("p") + *line;
            state.push({"p"});
        }
    }
    else if (regex_match(*line, R_ORDERED))
    { // Ordered list matched, e.g. 1. 2. 3. 
        resolveList("ol");
    }
    else if (regex_match(*line, R_UNORDERED))
    { // Unordered list matched, e.g. bullets - * +
        resolveList("ul");
    }
    else if (regex_match(*line, R_CODEBLOCK_TABBED))
    { // Tabbed codelock matched
        if (state.empty() || state.top().type != "pre")
        { // No <pre> codeblock open
            // Open pre tag
            *line = ot("pre") + *line;
            state.push({"pre"});
        }
        else
        { // <pre> codeblock already open
            // Do nothing
        }
    }
    else if (regex_match(*line, R_CODEBLOCK_FENCED))
    { // Fenced codeblock matched, i.e. ``` or ~~~
        // Find language for syntax highlighting support
        string lang = line->substr(3);

        if (state.empty() || state.top().type != "pre")
        { // No <pre> codeblock open
            *line = ot("pre");
            state.push({"pre"});
        }
        else
        { // <pre> codbelock already open
            // Close <pre> tag
            *line = ct("pre");
            state.pop();
        }
    }
    else if (regex_match(*line, R_HTML_TAG))
    { // HTML tag by itself
        // Do nothing
    }
    else if (regex_match(*line, R_HORIZONTAL_RULE))
    { // Horizontal rule matched, i.e. *** --- ===
        *line = "<hr>";
    }
    else if (regex_match(*line, regex("\\s*")))
    { // Blank line matched
        // Close all tags
        closeAllTags();
    }
    else
    { // Line by itself with no particular syntax
        if (!state.empty())
        { // Tags still open
            // Append this line to previous line
            *lastLine += " " + resolveInline(*line);
            buffer.pop_front();
        }
        else
        { // No tags open (state empty)
            // Start new paragraph
            *line = ot("p") + resolveInline(*line);
            state.push({"p"});
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x250, %rsp            # imm = 0x250
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
leaq 0x10(%rdi), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x1506a
movq %rax, %r14
pushq $0x1
popq %rsi
movq %r15, %rdi
callq 0x1506a
movq %rax, %r15
leaq 0x10726(%rip), %rsi     # 0x22dc0
movq %r14, %rdi
xorl %edx, %edx
callq 0xfdd4
testb %al, %al
jne 0x126e6
movq 0x80(%rbx), %rdi
cmpq 0x60(%rbx), %rdi
je 0x126e6
cmpq 0x88(%rbx), %rdi
jne 0x126ce
movq 0x98(%rbx), %rax
movl $0x1e0, %edi            # imm = 0x1E0
addq -0x8(%rax), %rdi
addq $-0x28, %rdi
leaq 0x4a40(%rip), %rsi      # 0x17119
callq 0x94e5
testb %al, %al
jne 0x12ac4
leaq 0x10613(%rip), %rsi     # 0x22d00
movq %r14, %rdi
xorl %edx, %edx
callq 0xfdd4
testb %al, %al
je 0x127ff
movq %rbx, %rdi
callq 0x124a6
leaq 0x4a0f(%rip), %rsi      # 0x1711d
movq %rsp, %rdi
pushq $0x10
popq %rdx
callq 0x5128
leaq 0x70(%rsp), %rsi
movq %rsp, %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xfdeb
movq %rsp, %rdi
callq 0x518e
movq %rsp, %rdi
leaq 0x70(%rsp), %rsi
xorl %edx, %edx
callq 0xfe18
movq %rsp, %rdi
movq 0x8(%rdi), %rbx
callq 0x4548
leaq 0x30(%rsp), %rdi
movl %ebx, %esi
callq 0x144bc
leaq 0x3ee7(%rip), %rsi      # 0x16648
leaq 0x230(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x14498
incl %ebx
movslq %ebx, %rdx
leaq 0x1f0(%rsp), %rdi
pushq $-0x1
popq %rcx
movq %r14, %rsi
callq 0x4300
leaq 0x210(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
callq 0xf459
movq %rsp, %rdi
leaq 0x230(%rsp), %rsi
leaq 0x210(%rsp), %rdx
callq 0xec42
movq %rsp, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4370
movq %rbx, %rdi
callq 0x4548
leaq 0x210(%rsp), %rdi
callq 0x4548
leaq 0x1f0(%rsp), %rdi
callq 0x4548
leaq 0x230(%rsp), %rdi
callq 0x4548
leaq 0x30(%rsp), %rdi
jmp 0x12abf
leaq 0x1051a(%rip), %rsi     # 0x22d20
movq %r14, %rdi
xorl %edx, %edx
callq 0xfdd4
testb %al, %al
je 0x1292f
leaq 0x4905(%rip), %rsi      # 0x17124
movq %rsp, %rdi
pushq $0x10
popq %rdx
callq 0x5128
movq %rsp, %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0xfdd4
movl %eax, %ebp
movq %rsp, %rdi
callq 0x518e
leaq 0x50(%rbx), %r12
testb %bpl, %bpl
je 0x129c5
movq %r12, %rdi
callq 0x1500a
movq 0x8(%r15), %rcx
movq %rsp, %rdi
pushq $0x3
popq %rdx
movq %r15, %rsi
callq 0x4300
movq %rsp, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x4370
movq %r12, %rdi
callq 0x4548
movq (%r14), %rax
cmpb $0x3d, (%rax)
leaq 0x489f(%rip), %rax      # 0x1712a
leaq 0x489b(%rip), %rsi      # 0x1712d
cmoveq %rax, %rsi
movq %rsp, %rdi
leaq 0x30(%rsp), %rdx
callq 0x51a8
leaq 0x1d0(%rsp), %rdi
movq %rsp, %rsi
callq 0x43b0
movq 0x8(%r15), %rcx
addq $-0x7, %rcx
leaq 0x1b0(%rsp), %rdi
pushq $0x3
popq %rdx
movq %r15, %rsi
callq 0x4300
leaq 0x30(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
leaq 0x1b0(%rsp), %rdx
callq 0xec42
leaq 0x30(%rsp), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x4370
movq %r14, %rdi
callq 0x4548
leaq 0x1b0(%rsp), %rdi
callq 0x4548
leaq 0x1d0(%rsp), %rdi
callq 0x4548
movq %rbx, %rdi
callq 0x14516
movq %rbx, %rdi
callq 0x124a6
jmp 0x12abc
leaq 0x1040a(%rip), %rsi     # 0x22d40
movq %r14, %rdi
xorl %edx, %edx
callq 0xfdd4
testb %al, %al
je 0x12978
leaq 0x46fa(%rip), %rsi      # 0x17045
leaq 0x170(%rsp), %rdi
movq %rsp, %rdx
callq 0x51a8
leaq 0x170(%rsp), %rsi
movq %rbx, %rdi
callq 0x13258
leaq 0x170(%rsp), %rdi
jmp 0x12abf
leaq 0x103e1(%rip), %rsi     # 0x22d60
movq %r14, %rdi
xorl %edx, %edx
callq 0xfdd4
testb %al, %al
je 0x12ade
leaq 0x46b0(%rip), %rsi      # 0x17048
leaq 0x150(%rsp), %rdi
movq %rsp, %rdx
callq 0x51a8
leaq 0x150(%rsp), %rsi
movq %rbx, %rdi
callq 0x13258
leaq 0x150(%rsp), %rdi
jmp 0x12abf
movq 0x80(%rbx), %rdi
cmpq 0x60(%rbx), %rdi
je 0x12a31
cmpq 0x88(%rbx), %rdi
jne 0x129eb
movq 0x98(%rbx), %rax
movl $0x1e0, %edi            # imm = 0x1E0
addq -0x8(%rax), %rdi
addq $-0x28, %rdi
leaq 0x3fa6(%rip), %rsi      # 0x1699c
callq 0x94e5
testb %al, %al
je 0x12a31
leaq 0x46ef(%rip), %rsi      # 0x170f5
movq %rsp, %rdi
movq %r14, %rdx
callq 0xed70
movq %rsp, %rsi
movq %r15, %rdi
callq 0x4510
movq %rsp, %rdi
callq 0x4548
movq %rbx, %rdi
callq 0x14516
jmp 0x12ac4
leaq 0x3f64(%rip), %rsi      # 0x1699c
leaq 0x190(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x51a8
leaq 0x30(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0xeb88
movq %rsp, %rdi
leaq 0x30(%rsp), %rsi
movq %r14, %rdx
callq 0xee4d
movq %rsp, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4370
movq %rbx, %rdi
callq 0x4548
leaq 0x30(%rsp), %rdi
callq 0x4548
leaq 0x190(%rsp), %rdi
callq 0x4548
leaq 0x3efc(%rip), %rsi      # 0x1699c
movq %rsp, %rdi
leaq 0x30(%rsp), %rdx
callq 0x51a8
movq %rsp, %rsi
andl $0x0, 0x20(%rsi)
movq %r12, %rdi
callq 0x15150
movq %rsp, %rdi
callq 0x4548
leaq 0x70(%rsp), %rdi
callq 0xfe38
addq $0x250, %rsp            # imm = 0x250
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x102fb(%rip), %rsi     # 0x22de0
movq %r14, %rdi
xorl %edx, %edx
callq 0xfdd4
testb %al, %al
je 0x12bc5
movq 0x80(%rbx), %rdi
cmpq 0x60(%rbx), %rdi
je 0x12b31
cmpq 0x88(%rbx), %rdi
jne 0x12b1d
movq 0x98(%rbx), %rax
movl $0x1e0, %edi            # imm = 0x1E0
addq -0x8(%rax), %rdi
addq $-0x28, %rdi
leaq 0x45f1(%rip), %rsi      # 0x17119
callq 0x14540
testb %al, %al
je 0x12ac4
leaq 0x45e1(%rip), %rsi      # 0x17119
leaq 0x130(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x51a8
leaq 0x30(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0xeb88
movq %rsp, %rdi
leaq 0x30(%rsp), %rsi
movq %r14, %rdx
callq 0xee4d
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x4370
movq %r15, %rdi
callq 0x4548
leaq 0x30(%rsp), %rdi
callq 0x4548
leaq 0x130(%rsp), %rdi
callq 0x4548
leaq 0x4579(%rip), %rsi      # 0x17119
movq %rsp, %rdi
leaq 0x30(%rsp), %rdx
callq 0x51a8
addq $0x50, %rbx
movq %rsp, %rsi
andl $0x0, 0x20(%rsi)
movq %rbx, %rdi
callq 0x15150
jmp 0x12abc
leaq 0x101f4(%rip), %rsi     # 0x22dc0
movq %r14, %rdi
xorl %edx, %edx
callq 0xfdd4
testb %al, %al
je 0x12caa
leaq 0x30(%rsp), %rdi
pushq $0x3
popq %rdx
pushq $-0x1
popq %rcx
movq %r14, %rsi
callq 0x4300
leaq 0x50(%rbx), %r15
movq 0x80(%rbx), %rdi
cmpq 0x60(%rbx), %rdi
je 0x12c33
cmpq 0x88(%rbx), %rdi
jne 0x12c1b
movq 0x98(%rbx), %rax
movl $0x1e0, %edi            # imm = 0x1E0
addq -0x8(%rax), %rdi
addq $-0x28, %rdi
leaq 0x44f3(%rip), %rsi      # 0x17119
callq 0x14540
testb %al, %al
je 0x12cec
leaq 0x44df(%rip), %rsi      # 0x17119
leaq 0x110(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x51a8
movq %rsp, %rdi
leaq 0x110(%rsp), %rsi
callq 0xeb88
movq %rsp, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4370
movq %rbx, %rdi
callq 0x4548
leaq 0x110(%rsp), %rdi
callq 0x4548
leaq 0x4493(%rip), %rsi      # 0x17119
movq %rsp, %rdi
leaq 0x50(%rsp), %rdx
callq 0x51a8
movq %rsp, %rsi
andl $0x0, 0x20(%rsi)
movq %r15, %rdi
callq 0x15150
movq %rsp, %rdi
jmp 0x127f0
leaq 0x100cf(%rip), %rsi     # 0x22d80
movq %r14, %rdi
xorl %edx, %edx
callq 0xfdd4
testb %al, %al
jne 0x12ac4
leaq 0x100d6(%rip), %rsi     # 0x22da0
movq %r14, %rdi
xorl %edx, %edx
callq 0xfdd4
testb %al, %al
je 0x12d45
leaq 0x4451(%rip), %rsi      # 0x17130
movq %r14, %rdi
callq 0x4500
jmp 0x12ac4
leaq 0x4426(%rip), %rsi      # 0x17119
leaq 0xf0(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x51a8
movq %rsp, %rdi
leaq 0xf0(%rsp), %rsi
callq 0xebe5
movq %rsp, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4370
movq %rbx, %rdi
callq 0x4548
leaq 0xf0(%rsp), %rdi
callq 0x4548
movq %r15, %rdi
callq 0x1500a
jmp 0x127f5
leaq 0x3468(%rip), %rsi      # 0x161b4
movq %rsp, %rdi
pushq $0x10
popq %rdx
callq 0x5128
movq %rsp, %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0xfdd4
movl %eax, %ebp
movq %rsp, %rdi
callq 0x518e
testb %bpl, %bpl
je 0x12d80
movq %rbx, %rdi
callq 0x124a6
jmp 0x12ac4
movq 0x80(%rbx), %rax
cmpq 0x60(%rbx), %rax
je 0x12ded
leaq 0xd0(%rsp), %rdi
movq %r14, %rsi
callq 0x43b0
leaq 0x30(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0xf459
leaq 0x433f(%rip), %rsi      # 0x170f5
movq %rsp, %rdi
leaq 0x30(%rsp), %rdx
callq 0x14498
movq %rsp, %rsi
movq %r15, %rdi
callq 0x4510
movq %rsp, %rdi
callq 0x4548
leaq 0x30(%rsp), %rdi
callq 0x4548
leaq 0xd0(%rsp), %rdi
jmp 0x12a1f
leaq 0x3ba8(%rip), %rsi      # 0x1699c
leaq 0xb0(%rsp), %rdi
leaq 0x2f(%rsp), %rdx
callq 0x51a8
leaq 0x30(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0xeb88
leaq 0x90(%rsp), %rdi
movq %r14, %rsi
callq 0x43b0
leaq 0x50(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0xf459
movq %rsp, %rdi
leaq 0x30(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0xede6
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x4370
movq %r15, %rdi
callq 0x4548
leaq 0x50(%rsp), %rdi
callq 0x4548
leaq 0x90(%rsp), %rdi
callq 0x4548
leaq 0x30(%rsp), %rdi
callq 0x4548
leaq 0xb0(%rsp), %rdi
callq 0x4548
leaq 0x3b05(%rip), %rsi      # 0x1699c
movq %rsp, %rdi
leaq 0x30(%rsp), %rdx
callq 0x51a8
addq $0x50, %rbx
movq %rsp, %rsi
andl $0x0, 0x20(%rsi)
movq %rbx, %rdi
callq 0x15150
jmp 0x12abc
jmp 0x13020
jmp 0x13097
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x4548
jmp 0x12ed8
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x4548
jmp 0x12eea
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x4548
jmp 0x12ef9
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
jmp 0x1307d
jmp 0x13097
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4548
jmp 0x12f1b
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x4548
jmp 0x12f2a
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
jmp 0x1307d
jmp 0x13097
jmp 0x13088
jmp 0x13097
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
jmp 0x1306e
jmp 0x13075
movq %rax, %rbx
movq %rsp, %rdi
jmp 0x1306e
jmp 0x13075
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
jmp 0x1306e
jmp 0x13075
jmp 0x13097
jmp 0x13020
jmp 0x13097
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x4548
jmp 0x12fa1
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
jmp 0x1307d
jmp 0x13097
jmp 0x13020
jmp 0x13097
movq %rax, %rbx
leaq 0x150(%rsp), %rdi
jmp 0x1307d
jmp 0x13097
jmp 0x13020
jmp 0x13097
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x4548
jmp 0x12fe8
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
jmp 0x1307d
jmp 0x13097
jmp 0x13020
movq %rax, %rbx
leaq 0x1b0(%rsp), %rdi
callq 0x4548
jmp 0x13011
movq %rax, %rbx
leaq 0x1d0(%rsp), %rdi
callq 0x4548
jmp 0x13023
movq %rax, %rbx
movq %rsp, %rdi
jmp 0x1307d
jmp 0x13097
movq %rax, %rbx
leaq 0x170(%rsp), %rdi
jmp 0x1307d
jmp 0x13097
jmp 0x13097
jmp 0x13088
jmp 0x13097
movq %rax, %rbx
leaq 0x210(%rsp), %rdi
callq 0x4548
jmp 0x13054
movq %rax, %rbx
leaq 0x1f0(%rsp), %rdi
callq 0x4548
jmp 0x13066
movq %rax, %rbx
leaq 0x230(%rsp), %rdi
callq 0x4548
jmp 0x13078
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x4548
jmp 0x1309a
jmp 0x13097
jmp 0x13097
movq %rax, %rbx
movq %rsp, %rdi
callq 0x518e
jmp 0x1309a
jmp 0x13097
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0xfe38
movq %rbx, %rdi
callq 0x44a0