	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2c_write
_i2c_write:                             ## @i2c_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
	cmpl	$0, 8(%rdi)
	js	LBB0_7
## %bb.1:
	movq	%rdi, %r15
	addq	$8, %rdi
	movq	_sensor_tb@GOTPCREL(%rip), %rax
	movq	(%rax), %r10
	movq	(%r15), %rbx
	movq	16(%r15), %r8
	movl	(%r10,%rbx,8), %ecx
	movl	4(%r10,%rbx,8), %r9d
	shll	$8, %ecx
	movq	_SQ930_CTRL_I2C_IO@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movzbl	1(%rsi), %r12d
	shll	$8, %r12d
	orl	4(%rsi), %r12d
	movl	%r9d, (%r8)
	movl	(%rsi), %eax
	leaq	8(%r8), %r14
	movl	%eax, 4(%r8)
	cmpl	$2, %edx
	jl	LBB0_5
## %bb.2:
	addq	$8, %rsi
	incl	%edx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%rsi), %eax
	movl	%eax, (%r14)
	movl	(%rsi), %eax
	sarl	$8, %eax
	movl	%eax, 4(%r14)
	movl	4(%r10,%rbx,8), %eax
	movl	%eax, 8(%r14)
	movl	(%rsi), %eax
	movl	%eax, 12(%r14)
	addq	$16, %r14
	addq	$8, %rsi
	decl	%edx
	cmpl	$2, %edx
	ja	LBB0_3
## %bb.4:
	movl	(%r8), %r9d
LBB0_5:
	movq	_D_USBO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-4(%r14), %eax
	subq	$8, %rsp
	leaq	L_.str(%rip), %rdx
	movl	%r12d, %r8d
	pushq	%rax
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	callq	_gspca_dbg
	addq	$16, %rsp
	movl	24(%r15), %r13d
	movl	%r13d, %edi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	movq	_USB_DIR_OUT@GOTPCREL(%rip), %rdx
	movq	_USB_TYPE_VENDOR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rdx), %ecx
	movq	_USB_RECIP_DEVICE@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movq	16(%r15), %rbx
	subq	%rbx, %r14
	shrq	$2, %r14
	subq	$8, %rsp
	movl	%r13d, %edi
	movl	%eax, %esi
	movl	$12, %edx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movl	%r12d, %r9d
	pushq	$500                            ## imm = 0x1F4
	pushq	%r14
	pushq	%rbx
	callq	_usb_control_msg
	addq	$32, %rsp
	testl	%eax, %eax
	jns	LBB0_7
## %bb.6:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_err
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	%ebx, (%rax)
LBB0_7:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_sensor_tb,8,3                  ## @sensor_tb
	.comm	_SQ930_CTRL_I2C_IO,4,2          ## @SQ930_CTRL_I2C_IO
	.comm	_D_USBO,4,2                     ## @D_USBO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"i2c_w v: %04x i: %04x %02x...%02x\n"

	.comm	_USB_DIR_OUT,4,2                ## @USB_DIR_OUT
	.comm	_USB_TYPE_VENDOR,4,2            ## @USB_TYPE_VENDOR
	.comm	_USB_RECIP_DEVICE,4,2           ## @USB_RECIP_DEVICE
L_.str.1:                               ## @.str.1
	.asciz	"i2c_write failed %d\n"

	.no_dead_strip	_i2c_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2c_write
_i2c_write:                             ; @i2c_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	x19, x0
	ldr	w8, [x19, #8]!
	tbnz	w8, #31, LBB0_13
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x8, _sensor_tb@GOTPAGE
Lloh1:
	ldr	x8, [x8, _sensor_tb@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x8]
	ldr	x11, [x0]
	lsl	x9, x11, #3
	add	x8, x10, x9
	ldr	w9, [x10, x9]
Lloh3:
	adrp	x12, _SQ930_CTRL_I2C_IO@GOTPAGE
Lloh4:
	ldr	x12, [x12, _SQ930_CTRL_I2C_IO@GOTPAGEOFF]
Lloh5:
	ldr	w12, [x12]
	orr	w21, w12, w9, lsl #8
	ldrb	w9, [x1, #1]
	ldr	w12, [x1, #4]
	orr	w22, w12, w9, lsl #8
	ldr	w5, [x8, #4]!
	ldr	x9, [x0, #16]
	str	w5, [x9]
	ldr	w12, [x1]
	add	x24, x9, #8
	str	w12, [x9, #4]
	subs	w12, w2, #2
	b.lt	LBB0_11
; %bb.2:
	csel	w12, wzr, w12, lo
	cmp	w12, #4
	b.lo	LBB0_8
; %bb.3:
	subs	w13, w2, #2
	csel	w13, wzr, w13, lo
	add	x14, x9, w13, uxtw #4
	add	x14, x14, #24
	add	x15, x1, #8
	add	x10, x10, x11, lsl #3
	add	x11, x10, #4
	add	x13, x1, w13, uxtw #3
	add	x13, x13, #16
	add	x10, x10, #8
	cmp	x24, x10
	ccmp	x11, x14, #2, lo
	cset	w10, lo
	cmp	x15, x14
	ccmp	x24, x13, #2, lo
	b.lo	LBB0_8
; %bb.4:
	tbnz	w10, #0, LBB0_8
; %bb.5:
	add	w10, w12, #1
	ands	x11, x10, #0x3
	mov	w12, #4
	csel	x11, x12, x11, eq
	sub	x10, x10, x11
	sub	w2, w2, w10
	add	x12, x1, x10, lsl #3
	add	x11, x24, x10, lsl #4
	add	x14, x1, #8
	mov	x13, x14
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ld2.4s	{ v0, v1 }, [x13], #32
	ld2.4s	{ v2, v3 }, [x14]
	sshr.4s	v3, v2, #8
	ld1r.4s	{ v4 }, [x8]
	mov.16b	v2, v1
	mov.16b	v5, v0
	st4.4s	{ v2, v3, v4, v5 }, [x24], #64
	mov	x14, x13
	subs	x10, x10, #4
	b.ne	LBB0_6
; %bb.7:
	mov	x1, x12
	mov	x24, x11
LBB0_8:
	add	x10, x1, #8
	add	w11, w2, #1
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x10, #4]
	str	w12, [x24]
	ldr	w12, [x10]
	asr	w12, w12, #8
	str	w12, [x24, #4]
	ldr	w12, [x8]
	str	w12, [x24, #8]
	ldr	w13, [x10], #8
	add	x12, x24, #16
	str	w13, [x24, #12]
	sub	w11, w11, #1
	mov	x24, x12
	cmp	w11, #2
	b.hi	LBB0_9
; %bb.10:
	ldr	w5, [x9]
	mov	x24, x12
LBB0_11:
Lloh6:
	adrp	x8, _D_USBO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _D_USBO@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldur	w6, [x24, #-4]
Lloh9:
	adrp	x2, l_.str@PAGE
Lloh10:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	x3, x21
	mov	x4, x22
	bl	_gspca_dbg
	ldr	w23, [x20, #24]
	mov	x0, x23
	mov	w1, #0
	bl	_usb_sndctrlpipe
	mov	x1, x0
Lloh11:
	adrp	x8, _USB_DIR_OUT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _USB_DIR_OUT@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _USB_TYPE_VENDOR@GOTPAGE
Lloh15:
	ldr	x9, [x9, _USB_TYPE_VENDOR@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
Lloh17:
	adrp	x10, _USB_RECIP_DEVICE@GOTPAGE
Lloh18:
	ldr	x10, [x10, _USB_RECIP_DEVICE@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh19:
	ldr	w9, [x10]
	orr	w3, w8, w9
	ldr	x6, [x20, #16]
	sub	x8, x24, x6
	lsr	x7, x8, #2
	mov	w8, #500
	str	w8, [sp]
	mov	x0, x23
	mov	w2, #12
	mov	x4, x21
	mov	x5, x22
                                        ; kill: def $w7 killed $w7 killed $x7
	bl	_usb_control_msg
	tbz	w0, #31, LBB0_13
; %bb.12:
	mov	x20, x0
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_pr_err
	str	w20, [x19]
LBB0_13:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_sensor_tb,8,3                  ; @sensor_tb
	.comm	_SQ930_CTRL_I2C_IO,4,2          ; @SQ930_CTRL_I2C_IO
	.comm	_D_USBO,4,2                     ; @D_USBO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"i2c_w v: %04x i: %04x %02x...%02x\n"

	.comm	_USB_DIR_OUT,4,2                ; @USB_DIR_OUT
	.comm	_USB_TYPE_VENDOR,4,2            ; @USB_TYPE_VENDOR
	.comm	_USB_RECIP_DEVICE,4,2           ; @USB_RECIP_DEVICE
l_.str.1:                               ; @.str.1
	.asciz	"i2c_write failed %d\n"

	.no_dead_strip	_i2c_write
.subsections_via_symbols
