// File: /workspace/github_cpp_makefile_star2_O2/supragya[P]DirectorySync/DirectorySync.cpp
// Function: main
int main( int argc, char **argv)
{
    if(argc != 5){
        std::cout<<"[MAIN] Usage: <programexec> <FolderName> <droid_IP> <SendPORT> <RecvPORT>"<<std::endl;
        exit(-1);
    }
    std::cout<<"    __________________________________________"<<std::endl;
    std::cout<<"  /_________________________________________ |"<<std::endl;
    std::cout<<" /----------------------------------------+ ||"<<std::endl;
    std::cout<<"|                                         | ||"<<std::endl;
    std::cout<<"|              DIRECTORY SYNC             | |+"<<std::endl;
    std::cout<<"|                                         |-+"<<std::endl;
    std::cout<<"+-----------------------------------------+"<<std::endl;

    std::cout<<"[MAIN] Setting up connections "<<std::endl;
    std::thread RConnect(set_reader_connection, atoi(argv[4]), argv[2]);
    std::thread FConnect(set_filewatcher_connection, atoi(argv[3]), argv[2]);
    RConnect.join();
    FConnect.join();
    std::cout<<"[MAIN] Connections setup!"<<std::endl;
    char empty[] = "";
    std::thread listener(reader, argv[1], RCsock);
    std::thread watcher(filewatcher, argv[1], empty, FCsock);
    std::thread closer(closeallsystems);
    listener.join();
    watcher.join();
    closer.join();
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
cmpl $0x5, %edi
jne 0x263a
movq %rsi, %rbx
movq 0x4b66(%rip), %r14      # 0x6fd0
leaq 0x1bdd(%rip), %rsi      # 0x404e
movq %r14, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x20c0
leaq 0x1bf5(%rip), %rsi      # 0x407d
movq %r14, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x20c0
leaq 0x1c0d(%rip), %rsi      # 0x40ac
movq %r14, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x20c0
leaq 0x1c25(%rip), %rsi      # 0x40db
movq %r14, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x20c0
leaq 0x1c3d(%rip), %rsi      # 0x410a
movq %r14, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x20c0
leaq 0x1c55(%rip), %rsi      # 0x4139
movq %r14, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x20c0
leaq 0x1c6c(%rip), %rsi      # 0x4167
movq %r14, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x20c0
leaq 0x1c81(%rip), %rsi      # 0x4193
movq %r14, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x20c0
movq 0x20(%rbx), %rdi
callq 0x2260
leaq -0x28(%rbp), %rdx
movl %eax, (%rdx)
leaq 0x10(%rbx), %r14
leaq 0x16f(%rip), %rsi       # 0x26ab
leaq -0x40(%rbp), %rdi
movq %r14, %rcx
callq 0x369a
movq 0x18(%rbx), %rdi
callq 0x2260
leaq -0x20(%rbp), %rdx
movl %eax, (%rdx)
leaq 0x2b0(%rip), %rsi       # 0x280e
leaq -0x28(%rbp), %rdi
movq %r14, %rcx
callq 0x369a
leaq -0x40(%rbp), %rdi
callq 0x2270
leaq -0x28(%rbp), %rdi
callq 0x2270
movq 0x4a4d(%rip), %rdi      # 0x6fd0
leaq 0x1c28(%rip), %rsi      # 0x41b2
callq 0x2180
movq %rax, %rdi
callq 0x20c0
movb $0x0, -0x11(%rbp)
addq $0x8, %rbx
leaq 0x357(%rip), %rsi       # 0x28fd
leaq 0x1dcbf(%rip), %rcx     # 0x2026c
leaq -0x20(%rbp), %rdi
movq %rbx, %rdx
callq 0x3724
leaq 0x52c(%rip), %rsi       # 0x2aec
leaq 0x1dca1(%rip), %r8      # 0x20268
leaq -0x38(%rbp), %rdi
leaq -0x11(%rbp), %rcx
movq %rbx, %rdx
callq 0x37ac
leaq 0xdd4(%rip), %rsi       # 0x33b2
leaq -0x30(%rbp), %rdi
callq 0x383c
leaq -0x20(%rbp), %rdi
callq 0x2270
leaq -0x38(%rbp), %rdi
callq 0x2270
leaq -0x30(%rbp), %rdi
callq 0x2270
leaq -0x30(%rbp), %rdi
callq 0x38aa
leaq -0x38(%rbp), %rdi
callq 0x38aa
leaq -0x20(%rbp), %rdi
callq 0x38aa
leaq -0x28(%rbp), %rdi
callq 0x38aa
leaq -0x40(%rbp), %rdi
callq 0x38aa
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x498f(%rip), %rdi      # 0x6fd0
leaq 0x19bc(%rip), %rsi      # 0x4004
callq 0x2180
movq %rax, %rdi
callq 0x20c0
pushq $-0x1
popq %rdi
callq 0x21d0
movq %rax, %rbx
jmp 0x267a
movq %rax, %rbx
jmp 0x2683
jmp 0x268e
movq %rax, %rbx
jmp 0x269a
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x38aa
leaq -0x38(%rbp), %rdi
callq 0x38aa
leaq -0x20(%rbp), %rdi
callq 0x38aa
jmp 0x2691
movq %rax, %rbx
leaq -0x28(%rbp), %rdi
callq 0x38aa
leaq -0x40(%rbp), %rdi
callq 0x38aa
movq %rbx, %rdi
callq 0x22b0