	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function in_evdev_update_keycode
_in_evdev_update_keycode:               ## @in_evdev_update_keycode
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	48(%rdi), %edi
	leaq	-40(%rbp), %rsi
	movl	$16, %edx
	callq	_read
	cmpl	$15, %eax
	jg	LBB0_3
## %bb.1:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	_EAGAIN@GOTPCREL(%rip), %rdx
	movl	$-1, %eax
	xorl	%r15d, %r15d
	cmpq	(%rdx), %rcx
	je	LBB0_33
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_perror
	movl	$-2, %eax
	jmp	LBB0_33
LBB0_3:
	movq	-40(%rbp), %rax
	movq	_EV_KEY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.4:
	movl	-32(%rbp), %r15d
	cmpl	$1, %r15d
	jbe	LBB0_12
## %bb.5:
	movl	$-1, %eax
	xorl	%r15d, %r15d
	jmp	LBB0_33
LBB0_6:
	movq	_EV_ABS@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.7:
	cmpq	$0, 40(%rbx)
	je	LBB0_13
## %bb.8:
	movslq	(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_13
## %bb.9:
	movl	-28(%rbp), %ecx
	movq	_ABS_X@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_16
## %bb.10:
	movslq	-32(%rbp), %rdx
	movq	8(%rbx), %rcx
	addq	%rax, %rcx
	cmpq	%rdx, %rcx
	jle	LBB0_19
## %bb.11:
	movq	_KEY_LEFT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$20, %edx
	jmp	LBB0_27
LBB0_12:
	movl	-28(%rbp), %eax
	jmp	LBB0_33
LBB0_16:
	movq	_ABS_Y@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_13
## %bb.17:
	movslq	-32(%rbp), %rdx
	movq	24(%rbx), %rcx
	addq	%rax, %rcx
	cmpq	%rdx, %rcx
	jle	LBB0_23
## %bb.18:
	movq	_KEY_UP@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_19:
	movl	16(%rbx), %esi
	subl	%eax, %esi
	xorl	%ecx, %ecx
	cmpl	%esi, %edx
	jle	LBB0_21
## %bb.20:
	movq	_KEY_RIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_21:
	movl	$20, %edx
	jmp	LBB0_27
LBB0_23:
	movl	32(%rbx), %esi
	subl	%eax, %esi
	xorl	%ecx, %ecx
	cmpl	%esi, %edx
	jle	LBB0_26
## %bb.24:
	movq	_KEY_DOWN@GOTPCREL(%rip), %rax
LBB0_25:
	movl	(%rax), %ecx
LBB0_26:
	movl	$36, %edx
LBB0_27:
	movl	(%rbx,%rdx), %eax
	cmpl	%eax, %ecx
	jne	LBB0_29
LBB0_13:
	movl	$-1, %eax
LBB0_33:
	testq	%r14, %r14
	je	LBB0_35
## %bb.34:
	movl	%r15d, (%r14)
LBB0_35:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_29:
	testl	%ecx, %ecx
	je	LBB0_32
## %bb.30:
	testl	%eax, %eax
	jne	LBB0_32
## %bb.31:
	movl	%ecx, (%rbx,%rdx)
	movl	$1, %r15d
	movl	%ecx, %eax
	jmp	LBB0_33
LBB0_32:
	movl	$0, (%rbx,%rdx)
	jmp	LBB0_33
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,8,3                      ## @errno
	.comm	_EAGAIN,8,3                     ## @EAGAIN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"in_evdev: error reading"

	.comm	_EV_KEY,8,3                     ## @EV_KEY
	.comm	_EV_ABS,8,3                     ## @EV_ABS
	.comm	_ABS_X,4,2                      ## @ABS_X
	.comm	_KEY_LEFT,4,2                   ## @KEY_LEFT
	.comm	_KEY_RIGHT,4,2                  ## @KEY_RIGHT
	.comm	_ABS_Y,4,2                      ## @ABS_Y
	.comm	_KEY_UP,4,2                     ## @KEY_UP
	.comm	_KEY_DOWN,4,2                   ## @KEY_DOWN
	.no_dead_strip	_in_evdev_update_keycode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function in_evdev_update_keycode
_in_evdev_update_keycode:               ; @in_evdev_update_keycode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	w0, [x0, #48]
	mov	x1, sp
	mov	w2, #16
	bl	_read
	cmp	w0, #15
	b.gt	LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _errno@GOTPAGE
Lloh1:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _EAGAIN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EAGAIN@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_19
; %bb.2:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_perror
	mov	w8, #0
	mov	w0, #-2
	b	LBB0_21
LBB0_3:
	ldr	x8, [sp]
Lloh8:
	adrp	x9, _EV_KEY@GOTPAGE
Lloh9:
	ldr	x9, [x9, _EV_KEY@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.4:
	ldr	w8, [sp, #8]
	cmp	w8, #1
	b.hi	LBB0_19
; %bb.5:
	ldr	w0, [sp, #12]
	b	LBB0_21
LBB0_6:
Lloh11:
	adrp	x9, _EV_ABS@GOTPAGE
Lloh12:
	ldr	x9, [x9, _EV_ABS@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_19
; %bb.7:
	ldr	x8, [x20, #40]
	cbz	x8, LBB0_20
; %bb.8:
	ldrsw	x8, [x20]
	cbz	w8, LBB0_20
; %bb.9:
	ldr	w9, [sp, #12]
Lloh14:
	adrp	x10, _ABS_X@GOTPAGE
Lloh15:
	ldr	x10, [x10, _ABS_X@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ne	LBB0_12
; %bb.10:
	ldrsw	x9, [sp, #8]
	ldr	x10, [x20, #8]
	add	x10, x10, x8
	cmp	x10, x9
	b.le	LBB0_15
; %bb.11:
Lloh17:
	adrp	x8, _KEY_LEFT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _KEY_LEFT@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x8]
	mov	w10, #20
	b	LBB0_18
LBB0_12:
Lloh20:
	adrp	x10, _ABS_Y@GOTPAGE
Lloh21:
	ldr	x10, [x10, _ABS_Y@GOTPAGEOFF]
Lloh22:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ne	LBB0_19
; %bb.13:
	ldrsw	x9, [sp, #8]
	ldr	x10, [x20, #24]
	add	x10, x10, x8
	cmp	x10, x9
	b.le	LBB0_16
; %bb.14:
Lloh23:
	adrp	x8, _KEY_UP@GOTPAGE
Lloh24:
	ldr	x8, [x8, _KEY_UP@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x8]
	b	LBB0_17
LBB0_15:
Lloh26:
	adrp	x10, _KEY_RIGHT@GOTPAGE
Lloh27:
	ldr	x10, [x10, _KEY_RIGHT@GOTPAGEOFF]
	ldr	w11, [x20, #16]
Lloh28:
	ldr	w10, [x10]
	sub	w8, w11, w8
	cmp	w9, w8
	csel	w9, w10, wzr, gt
	mov	w10, #20
	b	LBB0_18
LBB0_16:
Lloh29:
	adrp	x10, _KEY_DOWN@GOTPAGE
Lloh30:
	ldr	x10, [x10, _KEY_DOWN@GOTPAGEOFF]
	ldr	w11, [x20, #32]
Lloh31:
	ldr	w10, [x10]
	sub	w8, w11, w8
	cmp	w9, w8
	csel	w9, w10, wzr, gt
LBB0_17:
	mov	w10, #36
LBB0_18:
	ldr	w0, [x20, x10]
	cmp	w9, w0
	b.ne	LBB0_24
LBB0_19:
	mov	w8, #0
LBB0_20:
	mov	w0, #-1
LBB0_21:
	cbz	x19, LBB0_23
; %bb.22:
	str	w8, [x19]
LBB0_23:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_24:
	cbz	w9, LBB0_27
; %bb.25:
	cbnz	w0, LBB0_27
; %bb.26:
	str	w9, [x20, x10]
	mov	w8, #1
	mov	x0, x9
	b	LBB0_21
LBB0_27:
	mov	w8, #0
	str	wzr, [x20, x10]
	b	LBB0_21
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,8,3                      ; @errno
	.comm	_EAGAIN,8,3                     ; @EAGAIN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"in_evdev: error reading"

	.comm	_EV_KEY,8,3                     ; @EV_KEY
	.comm	_EV_ABS,8,3                     ; @EV_ABS
	.comm	_ABS_X,4,2                      ; @ABS_X
	.comm	_KEY_LEFT,4,2                   ; @KEY_LEFT
	.comm	_KEY_RIGHT,4,2                  ; @KEY_RIGHT
	.comm	_ABS_Y,4,2                      ; @ABS_Y
	.comm	_KEY_UP,4,2                     ; @KEY_UP
	.comm	_KEY_DOWN,4,2                   ; @KEY_DOWN
	.no_dead_strip	_in_evdev_update_keycode
.subsections_via_symbols
