	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dib0700_rc_query_old_firmware
_dib0700_rc_query_old_firmware:         ## @dib0700_rc_query_old_firmware
	.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	8(%rdi), %rbx
	xorl	%r12d, %r12d
	cmpl	$66047, (%rbx)                  ## imm = 0x101FF
	jg	LBB0_14
## %bb.1:
	movq	%rdi, %r14
	movq	_REQUEST_POLL_RC@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%rbx), %rcx
	movq	%rax, (%rcx)
	movq	$0, 8(%rcx)
	movq	%rcx, %rsi
	movl	$2, %edx
	movl	$4, %r8d
	callq	_dib0700_ctrl_rd
	testl	%eax, %eax
	jle	LBB0_2
## %bb.3:
	movq	8(%rbx), %rax
	cmpq	$0, (%rax)
	jne	LBB0_7
## %bb.4:
	cmpq	$0, 8(%rax)
	jne	LBB0_7
## %bb.5:
	cmpq	$0, 16(%rax)
	jne	LBB0_7
## %bb.6:
	cmpq	$0, 24(%rax)
	je	LBB0_14
LBB0_7:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_dib0700_rc_setup
	cmpl	$128, 4(%r14)
	jne	LBB0_12
## %bb.8:
	movq	8(%rbx), %rax
	movq	(%rax), %r12
	movq	8(%rax), %rdi
	movq	%rdi, %rcx
	orq	%r12, %rcx
	jne	LBB0_11
## %bb.9:
	xorl	%r12d, %r12d
	cmpq	$255, 24(%rax)
	jne	LBB0_11
## %bb.10:
	movl	(%r14), %edi
	callq	_rc_repeat
	jmp	LBB0_14
LBB0_2:
	leaq	L_.str(%rip), %rdi
	callq	_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_14
LBB0_12:
	movq	_RC_PROTO_RC5@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	8(%rbx), %rax
	movl	(%rax), %esi
	movl	8(%rax), %edi
	callq	_RC_SCANCODE_RC5
	movl	%eax, %edx
	movq	8(%rbx), %rax
	movl	16(%rax), %ecx
	jmp	LBB0_13
LBB0_11:
	movq	_RC_PROTO_NEC@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
                                        ## kill: def $edi killed $edi killed $rdi
	movl	%r12d, %esi
	callq	_RC_SCANCODE_NEC
	movl	%eax, %edx
	xorl	%ecx, %ecx
LBB0_13:
	movl	(%r14), %edi
	movl	%r15d, %esi
	callq	_rc_keydown
	xorl	%r12d, %r12d
LBB0_14:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REQUEST_POLL_RC,8,3            ## @REQUEST_POLL_RC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"RC Query Failed"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_RC_PROTO_NEC,4,2               ## @RC_PROTO_NEC
	.comm	_RC_PROTO_RC5,4,2               ## @RC_PROTO_RC5
	.no_dead_strip	_dib0700_rc_query_old_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dib0700_rc_query_old_firmware
_dib0700_rc_query_old_firmware:         ; @dib0700_rc_query_old_firmware
	.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
	ldr	x21, [x0, #8]
	ldr	w8, [x21]
	mov	w9, #511
	movk	w9, #1, lsl #16
	cmp	w8, w9
	b.gt	LBB0_15
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _REQUEST_POLL_RC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REQUEST_POLL_RC@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x1, [x21, #8]
	stp	x8, xzr, [x1]
	mov	w2, #2
	mov	x3, x1
	mov	w4, #4
	bl	_dib0700_ctrl_rd
	cmp	w0, #0
	b.le	LBB0_10
; %bb.2:
	ldr	x8, [x21, #8]
	ldr	x9, [x8]
	cbnz	x9, LBB0_6
; %bb.3:
	ldr	x9, [x8, #8]
	cbnz	x9, LBB0_6
; %bb.4:
	ldr	x9, [x8, #16]
	cbnz	x9, LBB0_6
; %bb.5:
	ldr	x8, [x8, #24]
	cbz	x8, LBB0_15
LBB0_6:
	mov	x0, x19
	mov	x1, #0
	bl	_dib0700_rc_setup
	ldr	w8, [x19, #4]
	cmp	w8, #128
	b.ne	LBB0_11
; %bb.7:
	ldr	x8, [x21, #8]
	ldp	x1, x0, [x8]
	orr	x9, x0, x1
	cbnz	x9, LBB0_13
; %bb.8:
	ldr	x8, [x8, #24]
	cmp	x8, #255
	b.ne	LBB0_12
; %bb.9:
	ldr	w0, [x19]
	bl	_rc_repeat
	b	LBB0_15
LBB0_10:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_err
Lloh5:
	adrp	x8, _EIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_16
LBB0_11:
Lloh8:
	adrp	x8, _RC_PROTO_RC5@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RC_PROTO_RC5@GOTPAGEOFF]
Lloh10:
	ldr	w20, [x8]
	ldr	x8, [x21, #8]
	ldr	w0, [x8, #8]
	ldr	w1, [x8]
	bl	_RC_SCANCODE_RC5
	mov	x2, x0
	ldr	x8, [x21, #8]
	ldr	w3, [x8, #16]
	b	LBB0_14
LBB0_12:
	mov	x1, #0
LBB0_13:
Lloh11:
	adrp	x8, _RC_PROTO_NEC@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RC_PROTO_NEC@GOTPAGEOFF]
Lloh13:
	ldr	w20, [x8]
                                        ; kill: def $w0 killed $w0 killed $x0
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_RC_SCANCODE_NEC
	mov	x2, x0
	mov	w3, #0
LBB0_14:
	ldr	w0, [x19]
	mov	x1, x20
	bl	_rc_keydown
LBB0_15:
	mov	w0, #0
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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_REQUEST_POLL_RC,8,3            ; @REQUEST_POLL_RC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"RC Query Failed"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_RC_PROTO_NEC,4,2               ; @RC_PROTO_NEC
	.comm	_RC_PROTO_RC5,4,2               ; @RC_PROTO_RC5
	.no_dead_strip	_dib0700_rc_query_old_firmware
.subsections_via_symbols
