	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_key_pinnacle
_get_key_pinnacle:                      ## @get_key_pinnacle
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %ebx
	movl	%r8d, %r14d
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %r15
	movl	4(%rdi), %edi
	leaq	-44(%rbp), %rsi
	movl	$4, %edx
	callq	_i2c_master_recv
	cmpl	$4, %eax
	jne	LBB0_3
## %bb.1:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	leaq	-44(%rbp), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	je	LBB0_2
## %bb.5:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	incq	%r13
	leaq	-44(%rbp), %rdi
	callq	_ARRAY_SIZE
	movl	%eax, %eax
	incl	%r14d
	cmpq	%rax, %r13
	jae	LBB0_9
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movzbl	-44(%rbp,%r13), %eax
	cmpl	%ebx, %eax
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	leal	1(%r14), %eax
	andl	$3, %eax
	movzbl	-44(%rbp,%rax), %r12d
	movl	%r14d, %eax
	andl	$3, %eax
	movzbl	-44(%rbp,%rax), %r15d
	jmp	LBB0_8
LBB0_3:
	movl	%eax, %r13d
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_ir_dbg
	testl	%r13d, %r13d
	js	LBB0_14
## %bb.4:
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, %r13d
	jmp	LBB0_14
LBB0_9:
	xorl	%r13d, %r13d
	testl	%r15d, %r15d
	je	LBB0_14
## %bb.10:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	cmpl	%r15d, (%rdi)
	je	LBB0_14
## %bb.11:
	movl	%r15d, (%rdi)
	cmpl	$254, %ebx
	jne	LBB0_13
## %bb.12:
	movl	%r12d, %ecx
	andl	$64, %ecx
	jne	LBB0_14
LBB0_13:
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	16(%rbp)
	movq	_RC_PROTO_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	%edx, (%rax)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	$0, (%rax)
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_ir_dbg
	movl	$1, %r13d
	jmp	LBB0_14
LBB0_2:
	xorl	%r13d, %r13d
LBB0_14:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read error\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_RC_PROTO_UNKNOWN,4,2           ## @RC_PROTO_UNKNOWN
L_.str.1:                               ## @.str.1
	.asciz	"Pinnacle PCTV key %02x\n"

	.no_dead_strip	_get_key_pinnacle
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_key_pinnacle
_get_key_pinnacle:                      ; @get_key_pinnacle
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x6
	mov	x24, x5
	mov	x26, x4
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
	ldr	w0, [x0, #4]
	add	x1, sp, #28
	mov	w2, #4
	bl	_i2c_master_recv
	cmp	w0, #4
	b.ne	LBB0_6
; %bb.1:
	add	x27, sp, #28
	add	x0, sp, #28
	bl	_ARRAY_SIZE
	cbz	w0, LBB0_12
; %bb.2:
	str	x21, [sp, #16]                  ; 8-byte Folded Spill
	mov	x28, #0
	mov	w25, #0
	mov	w21, #0
	mov	w26, w26
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x28, x28, #1
	add	x0, sp, #28
	bl	_ARRAY_SIZE
	cmp	x28, w0, uxtw
	b.hs	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldrb	w8, [x27, x28]
	cmp	w8, w24
	b.ne	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x26, x28
	add	w9, w8, #1
	and	x9, x9, #0x3
	ldrb	w25, [x27, x9]
	and	x8, x8, #0x3
	ldrb	w21, [x27, x8]
	b	LBB0_3
LBB0_6:
	mov	x25, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ir_dbg
	tbnz	w25, #31, LBB0_13
; %bb.7:
Lloh2:
	adrp	x8, _EIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_13
LBB0_8:
	cbz	w21, LBB0_12
; %bb.9:
	ldr	w8, [x19]
	cmp	w8, w21
	b.eq	LBB0_12
; %bb.10:
	str	w21, [x19]
	cmp	w24, #254
	b.ne	LBB0_14
; %bb.11:
	tbz	w25, #6, LBB0_14
LBB0_12:
	mov	w25, #0
LBB0_13:
	mov	x0, x25
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_14:
Lloh5:
	adrp	x8, _RC_PROTO_UNKNOWN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RC_PROTO_UNKNOWN@GOTPAGEOFF]
	udiv	w9, w25, w20
Lloh7:
	ldr	w8, [x8]
	str	w8, [x23]
	msub	w8, w9, w20, w25
	str	w8, [x22]
	ldr	x9, [sp, #16]                   ; 8-byte Folded Reload
	str	xzr, [x9]
	str	x8, [sp]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_ir_dbg
	mov	w25, #1
	b	LBB0_13
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read error\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_RC_PROTO_UNKNOWN,4,2           ; @RC_PROTO_UNKNOWN
l_.str.1:                               ; @.str.1
	.asciz	"Pinnacle PCTV key %02x\n"

	.no_dead_strip	_get_key_pinnacle
.subsections_via_symbols
