// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x510, %rsp            # imm = 0x510
movq %rsi, %rbx
movl %edi, %ebp
movq 0xaca4(%rip), %rsi      # 0x10408
leaq 0x308(%rsp), %rdi
pushq $0x4
popq %rdx
callq 0x45e0
leaq 0xf8(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x380(%rsp), %rdi
callq 0x40f0
testb %al, %al
je 0x5acf
leaq 0x308(%rsp), %r14
leaq 0xe8(%rsp), %r15
leaq 0xb0a4(%rip), %r12      # 0x10858
movq %r14, %rdi
movq %r15, %rsi
callq 0x40c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x57da
movq %r12, %rdi
movq %r15, %rsi
callq 0x60a4
jmp 0x57b4
testl %ebp, %ebp
je 0x590d
leaq 0x5904(%rip), %rsi      # 0xb0ed
leaq 0xab98(%rip), %rdx      # 0x10388
leaq 0x8(%rsp), %rdi
callq 0x62c7
leaq 0x58f1(%rip), %rdx      # 0xb0f2
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x6289
leaq 0xab91(%rip), %rdx      # 0x103a8
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x62a8
leaq 0x58a6(%rip), %rdx      # 0xb0d3
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x6289
leaq 0xac2d(%rip), %rdx      # 0x10470
leaq 0x88(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6289
leaq 0x5898(%rip), %rdx      # 0xb0f4
leaq 0xa8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x6289
leaq 0xc8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
movq %rbx, %rdx
callq 0x62a8
leaq 0x5b56(%rip), %rdx      # 0xb3e6
leaq 0x108(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x6289
leaq 0xc8(%rsp), %rdi
callq 0x4678
leaq 0xa8(%rsp), %rdi
callq 0x4678
leaq 0x88(%rsp), %rdi
callq 0x4678
leaq 0x68(%rsp), %rdi
callq 0x4678
leaq 0x48(%rsp), %rdi
callq 0x4678
leaq 0x28(%rsp), %rdi
callq 0x4678
leaq 0x8(%rsp), %rdi
callq 0x4678
leaq 0xaf5d(%rip), %rdi      # 0x10858
leaq 0x108(%rsp), %rsi
callq 0x60a4
jmp 0x5a33
leaq 0x57e2(%rip), %rsi      # 0xb0f6
leaq 0xaa6d(%rip), %rdx      # 0x10388
leaq 0x8(%rsp), %rdi
callq 0x62c7
leaq 0x57c6(%rip), %rdx      # 0xb0f2
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x6289
leaq 0xaa66(%rip), %rdx      # 0x103a8
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x62a8
leaq 0x577b(%rip), %rdx      # 0xb0d3
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x6289
leaq 0xab02(%rip), %rdx      # 0x10470
leaq 0x88(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6289
leaq 0x576d(%rip), %rdx      # 0xb0f4
leaq 0xa8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x6289
leaq 0xc8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
movq %rbx, %rdx
callq 0x62a8
leaq 0x5a2b(%rip), %rdx      # 0xb3e6
leaq 0x108(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x6289
leaq 0xc8(%rsp), %rdi
callq 0x4678
leaq 0xa8(%rsp), %rdi
callq 0x4678
leaq 0x88(%rsp), %rdi
callq 0x4678
leaq 0x68(%rsp), %rdi
callq 0x4678
leaq 0x48(%rsp), %rdi
callq 0x4678
leaq 0x28(%rsp), %rdi
callq 0x4678
leaq 0x8(%rsp), %rdi
callq 0x4678
leaq 0xae32(%rip), %rdi      # 0x10858
leaq 0x108(%rsp), %rsi
callq 0x60a4
leaq 0x108(%rsp), %rdi
callq 0x4678
leaq 0x308(%rsp), %rdi
callq 0x40d0
movq 0xa9b4(%rip), %rsi      # 0x10408
leaq 0x108(%rsp), %rdi
pushq $0x4
popq %rdx
callq 0x4380
xorl %r15d, %r15d
leaq 0x108(%rsp), %rbx
leaq 0x5970(%rip), %r14      # 0xb3e6
movl %r15d, %r15d
movq 0xade0(%rip), %rax      # 0x10860
movq 0xadd1(%rip), %rsi      # 0x10858
subq %rsi, %rax
sarq $0x5, %rax
cmpq %r15, %rax
jbe 0x5ab5
movq %r15, %rax
shlq $0x5, %rax
addq %rax, %rsi
movq %rbx, %rdi
callq 0x4300
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4330
incl %r15d
jmp 0x5a76
leaq 0x108(%rsp), %rdi
callq 0x4480
leaq 0x108(%rsp), %rdi
callq 0x44c0
leaq 0xe8(%rsp), %rdi
callq 0x4678
leaq 0x308(%rsp), %rdi
callq 0x4120
addq $0x510, %rsp            # imm = 0x510
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5b0e
jmp 0x5b1b
jmp 0x5b2d
jmp 0x5b3f
jmp 0x5b51
jmp 0x5b60
jmp 0x5b83
jmp 0x5b88
jmp 0x5ba7
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
jmp 0x5b7c
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x4678
jmp 0x5b30
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x4678
jmp 0x5b42
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x4678
jmp 0x5b54
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x4678
jmp 0x5b63
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x4678
leaq 0x28(%rsp), %rdi
callq 0x4678
leaq 0x8(%rsp), %rdi
callq 0x4678
jmp 0x5baa
movq %rax, %rbx
jmp 0x5b6d
movq %rax, %rbx
jmp 0x5b77
jmp 0x5ba7
jmp 0x5b95
jmp 0x5ba7
jmp 0x5ba7
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0x44c0
jmp 0x5baa
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x4678
leaq 0x308(%rsp), %rdi
callq 0x4120
movq %rbx, %rdi
callq 0x45b0