// File: /workspace/github_cpp_makefile_star2_O3/sun98[P]Mini-DFS/datanode.cpp
// Function: DataServer::read()
void DataServer::read()
{
    int start = 0;
    buf = new char[bufSize];
    while (start < bufSize)
    {
        int offset = start / chunkSize;
        std::string filePath = name_ + "/" + std::to_string(fid) + " " + std::to_string(offset);
        std::ifstream is(filePath);
        // file not found in this server.
        if (!is)
        {
            delete[] buf;
            bufSize = 0;
            break;
        }
        is.read(&buf[start], std::min(chunkSize, bufSize - start));
        start += chunkSize;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2b8, %rsp            # imm = 0x2B8
movq %rdi, %r14
movl 0xa4(%rdi), %eax
testl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmovnsl %eax, %ecx
movslq %ecx, %rdi
callq 0x3030
movq %rax, 0xb0(%r14)
leaq -0xa8(%rbp), %r13
leaq -0x2d0(%rbp), %r15
xorl %eax, %eax
movq %r14, -0x30(%rbp)
cmpl 0xa4(%r14), %eax
jge 0x43f0
movq %r15, %rbx
movq %rax, -0x38(%rbp)
cltd
idivl 0x82e1(%rip)            # 0xc288
movl %eax, %r12d
movq %r13, -0xb8(%rbp)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0xb8(%rbp), %r15
movq %r15, %rdi
callq 0x4fda
movq %r15, %rdi
leaq 0x505a(%rip), %rsi      # 0x902e
callq 0x34e0
movl 0xa0(%r14), %r15d
movl %r15d, %r13d
negl %r13d
cmovsl %r15d, %r13d
movl $0x1, %r14d
cmpl $0xa, %r13d
jb 0x403d
movl $0x4, %r14d
movl %r13d, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0x4034
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x403a
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x403d
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r14d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x4004
addl $-0x3, %r14d
jmp 0x403d
addl $-0x2, %r14d
jmp 0x403d
decl %r14d
shrl $0x1f, %r15d
leal (%r14,%r15), %esi
leaq -0x88(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x98(%rbp), %rdi
movl $0x2d, %edx
callq 0x32f0
addq -0x98(%rbp), %r15
movq %r15, %rdi
movl %r14d, %esi
movl %r13d, %edx
callq 0x4f59
movq -0xb8(%rbp), %rcx
movl $0xf, %edi
leaq -0xa8(%rbp), %r13
cmpq %r13, %rcx
je 0x4098
movq -0xa8(%rbp), %rdi
movq -0xb0(%rbp), %r8
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
leaq -0x48(%rbp), %r14
jbe 0x40d7
movl $0xf, %edi
leaq -0x88(%rbp), %r9
cmpq %r9, %rsi
je 0x40d2
movq -0x88(%rbp), %rdi
cmpq %rdi, %rax
jbe 0x40e5
leaq -0xb8(%rbp), %rdi
callq 0x3100
jmp 0x40f5
leaq -0x98(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32c0
movq %r14, -0x58(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x4112
movq %rdx, -0x58(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x48(%rbp)
jmp 0x4119
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x50(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq -0x58(%rbp), %rdi
leaq 0x5131(%rip), %rsi      # 0x9271
callq 0x34e0
movq %rbx, -0x2e0(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x416e
movq %rdx, -0x2e0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x2d0(%rbp)
jmp 0x4174
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, -0x2d8(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl %r12d, %r15d
negl %r15d
cmovsl %r12d, %r15d
movl $0x1, %r14d
cmpl $0xa, %r15d
jb 0x41eb
movl $0x4, %r14d
movl %r15d, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0x41e2
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x41e8
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x41eb
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r14d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x41b2
addl $-0x3, %r14d
jmp 0x41eb
addl $-0x2, %r14d
jmp 0x41eb
decl %r14d
shrl $0x1f, %r12d
leal (%r14,%r12), %esi
leaq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x78(%rbp), %rdi
movl $0x2d, %edx
callq 0x32f0
movl %r12d, %edi
addq -0x78(%rbp), %rdi
movl %r14d, %esi
movl %r15d, %edx
callq 0x4f59
movq -0x2e0(%rbp), %rcx
movl $0xf, %edi
movq %rbx, %r15
cmpq %rbx, %rcx
je 0x4236
movq -0x2d0(%rbp), %rdi
movq -0x2d8(%rbp), %r8
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
leaq -0x48(%rbp), %r14
leaq -0xc8(%rbp), %r12
jbe 0x4270
movl $0xf, %edi
leaq -0x68(%rbp), %r9
cmpq %r9, %rsi
je 0x426b
movq -0x68(%rbp), %rdi
cmpq %rdi, %rax
jbe 0x427e
leaq -0x2e0(%rbp), %rdi
callq 0x3100
jmp 0x428b
leaq -0x78(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32c0
movq %r12, -0xd8(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x42b1
movq %rdx, -0xd8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xc8(%rbp)
jmp 0x42b9
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0xd0(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x42ea
callq 0x3270
movq -0x2e0(%rbp), %rdi
cmpq %r15, %rdi
je 0x42fb
callq 0x3270
movq -0x58(%rbp), %rdi
cmpq %r14, %rdi
je 0x4309
callq 0x3270
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x4321
callq 0x3270
movq -0xb8(%rbp), %rdi
cmpq %r13, %rdi
je 0x4332
callq 0x3270
leaq -0x2e0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
movl $0x8, %edx
callq 0x3420
movq -0x2e0(%rbp), %rax
movq -0x18(%rax), %rax
movl -0x2c0(%rbp,%rax), %r14d
movq -0x30(%rbp), %rcx
movq 0xb0(%rcx), %rsi
testb $0x5, %r14b
je 0x438b
testq %rsi, %rsi
je 0x437b
movq %rsi, %rdi
callq 0x3340
movq -0x30(%rbp), %rax
movl $0x0, 0xa4(%rax)
jmp 0x43c1
movq -0x38(%rbp), %rbx
movslq %ebx, %rax
addq %rax, %rsi
movl 0xa4(%rcx), %eax
subl %ebx, %eax
movl 0x7ee5(%rip), %ecx      # 0xc288
cmpl %ecx, %eax
cmovgel %ecx, %eax
movslq %eax, %rdx
leaq -0x2e0(%rbp), %rdi
callq 0x3320
addl 0x7ecb(%rip), %ebx      # 0xc288
movq %rbx, -0x38(%rbp)
leaq -0x2e0(%rbp), %rdi
callq 0x30c0
movq -0xd8(%rbp), %rdi
cmpq %r12, %rdi
je 0x43de
callq 0x3270
testb $0x5, %r14b
movq -0x30(%rbp), %r14
movq -0x38(%rbp), %rax
je 0x3f8c
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq -0x2e0(%rbp), %rdi
callq 0x30c0
jmp 0x4422
jmp 0x4432
movq %rax, %r14
jmp 0x4474
movq %rax, %r14
jmp 0x4451
movq %rax, %r14
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
jmp 0x449a
movq %rax, %r14
jmp 0x448c
movq %rax, %r14
jmp 0x4462
movq %rax, %r14
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x4451
callq 0x3270
movq -0x2e0(%rbp), %rdi
cmpq %rbx, %rdi
je 0x4462
callq 0x3270
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x4474
callq 0x3270
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x448c
callq 0x3270
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x44a4
callq 0x3270
movq %r14, %rdi
callq 0x34a0