	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function io_write
_io_write:                              ## @io_write
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %rbx
	callq	_to_state
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_mutex_lock
	movl	%r15d, %esi
	sarl	$8, %esi
	movq	%rbx, %rdi
	callq	_tda1997x_setpage
	movl	$-1, %ebx
	testq	%rax, %rax
	jne	LBB0_3
## %bb.1:
	movl	4(%r12), %edi
	movzbl	%r15b, %r15d
	movl	%r15d, %esi
	movl	%r14d, %edx
	callq	_i2c_smbus_write_byte_data
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_3
## %bb.2:
	movl	4(%r12), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	movl	%r14d, %ecx
	callq	_v4l_err
	movl	$-1, %ebx
LBB0_3:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"write reg error:reg=%2x,val=%2x\n"

	.no_dead_strip	_io_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function io_write
_io_write:                              ; @io_write
	.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, x2
	mov	x21, x1
	mov	x22, x0
	bl	_to_state
	mov	x19, x0
	bl	_mutex_lock
	asr	w1, w21, #8
	mov	x0, x22
	bl	_tda1997x_setpage
	cbz	x0, LBB0_2
LBB0_1:
	mov	w22, #-1
	b	LBB0_3
LBB0_2:
	ldr	w0, [x19, #4]
	and	w21, w21, #0xff
	mov	x1, x21
	mov	x2, x20
	bl	_i2c_smbus_write_byte_data
	mov	x22, x0
	tbnz	w0, #31, LBB0_4
LBB0_3:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x22
	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_4:
	ldr	w0, [x19, #4]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	mov	x3, x20
	bl	_v4l_err
	b	LBB0_1
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"write reg error:reg=%2x,val=%2x\n"

	.no_dead_strip	_io_write
.subsections_via_symbols
