// File: eniac[P]Mantis/src/ast/ast_nodes_p4.cpp
// Function: P4ExprNode::toString[abi:cxx11]()
string P4ExprNode::toString() {
    ostringstream oss;
    oss << keyword_->toString() << " "
        << name1_->toString() << " ";

    // Append name2 if its present
    if (name2_) {
        if (keyword_->toString().compare("calculated_field")==0) {
            oss << ". "
                << name2_->toString();
        } else {
            oss << name2_->toString();
        }
    }

    // Append opts if they're present
    if (opts_) {
        oss << "(" << opts_->toString() << ") ";
    }

    // Append body if its present.
    if (body_) {
        string res = body_->toString();
        oss << "{\n" << res << "}\n";
    } else {
        // If there's no body, its a statement that 
        // ends with a semicolon
        oss << ";";
    }
    return oss.str();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2e0, %rsp            # imm = 0x2E0
movq %rdi, -0x290(%rbp)
movq %rdi, %rax
movq %rax, -0x288(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x280(%rbp)
leaq -0x188(%rbp), %rdi
callq 0xaa7b0
movq -0x280(%rbp), %rax
movq 0x40(%rax), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x1a8(%rbp), %rdi
callq *%rax
jmp 0xbc197
leaq -0x188(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0xaa4c0
movq %rax, -0x298(%rbp)
jmp 0xbc1b3
movq -0x298(%rbp), %rdi
leaq 0x80178(%rip), %rsi     # 0x13c339
callq 0xaa540
movq %rax, -0x2a0(%rbp)
jmp 0xbc1cf
movq -0x280(%rbp), %rax
movq 0x48(%rax), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x1d8(%rbp), %rdi
callq *%rax
jmp 0xbc1eb
movq -0x2a0(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0xaa4c0
movq %rax, -0x2a8(%rbp)
jmp 0xbc207
movq -0x2a8(%rbp), %rdi
leaq 0x80124(%rip), %rsi     # 0x13c339
callq 0xaa540
jmp 0xbc21c
leaq -0x1d8(%rbp), %rdi
callq 0xaabe8
leaq -0x1a8(%rbp), %rdi
callq 0xaabe8
movq -0x280(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0xbc3d5
movq -0x280(%rbp), %rax
movq 0x40(%rax), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x1f8(%rbp), %rdi
callq *%rax
jmp 0xbc262
leaq -0x1f8(%rbp), %rdi
leaq 0x7db3a(%rip), %rsi     # 0x139daa
callq 0xaa180
movl %eax, -0x2ac(%rbp)
leaq -0x1f8(%rbp), %rdi
callq 0xaabe8
movl -0x2ac(%rbp), %eax
cmpl $0x0, %eax
jne 0xbc371
leaq 0x7db8f(%rip), %rsi     # 0x139e2c
leaq -0x188(%rbp), %rdi
callq 0xaa540
movq %rax, -0x2b8(%rbp)
jmp 0xbc2b2
movq -0x280(%rbp), %rax
movq 0x50(%rax), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x218(%rbp), %rdi
callq *%rax
jmp 0xbc2ce
movq -0x2b8(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0xaa4c0
jmp 0xbc2e3
leaq -0x218(%rbp), %rdi
callq 0xaabe8
jmp 0xbc3d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b0(%rbp)
movl %eax, -0x1b4(%rbp)
jmp 0xbc572
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b0(%rbp)
movl %eax, -0x1b4(%rbp)
jmp 0xbc33d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b0(%rbp)
movl %eax, -0x1b4(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0xaabe8
leaq -0x1a8(%rbp), %rdi
callq 0xaabe8
jmp 0xbc572
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b0(%rbp)
movl %eax, -0x1b4(%rbp)
leaq -0x218(%rbp), %rdi
callq 0xaabe8
jmp 0xbc572
movq -0x280(%rbp), %rax
movq 0x50(%rax), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x238(%rbp), %rdi
callq *%rax
jmp 0xbc38d
leaq -0x188(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0xaa4c0
jmp 0xbc3a2
leaq -0x238(%rbp), %rdi
callq 0xaabe8
jmp 0xbc3d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b0(%rbp)
movl %eax, -0x1b4(%rbp)
leaq -0x238(%rbp), %rdi
callq 0xaabe8
jmp 0xbc572
jmp 0xbc3d5
movq -0x280(%rbp), %rax
cmpq $0x0, 0x58(%rax)
je 0xbc481
leaq 0x81b9b(%rip), %rsi     # 0x13df89
leaq -0x188(%rbp), %rdi
callq 0xaa540
movq %rax, -0x2c0(%rbp)
jmp 0xbc403
movq -0x280(%rbp), %rax
movq 0x58(%rax), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x258(%rbp), %rdi
callq *%rax
jmp 0xbc41f
movq -0x2c0(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0xaa4c0
movq %rax, -0x2c8(%rbp)
jmp 0xbc43b
movq -0x2c8(%rbp), %rdi
leaq 0x7d972(%rip), %rsi     # 0x139dbb
callq 0xaa540
jmp 0xbc450
leaq -0x258(%rbp), %rdi
callq 0xaabe8
jmp 0xbc481
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b0(%rbp)
movl %eax, -0x1b4(%rbp)
leaq -0x258(%rbp), %rdi
callq 0xaabe8
jmp 0xbc572
movq -0x280(%rbp), %rax
cmpq $0x0, 0x60(%rax)
je 0xbc52a
movq -0x280(%rbp), %rax
movq 0x60(%rax), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x278(%rbp), %rdi
callq *%rax
jmp 0xbc4af
leaq 0x81ae2(%rip), %rsi     # 0x13df98
leaq -0x188(%rbp), %rdi
callq 0xaa540
movq %rax, -0x2d0(%rbp)
jmp 0xbc4cb
movq -0x2d0(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0xaa4c0
movq %rax, -0x2d8(%rbp)
jmp 0xbc4e7
movq -0x2d8(%rbp), %rdi
leaq 0x7e4b4(%rip), %rsi     # 0x13a9a9
callq 0xaa540
jmp 0xbc4fc
leaq -0x278(%rbp), %rdi
callq 0xaabe8
jmp 0xbc541
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b0(%rbp)
movl %eax, -0x1b4(%rbp)
leaq -0x278(%rbp), %rdi
callq 0xaabe8
jmp 0xbc572
leaq 0x7e4c4(%rip), %rsi     # 0x13a9f5
leaq -0x188(%rbp), %rdi
callq 0xaa540
jmp 0xbc53f
jmp 0xbc541
movq -0x290(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0xaa580
jmp 0xbc556
leaq -0x188(%rbp), %rdi
callq 0xaa130
movq -0x288(%rbp), %rax
addq $0x2e0, %rsp            # imm = 0x2E0
popq %rbp
retq
leaq -0x188(%rbp), %rdi
callq 0xaa130
movq -0x1b0(%rbp), %rdi
callq 0xaaa60
nopw (%rax,%rax)