	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bus_reset_if_active
_bus_reset_if_active:                   ## @bus_reset_if_active
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_I2C_REG_STS
	movl	%eax, %edi
	callq	_ioread32
	movq	_mstatus_active@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_3
## %bb.1:
	movl	(%rbx), %edx
	addq	$4, %rbx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_err
LBB0_2:
	movq	%r14, %rdi
	callq	_I2C_REG_CTL
	movl	%eax, %edi
	callq	_ioread32
	movl	%eax, %ebx
	movq	_mcntrl_reset@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_I2C_REG_CTL
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_iowrite32
	movq	_I2C_PNX_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_wait_reset                     ## TAILCALL
LBB0_3:
	movq	_mstatus_rfe@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.4:
	movq	_mstatus_tfe@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.5:
	movq	_mstatus_nai@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_2
## %bb.6:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mstatus_active,4,2             ## @mstatus_active
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: Bus is still active after xfer. Reset it...\n"

	.comm	_mcntrl_reset,4,2               ## @mcntrl_reset
	.comm	_I2C_PNX_TIMEOUT,4,2            ## @I2C_PNX_TIMEOUT
	.comm	_mstatus_rfe,4,2                ## @mstatus_rfe
	.comm	_mstatus_tfe,4,2                ## @mstatus_tfe
	.comm	_mstatus_nai,4,2                ## @mstatus_nai
	.no_dead_strip	_bus_reset_if_active
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bus_reset_if_active
_bus_reset_if_active:                   ; @bus_reset_if_active
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
	ldr	x19, [x0, #8]
	mov	x0, x19
	bl	_I2C_REG_STS
	bl	_ioread32
Lloh0:
	adrp	x8, _mstatus_active@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mstatus_active@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_3
; %bb.1:
	ldr	w2, [x20], #4
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
LBB0_2:
	mov	x0, x19
	bl	_I2C_REG_CTL
	bl	_ioread32
Lloh5:
	adrp	x8, _mcntrl_reset@GOTPAGE
Lloh6:
	ldr	x8, [x8, _mcntrl_reset@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	orr	w20, w8, w0
	mov	x0, x19
	bl	_I2C_REG_CTL
	mov	x1, x0
	mov	x0, x20
	bl	_iowrite32
Lloh8:
	adrp	x8, _I2C_PNX_TIMEOUT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _I2C_PNX_TIMEOUT@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	mov	x1, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_wait_reset
LBB0_3:
Lloh11:
	adrp	x8, _mstatus_rfe@GOTPAGE
Lloh12:
	ldr	x8, [x8, _mstatus_rfe@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_2
; %bb.4:
Lloh14:
	adrp	x8, _mstatus_tfe@GOTPAGE
Lloh15:
	ldr	x8, [x8, _mstatus_tfe@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_2
; %bb.5:
Lloh17:
	adrp	x8, _mstatus_nai@GOTPAGE
Lloh18:
	ldr	x8, [x8, _mstatus_nai@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_2
; %bb.6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_mstatus_active,4,2             ; @mstatus_active
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: Bus is still active after xfer. Reset it...\n"

	.comm	_mcntrl_reset,4,2               ; @mcntrl_reset
	.comm	_I2C_PNX_TIMEOUT,4,2            ; @I2C_PNX_TIMEOUT
	.comm	_mstatus_rfe,4,2                ; @mstatus_rfe
	.comm	_mstatus_tfe,4,2                ; @mstatus_tfe
	.comm	_mstatus_nai,4,2                ; @mstatus_nai
	.no_dead_strip	_bus_reset_if_active
.subsections_via_symbols
