	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bttv_i2c_xfer
_bttv_i2c_xfer:                         ## @bttv_i2c_xfer
	.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	%edx, %ebx
	movq	%rsi, %r13
	callq	_i2c_get_adapdata
	movq	%rax, %rdi
	callq	_to_bttv
	movq	%rax, %r15
	movq	_i2c_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_debug
LBB0_2:
	movq	_BT848_INT_I2CDONE@GOTPCREL(%rip), %rax
	movq	_BT848_INT_RACK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	_BT848_INT_STAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_btwrite
	testl	%ebx, %ebx
	jle	LBB0_11
## %bb.3:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %r14d
	decq	%r14
	movq	_I2C_M_RD@GOTPCREL(%rip), %r12
	movq	%r14, %rbx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %eax
	xorl	%edx, %edx
	subq	$1, %rbx
	setb	%dl
	testl	%eax, (%r13)
	je	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_bttv_i2c_readbytes
	testl	%eax, %eax
	jns	LBB0_7
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_bttv_i2c_sendbytes
	testl	%eax, %eax
	js	LBB0_10
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	testq	%r14, %r14
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	addq	$4, %r13
	movq	%rbx, %r14
	jmp	LBB0_4
LBB0_10:
	testl	%eax, %eax
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	cmovsl	%eax, %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_i2c_debug,8,3                  ## @i2c_debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bt-i2c:"

	.comm	_BT848_INT_I2CDONE,4,2          ## @BT848_INT_I2CDONE
	.comm	_BT848_INT_RACK,4,2             ## @BT848_INT_RACK
	.comm	_BT848_INT_STAT,4,2             ## @BT848_INT_STAT
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.no_dead_strip	_bttv_i2c_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bttv_i2c_xfer
_bttv_i2c_xfer:                         ; @bttv_i2c_xfer
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x2
	mov	x20, x1
	bl	_i2c_get_adapdata
	bl	_to_bttv
	mov	x21, x0
Lloh0:
	adrp	x8, _i2c_debug@GOTPAGE
Lloh1:
	ldr	x8, [x8, _i2c_debug@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
LBB0_2:
Lloh5:
	adrp	x8, _BT848_INT_I2CDONE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BT848_INT_I2CDONE@GOTPAGEOFF]
Lloh7:
	adrp	x9, _BT848_INT_RACK@GOTPAGE
Lloh8:
	ldr	x9, [x9, _BT848_INT_RACK@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	ldr	w9, [x9]
	orr	w0, w9, w8
Lloh11:
	adrp	x8, _BT848_INT_STAT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BT848_INT_STAT@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	bl	_btwrite
	cmp	w19, #1
	b.lt	LBB0_10
; %bb.3:
	mov	w8, w19
	sub	x22, x8, #1
Lloh14:
	adrp	x23, _I2C_M_RD@GOTPAGE
Lloh15:
	ldr	x23, [x23, _I2C_M_RD@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x20]
	ldr	w9, [x23]
	cmp	x22, #0
	cset	w2, eq
	mov	x0, x21
	mov	x1, x20
	and	w8, w9, w8
	cbz	w8, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_bttv_i2c_readbytes
	tbz	w0, #31, LBB0_7
	b	LBB0_9
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	bl	_bttv_i2c_sendbytes
	tbnz	w0, #31, LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	cbz	x22, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	sub	x22, x22, #1
	add	x20, x20, #4
	b	LBB0_4
LBB0_9:
	cmp	w0, #0
	csel	w19, w0, w19, lt
LBB0_10:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh9
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_i2c_debug,8,3                  ; @i2c_debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bt-i2c:"

	.comm	_BT848_INT_I2CDONE,4,2          ; @BT848_INT_I2CDONE
	.comm	_BT848_INT_RACK,4,2             ; @BT848_INT_RACK
	.comm	_BT848_INT_STAT,4,2             ; @BT848_INT_STAT
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.no_dead_strip	_bttv_i2c_xfer
.subsections_via_symbols
