	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dreq0_write
_dreq0_write:                           ## @dreq0_write
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	_P32XS_68S@GOTPCREL(%rip), %r8
	movl	(%r8), %eax
	testl	%eax, 12(%rdi)
	je	LBB0_10
## %bb.1:
	movq	_Pico32x@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rax
	movq	_DMAC_FIFO_LEN@GOTPCREL(%rip), %r9
	cmpl	(%r9), %eax
	jge	LBB0_8
## %bb.2:
	movq	8(%rcx), %r10
	leal	1(%rax), %edx
	movl	%edx, (%rcx)
	movl	%esi, (%r10,%rax,4)
	movl	(%rcx), %ecx
	cmpl	(%r9), %ecx
	je	LBB0_3
## %bb.4:
	decl	32(%rdi)
	je	LBB0_5
LBB0_6:
	testb	$3, %cl
	je	LBB0_7
LBB0_9:
	popq	%rbp
	retq
LBB0_10:
	movq	_EL_32X@GOTPCREL(%rip), %rax
	movq	_EL_ANOMALY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	popq	%rbp
	jmp	_elprintf                       ## TAILCALL
LBB0_8:
	movq	_EL_32X@GOTPCREL(%rip), %rax
	movq	_EL_ANOMALY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	popq	%rbp
	jmp	_elprintf                       ## TAILCALL
LBB0_3:
	movq	_P32XS_FULL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 12(%rdi)
	decl	32(%rdi)
	jne	LBB0_6
LBB0_5:
	movl	(%r8), %eax
	notl	%eax
	andl	%eax, 12(%rdi)
	testb	$3, %cl
	jne	LBB0_9
LBB0_7:
	xorl	%eax, %eax
	callq	_SekCyclesDone
	movl	%eax, %edi
	callq	_p32x_sync_sh2s
	xorl	%eax, %eax
	popq	%rbp
	jmp	_p32x_dreq0_trigger             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_P32XS_68S,4,2                  ## @P32XS_68S
	.comm	_EL_32X,4,2                     ## @EL_32X
	.comm	_EL_ANOMALY,4,2                 ## @EL_ANOMALY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DREQ FIFO w16 without 68S?"

	.comm	_Pico32x,16,3                   ## @Pico32x
	.comm	_DMAC_FIFO_LEN,4,2              ## @DMAC_FIFO_LEN
	.comm	_P32XS_FULL,4,2                 ## @P32XS_FULL
L_.str.1:                               ## @.str.1
	.asciz	"DREQ FIFO overflow!"

	.no_dead_strip	_dreq0_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dreq0_write
_dreq0_write:                           ; @dreq0_write
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	ldr	w9, [x0, #12]
Lloh0:
	adrp	x8, _P32XS_68S@GOTPAGE
Lloh1:
	ldr	x8, [x8, _P32XS_68S@GOTPAGEOFF]
	ldr	w10, [x8]
	tst	w10, w9
	b.eq	LBB0_7
; %bb.1:
Lloh2:
	adrp	x9, _Pico32x@GOTPAGE
Lloh3:
	ldr	x9, [x9, _Pico32x@GOTPAGEOFF]
	ldrsw	x10, [x9]
Lloh4:
	adrp	x11, _DMAC_FIFO_LEN@GOTPAGE
Lloh5:
	ldr	x11, [x11, _DMAC_FIFO_LEN@GOTPAGEOFF]
	ldr	w12, [x11]
	cmp	w10, w12
	b.ge	LBB0_8
; %bb.2:
	ldr	x12, [x9, #8]
	add	w13, w10, #1
	str	w13, [x9]
	str	w1, [x12, x10, lsl #2]
	ldr	w9, [x9]
	ldr	w10, [x11]
	cmp	w9, w10
	b.ne	LBB0_4
; %bb.3:
Lloh6:
	adrp	x10, _P32XS_FULL@GOTPAGE
Lloh7:
	ldr	x10, [x10, _P32XS_FULL@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	ldr	w11, [x0, #12]
	orr	w10, w11, w10
	str	w10, [x0, #12]
LBB0_4:
	ldr	w10, [x0, #32]
	subs	w10, w10, #1
	str	w10, [x0, #32]
	b.eq	LBB0_9
; %bb.5:
	tst	w9, #0x3
	b.eq	LBB0_10
LBB0_6:
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_7:
Lloh9:
	adrp	x8, _EL_32X@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EL_32X@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _EL_ANOMALY@GOTPAGE
Lloh13:
	ldr	x9, [x9, _EL_ANOMALY@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w0, w9, w8
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	b	_elprintf
LBB0_8:
Lloh17:
	adrp	x8, _EL_32X@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EL_32X@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	adrp	x9, _EL_ANOMALY@GOTPAGE
Lloh21:
	ldr	x9, [x9, _EL_ANOMALY@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w0, w9, w8
Lloh23:
	adrp	x1, l_.str.1@PAGE
Lloh24:
	add	x1, x1, l_.str.1@PAGEOFF
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	b	_elprintf
LBB0_9:
	ldr	w8, [x8]
	ldr	w10, [x0, #12]
	bic	w8, w10, w8
	str	w8, [x0, #12]
	tst	w9, #0x3
	b.ne	LBB0_6
LBB0_10:
	bl	_SekCyclesDone
	bl	_p32x_sync_sh2s
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	b	_p32x_dreq0_trigger
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_P32XS_68S,4,2                  ; @P32XS_68S
	.comm	_EL_32X,4,2                     ; @EL_32X
	.comm	_EL_ANOMALY,4,2                 ; @EL_ANOMALY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DREQ FIFO w16 without 68S?"

	.comm	_Pico32x,16,3                   ; @Pico32x
	.comm	_DMAC_FIFO_LEN,4,2              ; @DMAC_FIFO_LEN
	.comm	_P32XS_FULL,4,2                 ; @P32XS_FULL
l_.str.1:                               ; @.str.1
	.asciz	"DREQ FIFO overflow!"

	.no_dead_strip	_dreq0_write
.subsections_via_symbols
