	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function EDIT_EM_PosFromChar
_EDIT_EM_PosFromChar:                   ## @EDIT_EM_PosFromChar
	.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
	movq	%rdx, %r13
	movq	%rsi, %rbx
	movq	%rdi, %r12
	callq	_get_text_length
	movq	$0, -56(%rbp)
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_min
	movq	%rax, %r14
	movq	_ES_MULTILINE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_11
## %bb.1:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_EDIT_EM_LineFromChar
	movq	%rax, %rbx
	movq	%r12, %rdi
	xorl	%esi, %esi
	movq	%rax, %rdx
	callq	_EDIT_UpdateUniscribeData
	movq	%rbx, %r15
	subq	8(%r12), %r15
	imulq	16(%r12), %r15
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_EDIT_EM_LineIndex
	testq	%r13, %r13
	je	LBB0_16
## %bb.2:
	testq	%rbx, %rbx
	je	LBB0_16
## %bb.3:
	cmpq	%r14, %rax
	jne	LBB0_16
## %bb.4:
	leaq	80(%r12), %rax
	leaq	-1(%rbx), %rsi
	movq	%rbx, %rdx
	andq	$7, %rdx
	je	LBB0_32
## %bb.5:
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rax), %rcx
	leaq	32(%rcx), %rax
	incq	%rdi
	cmpq	%rdi, %rdx
	jne	LBB0_6
## %bb.7:
	subq	%rdi, %rbx
	cmpq	$7, %rsi
	jb	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rax), %rax
	movq	32(%rax), %rax
	movq	32(%rax), %rax
	movq	32(%rax), %rax
	movq	32(%rax), %rax
	movq	32(%rax), %rax
	movq	32(%rax), %rax
	movq	32(%rax), %rcx
	leaq	32(%rcx), %rax
	addq	$-8, %rbx
	jne	LBB0_8
LBB0_9:
	movq	(%rcx), %rax
	movq	_END_WRAP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_15
## %bb.10:
	subq	16(%r12), %r15
	movq	%r12, %rdi
	callq	_EDIT_EM_LineIndex
	jmp	LBB0_16
LBB0_11:
	movq	$0, -48(%rbp)
	movq	$0, -64(%rbp)
	movq	%r12, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_EDIT_UpdateUniscribeData
	movq	24(%r12), %rbx
	testq	%rbx, %rbx
	je	LBB0_26
## %bb.12:
	cmpq	$0, 72(%r12)
	je	LBB0_25
## %bb.13:
	movq	%r12, %rdi
	callq	_get_text_length
	cmpq	%rax, %rbx
	jge	LBB0_33
## %bb.14:
	movq	24(%r12), %rsi
	movq	72(%r12), %rdi
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rcx
	callq	_ScriptStringCPtoX
	testq	%r14, %r14
	jne	LBB0_27
	jmp	LBB0_39
LBB0_15:
	movq	%r14, %rax
LBB0_16:
	leaq	80(%r12), %rcx
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rcx), %rdx
	leaq	32(%rdx), %rcx
	cmpq	%rax, 8(%rdx)
	jne	LBB0_17
## %bb.18:
	movq	16(%rdx), %r13
	movq	24(%rdx), %rdi
	movq	48(%r12), %rbx
	subq	56(%r12), %rbx
	testq	%rdi, %rdi
	je	LBB0_20
## %bb.19:
	notq	%rax
	addq	%rax, %r14
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-56(%rbp), %rcx
	movq	%r14, %rsi
	callq	_ScriptStringCPtoX
	movq	-56(%rbp), %rdi
	subq	24(%r12), %rdi
	jmp	LBB0_21
LBB0_20:
	movq	24(%r12), %rdi
LBB0_21:
	movl	(%r12), %eax
	movq	_ES_RIGHT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_23
## %bb.22:
	subq	%r13, %rbx
	addq	%rbx, %rdi
	jmp	LBB0_49
LBB0_23:
	movq	_ES_CENTER@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_49
## %bb.24:
	subq	%r13, %rbx
	movq	%rbx, %rax
	shrq	$63, %rax
	addq	%rbx, %rax
	sarq	%rax
	addq	%rax, %rdi
	jmp	LBB0_49
LBB0_25:
	movq	$0, -48(%rbp)
LBB0_26:
	testq	%r14, %r14
	je	LBB0_39
LBB0_27:
	movq	%r12, %rdi
	callq	_get_text_length
	movq	72(%r12), %rdi
	cmpq	%rax, %r14
	jge	LBB0_30
## %bb.28:
	testq	%rdi, %rdi
	je	LBB0_39
## %bb.29:
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-64(%rbp), %rcx
	movq	%r14, %rsi
	callq	_ScriptStringCPtoX
	movq	-64(%rbp), %rdi
	jmp	LBB0_40
LBB0_30:
	testq	%rdi, %rdi
	je	LBB0_39
## %bb.31:
	callq	_ScriptString_pSize
	movq	(%rax), %rdi
	jmp	LBB0_40
LBB0_32:
                                        ## implicit-def: $rcx
	cmpq	$7, %rsi
	jae	LBB0_8
	jmp	LBB0_9
LBB0_33:
	movl	24(%r12), %ebx
	movq	%r12, %rdi
	callq	_get_text_length
	subl	%eax, %ebx
	movq	72(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_37
## %bb.34:
	callq	_ScriptString_pSize
	movq	(%rax), %rax
	jmp	LBB0_38
LBB0_37:
	xorl	%eax, %eax
LBB0_38:
	movslq	32(%r12), %rcx
	movslq	%ebx, %rdx
	imulq	%rcx, %rdx
	addq	%rax, %rdx
	movq	%rdx, -48(%rbp)
	testq	%r14, %r14
	jne	LBB0_27
LBB0_39:
	xorl	%edi, %edi
LBB0_40:
	subq	-48(%rbp), %rdi
	testq	%r14, %r14
	js	LBB0_48
## %bb.41:
	cmpq	$0, 24(%r12)
	jne	LBB0_48
## %bb.42:
	movl	(%r12), %eax
	movq	_ES_RIGHT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_ES_CENTER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %esi
	orl	%edx, %esi
	testl	%eax, %esi
	je	LBB0_48
## %bb.43:
	movq	40(%r12), %r8
	movq	48(%r12), %rsi
	subq	56(%r12), %rsi
	movq	%rsi, %rbx
	subq	%r8, %rbx
	jle	LBB0_48
## %bb.44:
	testl	%eax, %edx
	je	LBB0_46
## %bb.45:
	subq	%r8, %rdi
	addq	%rsi, %rdi
	jmp	LBB0_48
LBB0_46:
	testl	%eax, %ecx
	je	LBB0_48
## %bb.47:
	movq	%rbx, %rax
	shrq	$63, %rax
	addq	%rbx, %rax
	sarq	%rax
	addq	%rax, %rdi
LBB0_48:
	xorl	%r15d, %r15d
LBB0_49:
	addq	56(%r12), %rdi
	movq	%rdi, -56(%rbp)
	addl	64(%r12), %r15d
                                        ## kill: def $edi killed $edi killed $rdi
	movl	%r15d, %esi
	callq	_MAKELONG
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ES_MULTILINE,4,2               ## @ES_MULTILINE
	.comm	_END_WRAP,8,3                   ## @END_WRAP
	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_ES_RIGHT,4,2                   ## @ES_RIGHT
	.comm	_ES_CENTER,4,2                  ## @ES_CENTER
	.comm	_FALSE,4,2                      ## @FALSE
	.no_dead_strip	_EDIT_EM_PosFromChar
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function EDIT_EM_PosFromChar
_EDIT_EM_PosFromChar:                   ; @EDIT_EM_PosFromChar
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x23, x2
	mov	x20, x1
	mov	x19, x0
	bl	_get_text_length
	mov	x1, x0
	str	xzr, [sp, #24]
	mov	x0, x20
	bl	_min
	mov	x21, x0
	mov	x20, x0
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _ES_MULTILINE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ES_MULTILINE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.1:
	mov	x0, x19
	mov	x1, x20
	bl	_EDIT_EM_LineFromChar
	mov	x22, x0
	mov	x0, x19
	mov	x1, #0
	mov	x2, x22
	bl	_EDIT_UpdateUniscribeData
	ldp	x8, x9, [x19, #8]
	sub	x8, x22, x8
	mul	x24, x8, x9
	mov	x0, x19
	mov	x1, x22
	bl	_EDIT_EM_LineIndex
	cbz	x23, LBB0_8
; %bb.2:
	cbz	x22, LBB0_8
; %bb.3:
	cmp	x0, x21
	b.ne	LBB0_8
; %bb.4:
	add	x8, x19, #80
	mov	x9, x22
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x8]
	add	x8, x10, #32
	subs	x9, x9, #1
	b.ne	LBB0_5
; %bb.6:
	ldr	x8, [x10]
Lloh3:
	adrp	x9, _END_WRAP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _END_WRAP@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.7:
	sub	x1, x22, #1
	ldr	x8, [x19, #16]
	sub	x24, x24, x8
	mov	x0, x19
	bl	_EDIT_EM_LineIndex
LBB0_8:
	mov	x20, x0
LBB0_9:
	add	x9, x19, #80
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x9]
	ldr	x10, [x8, #8]
	add	x9, x8, #32
	cmp	x10, x20
	b.ne	LBB0_10
; %bb.11:
	ldp	x23, x25, [x19, #48]
	ldp	x22, x0, [x8, #16]
	cbz	x0, LBB0_17
; %bb.12:
	mvn	x8, x20
	add	x1, x21, x8
Lloh6:
	adrp	x8, _TRUE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	add	x3, sp, #24
	bl	_ScriptStringCPtoX
	ldr	x8, [x19, #24]
	ldr	x9, [sp, #24]
	sub	x8, x9, x8
	b	LBB0_18
LBB0_13:
	stp	xzr, xzr, [sp, #8]
	mov	x0, x19
	mov	x1, #0
	mov	x2, #0
	bl	_EDIT_UpdateUniscribeData
	ldr	x22, [x19, #24]
	cbz	x22, LBB0_22
; %bb.14:
	ldr	x8, [x19, #72]
	cbz	x8, LBB0_21
; %bb.15:
	mov	x0, x19
	bl	_get_text_length
	cmp	x22, x0
	b.ge	LBB0_28
; %bb.16:
	ldr	x0, [x19, #72]
	ldr	x1, [x19, #24]
Lloh9:
	adrp	x8, _FALSE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	add	x3, sp, #16
	bl	_ScriptStringCPtoX
	cbnz	x20, LBB0_23
	b	LBB0_32
LBB0_17:
	ldr	x8, [x19, #24]
LBB0_18:
	sub	x10, x23, x25
	ldr	w9, [x19]
Lloh12:
	adrp	x11, _ES_RIGHT@GOTPAGE
Lloh13:
	ldr	x11, [x11, _ES_RIGHT@GOTPAGEOFF]
Lloh14:
	ldr	w11, [x11]
	tst	w11, w9
	b.eq	LBB0_20
; %bb.19:
	sub	x9, x10, x22
	add	x8, x9, x8
	b	LBB0_38
LBB0_20:
Lloh15:
	adrp	x11, _ES_CENTER@GOTPAGE
Lloh16:
	ldr	x11, [x11, _ES_CENTER@GOTPAGEOFF]
Lloh17:
	ldr	w11, [x11]
	sub	x10, x10, x22
	cmp	x10, #0
	cinc	x10, x10, lt
	add	x10, x8, x10, asr #1
	tst	w11, w9
	csel	x8, x8, x10, eq
	b	LBB0_38
LBB0_21:
	str	xzr, [sp, #16]
LBB0_22:
	cbz	x20, LBB0_32
LBB0_23:
	mov	x0, x19
	bl	_get_text_length
	mov	x8, x0
	ldr	x0, [x19, #72]
	cmp	x21, x8
	b.ge	LBB0_26
; %bb.24:
	cbz	x0, LBB0_32
; %bb.25:
Lloh18:
	adrp	x8, _FALSE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	add	x3, sp, #8
	mov	x1, x20
	bl	_ScriptStringCPtoX
	ldr	x8, [sp, #8]
	b	LBB0_33
LBB0_26:
	cbz	x0, LBB0_32
; %bb.27:
	bl	_ScriptString_pSize
	ldr	x8, [x0]
	b	LBB0_33
LBB0_28:
	ldr	w22, [x19, #24]
	mov	x0, x19
	bl	_get_text_length
	sub	w22, w22, w0
	ldr	x0, [x19, #72]
	cbz	x0, LBB0_30
; %bb.29:
	bl	_ScriptString_pSize
	ldr	x8, [x0]
	b	LBB0_31
LBB0_30:
	mov	x8, #0
LBB0_31:
	ldrsw	x9, [x19, #32]
	sxtw	x10, w22
	madd	x8, x9, x10, x8
	str	x8, [sp, #16]
	cbnz	x20, LBB0_23
LBB0_32:
	mov	x8, #0
LBB0_33:
	ldr	x9, [sp, #16]
	sub	x8, x8, x9
	tbnz	x20, #63, LBB0_37
; %bb.34:
	ldr	x9, [x19, #24]
	cbnz	x9, LBB0_37
; %bb.35:
	ldr	w9, [x19]
Lloh21:
	adrp	x10, _ES_RIGHT@GOTPAGE
Lloh22:
	ldr	x10, [x10, _ES_RIGHT@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
Lloh24:
	adrp	x11, _ES_CENTER@GOTPAGE
Lloh25:
	ldr	x11, [x11, _ES_CENTER@GOTPAGEOFF]
Lloh26:
	ldr	w11, [x11]
	orr	w12, w11, w10
	tst	w12, w9
	b.eq	LBB0_37
; %bb.36:
	ldp	x13, x12, [x19, #48]
	ldr	x14, [x19, #40]
	sub	x12, x13, x12
	sub	x13, x12, x14
	cmp	x13, #0
	cinc	x13, x13, lt
	add	x13, x8, x13, asr #1
	tst	w11, w9
	csel	x11, x8, x13, eq
	sub	x13, x8, x14
	add	x13, x13, x12
	tst	w10, w9
	csel	x9, x11, x13, eq
	cmp	x12, x14
	csel	x8, x8, x9, le
LBB0_37:
	mov	x24, #0
LBB0_38:
	ldr	x9, [x19, #56]
	add	x0, x8, x9
	str	x0, [sp, #24]
	ldr	w8, [x19, #64]
	add	w1, w8, w24
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_MAKELONG
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_ES_MULTILINE,4,2               ; @ES_MULTILINE
	.comm	_END_WRAP,8,3                   ; @END_WRAP
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_ES_RIGHT,4,2                   ; @ES_RIGHT
	.comm	_ES_CENTER,4,2                  ; @ES_CENTER
	.comm	_FALSE,4,2                      ; @FALSE
	.no_dead_strip	_EDIT_EM_PosFromChar
.subsections_via_symbols
