// File: /workspace/github_cpp_makefile_star2_O1/sun98[P]Mini-DFS/datanode.cpp
// Function: DataServer::put()
void DataServer::put()
{
    int start = 0;
    std::ofstream os;
    while (start < bufSize)
    {
        int offset = start / chunkSize;
        std::string filePath = name_ + "/" + std::to_string(fid) + " " + std::to_string(offset);
        os.open(filePath);
        if (!os)
            std::cerr << "Failed in creating file in data server: " << filePath << std::endl;
        os.write(&buf[start], std::min(chunkSize, bufSize - start));
        start += chunkSize;
        os.close();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2d8, %rsp            # imm = 0x2D8
movq %rdi, %r15
leaq -0x2f8(%rbp), %rdi
callq 0x3450
cmpl $0x0, 0xa4(%r15)
jle 0x3e3b
leaq -0x78(%rbp), %r14
xorl %eax, %eax
leaq -0x88(%rbp), %rbx
movq %r15, -0xf8(%rbp)
movq %rax, -0xf0(%rbp)
cltd
idivl 0x88c7(%rip)            # 0xc288
movl %eax, %r12d
movq %r14, -0x88(%rbp)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x4fce
movq %rbx, %rdi
leaq 0x5647(%rip), %rsi      # 0x902e
callq 0x34e0
movl 0xa0(%r15), %r15d
movl %r15d, %r13d
negl %r13d
cmovsl %r15d, %r13d
movl $0x1, %ebx
cmpl $0xa, %r13d
jb 0x3a4a
movl $0x4, %ebx
movl %r13d, %eax
cmpl $0x63, %eax
jbe 0x3a43
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x3a48
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x3a4a
movl %eax, %ecx
movl $0xd1b71759, %edx       # imm = 0xD1B71759
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebx
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x3a10
addl $-0x3, %ebx
jmp 0x3a4a
addl $-0x2, %ebx
jmp 0x3a4a
decl %ebx
shrl $0x1f, %r15d
leal (%rbx,%r15), %esi
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x68(%rbp), %rdi
movl $0x2d, %edx
callq 0x32f0
addq -0x68(%rbp), %r15
movq %r15, %rdi
movl %ebx, %esi
movl %r13d, %edx
callq 0x4f4d
movq -0x88(%rbp), %rcx
movl $0xf, %esi
leaq -0x78(%rbp), %r13
cmpq %r13, %rcx
je 0x3a92
movq -0x78(%rbp), %rsi
movq -0x80(%rbp), %r8
movq -0x60(%rbp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
leaq -0x98(%rbp), %rbx
leaq -0xd8(%rbp), %r15
jbe 0x3ac9
movl $0xf, %esi
leaq -0x58(%rbp), %rdi
cmpq %rdi, -0x68(%rbp)
je 0x3ac4
movq -0x58(%rbp), %rsi
cmpq %rsi, %rax
jbe 0x3adb
movq -0x68(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x3100
jmp 0x3ae8
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32c0
movq %rbx, -0xa8(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x3b0e
movq %rdx, -0xa8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x98(%rbp)
jmp 0x3b14
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0xa0(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq -0xa8(%rbp), %rdi
leaq 0x5730(%rip), %rsi      # 0x9271
callq 0x34e0
movq %r15, -0xe8(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3b6f
movq %rdx, -0xe8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xd8(%rbp)
jmp 0x3b76
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, -0xe0(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl %r12d, %r15d
negl %r15d
cmovsl %r12d, %r15d
movl $0x1, %ebx
cmpl $0xa, %r15d
jb 0x3be7
movl $0x4, %ebx
movl %r15d, %eax
cmpl $0x63, %eax
jbe 0x3be0
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x3be5
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x3be7
movl %eax, %ecx
movl $0xd1b71759, %edx       # imm = 0xD1B71759
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebx
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x3bad
addl $-0x3, %ebx
jmp 0x3be7
addl $-0x2, %ebx
jmp 0x3be7
decl %ebx
shrl $0x1f, %r12d
leal (%rbx,%r12), %esi
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x48(%rbp), %rdi
movl $0x2d, %edx
callq 0x32f0
movl %r12d, %edi
addq -0x48(%rbp), %rdi
movl %ebx, %esi
movl %r15d, %edx
callq 0x4f4d
movq -0xe8(%rbp), %rcx
movl $0xf, %esi
leaq -0xd8(%rbp), %r15
cmpq %r15, %rcx
je 0x3c35
movq -0xd8(%rbp), %rsi
movq -0xe0(%rbp), %r8
movq -0x40(%rbp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
leaq -0x98(%rbp), %rbx
leaq -0xb8(%rbp), %r12
jbe 0x3c6f
movl $0xf, %esi
leaq -0x38(%rbp), %rdi
cmpq %rdi, -0x48(%rbp)
je 0x3c6a
movq -0x38(%rbp), %rsi
cmpq %rsi, %rax
jbe 0x3c81
movq -0x48(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
callq 0x3100
jmp 0x3c8e
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32c0
movq %r12, -0xc8(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x3cb4
movq %rdx, -0xc8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xb8(%rbp)
jmp 0x3cbc
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0xc0(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x3ced
callq 0x3270
movq -0xe8(%rbp), %rdi
cmpq %r15, %rdi
je 0x3cfe
callq 0x3270
movq -0xa8(%rbp), %rdi
cmpq %rbx, %rdi
movq -0xf8(%rbp), %r15
je 0x3d16
callq 0x3270
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
leaq -0x2f8(%rbp), %rbx
je 0x3d2f
callq 0x3270
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
je 0x3d40
callq 0x3270
movq %r13, %r14
movq %rbx, %rdi
leaq -0xc8(%rbp), %rsi
movl $0x10, %edx
callq 0x3160
movq -0x2f8(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x2d8(%rbp,%rax)
je 0x3dc8
movl $0x28, %edx
movq 0x8278(%rip), %rdi      # 0xbff0
leaq 0x52b1(%rip), %rsi      # 0x9030
callq 0x32e0
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
movq 0x8257(%rip), %rdi      # 0xbff0
callq 0x32e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
movq -0xf0(%rbp), %rcx
movslq %ecx, %rsi
addq 0xb0(%r15), %rsi
movl 0xa4(%r15), %eax
subl %ecx, %eax
movl 0x84a0(%rip), %ecx      # 0xc288
cmpl %ecx, %eax
cmovgel %ecx, %eax
movslq %eax, %rdx
leaq -0x2f8(%rbp), %r13
movq %r13, %rdi
callq 0x3350
movl 0x8483(%rip), %ebx      # 0xc288
movq %r13, %rdi
callq 0x3390
movq -0xc8(%rbp), %rdi
cmpq %r12, %rdi
je 0x3e1e
callq 0x3270
movq -0xf0(%rbp), %rax
addl %ebx, %eax
cmpl 0xa4(%r15), %eax
leaq -0x88(%rbp), %rbx
jl 0x39b3
movq 0x817e(%rip), %rax      # 0xbfc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x2f0(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x2f8(%rbp,%rcx)
callq 0x3220
leaq -0x200(%rbp), %rdi
callq 0x3110
addq $0x2d8, %rsp            # imm = 0x2D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x3f20
jmp 0x3e8d
movq %rax, %rbx
jmp 0x3ef8
movq %rax, %rbx
jmp 0x3ee6
movq %rax, %rbx
jmp 0x3ece
movq %rax, %rbx
jmp 0x3eb6
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x3eb6
callq 0x3270
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0x3ece
callq 0x3270
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x3ee6
callq 0x3270
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x3ef8
callq 0x3270
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
jne 0x3f1b
jmp 0x3f20
jmp 0x3f0c
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
cmpq %r12, %rdi
je 0x3f20
callq 0x3270
leaq -0x2f8(%rbp), %rdi
callq 0x33d0
movq %rbx, %rdi
callq 0x34a0