// File: margual56[P]Markdown-CLI/src/Component.cpp
// Function: Component::render[abi:cxx11]()
std::string Component::render(){
    std::string tmp = ""; 
    
    if(!type.empty())                       // If the component has a tag assigned,
        tmp += "<" + this->type + ">\n";    // open the tag

    if(this->content.after == NULL && !this->content.text.empty())     // If the text's "after" is NULL, it means that the text should be rendered first
        tmp += this->content.text + "\n";

    for(Component *c: this->children){   // For each subcomponent,
        tmp += c->render() + "\n";              // render it

        if(this->content.after == c){  // and then check if the text goes after it
            tmp += this->content.text + "\n";  // (if it does, render the text)
        }
    }
    
    if(!type.empty())                       // If the component has a tag assigned,
        tmp += "</" + this->type + ">\n";    // close the tag

    return tmp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x158(%rbp)
movq %rdi, %rax
movq %rax, -0x168(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x160(%rbp)
movb $0x0, -0x11(%rbp)
leaq -0x12(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x5710
movq -0x158(%rbp), %rdi
movq -0x150(%rbp), %rdx
leaq 0x2d59d(%rip), %rsi     # 0x331c5
callq 0x61c0
jmp 0x5c2f
leaq -0x12(%rbp), %rdi
callq 0x5460
movq -0x160(%rbp), %rdi
callq 0x5690
testb $0x1, %al
jne 0x5cfd
movq -0x160(%rbp), %rdx
leaq 0x2d3aa(%rip), %rsi     # 0x33004
leaq -0x68(%rbp), %rdi
callq 0x62c0
jmp 0x5c65
leaq 0x2d39a(%rip), %rdx     # 0x33006
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x6270
jmp 0x5c7b
movq -0x158(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x5520
jmp 0x5c8d
leaq -0x48(%rbp), %rdi
callq 0x52b0
leaq -0x68(%rbp), %rdi
callq 0x52b0
jmp 0x5cfd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x12(%rbp), %rdi
callq 0x5460
jmp 0x5fea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x5fde
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x5cef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x52b0
leaq -0x68(%rbp), %rdi
callq 0x52b0
jmp 0x5fde
movq -0x160(%rbp), %rax
cmpq $0x0, 0x40(%rax)
jne 0x5d7f
movq -0x160(%rbp), %rdi
addq $0x20, %rdi
callq 0x5690
testb $0x1, %al
jne 0x5d7f
movq -0x160(%rbp), %rsi
addq $0x20, %rsi
leaq 0x2d493(%rip), %rdx     # 0x331c4
leaq -0x88(%rbp), %rdi
callq 0x63d0
jmp 0x5d3f
movq -0x158(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x5520
jmp 0x5d54
leaq -0x88(%rbp), %rdi
callq 0x52b0
jmp 0x5d7f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x52b0
jmp 0x5fde
movq -0x160(%rbp), %rax
addq $0x50, %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rdi
callq 0x6450
movq %rax, -0x98(%rbp)
movq -0x90(%rbp), %rdi
callq 0x6480
movq %rax, -0xa0(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x64b0
testb $0x1, %al
jne 0x5dd3
jmp 0x5f09
leaq -0x98(%rbp), %rdi
callq 0x64e0
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
callq 0x5bd0
jmp 0x5dfe
leaq 0x2d3bf(%rip), %rdx     # 0x331c4
leaq -0xc8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x6270
jmp 0x5e1a
movq -0x158(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x5520
jmp 0x5e2f
leaq -0xc8(%rbp), %rdi
callq 0x52b0
leaq -0xe8(%rbp), %rdi
callq 0x52b0
movq -0x160(%rbp), %rax
movq 0x40(%rax), %rax
cmpq -0xa8(%rbp), %rax
jne 0x5ef6
movq -0x160(%rbp), %rsi
addq $0x20, %rsi
leaq 0x2d353(%rip), %rdx     # 0x331c4
leaq -0x108(%rbp), %rdi
callq 0x63d0
jmp 0x5e7f
movq -0x158(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x5520
jmp 0x5e94
leaq -0x108(%rbp), %rdi
callq 0x52b0
jmp 0x5ef6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x5ec8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x52b0
leaq -0xe8(%rbp), %rdi
callq 0x52b0
jmp 0x5fde
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x52b0
jmp 0x5fde
jmp 0x5ef8
leaq -0x98(%rbp), %rdi
callq 0x6500
jmp 0x5db7
movq -0x160(%rbp), %rdi
callq 0x5690
testb $0x1, %al
jne 0x5fb8
movq -0x160(%rbp), %rdx
leaq 0x2d0de(%rip), %rsi     # 0x33009
leaq -0x148(%rbp), %rdi
callq 0x62c0
jmp 0x5f39
leaq 0x2d0c6(%rip), %rdx     # 0x33006
leaq -0x128(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x6270
jmp 0x5f55
movq -0x158(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x5520
jmp 0x5f6a
leaq -0x128(%rbp), %rdi
callq 0x52b0
leaq -0x148(%rbp), %rdi
callq 0x52b0
jmp 0x5fb8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x5faa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x52b0
leaq -0x148(%rbp), %rdi
callq 0x52b0
jmp 0x5fde
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x5fce
movq -0x158(%rbp), %rdi
callq 0x52b0
movq -0x168(%rbp), %rax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
movq -0x158(%rbp), %rdi
callq 0x52b0
movq -0x20(%rbp), %rdi
callq 0x5700
nopw %cs:(%rax,%rax)
nopl (%rax)