// File: vianna274[P]dropbox/server.cpp
// Function: main
int main(int argc, char *argv[])
{	
	Server *server;
	if(argc == 2){
		// main
		string ipLocal(argv[1]);
		server = new Server(ipLocal);
	}
	else{
		// backups
		string ipLocal(argv[1]);
		string ipMain(argv[2]);
		vector<string> ipBackups;
		for(int i = 3; i<argc; i++){
			ipBackups.push_back(argv[i]);
		}
		server = new Server(ipLocal, ipMain, ipBackups);
	}
	
	server->run();

	delete server;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
jne 0x18751
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x180(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0x178(%rbp)
callq 0x3620
movq -0x180(%rbp), %rsi
movq -0x178(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x3480
jmp 0x1867b
leaq -0x39(%rbp), %rdi
callq 0x33e0
movl $0xa00, %edi            # imm = 0xA00
callq 0x33b0
movq %rax, -0x188(%rbp)
jmp 0x18697
movb $0x1, -0x71(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x3190
jmp 0x186aa
movq -0x188(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xbce0
jmp 0x186bc
movq -0x188(%rbp), %rax
movb $0x0, -0x71(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x3280
leaq -0x38(%rbp), %rdi
callq 0x3280
jmp 0x18a83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x39(%rbp), %rdi
callq 0x33e0
jmp 0x18ac0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x18743
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1872d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x3280
testb $0x1, -0x71(%rbp)
jne 0x18735
jmp 0x18741
movq -0x188(%rbp), %rdi
callq 0x3370
jmp 0x18743
leaq -0x38(%rbp), %rdi
callq 0x3280
jmp 0x18ac0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x198(%rbp)
leaq -0x99(%rbp), %rdi
movq %rdi, -0x190(%rbp)
callq 0x3620
movq -0x198(%rbp), %rsi
movq -0x190(%rbp), %rdx
leaq -0x98(%rbp), %rdi
callq 0x3480
jmp 0x1878f
leaq -0x99(%rbp), %rdi
callq 0x33e0
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x1a8(%rbp)
leaq -0xc1(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0x3620
movq -0x1a8(%rbp), %rsi
movq -0x1a0(%rbp), %rdx
leaq -0xc0(%rbp), %rdi
callq 0x3480
jmp 0x187d9
leaq -0xc1(%rbp), %rdi
callq 0x33e0
leaq -0xe0(%rbp), %rdi
callq 0x11880
movl $0x3, -0xe4(%rbp)
movl -0xe4(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x18901
movq -0x10(%rbp), %rax
movslq -0xe4(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x1b8(%rbp)
leaq -0x109(%rbp), %rdi
movq %rdi, -0x1b0(%rbp)
callq 0x3620
movq -0x1b8(%rbp), %rsi
movq -0x1b0(%rbp), %rdx
leaq -0x108(%rbp), %rdi
callq 0x3480
jmp 0x1884f
leaq -0xe0(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x12330
jmp 0x18864
leaq -0x108(%rbp), %rdi
callq 0x3280
leaq -0x109(%rbp), %rdi
callq 0x33e0
movl -0xe4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe4(%rbp)
jmp 0x187fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x99(%rbp), %rdi
callq 0x33e0
jmp 0x18ac0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xc1(%rbp), %rdi
callq 0x33e0
jmp 0x18a75
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x188f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x3280
leaq -0x109(%rbp), %rdi
callq 0x33e0
jmp 0x18a5d
movl $0xa00, %edi            # imm = 0xA00
callq 0x33b0
movq %rax, -0x1c0(%rbp)
jmp 0x18914
movb $0x1, -0x169(%rbp)
leaq -0x130(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x3190
jmp 0x18930
leaq -0x150(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x3190
jmp 0x18945
leaq -0x168(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x11dd0
jmp 0x1895a
movq -0x1c0(%rbp), %rdi
leaq -0x130(%rbp), %rsi
leaq -0x150(%rbp), %rdx
leaq -0x168(%rbp), %rcx
callq 0xc690
jmp 0x1897d
movq -0x1c0(%rbp), %rax
movb $0x0, -0x169(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x11a00
leaq -0x150(%rbp), %rdi
callq 0x3280
leaq -0x130(%rbp), %rdi
callq 0x3280
leaq -0xe0(%rbp), %rdi
callq 0x11a00
leaq -0xc0(%rbp), %rdi
callq 0x3280
leaq -0x98(%rbp), %rdi
callq 0x3280
jmp 0x18a83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x18a5d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x18a44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x18a38
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x18a2c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x11a00
leaq -0x150(%rbp), %rdi
callq 0x3280
leaq -0x130(%rbp), %rdi
callq 0x3280
testb $0x1, -0x169(%rbp)
jne 0x18a4f
jmp 0x18a5b
movq -0x1c0(%rbp), %rdi
callq 0x3370
jmp 0x18a5d
leaq -0xe0(%rbp), %rdi
callq 0x11a00
leaq -0xc0(%rbp), %rdi
callq 0x3280
leaq -0x98(%rbp), %rdi
callq 0x3280
jmp 0x18ac0
movq -0x18(%rbp), %rdi
callq 0xca80
movq -0x18(%rbp), %rax
movq %rax, -0x1c8(%rbp)
cmpq $0x0, %rax
je 0x18ab5
movq -0x1c8(%rbp), %rdi
callq 0xe350
movq -0x1c8(%rbp), %rdi
callq 0x3370
xorl %eax, %eax
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x3610