	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_on_char                        ## -- Begin function on_char
	.p2align	4, 0x90
_on_char:                               ## @on_char
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_g@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	cmpq	$0, 16(%rax)
	je	LBB0_2
## %bb.1:
	movq	$0, 16(%rax)
LBB0_12:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_2:
	movl	%esi, %ebx
	cmpl	$0, (%rax)
	je	LBB0_6
## %bb.3:
	leal	-32(%rbx), %ecx
	cmpl	$95, %ecx
	ja	LBB0_12
## %bb.4:
	movq	8(%rax), %rdi
	callq	_strlen
	movq	_MAX_TEXT_LENGTH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	decl	%ecx
	cmpl	%ecx, %eax
	jge	LBB0_12
## %bb.5:
	movq	(%r14), %rcx
	movq	8(%rcx), %rcx
	cltq
	movb	%bl, (%rcx,%rax)
	movq	(%r14), %rcx
	movq	8(%rcx), %rcx
	movb	$0, 1(%rax,%rcx)
	jmp	LBB0_12
LBB0_6:
	movq	_CRAFT_KEY_CHAT@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	jne	LBB0_8
## %bb.7:
	movl	$1, (%rax)
	movq	8(%rax), %rax
	movb	$0, (%rax)
LBB0_8:
	movq	_CRAFT_KEY_COMMAND@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_10
## %bb.9:
	movq	(%r14), %rax
	movl	$1, (%rax)
	movq	8(%rax), %rax
	movb	$47, (%rax)
	movq	(%r14), %rax
	movq	8(%rax), %rax
	movb	$0, 1(%rax)
LBB0_10:
	movq	_CRAFT_KEY_SIGN@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_12
## %bb.11:
	movq	(%r14), %rcx
	movl	$1, (%rcx)
	movb	(%rax), %al
	movq	8(%rcx), %rcx
	movb	%al, (%rcx)
	movq	(%r14), %rax
	movq	8(%rax), %rax
	movb	$0, 1(%rax)
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_g,8,3                          ## @g
	.comm	_MAX_TEXT_LENGTH,4,2            ## @MAX_TEXT_LENGTH
	.comm	_CRAFT_KEY_CHAT,4,2             ## @CRAFT_KEY_CHAT
	.comm	_CRAFT_KEY_COMMAND,4,2          ## @CRAFT_KEY_COMMAND
	.comm	_CRAFT_KEY_SIGN,4,2             ## @CRAFT_KEY_SIGN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_on_char                        ; -- Begin function on_char
	.p2align	2
_on_char:                               ; @on_char
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x20, _g@GOTPAGE
Lloh1:
	ldr	x20, [x20, _g@GOTPAGEOFF]
	ldr	x8, [x20]
	ldr	x9, [x8, #16]
	cbz	x9, LBB0_3
; %bb.1:
	str	xzr, [x8, #16]
LBB0_2:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_3:
	mov	x19, x1
	ldr	w9, [x8]
	cbz	w9, LBB0_7
; %bb.4:
	sub	w9, w19, #32
	cmp	w9, #95
	b.hi	LBB0_2
; %bb.5:
	ldr	x0, [x8, #8]
	bl	_strlen
                                        ; kill: def $w0 killed $w0 def $x0
Lloh2:
	adrp	x8, _MAX_TEXT_LENGTH@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MAX_TEXT_LENGTH@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	sub	w8, w8, #1
	cmp	w0, w8
	b.ge	LBB0_2
; %bb.6:
	ldr	x8, [x20]
	ldr	x8, [x8, #8]
	sxtw	x9, w0
	strb	w19, [x8, x9]
	ldr	x8, [x20]
	ldr	x8, [x8, #8]
	add	x8, x9, x8
	b	LBB0_13
LBB0_7:
Lloh5:
	adrp	x9, _CRAFT_KEY_CHAT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _CRAFT_KEY_CHAT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w9, w19
	b.ne	LBB0_9
; %bb.8:
	mov	w9, #1
	str	w9, [x8]
	ldr	x8, [x8, #8]
	strb	wzr, [x8]
LBB0_9:
Lloh8:
	adrp	x8, _CRAFT_KEY_COMMAND@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CRAFT_KEY_COMMAND@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_11
; %bb.10:
	ldr	x8, [x20]
	mov	w9, #1
	str	w9, [x8]
	ldr	x8, [x8, #8]
	mov	w9, #47
	strb	w9, [x8]
	ldr	x8, [x20]
	ldr	x8, [x8, #8]
	strb	wzr, [x8, #1]
LBB0_11:
Lloh11:
	adrp	x8, _CRAFT_KEY_SIGN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CRAFT_KEY_SIGN@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w9, w19
	b.ne	LBB0_2
; %bb.12:
	ldr	x9, [x20]
	mov	w10, #1
	str	w10, [x9]
	ldr	w8, [x8]
	ldr	x9, [x9, #8]
	strb	w8, [x9]
	ldr	x8, [x20]
	ldr	x8, [x8, #8]
LBB0_13:
	strb	wzr, [x8, #1]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_g,8,3                          ; @g
	.comm	_MAX_TEXT_LENGTH,4,2            ; @MAX_TEXT_LENGTH
	.comm	_CRAFT_KEY_CHAT,4,2             ; @CRAFT_KEY_CHAT
	.comm	_CRAFT_KEY_COMMAND,4,2          ; @CRAFT_KEY_COMMAND
	.comm	_CRAFT_KEY_SIGN,4,2             ; @CRAFT_KEY_SIGN
.subsections_via_symbols
