// File: /workspace/github_cpp_makefile_star2_O3/girdhari9[P]mTORRENT/ClientConnection.cpp
// Function: FunctionCalling(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int FunctionCalling(string filename, int RequestType,string SHA_TO_Add, string root_path){
    sem_init(&mutex1, 0, 1);
    int FileSize;
    string FileName, SHA;
    if(filename.size() > 9 && filename.substr(filename.size()-9) != ".mtorrent"){
        cout<<"\n> Please give name of mtorrent file!\n";
        return 0;
    }

    int TorrentFileD = open(filename.c_str(), O_RDONLY, O_SYNC);
    ReadFileByLine(TorrentFileD,1);

    int sock = TrackerConnection(mTorrentFileData[0],atoi(mTorrentFileData[1].c_str()));
    if(sock == -1){
        cout<<"Error in connection\n";
        exit(0);
    }
    else{
        cout<<"> Connected with Tracker: "<<mTorrentFileData[0]<<":"<<mTorrentFileData[1]<<"";
    }
    if(RequestType == 1){

        ReadFileByLine(TorrentFileD,0);
        ReadFileByLine(TorrentFileD,0);
        int FileSize = stoi(mTorrentFileData[0]);
        int TotalPacket = FileSize/DataSize;
        int LastPartSize = FileSize - TotalPacket * DataSize;
        if(LastPartSize) TotalPacket++;

        SendToSeederList(filename,SHA_TO_Add,sock,root_path,1);
        SetBitMap(TotalPacket, 1, SHA_TO_Add);
        close(sock);
        close(TorrentFileD);
        printf("> Connection closed!\n");
    }
    else if(RequestType == 2){
        ReadFileByLine(TorrentFileD,0);
        ReadFileByLine(TorrentFileD,0);
        ReadFileByLine(TorrentFileD,0);

        SHA = ReadSHA(TorrentFileD);
        SHA = SHA.substr(0,20);
        SendToSeederList(filename,SHA,sock,root_path,2);
        close(sock);
        close(TorrentFileD);
        printf("> Connection closed!\n");
    }
    else{
        ReadFileByLine(TorrentFileD,0);
        cout<<"> You are requesting to download: "<<mTorrentFileData[0];
        FileName = mTorrentFileData[0];

        ReadFileByLine(TorrentFileD,0);
        cout<<"> File Size: "<<mTorrentFileData[0];
        FileSize = stoi(mTorrentFileData[0]);

        ReadFileByLine(TorrentFileD,0);
        SHA = ReadSHA(TorrentFileD);
        SHA = SHA.substr(0,20);

        GetSeedersDetails(sock,SHA);
        
        SendToSeederList(filename,SHA,sock,root_path,1);

        close(sock);
        close(TorrentFileD);
        cout<<"> Tracker Connection Closed!\n";

        // Connections using multithreads
        int ConDetailIndex = 0;
        TotalConn = ConDetail.size()/3;

        int LastPartSize = 0;
        int TotalPacket = FileSize/DataSize;
        LastPartSize = FileSize - TotalPacket * DataSize;

        if(LastPartSize) TotalPacket++;

        SetBitMap(TotalPacket, 0, SHA);

        int BitMap[TotalPacket];
        memset(&BitMap, -1, sizeof(BitMap));

        thread *threadptr = new thread[TotalConn];
        for(int thread_n = 0; thread_n < TotalConn; thread_n++,ConDetailIndex+=3){
            threadptr[thread_n] = thread(BitVectorRequestToServers,ConDetail[ConDetailIndex],atoi(ConDetail[ConDetailIndex+1].c_str()),thread_n,TotalPacket,ref(SHA));
        }
        
        for(int thread_n=0; thread_n < TotalConn; thread_n++,ConDetailIndex++){
            threadptr[thread_n].join();
        }

        delete [] threadptr;

        PieceSelection(TotalPacket,TotalConn,BitMap);

        vector<int> BitMap1(BitMap, BitMap + sizeof(BitMap) / sizeof(BitMap[0]));

        ConDetailIndex = 0;
        ofstream output;
        string NewFileName = "new_" + FileName.substr(0,FileName.size()-1);
        output.open(NewFileName.c_str(), ofstream::binary);

        thread *Threadptr = new thread[TotalConn];
        for(int thread_n = 0; thread_n < TotalConn; thread_n++,ConDetailIndex+=3){
            Threadptr[thread_n] = thread(clientConnection,ConDetail[ConDetailIndex],atoi(ConDetail[ConDetailIndex+1].c_str()),ref(FileName),FileSize,LastPartSize,TotalPacket,BitMap1,thread_n,ref(output),ref(SHA));
        }
        
        for(int thread_n=0; thread_n < TotalConn; thread_n++,ConDetailIndex++){
            Threadptr[thread_n].join();
        }
        //End of MultithNewFileNameread
        output.close();
    }
    // RecieveData(sock,FileName,FileSize);
    sem_destroy(&mutex1);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x488, %rsp            # imm = 0x488
movq %rcx, -0x48(%rbp)
movq %rdx, %r12
movl %esi, %r15d
movq %rdi, %r13
leaq 0xa804(%rip), %rdi      # 0x12900
xorl %ebx, %ebx
xorl %esi, %esi
movl $0x1, %edx
callq 0x42e0
leaq -0xe8(%rbp), %rax
movq %rax, -0x10(%rax)
movq %rbx, -0x8(%rax)
movb %bl, (%rax)
leaq -0x68(%rbp), %rax
movq %rax, -0x10(%rax)
movq %rbx, -0x8(%rax)
movb %bl, (%rax)
movq 0x8(%r13), %rdx
cmpq $0xa, %rdx
jb 0x81a4
addq $-0x9, %rdx
leaq -0x4b0(%rbp), %rdi
movq %r13, %rsi
movq $-0x1, %rcx
callq 0x4360
leaq 0x4ef7(%rip), %rsi      # 0xd04b
leaq -0x4b0(%rbp), %r14
movq %r14, %rdi
callq 0x4130
movl %eax, %ebx
movq (%r14), %rdi
leaq -0x4a0(%rbp), %rax
cmpq %rax, %rdi
je 0x8183
movq -0x4a0(%rbp), %rsi
incq %rsi
callq 0x4350
testl %ebx, %ebx
je 0x81a4
movq 0x9e42(%rip), %rdi      # 0x11fd0
leaq 0x51ad(%rip), %rsi      # 0xd342
movl $0x26, %edx
callq 0x43c0
jmp 0x8df5
movq (%r13), %rdi
xorl %esi, %esi
movl $0x101000, %edx         # imm = 0x101000
xorl %eax, %eax
callq 0x4260
movl %eax, %ebx
movl %eax, %edi
movl $0x1, %esi
callq 0x9166
movl %ebx, -0x30(%rbp)
movq 0xa71a(%rip), %rax      # 0x128e8
leaq -0x260(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x270(%rbp), %rdi
callq 0x74cc
movq 0xa6f2(%rip), %rax      # 0x128e8
movq 0x20(%rax), %rdi
callq 0x4510
leaq -0x270(%rbp), %rdi
movl %eax, %esi
callq 0x9379
movl %eax, -0x40(%rbp)
movq -0x270(%rbp), %rdi
cmpq %r14, %rdi
je 0x822b
movq -0x260(%rbp), %rsi
incq %rsi
callq 0x4350
cmpl $-0x1, -0x40(%rbp)
je 0x8e50
movq 0x9d94(%rip), %rdi      # 0x11fd0
leaq 0x513b(%rip), %rsi      # 0xd37e
movl $0x1a, %edx
callq 0x43c0
movq 0xa694(%rip), %rax      # 0x128e8
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x9d6e(%rip), %rdi      # 0x11fd0
callq 0x43c0
movq %rax, %r14
leaq 0x4e81(%rip), %rsi      # 0xd0f2
movl $0x1, %edx
movq %rax, %rdi
callq 0x43c0
movq 0xa663(%rip), %rax      # 0x128e8
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
movq %r14, %rdi
callq 0x43c0
leaq 0x514b(%rip), %rsi      # 0xd3e7
movq %rax, %rdi
xorl %edx, %edx
callq 0x43c0
cmpl $0x2, %r15d
je 0x849f
cmpl $0x1, %r15d
jne 0x862f
movl -0x30(%rbp), %edi
xorl %esi, %esi
callq 0x9166
movl -0x30(%rbp), %edi
xorl %esi, %esi
callq 0x9166
movq 0xa613(%rip), %rax      # 0x128e8
movq (%rax), %r14
callq 0x4050
movq %rax, %r15
movl (%rax), %eax
movl %eax, -0x50(%rbp)
movl $0x0, (%r15)
leaq -0x4b0(%rbp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
movl $0xa, %edx
callq 0x4480
cmpq %r14, (%rbx)
je 0x8e6a
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x8e76
movl (%r15), %ecx
cmpl $0x22, %ecx
je 0x8e76
testl %ecx, %ecx
jne 0x832e
movl -0x50(%rbp), %ecx
movl %ecx, (%r15)
leal 0x3ff(%rax), %ebx
testl %eax, %eax
cmovnsl %eax, %ebx
movl %ebx, %ecx
andl $0xfffffc00, %ecx       # imm = 0xFFFFFC00
xorl %r15d, %r15d
cmpl %eax, %ecx
setne %r14b
leaq -0x140(%rbp), %rax
movq %rax, -0x10(%rax)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq -0x150(%rbp), %rdi
callq 0x74cc
leaq -0x108(%rbp), %rax
movq %rax, -0x10(%rax)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq -0x118(%rbp), %rdi
callq 0x74cc
leaq -0x240(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0x48(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x250(%rbp), %rdi
callq 0x74cc
leaq -0x118(%rbp), %rsi
leaq -0x250(%rbp), %rcx
movl -0x40(%rbp), %edx
movl $0x1, %r8d
callq 0x9416
movq -0x250(%rbp), %rdi
cmpq %r13, %rdi
je 0x83eb
movq -0x240(%rbp), %rsi
incq %rsi
callq 0x4350
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0x840d
movq -0x108(%rbp), %rsi
incq %rsi
callq 0x4350
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rax
cmpq %rax, %rdi
je 0x842f
movq -0x140(%rbp), %rsi
incq %rsi
callq 0x4350
leaq -0x220(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq -0x230(%rbp), %rdi
callq 0x74cc
sarl $0xa, %ebx
movb %r14b, %r15b
addl %ebx, %r15d
leaq -0x230(%rbp), %rdx
movl %r15d, %edi
movl $0x1, %esi
callq 0xbad0
movq -0x230(%rbp), %rdi
cmpq %r13, %rdi
je 0x848a
movq -0x220(%rbp), %rsi
incq %rsi
callq 0x4350
movl -0x40(%rbp), %edi
callq 0x4670
movl -0x30(%rbp), %edi
callq 0x4670
jmp 0x861e
movl -0x30(%rbp), %edi
xorl %esi, %esi
callq 0x9166
movl -0x30(%rbp), %edi
xorl %esi, %esi
callq 0x9166
movl -0x30(%rbp), %edi
xorl %esi, %esi
callq 0x9166
leaq -0x4b0(%rbp), %rdi
movl -0x30(%rbp), %esi
callq 0x95b1
leaq -0x78(%rbp), %rdi
leaq -0x4b0(%rbp), %rbx
movq %rbx, %rsi
callq 0x4410
movq (%rbx), %rdi
leaq -0x4a0(%rbp), %r14
cmpq %r14, %rdi
je 0x84fd
movq -0x4a0(%rbp), %rsi
incq %rsi
callq 0x4350
leaq -0x4b0(%rbp), %rdi
leaq -0x78(%rbp), %rsi
movl $0x14, %ecx
xorl %edx, %edx
callq 0x4360
leaq -0x78(%rbp), %rdi
movq %rbx, %rsi
callq 0x4410
movq (%rbx), %rdi
cmpq %r14, %rdi
je 0x8537
movq -0x4a0(%rbp), %rsi
incq %rsi
callq 0x4350
leaq -0x2a0(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq -0x2b0(%rbp), %rdi
callq 0x74cc
leaq -0x200(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
addq %rsi, %rdx
leaq -0x210(%rbp), %rdi
callq 0x74cc
leaq -0x1e0(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x48(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x1f0(%rbp), %rdi
callq 0x74cc
leaq -0x210(%rbp), %rsi
leaq -0x1f0(%rbp), %rcx
movl -0x40(%rbp), %edx
movl $0x2, %r8d
callq 0x9416
movq -0x1f0(%rbp), %rdi
cmpq %r12, %rdi
je 0x85d8
movq -0x1e0(%rbp), %rsi
incq %rsi
callq 0x4350
movq -0x210(%rbp), %rdi
cmpq %r15, %rdi
je 0x85f3
movq -0x200(%rbp), %rsi
incq %rsi
callq 0x4350
movq -0x2b0(%rbp), %rdi
cmpq %r14, %rdi
je 0x860e
movq -0x2a0(%rbp), %rsi
incq %rsi
callq 0x4350
movl -0x40(%rbp), %edi
callq 0x4670
movl -0x30(%rbp), %edi
callq 0x4670
leaq 0x4eba(%rip), %rdi      # 0xd4df
callq 0x44f0
jmp 0x8de9
movl -0x30(%rbp), %edi
xorl %esi, %esi
callq 0x9166
movq 0x9990(%rip), %rdi      # 0x11fd0
leaq 0x4d52(%rip), %rsi      # 0xd399
movl $0x22, %edx
callq 0x43c0
movq 0xa290(%rip), %rax      # 0x128e8
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x996a(%rip), %rdi      # 0x11fd0
callq 0x43c0
movq 0xa276(%rip), %rsi      # 0x128e8
leaq -0xf8(%rbp), %rdi
callq 0x41f0
movl -0x30(%rbp), %edi
xorl %esi, %esi
callq 0x9166
movq 0x9941(%rip), %rdi      # 0x11fd0
leaq 0x4d26(%rip), %rsi      # 0xd3bc
movl $0xd, %edx
callq 0x43c0
movq 0xa241(%rip), %rax      # 0x128e8
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x991b(%rip), %rdi      # 0x11fd0
callq 0x43c0
movq 0xa227(%rip), %rax      # 0x128e8
movq (%rax), %rbx
callq 0x4050
movq %rax, %r15
movl (%rax), %r12d
movl $0x0, (%rax)
leaq -0x4b0(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
movl $0xa, %edx
callq 0x4480
cmpq %rbx, (%r14)
je 0x8e82
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x8e8e
movl (%r15), %ecx
cmpl $0x22, %ecx
je 0x8e8e
testl %ecx, %ecx
jne 0x8714
movl %r12d, (%r15)
movl %eax, -0x54(%rbp)
movl -0x30(%rbp), %edi
xorl %esi, %esi
callq 0x9166
leaq -0x4b0(%rbp), %rdi
movl -0x30(%rbp), %esi
callq 0x95b1
leaq -0x78(%rbp), %rdi
leaq -0x4b0(%rbp), %rbx
movq %rbx, %rsi
callq 0x4410
movq (%rbx), %rdi
leaq -0x4a0(%rbp), %r14
cmpq %r14, %rdi
je 0x8761
movq -0x4a0(%rbp), %rsi
incq %rsi
callq 0x4350
leaq -0x4b0(%rbp), %rdi
leaq -0x78(%rbp), %rsi
movl $0x14, %ecx
xorl %edx, %edx
callq 0x4360
leaq -0x78(%rbp), %rdi
movq %rbx, %rsi
callq 0x4410
movq (%rbx), %rdi
cmpq %r14, %rdi
je 0x879b
movq -0x4a0(%rbp), %rsi
incq %rsi
callq 0x4350
leaq -0x1c0(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1d0(%rbp), %rdi
callq 0x74cc
leaq -0x1d0(%rbp), %rsi
movl -0x40(%rbp), %edi
callq 0x9616
movq -0x1d0(%rbp), %rdi
cmpq %r14, %rdi
je 0x87e7
movq -0x1c0(%rbp), %rsi
incq %rsi
callq 0x4350
leaq -0x280(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq -0x290(%rbp), %rdi
callq 0x74cc
leaq -0x1a0(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1b0(%rbp), %rdi
callq 0x74cc
leaq -0x180(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x48(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x190(%rbp), %rdi
callq 0x74cc
leaq -0x1b0(%rbp), %rsi
leaq -0x190(%rbp), %rcx
movl -0x40(%rbp), %edx
movl $0x1, %r8d
callq 0x9416
movq -0x190(%rbp), %rdi
cmpq %r12, %rdi
je 0x8888
movq -0x180(%rbp), %rsi
incq %rsi
callq 0x4350
movq -0x1b0(%rbp), %rdi
cmpq %r15, %rdi
je 0x88a3
movq -0x1a0(%rbp), %rsi
incq %rsi
callq 0x4350
movq -0x290(%rbp), %rdi
cmpq %r14, %rdi
je 0x88be
movq -0x280(%rbp), %rsi
incq %rsi
callq 0x4350
movl -0x40(%rbp), %edi
callq 0x4670
movl -0x30(%rbp), %edi
callq 0x4670
movq 0x96fb(%rip), %rdi      # 0x11fd0
leaq 0x4aee(%rip), %rsi      # 0xd3ca
movl $0x1d, %edx
callq 0x43c0
movq 0x9feb(%rip), %rax      # 0x128d8
subq 0x9fdc(%rip), %rax      # 0x128d0
sarq $0x5, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
shrq %rdx
movl %edx, 0xa012(%rip)      # 0x12920
movl -0x54(%rbp), %eax
leal 0x3ff(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
movl %ecx, %ebx
sarl $0xa, %ebx
movl %ebx, -0x34(%rbp)
andl $0xfffffc00, %ecx       # imm = 0xFFFFFC00
subl %ecx, %eax
movl %eax, -0x80(%rbp)
je 0x8936
incl %ebx
movl %ebx, -0x34(%rbp)
leaq -0x160(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
addq %rsi, %rdx
leaq -0x170(%rbp), %rdi
callq 0x74cc
leaq -0x170(%rbp), %rdx
movl %ebx, %edi
xorl %esi, %esi
callq 0xbad0
movq -0x170(%rbp), %rdi
cmpq %r14, %rdi
je 0x8983
movq -0x160(%rbp), %rsi
incq %rsi
callq 0x4350
movq %rsp, %r13
movl -0x34(%rbp), %ecx
movq %rsp, %r15
leaq 0xf(,%rcx,4), %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
movq %rcx, -0x40(%rbp)
leaq (,%rcx,4), %rdx
movq %r15, %rdi
movl $0xff, %esi
callq 0x4200
movslq 0x9f62(%rip), %r12      # 0x12920
leaq (,%r12,8), %r14
movq %r14, %rdi
addq $0x8, %rdi
movq $-0x1, %rax
cmovbq %rax, %rdi
testq %r12, %r12
cmovsq %rax, %rdi
callq 0x4030
movq %rax, %rbx
movq %r15, -0x30(%rbp)
movq %r12, (%rax)
testl %r12d, %r12d
je 0x8ae9
movq %rbx, %r15
addq $0x8, %r15
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x4200
movl $0x0, -0xc0(%rbp)
testl %r12d, %r12d
jle 0x8ae9
movq %r13, -0x48(%rbp)
xorl %r12d, %r12d
leaq -0x34(%rbp), %r13
movq 0x9ea0(%rip), %r14      # 0x128d0
movq 0x20(%r14,%r12), %rdi
addq %r12, %r14
callq 0x4510
movl %eax, -0xd8(%rbp)
leaq -0x78(%rbp), %rax
movq %rax, -0xa0(%rbp)
subq $0x8, %rsp
leaq -0x4b0(%rbp), %rdi
leaq 0xe69(%rip), %rsi       # 0x98c9
movq %r14, %rdx
leaq -0xd8(%rbp), %rcx
leaq -0xc0(%rbp), %r8
movq %r13, %r9
leaq -0xa0(%rbp), %rax
pushq %rax
callq 0xa454
addq $0x10, %rsp
movslq -0xc0(%rbp), %rax
cmpq $0x0, (%r15,%rax,8)
jne 0x8e46
movq -0x4b0(%rbp), %rcx
movq %rcx, (%r15,%rax,8)
leal 0x1(%rax), %ecx
movl %ecx, -0xc0(%rbp)
movl 0x9e6f(%rip), %eax      # 0x12920
addq $0x60, %r12
cmpl %eax, %ecx
jl 0x8a29
testl %eax, %eax
movq -0x48(%rbp), %r13
movq -0x30(%rbp), %r12
jle 0x8aed
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x45a0
incq %r14
movslq 0x9e42(%rip), %rax      # 0x12920
addq $0x8, %r15
cmpq %rax, %r14
jl 0x8acc
jmp 0x8aed
movq -0x30(%rbp), %r12
movq (%rbx), %rax
leaq (,%rax,8), %rsi
testq %rax, %rax
je 0x8b11
movq %rsi, %rax
cmpq $0x0, (%rbx,%rax)
jne 0x8e41
addq $-0x8, %rax
jne 0x8b00
addq $0x8, %rsi
movq %rbx, %rdi
callq 0x4660
movl -0x34(%rbp), %edi
movl 0x9dfa(%rip), %esi      # 0x12920
movq %r12, %rdx
callq 0x9ab1
movq -0x40(%rbp), %rax
leaq (%r12,%rax,4), %rdx
leaq -0xd8(%rbp), %rdi
leaq -0x4b0(%rbp), %rcx
movq %r12, %rsi
callq 0xa50a
leaq -0x4b0(%rbp), %rdi
callq 0x4590
leaq -0xf8(%rbp), %rsi
movq 0x8(%rsi), %rcx
decq %rcx
leaq -0xc0(%rbp), %rdi
xorl %edx, %edx
callq 0x4360
leaq 0x486d(%rip), %rcx      # 0xd3e8
leaq -0xc0(%rbp), %rdi
movl $0x4, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x43a0
leaq -0x90(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x8bbf
movq %rdx, -0xa0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x90(%rbp)
jmp 0x8bc7
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, -0x98(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0xb0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8c00
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x4350
movq -0xa0(%rbp), %rsi
leaq -0x4b0(%rbp), %rdi
movl $0x4, %edx
callq 0x4060
movslq 0x9d01(%rip), %r14      # 0x12920
leaq (,%r14,8), %rbx
movq %rbx, %rdi
addq $0x8, %rdi
movq $-0x1, %rax
cmovbq %rax, %rdi
testq %r14, %r14
cmovsq %rax, %rdi
callq 0x4030
movq %rax, %r15
movq %r14, (%rax)
testl %r14d, %r14d
je 0x8d6e
addq $0x8, %r15
movq %r15, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x4200
movl $0x0, -0x4c(%rbp)
testl %r14d, %r14d
jle 0x8d6e
movq %r13, -0x48(%rbp)
xorl %r14d, %r14d
leaq -0x130(%rbp), %r13
leaq -0x54(%rbp), %r12
movq 0x9c42(%rip), %rbx      # 0x128d0
movq 0x20(%rbx,%r14), %rdi
addq %r14, %rbx
callq 0x4510
movl %eax, -0x7c(%rbp)
leaq -0xf8(%rbp), %rax
movq %rax, -0x130(%rbp)
leaq -0x4b0(%rbp), %rax
movq %rax, -0x128(%rbp)
leaq -0x78(%rbp), %rax
movq %rax, -0x120(%rbp)
leaq -0xc0(%rbp), %rdi
leaq 0x105a(%rip), %rsi      # 0x9d2d
movq %rbx, %rdx
leaq -0x7c(%rbp), %rcx
movq %r13, %r8
movq %r12, %r9
leaq -0x120(%rbp), %rax
pushq %rax
leaq -0x128(%rbp), %rax
pushq %rax
leaq -0x4c(%rbp), %rax
pushq %rax
leaq -0xd8(%rbp), %rax
pushq %rax
leaq -0x34(%rbp), %rax
pushq %rax
leaq -0x80(%rbp), %rax
pushq %rax
callq 0xa54c
addq $0x30, %rsp
movslq -0x4c(%rbp), %rax
cmpq $0x0, (%r15,%rax,8)
jne 0x8e4b
movq -0xc0(%rbp), %rcx
movq %rcx, (%r15,%rax,8)
leal 0x1(%rax), %ecx
movl %ecx, -0x4c(%rbp)
movl 0x9bea(%rip), %eax      # 0x12920
addq $0x60, %r14
cmpl %eax, %ecx
jl 0x8c87
testl %eax, %eax
movq -0x48(%rbp), %r13
leaq -0x90(%rbp), %r12
jle 0x8d6e
xorl %ebx, %ebx
movq %r15, %rdi
callq 0x45a0
incq %rbx
movslq 0x9bbb(%rip), %rax      # 0x12920
addq $0x8, %r15
cmpq %rax, %rbx
jl 0x8d53
leaq -0x4b0(%rbp), %rdi
callq 0x4490
movq -0xa0(%rbp), %rdi
cmpq %r12, %rdi
je 0x8d95
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x4350
movq 0x922c(%rip), %rax      # 0x11fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x4a8(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x4b0(%rbp,%rcx)
callq 0x42d0
leaq -0x3b8(%rbp), %rdi
callq 0x4160
movq -0xd8(%rbp), %rdi
testq %rdi, %rdi
je 0x8de6
movq -0xc8(%rbp), %rsi
subq %rdi, %rsi
callq 0x4350
movq %r13, %rsp
leaq 0x9b10(%rip), %rdi      # 0x12900
callq 0x4620
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x8e0e
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x4350
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0x8e30
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x4350
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4120
callq 0x4120
callq 0x4120
movq 0x9179(%rip), %rdi      # 0x11fd0
leaq 0x450b(%rip), %rsi      # 0xd369
callq 0x4330
xorl %edi, %edi
callq 0x4400
leaq 0x428a(%rip), %rdi      # 0xd0fb
callq 0x4220
leaq 0x427e(%rip), %rdi      # 0xd0fb
callq 0x44b0
leaq 0x4272(%rip), %rdi      # 0xd0fb
callq 0x4220
leaq 0x4266(%rip), %rdi      # 0xd0fb
callq 0x44b0
jmp 0x90d0
movq %rax, %rbx
leaq -0xb0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x90f5
movq -0xb0(%rbp), %rsi
jmp 0x90ed
movq %rax, %rbx
jmp 0x90f5
movq %rax, %rbx
jmp 0x9101
jmp 0x9120
movq %rax, %rbx
movq -0x170(%rbp), %rdi
cmpq %r14, %rdi
je 0x9123
movq -0x160(%rbp), %rsi
jmp 0x90c3
jmp 0x9120
movq %rax, %rbx
movq -0x190(%rbp), %rdi
cmpq %r12, %rdi
je 0x8f1e
movq -0x180(%rbp), %rsi
incq %rsi
callq 0x4350
jmp 0x8f1e
movq %rax, %rbx
movq -0x1b0(%rbp), %rdi
cmpq %r15, %rdi
je 0x8f3e
movq -0x1a0(%rbp), %rsi
incq %rsi
callq 0x4350
jmp 0x8f3e
movq %rax, %rbx
movq -0x290(%rbp), %rdi
cmpq %r14, %rdi
je 0x9123
movq -0x280(%rbp), %rsi
jmp 0x90c3
movq %rax, %rbx
movq -0x1d0(%rbp), %rdi
cmpq %r14, %rdi
je 0x9123
movq -0x1c0(%rbp), %rsi
jmp 0x90c3
jmp 0x9120
jmp 0x9120
movq %rax, %rbx
movq -0x230(%rbp), %rdi
cmpq %r13, %rdi
je 0x9123
movq -0x220(%rbp), %rsi
jmp 0x90c3
movq %rax, %rbx
movq -0x1f0(%rbp), %rdi
cmpq %r12, %rdi
je 0x8fc5
movq -0x1e0(%rbp), %rsi
incq %rsi
callq 0x4350
jmp 0x8fc5
movq %rax, %rbx
movq -0x210(%rbp), %rdi
cmpq %r15, %rdi
je 0x9005
movq -0x200(%rbp), %rsi
incq %rsi
callq 0x4350
jmp 0x9005
movq %rax, %rbx
movq -0x250(%rbp), %rdi
cmpq %r13, %rdi
je 0x9024
movq -0x240(%rbp), %rsi
incq %rsi
callq 0x4350
jmp 0x9024
movq %rax, %rbx
movq -0x2b0(%rbp), %rdi
cmpq %r14, %rdi
je 0x9123
movq -0x2a0(%rbp), %rsi
jmp 0x90c3
movq %rax, %rbx
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0x904b
movq -0x108(%rbp), %rsi
incq %rsi
callq 0x4350
jmp 0x904b
movq %rax, %rbx
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rax
cmpq %rax, %rdi
je 0x9123
movq -0x140(%rbp), %rsi
jmp 0x90c3
jmp 0x9120
jmp 0x9120
jmp 0x9120
jmp 0x90d0
jmp 0x9120
movq %rax, %rbx
cmpl $0x0, (%r15)
jne 0x9123
movl %r12d, (%r15)
jmp 0x9123
movq %rax, %rbx
cmpl $0x0, (%r15)
jne 0x9123
movl -0x50(%rbp), %eax
movl %eax, (%r15)
jmp 0x9123
jmp 0x9120
movq %rax, %rbx
movq -0x270(%rbp), %rdi
cmpq %r14, %rdi
je 0x9123
movq -0x260(%rbp), %rsi
incq %rsi
jmp 0x9117
jmp 0x9120
jmp 0x9120
jmp 0x90d0
jmp 0x9120
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x90f5
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x4350
leaq -0x4b0(%rbp), %rdi
callq 0x44d0
movq -0xd8(%rbp), %rdi
testq %rdi, %rdi
je 0x9123
movq -0xc8(%rbp), %rsi
subq %rdi, %rsi
callq 0x4350
jmp 0x9123
jmp 0x9120
movq %rax, %rbx
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x913c
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x4350
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0x915e
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x4350
movq %rbx, %rdi
callq 0x45d0