	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_MField_CharEvent               ## -- Begin function MField_CharEvent
	.p2align	4, 0x90
_MField_CharEvent:                      ## @MField_CharEvent
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	cmpl	$3, %esi
	je	LBB0_3
## %bb.1:
	movl	%esi, %ebx
	cmpl	$22, %esi
	jne	LBB0_4
## %bb.2:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_MField_Paste                   ## TAILCALL
LBB0_3:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_MField_Clear                   ## TAILCALL
LBB0_4:
	movq	(%r15), %rdi
	callq	_strlen
	cmpl	$1, %ebx
	je	LBB0_10
## %bb.5:
	movl	%eax, %r14d
	cmpl	$5, %ebx
	je	LBB0_11
## %bb.6:
	cmpl	$8, %ebx
	jne	LBB0_12
## %bb.7:
	movl	8(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_28
## %bb.8:
	movq	(%r15), %rcx
	leaq	(%rcx,%rax,4), %rsi
	leaq	(%rcx,%rax,4), %rdi
	addq	$-4, %rdi
	subl	%eax, %r14d
	incl	%r14d
	movl	%r14d, %edx
	callq	_memmove
	movl	8(%r15), %ecx
	movl	12(%r15), %eax
	leal	-1(%rcx), %edx
	movl	%edx, 8(%r15)
	cmpl	%eax, %ecx
	jg	LBB0_28
## %bb.9:
	decl	%eax
	movl	%eax, 12(%r15)
	jmp	LBB0_28
LBB0_11:
	movl	%r14d, 8(%r15)
	subl	16(%r15), %r14d
	leal	1(%r14), %eax
	xorl	%ecx, %ecx
	cmpl	$-1, %r14d
	cmovgel	%eax, %ecx
	movl	%ecx, 12(%r15)
	jmp	LBB0_28
LBB0_10:
	movq	$0, 8(%r15)
	jmp	LBB0_28
LBB0_12:
	cmpl	$32, %ebx
	jl	LBB0_28
## %bb.13:
	xorl	%eax, %eax
	callq	_trap_Key_GetOverstrikeMode
	testl	%eax, %eax
	je	LBB0_14
## %bb.17:
	movq	_MAX_EDIT_LINE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	decl	%eax
	cmpl	%eax, %r14d
	je	LBB0_28
## %bb.18:
	movl	20(%r15), %eax
	testl	%eax, %eax
	je	LBB0_20
## %bb.19:
	cmpl	%eax, %r14d
	jge	LBB0_28
LBB0_20:
	movq	(%r15), %rax
	movslq	8(%r15), %rcx
	leaq	(%rax,%rcx,4), %rsi
	leaq	(%rax,%rcx,4), %rdi
	addq	$4, %rdi
	movl	%r14d, %edx
	subl	%ecx, %edx
	incl	%edx
	callq	_memmove
	movl	8(%r15), %ecx
LBB0_21:
	movq	(%r15), %rax
	movslq	%ecx, %rcx
	movl	%ebx, (%rax,%rcx,4)
	movl	8(%r15), %ecx
	movl	20(%r15), %edx
	subl	$1, %edx
	jb	LBB0_23
## %bb.22:
	cmpl	%edx, %ecx
	jge	LBB0_24
LBB0_23:
	incl	%ecx
	movl	%ecx, 8(%r15)
LBB0_24:
	cmpl	16(%r15), %ecx
	jl	LBB0_26
## %bb.25:
	incl	12(%r15)
LBB0_26:
	incl	%r14d
	cmpl	%r14d, %ecx
	jne	LBB0_28
## %bb.27:
	movslq	%r14d, %rcx
	movl	$0, (%rax,%rcx,4)
	jmp	LBB0_28
LBB0_14:
	movl	8(%r15), %ecx
	movq	_MAX_EDIT_LINE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	decl	%eax
	cmpl	%eax, %ecx
	je	LBB0_28
## %bb.15:
	movl	20(%r15), %eax
	testl	%eax, %eax
	je	LBB0_21
## %bb.16:
	cmpl	%eax, %ecx
	jl	LBB0_21
LBB0_28:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_EDIT_LINE,4,2              ## @MAX_EDIT_LINE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_MField_CharEvent               ; -- Begin function MField_CharEvent
	.p2align	2
_MField_CharEvent:                      ; @MField_CharEvent
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	cmp	w1, #3
	b.eq	LBB0_3
; %bb.1:
	mov	x21, x1
	cmp	w1, #22
	b.ne	LBB0_4
; %bb.2:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_MField_Paste
LBB0_3:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_MField_Clear
LBB0_4:
	ldr	x0, [x19]
	bl	_strlen
	cmp	w21, #1
	b.eq	LBB0_11
; %bb.5:
	mov	x20, x0
	cmp	w21, #5
	b.eq	LBB0_10
; %bb.6:
	cmp	w21, #8
	b.ne	LBB0_12
; %bb.7:
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_28
; %bb.8:
	ldr	x9, [x19]
	add	x1, x9, x8, lsl #2
	sub	x0, x1, #4
	sub	w8, w20, w8
	add	w2, w8, #1
	bl	_memmove
	ldp	w9, w8, [x19, #8]
	sub	w10, w9, #1
	str	w10, [x19, #8]
	cmp	w9, w8
	b.gt	LBB0_28
; %bb.9:
	sub	w8, w8, #1
	str	w8, [x19, #12]
	b	LBB0_28
LBB0_10:
	ldr	w8, [x19, #16]
	sub	w8, w20, w8
	cmn	w8, #1
	csinc	w8, wzr, w8, lt
	stp	w20, w8, [x19, #8]
	b	LBB0_28
LBB0_11:
	str	xzr, [x19, #8]
	b	LBB0_28
LBB0_12:
	cmp	w21, #32
	b.lt	LBB0_28
; %bb.13:
	bl	_trap_Key_GetOverstrikeMode
	cbz	w0, LBB0_25
; %bb.14:
Lloh0:
	adrp	x8, _MAX_EDIT_LINE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_EDIT_LINE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	sub	w8, w8, #1
	cmp	w20, w8
	b.eq	LBB0_28
; %bb.15:
	ldr	w8, [x19, #20]
	cbz	w8, LBB0_17
; %bb.16:
	cmp	w20, w8
	b.ge	LBB0_28
LBB0_17:
	ldr	x8, [x19]
	ldrsw	x9, [x19, #8]
	add	x1, x8, x9, lsl #2
	add	x0, x1, #4
	sub	w8, w20, w9
	add	w2, w8, #1
	bl	_memmove
	ldr	w9, [x19, #8]
LBB0_18:
	ldr	x8, [x19]
	str	w21, [x8, w9, sxtw #2]
	ldr	w10, [x19, #20]
	ldr	w9, [x19, #8]
	cbz	w10, LBB0_20
; %bb.19:
	sub	w10, w10, #1
	cmp	w9, w10
	b.ge	LBB0_21
LBB0_20:
	add	w9, w9, #1
	str	w9, [x19, #8]
LBB0_21:
	ldr	w10, [x19, #16]
	cmp	w9, w10
	b.lt	LBB0_23
; %bb.22:
	ldr	w10, [x19, #12]
	add	w10, w10, #1
	str	w10, [x19, #12]
LBB0_23:
	add	w10, w20, #1
	cmp	w9, w10
	b.ne	LBB0_28
; %bb.24:
	str	wzr, [x8, w10, sxtw #2]
	b	LBB0_28
LBB0_25:
	ldr	w9, [x19, #8]
Lloh3:
	adrp	x8, _MAX_EDIT_LINE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_EDIT_LINE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	sub	w8, w8, #1
	cmp	w9, w8
	b.eq	LBB0_28
; %bb.26:
	ldr	w8, [x19, #20]
	cbz	w8, LBB0_18
; %bb.27:
	cmp	w9, w8
	b.lt	LBB0_18
LBB0_28:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_EDIT_LINE,4,2              ; @MAX_EDIT_LINE
.subsections_via_symbols
