	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_af9005_rc_decode               ## -- Begin function af9005_rc_decode
	.p2align	4, 0x90
_af9005_rc_decode:                      ## @af9005_rc_decode
	.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
	cmpl	$6, %edx
	jl	LBB0_23
## %bb.1:
	movq	%r8, %r15
	movq	%rcx, %r14
	movl	(%rsi), %eax
	movl	8(%rsi), %ecx
	shll	$8, %eax
	addl	4(%rsi), %eax
	shll	$8, %ecx
	addl	12(%rsi), %ecx
	leal	(%rcx,%rcx,2), %ecx
	cmpl	%eax, %ecx
	jge	LBB0_9
## %bb.2:
	movq	%rdi, %r13
	movq	_repeatable_keys@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_8
## %bb.3:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rsi
	movq	(%r12), %rdi
	cmpq	(%rdi,%rbx,8), %rsi
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %rbx
	jl	LBB0_5
LBB0_8:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_22
LBB0_9:
	cmpl	$132, %edx
	jb	LBB0_23
## %bb.10:
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
                                        ## kill: def $ebx killed $ebx def $rbx
	movl	16(%rsi,%rax,4), %ecx
	shll	$8, %ecx
	addl	20(%rsi,%rax,4), %ecx
	movl	24(%rsi,%rax,4), %edx
	shll	$8, %edx
	addl	28(%rsi,%rax,4), %edx
	sarl	%edx
	andl	$-2, %ecx
	xorl	%edi, %edi
	cmpl	%edx, %ecx
	movq	%rbx, %rcx
	setg	%dil
	leal	(%rdi,%rbx,2), %ebx
	addq	$4, %rax
	cmpq	$128, %rax
	jb	LBB0_11
## %bb.12:
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	movq	%rcx, %r12
	callq	_deb_decode
	movq	%r12, %rcx
	movl	%ecx, %eax
	andl	$2139095040, %eax               ## imm = 0x7F800000
	cmpl	$2130706432, %eax               ## imm = 0x7F000000
	jne	LBB0_13
## %bb.14:
	addl	%ecx, %ecx
	movzbl	%ch, %edx
	notl	%ebx
	movzbl	%bl, %eax
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	cmpl	%eax, %edx
	jne	LBB0_24
## %bb.15:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	_rc_map_af9005_table_size@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_21
## %bb.16:
	shrl	$16, %ecx
	movzbl	%cl, %r13d
	xorl	%ebx, %ebx
	movq	_rc_map_af9005_table@GOTPCREL(%rip), %r14
	xorl	%r12d, %r12d
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_17 Depth=1
	incq	%r12
	movq	_rc_map_af9005_table_size@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$4, %rbx
	cmpq	%rax, %r12
	jge	LBB0_21
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	addq	%rbx, %rdi
	callq	_rc5_custom
	cmpl	%r13d, %eax
	jne	LBB0_20
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	(%r14), %rdi
	addq	%rbx, %rdi
	callq	_rc5_data
	cmpl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	jne	LBB0_20
## %bb.19:
	movq	(%r14), %rax
	movl	(%rax,%rbx), %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movq	_REMOTE_KEY_PRESSED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movl	(%rcx), %esi
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_7
LBB0_6:
	movq	_REMOTE_KEY_REPEAT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movl	%esi, (%r14)
	leaq	L_.str(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
LBB0_7:
	xorl	%eax, %eax
	callq	_deb_decode
	jmp	LBB0_23
LBB0_13:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_22
LBB0_24:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_22
LBB0_21:
	leaq	L_.str.6(%rip), %rdi
LBB0_22:
	xorl	%eax, %eax
	callq	_deb_decode
LBB0_23:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.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 ignored (non repeatable)\n"

L_.str.2:                               ## @.str.2
	.asciz	"key pressed, raw value %x\n"

L_.str.3:                               ## @.str.3
	.asciz	"doesn't start with 0xfe, ignored\n"

L_.str.4:                               ## @.str.4
	.asciz	"code != inverted code\n"

	.comm	_rc_map_af9005_table_size,4,2   ## @rc_map_af9005_table_size
	.comm	_rc_map_af9005_table,8,3        ## @rc_map_af9005_table
	.comm	_REMOTE_KEY_PRESSED,4,2         ## @REMOTE_KEY_PRESSED
L_.str.5:                               ## @.str.5
	.asciz	"key pressed, event %x\n"

L_.str.6:                               ## @.str.6
	.asciz	"not found in table\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_af9005_rc_decode               ; -- Begin function af9005_rc_decode
	.p2align	2
_af9005_rc_decode:                      ; @af9005_rc_decode
	.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
	cmp	w2, #6
	b.lt	LBB0_23
; %bb.1:
	mov	x20, x4
	mov	x19, x3
	ldp	w8, w9, [x1]
	add	w8, w9, w8, lsl #8
	ldp	w9, w10, [x1, #8]
	add	w9, w10, w9, lsl #8
	add	w9, w9, w9, lsl #1
	cmp	w9, w8
	b.ge	LBB0_7
; %bb.2:
	mov	x21, x0
Lloh0:
	adrp	x22, _repeatable_keys@GOTPAGE
Lloh1:
	ldr	x22, [x22, _repeatable_keys@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_6
; %bb.3:
	mov	x23, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	ldr	x0, [x22]
	ldr	x9, [x0, x23, lsl #3]
	cmp	x8, x9
	b.eq	LBB0_18
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x23, x23, #1
	bl	_ARRAY_SIZE
	cmp	x23, w0, sxtw
	b.lt	LBB0_4
LBB0_6:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_22
LBB0_7:
	cmp	w2, #132
	b.lo	LBB0_23
; %bb.8:
	mov	x8, #0
	mov	w22, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x21, x22
	add	x9, x1, x8, lsl #2
	ldp	w10, w11, [x9, #16]
	add	w10, w11, w10, lsl #8
	ldp	w11, w9, [x9, #24]
	add	w9, w9, w11, lsl #8
	and	w10, w10, #0xfffffffe
	cmp	w10, w9, asr #1
	cset	w22, gt
	bfi	w22, w21, #1, #31
	add	x8, x8, #4
	cmp	x8, #128
	b.lo	LBB0_9
; %bb.10:
	str	x22, [sp]
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_deb_decode
	and	w8, w21, #0x7f800000
	mov	w9, #2130706432
	cmp	w8, w9
	b.ne	LBB0_19
; %bb.11:
	lsl	w8, w21, #1
	ubfx	w21, w8, #8, #8
	mvn	w9, w22
	cmp	w21, w9, uxtb
	b.ne	LBB0_20
; %bb.12:
Lloh6:
	adrp	x22, _rc_map_af9005_table_size@GOTPAGE
Lloh7:
	ldr	x22, [x22, _rc_map_af9005_table_size@GOTPAGEOFF]
	ldr	w9, [x22]
	cmp	w9, #1
	b.lt	LBB0_21
; %bb.13:
	mov	x23, #0
	mov	x24, #0
	ubfx	w25, w8, #16, #8
Lloh8:
	adrp	x26, _rc_map_af9005_table@GOTPAGE
Lloh9:
	ldr	x26, [x26, _rc_map_af9005_table@GOTPAGEOFF]
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x24, x24, #1
	ldrsw	x8, [x22]
	add	x23, x23, #4
	cmp	x24, x8
	b.ge	LBB0_21
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x26]
	add	x0, x8, x23
	bl	_rc5_custom
	cmp	w0, w25
	b.ne	LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	x8, [x26]
	add	x0, x8, x23
	bl	_rc5_data
	cmp	w0, w21
	b.ne	LBB0_14
; %bb.17:
	ldr	x8, [x26]
	ldr	w8, [x8, x23]
	str	w8, [x19]
Lloh10:
	adrp	x8, _REMOTE_KEY_PRESSED@GOTPAGE
Lloh11:
	ldr	x8, [x8, _REMOTE_KEY_PRESSED@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w8, [x20]
	ldr	w8, [x19]
	str	x8, [sp]
Lloh13:
	adrp	x0, l_.str.5@PAGE
Lloh14:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_22
LBB0_18:
Lloh15:
	adrp	x9, _REMOTE_KEY_REPEAT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _REMOTE_KEY_REPEAT@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	str	w9, [x20]
	str	w8, [x19]
	str	x8, [sp]
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_22
LBB0_19:
Lloh20:
	adrp	x0, l_.str.3@PAGE
Lloh21:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_22
LBB0_20:
Lloh22:
	adrp	x0, l_.str.4@PAGE
Lloh23:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_22
LBB0_21:
Lloh24:
	adrp	x0, l_.str.6@PAGE
Lloh25:
	add	x0, x0, l_.str.6@PAGEOFF
LBB0_22:
	bl	_deb_decode
LBB0_23:
	mov	w0, #0
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.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 ignored (non repeatable)\n"

l_.str.2:                               ; @.str.2
	.asciz	"key pressed, raw value %x\n"

l_.str.3:                               ; @.str.3
	.asciz	"doesn't start with 0xfe, ignored\n"

l_.str.4:                               ; @.str.4
	.asciz	"code != inverted code\n"

	.comm	_rc_map_af9005_table_size,4,2   ; @rc_map_af9005_table_size
	.comm	_rc_map_af9005_table,8,3        ; @rc_map_af9005_table
	.comm	_REMOTE_KEY_PRESSED,4,2         ; @REMOTE_KEY_PRESSED
l_.str.5:                               ; @.str.5
	.asciz	"key pressed, event %x\n"

l_.str.6:                               ; @.str.6
	.asciz	"not found in table\n"

.subsections_via_symbols
