	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_user_input                     ## -- Begin function user_input
	.p2align	4, 0x90
_user_input:                            ## @user_input
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	xorl	%eax, %eax
	callq	_getch
                                        ## kill: def $eax killed $eax def $rax
	leal	-48(%rax), %ecx
	cmpl	$10, %ecx
	jae	LBB0_1
## %bb.7:
	movslq	_user_input.pos(%rip), %rcx
	leal	1(%rcx), %edx
	movl	%edx, _user_input.pos(%rip)
	leaq	_user_input.chan(%rip), %rsi
	movb	%al, (%rcx,%rsi)
	cmpl	$2, %edx
	jne	LBB0_11
## %bb.8:
	leaq	_user_input.chan(%rip), %rdi
	callq	_atoi
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %ecx
	cmpl	$10, %ecx
	ja	LBB0_10
## %bb.9:
	movl	%eax, %edi
	callq	_set_chan
	movq	_chaninfo@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
LBB0_10:
	movl	$0, _user_input.pos(%rip)
LBB0_11:
	popq	%rbp
	retq
LBB0_1:
	addl	$-99, %eax
	cmpl	$29, %eax
	ja	LBB0_10
## %bb.2:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_5:
	movq	_chaninfo@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	cmpl	$0, (%rax)
	sete	%cl
	movl	%ecx, (%rax)
	popq	%rbp
	retq
LBB0_4:
	xorl	%edi, %edi
	popq	%rbp
	jmp	_cleanup                        ## TAILCALL
LBB0_3:
	xorl	%eax, %eax
	popq	%rbp
	jmp	_save_state                     ## TAILCALL
LBB0_6:
	leaq	L_.str(%rip), %rsi
	xorl	%edi, %edi
	popq	%rbp
	jmp	_die                            ## TAILCALL
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_3, LBB0_3-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
LJTI0_0:
	.long	L0_0_set_5
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_4
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_3
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_10
	.long	L0_0_set_6
	.end_data_region
                                        ## -- End function
.zerofill __DATA,__bss,_user_input.chan,3,0 ## @user_input.chan
.zerofill __DATA,__bss,_user_input.pos,4,2 ## @user_input.pos
	.comm	_chaninfo,4,2                   ## @chaninfo
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"getch()"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_user_input                     ; -- Begin function user_input
	.p2align	2
_user_input:                            ; @user_input
	.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
	bl	_getch
	sub	w8, w0, #48
	cmp	w8, #10
	b.hs	LBB0_6
; %bb.1:
	adrp	x19, _user_input.pos@PAGE
	ldrsw	x8, [x19, _user_input.pos@PAGEOFF]
	add	w9, w8, #1
	str	w9, [x19, _user_input.pos@PAGEOFF]
Lloh0:
	adrp	x10, _user_input.chan@PAGE
Lloh1:
	add	x10, x10, _user_input.chan@PAGEOFF
	strb	w0, [x10, x8]
	cmp	w9, #2
	b.ne	LBB0_5
; %bb.2:
Lloh2:
	adrp	x0, _user_input.chan@PAGE
Lloh3:
	add	x0, x0, _user_input.chan@PAGEOFF
	bl	_atoi
	sub	w8, w0, #1
	cmp	w8, #10
	b.hi	LBB0_4
; %bb.3:
	bl	_set_chan
Lloh4:
	adrp	x8, _chaninfo@GOTPAGE
Lloh5:
	ldr	x8, [x8, _chaninfo@GOTPAGEOFF]
	mov	w9, #1
Lloh6:
	str	w9, [x8]
LBB0_4:
	str	wzr, [x19, _user_input.pos@PAGEOFF]
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_6:
	sub	w8, w0, #99
	cmp	w8, #29
	b.hi	LBB0_9
; %bb.7:
Lloh7:
	adrp	x9, lJTI0_0@PAGE
Lloh8:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_8
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_8:
Lloh9:
	adrp	x8, _chaninfo@GOTPAGE
Lloh10:
	ldr	x8, [x8, _chaninfo@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w9, #0
	cset	w9, eq
	str	w9, [x8]
	b	LBB0_5
LBB0_9:
	adrp	x8, _user_input.pos@PAGE
	str	wzr, [x8, _user_input.pos@PAGEOFF]
	b	LBB0_5
LBB0_10:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_cleanup
LBB0_11:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_save_state
LBB0_12:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_die
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotStr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_8-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_10-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_11-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_12-LBB0_8)>>2
                                        ; -- End function
.zerofill __DATA,__bss,_user_input.chan,3,0 ; @user_input.chan
.zerofill __DATA,__bss,_user_input.pos,4,2 ; @user_input.pos
	.comm	_chaninfo,4,2                   ; @chaninfo
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"getch()"

.subsections_via_symbols
