// File: /workspace/github_cpp_makefile_star2_O1/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 0x48463
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 0x41c0
movq %r15, %rdi
movq %r13, %rsi
callq 0x45a0
testq %r12, %r12
je 0x48367
movl 0x20(%rsp), %ecx
movq %rcx, (%r12)
testl %eax, %eax
je 0x48386
callq 0x4050
cmpl $0x2, (%rax)
jne 0x483c4
movl $0x0, (%r14)
movl $0x1, %ebp
jmp 0x48441
movl $0xf000, %eax           # imm = 0xF000
andl 0x20(%rsp), %eax
cmpl $0x4000, %eax           # imm = 0x4000
je 0x48429
cmpl $0x6000, %eax           # imm = 0x6000
je 0x483c8
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x483c4
movl $0x1, (%r14)
movl $0x1, %ebp
testq %rbx, %rbx
je 0x48441
movq 0x38(%rsp), %rax
jmp 0x48424
xorl %ebp, %ebp
jmp 0x48441
movq $0x0, (%rsp)
testq %r15, %r15
je 0x48482
xorl %ebp, %ebp
movq %r15, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x45b0
cmpl $-0x1, %eax
je 0x48455
movl %eax, %r15d
xorl %ebp, %ebp
movq %rsp, %rdx
movl $0x80081272, %esi       # imm = 0x80081272
movl %eax, %edi
xorl %eax, %eax
callq 0x4440
movl %r15d, %edi
cmpl $-0x1, %eax
je 0x4845c
callq 0x4670
movl $0x1, (%r14)
movl $0x1, %ebp
testq %rbx, %rbx
je 0x48441
movq (%rsp), %rax
movq %rax, (%rbx)
jmp 0x48441
movl $0x2, (%r14)
movl $0x1, %ebp
testq %rbx, %rbx
je 0x48441
movq $0x0, (%rbx)
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4a36
jmp 0x48441
callq 0x4a14
jmp 0x48441
leaq 0x19d26(%rip), %rdi     # 0x62190
leaq 0x19d2b(%rip), %rsi     # 0x6219c
leaq 0x19d40(%rip), %rcx     # 0x621b8
movl $0xab, %edx
callq 0x4200
leaq 0x19edf(%rip), %rdi     # 0x62368
leaq 0x19d0c(%rip), %rsi     # 0x6219c
leaq 0x19edf(%rip), %rcx     # 0x62376
movl $0x3d, %edx
callq 0x4200