// File: eniac[P]Mantis/src/ast/ast_nodes_p4r.cpp
// Function: P4RReactionNode::P4RReactionNode(AstNode*, AstNode*, AstNode*)
P4RReactionNode::P4RReactionNode(AstNode* name, AstNode* args, AstNode* body) {
    nodeType_ = typeid(*this).name();
    name_ = dynamic_cast<NameNode*>(name);
    name_->parent_ = this;
    args_ = dynamic_cast<ReactionArgsNode*>(args);
    args_->parent_ = this;
    if(body->nodeType_.find("EmptyNode")!=string::npos) {
        // if body is empty node
        body_ = new BodyNode(NULL, NULL, new BodyWordNode(BodyWordNode::STRING, new StrNode(new string(""))));
    } else {
        body_ = dynamic_cast<BodyNode*>(body);
    }
    body_->parent_ = this;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x40(%rbp)
callq 0xb2f00
movq -0x40(%rbp), %rax
leaq 0xa9095(%rip), %rcx     # 0x1732a8
addq $0x10, %rcx
movq %rcx, (%rax)
cmpq $0x0, %rax
jne 0xca227
callq 0xaa640
jmp 0xca227
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rdi
callq 0xb2f90
movq -0x40(%rbp), %rdi
movq %rax, %rsi
addq $0x10, %rdi
callq 0xaa7c0
jmp 0xca249
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
je 0xca289
movq -0x48(%rbp), %rdi
leaq 0xa837e(%rip), %rsi     # 0x1725e0
leaq 0xa8727(%rip), %rdx     # 0x172990
xorl %eax, %eax
movl %eax, %ecx
callq 0xaa660
movq %rax, -0x50(%rbp)
jmp 0xca291
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0xca4e0
xorl %eax, %eax
movq %rax, -0x50(%rbp)
jmp 0xca291
movq -0x40(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rax, 0x40(%rcx)
movq 0x40(%rcx), %rax
movq %rcx, 0x30(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
je 0xca2d4
movq -0x58(%rbp), %rdi
leaq 0xa8322(%rip), %rsi     # 0x1725e0
leaq 0xa9133(%rip), %rdx     # 0x1733f8
xorl %eax, %eax
movl %eax, %ecx
callq 0xaa660
movq %rax, -0x60(%rbp)
jmp 0xca2dc
xorl %eax, %eax
movq %rax, -0x60(%rbp)
jmp 0xca2dc
movq -0x40(%rbp), %rcx
movq -0x60(%rbp), %rax
movq %rax, 0x48(%rcx)
movq 0x48(%rcx), %rax
movq %rcx, 0x30(%rax)
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
leaq 0x6fa88(%rip), %rsi     # 0x139d87
xorl %eax, %eax
movl %eax, %edx
callq 0xaab90
cmpq $-0x1, %rax
je 0xca479
movl $0x60, %edi
callq 0xaa560
movq %rax, -0x68(%rbp)
jmp 0xca322
movb $0x1, -0x31(%rbp)
movl $0x50, %edi
callq 0xaa560
movq %rax, -0x70(%rbp)
jmp 0xca336
movb $0x1, -0x30(%rbp)
movl $0x48, %edi
callq 0xaa560
movq %rax, -0x78(%rbp)
jmp 0xca34a
movb $0x1, -0x2f(%rbp)
movl $0x20, %edi
callq 0xaa560
movq %rax, -0x80(%rbp)
jmp 0xca35e
movb $0x1, -0x2e(%rbp)
leaq -0x2d(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0xaaa70
movq -0x80(%rbp), %rdi
movq -0x88(%rbp), %rdx
leaq 0x7181f(%rip), %rsi     # 0x13bba3
callq 0xaa7d0
jmp 0xca38b
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdi
movb $0x0, -0x2e(%rbp)
callq 0xb2890
jmp 0xca39e
movq -0x78(%rbp), %rdx
movq -0x70(%rbp), %rdi
movb $0x0, -0x2f(%rbp)
movl $0x3, %esi
callq 0xba4d0
jmp 0xca3b6
movq -0x70(%rbp), %rcx
movq -0x68(%rbp), %rdi
movb $0x0, -0x30(%rbp)
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0xbaed0
jmp 0xca3d0
movq -0x40(%rbp), %rax
movq -0x68(%rbp), %rcx
movb $0x0, -0x31(%rbp)
movq %rcx, 0x50(%rax)
leaq -0x2d(%rbp), %rdi
callq 0xaa5f0
jmp 0xca4cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0xca466
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0xca453
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0xca440
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x2d(%rbp), %rdi
callq 0xaa5f0
testb $0x1, -0x2e(%rbp)
jne 0xca435
jmp 0xca43e
movq -0x80(%rbp), %rdi
callq 0xaa4e0
jmp 0xca440
testb $0x1, -0x2f(%rbp)
jne 0xca448
jmp 0xca451
movq -0x78(%rbp), %rdi
callq 0xaa4e0
jmp 0xca453
testb $0x1, -0x30(%rbp)
jne 0xca45b
jmp 0xca464
movq -0x70(%rbp), %rdi
callq 0xaa4e0
jmp 0xca466
testb $0x1, -0x31(%rbp)
jne 0xca46e
jmp 0xca477
movq -0x68(%rbp), %rdi
callq 0xaa4e0
jmp 0xca4e0
movq -0x20(%rbp), %rax
movq %rax, -0x90(%rbp)
cmpq $0x0, %rax
je 0xca4b1
movq -0x90(%rbp), %rdi
leaq 0xa8148(%rip), %rsi     # 0x1725e0
leaq 0xa8629(%rip), %rdx     # 0x172ac8
xorl %eax, %eax
movl %eax, %ecx
callq 0xaa660
movq %rax, -0x98(%rbp)
jmp 0xca4bc
xorl %eax, %eax
movq %rax, -0x98(%rbp)
jmp 0xca4bc
movq -0x40(%rbp), %rax
movq -0x98(%rbp), %rcx
movq %rcx, 0x50(%rax)
movq -0x40(%rbp), %rcx
movq 0x50(%rcx), %rax
movq %rcx, 0x30(%rax)
addq $0xa0, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0xb2fd0
movq -0x28(%rbp), %rdi
callq 0xaaa60
nopw %cs:(%rax,%rax)