// File: /workspace/github_cpp_makefile_star2_O2/Manca[P]algorithms2/./assignment6.hpp
// Function: assignment6::readFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::unordered_map<int, std::vector<int, std::allocator<int>>, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<int const, std::vector<int, std::allocator<int>>>>>&, std::unordered_map<int, std::vector<int, std::allocator<int>>, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<int const, std::vector<int, std::allocator<int>>>>>&)
void readFile(const std::string& fileName, Graph& GOrig, Graph& GRev)
    {
        std::ifstream file(fileName, std::ios::in);
        int n;
        file >> n;

        PROFILE("Reading file: " + fileName);
        if (file.is_open())
        {
            int tail, head;
            while (file >> tail >> head)
            {
                // two edges per x,y pair
                GOrig[-tail].push_back(head);   // 1) notX => y
                if (GOrig.count(head) == 0)
                    GOrig[head] = std::vector<int>();

                GOrig[-head].push_back(tail);   // 2) notY => x
                if (GOrig.count(tail) == 0)
                    GOrig[tail] = std::vector<int>();

                // the same for reversed graph
                GRev[head].push_back(-tail);
                if (GRev.count(-tail) == 0)
                    GRev[-tail] = std::vector<int>();

                GRev[tail].push_back(-head);
                if (GRev.count(-head) == 0)
                    GRev[-head] = std::vector<int>();

            }
            file.close();
        }
        PROFILE_STOP();
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x40(%rsp), %r12
pushq $0x8
popq %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x2320
leaq 0x3c(%rsp), %rsi
movq %r12, %rdi
callq 0x21a0
callq 0x725c
movq %rax, %r12
leaq 0x85d4(%rip), %rsi      # 0xd8aa
leaq 0x10(%rsp), %rdi
movq %r15, %rdx
callq 0x75fa
leaq 0x10(%rsp), %rsi
movq %r12, %rdi
callq 0x72a6
leaq 0x10(%rsp), %rdi
callq 0x2150
leaq 0xb8(%rsp), %rdi
callq 0x20c0
testb %al, %al
je 0x54fa
leaq 0x40(%rsp), %r15
leaq 0x8(%rsp), %r12
leaq 0x4(%rsp), %r13
leaq 0x10(%rsp), %rbp
movq %r15, %rdi
movq %r12, %rsi
callq 0x21a0
movq %rax, %rdi
movq %r13, %rsi
callq 0x21a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x54f0
xorl %eax, %eax
subl 0x8(%rsp), %eax
movl %eax, 0x10(%rsp)
movq %r14, %rdi
movq %rbp, %rsi
callq 0xbfbe
movq %rax, %rdi
movq %r13, %rsi
callq 0x71b6
movq %r14, %rdi
movq %r13, %rsi
callq 0xc314
testq %rax, %rax
jne 0x53a7
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0xc346
movq %rax, %rdi
movq %rbp, %rsi
callq 0xc41c
movq %rbp, %rdi
callq 0x9cda
xorl %eax, %eax
subl 0x4(%rsp), %eax
movl %eax, 0x10(%rsp)
movq %r14, %rdi
movq %rbp, %rsi
callq 0xbfbe
movq %rax, %rdi
movq %r12, %rsi
callq 0x71b6
movq %r14, %rdi
movq %r12, %rsi
callq 0xc314
testq %rax, %rax
jne 0x5403
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0xc346
movq %rax, %rdi
movq %rbp, %rsi
callq 0xc41c
movq %rbp, %rdi
callq 0x9cda
movq %rbx, %rdi
movq %r13, %rsi
callq 0xc346
xorl %ecx, %ecx
subl 0x8(%rsp), %ecx
movl %ecx, 0x10(%rsp)
movq %rax, %rdi
movq %rbp, %rsi
callq 0xc46e
xorl %eax, %eax
subl 0x8(%rsp), %eax
movl %eax, 0x10(%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xc314
testq %rax, %rax
jne 0x5475
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
xorl %eax, %eax
subl 0x8(%rsp), %eax
movl %eax, 0xc(%rsp)
movq %rbx, %rdi
leaq 0xc(%rsp), %rsi
callq 0xbfbe
movq %rax, %rdi
movq %rbp, %rsi
callq 0xc41c
movq %rbp, %rdi
callq 0x9cda
movq %rbx, %rdi
movq %r12, %rsi
callq 0xc346
xorl %ecx, %ecx
subl 0x4(%rsp), %ecx
movl %ecx, 0x10(%rsp)
movq %rax, %rdi
movq %rbp, %rsi
callq 0xc46e
xorl %eax, %eax
subl 0x4(%rsp), %eax
movl %eax, 0x10(%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xc314
testq %rax, %rax
jne 0x5323
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
xorl %eax, %eax
subl 0x4(%rsp), %eax
movl %eax, 0xc(%rsp)
movq %rbx, %rdi
leaq 0xc(%rsp), %rsi
callq 0xbfbe
movq %rax, %rdi
movq %rbp, %rsi
callq 0xc41c
movq %rbp, %rdi
callq 0x9cda
jmp 0x5323
leaq 0x40(%rsp), %rdi
callq 0x2090
callq 0x725c
movq %rax, %rdi
callq 0x72c8
leaq 0x40(%rsp), %rdi
callq 0x20e0
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5559
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2150
jmp 0x555c
jmp 0x5559
jmp 0x5559
jmp 0x553e
jmp 0x553e
jmp 0x553e
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x9cda
jmp 0x555c
jmp 0x5559
jmp 0x5559
jmp 0x5559
jmp 0x5559
jmp 0x5559
jmp 0x5559
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x2380