LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/brandoncanaday[P]1730sh/Input.cpp
// Function: Input::isCompleted() const
const bool Input::isCompleted() const {
  for(unsigned int i = 0, s = processes.size(); i < s; i++) {
    if(!processes[i].completed) {
      return false;
    } // if
  } // for
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x30(%rdi), %rcx
movq 0x38(%rdi), %rax
subq %rcx, %rax
movabsq $0x28, %rsi
cqto
idivq %rsi
movl %eax, %eax
addq $0x9, %rcx
xorl %esi, %esi
movq %rsi, %rdx
cmpq %rsi, %rax
je 0x977f
leaq 0x1(%rdx), %rsi
cmpb $0x0, (%rcx)
leaq 0x28(%rcx), %rcx
jne 0x976a
cmpq %rax, %rdx
setae %al
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/brandoncanaday[P]1730sh/Input.cpp
// Function: Input::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Input& Input::operator=(string input) {
  setShellInput(input); 
  set_foreground();
  setSTDIN();
  setSTDOUT();
  setSTDERR();
  this->processes = inputToProcesses();
  return *this;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x3380
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8796
leaq -0x30(%rbp), %rdi
callq 0x3120
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
cmpb $0x26, -0x1(%rax,%rcx)
setne 0x4(%rbx)
movq %rbx, %rdi
callq 0x882e
movq %rbx, %rdi
callq 0x89f4
movq %rbx, %rdi
callq 0x8c36
leaq -0x48(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8e7a
leaq 0x30(%rbx), %rdi
movq %r14, %rsi
callq 0x9b76
movq %r14, %rdi
callq 0x7966
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O2/brandoncanaday[P]1730sh/Input.cpp
// Function: operator<<(std::ostream&, Input&)
ostream& operator<<(ostream& output, Input& rhs) { 
  output << "JID = " << rhs.getJID() << ", In foreground? " << rhs.isForeground() << endl;
  for(unsigned int i = 0, s = rhs.getProcesses().size(); i < s; i++) {
    output << "Process " << i << " (PID/PGID = " << rhs.getProcesses()[i].PID << "/" << rhs.getProcesses()[i].PGID << ") argv: ";
    for(unsigned int j = 0; j < rhs.getProcesses()[i].args.size(); j++) {
      output << rhs.getProcesses()[i].args[j] << " ";
    } // for
    if(i != s-1) { output << endl; } // if not last iter
  } // for
  return output;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x22a3(%rip), %rsi      # 0xbae3
callq 0x3280
movl (%r14), %esi
movq %rax, %rdi
callq 0x34a0
leaq 0x2293(%rip), %rsi      # 0xbaea
movq %rax, %rdi
callq 0x3280
movzbl 0x4(%r14), %esi
movq %rax, %rdi
callq 0x3460
movq %rax, %rdi
callq 0x3130
movq 0x38(%r14), %rax
subq 0x30(%r14), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leal -0x1(%rax), %ecx
movq %rcx, -0x30(%rbp)
movl %eax, %eax
movq %rax, -0x38(%rbp)
xorl %r15d, %r15d
leaq 0xe87(%rip), %r12       # 0xa722
cmpq -0x38(%rbp), %r15
je 0x9971
movq %rbx, %rdi
leaq 0x224d(%rip), %rsi      # 0xbafc
callq 0x3280
movq %rax, %rdi
movq %r15, %rsi
callq 0x31b0
movq %rax, %rdi
leaq 0x223c(%rip), %rsi      # 0xbb05
callq 0x3280
movq 0x30(%r14), %rcx
movq %r15, -0x40(%rbp)
imulq $0x28, %r15, %r13
movl (%rcx,%r13), %esi
movq %rax, %rdi
callq 0x34a0
movq %rax, %rdi
leaq 0x2004(%rip), %rsi      # 0xb8f4
callq 0x3280
movq 0x30(%r14), %rcx
movl 0x4(%rcx,%r13), %esi
movq %rax, %rdi
callq 0x34a0
movq %rax, %rdi
leaq 0x2203(%rip), %rsi      # 0xbb13
callq 0x3280
xorl %eax, %eax
movl %eax, %r15d
movq 0x30(%r14), %rax
movq 0x10(%rax,%r13), %rsi
movq 0x18(%rax,%r13), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %r15, %rax
jbe 0x9957
movq %r15, %rax
shlq $0x5, %rax
addq %rax, %rsi
movq %rbx, %rdi
callq 0x3250
movq %rax, %rdi
movq %r12, %rsi
callq 0x3280
leal 0x1(%r15), %eax
jmp 0x9917
movq -0x40(%rbp), %r15
cmpq -0x30(%rbp), %r15
je 0x9969
movq %rbx, %rdi
callq 0x3130
incq %r15
jmp 0x989b
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/brandoncanaday[P]1730sh/Input.cpp
// Function: trim(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string trim(string input) {
  string s = input;
  const char * ws = " \t"; // chars to trim
  s = s.erase(s.find_last_not_of(ws) + 1); // trims end 
  s = s.erase(0, s.find_first_not_of(ws)); // trims beginning  
  return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x3380
leaq 0x2147(%rip), %rsi      # 0xbae0
pushq $-0x1
popq %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x34d0
leaq 0x1(%rax), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x3080
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3170
leaq 0x2117(%rip), %rsi      # 0xbae0
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3180
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x3080
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3170
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x3120
movq %r14, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O2/brandoncanaday[P]1730sh/Input.cpp
// Function: sanitize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string sanitize(string input, string charsToRemove) {
  const string unwanted = charsToRemove ;
  std::string sanitized_str = "";
  for(char c : input) {
    if(unwanted.find(c) == string::npos) {
      sanitized_str += c;
    } // if
  } // for
  return sanitized_str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x58(%rbp), %rdi
movq %rdx, %rsi
callq 0x3380
leaq 0x20b2(%rip), %rsi      # 0xbae2
leaq -0x29(%rbp), %rdx
movq %rbx, -0x38(%rbp)
movq %rbx, %rdi
callq 0x3100
movq (%r14), %r12
movq 0x8(%r14), %r13
xorl %ebx, %ebx
leaq -0x58(%rbp), %r14
cmpq %rbx, %r13
je 0x9a7b
movsbl (%r12,%rbx), %r15d
movq %r14, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x3360
cmpq $-0x1, %rax
jne 0x9a76
movq -0x38(%rbp), %rdi
movl %r15d, %esi
callq 0x3230
incq %rbx
jmp 0x9a4d
leaq -0x58(%rbp), %rdi
callq 0x3120
movq -0x38(%rbp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x9aa8
movq %rax, %r14
movq -0x38(%rbp), %rdi
callq 0x3120
leaq -0x58(%rbp), %rdi
callq 0x3120
movq %r14, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O2/brandoncanaday[P]1730sh/Input.cpp
// Function: hasQuotes(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool hasQuotes(string input) {
  for(unsigned int i = 0; i < input.length(); i++) {
    if(i == 0) {
      if(input[i] == '"') return true;
    } else {
      if(input[i] == '"' && input[i-1] != '\\') return true;
    } // if/else
  } // for
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rax
xorl %ecx, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jbe 0x9af1
movq (%rdi), %rdx
movb (%rdx,%rcx), %sil
testq %rcx, %rcx
je 0x9ae7
cmpb $0x22, %sil
jne 0x9aed
leal -0x1(%rcx), %esi
cmpb $0x5c, (%rdx,%rsi)
je 0x9aed
jmp 0x9af1
cmpb $0x22, %sil
je 0x9af1
incl %ecx
jmp 0x9ac3
cmpq %rcx, %rax
seta %al
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/brandoncanaday[P]1730sh/Input.cpp
// Function: pos_of_first_quote(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
unsigned int pos_of_first_quote(string input) {
  int pos = 0;
  for(unsigned int i = 0; i < input.length(); i++) {
    if(i == 0) {
      if(input[i] == '"') {
	pos = i; 
	break;
      } // if
    } else {
      if(input[i] == '"' && input[i-1] != '\\') {
	pos = i;
	break;
      } // if
    } // if/else
  } // for
  return pos;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rcx
xorl %eax, %eax
xorl %edx, %edx
movl %edx, %r8d
cmpq %r8, %rcx
jbe 0x9b37
movq (%rdi), %rsi
movb (%rsi,%r8), %r8b
testl %edx, %edx
je 0x9b2b
cmpb $0x22, %r8b
jne 0x9b31
leal -0x1(%rdx), %r8d
cmpb $0x5c, (%rsi,%r8)
je 0x9b31
jmp 0x9b35
cmpb $0x22, %r8b
je 0x9b37
incl %edx
jmp 0x9b05
movl %edx, %eax
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/main.cpp
// Function: main
int main (int argc, char* argv[])
{
    srand (time(NULL));

    system("rm files/*");
    system("clear");

    std::cout << std::endl << "CS425 - MP3: Distributed File System" ;
    std::cout << std::endl << std::endl;

    logFile.open("log.log");
    logFile << "Inicializing! " << std::endl;

    int port = atoi(argv[1]);
    bool isIntroducer = atoi(argv[2]);

    Membership m(isIntroducer, port);
    FileSystem fs (port + 21, m);

    std::thread cinListening(listeningCin, &m, &fs);
    cinListening.join();

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x6d8, %rsp            # imm = 0x6D8
movq %rsi, %rbx
xorl %edi, %edi
callq 0x4330
movl %eax, %edi
callq 0x4360
leaq 0xa2a8(%rip), %rdi      # 0xf2dd
callq 0x42e0
leaq 0xa200(%rip), %rdi      # 0xf241
callq 0x42e0
movq 0x10f73(%rip), %r14     # 0x15fc0
movq %r14, %rdi
callq 0x41d0
leaq 0xa28c(%rip), %rsi      # 0xf2e8
movq %rax, %rdi
callq 0x4370
movq %r14, %rdi
callq 0x41d0
movq %rax, %rdi
callq 0x41d0
leaq 0x112e5(%rip), %r14     # 0x16360
leaq 0xa28b(%rip), %rsi      # 0xf30d
pushq $0x10
popq %rdx
movq %r14, %rdi
callq 0x4050
leaq 0xa281(%rip), %rsi      # 0xf315
movq %r14, %rdi
callq 0x4370
movq %rax, %rdi
callq 0x41d0
movq 0x8(%rbx), %rdi
callq 0x44f0
movl %eax, %r15d
movq 0x10(%rbx), %rdi
callq 0x44f0
xorl %esi, %esi
testl %eax, %eax
setne %sil
leaq -0x6f0(%rbp), %rbx
movq %rbx, %rdi
movl %r15d, %edx
callq 0x5244
addl $0x15, %r15d
leaq -0x328(%rbp), %r14
movq %r14, %rdi
movl %r15d, %esi
movq %rbx, %rdx
callq 0x95fa
leaq -0x30(%rbp), %rdx
movq %rbx, (%rdx)
leaq -0x28(%rbp), %rcx
movq %r14, (%rcx)
leaq -0x845(%rip), %rsi      # 0x48bc
leaq -0x20(%rbp), %rdi
callq 0x517a
leaq -0x20(%rbp), %rdi
callq 0x4590
leaq -0x20(%rbp), %rdi
callq 0x5204
leaq -0x328(%rbp), %rdi
callq 0x9bb2
leaq -0x6f0(%rbp), %rdi
callq 0x65ca
xorl %eax, %eax
addq $0x6d8, %rsp            # imm = 0x6D8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x20(%rbp), %rdi
callq 0x5204
jmp 0x5155
movq %rax, %rbx
leaq -0x328(%rbp), %rdi
callq 0x9bb2
jmp 0x5166
movq %rax, %rbx
leaq -0x6f0(%rbp), %rdi
callq 0x65ca
movq %rbx, %rdi
callq 0x45d0
// File: /workspace/github_cpp_makefile_star2_O2/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 $0x2a8, %rsp            # imm = 0x2A8
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x9dad(%rip), %rsi      # 0xf3f2
callq 0x4370
movq %rax, %rdi
callq 0x41d0
leaq -0x2c8(%rbp), %rdi
pushq $0x8
popq %rdx
movq %rbx, %rsi
callq 0x4530
leaq -0x50(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x200(%r14), %rdi
movq %rdi, -0x40(%rbp)
callq 0x8772
movq %r14, -0x30(%rbp)
leaq 0x218(%r14), %rax
movq %rax, -0x38(%rbp)
xorl %r13d, %r13d
leaq -0x60(%rbp), %r14
leaq -0xa8(%rbp), %rbx
leaq -0x88(%rbp), %r12
movq -0x2c8(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x2a8(%rbp,%rax)
jne 0x57ad
leaq -0x2c8(%rbp), %rdi
movq %r14, %rsi
callq 0x40b0
movq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0x8780
movq -0x60(%rbp), %rdi
callq 0x43b0
movq 0x18(%rax), %rax
movq (%rax), %rax
movl (%rax), %edi
callq 0x41a0
leaq -0xc0(%rbp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x4340
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x4170
leaq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
andq $0x0, -0x80(%rbp)
movb $0x0, -0x78(%rbp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4200
movq -0x38(%rbp), %rdi
movq %r12, %rsi
callq 0x87bc
movq -0x30(%rbp), %rdi
leaq 0x9cb4(%rip), %rsi      # 0xf3fd
callq 0x4370
movq %rax, %rdi
movl %r13d, %esi
callq 0x45a0
movq %rax, %rdi
leaq 0x9ca5(%rip), %rsi      # 0xf408
callq 0x4370
movq %rax, %rdi
movq %r14, %rsi
callq 0x4300
movq %rax, %rdi
leaq 0x9c9d(%rip), %rsi      # 0xf41a
callq 0x4370
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4300
movq %rax, %rdi
callq 0x41d0
movq %r12, %rdi
callq 0x41b0
movq %rbx, %rdi
callq 0x41b0
incl %r13d
jmp 0x56a8
leaq -0x60(%rbp), %rdi
callq 0x41b0
leaq -0x2c8(%rbp), %rdi
callq 0x40f0
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x57d8
jmp 0x57d8
movq %rax, %rbx
jmp 0x57f8
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x41b0
leaq -0xa8(%rbp), %rdi
callq 0x41b0
leaq -0x60(%rbp), %rdi
callq 0x41b0
leaq -0x2c8(%rbp), %rdi
callq 0x40f0
movq %rbx, %rdi
callq 0x45d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/Membership.cpp
// Function: Membership::join()
void Membership::join()
{
	bool joined = firstJoin();
    while( !isIntroducer && !joined)
    {   //introducer will firstJoin() once. Other node will keep firstJoin() until it enter the group.
        joined = firstJoin();
        //usleep( 1000*1000 );
    }


    MemberUpdateMsg msg( MSG_JOIN_FINISH , members[0]);
    pushMsgToFileSysQueue(msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %rdi, %rbx
callq 0x6720
testb $0x1, %al
jne 0x583e
cmpb $0x0, 0x2cc(%rbx)
jne 0x583e
movq %rbx, %rdi
jmp 0x5827
movq 0x258(%rbx), %rsi
leaq -0xa8(%rbp), %r14
movq %r14, %rdi
callq 0x8734
leaq -0x80(%rbp), %rdi
pushq $0x8
popq %rsi
movq %r14, %rdx
callq 0x8434
leaq -0xa8(%rbp), %rdi
callq 0x41b0
leaq -0x48(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x847c
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x6ac0
leaq -0x40(%rbp), %rdi
callq 0x41b0
leaq -0x78(%rbp), %rdi
callq 0x41b0
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x41b0
jmp 0x58b7
movq %rax, %rbx
leaq -0x78(%rbp), %r14
jmp 0x58c0
movq %rax, %rbx
movq %r14, %rdi
callq 0x41b0
movq %rbx, %rdi
callq 0x45d0
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/Membership.cpp
// Function: Membership::~Membership()
Membership::~Membership()
{
	//Kill threads
	killListeningThread = true;
	killDetectingThread = true;

	listening.join();
	detecting.join();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movw $0x101, 0x350(%rdi)     # imm = 0x101
leaq 0x338(%rdi), %r14
movq %r14, %rdi
callq 0x4590
leaq 0x340(%rbx), %r15
movq %r15, %rdi
callq 0x4590
leaq 0x398(%rbx), %rdi
callq 0x45f0
leaq 0x358(%rbx), %rdi
callq 0x869c
leaq 0x348(%rbx), %rdi
callq 0x5204
movq %r15, %rdi
callq 0x5204
movq %r14, %rdi
callq 0x5204
leaq 0x2f8(%rbx), %rdi
callq 0x8a4a
leaq 0x2d8(%rbx), %rdi
callq 0x41b0
leaq 0x270(%rbx), %rdi
callq 0x41b0
leaq 0x258(%rbx), %rdi
callq 0x86dc
leaq 0x218(%rbx), %rdi
callq 0x86dc
leaq 0x200(%rbx), %rdi
callq 0x8708
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4678
movq %rax, %r15
leaq 0x398(%rbx), %rdi
callq 0x45f0
leaq 0x358(%rbx), %rdi
callq 0x869c
leaq 0x348(%rbx), %rdi
callq 0x5204
leaq 0x340(%rbx), %rdi
callq 0x5204
movq %r14, %rdi
callq 0x5204
leaq 0x2f8(%rbx), %rdi
callq 0x86c8
leaq 0x2d8(%rbx), %rdi
callq 0x41b0
leaq 0x270(%rbx), %rdi
callq 0x86d2
leaq 0x258(%rbx), %rdi
callq 0x86dc
leaq 0x218(%rbx), %rdi
callq 0x86dc
leaq 0x200(%rbx), %rdi
callq 0x8708
movq %rbx, %rdi
callq 0x4678
movq %r15, %rdi
callq 0x4400
nop
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/Membership.cpp
// Function: Membership::pushMsgToFileSysQueue(MemberUpdateMsg)
void Membership::pushMsgToFileSysQueue(MemberUpdateMsg msg){
    std::unique_lock<std::mutex> locker( fileSysMsgQueueLock );

    this->fileSysMsgQueue.push_back(msg);

    this->fileSysMsgQueueCV.notify_all();
    usleep(5000);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x370(%rdi), %rsi
leaq -0x20(%rbp), %rdi
callq 0x8948
leaq 0x358(%rbx), %rdi
movq %r14, %rsi
callq 0x8968
addq $0x398, %rbx            # imm = 0x398
movq %rbx, %rdi
callq 0x4580
movl $0x1388, %edi           # imm = 0x1388
callq 0x4470
leaq -0x20(%rbp), %rdi
callq 0x89a4
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x20(%rbp), %rdi
callq 0x89a4
movq %rbx, %rdi
callq 0x45d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/Membership.cpp
// Function: Membership::leave()
void Membership::leave()
{
    membersLock.lock();
    Message msg;
    msg.type = MSG_LEAVE;
    msg.TTL = 1; // Just in case
    ipString2Char4(members.at(0).ip_str, msg.carrierAdd);
    msg.timeStamp = members.at(0).timeStamp;
    membersLock.unlock();
    spreadMessage(msg); // this method wants the lock!
    
    while(members.size()!=0){
        failMember(members[0].ip_str, members[0].timeStamp);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
leaq 0x230(%rdi), %r15
movq %r15, %rdi
callq 0x8608
leaq -0x3b(%rbp), %r13
movl $0x7, -0x5(%r13)
movb $0x1, 0xb(%r13)
leaq 0x258(%rbx), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x8754
leaq -0x60(%rbp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x4450
movq %r14, %rdi
movq %r13, %rsi
callq 0xd87c
leaq -0x60(%rbp), %rdi
callq 0x41b0
movq %r12, %rdi
xorl %esi, %esi
callq 0x8754
movl 0x20(%rax), %eax
movl %eax, -0x34(%rbp)
movq %r15, %rdi
callq 0x4290
movl -0x30(%rbp), %eax
movl %eax, 0x10(%rsp)
movups -0x40(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6c28
leaq -0x80(%rbp), %r14
movq 0x258(%rbx), %rsi
cmpq %rsi, 0x260(%rbx)
je 0x6c04
movq %r14, %rdi
callq 0x4450
movq 0x258(%rbx), %rax
movl 0x20(%rax), %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6e58
movq %r14, %rdi
callq 0x41b0
jmp 0x6bcd
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6c15
movq %rax, %rbx
movq %r14, %rdi
callq 0x41b0
movq %rbx, %rdi
callq 0x45d0
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/Membership.cpp
// Function: Membership::failMember(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
int Membership::failMember(std::string ip_str, int timeStamp){

    membersLock.lock();

    bool exist = false;
    int position = 0;

    for(int i=0; i<members.size(); i++){
        if( members[i].ip_str.compare( ip_str )==0 && members[i].timeStamp == timeStamp ){
            exist = true;
            position = i;
            break;
        }
    }
    
    if(exist){
        MemberUpdateMsg msg(MSG_LEAVE, members[position]);
        pushMsgToFileSysQueue(msg);

        members.erase( members.begin()+position );
    }
    
    membersLock.unlock();

    checkLeader();

    return !exist;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %edx, -0x2c(%rbp)
movq %rsi, %r15
movq %rdi, %rbx
addq $0x230, %rdi            # imm = 0x230
movq %rdi, -0x40(%rbp)
callq 0x8608
leaq 0x258(%rbx), %rax
movq %rax, -0x38(%rbp)
xorl %r12d, %r12d
xorl %r14d, %r14d
movq 0x258(%rbx), %rdi
movq 0x260(%rbx), %rax
subq %rdi, %rax
cqto
pushq $0x28
popq %rcx
idivq %rcx
movq %rax, %r13
cmpq %r14, %rax
jbe 0x6f54
addq %r12, %rdi
movq %r15, %rsi
callq 0x4040
testl %eax, %eax
jne 0x6edb
movq -0x38(%rbp), %rax
movq (%rax), %rsi
movl -0x2c(%rbp), %eax
cmpl %eax, 0x20(%rsi,%r12)
je 0x6ee4
incq %r14
addq $0x28, %r12
jmp 0x6e96
addq %r12, %rsi
leaq -0xd8(%rbp), %r15
movq %r15, %rdi
callq 0x8734
leaq -0xb0(%rbp), %rdi
pushq $0x7
popq %rsi
movq %r15, %rdx
callq 0x8434
leaq -0xd8(%rbp), %rdi
callq 0x41b0
leaq -0x78(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x847c
leaq -0x78(%rbp), %rsi
movq %rbx, %rdi
callq 0x6ac0
leaq -0x70(%rbp), %rdi
callq 0x41b0
movq -0x38(%rbp), %rdi
addq (%rdi), %r12
movq %r12, %rsi
callq 0x8914
leaq -0xa8(%rbp), %rdi
callq 0x41b0
xorl %r15d, %r15d
cmpq %r14, %r13
setbe %r15b
movq -0x40(%rbp), %rdi
callq 0x4290
movq %rbx, %rdi
callq 0x7b2e
movl %r15d, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6f94
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x41b0
jmp 0x6f97
movq %rax, %rbx
leaq -0xa8(%rbp), %r15
jmp 0x6fa3
movq %rax, %rbx
movq %r15, %rdi
callq 0x41b0
movq %rbx, %rdi
callq 0x45d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/Membership.cpp
// Function: Membership::addMember(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
int Membership::addMember(std::string newAddress, int timeStamp){
    Node newMember;
    newMember.ip_str = newAddress;
    newMember.timeStamp = timeStamp;
    newMember.active = 1;
    
    membersLock.lock();

    bool exist = false;
    int position = 0;
    for(int i=0; i < members.size(); i++){
        if( members[i].ip_str.compare( newMember.ip_str )==0 ){
            exist = true;
            position = i;
        }
    }
    
    if(exist){
        members[position].timeStamp = newMember.timeStamp;
    }
    else{
        //if add a new member, tell the memUpMsgQueue
        MemberUpdateMsg msg(MSG_JOIN, newMember);
        pushMsgToFileSysQueue(msg);

        members.push_back(newMember);
    }

    membersLock.unlock();

    logFile << "New member: " << newMember.ip_str << std::endl;

    return exist;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl %edx, %r14d
movq %rdi, %rbx
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x50(%rbp), %rdi
callq 0x4200
movl %r14d, -0x30(%rbp)
movl $0x1, -0x2c(%rbp)
leaq 0x230(%rbx), %rdi
movq %rdi, -0x60(%rbp)
callq 0x8608
leaq 0x258(%rbx), %rax
movq %rax, -0x58(%rbp)
xorl %r15d, %r15d
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %r14d, %r14d
movq 0x258(%rbx), %rdi
movq 0x260(%rbx), %rax
subq %rdi, %rax
cqto
pushq $0x28
popq %rcx
idivq %rcx
cmpq %r12, %rax
jbe 0x705d
addq %r15, %rdi
leaq -0x50(%rbp), %rsi
callq 0x4040
testl %eax, %eax
movzbl %r13b, %r13d
pushq $0x1
popq %rax
cmovel %eax, %r13d
cmovel %r12d, %r14d
incq %r12
addq $0x28, %r15
jmp 0x7019
testb $0x1, %r13b
je 0x7073
movl -0x30(%rbp), %eax
movslq %r14d, %rcx
imulq $0x28, %rcx, %rcx
movl %eax, 0x20(%rdi,%rcx)
jmp 0x70ec
leaq -0x88(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x8734
leaq -0xf8(%rbp), %rdi
pushq $0x6
popq %rsi
leaq -0x88(%rbp), %rdx
callq 0x8434
leaq -0x88(%rbp), %rdi
callq 0x41b0
leaq -0xc0(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x847c
leaq -0xc0(%rbp), %rsi
movq %rbx, %rdi
callq 0x6ac0
leaq -0xb8(%rbp), %rdi
callq 0x41b0
leaq -0x50(%rbp), %rsi
movq -0x58(%rbp), %rdi
callq 0x87bc
leaq -0xf0(%rbp), %rdi
callq 0x41b0
movq -0x60(%rbp), %rdi
callq 0x4290
leaq 0x8832(%rip), %rsi      # 0xf92e
movq %rbx, %rdi
callq 0x4370
leaq -0x50(%rbp), %rsi
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x41d0
andb $0x1, %r13b
movzbl %r13b, %ebx
leaq -0x50(%rbp), %rdi
callq 0x41b0
movl %ebx, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x41b0
jmp 0x715f
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
jmp 0x7166
jmp 0x7171
movq %rax, %rbx
leaq -0xf0(%rbp), %rdi
callq 0x41b0
jmp 0x7174
jmp 0x7171
jmp 0x7171
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x41b0
movq %rbx, %rdi
callq 0x45d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/Membership.cpp
// Function: Membership::broadcastJoin(Message, int)
int Membership::broadcastJoin(Message income, int i)
{
	income.TTL = 0;
	int connectionToServer;
    //TCP connect to members of introducer
    logFile<<"broadcastJoin: Introducer trying to broadcast join to "<<members[i].ip_str << std::endl;
    int ret = connect_to_server(members[i].ip_str.c_str(), port + 1, &connectionToServer);
    if(ret!=0){
        logFile<<"broadcastJoin: cannot connect to "<<members[i].ip_str << std::endl;
        return 1;
    }
    else{
    	ret = write(connectionToServer, &income, sizeof(Message) );
    	close(connectionToServer);
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %r14d
movq %rdi, %rbx
movb $0x0, 0x20(%rbp)
leaq 0x813c(%rip), %rsi      # 0xf4d6
callq 0x4370
movslq %r14d, %rcx
imulq $0x28, %rcx, %r14
movq 0x258(%rbx), %rsi
addq %r14, %rsi
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x41d0
movq 0x258(%rbx), %rax
movq (%rax,%r14), %rdi
movl 0x298(%rbx), %esi
incl %esi
leaq -0x14(%rbp), %rdx
callq 0xddff
testl %eax, %eax
je 0x740e
leaq 0x8126(%rip), %rsi      # 0xf50d
movq %rbx, %rdi
callq 0x4370
addq 0x258(%rbx), %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x4300
movq %rax, %rdi
callq 0x41d0
pushq $0x1
popq %rax
jmp 0x7427
leaq 0x10(%rbp), %rsi
movl -0x14(%rbp), %edi
pushq $0x14
popq %rdx
callq 0x4150
movl -0x14(%rbp), %edi
callq 0x4650
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/Membership.cpp
// Function: Membership::piggyMsg(Message, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Membership::piggyMsg( Message msg, std::string sender )
{
    std::string target = char42String(msg.carrierAdd);
    msg.type = MSG_PIGGY_PING;

    ipString2Char4(sender, msg.carrierAdd); //Original Sender as carrier

    sendUDP( sockfd,  target, port, (char*)&msg, sizeof(Message) );
    logFile << "Weired!: " << sender << " says that " << target << " did not responde..." << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x15(%rbp), %r15
leaq -0x38(%rbp), %rdi
movq %r15, %rsi
callq 0xd999
movl $0x3, -0x5(%r15)
leaq -0x58(%rbp), %rdi
movq %rbx, %rsi
callq 0x4450
leaq -0x58(%rbp), %rdi
movq %r15, %rsi
callq 0xd87c
leaq 0x10(%rbp), %r15
leaq -0x58(%rbp), %rdi
callq 0x41b0
movl 0x298(%r14), %edx
movl 0x29c(%r14), %edi
leaq -0x38(%rbp), %rsi
pushq $0x14
popq %r8
movq %r15, %rcx
callq 0xdc23
leaq 0x8278(%rip), %rsi      # 0xf791
movq %r14, %rdi
callq 0x4370
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4300
leaq 0x8268(%rip), %rsi      # 0xf79b
movq %rax, %rdi
callq 0x4370
leaq -0x38(%rbp), %rsi
movq %rax, %rdi
callq 0x4300
leaq 0x8259(%rip), %rsi      # 0xf7a7
movq %rax, %rdi
callq 0x4370
movq %rax, %rdi
callq 0x41d0
leaq -0x38(%rbp), %rdi
callq 0x41b0
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x41b0
jmp 0x7583
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x41b0
movq %rbx, %rdi
callq 0x45d0
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/Membership.cpp
// Function: Membership::piggyPingMsg(Message, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Membership::piggyPingMsg( Message msg, std::string sender )
{
    msg.type = MSG_PIGGY_ACK;
    //ipString2Char4(char42String(msg.carrierAdd), msg.carrierAdd); //Original Sender as carrier
    sendUDP( sockfd,  sender, port, (char*)&msg, sizeof(Message) );

    //Just in case, we can send the message back to the original sender
    // Because we can!
    std::string original = char42String(msg.carrierAdd);
    msg.type = MSG_ACK;
    sendUDP( sockfd,  original, port, (char*)&msg, sizeof(Message) );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x10(%rbp), %r14
movl $0x4, (%r14)
movl 0x298(%rdi), %edx
movl 0x29c(%rdi), %edi
pushq $0x14
popq %r15
movq %r14, %rcx
movl %r15d, %r8d
callq 0xdc23
leaq 0x15(%rbp), %r12
leaq -0x48(%rbp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0xd999
movl $0x1, -0x5(%r12)
movl 0x298(%rbx), %edx
movl 0x29c(%rbx), %edi
movq %r13, %rsi
movq %r14, %rcx
movl %r15d, %r8d
callq 0xdc23
leaq -0x48(%rbp), %rdi
callq 0x41b0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x41b0
movq %rbx, %rdi
callq 0x45d0
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/Membership.cpp
// Function: Membership::piggyAckMsg(Message, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Membership::piggyAckMsg( Message msg, std::string sender )
{
    std::string target = char42String(msg.carrierAdd);
    msg.type = MSG_ACK;

    ipString2Char4(sender, msg.carrierAdd); //Dont care, but meh

    sendUDP( sockfd,  target, port, (char*)&msg, sizeof(Message) );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x15(%rbp), %r14
leaq -0x58(%rbp), %rdi
movq %r14, %rsi
callq 0xd999
movl $0x1, -0x5(%r14)
leaq -0x38(%rbp), %rdi
movq %r15, %rsi
callq 0x4450
leaq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0xd87c
leaq 0x10(%rbp), %r14
leaq -0x38(%rbp), %rdi
callq 0x41b0
movl 0x298(%rbx), %edx
movl 0x29c(%rbx), %edi
leaq -0x58(%rbp), %rsi
pushq $0x14
popq %r8
movq %r14, %rcx
callq 0xdc23
leaq -0x58(%rbp), %rdi
callq 0x41b0
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x41b0
jmp 0x76c1
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x41b0
movq %rbx, %rdi
callq 0x45d0
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/Membership.cpp
// Function: Membership::failMsg(Message, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Membership::failMsg( Message msg, std::string sender )
{
	std::string carrier = char42String(msg.carrierAdd);
/*
    if ( my_ip_str.compare(carrier) == 0) // THIS IS MY! I NEED TO REJOIN
    {
        std::cout <<"they are trying to kill me!" << std::endl;
        membersLock.lock();
        members.clear();
        membersLock.unlock();
        usleep( 2000*1000 ); // wait 2 second and rejoin
        bool joined = firstJoin();
        while( !isIntroducer && !joined)
        {   //introducer will firstJoin() once. Other node will keep firstJoin() until it enter the group.
            joined = firstJoin();
            usleep( 1000*1000 );
        }
        return;
    }
*/
    failMember(carrier, msg.timeStamp);
	logFile<<"failMsg: node "<<carrier<<" failed acording to " << sender << std::endl;
/*
    int select = rand()%10;

    if (select <= 7) // 1 and 2
    //if (true) // 1 and 2
    {
        Message justInCase;
        justInCase.type = MSG_FAIL;
        msg.TTL = 0;
        ipString2Char4(carrier, justInCase.carrierAdd);
        sendUDP( sockfd,  carrier, port, (char*)&justInCase, sizeof(Message) );
        // Just in case let the node know so it can rejoin
    }
*/
    if(msg.TTL==0)
    {
        return;
    }
    else{
    	msg.TTL--;
    	spreadMessage(msg);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x15(%rbp), %rsi
leaq -0x58(%rbp), %r15
movq %r15, %rdi
callq 0xd999
leaq -0x38(%rbp), %rdi
movq %r15, %rsi
callq 0x4450
leaq 0x10(%rbp), %r15
movl 0xc(%r15), %edx
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
callq 0x6e58
leaq -0x38(%rbp), %rdi
callq 0x41b0
leaq 0x8048(%rip), %rsi      # 0xf76d
movq %rbx, %rdi
callq 0x4370
leaq -0x58(%rbp), %rsi
movq %rax, %rdi
callq 0x4300
leaq 0x803c(%rip), %rsi      # 0xf77c
movq %rax, %rdi
callq 0x4370
movq %rax, %rdi
movq %r14, %rsi
callq 0x4300
movq %rax, %rdi
callq 0x41d0
movb 0x10(%r15), %al
testb %al, %al
je 0x7783
decb %al
movb %al, 0x10(%r15)
movl 0x10(%r15), %eax
movl %eax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6c28
leaq -0x58(%rbp), %rdi
callq 0x41b0
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x41b0
jmp 0x77a8
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x41b0
movq %rbx, %rdi
callq 0x45d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/Membership.cpp
// Function: Membership::leaveMsg(Message, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Membership::leaveMsg( Message msg, std::string sender )
{
    std::string carrier = char42String(msg.carrierAdd);

    if ( !checkMember(carrier) ) return; // Already deleted

	failMember(carrier, msg.timeStamp);
    
    logFile<<"leaveMsg: node "<<carrier<<" has left"<<std::endl;

    if(msg.TTL == 0)
    {
        return;
    }
    else{
        msg.TTL--;
        spreadMessage(msg);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
leaq 0x15(%rbp), %rsi
leaq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0xd999
leaq -0x70(%rbp), %rdi
movq %r14, %rsi
callq 0x4450
leaq -0x70(%rbp), %rsi
movq %rbx, %rdi
callq 0x7dc8
movl %eax, %r14d
leaq -0x70(%rbp), %rdi
callq 0x41b0
testl %r14d, %r14d
je 0x7892
leaq -0x50(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x4450
leaq 0x10(%rbp), %r14
movl 0xc(%r14), %edx
leaq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0x6e58
leaq -0x50(%rbp), %rdi
callq 0x41b0
leaq 0x7f14(%rip), %rsi      # 0xf753
movq %rbx, %rdi
callq 0x4370
leaq -0x30(%rbp), %rsi
movq %rax, %rdi
callq 0x4300
leaq 0x7f09(%rip), %rsi      # 0xf763
movq %rax, %rdi
callq 0x4370
movq %rax, %rdi
callq 0x41d0
movb 0x10(%r14), %al
testb %al, %al
je 0x7892
decb %al
movb %al, 0x10(%r14)
movl 0x10(%r14), %eax
movl %eax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6c28
leaq -0x30(%rbp), %rdi
callq 0x41b0
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
jmp 0x78b7
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x41b0
jmp 0x78c1
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x41b0
movq %rbx, %rdi
callq 0x45d0
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/Membership.cpp
// Function: Membership::electionMsg(Message, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Membership::electionMsg( Message msg, std::string sender )
{
	logFile << "Election received! I am gonna bully that guy :)" << std::endl;
    msg.type = MSG_BULLY;
    ipString2Char4(sender, msg.carrierAdd); //Dont care, but meh

    sendUDP( sockfd,  sender, port, (char*)&msg, sizeof(Message) );

	runLeaderElection();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x7f67(%rip), %rsi      # 0xf855
callq 0x4370
movq %rax, %rdi
callq 0x41d0
leaq 0x15(%rbp), %r15
movl $0xa, -0x5(%r15)
leaq -0x40(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x4450
movq %r12, %rdi
movq %r15, %rsi
callq 0xd87c
leaq 0x10(%rbp), %r15
leaq -0x40(%rbp), %rdi
callq 0x41b0
movl 0x298(%rbx), %edx
movl 0x29c(%rbx), %edi
pushq $0x14
popq %r8
movq %r14, %rsi
movq %r15, %rcx
callq 0xdc23
movq %rbx, %rdi
callq 0x8030
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x41b0
movq %rbx, %rdi
callq 0x45d0
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/Membership.cpp
// Function: Membership::newLeaderMsg(Message, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Membership::newLeaderMsg( Message msg, std::string sender )
{
	logFile << "New leader recieved... lets check that..." << std::endl;
	bool flag = false;
	if ( isBiggerThanMine(sender, my_ip_str) )
	{
		membersLock.lock();

		for (int i = 0; i < members.size(); ++i)
		{
			if ( 0 == sender.compare(members.at(i).ip_str) )
			{
				logFile<< "Ok, new leader acepted: " <<  sender << std::endl;
				leader = members.at(i);
				leader.active = true;
				flag = true;
			}
			// Message msg;
			// msg.type = MSG_NEWLEADER_ACK;
			// sendUDP( sockfd,  other, port, (char*)&msg, sizeof(Message) );
		}

		membersLock.unlock();

		if(!flag)
		{
			runLeaderElection();
		}
	}
	else
	{
		logFile << "I am bigger than that guy! Re runnig election" <<  sender << std::endl;
		runLeaderElection();
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x7ef5(%rip), %rsi      # 0xf8b1
callq 0x4370
movq %rax, %rdi
callq 0x41d0
leaq -0x78(%rbp), %rdi
movq %r14, %rsi
callq 0x4450
leaq 0x2d8(%rbx), %rsi
leaq -0x58(%rbp), %rdi
callq 0x4450
leaq -0x78(%rbp), %rsi
leaq -0x58(%rbp), %rdx
movq %rbx, %rdi
callq 0x7e6a
movl %eax, %r15d
leaq -0x58(%rbp), %rdi
callq 0x41b0
leaq -0x78(%rbp), %rdi
callq 0x41b0
testb %r15b, %r15b
je 0x7ac2
leaq 0x230(%rbx), %rdi
movq %rdi, -0x30(%rbp)
callq 0x8608
leaq 0x258(%rbx), %r12
leaq 0x270(%rbx), %rax
movq %rax, -0x38(%rbp)
xorl %r15d, %r15d
xorl %r13d, %r13d
movq 0x260(%rbx), %rax
subq 0x258(%rbx), %rax
cqto
pushq $0x28
popq %rcx
idivq %rcx
cmpq %r15, %rax
jbe 0x7ae6
movq %r12, %rdi
movq %r15, %rsi
callq 0x8754
movq %r14, %rdi
movq %rax, %rsi
callq 0x4040
testl %eax, %eax
jne 0x7aba
movq %rbx, %rdi
leaq 0x7e5d(%rip), %rsi      # 0xf8db
callq 0x4370
movq %rax, %rdi
movq %r14, %rsi
callq 0x4300
movq %rax, %rdi
callq 0x41d0
movq %r12, %rdi
movq %r15, %rsi
callq 0x8754
movq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0x8898
movl $0x1, 0x294(%rbx)
movb $0x1, %r13b
incq %r15
jmp 0x7a3b
leaq 0x7e2b(%rip), %rsi      # 0xf8f4
movq %rbx, %rdi
callq 0x4370
movq %rax, %rdi
movq %r14, %rsi
callq 0x4300
movq %rax, %rdi
callq 0x41d0
jmp 0x7af5
movq -0x30(%rbp), %rdi
callq 0x4290
testb $0x1, %r13b
jne 0x7afd
movq %rbx, %rdi
callq 0x8030
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x41b0
jmp 0x7b1d
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x41b0
movq %rbx, %rdi
callq 0x45d0
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/Membership.cpp
// Function: Membership::checkLeader()
void Membership::checkLeader()
{
	logFile << "Checking leader... " << std::endl;

	if ( !leader.active)
	{
		logFile << "No leader! " << std::endl;
		runLeaderElection();
		return;
	}

	bool exist = false;

	membersLock.lock();

	for (int i = 0; i < members.size(); ++i)
	{
		if( leader.ip_str.compare(members.at(i).ip_str) == 0)
		{
			exist = true;
		}
	}

	membersLock.unlock();

	if (!exist)
	{
		leader.active = false;
		runLeaderElection();
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x7cef(%rip), %rsi      # 0xf835
callq 0x4370
movq %rax, %rdi
callq 0x41d0
cmpl $0x0, 0x294(%rbx)
je 0x7be0
leaq 0x270(%rbx), %r15
leaq 0x230(%rbx), %rdi
movq %rdi, -0x30(%rbp)
callq 0x8608
leaq 0x258(%rbx), %r12
xorl %r13d, %r13d
xorl %r14d, %r14d
movq 0x260(%rbx), %rax
subq 0x258(%rbx), %rax
cqto
pushq $0x28
popq %rcx
idivq %rcx
cmpq %r13, %rax
jbe 0x7bc2
movq %r12, %rdi
movq %r13, %rsi
callq 0x8754
movq %r15, %rdi
movq %rax, %rsi
callq 0x4040
testl %eax, %eax
sete %al
orb %al, %r14b
incq %r13
jmp 0x7b84
movq -0x30(%rbp), %rdi
callq 0x4290
testb $0x1, %r14b
je 0x7bf9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7c62(%rip), %rsi      # 0xf849
movq %rbx, %rdi
callq 0x4370
movq %rax, %rdi
callq 0x41d0
jmp 0x7c00
andl $0x0, 0x294(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8030
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/Membership.cpp
// Function: Membership::printMember[abi:cxx11]()
std::string Membership::printMember(){

    std::stringstream ret;
    membersLock.lock();
    for(int i=0; i < members.size(); i++){
        ret<<"Member["<<i<<"]: "<<members[i].ip_str<<" "<<members[i].timeStamp<<" "<<members[i].active<<std::endl;
    }
    membersLock.unlock();  

    return ret.str();  
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x1c0(%rbp), %rdi
callq 0x4260
leaq 0x230(%r14), %rdi
movq %rdi, -0x38(%rbp)
callq 0x8608
movq %rbx, -0x30(%rbp)
xorl %r13d, %r13d
pushq $0x28
popq %rbx
leaq 0x76c5(%rip), %r15      # 0xf322
xorl %r12d, %r12d
movq 0x260(%r14), %rax
subq 0x258(%r14), %rax
cqto
idivq %rbx
cmpq %r12, %rax
jbe 0x7d0d
leaq -0x1b0(%rbp), %rdi
leaq 0x7c98(%rip), %rsi      # 0xf922
callq 0x4370
movq %rax, %rdi
movl %r12d, %esi
callq 0x45a0
movq %rax, %rdi
leaq 0x7c86(%rip), %rsi      # 0xf92a
callq 0x4370
movq 0x258(%r14), %rsi
addq %r13, %rsi
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
movq %r15, %rsi
callq 0x4370
movq 0x258(%r14), %rcx
movl 0x20(%rcx,%r13), %esi
movq %rax, %rdi
callq 0x45a0
movq %rax, %rdi
movq %r15, %rsi
callq 0x4370
movq 0x258(%r14), %rcx
movl 0x24(%rcx,%r13), %esi
movq %rax, %rdi
callq 0x45a0
movq %rax, %rdi
callq 0x41d0
incq %r12
addq $0x28, %r13
jmp 0x7c60
movq -0x38(%rbp), %rdi
callq 0x4290
leaq -0x1a8(%rbp), %rsi
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x4510
leaq -0x1c0(%rbp), %rdi
callq 0x4280
movq %rbx, %rax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7d4c
movq %rax, %rbx
leaq -0x1c0(%rbp), %rdi
callq 0x4280
movq %rbx, %rdi
callq 0x45d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/Membership.cpp
// Function: Membership::ackMsgQueue()
bool Membership::ackMsgQueue(){
    bool acked = false;
    while(!msgQueueEmpty()){
        Message receive = popMsgQueue();
        if(receive.roundId==roundId)
            acked = true;
    }
    return acked;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x2f8(%rdi), %rcx
movq 0x300(%rdi), %rdx
movl 0x2c8(%rdi), %esi
xorl %eax, %eax
cmpq %rcx, %rdx
je 0x7dc3
movzbl -0x10(%rdx), %r8d
addq $-0x14, %rdx
movq %rdx, 0x300(%rdi)
cmpl %r8d, %esi
sete %r8b
orb %r8b, %al
jmp 0x7da2
andb $0x1, %al
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/Membership.cpp
// Function: Membership::checkMember(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int Membership::checkMember(std::string ip_str){
    bool exist = false;
    
    membersLock.lock();
    
    for(int i=0; i<members.size(); i++){
        if( members[i].ip_str.compare( ip_str )==0 ){
            exist = true;
        }
    }

    membersLock.unlock();

    return exist;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
addq $0x230, %rdi            # imm = 0x230
movq %rdi, -0x30(%rbp)
callq 0x8608
xorl %r13d, %r13d
xorl %ebx, %ebx
xorl %r12d, %r12d
movq 0x258(%r15), %rdi
movq 0x260(%r15), %rax
subq %rdi, %rax
cqto
pushq $0x28
popq %rcx
idivq %rcx
cmpq %rbx, %rax
jbe 0x7e33
addq %r13, %rdi
movq %r14, %rsi
callq 0x4040
testl %eax, %eax
movzbl %r12b, %r12d
pushq $0x1
popq %rax
cmovel %eax, %r12d
incq %rbx
addq $0x28, %r13
jmp 0x7df4
movq -0x30(%rbp), %rdi
callq 0x4290
andb $0x1, %r12b
movzbl %r12b, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/Membership.cpp
// Function: Membership::isBiggerThanMine(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool Membership::isBiggerThanMine(std::string other, std::string mine)
{
	char other_char[4];
	char me_char[4];
	ipString2Char4(other, other_char);
	ipString2Char4(mine, me_char);

	for (int i = 0; i < 4; ++i)
	{
		unsigned int me = (uint8_t) me_char[i];
		unsigned int ot = (uint8_t) other_char[i];
		logFile << ot << " > " << me << std::endl;
		if( ot > me){
			logFile << ot << " > " << me << std::endl;
			return true;
		}
		if( me > ot){
			logFile << ot << " < " << me << std::endl;
			return false;
		}
	}
	
	logFile << "comparing with myself: this code sucks!" << std::endl;
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r15
movq %rdi, %rbx
leaq -0x70(%rbp), %r14
movq %r14, %rdi
callq 0x4450
leaq -0x30(%rbp), %rsi
movq %r14, %rdi
callq 0xd87c
leaq -0x70(%rbp), %rdi
callq 0x41b0
leaq -0x50(%rbp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x4450
leaq -0x2c(%rbp), %rsi
movq %r14, %rdi
callq 0xd87c
leaq -0x50(%rbp), %rdi
callq 0x41b0
xorl %r13d, %r13d
leaq 0x78ec(%rip), %r15      # 0xf7bc
cmpq $0x4, %r13
je 0x7f3f
movzbl -0x2c(%rbp,%r13), %r14d
movzbl -0x30(%rbp,%r13), %r12d
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4250
movq %rax, %rdi
movq %r15, %rsi
callq 0x4370
movq %rax, %rdi
movq %r14, %rsi
callq 0x4250
movq %rax, %rdi
callq 0x41d0
cmpb %r14b, %r12b
ja 0x7f52
incq %r13
cmpb %r12b, %r14b
jbe 0x7ed0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4250
leaq 0x7896(%rip), %rsi      # 0xf7c0
movq %rax, %rdi
callq 0x4370
movq %rax, %rdi
movq %r14, %rsi
callq 0x4250
jmp 0x7f4e
leaq 0x787e(%rip), %rsi      # 0xf7c4
movq %rbx, %rdi
callq 0x4370
xorl %ebx, %ebx
jmp 0x7f79
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4250
leaq 0x7858(%rip), %rsi      # 0xf7bc
movq %rax, %rdi
callq 0x4370
movq %rax, %rdi
movq %r14, %rsi
callq 0x4250
movb $0x1, %bl
movq %rax, %rdi
callq 0x41d0
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7f94
movq %rax, %rbx
movq %r14, %rdi
callq 0x41b0
movq %rbx, %rdi
callq 0x45d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/Membership.cpp
// Function: Membership::checkMember(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
int Membership::checkMember(std::string ip_str, int timeStamp){
    bool exist = false;
    
    membersLock.lock();
    
    for(int i=0; i<members.size(); i++){
        if( members[i].ip_str.compare( ip_str )==0 && members[i].timeStamp == timeStamp){
            exist = true;
        }
    }

    membersLock.unlock();

    return exist;   
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, -0x2c(%rbp)
movq %rsi, %r15
movq %rdi, %r12
addq $0x230, %rdi            # imm = 0x230
movq %rdi, -0x38(%rbp)
callq 0x8608
xorl %r14d, %r14d
xorl %ebx, %ebx
xorl %r13d, %r13d
movq 0x258(%r12), %rdi
movq 0x260(%r12), %rax
subq %rdi, %rax
cqto
pushq $0x28
popq %rcx
idivq %rcx
cmpq %rbx, %rax
jbe 0x8337
addq %r14, %rdi
movq %r15, %rsi
callq 0x4040
testl %eax, %eax
jne 0x832e
movq 0x258(%r12), %rax
movl -0x2c(%rbp), %ecx
cmpl %ecx, 0x20(%rax,%r14)
movzbl %r13b, %r13d
pushq $0x1
popq %rax
cmovel %eax, %r13d
incq %rbx
addq $0x28, %r14
jmp 0x82e4
movq -0x38(%rbp), %rdi
callq 0x4290
andb $0x1, %r13b
movzbl %r13b, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/Membership.cpp
// Function: Membership::failureDetected(Node)
void Membership::failureDetected(Node process) // This is the method we call when we detect a failure
{
    Message msg;
    msg.type = MSG_FAIL;
    msg.roundId = 0;
    ipString2Char4( process.ip_str, msg.carrierAdd );
    msg.timeStamp = process.timeStamp;
    msg.TTL = K_FORWARD;

    spreadMessage(msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x33(%rbp), %r15
movl $0x5, -0x5(%r15)
movb $0x0, -0x1(%r15)
leaq -0x58(%rbp), %r12
movq %r12, %rdi
callq 0x4450
movq %r12, %rdi
movq %r15, %rsi
callq 0xd87c
leaq -0x58(%rbp), %rdi
callq 0x41b0
movl 0x20(%r14), %eax
movl %eax, -0x2c(%rbp)
movb $0x4, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, 0x10(%rsp)
movups -0x38(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6c28
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x41b0
movq %rbx, %rdi
callq 0x45d0
nop