fgettype() test: Skip useless tests (lea/cmp/cmove) if correct filetype was detected
This commit is contained in:
@@ -1326,25 +1326,32 @@ _start:
|
||||
lea rsi, [rel ftype_dir]
|
||||
cmp rax, S_IFDIR
|
||||
cmove rdx, rsi
|
||||
je .fgettype_cnt
|
||||
lea rsi, [rel ftype_char]
|
||||
cmp rax, S_IFCHR
|
||||
cmove rdx, rsi
|
||||
je .fgettype_cnt
|
||||
lea rsi, [rel ftype_blk]
|
||||
cmp rax, S_IFBLK
|
||||
cmove rdx, rsi
|
||||
je .fgettype_cnt
|
||||
lea rsi, [rel ftype_reg]
|
||||
cmp rax, S_IFREG
|
||||
cmove rdx, rsi
|
||||
je .fgettype_cnt
|
||||
lea rsi, [rel ftype_fifo]
|
||||
cmp rax, S_IFIFO
|
||||
cmove rdx, rsi
|
||||
je .fgettype_cnt
|
||||
lea rsi, [rel ftype_link]
|
||||
cmp rax, S_IFLNK
|
||||
cmove rdx, rsi
|
||||
je .fgettype_cnt
|
||||
lea rsi, [rel ftype_sock]
|
||||
cmp rax, S_IFSOCK
|
||||
cmove rdx, rsi
|
||||
|
||||
.fgettype_cnt:
|
||||
lea rdi, [rel fgettypeStr]
|
||||
lea rsi, [rel file1]
|
||||
call printf
|
||||
|
Reference in New Issue
Block a user