	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm_bsc_transfer
_bcm_bsc_transfer:                      ## @bcm_bsc_transfer
	.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
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %r15
	callq	_device_get_softc
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_BCM_BSC_LOCK
	movq	_BCM_I2C_BUSY@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	testl	%eax, (%r12)
	je	LBB0_3
## %bb.1:
	leaq	24(%r12), %rbx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	leaq	L_.str(%rip), %rcx
	xorl	%r8d, %r8d
	callq	_mtx_sleep
	movl	(%r13), %eax
	testl	%eax, (%r12)
	jne	LBB0_2
LBB0_3:
	movl	%eax, (%r12)
	leaq	L_.str.1(%rip), %rdx
	xorl	%r13d, %r13d
	movq	%r12, %rdi
	movl	$3, %esi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rcx
	xorl	%eax, %eax
	callq	_DEVICE_DEBUGF
	movq	%r12, %rdi
	callq	_bcm_bsc_reset
	movq	$0, 40(%r12)
	movq	%r14, 32(%r12)
	testq	%rbx, %rbx
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	jle	LBB0_31
## %bb.4:
	movq	-48(%rbp), %r9                  ## 8-byte Reload
	shlq	$4, %r9
	addq	%r14, %r9
	movq	%r12, %rax
	addq	$24, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_BCM_BSC_STATUS@GOTPCREL(%rip), %r15
	movq	%r9, -48(%rbp)                  ## 8-byte Spill
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
                                        ##     Child Loop BB0_17 Depth 2
                                        ##     Child Loop BB0_23 Depth 2
	movl	(%r14), %eax
	movq	_IIC_M_RD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	4(%r14), %ebx
	andl	%edx, %ebx
	movq	$0, 8(%r12)
	movq	8(%r14), %rcx
	addq	$16, %r14
	cmpq	%r9, %r14
	jae	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_IIC_M_WR@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r8d
	movl	%ebx, %edi
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=2
	addq	8(%r14), %rcx
	addq	$16, %r14
	cmpq	%r9, %r14
	jae	LBB0_12
LBB0_7:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r14), %esi
	xorl	%eax, %esi
	cmpl	$1, %esi
	ja	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=2
	movl	4(%r14), %esi
	andl	%edx, %esi
	cmpl	%esi, %edi
	je	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=2
	cmpl	%r8d, %edi
	jne	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=2
	movq	%rcx, 8(%r12)
	movl	%edx, %edi
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%rcx, 16(%r12)
	xorl	%r14d, %r14d
	testl	%ebx, %ebx
	setne	%r14b
	leaq	L_.str.4(%rip), %r13
	leaq	L_.str.5(%rip), %rcx
	cmoveq	%rcx, %r13
	orl	%eax, %r14d
	movq	_BCM_BSC_SLAVE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	sarl	%eax
	movslq	%eax, %rdx
	movq	%r12, %rdi
	callq	_BCM_BSC_WRITE
	movq	%r12, %rdi
	movl	$2, %esi
	leaq	L_.str.2(%rip), %rdx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_DEVICE_DEBUGF
	movq	8(%r12), %r9
	testq	%r9, %r9
	je	LBB0_13
## %bb.16:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%r12, %rdi
	movl	$1, %esi
	leaq	L_.str.3(%rip), %rdx
	movq	%r13, %rcx
	movl	%r14d, %r8d
	xorl	%eax, %eax
	callq	_DEVICE_DEBUGF
	movq	_BCM_BSC_DLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	8(%r12), %rdx
	movq	%r12, %rdi
	callq	_BCM_BSC_WRITE
	movq	_BCM_BSC_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BCM_BSC_CTRL_ST@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	_BCM_BSC_CTRL_I2CEN@GOTPCREL(%rip), %rax
	orq	(%rax), %rdx
	movq	%r12, %rdi
	callq	_BCM_BSC_WRITE
	movq	_BCM_BSC_STATUS_ERR@GOTPCREL(%rip), %rbx
	movq	_BCM_BSC_STATUS_TA@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_17:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_BCM_BSC_READ
	testq	%rax, (%rbx)
	jne	LBB0_27
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=2
	testq	%rax, (%r14)
	je	LBB0_17
## %bb.19:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	16(%r12), %rdx
	subq	8(%r12), %rdx
	movq	_BCM_BSC_CTRL_READ@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movq	_BCM_I2C_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	(%r12), %eax
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	16(%r12), %r9
	movq	%r12, %rdi
	movl	$1, %esi
	leaq	L_.str.3(%rip), %rdx
	movq	%r13, %rcx
	movl	%r14d, %r8d
	xorl	%eax, %eax
	callq	_DEVICE_DEBUGF
	movq	16(%r12), %rdx
	testl	%ebx, %ebx
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_BCM_BSC_CTRL_READ@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movl	(%r12), %eax
	movq	_BCM_I2C_READ@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	jmp	LBB0_20
LBB0_15:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	_BCM_I2C_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	(%r12), %eax
	xorl	%r14d, %r14d
LBB0_20:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	%eax, (%r12)
	movq	_BCM_BSC_DLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_BCM_BSC_WRITE
	movq	_BCM_BSC_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BCM_BSC_CTRL_I2CEN@GOTPCREL(%rip), %rax
	orq	(%rax), %r14
	movq	_BCM_BSC_CTRL_ST@GOTPCREL(%rip), %rax
	orq	(%rax), %r14
	movq	_BCM_BSC_CTRL_INT_ALL@GOTPCREL(%rip), %rax
	orq	(%rax), %r14
	movq	%r12, %rdi
	movq	%r14, %rdx
	callq	_BCM_BSC_WRITE
	movq	32(%r12), %rax
	movq	_IIC_M_RD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 4(%rax)
	jne	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%r12, %rdi
	callq	_bcm_bsc_fill_tx_fifo
LBB0_22:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	_BCM_I2C_DONE@GOTPCREL(%rip), %r14
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_23:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r12), %r13d
	testl	%r13d, (%r14)
	jne	LBB0_26
## %bb.24:                              ##   in Loop: Header=BB0_23 Depth=2
	movq	_hz@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r12, %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	leaq	L_.str.6(%rip), %rcx
	callq	_mtx_sleep
	testl	%eax, %eax
	je	LBB0_23
## %bb.25:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	%eax, %r13d
	jmp	LBB0_28
	.p2align	4, 0x90
LBB0_26:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	_BCM_I2C_ERROR@GOTPCREL(%rip), %rax
	andl	(%rax), %r13d
	je	LBB0_28
LBB0_27:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_28:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%r12, %rdi
	movl	$1, %esi
	leaq	L_.str.7(%rip), %rdx
	movl	%r13d, %ecx
	callq	_DEBUGF
	movq	%r12, %rdi
	movl	$2, %esi
	leaq	L_.str.8(%rip), %rdx
	xorl	%eax, %eax
	callq	_DEVICE_DEBUGF
	testl	%r13d, %r13d
	jne	LBB0_31
## %bb.29:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	32(%r12), %r14
	movq	-48(%rbp), %r9                  ## 8-byte Reload
	cmpq	%r9, %r14
	jb	LBB0_5
## %bb.30:
	xorl	%r13d, %r13d
LBB0_31:
	movq	%r12, %rdi
	callq	_bcm_bsc_reset
	movl	$0, (%r12)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_wakeup
	movq	%r12, %rdi
	callq	_BCM_BSC_UNLOCK
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BCM_I2C_BUSY,4,2               ## @BCM_I2C_BUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bscbusw"

L_.str.1:                               ## @.str.1
	.asciz	"Transfer %d msgs\n"

	.comm	_IIC_M_RD,4,2                   ## @IIC_M_RD
	.comm	_IIC_M_WR,4,2                   ## @IIC_M_WR
	.comm	_BCM_BSC_SLAVE,4,2              ## @BCM_BSC_SLAVE
L_.str.2:                               ## @.str.2
	.asciz	"start  0x%02x\n"

L_.str.3:                               ## @.str.3
	.asciz	"%-6s 0x%02x len %d: "

L_.str.4:                               ## @.str.4
	.asciz	"read"

L_.str.5:                               ## @.str.5
	.asciz	"write"

	.comm	_BCM_BSC_CTRL_READ,8,3          ## @BCM_BSC_CTRL_READ
	.comm	_BCM_I2C_READ,4,2               ## @BCM_I2C_READ
	.comm	_BCM_BSC_DLEN,4,2               ## @BCM_BSC_DLEN
	.comm	_BCM_BSC_CTRL,4,2               ## @BCM_BSC_CTRL
	.comm	_BCM_BSC_CTRL_I2CEN,8,3         ## @BCM_BSC_CTRL_I2CEN
	.comm	_BCM_BSC_CTRL_ST,8,3            ## @BCM_BSC_CTRL_ST
	.comm	_BCM_BSC_STATUS,4,2             ## @BCM_BSC_STATUS
	.comm	_BCM_BSC_STATUS_ERR,8,3         ## @BCM_BSC_STATUS_ERR
	.comm	_EIO,4,2                        ## @EIO
	.comm	_BCM_BSC_STATUS_TA,8,3          ## @BCM_BSC_STATUS_TA
	.comm	_BCM_BSC_CTRL_INT_ALL,8,3       ## @BCM_BSC_CTRL_INT_ALL
	.comm	_BCM_I2C_DONE,4,2               ## @BCM_I2C_DONE
L_.str.6:                               ## @.str.6
	.asciz	"bsciow"

	.comm	_hz,4,2                         ## @hz
	.comm	_BCM_I2C_ERROR,4,2              ## @BCM_I2C_ERROR
L_.str.7:                               ## @.str.7
	.asciz	" err=%d\n"

L_.str.8:                               ## @.str.8
	.asciz	"stop\n"

	.no_dead_strip	_bcm_bsc_transfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm_bsc_transfer
_bcm_bsc_transfer:                      ; @bcm_bsc_transfer
	.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, x2
	mov	x27, x1
	mov	x24, x0
	bl	_device_get_softc
	mov	x20, x0
	bl	_BCM_BSC_LOCK
	ldr	w9, [x20]
Lloh0:
	adrp	x19, _BCM_I2C_BUSY@GOTPAGE
Lloh1:
	ldr	x19, [x19, _BCM_I2C_BUSY@GOTPAGEOFF]
	ldr	w8, [x19]
	tst	w8, w9
	str	x24, [sp, #24]                  ; 8-byte Folded Spill
	b.eq	LBB0_3
; %bb.1:
	add	x21, x20, #24
Lloh2:
	adrp	x23, l_.str@PAGE
Lloh3:
	add	x23, x23, l_.str@PAGEOFF
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	mov	x1, x21
	mov	w2, #0
	mov	x3, x23
	mov	w4, #0
	bl	_mtx_sleep
	ldr	w9, [x20]
	ldr	w8, [x19]
	tst	w8, w9
	b.ne	LBB0_2
LBB0_3:
	str	w8, [x20]
	str	x22, [sp]
Lloh4:
	adrp	x2, l_.str.1@PAGE
Lloh5:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	w1, #3
	bl	_DEVICE_DEBUGF
	mov	x0, x20
	bl	_bcm_bsc_reset
	stp	x27, xzr, [x20, #32]
	cmp	x22, #1
	b.lt	LBB0_30
; %bb.4:
	add	x21, x20, #24
	add	x22, x27, x22, lsl #4
Lloh6:
	adrp	x25, _BCM_I2C_DONE@GOTPAGE
Lloh7:
	ldr	x25, [x25, _BCM_I2C_DONE@GOTPAGEOFF]
Lloh8:
	adrp	x26, _hz@GOTPAGE
Lloh9:
	ldr	x26, [x26, _hz@GOTPAGEOFF]
Lloh10:
	adrp	x24, l_.str.6@PAGE
Lloh11:
	add	x24, x24, l_.str.6@PAGEOFF
Lloh12:
	adrp	x28, _BCM_BSC_STATUS_ERR@GOTPAGE
Lloh13:
	ldr	x28, [x28, _BCM_BSC_STATUS_ERR@GOTPAGEOFF]
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
                                        ;     Child Loop BB0_14 Depth 2
                                        ;     Child Loop BB0_24 Depth 2
	ldp	w23, w8, [x27]
Lloh14:
	adrp	x9, _IIC_M_RD@GOTPAGE
Lloh15:
	ldr	x9, [x9, _IIC_M_RD@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	and	w19, w9, w8
	str	xzr, [x20, #8]
	ldr	x8, [x27, #8]
	add	x10, x27, #16
	cmp	x10, x22
	b.hs	LBB0_12
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh17:
	adrp	x11, _IIC_M_WR@GOTPAGE
Lloh18:
	ldr	x11, [x11, _IIC_M_WR@GOTPAGEOFF]
Lloh19:
	ldr	w11, [x11]
	mov	x12, x19
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=2
	ldr	x13, [x10, #8]
	add	x8, x13, x8
	add	x10, x10, #16
	cmp	x10, x22
	b.hs	LBB0_12
LBB0_8:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w13, [x10]
	eor	w13, w13, w23
	cmp	w13, #1
	b.hi	LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	ldr	w13, [x10, #4]
	and	w13, w13, w9
	cmp	w12, w13
	b.eq	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=2
	cmp	w12, w11
	b.ne	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=2
	str	x8, [x20, #8]
	mov	x12, x9
	b	LBB0_7
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=1
	str	x8, [x20, #16]
Lloh20:
	adrp	x8, _BCM_BSC_SLAVE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _BCM_BSC_SLAVE@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	sbfx	x2, x23, #1, #31
	mov	x0, x20
	bl	_BCM_BSC_WRITE
	cmp	w19, #0
	cset	w8, ne
	orr	w23, w23, w8
	str	x23, [sp]
Lloh23:
	adrp	x8, l_.str.4@PAGE
Lloh24:
	add	x8, x8, l_.str.4@PAGEOFF
Lloh25:
	adrp	x9, l_.str.5@PAGE
Lloh26:
	add	x9, x9, l_.str.5@PAGEOFF
	csel	x27, x9, x8, eq
	mov	x0, x20
	mov	w1, #2
Lloh27:
	adrp	x2, l_.str.2@PAGE
Lloh28:
	add	x2, x2, l_.str.2@PAGEOFF
	bl	_DEVICE_DEBUGF
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_17
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=1
                                        ; kill: def $w23 killed $w23 killed $x23 def $x23
	stp	x23, x8, [sp, #8]
	str	x27, [sp]
	mov	x0, x20
	mov	w1, #1
Lloh29:
	adrp	x2, l_.str.3@PAGE
Lloh30:
	add	x2, x2, l_.str.3@PAGEOFF
	bl	_DEVICE_DEBUGF
Lloh31:
	adrp	x8, _BCM_BSC_DLEN@GOTPAGE
Lloh32:
	ldr	x8, [x8, _BCM_BSC_DLEN@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	ldr	x2, [x20, #8]
	mov	x0, x20
	bl	_BCM_BSC_WRITE
Lloh34:
	adrp	x8, _BCM_BSC_CTRL@GOTPAGE
Lloh35:
	ldr	x8, [x8, _BCM_BSC_CTRL@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
Lloh37:
	adrp	x8, _BCM_BSC_CTRL_I2CEN@GOTPAGE
Lloh38:
	ldr	x8, [x8, _BCM_BSC_CTRL_I2CEN@GOTPAGEOFF]
Lloh39:
	ldr	x8, [x8]
Lloh40:
	adrp	x9, _BCM_BSC_CTRL_ST@GOTPAGE
Lloh41:
	ldr	x9, [x9, _BCM_BSC_CTRL_ST@GOTPAGEOFF]
Lloh42:
	ldr	x9, [x9]
	orr	x2, x9, x8
	mov	x0, x20
	bl	_BCM_BSC_WRITE
Lloh43:
	adrp	x19, _BCM_BSC_STATUS@GOTPAGE
Lloh44:
	ldr	x19, [x19, _BCM_BSC_STATUS@GOTPAGEOFF]
Lloh45:
	adrp	x23, _BCM_BSC_STATUS_TA@GOTPAGE
Lloh46:
	ldr	x23, [x23, _BCM_BSC_STATUS_TA@GOTPAGEOFF]
LBB0_14:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w1, [x19]
	mov	x0, x20
	bl	_BCM_BSC_READ
	ldr	x8, [x28]
	tst	x8, x0
	b.ne	LBB0_19
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=2
	ldr	x8, [x23]
	tst	x8, x0
	b.eq	LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_5 Depth=1
	ldp	x9, x8, [x20, #8]
	sub	x2, x8, x9
Lloh47:
	adrp	x8, _BCM_BSC_CTRL_READ@GOTPAGE
Lloh48:
	ldr	x8, [x8, _BCM_BSC_CTRL_READ@GOTPAGEOFF]
Lloh49:
	ldr	x19, [x8]
	b	LBB0_21
LBB0_17:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x20, #16]
                                        ; kill: def $w23 killed $w23 killed $x23 def $x23
	stp	x23, x8, [sp, #8]
	str	x27, [sp]
	mov	x0, x20
	mov	w1, #1
Lloh50:
	adrp	x2, l_.str.3@PAGE
Lloh51:
	add	x2, x2, l_.str.3@PAGEOFF
	bl	_DEVICE_DEBUGF
	ldr	x2, [x20, #16]
	cbz	w19, LBB0_20
; %bb.18:                               ;   in Loop: Header=BB0_5 Depth=1
Lloh52:
	adrp	x8, _BCM_BSC_CTRL_READ@GOTPAGE
Lloh53:
	ldr	x8, [x8, _BCM_BSC_CTRL_READ@GOTPAGEOFF]
Lloh54:
	ldr	x19, [x8]
Lloh55:
	adrp	x8, _BCM_I2C_READ@GOTPAGE
Lloh56:
	ldr	x8, [x8, _BCM_I2C_READ@GOTPAGEOFF]
Lloh57:
	ldr	w8, [x8]
	ldr	w9, [x20]
	orr	w8, w9, w8
	b	LBB0_22
LBB0_19:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh58:
	adrp	x8, _EIO@GOTPAGE
Lloh59:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh60:
	ldr	w27, [x8]
	b	LBB0_28
LBB0_20:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x19, #0
LBB0_21:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh61:
	adrp	x8, _BCM_I2C_READ@GOTPAGE
Lloh62:
	ldr	x8, [x8, _BCM_I2C_READ@GOTPAGEOFF]
Lloh63:
	ldr	w8, [x8]
	ldr	w9, [x20]
	bic	w8, w9, w8
LBB0_22:                                ;   in Loop: Header=BB0_5 Depth=1
	str	w8, [x20]
Lloh64:
	adrp	x8, _BCM_BSC_DLEN@GOTPAGE
Lloh65:
	ldr	x8, [x8, _BCM_BSC_DLEN@GOTPAGEOFF]
Lloh66:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_BCM_BSC_WRITE
Lloh67:
	adrp	x8, _BCM_BSC_CTRL@GOTPAGE
Lloh68:
	ldr	x8, [x8, _BCM_BSC_CTRL@GOTPAGEOFF]
Lloh69:
	ldr	w1, [x8]
Lloh70:
	adrp	x8, _BCM_BSC_CTRL_I2CEN@GOTPAGE
Lloh71:
	ldr	x8, [x8, _BCM_BSC_CTRL_I2CEN@GOTPAGEOFF]
Lloh72:
	ldr	x8, [x8]
	orr	x8, x8, x19
Lloh73:
	adrp	x9, _BCM_BSC_CTRL_ST@GOTPAGE
Lloh74:
	ldr	x9, [x9, _BCM_BSC_CTRL_ST@GOTPAGEOFF]
Lloh75:
	ldr	x9, [x9]
	orr	x8, x8, x9
Lloh76:
	adrp	x9, _BCM_BSC_CTRL_INT_ALL@GOTPAGE
Lloh77:
	ldr	x9, [x9, _BCM_BSC_CTRL_INT_ALL@GOTPAGEOFF]
Lloh78:
	ldr	x9, [x9]
	orr	x2, x8, x9
	mov	x0, x20
	bl	_BCM_BSC_WRITE
	ldr	x8, [x20, #32]
	ldr	w8, [x8, #4]
Lloh79:
	adrp	x9, _IIC_M_RD@GOTPAGE
Lloh80:
	ldr	x9, [x9, _IIC_M_RD@GOTPAGEOFF]
Lloh81:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_24
; %bb.23:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	bl	_bcm_bsc_fill_tx_fifo
LBB0_24:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x20]
	ldr	w9, [x25]
	tst	w9, w8
	b.ne	LBB0_27
; %bb.25:                               ;   in Loop: Header=BB0_24 Depth=2
	ldr	w4, [x26]
	mov	x0, x20
	mov	x1, x21
	mov	w2, #0
	mov	x3, x24
	bl	_mtx_sleep
	cbz	w0, LBB0_24
; %bb.26:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x27, x0
	b	LBB0_28
LBB0_27:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh82:
	adrp	x9, _BCM_I2C_ERROR@GOTPAGE
Lloh83:
	ldr	x9, [x9, _BCM_I2C_ERROR@GOTPAGEOFF]
Lloh84:
	ldr	w9, [x9]
Lloh85:
	adrp	x10, _EIO@GOTPAGE
Lloh86:
	ldr	x10, [x10, _EIO@GOTPAGEOFF]
Lloh87:
	ldr	w10, [x10]
	tst	w9, w8
	csel	w27, wzr, w10, eq
LBB0_28:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	mov	w1, #1
Lloh88:
	adrp	x2, l_.str.7@PAGE
Lloh89:
	add	x2, x2, l_.str.7@PAGEOFF
	mov	x3, x27
	bl	_DEBUGF
	mov	x0, x20
	mov	w1, #2
Lloh90:
	adrp	x2, l_.str.8@PAGE
Lloh91:
	add	x2, x2, l_.str.8@PAGEOFF
	bl	_DEVICE_DEBUGF
	cbnz	w27, LBB0_31
; %bb.29:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x27, [x20, #32]
	cmp	x27, x22
	b.lo	LBB0_5
LBB0_30:
	mov	w27, #0
LBB0_31:
	mov	x0, x20
	bl	_bcm_bsc_reset
	str	wzr, [x20]
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	bl	_wakeup
	mov	x0, x20
	bl	_BCM_BSC_UNLOCK
	mov	x0, x27
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh58, Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh61, Lloh62, Lloh63
	.loh AdrpLdrGotLdr	Lloh79, Lloh80, Lloh81
	.loh AdrpLdrGotLdr	Lloh76, Lloh77, Lloh78
	.loh AdrpLdrGotLdr	Lloh73, Lloh74, Lloh75
	.loh AdrpLdrGotLdr	Lloh70, Lloh71, Lloh72
	.loh AdrpLdrGotLdr	Lloh67, Lloh68, Lloh69
	.loh AdrpLdrGotLdr	Lloh64, Lloh65, Lloh66
	.loh AdrpLdrGotLdr	Lloh85, Lloh86, Lloh87
	.loh AdrpLdrGotLdr	Lloh82, Lloh83, Lloh84
	.loh AdrpAdd	Lloh90, Lloh91
	.loh AdrpAdd	Lloh88, Lloh89
	.cfi_endproc
                                        ; -- End function
	.comm	_BCM_I2C_BUSY,4,2               ; @BCM_I2C_BUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bscbusw"

l_.str.1:                               ; @.str.1
	.asciz	"Transfer %d msgs\n"

	.comm	_IIC_M_RD,4,2                   ; @IIC_M_RD
	.comm	_IIC_M_WR,4,2                   ; @IIC_M_WR
	.comm	_BCM_BSC_SLAVE,4,2              ; @BCM_BSC_SLAVE
l_.str.2:                               ; @.str.2
	.asciz	"start  0x%02x\n"

l_.str.3:                               ; @.str.3
	.asciz	"%-6s 0x%02x len %d: "

l_.str.4:                               ; @.str.4
	.asciz	"read"

l_.str.5:                               ; @.str.5
	.asciz	"write"

	.comm	_BCM_BSC_CTRL_READ,8,3          ; @BCM_BSC_CTRL_READ
	.comm	_BCM_I2C_READ,4,2               ; @BCM_I2C_READ
	.comm	_BCM_BSC_DLEN,4,2               ; @BCM_BSC_DLEN
	.comm	_BCM_BSC_CTRL,4,2               ; @BCM_BSC_CTRL
	.comm	_BCM_BSC_CTRL_I2CEN,8,3         ; @BCM_BSC_CTRL_I2CEN
	.comm	_BCM_BSC_CTRL_ST,8,3            ; @BCM_BSC_CTRL_ST
	.comm	_BCM_BSC_STATUS,4,2             ; @BCM_BSC_STATUS
	.comm	_BCM_BSC_STATUS_ERR,8,3         ; @BCM_BSC_STATUS_ERR
	.comm	_EIO,4,2                        ; @EIO
	.comm	_BCM_BSC_STATUS_TA,8,3          ; @BCM_BSC_STATUS_TA
	.comm	_BCM_BSC_CTRL_INT_ALL,8,3       ; @BCM_BSC_CTRL_INT_ALL
	.comm	_BCM_I2C_DONE,4,2               ; @BCM_I2C_DONE
l_.str.6:                               ; @.str.6
	.asciz	"bsciow"

	.comm	_hz,4,2                         ; @hz
	.comm	_BCM_I2C_ERROR,4,2              ; @BCM_I2C_ERROR
l_.str.7:                               ; @.str.7
	.asciz	" err=%d\n"

l_.str.8:                               ; @.str.8
	.asciz	"stop\n"

	.no_dead_strip	_bcm_bsc_transfer
.subsections_via_symbols
