	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_directory
_read_directory:                        ## @read_directory
	.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	$1040, %rsp                     ## imm = 0x410
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	callq	_FSTEST_ENTER
	movq	_O_DIRECTORY@GOTPCREL(%rip), %rax
	movq	_O_RDONLY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	movl	$511, %edx                      ## imm = 0x1FF
	callq	_rump_sys_open
	movl	%eax, %ebx
	xorl	%edi, %edi
	cmpl	$-1, %eax
	setne	%dil
	callq	_ATF_REQUIRE
	leaq	-1072(%rbp), %r14
	movl	%ebx, %edi
	movq	%r14, %rsi
	movl	$1024, %edx                     ## imm = 0x400
	xorl	%ecx, %ecx
	callq	_rump_sys_pread
	cmpl	$-1, %eax
	setne	%al
	movq	_errno@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	movq	_EISDIR@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rcx
	sete	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_ATF_CHECK
	movl	%ebx, %edi
	movq	%r14, %rsi
	movl	$1024, %edx                     ## imm = 0x400
	callq	_rump_sys_read
	cmpl	$-1, %eax
	setne	%al
	movq	(%r15), %rcx
	cmpq	(%r12), %rcx
	sete	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_ATF_CHECK
	movl	%ebx, %edi
	callq	_rump_sys_close
	xorl	%edi, %edi
	cmpl	$-1, %eax
	setne	%dil
	callq	_ATF_REQUIRE
	xorl	%eax, %eax
	callq	_FSTEST_EXIT
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_2
## %bb.1:
	addq	$1040, %rsp                     ## imm = 0x410
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"."

	.comm	_O_DIRECTORY,4,2                ## @O_DIRECTORY
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_errno,8,3                      ## @errno
	.comm	_EISDIR,8,3                     ## @EISDIR
	.no_dead_strip	_read_directory
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_directory
_read_directory:                        ; @read_directory
	.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, #1040
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	bl	_FSTEST_ENTER
Lloh3:
	adrp	x8, _O_DIRECTORY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _O_DIRECTORY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _O_RDONLY@GOTPAGE
Lloh7:
	ldr	x9, [x9, _O_RDONLY@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w1, w9, w8
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	mov	w2, #511
	bl	_rump_sys_open
	mov	x19, x0
	cmn	w0, #1
	cset	w0, ne
	bl	_ATF_REQUIRE
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #1024
	mov	w3, #0
	bl	_rump_sys_pread
	cmn	w0, #1
Lloh11:
	adrp	x20, _errno@GOTPAGE
Lloh12:
	ldr	x20, [x20, _errno@GOTPAGEOFF]
	ldr	x8, [x20]
Lloh13:
	adrp	x21, _EISDIR@GOTPAGE
Lloh14:
	ldr	x21, [x21, _EISDIR@GOTPAGEOFF]
	ldr	x9, [x21]
	ccmp	x8, x9, #4, eq
	cset	w0, eq
	bl	_ATF_CHECK
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #1024
	bl	_rump_sys_read
	cmn	w0, #1
	ldr	x8, [x20]
	ldr	x9, [x21]
	ccmp	x8, x9, #4, eq
	cset	w0, eq
	bl	_ATF_CHECK
	mov	x0, x19
	bl	_rump_sys_close
	cmn	w0, #1
	cset	w0, ne
	bl	_ATF_REQUIRE
	bl	_FSTEST_EXIT
	ldur	x8, [x29, #-40]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_2
; %bb.1:
	add	sp, sp, #1040
	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_2:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"."

	.comm	_O_DIRECTORY,4,2                ; @O_DIRECTORY
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_errno,8,3                      ; @errno
	.comm	_EISDIR,8,3                     ; @EISDIR
	.no_dead_strip	_read_directory
.subsections_via_symbols
