	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_i2c_bus_clear
_tegra_i2c_bus_clear:                   ## @tegra_i2c_bus_clear
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	_I2C_BUS_CLEAR_CONFIG@GOTPCREL(%rip), %r15
	movl	(%r15), %r14d
	movl	$18, %edi
	callq	_I2C_BUS_CLEAR_CONFIG_BC_SCLK_THRESHOLD
	movq	_I2C_BUS_CLEAR_CONFIG_BC_STOP_COND@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_I2C_BUS_CLEAR_CONFIG_BC_TERMINATE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_WR4
	movq	_I2C_CONFIG_LOAD@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_I2C_CONFIG_LOAD_MSTR_CONFIG_LOAD@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_WR4
	movl	$1001, %ebx                     ## imm = 0x3E9
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %esi
	movq	%r12, %rdi
	callq	_RD4
	testl	%eax, %eax
	je	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$10, %edi
	callq	_DELAY
	decl	%ebx
	cmpl	$1, %ebx
	ja	LBB0_1
## %bb.3:
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_device_printf
LBB0_4:
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_RD4
	movq	_I2C_BUS_CLEAR_CONFIG_BC_ENABLE@GOTPCREL(%rip), %r14
	orl	(%r14), %eax
	movl	(%r15), %esi
	movq	%r12, %rdi
	movl	%eax, %edx
	callq	_WR4
	movl	$1001, %ebx                     ## imm = 0x3E9
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_RD4
	testl	%eax, (%r14)
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	$10, %edi
	callq	_DELAY
	decl	%ebx
	cmpl	$1, %ebx
	ja	LBB0_5
## %bb.7:
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_device_printf
LBB0_8:
	movq	_I2C_BUS_CLEAR_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_RD4
	movq	_I2C_BUS_CLEAR_STATUS_BC_STATUS@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_10
## %bb.9:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_device_printf                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_BUS_CLEAR_CONFIG,4,2       ## @I2C_BUS_CLEAR_CONFIG
	.comm	_I2C_BUS_CLEAR_CONFIG_BC_STOP_COND,4,2 ## @I2C_BUS_CLEAR_CONFIG_BC_STOP_COND
	.comm	_I2C_BUS_CLEAR_CONFIG_BC_TERMINATE,4,2 ## @I2C_BUS_CLEAR_CONFIG_BC_TERMINATE
	.comm	_I2C_CONFIG_LOAD,4,2            ## @I2C_CONFIG_LOAD
	.comm	_I2C_CONFIG_LOAD_MSTR_CONFIG_LOAD,4,2 ## @I2C_CONFIG_LOAD_MSTR_CONFIG_LOAD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"config load timeouted\n"

	.comm	_I2C_BUS_CLEAR_CONFIG_BC_ENABLE,4,2 ## @I2C_BUS_CLEAR_CONFIG_BC_ENABLE
L_.str.1:                               ## @.str.1
	.asciz	"bus clear timeouted\n"

	.comm	_I2C_BUS_CLEAR_STATUS,4,2       ## @I2C_BUS_CLEAR_STATUS
	.comm	_I2C_BUS_CLEAR_STATUS_BC_STATUS,4,2 ## @I2C_BUS_CLEAR_STATUS_BC_STATUS
L_.str.2:                               ## @.str.2
	.asciz	"bus clear failed\n"

	.no_dead_strip	_tegra_i2c_bus_clear
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_i2c_bus_clear
_tegra_i2c_bus_clear:                   ; @tegra_i2c_bus_clear
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
Lloh0:
	adrp	x21, _I2C_BUS_CLEAR_CONFIG@GOTPAGE
Lloh1:
	ldr	x21, [x21, _I2C_BUS_CLEAR_CONFIG@GOTPAGEOFF]
	ldr	w20, [x21]
	mov	w0, #18
	bl	_I2C_BUS_CLEAR_CONFIG_BC_SCLK_THRESHOLD
Lloh2:
	adrp	x8, _I2C_BUS_CLEAR_CONFIG_BC_STOP_COND@GOTPAGE
Lloh3:
	ldr	x8, [x8, _I2C_BUS_CLEAR_CONFIG_BC_STOP_COND@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	orr	w8, w8, w0
Lloh5:
	adrp	x9, _I2C_BUS_CLEAR_CONFIG_BC_TERMINATE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _I2C_BUS_CLEAR_CONFIG_BC_TERMINATE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x19
	mov	x1, x20
	bl	_WR4
Lloh8:
	adrp	x20, _I2C_CONFIG_LOAD@GOTPAGE
Lloh9:
	ldr	x20, [x20, _I2C_CONFIG_LOAD@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh10:
	adrp	x8, _I2C_CONFIG_LOAD_MSTR_CONFIG_LOAD@GOTPAGE
Lloh11:
	ldr	x8, [x8, _I2C_CONFIG_LOAD_MSTR_CONFIG_LOAD@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_WR4
	mov	w22, #1001
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x20]
	mov	x0, x19
	bl	_RD4
	cbz	w0, LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w0, #10
	bl	_DELAY
	sub	w22, w22, #1
	cmp	w22, #1
	b.hi	LBB0_1
; %bb.3:
	ldr	w0, [x19]
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	bl	_device_printf
LBB0_4:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_RD4
Lloh15:
	adrp	x20, _I2C_BUS_CLEAR_CONFIG_BC_ENABLE@GOTPAGE
Lloh16:
	ldr	x20, [x20, _I2C_BUS_CLEAR_CONFIG_BC_ENABLE@GOTPAGEOFF]
	ldr	w8, [x20]
	orr	w2, w8, w0
	ldr	w1, [x21]
	mov	x0, x19
	bl	_WR4
	mov	w22, #1001
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	mov	x0, x19
	bl	_RD4
	ldr	w8, [x20]
	tst	w8, w0
	b.eq	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #10
	bl	_DELAY
	sub	w22, w22, #1
	cmp	w22, #1
	b.hi	LBB0_5
; %bb.7:
	ldr	w0, [x19]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_device_printf
LBB0_8:
Lloh19:
	adrp	x8, _I2C_BUS_CLEAR_STATUS@GOTPAGE
Lloh20:
	ldr	x8, [x8, _I2C_BUS_CLEAR_STATUS@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_RD4
Lloh22:
	adrp	x8, _I2C_BUS_CLEAR_STATUS_BC_STATUS@GOTPAGE
Lloh23:
	ldr	x8, [x8, _I2C_BUS_CLEAR_STATUS_BC_STATUS@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_10
; %bb.9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_10:
	ldr	w0, [x19]
Lloh25:
	adrp	x1, l_.str.2@PAGE
Lloh26:
	add	x1, x1, l_.str.2@PAGEOFF
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_device_printf
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_BUS_CLEAR_CONFIG,4,2       ; @I2C_BUS_CLEAR_CONFIG
	.comm	_I2C_BUS_CLEAR_CONFIG_BC_STOP_COND,4,2 ; @I2C_BUS_CLEAR_CONFIG_BC_STOP_COND
	.comm	_I2C_BUS_CLEAR_CONFIG_BC_TERMINATE,4,2 ; @I2C_BUS_CLEAR_CONFIG_BC_TERMINATE
	.comm	_I2C_CONFIG_LOAD,4,2            ; @I2C_CONFIG_LOAD
	.comm	_I2C_CONFIG_LOAD_MSTR_CONFIG_LOAD,4,2 ; @I2C_CONFIG_LOAD_MSTR_CONFIG_LOAD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"config load timeouted\n"

	.comm	_I2C_BUS_CLEAR_CONFIG_BC_ENABLE,4,2 ; @I2C_BUS_CLEAR_CONFIG_BC_ENABLE
l_.str.1:                               ; @.str.1
	.asciz	"bus clear timeouted\n"

	.comm	_I2C_BUS_CLEAR_STATUS,4,2       ; @I2C_BUS_CLEAR_STATUS
	.comm	_I2C_BUS_CLEAR_STATUS_BC_STATUS,4,2 ; @I2C_BUS_CLEAR_STATUS_BC_STATUS
l_.str.2:                               ; @.str.2
	.asciz	"bus clear failed\n"

	.no_dead_strip	_tegra_i2c_bus_clear
.subsections_via_symbols
