	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function usbvision_i2c_write_max4
_usbvision_i2c_write_max4:              ## @usbvision_i2c_write_max4
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $ecx killed $ecx def $rcx
	movq	%rdi, %rbx
	movq	(%rdi), %r14
	movl	%ecx, %eax
	andl	$7, %eax
	orl	$16, %eax
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movb	%sil, (%r14)
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movb	%al, 1(%r14)
	testw	%cx, %cx
	jle	LBB0_22
## %bb.1:
	movl	%ecx, %r8d
	cmpw	$8, %cx
	jb	LBB0_2
## %bb.3:
	movq	%r14, %rax
	subq	%rdx, %rax
	addq	$2, %rax
	cmpq	$32, %rax
	jae	LBB0_5
LBB0_2:
	xorl	%edi, %edi
LBB0_18:
	movq	%rdi, %r9
	notq	%r9
	addq	%r8, %r9
	movq	%r8, %rsi
	andq	$3, %rsi
	je	LBB0_20
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movzbl	(%rdx,%rdi), %eax
	movb	%al, 2(%r14,%rdi)
	incq	%rdi
	decq	%rsi
	jne	LBB0_19
LBB0_20:
	cmpq	$3, %r9
	jb	LBB0_22
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movzbl	(%rdx,%rdi), %eax
	movb	%al, 2(%r14,%rdi)
	movzbl	1(%rdx,%rdi), %eax
	movb	%al, 3(%r14,%rdi)
	movzbl	2(%rdx,%rdi), %eax
	movb	%al, 4(%r14,%rdi)
	movzbl	3(%rdx,%rdi), %eax
	movb	%al, 5(%r14,%rdi)
	addq	$4, %rdi
	cmpq	%rdi, %r8
	jne	LBB0_21
LBB0_22:
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	leal	2(%rcx), %eax
	movl	$5, %r13d
	cwtl
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	_USBVISION_SER_CONT@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_23:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_25 Depth 2
	movl	8(%rbx), %r15d
	movl	%r15d, %edi
	movl	$1, %esi
	callq	_usb_sndctrlpipe
	movq	_USBVISION_OP_CODE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_USB_TYPE_VENDOR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_USB_DIR_OUT@GOTPCREL(%rip), %rsi
	orl	(%rsi), %ecx
	movq	_USB_RECIP_ENDPOINT@GOTPCREL(%rip), %rsi
	orl	(%rsi), %ecx
	movq	_USBVISION_SER_ADRS@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r9d
	movq	_HZ@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r10d
	subq	$8, %rsp
	movl	%r15d, %edi
	movl	%eax, %esi
	xorl	%r8d, %r8d
	pushq	%r10
	pushq	-72(%rbp)                       ## 8-byte Folded Reload
	pushq	%r14
	callq	_usb_control_msg
	addq	$32, %rsp
	testl	%eax, %eax
	js	LBB0_39
## %bb.24:                              ##   in Loop: Header=BB0_23 Depth=1
	movl	(%r12), %esi
	movq	%rbx, %rdi
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	callq	_usbvision_write_reg
	testl	%eax, %eax
	js	LBB0_39
	.p2align	4, 0x90
LBB0_25:                                ##   Parent Loop BB0_23 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_usbvision_read_reg
	testl	%eax, %eax
	jle	LBB0_27
## %bb.26:                              ##   in Loop: Header=BB0_25 Depth=2
	movl	%eax, %ecx
	andl	$16, %ecx
	jne	LBB0_25
LBB0_27:                                ##   in Loop: Header=BB0_23 Depth=1
	testl	%eax, %eax
	js	LBB0_39
## %bb.28:                              ##   in Loop: Header=BB0_23 Depth=1
	testb	$32, %al
	je	LBB0_31
## %bb.29:                              ##   in Loop: Header=BB0_23 Depth=1
	movl	(%r12), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_usbvision_write_reg
	subl	$1, %r13d
	jae	LBB0_23
## %bb.30:
	movl	$-1, %eax
	jmp	LBB0_39
LBB0_31:
	movq	_i2c_debug@GOTPCREL(%rip), %rax
	movq	_DBG_I2C@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	testl	%edi, (%rax)
	je	LBB0_38
## %bb.32:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	testw	%bx, %bx
	jle	LBB0_35
## %bb.33:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movzbl	(%r14), %edx
	movzbl	-52(%rbp), %r12d                ## 1-byte Folded Reload
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %ecx
	callq	_PDEBUG
	cmpw	$1, %bx
	jne	LBB0_36
LBB0_35:
	movl	%ebx, %eax
	jmp	LBB0_39
LBB0_5:
	cmpw	$32, %cx
	jae	LBB0_7
## %bb.6:
	xorl	%edi, %edi
	jmp	LBB0_15
LBB0_7:
	movl	%r8d, %edi
	andl	$-32, %edi
	leaq	-32(%rdi), %rsi
	movq	%rsi, %rax
	shrq	$5, %rax
	incq	%rax
	movl	%eax, %r9d
	andl	$3, %r9d
	cmpq	$96, %rsi
	jae	LBB0_9
## %bb.8:
	xorl	%esi, %esi
	jmp	LBB0_11
LBB0_36:
	movl	%ebx, %r13d
	movl	$1, %ebx
	leaq	L_.str(%rip), %r15
	.p2align	4, 0x90
LBB0_37:                                ## =>This Inner Loop Header: Depth=1
	movq	_DBG_I2C@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movzbl	(%r14,%rbx), %edx
	movq	%r15, %rsi
	movl	%r12d, %ecx
	callq	_PDEBUG
	incq	%rbx
	cmpq	%rbx, %r13
	jne	LBB0_37
LBB0_38:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
                                        ## kill: def $eax killed $eax killed $rax
LBB0_39:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	andq	$-4, %rax
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movups	(%rdx,%rsi), %xmm0
	movups	16(%rdx,%rsi), %xmm1
	movups	%xmm0, 2(%r14,%rsi)
	movups	%xmm1, 18(%r14,%rsi)
	movups	32(%rdx,%rsi), %xmm0
	movups	48(%rdx,%rsi), %xmm1
	movups	%xmm0, 34(%r14,%rsi)
	movups	%xmm1, 50(%r14,%rsi)
	movups	64(%rdx,%rsi), %xmm0
	movups	80(%rdx,%rsi), %xmm1
	movups	%xmm0, 66(%r14,%rsi)
	movups	%xmm1, 82(%r14,%rsi)
	movups	96(%rdx,%rsi), %xmm0
	movups	112(%rdx,%rsi), %xmm1
	movups	%xmm0, 98(%r14,%rsi)
	movups	%xmm1, 114(%r14,%rsi)
	subq	$-128, %rsi
	addq	$-4, %rax
	jne	LBB0_10
LBB0_11:
	testq	%r9, %r9
	je	LBB0_13
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movups	(%rdx,%rsi), %xmm0
	movups	16(%rdx,%rsi), %xmm1
	movq	%rsi, %rax
	orq	$2, %rax
	movups	%xmm0, (%r14,%rax)
	movups	%xmm1, 16(%r14,%rax)
	addq	$32, %rsi
	decq	%r9
	jne	LBB0_12
LBB0_13:
	cmpq	%r8, %rdi
	je	LBB0_22
## %bb.14:
	testb	$24, %r8b
	je	LBB0_18
LBB0_15:
	movq	%rdi, %rax
	movl	%r8d, %edi
	andl	$-8, %edi
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rdx,%rax), %rsi
	movq	%rsi, 2(%r14,%rax)
	addq	$8, %rax
	cmpq	%rax, %rdi
	jne	LBB0_16
## %bb.17:
	cmpq	%r8, %rdi
	je	LBB0_22
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_USBVISION_OP_CODE,4,2          ## @USBVISION_OP_CODE
	.comm	_USB_DIR_OUT,4,2                ## @USB_DIR_OUT
	.comm	_USB_TYPE_VENDOR,4,2            ## @USB_TYPE_VENDOR
	.comm	_USB_RECIP_ENDPOINT,4,2         ## @USB_RECIP_ENDPOINT
	.comm	_USBVISION_SER_ADRS,8,3         ## @USBVISION_SER_ADRS
	.comm	_HZ,4,2                         ## @HZ
	.comm	_USBVISION_SER_CONT,4,2         ## @USBVISION_SER_CONT
	.comm	_i2c_debug,4,2                  ## @i2c_debug
	.comm	_DBG_I2C,4,2                    ## @DBG_I2C
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wrote %x at address %x"

	.no_dead_strip	_usbvision_i2c_write_max4
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function usbvision_i2c_write_max4
_usbvision_i2c_write_max4:              ; @usbvision_i2c_write_max4
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x0
	ldr	x23, [x0]
	mov	w24, #16
	bfxil	w24, w3, #0, #3
	str	w1, [sp, #24]                   ; 4-byte Folded Spill
	strb	w1, [x23]
	strb	w24, [x23, #1]
	cmp	w3, #1
	b.lt	LBB0_6
; %bb.1:
	mov	w8, w3
	cmp	w3, #8
	b.lo	LBB0_3
; %bb.2:
	sub	x9, x23, x2
	add	x9, x9, #2
	cmp	x9, #64
	b.hs	LBB0_20
LBB0_3:
	mov	x9, #0
LBB0_4:
	add	x10, x9, x23
	add	x10, x10, #2
	add	x11, x2, x9
	sub	x8, x8, x9
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldrb	w9, [x11], #1
	strb	w9, [x10], #1
	subs	x8, x8, #1
	b.ne	LBB0_5
LBB0_6:
	str	x2, [sp, #16]                   ; 8-byte Folded Spill
	str	w3, [sp, #28]                   ; 4-byte Folded Spill
	add	w9, w3, #2
Lloh0:
	adrp	x20, _USB_RECIP_ENDPOINT@GOTPAGE
Lloh1:
	ldr	x20, [x20, _USB_RECIP_ENDPOINT@GOTPAGEOFF]
Lloh2:
	adrp	x19, _USBVISION_SER_ADRS@GOTPAGE
Lloh3:
	ldr	x19, [x19, _USBVISION_SER_ADRS@GOTPAGEOFF]
	mov	w8, #5
Lloh4:
	adrp	x27, _HZ@GOTPAGE
Lloh5:
	ldr	x27, [x27, _HZ@GOTPAGEOFF]
	sxth	w25, w9
Lloh6:
	adrp	x28, _USBVISION_SER_CONT@GOTPAGE
Lloh7:
	ldr	x28, [x28, _USBVISION_SER_CONT@GOTPAGEOFF]
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	mov	x21, x8
	ldr	w26, [x22, #8]
	mov	x0, x26
	mov	w1, #1
	bl	_usb_sndctrlpipe
	mov	x1, x0
Lloh8:
	adrp	x8, _USBVISION_OP_CODE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _USBVISION_OP_CODE@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
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]
	orr	w8, w9, w8
	ldr	w9, [x20]
	orr	w3, w8, w9
	ldr	w5, [x19]
	ldr	w8, [x27]
	str	w8, [sp]
	mov	x0, x26
	mov	w4, #0
	mov	x6, x23
	mov	x7, x25
	bl	_usb_control_msg
	tbnz	w0, #31, LBB0_19
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w1, [x28]
	mov	x0, x22
	mov	x2, x24
	bl	_usbvision_write_reg
	tbnz	w0, #31, LBB0_19
LBB0_9:                                 ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w1, [x28]
	mov	x0, x22
	bl	_usbvision_read_reg
	and	w8, w0, #0x10
	cmp	w0, #1
	ccmp	w8, #0, #4, ge
	b.ne	LBB0_9
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	tbnz	w0, #31, LBB0_19
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	tbz	w0, #5, LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w1, [x28]
	mov	x0, x22
	mov	w2, #0
	bl	_usbvision_write_reg
	sub	w8, w21, #1
	cbnz	w21, LBB0_7
; %bb.13:
	mov	w0, #-1
	b	LBB0_19
LBB0_14:
Lloh17:
	adrp	x8, _i2c_debug@GOTPAGE
Lloh18:
	ldr	x8, [x8, _i2c_debug@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	adrp	x19, _DBG_I2C@GOTPAGE
Lloh21:
	ldr	x19, [x19, _DBG_I2C@GOTPAGEOFF]
	ldr	w0, [x19]
	and	w8, w0, w8
	cmp	w8, #0
	ldr	w23, [sp, #28]                  ; 4-byte Folded Reload
	ccmp	w23, #1, #8, ne
	b.lt	LBB0_18
; %bb.15:
	ldr	x21, [sp, #16]                  ; 8-byte Folded Reload
	ldrb	w2, [x21]
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	ldr	w24, [sp, #24]                  ; 4-byte Folded Reload
	mov	x3, x24
	bl	_PDEBUG
	cmp	w23, #1
	b.eq	LBB0_18
; %bb.16:
	mov	w8, w23
	sub	x20, x8, #1
	add	x22, x21, #1
Lloh24:
	adrp	x21, l_.str@PAGE
Lloh25:
	add	x21, x21, l_.str@PAGEOFF
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19]
	ldrb	w2, [x22], #1
	mov	x1, x21
	mov	x3, x24
	bl	_PDEBUG
	subs	x20, x20, #1
	b.ne	LBB0_17
LBB0_18:
	mov	x0, x23
LBB0_19:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_20:
	cmp	w3, #64
	b.hs	LBB0_22
; %bb.21:
	mov	x9, #0
	b	LBB0_26
LBB0_22:
	and	x9, x8, #0xffffffc0
	add	x10, x2, #32
	add	x11, x23, #34
	mov	x12, x9
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x10, #-32]
	ldp	q2, q3, [x10], #64
	stp	q0, q1, [x11, #-32]
	stp	q2, q3, [x11], #64
	subs	x12, x12, #64
	b.ne	LBB0_23
; %bb.24:
	cmp	x9, x8
	b.eq	LBB0_6
; %bb.25:
	tst	x8, #0x38
	b.eq	LBB0_4
LBB0_26:
	mov	x12, x9
	and	x9, x8, #0xfffffff8
	add	x10, x12, x23
	add	x10, x10, #2
	add	x11, x2, x12
	sub	x12, x12, x9
LBB0_27:                                ; =>This Inner Loop Header: Depth=1
	ldr	d0, [x11], #8
	str	d0, [x10], #8
	adds	x12, x12, #8
	b.ne	LBB0_27
; %bb.28:
	cmp	x9, x8
	b.eq	LBB0_6
	b	LBB0_4
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_USBVISION_OP_CODE,4,2          ; @USBVISION_OP_CODE
	.comm	_USB_DIR_OUT,4,2                ; @USB_DIR_OUT
	.comm	_USB_TYPE_VENDOR,4,2            ; @USB_TYPE_VENDOR
	.comm	_USB_RECIP_ENDPOINT,4,2         ; @USB_RECIP_ENDPOINT
	.comm	_USBVISION_SER_ADRS,8,3         ; @USBVISION_SER_ADRS
	.comm	_HZ,4,2                         ; @HZ
	.comm	_USBVISION_SER_CONT,4,2         ; @USBVISION_SER_CONT
	.comm	_i2c_debug,4,2                  ; @i2c_debug
	.comm	_DBG_I2C,4,2                    ; @DBG_I2C
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wrote %x at address %x"

	.no_dead_strip	_usbvision_i2c_write_max4
.subsections_via_symbols
