// File: /workspace/github_cpp_makefile_star2_O3/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 0x792f(%rip), %eax      # 0xc288
testl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmovnsl %eax, %ecx
movslq %ecx, %rdi
callq 0x3030
movq %rax, 0xb0(%rbx)
leaq -0x58(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %r14
movq %r14, %rdi
callq 0x4fda
leaq 0x4697(%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 0x4a06
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r15d, %ecx
cmpl $0x63, %ecx
jbe 0x49fd
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x4a03
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x4a06
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x49ca
addl $-0x3, %r12d
jmp 0x4a06
addl $-0x2, %r12d
jmp 0x4a06
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 0x4f59
movq -0x68(%rbp), %rcx
movq -0x60(%rbp), %r8
movq -0x40(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r13, %rcx
je 0x4a54
movq -0x58(%rbp), %rdi
movq -0x48(%rbp), %rsi
cmpq %rdi, %rax
jbe 0x4a74
movl $0xf, %edi
leaq -0x38(%rbp), %r9
cmpq %r9, %rsi
je 0x4a6f
movq -0x38(%rbp), %rdi
cmpq %rdi, %rax
jbe 0x4a7f
leaq -0x68(%rbp), %rdi
callq 0x3100
jmp 0x4a8c
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32c0
leaq -0x78(%rbp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x4ab0
movq %rsi, -0x88(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x78(%rbp)
jmp 0x4ab6
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x80(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x4798(%rip), %rsi      # 0x9271
leaq -0x88(%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 0x4b15
movq %rsi, %r13
movq %rdx, -0x2d0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x2c0(%rbp)
jmp 0x4b1e
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 0x4b9f
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r15d, %ecx
cmpl $0x63, %ecx
jbe 0x4b96
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x4b9c
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x4b9f
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x4b63
addl $-0x3, %r12d
jmp 0x4b9f
addl $-0x2, %r12d
jmp 0x4b9f
decl %r12d
shrl $0x1f, %r14d
leal (%r12,%r14), %esi
leaq -0xb8(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0xc8(%rbp), %rdi
movl $0x2d, %edx
callq 0x32f0
addq -0xc8(%rbp), %r14
movq %r14, %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0x4f59
movq -0x2d0(%rbp), %rcx
movq -0x2c8(%rbp), %r8
movq -0xc0(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r13, %rcx
je 0x4c02
movq -0x2c0(%rbp), %rdi
movq -0xc8(%rbp), %rsi
cmpq %rdi, %rax
leaq -0xb8(%rbp), %r14
jbe 0x4c2b
movl $0xf, %edi
cmpq %r14, %rsi
je 0x4c26
movq -0xb8(%rbp), %rdi
cmpq %rdi, %rax
jbe 0x4c39
leaq -0x2d0(%rbp), %rdi
callq 0x3100
jmp 0x4c49
leaq -0xc8(%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 0x4c73
movq %rsi, -0xa8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x98(%rbp)
jmp 0x4c79
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)
movq -0xc8(%rbp), %rdi
cmpq %r14, %rdi
je 0x4ca9
callq 0x3270
movq -0x2d0(%rbp), %rdi
cmpq %r13, %rdi
leaq -0x58(%rbp), %r14
je 0x4cbe
callq 0x3270
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4cd0
callq 0x3270
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4ce2
callq 0x3270
movq -0x68(%rbp), %rdi
cmpq %r14, %rdi
je 0x4cf0
callq 0x3270
leaq -0x2d0(%rbp), %rdi
leaq -0xa8(%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 0x4d3d
testq %rsi, %rsi
je 0x4d31
movq %rsi, %rdi
callq 0x3340
movl $0x0, 0xa4(%rbx)
jmp 0x4d7a
movl 0xa4(%rbx), %eax
movl 0x753f(%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 -0x98(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4d9b
callq 0x3270
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4daf
movq %rax, %rbx
leaq -0x2d0(%rbp), %rdi
callq 0x30c0
jmp 0x4dc3
movq %rax, %rbx
leaq -0x98(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0x4e35
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
cmpq %r14, %rdi
je 0x4de9
callq 0x3270
jmp 0x4de9
movq %rax, %rbx
movq -0x2d0(%rbp), %rdi
cmpq %r13, %rdi
je 0x4dff
callq 0x3270
jmp 0x4dff
movq %rax, %rbx
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4e16
callq 0x3270
jmp 0x4e16
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4e2d
callq 0x3270
jmp 0x4e2d
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x4e3f
callq 0x3270
movq %rbx, %rdi
callq 0x34a0
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
jne 0x4e3a
jmp 0x4e3f
nop