	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function m920x_rc_query
_m920x_rc_query:                        ## @m920x_rc_query
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	24(%rdi), %r12
	movl	16(%rdi), %edi
	movq	_M9206_CORE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_M9206_RC_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-56(%rbp), %r8
	xorl	%edx, %edx
	movl	$1, %r9d
	callq	_m920x_read
	testl	%eax, %eax
	jne	LBB0_23
## %bb.1:
	movl	16(%r13), %edi
	movl	(%rbx), %esi
	movq	_M9206_RC_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-52(%rbp), %r8
	xorl	%edx, %edx
	movl	$1, %r9d
	callq	_m920x_read
	testl	%eax, %eax
	jne	LBB0_23
## %bb.2:
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%r13)
	jle	LBB0_3
## %bb.4:
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rdi
	addq	%rbx, %rdi
	callq	_rc5_data
	movl	-52(%rbp), %esi
	cmpl	%esi, %eax
	je	LBB0_6
## %bb.15:                              ##   in Loop: Header=BB0_5 Depth=1
	incq	%r14
	movslq	(%r13), %rax
	addq	$4, %rbx
	cmpq	%rax, %r14
	jl	LBB0_5
	jmp	LBB0_16
LBB0_3:
	movl	-52(%rbp), %esi
LBB0_16:
	testl	%esi, %esi
	je	LBB0_19
## %bb.17:
	leaq	L_.str.1(%rip), %rdi
LBB0_18:
	callq	_deb
LBB0_19:
	movq	_REMOTE_NO_KEY_PRESSED@GOTPCREL(%rip), %rax
LBB0_20:
	movl	(%rax), %eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
LBB0_21:
	movl	%eax, (%rcx)
LBB0_22:
	xorl	%eax, %eax
LBB0_23:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_25
## %bb.24:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	8(%r13), %rax
	movl	(%rax,%rbx), %eax
	movl	%eax, (%r15)
	movl	-56(%rbp), %esi
	leal	-128(%rsi), %eax
	cmpl	$88, %eax
	ja	LBB0_14
## %bb.7:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_9:
	movl	$0, (%r12)
	movq	_REMOTE_KEY_PRESSED@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_8:
	movq	_REMOTE_NO_KEY_PRESSED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movl	$0, (%r12)
	jmp	LBB0_22
LBB0_10:
	movl	(%r12), %eax
	leal	1(%rax), %ecx
	movl	%ecx, (%r12)
	cmpl	$2, %eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	jl	LBB0_13
## %bb.11:
	movq	_REMOTE_KEY_REPEAT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_21
LBB0_14:
	leaq	L_.str(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	jmp	LBB0_18
LBB0_13:
	movq	_REMOTE_NO_KEY_PRESSED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_21
LBB0_25:
	callq	___stack_chk_fail
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_19, LBB0_19-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
LJTI0_0:
	.long	L0_0_set_19
	.long	L0_0_set_10
	.long	L0_0_set_9
	.long	L0_0_set_9
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_8
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_10
	.long	L0_0_set_9
	.long	L0_0_set_9
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_8
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_8
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_8
	.end_data_region
                                        ## -- End function
	.comm	_M9206_CORE,4,2                 ## @M9206_CORE
	.comm	_M9206_RC_STATE,4,2             ## @M9206_RC_STATE
	.comm	_M9206_RC_KEY,4,2               ## @M9206_RC_KEY
	.comm	_REMOTE_NO_KEY_PRESSED,4,2      ## @REMOTE_NO_KEY_PRESSED
	.comm	_REMOTE_KEY_PRESSED,4,2         ## @REMOTE_KEY_PRESSED
	.comm	_REMOTE_KEY_REPEAT,4,2          ## @REMOTE_KEY_REPEAT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unexpected rc state %02x\n"

L_.str.1:                               ## @.str.1
	.asciz	"Unknown rc key %02x\n"

	.no_dead_strip	_m920x_rc_query
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function m920x_rc_query
_m920x_rc_query:                        ; @m920x_rc_query
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #8]
	ldr	x22, [x0, #24]
	ldr	w0, [x0, #16]
Lloh3:
	adrp	x23, _M9206_CORE@GOTPAGE
Lloh4:
	ldr	x23, [x23, _M9206_CORE@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh5:
	adrp	x8, _M9206_RC_STATE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _M9206_RC_STATE@GOTPAGEOFF]
Lloh7:
	ldr	w3, [x8]
	mov	x24, sp
	mov	x4, sp
	mov	w2, #0
	mov	w5, #1
	bl	_m920x_read
	cbnz	w0, LBB0_12
; %bb.1:
	ldr	w0, [x21, #16]
	ldr	w1, [x23]
Lloh8:
	adrp	x8, _M9206_RC_KEY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _M9206_RC_KEY@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
	add	x4, x24, #4
	mov	w2, #0
	mov	w5, #1
	bl	_m920x_read
	cbnz	w0, LBB0_12
; %bb.2:
	ldr	w8, [x21]
	cmp	w8, #0
	b.le	LBB0_6
; %bb.3:
	mov	x23, #0
	mov	x24, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #8]
	add	x0, x8, x23
	bl	_rc5_data
	ldr	w1, [sp, #4]
	cmp	w0, w1
	b.eq	LBB0_14
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x24, x24, #1
	ldrsw	x8, [x21]
	add	x23, x23, #4
	cmp	x24, x8
	b.lt	LBB0_4
	b	LBB0_7
LBB0_6:
	ldr	w1, [sp, #4]
LBB0_7:
	cbz	w1, LBB0_10
; %bb.8:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_9:
	bl	_deb
LBB0_10:
	mov	w0, #0
Lloh13:
	adrp	x8, _REMOTE_NO_KEY_PRESSED@GOTPAGE
Lloh14:
	ldr	x8, [x8, _REMOTE_NO_KEY_PRESSED@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_12:
	ldr	x8, [sp, #8]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_21
; %bb.13:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_14:
	ldr	x8, [x21, #8]
	ldr	w8, [x8, x23]
	str	w8, [x20]
	ldr	w1, [sp]
	sub	w8, w1, #128
	cmp	w8, #88
	b.hi	LBB0_20
; %bb.15:
Lloh18:
	adrp	x9, lJTI0_0@PAGE
Lloh19:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_10
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_16:
	mov	w0, #0
	str	wzr, [x22]
Lloh20:
	adrp	x8, _REMOTE_KEY_PRESSED@GOTPAGE
Lloh21:
	ldr	x8, [x8, _REMOTE_KEY_PRESSED@GOTPAGEOFF]
	b	LBB0_11
LBB0_17:
	mov	w0, #0
Lloh22:
	adrp	x8, _REMOTE_NO_KEY_PRESSED@GOTPAGE
Lloh23:
	ldr	x8, [x8, _REMOTE_NO_KEY_PRESSED@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	str	w8, [x19]
	str	wzr, [x22]
	b	LBB0_12
LBB0_18:
	ldr	w8, [x22]
	add	w9, w8, #1
	str	w9, [x22]
	cmp	w8, #2
	b.lt	LBB0_10
; %bb.19:
	mov	w0, #0
Lloh25:
	adrp	x8, _REMOTE_KEY_REPEAT@GOTPAGE
Lloh26:
	ldr	x8, [x8, _REMOTE_KEY_REPEAT@GOTPAGEOFF]
	b	LBB0_11
LBB0_20:
Lloh27:
	adrp	x0, l_.str@PAGE
Lloh28:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_9
LBB0_21:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_10-LBB0_10)>>2
	.byte	(LBB0_18-LBB0_10)>>2
	.byte	(LBB0_16-LBB0_10)>>2
	.byte	(LBB0_16-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_17-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_18-LBB0_10)>>2
	.byte	(LBB0_16-LBB0_10)>>2
	.byte	(LBB0_16-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_17-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_17-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_20-LBB0_10)>>2
	.byte	(LBB0_17-LBB0_10)>>2
                                        ; -- End function
	.comm	_M9206_CORE,4,2                 ; @M9206_CORE
	.comm	_M9206_RC_STATE,4,2             ; @M9206_RC_STATE
	.comm	_M9206_RC_KEY,4,2               ; @M9206_RC_KEY
	.comm	_REMOTE_NO_KEY_PRESSED,4,2      ; @REMOTE_NO_KEY_PRESSED
	.comm	_REMOTE_KEY_PRESSED,4,2         ; @REMOTE_KEY_PRESSED
	.comm	_REMOTE_KEY_REPEAT,4,2          ; @REMOTE_KEY_REPEAT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unexpected rc state %02x\n"

l_.str.1:                               ; @.str.1
	.asciz	"Unknown rc key %02x\n"

	.no_dead_strip	_m920x_rc_query
.subsections_via_symbols
