	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xlp9xx_i2c_drain_rx_fifo
_xlp9xx_i2c_drain_rx_fifo:              ## @xlp9xx_i2c_drain_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
	pushq	%rax
	.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), %r13
	movq	_XLP9XX_I2C_FIFOWCNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_xlp9xx_read_i2c_reg
	movl	%eax, %r14d
	movq	_XLP9XX_I2C_FIFO_WCNT_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r14d
	je	LBB0_9
## %bb.1:
	cmpl	$0, 8(%r15)
	je	LBB0_5
## %bb.2:
	movq	_XLP9XX_I2C_MRXFIFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_xlp9xx_read_i2c_reg
	testl	%eax, %eax
	je	LBB0_10
## %bb.3:
	movq	_I2C_SMBUS_BLOCK_MAX@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jg	LBB0_10
## %bb.4:
	decl	%r14d
	movl	%eax, (%r13)
	addq	$4, %r13
	cmpq	$1, 24(%r15)
	sbbl	$-1, %eax
	movl	%eax, 12(%r15)
	incl	%eax
	movl	%eax, 16(%r15)
	movq	%r15, %rdi
	callq	_xlp9xx_i2c_update_rlen
	movl	$0, 8(%r15)
LBB0_5:
	movl	12(%r15), %edi
	movl	%r14d, %esi
	callq	_min
	movl	%eax, %r14d
	testl	%eax, %eax
	jle	LBB0_8
## %bb.6:
	movq	_XLP9XX_I2C_MRXFIFO@GOTPCREL(%rip), %r12
	movl	%r14d, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_xlp9xx_read_i2c_reg
	movl	%eax, (%r13)
	addq	$4, %r13
	decl	%ebx
	jne	LBB0_7
LBB0_8:
	subl	%r14d, 12(%r15)
	movq	%r13, (%r15)
	jne	LBB0_11
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	$0, 12(%r15)
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_xlp9xx_i2c_update_rlen         ## TAILCALL
LBB0_11:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_xlp9xx_i2c_update_rx_fifo_thres ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_XLP9XX_I2C_FIFOWCNT,4,2        ## @XLP9XX_I2C_FIFOWCNT
	.comm	_XLP9XX_I2C_FIFO_WCNT_MASK,4,2  ## @XLP9XX_I2C_FIFO_WCNT_MASK
	.comm	_XLP9XX_I2C_MRXFIFO,4,2         ## @XLP9XX_I2C_MRXFIFO
	.comm	_I2C_SMBUS_BLOCK_MAX,4,2        ## @I2C_SMBUS_BLOCK_MAX
	.no_dead_strip	_xlp9xx_i2c_drain_rx_fifo
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xlp9xx_i2c_drain_rx_fifo
_xlp9xx_i2c_drain_rx_fifo:              ; @xlp9xx_i2c_drain_rx_fifo
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	x21, [x0]
Lloh0:
	adrp	x8, _XLP9XX_I2C_FIFOWCNT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XLP9XX_I2C_FIFOWCNT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_xlp9xx_read_i2c_reg
Lloh3:
	adrp	x8, _XLP9XX_I2C_FIFO_WCNT_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _XLP9XX_I2C_FIFO_WCNT_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ands	w20, w8, w0
	b.eq	LBB0_9
; %bb.1:
	ldr	w8, [x19, #8]
Lloh6:
	adrp	x22, _XLP9XX_I2C_MRXFIFO@GOTPAGE
Lloh7:
	ldr	x22, [x22, _XLP9XX_I2C_MRXFIFO@GOTPAGEOFF]
	cbz	w8, LBB0_5
; %bb.2:
	ldr	w1, [x22]
	mov	x0, x19
	bl	_xlp9xx_read_i2c_reg
Lloh8:
	adrp	x8, _I2C_SMBUS_BLOCK_MAX@GOTPAGE
Lloh9:
	ldr	x8, [x8, _I2C_SMBUS_BLOCK_MAX@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w0, #0
	ccmp	w0, w8, #0, ne
	b.le	LBB0_4
; %bb.3:
	stp	wzr, wzr, [x19, #12]
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_xlp9xx_i2c_update_rlen
LBB0_4:
	sub	w20, w20, #1
	str	w0, [x21], #4
	ldr	x8, [x19, #24]
	cmp	x8, #0
	cinc	w8, w0, ne
	add	w9, w8, #1
	stp	w8, w9, [x19, #12]
	mov	x0, x19
	bl	_xlp9xx_i2c_update_rlen
	str	wzr, [x19, #8]
LBB0_5:
	ldr	w0, [x19, #12]
	mov	x1, x20
	bl	_min
	mov	x20, x0
	cmp	w0, #1
	b.lt	LBB0_8
; %bb.6:
	mov	x23, x20
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	bl	_xlp9xx_read_i2c_reg
	str	w0, [x21], #4
	subs	w23, w23, #1
	b.ne	LBB0_7
LBB0_8:
	ldr	w8, [x19, #12]
	str	x21, [x19]
	subs	w8, w8, w20
	str	w8, [x19, #12]
	b.ne	LBB0_10
LBB0_9:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_xlp9xx_i2c_update_rx_fifo_thres
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_XLP9XX_I2C_FIFOWCNT,4,2        ; @XLP9XX_I2C_FIFOWCNT
	.comm	_XLP9XX_I2C_FIFO_WCNT_MASK,4,2  ; @XLP9XX_I2C_FIFO_WCNT_MASK
	.comm	_XLP9XX_I2C_MRXFIFO,4,2         ; @XLP9XX_I2C_MRXFIFO
	.comm	_I2C_SMBUS_BLOCK_MAX,4,2        ; @I2C_SMBUS_BLOCK_MAX
	.no_dead_strip	_xlp9xx_i2c_drain_rx_fifo
.subsections_via_symbols
