	.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
	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	%r15, %rdi
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	js	LBB0_1
## %bb.2:
	movq	_REQUEST_SET_RC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%rbx), %rsi
	movl	%eax, (%rsi)
	movq	$0, 4(%rsi)
	movl	(%r14), %edx
	movq	_RC_PROTO_BIT_RC5@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$1, %ecx
	testl	%edx, %eax
	jne	LBB0_7
## %bb.3:
	movq	_RC_PROTO_BIT_NEC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ecx, %ecx
	testl	%edx, %eax
	je	LBB0_4
LBB0_7:
	movl	%eax, (%r14)
	movl	%ecx, 4(%rsi)
	movq	%r15, %rdi
	movl	$3, %edx
	callq	_dib0700_ctrl_wr
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_8
## %bb.9:
	movl	(%r14), %eax
	movl	%eax, 4(%r15)
	jmp	LBB0_10
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_err
	movq	_EINTR@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_8:
	leaq	L_.str.1(%rip), %rdi
	callq	_err
	jmp	LBB0_10
LBB0_4:
	movq	_RC_PROTO_BIT_RC6_MCE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%edx, %eax
	je	LBB0_6
## %bb.5:
	movl	$2, %ecx
	cmpl	$66047, 8(%rbx)                 ## imm = 0x101FF
	jg	LBB0_7
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not acquire lock"

	.comm	_EINTR,4,2                      ## @EINTR
	.comm	_REQUEST_SET_RC,4,2             ## @REQUEST_SET_RC
	.comm	_RC_PROTO_BIT_RC5,4,2           ## @RC_PROTO_BIT_RC5
	.comm	_RC_PROTO_BIT_NEC,4,2           ## @RC_PROTO_BIT_NEC
	.comm	_RC_PROTO_BIT_RC6_MCE,4,2       ## @RC_PROTO_BIT_RC6_MCE
	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.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:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, x1
	ldr	x19, [x0]
	ldr	x21, [x19, #8]
	mov	x0, x19
	bl	_mutex_lock_interruptible
	tbnz	x0, #63, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _REQUEST_SET_RC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REQUEST_SET_RC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	x1, [x21]
	stp	wzr, wzr, [x1, #4]
	str	w8, [x1]
	ldr	w9, [x20]
Lloh3:
	adrp	x8, _RC_PROTO_BIT_RC5@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RC_PROTO_BIT_RC5@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w9
	b.eq	LBB0_4
; %bb.2:
	mov	w9, #1
	b	LBB0_6
LBB0_3:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_err
Lloh8:
	adrp	x8, _EINTR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_13
LBB0_4:
Lloh11:
	adrp	x8, _RC_PROTO_BIT_NEC@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RC_PROTO_BIT_NEC@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	tst	w8, w9
	b.eq	LBB0_9
; %bb.5:
	mov	w9, #0
LBB0_6:
	str	w8, [x20]
	str	w9, [x1, #4]
	mov	x0, x19
	mov	w2, #3
	bl	_dib0700_ctrl_wr
	mov	x21, x0
	tbnz	w0, #31, LBB0_8
; %bb.7:
	ldr	w8, [x20]
	str	w8, [x19, #4]
	b	LBB0_12
LBB0_8:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_err
	b	LBB0_12
LBB0_9:
Lloh16:
	adrp	x8, _RC_PROTO_BIT_RC6_MCE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _RC_PROTO_BIT_RC6_MCE@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	tst	w8, w9
	b.eq	LBB0_11
; %bb.10:
	ldr	w9, [x21, #8]
	mov	w10, #511
	movk	w10, #1, lsl #16
	cmp	w9, w10
	b.gt	LBB0_14
LBB0_11:
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_12:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_13:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_14:
	mov	w9, #2
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not acquire lock"

	.comm	_EINTR,4,2                      ; @EINTR
	.comm	_REQUEST_SET_RC,4,2             ; @REQUEST_SET_RC
	.comm	_RC_PROTO_BIT_RC5,4,2           ; @RC_PROTO_BIT_RC5
	.comm	_RC_PROTO_BIT_NEC,4,2           ; @RC_PROTO_BIT_NEC
	.comm	_RC_PROTO_BIT_RC6_MCE,4,2       ; @RC_PROTO_BIT_RC6_MCE
	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"ir protocol setup failed"

.subsections_via_symbols
