	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_i2c_empty_rx_fifo
_tegra_i2c_empty_rx_fifo:               ## @tegra_i2c_empty_rx_fifo
	.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	%rdi, %r15
	movq	(%rdi), %r14
	movq	8(%rdi), %rbx
	xorl	%edi, %edi
	testq	%r14, %r14
	sete	%dil
	callq	_WARN_ON_ONCE
	testq	%rax, %rax
	jne	LBB0_1
## %bb.2:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	16(%r15), %rax
	cmpq	$0, (%rax)
	movq	_I2C_MST_FIFO_STATUS@GOTPCREL(%rip), %rax
	cmoveq	_I2C_FIFO_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_I2C_MST_FIFO_STATUS_RX_MASK@GOTPCREL(%rip), %rbx
	cmoveq	_I2C_FIFO_STATUS_RX_MASK@GOTPCREL(%rip), %rbx
	movq	_I2C_MST_FIFO_STATUS_RX_SHIFT@GOTPCREL(%rip), %r12
	cmoveq	_I2C_FIFO_STATUS_RX_SHIFT@GOTPCREL(%rip), %r12
	movq	%r15, %rdi
	callq	_i2c_readl
	movl	%eax, %r13d
	movl	%eax, -44(%rbp)
	andl	(%rbx), %r13d
	movb	(%r12), %cl
	sarl	%cl, %r13d
	movq	_BYTES_PER_FIFO_WORD@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%r14, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_3
## %bb.4:
	movq	%r14, %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %rbx
	jmp	LBB0_5
LBB0_3:
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %ebx
LBB0_5:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	cmpl	%ebx, %r13d
	cmovll	%r13d, %ebx
	movq	_I2C_RX_FIFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	%ebx, %ecx
	callq	_i2c_readsl
	movslq	%ebx, %rax
	movq	_BYTES_PER_FIFO_WORD@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	imulq	%rax, %rcx
	leaq	(%r12,%rcx,4), %r12
	subq	%rcx, %r14
	subl	%eax, %r13d
	jle	LBB0_8
## %bb.6:
	testq	%r14, %r14
	je	LBB0_8
## %bb.7:
	movq	_I2C_RX_FIFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i2c_readl
	movl	%eax, %edi
	callq	_cpu_to_le32
	movl	%eax, -44(%rbp)
	leaq	-44(%rbp), %rsi
	movq	%r12, %rdi
	movq	%r14, %rdx
	callq	_memcpy
	decl	%r13d
	xorl	%r14d, %r14d
LBB0_8:
	movl	%r13d, %edi
	callq	_WARN_ON_ONCE
	testq	%rax, %rax
	je	LBB0_9
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r14, (%r15)
	movq	%r12, 8(%r15)
	xorl	%eax, %eax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_I2C_MST_FIFO_STATUS,4,2        ## @I2C_MST_FIFO_STATUS
	.comm	_I2C_MST_FIFO_STATUS_RX_MASK,4,2 ## @I2C_MST_FIFO_STATUS_RX_MASK
	.comm	_I2C_MST_FIFO_STATUS_RX_SHIFT,4,2 ## @I2C_MST_FIFO_STATUS_RX_SHIFT
	.comm	_I2C_FIFO_STATUS,4,2            ## @I2C_FIFO_STATUS
	.comm	_I2C_FIFO_STATUS_RX_MASK,4,2    ## @I2C_FIFO_STATUS_RX_MASK
	.comm	_I2C_FIFO_STATUS_RX_SHIFT,4,2   ## @I2C_FIFO_STATUS_RX_SHIFT
	.comm	_BYTES_PER_FIFO_WORD,8,3        ## @BYTES_PER_FIFO_WORD
	.comm	_I2C_RX_FIFO,4,2                ## @I2C_RX_FIFO
	.no_dead_strip	_tegra_i2c_empty_rx_fifo
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_i2c_empty_rx_fifo
_tegra_i2c_empty_rx_fifo:               ; @tegra_i2c_empty_rx_fifo
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x0
	ldp	x21, x20, [x0]
	cmp	x21, #0
	cset	w0, eq
	bl	_WARN_ON_ONCE
	cbnz	x0, LBB0_4
; %bb.1:
	ldr	x8, [x19, #16]
Lloh0:
	adrp	x9, _I2C_FIFO_STATUS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _I2C_FIFO_STATUS@GOTPAGEOFF]
	ldr	x8, [x8]
Lloh2:
	adrp	x10, _I2C_MST_FIFO_STATUS@GOTPAGE
Lloh3:
	ldr	x10, [x10, _I2C_MST_FIFO_STATUS@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x9, x10, eq
	ldr	w1, [x8]
Lloh4:
	adrp	x8, _I2C_FIFO_STATUS_RX_MASK@GOTPAGE
Lloh5:
	ldr	x8, [x8, _I2C_FIFO_STATUS_RX_MASK@GOTPAGEOFF]
Lloh6:
	adrp	x9, _I2C_MST_FIFO_STATUS_RX_MASK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _I2C_MST_FIFO_STATUS_RX_MASK@GOTPAGEOFF]
Lloh8:
	adrp	x10, _I2C_FIFO_STATUS_RX_SHIFT@GOTPAGE
Lloh9:
	ldr	x10, [x10, _I2C_FIFO_STATUS_RX_SHIFT@GOTPAGEOFF]
	csel	x22, x8, x9, eq
Lloh10:
	adrp	x8, _I2C_MST_FIFO_STATUS_RX_SHIFT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _I2C_MST_FIFO_STATUS_RX_SHIFT@GOTPAGEOFF]
	csel	x23, x10, x8, eq
	mov	x0, x19
	bl	_i2c_readl
	str	w0, [sp, #12]
	ldr	w8, [x22]
	and	w8, w8, w0
	ldr	w9, [x23]
	asr	w24, w8, w9
Lloh12:
	adrp	x25, _BYTES_PER_FIFO_WORD@GOTPAGE
Lloh13:
	ldr	x25, [x25, _BYTES_PER_FIFO_WORD@GOTPAGEOFF]
	ldr	x8, [x25]
	udiv	x8, x21, x8
	cmp	w24, w8
	csel	w22, w24, w8, lt
Lloh14:
	adrp	x23, _I2C_RX_FIFO@GOTPAGE
Lloh15:
	ldr	x23, [x23, _I2C_RX_FIFO@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x19
	mov	x1, x20
	mov	x3, x22
	bl	_i2c_readsl
	sxtw	x8, w22
	ldr	x9, [x25]
	mul	x8, x9, x8
	add	x20, x20, x8, lsl #2
	sub	x21, x21, x8
	sub	w0, w24, w22
	subs	w22, w0, #1
	ccmp	x21, #0, #4, ge
	b.eq	LBB0_3
; %bb.2:
	ldr	w1, [x23]
	mov	x0, x19
	bl	_i2c_readl
	bl	_cpu_to_le32
	str	w0, [sp, #12]
	add	x1, sp, #12
	mov	x0, x20
	mov	x2, x21
	bl	_memcpy
	mov	x21, #0
	mov	x0, x22
LBB0_3:
	bl	_WARN_ON_ONCE
	cbz	x0, LBB0_6
LBB0_4:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_6:
	stp	x21, x20, [x19]
	b	LBB0_5
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_I2C_MST_FIFO_STATUS,4,2        ; @I2C_MST_FIFO_STATUS
	.comm	_I2C_MST_FIFO_STATUS_RX_MASK,4,2 ; @I2C_MST_FIFO_STATUS_RX_MASK
	.comm	_I2C_MST_FIFO_STATUS_RX_SHIFT,4,2 ; @I2C_MST_FIFO_STATUS_RX_SHIFT
	.comm	_I2C_FIFO_STATUS,4,2            ; @I2C_FIFO_STATUS
	.comm	_I2C_FIFO_STATUS_RX_MASK,4,2    ; @I2C_FIFO_STATUS_RX_MASK
	.comm	_I2C_FIFO_STATUS_RX_SHIFT,4,2   ; @I2C_FIFO_STATUS_RX_SHIFT
	.comm	_BYTES_PER_FIFO_WORD,8,3        ; @BYTES_PER_FIFO_WORD
	.comm	_I2C_RX_FIFO,4,2                ; @I2C_RX_FIFO
	.no_dead_strip	_tegra_i2c_empty_rx_fifo
.subsections_via_symbols
