// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: hpatch_getPathStat_noEndDirSeparator
hpatch_BOOL _hpatch_getPathStat_noEndDirSeparator(const char* path_utf8,hpatch_TPathType* out_type,
                                                  hpatch_StreamPos_t* out_fileSize,size_t* out_st_mode){
#if (_IS_USED_WIN32_UTF8_WAPI)
    int            wsize;
    wchar_t        path_w[hpatch_kPathMaxSize];
    struct _stat64 s;
#else
#   ifdef _MSC_VER
    struct _stat64 s;
#   else
    struct stat  s;
#   endif
#endif
    
    int          rt;
    assert(out_type!=0);
    memset(&s,0,sizeof(s));
#if (_IS_USED_WIN32_UTF8_WAPI)
    wsize=_utf8FileName_to_w(path_utf8,path_w,hpatch_kPathMaxSize);
    if (wsize<=0) return hpatch_FALSE;
    #if (_IS_FOR_WINXP)
        _getStatByAttributes(path_w,s,rt,GetFileAttributesExW);
    #else
        rt = _wstat64(path_w,&s);
    #endif
#else
#   ifdef _MSC_VER
    #if (_IS_FOR_WINXP)
        _getStatByAttributes(path_utf8,s,rt,GetFileAttributesExA);
    #else
        rt = _stat64(path_utf8,&s);
    #endif
#   else
    rt = stat(path_utf8,&s);
#   endif
#endif
    if (out_st_mode) *out_st_mode=s.st_mode;
    
    if(rt!=0){
        if (errno==ENOENT){
            *out_type=kPathType_notExist;
            return hpatch_TRUE;
        }
        return hpatch_FALSE; //error
    }else if ((s.st_mode&S_IFMT)==S_IFREG){
        *out_type=kPathType_file;
        if (out_fileSize) *out_fileSize=s.st_size;
        return hpatch_TRUE;
    }else if ((s.st_mode&S_IFMT)==S_IFDIR){
        *out_type=kPathType_dir;
        if (out_fileSize) *out_fileSize=0;
        return hpatch_TRUE;
#if (_IS_NEED_BLOCK_DEV)
    }else if ((s.st_mode&S_IFMT)==S_IFBLK){
        hpatch_uint64_t bsize=0;
        if (!_get_block_dev_size(path_utf8, &bsize))
            return hpatch_FALSE;
        *out_type=kPathType_file;
        if (out_fileSize) *out_fileSize=bsize;
        return hpatch_TRUE;
#endif
    }else{
        return hpatch_FALSE; //as error; unknow how to dispose
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
testq %rsi, %rsi
je 0x3e482
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rsp), %r13
movl $0x90, %edx
movq %r13, %rdi
xorl %esi, %esi
callq 0x41f0
movq %r15, %rdi
movq %r13, %rsi
callq 0x45c0
testq %r12, %r12
je 0x3e372
movl 0x20(%rsp), %ecx
movq %rcx, (%r12)
testl %eax, %eax
je 0x3e38c
callq 0x4050
cmpl $0x2, (%rax)
jne 0x3e3c3
andl $0x0, (%r14)
pushq $0x1
popq %rbp
jmp 0x3e436
movl $0xf000, %eax           # imm = 0xF000
andl 0x20(%rsp), %eax
cmpw $0x4000, %ax            # imm = 0x4000
je 0x3e423
cmpl $0x6000, %eax           # imm = 0x6000
je 0x3e3c7
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x3e3c3
movl $0x1, (%r14)
pushq $0x1
popq %rbp
testq %rbx, %rbx
je 0x3e436
movq 0x38(%rsp), %rax
jmp 0x3e41e
xorl %ebp, %ebp
jmp 0x3e436
andq $0x0, (%rsp)
testq %r15, %r15
je 0x3e4a1
xorl %ebp, %ebp
movq %r15, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x45d0
cmpl $-0x1, %eax
je 0x3e44a
movl %eax, %r15d
xorl %ebp, %ebp
movq %rsp, %rdx
movl $0x80081272, %esi       # imm = 0x80081272
movl %eax, %edi
xorl %eax, %eax
callq 0x4470
cmpl $-0x1, %eax
je 0x3e462
movl %r15d, %edi
callq 0x4690
movl $0x1, (%r14)
pushq $0x1
popq %rbp
testq %rbx, %rbx
je 0x3e436
movq (%rsp), %rax
movq %rax, (%rbx)
jmp 0x3e436
movl $0x2, (%r14)
pushq $0x1
popq %rbp
testq %rbx, %rbx
je 0x3e436
andq $0x0, (%rbx)
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x36b77(%rip), %rax     # 0x74fc8
movq (%rax), %rsi
leaq 0x1906a(%rip), %rdi     # 0x574c5
callq 0x4390
jmp 0x3e436
movq 0x36b5f(%rip), %rax     # 0x74fc8
movq (%rax), %rsi
leaq 0x1906d(%rip), %rdi     # 0x574e0
callq 0x4390
movl %r15d, %edi
callq 0x4690
jmp 0x3e436
leaq 0x18e15(%rip), %rdi     # 0x5729e
leaq 0x18e1a(%rip), %rsi     # 0x572aa
leaq 0x18e2f(%rip), %rcx     # 0x572c6
movl $0xab, %edx
callq 0x4230
leaq 0x18fce(%rip), %rdi     # 0x57476
leaq 0x18dfb(%rip), %rsi     # 0x572aa
leaq 0x18fce(%rip), %rcx     # 0x57484
pushq $0x3d
popq %rdx
callq 0x4230