// File: /workspace/github_cpp_makefile_star2_O1/sun98[P]Mini-DFS/datanode.cpp
// Function: DataServer::fetch()
void DataServer::fetch()
{
    buf = new char[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;
    }
    else
    {
        is.read(buf, std::min(chunkSize, bufSize - chunkSize * offset));
        bufSize = is.tellg();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
movq %rdi, %rbx
movl 0x793f(%rip), %eax      # 0xc288
testl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmovnsl %eax, %ecx
movslq %ecx, %rdi
callq 0x3030
movq %rax, 0xb0(%rbx)
leaq -0x78(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %r14
movq %r14, %rdi
callq 0x4fce
leaq 0x46a4(%rip), %rsi      # 0x902e
movq %r14, %rdi
callq 0x34e0
movl 0xa0(%rbx), %r14d
movl %r14d, %r15d
negl %r15d
cmovsl %r14d, %r15d
movl $0x1, %r12d
cmpl $0xa, %r15d
jb 0x49f9
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r15d, %ecx
cmpl $0x63, %ecx
jbe 0x49f0
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x49f6
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x49f9
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x49bd
addl $-0x3, %r12d
jmp 0x49f9
addl $-0x2, %r12d
jmp 0x49f9
decl %r12d
shrl $0x1f, %r14d
leal (%r12,%r14), %esi
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0x48(%rbp), %rdi
movl $0x2d, %edx
callq 0x32f0
addq -0x48(%rbp), %r14
movq %r14, %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0x4f4d
movq -0x88(%rbp), %rcx
movq -0x80(%rbp), %r8
movq -0x40(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r13, %rcx
je 0x4a4a
movq -0x78(%rbp), %rsi
cmpq %rsi, %rax
jbe 0x4a67
movl $0xf, %esi
leaq -0x38(%rbp), %rdi
cmpq %rdi, -0x48(%rbp)
je 0x4a62
movq -0x38(%rbp), %rsi
cmpq %rsi, %rax
jbe 0x4a79
movq -0x48(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x3100
jmp 0x4a86
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32c0
leaq -0x98(%rbp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x4ab0
movq %rsi, -0xa8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x98(%rbp)
jmp 0x4ab6
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0xa0(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x4795(%rip), %rsi      # 0x9271
leaq -0xa8(%rbp), %rdi
callq 0x34e0
leaq -0x2c0(%rbp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4b18
movq %rsi, %r13
movq %rdx, -0x2d0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x2c0(%rbp)
jmp 0x4b21
movups (%rcx), %xmm0
movq %rsi, %r13
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, -0x2c8(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl 0xa8(%rbx), %r14d
movl %r14d, %r15d
negl %r15d
cmovsl %r14d, %r15d
movl $0x1, %r12d
cmpl $0xa, %r15d
jb 0x4ba2
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r15d, %ecx
cmpl $0x63, %ecx
jbe 0x4b99
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x4b9f
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x4ba2
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x4b66
addl $-0x3, %r12d
jmp 0x4ba2
addl $-0x2, %r12d
jmp 0x4ba2
decl %r12d
shrl $0x1f, %r14d
leal (%r12,%r14), %esi
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0x68(%rbp), %rdi
movl $0x2d, %edx
callq 0x32f0
addq -0x68(%rbp), %r14
movq %r14, %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0x4f4d
movq -0x2d0(%rbp), %rcx
movq -0x2c8(%rbp), %r8
movq -0x60(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r13, %rcx
je 0x4bf9
movq -0x2c0(%rbp), %rsi
cmpq %rsi, %rax
leaq -0x58(%rbp), %r14
jbe 0x4c16
movl $0xf, %esi
cmpq %r14, -0x68(%rbp)
je 0x4c11
movq -0x58(%rbp), %rsi
cmpq %rsi, %rax
jbe 0x4c28
movq -0x68(%rbp), %rsi
leaq -0x2d0(%rbp), %rdi
callq 0x3100
jmp 0x4c35
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32c0
leaq -0xb8(%rbp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x4c5f
movq %rsi, -0xc8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xb8(%rbp)
jmp 0x4c65
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0xc0(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq -0x68(%rbp), %rdi
cmpq %r14, %rdi
je 0x4c92
callq 0x3270
movq -0x2d0(%rbp), %rdi
cmpq %r13, %rdi
leaq -0x78(%rbp), %r14
je 0x4ca7
callq 0x3270
leaq -0x98(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4cbc
callq 0x3270
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4cce
callq 0x3270
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0x4cdf
callq 0x3270
leaq -0x2d0(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
movl $0x8, %edx
callq 0x3420
movq -0x2d0(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x2b0(%rbp,%rax)
movq 0xb0(%rbx), %rsi
je 0x4d2c
testq %rsi, %rsi
je 0x4d20
movq %rsi, %rdi
callq 0x3340
movl $0x0, 0xa4(%rbx)
jmp 0x4d69
movl 0xa4(%rbx), %eax
movl 0x7550(%rip), %ecx      # 0xc288
movl 0xa8(%rbx), %edx
imull %ecx, %edx
subl %edx, %eax
cmpl %ecx, %eax
cmovgel %ecx, %eax
movslq %eax, %rdx
leaq -0x2d0(%rbp), %rdi
callq 0x3320
leaq -0x2d0(%rbp), %rdi
callq 0x3480
movl %eax, 0xa4(%rbx)
leaq -0x2d0(%rbp), %rdi
callq 0x30c0
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4d8a
callq 0x3270
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4d9e
movq %rax, %rbx
leaq -0x2d0(%rbp), %rdi
callq 0x30c0
jmp 0x4db2
movq %rax, %rbx
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0x4e27
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r14, %rdi
je 0x4dd5
callq 0x3270
jmp 0x4dd5
movq %rax, %rbx
movq -0x2d0(%rbp), %rdi
cmpq %r13, %rdi
je 0x4deb
callq 0x3270
jmp 0x4deb
movq %rax, %rbx
leaq -0x98(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4e05
callq 0x3270
jmp 0x4e05
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4e1c
callq 0x3270
jmp 0x4e1c
movq %rax, %rbx
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x4e31
callq 0x3270
movq %rbx, %rdi
callq 0x34a0
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
jne 0x4e2c
jmp 0x4e31