	.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_14
## %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	%r13d, %r13d
	cmpl	$2, %eax
	movq	_BT878_I2C_NOSTOP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmovgel	%eax, %r13d
	testl	%r14d, %r14d
	cmovel	%eax, %r13d
	orl	%edx, %r13d
	movq	_BT848_I2C@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	callq	_btwrite
	movq	%r15, %rdi
	callq	_bttv_i2c_wait_done
	testl	%eax, %eax
	js	LBB0_15
## %bb.2:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	je	LBB0_16
## %bb.3:
	movq	_i2c_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %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	_printk
	movq	_BT878_I2C_NOSTOP@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	jne	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_printk
LBB0_6:
	movl	(%r12), %ebx
	cmpl	$2, %ebx
	jl	LBB0_19
## %bb.7:
	movl	$1, %r14d
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_9 Depth=1
	incq	%r14
	movslq	(%r12), %rbx
	cmpq	%rbx, %r14
	jge	LBB0_19
LBB0_9:                                 ## =>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	%ebx
	movslq	%ebx, %rcx
	cmpq	%rcx, %r14
	movq	_BT878_I2C_NOSTOP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %r13d
	movl	$0, %edx
	cmovgel	%edx, %r13d
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	cmovel	%ecx, %r13d
	orl	%eax, %r13d
	movq	_BT848_I2C@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	callq	_btwrite
	movq	%r15, %rdi
	callq	_bttv_i2c_wait_done
	testl	%eax, %eax
	js	LBB0_15
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	je	LBB0_16
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_i2c_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	8(%r12), %rax
	movl	(%rax,%r14,4), %esi
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_printk
	movq	_BT878_I2C_NOSTOP@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	jne	LBB0_8
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=1
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_printk
	jmp	LBB0_8
LBB0_14:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_19
LBB0_15:
	movl	%eax, %ebx
	jmp	LBB0_17
LBB0_16:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_17:
	movq	_i2c_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_19
## %bb.18:
	leaq	L_.str.3(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_printk
LBB0_19:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.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"

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

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

	.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_14
; %bb.1:
	mov	x19, x2
	mov	x20, 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	x26, _I2C_HW@GOTPAGE
Lloh1:
	ldr	x26, [x26, _I2C_HW@GOTPAGEOFF]
	ldr	w10, [x26]
	orr	w9, w9, w10
	cmp	w8, #2
	ccmp	w2, #0, #4, lt
Lloh2:
	adrp	x27, _BT878_I2C_NOSTOP@GOTPAGE
Lloh3:
	ldr	x27, [x27, _BT878_I2C_NOSTOP@GOTPAGEOFF]
	ldr	w8, [x27]
	csel	w8, wzr, w8, ne
	orr	w22, w9, w8
Lloh4:
	adrp	x23, _BT848_I2C@GOTPAGE
Lloh5:
	ldr	x23, [x23, _BT848_I2C@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x22
	bl	_btwrite
	mov	x0, x21
	bl	_bttv_i2c_wait_done
	mov	x24, x0
Lloh6:
	adrp	x28, _i2c_debug@GOTPAGE
Lloh7:
	ldr	x28, [x28, _i2c_debug@GOTPAGEOFF]
	tbnz	w0, #31, LBB0_16
; %bb.2:
	cbz	w24, LBB0_15
; %bb.3:
	ldr	x8, [x28]
	cbz	x8, LBB0_6
; %bb.4:
	ldr	w8, [x20, #4]
	lsl	w8, w8, #1
	ldr	x9, [x20, #8]
	ldr	w9, [x9]
	stp	x8, x9, [sp]
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printk
	ldr	w8, [x27]
	tst	w8, w22
	b.ne	LBB0_6
; %bb.5:
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printk
LBB0_6:
	ldr	w24, [x20]
	cmp	w24, #2
	b.lt	LBB0_18
; %bb.7:
	mov	w22, #1
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	x22, x22, #1
	ldrsw	x24, [x20]
	cmp	x22, x24
	b.ge	LBB0_18
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	sub	w8, w24, #1
	cmp	x22, w8, sxtw
	ccmp	w19, #0, #4, ge
	ldr	x8, [x20, #8]
	ldr	w8, [x8, x22, lsl #2]
	ldr	w9, [x26]
	orr	w8, w9, w8, lsl #24
Lloh12:
	adrp	x9, _BT878_I2C_NOSTART@GOTPAGE
Lloh13:
	ldr	x9, [x9, _BT878_I2C_NOSTART@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x27]
	csel	w9, wzr, w9, ne
	orr	w25, w8, w9
	ldr	w1, [x23]
	mov	x0, x25
	bl	_btwrite
	mov	x0, x21
	bl	_bttv_i2c_wait_done
	mov	x24, x0
	tbnz	w0, #31, LBB0_16
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	cbz	w24, LBB0_15
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x28]
	cbz	x8, LBB0_8
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x20, #8]
	ldr	w8, [x8, x22, lsl #2]
	str	x8, [sp]
Lloh15:
	adrp	x0, l_.str.2@PAGE
Lloh16:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_printk
	ldr	w8, [x27]
	tst	w8, w25
	b.ne	LBB0_8
; %bb.13:                               ;   in Loop: Header=BB0_9 Depth=1
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printk
	b	LBB0_8
LBB0_14:
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_18
LBB0_15:
Lloh22:
	adrp	x8, _EIO@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_16:
	ldr	x8, [x28]
	cbz	x8, LBB0_18
; %bb.17:
	mov	x8, x24
	str	x8, [sp]
Lloh25:
	adrp	x0, l_.str.3@PAGE
Lloh26:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_printk
LBB0_18:
	mov	x0, x24
	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
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.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"

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

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

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

	.no_dead_strip	_bttv_i2c_sendbytes
.subsections_via_symbols
