	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm_kona_i2c_read_fifo
_bcm_kona_i2c_read_fifo:                ## @bcm_kona_i2c_read_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rsi), %eax
	testl	%eax, %eax
	je	LBB0_7
## %bb.1:
	movq	%rsi, %r15
	movq	8(%rsi), %r12
	movq	_MAX_RX_FIFO_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	xorl	%r13d, %r13d
	cmpl	%ebx, %eax
	setbe	%r13b
	cmovbl	%eax, %ebx
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	%r12, %rsi
	movl	%ebx, %edx
	movl	%r13d, %ecx
	callq	_bcm_kona_i2c_read_fifo_single
	testl	%eax, %eax
	js	LBB0_5
## %bb.2:
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	addl	%ebx, %r14d
	movl	(%r15), %eax
	subl	%r14d, %eax
	jbe	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_MAX_RX_FIFO_SIZE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	movl	%ebx, %ecx
	cmovbel	%eax, %ebx
	leaq	(%r12,%rcx,4), %r12
	movl	$1, %eax
	cmovbel	%eax, %r13d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movl	%ebx, %edx
	movl	%r13d, %ecx
	callq	_bcm_kona_i2c_read_fifo_single
	testl	%eax, %eax
	jns	LBB0_3
LBB0_5:
	movq	_EREMOTEIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
LBB0_7:
	xorl	%eax, %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_RX_FIFO_SIZE,4,2           ## @MAX_RX_FIFO_SIZE
	.comm	_EREMOTEIO,4,2                  ## @EREMOTEIO
	.no_dead_strip	_bcm_kona_i2c_read_fifo
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm_kona_i2c_read_fifo
_bcm_kona_i2c_read_fifo:                ; @bcm_kona_i2c_read_fifo
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldr	w8, [x1]
	cbz	w8, LBB0_6
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	ldr	x21, [x1, #8]
Lloh0:
	adrp	x24, _MAX_RX_FIFO_SIZE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _MAX_RX_FIFO_SIZE@GOTPAGEOFF]
	ldr	w9, [x24]
	cmp	w8, w9
	csel	w22, w8, w9, lo
	cset	w23, ls
	mov	x1, x21
	mov	x2, x22
	mov	x3, x23
	bl	_bcm_kona_i2c_read_fifo_single
	tbnz	w0, #31, LBB0_5
; %bb.2:
	mov	w25, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x19]
	add	w25, w22, w25
	subs	w8, w8, w25
	b.ls	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x21, x21, w22, uxtw #2
	ldr	w9, [x24]
	cmp	w8, w9
	csel	w22, w22, w8, hi
	csinc	w23, w23, wzr, hi
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	mov	x3, x23
	bl	_bcm_kona_i2c_read_fifo_single
	tbz	w0, #31, LBB0_3
LBB0_5:
Lloh2:
	adrp	x8, _EREMOTEIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EREMOTEIO@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_6:
	mov	w0, #0
LBB0_7:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_RX_FIFO_SIZE,4,2           ; @MAX_RX_FIFO_SIZE
	.comm	_EREMOTEIO,4,2                  ; @EREMOTEIO
	.no_dead_strip	_bcm_kona_i2c_read_fifo
.subsections_via_symbols
