	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wine_fold_string               ## -- Begin function wine_fold_string
	.p2align	4, 0x90
_wine_fold_string:                      ## @wine_fold_string
	.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, %ebx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r15
	movl	%edi, %r13d
	cmpl	$-1, %edx
	je	LBB0_18
## %bb.1:
	testl	%ebx, %ebx
	je	LBB0_19
LBB0_2:
	movq	%r15, %rax
	xorl	%r15d, %r15d
	cmpl	%ebx, %edx
	jg	LBB0_26
## %bb.3:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	testl	%edx, %edx
	jle	LBB0_23
## %bb.4:
	movq	%rax, %r15
	subl	%edx, -44(%rbp)                 ## 4-byte Folded Spill
	movl	%edx, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, (%r14)
	addq	$8, %r14
	incq	%r12
	cmpl	%r12d, -64(%rbp)                ## 4-byte Folded Reload
	je	LBB0_23
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15,%r12,8), %rbx
	movq	_MAP_EXPAND_LIGATURES@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_14
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rdi
	callq	_get_ligature
	movq	(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_14
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r15, %rsi
	xorl	%r15d, %r15d
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%edi, %edx
	subl	$1, %edx
	jb	LBB0_26
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%rcx, (%r14)
	cmpq	$0, 16(%rax)
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	testl	%edx, %edx
	je	LBB0_26
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%rax, %rcx
	addq	$16, %rcx
	addl	$-2, %edi
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movq	8(%rax), %rax
	movq	%rax, 8(%r14)
	addq	$8, %r14
	jmp	LBB0_13
LBB0_12:                                ##   in Loop: Header=BB0_6 Depth=1
	addq	$8, %rax
	movq	%rax, %rcx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
LBB0_13:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	(%rcx), %rbx
	addq	$8, %r14
	movq	%rsi, %r15
LBB0_14:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	_MAP_FOLDDIGITS@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rdi
	callq	_to_unicode_digit
	movq	%rax, %rbx
LBB0_16:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	_MAP_FOLDCZONE@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_5
## %bb.17:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rdi
	callq	_to_unicode_native
	movq	%rax, %rbx
	jmp	LBB0_5
LBB0_18:
	movq	%r15, %rdi
	callq	_strlenW
	movl	%eax, %edx
	incl	%edx
	testl	%ebx, %ebx
	jne	LBB0_2
LBB0_19:
	movq	_MAP_EXPAND_LIGATURES@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_25
## %bb.20:
	testl	%edx, %edx
	je	LBB0_25
## %bb.21:
	movl	%edx, %r14d
	xorl	%ebx, %ebx
	movq	%r15, %r12
	movl	%edx, %r15d
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12,%rbx,8), %rdi
	callq	_get_ligature_len
	addl	%eax, %r15d
	incq	%rbx
	cmpl	%ebx, %r14d
	jne	LBB0_22
	jmp	LBB0_26
LBB0_23:
	subq	-56(%rbp), %r14                 ## 8-byte Folded Reload
	shrq	$3, %r14
	movl	%r14d, %r15d
	jmp	LBB0_26
LBB0_25:
	movl	%edx, %r15d
LBB0_26:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAP_EXPAND_LIGATURES,4,2       ## @MAP_EXPAND_LIGATURES
	.comm	_MAP_COMPOSITE,4,2              ## @MAP_COMPOSITE
	.comm	_MAP_PRECOMPOSED,4,2            ## @MAP_PRECOMPOSED
	.comm	_MAP_FOLDDIGITS,4,2             ## @MAP_FOLDDIGITS
	.comm	_MAP_FOLDCZONE,4,2              ## @MAP_FOLDCZONE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wine_fold_string               ; -- Begin function wine_fold_string
	.p2align	2
_wine_fold_string:                      ; @wine_fold_string
	.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
	mov	x23, x4
	mov	x21, x3
	mov	x19, x2
	mov	x20, x1
	mov	x22, x0
	cmn	w2, #1
	b.eq	LBB0_4
; %bb.1:
	cbz	w23, LBB0_5
LBB0_2:
	cmp	w19, w23
	b.le	LBB0_8
LBB0_3:
	mov	w19, #0
	b	LBB0_24
LBB0_4:
	mov	x0, x20
	bl	_strlenW
	add	w19, w0, #1
	cbnz	w23, LBB0_2
LBB0_5:
Lloh0:
	adrp	x8, _MAP_EXPAND_LIGATURES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAP_EXPAND_LIGATURES@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w8, w8, w22
	cmp	w8, #0
	ccmp	w19, #0, #4, ne
	b.eq	LBB0_24
; %bb.6:
	mov	x21, x19
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	sub	w21, w21, #1
	ldr	x0, [x20], #8
	bl	_get_ligature_len
	add	w19, w19, w0
	cbnz	w21, LBB0_7
	b	LBB0_24
LBB0_8:
	mov	x25, x21
	cmp	w19, #1
	b.lt	LBB0_23
; %bb.9:
Lloh3:
	adrp	x24, _MAP_EXPAND_LIGATURES@GOTPAGE
Lloh4:
	ldr	x24, [x24, _MAP_EXPAND_LIGATURES@GOTPAGEOFF]
	sub	w28, w23, w19
Lloh5:
	adrp	x26, _MAP_FOLDDIGITS@GOTPAGE
Lloh6:
	ldr	x26, [x26, _MAP_FOLDDIGITS@GOTPAGEOFF]
	mov	x25, x21
Lloh7:
	adrp	x27, _MAP_FOLDCZONE@GOTPAGE
Lloh8:
	ldr	x27, [x27, _MAP_FOLDCZONE@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	str	x23, [x25], #8
	add	x20, x20, #8
	subs	w19, w19, #1
	b.eq	LBB0_23
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x23, [x20]
	ldr	w8, [x24]
	tst	w8, w22
	b.eq	LBB0_19
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x23
	bl	_get_ligature
	ldr	x9, [x0]
	cbz	x9, LBB0_19
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	cbz	w28, LBB0_3
; %bb.14:                               ;   in Loop: Header=BB0_11 Depth=1
	sub	w8, w28, #1
	str	x9, [x25]
	mov	x9, x0
	ldr	x10, [x9, #16]!
	cbz	x10, LBB0_17
; %bb.15:                               ;   in Loop: Header=BB0_11 Depth=1
	cbz	w8, LBB0_3
; %bb.16:                               ;   in Loop: Header=BB0_11 Depth=1
	sub	w8, w28, #2
	ldr	x10, [x0, #8]
	str	x10, [x25, #8]!
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_11 Depth=1
	add	x9, x0, #8
LBB0_18:                                ;   in Loop: Header=BB0_11 Depth=1
	ldr	x23, [x9]
	add	x25, x25, #8
	mov	x28, x8
LBB0_19:                                ;   in Loop: Header=BB0_11 Depth=1
	ldr	w8, [x26]
	tst	w8, w22
	b.eq	LBB0_21
; %bb.20:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x23
	bl	_to_unicode_digit
	mov	x23, x0
LBB0_21:                                ;   in Loop: Header=BB0_11 Depth=1
	ldr	w8, [x27]
	tst	w8, w22
	b.eq	LBB0_10
; %bb.22:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x23
	bl	_to_unicode_native
	mov	x23, x0
	b	LBB0_10
LBB0_23:
	sub	x8, x25, x21
	lsr	x19, x8, #3
LBB0_24:
	mov	x0, x19
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_MAP_EXPAND_LIGATURES,4,2       ; @MAP_EXPAND_LIGATURES
	.comm	_MAP_COMPOSITE,4,2              ; @MAP_COMPOSITE
	.comm	_MAP_PRECOMPOSED,4,2            ; @MAP_PRECOMPOSED
	.comm	_MAP_FOLDDIGITS,4,2             ; @MAP_FOLDDIGITS
	.comm	_MAP_FOLDCZONE,4,2              ; @MAP_FOLDCZONE
.subsections_via_symbols
