// File: girdhari9[P]mTORRENT/ClientConnection.cpp
// Function: ReadFileByLine(int, int)
void ReadFileByLine(int TrackerFileD,int flag){
    char sendBuffer[BUFFER_SIZE];
    int index = 0;

    mTorrentFileData.clear();
    memset(&sendBuffer, '\0',BUFFER_SIZE);
    while (read(TrackerFileD, &sendBuffer[index], 1) == 1) {
        if (sendBuffer[index] == '\n' || sendBuffer[index] == 0x0) {
            if(!flag){
                mTorrentFileData.push_back((string)sendBuffer);
                return ;
            }
            else{ 
                string sb = (string)sendBuffer;
                unsigned int found = sb.find(':');
                if (found != string::npos){
                    mTorrentFileData.push_back(sb.substr(0,found));
                    mTorrentFileData.push_back(sb.substr(found+1));
                }
                return ;
            }
        }
        index++;
    }
    return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x8a0, %rsp            # imm = 0x8A0
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl $0x0, -0x7e4(%rbp)
leaq 0x15956(%rip), %rdi     # 0x21998
callq 0xdf40
leaq -0x7e0(%rbp), %rdi
xorl %esi, %esi
movl $0x7d0, %edx            # imm = 0x7D0
callq 0x4260
movl -0x4(%rbp), %edi
movslq -0x7e4(%rbp), %rax
leaq -0x7e0(%rbp), %rsi
addq %rax, %rsi
movl $0x1, %edx
callq 0x45c0
cmpq $0x1, %rax
jne 0xc2f4
movslq -0x7e4(%rbp), %rax
movsbl -0x7e0(%rbp,%rax), %eax
cmpl $0xa, %eax
je 0xc0ae
movslq -0x7e4(%rbp), %rax
movsbl -0x7e0(%rbp,%rax), %eax
cmpl $0x0, %eax
jne 0xc2e0
cmpl $0x0, -0x8(%rbp)
jne 0xc15c
leaq -0x809(%rbp), %rdi
movq %rdi, -0x890(%rbp)
callq 0x4710
movq -0x890(%rbp), %rdx
leaq -0x808(%rbp), %rdi
leaq -0x7e0(%rbp), %rsi
callq 0x6d90
jmp 0xc0e7
leaq 0x158aa(%rip), %rdi     # 0x21998
leaq -0x808(%rbp), %rsi
callq 0x6f20
jmp 0xc0fc
leaq -0x808(%rbp), %rdi
callq 0x47e8
leaq -0x809(%rbp), %rdi
callq 0x4450
jmp 0xc2f6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x818(%rbp)
movl %eax, -0x81c(%rbp)
jmp 0xc14b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x818(%rbp)
movl %eax, -0x81c(%rbp)
leaq -0x808(%rbp), %rdi
callq 0x47e8
leaq -0x809(%rbp), %rdi
callq 0x4450
jmp 0xc2ff
leaq -0x841(%rbp), %rdi
movq %rdi, -0x898(%rbp)
callq 0x4710
movq -0x898(%rbp), %rdx
leaq -0x840(%rbp), %rdi
leaq -0x7e0(%rbp), %rsi
callq 0x6d90
jmp 0xc18b
leaq -0x841(%rbp), %rdi
callq 0x4450
leaq -0x840(%rbp), %rdi
movl $0x3a, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x4560
movl %eax, -0x848(%rbp)
movl -0x848(%rbp), %eax
cmpq $-0x1, %rax
je 0xc2c4
movl -0x848(%rbp), %eax
movl %eax, %ecx
xorl %eax, %eax
movl %eax, %edx
leaq -0x868(%rbp), %rdi
leaq -0x840(%rbp), %rsi
callq 0x4420
jmp 0xc1e3
leaq 0x157ae(%rip), %rdi     # 0x21998
leaq -0x868(%rbp), %rsi
callq 0x6f20
jmp 0xc1f8
leaq -0x868(%rbp), %rdi
callq 0x47e8
movl -0x848(%rbp), %eax
incl %eax
movl %eax, %edx
leaq -0x888(%rbp), %rdi
leaq -0x840(%rbp), %rsi
movq $-0x1, %rcx
callq 0x4420
jmp 0xc22a
leaq 0x15767(%rip), %rdi     # 0x21998
leaq -0x888(%rbp), %rsi
callq 0x6f20
jmp 0xc23f
leaq -0x888(%rbp), %rdi
callq 0x47e8
jmp 0xc2c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x818(%rbp)
movl %eax, -0x81c(%rbp)
leaq -0x841(%rbp), %rdi
callq 0x4450
jmp 0xc2ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x818(%rbp)
movl %eax, -0x81c(%rbp)
jmp 0xc2d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x818(%rbp)
movl %eax, -0x81c(%rbp)
leaq -0x868(%rbp), %rdi
callq 0x47e8
jmp 0xc2d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x818(%rbp)
movl %eax, -0x81c(%rbp)
leaq -0x888(%rbp), %rdi
callq 0x47e8
jmp 0xc2d2
leaq -0x840(%rbp), %rdi
callq 0x47e8
jmp 0xc2f6
leaq -0x840(%rbp), %rdi
callq 0x47e8
jmp 0xc2ff
movl -0x7e4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7e4(%rbp)
jmp 0xc05a
jmp 0xc2f6
addq $0x8a0, %rsp            # imm = 0x8A0
popq %rbp
retq
movq -0x818(%rbp), %rdi
callq 0x4700
nopl (%rax,%rax)