// File: eniac[P]Mantis/src/compile/find_nodes.cpp
// Function: findTableActionStmts(std::vector<AstNode*, std::allocator<AstNode*>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
unordered_map<TableActionStmtNode*, TableNode*> findTableActionStmts(
            const vector<AstNode*>& astNodes, const string& actionName) {
    auto ret = unordered_map<TableActionStmtNode*, TableNode*>();

    for (auto node : astNodes) {
        if (typeContains(node, "TableNode") && !typeContains(node, "P4R")) {
            TableNode* table = dynamic_cast<TableNode*>(node);
            TableActionStmtsNode* actions = table->actions_;
            for (TableActionStmtNode* tas : *actions->list_) {
                if (*tas->name_->word_ == actionName) {
                    ret.emplace(tas, table);
                    break;
                }
            }
        }
    }
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x98(%rbp)
movq %rdi, %rax
movq %rax, -0xa0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
xorl %esi, %esi
movl $0x38, %edx
callq 0xaa330
movq -0x98(%rbp), %rdi
callq 0x12fa80
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xb8280
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0xb82b0
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x12f810
testb $0x1, %al
jne 0x12d2fc
jmp 0x12d497
leaq -0x30(%rbp), %rdi
callq 0x12f850
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
leaq 0xeba2(%rip), %rsi      # 0x13beb9
callq 0x12c730
movb %al, -0xa1(%rbp)
jmp 0x12d324
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0x12d333
jmp 0x12d487
movq -0x40(%rbp), %rdi
leaq 0xe854(%rip), %rsi      # 0x13bb92
callq 0x12c730
movb %al, -0xa2(%rbp)
jmp 0x12d34b
movb -0xa2(%rbp), %al
testb $0x1, %al
jne 0x12d487
jmp 0x12d35b
movq -0x40(%rbp), %rax
movq %rax, -0xb0(%rbp)
cmpq $0x0, %rax
je 0x12d3b0
movq -0xb0(%rbp), %rdi
leaq 0x45266(%rip), %rsi     # 0x1725e0
leaq 0x45a77(%rip), %rdx     # 0x172df8
xorl %eax, %eax
movl %eax, %ecx
callq 0xaa660
movq %rax, -0xb8(%rbp)
jmp 0x12d3bb
movq -0x98(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x128140
jmp 0x12d4bd
xorl %eax, %eax
movq %rax, -0xb8(%rbp)
jmp 0x12d3bb
movq -0xb8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
callq 0xb4ca0
movq %rax, -0x70(%rbp)
movq -0x68(%rbp), %rdi
callq 0xb4b30
movq %rax, -0x78(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0xc0190
testb $0x1, %al
jne 0x12d40b
jmp 0x12d485
leaq -0x70(%rbp), %rdi
callq 0xc01d0
movq (%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x40(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xfef60
testb $0x1, %al
jne 0x12d436
jmp 0x12d475
movq -0x98(%rbp), %rdi
leaq -0x80(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x12faa0
movb %dl, -0xc1(%rbp)
movq %rax, -0xc0(%rbp)
jmp 0x12d459
movb -0xc1(%rbp), %al
movq -0xc0(%rbp), %rcx
movq %rcx, -0x90(%rbp)
movb %al, -0x88(%rbp)
jmp 0x12d485
jmp 0x12d477
leaq -0x70(%rbp), %rdi
callq 0xc01f0
jmp 0x12d3f8
jmp 0x12d487
jmp 0x12d489
leaq -0x30(%rbp), %rdi
callq 0x12f870
jmp 0x12d2e6
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x12d4ad
movq -0x98(%rbp), %rdi
callq 0x128140
movq -0xa0(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0xaaa60
nopw %cs:(%rax,%rax)