	.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	$7, %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
LBB0_4:
	cmpq	$0, 24(%r12)
	je	LBB0_7
## %bb.5:
	cmpl	%ebx, (%r12)
	jne	LBB0_6
## %bb.20:
	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.21:
	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
	movq	_RC_PROTO_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edx
	xorl	%ecx, %ecx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rc_keydown                     ## TAILCALL
LBB0_8:
	movq	_CX88_BOARD_PROLINK_PLAYTVPVR@GOTPCREL(%rip), %rcx
	cmpq	%rax, (%rcx)
	je	LBB0_10
## %bb.9:
	movq	_CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO@GOTPCREL(%rip), %rcx
	cmpq	%rax, (%rcx)
	je	LBB0_10
## %bb.13:
	movl	4(%r12), %eax
	testl	%eax, %eax
	je	LBB0_16
## %bb.14:
	movl	12(%r12), %edi
	testl	%r15d, %eax
	je	LBB0_19
LBB0_15:
	movq	_RC_PROTO_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edx
	jmp	LBB0_12
LBB0_1:
	movl	%ebx, %r15d
	cmpl	$135, %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
	jmp	LBB0_4
LBB0_10:
	movl	%r14d, %eax
	shrl	$8, %eax
	movzwl	%ax, %edi
	movzbl	%r14b, %esi
	callq	_RC_SCANCODE_NECX
	movl	12(%r12), %edi
	testl	%r15d, 8(%r12)
	je	LBB0_11
LBB0_19:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rc_keyup                       ## TAILCALL
LBB0_16:
	movl	8(%r12), %eax
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	movl	12(%r12), %edi
	testl	%r15d, %eax
	jne	LBB0_19
	jmp	LBB0_15
LBB0_11:
	movq	_RC_PROTO_NECX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edx
LBB0_12:
	xorl	%ecx, %ecx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rc_keydown_notimeout           ## TAILCALL
LBB0_18:
	movl	12(%r12), %edi
	movq	_RC_PROTO_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edx
	xorl	%ecx, %ecx
	callq	_rc_keydown_notimeout
	movl	12(%r12), %edi
	jmp	LBB0_19
	.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
	.comm	_RC_PROTO_UNKNOWN,4,2           ## @RC_PROTO_UNKNOWN
	.comm	_CX88_BOARD_PROLINK_PLAYTVPVR,8,3 ## @CX88_BOARD_PROLINK_PLAYTVPVR
	.comm	_CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO,8,3 ## @CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO
	.comm	_RC_PROTO_NECX,4,2              ## @RC_PROTO_NECX
	.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, #7
	b.hs	LBB0_13
; %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
LBB0_2:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_6
; %bb.3:
	ldr	w8, [x19]
	cmp	w8, w21
	b.ne	LBB0_5
; %bb.4:
	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_5:
	str	w21, [x19]
LBB0_6:
	ldr	w1, [x19, #32]
	mov	x0, x20
	bl	_ir_extract_bits
	mov	x21, x0
	ldr	x8, [x19, #24]
Lloh3:
	adrp	x9, l_.str.1@PAGE
Lloh4:
	add	x9, x9, l_.str.1@PAGEOFF
Lloh5:
	adrp	x10, l_.str.2@PAGE
Lloh6:
	add	x10, x10, l_.str.2@PAGEOFF
	cmp	x8, #0
	csel	x3, x10, x9, eq
Lloh7:
	adrp	x8, l_.str.3@PAGE
Lloh8:
	add	x8, x8, l_.str.3@PAGEOFF
Lloh9:
	adrp	x9, l_.str.4@PAGE
Lloh10:
	add	x9, x9, l_.str.4@PAGEOFF
	ldp	w10, w11, [x19, #4]
	tst	w10, w20
	csel	x4, x9, x8, eq
Lloh11:
	adrp	x8, l_.str.5@PAGE
Lloh12:
	add	x8, x8, l_.str.5@PAGEOFF
	tst	w11, w20
	csel	x5, x9, x8, eq
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x21
	bl	_ir_dprintk
	ldr	x8, [x19, #16]
	ldrsw	x8, [x8]
Lloh15:
	adrp	x9, _CX88_BOARD_NORWOOD_MICRO@GOTPAGE
Lloh16:
	ldr	x9, [x9, _CX88_BOARD_NORWOOD_MICRO@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
Lloh18:
	adrp	x8, _MO_GP0_IO@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MO_GP0_IO@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	bl	_cx_read
	lsl	w2, w21, #4
	bfxil	w2, w0, #4, #4
Lloh21:
	adrp	x8, _RC_PROTO_UNKNOWN@GOTPAGE
Lloh22:
	ldr	x8, [x8, _RC_PROTO_UNKNOWN@GOTPAGEOFF]
	ldr	w0, [x19, #12]
Lloh23:
	ldr	w1, [x8]
	mov	w3, #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_8:
Lloh24:
	adrp	x9, _CX88_BOARD_PROLINK_PLAYTVPVR@GOTPAGE
Lloh25:
	ldr	x9, [x9, _CX88_BOARD_PROLINK_PLAYTVPVR@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x9, x8
	b.eq	LBB0_15
; %bb.9:
Lloh27:
	adrp	x9, _CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO@GOTPAGE
Lloh28:
	ldr	x9, [x9, _CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	cmp	x9, x8
	b.eq	LBB0_15
; %bb.10:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_17
; %bb.11:
	ldr	w0, [x19, #12]
	tst	w8, w20
	b.eq	LBB0_16
LBB0_12:
Lloh30:
	adrp	x8, _RC_PROTO_UNKNOWN@GOTPAGE
Lloh31:
	ldr	x8, [x8, _RC_PROTO_UNKNOWN@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	mov	x2, x21
	b	LBB0_20
LBB0_13:
	mov	x20, x21
	cmp	w8, #135
	b.ne	LBB0_2
; %bb.14:
Lloh33:
	adrp	x8, _MO_GP1_IO@GOTPAGE
Lloh34:
	ldr	x8, [x8, _MO_GP1_IO@GOTPAGEOFF]
Lloh35:
	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
	b	LBB0_2
LBB0_15:
	ubfx	w0, w21, #8, #16
	and	w1, w21, #0xff
	bl	_RC_SCANCODE_NECX
	mov	x2, x0
	ldp	w8, w0, [x19, #8]
	tst	w8, w20
	b.eq	LBB0_19
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
LBB0_17:
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_21
; %bb.18:
	ldr	w0, [x19, #12]
	tst	w8, w20
	b.ne	LBB0_16
	b	LBB0_12
LBB0_19:
Lloh36:
	adrp	x8, _RC_PROTO_NECX@GOTPAGE
Lloh37:
	ldr	x8, [x8, _RC_PROTO_NECX@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
LBB0_20:
	mov	w3, #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_21:
	ldr	w0, [x19, #12]
Lloh39:
	adrp	x8, _RC_PROTO_UNKNOWN@GOTPAGE
Lloh40:
	ldr	x8, [x8, _RC_PROTO_UNKNOWN@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
	mov	x2, x21
	mov	w3, #0
	bl	_rc_keydown_notimeout
	ldr	w0, [x19, #12]
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.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
	.comm	_RC_PROTO_UNKNOWN,4,2           ; @RC_PROTO_UNKNOWN
	.comm	_CX88_BOARD_PROLINK_PLAYTVPVR,8,3 ; @CX88_BOARD_PROLINK_PLAYTVPVR
	.comm	_CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO,8,3 ; @CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO
	.comm	_RC_PROTO_NECX,4,2              ; @RC_PROTO_NECX
	.no_dead_strip	_cx88_ir_handle_key
.subsections_via_symbols
