	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_em28xx_ir_change_protocol      ## -- Begin function em28xx_ir_change_protocol
	.p2align	4, 0x90
_em28xx_ir_change_protocol:             ## @em28xx_ir_change_protocol
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r15
	movq	8(%r15), %rbx
	movq	_EM2874_IR_RC5@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -28(%rbp)
	movq	_RC_TYPE_RC5@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	jne	LBB0_3
## %bb.1:
	movq	_EM28XX_XCLK_IR_RC5_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%rbx)
	jmp	LBB0_2
LBB0_3:
	movq	_RC_TYPE_NEC@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	jne	LBB0_5
## %bb.4:
	movq	_EM28XX_XCLK_IR_RC5_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 4(%rbx)
	movq	_EM2874_IR_NEC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -28(%rbp)
LBB0_2:
	movl	$1, (%r15)
	xorl	%r14d, %r14d
LBB0_7:
	movq	_EM28XX_R0F_XCLK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%rbx), %edx
	movq	_EM28XX_XCLK_IR_RC5_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	callq	_em28xx_write_reg_bits
	movl	(%rbx), %eax
	cmpl	$130, %eax
	je	LBB0_10
## %bb.8:
	cmpl	$129, %eax
	je	LBB0_11
## %bb.9:
	cmpl	$128, %eax
	jne	LBB0_12
LBB0_10:
	movq	_default_polling_getkey@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r15)
	jmp	LBB0_13
LBB0_5:
	movq	_RC_TYPE_UNKNOWN@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	cmpq	%rsi, (%rax)
	je	LBB0_7
## %bb.6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_7
LBB0_11:
	movq	_em2874_polling_getkey@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r15)
	movq	_EM2874_R50_IR_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$1, %ecx
	callq	_em28xx_write_regs
	jmp	LBB0_13
LBB0_12:
	leaq	L_.str(%rip), %rdi
	callq	_printk
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_13:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EM2874_IR_RC5,4,2              ## @EM2874_IR_RC5
	.comm	_RC_TYPE_RC5,8,3                ## @RC_TYPE_RC5
	.comm	_EM28XX_XCLK_IR_RC5_MODE,4,2    ## @EM28XX_XCLK_IR_RC5_MODE
	.comm	_RC_TYPE_NEC,8,3                ## @RC_TYPE_NEC
	.comm	_EM2874_IR_NEC,4,2              ## @EM2874_IR_NEC
	.comm	_RC_TYPE_UNKNOWN,8,3            ## @RC_TYPE_UNKNOWN
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EM28XX_R0F_XCLK,4,2            ## @EM28XX_R0F_XCLK
	.comm	_default_polling_getkey,4,2     ## @default_polling_getkey
	.comm	_em2874_polling_getkey,4,2      ## @em2874_polling_getkey
	.comm	_EM2874_R50_IR_CONFIG,4,2       ## @EM2874_R50_IR_CONFIG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unrecognized em28xx chip id: IR not supported\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_em28xx_ir_change_protocol      ; -- Begin function em28xx_ir_change_protocol
	.p2align	2
_em28xx_ir_change_protocol:             ; @em28xx_ir_change_protocol
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x21, [x0]
	ldr	x19, [x21, #8]
Lloh0:
	adrp	x8, _EM2874_IR_RC5@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EM2874_IR_RC5@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #12]
Lloh3:
	adrp	x8, _RC_TYPE_RC5@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RC_TYPE_RC5@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x8]
Lloh6:
	adrp	x8, _EM28XX_XCLK_IR_RC5_MODE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EM28XX_XCLK_IR_RC5_MODE@GOTPAGEOFF]
	cmp	x9, x1
	b.ne	LBB0_2
; %bb.1:
	mov	w20, #0
	ldr	w9, [x8]
	ldr	w10, [x19, #4]
	orr	w9, w10, w9
	str	w9, [x19, #4]
	b	LBB0_4
LBB0_2:
Lloh8:
	adrp	x9, _RC_TYPE_NEC@GOTPAGE
Lloh9:
	ldr	x9, [x9, _RC_TYPE_NEC@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x1
	b.ne	LBB0_9
; %bb.3:
	mov	w20, #0
	ldr	w9, [x8]
	ldr	w10, [x19, #4]
	bic	w9, w10, w9
	str	w9, [x19, #4]
Lloh11:
	adrp	x9, _EM2874_IR_NEC@GOTPAGE
Lloh12:
	ldr	x9, [x9, _EM2874_IR_NEC@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	str	w9, [sp, #12]
LBB0_4:
	mov	w9, #1
	str	w9, [x21]
LBB0_5:
Lloh14:
	adrp	x9, _EM28XX_R0F_XCLK@GOTPAGE
Lloh15:
	ldr	x9, [x9, _EM28XX_R0F_XCLK@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x9]
	ldr	w2, [x19, #4]
	ldr	w3, [x8]
	mov	x0, x19
	bl	_em28xx_write_reg_bits
	ldr	w8, [x19]
	cmp	w8, #130
	b.eq	LBB0_8
; %bb.6:
	cmp	w8, #129
	b.eq	LBB0_11
; %bb.7:
	cmp	w8, #128
	b.ne	LBB0_12
LBB0_8:
Lloh17:
	adrp	x8, _default_polling_getkey@GOTPAGE
Lloh18:
	ldr	x8, [x8, _default_polling_getkey@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	str	w8, [x21, #4]
	b	LBB0_13
LBB0_9:
Lloh20:
	adrp	x9, _RC_TYPE_UNKNOWN@GOTPAGE
Lloh21:
	ldr	x9, [x9, _RC_TYPE_UNKNOWN@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x9, x1
	b.ne	LBB0_14
; %bb.10:
	mov	w20, #0
	b	LBB0_5
LBB0_11:
Lloh23:
	adrp	x8, _em2874_polling_getkey@GOTPAGE
Lloh24:
	ldr	x8, [x8, _em2874_polling_getkey@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	str	w8, [x21, #4]
Lloh26:
	adrp	x8, _EM2874_R50_IR_CONFIG@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EM2874_R50_IR_CONFIG@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	mov	w3, #1
	bl	_em28xx_write_regs
	b	LBB0_13
LBB0_12:
Lloh29:
	adrp	x0, l_.str@PAGE
Lloh30:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printk
Lloh31:
	adrp	x8, _EINVAL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_13:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_14:
Lloh34:
	adrp	x9, _EINVAL@GOTPAGE
Lloh35:
	ldr	x9, [x9, _EINVAL@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	neg	w20, w9
	b	LBB0_5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_EM2874_IR_RC5,4,2              ; @EM2874_IR_RC5
	.comm	_RC_TYPE_RC5,8,3                ; @RC_TYPE_RC5
	.comm	_EM28XX_XCLK_IR_RC5_MODE,4,2    ; @EM28XX_XCLK_IR_RC5_MODE
	.comm	_RC_TYPE_NEC,8,3                ; @RC_TYPE_NEC
	.comm	_EM2874_IR_NEC,4,2              ; @EM2874_IR_NEC
	.comm	_RC_TYPE_UNKNOWN,8,3            ; @RC_TYPE_UNKNOWN
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EM28XX_R0F_XCLK,4,2            ; @EM28XX_R0F_XCLK
	.comm	_default_polling_getkey,4,2     ; @default_polling_getkey
	.comm	_em2874_polling_getkey,4,2      ; @em2874_polling_getkey
	.comm	_EM2874_R50_IR_CONFIG,4,2       ; @EM2874_R50_IR_CONFIG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unrecognized em28xx chip id: IR not supported\n"

.subsections_via_symbols
