	.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	%r14
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	24(%rdi), %rax
	xorl	%r14d, %r14d
	cmpl	$66047, (%rax)                  ## imm = 0x101FF
	jg	LBB0_16
## %bb.1:
	movq	%rdi, %rbx
	movq	_rc_request@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-64(%rbp), %rcx
	movl	$2, %edx
	movl	$4, %r8d
	callq	_dib0700_ctrl_rd
	testl	%eax, %eax
	jle	LBB0_2
## %bb.3:
	cmpq	$0, -64(%rbp)
	jne	LBB0_7
## %bb.4:
	cmpq	$0, -56(%rbp)
	jne	LBB0_7
## %bb.5:
	cmpq	$0, -48(%rbp)
	jne	LBB0_7
## %bb.6:
	cmpq	$0, -40(%rbp)
	je	LBB0_16
LBB0_7:
	movq	%rbx, %rdi
	callq	_dib0700_rc_setup
	movq	$0, 8(%rbx)
	cmpl	$128, 16(%rbx)
	movq	-56(%rbp), %rsi
	jne	LBB0_14
## %bb.8:
	movq	-64(%rbp), %rax
	testq	%rsi, %rsi
	jne	LBB0_12
## %bb.9:
	testq	%rax, %rax
	jne	LBB0_12
## %bb.10:
	cmpq	$255, -40(%rbp)
	jne	LBB0_12
## %bb.11:
	xorl	%esi, %esi
	jmp	LBB0_13
LBB0_2:
	leaq	L_.str(%rip), %rdi
	callq	_err
	movl	$-1, %r14d
	jmp	LBB0_16
LBB0_14:
	shlq	$8, %rsi
	orq	-64(%rbp), %rsi
	movq	-48(%rbp), %rdx
	movl	(%rbx), %edi
	jmp	LBB0_15
LBB0_12:
	shlq	$8, %rsi
	orq	%rax, %rsi
	movq	%rsi, 8(%rbx)
LBB0_13:
	movl	(%rbx), %edi
	xorl	%r14d, %r14d
	xorl	%edx, %edx
LBB0_15:
	callq	_rc_keydown
LBB0_16:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-24(%rbp), %rax
	jne	LBB0_18
## %bb.17:
	movl	%r14d, %eax
	addq	$48, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_rc_request,4,2                 ## @rc_request
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"RC Query Failed"

	.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:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	ldr	x8, [x0, #24]
	ldr	w8, [x8]
	mov	w9, #511
	movk	w9, #1, lsl #16
	cmp	w8, w9
	b.gt	LBB0_13
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _rc_request@GOTPAGE
Lloh1:
	ldr	x8, [x8, _rc_request@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x3, sp, #16
	mov	w2, #2
	mov	w4, #4
	bl	_dib0700_ctrl_rd
	cmp	w0, #0
	b.le	LBB0_8
; %bb.2:
	ldp	q1, q0, [sp, #16]
	cmtst.2d	v0, v0, v0
	cmtst.2d	v1, v1, v1
	uzp1.4s	v0, v1, v0
	xtn.4h	v0, v0
	umov.h	w8, v0[0]
	umov.h	w9, v0[1]
	and	w9, w9, #0x1
	bfi	w8, w9, #1, #1
	umov.h	w9, v0[2]
	and	w9, w9, #0x1
	bfi	w8, w9, #2, #1
	umov.h	w9, v0[3]
	bfi	w8, w9, #3, #29
	tst	w8, #0xf
	b.eq	LBB0_13
; %bb.3:
	mov	x0, x19
	bl	_dib0700_rc_setup
	str	xzr, [x19, #8]
	ldr	w9, [x19, #16]
	ldr	x8, [sp, #24]
	cmp	w9, #128
	b.ne	LBB0_9
; %bb.4:
	ldr	x9, [sp, #16]
	cbnz	x8, LBB0_10
; %bb.5:
	cbnz	x9, LBB0_10
; %bb.6:
	ldr	x10, [sp, #40]
	cmp	x10, #255
	b.ne	LBB0_10
; %bb.7:
	mov	x1, #0
	b	LBB0_11
LBB0_8:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_err
	mov	w0, #-1
	b	LBB0_14
LBB0_9:
	ldr	x9, [sp, #16]
	ldr	x2, [sp, #32]
	orr	x1, x9, x8, lsl #8
	ldr	w0, [x19]
	b	LBB0_12
LBB0_10:
	orr	x1, x9, x8, lsl #8
	str	x1, [x19, #8]
LBB0_11:
	ldr	w0, [x19]
	mov	x2, #0
LBB0_12:
	bl	_rc_keydown
LBB0_13:
	mov	w0, #0
LBB0_14:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_rc_request,4,2                 ; @rc_request
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"RC Query Failed"

	.no_dead_strip	_dib0700_rc_query_old_firmware
.subsections_via_symbols
