	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dib0700_change_protocol        ## -- Begin function dib0700_change_protocol
	.p2align	4, 0x90
_dib0700_change_protocol:               ## @dib0700_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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	(%rdi), %r15
	movq	8(%r15), %rax
	movq	_REQUEST_SET_RC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -44(%rbp)
	movl	$0, -36(%rbp)
	movq	_RC_TYPE_RC5@GOTPCREL(%rip), %rdx
	movl	$1, %ecx
	cmpq	%rsi, (%rdx)
	je	LBB0_5
## %bb.1:
	movq	_RC_TYPE_NEC@GOTPCREL(%rip), %rdx
	xorl	%ecx, %ecx
	cmpq	%r14, (%rdx)
	je	LBB0_5
## %bb.2:
	movq	_RC_TYPE_RC6@GOTPCREL(%rip), %rcx
	cmpq	%r14, (%rcx)
	jne	LBB0_4
## %bb.3:
	movl	$2, %ecx
	cmpl	$66047, (%rax)                  ## imm = 0x101FF
	jg	LBB0_5
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_5:
	movl	%ecx, -40(%rbp)
	leaq	-44(%rbp), %rsi
	movq	%r15, %rdi
	movl	$12, %edx
	callq	_dib0700_ctrl_wr
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:
	movq	%r14, (%r15)
	jmp	LBB0_8
LBB0_6:
	leaq	L_.str(%rip), %rdi
	callq	_err
LBB0_8:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_10
## %bb.9:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_REQUEST_SET_RC,4,2             ## @REQUEST_SET_RC
	.comm	_RC_TYPE_RC5,8,3                ## @RC_TYPE_RC5
	.comm	_RC_TYPE_NEC,8,3                ## @RC_TYPE_NEC
	.comm	_RC_TYPE_RC6,8,3                ## @RC_TYPE_RC6
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ir protocol setup failed"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dib0700_change_protocol        ; -- Begin function dib0700_change_protocol
	.p2align	2
_dib0700_change_protocol:               ; @dib0700_change_protocol
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	x20, [x0]
	ldr	x8, [x20, #8]
Lloh3:
	adrp	x9, _REQUEST_SET_RC@GOTPAGE
Lloh4:
	ldr	x9, [x9, _REQUEST_SET_RC@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	str	w9, [sp, #12]
	str	wzr, [sp, #20]
Lloh6:
	adrp	x9, _RC_TYPE_RC5@GOTPAGE
Lloh7:
	ldr	x9, [x9, _RC_TYPE_RC5@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x1
	b.ne	LBB0_2
; %bb.1:
	mov	w8, #1
	b	LBB0_8
LBB0_2:
Lloh9:
	adrp	x9, _RC_TYPE_NEC@GOTPAGE
Lloh10:
	ldr	x9, [x9, _RC_TYPE_NEC@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x9, x19
	b.ne	LBB0_4
; %bb.3:
	mov	w8, #0
	b	LBB0_8
LBB0_4:
Lloh12:
	adrp	x9, _RC_TYPE_RC6@GOTPAGE
Lloh13:
	ldr	x9, [x9, _RC_TYPE_RC6@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x19
	b.ne	LBB0_6
; %bb.5:
	ldr	w8, [x8]
	mov	w9, #511
	movk	w9, #1, lsl #16
	cmp	w8, w9
	b.gt	LBB0_7
LBB0_6:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_11
LBB0_7:
	mov	w8, #2
LBB0_8:
	str	w8, [sp, #16]
	add	x1, sp, #12
	mov	x0, x20
	mov	w2, #12
	bl	_dib0700_ctrl_wr
	mov	x21, x0
	tbnz	w0, #31, LBB0_10
; %bb.9:
	str	x19, [x20]
	b	LBB0_11
LBB0_10:
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	bl	_err
LBB0_11:
	ldr	x8, [sp, #24]
Lloh20:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh21:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_REQUEST_SET_RC,4,2             ; @REQUEST_SET_RC
	.comm	_RC_TYPE_RC5,8,3                ; @RC_TYPE_RC5
	.comm	_RC_TYPE_NEC,8,3                ; @RC_TYPE_NEC
	.comm	_RC_TYPE_RC6,8,3                ; @RC_TYPE_RC6
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ir protocol setup failed"

.subsections_via_symbols
