	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_key_haup_common
_get_key_haup_common:                   ## @get_key_haup_common
	.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	%r8d, %ebx
	movq	%rcx, %r15
	movq	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, %r13
	movl	8(%rdi), %edi
	leaq	-46(%rbp), %rsi
	movl	%r8d, %edx
	callq	_i2c_master_recv
	cmpl	%ebx, %eax
	jne	LBB0_1
## %bb.2:
	movzbl	-46(%rbp), %eax
	testb	$-128, %al
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	jne	LBB0_3
## %bb.6:
	xorl	%r14d, %r14d
	cmpl	$6, %ebx
	jne	LBB0_12
## %bb.7:
	andl	$64, %eax
	je	LBB0_12
## %bb.8:
	movzbl	-42(%rbp), %ebx
	movzbl	-43(%rbp), %r14d
	leaq	-45(%rbp), %rdi
	callq	_get_unaligned_be16
	cmpl	$32783, %eax                    ## imm = 0x800F
	jne	LBB0_10
## %bb.9:
	movl	%r14d, %ecx
	shrl	$7, %ecx
	movl	%ecx, (%r15)
	movq	_RC_PROTO_RC6_MCE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%r12)
	andl	$127, %r14d
	movq	(%r13), %rdi
	movl	%eax, %r12d
	movl	(%r15), %edx
	leaq	L_.str.1(%rip), %rsi
	movl	$32783, %ecx                    ## imm = 0x800F
	movl	%r14d, %r8d
	movl	%ebx, %r9d
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	%r12d, %edi
	jmp	LBB0_11
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_12
LBB0_3:
	xorl	%eax, %eax
	cmpl	$6, %ebx
	sete	%al
	leal	(%rax,%rax,2), %eax
	movzbl	-46(%rbp,%rax), %ecx
	xorl	%r14d, %r14d
	testb	%cl, %cl
	jns	LBB0_12
## %bb.4:
	movl	%ecx, %ebx
	shrl	$5, %ebx
	andl	$1, %ebx
	movl	%ecx, %r9d
	andl	$31, %r9d
	movzbl	-45(%rbp,%rax), %eax
	shrl	$2, %eax
	movl	%ebx, %edx
	shll	$11, %edx
	movl	%r9d, %esi
	shll	$6, %esi
	orl	%edx, %esi
	orl	%eax, %esi
	cmpl	$4095, %esi                     ## imm = 0xFFF
	je	LBB0_12
## %bb.5:
	shrl	$6, %ecx
	andl	$1, %ecx
	movl	%ecx, %edx
	shll	$6, %edx
	orl	%eax, %edx
	xorl	$64, %edx
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movq	(%r13), %rdi
	movl	%edx, (%rsp)
	leaq	L_.str(%rip), %rsi
	movl	$1, %r14d
	movl	$1, %edx
	movl	%ebx, %r8d
	movl	%r9d, %r13d
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_RC_PROTO_RC5@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r12)
	movl	%r13d, %edi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_RC_SCANCODE_RC5
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movl	%ebx, (%r15)
	jmp	LBB0_12
LBB0_10:
	movl	$0, (%r15)
	movq	_RC_PROTO_RC6_6A_32@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%r12)
	movq	(%r13), %rdi
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %r15d
	movl	%eax, %edx
	movl	%r14d, %ecx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	%r15d, %edi
LBB0_11:
	movl	%r14d, %esi
	movl	%ebx, %edx
	callq	_RC_SCANCODE_RC6_6A
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movl	$1, %r14d
LBB0_12:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ir hauppauge (rc5): s%d r%d t%d dev=%d code=%d\n"

	.comm	_RC_PROTO_RC5,4,2               ## @RC_PROTO_RC5
	.comm	_RC_PROTO_RC6_MCE,4,2           ## @RC_PROTO_RC6_MCE
L_.str.1:                               ## @.str.1
	.asciz	"ir hauppauge (rc6-mce): t%d vendor=%d dev=%d code=%d\n"

	.comm	_RC_PROTO_RC6_6A_32,4,2         ## @RC_PROTO_RC6_6A_32
L_.str.2:                               ## @.str.2
	.asciz	"ir hauppauge (rc6-6a-32): vendor=%d dev=%d code=%d\n"

	.no_dead_strip	_get_key_haup_common
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_key_haup_common
_get_key_haup_common:                   ; @get_key_haup_common
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x24, x4
	mov	x20, x3
	mov	x19, x2
	mov	x21, x1
	mov	x22, x0
	ldr	w0, [x0, #8]
	add	x1, sp, #26
	mov	x2, x4
	bl	_i2c_master_recv
	cmp	w0, w24
	b.ne	LBB0_6
; %bb.1:
	ldrb	w8, [sp, #26]
	tbnz	w8, #7, LBB0_7
; %bb.2:
	mov	w23, #0
	cmp	w24, #6
	b.ne	LBB0_13
; %bb.3:
	tbz	w8, #6, LBB0_13
; %bb.4:
	ldrb	w23, [sp, #30]
	ldrb	w24, [sp, #29]
	add	x8, sp, #26
	add	x0, x8, #1
	bl	_get_unaligned_be16
	mov	x25, x0
	mov	w8, #32783
	cmp	w0, w8
	b.ne	LBB0_10
; %bb.5:
	lsr	w8, w24, #7
Lloh0:
	adrp	x9, _RC_PROTO_RC6_MCE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RC_PROTO_RC6_MCE@GOTPAGEOFF]
	str	w8, [x20]
Lloh2:
	ldr	w8, [x9]
	str	w8, [x21]
	and	w24, w24, #0x7f
	ldr	x0, [x22]
	ldr	w2, [x20]
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	str	x23, [sp]
	mov	w3, #32783
	mov	x4, x24
	b	LBB0_11
LBB0_6:
Lloh5:
	adrp	x8, _EIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_13
LBB0_7:
	mov	w23, #0
	mov	w8, #3
	cmp	w24, #6
	csel	w8, w8, wzr, eq
	add	x9, sp, #26
	add	x8, x9, x8
	ldrsb	w10, [x8]
	tbz	w10, #31, LBB0_13
; %bb.8:
	and	w9, w10, #0xff
	ubfx	w24, w9, #5, #1
	and	w25, w10, #0x1f
	ldrb	w8, [x8, #1]
	lsr	w8, w8, #2
	lsl	w10, w25, #6
	bfi	w10, w24, #11, #1
	orr	w10, w10, w8
	cmp	w10, #4095
	b.ne	LBB0_12
; %bb.9:
	mov	w23, #0
	b	LBB0_13
LBB0_10:
	str	wzr, [x20]
Lloh8:
	adrp	x8, _RC_PROTO_RC6_6A_32@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RC_PROTO_RC6_6A_32@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [x21]
	ldr	x0, [x22]
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x25
	mov	x3, x24
	mov	x4, x23
LBB0_11:
	bl	_dev_dbg
	mov	x0, x25
	mov	x1, x24
	mov	x2, x23
	bl	_RC_SCANCODE_RC6_6A
	str	w0, [x19]
	mov	w23, #1
	b	LBB0_13
LBB0_12:
	ubfx	w3, w9, #6, #1
	bfi	w8, w3, #6, #1
	eor	w26, w8, #0x40
	ldr	x0, [x22]
	stp	x25, x26, [sp]
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	mov	w23, #1
	mov	w2, #1
	mov	x4, x24
	bl	_dev_dbg
Lloh15:
	adrp	x8, _RC_PROTO_RC5@GOTPAGE
Lloh16:
	ldr	x8, [x8, _RC_PROTO_RC5@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	w8, [x21]
	mov	x0, x25
	mov	x1, x26
	bl	_RC_SCANCODE_RC5
	str	w0, [x19]
	str	w24, [x20]
LBB0_13:
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ir hauppauge (rc5): s%d r%d t%d dev=%d code=%d\n"

	.comm	_RC_PROTO_RC5,4,2               ; @RC_PROTO_RC5
	.comm	_RC_PROTO_RC6_MCE,4,2           ; @RC_PROTO_RC6_MCE
l_.str.1:                               ; @.str.1
	.asciz	"ir hauppauge (rc6-mce): t%d vendor=%d dev=%d code=%d\n"

	.comm	_RC_PROTO_RC6_6A_32,4,2         ; @RC_PROTO_RC6_6A_32
l_.str.2:                               ; @.str.2
	.asciz	"ir hauppauge (rc6-6a-32): vendor=%d dev=%d code=%d\n"

	.no_dead_strip	_get_key_haup_common
.subsections_via_symbols
