	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function best_effort_strncat_to_utf16
_best_effort_strncat_to_utf16:          ## @best_effort_strncat_to_utf16
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r15d
	movq	%rdx, %r13
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	(%rdi), %rax
	leaq	(%rax,%rdx,2), %rsi
	addq	$2, %rsi
	callq	_archive_string_ensure
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	8(%r12), %rdx
	movq	(%r12), %rbx
	addq	%rdx, %rbx
	testq	%r13, %r13
	je	LBB0_3
## %bb.4:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	callq	_archive_le16enc
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	addq	$2, %rbx
	incq	%r12
	cmpq	%r12, %r13
	je	LBB0_11
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movsbl	(%r14,%r12), %esi
	testl	%esi, %esi
	jns	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	$-1, -44(%rbp)                  ## 4-byte Folded Spill
	movq	_UNICODE_R_CHAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	testl	%r15d, %r15d
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	callq	_archive_be16enc
	jmp	LBB0_10
LBB0_11:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	8(%r12), %rdx
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	jmp	LBB0_12
LBB0_1:
	movl	$-1, %eax
	jmp	LBB0_13
LBB0_3:
	xorl	%eax, %eax
LBB0_12:
	movq	%rbx, %rcx
	subq	%rdx, %rcx
	movq	%rcx, (%r12)
	movb	$0, (%rbx)
	movq	(%r12), %rdx
	movq	8(%r12), %rcx
	movb	$0, 1(%rdx,%rcx)
LBB0_13:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_UNICODE_R_CHAR,4,2             ## @UNICODE_R_CHAR
	.no_dead_strip	_best_effort_strncat_to_utf16
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function best_effort_strncat_to_utf16
_best_effort_strncat_to_utf16:          ; @best_effort_strncat_to_utf16
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x22, x4
	mov	x23, x2
	mov	x24, x1
	mov	x19, x0
	ldr	x8, [x0]
	add	x8, x8, x2, lsl #1
	add	x1, x8, #2
	bl	_archive_string_ensure
	cbz	x0, LBB0_8
; %bb.1:
	ldp	x9, x8, [x19]
	add	x21, x8, x9
	mov	w20, #0
	cbz	x23, LBB0_7
; %bb.2:
Lloh0:
	adrp	x25, _UNICODE_R_CHAR@GOTPAGE
Lloh1:
	ldr	x25, [x25, _UNICODE_R_CHAR@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	bl	_archive_le16enc
	add	x21, x21, #2
	cbz	x23, LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	sub	x23, x23, #1
	ldrsb	w8, [x24], #1
	ldr	w9, [x25]
	cmp	w8, #0
	csel	w1, w9, w8, lt
	csinv	w20, w20, wzr, ge
	mov	x0, x21
	cbz	w22, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_archive_be16enc
	add	x21, x21, #2
	cbnz	x23, LBB0_4
LBB0_6:
	ldr	x8, [x19, #8]
LBB0_7:
	sub	x8, x21, x8
	str	x8, [x19]
	strb	wzr, [x21]
	ldp	x9, x8, [x19]
	add	x8, x9, x8
	strb	wzr, [x8, #1]
	b	LBB0_9
LBB0_8:
	mov	w20, #-1
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_UNICODE_R_CHAR,4,2             ; @UNICODE_R_CHAR
	.no_dead_strip	_best_effort_strncat_to_utf16
.subsections_via_symbols
