	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cx88_ir_handle_key
_cx88_ir_handle_key:                    ## @cx88_ir_handle_key
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	16(%rdi), %r14
	movl	36(%rdi), %edi
	callq	_cx_read
	movl	%eax, %ebx
	movl	(%r14), %eax
	leal	-128(%rax), %ecx
	cmpl	$3, %ecx
	jae	LBB0_1
## %bb.3:
	andl	$1791, %ebx                     ## imm = 0x6FF
	movq	_MO_GP1_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cx_read
	andl	$9, %eax
	shll	$8, %eax
	orl	%eax, %ebx
	movl	%ebx, %r15d
	jmp	LBB0_4
LBB0_1:
	movl	%ebx, %r15d
	cmpl	$131, %eax
	jne	LBB0_4
## %bb.2:
	movq	_MO_GP1_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cx_read
	andl	$2045, %ebx                     ## imm = 0x7FD
	movl	%eax, %r15d
	andl	$239, %r15d
	addl	%ebx, %r15d
	movl	%eax, %ebx
LBB0_4:
	cmpq	$0, 24(%r12)
	je	LBB0_7
## %bb.5:
	cmpl	%ebx, (%r12)
	jne	LBB0_6
## %bb.15:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	%ebx, (%r12)
LBB0_7:
	movl	32(%r12), %esi
	movl	%r15d, %edi
	callq	_ir_extract_bits
	cmpq	$0, 24(%r12)
	leaq	L_.str.2(%rip), %rdx
	leaq	L_.str.1(%rip), %rcx
	cmoveq	%rdx, %rcx
	movl	%eax, %r14d
	movl	4(%r12), %eax
	andl	%r15d, %eax
	leaq	L_.str.4(%rip), %rax
	leaq	L_.str.3(%rip), %r8
	cmoveq	%rax, %r8
	movl	8(%r12), %edx
	andl	%r15d, %edx
	leaq	L_.str.5(%rip), %r9
	cmoveq	%rax, %r9
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	movl	%r14d, %edx
	callq	_ir_dprintk
	movq	16(%r12), %rax
	movslq	(%rax), %rax
	movq	_CX88_BOARD_NORWOOD_MICRO@GOTPCREL(%rip), %rcx
	cmpq	%rax, (%rcx)
	jne	LBB0_8
## %bb.16:
	movq	_MO_GP0_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cx_read
	shll	$4, %r14d
	shrl	$4, %eax
	andl	$15, %eax
	orl	%eax, %r14d
	movl	12(%r12), %edi
	movl	%r14d, %esi
	xorl	%edx, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rc_keydown                     ## TAILCALL
LBB0_8:
	movl	4(%r12), %eax
	testl	%eax, %eax
	je	LBB0_11
## %bb.9:
	movl	12(%r12), %edi
	testl	%r15d, %eax
	je	LBB0_10
LBB0_13:
	movl	%r14d, %esi
	xorl	%edx, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rc_keydown_notimeout           ## TAILCALL
LBB0_11:
	movl	8(%r12), %eax
	testl	%eax, %eax
	je	LBB0_14
## %bb.12:
	movl	12(%r12), %edi
	testl	%r15d, %eax
	jne	LBB0_10
	jmp	LBB0_13
LBB0_14:
	movl	12(%r12), %edi
	movl	%r14d, %esi
	xorl	%edx, %edx
	callq	_rc_keydown_notimeout
	movl	12(%r12), %edi
LBB0_10:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rc_keyup                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MO_GP1_IO,4,2                  ## @MO_GP1_IO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"irq gpio=0x%x code=%d | %s%s%s\n"

L_.str.1:                               ## @.str.1
	.asciz	"poll"

L_.str.2:                               ## @.str.2
	.asciz	"irq"

L_.str.3:                               ## @.str.3
	.asciz	" down"

L_.str.4:                               ## @.str.4
	.space	1

L_.str.5:                               ## @.str.5
	.asciz	" up"

	.comm	_CX88_BOARD_NORWOOD_MICRO,8,3   ## @CX88_BOARD_NORWOOD_MICRO
	.comm	_MO_GP0_IO,4,2                  ## @MO_GP0_IO
	.no_dead_strip	_cx88_ir_handle_key
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cx88_ir_handle_key
_cx88_ir_handle_key:                    ; @cx88_ir_handle_key
	.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
	ldr	x20, [x0, #16]
	ldr	w0, [x0, #36]
	bl	_cx_read
	mov	x21, x0
	ldr	w8, [x20]
	sub	w9, w8, #128
	cmp	w9, #3
	b.hs	LBB0_2
; %bb.1:
	mov	w8, #1791
	and	w20, w21, w8
Lloh0:
	adrp	x8, _MO_GP1_IO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MO_GP1_IO@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_cx_read
	mov	w8, #2304
	and	w8, w8, w0, lsl #8
	orr	w21, w8, w20
	mov	x20, x21
	b	LBB0_4
LBB0_2:
	mov	x20, x21
	cmp	w8, #131
	b.ne	LBB0_4
; %bb.3:
Lloh3:
	adrp	x8, _MO_GP1_IO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MO_GP1_IO@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_cx_read
	mov	w8, #2045
	and	w8, w21, w8
	mov	w9, #239
	and	w9, w0, w9
	add	w20, w9, w8
	mov	x21, x0
LBB0_4:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_8
; %bb.5:
	ldr	w8, [x19]
	cmp	w8, w21
	b.ne	LBB0_7
; %bb.6:
	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
LBB0_7:
	str	w21, [x19]
LBB0_8:
	ldr	w1, [x19, #32]
	mov	x0, x20
	bl	_ir_extract_bits
	mov	x21, x0
	ldr	x8, [x19, #24]
Lloh6:
	adrp	x9, l_.str.1@PAGE
Lloh7:
	add	x9, x9, l_.str.1@PAGEOFF
Lloh8:
	adrp	x10, l_.str.2@PAGE
Lloh9:
	add	x10, x10, l_.str.2@PAGEOFF
	cmp	x8, #0
	csel	x3, x10, x9, eq
Lloh10:
	adrp	x8, l_.str.3@PAGE
Lloh11:
	add	x8, x8, l_.str.3@PAGEOFF
Lloh12:
	adrp	x9, l_.str.4@PAGE
Lloh13:
	add	x9, x9, l_.str.4@PAGEOFF
	ldp	w10, w11, [x19, #4]
	tst	w10, w20
	csel	x4, x9, x8, eq
Lloh14:
	adrp	x8, l_.str.5@PAGE
Lloh15:
	add	x8, x8, l_.str.5@PAGEOFF
	tst	w11, w20
	csel	x5, x9, x8, eq
Lloh16:
	adrp	x0, l_.str@PAGE
Lloh17:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x21
	bl	_ir_dprintk
	ldr	x8, [x19, #16]
	ldrsw	x8, [x8]
Lloh18:
	adrp	x9, _CX88_BOARD_NORWOOD_MICRO@GOTPAGE
Lloh19:
	ldr	x9, [x9, _CX88_BOARD_NORWOOD_MICRO@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.9:
Lloh21:
	adrp	x8, _MO_GP0_IO@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MO_GP0_IO@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	bl	_cx_read
	lsl	w1, w21, #4
	bfxil	w1, w0, #4, #4
	ldr	w0, [x19, #12]
	mov	w2, #0
	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	_rc_keydown
LBB0_10:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_13
; %bb.11:
	ldr	w0, [x19, #12]
	tst	w8, w20
	b.eq	LBB0_16
LBB0_12:
	mov	x1, x21
	mov	w2, #0
	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	_rc_keydown_notimeout
LBB0_13:
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_15
; %bb.14:
	ldr	w0, [x19, #12]
	tst	w8, w20
	b.ne	LBB0_16
	b	LBB0_12
LBB0_15:
	ldr	w0, [x19, #12]
	mov	x1, x21
	mov	w2, #0
	bl	_rc_keydown_notimeout
	ldr	w0, [x19, #12]
LBB0_16:
	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	_rc_keyup
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_MO_GP1_IO,4,2                  ; @MO_GP1_IO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"irq gpio=0x%x code=%d | %s%s%s\n"

l_.str.1:                               ; @.str.1
	.asciz	"poll"

l_.str.2:                               ; @.str.2
	.asciz	"irq"

l_.str.3:                               ; @.str.3
	.asciz	" down"

l_.str.4:                               ; @.str.4
	.space	1

l_.str.5:                               ; @.str.5
	.asciz	" up"

	.comm	_CX88_BOARD_NORWOOD_MICRO,8,3   ; @CX88_BOARD_NORWOOD_MICRO
	.comm	_MO_GP0_IO,4,2                  ; @MO_GP0_IO
	.no_dead_strip	_cx88_ir_handle_key
.subsections_via_symbols
