	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function tegra_i2c_transfer
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_tegra_i2c_transfer:                    ## @tegra_i2c_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	callq	_device_get_softc
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_LOCK
	cmpl	$1, (%rbx)
	jne	LBB0_3
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_SLEEP
	cmpl	$1, (%rbx)
	je	LBB0_1
LBB0_3:
	movl	$1, (%rbx)
	testl	%r14d, %r14d
	jle	LBB0_18
## %bb.4:
	leaq	4(%rbx), %r12
	leaq	8(%rbx), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leal	-1(%r14), %eax
	movq	%rbx, %rcx
	addq	$32, %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%r14d, %ecx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	leaq	(%rax,%rax,2), %rax
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	leaq	(%r14,%rax,8), %rax
	addq	$8, %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, 24(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r12)
	movl	$0, 16(%r12)
	cmpq	$0, -48(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_17
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpq	$0, 16(%r14)
	je	LBB0_17
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpq	$0, (%r14)
	je	LBB0_17
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	leaq	32(%r14), %rcx
	cmpq	%r13, -88(%rbp)                 ## 8-byte Folded Reload
	cmoveq	-80(%rbp), %rcx                 ## 8-byte Folded Reload
	movq	_IIC_M_NOSTART@GOTPCREL(%rip), %rax
	cmoveq	_IIC_M_NOSTOP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_XFER_REPEAT_START@GOTPCREL(%rip), %rax
	cmoveq	_XFER_STOP@GOTPCREL(%rip), %rax
	andl	(%rcx), %edx
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	_XFER_CONTINUE@GOTPCREL(%rip), %rax
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_tegra_i2c_start_msg
	movq	_cold@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rdi
	callq	_tegra_i2c_poll
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	_PZERO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_I2C_REQUEST_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	leaq	L_.str(%rip), %rcx
	callq	_msleep
LBB0_14:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	%eax, %r15d
	movq	_I2C_INTERRUPT_MASK_REGISTER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_WR4
	movq	_I2C_INTERRUPT_STATUS_REGISTER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$-1, %edx
	callq	_WR4
	testl	%r15d, %r15d
	jne	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	(%r12), %r15d
	testl	%r15d, %r15d
	jne	LBB0_16
## %bb.5:                               ##   in Loop: Header=BB0_6 Depth=1
	incq	%r13
	addq	$24, %r14
	cmpq	%r13, -72(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_6
	jmp	LBB0_18
LBB0_17:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	testl	%r15d, %r15d
	je	LBB0_18
LBB0_16:
	movq	%rbx, %rdi
	callq	_tegra_i2c_hw_init
	movq	%rbx, %rdi
	callq	_tegra_i2c_flush_fifo
	jmp	LBB0_19
LBB0_18:
	xorl	%r15d, %r15d
LBB0_19:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rbx)
	movups	%xmm0, (%rbx)
	movq	%rbx, %rdi
	callq	_wakeup
	movq	%rbx, %rdi
	callq	_UNLOCK
	movl	%r15d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IIC_M_NOSTOP,4,2               ## @IIC_M_NOSTOP
	.comm	_XFER_CONTINUE,4,2              ## @XFER_CONTINUE
	.comm	_XFER_STOP,4,2                  ## @XFER_STOP
	.comm	_IIC_M_NOSTART,4,2              ## @IIC_M_NOSTART
	.comm	_XFER_REPEAT_START,4,2          ## @XFER_REPEAT_START
	.comm	_cold,8,3                       ## @cold
	.comm	_PZERO,4,2                      ## @PZERO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"iic"

	.comm	_I2C_REQUEST_TIMEOUT,4,2        ## @I2C_REQUEST_TIMEOUT
	.comm	_I2C_INTERRUPT_MASK_REGISTER,4,2 ## @I2C_INTERRUPT_MASK_REGISTER
	.comm	_I2C_INTERRUPT_STATUS_REGISTER,4,2 ## @I2C_INTERRUPT_STATUS_REGISTER
	.no_dead_strip	_tegra_i2c_transfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_i2c_transfer
_tegra_i2c_transfer:                    ; @tegra_i2c_transfer
	.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
	mov	x23, x2
	mov	x20, x1
	bl	_device_get_softc
	mov	x19, x0
	bl	_LOCK
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x19]
	cmp	w8, #1
	b.ne	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x19
	mov	w1, #0
	bl	_SLEEP
	b	LBB0_1
LBB0_3:
	mov	w8, #1
	str	w8, [x19]
	subs	w26, w23, #1
	b.lt	LBB0_14
; %bb.4:
	add	x27, x19, #4
	add	x9, x19, #8
	add	x8, x19, #32
	stp	x8, x9, [sp]                    ; 16-byte Folded Spill
	mov	w28, w23
	mov	w8, #24
	umaddl	x8, w26, w8, x20
	add	x23, x8, #8
Lloh0:
	adrp	x21, _I2C_INTERRUPT_MASK_REGISTER@GOTPAGE
Lloh1:
	ldr	x21, [x21, _I2C_INTERRUPT_MASK_REGISTER@GOTPAGEOFF]
Lloh2:
	adrp	x22, _I2C_INTERRUPT_STATUS_REGISTER@GOTPAGE
Lloh3:
	ldr	x22, [x22, _I2C_INTERRUPT_STATUS_REGISTER@GOTPAGEOFF]
	mov	x24, x20
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	str	x24, [x19, #24]
	stp	xzr, xzr, [x27]
	str	wzr, [x27, #16]
	cbz	x20, LBB0_15
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x24, #16]
	cbz	x8, LBB0_15
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x24]
	cbz	x8, LBB0_15
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x8, x24, #32
	cmp	x26, #0
	csel	x8, x23, x8, eq
	ldr	w8, [x8]
Lloh4:
	adrp	x9, _IIC_M_NOSTOP@GOTPAGE
Lloh5:
	ldr	x9, [x9, _IIC_M_NOSTOP@GOTPAGEOFF]
Lloh6:
	adrp	x10, _IIC_M_NOSTART@GOTPAGE
Lloh7:
	ldr	x10, [x10, _IIC_M_NOSTART@GOTPAGEOFF]
	csel	x9, x9, x10, eq
	ldr	w9, [x9]
Lloh8:
	adrp	x10, _XFER_STOP@GOTPAGE
Lloh9:
	ldr	x10, [x10, _XFER_STOP@GOTPAGEOFF]
Lloh10:
	adrp	x11, _XFER_REPEAT_START@GOTPAGE
Lloh11:
	ldr	x11, [x11, _XFER_REPEAT_START@GOTPAGEOFF]
	csel	x10, x10, x11, eq
	tst	w9, w8
Lloh12:
	adrp	x8, _XFER_CONTINUE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _XFER_CONTINUE@GOTPAGEOFF]
	csel	x8, x10, x8, eq
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x24
	bl	_tegra_i2c_start_msg
Lloh14:
	adrp	x8, _cold@GOTPAGE
Lloh15:
	ldr	x8, [x8, _cold@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	cbz	x8, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	bl	_tegra_i2c_poll
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh17:
	adrp	x8, _PZERO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PZERO@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
Lloh20:
	adrp	x8, _I2C_REQUEST_TIMEOUT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _I2C_REQUEST_TIMEOUT@GOTPAGEOFF]
Lloh22:
	ldr	w4, [x8]
	ldp	x1, x0, [sp]                    ; 16-byte Folded Reload
Lloh23:
	adrp	x3, l_.str@PAGE
Lloh24:
	add	x3, x3, l_.str@PAGEOFF
	bl	_msleep
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x25, x0
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #0
	bl	_WR4
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #-1
	bl	_WR4
	cbnz	w25, LBB0_16
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	w25, [x27]
	cbnz	w25, LBB0_16
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=1
	sub	x26, x26, #1
	add	x24, x24, #24
	subs	x28, x28, #1
	b.ne	LBB0_5
LBB0_14:
	mov	w25, #0
	b	LBB0_17
LBB0_15:
Lloh25:
	adrp	x8, _EINVAL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh27:
	ldr	w25, [x8]
	cbz	w25, LBB0_17
LBB0_16:
	mov	x0, x19
	bl	_tegra_i2c_hw_init
	mov	x0, x19
	bl	_tegra_i2c_flush_fifo
LBB0_17:
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [x19]
	mov	x0, x19
	bl	_wakeup
	mov	x0, x19
	bl	_UNLOCK
	mov	x0, x25
	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	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IIC_M_NOSTOP,4,2               ; @IIC_M_NOSTOP
	.comm	_XFER_CONTINUE,4,2              ; @XFER_CONTINUE
	.comm	_XFER_STOP,4,2                  ; @XFER_STOP
	.comm	_IIC_M_NOSTART,4,2              ; @IIC_M_NOSTART
	.comm	_XFER_REPEAT_START,4,2          ; @XFER_REPEAT_START
	.comm	_cold,8,3                       ; @cold
	.comm	_PZERO,4,2                      ; @PZERO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"iic"

	.comm	_I2C_REQUEST_TIMEOUT,4,2        ; @I2C_REQUEST_TIMEOUT
	.comm	_I2C_INTERRUPT_MASK_REGISTER,4,2 ; @I2C_INTERRUPT_MASK_REGISTER
	.comm	_I2C_INTERRUPT_STATUS_REGISTER,4,2 ; @I2C_INTERRUPT_STATUS_REGISTER
	.no_dead_strip	_tegra_i2c_transfer
.subsections_via_symbols
