	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function chip_write
_chip_write:                            ## @chip_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %r13
	leaq	8(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_v4l2_get_subdevdata
	movq	%rax, %r12
	testl	%r15d, %r15d
	js	LBB0_1
## %bb.4:
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	leal	1(%r15), %r14d
	movq	(%r13), %rdi
	callq	_ARRAY_SIZE
	cmpl	%eax, %r14d
	jge	LBB0_5
## %bb.6:
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rcx
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	movl	$1, %edi
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdx
	movl	%r15d, %r8d
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %r9d
	xorl	%eax, %eax
	callq	_v4l2_dbg
	movq	(%r13), %rax
	movl	%r14d, %ecx
	movl	%ebx, (%rax,%rcx,4)
	movb	%r15b, -42(%rbp)
	movb	%bl, -41(%rbp)
	leaq	-42(%rbp), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	$2, %edx
	callq	_i2c_master_send
	cmpl	$2, %eax
	je	LBB0_11
## %bb.7:
	movl	%eax, %r13d
	leaq	L_.str.4(%rip), %rsi
	xorl	%r12d, %r12d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %edx
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_v4l2_warn
	testl	%r13d, %r13d
	jns	LBB0_9
## %bb.8:
	movl	%r13d, %r12d
	jmp	LBB0_11
LBB0_1:
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rcx
	movq	%r12, %r15
	xorl	%r12d, %r12d
	movl	$1, %edi
	movq	%rbx, %rdx
	movl	%r14d, %r8d
	xorl	%eax, %eax
	callq	_v4l2_dbg
	movq	(%r13), %rax
	movl	%r14d, 4(%rax)
	movb	%r14b, -42(%rbp)
	leaq	-42(%rbp), %rsi
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_i2c_master_send
	cmpl	$1, %eax
	je	LBB0_11
## %bb.2:
	movq	%rbx, %rdi
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	xorl	%r12d, %r12d
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_v4l2_warn
	testl	%ebx, %ebx
	js	LBB0_3
LBB0_9:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_5:
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_v4l2_info
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
LBB0_10:
	subl	(%rax), %r12d
LBB0_11:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	%ebx, %r12d
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"chip_write: 0x%x\n"

L_.str.1:                               ## @.str.1
	.asciz	"I/O error (write 0x%x)\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.2:                               ## @.str.2
	.asciz	"Tried to access a non-existent register: %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.3:                               ## @.str.3
	.asciz	"chip_write: reg%d=0x%x\n"

L_.str.4:                               ## @.str.4
	.asciz	"I/O error (write reg%d=0x%x)\n"

	.no_dead_strip	_chip_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function chip_write
_chip_write:                            ; @chip_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x2
	mov	x21, x1
	mov	x23, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_v4l2_get_subdevdata
	mov	x22, x0
	tbnz	w21, #31, LBB0_4
; %bb.1:
	add	w24, w21, #1
	ldr	x0, [x23]
	bl	_ARRAY_SIZE
	cmp	w24, w0
	b.ge	LBB0_6
; %bb.2:
Lloh0:
	adrp	x8, _debug@GOTPAGE
Lloh1:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x3, l_.str.3@PAGE
Lloh4:
	add	x3, x3, l_.str.3@PAGEOFF
	str	x20, [sp]
	mov	w0, #1
	mov	x2, x19
	mov	x4, x21
	bl	_v4l2_dbg
	ldr	x8, [x23]
	str	w20, [x8, w24, uxtw #2]
	strb	w21, [sp, #14]
	strb	w20, [sp, #15]
	add	x1, sp, #14
	mov	x0, x22
	mov	w2, #2
	bl	_i2c_master_send
	cmp	w0, #2
	b.eq	LBB0_5
; %bb.3:
	mov	x22, x0
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	str	x20, [sp]
Lloh5:
	adrp	x1, l_.str.4@PAGE
Lloh6:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_v4l2_warn
	tbz	w22, #31, LBB0_8
	b	LBB0_10
LBB0_4:
Lloh7:
	adrp	x8, _debug@GOTPAGE
Lloh8:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x3, l_.str@PAGE
Lloh11:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	mov	x4, x20
	bl	_v4l2_dbg
	ldr	x8, [x23]
	str	w20, [x8, #4]
	strb	w20, [sp, #14]
	add	x1, sp, #14
	mov	x0, x22
	mov	w2, #1
	bl	_i2c_master_send
	cmp	w0, #1
	b.ne	LBB0_7
LBB0_5:
	mov	w22, #0
	b	LBB0_10
LBB0_6:
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_v4l2_info
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
	mov	x22, x0
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_v4l2_warn
	tbnz	w22, #31, LBB0_10
LBB0_8:
Lloh18:
	adrp	x8, _EIO@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_10:
	mov	x0, x22
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"chip_write: 0x%x\n"

l_.str.1:                               ; @.str.1
	.asciz	"I/O error (write 0x%x)\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.2:                               ; @.str.2
	.asciz	"Tried to access a non-existent register: %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.3:                               ; @.str.3
	.asciz	"chip_write: reg%d=0x%x\n"

l_.str.4:                               ; @.str.4
	.asciz	"I/O error (write reg%d=0x%x)\n"

	.no_dead_strip	_chip_write
.subsections_via_symbols
