// File: /workspace/github_cpp_makefile_star2_O2/Manca[P]algorithms2/main.cpp
// Function: main
int main(int argc, const char * argv[]) 
{
    PROFILE("All problems for Algorithms 2 course")

    ///////////////////// Assignment 1 //////////////////////////
	std::cout << "*** Assignment 1 - Scheduling problem ***" << std::endl;
	assignment1::scheduling_problem::run_algorithm("data/jobs.txt");

	std::cout << std::endl << "*** Assignment 1 - Prim's algorithm - Test Case 1 ***" << std::endl;
	if (assignment1::prims_algorithm::test1())
		std::cout << "... Test passed!" << std::endl;

	std::cout << "*** Assignment 1 - Prim's algorithm - Main Test Case ***" << std::endl;
	assignment1::prims_algorithm::run_algorithm("data/edges.txt");

    ///////////////////// Assignment 2 //////////////////////////
    std::cout << std::endl << "*** Assignment 2 - UnionFind Test Case 1 ***" << std::endl;
    if (DataStructures::TestCase1())
        std::cout << "... Test passed!" << std::endl;

    std::cout << "*** Assignment 2 - Clustering - Max-Spacing K=4 Clustering ***" << std::endl;
    int max_spacing = assignment2::four_clustering::four_clustering("data/clustering1.txt");
    std::cout << "Max-Spacing clustering is: " << max_spacing << std::endl;

    std::cout << "*** Assignment 2 - Big Clustering - Hamming distance ***" << std::endl;
    assignment2::clustering_big::run_algorithm("data/clustering_big.txt");
    std::cout << "*** Assignment 2 - Big Clustering - Hamming distance - Faster Algorithm ***" << std::endl;
    assignment2::clustering_big::run_faster_algorithm("data/clustering_big.txt");

    ///////////////////// Assignment 3 //////////////////////////
    std::cout << std::endl << "*** Assignment 3 - Knapsack - Test Case 1 ***" << std::endl;
    if (assignment3::knapsack_1::testCase1())
        std::cout << "... Test passed!" << std::endl;
    std::cout << "*** Assignment 3 - Knapsack - Problem 1 ***" << std::endl;
    assignment3::knapsack_1::run_algorithm("data/knapsack1.txt");

    std::cout << "*** Assignment 3 - Knapsack - Problem 2 - Test Case 1 ***" << std::endl;
    if (assignment3::knapsack_big::testCase1())
        std::cout << "... Test passed!" << std::endl;
    std::cout << "*** Assignment 3 - Knapsack - Problem 2 ***" << std::endl;
    assignment3::knapsack_big::run_algorithm("data/knapsack_big.txt");

    ///////////////////// Assignment 4 //////////////////////////
    std::cout << std::endl << "*** Assignment 4 - All-Pairs Shortest Path ***" << std::endl;
    assignment4::run_algorithm("data/g1.txt");
    assignment4::run_algorithm("data/g2.txt");
    assignment4::run_algorithm("data/g3.txt"); 

    ///////////////////// Assignment 5 //////////////////////////
    std::cout << std::endl << "*** Assignment 5 - Traveling Salesman Problem ***" << std::endl;
    PROFILE("TSP")
    assignment5::TSP tsp("data/tsp.txt");
    tsp.solve();
    PROFILE_STOP();
    
    ///////////////////// Assignment 6 //////////////////////////
    std::cout << std::endl << "*** Assignment 6 - 2-SAT Problem ***" << std::endl;
    std::vector<bool> res;
    PROFILE("2 SAT");
    res.push_back(assignment6::run_algorithm("data/2sat1.txt"));
    res.push_back(assignment6::run_algorithm("data/2sat2.txt"));
    res.push_back(assignment6::run_algorithm("data/2sat3.txt"));
    res.push_back(assignment6::run_algorithm("data/2sat4.txt"));
    res.push_back(assignment6::run_algorithm("data/2sat5.txt"));
    res.push_back(assignment6::run_algorithm("data/2sat6.txt"));
    PROFILE_STOP();
    std::cout << "Solution:";
    for (bool sln : res)
        std::cout << " " << sln;
    
    std::cout << std::endl;
    PROFILE_STOP(); // main
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
callq 0x725c
movq %rax, %rbx
leaq 0x7b08(%rip), %rsi      # 0xd8d4
leaq 0x8(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x2120
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x72a6
leaq 0x8(%rsp), %rdi
callq 0x2150
movq 0x101df(%rip), %rdi     # 0x15fd8
leaq 0x7af9(%rip), %rsi      # 0xd8f9
callq 0x2230
movq %rax, %rdi
callq 0x2160
leaq 0x7b0f(%rip), %rsi      # 0xd923
leaq 0x8(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x2120
leaq 0x8(%rsp), %rdi
callq 0x2887
leaq 0x8(%rsp), %rdi
callq 0x2150
movq 0x1019a(%rip), %rbx     # 0x15fd8
movq %rbx, %rdi
callq 0x2160
leaq 0x7ae4(%rip), %rsi      # 0xd931
movq %rax, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2160
callq 0x2bbb
leaq 0x7afe(%rip), %rsi      # 0xd967
movq %rbx, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2160
leaq 0x7af8(%rip), %rsi      # 0xd978
movq %rbx, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2160
leaq 0x7b1a(%rip), %rsi      # 0xd9b1
leaq 0x8(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x2120
leaq 0x8(%rsp), %rdi
callq 0x2dd3
leaq 0x8(%rsp), %rdi
callq 0x2150
movq 0x10117(%rip), %rbx     # 0x15fd8
movq %rbx, %rdi
callq 0x2160
leaq 0x7af0(%rip), %rsi      # 0xd9c0
movq %rax, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2160
callq 0x309d
leaq 0x7a7b(%rip), %rsi      # 0xd967
movq %rbx, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2160
leaq 0x7aea(%rip), %rsi      # 0xd9ed
movq %rbx, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2160
leaq 0x7b12(%rip), %rsi      # 0xda2c
leaq 0x8(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x2120
leaq 0x8(%rsp), %rdi
callq 0x3406
movl %eax, %ebx
leaq 0x8(%rsp), %rdi
callq 0x2150
movq 0x10092(%rip), %r14     # 0x15fd8
leaq 0x7af4(%rip), %rsi      # 0xda41
movq %r14, %rdi
callq 0x2230
movq %rax, %rdi
movl %ebx, %esi
callq 0x2370
movq %rax, %rdi
callq 0x2160
leaq 0x7aef(%rip), %rsi      # 0xda5d
movq %r14, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2160
leaq 0x7b11(%rip), %rsi      # 0xda96
leaq 0x8(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x2120
leaq 0x8(%rsp), %rdi
callq 0x37c8
leaq 0x8(%rsp), %rdi
callq 0x2150
movq 0x10029(%rip), %rdi     # 0x15fd8
leaq 0x7af8(%rip), %rsi      # 0xdaae
callq 0x2230
movq %rax, %rdi
callq 0x2160
leaq 0x7acc(%rip), %rsi      # 0xda96
leaq 0x8(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x2120
leaq 0x8(%rsp), %rdi
callq 0x3d59
leaq 0x8(%rsp), %rdi
callq 0x2150
movq 0xffe4(%rip), %rbx      # 0x15fd8
movq %rbx, %rdi
callq 0x2160
leaq 0x7af7(%rip), %rsi      # 0xdafa
movq %rax, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2160
callq 0x44e8
leaq 0x7948(%rip), %rsi      # 0xd967
movq %rbx, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2160
leaq 0x7af2(%rip), %rsi      # 0xdb28
movq %rbx, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2160
leaq 0x7b07(%rip), %rsi      # 0xdb54
leaq 0x8(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x2120
leaq 0x8(%rsp), %rdi
callq 0x45ae
leaq 0x8(%rsp), %rdi
callq 0x2150
movq 0xff61(%rip), %rbx      # 0x15fd8
leaq 0x7ae9(%rip), %rsi      # 0xdb67
movq %rbx, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2160
callq 0x4888
leaq 0x78cd(%rip), %rsi      # 0xd967
movq %rbx, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2160
leaq 0x7af0(%rip), %rsi      # 0xdba1
movq %rbx, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2160
leaq 0x7b05(%rip), %rsi      # 0xdbcd
leaq 0x8(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x2120
leaq 0x8(%rsp), %rdi
callq 0x4950
leaq 0x8(%rsp), %rdi
callq 0x2150
movq 0xfee6(%rip), %rdi      # 0x15fd8
callq 0x2160
leaq 0x7ae5(%rip), %rsi      # 0xdbe3
movq %rax, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2160
leaq 0x7afd(%rip), %rsi      # 0xdc12
leaq 0x8(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x2120
leaq 0x8(%rsp), %rdi
callq 0x5213
leaq 0x8(%rsp), %rdi
callq 0x2150
leaq 0x7adf(%rip), %rsi      # 0xdc1e
leaq 0x8(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x2120
leaq 0x8(%rsp), %rdi
callq 0x5213
leaq 0x8(%rsp), %rdi
callq 0x2150
leaq 0x7ac1(%rip), %rsi      # 0xdc2a
leaq 0x8(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x2120
leaq 0x8(%rsp), %rdi
callq 0x5213
leaq 0x8(%rsp), %rdi
callq 0x2150
movq 0xfe45(%rip), %rdi      # 0x15fd8
callq 0x2160
leaq 0x7a97(%rip), %rsi      # 0xdc36
movq %rax, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2160
callq 0x725c
movq %rax, %rbx
leaq 0x7aaa(%rip), %rsi      # 0xdc68
leaq 0x8(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x2120
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x72a6
leaq 0x8(%rsp), %rdi
callq 0x2150
leaq 0x7a81(%rip), %rsi      # 0xdc6c
leaq 0x60(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x2120
leaq 0x8(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x79e2
leaq 0x60(%rsp), %rdi
callq 0x2150
leaq 0x8(%rsp), %rdi
callq 0x7b24
callq 0x725c
movq %rax, %rdi
callq 0x72c8
movq 0xfda7(%rip), %rdi      # 0x15fd8
callq 0x2160
leaq 0x7a3c(%rip), %rsi      # 0xdc79
movq %rax, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2160
andq $0x0, 0x60(%rsp)
andl $0x0, 0x68(%rsp)
andq $0x0, 0x70(%rsp)
andl $0x0, 0x78(%rsp)
andq $0x0, 0x80(%rsp)
callq 0x725c
movq %rax, %rbx
leaq 0x7a23(%rip), %rsi      # 0xdc9e
leaq 0x40(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x2120
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x72a6
leaq 0x40(%rsp), %rdi
callq 0x2150
leaq 0x79fc(%rip), %rsi      # 0xdca4
leaq 0x40(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x2120
leaq 0x40(%rsp), %rdi
callq 0x587d
movzbl %al, %esi
leaq 0x60(%rsp), %rdi
callq 0x7f9e
leaq 0x40(%rsp), %rdi
callq 0x2150
leaq 0x79d4(%rip), %rsi      # 0xdcb3
leaq 0x40(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x2120
leaq 0x40(%rsp), %rdi
callq 0x587d
movzbl %al, %esi
leaq 0x60(%rsp), %rdi
callq 0x7f9e
leaq 0x40(%rsp), %rdi
callq 0x2150
leaq 0x79ac(%rip), %rsi      # 0xdcc2
leaq 0x40(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x2120
leaq 0x40(%rsp), %rdi
callq 0x587d
movzbl %al, %esi
leaq 0x60(%rsp), %rdi
callq 0x7f9e
leaq 0x40(%rsp), %rdi
callq 0x2150
leaq 0x7984(%rip), %rsi      # 0xdcd1
leaq 0x40(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x2120
leaq 0x40(%rsp), %rdi
callq 0x587d
movzbl %al, %esi
leaq 0x60(%rsp), %rdi
callq 0x7f9e
leaq 0x40(%rsp), %rdi
callq 0x2150
leaq 0x795c(%rip), %rsi      # 0xdce0
leaq 0x40(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x2120
leaq 0x40(%rsp), %rdi
callq 0x587d
movzbl %al, %esi
leaq 0x60(%rsp), %rdi
callq 0x7f9e
leaq 0x40(%rsp), %rdi
callq 0x2150
leaq 0x7934(%rip), %rsi      # 0xdcef
leaq 0x40(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x2120
leaq 0x40(%rsp), %rdi
callq 0x587d
movzbl %al, %esi
leaq 0x60(%rsp), %rdi
callq 0x7f9e
leaq 0x40(%rsp), %rdi
callq 0x2150
callq 0x725c
movq %rax, %rdi
callq 0x72c8
movq 0xfbd9(%rip), %rdi      # 0x15fd8
leaq 0x78f8(%rip), %rsi      # 0xdcfe
callq 0x2230
movq 0x60(%rsp), %r15
movq 0x70(%rsp), %r12
movl 0x78(%rsp), %r13d
leaq 0x7496(%rip), %r14      # 0xd8b7
xorl %ebp, %ebp
cmpq %r12, %r15
jne 0x642d
cmpl %r13d, %ebp
je 0x646c
movq (%r15), %rbx
movq 0xfba1(%rip), %rdi      # 0x15fd8
movq %r14, %rsi
callq 0x2230
xorl %esi, %esi
btq %rbp, %rbx
setb %sil
movq %rax, %rdi
callq 0x2350
xorl %eax, %eax
cmpl $0x3f, %ebp
leal 0x1(%rbp), %ecx
sete %al
leaq (%r15,%rax,8), %r15
movl $0x0, %eax
cmovel %eax, %ecx
movl %ecx, %ebp
jmp 0x6423
movq 0xfb65(%rip), %rdi      # 0x15fd8
callq 0x2160
callq 0x725c
movq %rax, %rdi
callq 0x72c8
leaq 0x60(%rsp), %rdi
callq 0x75ea
leaq 0x8(%rsp), %rdi
callq 0x7fdc
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6529
jmp 0x6529
jmp 0x6529
jmp 0x6529
jmp 0x6529
jmp 0x6529
jmp 0x6513
jmp 0x6529
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
jmp 0x64fd
jmp 0x6504
jmp 0x64f5
jmp 0x6504
jmp 0x64f5
jmp 0x6504
jmp 0x64f5
jmp 0x6504
jmp 0x64f5
jmp 0x6504
jmp 0x64f5
jmp 0x6504
jmp 0x64f5
jmp 0x6504
jmp 0x64f5
jmp 0x6504
jmp 0x64f5
jmp 0x6504
jmp 0x64f5
jmp 0x6504
jmp 0x64f5
jmp 0x6504
jmp 0x64f5
jmp 0x6504
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2150
jmp 0x6540
movq %rax, %rbx
jmp 0x6540
jmp 0x6513
jmp 0x6513
jmp 0x6513
jmp 0x6513
jmp 0x6513
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x2150
jmp 0x652c
movq %rax, %rbx
jmp 0x6536
jmp 0x6529
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x75ea
leaq 0x8(%rsp), %rdi
callq 0x7fdc
movq %rbx, %rdi
callq 0x2380