// File: /workspace/github_cpp_makefile_star2_O1/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 $0x88, %rsp
cmpq $0x0, 0x8(%rsi)
je 0x6566
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x48(%rbp), %r12
movl $0x2, %ecx
movq %r12, %rdi
xorl %edx, %edx
callq 0x3230
leaq 0x2cb5(%rip), %rsi      # 0x91de
movq %r12, %rdi
callq 0x30b0
movl %eax, %r15d
movq (%r12), %rdi
leaq -0x38(%rbp), %r12
cmpq %r12, %rdi
je 0x654d
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x3220
testl %r15d, %r15d
je 0x6586
leaq 0x1038(%rbx), %rdi
movq %r14, %rsi
callq 0x3130
jmp 0x6745
movq 0x6a5b(%rip), %rdi      # 0xcfc8
leaq 0x2c48(%rip), %rsi      # 0x91bc
movl $0x21, %edx
callq 0x3260
xorl %r15d, %r15d
jmp 0x67ee
leaq -0x48(%rbp), %r15
movq %r12, (%r15)
movq 0x10a8(%rbx), %rsi
movq 0x10b0(%rbx), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x77a6
xorl %r13d, %r13d
leaq -0xa8(%rbp), %r12
cmpq $0x4, -0x40(%rbp)
jb 0x65e9
movl %r13d, %edx
cmpq %rdx, 0x8(%r14)
jbe 0x65e9
movl $0x2, %ecx
movq %r12, %rdi
movq %r14, %rsi
callq 0x3230
movq %r12, %rdi
leaq 0x2c04(%rip), %rsi      # 0x91de
callq 0x30b0
testl %eax, %eax
sete %r12b
movb $0x1, %al
jmp 0x65ee
xorl %eax, %eax
xorl %r12d, %r12d
testb %al, %al
je 0x6614
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x6614
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x3220
testb %r12b, %r12b
je 0x6679
movq %r15, %rdi
callq 0x3290
movq %r15, %rdi
movl $0x2f, %esi
movq $-0x1, %rdx
callq 0x3430
incq %rax
movq -0x40(%rbp), %rcx
cmpq %rax, %rcx
jb 0x6803
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rcx
movb $0x0, (%rcx,%rax)
addl $0x2, %r13d
xorl %eax, %eax
cmpq %r13, 0x8(%r14)
leaq -0xa8(%rbp), %r12
jbe 0x6671
movq (%r14), %rcx
xorl %eax, %eax
cmpb $0x2f, (%rcx,%r13)
sete %al
addl %eax, %r13d
jmp 0x65b0
movl %r13d, %edx
leaq -0x68(%rbp), %rdi
movq %r14, %rsi
movq $-0x1, %rcx
callq 0x3230
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %r8
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq -0x38(%rbp), %r12
callq 0x3250
leaq -0x78(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x66cf
movq %rdx, -0x88(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x78(%rbp)
jmp 0x66d6
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq -0x88(%rbp), %r14
movq %rdx, 0x8(%r14)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1038(%rbx), %rdi
movq %r14, %rsi
callq 0x32a0
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x6717
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x3220
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6730
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x3220
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x6745
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x3220
leaq 0x1038(%rbx), %r14
movq 0x1040(%rbx), %rax
cmpq $0x2, %rax
jb 0x676b
movq (%r14), %rcx
cmpb $0x2f, -0x1(%rcx,%rax)
jne 0x676b
movq %r14, %rdi
callq 0x3290
cmpq $0x0, 0x1040(%rbx)
sete %r15b
je 0x67ee
movq %r14, %rdi
movl $0x2f, %esi
xorl %edx, %edx
callq 0x32e0
movq %rax, %r12
movl 0x1040(%rbx), %eax
cmpl %r12d, %eax
cmovbl %eax, %r12d
cmpl $0x1c, %r12d
ja 0x67d6
incl %r12d
cmpq %r12, 0x1040(%rbx)
setbe %r15b
jbe 0x67ee
movq %r14, %rdi
movl $0x2f, %esi
movq %r12, %rdx
callq 0x32e0
movl 0x1040(%rbx), %ecx
cmpl %eax, %ecx
cmovbl %ecx, %eax
movl %eax, %ecx
subl %r12d, %ecx
movl %eax, %r12d
cmpl $0x1d, %ecx
jb 0x679e
movq 0x67eb(%rip), %rdi      # 0xcfc8
leaq 0x29fd(%rip), %rsi      # 0x91e1
movl $0x14, %edx
callq 0x3260
movl %r15d, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2adc(%rip), %rdi      # 0x92e6
leaq 0x2b0c(%rip), %rsi      # 0x931d
movq %rax, %rdx
xorl %eax, %eax
callq 0x3350
movq %rax, %rbx
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6840
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x3220
jmp 0x6840
jmp 0x683d
jmp 0x683d
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x6859
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x3220
movq %rbx, %rdi
callq 0x33e0
nop