	.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, %rbx
	movq	%rdi, %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$2, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	16(%r15), %edi
	movq	_M9206_CORE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_M9206_RC_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%edx, %edx
	movq	%r12, %r8
	movl	$1, %r9d
	callq	_m920x_read
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_14
## %bb.3:
	movl	16(%r15), %edi
	movl	(%rbx), %esi
	movq	_M9206_RC_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %r13
	addq	$8, %r13
	xorl	%edx, %edx
	movq	%r13, %r8
	movl	$1, %r9d
	callq	_m920x_read
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_14
## %bb.4:
	movq	(%r12), %rsi
	movq	%r15, %rdi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_m920x_parse_rc_state
	cmpl	$0, (%r15)
	jle	LBB0_5
## %bb.6:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rdi
	addq	%r14, %rdi
	callq	_rc5_data
	movq	(%r13), %rsi
	cmpq	%rsi, %rax
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	incq	%rbx
	movslq	(%r15), %rax
	addq	$4, %r14
	cmpq	%rax, %rbx
	jl	LBB0_7
	jmp	LBB0_10
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_15
LBB0_5:
	movq	(%r13), %rsi
LBB0_10:
	movq	_REMOTE_NO_KEY_PRESSED@GOTPCREL(%rip), %r14
	testq	%rsi, %rsi
	je	LBB0_12
## %bb.11:
	leaq	L_.str(%rip), %rdi
	callq	_deb
LBB0_12:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	jmp	LBB0_13
LBB0_8:
	addq	8(%r15), %r14
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
LBB0_13:
	movl	(%r14), %eax
	movl	%eax, (%rcx)
	xorl	%r14d, %r14d
LBB0_14:
	movq	%r12, %rdi
	callq	_kfree
LBB0_15:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unknown rc key %02x\n"

	.comm	_REMOTE_NO_KEY_PRESSED,4,2      ## @REMOTE_NO_KEY_PRESSED
	.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:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #2
	bl	_kmalloc
	cbz	x0, LBB0_7
; %bb.1:
	mov	x19, x0
	ldr	w0, [x22, #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	w2, #0
	mov	x4, x19
	mov	w5, #1
	bl	_m920x_read
	mov	x24, x0
	cbnz	w0, LBB0_14
; %bb.2:
	ldr	w0, [x22, #16]
	ldr	w1, [x23]
Lloh8:
	adrp	x8, _M9206_RC_KEY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _M9206_RC_KEY@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
	add	x23, x19, #8
	mov	w2, #0
	mov	x4, x23
	mov	w5, #1
	bl	_m920x_read
	mov	x24, x0
	cbnz	w0, LBB0_14
; %bb.3:
	ldr	x1, [x19]
	mov	x0, x22
	mov	x2, x20
	bl	_m920x_parse_rc_state
	ldr	w8, [x22]
	cmp	w8, #0
	b.le	LBB0_8
; %bb.4:
	mov	x24, #0
	mov	x25, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22, #8]
	add	x0, x8, x24
	bl	_rc5_data
	ldr	x1, [x23]
	cmp	x0, x1
	b.eq	LBB0_12
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x25, x25, #1
	ldrsw	x8, [x22]
	add	x24, x24, #4
	cmp	x25, x8
	b.lt	LBB0_5
	b	LBB0_9
LBB0_7:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_15
LBB0_8:
	ldr	x1, [x23]
LBB0_9:
	cbz	x1, LBB0_11
; %bb.10:
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	bl	_deb
LBB0_11:
Lloh16:
	adrp	x8, _REMOTE_NO_KEY_PRESSED@GOTPAGE
Lloh17:
	ldr	x8, [x8, _REMOTE_NO_KEY_PRESSED@GOTPAGEOFF]
	mov	x21, x20
	b	LBB0_13
LBB0_12:
	ldr	x8, [x22, #8]
	add	x8, x8, x24
LBB0_13:
	mov	w24, #0
	ldr	w8, [x8]
	str	w8, [x21]
LBB0_14:
	mov	x0, x19
	bl	_kfree
LBB0_15:
	mov	x0, x24
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.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
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unknown rc key %02x\n"

	.comm	_REMOTE_NO_KEY_PRESSED,4,2      ; @REMOTE_NO_KEY_PRESSED
	.no_dead_strip	_m920x_rc_query
.subsections_via_symbols
