	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bttv_i2c_sendbytes
_bttv_i2c_sendbytes:                    ## @bttv_i2c_sendbytes
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rsi), %eax
	testl	%eax, %eax
	je	LBB0_12
## %bb.1:
	movl	%edx, %r14d
	movq	%rsi, %r12
	movq	%rdi, %r15
	movl	4(%rsi), %ecx
	shll	$25, %ecx
	movq	8(%rsi), %rdx
	movl	(%rdx), %edx
	shll	$16, %edx
	orl	%ecx, %edx
	movq	_I2C_HW@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	xorl	%ebx, %ebx
	cmpl	$2, %eax
	movq	_BT878_I2C_NOSTOP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmovgel	%eax, %ebx
	testl	%r14d, %r14d
	cmovel	%eax, %ebx
	orl	%edx, %ebx
	movq	_BT848_I2C@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_btwrite
	movq	%r15, %rdi
	callq	_bttv_i2c_wait_done
	testl	%eax, %eax
	js	LBB0_13
## %bb.2:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	je	LBB0_14
## %bb.3:
	movq	_i2c_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_5
## %bb.4:
	movl	4(%r12), %esi
	addl	%esi, %esi
	movq	8(%r12), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_cont
LBB0_5:
	movl	(%r12), %r13d
	cmpl	$2, %r13d
	jl	LBB0_18
## %bb.6:
	movl	$1, %r14d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_8 Depth=1
	incq	%r14
	movslq	(%r12), %r13
	cmpq	%r13, %r14
	jge	LBB0_18
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movl	(%rax,%r14,4), %eax
	shll	$24, %eax
	movq	_I2C_HW@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_BT878_I2C_NOSTART@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	decl	%r13d
	movslq	%r13d, %rcx
	cmpq	%rcx, %r14
	movq	_BT878_I2C_NOSTOP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %ebx
	movl	$0, %edx
	cmovgel	%edx, %ebx
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	cmovel	%ecx, %ebx
	orl	%eax, %ebx
	movq	_BT848_I2C@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_btwrite
	movq	%r15, %rdi
	callq	_bttv_i2c_wait_done
	testl	%eax, %eax
	js	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	je	LBB0_14
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	_i2c_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_7
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	8(%r12), %rax
	movl	(%rax,%r14,4), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_cont
	jmp	LBB0_7
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_17
LBB0_13:
	movl	%eax, %r13d
	jmp	LBB0_15
LBB0_14:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_15:
	movq	_i2c_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_17
## %bb.16:
	leaq	L_.str.3(%rip), %rdi
	movl	%r13d, %esi
	xorl	%eax, %eax
	callq	_pr_cont
LBB0_17:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movq	_i2c_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_17
## %bb.19:
	movq	_BT878_I2C_NOSTOP@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	jne	LBB0_17
## %bb.20:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_cont
	movl	(%r12), %r13d
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_I2C_HW,4,2                     ## @I2C_HW
	.comm	_BT878_I2C_NOSTOP,4,2           ## @BT878_I2C_NOSTOP
	.comm	_BT848_I2C,4,2                  ## @BT848_I2C
	.comm	_i2c_debug,8,3                  ## @i2c_debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	" <W %02x %02x"

	.comm	_BT878_I2C_NOSTART,4,2          ## @BT878_I2C_NOSTART
L_.str.1:                               ## @.str.1
	.asciz	" %02x"

L_.str.2:                               ## @.str.2
	.asciz	">\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.3:                               ## @.str.3
	.asciz	" ERR: %d\n"

	.no_dead_strip	_bttv_i2c_sendbytes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bttv_i2c_sendbytes
_bttv_i2c_sendbytes:                    ; @bttv_i2c_sendbytes
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	ldr	w8, [x1]
	cbz	w8, LBB0_12
; %bb.1:
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	ldr	w9, [x1, #4]
	ldr	x10, [x1, #8]
	ldr	w10, [x10]
	lsl	w10, w10, #16
	orr	w9, w10, w9, lsl #25
Lloh0:
	adrp	x27, _I2C_HW@GOTPAGE
Lloh1:
	ldr	x27, [x27, _I2C_HW@GOTPAGEOFF]
	ldr	w10, [x27]
	orr	w9, w9, w10
	cmp	w8, #2
	ccmp	w2, #0, #4, lt
Lloh2:
	adrp	x25, _BT878_I2C_NOSTOP@GOTPAGE
Lloh3:
	ldr	x25, [x25, _BT878_I2C_NOSTOP@GOTPAGEOFF]
	ldr	w8, [x25]
	csel	w8, wzr, w8, ne
	orr	w22, w9, w8
Lloh4:
	adrp	x28, _BT848_I2C@GOTPAGE
Lloh5:
	ldr	x28, [x28, _BT848_I2C@GOTPAGEOFF]
	ldr	w1, [x28]
	mov	x0, x22
	bl	_btwrite
	mov	x0, x21
	bl	_bttv_i2c_wait_done
	mov	x23, x0
Lloh6:
	adrp	x26, _i2c_debug@GOTPAGE
Lloh7:
	ldr	x26, [x26, _i2c_debug@GOTPAGEOFF]
	tbnz	w0, #31, LBB0_14
; %bb.2:
	cbz	w23, LBB0_13
; %bb.3:
	ldr	x8, [x26]
	cbz	x8, LBB0_5
; %bb.4:
	ldr	w8, [x19, #4]
	lsl	w8, w8, #1
	ldr	x9, [x19, #8]
	ldr	w9, [x9]
	stp	x8, x9, [sp]
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_cont
LBB0_5:
	ldr	w23, [x19]
	cmp	w23, #2
	b.lt	LBB0_17
; %bb.6:
	mov	w24, #1
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x24, x24, #1
	ldrsw	x23, [x19]
	cmp	x24, x23
	b.ge	LBB0_17
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	sub	w8, w23, #1
	cmp	x24, w8, sxtw
	ccmp	w20, #0, #4, ge
	ldr	x8, [x19, #8]
	ldr	w8, [x8, x24, lsl #2]
	ldr	w9, [x27]
	orr	w8, w9, w8, lsl #24
Lloh10:
	adrp	x9, _BT878_I2C_NOSTART@GOTPAGE
Lloh11:
	ldr	x9, [x9, _BT878_I2C_NOSTART@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x25]
	csel	w9, wzr, w9, ne
	orr	w22, w8, w9
	ldr	w1, [x28]
	mov	x0, x22
	bl	_btwrite
	mov	x0, x21
	bl	_bttv_i2c_wait_done
	mov	x23, x0
	tbnz	w0, #31, LBB0_14
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	cbz	w23, LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x26]
	cbz	x8, LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x19, #8]
	ldr	w8, [x8, x24, lsl #2]
	str	x8, [sp]
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_cont
	b	LBB0_7
LBB0_12:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_16
LBB0_13:
Lloh18:
	adrp	x8, _EIO@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_14:
	ldr	x8, [x26]
	cbz	x8, LBB0_16
; %bb.15:
	mov	x8, x23
	str	x8, [sp]
Lloh21:
	adrp	x0, l_.str.3@PAGE
Lloh22:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_cont
LBB0_16:
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_17:
	ldr	x8, [x26]
	cbz	x8, LBB0_16
; %bb.18:
	ldr	w8, [x25]
	tst	w8, w22
	b.ne	LBB0_16
; %bb.19:
Lloh23:
	adrp	x0, l_.str.2@PAGE
Lloh24:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_cont
	ldr	w23, [x19]
	b	LBB0_16
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_I2C_HW,4,2                     ; @I2C_HW
	.comm	_BT878_I2C_NOSTOP,4,2           ; @BT878_I2C_NOSTOP
	.comm	_BT848_I2C,4,2                  ; @BT848_I2C
	.comm	_i2c_debug,8,3                  ; @i2c_debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" <W %02x %02x"

	.comm	_BT878_I2C_NOSTART,4,2          ; @BT878_I2C_NOSTART
l_.str.1:                               ; @.str.1
	.asciz	" %02x"

l_.str.2:                               ; @.str.2
	.asciz	">\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.3:                               ; @.str.3
	.asciz	" ERR: %d\n"

	.no_dead_strip	_bttv_i2c_sendbytes
.subsections_via_symbols
