// File: eniac[P]Mantis/src/compile/compile_c.cpp
// Function: generatePrologueNode(std::vector<AstNode*, std::allocator<AstNode*>>, std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char>>&)
UnanchoredNode* generatePrologueNode(std::vector<AstNode*> nodeArray, ostringstream& oss_mbl_init, ostringstream& oss_init_end) {

    P4RInitBlockNode * init_node = findInitBlock(nodeArray);

    string * prologue_str = NULL;
    if (init_node != 0) {
        prologue_str = new string(
            str(boost::format(kPrologueT) % oss_mbl_init.str() % init_node -> body_ -> toString() % oss_init_end.str()));
    } else {
        // if no init_block
        prologue_str = new string(
            str(boost::format(kPrologueT) % oss_mbl_init.str() % "" % oss_init_end.str()));
    }

    UnanchoredNode* prologue_cnode = new UnanchoredNode(prologue_str, new string ("prologue"), new string("pd_prologue"));
    return prologue_cnode;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x350, %rsp            # imm = 0x350
movq %rsi, %rax
movq %rdi, %rsi
movq %rsi, -0x8(%rbp)
movq %rax, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x38(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0xb2bc0
movq -0x2e0(%rbp), %rdi
callq 0x12d820
movq %rax, -0x2d8(%rbp)
jmp 0xd2ec2
leaq -0x38(%rbp), %rdi
callq 0xb22f0
movq -0x2d8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x50(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xd30ad
movl $0x20, %edi
callq 0xaa560
movq %rax, -0x2e8(%rbp)
movb $0x1, -0x191(%rbp)
leaq 0x67a0b(%rip), %rsi     # 0x13a913
leaq -0x130(%rbp), %rdi
callq 0xe2f10
jmp 0xd2f16
movq -0x10(%rbp), %rsi
leaq -0x150(%rbp), %rdi
callq 0xaa580
jmp 0xd2f28
leaq -0x130(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0xe3090
movq %rax, -0x2f0(%rbp)
jmp 0xd2f44
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x170(%rbp), %rdi
callq *%rax
jmp 0xd2f5d
movq -0x2f0(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0xe3090
movq %rax, -0x2f8(%rbp)
jmp 0xd2f79
movq -0x18(%rbp), %rsi
leaq -0x190(%rbp), %rdi
callq 0xaa580
jmp 0xd2f8b
movq -0x2f8(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0xe3090
movq %rax, -0x300(%rbp)
jmp 0xd2fa7
movq -0x300(%rbp), %rsi
movq -0x2e8(%rbp), %rdi
callq 0xe2ee0
jmp 0xd2fbc
movq -0x2e8(%rbp), %rax
movb $0x0, -0x191(%rbp)
movq %rax, -0x50(%rbp)
leaq -0x190(%rbp), %rdi
callq 0xaabe8
leaq -0x170(%rbp), %rdi
callq 0xaabe8
leaq -0x150(%rbp), %rdi
callq 0xaabe8
leaq -0x130(%rbp), %rdi
callq 0xe30c0
jmp 0xd3215
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xb22f0
jmp 0xd33c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xd3091
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xd3085
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xd3079
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xd306d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x190(%rbp), %rdi
callq 0xaabe8
leaq -0x170(%rbp), %rdi
callq 0xaabe8
leaq -0x150(%rbp), %rdi
callq 0xaabe8
leaq -0x130(%rbp), %rdi
callq 0xe30c0
testb $0x1, -0x191(%rbp)
jne 0xd309c
jmp 0xd30a8
movq -0x2e8(%rbp), %rdi
callq 0xaa4e0
jmp 0xd33c3
movl $0x20, %edi
callq 0xaa560
movq %rax, -0x308(%rbp)
movb $0x1, -0x2b9(%rbp)
leaq 0x67847(%rip), %rsi     # 0x13a913
leaq -0x278(%rbp), %rdi
callq 0xe2f10
jmp 0xd30da
movq -0x10(%rbp), %rsi
leaq -0x298(%rbp), %rdi
callq 0xaa580
jmp 0xd30ec
leaq -0x278(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0xe3090
movq %rax, -0x310(%rbp)
jmp 0xd3108
movq -0x310(%rbp), %rdi
leaq 0x68a8d(%rip), %rsi     # 0x13bba3
callq 0xe3120
movq %rax, -0x318(%rbp)
jmp 0xd3124
movq -0x18(%rbp), %rsi
leaq -0x2b8(%rbp), %rdi
callq 0xaa580
jmp 0xd3136
movq -0x318(%rbp), %rdi
leaq -0x2b8(%rbp), %rsi
callq 0xe3090
movq %rax, -0x320(%rbp)
jmp 0xd3152
movq -0x320(%rbp), %rsi
movq -0x308(%rbp), %rdi
callq 0xe2ee0
jmp 0xd3167
movq -0x308(%rbp), %rax
movb $0x0, -0x2b9(%rbp)
movq %rax, -0x50(%rbp)
leaq -0x2b8(%rbp), %rdi
callq 0xaabe8
leaq -0x298(%rbp), %rdi
callq 0xaabe8
leaq -0x278(%rbp), %rdi
callq 0xe30c0
jmp 0xd3215
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xd31f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xd31ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xd31e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2b8(%rbp), %rdi
callq 0xaabe8
leaq -0x298(%rbp), %rdi
callq 0xaabe8
leaq -0x278(%rbp), %rdi
callq 0xe30c0
testb $0x1, -0x2b9(%rbp)
jne 0xd3204
jmp 0xd3210
movq -0x308(%rbp), %rdi
callq 0xaa4e0
jmp 0xd33c3
movl $0x58, %edi
callq 0xaa560
movq %rax, -0x338(%rbp)
movb $0x1, -0x2cd(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x330(%rbp)
movl $0x20, %edi
callq 0xaa560
movq %rax, -0x328(%rbp)
jmp 0xd324b
movb $0x1, -0x2ca(%rbp)
leaq -0x2c9(%rbp), %rdi
movq %rdi, -0x340(%rbp)
callq 0xaaa70
movq -0x328(%rbp), %rdi
movq -0x340(%rbp), %rdx
leaq 0x67735(%rip), %rsi     # 0x13a9af
callq 0xaa7d0
jmp 0xd3281
movb $0x0, -0x2ca(%rbp)
movl $0x20, %edi
callq 0xaa560
movq %rax, -0x348(%rbp)
jmp 0xd329b
movb $0x1, -0x2cc(%rbp)
leaq -0x2cb(%rbp), %rdi
movq %rdi, -0x350(%rbp)
callq 0xaaa70
movq -0x348(%rbp), %rdi
movq -0x350(%rbp), %rdx
leaq 0x676e2(%rip), %rsi     # 0x13a9ac
callq 0xaa7d0
jmp 0xd32d1
movq -0x348(%rbp), %rcx
movq -0x328(%rbp), %rdx
movq -0x330(%rbp), %rsi
movq -0x338(%rbp), %rdi
movb $0x0, -0x2cc(%rbp)
callq 0xcaee0
jmp 0xd32fb
movb $0x0, -0x2cd(%rbp)
leaq -0x2cb(%rbp), %rdi
callq 0xaa5f0
leaq -0x2c9(%rbp), %rdi
callq 0xaa5f0
movq -0x338(%rbp), %rax
movq %rax, -0x2c8(%rbp)
movq -0x2c8(%rbp), %rax
addq $0x350, %rsp            # imm = 0x350
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xd33aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xd3385
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2cb(%rbp), %rdi
callq 0xaa5f0
testb $0x1, -0x2cc(%rbp)
jne 0xd3377
jmp 0xd3383
movq -0x348(%rbp), %rdi
callq 0xaa4e0
jmp 0xd3385
leaq -0x2c9(%rbp), %rdi
callq 0xaa5f0
testb $0x1, -0x2ca(%rbp)
jne 0xd339c
jmp 0xd33a8
movq -0x328(%rbp), %rdi
callq 0xaa4e0
jmp 0xd33aa
testb $0x1, -0x2cd(%rbp)
jne 0xd33b5
jmp 0xd33c1
movq -0x338(%rbp), %rdi
callq 0xaa4e0
jmp 0xd33c3
movq -0x40(%rbp), %rdi
callq 0xaaa60
nopl (%rax)