	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dir_notempty
_dir_notempty:                          ## @dir_notempty
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	_MAXPATHLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	movl	%ebx, %esi
	movq	%r12, %rcx
	callq	_snprintf
	movq	%r15, %rdi
	movl	$511, %esi                      ## imm = 0x1FF
	callq	_rump_sys_mkdir
	cmpl	$-1, %eax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rdi
	callq	_atf_tc_fail_errno
LBB0_2:
	leaq	L_.str.2(%rip), %rdx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movq	%r12, %rcx
	callq	_snprintf
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movq	_O_CREAT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	%r14, %rdi
	movl	$511, %edx                      ## imm = 0x1FF
	callq	_rump_sys_open
	movl	%eax, %ebx
	cmpl	$-1, %eax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.3(%rip), %rdi
	callq	_atf_tc_fail_errno
LBB0_4:
	movl	%ebx, %edi
	callq	_rump_sys_close
	movq	%r15, %rdi
	callq	_rump_sys_rmdir
	cmpl	$-1, %eax
	jne	LBB0_6
## %bb.5:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ENOTEMPTY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
LBB0_6:
	leaq	L_.str.4(%rip), %rdi
	callq	_atf_tc_fail
LBB0_7:
	movq	%r14, %rdi
	callq	_rump_sys_unlink
	cmpl	$-1, %eax
	jne	LBB0_9
## %bb.8:
	leaq	L_.str.5(%rip), %rdi
	callq	_atf_tc_fail_errno
LBB0_9:
	movq	%r15, %rdi
	callq	_rump_sys_rmdir
	cmpl	$-1, %eax
	jne	LBB0_11
## %bb.10:
	leaq	L_.str.6(%rip), %rdi
	callq	_atf_tc_fail_errno
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_13
## %bb.12:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAXPATHLEN,4,2                 ## @MAXPATHLEN
	.comm	_USES_DIRS,4,2                  ## @USES_DIRS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s/dir"

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

L_.str.2:                               ## @.str.2
	.asciz	"%s/dir/file"

	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_CREAT,4,2                    ## @O_CREAT
L_.str.3:                               ## @.str.3
	.asciz	"create file"

	.comm	_errno,8,3                      ## @errno
	.comm	_ENOTEMPTY,8,3                  ## @ENOTEMPTY
L_.str.4:                               ## @.str.4
	.asciz	"non-empty directory removed succesfully"

L_.str.5:                               ## @.str.5
	.asciz	"cannot remove dir/file"

L_.str.6:                               ## @.str.6
	.asciz	"remove directory"

	.no_dead_strip	_dir_notempty
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dir_notempty
_dir_notempty:                          ; @dir_notempty
	.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
	sub	sp, sp, #16
	mov	x21, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
Lloh3:
	adrp	x8, _MAXPATHLEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAXPATHLEN@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
	mov	x9, x22
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x22, #15
	and	x12, x9, #0x1fffffff0
	sub	x19, x8, x12
	mov	sp, x19
	mov	x9, x22
Lloh8:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh9:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	sub	x20, x8, x12
	mov	sp, x20
Lloh10:
	adrp	x2, l_.str@PAGE
Lloh11:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	x1, x22
	mov	x3, x21
	bl	_snprintf
	mov	x0, x19
	mov	w1, #511
	bl	_rump_sys_mkdir
	cmn	w0, #1
	b.ne	LBB0_2
; %bb.1:
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_atf_tc_fail_errno
LBB0_2:
Lloh14:
	adrp	x2, l_.str.2@PAGE
Lloh15:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	x1, x22
	mov	x3, x21
	bl	_snprintf
Lloh16:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh17:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
Lloh19:
	adrp	x9, _O_CREAT@GOTPAGE
Lloh20:
	ldr	x9, [x9, _O_CREAT@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	x0, x20
	mov	w2, #511
	bl	_rump_sys_open
	mov	x21, x0
	cmn	w0, #1
	b.ne	LBB0_4
; %bb.3:
Lloh22:
	adrp	x0, l_.str.3@PAGE
Lloh23:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_atf_tc_fail_errno
LBB0_4:
	mov	x0, x21
	bl	_rump_sys_close
	mov	x0, x19
	bl	_rump_sys_rmdir
	cmn	w0, #1
	b.ne	LBB0_6
; %bb.5:
Lloh24:
	adrp	x8, _errno@GOTPAGE
Lloh25:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
Lloh27:
	adrp	x9, _ENOTEMPTY@GOTPAGE
Lloh28:
	ldr	x9, [x9, _ENOTEMPTY@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_7
LBB0_6:
Lloh30:
	adrp	x0, l_.str.4@PAGE
Lloh31:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_atf_tc_fail
LBB0_7:
	mov	x0, x20
	bl	_rump_sys_unlink
	cmn	w0, #1
	b.ne	LBB0_9
; %bb.8:
Lloh32:
	adrp	x0, l_.str.5@PAGE
Lloh33:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_atf_tc_fail_errno
LBB0_9:
	mov	x0, x19
	bl	_rump_sys_rmdir
	cmn	w0, #1
	b.ne	LBB0_11
; %bb.10:
Lloh34:
	adrp	x0, l_.str.6@PAGE
Lloh35:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_atf_tc_fail_errno
LBB0_11:
	ldur	x8, [x29, #-40]
Lloh36:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh37:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh38:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	sub	sp, x29, #32
	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_13:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_MAXPATHLEN,4,2                 ; @MAXPATHLEN
	.comm	_USES_DIRS,4,2                  ; @USES_DIRS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s/dir"

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

l_.str.2:                               ; @.str.2
	.asciz	"%s/dir/file"

	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_CREAT,4,2                    ; @O_CREAT
l_.str.3:                               ; @.str.3
	.asciz	"create file"

	.comm	_errno,8,3                      ; @errno
	.comm	_ENOTEMPTY,8,3                  ; @ENOTEMPTY
l_.str.4:                               ; @.str.4
	.asciz	"non-empty directory removed succesfully"

l_.str.5:                               ; @.str.5
	.asciz	"cannot remove dir/file"

l_.str.6:                               ; @.str.6
	.asciz	"remove directory"

	.no_dead_strip	_dir_notempty
.subsections_via_symbols
