	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_remove_entry_from_dir          ## -- Begin function remove_entry_from_dir
	.p2align	4, 0x90
_remove_entry_from_dir:                 ## @remove_entry_from_dir
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	callq	_strlen
	movl	%eax, %r15d
	movslq	%eax, %rsi
	cmpb	$47, -1(%r14,%rsi)
	jne	LBB0_2
## %bb.1:
	decq	%rsi
	movq	%r14, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_xmemdupz
	movq	%rax, %r12
	movq	%rbx, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_find_containing_dir
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_free
	jmp	LBB0_3
LBB0_2:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_find_containing_dir
	movq	%rax, %rbx
LBB0_3:
	movl	$-1, %r12d
	testq	%rbx, %rbx
	je	LBB0_8
## %bb.4:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_search_ref_dir
	cmpl	$-1, %eax
	je	LBB0_8
## %bb.5:
	movl	%eax, %r15d
	movq	8(%rbx), %rax
	movslq	%r15d, %rcx
	leaq	(%rax,%rcx,8), %rdi
	movq	(%rax,%rcx,8), %r14
	leaq	(%rax,%rcx,8), %rsi
	addq	$8, %rsi
	movl	%r15d, %edx
	notl	%edx
	addl	(%rbx), %edx
	callq	_MOVE_ARRAY
	decl	(%rbx)
	movl	4(%rbx), %eax
	cmpl	%r15d, %eax
	jle	LBB0_7
## %bb.6:
	decl	%eax
	movl	%eax, 4(%rbx)
LBB0_7:
	movq	%r14, %rdi
	callq	_free_ref_entry
	movl	(%rbx), %r12d
LBB0_8:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_remove_entry_from_dir          ; -- Begin function remove_entry_from_dir
	.p2align	2
_remove_entry_from_dir:                 ; @remove_entry_from_dir
	.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
	mov	x19, x1
	mov	x20, x0
	mov	x0, x1
	bl	_strlen
	mov	x21, x0
	sxtw	x8, w21
	sub	x1, x8, #1
	ldrb	w8, [x19, x1]
	cmp	w8, #47
	b.ne	LBB0_6
; %bb.1:
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_xmemdupz
	mov	x22, x0
	mov	x0, x20
	mov	x1, x22
	mov	w2, #0
	bl	_find_containing_dir
	mov	x20, x0
	mov	x0, x22
	bl	_free
	cbz	x20, LBB0_7
LBB0_2:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	bl	_search_ref_dir
	cmn	w0, #1
	b.eq	LBB0_8
; %bb.3:
	mov	x21, x0
	ldr	x8, [x20, #8]
	add	x0, x8, w0, sxtw #3
	mov	x1, x0
	ldr	x19, [x1], #8
	ldr	w8, [x20]
	mvn	w9, w21
	add	w2, w8, w9
	bl	_MOVE_ARRAY
	ldp	w9, w8, [x20]
	sub	w9, w9, #1
	str	w9, [x20]
	cmp	w8, w21
	b.le	LBB0_5
; %bb.4:
	sub	w8, w8, #1
	str	w8, [x20, #4]
LBB0_5:
	mov	x0, x19
	bl	_free_ref_entry
	ldr	w0, [x20]
	b	LBB0_8
LBB0_6:
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	bl	_find_containing_dir
	mov	x20, x0
	cbnz	x20, LBB0_2
LBB0_7:
	mov	w0, #-1
LBB0_8:
	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
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
