// File: /workspace/github_cpp_makefile_star2_O1/margual56[P]Markdown-CLI/src/markdown.cpp
// Function: markdown(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string markdown(std::string markdown){
    std::smatch match;  // Match object (stores match information)

    ////////////////////////////// HEADERS //////////////////////////////////////
    std::regex headers("#+[^\\r\\n]+(\\r|\\n|\\r\\n)"); // Regex for the headers

    while (std::regex_search (markdown, match, headers)) {

        int match_begin = match.position();
        int match_end   = match_begin + match.length();

        printf("Processing match: %s", markdown.substr(match_begin, match.length()).c_str());

        int j;
        for(j = 0; markdown[j+match_begin]=='#'; j++){}     // So count the number of '#' in a row,


        markdown.insert(match_end, "</h" + std::to_string(j) + "><hr/>");
        markdown.replace(match_begin, j, "<h" + std::to_string(j) + ">");
    }
    
    //////////////////////////////// LINKS //////////////////////////////////////
    std::regex links("\\[[^\\n\\r]*\\]\\([^\\n\\r]*\\)"); // Regex for the headers
    std::regex linkHref("\\([^\\n\\r]*\\)");

    std::smatch match2;  // Match object (stores match information)
    while (std::regex_search (markdown, match, links)) {

        int match_begin = match.position();
        int match_end   = match_begin + match.length();
        
        std::string text = "";
        std::string link = "";

        int i, count;
        for(i = match_begin+1, count = 1; count > 0; i++){
            char c = markdown[i];

            if(c == '[') count++;
            else if(c == ']') count--;

            if(count > 0) text += c;
        }

        for(i += 1, count = 1; count > 0; i++){
            char c = markdown[i];

            if(c == '(') count++;
            else if(c == ')') count--;

            if(count > 0) link += c;
        }

        std::string finalLink = "<a href=\"" + link + "\">" + text + "</a>";

        printf("Processing link: %s", finalLink.c_str());
        markdown.replace(match_begin, match.length(), finalLink);
    }

    ////////////////////////// OTHER TOKENS ////////////////////////////////////
    //token{"[^\\r\\n]+((\\r|\\n|\\r\\n)[^\\r\\n]+)*",0,2,  "p"}       // Paragraphs regex

    std::list<token> tokens = {
        token{"`[^`\\n]+`",                             1,1,  "code"},   // Code tag regex
        token{"(\\*){2}[^(\\*){2}\\r\\n]+(\\*){2}",     2,2,  "b"},      // Bold tag regex    (**)
        token{"(_){2}[^(_){2}\\r\\n]+(_){2}",           2,2,  "b"},      // Bold tag regex    (__)
        token{"\\*[^\\*\\r\\n]+\\*",                    1,1,  "i"},      // Italic tag regex  (*)
        token{"_[^\\*\\r\\n]+_",                        1,1,  "i"}      // Italic tag regex  (_)
    };

    for(token tok: tokens){
        printf("Checking for %s\n", tok.tag.c_str());
        std::regex tmp(tok.rex);
        
        int match_end, match_begin;
        while (std::regex_search (markdown, match, tmp)) {
            match_begin = match.position();
            match_end   = match_begin + match.length();

            printf("Processing match: %s\n", markdown.substr(match_begin, match.length()).c_str());

            markdown.replace(match_end-tok.length2, tok.length2, "</" + tok.tag + ">");
            markdown.replace(match_begin, tok.length1, "<" + tok.tag + ">");
        }

        printf("Done checking %s\n", tok.tag.c_str());
    }

    ////////////////////////////// LINE BREAKS ///////////////////////////////////
    for(int i = 0; i<markdown.length(); i++){
        if(markdown[i] == '\n'){
            markdown.insert(i, "<br/>");
            i+=6;
        }
    }

    return markdown;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
movq %rsi, %rbx
movq %rdi, -0x120(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0xc0(%rbp)
movaps %xmm0, -0xd0(%rbp)
leaq 0x10132(%rip), %rsi     # 0x16278
leaq -0x2d0(%rbp), %rdi
movl $0x10, %edx
callq 0x73f4
movq %rbx, -0x30(%rbp)
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
addq %rdi, %rsi
leaq -0xd0(%rbp), %rdx
leaq -0x2d0(%rbp), %rcx
xorl %r8d, %r8d
callq 0x12e64
testb %al, %al
je 0x65d2
movq -0xd0(%rbp), %rax
movq -0xc8(%rbp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
leaq -0x48(%rcx), %rsi
cmpq $0x48, %rdx
movq %rax, %rdx
cmoveq %rsi, %rdx
cmpq %rax, %rcx
cmoveq %rsi, %rdx
movq %rbx, %rsi
movq (%rdx), %rbx
movq 0x8(%rdx), %r13
subq %rbx, %r13
subq -0xb8(%rbp), %rbx
cmpb $0x0, 0x10(%rdx)
movl $0x0, %eax
cmoveq %rax, %r13
movslq %ebx, %r15
movq 0x8(%rdx), %rcx
subq (%rdx), %rcx
cmpb $0x0, 0x10(%rdx)
cmoveq %rax, %rcx
leaq -0x288(%rbp), %rdi
movq %r15, %rdx
callq 0x42e0
movq %r15, -0xf8(%rbp)
movq -0x288(%rbp), %rsi
leaq 0x1008b(%rip), %rdi     # 0x1628f
xorl %eax, %eax
callq 0x4050
movq -0x288(%rbp), %rdi
leaq -0x278(%rbp), %rax
cmpq %rax, %rdi
je 0x622d
movq -0x278(%rbp), %rsi
incq %rsi
callq 0x42b0
addq %rbx, %r13
movslq %ebx, %rax
movq -0x30(%rbp), %rcx
addq (%rcx), %rax
movq $-0x1, %r12
cmpb $0x23, 0x1(%rax,%r12)
leaq 0x1(%r12), %r12
je 0x6241
movl $0x1, %ebx
cmpq $0xa, %r12
leaq -0xb0(%rbp), %r15
jb 0x62a2
movl $0x4, %ebx
movl %r12d, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0x629b
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x62a0
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x62a2
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebx
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x626d
addl $-0x3, %ebx
jmp 0x62a2
addl $-0x2, %ebx
jmp 0x62a2
decl %ebx
movl %ebx, %esi
leaq -0xa0(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq %r15, %rdi
movl $0x2d, %edx
callq 0x4350
movq -0xb0(%rbp), %rdi
movl %ebx, %esi
movl %r12d, %edx
callq 0x7577
movl $0x3, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0xffc0(%rip), %rcx      # 0x162a4
callq 0x4310
leaq -0x80(%rbp), %rbx
movq %rbx, -0x90(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6313
movq %rdx, -0x90(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x80(%rbp)
jmp 0x6319
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, -0x88(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x90(%rbp), %rdi
leaq 0xff67(%rip), %rsi      # 0x162a8
callq 0x4510
leaq -0x278(%rbp), %rsi
movq %rsi, -0x288(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6376
movq %rdx, -0x288(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x278(%rbp)
jmp 0x637c
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movslq %r13d, %rsi
movq 0x8(%rax), %rdx
movq %rdx, -0x280(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x288(%rbp), %rcx
movq -0x280(%rbp), %r8
movq -0x30(%rbp), %rdi
xorl %edx, %edx
callq 0x4310
movq -0x288(%rbp), %rdi
leaq -0x278(%rbp), %rax
cmpq %rax, %rdi
leaq -0xa0(%rbp), %r13
je 0x63db
movq -0x278(%rbp), %rsi
incq %rsi
callq 0x42b0
movq -0x90(%rbp), %rdi
cmpq %rbx, %rdi
je 0x63f3
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x42b0
movq -0xb0(%rbp), %rdi
cmpq %r13, %rdi
je 0x640e
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x42b0
movl $0x1, %ebx
cmpq $0xa, %r12
leaq -0xb0(%rbp), %r15
jb 0x6462
movl $0x4, %ebx
movl %r12d, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0x645b
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x6460
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x6462
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebx
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x642d
addl $-0x3, %ebx
jmp 0x6462
addl $-0x2, %ebx
jmp 0x6462
decl %ebx
movl %ebx, %esi
movq %r13, -0xb0(%rbp)
movq %r15, %rdi
movl $0x2d, %edx
callq 0x4350
movq -0xb0(%rbp), %rdi
movl %ebx, %esi
movl %r12d, %edx
callq 0x7577
movl $0x2, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0xfe12(%rip), %rcx      # 0x162af
callq 0x4310
leaq -0x80(%rbp), %rbx
movq %rbx, -0x90(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x64cc
movq %rdx, -0x90(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x80(%rbp)
jmp 0x64d2
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, -0x88(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x90(%rbp), %rdi
leaq 0xfb6f(%rip), %rsi      # 0x16069
callq 0x4510
leaq -0x278(%rbp), %rsi
movq %rsi, -0x288(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x652f
movq %rdx, -0x288(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x278(%rbp)
jmp 0x6535
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movl %r12d, %edx
movq 0x8(%rax), %rsi
movq %rsi, -0x280(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x288(%rbp), %rcx
movq -0x280(%rbp), %r8
movq -0x30(%rbp), %rdi
movq -0xf8(%rbp), %rsi
callq 0x4310
movq -0x288(%rbp), %rdi
leaq -0x278(%rbp), %rax
cmpq %rax, %rdi
je 0x6592
movq -0x278(%rbp), %rsi
incq %rsi
callq 0x42b0
movq -0x90(%rbp), %rdi
cmpq %rbx, %rdi
je 0x65aa
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x42b0
movq -0xb0(%rbp), %rdi
cmpq %r13, %rdi
movq -0x30(%rbp), %rbx
je 0x615b
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x42b0
jmp 0x615b
leaq 0xfcd9(%rip), %rsi      # 0x162b2
leaq -0x90(%rbp), %rdi
movl $0x10, %edx
callq 0x73f4
leaq 0xfccd(%rip), %rsi      # 0x162be
leaq -0xb0(%rbp), %rdi
movl $0x10, %edx
callq 0x73f4
leaq 0xfdd0(%rip), %r13      # 0x163d9
leaq -0x118(%rbp), %rbx
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rsi
addq %rdi, %rsi
leaq -0xd0(%rbp), %rdx
leaq -0x90(%rbp), %rcx
xorl %r8d, %r8d
callq 0x12e64
testb %al, %al
je 0x6992
movq -0xd0(%rbp), %rax
movq -0xc8(%rbp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
leaq -0x48(%rcx), %rsi
cmpq $0x48, %rdx
movq %rax, %rdx
cmoveq %rsi, %rdx
cmpq %rax, %rcx
movq -0xb8(%rbp), %r12
cmoveq %rsi, %rdx
movq (%rdx), %r15
leaq -0x278(%rbp), %rax
movq %rax, -0x288(%rbp)
leaq -0x288(%rbp), %rdi
movq %r13, %rsi
movq %r13, %rdx
callq 0x5002
leaq -0x108(%rbp), %rax
movq %rax, -0x118(%rbp)
movq %rbx, %rdi
movq %r13, %rsi
movq %r13, %rbx
movq %r13, %rdx
callq 0x5002
movq %r15, %rax
subq %r12, %rax
movslq %eax, %r14
movslq %eax, %r13
subl %r12d, %r15d
addl $0x2, %r15d
movl $0x1, %r12d
movq -0x30(%rbp), %rax
movq (%rax), %rax
movzbl 0x1(%rax,%r13), %eax
cmpl $0x5d, %eax
je 0x66e4
cmpl $0x5b, %eax
jne 0x66e7
incl %r12d
jmp 0x66e7
decl %r12d
testl %r12d, %r12d
jle 0x66fb
movsbl %al, %esi
leaq -0x288(%rbp), %rdi
callq 0x4260
incl %r15d
incq %r13
testl %r12d, %r12d
jg 0x66c8
movslq %r15d, %r15
movl $0x1, %r12d
movq %rbx, %r13
leaq -0x118(%rbp), %rbx
movq -0x30(%rbp), %rax
movq (%rax), %rax
movzbl (%rax,%r15), %eax
cmpl $0x29, %eax
je 0x6734
cmpl $0x28, %eax
jne 0x6737
incl %r12d
jmp 0x6737
decl %r12d
testl %r12d, %r12d
jle 0x6747
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4260
incq %r15
testl %r12d, %r12d
jg 0x6719
leaq -0x2b0(%rbp), %r15
movq %r15, %rdi
leaq 0xfb6b(%rip), %rsi      # 0x162cb
movq %rbx, %rdx
callq 0x4ed5
movq %r15, %rdi
leaq 0xf8f6(%rip), %rsi      # 0x16068
callq 0x4510
leaq -0x40(%rbp), %r15
leaq -0xe0(%rbp), %r12
movq %r12, -0xf0(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x67ab
movq %rdx, -0xf0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xe0(%rbp)
jmp 0x67b3
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, -0xe8(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x288(%rbp), %rsi
movq -0x280(%rbp), %rdx
leaq -0xf0(%rbp), %rdi
callq 0x40e0
leaq -0x60(%rbp), %rsi
movq %rsi, -0x70(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x680b
movq %rdx, -0x70(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x60(%rbp)
jmp 0x6811
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, -0x68(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x70(%rbp), %rdi
leaq 0xfaa2(%rip), %rsi      # 0x162d5
callq 0x4510
movq %r15, -0x50(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6858
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x685f
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, -0x48(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x688f
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x42b0
movq -0xf0(%rbp), %rdi
cmpq %r12, %rdi
je 0x68aa
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x42b0
movq -0x2b0(%rbp), %rdi
leaq -0x2a0(%rbp), %rax
cmpq %rax, %rdi
je 0x68cc
movq -0x2a0(%rbp), %rsi
incq %rsi
callq 0x42b0
movq -0x50(%rbp), %rsi
leaq 0xfa03(%rip), %rdi      # 0x162da
xorl %eax, %eax
callq 0x4050
movq -0xd0(%rbp), %rax
movq -0xc8(%rbp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
leaq -0x48(%rcx), %rsi
cmpq $0x48, %rdx
movq %rax, %rdi
cmoveq %rsi, %rdi
cmpq %rax, %rcx
cmoveq %rsi, %rdi
movq 0x8(%rdi), %rdx
subq (%rdi), %rdx
cmpb $0x0, 0x10(%rdi)
movl $0x0, %eax
cmoveq %rax, %rdx
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %r8
movq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0x4310
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x6945
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x42b0
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0x6967
movq -0x108(%rbp), %rsi
incq %rsi
callq 0x42b0
movq -0x288(%rbp), %rdi
leaq -0x278(%rbp), %rax
cmpq %rax, %rdi
je 0x6610
movq -0x278(%rbp), %rsi
incq %rsi
callq 0x42b0
jmp 0x6610
leaq -0x288(%rbp), %r12
leaq -0x278(%rbp), %rax
movq %rax, (%r12)
leaq 0xf943(%rip), %rsi      # 0x162ee
leaq 0xf945(%rip), %rdx      # 0x162f7
movq %r12, %rdi
callq 0x5002
movabsq $0x100000001, %rbx      # imm = 0x100000001
leaq -0x260(%rbp), %rdi
movq %rbx, -0x8(%rdi)
leaq -0x250(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xf917(%rip), %rsi      # 0x162f8
leaq 0xf914(%rip), %rdx      # 0x162fc
callq 0x5002
leaq -0x240(%rbp), %r12
leaq -0x230(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xf8f7(%rip), %rsi      # 0x162fd
leaq 0xf90d(%rip), %rdx      # 0x1631a
movq %r12, %rdi
callq 0x5002
movabsq $0x200000002, %r15      # imm = 0x200000002
leaq -0x218(%rbp), %rdi
movq %r15, -0x8(%rdi)
leaq -0x208(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xfeba(%rip), %rsi      # 0x168f6
leaq 0xfeb4(%rip), %rdx      # 0x168f7
callq 0x5002
leaq -0x1f8(%rbp), %r12
leaq -0x1e8(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0xf8ba(%rip), %rsi      # 0x1631b
leaq 0xf8cd(%rip), %rdx      # 0x16335
movq %r12, %rdi
callq 0x5002
leaq -0x1d0(%rbp), %rdi
movq %r15, -0x8(%rdi)
leaq -0x1c0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xfe69(%rip), %rsi      # 0x168f6
leaq 0xfe63(%rip), %rdx      # 0x168f7
callq 0x5002
leaq -0x1b0(%rbp), %r12
leaq -0x1a0(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xf884(%rip), %rsi      # 0x16336
leaq 0xf88b(%rip), %rdx      # 0x16344
movq %r12, %rdi
callq 0x5002
leaq -0x188(%rbp), %rdi
movq %rbx, -0x8(%rdi)
leaq -0x178(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xf867(%rip), %rsi      # 0x16345
leaq 0xf861(%rip), %rdx      # 0x16346
callq 0x5002
leaq -0x168(%rbp), %r12
leaq -0x158(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0xf844(%rip), %rsi      # 0x16347
leaq 0xf849(%rip), %rdx      # 0x16353
movq %r12, %rdi
callq 0x5002
leaq -0x140(%rbp), %rdi
movq %rbx, -0x8(%rdi)
leaq -0x130(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0xf816(%rip), %rsi      # 0x16345
leaq 0xf810(%rip), %rdx      # 0x16346
callq 0x5002
leaq -0xf0(%rbp), %rdi
leaq -0x288(%rbp), %rsi
leaq -0x118(%rbp), %rcx
movl $0x5, %edx
callq 0x7460
movq $-0x168, %r15           # imm = 0xFE98
movq -0x10(%rbx), %rdi
cmpq %rdi, %rbx
je 0x6b75
movq (%rbx), %rsi
incq %rsi
callq 0x42b0
movq -0x38(%rbx), %rdi
leaq -0x28(%rbx), %rax
cmpq %rdi, %rax
je 0x6b8d
movq (%rax), %rsi
incq %rsi
callq 0x42b0
addq $-0x48, %rbx
addq $0x48, %r15
jne 0x6b61
movq -0xf0(%rbp), %rcx
leaq -0xf0(%rbp), %rax
cmpq %rax, %rcx
leaq -0x40(%rbp), %r15
je 0x6f0f
leaq 0xf4b0(%rip), %r14      # 0x16069
leaq -0x278(%rbp), %rax
movq %rax, -0x288(%rbp)
movq 0x10(%rcx), %rsi
movq 0x18(%rcx), %rdx
addq %rsi, %rdx
leaq -0x288(%rbp), %rdi
movq %rcx, %rbx
callq 0x4f68
movq 0x30(%rbx), %rax
movq %rax, -0x268(%rbp)
leaq -0x250(%rbp), %rax
movq %rax, -0x260(%rbp)
movq 0x38(%rbx), %rsi
movq %rbx, -0x290(%rbp)
movq 0x40(%rbx), %rdx
addq %rsi, %rdx
leaq -0x260(%rbp), %rdi
callq 0x4f68
movq -0x260(%rbp), %rsi
leaq 0xf72e(%rip), %rdi      # 0x16354
xorl %eax, %eax
callq 0x4050
leaq -0x118(%rbp), %rdi
leaq -0x288(%rbp), %rsi
movl $0x10, %edx
callq 0x74e4
movq -0x30(%rbp), %rbx
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
addq %rdi, %rsi
leaq -0xd0(%rbp), %rdx
leaq -0x118(%rbp), %rcx
xorl %r8d, %r8d
callq 0x12e64
testb %al, %al
je 0x6e90
movq %rbx, %rsi
movq -0xd0(%rbp), %rax
movq -0xc8(%rbp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
leaq -0x48(%rcx), %rdi
cmpq $0x48, %rdx
movq %rax, %rdx
cmoveq %rdi, %rdx
cmpq %rax, %rcx
cmoveq %rdi, %rdx
movq (%rdx), %r12
movl 0x8(%rdx), %r13d
subl %r12d, %r13d
subq -0xb8(%rbp), %r12
cmpb $0x0, 0x10(%rdx)
movl $0x0, %eax
cmovel %eax, %r13d
movslq %r12d, %rbx
movq 0x8(%rdx), %rcx
subq (%rdx), %rcx
cmpb $0x0, 0x10(%rdx)
cmoveq %rax, %rcx
leaq -0x50(%rbp), %rdi
movq %rbx, %rdx
callq 0x42e0
movq %rbx, -0xf8(%rbp)
movq %r14, %rbx
movq -0x50(%rbp), %rsi
leaq 0xf676(%rip), %rdi      # 0x16365
xorl %eax, %eax
callq 0x4050
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x6d0b
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x42b0
movslq -0x264(%rbp), %r15
leaq -0x70(%rbp), %r14
movq %r14, %rdi
leaq 0xf2e9(%rip), %rsi      # 0x16009
leaq -0x260(%rbp), %rdx
callq 0x4ed5
movq %r14, %rdi
movq %rbx, %r14
movq %rbx, %rsi
callq 0x4510
leaq -0x40(%rbp), %rsi
movq %rsi, -0x50(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6d5e
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x6d64
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
addl %r12d, %r13d
movslq %r13d, %rsi
subq %r15, %rsi
movq 0x8(%rax), %rdx
movq %rdx, -0x48(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %r8
movq -0x30(%rbp), %rdi
movq %r15, %rdx
callq 0x4310
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x6db1
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x42b0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
leaq -0x70(%rbp), %r12
je 0x6dce
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x42b0
movslq -0x268(%rbp), %r15
movq %r12, %rdi
leaq 0xf225(%rip), %rsi      # 0x16004
leaq -0x260(%rbp), %rdx
callq 0x4ed5
movq -0x30(%rbp), %rbx
movq %r12, %rdi
movq %r14, %rsi
callq 0x4510
leaq -0x40(%rbp), %rsi
movq %rsi, -0x50(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6e1e
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x6e24
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, -0x48(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %r8
movq %rbx, %rdi
movq -0xf8(%rbp), %rsi
movq %r15, %rdx
callq 0x4310
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %r15
cmpq %r15, %rdi
je 0x6e6e
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x42b0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x6c49
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x42b0
jmp 0x6c49
movq -0x260(%rbp), %rsi
leaq 0xf4dd(%rip), %rdi      # 0x1637b
xorl %eax, %eax
callq 0x4050
leaq -0x118(%rbp), %rdi
callq 0x754e
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0x6ed3
movq -0x250(%rbp), %rsi
incq %rsi
callq 0x42b0
movq -0x288(%rbp), %rdi
leaq -0x278(%rbp), %rax
cmpq %rax, %rdi
je 0x6ef5
movq -0x278(%rbp), %rsi
incq %rsi
callq 0x42b0
movq -0x290(%rbp), %rcx
movq (%rcx), %rcx
leaq -0xf0(%rbp), %rax
cmpq %rax, %rcx
jne 0x6bb9
movq -0x30(%rbp), %rdi
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x6f58
xorl %esi, %esi
leaq 0xf468(%rip), %rbx      # 0x1638d
xorl %r15d, %r15d
movq (%rdi), %rax
cmpb $0xa, (%rax,%rsi)
jne 0x6f45
movl $0x5, %r8d
xorl %edx, %edx
movq %rbx, %rcx
callq 0x4310
addl $0x6, %r15d
incl %r15d
movslq %r15d, %rsi
movq -0x30(%rbp), %rdi
movq 0x8(%rdi), %rax
cmpq %rsi, %rax
ja 0x6f28
movq -0x120(%rbp), %r9
leaq 0x10(%r9), %rdx
movq %rdx, (%r9)
movq (%rdi), %rsi
leaq 0x10(%rdi), %rcx
cmpq %rcx, %rsi
movq %rdi, %r8
je 0x6f81
movq %rsi, (%r9)
movq (%rcx), %rdx
movq %rdx, 0x10(%r9)
jmp 0x6f87
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, 0x8(%r9)
movq %rcx, (%r8)
movq $0x0, 0x8(%r8)
movb $0x0, 0x10(%r8)
leaq -0xf0(%rbp), %rdi
callq 0x75f8
leaq -0xb0(%rbp), %rdi
callq 0x754e
leaq -0x90(%rbp), %rdi
callq 0x754e
leaq -0x2d0(%rbp), %rdi
callq 0x754e
movq -0xd0(%rbp), %rdi
testq %rdi, %rdi
je 0x6fe6
movq -0xc0(%rbp), %rsi
subq %rdi, %rsi
callq 0x42b0
movq -0x120(%rbp), %rax
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, -0x30(%rbp)
movl $0x120, %ebx            # imm = 0x120
leaq (%rbx,%rbp), %rdi
addq $-0x288, %rdi           # imm = 0xFD78
callq 0x749e
addq $-0x48, %rbx
cmpq $-0x48, %rbx
jne 0x7008
xorl %ebx, %ebx
jmp 0x702c
movq %rax, -0x30(%rbp)
movb $0x1, %bl
testb %bl, %bl
je 0x7053
movq -0x168(%rbp), %rdi
cmpq %r13, %rdi
je 0x7053
movq -0x158(%rbp), %rsi
incq %rsi
callq 0x42b0
jmp 0x7053
movq %rax, -0x30(%rbp)
movb $0x1, %bl
xorl %eax, %eax
jmp 0x705f
movq %rax, -0x30(%rbp)
movb $0x1, %al
movb $0x1, %bl
testb %al, %al
je 0x7086
movq -0x1b0(%rbp), %rdi
cmpq %r15, %rdi
je 0x7086
movq -0x1a0(%rbp), %rsi
incq %rsi
callq 0x42b0
jmp 0x7086
movq %rax, -0x30(%rbp)
movb $0x1, %bl
xorl %eax, %eax
testb %al, %al
je 0x70b9
movq -0x1f8(%rbp), %rdi
cmpq %r14, %rdi
je 0x70b9
movq -0x1e8(%rbp), %rsi
incq %rsi
callq 0x42b0
jmp 0x70b9
movq %rax, -0x30(%rbp)
movb $0x1, %al
movb $0x1, %bl
jmp 0x7088
movq %rax, -0x30(%rbp)
movb $0x1, %bl
xorl %eax, %eax
testb %al, %al
je 0x70f3
movq -0x240(%rbp), %rdi
leaq -0x230(%rbp), %rax
cmpq %rax, %rdi
je 0x70f3
movq -0x230(%rbp), %rsi
incq %rsi
callq 0x42b0
jmp 0x70f3
movq %rax, -0x30(%rbp)
movb $0x1, %al
movb $0x1, %bl
jmp 0x70bb
movq %rax, -0x30(%rbp)
movb $0x1, %bl
xorl %eax, %eax
testb %al, %al
je 0x7134
movq -0x288(%rbp), %rdi
leaq -0x278(%rbp), %rax
cmpq %rax, %rdi
je 0x7134
movq -0x278(%rbp), %rsi
incq %rsi
callq 0x42b0
jmp 0x7134
movq %rax, -0x30(%rbp)
movb $0x1, %al
leaq -0x288(%rbp), %r12
movb $0x1, %bl
jmp 0x70f5
movq %rax, -0x30(%rbp)
movb $0x1, %bl
leaq -0x288(%rbp), %rax
cmpq %r12, %rax
setne %al
testb %bl, %bl
je 0x7161
testb %al, %al
je 0x7161
leaq -0x288(%rbp), %rbx
addq $-0x48, %r12
movq %r12, %rdi
callq 0x749e
cmpq %rbx, %r12
jne 0x7150
movq -0x30(%rbp), %rbx
jmp 0x73ad
movq %rax, %rbx
jmp 0x73b9
jmp 0x72e7
movq %rax, %rbx
jmp 0x73d1
jmp 0x7181
movq %rax, %rbx
jmp 0x73a1
movq %rax, %rbx
movq -0x288(%rbp), %rdi
leaq -0x278(%rbp), %rax
cmpq %rax, %rdi
je 0x73a1
movq -0x278(%rbp), %rsi
incq %rsi
callq 0x42b0
jmp 0x73a1
movq %rax, %rbx
jmp 0x7395
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x7340
movq -0x40(%rbp), %rsi
jmp 0x723b
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x71f6
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x42b0
jmp 0x71f6
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0x721d
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x42b0
jmp 0x721d
movq %rax, %rbx
movq -0x2b0(%rbp), %rdi
leaq -0x2a0(%rbp), %rax
cmpq %rax, %rdi
je 0x7340
movq -0x2a0(%rbp), %rsi
incq %rsi
callq 0x42b0
jmp 0x7340
jmp 0x733d
jmp 0x72df
movq %rax, %rbx
jmp 0x7362
jmp 0x7265
jmp 0x72e7
jmp 0x7273
jmp 0x726c
movq %rax, %rbx
jmp 0x72b4
jmp 0x72e7
movq %rax, %rbx
jmp 0x7298
jmp 0x72e7
movq %rax, %rbx
movq -0x288(%rbp), %rdi
leaq -0x278(%rbp), %rax
cmpq %rax, %rdi
je 0x7298
movq -0x278(%rbp), %rsi
incq %rsi
callq 0x42b0
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x72b4
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x42b0
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x73c5
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x42b0
jmp 0x73c5
movq %rax, %rbx
jmp 0x73ad
movq %rax, %rbx
jmp 0x73c5
jmp 0x7386
jmp 0x72f6
movq %rax, %rbx
jmp 0x731e
jmp 0x7386
jmp 0x7302
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x731e
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x42b0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x7389
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x42b0
jmp 0x7389
jmp 0x7386
jmp 0x733d
movq %rax, %rbx
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0x7362
movq -0x108(%rbp), %rsi
incq %rsi
callq 0x42b0
movq -0x288(%rbp), %rdi
leaq -0x278(%rbp), %rax
cmpq %rax, %rdi
je 0x73ad
movq -0x278(%rbp), %rsi
incq %rsi
callq 0x42b0
jmp 0x73ad
movq %rax, %rbx
leaq -0x118(%rbp), %rdi
callq 0x754e
leaq -0x288(%rbp), %rdi
callq 0x749e
leaq -0xf0(%rbp), %rdi
callq 0x75f8
leaq -0xb0(%rbp), %rdi
callq 0x754e
leaq -0x90(%rbp), %rdi
callq 0x754e
leaq -0x2d0(%rbp), %rdi
callq 0x754e
movq -0xd0(%rbp), %rdi
testq %rdi, %rdi
je 0x73ec
movq -0xc0(%rbp), %rsi
subq %rdi, %rsi
callq 0x42b0
movq %rbx, %rdi
callq 0x44a0