	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __wceex_get_file_mode
___wceex_get_file_mode:                 ## @__wceex_get_file_mode
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	___DOSMODE_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r15d
	movq	%rdi, %r14
	xorl	%ebx, %ebx
	cmpb	$58, 1(%rdi)
	sete	%bl
	movsbl	(%rdi,%rbx,2), %edi
	addq	%rbx, %rbx
	callq	_IS_SLASH
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	cmpb	$0, 1(%r14,%rbx)
	je	LBB0_4
LBB0_2:
	movq	_FILE_ATTRIBUTE_DIRECTORY@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_3
LBB0_4:
	movq	_S_IFDIR@GOTPCREL(%rip), %rax
	movq	_S_IEXEC@GOTPCREL(%rip), %rcx
	movzwl	(%rcx), %ebx
	orw	(%rax), %bx
LBB0_6:
	movq	_FILE_ATTRIBUTE_READONLY@GOTPCREL(%rip), %rcx
	movq	_S_IREAD@GOTPCREL(%rip), %rax
	andl	(%rcx), %r15d
	jne	LBB0_7
## %bb.8:
	movq	_S_IWRITE@GOTPCREL(%rip), %rcx
	movzwl	(%rcx), %ecx
	jmp	LBB0_9
LBB0_7:
	xorl	%ecx, %ecx
LBB0_9:
	orw	(%rax), %bx
	orl	%ecx, %ebx
	movq	%r14, %rdi
	movl	$46, %esi
	callq	_strrchr
	testq	%rax, %rax
	je	LBB0_15
## %bb.10:
	movq	%rax, %r14
	leaq	L_.str(%rip), %rsi
	movq	%rax, %rdi
	callq	__stricmp
	testl	%eax, %eax
	je	LBB0_14
## %bb.11:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	__stricmp
	testl	%eax, %eax
	je	LBB0_14
## %bb.12:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	__stricmp
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	callq	__stricmp
	testl	%eax, %eax
	jne	LBB0_15
LBB0_14:
	movq	_S_IEXEC@GOTPCREL(%rip), %rax
	orw	(%rax), %bx
LBB0_15:
	movl	%ebx, %eax
	shrl	$3, %eax
	andl	$56, %eax
	orl	%ebx, %eax
	shrl	$6, %ebx
	andl	$7, %ebx
	orl	%eax, %ebx
	movzwl	%bx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	cmpb	$0, (%r14,%rbx)
	je	LBB0_4
## %bb.5:
	movq	_S_IFREG@GOTPCREL(%rip), %rax
	movzwl	(%rax), %ebx
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	___DOSMODE_MASK,4,2             ## @__DOSMODE_MASK
	.comm	_FILE_ATTRIBUTE_DIRECTORY,4,2   ## @FILE_ATTRIBUTE_DIRECTORY
	.comm	_S_IFDIR,2,1                    ## @S_IFDIR
	.comm	_S_IEXEC,2,1                    ## @S_IEXEC
	.comm	_S_IFREG,2,1                    ## @S_IFREG
	.comm	_FILE_ATTRIBUTE_READONLY,4,2    ## @FILE_ATTRIBUTE_READONLY
	.comm	_S_IREAD,2,1                    ## @S_IREAD
	.comm	_S_IWRITE,2,1                   ## @S_IWRITE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	".exe"

L_.str.1:                               ## @.str.1
	.asciz	".cmd"

L_.str.2:                               ## @.str.2
	.asciz	".bat"

L_.str.3:                               ## @.str.3
	.asciz	".com"

	.no_dead_strip	___wceex_get_file_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __wceex_get_file_mode
___wceex_get_file_mode:                 ; @__wceex_get_file_mode
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
Lloh0:
	adrp	x8, ___DOSMODE_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___DOSMODE_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w21, w8, w1
	ldrb	w8, [x0, #1]
	cmp	w8, #58
	cset	w8, eq
	add	x22, x0, w8, uxtw #1
	ldrsb	w0, [x22]
	bl	_IS_SLASH
Lloh3:
	adrp	x20, _S_IEXEC@GOTPAGE
Lloh4:
	ldr	x20, [x20, _S_IEXEC@GOTPAGEOFF]
	cbz	x0, LBB0_2
; %bb.1:
	ldrb	w8, [x22, #1]
	cbz	w8, LBB0_3
LBB0_2:
Lloh5:
	adrp	x8, _FILE_ATTRIBUTE_DIRECTORY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _FILE_ATTRIBUTE_DIRECTORY@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_11
LBB0_3:
Lloh8:
	adrp	x8, _S_IFDIR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _S_IFDIR@GOTPAGEOFF]
	ldrh	w8, [x8]
	ldrh	w9, [x20]
	orr	w8, w9, w8
LBB0_4:
Lloh10:
	adrp	x9, _FILE_ATTRIBUTE_READONLY@GOTPAGE
Lloh11:
	ldr	x9, [x9, _FILE_ATTRIBUTE_READONLY@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
Lloh13:
	adrp	x10, _S_IREAD@GOTPAGE
Lloh14:
	ldr	x10, [x10, _S_IREAD@GOTPAGEOFF]
Lloh15:
	adrp	x11, _S_IWRITE@GOTPAGE
Lloh16:
	ldr	x11, [x11, _S_IWRITE@GOTPAGEOFF]
	ldrh	w10, [x10]
	ldrh	w11, [x11]
	tst	w9, w21
	csel	w9, w11, wzr, eq
	orr	w8, w10, w8
	orr	w21, w8, w9
	mov	x0, x19
	mov	w1, #46
	bl	_strrchr
	cbz	x0, LBB0_10
; %bb.5:
	mov	x19, x0
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	bl	__stricmp
	cbz	w0, LBB0_9
; %bb.6:
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	__stricmp
	cbz	w0, LBB0_9
; %bb.7:
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	__stricmp
	cbz	w0, LBB0_9
; %bb.8:
Lloh23:
	adrp	x1, l_.str.3@PAGE
Lloh24:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	__stricmp
	cbnz	w0, LBB0_10
LBB0_9:
	ldrh	w8, [x20]
	orr	w21, w8, w21
LBB0_10:
	and	w8, w21, #0xffff
	ubfx	w9, w21, #3, #13
	and	w9, w9, #0x38
	orr	w9, w9, w21
	ubfx	w8, w8, #6, #3
	orr	w8, w9, w8
	and	w0, w8, #0xffff
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_11:
	ldrb	w8, [x22]
	cbz	w8, LBB0_3
; %bb.12:
Lloh25:
	adrp	x8, _S_IFREG@GOTPAGE
Lloh26:
	ldr	x8, [x8, _S_IFREG@GOTPAGEOFF]
	ldrh	w8, [x8]
	b	LBB0_4
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	___DOSMODE_MASK,4,2             ; @__DOSMODE_MASK
	.comm	_FILE_ATTRIBUTE_DIRECTORY,4,2   ; @FILE_ATTRIBUTE_DIRECTORY
	.comm	_S_IFDIR,2,1                    ; @S_IFDIR
	.comm	_S_IEXEC,2,1                    ; @S_IEXEC
	.comm	_S_IFREG,2,1                    ; @S_IFREG
	.comm	_FILE_ATTRIBUTE_READONLY,4,2    ; @FILE_ATTRIBUTE_READONLY
	.comm	_S_IREAD,2,1                    ; @S_IREAD
	.comm	_S_IWRITE,2,1                   ; @S_IWRITE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	".exe"

l_.str.1:                               ; @.str.1
	.asciz	".cmd"

l_.str.2:                               ; @.str.2
	.asciz	".bat"

l_.str.3:                               ; @.str.3
	.asciz	".com"

	.no_dead_strip	___wceex_get_file_mode
.subsections_via_symbols
