	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cinergyt2_rc_query
_cinergyt2_rc_query:                    ## @cinergyt2_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	16(%rdi), %r15
	movq	_REMOTE_NO_KEY_PRESSED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	leaq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_CINERGYT2_EP1_GET_RC_EVENTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%r15), %rcx
	movl	%eax, (%rcx)
	movq	%rbx, %rdi
	movq	%rcx, %rsi
	movl	$1, %edx
	movl	$5, %r8d
	xorl	%r9d, %r9d
	callq	_dvb_usb_generic_rw
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_13
## %bb.1:
	movq	(%r15), %rsi
	cmpl	$255, 16(%rsi)
	jne	LBB0_9
## %bb.2:
	movq	8(%r15), %rax
	leaq	1(%rax), %rcx
	movq	%rcx, 8(%r15)
	movq	_RC_REPEAT_DELAY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_13
## %bb.3:
	movq	_repeatable_keys@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_8
## %bb.4:
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rsi
	movq	_repeatable_keys@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	cmpq	(%rdi,%r15,8), %rsi
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_6 Depth=1
	incq	%r15
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %r15
	jl	LBB0_6
LBB0_8:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_deb_rc
	jmp	LBB0_13
LBB0_9:
	movl	4(%rsi), %eax
	notl	%eax
	movl	%eax, 8(%rsi)
	movq	%rbx, %rdi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	%r13, %rcx
	callq	_dvb_usb_nec_rc_key_to_event
	movq	(%r15), %rdx
	cmpl	$0, (%rdx)
	je	LBB0_13
## %bb.10:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	cmpq	(%rbx), %rax
	je	LBB0_12
## %bb.11:
	movq	$0, 8(%r15)
LBB0_12:
	leaq	L_.str.2(%rip), %rdi
	movl	$5, %esi
	xorl	%eax, %eax
	callq	_deb_rc
	jmp	LBB0_13
LBB0_7:
	movq	_REMOTE_KEY_REPEAT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r13)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rsi, (%rax)
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_deb_rc
LBB0_13:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REMOTE_NO_KEY_PRESSED,4,2      ## @REMOTE_NO_KEY_PRESSED
	.comm	_CINERGYT2_EP1_GET_RC_EVENTS,4,2 ## @CINERGYT2_EP1_GET_RC_EVENTS
	.comm	_RC_REPEAT_DELAY,8,3            ## @RC_REPEAT_DELAY
	.comm	_repeatable_keys,8,3            ## @repeatable_keys
	.comm	_REMOTE_KEY_REPEAT,4,2          ## @REMOTE_KEY_REPEAT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"repeat key, event %x\n"

L_.str.1:                               ## @.str.1
	.asciz	"repeated key (non repeatable)\n"

L_.str.2:                               ## @.str.2
	.asciz	"key: %*ph\n"

	.no_dead_strip	_cinergyt2_rc_query
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cinergyt2_rc_query
_cinergyt2_rc_query:                    ; @cinergyt2_rc_query
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x23, x2
	mov	x21, x1
	mov	x22, x0
	ldr	x24, [x0, #16]
Lloh0:
	adrp	x8, _REMOTE_NO_KEY_PRESSED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REMOTE_NO_KEY_PRESSED@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x2]
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
Lloh3:
	adrp	x8, _CINERGYT2_EP1_GET_RC_EVENTS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CINERGYT2_EP1_GET_RC_EVENTS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	x1, [x24]
	str	w8, [x1]
	mov	x0, x22
	mov	w2, #1
	mov	x3, x1
	mov	w4, #5
	mov	w5, #0
	bl	_dvb_usb_generic_rw
	mov	x20, x0
	tbnz	w0, #31, LBB0_14
; %bb.1:
	ldr	x1, [x24]
	ldr	w8, [x1, #16]
	cmp	w8, #255
	b.ne	LBB0_8
; %bb.2:
	ldr	x8, [x24, #8]
	add	x9, x8, #1
	str	x9, [x24, #8]
Lloh6:
	adrp	x9, _RC_REPEAT_DELAY@GOTPAGE
Lloh7:
	ldr	x9, [x9, _RC_REPEAT_DELAY@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_14
; %bb.3:
Lloh9:
	adrp	x24, _repeatable_keys@GOTPAGE
Lloh10:
	ldr	x24, [x24, _repeatable_keys@GOTPAGEOFF]
	ldr	x0, [x24]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_7
; %bb.4:
	mov	x25, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22]
	ldr	x0, [x24]
	ldr	x9, [x0, x25, lsl #3]
	cmp	x8, x9
	b.eq	LBB0_12
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x25, x25, #1
	bl	_ARRAY_SIZE
	cmp	x25, w0, sxtw
	b.lt	LBB0_5
LBB0_7:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_13
LBB0_8:
	ldr	w8, [x1, #4]
	mvn	w8, w8
	str	w8, [x1, #8]
	mov	x0, x22
	mov	x2, x21
	mov	x3, x23
	bl	_dvb_usb_nec_rc_key_to_event
	ldr	x8, [x24]
	ldr	w9, [x8]
	cbz	w9, LBB0_14
; %bb.9:
	ldr	x9, [x21]
	ldr	x10, [x22]
	cmp	x9, x10
	b.eq	LBB0_11
; %bb.10:
	str	xzr, [x24, #8]
LBB0_11:
	mov	w9, #5
	stp	x9, x8, [sp]
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_13
LBB0_12:
Lloh15:
	adrp	x9, _REMOTE_KEY_REPEAT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _REMOTE_KEY_REPEAT@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	str	w9, [x23]
	str	x8, [x21]
	str	x8, [sp]
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
LBB0_13:
	bl	_deb_rc
LBB0_14:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_REMOTE_NO_KEY_PRESSED,4,2      ; @REMOTE_NO_KEY_PRESSED
	.comm	_CINERGYT2_EP1_GET_RC_EVENTS,4,2 ; @CINERGYT2_EP1_GET_RC_EVENTS
	.comm	_RC_REPEAT_DELAY,8,3            ; @RC_REPEAT_DELAY
	.comm	_repeatable_keys,8,3            ; @repeatable_keys
	.comm	_REMOTE_KEY_REPEAT,4,2          ; @REMOTE_KEY_REPEAT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"repeat key, event %x\n"

l_.str.1:                               ; @.str.1
	.asciz	"repeated key (non repeatable)\n"

l_.str.2:                               ; @.str.2
	.asciz	"key: %*ph\n"

	.no_dead_strip	_cinergyt2_rc_query
.subsections_via_symbols
