// File: /workspace/github_cpp_makefile_star2_O3/ljl0222[P]SecondFileSystem/User.cpp
// Function: User::Read(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::Read(string sfd, string outFile, string size) {
    if (sfd.empty() || !isdigit(sfd.front())) {
        cout << "read���������� \n";
        return;
    }
    int fd = stoi(sfd);

    int usize;
    if (size.empty() || !isdigit(size.front()) || (usize = stoi(size)) < 0) {
        cout << "read���������� \n";
        return;
    }
    char* buffer = new char[usize];
    //cout << "fd = " << fd << " outFile = " << outFile << " size = " << size << "\n";
    u_arg[0] = fd;
    u_arg[1] = (long)buffer;
    u_arg[2] = usize;
    u_FileManager->Read();
    if (IsError())
        return;

    cout << "read " << u_ar0[User::EAX] << " bytes success : \n";
    if (outFile.empty()) {
        for (unsigned int i = 0; i < u_ar0[User::EAX]; ++i) {
            cout << (char)buffer[i];
        }
        cout << " \n";
        return;
    }
    fstream fout(outFile, ios::out | ios::binary);
    if (!fout) {
        cout << "���������ļ� " << outFile << " ʧ�ܣ� \n";
        return;
    }
    fout.write(buffer, u_ar0[User::EAX]);
    fout.close();
    cout << "�������ļ� " << outFile << " �ɹ��� \n";
    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 0x7468
movq (%rsi), %rbx
movsbl (%rbx), %eax
addl $-0x30, %eax
cmpl $0xa, %eax
jae 0x7468
movq %rcx, %r13
movq %rdi, -0x40(%rbp)
movq %rdx, -0x38(%rbp)
callq 0x3050
movq %rax, %r15
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
movl $0x0, (%r15)
leaq -0x250(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
movl $0xa, %edx
callq 0x3310
cmpq %rbx, (%r14)
je 0x7572
movq %rax, %r12
movslq %r12d, %rax
cmpq %r12, %rax
jne 0x757e
movl (%r15), %r14d
cmpl $0x22, %r14d
je 0x757e
testl %r14d, %r14d
jne 0x72e2
movl -0x2c(%rbp), %r14d
movl %r14d, (%r15)
cmpq $0x0, 0x8(%r13)
je 0x7468
movq (%r13), %rbx
movsbl (%rbx), %eax
addl $-0x30, %eax
cmpl $0x9, %eax
ja 0x7468
movl $0x0, (%r15)
leaq -0x250(%rbp), %rsi
movq %rbx, %rdi
movl $0xa, %edx
callq 0x3310
movq %rax, %r13
leaq -0x250(%rbp), %rax
cmpq %rbx, (%rax)
je 0x758a
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
leaq -0x80000000(%r13), %rcx
cmpq %rax, %rcx
jb 0x7596
movl (%r15), %eax
cmpl $0x22, %eax
je 0x7596
testl %eax, %eax
jne 0x735b
movl %r14d, (%r15)
testl %r13d, %r13d
js 0x7468
movl %r13d, %edi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
callq 0x3030
movq %rax, %r15
movq -0x40(%rbp), %rax
movl %r12d, 0x1020(%rax)
movq %rax, %r12
movl %r15d, 0x1024(%rax)
movl %r13d, 0x1028(%rax)
movq 0x1400(%rax), %rdi
callq 0x4b34
movq %r12, %rdi
callq 0x6398
testb %al, %al
jne 0x7560
movq 0x5c14(%rip), %rbx      # 0xcfc8
leaq 0x1db0(%rip), %rsi      # 0x916b
movl $0x5, %edx
movq %rbx, %rdi
callq 0x3260
movl 0x20(%r12), %esi
movq %rbx, %rdi
callq 0x3160
leaq 0x1d95(%rip), %rsi      # 0x9171
movl $0x12, %edx
movq %rax, %rdi
callq 0x3260
movq -0x38(%rbp), %r14
cmpq $0x0, 0x8(%r14)
je 0x7491
leaq -0x250(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x14, %edx
callq 0x33b0
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x230(%rbp,%rax)
je 0x74ed
movq 0x5b9d(%rip), %rdi      # 0xcfc8
leaq 0x1d52(%rip), %rsi      # 0x9184
movl $0xd, %edx
callq 0x3260
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x5b7e(%rip), %rdi      # 0xcfc8
callq 0x3260
leaq 0x1d3c(%rip), %rsi      # 0x9192
movl $0x9, %edx
movq %rax, %rdi
callq 0x3260
jmp 0x7554
movq 0x5b59(%rip), %rdi      # 0xcfc8
leaq 0x1ce4(%rip), %rsi      # 0x915a
movl $0x10, %edx
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3260
cmpl $0x0, 0x20(%r12)
je 0x74d3
movq %r12, %r13
xorl %r14d, %r14d
movq 0x5b22(%rip), %rbx      # 0xcfc8
leaq -0x250(%rbp), %r12
movb (%r15,%r14), %al
movb %al, -0x250(%rbp)
movl $0x1, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3260
incq %r14
movl 0x20(%r13), %eax
cmpq %rax, %r14
jb 0x74ad
movq 0x5aee(%rip), %rdi      # 0xcfc8
leaq 0x1be6(%rip), %rsi      # 0x90c7
movl $0x2, %edx
callq 0x3260
jmp 0x7560
leaq -0x240(%rbp), %rdi
movl 0x20(%r12), %edx
movq %r15, %rsi
callq 0x32f0
leaq -0x250(%rbp), %rdi
callq 0x3070
movq 0x5ab4(%rip), %rdi      # 0xcfc8
leaq 0x1c81(%rip), %rsi      # 0x919c
movl $0xb, %edx
callq 0x3260
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x5a95(%rip), %rdi      # 0xcfc8
callq 0x3260
leaq 0x1c69(%rip), %rsi      # 0x91a8
movl $0x9, %edx
movq %rax, %rdi
callq 0x3260
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 0x1d3e(%rip), %rdi      # 0x92b7
callq 0x3150
leaq 0x1d32(%rip), %rdi      # 0x92b7
callq 0x3320
leaq 0x1d26(%rip), %rdi      # 0x92b7
callq 0x3150
leaq 0x1d1a(%rip), %rdi      # 0x92b7
callq 0x3320
movq %rax, %rbx
leaq -0x250(%rbp), %rdi
callq 0x3090
jmp 0x75d0
movq %rax, %rbx
cmpl $0x0, (%r15)
jne 0x75d0
movl %r14d, (%r15)
jmp 0x75d0
movq %rax, %rbx
cmpl $0x0, (%r15)
jne 0x75d0
movl -0x2c(%rbp), %eax
movl %eax, (%r15)
movq %rbx, %rdi
callq 0x33e0