// File: /workspace/github_cpp_makefile_star2_O1/ljl0222[P]SecondFileSystem/User.cpp
// Function: User::Write(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void User::Write(string sfd, string inFile, string size) {
    if (sfd.empty() || !isdigit(sfd.front())) {
        cout << "write����������\n";
        return;
    }
    int fd = stoi(sfd);

    int usize;
    if (size.empty() || (usize = stoi(size)) < 0) {
        cout << "write����������\n";
        return;
    }

    char* buffer = new char[usize];
    fstream fin(inFile, ios::in | ios::binary);
    if (!fin) {
        cout << "���������ļ�  " << inFile << " ʧ�ܣ�\n";
        return;
    }
    fin.read(buffer, usize);
    fin.close();
    u_arg[0] = fd;
    u_arg[1] = (long)buffer;
    u_arg[2] = usize;
    u_FileManager->Write();

    if (IsError())
        return;
    cout << "������д�� " << u_ar0[User::EAX] << "�ֽڳɹ���" << endl;
    delete[]buffer;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
cmpq $0x0, 0x8(%rsi)
je 0x7181
movq (%rsi), %rbx
movsbl (%rbx), %eax
addl $-0x30, %eax
cmpl $0xa, %eax
jae 0x7181
movq %rcx, %r13
movq %rdx, %r14
movq %rdi, -0x40(%rbp)
callq 0x3050
movq %rax, %r15
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
movl $0x0, (%r15)
leaq -0x250(%rbp), %r12
movq %rbx, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x3310
cmpq %rbx, (%r12)
je 0x726a
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x7276
movq %rax, %rcx
movl (%r15), %eax
cmpl $0x22, %eax
je 0x7276
movq %rcx, -0x38(%rbp)
testl %eax, %eax
jne 0x7087
movl -0x2c(%rbp), %eax
movl %eax, (%r15)
cmpq $0x0, 0x8(%r13)
je 0x7181
movq (%r13), %r12
movl (%r15), %eax
movl %eax, -0x2c(%rbp)
movl $0x0, (%r15)
leaq -0x250(%rbp), %r13
movq %r12, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x3310
cmpq %r12, (%r13)
je 0x7282
movq %rax, %rbx
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
leaq -0x80000000(%rbx), %rcx
cmpq %rax, %rcx
jb 0x728e
movl (%r15), %eax
cmpl $0x22, %eax
je 0x728e
testl %eax, %eax
jne 0x70f7
movl -0x2c(%rbp), %eax
movl %eax, (%r15)
testl %ebx, %ebx
js 0x7181
movl %ebx, %r13d
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
movq %r13, %rdi
callq 0x3030
movq %rax, %r15
leaq -0x250(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
movl $0xc, %edx
callq 0x33b0
movq (%r12), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x230(%rbp,%rax)
je 0x71aa
movq 0x5e84(%rip), %rdi      # 0xcfc8
leaq 0x1fe0(%rip), %rsi      # 0x912b
movl $0xe, %edx
callq 0x3260
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x5e65(%rip), %rdi      # 0xcfc8
callq 0x3260
leaq 0x1fcb(%rip), %rsi      # 0x913a
movl $0x8, %edx
movq %rax, %rdi
callq 0x3260
jmp 0x724c
movq 0x5e40(%rip), %rdi      # 0xcfc8
leaq 0x1f8b(%rip), %rsi      # 0x911a
movl $0x10, %edx
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3260
leaq -0x250(%rbp), %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x32b0
movq -0x40(%rbp), %r14
leaq -0x250(%rbp), %rdi
callq 0x3070
movq -0x38(%rbp), %rax
movl %eax, 0x1020(%r14)
movl %r15d, 0x1024(%r14)
movl %ebx, 0x1028(%r14)
movq 0x1400(%r14), %rdi
callq 0x4bf6
movq %r14, %rdi
callq 0x63e4
testb %al, %al
jne 0x724c
movq 0x5dc4(%rip), %rdi      # 0xcfc8
leaq 0x1f38(%rip), %rsi      # 0x9143
movl $0xb, %edx
callq 0x3260
movl 0x20(%r14), %esi
movq 0x5da8(%rip), %rdi      # 0xcfc8
callq 0x3160
movq %rax, %rbx
leaq 0x1f20(%rip), %rsi      # 0x914f
movl $0xa, %edx
movq %rax, %rdi
callq 0x3260
movq %rbx, %rdi
callq 0x3110
movq %r15, %rdi
callq 0x32d0
leaq -0x250(%rbp), %rdi
callq 0x3090
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2046(%rip), %rdi      # 0x92b7
callq 0x3150
leaq 0x203a(%rip), %rdi      # 0x92b7
callq 0x3320
leaq 0x202e(%rip), %rdi      # 0x92b7
callq 0x3150
leaq 0x2022(%rip), %rdi      # 0x92b7
callq 0x3320
jmp 0x72ad
movq %rax, %rbx
leaq -0x250(%rbp), %rdi
callq 0x3090
jmp 0x72bc
movq %rax, %rbx
cmpl $0x0, (%r15)
jne 0x72bc
movl -0x2c(%rbp), %eax
movl %eax, (%r15)
movq %rbx, %rdi
callq 0x33e0