// File: /workspace/github_cpp_makefile_star2_O3/girdhari9[P]mTORRENT/ClientConnection.cpp
// Function: BitVectorRequestToServers(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void BitVectorRequestToServers(string IPaddress, int PORT, int thread_n,int TotalPacket, string SHA){
    int sock = Connection(IPaddress,PORT);

    int BitMapRequest = 1;
    send(sock , &BitMapRequest , sizeof(int) , 0 );
    send(sock , &TotalPacket , sizeof(int) , 0 );
    send(sock, SHA.c_str(), sizeof(SHA), 0);

    char recvBuffer[TotalPacket];
    memset(&recvBuffer, '\0',TotalPacket);
    int ack = 1, AvlPack;

    read(sock, recvBuffer, TotalPacket);
    read(sock, &AvlPack, sizeof(int));
    send(sock , &ack , sizeof(int) , 0 );

    string BitString = (string)recvBuffer;
    sem_wait(&mutex1);
        TotalAvlPack.insert(make_pair(AvlPack,thread_n));
        PacketNoAvl[thread_n] = BitString;
    sem_post(&mutex1);
    return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r8, %r15
movl %edx, %ebx
movl %esi, %r14d
movl %edx, -0x34(%rbp)
movl %ecx, -0x30(%rbp)
leaq -0x78(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rdi), %rsi
movq 0x8(%rdi), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %r12
movq %r12, %rdi
callq 0x74cc
movq %r12, %rdi
movl %r14d, %esi
callq 0xa31c
movl %eax, %r14d
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
je 0x992f
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x4350
movl $0x1, %eax
leaq -0x48(%rbp), %rsi
movl %eax, (%rsi)
movl $0x4, %edx
movl %r14d, %edi
xorl %ecx, %ecx
callq 0x41c0
leaq -0x30(%rbp), %r12
movl $0x4, %edx
movl %r14d, %edi
movq %r12, %rsi
xorl %ecx, %ecx
callq 0x41c0
movq (%r15), %rsi
movl $0x20, %edx
movl %r14d, %edi
xorl %ecx, %ecx
callq 0x41c0
movq %rsp, -0x40(%rbp)
movl (%r12), %eax
movq %rsp, %r15
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
movslq (%r12), %r12
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x4200
leaq -0x44(%rbp), %r13
movl $0x1, %eax
movl %eax, (%r13)
movl %r14d, %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x44a0
leaq -0x2c(%rbp), %rsi
movl $0x4, %edx
movl %r14d, %edi
callq 0x44a0
movl $0x4, %edx
movl %r14d, %edi
movq %r13, %rsi
xorl %ecx, %ecx
callq 0x41c0
leaq -0x58(%rbp), %r14
movq %r14, -0x10(%r14)
movq %r15, %rdi
callq 0x41a0
leaq (%rax,%r15), %rdx
leaq -0x68(%rbp), %rdi
movq %r15, %rsi
callq 0x7562
leaq 0x8f00(%rip), %rdi      # 0x12900
callq 0x4210
movl -0x2c(%rbp), %eax
shlq $0x20, %rbx
orq %rax, %rbx
leaq -0x90(%rbp), %rsi
movq %rbx, (%rsi)
leaq 0x8f38(%rip), %rdi      # 0x12958
callq 0xb294
leaq 0x8efc(%rip), %rdi      # 0x12928
leaq -0x34(%rbp), %rsi
callq 0xa71c
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x41f0
leaq 0x8eb8(%rip), %rdi      # 0x12900
callq 0x4580
movq -0x68(%rbp), %rdi
cmpq %r14, %rdi
je 0x9a62
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x4350
movq -0x40(%rbp), %rsp
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9a91
movq %rax, %rbx
jmp 0x9aa9
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
je 0x9aa9
movq -0x78(%rbp), %rsi
jmp 0x9aa1
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r14, %rdi
je 0x9aa9
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x4350
movq %rbx, %rdi
callq 0x45d0