	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_keyboard                       ## -- Begin function keyboard
	.p2align	4, 0x90
_keyboard:                              ## @keyboard
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	leaq	-56(%rbp), %rdi
	xorl	%esi, %esi
	callq	_gettimeofday
	movq	_delay@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_col@GOTPCREL(%rip), %rax
	leaq	-92(%rbp), %r15
	movq	_STDIN_FILENO@GOTPCREL(%rip), %r13
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	_line@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rax
	movq	_col@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rcx
	movb	$0, (%rax,%rcx)
	movq	(%rdx), %rdi
	incq	%rdi
	callq	_command
	movq	_delay@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	xorl	%eax, %eax
	callq	_refresh
	movq	%rbx, %rax
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
	movslq	%r14d, %rdx
	imulq	$1125899907, %rdx, %rcx         ## imm = 0x431BDE83
	movq	%rdx, %r12
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rcx, %rdx
	shrq	$63, %rdx
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	sarq	$50, %rcx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	leal	(%rcx,%rdx), %r14d
	imull	$1000000, %r14d, %ebx           ## imm = 0xF4240
                                        ## kill: def $r12d killed $r12d killed $r12 def $r12
	subl	%ebx, %r12d
	movq	$0, (%rax)
	movq	_CMDLINE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_move
	negl	%ebx
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	addl	%ebx, %eax
	addl	$1000000, %eax                  ## imm = 0xF4240
	movl	%eax, -72(%rbp)                 ## 4-byte Spill
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	addl	%ecx, %eax
	decl	%eax
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=2
	js	LBB0_15
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=2
	xorl	%eax, %eax
	callq	_display
	leaq	-56(%rbp), %rdi
	xorl	%esi, %esi
	callq	_gettimeofday
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leaq	-80(%rbp), %rdi
	xorl	%esi, %esi
	callq	_gettimeofday
	movl	-56(%rbp), %edx
	movl	-52(%rbp), %edi
	leal	(%rdx,%r14), %ecx
	movl	-80(%rbp), %esi
	movl	-76(%rbp), %r8d
	subl	%esi, %ecx
	movl	%ecx, -48(%rbp)
	leal	(%rdi,%r12), %ebx
	movl	%ebx, %eax
	subl	%r8d, %eax
	movl	%eax, -44(%rbp)
	js	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=2
	cmpl	$1000000, %eax                  ## imm = 0xF4240
	jge	LBB0_5
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=2
	testl	%ecx, %ecx
	jns	LBB0_10
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=2
	addl	-72(%rbp), %edi                 ## 4-byte Folded Reload
	cmpl	$-999999, %eax                  ## imm = 0xFFF0BDC1
	movl	$-1000000, %ecx                 ## imm = 0xFFF0BDC0
	cmovll	%ecx, %eax
	addl	%r8d, %eax
	xorl	%ecx, %ecx
	cmpl	%ebx, %eax
	setne	%cl
	addl	%ecx, %ebx
	subl	%ebx, %eax
	imulq	$1125899907, %rax, %rbx         ## imm = 0x431BDE83
	shrq	$50, %rbx
	addl	%ecx, %ebx
	imull	$1000000, %ebx, %eax            ## imm = 0xF4240
	addl	%edi, %eax
	addl	-64(%rbp), %edx                 ## 4-byte Folded Reload
	subl	%r8d, %eax
	addl	%ebx, %esi
	subl	%esi, %edx
	movl	%eax, -44(%rbp)
	movl	%edx, -48(%rbp)
	movl	%edx, %ecx
	cmpl	$1000000, %eax                  ## imm = 0xF4240
	jl	LBB0_8
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=2
	movl	%eax, %edx
	cmpl	$1999999, %eax                  ## imm = 0x1E847F
	jl	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=2
	movl	$1999999, %edx                  ## imm = 0x1E847F
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=2
	negl	%edx
	addl	%eax, %edx
	addl	$999999, %edx                   ## imm = 0xF423F
	imulq	$1125899907, %rdx, %rdx         ## imm = 0x431BDE83
	shrq	$50, %rdx
	imull	$-1000000, %edx, %esi           ## imm = 0xFFF0BDC0
	addl	%esi, %eax
	addl	$-1000000, %eax                 ## imm = 0xFFF0BDC0
	addl	%edx, %ecx
	incl	%ecx
	movl	%eax, -44(%rbp)
	movl	%ecx, -48(%rbp)
	testl	%ecx, %ecx
	js	LBB0_9
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=2
	movq	%r15, %rdi
	callq	_FD_ZERO
	movq	(%r13), %rdi
	movq	%r15, %rsi
	callq	_FD_SET
	movq	(%r13), %rdi
	incq	%rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	leaq	-48(%rbp), %r8
	callq	_select
	testl	%eax, %eax
	jle	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=2
	xorl	%eax, %eax
	callq	_getch
	movl	%eax, %edi
	callq	_keyboard_dispatch
	testq	%rax, %rax
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=2
	xorl	%eax, %eax
	callq	_refresh
	jmp	LBB0_2
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=2
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EINTR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_9
## %bb.16:
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_delay,4,2                      ## @delay
	.comm	_col,8,3                        ## @col
	.comm	_CMDLINE,4,2                    ## @CMDLINE
	.comm	_STDIN_FILENO,8,3               ## @STDIN_FILENO
	.comm	_line,8,3                       ## @line
	.comm	_errno,8,3                      ## @errno
	.comm	_EINTR,8,3                      ## @EINTR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_keyboard                       ; -- Begin function keyboard
	.p2align	2
_keyboard:                              ; @keyboard
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	w19, #48576
	movk	w19, #65520, lsl #16
	mov	w20, #16960
	movk	w20, #15, lsl #16
	add	x0, sp, #24
	mov	x1, #0
	bl	_gettimeofday
Lloh0:
	adrp	x8, _delay@GOTPAGE
Lloh1:
	ldr	x8, [x8, _delay@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
Lloh3:
	adrp	x27, _col@GOTPAGE
Lloh4:
	ldr	x27, [x27, _col@GOTPAGEOFF]
	sub	w24, w20, #1
	mov	w25, #33919
	movk	w25, #30, lsl #16
Lloh5:
	adrp	x26, _STDIN_FILENO@GOTPAGE
Lloh6:
	ldr	x26, [x26, _STDIN_FILENO@GOTPAGEOFF]
Lloh7:
	adrp	x21, _EINTR@GOTPAGE
Lloh8:
	ldr	x21, [x21, _EINTR@GOTPAGEOFF]
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
Lloh9:
	adrp	x10, _line@GOTPAGE
Lloh10:
	ldr	x10, [x10, _line@GOTPAGEOFF]
	ldr	x8, [x10]
Lloh11:
	adrp	x27, _col@GOTPAGE
Lloh12:
	ldr	x27, [x27, _col@GOTPAGEOFF]
	ldr	x9, [x27]
	strb	wzr, [x8, x9]
	ldr	x8, [x10]
	add	x0, x8, #1
	bl	_command
Lloh13:
	adrp	x8, _delay@GOTPAGE
Lloh14:
	ldr	x8, [x8, _delay@GOTPAGEOFF]
Lloh15:
	ldr	w22, [x8]
	bl	_refresh
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	sdiv	w23, w22, w20
	msub	w22, w23, w20, w22
	str	xzr, [x27]
Lloh16:
	adrp	x8, _CMDLINE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CMDLINE@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_move
	add	w27, w22, w20
	sub	w28, w23, #1
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=2
	tbnz	w0, #31, LBB0_13
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=2
	bl	_display
	add	x0, sp, #24
	mov	x1, #0
	bl	_gettimeofday
LBB0_5:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x0, sp, #16
	mov	x1, #0
	bl	_gettimeofday
	ldp	w10, w13, [sp, #24]
	ldp	w11, w12, [sp, #16]
	add	w8, w10, w23
	sub	w8, w8, w11
	add	w14, w13, w22
	subs	w9, w14, w12
	stp	w8, w9, [sp, #8]
	b.mi	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	cmp	w9, w24
	b.gt	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=2
	tbz	w8, #31, LBB0_10
	b	LBB0_4
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=2
	cmp	w9, w19
	csel	w8, w9, w19, gt
	add	w8, w12, w8
	cmp	w8, w14
	cinc	w9, w14, ne
	sub	w9, w8, w9
	cmp	w8, w14
	add	w8, w27, w13
	udiv	w9, w9, w20
	cinc	w13, w9, ne
	madd	w8, w13, w20, w8
	add	w10, w28, w10
	sub	w9, w8, w12
	add	w8, w11, w13
	sub	w8, w10, w8
	stp	w8, w9, [sp, #8]
	cmp	w9, w24
	b.le	LBB0_7
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=2
	cmp	w9, w25
	csel	w10, w9, w25, lt
	mvn	w10, w10
	add	w11, w20, w9
	add	w10, w10, w11
	udiv	w10, w10, w20
	add	w8, w8, w10
	add	w9, w9, w19
	madd	w9, w10, w19, w9
	add	w8, w8, #1
	stp	w8, w9, [sp, #8]
	tbnz	w8, #31, LBB0_4
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=2
	add	x0, sp, #4
	bl	_FD_ZERO
	ldr	x0, [x26]
	add	x1, sp, #4
	bl	_FD_SET
	ldr	x8, [x26]
	add	x0, x8, #1
	add	x1, sp, #4
	add	x4, sp, #8
	mov	x2, #0
	mov	x3, #0
	bl	_select
	cmp	w0, #1
	b.lt	LBB0_3
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=2
	bl	_getch
	bl	_keyboard_dispatch
	cbnz	x0, LBB0_1
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=2
	bl	_refresh
	b	LBB0_5
LBB0_13:                                ;   in Loop: Header=BB0_5 Depth=2
Lloh19:
	adrp	x8, _errno@GOTPAGE
Lloh20:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	ldr	x9, [x21]
	cmp	x8, x9
	b.eq	LBB0_4
; %bb.14:
	mov	w0, #1
	bl	_exit
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_delay,4,2                      ; @delay
	.comm	_col,8,3                        ; @col
	.comm	_CMDLINE,4,2                    ; @CMDLINE
	.comm	_STDIN_FILENO,8,3               ; @STDIN_FILENO
	.comm	_line,8,3                       ; @line
	.comm	_errno,8,3                      ; @errno
	.comm	_EINTR,8,3                      ; @EINTR
.subsections_via_symbols
