// File: csMOOC[P]UIUC/Application.cpp
// Function: Application::Application(char*)
Application::Application(char *infile) {
	int i;
	par = new Params();
	srand (time(NULL));
	par->setparams(infile);
	log = new Log(par);
	en = new EmulNet(par);
	mp1 = (MP1Node **) malloc(par->EN_GPSZ * sizeof(MP1Node *));

	/*
	 * Init all nodes
	 */
	for( i = 0; i < par->EN_GPSZ; i++ ) {
		Member *memberNode = new Member;
		memberNode->inited = false;
		Address *addressOfMemberNode = new Address();
		Address joinaddr;
		joinaddr = getjoinaddr();
		addressOfMemberNode = (Address *) en->ENinit(addressOfMemberNode, par->PORTNUM);
		mp1[i] = new MP1Node(memberNode, par, en, log, addressOfMemberNode);
		log->LOG(&(mp1[i]->getMemberNode()->addr), "APP");
		delete addressOfMemberNode;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq 0xd476(%rip), %rcx      # 0x14d28
movq %rcx, (%rax)
movl $0x38, %edi
callq 0x3220
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x50(%rbp)
callq 0x98d0
jmp 0x78d0
movq -0x58(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, 0x40(%rax)
xorl %eax, %eax
movl %eax, %edi
callq 0x31d0
movl %eax, %edi
callq 0x31f0
movq -0x58(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x98f0
movl $0x18, %edi
callq 0x3220
movq %rax, %rdi
movq -0x58(%rbp), %rax
movq %rdi, %rcx
movq %rcx, -0x60(%rbp)
movq 0x40(%rax), %rsi
callq 0x8fb0
jmp 0x7920
movq -0x58(%rbp), %rax
movq -0x60(%rbp), %rcx
movq %rcx, 0x30(%rax)
movl $0x1bb8e30, %edi        # imm = 0x1BB8E30
callq 0x3220
movq %rax, %rdi
movq -0x58(%rbp), %rax
movq %rdi, %rcx
movq %rcx, -0x68(%rbp)
movq 0x40(%rax), %rsi
callq 0x6a00
jmp 0x794f
movq -0x58(%rbp), %rax
movq -0x68(%rbp), %rcx
movq %rcx, 0x28(%rax)
movq 0x40(%rax), %rax
movslq 0x18(%rax), %rdi
shlq $0x3, %rdi
callq 0x32f0
movq %rax, %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x38(%rax)
movl $0x0, -0x14(%rbp)
movq -0x58(%rbp), %rcx
movl -0x14(%rbp), %eax
movq 0x40(%rcx), %rcx
cmpl 0x18(%rcx), %eax
jge 0x7b90
movl $0x98, %edi
callq 0x3220
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x70(%rbp)
callq 0x81b0
jmp 0x79ad
movq -0x70(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movb $0x0, 0xe(%rax)
movl $0x6, %edi
callq 0x3220
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x78(%rbp)
callq 0x4620
jmp 0x79d8
movq -0x78(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq -0x3e(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x4620
movq -0x58(%rbp), %rsi
leaq -0x44(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x7bb0
movq -0x90(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0x9a70
movq -0x58(%rbp), %rax
movq -0x38(%rbp), %rsi
movq 0x28(%rax), %rdi
movq 0x40(%rax), %rax
movswl 0x30(%rax), %edx
callq 0x6e00
movq %rax, -0x38(%rbp)
movl $0x30, %edi
callq 0x3220
movq %rax, %rdi
movq -0x58(%rbp), %rax
movq %rdi, %rcx
movq %rcx, -0x80(%rbp)
movq -0x30(%rbp), %rsi
movq 0x40(%rax), %rdx
movq 0x28(%rax), %rcx
movq 0x30(%rax), %r8
movq -0x38(%rbp), %r9
callq 0x3720
jmp 0x7a67
movq -0x58(%rbp), %rax
movq -0x80(%rbp), %rsi
movq 0x38(%rax), %rcx
movslq -0x14(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movq 0x30(%rax), %rcx
movq %rcx, -0xa0(%rbp)
movq 0x38(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x8260
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
addq $0x8, %rsi
leaq 0x77fb(%rip), %rdx      # 0xf2a7
movb $0x0, %al
callq 0x9090
movq -0x38(%rbp), %rax
movq %rax, -0x98(%rbp)
cmpq $0x0, %rax
je 0x7ad5
movq -0x98(%rbp), %rdi
movl $0x6, %esi
callq 0x3230
jmp 0x7ad7
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x797e
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x38, %esi
callq 0x3230
jmp 0x7b99
movq -0x60(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x18, %esi
callq 0x3230
jmp 0x7b99
movq -0x68(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x1bb8e30, %esi        # imm = 0x1BB8E30
callq 0x3230
jmp 0x7b99
movq -0x70(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x98, %esi
callq 0x3230
jmp 0x7b99
movq -0x78(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x6, %esi
callq 0x3230
jmp 0x7b99
movq -0x80(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x30, %esi
callq 0x3230
jmp 0x7b99
addq $0xa0, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x33b0
nopw %cs:(%rax,%rax)