// File: girdhari9[P]mTORRENT/ClientServer.cpp
// Function: UpdateDownloadLog(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void UpdateDownloadLog(int flag,string filename){
	ifstream TrackerFile(DOWNLOADLOG.c_str(), ifstream::binary);
	string detail;
    if (TrackerFile.is_open()){
    	while(getline (TrackerFile,detail)){
			Download.push_back(detail);
		}
    	if(flag){
    		string detail ="[S] " + MYIP + ":" + MYPORT + " " + root_path + "/" + filename + "\n"; 
    		Download.push_back(detail);
        }
        else{
        	string detail ="[D] " + MYIP + ":" + MYPORT + " " + root_path + "/" + filename + "\n"; 
    		Download.push_back(detail);
        }
        TrackerFile.close();

        ofstream TrackerFileD(DOWNLOADLOG.c_str(), ofstream::binary);
        for(unsigned int i = 0; i < Download.size(); i++){
        	TrackerFileD << Download[i];
        	TrackerFileD << "\n";
        }
        TrackerFileD.close();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x680, %rsp            # imm = 0x680
movq %rsi, -0x660(%rbp)
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x1b518(%rip), %rdi     # 0x214c8
callq 0x41f0
movq %rax, %rsi
leaq -0x218(%rbp), %rdi
movq %rdi, -0x658(%rbp)
movl $0x4, %edx
callq 0x4740
leaq -0x238(%rbp), %rdi
callq 0x45a0
movq -0x658(%rbp), %rdi
callq 0x4650
movb %al, -0x64d(%rbp)
jmp 0x5ff0
movb -0x64d(%rbp), %al
testb $0x1, %al
jne 0x5fff
jmp 0x6634
jmp 0x6001
leaq -0x218(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x4100
movq %rax, -0x668(%rbp)
jmp 0x601d
movq -0x668(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x4510
movb %al, -0x669(%rbp)
jmp 0x603b
movb -0x669(%rbp), %al
testb $0x1, %al
jne 0x6047
jmp 0x6075
leaq 0x1b8ca(%rip), %rdi     # 0x21918
leaq -0x238(%rbp), %rsi
callq 0x6eb0
jmp 0x605c
jmp 0x6001
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x6655
cmpl $0x0, -0x4(%rbp)
je 0x62e5
leaq 0x1004b(%rip), %rsi     # 0x160d1
leaq 0x1b3bb(%rip), %rdx     # 0x21448
leaq -0x348(%rbp), %rdi
callq 0x7380
jmp 0x609b
leaq 0x10034(%rip), %rdx     # 0x160d6
leaq -0x328(%rbp), %rdi
leaq -0x348(%rbp), %rsi
callq 0x72e0
jmp 0x60b7
leaq 0x1b3aa(%rip), %rdx     # 0x21468
leaq -0x308(%rbp), %rdi
leaq -0x328(%rbp), %rsi
callq 0x7330
jmp 0x60d3
leaq 0xffdd(%rip), %rdx      # 0x160b7
leaq -0x2e8(%rbp), %rdi
leaq -0x308(%rbp), %rsi
callq 0x72e0
jmp 0x60ef
leaq 0x1b43a(%rip), %rdx     # 0x21530
leaq -0x2c8(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
callq 0x72e0
jmp 0x610b
leaq 0xffc6(%rip), %rdx      # 0x160d8
leaq -0x2a8(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
callq 0x72e0
jmp 0x6127
movq -0x660(%rbp), %rdx
leaq -0x288(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0x7330
jmp 0x6143
leaq 0x102f4(%rip), %rdx     # 0x1643e
leaq -0x268(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0x72e0
jmp 0x615f
leaq -0x288(%rbp), %rdi
callq 0x47e8
leaq -0x2a8(%rbp), %rdi
callq 0x47e8
leaq -0x2c8(%rbp), %rdi
callq 0x47e8
leaq -0x2e8(%rbp), %rdi
callq 0x47e8
leaq -0x308(%rbp), %rdi
callq 0x47e8
leaq -0x328(%rbp), %rdi
callq 0x47e8
leaq -0x348(%rbp), %rdi
callq 0x47e8
leaq 0x1b75e(%rip), %rdi     # 0x21918
leaq -0x268(%rbp), %rsi
callq 0x6eb0
jmp 0x61c8
leaq -0x268(%rbp), %rdi
callq 0x47e8
jmp 0x654b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x62b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x62a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x6299
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x628d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x6281
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x6275
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x47e8
leaq -0x2a8(%rbp), %rdi
callq 0x47e8
leaq -0x2c8(%rbp), %rdi
callq 0x47e8
leaq -0x2e8(%rbp), %rdi
callq 0x47e8
leaq -0x308(%rbp), %rdi
callq 0x47e8
leaq -0x328(%rbp), %rdi
callq 0x47e8
leaq -0x348(%rbp), %rdi
callq 0x47e8
jmp 0x6655
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x47e8
jmp 0x6655
leaq 0xfdee(%rip), %rsi      # 0x160da
leaq 0x1b155(%rip), %rdx     # 0x21448
leaq -0x448(%rbp), %rdi
callq 0x7380
jmp 0x6301
leaq 0xfdce(%rip), %rdx      # 0x160d6
leaq -0x428(%rbp), %rdi
leaq -0x448(%rbp), %rsi
callq 0x72e0
jmp 0x631d
leaq 0x1b144(%rip), %rdx     # 0x21468
leaq -0x408(%rbp), %rdi
leaq -0x428(%rbp), %rsi
callq 0x7330
jmp 0x6339
leaq 0xfd77(%rip), %rdx      # 0x160b7
leaq -0x3e8(%rbp), %rdi
leaq -0x408(%rbp), %rsi
callq 0x72e0
jmp 0x6355
leaq 0x1b1d4(%rip), %rdx     # 0x21530
leaq -0x3c8(%rbp), %rdi
leaq -0x3e8(%rbp), %rsi
callq 0x72e0
jmp 0x6371
leaq 0xfd60(%rip), %rdx      # 0x160d8
leaq -0x3a8(%rbp), %rdi
leaq -0x3c8(%rbp), %rsi
callq 0x72e0
jmp 0x638d
movq -0x660(%rbp), %rdx
leaq -0x388(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
callq 0x7330
jmp 0x63a9
leaq 0x1008e(%rip), %rdx     # 0x1643e
leaq -0x368(%rbp), %rdi
leaq -0x388(%rbp), %rsi
callq 0x72e0
jmp 0x63c5
leaq -0x388(%rbp), %rdi
callq 0x47e8
leaq -0x3a8(%rbp), %rdi
callq 0x47e8
leaq -0x3c8(%rbp), %rdi
callq 0x47e8
leaq -0x3e8(%rbp), %rdi
callq 0x47e8
leaq -0x408(%rbp), %rdi
callq 0x47e8
leaq -0x428(%rbp), %rdi
callq 0x47e8
leaq -0x448(%rbp), %rdi
callq 0x47e8
leaq 0x1b4f8(%rip), %rdi     # 0x21918
leaq -0x368(%rbp), %rsi
callq 0x6eb0
jmp 0x642e
leaq -0x368(%rbp), %rdi
callq 0x47e8
jmp 0x654b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x6517
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x650b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x64ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x64f3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x64e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x64db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x388(%rbp), %rdi
callq 0x47e8
leaq -0x3a8(%rbp), %rdi
callq 0x47e8
leaq -0x3c8(%rbp), %rdi
callq 0x47e8
leaq -0x3e8(%rbp), %rdi
callq 0x47e8
leaq -0x408(%rbp), %rdi
callq 0x47e8
leaq -0x428(%rbp), %rdi
callq 0x47e8
leaq -0x448(%rbp), %rdi
callq 0x47e8
jmp 0x6655
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x368(%rbp), %rdi
callq 0x47e8
jmp 0x6655
leaq -0x218(%rbp), %rdi
callq 0x4110
jmp 0x6559
leaq 0x1af68(%rip), %rdi     # 0x214c8
callq 0x41f0
movq %rax, %rsi
leaq -0x648(%rbp), %rdi
movl $0x4, %edx
callq 0x4460
jmp 0x657b
movl $0x0, -0x64c(%rbp)
movl -0x64c(%rbp), %eax
movq %rax, -0x678(%rbp)
leaq 0x1b37f(%rip), %rdi     # 0x21918
callq 0x72a0
movq %rax, %rcx
movq -0x678(%rbp), %rax
cmpq %rcx, %rax
jae 0x661a
movl -0x64c(%rbp), %eax
movl %eax, %esi
leaq 0x1b35c(%rip), %rdi     # 0x21918
callq 0x72c0
movq %rax, %rsi
leaq -0x648(%rbp), %rdi
callq 0x43c0
jmp 0x65d2
leaq 0xfe65(%rip), %rsi      # 0x1643e
leaq -0x648(%rbp), %rdi
callq 0x43f0
jmp 0x65e7
jmp 0x65e9
movl -0x64c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64c(%rbp)
jmp 0x6585
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x648(%rbp), %rdi
callq 0x45f0
jmp 0x6655
leaq -0x648(%rbp), %rdi
callq 0x45b0
jmp 0x6628
leaq -0x648(%rbp), %rdi
callq 0x45f0
leaq -0x238(%rbp), %rdi
callq 0x47e8
leaq -0x218(%rbp), %rdi
callq 0x4150
addq $0x680, %rsp            # imm = 0x680
popq %rbp
retq
leaq -0x238(%rbp), %rdi
callq 0x47e8
leaq -0x218(%rbp), %rdi
callq 0x4150
movq -0x240(%rbp), %rdi
callq 0x4700
nopl (%rax)