	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sp2_ci_op_cam
_sp2_ci_op_cam:                         ## @sp2_ci_op_cam
	.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
	testl	%esi, %esi
	je	LBB0_2
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	%r9d, %r12d
	movl	%r8d, %r14d
	movl	%ecx, %r15d
	movl	%edx, %r13d
	movq	(%rdi), %rbx
	movq	(%rbx), %r9
	cmpl	%edx, 8(%rbx)
	jne	LBB0_3
LBB0_5:
	movl	%r13d, 8(%rbx)
	testq	%r9, %r9
	je	LBB0_14
## %bb.6:
	movq	16(%rbx), %rdi
	leaq	-48(%rbp), %r8
	movl	%r15d, %esi
	movl	%r14d, %edx
	movl	%r12d, %ecx
	callq	*%r9
	testl	%eax, %eax
	jne	LBB0_13
## %bb.7:
	movq	24(%rbx), %rdi
	movq	_SP2_CI_ATTR_ACS@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	leaq	L_.str.4(%rip), %rax
	leaq	L_.str.5(%rip), %r9
	cmoveq	%rax, %r9
	testl	%r15d, %r15d
	je	LBB0_8
## %bb.9:
	leaq	L_.str.2(%rip), %rdx
	movl	-48(%rbp), %r12d
	jmp	LBB0_10
LBB0_3:
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$1, %ecx
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	callq	_sp2_read_i2c
	testl	%eax, %eax
	jne	LBB0_13
## %bb.4:
	movq	_SP2_MOD_CTL_ACS1@GOTPCREL(%rip), %rax
	movq	_SP2_MOD_CTL_ACS0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	notl	%ecx
	andl	-44(%rbp), %ecx
	orl	%r13d, %ecx
	movl	%ecx, -44(%rbp)
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$1, %ecx
	callq	_sp2_write_i2c
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	testl	%eax, %eax
	jne	LBB0_13
	jmp	LBB0_5
LBB0_14:
	movq	24(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_1
LBB0_8:
	leaq	L_.str.3(%rip), %rdx
LBB0_10:
	movl	%r12d, (%rsp)
	leaq	L_.str.1(%rip), %rsi
	xorl	%ecx, %ecx
	movl	%r14d, %r8d
	callq	_dev_dbg
	testl	%r15d, %r15d
	je	LBB0_12
## %bb.11:
	movl	-48(%rbp), %r15d
LBB0_12:
	movl	%r15d, %eax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SP2_MOD_CTL_ACS1,4,2           ## @SP2_MOD_CTL_ACS1
	.comm	_SP2_MOD_CTL_ACS0,4,2           ## @SP2_MOD_CTL_ACS0
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"callback not defined"

L_.str.1:                               ## @.str.1
	.asciz	"%s: slot=%d, addr=0x%04x, %s, data=%x"

L_.str.2:                               ## @.str.2
	.asciz	"read"

L_.str.3:                               ## @.str.3
	.asciz	"write"

	.comm	_SP2_CI_ATTR_ACS,4,2            ## @SP2_CI_ATTR_ACS
L_.str.4:                               ## @.str.4
	.asciz	"attr"

L_.str.5:                               ## @.str.5
	.asciz	"io"

	.no_dead_strip	_sp2_ci_op_cam
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sp2_ci_op_cam
_sp2_ci_op_cam:                         ; @sp2_ci_op_cam
	.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
	cbz	w1, LBB0_3
LBB0_1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_2:
	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
LBB0_3:
	mov	x21, x5
	mov	x20, x4
	mov	x19, x3
	mov	x22, x2
	ldr	x23, [x0]
	ldr	x24, [x23]
	ldr	w8, [x23, #8]
	cmp	w8, w2
	b.ne	LBB0_7
LBB0_4:
	str	w22, [x23, #8]
	cbz	x24, LBB0_9
; %bb.5:
	ldr	x0, [x23, #16]
	add	x4, sp, #8
	mov	x1, x19
	mov	x2, x20
	mov	x3, x21
	blr	x24
	cbnz	w0, LBB0_2
; %bb.6:
Lloh3:
	adrp	x8, l_.str.2@PAGE
Lloh4:
	add	x8, x8, l_.str.2@PAGEOFF
Lloh5:
	adrp	x9, l_.str.3@PAGE
Lloh6:
	add	x9, x9, l_.str.3@PAGEOFF
Lloh7:
	adrp	x10, _SP2_CI_ATTR_ACS@GOTPAGE
Lloh8:
	ldr	x10, [x10, _SP2_CI_ATTR_ACS@GOTPAGEOFF]
	ldr	x0, [x23, #24]
Lloh9:
	ldr	w10, [x10]
Lloh10:
	adrp	x11, l_.str.5@PAGE
Lloh11:
	add	x11, x11, l_.str.5@PAGEOFF
Lloh12:
	adrp	x12, l_.str.4@PAGE
Lloh13:
	add	x12, x12, l_.str.4@PAGEOFF
	cmp	w10, w22
	csel	x5, x12, x11, eq
	ldr	w10, [sp, #8]
	cmp	w19, #0
	csel	w6, w21, w10, eq
	csel	x2, x9, x8, eq
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w3, #0
	mov	x4, x20
	bl	_dev_dbg
	ldr	w8, [sp, #8]
	cmp	w19, #0
	csel	w0, wzr, w8, eq
	b	LBB0_2
LBB0_7:
	add	x2, sp, #12
	mov	x0, x23
	mov	w1, #0
	mov	w3, #1
	bl	_sp2_read_i2c
	cbnz	w0, LBB0_2
; %bb.8:
Lloh16:
	adrp	x8, _SP2_MOD_CTL_ACS1@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SP2_MOD_CTL_ACS1@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
Lloh19:
	adrp	x9, _SP2_MOD_CTL_ACS0@GOTPAGE
Lloh20:
	ldr	x9, [x9, _SP2_MOD_CTL_ACS0@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [sp, #12]
	bic	w8, w9, w8
	orr	w8, w8, w22
	str	w8, [sp, #12]
	add	x2, sp, #12
	mov	x0, x23
	mov	w1, #0
	mov	w3, #1
	bl	_sp2_write_i2c
	cbnz	w0, LBB0_2
	b	LBB0_4
LBB0_9:
	ldr	x0, [x23, #24]
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SP2_MOD_CTL_ACS1,4,2           ; @SP2_MOD_CTL_ACS1
	.comm	_SP2_MOD_CTL_ACS0,4,2           ; @SP2_MOD_CTL_ACS0
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"callback not defined"

l_.str.1:                               ; @.str.1
	.asciz	"%s: slot=%d, addr=0x%04x, %s, data=%x"

l_.str.2:                               ; @.str.2
	.asciz	"read"

l_.str.3:                               ; @.str.3
	.asciz	"write"

	.comm	_SP2_CI_ATTR_ACS,4,2            ; @SP2_CI_ATTR_ACS
l_.str.4:                               ; @.str.4
	.asciz	"attr"

l_.str.5:                               ; @.str.5
	.asciz	"io"

	.no_dead_strip	_sp2_ci_op_cam
.subsections_via_symbols
