	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function EDIT_EM_ScrollCaret
_EDIT_EM_ScrollCaret:                   ## @EDIT_EM_ScrollCaret
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	_ES_MULTILINE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_24
## %bb.1:
	movq	8(%r13), %r15
	movq	16(%r13), %rsi
	movq	%r13, %rdi
	callq	_EDIT_EM_LineFromChar
	movq	%rax, %r14
	movq	16(%r13), %rsi
	movq	_EF_AFTER_WRAP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	24(%r13), %edx
	movq	%r13, %rdi
	callq	_EDIT_EM_PosFromChar
	movl	%eax, %edi
	callq	_LOWORD
	movswq	%ax, %r12
	movq	%r13, %rdi
	callq	_get_vertical_line_count
	movq	%rax, %r8
	movq	32(%r13), %r9
	leaq	(%r9,%rax), %rcx
	xorl	%eax, %eax
	movq	%r14, %rdx
	subq	%rcx, %rdx
	leaq	1(%rdx), %rcx
	cmovlq	%rax, %rcx
	subq	%r9, %r14
	cmovgeq	%rcx, %r14
	movq	64(%r13), %rsi
	movq	72(%r13), %r10
	movq	%rsi, %rcx
	subq	%r10, %rcx
	cmpq	%r10, %r12
	jge	LBB0_9
## %bb.2:
	movq	_HSCROLL_FRACTION@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%rcx, %rax
	orq	%rdi, %rax
	shrq	$32, %rax
	je	LBB0_3
## %bb.4:
	movq	%rcx, %rax
	cqto
	idivq	%rdi
	movq	%rax, %rdi
	jmp	LBB0_5
LBB0_24:
	movq	16(%r13), %rsi
	movq	_FALSE@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%r13, %rdi
	callq	_EDIT_EM_PosFromChar
	movl	%eax, %edi
	callq	_LOWORD
	movswq	%ax, %rax
	movq	64(%r13), %rdx
	movq	72(%r13), %rcx
	movq	%rdx, %r15
	subq	%rcx, %r15
	cmpq	%rcx, %rax
	jge	LBB0_31
## %bb.25:
	movq	_HSCROLL_FRACTION@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rax
	orq	%rsi, %rax
	shrq	$32, %rax
	je	LBB0_26
## %bb.27:
	movq	%r15, %rax
	cqto
	idivq	%rsi
	movq	%rax, %r14
	jmp	LBB0_28
LBB0_31:
	cmpq	%rdx, %rax
	jle	LBB0_39
## %bb.32:
	movq	%r13, %rdi
	callq	_get_text_length
	movq	%rax, %rsi
	movq	64(%r13), %r14
	movq	_HSCROLL_FRACTION@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%r15, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_33
## %bb.34:
	movq	%r15, %rax
	cqto
	idivq	%rcx
	jmp	LBB0_35
LBB0_3:
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%edi
	movl	%eax, %edi
LBB0_5:
	movq	%rdi, %rax
	orq	%r15, %rax
	shrq	$32, %rax
	je	LBB0_6
## %bb.7:
	movq	%rdi, %rax
	cqto
	idivq	%r15
	jmp	LBB0_8
LBB0_6:
	movl	%edi, %eax
	xorl	%edx, %edx
	divl	%r15d
                                        ## kill: def $edx killed $edx def $rdx
LBB0_8:
	addq	%r10, %rdi
	movq	%r12, %rax
	subq	%rdi, %rax
	addq	%rdx, %rax
LBB0_9:
	cmpq	%rsi, %r12
	jle	LBB0_17
## %bb.10:
	movq	_HSCROLL_FRACTION@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	-1(%rsi), %rax
	imulq	%rcx, %rax
	movq	%rax, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_11
## %bb.12:
	cqto
	idivq	%rsi
	movq	%rax, %rdi
	jmp	LBB0_13
LBB0_11:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%esi
	movl	%eax, %edi
LBB0_13:
	movq	%rdi, %rax
	orq	%r15, %rax
	shrq	$32, %rax
	je	LBB0_14
## %bb.15:
	movq	%rdi, %rax
	cqto
	idivq	%r15
	jmp	LBB0_16
LBB0_14:
	movl	%edi, %eax
	xorl	%edx, %edx
	divl	%r15d
                                        ## kill: def $edx killed $edx def $rdx
LBB0_16:
	addq	%rdi, %r10
	subq	%r10, %r12
	addq	%rdx, %r12
	movq	%r12, %rax
LBB0_17:
	movq	%r14, %rdx
	orq	%rax, %rdx
	jne	LBB0_20
## %bb.18:
	testq	%r9, %r9
	je	LBB0_39
## %bb.19:
	movq	40(%r13), %rdx
	subq	%r9, %rdx
	cmpq	%r8, %rdx
	jge	LBB0_39
LBB0_20:
	addq	48(%r13), %rcx
	movq	56(%r13), %rdx
	movq	%rdx, %rsi
	subq	%rcx, %rsi
	addq	%rax, %rcx
	cmpq	%rdx, %rcx
	cmovleq	%rax, %rsi
	movq	%rsi, %rax
	orq	%r14, %rax
	jne	LBB0_23
## %bb.21:
	testq	%r9, %r9
	je	LBB0_39
## %bb.22:
	movq	40(%r13), %rax
	subq	%r9, %rax
	cmpq	%r8, %rax
	jge	LBB0_39
LBB0_23:
	movq	%r13, %rdi
	movq	%r14, %rdx
	callq	_EDIT_EM_LineScroll_internal
	jmp	LBB0_39
LBB0_26:
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	%esi
	movl	%eax, %r14d
LBB0_28:
	addq	%rcx, %r14
	movq	48(%r13), %rax
	.p2align	4, 0x90
LBB0_29:                                ## =>This Inner Loop Header: Depth=1
	decq	%rax
	movq	%rax, 48(%r13)
	movq	16(%r13), %rsi
	movl	(%r12), %edx
	movq	%r13, %rdi
	callq	_EDIT_EM_PosFromChar
	movl	%eax, %edi
	callq	_LOWORD
	movswq	%ax, %rax
	cmpq	%r14, %rax
	jge	LBB0_38
## %bb.30:                              ##   in Loop: Header=BB0_29 Depth=1
	movq	48(%r13), %rax
	testq	%rax, %rax
	jne	LBB0_29
	jmp	LBB0_38
LBB0_33:
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_35:
	subq	%rax, %r14
	movq	%rsi, %r15
	.p2align	4, 0x90
LBB0_36:                                ## =>This Inner Loop Header: Depth=1
	incq	48(%r13)
	movq	16(%r13), %rsi
	movl	(%r12), %edx
	movq	%r13, %rdi
	callq	_EDIT_EM_PosFromChar
	movl	%eax, %edi
	callq	_LOWORD
	movswq	%ax, %rbx
	movl	(%r12), %edx
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_EDIT_EM_PosFromChar
	movl	%eax, %edi
	callq	_LOWORD
	cmpq	%r14, %rbx
	jle	LBB0_38
## %bb.37:                              ##   in Loop: Header=BB0_36 Depth=1
	movswq	%ax, %rax
	cmpq	64(%r13), %rax
	jg	LBB0_36
LBB0_38:
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_EDIT_UpdateText
LBB0_39:
	movl	24(%r13), %edx
	movq	_EF_FOCUSED@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_40
## %bb.41:
	movq	16(%r13), %rsi
	movq	_EF_AFTER_WRAP@GOTPCREL(%rip), %rax
	andl	(%rax), %edx
	movq	%r13, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_EDIT_SetCaretPos               ## TAILCALL
LBB0_40:
	addq	$8, %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	_EF_AFTER_WRAP,4,2              ## @EF_AFTER_WRAP
	.comm	_HSCROLL_FRACTION,8,3           ## @HSCROLL_FRACTION
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_EF_FOCUSED,4,2                 ## @EF_FOCUSED
	.no_dead_strip	_EDIT_EM_ScrollCaret
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function EDIT_EM_ScrollCaret
_EDIT_EM_ScrollCaret:                   ; @EDIT_EM_ScrollCaret
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _ES_MULTILINE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ES_MULTILINE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x22, _EF_AFTER_WRAP@GOTPAGE
Lloh4:
	ldr	x22, [x22, _EF_AFTER_WRAP@GOTPAGEOFF]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.1:
	ldp	x21, x1, [x19, #8]
	mov	x0, x19
	bl	_EDIT_EM_LineFromChar
	mov	x20, x0
	ldr	x1, [x19, #16]
	ldr	w8, [x19, #24]
	ldr	w9, [x22]
	and	w2, w9, w8
	mov	x0, x19
	bl	_EDIT_EM_PosFromChar
	bl	_LOWORD
	sxth	x23, w0
	mov	x0, x19
	bl	_get_vertical_line_count
	mov	x10, #0
	ldr	x8, [x19, #32]
	add	x9, x8, x0
	subs	x9, x20, x9
	csinc	x9, xzr, x9, lt
	subs	x11, x20, x8
	csel	x2, x11, x9, lt
	ldp	x12, x11, [x19, #64]
	sub	x9, x12, x11
	cmp	x23, x11
	b.lt	LBB0_8
; %bb.2:
	cmp	x23, x12
	b.gt	LBB0_9
LBB0_3:
	orr	x11, x2, x10
	cbz	x11, LBB0_10
	b	LBB0_12
LBB0_4:
	ldr	x1, [x19, #16]
Lloh5:
	adrp	x23, _FALSE@GOTPAGE
Lloh6:
	ldr	x23, [x23, _FALSE@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x19
	bl	_EDIT_EM_PosFromChar
	bl	_LOWORD
	sxth	x9, w0
	ldp	x10, x8, [x19, #64]
	sub	x21, x10, x8
	cmp	x9, x8
	b.ge	LBB0_16
; %bb.5:
Lloh7:
	adrp	x9, _HSCROLL_FRACTION@GOTPAGE
Lloh8:
	ldr	x9, [x9, _HSCROLL_FRACTION@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	sdiv	x9, x21, x9
	add	x20, x9, x8
	ldr	x8, [x19, #48]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	sub	x8, x8, #1
	str	x8, [x19, #48]
	ldr	x1, [x19, #16]
	ldr	w2, [x23]
	mov	x0, x19
	bl	_EDIT_EM_PosFromChar
	bl	_LOWORD
	cmp	x20, w0, sxth
	b.le	LBB0_20
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x19, #48]
	cbnz	x8, LBB0_6
	b	LBB0_20
LBB0_8:
Lloh10:
	adrp	x10, _HSCROLL_FRACTION@GOTPAGE
Lloh11:
	ldr	x10, [x10, _HSCROLL_FRACTION@GOTPAGEOFF]
Lloh12:
	ldr	x10, [x10]
	sdiv	x10, x9, x10
	sdiv	x13, x10, x21
	msub	x13, x13, x21, x10
	add	x10, x11, x10
	sub	x10, x23, x10
	add	x10, x10, x13
	cmp	x23, x12
	b.le	LBB0_3
LBB0_9:
Lloh13:
	adrp	x10, _HSCROLL_FRACTION@GOTPAGE
Lloh14:
	ldr	x10, [x10, _HSCROLL_FRACTION@GOTPAGEOFF]
Lloh15:
	ldr	x10, [x10]
	sub	x12, x10, #1
	mul	x12, x12, x9
	sdiv	x10, x12, x10
	sdiv	x12, x10, x21
	msub	x12, x12, x21, x10
	add	x10, x11, x10
	sub	x10, x23, x10
	add	x10, x10, x12
	orr	x11, x2, x10
	cbnz	x11, LBB0_12
LBB0_10:
	cbz	x8, LBB0_21
; %bb.11:
	ldr	x11, [x19, #40]
	sub	x11, x11, x8
	cmp	x11, x0
	b.ge	LBB0_21
LBB0_12:
	ldp	x11, x12, [x19, #48]
	add	x9, x11, x9
	add	x11, x9, x10
	sub	x9, x12, x9
	cmp	x11, x12
	csel	x1, x9, x10, gt
	orr	x9, x1, x2
	cbnz	x9, LBB0_15
; %bb.13:
	cbz	x8, LBB0_21
; %bb.14:
	ldr	x9, [x19, #40]
	sub	x8, x9, x8
	cmp	x8, x0
	b.ge	LBB0_21
LBB0_15:
	mov	x0, x19
	bl	_EDIT_EM_LineScroll_internal
	b	LBB0_21
LBB0_16:
	cmp	x9, x10
	b.le	LBB0_21
; %bb.17:
	mov	x0, x19
	bl	_get_text_length
	mov	x20, x0
	ldr	x8, [x19, #64]
Lloh16:
	adrp	x9, _HSCROLL_FRACTION@GOTPAGE
Lloh17:
	ldr	x9, [x9, _HSCROLL_FRACTION@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	sdiv	x9, x21, x9
	sub	x24, x8, x9
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #48]
	add	x8, x8, #1
	str	x8, [x19, #48]
	ldr	x1, [x19, #16]
	ldr	w2, [x23]
	mov	x0, x19
	bl	_EDIT_EM_PosFromChar
	bl	_LOWORD
	mov	x21, x0
	ldr	w2, [x23]
	mov	x0, x19
	mov	x1, x20
	bl	_EDIT_EM_PosFromChar
	bl	_LOWORD
	cmp	x24, w21, sxth
	b.ge	LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	x8, [x19, #64]
	cmp	x8, w0, sxth
	b.lt	LBB0_18
LBB0_20:
Lloh19:
	adrp	x8, _TRUE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, #0
	bl	_EDIT_UpdateText
LBB0_21:
	ldr	w8, [x19, #24]
Lloh22:
	adrp	x9, _EF_FOCUSED@GOTPAGE
Lloh23:
	ldr	x9, [x9, _EF_FOCUSED@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_23
; %bb.22:
	ldr	x1, [x19, #16]
	ldr	w9, [x22]
	and	w2, w9, w8
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_EDIT_SetCaretPos
LBB0_23:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_ES_MULTILINE,4,2               ; @ES_MULTILINE
	.comm	_EF_AFTER_WRAP,4,2              ; @EF_AFTER_WRAP
	.comm	_HSCROLL_FRACTION,8,3           ; @HSCROLL_FRACTION
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_EF_FOCUSED,4,2                 ; @EF_FOCUSED
	.no_dead_strip	_EDIT_EM_ScrollCaret
.subsections_via_symbols
