	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function test
_test:                                  ## @test
	.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
	movq	%rdi, %r15
	movl	$4, %esi
	callq	_access
	testq	%rax, %rax
	js	LBB0_4
## %bb.1:
	movq	_statb@GOTPCREL(%rip), %rbx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_stat
	testq	%rax, %rax
	js	LBB0_5
## %bb.2:
	movq	_S_IFMT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%rbx), %eax
	movq	_S_IFDIR@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_6
## %bb.3:
	movq	_progname@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_16
LBB0_4:
	movq	_progname@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_16
LBB0_5:
	movq	_progname@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_16
LBB0_6:
	cmpq	$0, 8(%rbx)
	je	LBB0_14
## %bb.7:
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_open
	testl	%eax, %eax
	js	LBB0_15
## %bb.8:
	movl	%eax, %r14d
	leaq	-32(%rbp), %rsi
	movl	%eax, %edi
	movl	$4, %edx
	callq	_read
	cmpl	$4, %eax
	jne	LBB0_10
## %bb.9:
	movl	-32(%rbp), %edi
	callq	_N_BADMAG
	testl	%eax, %eax
	je	LBB0_20
LBB0_10:
	movl	%r14d, %edi
	callq	_close
	movq	_rflag@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_19
## %bb.11:
	movq	%r15, %rdi
	movl	$47, %esi
	callq	_strrchr
	testq	%rax, %rax
	je	LBB0_21
## %bb.12:
	movq	%rax, %rbx
	subq	%r15, %rbx
	je	LBB0_23
## %bb.13:
	incq	%rbx
	movq	%rbx, %rdi
	callq	_malloc
	movq	%rax, %r14
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_strlcpy
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_checkwriteperm
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_free
	jmp	LBB0_24
LBB0_14:
	movq	_progname@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_16
LBB0_15:
	movq	_progname@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	L_.str.4(%rip), %rdi
LBB0_16:
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_printf
LBB0_17:
	movl	$-1, %ebx
LBB0_18:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	xorl	%ebx, %ebx
	jmp	LBB0_18
LBB0_20:
	movq	_progname@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	L_.str.5(%rip), %rdi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_printf
	leaq	L_str(%rip), %rdi
	callq	_puts
	movl	%r14d, %edi
	callq	_close
	jmp	LBB0_17
LBB0_21:
	leaq	L_.str.6(%rip), %rsi
	movq	%r15, %rdi
	callq	_checkwriteperm
	testl	%eax, %eax
	jne	LBB0_25
LBB0_22:
	movl	$1, %ebx
	jmp	LBB0_18
LBB0_23:
	leaq	L_.str.7(%rip), %rsi
	movq	%r15, %rdi
	callq	_checkwriteperm
	movl	%eax, %ebx
LBB0_24:
	testl	%ebx, %ebx
	je	LBB0_22
LBB0_25:
	movq	_progname@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	L_.str.8(%rip), %rdi
	xorl	%ebx, %ebx
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: cannot access %s\n"

	.comm	_progname,8,3                   ## @progname
	.comm	_statb,16,3                     ## @statb
L_.str.1:                               ## @.str.1
	.asciz	"%s: cannot stat %s\n"

	.comm	_S_IFMT,4,2                     ## @S_IFMT
	.comm	_S_IFDIR,4,2                    ## @S_IFDIR
L_.str.2:                               ## @.str.2
	.asciz	"%s: %s is a directory\n"

L_.str.3:                               ## @.str.3
	.asciz	"%s: %s is an empty file\n"

	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
L_.str.4:                               ## @.str.4
	.asciz	"%s: cannot open %s\n"

L_.str.5:                               ## @.str.5
	.asciz	"%s: %s is an executable program"

	.comm	_rflag,8,3                      ## @rflag
L_.str.6:                               ## @.str.6
	.asciz	"."

L_.str.7:                               ## @.str.7
	.asciz	"/"

L_.str.8:                               ## @.str.8
	.asciz	"%s: %s: is not removable by you\n"

L_str:                                  ## @str
	.asciz	" and is unprintable"

	.no_dead_strip	_test
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function test
_test:                                  ; @test
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	w1, #4
	bl	_access
	tbnz	x0, #63, LBB0_4
; %bb.1:
Lloh0:
	adrp	x20, _statb@GOTPAGE
Lloh1:
	ldr	x20, [x20, _statb@GOTPAGEOFF]
	mov	x0, x19
	mov	x1, x20
	bl	_stat
	tbnz	x0, #63, LBB0_5
; %bb.2:
	ldr	w8, [x20]
Lloh2:
	adrp	x9, _S_IFMT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _S_IFMT@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh5:
	adrp	x9, _S_IFDIR@GOTPAGE
Lloh6:
	ldr	x9, [x9, _S_IFDIR@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_6
; %bb.3:
Lloh8:
	adrp	x8, _progname@GOTPAGE
Lloh9:
	ldr	x8, [x8, _progname@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	stp	x8, x19, [sp]
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_16
LBB0_4:
Lloh13:
	adrp	x8, _progname@GOTPAGE
Lloh14:
	ldr	x8, [x8, _progname@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	stp	x8, x19, [sp]
Lloh16:
	adrp	x0, l_.str@PAGE
Lloh17:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_16
LBB0_5:
Lloh18:
	adrp	x8, _progname@GOTPAGE
Lloh19:
	ldr	x8, [x8, _progname@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	stp	x8, x19, [sp]
Lloh21:
	adrp	x0, l_.str.1@PAGE
Lloh22:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_16
LBB0_6:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_14
; %bb.7:
Lloh23:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh24:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_open
	tbnz	w0, #31, LBB0_15
; %bb.8:
	mov	x20, x0
	add	x1, sp, #24
	mov	w2, #4
	bl	_read
	cmp	w0, #4
	b.ne	LBB0_10
; %bb.9:
	ldr	w0, [sp, #24]
	bl	_N_BADMAG
	cbz	w0, LBB0_19
LBB0_10:
	mov	x0, x20
	bl	_close
Lloh26:
	adrp	x8, _rflag@GOTPAGE
Lloh27:
	ldr	x8, [x8, _rflag@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	cbz	x8, LBB0_25
; %bb.11:
	mov	x0, x19
	mov	w1, #47
	bl	_strrchr
	cbz	x0, LBB0_20
; %bb.12:
	subs	x8, x0, x19
	b.eq	LBB0_22
; %bb.13:
	add	x20, x8, #1
	mov	x0, x20
	bl	_malloc
	mov	x21, x0
	mov	x1, x19
	mov	x2, x20
	bl	_strlcpy
	mov	x0, x19
	mov	x1, x21
	bl	_checkwriteperm
	mov	x20, x0
	mov	x0, x21
	bl	_free
	b	LBB0_23
LBB0_14:
Lloh29:
	adrp	x8, _progname@GOTPAGE
Lloh30:
	ldr	x8, [x8, _progname@GOTPAGEOFF]
Lloh31:
	ldr	x8, [x8]
	stp	x8, x19, [sp]
Lloh32:
	adrp	x0, l_.str.3@PAGE
Lloh33:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_16
LBB0_15:
Lloh34:
	adrp	x8, _progname@GOTPAGE
Lloh35:
	ldr	x8, [x8, _progname@GOTPAGEOFF]
Lloh36:
	ldr	x8, [x8]
	stp	x8, x19, [sp]
Lloh37:
	adrp	x0, l_.str.4@PAGE
Lloh38:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_16:
	bl	_printf
LBB0_17:
	mov	w0, #-1
LBB0_18:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_19:
Lloh39:
	adrp	x8, _progname@GOTPAGE
Lloh40:
	ldr	x8, [x8, _progname@GOTPAGEOFF]
Lloh41:
	ldr	x8, [x8]
	stp	x8, x19, [sp]
Lloh42:
	adrp	x0, l_.str.5@PAGE
Lloh43:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_printf
Lloh44:
	adrp	x0, l_str@PAGE
Lloh45:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	mov	x0, x20
	bl	_close
	b	LBB0_17
LBB0_20:
Lloh46:
	adrp	x1, l_.str.6@PAGE
Lloh47:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_checkwriteperm
	cbnz	w0, LBB0_24
LBB0_21:
	mov	w0, #1
	b	LBB0_18
LBB0_22:
Lloh48:
	adrp	x1, l_.str.7@PAGE
Lloh49:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x19
	bl	_checkwriteperm
	mov	x20, x0
LBB0_23:
	cbz	w20, LBB0_21
LBB0_24:
Lloh50:
	adrp	x8, _progname@GOTPAGE
Lloh51:
	ldr	x8, [x8, _progname@GOTPAGEOFF]
Lloh52:
	ldr	x8, [x8]
	stp	x8, x19, [sp]
Lloh53:
	adrp	x0, l_.str.8@PAGE
Lloh54:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_printf
LBB0_25:
	mov	w0, #0
	b	LBB0_18
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpAdd	Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: cannot access %s\n"

	.comm	_progname,8,3                   ; @progname
	.comm	_statb,16,3                     ; @statb
l_.str.1:                               ; @.str.1
	.asciz	"%s: cannot stat %s\n"

	.comm	_S_IFMT,4,2                     ; @S_IFMT
	.comm	_S_IFDIR,4,2                    ; @S_IFDIR
l_.str.2:                               ; @.str.2
	.asciz	"%s: %s is a directory\n"

l_.str.3:                               ; @.str.3
	.asciz	"%s: %s is an empty file\n"

	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
l_.str.4:                               ; @.str.4
	.asciz	"%s: cannot open %s\n"

l_.str.5:                               ; @.str.5
	.asciz	"%s: %s is an executable program"

	.comm	_rflag,8,3                      ; @rflag
l_.str.6:                               ; @.str.6
	.asciz	"."

l_.str.7:                               ; @.str.7
	.asciz	"/"

l_.str.8:                               ; @.str.8
	.asciz	"%s: %s: is not removable by you\n"

l_str:                                  ; @str
	.asciz	" and is unprintable"

	.no_dead_strip	_test
.subsections_via_symbols
