// File: 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
subq $0x790, %rsp            # imm = 0x790
movq %rsi, -0x588(%rbp)
movq %rdi, -0x580(%rbp)
movq %rdi, %rax
movq %rax, -0x578(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x96a0
leaq 0x2b11d(%rip), %rsi     # 0x33338
leaq -0x50(%rbp), %rdi
movl $0x10, %edx
callq 0x96e0
jmp 0x822b
jmp 0x822d
movq -0x588(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0x50(%rbp), %rdx
xorl %ecx, %ecx
callq 0x9780
movb %al, -0x589(%rbp)
jmp 0x824b
movb -0x589(%rbp), %al
testb $0x1, %al
jne 0x825a
jmp 0x8591
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x97e0
movq %rax, -0x598(%rbp)
jmp 0x8270
movq -0x598(%rbp), %rax
movl %eax, -0x60(%rbp)
movslq -0x60(%rbp), %rax
movq %rax, -0x5a8(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x9820
movq %rax, -0x5a0(%rbp)
jmp 0x829b
movq -0x5a8(%rbp), %rax
movq -0x5a0(%rbp), %rcx
addl %ecx, %eax
movl %eax, -0x64(%rbp)
movslq -0x60(%rbp), %rax
movq %rax, -0x5b8(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x9820
movq %rax, -0x5b0(%rbp)
jmp 0x82cf
movq -0x5b0(%rbp), %rcx
movq -0x5b8(%rbp), %rdx
movq -0x588(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x5430
jmp 0x82f2
leaq -0x88(%rbp), %rdi
callq 0x51b0
movq %rax, %rsi
leaq 0x2b047(%rip), %rdi     # 0x3334f
xorl %eax, %eax
callq 0x5070
jmp 0x8311
leaq -0x88(%rbp), %rdi
callq 0x52b0
movl $0x0, -0x8c(%rbp)
movq -0x588(%rbp), %rdi
movl -0x8c(%rbp), %eax
movl -0x60(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
callq 0x57c0
movq %rax, -0x5c0(%rbp)
jmp 0x834a
movq -0x5c0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x83ab
jmp 0x835b
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0x8327
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x9687
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x967e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x52b0
jmp 0x967e
movslq -0x64(%rbp), %rax
movq %rax, -0x5c8(%rbp)
movl -0x8c(%rbp), %esi
leaq -0xf0(%rbp), %rdi
callq 0x98a0
jmp 0x83ca
leaq 0x2af93(%rip), %rsi     # 0x33364
leaq -0xd0(%rbp), %rdi
leaq -0xf0(%rbp), %rdx
callq 0x9850
jmp 0x83e6
leaq 0x2af7b(%rip), %rdx     # 0x33368
leaq -0xb0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x6270
jmp 0x8402
movq -0x5c8(%rbp), %rsi
movq -0x588(%rbp), %rdi
leaq -0xb0(%rbp), %rdx
callq 0x5620
jmp 0x841e
leaq -0xb0(%rbp), %rdi
callq 0x52b0
leaq -0xd0(%rbp), %rdi
callq 0x52b0
leaq -0xf0(%rbp), %rdi
callq 0x52b0
movslq -0x60(%rbp), %rax
movq %rax, -0x5d8(%rbp)
movl -0x8c(%rbp), %esi
movslq %esi, %rax
movq %rax, -0x5d0(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x98a0
jmp 0x846b
leaq 0x2aefd(%rip), %rsi     # 0x3336f
leaq -0x130(%rbp), %rdi
leaq -0x150(%rbp), %rdx
callq 0x9850
jmp 0x8487
leaq 0x2abdb(%rip), %rdx     # 0x33069
leaq -0x110(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x6270
jmp 0x84a3
movq -0x5d0(%rbp), %rdx
movq -0x5d8(%rbp), %rsi
movq -0x588(%rbp), %rdi
leaq -0x110(%rbp), %rcx
callq 0x5160
jmp 0x84c6
leaq -0x110(%rbp), %rdi
callq 0x52b0
leaq -0x130(%rbp), %rdi
callq 0x52b0
leaq -0x150(%rbp), %rdi
callq 0x52b0
jmp 0x822d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x852f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x8523
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x52b0
leaq -0xd0(%rbp), %rdi
callq 0x52b0
leaq -0xf0(%rbp), %rdi
callq 0x52b0
jmp 0x967e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x8580
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x8574
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x52b0
leaq -0x130(%rbp), %rdi
callq 0x52b0
leaq -0x150(%rbp), %rdi
callq 0x52b0
jmp 0x967e
leaq 0x2adda(%rip), %rsi     # 0x33372
leaq -0x170(%rbp), %rdi
movl $0x10, %edx
callq 0x96e0
jmp 0x85ab
leaq 0x2adcc(%rip), %rsi     # 0x3337e
leaq -0x190(%rbp), %rdi
movl $0x10, %edx
callq 0x96e0
jmp 0x85c5
leaq -0x1b0(%rbp), %rdi
callq 0x96a0
jmp 0x85d3
jmp 0x85d5
movq -0x588(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0x170(%rbp), %rdx
xorl %ecx, %ecx
callq 0x9780
movb %al, -0x5d9(%rbp)
jmp 0x85f6
movb -0x5d9(%rbp), %al
testb $0x1, %al
jne 0x8605
jmp 0x8a85
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x97e0
movq %rax, -0x5e8(%rbp)
jmp 0x861b
movq -0x5e8(%rbp), %rax
movl %eax, -0x1b4(%rbp)
movslq -0x1b4(%rbp), %rax
movq %rax, -0x5f8(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x9820
movq %rax, -0x5f0(%rbp)
jmp 0x864c
movq -0x5f8(%rbp), %rax
movq -0x5f0(%rbp), %rcx
addl %ecx, %eax
movl %eax, -0x1b8(%rbp)
leaq -0x1d9(%rbp), %rdi
movq %rdi, -0x600(%rbp)
callq 0x5710
movq -0x600(%rbp), %rdx
leaq 0x2ab42(%rip), %rsi     # 0x331c5
leaq -0x1d8(%rbp), %rdi
callq 0x61c0
jmp 0x8691
leaq -0x1d9(%rbp), %rdi
callq 0x5460
leaq -0x201(%rbp), %rdi
movq %rdi, -0x608(%rbp)
callq 0x5710
movq -0x608(%rbp), %rdx
leaq 0x2ab07(%rip), %rsi     # 0x331c5
leaq -0x200(%rbp), %rdi
callq 0x61c0
jmp 0x86cc
leaq -0x201(%rbp), %rdi
callq 0x5460
movl -0x1b4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x208(%rbp)
movl $0x1, -0x20c(%rbp)
cmpl $0x0, -0x20c(%rbp)
jle 0x881e
movq -0x588(%rbp), %rdi
movslq -0x208(%rbp), %rsi
callq 0x57c0
movq %rax, -0x610(%rbp)
jmp 0x871a
movq -0x610(%rbp), %rax
movb (%rax), %al
movb %al, -0x20d(%rbp)
movsbl -0x20d(%rbp), %eax
cmpl $0x5b, %eax
jne 0x87cb
movl -0x20c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20c(%rbp)
jmp 0x87e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x9672
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x9666
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x965a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x1d9(%rbp), %rdi
callq 0x5460
jmp 0x965a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x201(%rbp), %rdi
callq 0x5460
jmp 0x8a74
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x8a68
movsbl -0x20d(%rbp), %eax
cmpl $0x5d, %eax
jne 0x87e6
movl -0x20c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20c(%rbp)
jmp 0x87e8
cmpl $0x0, -0x20c(%rbp)
jle 0x8808
movsbl -0x20d(%rbp), %esi
leaq -0x1d8(%rbp), %rdi
callq 0x52d0
jmp 0x8806
jmp 0x8808
jmp 0x880a
movl -0x208(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x208(%rbp)
jmp 0x86f1
movl -0x208(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x208(%rbp)
movl $0x1, -0x20c(%rbp)
cmpl $0x0, -0x20c(%rbp)
jle 0x88df
movq -0x588(%rbp), %rdi
movslq -0x208(%rbp), %rsi
callq 0x57c0
movq %rax, -0x618(%rbp)
jmp 0x8860
movq -0x618(%rbp), %rax
movb (%rax), %al
movb %al, -0x20e(%rbp)
movsbl -0x20e(%rbp), %eax
cmpl $0x28, %eax
jne 0x888c
movl -0x20c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20c(%rbp)
jmp 0x88a9
movsbl -0x20e(%rbp), %eax
cmpl $0x29, %eax
jne 0x88a7
movl -0x20c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20c(%rbp)
jmp 0x88a9
cmpl $0x0, -0x20c(%rbp)
jle 0x88c9
movsbl -0x20e(%rbp), %esi
leaq -0x200(%rbp), %rdi
callq 0x52d0
jmp 0x88c7
jmp 0x88c9
jmp 0x88cb
movl -0x208(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x208(%rbp)
jmp 0x8837
leaq 0x2aaa5(%rip), %rsi     # 0x3338b
leaq -0x290(%rbp), %rdi
leaq -0x200(%rbp), %rdx
callq 0x62c0
jmp 0x88fb
leaq 0x2a766(%rip), %rdx     # 0x33068
leaq -0x270(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x6270
jmp 0x8917
leaq -0x250(%rbp), %rdi
leaq -0x270(%rbp), %rsi
leaq -0x1d8(%rbp), %rdx
callq 0x99c0
jmp 0x8933
leaq 0x2aa5b(%rip), %rdx     # 0x33395
leaq -0x230(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x6270
jmp 0x894f
leaq -0x250(%rbp), %rdi
callq 0x52b0
leaq -0x270(%rbp), %rdi
callq 0x52b0
leaq -0x290(%rbp), %rdi
callq 0x52b0
leaq -0x230(%rbp), %rdi
callq 0x51b0
movq %rax, %rsi
leaq 0x2aa11(%rip), %rdi     # 0x3339a
xorl %eax, %eax
callq 0x5070
jmp 0x8992
movslq -0x1b4(%rbp), %rax
movq %rax, -0x628(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x9820
movq %rax, -0x620(%rbp)
jmp 0x89b6
movq -0x620(%rbp), %rdx
movq -0x628(%rbp), %rsi
movq -0x588(%rbp), %rdi
leaq -0x230(%rbp), %rcx
callq 0x5160
jmp 0x89d9
leaq -0x230(%rbp), %rdi
callq 0x52b0
leaq -0x200(%rbp), %rdi
callq 0x52b0
leaq -0x1d8(%rbp), %rdi
callq 0x52b0
jmp 0x85d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x8a42
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x8a36
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x52b0
leaq -0x270(%rbp), %rdi
callq 0x52b0
leaq -0x290(%rbp), %rdi
callq 0x52b0
jmp 0x8a68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x230(%rbp), %rdi
callq 0x52b0
leaq -0x200(%rbp), %rdi
callq 0x52b0
leaq -0x1d8(%rbp), %rdi
callq 0x52b0
jmp 0x965a
movb $0x1, -0x438(%rbp)
leaq -0x420(%rbp), %rax
movq %rax, -0x638(%rbp)
movq %rax, -0x428(%rbp)
leaq -0x429(%rbp), %rdi
movq %rdi, -0x630(%rbp)
callq 0x5710
movq -0x638(%rbp), %rdi
movq -0x630(%rbp), %rdx
leaq 0x2a8e5(%rip), %rsi     # 0x333ae
callq 0x61c0
jmp 0x8ad0
movb $0x1, -0x42b(%rbp)
movl $0x1, -0x400(%rbp)
movl $0x1, -0x3fc(%rbp)
leaq -0x3f8(%rbp), %rax
movq %rax, -0x648(%rbp)
leaq -0x42a(%rbp), %rdi
movq %rdi, -0x640(%rbp)
callq 0x5710
movq -0x648(%rbp), %rdi
movq -0x640(%rbp), %rdx
leaq 0x2a897(%rip), %rsi     # 0x333b8
callq 0x61c0
jmp 0x8b28
movb $0x0, -0x42b(%rbp)
leaq -0x3d8(%rbp), %rax
movq %rax, -0x658(%rbp)
movq %rax, %rcx
movq %rcx, -0x660(%rbp)
movq %rax, -0x428(%rbp)
leaq -0x42c(%rbp), %rdi
movq %rdi, -0x650(%rbp)
callq 0x5710
movq -0x658(%rbp), %rdi
movq -0x650(%rbp), %rdx
leaq 0x2a847(%rip), %rsi     # 0x333bd
callq 0x61c0
jmp 0x8b7d
movq -0x660(%rbp), %rax
movb $0x1, -0x42e(%rbp)
movl $0x2, 0x20(%rax)
movl $0x2, 0x24(%rax)
addq $0x28, %rax
movq %rax, -0x670(%rbp)
leaq -0x42d(%rbp), %rdi
movq %rdi, -0x668(%rbp)
callq 0x5710
movq -0x670(%rbp), %rdi
movq -0x668(%rbp), %rdx
leaq 0x2adea(%rip), %rsi     # 0x339b6
callq 0x61c0
jmp 0x8bd3
movb $0x0, -0x42e(%rbp)
leaq -0x390(%rbp), %rax
movq %rax, -0x680(%rbp)
movq %rax, %rcx
movq %rcx, -0x688(%rbp)
movq %rax, -0x428(%rbp)
leaq -0x42f(%rbp), %rdi
movq %rdi, -0x678(%rbp)
callq 0x5710
movq -0x680(%rbp), %rdi
movq -0x678(%rbp), %rdx
leaq 0x2a7ba(%rip), %rsi     # 0x333db
callq 0x61c0
jmp 0x8c28
movq -0x688(%rbp), %rax
movb $0x1, -0x431(%rbp)
movl $0x2, 0x20(%rax)
movl $0x2, 0x24(%rax)
addq $0x28, %rax
movq %rax, -0x698(%rbp)
leaq -0x430(%rbp), %rdi
movq %rdi, -0x690(%rbp)
callq 0x5710
movq -0x698(%rbp), %rdi
movq -0x690(%rbp), %rdx
leaq 0x2ad3f(%rip), %rsi     # 0x339b6
callq 0x61c0
jmp 0x8c7e
movb $0x0, -0x431(%rbp)
leaq -0x348(%rbp), %rax
movq %rax, -0x6a8(%rbp)
movq %rax, %rcx
movq %rcx, -0x6b0(%rbp)
movq %rax, -0x428(%rbp)
leaq -0x432(%rbp), %rdi
movq %rdi, -0x6a0(%rbp)
callq 0x5710
movq -0x6a8(%rbp), %rdi
movq -0x6a0(%rbp), %rdx
leaq 0x2a72a(%rip), %rsi     # 0x333f6
callq 0x61c0
jmp 0x8cd3
movq -0x6b0(%rbp), %rax
movb $0x1, -0x434(%rbp)
movl $0x1, 0x20(%rax)
movl $0x1, 0x24(%rax)
addq $0x28, %rax
movq %rax, -0x6c0(%rbp)
leaq -0x433(%rbp), %rdi
movq %rdi, -0x6b8(%rbp)
callq 0x5710
movq -0x6c0(%rbp), %rdi
movq -0x6b8(%rbp), %rdx
leaq 0x2a6e3(%rip), %rsi     # 0x33405
callq 0x61c0
jmp 0x8d29
movb $0x0, -0x434(%rbp)
leaq -0x300(%rbp), %rax
movq %rax, -0x6d0(%rbp)
movq %rax, %rcx
movq %rcx, -0x6d8(%rbp)
movq %rax, -0x428(%rbp)
leaq -0x435(%rbp), %rdi
movq %rdi, -0x6c8(%rbp)
callq 0x5710
movq -0x6d0(%rbp), %rdi
movq -0x6c8(%rbp), %rdx
leaq 0x2a690(%rip), %rsi     # 0x33407
callq 0x61c0
jmp 0x8d7e
movq -0x6d8(%rbp), %rax
movb $0x1, -0x437(%rbp)
movl $0x1, 0x20(%rax)
movl $0x1, 0x24(%rax)
addq $0x28, %rax
movq %rax, -0x6e8(%rbp)
leaq -0x436(%rbp), %rdi
movq %rdi, -0x6e0(%rbp)
callq 0x5710
movq -0x6e8(%rbp), %rdi
movq -0x6e0(%rbp), %rdx
leaq 0x2a638(%rip), %rsi     # 0x33405
callq 0x61c0
jmp 0x8dd4
movb $0x0, -0x437(%rbp)
movb $0x0, -0x438(%rbp)
leaq -0x420(%rbp), %rax
movq %rax, -0x2b8(%rbp)
movq $0x5, -0x2b0(%rbp)
leaq -0x439(%rbp), %rdi
movq %rdi, -0x6f0(%rbp)
callq 0x9a10
movq -0x6f0(%rbp), %rcx
movq -0x2b8(%rbp), %rsi
movq -0x2b0(%rbp), %rdx
leaq -0x2a8(%rbp), %rdi
callq 0x9a30
jmp 0x8e31
leaq -0x439(%rbp), %rdi
callq 0x9ae0
leaq -0x420(%rbp), %rax
movq %rax, -0x700(%rbp)
addq $0x168, %rax            # imm = 0x168
movq %rax, -0x6f8(%rbp)
movq -0x6f8(%rbp), %rdi
addq $-0x48, %rdi
movq %rdi, -0x708(%rbp)
callq 0x9b00
movq -0x700(%rbp), %rcx
movq -0x708(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x6f8(%rbp)
jne 0x8e58
leaq -0x436(%rbp), %rdi
callq 0x5460
leaq -0x435(%rbp), %rdi
callq 0x5460
leaq -0x433(%rbp), %rdi
callq 0x5460
leaq -0x432(%rbp), %rdi
callq 0x5460
leaq -0x430(%rbp), %rdi
callq 0x5460
leaq -0x42f(%rbp), %rdi
callq 0x5460
leaq -0x42d(%rbp), %rdi
callq 0x5460
leaq -0x42c(%rbp), %rdi
callq 0x5460
leaq -0x42a(%rbp), %rdi
callq 0x5460
leaq -0x429(%rbp), %rdi
callq 0x5460
leaq -0x2a8(%rbp), %rax
movq %rax, -0x448(%rbp)
movq -0x448(%rbp), %rdi
callq 0x9b30
movq %rax, -0x450(%rbp)
movq -0x448(%rbp), %rdi
callq 0x9b60
movq %rax, -0x458(%rbp)
leaq -0x450(%rbp), %rdi
leaq -0x458(%rbp), %rsi
callq 0x9b90
testb $0x1, %al
jne 0x8f51
jmp 0x954a
leaq -0x450(%rbp), %rdi
callq 0x9bc0
movq %rax, %rsi
leaq -0x4a0(%rbp), %rdi
callq 0x9be0
jmp 0x8f6e
leaq -0x478(%rbp), %rdi
callq 0x51b0
movq %rax, %rsi
leaq 0x2a490(%rip), %rdi     # 0x33414
xorl %eax, %eax
callq 0x5070
jmp 0x8f8d
leaq -0x4c0(%rbp), %rdi
leaq -0x4a0(%rbp), %rsi
movl $0x10, %edx
callq 0x9c50
jmp 0x8fa7
jmp 0x8fa9
movq -0x588(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0x4c0(%rbp), %rdx
xorl %ecx, %ecx
callq 0x9780
movb %al, -0x709(%rbp)
jmp 0x8fca
movb -0x709(%rbp), %al
testb $0x1, %al
jne 0x8fd9
jmp 0x94e5
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x97e0
movq %rax, -0x718(%rbp)
jmp 0x8fef
movq -0x718(%rbp), %rax
movl %eax, -0x4c8(%rbp)
movslq -0x4c8(%rbp), %rax
movq %rax, -0x728(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x9820
movq %rax, -0x720(%rbp)
jmp 0x9020
movq -0x728(%rbp), %rax
movq -0x720(%rbp), %rcx
addl %ecx, %eax
movl %eax, -0x4c4(%rbp)
movslq -0x4c8(%rbp), %rax
movq %rax, -0x738(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x9820
movq %rax, -0x730(%rbp)
jmp 0x905a
movq -0x730(%rbp), %rcx
movq -0x738(%rbp), %rdx
movq -0x588(%rbp), %rsi
leaq -0x4e8(%rbp), %rdi
callq 0x5430
jmp 0x907d
leaq -0x4e8(%rbp), %rdi
callq 0x51b0
movq %rax, %rsi
leaq 0x2a392(%rip), %rdi     # 0x33425
xorl %eax, %eax
callq 0x5070
jmp 0x909c
leaq -0x4e8(%rbp), %rdi
callq 0x52b0
movl -0x4c4(%rbp), %eax
movslq -0x47c(%rbp), %rcx
movq %rcx, -0x748(%rbp)
subl %ecx, %eax
cltq
movq %rax, -0x740(%rbp)
leaq -0x478(%rbp), %rdx
leaq 0x29f34(%rip), %rsi     # 0x33009
leaq -0x528(%rbp), %rdi
callq 0x62c0
jmp 0x90e3
leaq 0x29f7f(%rip), %rdx     # 0x33069
leaq -0x508(%rbp), %rdi
leaq -0x528(%rbp), %rsi
callq 0x6270
jmp 0x90ff
movq -0x748(%rbp), %rdx
movq -0x740(%rbp), %rsi
movq -0x588(%rbp), %rdi
leaq -0x508(%rbp), %rcx
callq 0x5160
jmp 0x9122
leaq -0x508(%rbp), %rdi
callq 0x52b0
leaq -0x528(%rbp), %rdi
callq 0x52b0
movslq -0x4c8(%rbp), %rax
movq %rax, -0x758(%rbp)
movslq -0x480(%rbp), %rax
movq %rax, -0x750(%rbp)
leaq -0x478(%rbp), %rdx
leaq 0x29ea0(%rip), %rsi     # 0x33004
leaq -0x568(%rbp), %rdi
callq 0x62c0
jmp 0x9172
leaq 0x29ef0(%rip), %rdx     # 0x33069
leaq -0x548(%rbp), %rdi
leaq -0x568(%rbp), %rsi
callq 0x6270
jmp 0x918e
movq -0x750(%rbp), %rdx
movq -0x758(%rbp), %rsi
movq -0x588(%rbp), %rdi
leaq -0x548(%rbp), %rcx
callq 0x5160
jmp 0x91b1
leaq -0x548(%rbp), %rdi
callq 0x52b0
leaq -0x568(%rbp), %rdi
callq 0x52b0
jmp 0x8fa9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x93c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x939f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x9393
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x936e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x9362
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x933d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x9331
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x930c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x9300
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x92db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x439(%rbp), %rdi
callq 0x9ae0
leaq -0x420(%rbp), %rax
movq %rax, -0x768(%rbp)
addq $0x168, %rax            # imm = 0x168
movq %rax, -0x760(%rbp)
movq -0x760(%rbp), %rdi
addq $-0x48, %rdi
movq %rdi, -0x770(%rbp)
callq 0x9b00
movq -0x768(%rbp), %rcx
movq -0x770(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x760(%rbp)
jne 0x92a8
jmp 0x92db
leaq -0x436(%rbp), %rdi
callq 0x5460
testb $0x1, -0x437(%rbp)
jne 0x92f2
jmp 0x92fe
movq -0x6d0(%rbp), %rdi
callq 0x52b0
jmp 0x9300
leaq -0x435(%rbp), %rdi
callq 0x5460
leaq -0x433(%rbp), %rdi
callq 0x5460
testb $0x1, -0x434(%rbp)
jne 0x9323
jmp 0x932f
movq -0x6a8(%rbp), %rdi
callq 0x52b0
jmp 0x9331
leaq -0x432(%rbp), %rdi
callq 0x5460
leaq -0x430(%rbp), %rdi
callq 0x5460
testb $0x1, -0x431(%rbp)
jne 0x9354
jmp 0x9360
movq -0x680(%rbp), %rdi
callq 0x52b0
jmp 0x9362
leaq -0x42f(%rbp), %rdi
callq 0x5460
leaq -0x42d(%rbp), %rdi
callq 0x5460
testb $0x1, -0x42e(%rbp)
jne 0x9385
jmp 0x9391
movq -0x658(%rbp), %rdi
callq 0x52b0
jmp 0x9393
leaq -0x42c(%rbp), %rdi
callq 0x5460
leaq -0x42a(%rbp), %rdi
callq 0x5460
testb $0x1, -0x42b(%rbp)
jne 0x93b6
jmp 0x93c2
movq -0x638(%rbp), %rdi
callq 0x52b0
jmp 0x93c4
leaq -0x429(%rbp), %rdi
callq 0x5460
testb $0x1, -0x438(%rbp)
jne 0x93db
jmp 0x9428
movq -0x428(%rbp), %rax
leaq -0x420(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x778(%rbp)
je 0x9426
movq -0x778(%rbp), %rdi
addq $-0x48, %rdi
movq %rdi, -0x780(%rbp)
callq 0x9b00
movq -0x780(%rbp), %rax
leaq -0x420(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x778(%rbp)
jne 0x93f5
jmp 0x9428
jmp 0x965a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x964e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x9539
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x952d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x4e8(%rbp), %rdi
callq 0x52b0
jmp 0x952d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x94a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x508(%rbp), %rdi
callq 0x52b0
leaq -0x528(%rbp), %rdi
callq 0x52b0
jmp 0x952d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x94d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x548(%rbp), %rdi
callq 0x52b0
leaq -0x568(%rbp), %rdi
callq 0x52b0
jmp 0x952d
leaq -0x478(%rbp), %rdi
callq 0x51b0
movq %rax, %rsi
leaq 0x29f40(%rip), %rdi     # 0x3343b
xorl %eax, %eax
callq 0x5070
jmp 0x9504
leaq -0x4c0(%rbp), %rdi
callq 0x9d00
leaq -0x4a0(%rbp), %rdi
callq 0x9b00
leaq -0x450(%rbp), %rdi
callq 0x9d30
jmp 0x8f35
leaq -0x4c0(%rbp), %rdi
callq 0x9d00
leaq -0x4a0(%rbp), %rdi
callq 0x9b00
jmp 0x964e
movl $0x0, -0x56c(%rbp)
movq -0x588(%rbp), %rdi
movslq -0x56c(%rbp), %rax
movq %rax, -0x788(%rbp)
callq 0x55e0
movq %rax, %rcx
movq -0x788(%rbp), %rax
cmpq %rcx, %rax
jae 0x95e9
movq -0x588(%rbp), %rdi
movslq -0x56c(%rbp), %rsi
callq 0x57c0
movq %rax, -0x790(%rbp)
jmp 0x9599
movq -0x790(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
jne 0x95d3
movq -0x588(%rbp), %rdi
movslq -0x56c(%rbp), %rsi
leaq 0x29e90(%rip), %rdx     # 0x3344d
callq 0x50f0
jmp 0x95c4
movl -0x56c(%rbp), %eax
addl $0x6, %eax
movl %eax, -0x56c(%rbp)
jmp 0x95d5
movl -0x56c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x56c(%rbp)
jmp 0x9554
movq -0x588(%rbp), %rsi
movq -0x580(%rbp), %rdi
callq 0x5290
leaq -0x2a8(%rbp), %rdi
callq 0x9d50
leaq -0x1b0(%rbp), %rdi
callq 0x9d70
leaq -0x190(%rbp), %rdi
callq 0x9d00
leaq -0x170(%rbp), %rdi
callq 0x9d00
leaq -0x50(%rbp), %rdi
callq 0x9d00
leaq -0x30(%rbp), %rdi
callq 0x9d70
movq -0x578(%rbp), %rax
addq $0x790, %rsp            # imm = 0x790
popq %rbp
retq
leaq -0x2a8(%rbp), %rdi
callq 0x9d50
leaq -0x1b0(%rbp), %rdi
callq 0x9d70
leaq -0x190(%rbp), %rdi
callq 0x9d00
leaq -0x170(%rbp), %rdi
callq 0x9d00
leaq -0x50(%rbp), %rdi
callq 0x9d00
leaq -0x30(%rbp), %rdi
callq 0x9d70
movq -0x58(%rbp), %rdi
callq 0x5700
nopl (%rax)