	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function em2874_ir_change_protocol
_em2874_ir_change_protocol:             ## @em2874_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	%rsi, %r14
	movq	(%rdi), %r15
	movq	8(%r15), %rbx
	movq	_EM2874_IR_RC5@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -28(%rbp)
	movl	(%rsi), %ecx
	movq	_RC_PROTO_BIT_RC5@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	je	LBB0_4
## %bb.1:
	movq	_EM28XX_XCLK_IR_RC5_MODE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, (%rbx)
	jmp	LBB0_2
LBB0_4:
	movq	_RC_PROTO_BIT_NEC@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	je	LBB0_6
## %bb.5:
	movq	_EM28XX_XCLK_IR_RC5_MODE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%ecx, (%rbx)
	movq	_EM2874_IR_NEC@GOTPCREL(%rip), %rcx
	movq	_EM2874_IR_NEC_NO_PARITY@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movl	%edx, -28(%rbp)
	jmp	LBB0_2
LBB0_6:
	movq	_RC_PROTO_BIT_RC6_0@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	je	LBB0_8
## %bb.7:
	movq	_EM28XX_XCLK_IR_RC5_MODE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, (%rbx)
	movq	_EM2874_IR_RC6_MODE_0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -28(%rbp)
LBB0_2:
	movl	$1, (%r15)
	movl	(%rax), %eax
LBB0_3:
	movl	%eax, (%r14)
	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
	movq	_EM28XX_R0F_XCLK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %edx
	movq	_EM28XX_XCLK_IR_RC5_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	callq	_em28xx_write_reg_bits
	movl	(%r14), %eax
	movl	%eax, 4(%r15)
	xorl	%eax, %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_RC_PROTO_BIT_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%ecx, %eax
	jne	LBB0_3
## %bb.9:
	movl	4(%r15), %eax
	movl	%eax, (%r14)
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_EM2874_IR_RC5,4,2              ## @EM2874_IR_RC5
	.comm	_RC_PROTO_BIT_RC5,4,2           ## @RC_PROTO_BIT_RC5
	.comm	_EM28XX_XCLK_IR_RC5_MODE,4,2    ## @EM28XX_XCLK_IR_RC5_MODE
	.comm	_RC_PROTO_BIT_NEC,4,2           ## @RC_PROTO_BIT_NEC
	.comm	_EM2874_IR_NEC,4,2              ## @EM2874_IR_NEC
	.comm	_EM2874_IR_NEC_NO_PARITY,4,2    ## @EM2874_IR_NEC_NO_PARITY
	.comm	_RC_PROTO_BIT_RC6_0,4,2         ## @RC_PROTO_BIT_RC6_0
	.comm	_EM2874_IR_RC6_MODE_0,4,2       ## @EM2874_IR_RC6_MODE_0
	.comm	_RC_PROTO_BIT_UNKNOWN,4,2       ## @RC_PROTO_BIT_UNKNOWN
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EM2874_R50_IR_CONFIG,4,2       ## @EM2874_R50_IR_CONFIG
	.comm	_EM28XX_R0F_XCLK,4,2            ## @EM28XX_R0F_XCLK
	.no_dead_strip	_em2874_ir_change_protocol
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function em2874_ir_change_protocol
_em2874_ir_change_protocol:             ; @em2874_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
	mov	x19, x1
	ldr	x21, [x0]
	ldr	x20, [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]
	ldr	w8, [x1]
Lloh3:
	adrp	x9, _RC_PROTO_BIT_RC5@GOTPAGE
Lloh4:
	ldr	x9, [x9, _RC_PROTO_BIT_RC5@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x22, _EM28XX_XCLK_IR_RC5_MODE@GOTPAGE
Lloh7:
	ldr	x22, [x22, _EM28XX_XCLK_IR_RC5_MODE@GOTPAGEOFF]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	ldr	w8, [x22]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
Lloh8:
	adrp	x8, _RC_PROTO_BIT_RC5@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RC_PROTO_BIT_RC5@GOTPAGEOFF]
	b	LBB0_6
LBB0_2:
Lloh10:
	adrp	x9, _RC_PROTO_BIT_NEC@GOTPAGE
Lloh11:
	ldr	x9, [x9, _RC_PROTO_BIT_NEC@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	ldr	w8, [x22]
	ldr	w9, [x20]
	bic	w8, w9, w8
	str	w8, [x20]
Lloh13:
	adrp	x8, _EM2874_IR_NEC@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EM2874_IR_NEC@GOTPAGEOFF]
Lloh15:
	adrp	x9, _EM2874_IR_NEC_NO_PARITY@GOTPAGE
Lloh16:
	ldr	x9, [x9, _EM2874_IR_NEC_NO_PARITY@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [sp, #12]
Lloh19:
	adrp	x8, _RC_PROTO_BIT_NEC@GOTPAGE
Lloh20:
	ldr	x8, [x8, _RC_PROTO_BIT_NEC@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
Lloh21:
	adrp	x9, _RC_PROTO_BIT_RC6_0@GOTPAGE
Lloh22:
	ldr	x9, [x9, _RC_PROTO_BIT_RC6_0@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.5:
	ldr	w8, [x22]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
Lloh24:
	adrp	x8, _EM2874_IR_RC6_MODE_0@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EM2874_IR_RC6_MODE_0@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	str	w8, [sp, #12]
Lloh27:
	adrp	x8, _RC_PROTO_BIT_RC6_0@GOTPAGE
Lloh28:
	ldr	x8, [x8, _RC_PROTO_BIT_RC6_0@GOTPAGEOFF]
LBB0_6:
	mov	w9, #1
	str	w9, [x21]
	ldr	w9, [x8]
LBB0_7:
	str	w9, [x19]
Lloh29:
	adrp	x8, _EM2874_R50_IR_CONFIG@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EM2874_R50_IR_CONFIG@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x20
	mov	w3, #1
	bl	_em28xx_write_regs
Lloh32:
	adrp	x8, _EM28XX_R0F_XCLK@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EM28XX_R0F_XCLK@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	ldr	w2, [x20]
	ldr	w3, [x22]
	mov	x0, x20
	bl	_em28xx_write_reg_bits
	mov	w0, #0
	ldr	w8, [x19]
	str	w8, [x21, #4]
LBB0_8:
	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_9:
Lloh35:
	adrp	x9, _RC_PROTO_BIT_UNKNOWN@GOTPAGE
Lloh36:
	ldr	x9, [x9, _RC_PROTO_BIT_UNKNOWN@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_7
; %bb.10:
	ldr	w8, [x21, #4]
	str	w8, [x19]
Lloh38:
	adrp	x8, _EINVAL@GOTPAGE
Lloh39:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_EM2874_IR_RC5,4,2              ; @EM2874_IR_RC5
	.comm	_RC_PROTO_BIT_RC5,4,2           ; @RC_PROTO_BIT_RC5
	.comm	_EM28XX_XCLK_IR_RC5_MODE,4,2    ; @EM28XX_XCLK_IR_RC5_MODE
	.comm	_RC_PROTO_BIT_NEC,4,2           ; @RC_PROTO_BIT_NEC
	.comm	_EM2874_IR_NEC,4,2              ; @EM2874_IR_NEC
	.comm	_EM2874_IR_NEC_NO_PARITY,4,2    ; @EM2874_IR_NEC_NO_PARITY
	.comm	_RC_PROTO_BIT_RC6_0,4,2         ; @RC_PROTO_BIT_RC6_0
	.comm	_EM2874_IR_RC6_MODE_0,4,2       ; @EM2874_IR_RC6_MODE_0
	.comm	_RC_PROTO_BIT_UNKNOWN,4,2       ; @RC_PROTO_BIT_UNKNOWN
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EM2874_R50_IR_CONFIG,4,2       ; @EM2874_R50_IR_CONFIG
	.comm	_EM28XX_R0F_XCLK,4,2            ; @EM28XX_R0F_XCLK
	.no_dead_strip	_em2874_ir_change_protocol
.subsections_via_symbols
