	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___freebsd11_basename_r         ## -- Begin function __freebsd11_basename_r
	.p2align	4, 0x90
___freebsd11_basename_r:                ## @__freebsd11_basename_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	%rdi, %r15
	cmpb	$0, (%rdi)
	je	LBB0_2
## %bb.3:
	movq	%r15, %rdi
	callq	_strlen
	movslq	%eax, %rdx
	decq	%rdx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rdx, %rcx
	leaq	(%r15,%rdx), %rax
	cmpq	%r15, %rax
	jbe	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	leaq	-1(%rcx), %rdx
	cmpb	$47, (%rax)
	je	LBB0_4
LBB0_6:
	testq	%rcx, %rcx
	jne	LBB0_7
## %bb.12:
	cmpb	$47, (%r15)
	jne	LBB0_7
## %bb.13:
	movw	$47, (%r14)
	jmp	LBB0_15
LBB0_2:
	movw	$46, (%r14)
	jmp	LBB0_15
LBB0_7:
	movl	$1, %ecx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rax, %rsi
	movq	%rcx, %rbx
	cmpq	%r15, %rax
	jbe	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	leaq	-1(%rsi), %rax
	leaq	1(%rbx), %rcx
	cmpb	$47, -1(%rsi)
	jne	LBB0_8
LBB0_10:
	movq	_MAXPATHLEN@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jae	LBB0_11
## %bb.14:
	movq	%r14, %rdi
	movq	%rbx, %rdx
	callq	_memcpy
	movb	$0, (%r14,%rbx)
	jmp	LBB0_15
LBB0_11:
	movq	_ENAMETOOLONG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	xorl	%r14d, %r14d
LBB0_15:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAXPATHLEN,8,3                 ## @MAXPATHLEN
	.comm	_ENAMETOOLONG,4,2               ## @ENAMETOOLONG
	.comm	_errno,4,2                      ## @errno
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___freebsd11_basename_r         ; -- Begin function __freebsd11_basename_r
	.p2align	2
___freebsd11_basename_r:                ; @__freebsd11_basename_r
	.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
	cbz	x0, LBB0_8
; %bb.1:
	mov	x20, x0
	ldrb	w8, [x0]
	cbz	w8, LBB0_8
; %bb.2:
	mov	x0, x20
	bl	_strlen
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	sub	x10, x8, #1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x9, x10
	add	x8, x20, x10
	cmp	x8, x20
	b.ls	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldrb	w11, [x8]
	sub	x10, x9, #1
	cmp	w11, #47
	b.eq	LBB0_3
LBB0_5:
	cbnz	x9, LBB0_9
; %bb.6:
	ldrb	w9, [x20]
	cmp	w9, #47
	b.ne	LBB0_9
; %bb.7:
	mov	w8, #47
	strh	w8, [x19]
	b	LBB0_15
LBB0_8:
	mov	w8, #46
	strh	w8, [x19]
	b	LBB0_15
LBB0_9:
	mov	w9, #1
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	mov	x1, x8
	mov	x21, x9
	cmp	x8, x20
	b.ls	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x8, x1
	ldrb	w10, [x8, #-1]!
	add	x9, x21, #1
	cmp	w10, #47
	b.ne	LBB0_10
LBB0_12:
Lloh0:
	adrp	x8, _MAXPATHLEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAXPATHLEN@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x21, x8
	b.hs	LBB0_14
; %bb.13:
	mov	x0, x19
	mov	x2, x21
	bl	_memcpy
	strb	wzr, [x19, x21]
	b	LBB0_15
LBB0_14:
	mov	x19, #0
Lloh3:
	adrp	x8, _ENAMETOOLONG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENAMETOOLONG@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _errno@GOTPAGE
Lloh7:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh8:
	str	w8, [x9]
LBB0_15:
	mov	x0, x19
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MAXPATHLEN,8,3                 ; @MAXPATHLEN
	.comm	_ENAMETOOLONG,4,2               ; @ENAMETOOLONG
	.comm	_errno,4,2                      ; @errno
.subsections_via_symbols
