	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm_spi_drain_fifo
_bcm_spi_drain_fifo:                    ## @bcm_spi_drain_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, %r13
	movq	16(%rdi), %r14
	movq	_SPI_CS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_BCM_SPI_READ
	movq	(%r13), %rbx
	cmpq	8(%r13), %rbx
	jge	LBB0_7
## %bb.1:
	movq	_SPI_CS_RXD@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	andq	%rcx, %rax
	cmpq	%rcx, %rax
	jne	LBB0_7
## %bb.2:
	movq	_SPI_FIFO@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r14), %r12
	leaq	1(%rbx), %rax
	movq	%rax, (%r13)
	movq	%rbx, %rax
	subq	(%r14), %rax
	jb	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r14), %r12
	movq	%rax, %rbx
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r15), %esi
	movq	%r13, %rdi
	callq	_BCM_SPI_READ
	movzbl	%al, %eax
	movl	%eax, (%r12,%rbx,4)
	movq	_SPI_CS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_BCM_SPI_READ
	movq	(%r13), %rbx
	cmpq	8(%r13), %rbx
	jge	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_SPI_CS_RXD@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	andq	%rcx, %rax
	cmpq	%rcx, %rax
	je	LBB0_3
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SPI_CS,4,2                     ## @SPI_CS
	.comm	_SPI_CS_RXD,8,3                 ## @SPI_CS_RXD
	.comm	_SPI_FIFO,4,2                   ## @SPI_FIFO
	.no_dead_strip	_bcm_spi_drain_fifo
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm_spi_drain_fifo
_bcm_spi_drain_fifo:                    ; @bcm_spi_drain_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
	mov	x19, x0
	ldr	x20, [x0, #16]
Lloh0:
	adrp	x21, _SPI_CS@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SPI_CS@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_BCM_SPI_READ
Lloh2:
	adrp	x22, _SPI_CS_RXD@GOTPAGE
Lloh3:
	ldr	x22, [x22, _SPI_CS_RXD@GOTPAGEOFF]
	ldr	x8, [x22]
	and	x9, x8, x0
	ldp	x24, x10, [x19]
	cmp	x24, x10
	ccmp	x9, x8, #0, lt
	b.ne	LBB0_6
; %bb.1:
Lloh4:
	adrp	x23, _SPI_FIFO@GOTPAGE
Lloh5:
	ldr	x23, [x23, _SPI_FIFO@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x25, [x20, #16]
	add	x8, x24, #1
	str	x8, [x19]
	ldr	x8, [x20]
	subs	x8, x24, x8
	b.lo	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x25, [x20, #8]
	mov	x24, x8
LBB0_4:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w1, [x23]
	mov	x0, x19
	bl	_BCM_SPI_READ
	and	w8, w0, #0xff
	str	w8, [x25, x24, lsl #2]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_BCM_SPI_READ
	ldp	x24, x8, [x19]
	cmp	x24, x8
	b.ge	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x22]
	and	x9, x8, x0
	cmp	x9, x8
	b.eq	LBB0_2
LBB0_6:
	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	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_SPI_CS,4,2                     ; @SPI_CS
	.comm	_SPI_CS_RXD,8,3                 ; @SPI_CS_RXD
	.comm	_SPI_FIFO,4,2                   ; @SPI_FIFO
	.no_dead_strip	_bcm_spi_drain_fifo
.subsections_via_symbols
