// File: canzarlab[P]Trajan/src/CrossingConstraint.cpp
// Function: CrossingConstraint::CrossingConstraint(std::vector<Eigen::Triplet<double, int>, std::allocator<Eigen::Triplet<double, int>>>&, Graph&, Graph&, std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&, Eigen::Matrix<double, -1, 1, 0, -1, 1>&, bool)
CrossingConstraint::CrossingConstraint(vector<ET>& Triplets, Graph& t1, Graph& t2, vvi& K, Vector& x, bool swp) : Constraint(Triplets, t1, t2, K, x, swp)
{
    DP.resize(t1.GetNumNodes());
    PA.resize(t1.GetNumNodes());
    for (auto& v : DP)
        v.resize(t2.GetNumNodes());

    vb C(t1.GetNumNodes());
    DFSLeft(t1.GetRoot(), C);
    Q.push(t1.GetRoot());
    RunParallel();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movb 0x10(%rbp), %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
andb $0x1, %al
movb %al, -0x31(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
movzbl -0x31(%rbp), %r10d
andl $0x1, %r10d
movq %rsp, %rax
movl %r10d, (%rax)
callq 0xc0550
movq -0xc0(%rbp), %rdi
leaq 0xdd25c(%rip), %rax     # 0x19f6a8
movq %rax, (%rdi)
addq $0x40, %rdi
callq 0xbcd80
movq -0xc0(%rbp), %rdi
addq $0x68, %rdi
movq %rdi, -0xd0(%rbp)
callq 0xc3030
movq -0xc0(%rbp), %rdi
addq $0xb8, %rdi
movq %rdi, -0xc8(%rbp)
callq 0x9b6f0
movq -0xc0(%rbp), %rdi
addq $0xd0, %rdi
movq %rdi, -0xb8(%rbp)
movq %rdi, %rax
movq %rax, -0xb0(%rbp)
callq 0x99120
movq -0x18(%rbp), %rdi
callq 0xa8e00
movl %eax, -0xa4(%rbp)
jmp 0xc24be
movq -0xb8(%rbp), %rdi
movl -0xa4(%rbp), %eax
movslq %eax, %rsi
callq 0xc3060
jmp 0xc24d5
movq -0xc0(%rbp), %rax
addq $0xb8, %rax
movq %rax, -0xe0(%rbp)
movq -0x18(%rbp), %rdi
callq 0xa8e00
movl %eax, -0xd4(%rbp)
jmp 0xc24fa
movq -0xe0(%rbp), %rdi
movl -0xd4(%rbp), %eax
movslq %eax, %rsi
callq 0xc30f0
jmp 0xc2511
movq -0xc0(%rbp), %rax
addq $0xd0, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0x9cbe0
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
callq 0x9c860
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xc3180
testb $0x1, %al
jne 0xc254f
jmp 0xc25ad
leaq -0x58(%rbp), %rdi
callq 0xc31c0
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x20(%rbp), %rdi
callq 0xa8e00
movl %eax, -0xe4(%rbp)
jmp 0xc2578
movq -0xf0(%rbp), %rdi
movl -0xe4(%rbp), %eax
movslq %eax, %rsi
callq 0xc31e0
jmp 0xc258f
jmp 0xc2591
leaq -0x58(%rbp), %rdi
callq 0xc3270
jmp 0xc253c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xc26d2
movq -0x18(%rbp), %rdi
callq 0xa8e00
movl %eax, -0xf4(%rbp)
jmp 0xc25be
movl -0xf4(%rbp), %eax
cltq
movq %rax, -0x108(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x995b0
movq -0x108(%rbp), %rsi
movq -0x100(%rbp), %rdx
leaq -0x90(%rbp), %rdi
callq 0x995d0
jmp 0xc25fc
leaq -0x91(%rbp), %rdi
callq 0x99610
movq -0x18(%rbp), %rdi
callq 0xa8ec0
movq %rax, -0x110(%rbp)
jmp 0xc261a
movq -0x110(%rbp), %rsi
movq -0xc0(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0xc2700
jmp 0xc2636
movq -0xc0(%rbp), %rax
addq $0x68, %rax
movq %rax, -0x120(%rbp)
movq -0x18(%rbp), %rdi
callq 0xa8ec0
movq %rax, -0x118(%rbp)
jmp 0xc265a
movq -0x120(%rbp), %rdi
movq -0x118(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0xa0(%rbp), %rsi
callq 0xc3290
jmp 0xc267d
movq -0xc0(%rbp), %rdi
callq 0xc27d0
jmp 0xc268b
leaq -0x90(%rbp), %rdi
callq 0x10160
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x91(%rbp), %rdi
callq 0x99610
jmp 0xc26d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x10160
movq -0xb0(%rbp), %rdi
callq 0x994d0
movq -0xc8(%rbp), %rdi
callq 0x14b50
movq -0xd0(%rbp), %rdi
callq 0xb5c10
movq -0x40(%rbp), %rdi
callq 0xa7c0
nop