	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function m920x_rc_core_query
_m920x_rc_core_query:                   ## @m920x_rc_core_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	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
	movl	4(%r14), %edi
	movq	_M9206_CORE@GOTPCREL(%rip), %r15
	movl	(%r15), %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, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.3:
	movl	4(%r14), %edi
	movl	(%r15), %esi
	movq	_M9206_RC_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %r15
	addq	$4, %r15
	xorl	%edx, %edx
	movq	%r15, %r8
	movl	$1, %r9d
	callq	_m920x_read
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.4:
	movl	(%r12), %esi
	movl	4(%r12), %edx
	leaq	L_.str(%rip), %rdi
	callq	_deb
	movl	(%r12), %esi
	leaq	-36(%rbp), %rdx
	movq	%r14, %rdi
	callq	_m920x_parse_rc_state
	movl	-36(%rbp), %eax
	movq	_REMOTE_NO_KEY_PRESSED@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_6
## %bb.5:
	movl	(%r14), %edi
	callq	_rc_keyup
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_6:
	movq	_REMOTE_KEY_REPEAT@GOTPCREL(%rip), %rcx
	movl	(%r14), %edi
	cmpl	(%rcx), %eax
	jne	LBB0_8
## %bb.7:
	callq	_rc_repeat
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_8:
	movq	_RC_PROTO_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %edx
	xorl	%ebx, %ebx
	xorl	%ecx, %ecx
	callq	_rc_keydown
LBB0_9:
	movq	%r12, %rdi
	callq	_kfree
LBB0_10:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	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	"state=0x%02x keycode=0x%02x\n"

	.comm	_REMOTE_NO_KEY_PRESSED,4,2      ## @REMOTE_NO_KEY_PRESSED
	.comm	_REMOTE_KEY_REPEAT,4,2          ## @REMOTE_KEY_REPEAT
	.comm	_RC_PROTO_UNKNOWN,4,2           ## @RC_PROTO_UNKNOWN
	.no_dead_strip	_m920x_rc_core_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_core_query
_m920x_rc_core_query:                   ; @m920x_rc_core_query
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, 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_5
; %bb.1:
	mov	x19, x0
	ldr	w0, [x20, #4]
Lloh3:
	adrp	x21, _M9206_CORE@GOTPAGE
Lloh4:
	ldr	x21, [x21, _M9206_CORE@GOTPAGEOFF]
	ldr	w1, [x21]
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	x22, x0
	cbnz	w0, LBB0_10
; %bb.2:
	ldr	w0, [x20, #4]
	ldr	w1, [x21]
Lloh8:
	adrp	x8, _M9206_RC_KEY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _M9206_RC_KEY@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
	add	x21, x19, #4
	mov	w2, #0
	mov	x4, x21
	mov	w5, #1
	bl	_m920x_read
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.3:
	ldp	w1, w2, [x19]
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_deb
	ldr	w1, [x19]
	add	x2, sp, #12
	mov	x0, x20
	bl	_m920x_parse_rc_state
	ldr	w8, [sp, #12]
Lloh13:
	adrp	x9, _REMOTE_NO_KEY_PRESSED@GOTPAGE
Lloh14:
	ldr	x9, [x9, _REMOTE_NO_KEY_PRESSED@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_6
; %bb.4:
	ldr	w0, [x20]
	bl	_rc_keyup
	b	LBB0_9
LBB0_5:
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_11
LBB0_6:
Lloh19:
	adrp	x9, _REMOTE_KEY_REPEAT@GOTPAGE
Lloh20:
	ldr	x9, [x9, _REMOTE_KEY_REPEAT@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	ldr	w0, [x20]
	cmp	w8, w9
	b.ne	LBB0_8
; %bb.7:
	bl	_rc_repeat
	b	LBB0_9
LBB0_8:
Lloh22:
	adrp	x8, _RC_PROTO_UNKNOWN@GOTPAGE
Lloh23:
	ldr	x8, [x8, _RC_PROTO_UNKNOWN@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	ldr	w2, [x21]
	mov	w3, #0
	bl	_rc_keydown
LBB0_9:
	mov	w22, #0
LBB0_10:
	mov	x0, x19
	bl	_kfree
LBB0_11:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.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	"state=0x%02x keycode=0x%02x\n"

	.comm	_REMOTE_NO_KEY_PRESSED,4,2      ; @REMOTE_NO_KEY_PRESSED
	.comm	_REMOTE_KEY_REPEAT,4,2          ; @REMOTE_KEY_REPEAT
	.comm	_RC_PROTO_UNKNOWN,4,2           ; @RC_PROTO_UNKNOWN
	.no_dead_strip	_m920x_rc_core_query
.subsections_via_symbols
