// File: /workspace/github_cpp_makefile_star2_O2/zkl94[P]distributed-key-value-store/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);
	en1 = new EmulNet(par);
	mp1 = (MP1Node **) malloc(par->EN_GPSZ * sizeof(MP1Node *));
	mp2 = (MP2Node **) malloc(par->EN_GPSZ * sizeof(MP2Node *));

	/*
	 * 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);
		mp2[i] = new MP2Node(memberNode, par, en1, log, addressOfMemberNode);
		log->LOG(&(mp1[i]->getMemberNode()->addr), "APP");
		log->LOG(&(mp2[i]->getMemberNode()->addr), "APP MP2");
		delete addressOfMemberNode;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x14f89(%rip), %rax     # 0x1acc8
movq %rax, (%rdi)
leaq 0x60(%rdi), %rax
andl $0x0, 0x60(%rdi)
andq $0x0, 0x68(%rdi)
movq %rax, 0x70(%rdi)
movq %rax, 0x78(%rdi)
andq $0x0, 0x80(%rdi)
pushq $0x38
popq %rdi
callq 0x3260
movq %rax, %r15
movq %rax, %rdi
callq 0x9dbc
movq %r15, 0x50(%rbx)
xorl %edi, %edi
callq 0x3210
movl %eax, %edi
callq 0x3230
movq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0x9dc4
pushq $0x18
popq %rdi
callq 0x3260
movq %rax, %r15
movq 0x50(%rbx), %rsi
movq %rax, %rdi
callq 0x9408
movq %r15, 0x38(%rbx)
movl $0x1bb8e30, %edi        # imm = 0x1BB8E30
callq 0x3260
movq %rax, %r15
movq 0x50(%rbx), %rsi
movq %rax, %rdi
callq 0x5550
movq %r15, 0x28(%rbx)
movl $0x1bb8e30, %edi        # imm = 0x1BB8E30
callq 0x3260
movq %rax, %r15
movq 0x50(%rbx), %rsi
movq %rax, %rdi
callq 0x5550
movq %r15, 0x30(%rbx)
movq 0x50(%rbx), %rax
movslq 0x18(%rax), %r12
movq %r12, %r14
shlq $0x3, %r14
movq %r14, %rdi
callq 0x3330
movq %rax, 0x40(%rbx)
movq %r14, %rdi
callq 0x3330
movq %rax, 0x48(%rbx)
pushq $0x6
popq %r14
xorl %r15d, %r15d
movslq %r12d, %rax
cmpq %rax, %r15
jge 0x5f34
movl $0xe8, %edi
callq 0x3260
movq %rax, %r12
movq %rax, %rdi
callq 0x8766
movb $0x0, 0xe(%r12)
movq %r14, %rdi
callq 0x3260
movq %rax, %r13
movl $0x1, 0xc(%rsp)
andw $0x0, 0x10(%rsp)
leaq 0x12(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x9f22
movq 0x28(%rbx), %rdi
movq 0x50(%rbx), %rax
movswl 0x30(%rax), %edx
movq %r13, %rsi
callq 0x56d4
movq %rax, %r13
pushq $0x40
popq %rdi
callq 0x3260
movq %rax, %rbp
movq 0x50(%rbx), %rdx
movq 0x28(%rbx), %rcx
movq 0x38(%rbx), %r8
movq %rax, %rdi
movq %r12, %rsi
movq %r13, %r9
callq 0x379c
movq 0x40(%rbx), %rax
movq %rbp, (%rax,%r15,8)
movl $0xc0, %edi
callq 0x3260
movq %rax, %rbp
movq 0x50(%rbx), %rdx
movq 0x30(%rbx), %rcx
movq 0x38(%rbx), %r8
movq %rax, %rdi
movq %r12, %rsi
movq %r13, %r9
callq 0xbf28
movq 0x48(%rbx), %rax
movq %rbp, (%rax,%r15,8)
movq 0x38(%rbx), %rdi
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %rax
movq 0x20(%rax), %rsi
addq $0x8, %rsi
leaq 0xc499(%rip), %rdx      # 0x12389
xorl %eax, %eax
callq 0x9452
movq 0x38(%rbx), %rdi
movq 0x48(%rbx), %rax
movq (%rax,%r15,8), %rax
movq 0x50(%rax), %rsi
addq $0x8, %rsi
leaq 0xc47b(%rip), %rdx      # 0x1238d
xorl %eax, %eax
callq 0x9452
movq %r13, %rdi
movq %r14, %rsi
callq 0x3270
incq %r15
movq 0x50(%rbx), %rax
movl 0x18(%rax), %r12d
jmp 0x5e13
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5f45
movq %rax, %r14
movl $0x1bb8e30, %esi        # imm = 0x1BB8E30
jmp 0x5f5c
movq %rax, %r14
pushq $0x18
jmp 0x5f5b
movq %rax, %r14
pushq $0x38
popq %rsi
movq %r15, %rdi
jmp 0x5f89
jmp 0x5f90
jmp 0x5f90
jmp 0x5f90
movq %rax, %r14
movl $0xe8, %esi
movq %r12, %rdi
jmp 0x5f89
jmp 0x5f90
movq %rax, %r14
pushq $0x40
popq %rsi
jmp 0x5f86
movq %rax, %r14
movl $0xc0, %esi
movq %rbp, %rdi
callq 0x3270
jmp 0x5f93
movq %rax, %r14
addq $0x58, %rbx
movq %rbx, %rdi
callq 0x8c66
movq %r14, %rdi
callq 0x3420
nop