	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xdirname_r
_xdirname_r:                            ## @xdirname_r
	.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, %r14
	movl	$1, %r12d
	leaq	L_.str(%rip), %r13
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.1:
	movq	%rdi, %rbx
	cmpb	$0, (%rdi)
	je	LBB0_15
## %bb.2:
	movq	%rbx, %rdi
	callq	_strlen
	cltq
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$1, %rax
	je	LBB0_21
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	-1(%rax), %rdx
	cmpb	$47, -1(%rbx,%rax)
	movq	%rdx, %rax
	je	LBB0_3
## %bb.5:
	leaq	(%rbx,%rdx), %rax
	cmpq	%rbx, %rax
	jbe	LBB0_10
## %bb.6:
	movq	%rax, %rcx
	subq	%rdx, %rcx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	cmpb	$47, (%rax)
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	decq	%rax
	cmpq	%rbx, %rax
	ja	LBB0_7
## %bb.9:
	movq	%rcx, %rax
LBB0_10:
	movq	%rax, %rcx
	subq	%rbx, %rcx
	je	LBB0_21
## %bb.11:
	decq	%rax
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	%rcx, %r12
	cmpq	%rbx, %rax
	jbe	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	leaq	-1(%r12), %rcx
	cmpb	$47, (%rax)
	leaq	-1(%rax), %rax
	je	LBB0_12
LBB0_14:
	movq	%rbx, %r13
	jmp	LBB0_15
LBB0_21:
	cmpb	$47, (%rbx)
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str(%rip), %r13
	cmoveq	%rax, %r13
LBB0_15:
	testq	%r14, %r14
	je	LBB0_20
## %bb.16:
	testq	%r15, %r15
	je	LBB0_20
## %bb.17:
	decq	%r15
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_MIN
	movq	%rax, %rbx
	cmpq	%r14, %r13
	je	LBB0_19
## %bb.18:
	movq	%r14, %rdi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	callq	_memcpy
LBB0_19:
	movb	$0, (%r14,%rbx)
LBB0_20:
	movq	%r12, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"."

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

	.no_dead_strip	_xdirname_r
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xdirname_r
_xdirname_r:                            ; @xdirname_r
	.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	x21, x2
	mov	x19, x1
	cbz	x0, LBB0_14
; %bb.1:
	mov	x20, x0
	ldrb	w8, [x0]
Lloh0:
	adrp	x23, l_.str@PAGE
Lloh1:
	add	x23, x23, l_.str@PAGEOFF
	cbz	w8, LBB0_22
; %bb.2:
	mov	x0, x20
	bl	_strlen
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	subs	x9, x8, #1
	b.eq	LBB0_15
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x8, x20, x8
	ldurb	w10, [x8, #-1]
	mov	x8, x9
	cmp	w10, #47
	b.eq	LBB0_3
; %bb.5:
	add	x8, x20, x9
	cmp	x8, x20
	b.ls	LBB0_10
; %bb.6:
	sub	x9, x8, x9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldrb	w10, [x8]
	cmp	w10, #47
	b.eq	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	sub	x8, x8, #1
	cmp	x8, x20
	b.hi	LBB0_7
; %bb.9:
	mov	x8, x9
LBB0_10:
	subs	x9, x8, x20
	b.eq	LBB0_15
; %bb.11:
	sub	x8, x8, #1
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	mov	x22, x9
	cmp	x8, x20
	b.ls	LBB0_16
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldrb	w10, [x8], #-1
	sub	x9, x22, #1
	cmp	w10, #47
	b.eq	LBB0_12
	b	LBB0_16
LBB0_14:
Lloh2:
	adrp	x20, l_.str@PAGE
Lloh3:
	add	x20, x20, l_.str@PAGEOFF
	mov	w22, #1
	cbnz	x19, LBB0_17
	b	LBB0_21
LBB0_15:
	ldrb	w8, [x20]
Lloh4:
	adrp	x9, l_.str.1@PAGE
Lloh5:
	add	x9, x9, l_.str.1@PAGEOFF
	cmp	w8, #47
	csel	x20, x9, x23, eq
	mov	w22, #1
LBB0_16:
	cbz	x19, LBB0_21
LBB0_17:
	cbz	x21, LBB0_21
; %bb.18:
	sub	x1, x21, #1
	mov	x0, x22
	bl	_MIN
	mov	x21, x0
	cmp	x20, x19
	b.eq	LBB0_20
; %bb.19:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_memcpy
LBB0_20:
	strb	wzr, [x19, x21]
LBB0_21:
	mov	x0, x22
	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
LBB0_22:
	mov	w22, #1
	mov	x20, x23
	cbnz	x19, LBB0_17
	b	LBB0_21
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"."

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

	.no_dead_strip	_xdirname_r
.subsections_via_symbols
