// File: eniac[P]Mantis/src/compile/compile_p4.cpp
// Function: transformMalleableTables(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, P4RMalleableTableNode*, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, P4RMalleableTableNode*>>>*, std::vector<AstNode*, std::allocator<AstNode*>>, int, int)
void transformMalleableTables(unordered_map<string, P4RMalleableTableNode*>* varTables, vector<AstNode*> nodeArray, int ing_iso_opt, int egr_iso_opt) {
    for (auto t : *varTables) {
        // Check if mbl table in ing/egr
        if(findTblInIng(t.second->table_->name_->toString(), nodeArray)) {
            if (((unsigned int)ing_iso_opt) & 0b10) {
                auto field = new FieldNode(new NameNode(new string(kP4rIngMetadataName)),
                                        new NameNode(new string("__vv")));
                auto readstmt = new TableReadStmtNode(TableReadStmtNode::EXACT, field);
                t.second->table_->reads_->list_->push_back(readstmt);
            }
        } else {
            if (((unsigned int)egr_iso_opt) & 0b10) {
                auto field = new FieldNode(new NameNode(new string(kP4rEgrMetadataName)),
                                        new NameNode(new string("__vv")));
                auto readstmt = new TableReadStmtNode(TableReadStmtNode::EXACT, field);
                t.second->table_->reads_->list_->push_back(readstmt);
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rsi, -0xc0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1279b0
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1279e0
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x127a10
testb $0x1, %al
jne 0x1195c8
jmp 0x119c4f
leaq -0x28(%rbp), %rdi
callq 0x127a40
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0x127a70
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x40(%rax), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x78(%rbp), %rdi
callq *%rax
jmp 0x1195f7
movq -0xc0(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x12e680
movb %al, -0xc1(%rbp)
jmp 0x11960f
leaq -0x78(%rbp), %rdi
callq 0xaabe8
movb -0xc1(%rbp), %al
testb $0x1, %al
jne 0x119627
jmp 0x119947
movl -0x14(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x119942
movl $0x50, %edi
callq 0xaa560
movq %rax, -0xd0(%rbp)
jmp 0x119649
movb $0x1, -0x97(%rbp)
movl $0x48, %edi
callq 0xaa560
movq %rax, -0xd8(%rbp)
jmp 0x119663
movb $0x1, -0x93(%rbp)
movl $0x20, %edi
callq 0xaa560
movq %rax, -0xe0(%rbp)
jmp 0x11967d
movb $0x1, -0x92(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0xaaa70
movq -0xe0(%rbp), %rdi
movq -0xe8(%rbp), %rdx
leaq 0x22817(%rip), %rsi     # 0x13bec3
callq 0xaa7d0
jmp 0x1196b3
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdi
movb $0x0, -0x92(%rbp)
callq 0xb26f0
jmp 0x1196cf
movb $0x0, -0x93(%rbp)
movl $0x48, %edi
callq 0xaa560
movq %rax, -0xf0(%rbp)
jmp 0x1196e9
movb $0x1, -0x96(%rbp)
movl $0x20, %edi
callq 0xaa560
movq %rax, -0xf8(%rbp)
jmp 0x119703
movb $0x1, -0x95(%rbp)
leaq -0x94(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0xaaa70
movq -0xf8(%rbp), %rdi
movq -0x100(%rbp), %rdx
leaq 0x24a82(%rip), %rsi     # 0x13e1b4
callq 0xaa7d0
jmp 0x119739
movq -0xf8(%rbp), %rsi
movq -0xf0(%rbp), %rdi
movb $0x0, -0x95(%rbp)
callq 0xb26f0
jmp 0x119755
movq -0xf0(%rbp), %rdx
movq -0xd8(%rbp), %rsi
movq -0xd0(%rbp), %rdi
movb $0x0, -0x96(%rbp)
callq 0xc89b0
jmp 0x119778
movb $0x0, -0x97(%rbp)
leaq -0x94(%rbp), %rdi
callq 0xaa5f0
leaq -0x91(%rbp), %rdi
callq 0xaa5f0
movq -0xd0(%rbp), %rax
movq %rax, -0x90(%rbp)
movl $0x48, %edi
callq 0xaa560
movq %rax, -0x108(%rbp)
jmp 0x1197b8
movq -0x108(%rbp), %rdi
movq -0x90(%rbp), %rdx
xorl %esi, %esi
callq 0xbc9c0
jmp 0x1197cf
movq -0x108(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x48(%rax), %rax
movq 0x40(%rax), %rdi
leaq -0xa0(%rbp), %rsi
callq 0xb4140
jmp 0x1197fb
jmp 0x119942
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x119c44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x78(%rbp), %rdi
callq 0xaabe8
jmp 0x119c44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x119906
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x1198ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x1198c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x1198af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x94(%rbp), %rdi
callq 0xaa5f0
testb $0x1, -0x95(%rbp)
jne 0x1198a1
jmp 0x1198ad
movq -0xf8(%rbp), %rdi
callq 0xaa4e0
jmp 0x1198af
testb $0x1, -0x96(%rbp)
jne 0x1198ba
jmp 0x1198c6
movq -0xf0(%rbp), %rdi
callq 0xaa4e0
jmp 0x1198c8
leaq -0x91(%rbp), %rdi
callq 0xaa5f0
testb $0x1, -0x92(%rbp)
jne 0x1198df
jmp 0x1198eb
movq -0xe0(%rbp), %rdi
callq 0xaa4e0
jmp 0x1198ed
testb $0x1, -0x93(%rbp)
jne 0x1198f8
jmp 0x119904
movq -0xd8(%rbp), %rdi
callq 0xaa4e0
jmp 0x119906
testb $0x1, -0x97(%rbp)
jne 0x119911
jmp 0x11991d
movq -0xd0(%rbp), %rdi
callq 0xaa4e0
jmp 0x119c44
movq -0x108(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
callq 0xaa4e0
jmp 0x119c44
jmp 0x119c2d
movl -0x18(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x119c2b
movl $0x50, %edi
callq 0xaa560
movq %rax, -0x110(%rbp)
jmp 0x119969
movb $0x1, -0xaf(%rbp)
movl $0x48, %edi
callq 0xaa560
movq %rax, -0x118(%rbp)
jmp 0x119983
movb $0x1, -0xab(%rbp)
movl $0x20, %edi
callq 0xaa560
movq %rax, -0x120(%rbp)
jmp 0x11999d
movb $0x1, -0xaa(%rbp)
leaq -0xa9(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0xaaa70
movq -0x120(%rbp), %rdi
movq -0x128(%rbp), %rdx
leaq 0x22515(%rip), %rsi     # 0x13bee1
callq 0xaa7d0
jmp 0x1199d3
movq -0x120(%rbp), %rsi
movq -0x118(%rbp), %rdi
movb $0x0, -0xaa(%rbp)
callq 0xb26f0
jmp 0x1199ef
movb $0x0, -0xab(%rbp)
movl $0x48, %edi
callq 0xaa560
movq %rax, -0x130(%rbp)
jmp 0x119a09
movb $0x1, -0xae(%rbp)
movl $0x20, %edi
callq 0xaa560
movq %rax, -0x138(%rbp)
jmp 0x119a23
movb $0x1, -0xad(%rbp)
leaq -0xac(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0xaaa70
movq -0x138(%rbp), %rdi
movq -0x140(%rbp), %rdx
leaq 0x24762(%rip), %rsi     # 0x13e1b4
callq 0xaa7d0
jmp 0x119a59
movq -0x138(%rbp), %rsi
movq -0x130(%rbp), %rdi
movb $0x0, -0xad(%rbp)
callq 0xb26f0
jmp 0x119a75
movq -0x130(%rbp), %rdx
movq -0x118(%rbp), %rsi
movq -0x110(%rbp), %rdi
movb $0x0, -0xae(%rbp)
callq 0xc89b0
jmp 0x119a98
movb $0x0, -0xaf(%rbp)
leaq -0xac(%rbp), %rdi
callq 0xaa5f0
leaq -0xa9(%rbp), %rdi
callq 0xaa5f0
movq -0x110(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl $0x48, %edi
callq 0xaa560
movq %rax, -0x148(%rbp)
jmp 0x119ad8
movq -0x148(%rbp), %rdi
movq -0xa8(%rbp), %rdx
xorl %esi, %esi
callq 0xbc9c0
jmp 0x119aef
movq -0x148(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x48(%rax), %rax
movq 0x40(%rax), %rdi
leaq -0xb8(%rbp), %rsi
callq 0xb4140
jmp 0x119b1b
jmp 0x119c2b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x119bf5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x119bdc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x119bb7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x119b9e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xac(%rbp), %rdi
callq 0xaa5f0
testb $0x1, -0xad(%rbp)
jne 0x119b90
jmp 0x119b9c
movq -0x138(%rbp), %rdi
callq 0xaa4e0
jmp 0x119b9e
testb $0x1, -0xae(%rbp)
jne 0x119ba9
jmp 0x119bb5
movq -0x130(%rbp), %rdi
callq 0xaa4e0
jmp 0x119bb7
leaq -0xa9(%rbp), %rdi
callq 0xaa5f0
testb $0x1, -0xaa(%rbp)
jne 0x119bce
jmp 0x119bda
movq -0x120(%rbp), %rdi
callq 0xaa4e0
jmp 0x119bdc
testb $0x1, -0xab(%rbp)
jne 0x119be7
jmp 0x119bf3
movq -0x118(%rbp), %rdi
callq 0xaa4e0
jmp 0x119bf5
testb $0x1, -0xaf(%rbp)
jne 0x119c00
jmp 0x119c0c
movq -0x110(%rbp), %rdi
callq 0xaa4e0
jmp 0x119c44
movq -0x148(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
callq 0xaa4e0
jmp 0x119c44
jmp 0x119c2d
leaq -0x58(%rbp), %rdi
callq 0xce600
leaq -0x28(%rbp), %rdi
callq 0x127ab0
jmp 0x1195b2
leaq -0x58(%rbp), %rdi
callq 0xce600
jmp 0x119c58
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0xaaa60
nopw %cs:(%rax,%rax)