	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rewinddir                      ## -- Begin function rewinddir
	.p2align	4, 0x90
_rewinddir:                             ## @rewinddir
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	___isthreaded@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	je	LBB0_2
## %bb.1:
	leaq	4(%rbx), %rdi
	callq	__pthread_mutex_lock
LBB0_2:
	movq	___DTF_SKIPREAD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	(%rbx), %eax
	movl	%eax, (%rbx)
	movq	___DTF_READALL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	__filldir
	jmp	LBB0_5
LBB0_4:
	movl	24(%rbx), %edi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_lseek
	movq	$0, 16(%rbx)
LBB0_5:
	movq	$0, 8(%rbx)
	movq	%rbx, %rdi
	callq	__reclaim_telldir
	cmpq	$0, (%r14)
	je	LBB0_6
## %bb.7:
	addq	$4, %rbx
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	__pthread_mutex_unlock          ## TAILCALL
LBB0_6:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	___isthreaded,8,3               ## @__isthreaded
	.comm	___DTF_SKIPREAD,4,2             ## @__DTF_SKIPREAD
	.comm	___DTF_READALL,4,2              ## @__DTF_READALL
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rewinddir                      ; -- Begin function rewinddir
	.p2align	2
_rewinddir:                             ; @rewinddir
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x20, ___isthreaded@GOTPAGE
Lloh1:
	ldr	x20, [x20, ___isthreaded@GOTPAGEOFF]
	ldr	x8, [x20]
	cbz	x8, LBB0_2
; %bb.1:
	add	x0, x19, #4
	bl	__pthread_mutex_lock
LBB0_2:
Lloh2:
	adrp	x8, ___DTF_SKIPREAD@GOTPAGE
Lloh3:
	ldr	x8, [x8, ___DTF_SKIPREAD@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
Lloh5:
	adrp	x9, ___DTF_READALL@GOTPAGE
Lloh6:
	ldr	x9, [x9, ___DTF_READALL@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	mov	x0, x19
	mov	w1, #0
	bl	__filldir
	b	LBB0_5
LBB0_4:
	ldr	w0, [x19, #24]
Lloh8:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_lseek
	str	xzr, [x19, #16]
LBB0_5:
	str	xzr, [x19, #8]
	mov	x0, x19
	bl	__reclaim_telldir
	ldr	x8, [x20]
	cbz	x8, LBB0_7
; %bb.6:
	add	x0, x19, #4
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	__pthread_mutex_unlock
LBB0_7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	___isthreaded,8,3               ; @__isthreaded
	.comm	___DTF_SKIPREAD,4,2             ; @__DTF_SKIPREAD
	.comm	___DTF_READALL,4,2              ; @__DTF_READALL
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
.subsections_via_symbols
