	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_grapheme_strpos_utf16          ## -- Begin function grapheme_strpos_utf16
	.p2align	4, 0x90
_grapheme_strpos_utf16:                 ## @grapheme_strpos_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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %rbx
	movl	%r8d, -84(%rbp)                 ## 4-byte Spill
	movq	%rcx, -112(%rbp)                ## 8-byte Spill
	movq	%rdx, -104(%rbp)                ## 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	%rsp, -120(%rbp)                ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	$0, -64(%rbp)
	movq	$0, -80(%rbp)
	movl	$0, -56(%rbp)
	movl	$0, -68(%rbp)
	movq	_U_BRK_SAFECLONE_BUFFERSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.1:
	movl	$-1, (%rbx)
LBB0_2:
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	movq	_U_ZERO_ERROR@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	movl	%eax, -52(%rbp)
	leaq	-64(%rbp), %rdi
	leaq	-56(%rbp), %rsi
	leaq	-52(%rbp), %r13
	movq	%r15, %rdx
	movq	%r12, %rcx
	movq	%rbx, %r12
	movq	%r13, %r8
	callq	_intl_convert_utf8_to_utf16
	movl	-52(%rbp), %edi
	leaq	L_.str(%rip), %rsi
	callq	_STRPOS_CHECK_STATUS
	movl	(%rbx), %eax
	movl	%eax, -52(%rbp)
	leaq	-80(%rbp), %rdi
	leaq	-68(%rbp), %rsi
	movq	-104(%rbp), %rdx                ## 8-byte Reload
	movq	-112(%rbp), %rcx                ## 8-byte Reload
	movq	%r13, %r8
	callq	_intl_convert_utf8_to_utf16
	movl	-52(%rbp), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_STRPOS_CHECK_STATUS
	movl	(%rbx), %eax
	movl	%eax, -52(%rbp)
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_grapheme_get_break_iterator
	movq	%rax, %r15
	movl	-52(%rbp), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_STRPOS_CHECK_STATUS
	movl	(%rbx), %eax
	movl	%eax, -52(%rbp)
	movq	-64(%rbp), %rsi
	movl	-56(%rbp), %edx
	movq	%r15, %rdi
	movq	%r13, %rcx
	callq	_ubrk_setText
	movl	-52(%rbp), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_STRPOS_CHECK_STATUS
	movl	(%rbx), %eax
	movl	%eax, -52(%rbp)
	movq	-80(%rbp), %rdi
	movl	-68(%rbp), %esi
	movq	-64(%rbp), %rdx
	movl	-56(%rbp), %ecx
	subq	$8, %rsp
	leaq	L_.str.4(%rip), %r8
	movq	%r15, %r9
	pushq	%r13
	callq	_usearch_open
	addq	$16, %rsp
	movq	%rax, %r13
	movl	-52(%rbp), %edi
	leaq	L_.str.5(%rip), %rsi
	callq	_STRPOS_CHECK_STATUS
	cmpl	$0, 16(%rbp)
	je	LBB0_4
## %bb.3:
	movq	%r13, %rdi
	callq	_usearch_getCollator
	movl	(%r12), %ecx
	movl	%ecx, -52(%rbp)
	movq	_UCOL_STRENGTH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_UCOL_SECONDARY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leaq	-52(%rbp), %rcx
	movq	%rax, %rdi
	callq	_ucol_setAttribute
	movl	-52(%rbp), %edi
	leaq	L_.str.6(%rip), %rsi
	callq	_STRPOS_CHECK_STATUS
	movq	%r13, %rdi
	callq	_usearch_reset
LBB0_4:
	movl	24(%rbp), %ebx
	movl	-84(%rbp), %esi                 ## 4-byte Reload
	testl	%esi, %esi
	je	LBB0_5
## %bb.6:
	movq	%r15, %rdi
	callq	_grapheme_get_haystack_offset
	movl	%eax, %r14d
	cmpl	$-1, %eax
	jne	LBB0_8
## %bb.7:
	movq	_U_ILLEGAL_ARGUMENT_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%edi, -52(%rbp)
	leaq	L_.str.7(%rip), %rsi
	callq	_STRPOS_CHECK_STATUS
LBB0_8:
	movl	(%r12), %eax
	movl	%eax, -52(%rbp)
	leaq	-52(%rbp), %rdx
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_usearch_setOffset
	movl	-52(%rbp), %edi
	leaq	L_.str.7(%rip), %rsi
	callq	_STRPOS_CHECK_STATUS
	jmp	LBB0_9
LBB0_5:
	xorl	%r14d, %r14d
LBB0_9:
	leaq	-52(%rbp), %rsi
	movq	%r13, %rdi
	testl	%ebx, %ebx
	je	LBB0_12
## %bb.10:
	callq	_usearch_last
	movl	%eax, %ebx
	cmpl	%r14d, %eax
	jge	LBB0_13
## %bb.11:
	movq	_USEARCH_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_13
LBB0_12:
	callq	_usearch_next
	movl	%eax, %ebx
LBB0_13:
	movl	-52(%rbp), %edi
	leaq	L_.str.8(%rip), %rsi
	callq	_STRPOS_CHECK_STATUS
	movq	_USEARCH_DONE@GOTPCREL(%rip), %rax
	movl	$-1, %r14d
	cmpl	(%rax), %ebx
	je	LBB0_17
## %bb.14:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_ubrk_isBoundary
	testq	%rax, %rax
	je	LBB0_17
## %bb.15:
	movq	-64(%rbp), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_grapheme_count_graphemes
	movl	%eax, %r14d
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:
	movl	%ebx, (%rax)
LBB0_17:
	movq	-64(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_19
## %bb.18:
	callq	_efree
LBB0_19:
	movq	-80(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_21
## %bb.20:
	callq	_efree
LBB0_21:
	movq	%r15, %rdi
	callq	_ubrk_close
	movq	%r13, %rdi
	callq	_usearch_close
	movq	-120(%rbp), %rsp                ## 8-byte Reload
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_23
## %bb.22:
	movl	%r14d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_23:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_U_BRK_SAFECLONE_BUFFERSIZE,4,2 ## @U_BRK_SAFECLONE_BUFFERSIZE
	.comm	_U_ZERO_ERROR,4,2               ## @U_ZERO_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error converting input string to UTF-16"

L_.str.1:                               ## @.str.1
	.asciz	"Error converting needle string to UTF-16"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to get iterator"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to set up iterator"

L_.str.4:                               ## @.str.4
	.space	1

L_.str.5:                               ## @.str.5
	.asciz	"Error creating search object"

	.comm	_UCOL_STRENGTH,4,2              ## @UCOL_STRENGTH
	.comm	_UCOL_SECONDARY,4,2             ## @UCOL_SECONDARY
L_.str.6:                               ## @.str.6
	.asciz	"Error setting collation strength"

	.comm	_U_ILLEGAL_ARGUMENT_ERROR,4,2   ## @U_ILLEGAL_ARGUMENT_ERROR
L_.str.7:                               ## @.str.7
	.asciz	"Invalid search offset"

	.comm	_USEARCH_DONE,4,2               ## @USEARCH_DONE
L_.str.8:                               ## @.str.8
	.asciz	"Error looking up string"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_grapheme_strpos_utf16          ; -- Begin function grapheme_strpos_utf16
	.p2align	2
_grapheme_strpos_utf16:                 ; @grapheme_strpos_utf16
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #48
	mov	x21, x7
	mov	x24, x6
	mov	x19, x5
	mov	x23, x4
	mov	x20, x3
	mov	x22, x2
	mov	x3, x1
	mov	x2, x0
	mov	x26, sp
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	stp	xzr, xzr, [x29, #-104]
	stur	xzr, [x29, #-112]
Lloh3:
	adrp	x8, _U_BRK_SAFECLONE_BUFFERSIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _U_BRK_SAFECLONE_BUFFERSIZE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x25, x9, x8
	mov	sp, x25
	cbz	x5, LBB0_2
; %bb.1:
	mov	w8, #-1
	str	w8, [x19]
LBB0_2:
Lloh8:
	adrp	x27, _U_ZERO_ERROR@GOTPAGE
Lloh9:
	ldr	x27, [x27, _U_ZERO_ERROR@GOTPAGEOFF]
	ldr	w8, [x27]
	stur	w8, [x29, #-116]
	sub	x0, x29, #96
	sub	x1, x29, #108
	sub	x4, x29, #116
	bl	_intl_convert_utf8_to_utf16
	ldur	w0, [x29, #-116]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	bl	_STRPOS_CHECK_STATUS
	ldr	w8, [x27]
	stur	w8, [x29, #-116]
	sub	x0, x29, #104
	sub	x1, x29, #112
	sub	x4, x29, #116
	mov	x2, x22
	mov	x3, x20
	bl	_intl_convert_utf8_to_utf16
	ldur	w0, [x29, #-116]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_STRPOS_CHECK_STATUS
	ldr	w8, [x27]
	stur	w8, [x29, #-116]
	sub	x1, x29, #116
	mov	x0, x25
	bl	_grapheme_get_break_iterator
	mov	x20, x0
	ldur	w0, [x29, #-116]
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_STRPOS_CHECK_STATUS
	ldr	w8, [x27]
	stur	w8, [x29, #-116]
	ldur	x1, [x29, #-96]
	ldur	w2, [x29, #-108]
	sub	x3, x29, #116
	mov	x0, x20
	bl	_ubrk_setText
	ldur	w0, [x29, #-116]
Lloh16:
	adrp	x1, l_.str.3@PAGE
Lloh17:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_STRPOS_CHECK_STATUS
	ldr	w8, [x27]
	stur	w8, [x29, #-116]
	ldp	x0, x2, [x29, #-104]
	ldp	w1, w3, [x29, #-112]
Lloh18:
	adrp	x4, l_.str.4@PAGE
Lloh19:
	add	x4, x4, l_.str.4@PAGEOFF
	sub	x6, x29, #116
	mov	x5, x20
	bl	_usearch_open
	mov	x22, x0
	ldur	w0, [x29, #-116]
Lloh20:
	adrp	x1, l_.str.5@PAGE
Lloh21:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_STRPOS_CHECK_STATUS
	cbz	w24, LBB0_4
; %bb.3:
	mov	x0, x22
	bl	_usearch_getCollator
	ldr	w8, [x27]
	stur	w8, [x29, #-116]
Lloh22:
	adrp	x8, _UCOL_STRENGTH@GOTPAGE
Lloh23:
	ldr	x8, [x8, _UCOL_STRENGTH@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
Lloh25:
	adrp	x8, _UCOL_SECONDARY@GOTPAGE
Lloh26:
	ldr	x8, [x8, _UCOL_SECONDARY@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x8]
	sub	x3, x29, #116
	bl	_ucol_setAttribute
	ldur	w0, [x29, #-116]
Lloh28:
	adrp	x1, l_.str.6@PAGE
Lloh29:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_STRPOS_CHECK_STATUS
	mov	x0, x22
	bl	_usearch_reset
LBB0_4:
	cbz	w23, LBB0_8
; %bb.5:
	mov	x0, x20
	mov	x1, x23
	bl	_grapheme_get_haystack_offset
	mov	x23, x0
	cmn	w0, #1
	b.ne	LBB0_7
; %bb.6:
Lloh30:
	adrp	x8, _U_ILLEGAL_ARGUMENT_ERROR@GOTPAGE
Lloh31:
	ldr	x8, [x8, _U_ILLEGAL_ARGUMENT_ERROR@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
	stur	w0, [x29, #-116]
Lloh33:
	adrp	x1, l_.str.7@PAGE
Lloh34:
	add	x1, x1, l_.str.7@PAGEOFF
	bl	_STRPOS_CHECK_STATUS
LBB0_7:
	ldr	w8, [x27]
	stur	w8, [x29, #-116]
	sub	x2, x29, #116
	mov	x0, x22
	mov	x1, x23
	bl	_usearch_setOffset
	ldur	w0, [x29, #-116]
Lloh35:
	adrp	x1, l_.str.7@PAGE
Lloh36:
	add	x1, x1, l_.str.7@PAGEOFF
	bl	_STRPOS_CHECK_STATUS
LBB0_8:
Lloh37:
	adrp	x24, _USEARCH_DONE@GOTPAGE
Lloh38:
	ldr	x24, [x24, _USEARCH_DONE@GOTPAGEOFF]
	sub	x1, x29, #116
	mov	x0, x22
	cbz	w21, LBB0_10
; %bb.9:
	bl	_usearch_last
	ldr	w8, [x24]
	cmp	w0, w23
	csel	w23, w8, w0, lt
	b	LBB0_11
LBB0_10:
	bl	_usearch_next
	mov	x23, x0
LBB0_11:
	ldur	w0, [x29, #-116]
Lloh39:
	adrp	x1, l_.str.8@PAGE
Lloh40:
	add	x1, x1, l_.str.8@PAGEOFF
	bl	_STRPOS_CHECK_STATUS
	ldr	w8, [x24]
	cmp	w23, w8
	b.eq	LBB0_21
; %bb.12:
	mov	x0, x20
	mov	x1, x23
	bl	_ubrk_isBoundary
	cbz	x0, LBB0_21
; %bb.13:
	ldur	x1, [x29, #-96]
	mov	x0, x20
	mov	x2, x23
	bl	_grapheme_count_graphemes
	mov	x21, x0
	cbz	x19, LBB0_15
; %bb.14:
	str	w23, [x19]
LBB0_15:
	ldur	x0, [x29, #-96]
	cbz	x0, LBB0_17
LBB0_16:
	bl	_efree
LBB0_17:
	ldur	x0, [x29, #-104]
	cbz	x0, LBB0_19
; %bb.18:
	bl	_efree
LBB0_19:
	mov	x0, x20
	bl	_ubrk_close
	mov	x0, x22
	bl	_usearch_close
	mov	sp, x26
	ldur	x8, [x29, #-88]
Lloh41:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh42:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh43:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_22
; %bb.20:
	mov	x0, x21
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_21:
	mov	w21, #-1
	ldur	x0, [x29, #-96]
	cbnz	x0, LBB0_16
	b	LBB0_17
LBB0_22:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_U_BRK_SAFECLONE_BUFFERSIZE,4,2 ; @U_BRK_SAFECLONE_BUFFERSIZE
	.comm	_U_ZERO_ERROR,4,2               ; @U_ZERO_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error converting input string to UTF-16"

l_.str.1:                               ; @.str.1
	.asciz	"Error converting needle string to UTF-16"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to get iterator"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to set up iterator"

l_.str.4:                               ; @.str.4
	.space	1

l_.str.5:                               ; @.str.5
	.asciz	"Error creating search object"

	.comm	_UCOL_STRENGTH,4,2              ; @UCOL_STRENGTH
	.comm	_UCOL_SECONDARY,4,2             ; @UCOL_SECONDARY
l_.str.6:                               ; @.str.6
	.asciz	"Error setting collation strength"

	.comm	_U_ILLEGAL_ARGUMENT_ERROR,4,2   ; @U_ILLEGAL_ARGUMENT_ERROR
l_.str.7:                               ; @.str.7
	.asciz	"Invalid search offset"

	.comm	_USEARCH_DONE,4,2               ; @USEARCH_DONE
l_.str.8:                               ; @.str.8
	.asciz	"Error looking up string"

.subsections_via_symbols
