// File: /workspace/github_cpp_makefile_star2_O1/luisremis[P]SDFS/Membership.cpp
// Function: Membership::getAdress(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Membership::getAdress(std::string filename)
{
	logFile<<"getAdress:" << std::endl;
    std::ifstream addFile(filename);

    std::string str;
    int i=0; 

    address.clear();
    
    while(!addFile.eof())
    {
        getline(addFile, str);
        address.push_back(str);
        struct hostent *server = gethostbyname(str.c_str());

        struct in_addr addr;
        char ip[20];
        memcpy(&addr, server->h_addr_list[0], sizeof(struct in_addr)); 
        strcpy(ip,inet_ntoa(addr));
        
        std::string ip_str (ip);

        struct Node newnode;
        //newnode.name = str;
        newnode.ip_str = ip_str;

        nodes.push_back(newnode);
        
        logFile << "read node " << i++ << " from addr file: " << str << " : " << ip_str << std::endl;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xd821(%rip), %rsi      # 0x1341a
movl $0xa, %edx
callq 0x43f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4380
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
leaq -0x2b8(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x4570
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x200(%rbx), %r14
movq %r14, %rdi
callq 0xa3da
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x298(%rbp,%rax)
jne 0x5e30
leaq (%rax,%rbp), %rdi
addq $-0x2b8, %rdi           # imm = 0xFD48
leaq 0x218(%rbx), %rax
movq %rax, -0x70(%rbp)
xorl %r12d, %r12d
leaq -0xb0(%rbp), %r13
movl $0xa, %esi
callq 0x4380
movsbl %al, %edx
leaq -0x2b8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x4680
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
callq 0xa420
movq -0x48(%rbp), %rdi
callq 0x43e0
movq 0x18(%rax), %rax
movq (%rax), %rax
movl (%rax), %edi
callq 0x41b0
movq %r13, %rdi
movq %rax, %rsi
callq 0x4350
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
movq %r13, %rdi
callq 0x41a0
leaq (%rax,%rbp), %rdx
addq $-0xb0, %rdx
leaq -0x68(%rbp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0xa686
leaq -0x88(%rbp), %rax
movq %rax, -0x98(%rbp)
movq $0x0, -0x90(%rbp)
movb $0x0, -0x88(%rbp)
leaq -0x98(%rbp), %rdi
movq %r15, %rsi
callq 0x4210
movq -0x70(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0xa46c
movl $0xa, %edx
movq %rbx, %rdi
leaq 0xd6ca(%rip), %rsi      # 0x13425
callq 0x43f0
movq %rbx, %rdi
movl %r12d, %esi
callq 0x45f0
movq %rax, %r15
movl $0x11, %edx
movq %rax, %rdi
leaq 0xd6b3(%rip), %rsi      # 0x13430
callq 0x43f0
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r15, %rdi
callq 0x43f0
movq %rax, %r15
movl $0x3, %edx
movq %rax, %rdi
leaq 0xd69e(%rip), %rsi      # 0x13442
callq 0x43f0
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq %r15, %rdi
callq 0x43f0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4380
movsbl %al, %esi
movq %r15, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x5dfb
callq 0x4360
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x5e0d
callq 0x4360
movq -0x2b8(%rbp), %rax
movq -0x18(%rax), %rax
leaq (%rax,%rbp), %rdi
addq $-0x2b8, %rdi           # imm = 0xFD48
incl %r12d
testb $0x2, 0x20(%rdi)
je 0x5c98
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x5e42
callq 0x4360
leaq -0x2b8(%rbp), %rdi
callq 0x40f0
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5e64
jmp 0x5e64
movq %rax, %rbx
jmp 0x5e96
movq %rax, %rbx
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x5e84
callq 0x4360
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x5e96
callq 0x4360
leaq -0x38(%rbp), %rax
movq -0x48(%rbp), %rdi
cmpq %rax, %rdi
je 0x5ea8
callq 0x4360
leaq -0x2b8(%rbp), %rdi
callq 0x40f0
movq %rbx, %rdi
callq 0x4630