// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rsi
leaq -0x188(%rbp), %rbx
movq %rbx, %rdi
callq 0x32ac0
movq %rbx, %rdi
callq 0x6f36e
movq %rax, %r12
movq -0x188(%rbp), %rdi
testq %rdi, %rdi
je 0x4050c
callq 0x2e360
movl $0x20, %edi
callq 0x2e3a0
movq %rax, -0x30(%rbp)
testq %r12, %r12
je 0x405fd
leaq 0x36121(%rip), %rsi     # 0x7664b
leaq -0x170(%rbp), %rdi
callq 0x50494
addq $0x8, %r15
leaq -0x70(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x2e660
leaq -0x50(%rbp), %rsi
movq %r13, (%rsi)
leaq 0x143b3(%rip), %r13     # 0x5490a
movq %r13, 0x8(%rsi)
leaq 0x143ae(%rip), %rbx     # 0x54910
movq %rbx, 0x10(%rsi)
leaq -0x170(%rbp), %rdi
callq 0x537b3
movq %rax, %r15
movq 0x48(%r12), %rsi
movq (%rsi), %rax
leaq -0x50(%rbp), %r12
movq %r12, %rdi
callq *(%rax)
leaq -0x90(%rbp), %rsi
movq %r12, (%rsi)
movq %r13, 0x8(%rsi)
movq %rbx, 0x10(%rsi)
movq %r15, %rdi
callq 0x537b3
movq %rax, %r15
addq $0x8, %r14
leaq -0x90(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x2e660
leaq -0x1a0(%rbp), %rsi
movq %r12, (%rsi)
movq %r13, 0x8(%rsi)
movq %rbx, 0x10(%rsi)
movq %r15, %rdi
movq -0x30(%rbp), %rbx
callq 0x537b3
movq %rbx, %rdi
movq %rax, %rsi
callq 0x54924
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x406b7
callq 0x2e360
jmp 0x406b7
leaq 0x36047(%rip), %rsi     # 0x7664b
leaq -0x170(%rbp), %rdi
callq 0x50494
addq $0x8, %r15
leaq -0x70(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x2e660
leaq -0x50(%rbp), %rsi
movq %r12, (%rsi)
leaq 0x142d9(%rip), %rbx     # 0x5490a
movq %rbx, 0x8(%rsi)
leaq 0x142d4(%rip), %r13     # 0x54910
movq %r13, 0x10(%rsi)
leaq -0x170(%rbp), %rdi
callq 0x537b3
leaq 0x37288(%rip), %rcx     # 0x778db
leaq -0x50(%rbp), %rsi
movq %rcx, (%rsi)
leaq 0x14878(%rip), %rcx     # 0x54ed9
movq %rcx, 0x8(%rsi)
leaq 0x14873(%rip), %rcx     # 0x54edf
movq %rcx, 0x10(%rsi)
movq %rax, %rdi
callq 0x537b3
movq %rax, %r15
addq $0x8, %r14
leaq -0x50(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x2e660
leaq -0x90(%rbp), %rsi
movq %r12, (%rsi)
movq %rbx, 0x8(%rsi)
movq %r13, 0x10(%rsi)
movq %r15, %rdi
movq -0x30(%rbp), %rbx
callq 0x537b3
movq %rbx, %rdi
movq %rax, %rsi
callq 0x54924
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x406c9
callq 0x2e360
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x406db
callq 0x2e360
cmpb $0x1, -0xa0(%rbp)
jne 0x406f8
leaq -0x98(%rbp), %r14
movq %r14, %rdi
callq 0x2e580
movb $0x0, -0x8(%r14)
leaq -0xf8(%rbp), %r14
movq %r14, %rdi
callq 0x507e2
movq -0x28(%r14), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x4071c
callq 0x2e360
movq -0x158(%rbp), %rdi
testq %rdi, %rdi
je 0x40750
callq 0x2e360
xorl %eax, %eax
movq %rax, -0x158(%rbp)
movl %eax, -0x150(%rbp)
movq %rax, -0x148(%rbp)
movl %eax, -0x140(%rbp)
movq %rax, -0x138(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x50840
movl $0x58, %edi
callq 0x2e3a0
movq %rax, %r15
movl $0x20, %edi
callq 0x2e3a0
movq %rax, %r12
addq $0x10, %rax
movq %rax, (%r12)
leaq 0x35f62(%rip), %rsi     # 0x766e7
leaq 0x35f63(%rip), %rdx     # 0x766ef
movq %r12, %rdi
callq 0x32e40
movl $0x20, %edi
callq 0x2e3a0
movq %rax, %r13
addq $0x10, %rax
movq %rax, (%r13)
leaq 0x35f34(%rip), %rsi     # 0x766e4
leaq 0x35f38(%rip), %rdx     # 0x766ef
movq %r13, %rdi
callq 0x32e40
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x3e120
movq %r15, %rax
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x40805
jmp 0x407f3
jmp 0x407f8
jmp 0x40800
jmp 0x40800
jmp 0x40805
jmp 0x40805
movq %rax, %r14
jmp 0x40875
movq %rax, %r14
jmp 0x40881
movq %rax, %r14
jmp 0x40851
movq %rax, %r14
jmp 0x40863
jmp 0x40823
movq %rax, %r14
movq %r13, %rdi
jmp 0x4081c
jmp 0x40823
movq %rax, %r14
movq %r12, %rdi
callq 0x2e360
jmp 0x40826
movq %rax, %r14
movq %r15, %rdi
jmp 0x40885
movq %rax, %r14
movq -0x188(%rbp), %rdi
testq %rdi, %rdi
jne 0x40885
jmp 0x4088a
movq %rax, %r14
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40851
callq 0x2e360
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40863
callq 0x2e360
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40875
callq 0x2e360
leaq -0x170(%rbp), %rdi
callq 0x505f8
movq -0x30(%rbp), %rdi
callq 0x2e360
movq %r14, %rdi
callq 0x2e730