// File: girdhari9[P]mTORRENT/ClientServer.cpp
// Function: UpdateLogFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void UpdateLogFile(string ClientLog){
	ifstream TrackerFile(ClientLog, ifstream::binary);
	string detail;
    if (TrackerFile.is_open()){
    	while( getline(TrackerFile,detail) ){
    		stringstream Log(detail); // Used for breaking words 
            string mtorrentfilename,SHA,FilePath; // to store individual words 
        	Log >> mtorrentfilename;
            UpdateLog.push_back(mtorrentfilename);
	        Log >> SHA;
	        UpdateLog.push_back(SHA);
	        Log >> FilePath;
	        UpdateLog.push_back(FilePath);
    	}
    	TrackerFile.close();

    	ofstream TrackerFileD(ClientLog, ofstream::binary);
        for(unsigned int i = 0; i < UpdateLog.size(); i += 3){
        	TrackerFileD << UpdateLog[i];
        	TrackerFileD << " ";
        	TrackerFileD << UpdateLog[i+1];
        	TrackerFileD << " ";
        	TrackerFileD << UpdateLog[i+2];
        	TrackerFileD << " ";
        	TrackerFileD << "\n";
        }
        for(unsigned int i = 0; i < CreateLog.size(); i += 3){
        	TrackerFileD << CreateLog[i];
        	TrackerFileD << " ";
        	TrackerFileD << CreateLog[i+1];
        	TrackerFileD << " ";
        	TrackerFileD << CreateLog[i+2];
        	TrackerFileD << " ";
        	TrackerFileD << "\n";
        }
        TrackerFileD.close();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x670, %rsp            # imm = 0x670
movq %rdi, %rsi
movq %rsi, -0x648(%rbp)
movq %rsi, -0x8(%rbp)
leaq -0x210(%rbp), %rdi
movq %rdi, -0x640(%rbp)
movl $0x4, %edx
callq 0x4660
leaq -0x230(%rbp), %rdi
callq 0x45a0
movq -0x640(%rbp), %rdi
callq 0x4650
movb %al, -0x631(%rbp)
jmp 0x66d1
movb -0x631(%rbp), %al
testb $0x1, %al
jne 0x66e0
jmp 0x6b26
jmp 0x66e2
leaq -0x210(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x4100
movq %rax, -0x650(%rbp)
jmp 0x66fe
movq -0x650(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x4510
movb %al, -0x651(%rbp)
jmp 0x671c
movb -0x651(%rbp), %al
testb $0x1, %al
jne 0x672b
jmp 0x6899
movl $0x10, %edi
movl $0x8, %esi
callq 0x7490
movl %eax, -0x658(%rbp)
jmp 0x6742
movl -0x658(%rbp), %edx
leaq -0x3c8(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x4640
jmp 0x675d
leaq -0x3e8(%rbp), %rdi
movq %rdi, -0x660(%rbp)
callq 0x45a0
leaq -0x408(%rbp), %rdi
callq 0x45a0
leaq -0x428(%rbp), %rdi
callq 0x45a0
movq -0x660(%rbp), %rsi
leaq -0x3c8(%rbp), %rdi
callq 0x4540
jmp 0x679d
leaq 0x1b1bc(%rip), %rdi     # 0x21960
leaq -0x3e8(%rbp), %rsi
callq 0x6eb0
jmp 0x67b2
leaq -0x3c8(%rbp), %rdi
leaq -0x408(%rbp), %rsi
callq 0x4540
jmp 0x67c7
leaq 0x1b192(%rip), %rdi     # 0x21960
leaq -0x408(%rbp), %rsi
callq 0x6eb0
jmp 0x67dc
leaq -0x3c8(%rbp), %rdi
leaq -0x428(%rbp), %rsi
callq 0x4540
jmp 0x67f1
leaq 0x1b168(%rip), %rdi     # 0x21960
leaq -0x428(%rbp), %rsi
callq 0x6eb0
jmp 0x6806
leaq -0x428(%rbp), %rdi
callq 0x47e8
leaq -0x408(%rbp), %rdi
callq 0x47e8
leaq -0x3e8(%rbp), %rdi
callq 0x47e8
leaq -0x3c8(%rbp), %rdi
callq 0x4320
jmp 0x66e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0x6b47
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
leaq -0x428(%rbp), %rdi
callq 0x47e8
leaq -0x408(%rbp), %rdi
callq 0x47e8
leaq -0x3e8(%rbp), %rdi
callq 0x47e8
leaq -0x3c8(%rbp), %rdi
callq 0x4320
jmp 0x6b47
leaq -0x210(%rbp), %rdi
callq 0x4110
jmp 0x68a7
movq -0x648(%rbp), %rsi
leaq -0x628(%rbp), %rdi
movl $0x4, %edx
callq 0x4780
jmp 0x68c1
movl $0x0, -0x62c(%rbp)
movl -0x62c(%rbp), %eax
movq %rax, -0x668(%rbp)
leaq 0x1b081(%rip), %rdi     # 0x21960
callq 0x72a0
movq %rax, %rcx
movq -0x668(%rbp), %rax
cmpq %rcx, %rax
jae 0x69f8
movl -0x62c(%rbp), %eax
movl %eax, %esi
leaq 0x1b05a(%rip), %rdi     # 0x21960
callq 0x72c0
movq %rax, %rsi
leaq -0x628(%rbp), %rdi
callq 0x43c0
jmp 0x691c
leaq 0xf794(%rip), %rsi      # 0x160b7
leaq -0x628(%rbp), %rdi
callq 0x43f0
jmp 0x6931
movl -0x62c(%rbp), %eax
incl %eax
movl %eax, %esi
leaq 0x1b01e(%rip), %rdi     # 0x21960
callq 0x72c0
movq %rax, %rsi
leaq -0x628(%rbp), %rdi
callq 0x43c0
jmp 0x6958
leaq 0xf758(%rip), %rsi      # 0x160b7
leaq -0x628(%rbp), %rdi
callq 0x43f0
jmp 0x696d
movl -0x62c(%rbp), %eax
addl $0x2, %eax
movl %eax, %esi
leaq 0x1afe1(%rip), %rdi     # 0x21960
callq 0x72c0
movq %rax, %rsi
leaq -0x628(%rbp), %rdi
callq 0x43c0
jmp 0x6995
leaq 0xf71b(%rip), %rsi      # 0x160b7
leaq -0x628(%rbp), %rdi
callq 0x43f0
jmp 0x69aa
leaq 0xfa8d(%rip), %rsi      # 0x1643e
leaq -0x628(%rbp), %rdi
callq 0x43f0
jmp 0x69bf
jmp 0x69c1
movl -0x62c(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x62c(%rbp)
jmp 0x68cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
leaq -0x628(%rbp), %rdi
callq 0x45f0
jmp 0x6b47
movl $0x0, -0x630(%rbp)
movl -0x630(%rbp), %eax
movq %rax, -0x670(%rbp)
leaq 0x1af32(%rip), %rdi     # 0x21948
callq 0x72a0
movq %rax, %rcx
movq -0x670(%rbp), %rax
cmpq %rcx, %rax
jae 0x6b0c
movl -0x630(%rbp), %eax
movl %eax, %esi
leaq 0x1af0b(%rip), %rdi     # 0x21948
callq 0x72c0
movq %rax, %rsi
leaq -0x628(%rbp), %rdi
callq 0x43c0
jmp 0x6a53
leaq 0xf65d(%rip), %rsi      # 0x160b7
leaq -0x628(%rbp), %rdi
callq 0x43f0
jmp 0x6a68
movl -0x630(%rbp), %eax
incl %eax
movl %eax, %esi
leaq 0x1aecf(%rip), %rdi     # 0x21948
callq 0x72c0
movq %rax, %rsi
leaq -0x628(%rbp), %rdi
callq 0x43c0
jmp 0x6a8f
leaq 0xf621(%rip), %rsi      # 0x160b7
leaq -0x628(%rbp), %rdi
callq 0x43f0
jmp 0x6aa4
movl -0x630(%rbp), %eax
addl $0x2, %eax
movl %eax, %esi
leaq 0x1ae92(%rip), %rdi     # 0x21948
callq 0x72c0
movq %rax, %rsi
leaq -0x628(%rbp), %rdi
callq 0x43c0
jmp 0x6acc
leaq 0xf5e4(%rip), %rsi      # 0x160b7
leaq -0x628(%rbp), %rdi
callq 0x43f0
jmp 0x6ae1
leaq 0xf956(%rip), %rsi      # 0x1643e
leaq -0x628(%rbp), %rdi
callq 0x43f0
jmp 0x6af6
jmp 0x6af8
movl -0x630(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x630(%rbp)
jmp 0x6a02
leaq -0x628(%rbp), %rdi
callq 0x45b0
jmp 0x6b1a
leaq -0x628(%rbp), %rdi
callq 0x45f0
leaq -0x230(%rbp), %rdi
callq 0x47e8
leaq -0x210(%rbp), %rdi
callq 0x4150
addq $0x670, %rsp            # imm = 0x670
popq %rbp
retq
leaq -0x230(%rbp), %rdi
callq 0x47e8
leaq -0x210(%rbp), %rdi
callq 0x4150
movq -0x238(%rbp), %rdi
callq 0x4700
nopl (%rax,%rax)