	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function r592_transfer_fifo_pio
_r592_transfer_fifo_pio:                ## @r592_transfer_fifo_pio
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	(%rax), %r15
	movq	_MS_TPC_SET_RW_REG_ADRS@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	addq	$8, %rdi
	callq	_kfifo_reset
	movq	(%rbx), %rax
	cmpl	$0, 20(%rax)
	je	LBB0_1
## %bb.4:
	callq	_local_irq_save
	movq	(%rbx), %rsi
	addq	$8, %rsi
	movq	_SG_MITER_ATOMIC@GOTPCREL(%rip), %rax
	cmpq	%r12, %r15
	jge	LBB0_5
## %bb.6:
	movq	_SG_MITER_TO_SG@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_1:
	movl	12(%rax), %edx
	movl	16(%rax), %esi
	cmpq	%r12, %r15
	jge	LBB0_2
## %bb.3:
	movq	%rbx, %rdi
	callq	_r592_read_fifo_pio
	jmp	LBB0_16
LBB0_5:
	movq	_SG_MITER_FROM_SG@GOTPCREL(%rip), %rcx
LBB0_7:
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	leaq	-40(%rbp), %r14
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_sg_miter_start
	movq	%r14, %rdi
	callq	_sg_miter_next
	testq	%rax, %rax
	je	LBB0_13
## %bb.8:
	leaq	-40(%rbp), %r14
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	callq	_r592_read_fifo_pio
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%r14, %rdi
	callq	_sg_miter_next
	testq	%rax, %rax
	je	LBB0_13
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %esi
	movq	%rbx, %rdi
	cmpq	%r12, %r15
	jl	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	callq	_r592_write_fifo_pio
	jmp	LBB0_12
LBB0_13:
	cmpq	%r12, %r15
	jl	LBB0_15
## %bb.14:
	movq	%rbx, %rdi
	callq	_r592_flush_fifo_write
LBB0_15:
	leaq	-40(%rbp), %rdi
	callq	_sg_miter_stop
	callq	_local_irq_restore
	jmp	LBB0_16
LBB0_2:
	movq	%rbx, %rdi
	callq	_r592_write_fifo_pio
	movq	%rbx, %rdi
	callq	_r592_flush_fifo_write
LBB0_16:
	xorl	%eax, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MS_TPC_SET_RW_REG_ADRS,8,3     ## @MS_TPC_SET_RW_REG_ADRS
	.comm	_SG_MITER_ATOMIC,4,2            ## @SG_MITER_ATOMIC
	.comm	_SG_MITER_FROM_SG,4,2           ## @SG_MITER_FROM_SG
	.comm	_SG_MITER_TO_SG,4,2             ## @SG_MITER_TO_SG
	.no_dead_strip	_r592_transfer_fifo_pio
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function r592_transfer_fifo_pio
_r592_transfer_fifo_pio:                ; @r592_transfer_fifo_pio
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	ldr	x8, [x0], #8
	ldr	x20, [x8]
Lloh0:
	adrp	x8, _MS_TPC_SET_RW_REG_ADRS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MS_TPC_SET_RW_REG_ADRS@GOTPAGEOFF]
Lloh2:
	ldr	x21, [x8]
	bl	_kfifo_reset
	ldr	x8, [x19]
	ldr	w9, [x8, #20]
	cbz	w9, LBB0_9
; %bb.1:
	bl	_local_irq_save
	ldr	x8, [x19]
	add	x1, x8, #8
Lloh3:
	adrp	x8, _SG_MITER_ATOMIC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SG_MITER_ATOMIC@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _SG_MITER_FROM_SG@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SG_MITER_FROM_SG@GOTPAGEOFF]
Lloh8:
	adrp	x10, _SG_MITER_TO_SG@GOTPAGE
Lloh9:
	ldr	x10, [x10, _SG_MITER_TO_SG@GOTPAGEOFF]
	cmp	x20, x21
	csel	x9, x10, x9, lt
	ldr	w9, [x9]
	orr	w3, w9, w8
	add	x0, sp, #8
	mov	w2, #1
	bl	_sg_miter_start
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	bl	_r592_write_fifo_pio
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #8
	bl	_sg_miter_next
	cbz	x0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldp	w2, w1, [sp, #8]
	mov	x0, x19
	cmp	x20, x21
	b.ge	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_r592_read_fifo_pio
	b	LBB0_3
LBB0_6:
	cmp	x20, x21
	b.lt	LBB0_8
; %bb.7:
	mov	x0, x19
	bl	_r592_flush_fifo_write
LBB0_8:
	add	x0, sp, #8
	bl	_sg_miter_stop
	bl	_local_irq_restore
	b	LBB0_12
LBB0_9:
	ldp	w2, w1, [x8, #12]
	cmp	x20, x21
	b.ge	LBB0_11
; %bb.10:
	mov	x0, x19
	bl	_r592_read_fifo_pio
	b	LBB0_12
LBB0_11:
	mov	x0, x19
	bl	_r592_write_fifo_pio
	mov	x0, x19
	bl	_r592_flush_fifo_write
LBB0_12:
	mov	w0, #0
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MS_TPC_SET_RW_REG_ADRS,8,3     ; @MS_TPC_SET_RW_REG_ADRS
	.comm	_SG_MITER_ATOMIC,4,2            ; @SG_MITER_ATOMIC
	.comm	_SG_MITER_FROM_SG,4,2           ; @SG_MITER_FROM_SG
	.comm	_SG_MITER_TO_SG,4,2             ; @SG_MITER_TO_SG
	.no_dead_strip	_r592_transfer_fifo_pio
.subsections_via_symbols
