	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rst_seekdir
_rst_seekdir:                           ## @rst_seekdir
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %r14
	callq	_rst_telldir
	cmpq	%rbx, %rax
	je	LBB0_5
## %bb.1:
	subq	%r15, %rbx
	jns	LBB0_3
## %bb.2:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdx
	callq	_fprintf
LBB0_3:
	movl	12(%r14), %r12d
	movq	_DIRBLKSIZ@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_rounddown2
	addq	%rax, %r15
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r12d, %edi
	movq	%r15, %rsi
	callq	_lseek
	movslq	(%r13), %rdx
	leaq	-1(%rdx), %rax
	andq	%rbx, %rax
	movq	%rax, (%r14)
	je	LBB0_5
## %bb.4:
	movl	8(%r14), %esi
	movl	12(%r14), %edi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_read
	movl	%eax, 16(%r14)
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bad seek pointer to rst_seekdir %ld\n"

	.comm	_DIRBLKSIZ,4,2                  ## @DIRBLKSIZ
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.no_dead_strip	_rst_seekdir
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rst_seekdir
_rst_seekdir:                           ; @rst_seekdir
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	bl	_rst_telldir
	cmp	x0, x21
	b.eq	LBB0_5
; %bb.1:
	subs	x21, x21, x20
	b.pl	LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _stderr@GOTPAGE
Lloh1:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_fprintf
LBB0_3:
	ldr	w22, [x19, #12]
Lloh5:
	adrp	x23, _DIRBLKSIZ@GOTPAGE
Lloh6:
	ldr	x23, [x23, _DIRBLKSIZ@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x21
	bl	_rounddown2
	add	x1, x0, x20
Lloh7:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	mov	x0, x22
	bl	_lseek
	ldrsw	x2, [x23]
	sub	x8, x2, #1
	ands	x8, x21, x8
	str	x8, [x19]
	b.eq	LBB0_5
; %bb.4:
	ldp	w1, w0, [x19, #8]
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_read
	str	w0, [x19, #16]
LBB0_5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bad seek pointer to rst_seekdir %ld\n"

	.comm	_DIRBLKSIZ,4,2                  ; @DIRBLKSIZ
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.no_dead_strip	_rst_seekdir
.subsections_via_symbols
