LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/rachit31[P]CubeSatADCS/threadManager.cpp
// Function: ThreadManager::create(void* (*)(void*), unsigned int)
const char* ThreadManager::create(void *(*function)(void *), const unsigned int id)
{
  std::stringstream error;

  // Look for existing id
  if (m_threadMap.count(id))
  {
    error << "thread " << id << " already exists";
    return error.str().c_str();
  }

  return threadCreate(function,id);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x1c(%rbp), %r15
movl %edx, (%r15)
leaq -0x1c8(%rbp), %rdi
callq 0x2170
leaq 0x8(%r14), %rdi
movq %r15, %rsi
callq 0x45ca
testq %rax, %rax
je 0x4151
leaq -0x1b8(%rbp), %rdi
leaq 0x31cc(%rip), %rsi      # 0x72e0
callq 0x2220
movl -0x1c(%rbp), %esi
movq %rax, %rdi
callq 0x2150
leaq 0x31bd(%rip), %rsi      # 0x72e8
movq %rax, %rdi
callq 0x2220
leaq -0x1b0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x22e0
leaq -0x40(%rbp), %rdi
movq (%rdi), %rbx
callq 0x20f0
jmp 0x4162
movl -0x1c(%rbp), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3fa2
movq %rax, %rbx
leaq -0x1c8(%rbp), %rdi
callq 0x21b0
movq %rbx, %rax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4181
movq %rax, %rbx
leaq -0x1c8(%rbp), %rdi
callq 0x21b0
movq %rbx, %rdi
callq 0x2350
// File: /workspace/github_cpp_makefile_star2_O2/rachit31[P]CubeSatADCS/threadManager.cpp
// Function: ThreadManager::cancel(unsigned int)
const char* ThreadManager::cancel(const unsigned int id)
{
  std::stringstream error;
  int retVal;

  if (!m_threadMap.count(id))
  {
    error << "thread id " << id << " does not exist";
    return error.str().c_str();
  }

  // Cancel the thread (TLPI pg 671)
  retVal = pthread_cancel(m_threadMap[id]->getThread());
  if (retVal != 0)
  {
    error << "pthread_cancel(): " << std::strerror(retVal);
    return error.str().c_str();
  }

  return error.str().c_str();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, %rbx
leaq -0x14(%rbp), %r14
movl %esi, (%r14)
leaq -0x1c0(%rbp), %rdi
callq 0x2170
addq $0x8, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x45ca
testq %rax, %rax
je 0x4536
leaq -0x14(%rbp), %rsi
movq %rbx, %rdi
callq 0x462a
movq (%rax), %rdi
callq 0x4ec6
movq %rax, %rdi
callq 0x2270
movl %eax, %ebx
testl %eax, %eax
je 0x4575
leaq -0x1b0(%rbp), %rdi
leaq 0x2e7d(%rip), %rsi      # 0x7387
callq 0x2220
movq %rax, %r14
movl %ebx, %edi
callq 0x20b0
movq %r14, %rdi
movq %rax, %rsi
callq 0x2220
leaq -0x1a8(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x22e0
jmp 0x4585
leaq -0x1b0(%rbp), %rdi
leaq 0x2e28(%rip), %rsi      # 0x736c
callq 0x2220
movl -0x14(%rbp), %esi
movq %rax, %rdi
callq 0x2150
leaq 0x2e1c(%rip), %rsi      # 0x7377
movq %rax, %rdi
callq 0x2220
leaq -0x1a8(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x22e0
jmp 0x4585
leaq -0x1a8(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x22e0
leaq -0x38(%rbp), %rdi
movq (%rdi), %rbx
callq 0x20f0
leaq -0x1c0(%rbp), %rdi
callq 0x21b0
movq %rbx, %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x45b2
jmp 0x45b2
jmp 0x45b2
movq %rax, %rbx
leaq -0x1c0(%rbp), %rdi
callq 0x21b0
movq %rbx, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O2/rachit31[P]CubeSatADCS/thread.cpp
// Function: Thread::Thread(void* (*)(void*), ThreadManager*, unsigned int)
Thread::Thread(void *(*function)(void *),
               ThreadManager* pManager,
               const unsigned int id) :
m_alive(true), m_pManager(pManager), m_id(id)
{
  int retVal;

  // Create pthread (TLPI pg 622)
  retVal = pthread_create(&m_pthread, NULL, function, this);
  if (retVal != 0)
  {
    std::stringstream error;
    error << "pthread_create(): " << std::strerror(retVal);
    throw error.str().c_str();
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rsi, %rax
movq %rdi, %r8
movl %ecx, (%rdi)
movb $0x1, 0x10(%rdi)
movq %rdx, 0x18(%rdi)
addq $0x8, %rdi
xorl %esi, %esi
movq %rax, %rdx
movq %r8, %rcx
callq 0x2370
testl %eax, %eax
jne 0x4e1b
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r14
popq %rbp
retq
movl %eax, %ebx
leaq -0x1b8(%rbp), %rdi
callq 0x2170
leaq -0x1a8(%rbp), %rdi
leaq 0x25a8(%rip), %rsi      # 0x73df
callq 0x2220
movq %rax, %r14
movl %ebx, %edi
callq 0x20b0
movq %r14, %rdi
movq %rax, %rsi
callq 0x2220
pushq $0x8
popq %rdi
callq 0x2110
movq %rax, %r14
leaq -0x1a0(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x22e0
movq -0x30(%rbp), %rax
movq %rax, (%r14)
movq 0x514e(%rip), %rsi      # 0x9fc8
movq %r14, %rdi
xorl %edx, %edx
callq 0x2320
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x20f0
jmp 0x4ea2
movq %rax, %rbx
movq %r14, %rdi
callq 0x2190
jmp 0x4ea2
movq %rax, %rbx
leaq -0x1b8(%rbp), %rdi
callq 0x21b0
movq %rbx, %rdi
callq 0x2350
// File: /workspace/github_cpp_makefile_star2_O2/rachit31[P]CubeSatADCS/thread.cpp
// Function: Thread::threadCleanup()
void Thread::threadCleanup()
{
  // Get the mutex from the threadManager
  Mutex* pMutex = m_pManager->getMutex();

  // Lock the mutex
  pMutex->lock();

  // Mark this thread as dead
  m_alive = false;

  // Increment the managers join variable
  m_pManager->incrementJoin();

  // Unlock the mutex
  pMutex->unlock();

  // Signal the thread conditional variable
  pMutex->signal();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x4498
movq %rax, %r14
movq %rax, %rdi
callq 0x3228
movb $0x0, 0x10(%rbx)
movq 0x18(%rbx), %rdi
callq 0x4490
movq %r14, %rdi
callq 0x32e4
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x34b8
nop
// File: /workspace/github_cpp_makefile_star2_O2/rachit31[P]CubeSatADCS/propagateANDupdate.cpp
// Function: quatProp(double const (&) [3], double, double (&) [4])
void quatProp(const double (&wbi_B)[3], const double dtGyro, double (&q_BI)[4])
 {
	 double wmag = sqrt(wbi_B[0]*wbi_B[0]+wbi_B[1]*wbi_B[1]+wbi_B[2]*wbi_B[2]);
		
	 double s = sin(0.5*wmag*dtGyro);
     double c = cos(0.5*wmag*dtGyro);
		
     double psi[3];
		
     psi[0] = s*wbi_B[0]/wmag;
     psi[1] = s*wbi_B[1]/wmag;
     psi[2] = s*wbi_B[2]/wmag;
		
     double qnew_BI[4];
		
     qnew_BI[0] = c*q_BI[0] - psi[0]*q_BI[1] - psi[1]*q_BI[2] - psi[2]*q_BI[3];
     qnew_BI[1] = c*q_BI[1] + psi[0]*q_BI[0] - psi[1]*q_BI[3] + psi[2]*q_BI[2];
     qnew_BI[2] = c*q_BI[2] + psi[1]*q_BI[0] + psi[0]*q_BI[3] - psi[2]*q_BI[1];
     qnew_BI[3] = c*q_BI[3] - psi[0]*q_BI[2] + psi[1]*q_BI[1] + psi[2]*q_BI[0];
		
     double qmag = sqrt(qnew_BI[0]*qnew_BI[0]+qnew_BI[1]*qnew_BI[1]+qnew_BI[2]*qnew_BI[2]+qnew_BI[3]*qnew_BI[3]);
		
     q_BI[0] = qnew_BI[0]/qmag;
     q_BI[1] = qnew_BI[1]/qmag;
     q_BI[2] = qnew_BI[2]/qmag;
     q_BI[3] = qnew_BI[3]/qmag;
 }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movsd (%rdi), %xmm2
movsd 0x8(%rdi), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm2, %xmm2
addsd %xmm1, %xmm2
movsd 0x10(%rdi), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm2, %xmm1
sqrtsd %xmm1, %xmm2
movsd %xmm2, -0x28(%rbp)
movsd 0x1650(%rip), %xmm1     # 0x7410
mulsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
callq 0x2080
movsd %xmm0, -0x20(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x2380
movsd (%r14), %xmm1
movsd -0x20(%rbp), %xmm12
mulsd %xmm12, %xmm1
movsd -0x28(%rbp), %xmm3
divsd %xmm3, %xmm1
movsd 0x8(%r14), %xmm2
mulsd %xmm12, %xmm2
divsd %xmm3, %xmm2
mulsd 0x10(%r14), %xmm12
divsd %xmm3, %xmm12
movsd (%rbx), %xmm3
movsd 0x8(%rbx), %xmm4
movapd %xmm2, %xmm6
movapd %xmm0, %xmm5
mulsd %xmm4, %xmm5
movapd %xmm2, %xmm7
movapd %xmm2, %xmm8
movapd %xmm12, %xmm9
mulsd %xmm4, %xmm9
mulsd %xmm4, %xmm2
movapd %xmm4, %xmm10
mulsd %xmm1, %xmm10
movapd %xmm0, %xmm4
mulsd %xmm3, %xmm4
subsd %xmm10, %xmm4
movsd 0x10(%rbx), %xmm10
mulsd %xmm10, %xmm6
subsd %xmm6, %xmm4
movsd 0x18(%rbx), %xmm11
movapd %xmm12, %xmm6
mulsd %xmm11, %xmm6
subsd %xmm6, %xmm4
movapd %xmm1, %xmm6
mulsd %xmm3, %xmm6
addsd %xmm6, %xmm5
mulsd %xmm11, %xmm7
subsd %xmm7, %xmm5
movapd %xmm12, %xmm6
mulsd %xmm10, %xmm6
addsd %xmm5, %xmm6
mulsd %xmm3, %xmm8
movapd %xmm0, %xmm5
mulsd %xmm10, %xmm5
addsd %xmm8, %xmm5
mulsd %xmm1, %xmm10
mulsd %xmm11, %xmm1
addsd %xmm5, %xmm1
subsd %xmm9, %xmm1
mulsd %xmm11, %xmm0
subsd %xmm10, %xmm0
addsd %xmm0, %xmm2
mulsd %xmm3, %xmm12
addsd %xmm2, %xmm12
movapd %xmm6, %xmm0
mulsd %xmm6, %xmm0
movapd %xmm4, %xmm2
mulsd %xmm4, %xmm2
addsd %xmm0, %xmm2
movapd %xmm1, %xmm0
mulsd %xmm1, %xmm0
addsd %xmm2, %xmm0
movapd %xmm12, %xmm2
mulsd %xmm12, %xmm2
addsd %xmm0, %xmm2
sqrtsd %xmm2, %xmm0
divsd %xmm0, %xmm4
movsd %xmm4, (%rbx)
divsd %xmm0, %xmm6
movsd %xmm6, 0x8(%rbx)
divsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rbx)
divsd %xmm0, %xmm12
movsd %xmm12, 0x18(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/rachit31[P]CubeSatADCS/propagateANDupdate.cpp
// Function: X(double const (&) [3], double (&) [3][3])
void X(const double (&v)[3], double (&vX)[3][3])
{
  vX[0][0] = 0;
  vX[0][1] = -v[2];
  vX[0][2] = v[1];
  vX[1][0] = v[2];
  vX[1][1] = 0;
  vX[1][2] = -v[0];
  vX[2][0] = -v[1];
  vX[2][1] = v[0];
  vX[2][2] = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
andq $0x0, (%rsi)
movsd 0x10(%rdi), %xmm0
movaps 0x14f1(%rip), %xmm1     # 0x7440
xorps %xmm1, %xmm0
movlps %xmm0, 0x8(%rsi)
movsd 0x8(%rdi), %xmm0
movsd %xmm0, 0x10(%rsi)
movsd 0x10(%rdi), %xmm0
movsd %xmm0, 0x18(%rsi)
andq $0x0, 0x20(%rsi)
movsd (%rdi), %xmm0
xorps %xmm1, %xmm0
movlps %xmm0, 0x28(%rsi)
movsd 0x8(%rdi), %xmm0
xorps %xmm1, %xmm0
movlps %xmm0, 0x30(%rsi)
movsd (%rdi), %xmm0
movsd %xmm0, 0x38(%rsi)
andq $0x0, 0x40(%rsi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/rachit31[P]CubeSatADCS/propagateANDupdate.cpp
// Function: mult3x3(double const (&) [3][3], double const (&) [3][3], double (&) [3][3])
void mult3x3(const double (&A)[3][3], const double (&B)[3][3], double (&C)[3][3])
{
  for (int i = 0; i < 3; i++)
  {
    for (int j = 0; j < 3; j++)
    {
      C[i][j] = 0;

      for (int k = 0; k < 3; k++)
      {
        C[i][j] += A[i][k]*B[k][j];
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
xorl %eax, %eax
cmpq $0x3, %rax
je 0x6031
imulq $0x18, %rax, %rcx
addq %rdx, %rcx
movq %rsi, %r8
xorl %r9d, %r9d
cmpq $0x3, %r9
je 0x6028
leaq (%rcx,%r9,8), %r10
andq $0x0, (%r10)
xorpd %xmm0, %xmm0
movq %r8, %r11
xorl %ebx, %ebx
cmpq $0x3, %rbx
je 0x601f
movsd (%rdi,%rbx,8), %xmm1
mulsd (%r11), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, (%r10)
incq %rbx
addq $0x18, %r11
jmp 0x5ffd
incq %r9
addq $0x8, %r8
jmp 0x5fe6
incq %rax
addq $0x18, %rdi
jmp 0x5fd3
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/rachit31[P]CubeSatADCS/propagateANDupdate.cpp
// Function: mult6x6(double const (&) [6][6], double const (&) [6][6], double (&) [6][6])
void mult6x6(const double (&A)[6][6], const double (&B)[6][6], double (&C)[6][6])
{
  for (int i = 0; i < 6; i++)
  {
    for (int j = 0; j < 6; j++)
    {
      C[i][j] = 0;

      for (int k = 0; k < 6; k++)
      {
        C[i][j] += A[i][k]*B[k][j];
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
xorl %eax, %eax
cmpq $0x6, %rax
je 0x610c
imulq $0x30, %rax, %rcx
addq %rdx, %rcx
movq %rsi, %r8
xorl %r9d, %r9d
cmpq $0x6, %r9
je 0x6103
leaq (%rcx,%r9,8), %r10
andq $0x0, (%r10)
xorpd %xmm0, %xmm0
movq %r8, %r11
xorl %ebx, %ebx
cmpq $0x6, %rbx
je 0x60fa
movsd (%rdi,%rbx,8), %xmm1
mulsd (%r11), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, (%r10)
incq %rbx
addq $0x30, %r11
jmp 0x60d8
incq %r9
addq $0x8, %r8
jmp 0x60c1
incq %rax
addq $0x30, %rdi
jmp 0x60ae
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/MisakiFx[P]P2PDownload/main.cpp
// Function: main
int main()
{
  //服务端
  std::thread thr(srv_start);
  thr.detach();
  //客户端
  P2PClient client(9000);
  client.Start();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x48, %rsp
leaq -0x65(%rip), %rsi       # 0x8c5c
leaq -0x10(%rbp), %rbx
movq %rbx, %rdi
callq 0x91d0
movq %rbx, %rdi
callq 0x8970
leaq -0x48(%rbp), %rdi
movl $0x2328, 0x4(%rdi)      # imm = 0x2328
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x28(%rdi)
callq 0x923e
leaq -0x48(%rbp), %rdi
callq 0x9334
leaq -0x10(%rbp), %rdi
callq 0x9358
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x9334
jmp 0x8d20
movq %rax, %rbx
leaq -0x10(%rbp), %rdi
callq 0x9358
movq %rbx, %rdi
callq 0x8990
nop
// File: /workspace/github_cpp_makefile_star2_O2/MisakiFx[P]P2PDownload/./server.hpp
// Function: P2PServer::P2PServer()
P2PServer()
  {
    if(!bf::exists(SHARE_PATH))
    {
      bf::create_directory(SHARE_PATH);
    }
    if(!bf::exists(DOWNLOAD_PATH))
    {
      bf::create_directory(DOWNLOAD_PATH);
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
callq 0x9958
leaq 0x1b1b2(%rip), %rsi     # 0x241b2
leaq -0x30(%rbp), %rdi
callq 0x99cc
leaq -0x30(%rbp), %rdi
callq 0x99a8
movl %eax, %r14d
leaq -0x30(%rbp), %rdi
callq 0x8aa8
testb %r14b, %r14b
jne 0x9045
leaq 0x1b188(%rip), %rsi     # 0x241b2
leaq -0x30(%rbp), %rdi
callq 0x99cc
leaq -0x30(%rbp), %rdi
callq 0x99e3
leaq -0x30(%rbp), %rdi
callq 0x8aa8
leaq 0x1b16d(%rip), %rsi     # 0x241b9
leaq -0x30(%rbp), %rdi
callq 0x99cc
leaq -0x30(%rbp), %rdi
callq 0x99a8
movl %eax, %r14d
leaq -0x30(%rbp), %rdi
callq 0x8aa8
testb %r14b, %r14b
jne 0x9091
leaq 0x1b143(%rip), %rsi     # 0x241b9
leaq -0x30(%rbp), %rdi
callq 0x99cc
leaq -0x30(%rbp), %rdi
callq 0x99e3
leaq -0x30(%rbp), %rdi
callq 0x8aa8
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x90a6
jmp 0x90b4
jmp 0x90a6
jmp 0x90b4
jmp 0x90a6
jmp 0x90b4
movq %rax, %r14
leaq -0x30(%rbp), %rdi
callq 0x8aa8
jmp 0x90b7
movq %rax, %r14
movq %rbx, %rdi
callq 0x8d94
movq %r14, %rdi
callq 0x8990
nop
// File: /workspace/github_cpp_makefile_star2_O2/MisakiFx[P]P2PDownload/./server.hpp
// Function: P2PServer::Start(unsigned short)
bool Start(uint16_t port)
  {
    _server.Get("/hostpair", GetHostPair);
    _server.Get("/list", GetFileList);
    _server.Get("/list/(.*)", GetFileData);
    _server.listen("0.0.0.0", port);
    return true;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
leaq -0x88(%rbp), %rbx
andq $0x0, 0x8(%rbx)
movl %esi, %r15d
movq %rdi, %r14
leaq 0x980(%rip), %rax       # 0x9a72
movq %rax, (%rbx)
leaq 0xb08e(%rip), %r12      # 0x1418a
movq %r12, 0x18(%rbx)
leaq 0xb093(%rip), %r13      # 0x1419a
movq %r13, 0x10(%rbx)
leaq 0x1b0b0(%rip), %rsi     # 0x241c2
movq %rbx, %rdx
callq 0x99f2
leaq -0x88(%rbp), %rdi
callq 0x16248
leaq -0x68(%rbp), %rbx
andq $0x0, 0x8(%rbx)
leaq 0x94a(%rip), %rax       # 0x9a80
movq %rax, (%rbx)
movq %r12, 0x18(%rbx)
movq %r13, 0x10(%rbx)
leaq 0x1b084(%rip), %rsi     # 0x241cc
movq %r14, %rdi
movq %rbx, %rdx
callq 0x99f2
leaq -0x68(%rbp), %rdi
callq 0x16248
leaq -0x48(%rbp), %rbx
andq $0x0, 0x8(%rbx)
leaq 0xa96(%rip), %rax       # 0x9c02
movq %rax, (%rbx)
movq %r12, 0x18(%rbx)
movq %r13, 0x10(%rbx)
leaq 0x1b054(%rip), %rsi     # 0x241d2
movq %r14, %rdi
movq %rbx, %rdx
callq 0x99f2
leaq -0x48(%rbp), %rdi
callq 0x16248
movzwl %r15w, %edx
leaq 0x1b040(%rip), %rsi     # 0x241dd
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9fde
movb $0x1, %al
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x91bc
jmp 0x91bc
movq %rax, %r14
movq %rbx, %rdi
callq 0x16248
movq %r14, %rdi
callq 0x8990
nop
// File: /workspace/github_cpp_makefile_star2_O2/MisakiFx[P]P2PDownload/./client.hpp
// Function: P2PClient::Start()
bool Start()
    {
      while(1)
      {
        int choose = DoFace();
        std::vector<std::string> list;
        std::string filename;
        switch(choose)
        {
          case 1:
            GetAllHost(list);
            GetOnlineHost(list);
            break;
          case 2:
            if(ShowOnlineHost() == false)
            {
              break;
            }
            GetFileList();
            break;
          case 3:
            if(ShowFileList(filename) == false)
            {
              break;
            }
            DownloadFIle(filename);
            break;
          case 0:
            exit(0);
            break;
          default:
            std::cout << "input error" << std::endl;
            break;
        }
      }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq -0x38(%rbp), %r14
leaq -0x48(%rbp), %r12
leaq -0x60(%rbp), %r13
leaq 0x1addb(%rip), %r15     # 0x24040
movq %rbx, %rdi
callq 0x15214
andq $0x0, -0x50(%rbp)
movq %r14, -0x48(%rbp)
andq $0x0, -0x40(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
movb $0x0, -0x38(%rbp)
cmpl $0x3, %eax
ja 0x92c4
movl %eax, %eax
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movq %rbx, %rdi
movq %r13, %rsi
callq 0x152ba
movq %rbx, %rdi
movq %r13, %rsi
callq 0x153a2
jmp 0x92fb
movq %rbx, %rdi
callq 0x1549e
testb %al, %al
je 0x92fb
movq %rbx, %rdi
callq 0x155e4
jmp 0x92fb
movq 0x2eccd(%rip), %rdi     # 0x37f98
leaq 0x1ba1a(%rip), %rsi     # 0x24cec
callq 0x8530
movq %rax, %rdi
callq 0x8250
jmp 0x92fb
movq %rbx, %rdi
movq %r12, %rsi
callq 0x15750
testb %al, %al
je 0x92fb
movq %rbx, %rdi
movq %r12, %rsi
callq 0x158b0
movq %r12, %rdi
callq 0x8aa8
movq %r13, %rdi
callq 0xe67e
jmp 0x9265
xorl %edi, %edi
callq 0x86b0
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x8aa8
leaq -0x60(%rbp), %rdi
callq 0xe67e
movq %rbx, %rdi
callq 0x8990
// File: /workspace/github_cpp_makefile_star2_O2/MisakiFx[P]P2PDownload/./server.hpp
// Function: P2PServer::GetFileList(httplib::Request const&, httplib::Response&)
static void GetFileList(const Request& req, Response& rsp)
  {
    bf::directory_iterator item_begin(SHARE_PATH);
    bf::directory_iterator item_end;
    //std::stringstream body;
    //body << "<html><body>";
    //std::string body;
    for(; item_begin != item_end; ++item_begin)
    {
      //越过目录
      if(bf::is_directory(item_begin->status()))
      {
        continue;
      }
      //获取路径
      //std::string path = item_begin->path().string();
      //获取文件名
      std::string name = item_begin->path().filename().string();
      //std::cout << name << std::endl;
      rsp.body += name + "\n";
      //body << "<h4><a href='/list/" << name <<  "'>";
      //body << name;
      //body << "</a></h4>";
    }
    //body << "</body></html>";
    rsp.set_header("Content-Type", "text/html");
    //rsp.body = body.str();
    rsp.status = 200;
    //rsp.set_content(&body[0], body.size(), "text");
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r12
leaq 0x1a717(%rip), %rsi     # 0x241b2
leaq -0x68(%rbp), %rbx
movq %rbx, %rdi
callq 0x99cc
leaq -0x30(%rbp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x141c2
leaq -0x68(%rbp), %r14
movq %r14, %rdi
callq 0x8aa8
leaq -0x38(%rbp), %r15
andq $0x0, (%r15)
movq %r12, -0x40(%rbp)
addq $0x58, %r12
leaq -0x30(%rbp), %r13
leaq -0x88(%rbp), %rbx
movq %r13, %rdi
movq %r15, %rsi
callq 0x141ef
testb %al, %al
je 0x9b65
movq %r13, %rdi
callq 0x14356
leaq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x141fc
cmpl $0x3, -0x48(%rbp)
je 0x9b58
movq %r13, %rdi
callq 0x14356
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8490
movq %r14, %rdi
movq %rbx, %rsi
callq 0x87b0
movq %rbx, %rdi
callq 0x8aa8
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x1b870(%rip), %rdx     # 0x253a8
callq 0x14216
movq %r12, %rdi
movq %rbx, %rsi
callq 0x8a50
movq %rbx, %rdi
callq 0x8aa8
movq %r14, %rdi
callq 0x8aa8
movq %r13, %rdi
callq 0x1439a
jmp 0x9adc
leaq 0x1af1b(%rip), %rsi     # 0x24a87
leaq 0x1af21(%rip), %rdx     # 0x24a94
movq -0x40(%rbp), %rbx
movq %rbx, %rdi
callq 0x1424e
movl $0xc8, 0x20(%rbx)
leaq -0x38(%rbp), %rdi
callq 0x1427a
leaq -0x30(%rbp), %rdi
callq 0x1427a
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9be4
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x8aa8
jmp 0x9bf9
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
jmp 0x9bdd
movq %rax, %rbx
jmp 0x9bd9
jmp 0x9be4
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x8aa8
leaq -0x68(%rbp), %rdi
callq 0x8aa8
jmp 0x9be7
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x1427a
leaq -0x30(%rbp), %rdi
callq 0x1427a
movq %rbx, %rdi
callq 0x8990
nop
// File: /workspace/github_cpp_makefile_star2_O2/MisakiFx[P]P2PDownload/./server.hpp
// Function: P2PServer::RangeParse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, long&, long&)
static bool RangeParse(std::string& range_val, int64_t& start, int64_t& len)
  {
      size_t pos1 = range_val.find('=');
      size_t pos2 = range_val.find('-');
      //没找到
      if(pos1 == std::string::npos || pos2 == std::string::npos)
      {
        std::cerr << "range " << range_val << " format error" << std::endl;
        return false;
      }
      int64_t end;
      std::string rstart, rend;
      rstart = range_val.substr(pos1 + 1, pos2 - pos1 - 1);
      rend = range_val.substr(pos2 + 1, std::string::npos);
      std::stringstream tmp;
      tmp << rstart;
      tmp >> start;
      tmp.clear();
      tmp << rend;
      tmp >> end;
      len = end - start + 1;
      return true;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdx, -0x30(%rbp)
movq %rsi, %r15
movq %rdi, %r12
pushq $0x3d
popq %rsi
xorl %edx, %edx
callq 0x8740
movq %rax, %r14
pushq $0x2d
popq %rsi
movq %r12, %rdi
xorl %edx, %edx
callq 0x8740
movq %rax, %r13
cmpq $-0x1, %r14
setne %al
cmpq $-0x1, %r13
setne %bl
andb %al, %bl
je 0x14977
leaq -0x68(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0x1(%r14), %rdx
notq %r14
addq %r13, %r14
leaq -0x200(%rbp), %rdi
movq %r12, %rsi
movq %r14, %rcx
callq 0x8590
leaq -0x78(%rbp), %rdi
leaq -0x200(%rbp), %r14
movq %r14, %rsi
callq 0x86c0
movq %r14, %rdi
callq 0x8aa8
incq %r13
leaq -0x200(%rbp), %rdi
pushq $-0x1
popq %rcx
movq %r12, %rsi
movq %r13, %rdx
callq 0x8590
leaq -0x58(%rbp), %rdi
movq %r14, %rsi
callq 0x86c0
movq %r14, %rdi
callq 0x8aa8
leaq -0x200(%rbp), %rdi
callq 0x83c0
leaq -0x1f0(%rbp), %r14
leaq -0x78(%rbp), %rsi
movq %r14, %rdi
callq 0x84b0
leaq -0x200(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x8570
movq -0x200(%rbp), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x8920
leaq -0x58(%rbp), %rsi
movq %r14, %rdi
callq 0x84b0
leaq -0x200(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x8570
movq -0x38(%rbp), %rax
subq (%r15), %rax
incq %rax
movq -0x30(%rbp), %rcx
movq %rax, (%rcx)
leaq -0x200(%rbp), %rdi
callq 0x8410
leaq -0x58(%rbp), %rdi
callq 0x8aa8
leaq -0x78(%rbp), %rdi
callq 0x8aa8
jmp 0x149ac
movq 0x2366a(%rip), %rdi     # 0x37fe8
leaq 0x10340(%rip), %rsi     # 0x24cc5
callq 0x8530
movq %rax, %rdi
movq %r12, %rsi
callq 0x84b0
leaq 0x10342(%rip), %rsi     # 0x24cde
movq %rax, %rdi
callq 0x8530
movq %rax, %rdi
callq 0x8250
movl %ebx, %eax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x149c4
jmp 0x149c4
movq %rax, %rbx
jmp 0x149d8
movq %rax, %rbx
leaq -0x200(%rbp), %rdi
callq 0x8410
leaq -0x58(%rbp), %rdi
callq 0x8aa8
leaq -0x78(%rbp), %rdi
callq 0x8aa8
movq %rbx, %rdi
callq 0x8990
// File: /workspace/github_cpp_makefile_star2_O2/MisakiFx[P]P2PDownload/./httplib.h
// Function: httplib::detail::get_header_value(std::multimap<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, httplib::detail::ci, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const&, char const*, unsigned long, char const*)
inline const char *get_header_value(const Headers &headers, const char *key,
                size_t id = 0, const char *def = nullptr) {
            auto it = headers.find(key);
            std::advance(it, id);
            if (it != headers.end()) { return it->second.c_str(); }
            return def;
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rdi, %r14
leaq -0x50(%rbp), %r12
leaq -0x21(%rbp), %rdx
movq %r12, %rdi
callq 0x81d0
movq %r14, %rdi
movq %r12, %rsi
callq 0x14afc
leaq -0x30(%rbp), %r12
movq %rax, (%r12)
leaq -0x50(%rbp), %rdi
callq 0x8aa8
movq %r12, %rdi
movq %r15, %rsi
callq 0x14c15
addq $0x8, %r14
movq (%r12), %rax
cmpq %r14, %rax
je 0x14bf1
movq 0x40(%rax), %rbx
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x8aa8
movq %rbx, %rdi
callq 0x8990
// File: /workspace/github_cpp_makefile_star2_O2/MisakiFx[P]P2PDownload/./httplib.h
// Function: httplib::Server::bind_internal(char const*, int, int)
inline int Server::bind_internal(const char *host, int port, int socket_flags) {
        if (!is_valid()) { return -1; }

        svr_sock_ = create_server_socket(host, port, socket_flags);
        if (svr_sock_ == INVALID_SOCKET) { return -1; }

        if (port == 0) {
            struct sockaddr_storage address;
            socklen_t len = sizeof(address);
            if (getsockname(svr_sock_, reinterpret_cast<struct sockaddr *>(&address),
                        &len) == -1) {
                return -1;
            }
            if (address.ss_family == AF_INET) {
                return ntohs(reinterpret_cast<struct sockaddr_in *>(&address)->sin_port);
            } else if (address.ss_family == AF_INET6) {
                return ntohs(
                        reinterpret_cast<struct sockaddr_in6 *>(&address)->sin6_port);
            } else {
                return -1;
            }
        } else {
            return port;
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %ecx, %r12d
movl %edx, %r14d
movq %rsi, %r13
movq %rdi, %r15
movq (%rdi), %rax
callq *0x10(%rax)
pushq $-0x1
popq %rbx
testb %al, %al
je 0x14cd4
movq %r13, %rdi
movl %r14d, %esi
movl %r12d, %edx
callq 0x14e0f
movl %eax, 0x1c(%r15)
cmpl $-0x1, %eax
je 0x14cd4
movl %r14d, %ebx
testl %r14d, %r14d
je 0x14ce8
movl %ebx, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x2c(%rbp), %rdx
movl $0x80, (%rdx)
leaq -0xb0(%rbp), %rsi
movl %eax, %edi
callq 0x84f0
pushq $-0x1
popq %rbx
cmpl $-0x1, %eax
je 0x14cd4
movzwl -0xb0(%rbp), %eax
cmpl $0xa, %eax
je 0x14d19
cmpl $0x2, %eax
jne 0x14cd4
movzwl -0xae(%rbp), %eax
rolw $0x8, %ax
movzwl %ax, %ebx
jmp 0x14cd4
nop
// File: /workspace/github_cpp_makefile_star2_O2/MisakiFx[P]P2PDownload/./httplib.h
// Function: httplib::Server::listen_internal()
inline bool Server::listen_internal() {
        auto ret = true;

        is_running_ = true;

        for (;;) {
            auto val = detail::select_read(svr_sock_, 0, 100000);

            if (val == 0) { // Timeout
                if (svr_sock_ == INVALID_SOCKET) {
                    // The server socket was closed by 'stop' method.
                    break;
                }
                continue;
            }

            socket_t sock = accept(svr_sock_, nullptr, nullptr);

            if (sock == INVALID_SOCKET) {
                if (svr_sock_ != INVALID_SOCKET) {
                    detail::close_socket(svr_sock_);
                    ret = false;
                } else {
                    ; // The server socket was closed by user.
                }
                break;
            }

            // TODO: Use thread pool...
            std::thread([=]() {
                    {
                    std::lock_guard<std::mutex> guard(running_threads_mutex_);
                    running_threads_++;
                    }

                    read_and_close_socket(sock);

                    {
                    std::lock_guard<std::mutex> guard(running_threads_mutex_);
                    running_threads_--;
                    }
                    }).detach();
        }

        // TODO: Use thread pool...
        for (;;) {
            std::this_thread::sleep_for(std::chrono::milliseconds(10));
            std::lock_guard<std::mutex> guard(running_threads_mutex_);
            if (!running_threads_) { break; }
        }

        is_running_ = false;

        return ret;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movb $0x1, 0x18(%rdi)
leaq -0x40(%rbp), %r14
leaq -0x38(%rbp), %r15
movl 0x1c(%rbx), %edi
movl $0x186a0, %edx          # imm = 0x186A0
xorl %esi, %esi
callq 0x15057
movl 0x1c(%rbx), %edi
testl %eax, %eax
je 0x14d92
xorl %esi, %esi
xorl %edx, %edx
callq 0x8160
cmpl $-0x1, %eax
je 0x14d99
movq %rbx, -0x38(%rbp)
movl %eax, -0x30(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x150c2
movq %r14, %rdi
callq 0x8970
movq %r14, %rdi
callq 0x9358
jmp 0x14d4a
cmpl $-0x1, %edi
jne 0x14d4a
jmp 0x14dab
movl 0x1c(%rbx), %edi
cmpl $-0x1, %edi
je 0x14dab
callq 0x8a60
xorl %r14d, %r14d
jmp 0x14dae
movb $0x1, %r14b
leaq 0x110(%rbx), %r15
leaq -0x38(%rbp), %r12
movq $0xa, -0x38(%rbp)
movq %r12, %rdi
callq 0x15133
movq %r15, %rdi
callq 0x9942
movl 0x138(%rbx), %r13d
movq %r15, %rdi
callq 0x8430
testl %r13d, %r13d
jne 0x14db9
movb $0x0, 0x18(%rbx)
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x9358
movq %rbx, %rdi
callq 0x8990
// File: /workspace/github_cpp_makefile_star2_O2/MisakiFx[P]P2PDownload/./httplib.h
// Function: httplib::detail::select_read(int, long, long)
inline int select_read(socket_t sock, time_t sec, time_t usec) {
            fd_set fds;
            FD_ZERO(&fds);
            FD_SET(sock, &fds);

            timeval tv;
            tv.tv_sec = static_cast<long>(sec);
            tv.tv_usec = static_cast<long>(usec);

            return select(static_cast<int>(sock + 1), &fds, nullptr, nullptr, &tv);
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdx, %r9
xorl %eax, %eax
cmpq $0x10, %rax
je 0x1507b
andq $0x0, -0x90(%rbp,%rax,8)
incq %rax
jmp 0x15067
pushq $0x40
popq %rcx
movl %edi, %eax
cltd
idivl %ecx
movslq %eax, %rdx
shll $0x6, %eax
movl %edi, %ecx
subl %eax, %ecx
pushq $0x1
popq %rax
shlq %cl, %rax
orq %rax, -0x90(%rbp,%rdx,8)
leaq -0x10(%rbp), %r8
movq %rsi, (%r8)
movq %r9, 0x8(%r8)
incl %edi
leaq -0x90(%rbp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x8520
addq $0x90, %rsp
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/MisakiFx[P]P2PDownload/./client.hpp
// Function: P2PClient::DoFace()
int DoFace()
    {
      std::cout << "1.Serch Host nearby" << std::endl;
      std::cout << "2.Show Online Host" << std::endl;
      std::cout << "3.Show File List" << std::endl;
      std::cout << "0.Exit" << std::endl;
      int choose;
      std::cout << "please choose:";
      fflush(stdout);
      scanf("%d", &choose);
      return choose;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x22d77(%rip), %rbx     # 0x37f98
leaq 0xfad0(%rip), %rsi      # 0x24cf8
movq %rbx, %rdi
callq 0x8530
movq %rax, %rdi
callq 0x8250
leaq 0xfacd(%rip), %rsi      # 0x24d0c
movq %rbx, %rdi
callq 0x8530
movq %rax, %rdi
callq 0x8250
leaq 0xfac9(%rip), %rsi      # 0x24d1f
movq %rbx, %rdi
callq 0x8530
movq %rax, %rdi
callq 0x8250
leaq 0xfac3(%rip), %rsi      # 0x24d30
movq %rbx, %rdi
callq 0x8530
movq %rax, %rdi
callq 0x8250
leaq 0xfab3(%rip), %rsi      # 0x24d37
movq %rbx, %rdi
callq 0x8530
movq 0x22cc5(%rip), %rax     # 0x37f58
movq (%rax), %rdi
callq 0x8680
leaq 0xfaa4(%rip), %rdi      # 0x24d46
leaq -0xc(%rbp), %rbx
movq %rbx, %rsi
xorl %eax, %eax
callq 0x8640
movl (%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/MisakiFx[P]P2PDownload/./client.hpp
// Function: P2PClient::GetAllHost(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
bool GetAllHost(std::vector<std::string>& list)
    {
      struct ifaddrs* addrs = NULL;
      getifaddrs(&addrs);
      struct sockaddr_in* ip = NULL;
      struct sockaddr_in* mask = NULL;
      for(; addrs != NULL; addrs = addrs->ifa_next)
      {
        ip = (struct sockaddr_in*)addrs->ifa_addr;
        mask = (struct sockaddr_in*)addrs->ifa_netmask;
        //不是ipv4的跳过
        if(ip->sin_family != AF_INET)
        {
          continue;
        }
        //跳过本地回环网卡
        if(ip->sin_addr.s_addr == inet_addr("127.0.0.1"))
        {
          continue;
        }
        uint32_t net, host;
        //网络号
        net = ntohl(ip->sin_addr.s_addr & mask->sin_addr.s_addr);
        //最大主机号
        host = ntohl(~mask->sin_addr.s_addr);
        for(int i = 1; i <= host; i++)
        {
          struct in_addr ip;
          ip.s_addr = htonl(net + i);
          list.push_back(inet_ntoa(ip));
        }
      }
      freeifaddrs(addrs);
      return true;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
leaq -0x38(%rbp), %r14
andq $0x0, (%r14)
movq %r14, %rdi
callq 0x8a10
movq (%r14), %rax
leaq -0x60(%rbp), %r15
leaq -0x29(%rbp), %r12
testq %rax, %rax
je 0x15375
movq 0x18(%rax), %r14
cmpw $0x2, (%r14)
jne 0x1531a
movq 0x20(%rax), %rax
movq %rax, -0x40(%rbp)
movl 0x4(%r14), %r13d
leaq 0xfa39(%rip), %rdi      # 0x24d49
callq 0x8550
cmpl %eax, %r13d
jne 0x15327
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x152e9
movq -0x40(%rbp), %rax
movl 0x4(%rax), %r13d
movl 0x4(%r14), %r14d
andl %r13d, %r14d
bswapl %r14d
notl %r13d
bswapl %r13d
incl %r14d
subl $0x1, %r13d
jb 0x1531a
movl %r14d, %edi
bswapl %edi
callq 0x8210
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x81d0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x15cc8
movq %r15, %rdi
callq 0x8aa8
jmp 0x1533f
xorl %edi, %edi
callq 0x8960
movb $0x1, %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x8aa8
movq %rbx, %rdi
callq 0x8990
nop
// File: /workspace/github_cpp_makefile_star2_O2/MisakiFx[P]P2PDownload/./client.hpp
// Function: P2PClient::GetOnlineHost(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
bool GetOnlineHost(std::vector<std::string>& list)
    {
      _online_list.clear();
      std::vector<std::thread> thr_list(list.size());
      //广播配对
      for(int i = 0; i < list.size(); i++)
      {
        //一个个发送连接请求过慢，使用多线程并行完成
        //参数与入口函数参数类型严格匹配
        thr_list[i] = std::move(std::thread(&P2PClient::HostPair, this, std::ref(list[i])));
      }
      for(auto& i : thr_list)
      {
        i.join();
      }
      return true;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, -0x30(%rbp)
addq $0x8, %rdi
callq 0x15dba
movq 0x8(%rbx), %rsi
subq (%rbx), %rsi
sarq $0x5, %rsi
leaq -0x68(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x15dc8
xorl %r13d, %r13d
leaq -0x70(%rbp), %r12
xorl %r15d, %r15d
xorl %r14d, %r14d
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %r14, %rcx
jbe 0x15452
leaq 0xa18(%rip), %rcx       # 0x15e1a
movq %rcx, -0x50(%rbp)
andq $0x0, -0x48(%rbp)
movq -0x30(%rbp), %rcx
movq %rcx, -0x40(%rbp)
addq %r15, %rax
movq %rax, -0x38(%rbp)
movq %r12, %rdi
leaq -0x50(%rbp), %rsi
leaq -0x40(%rbp), %rdx
leaq -0x38(%rbp), %rcx
callq 0x15eee
movq -0x68(%rbp), %rdi
addq %r13, %rdi
movq %r12, %rsi
callq 0x15f7c
movq %r12, %rdi
callq 0x9358
incq %r14
addq $0x20, %r15
addq $0x8, %r13
jmp 0x153e8
movq -0x68(%rbp), %rbx
movq -0x60(%rbp), %r14
cmpq %r14, %rbx
je 0x1546d
movq %rbx, %rdi
callq 0x8930
addq $0x8, %rbx
jmp 0x1545a
leaq -0x68(%rbp), %rdi
callq 0x15f9a
movb $0x1, %al
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x15489
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x15f9a
movq %rbx, %rdi
callq 0x8990
nop
// File: /workspace/github_cpp_makefile_star2_O2/MisakiFx[P]P2PDownload/./client.hpp
// Function: P2PClient::ShowOnlineHost()
bool ShowOnlineHost()
    {
      if(_online_list.empty())
      {
        std::cerr << "no online host!" << std::endl;
        return false;
      }
      for(int i = 0; i < _online_list.size(); i++)
      {
        std::cout << i << ". " << _online_list[i] << std::endl;
      }
      std::cout << _online_list.size() << ". " << "return" << std::endl;
      std::cout << "please choose:";
      fflush(stdout);
      std::cin >> _host_idx;
      if(_host_idx == _online_list.size())
      {
        _host_idx = -1;
        return false;
      }
      if(_host_idx < 0 || _host_idx > _online_list.size())
      {
        _host_idx = -1;
        std::cerr << "choose error" << std::endl;
        return false;
      }
      return true;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
movq 0x10(%rdi), %rsi
cmpq %rsi, %rax
je 0x15599
movq %rdi, %rbx
xorl %r13d, %r13d
movq 0x22ace(%rip), %r14     # 0x37f98
leaq 0xf896(%rip), %r15      # 0x24d67
xorl %r12d, %r12d
subq %rax, %rsi
sarq $0x5, %rsi
cmpq %r12, %rsi
jbe 0x1551e
movq %r14, %rdi
movl %r12d, %esi
callq 0x8950
movq %rax, %rdi
movq %r15, %rsi
callq 0x8530
movq 0x8(%rbx), %rsi
addq %r13, %rsi
movq %rax, %rdi
callq 0x84b0
movq %rax, %rdi
callq 0x8250
incq %r12
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rsi
addq $0x20, %r13
jmp 0x154d4
movq 0x22a73(%rip), %r14     # 0x37f98
movq %r14, %rdi
callq 0x8390
leaq 0xf833(%rip), %rsi      # 0x24d67
movq %rax, %rdi
callq 0x8530
leaq 0xf21a(%rip), %rsi      # 0x2475d
movq %rax, %rdi
callq 0x8530
movq %rax, %rdi
callq 0x8250
leaq 0xf7dd(%rip), %rsi      # 0x24d37
movq %r14, %rdi
callq 0x8530
movq 0x229ef(%rip), %rax     # 0x37f58
movq (%rax), %rdi
callq 0x8680
movq 0x22a58(%rip), %rdi     # 0x37fd0
movq %rbx, %rsi
callq 0x8310
movslq (%rbx), %rcx
movq 0x10(%rbx), %rdx
subq 0x8(%rbx), %rdx
sarq $0x5, %rdx
cmpq %rcx, %rdx
jne 0x155a9
orl $-0x1, (%rbx)
jmp 0x155d2
movq 0x22a48(%rip), %rdi     # 0x37fe8
leaq 0xf7b0(%rip), %rsi      # 0x24d57
jmp 0x155c5
testl %ecx, %ecx
js 0x155b4
movb $0x1, %al
cmpq %rcx, %rdx
jae 0x155d4
orl $-0x1, (%rbx)
movq 0x22a2a(%rip), %rdi     # 0x37fe8
leaq 0xf7a5(%rip), %rsi      # 0x24d6a
callq 0x8530
movq %rax, %rdi
callq 0x8250
xorl %eax, %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/MisakiFx[P]P2PDownload/./client.hpp
// Function: P2PClient::GetFileList()
bool GetFileList()
    {
      Client client(_online_list[_host_idx].c_str(), _srv_port);
      auto rsp = client.Get("/list");
      if(rsp && rsp->status == 200)
      {
        std::vector<std::string> list;
        boost::split(list, rsp->body, boost::is_any_of("\n"));
        list.pop_back();
        _file_list = list;
        return true;
      }
      else 
      {
        std::cerr << "get file list error" << std::endl;
        return false;
      }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
movslq (%rdi), %rax
movq 0x8(%rdi), %rcx
shlq $0x5, %rax
movq (%rcx,%rax), %rsi
movl 0x4(%rdi), %edx
leaq -0xd8(%rbp), %r14
movl $0x12c, %ecx            # imm = 0x12C
movq %r14, %rdi
callq 0x160f4
xorps %xmm0, %xmm0
leaq -0x80(%rbp), %rcx
movaps %xmm0, (%rcx)
movaps %xmm0, 0x10(%rcx)
leaq 0xeb9c(%rip), %rdx      # 0x241cc
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0x161b0
leaq -0x80(%rbp), %rdi
callq 0x16248
movq -0x40(%rbp), %r14
testq %r14, %r14
je 0x156c5
cmpl $0xc8, 0x20(%r14)
jne 0x156c5
xorps %xmm0, %xmm0
movaps %xmm0, -0x30(%rbp)
andq $0x0, -0x20(%rbp)
leaq 0xfd3d(%rip), %rsi      # 0x253a8
leaq -0x58(%rbp), %rdi
callq 0x17157
addq $0x58, %r14
leaq -0x30(%rbp), %rdi
leaq -0x58(%rbp), %rdx
pushq $0x1
popq %rcx
movq %r14, %rsi
callq 0x170cb
leaq -0x58(%rbp), %rdi
callq 0x17188
leaq -0x30(%rbp), %r14
movq 0x8(%r14), %rdi
addq $-0x20, %rdi
movq %rdi, 0x8(%r14)
callq 0x8aa8
addq $0x20, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x171a4
leaq -0x30(%rbp), %rdi
callq 0xe67e
movb $0x1, %bl
jmp 0x156e2
movq 0x2291c(%rip), %rdi     # 0x37fe8
leaq 0xf6a4(%rip), %rsi      # 0x24d77
callq 0x8530
movq %rax, %rdi
callq 0x8250
xorl %ebx, %ebx
leaq -0x38(%rbp), %rdi
callq 0x140c0
leaq -0xd8(%rbp), %rdi
callq 0x8e2c
movl %ebx, %eax
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x17188
jmp 0x15716
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0xe67e
jmp 0x15732
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x16248
jmp 0x1573b
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x140c0
leaq -0xd8(%rbp), %rdi
callq 0x8e2c
movq %rbx, %rdi
callq 0x8990
nop
// File: /workspace/github_cpp_makefile_star2_O2/MisakiFx[P]P2PDownload/./client.hpp
// Function: P2PClient::ShowFileList(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool ShowFileList(std::string& name)
    {
      if(_file_list.empty())
      {
        std::cerr << "no file!" << std::endl;
        return false;
      }
      for(int i = 0; i < _file_list.size(); i++)
      {
        std::cout << i << ". " << _file_list[i] << std::endl;
      }
      std::cout << _file_list.size() << ". " << "return" << std::endl;
      std::cout << "please choose:";
      fflush(stdout);
      int file_idx;
      std::cin >> file_idx;
      if(file_idx == _file_list.size())
      {
        return false;
      }
      if(file_idx < 0 || file_idx > _file_list.size())
      {
        std::cerr << "choose error" << std::endl;
        return false;
      }
      name = _file_list[file_idx];
      return true;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rcx
movq 0x20(%rdi), %rax
movq 0x28(%rdi), %rsi
cmpq %rsi, %rax
je 0x15873
movq %rdi, %r14
movq %rcx, -0x30(%rbp)
xorl %ebx, %ebx
movq 0x22813(%rip), %r15     # 0x37f98
leaq 0xf5db(%rip), %r12      # 0x24d67
xorl %r13d, %r13d
subq %rax, %rsi
sarq $0x5, %rsi
cmpq %r13, %rsi
jbe 0x157d9
movq %r15, %rdi
movl %r13d, %esi
callq 0x8950
movq %rax, %rdi
movq %r12, %rsi
callq 0x8530
movq 0x20(%r14), %rsi
addq %rbx, %rsi
movq %rax, %rdi
callq 0x84b0
movq %rax, %rdi
callq 0x8250
incq %r13
movq 0x20(%r14), %rax
movq 0x28(%r14), %rsi
addq $0x20, %rbx
jmp 0x1578f
movq 0x227b8(%rip), %r15     # 0x37f98
movq %r15, %rdi
callq 0x8390
leaq 0xf578(%rip), %rsi      # 0x24d67
movq %rax, %rdi
callq 0x8530
leaq 0xef5f(%rip), %rsi      # 0x2475d
movq %rax, %rdi
callq 0x8530
movq %rax, %rdi
callq 0x8250
leaq 0xf522(%rip), %rsi      # 0x24d37
movq %r15, %rdi
callq 0x8530
movq 0x22734(%rip), %rax     # 0x37f58
movq (%rax), %rdi
callq 0x8680
movq 0x2279d(%rip), %rdi     # 0x37fd0
leaq -0x34(%rbp), %r15
movq %r15, %rsi
callq 0x8310
movslq (%r15), %rax
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rcx
subq %rsi, %rcx
sarq $0x5, %rcx
cmpq %rax, %rcx
je 0x1589e
testl %eax, %eax
js 0x15883
cmpq %rax, %rcx
jb 0x15883
shlq $0x5, %rax
addq %rax, %rsi
movq -0x30(%rbp), %rdi
callq 0x82c0
movb $0x1, %al
jmp 0x158a0
movq 0x2276e(%rip), %rdi     # 0x37fe8
leaq 0xf528(%rip), %rsi      # 0x24da9
jmp 0x15891
movq 0x2275e(%rip), %rdi     # 0x37fe8
leaq 0xf4d9(%rip), %rsi      # 0x24d6a
callq 0x8530
movq %rax, %rdi
callq 0x8250
xorl %eax, %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/MisakiFx[P]P2PDownload/./client.hpp
// Function: P2PClient::HostPair(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void HostPair(std::string& i)
    {
      Client client(i.c_str(),_srv_port);
      auto rsp = client.Get("/hostpair");
      if(rsp && rsp->status == 200)
      {
        _online_list.push_back(i);
      }
      printf("%s\n", i.c_str());
      return;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rsi
movl 0x4(%rdi), %edx
leaq -0xa8(%rbp), %r15
movl $0x12c, %ecx            # imm = 0x12C
movq %r15, %rdi
callq 0x160f4
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rcx
movaps %xmm0, (%rcx)
movaps %xmm0, 0x10(%rcx)
leaq 0xe363(%rip), %rdx      # 0x241c2
leaq -0x28(%rbp), %rdi
movq %r15, %rsi
callq 0x161b0
leaq -0x50(%rbp), %rdi
callq 0x16248
movq -0x28(%rbp), %rax
testq %rax, %rax
je 0x15e95
cmpl $0xc8, 0x20(%rax)
jne 0x15e95
addq $0x8, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x11d62
movq (%rbx), %rdi
callq 0x8880
leaq -0x20(%rbp), %rdi
callq 0x140c0
leaq -0xa8(%rbp), %rdi
callq 0x8e2c
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x20(%rbp), %rdi
callq 0x140c0
jmp 0x15eda
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x16248
leaq -0xa8(%rbp), %rdi
callq 0x8e2c
movq %rbx, %rdi
callq 0x8990
// File: /workspace/github_cpp_makefile_star2_O2/MisakiFx[P]P2PDownload/./httplib.h
// Function: httplib::Client::Get(char const*, std::multimap<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, httplib::detail::ci, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const&, std::function<bool (unsigned long, unsigned long)>)
inline std::shared_ptr<Response>
        Client::Get(const char *path, const Headers &headers, Progress progress) {
            Request req;
            req.method = "GET";
            req.path = path;
            req.headers = headers;
            req.progress = progress;

            auto res = std::make_shared<Response>();

            return send(req, *res) ? res : nullptr;
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
leaq -0x198(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %r9d, %r9d
movb %r9b, (%rax)
leaq -0x178(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %r9b, (%rax)
leaq -0x158(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %r8, %r14
movb %r9b, (%rax)
leaq -0x138(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %r9b, (%rax)
leaq -0x120(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq %rcx, %r12
movq %rdx, %r13
leaq -0xe8(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %r9b, (%rax)
leaq -0xd0(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0xa0(%rbp), %rax
andl $0x0, (%rax)
movq %rsi, %r15
andq $0x0, 0x8(%rax)
movq %rdi, %rbx
leaq -0x188(%rbp), %rdi
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
andq $0x0, 0x60(%rax)
leaq 0xe981(%rip), %rsi      # 0x24d53
callq 0x8a40
leaq -0x148(%rbp), %rdi
movq %r13, %rsi
callq 0x8a40
leaq -0x128(%rbp), %rdi
movq %r12, %rsi
callq 0x1674a
leaq -0x58(%rbp), %rdi
movq %r14, %rsi
callq 0x164d4
leaq -0x38(%rbp), %rdi
callq 0x16534
movq -0x38(%rbp), %rdx
leaq -0x1a8(%rbp), %rsi
movq %r15, %rdi
callq 0x16550
testb %al, %al
je 0x1642f
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
callq 0x16ffe
jmp 0x16435
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
leaq -0x30(%rbp), %rdi
callq 0x140c0
leaq -0x1a8(%rbp), %rdi
callq 0x165a0
movq %rbx, %rax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x140c0
jmp 0x16472
jmp 0x1646f
movq %rax, %rbx
leaq -0x1a8(%rbp), %rdi
callq 0x165a0
movq %rbx, %rdi
callq 0x8990