	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function trf7970a_fill_fifo
_trf7970a_fill_fifo:                    ## @trf7970a_fill_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	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %r14
	movq	_TRF7970A_FIFO_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	callq	_trf7970a_read
	testl	%eax, %eax
	je	LBB0_1
LBB0_4:
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_trf7970a_send_err_upstream
	jmp	LBB0_5
LBB0_1:
	movl	4(%rbx), %edi
	movl	-20(%rbp), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movq	_TRF7970A_FIFO_STATUS_OVERFLOW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	-20(%rbp), %eax
	movl	%eax, -20(%rbp)
	movq	_TRF7970A_FIFO_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	subl	%eax, %esi
	jne	LBB0_3
## %bb.2:
	movq	_TRF7970A_WAIT_FOR_FIFO_DRAIN_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_schedule_delayed_work
	jmp	LBB0_5
LBB0_3:
	movl	(%r14), %edi
	callq	_min
	movq	_TRF7970A_CMD_BIT_CONTINUOUS@GOTPCREL(%rip), %rcx
	movq	_TRF7970A_FIFO_IO_REGISTER@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movl	%edx, -24(%rbp)
	leaq	-24(%rbp), %rcx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	movl	$4, %r8d
	callq	_trf7970a_transmit
	testl	%eax, %eax
	jne	LBB0_4
LBB0_5:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TRF7970A_FIFO_STATUS,4,2       ## @TRF7970A_FIFO_STATUS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Filling FIFO - fifo_bytes: 0x%x\n"

	.comm	_TRF7970A_FIFO_STATUS_OVERFLOW,4,2 ## @TRF7970A_FIFO_STATUS_OVERFLOW
	.comm	_TRF7970A_FIFO_SIZE,4,2         ## @TRF7970A_FIFO_SIZE
	.comm	_TRF7970A_WAIT_FOR_FIFO_DRAIN_TIMEOUT,4,2 ## @TRF7970A_WAIT_FOR_FIFO_DRAIN_TIMEOUT
	.comm	_TRF7970A_CMD_BIT_CONTINUOUS,4,2 ## @TRF7970A_CMD_BIT_CONTINUOUS
	.comm	_TRF7970A_FIFO_IO_REGISTER,4,2  ## @TRF7970A_FIFO_IO_REGISTER
	.no_dead_strip	_trf7970a_fill_fifo
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function trf7970a_fill_fifo
_trf7970a_fill_fifo:                    ; @trf7970a_fill_fifo
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x20, [x0, #8]
Lloh0:
	adrp	x8, _TRF7970A_FIFO_STATUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TRF7970A_FIFO_STATUS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_trf7970a_read
	cbz	w0, LBB0_2
LBB0_1:
	mov	x1, x0
	mov	x0, x19
	bl	_trf7970a_send_err_upstream
	b	LBB0_5
LBB0_2:
	ldr	w0, [x19, #4]
	ldr	w2, [sp, #12]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
Lloh5:
	adrp	x8, _TRF7970A_FIFO_STATUS_OVERFLOW@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TRF7970A_FIFO_STATUS_OVERFLOW@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	bic	w8, w9, w8
	str	w8, [sp, #12]
Lloh8:
	adrp	x9, _TRF7970A_FIFO_SIZE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _TRF7970A_FIFO_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	subs	w1, w9, w8
	b.ne	LBB0_4
; %bb.3:
Lloh11:
	adrp	x8, _TRF7970A_WAIT_FOR_FIFO_DRAIN_TIMEOUT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TRF7970A_WAIT_FOR_FIFO_DRAIN_TIMEOUT@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x19
	bl	_schedule_delayed_work
	b	LBB0_5
LBB0_4:
	ldr	w0, [x20]
	bl	_min
	mov	x2, x0
Lloh14:
	adrp	x8, _TRF7970A_CMD_BIT_CONTINUOUS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _TRF7970A_CMD_BIT_CONTINUOUS@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, _TRF7970A_FIFO_IO_REGISTER@GOTPAGE
Lloh18:
	ldr	x9, [x9, _TRF7970A_FIFO_IO_REGISTER@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [sp, #8]
	add	x3, sp, #8
	mov	x0, x19
	mov	x1, x20
	mov	w4, #4
	bl	_trf7970a_transmit
	cbnz	w0, LBB0_1
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_TRF7970A_FIFO_STATUS,4,2       ; @TRF7970A_FIFO_STATUS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Filling FIFO - fifo_bytes: 0x%x\n"

	.comm	_TRF7970A_FIFO_STATUS_OVERFLOW,4,2 ; @TRF7970A_FIFO_STATUS_OVERFLOW
	.comm	_TRF7970A_FIFO_SIZE,4,2         ; @TRF7970A_FIFO_SIZE
	.comm	_TRF7970A_WAIT_FOR_FIFO_DRAIN_TIMEOUT,4,2 ; @TRF7970A_WAIT_FOR_FIFO_DRAIN_TIMEOUT
	.comm	_TRF7970A_CMD_BIT_CONTINUOUS,4,2 ; @TRF7970A_CMD_BIT_CONTINUOUS
	.comm	_TRF7970A_FIFO_IO_REGISTER,4,2  ; @TRF7970A_FIFO_IO_REGISTER
	.no_dead_strip	_trf7970a_fill_fifo
.subsections_via_symbols
