// File: /workspace/github_cpp_makefile_star2_O3/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 0x282f
movq %rsi, %rbx
movq 0x5ab6(%rip), %r14      # 0x7fd0
leaq 0x2b2d(%rip), %rsi      # 0x504e
movl $0x2e, %edx
movq %r14, %rdi
callq 0x21e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
leaq 0x2b21(%rip), %rsi      # 0x507d
movl $0x2e, %edx
movq %r14, %rdi
callq 0x21e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
leaq 0x2b15(%rip), %rsi      # 0x50ac
movl $0x2e, %edx
movq %r14, %rdi
callq 0x21e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
leaq 0x2b09(%rip), %rsi      # 0x50db
movl $0x2e, %edx
movq %r14, %rdi
callq 0x21e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
leaq 0x2afd(%rip), %rsi      # 0x510a
movl $0x2e, %edx
movq %r14, %rdi
callq 0x21e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
leaq 0x2af1(%rip), %rsi      # 0x5139
movl $0x2d, %edx
movq %r14, %rdi
callq 0x21e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
leaq 0x2ae4(%rip), %rsi      # 0x5167
movl $0x2b, %edx
movq %r14, %rdi
callq 0x21e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
leaq 0x2ad5(%rip), %rsi      # 0x5193
movl $0x1e, %edx
movq %r14, %rdi
callq 0x21e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x20(%rbx), %rdi
callq 0x2290
leaq -0x28(%rbp), %rdx
movl %eax, (%rdx)
leaq 0x10(%rbx), %r14
leaq 0x182(%rip), %rsi       # 0x288e
leaq -0x40(%rbp), %rdi
movq %r14, %rcx
callq 0x3dd4
movq 0x18(%rbx), %rdi
callq 0x2290
leaq -0x20(%rbp), %rdx
movl %eax, (%rdx)
leaq 0x337(%rip), %rsi       # 0x2a65
leaq -0x28(%rbp), %rdi
movq %r14, %rcx
callq 0x3dd4
leaq -0x40(%rbp), %rdi
callq 0x22b0
leaq -0x28(%rbp), %rdi
callq 0x22b0
movq 0x587d(%rip), %r14      # 0x7fd0
leaq 0x2a58(%rip), %rsi      # 0x51b2
movl $0x19, %edx
movq %r14, %rdi
callq 0x21e0
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0x584b(%rip), %rdi      # 0x7fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
movb $0x0, -0x11(%rbp)
addq $0x8, %rbx
leaq 0x3c7(%rip), %rsi       # 0x2b68
leaq 0x1eae4(%rip), %rcx     # 0x2128c
leaq -0x20(%rbp), %rdi
movq %rbx, %rdx
callq 0x3e62
leaq 0x5cf(%rip), %rsi       # 0x2d8a
leaq 0x1eac6(%rip), %r8      # 0x21288
leaq -0x38(%rbp), %rdi
leaq -0x11(%rbp), %rcx
movq %rbx, %rdx
callq 0x3ef0
leaq 0x12be(%rip), %rsi      # 0x3a97
leaq -0x30(%rbp), %rdi
callq 0x3f86
leaq -0x20(%rbp), %rdi
callq 0x22b0
leaq -0x38(%rbp), %rdi
callq 0x22b0
leaq -0x30(%rbp), %rdi
callq 0x22b0
cmpq $0x0, -0x30(%rbp)
jne 0x2889
cmpq $0x0, -0x38(%rbp)
jne 0x2889
cmpq $0x0, -0x20(%rbp)
jne 0x2889
cmpq $0x0, -0x28(%rbp)
jne 0x2889
cmpq $0x0, -0x40(%rbp)
jne 0x2889
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x579a(%rip), %rdi      # 0x7fd0
leaq 0x27c7(%rip), %rsi      # 0x5004
callq 0x21b0
movq %rax, %rdi
callq 0x20d0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2200
jmp 0x2863
jmp 0x286a
jmp 0x2873
jmp 0x287a
cmpq $0x0, -0x30(%rbp)
jne 0x2889
cmpq $0x0, -0x38(%rbp)
jne 0x2889
cmpq $0x0, -0x20(%rbp)
je 0x2873
jmp 0x2889
cmpq $0x0, -0x28(%rbp)
jne 0x2889
cmpq $0x0, -0x40(%rbp)
jne 0x2889
movq %rax, %rdi
callq 0x22f0
callq 0x2080