// File: /workspace/github_cpp_makefile_star2_O2/ljl0222[P]SecondFileSystem/User.cpp
// Function: User::checkPathName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool User::checkPathName(string path) {
    // FileManager �к������жϲ����ĺϷ��ԣ�������User�й��ˣ�
    // �ݲ����ǹ����Ĳ������Ϸ�����
    if (path.empty()) {
        cout << "parameter path can't be empty ! \n";
        return false;
    }

    if (path.substr(0, 2) != "..") {
        u_dirp = path;
    }
    else {
        string pre = u_curdir;
        unsigned int p = 0;
        //���Զ�������·�� .. ../ ../.. ../../
        for (; pre.length() > 3 && p < path.length() && path.substr(p, 2) == ".."; ) {
            pre.pop_back();
            pre.erase(pre.find_last_of('/') + 1);
            p += 2;
            p += p < path.length() && path[p] == '/';
        }
        u_dirp = pre + path.substr(p);
    }

    if (u_dirp.length() > 1 && u_dirp.back() == '/') {
        u_dirp.pop_back();
    }

    for (unsigned int p = 0, q = 0; p < u_dirp.length(); p = q + 1) {
        q = u_dirp.find('/', p);
        q = min(q, (unsigned int)u_dirp.length());
        if (q - p > DirectoryEntry::DIRSIZ) {
            cout << "�ļ�·�����ȹ����� \n";
            return false;
        }
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
cmpq $0x0, 0x8(%rsi)
je 0x6311
movq %rsi, %r12
movq %rdi, %rbx
leaq -0x48(%rbp), %r15
pushq $0x2
popq %rcx
movq %r15, %rdi
xorl %edx, %edx
callq 0x3230
leaq 0x1efa(%rip), %rsi      # 0x81de
movq %r15, %rdi
callq 0x6e3d
movl %eax, %r15d
leaq -0x48(%rbp), %rdi
callq 0x3448
testb %r15b, %r15b
je 0x6324
leaq 0x1038(%rbx), %rdi
movq %r12, %rsi
callq 0x3120
jmp 0x6443
movq 0x5ca8(%rip), %rdi      # 0xbfc0
leaq 0x1e9d(%rip), %rsi      # 0x81bc
jmp 0x64b2
leaq 0x10a8(%rbx), %rsi
leaq -0x48(%rbp), %rdi
callq 0x3310
xorl %r15d, %r15d
leaq -0x90(%rbp), %r13
movq %rbx, -0x50(%rbp)
cmpq $0x4, -0x40(%rbp)
movl %r15d, %r15d
jb 0x63ed
cmpq %r15, 0x8(%r12)
jbe 0x63ed
movq %r13, %rdi
movq %r12, %r14
movq %r12, %rsi
movq %r15, %rdx
pushq $0x2
popq %rcx
callq 0x3230
movq %r13, %rdi
leaq 0x1e65(%rip), %rsi      # 0x81de
callq 0x6e4a
movl %eax, %r12d
movq %r13, %rdi
callq 0x3448
testb %r12b, %r12b
movq %r14, %r12
je 0x63ed
movq %r13, %rbx
leaq -0x48(%rbp), %r12
movq %r12, %rdi
callq 0x3280
movq %r12, %rdi
pushq $0x2f
popq %rsi
pushq $-0x1
popq %r13
movq %r13, %rdx
callq 0x3420
leaq 0x1(%rax), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x30a0
addl $0x2, %r15d
xorl %eax, %eax
movq %r14, %r12
cmpq %r15, 0x8(%r14)
jbe 0x63de
movq (%r12), %rcx
xorl %eax, %eax
cmpb $0x2f, (%rcx,%r15)
sete %al
addl %eax, %r15d
movq %rbx, %r13
movq -0x50(%rbp), %rbx
jmp 0x6342
leaq -0x70(%rbp), %rdi
pushq $-0x1
popq %rcx
movq %r12, %rsi
movq %r15, %rdx
callq 0x3230
leaq -0x90(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x6e5a
leaq 0x1038(%rbx), %rdi
leaq -0x90(%rbp), %r14
movq %r14, %rsi
callq 0x3290
movq %r14, %rdi
callq 0x3448
leaq -0x70(%rbp), %rdi
callq 0x3448
leaq -0x48(%rbp), %rdi
callq 0x3448
leaq 0x1038(%rbx), %r14
movq 0x1040(%rbx), %rcx
cmpq $0x2, %rcx
jb 0x6470
movq (%r14), %rax
cmpb $0x2f, -0x1(%rax,%rcx)
jne 0x6470
movq %r14, %rdi
callq 0x3280
movq 0x1040(%rbx), %rcx
xorl %eax, %eax
pushq $0x2f
popq %r15
movl %eax, %r12d
cmpq %r12, %rcx
jbe 0x64bb
movq %r14, %rdi
movl %r15d, %esi
movq %r12, %rdx
callq 0x32e0
movq 0x1040(%rbx), %rcx
cmpl %eax, %ecx
cmovbl %ecx, %eax
movl %eax, %edx
subl %r12d, %edx
incl %eax
cmpl $0x1d, %edx
jb 0x6476
movq 0x5b15(%rip), %rdi      # 0xbfc0
leaq 0x1d2f(%rip), %rsi      # 0x81e1
callq 0x31e0
xorl %eax, %eax
jmp 0x64bd
movb $0x1, %al
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x3448
jmp 0x64e3
jmp 0x64e0
jmp 0x64e0
jmp 0x64e0
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x3448
movq %rbx, %rdi
callq 0x33c0