	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CheckDMA                       ## -- Begin function CheckDMA
	.p2align	4, 0x90
_CheckDMA:                              ## @CheckDMA
	.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	_Pico@GOTPCREL(%rip), %rax
	movq	8(%rax), %rsi
	movl	48(%rsi), %ecx
	movl	92(%rsi), %edx
	movl	%edx, %edi
	sarl	$6, %edi
	movl	(%rax), %r14d
	xorl	%r12d, %r12d
	cmpl	$1, 16(%rax)
	setne	%r12b
	testb	$-128, %dl
	cmovnel	%edi, %r12d
	shll	$2, %ecx
	andl	$4, %ecx
	orl	%r12d, %ecx
	movl	20(%rax), %edx
	testb	$8, %dl
	jne	LBB0_2
## %bb.1:
	movl	4(%rsi), %esi
	shrl	$3, %esi
	andl	$8, %esi
	orl	%esi, %ecx
LBB0_2:
	movq	_dma_timings@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rdi
	movslq	%ecx, %rsi
	movl	(%rdi,%rsi,4), %r15d
	movl	%r14d, %ebx
	subl	%r15d, %ebx
	jle	LBB0_3
## %bb.6:
	xorl	%edx, %edx
	testb	$2, %cl
	movl	$488, %r14d                     ## imm = 0x1E8
	cmovnel	%edx, %r14d
	jmp	LBB0_7
LBB0_3:
	testb	$2, %cl
	jne	LBB0_4
## %bb.5:
	movq	_dma_bsycles@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	imull	(%rcx,%rsi,4), %r14d
	sarl	$8, %r14d
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_4:
	andl	$-3, %edx
	movl	%edx, 20(%rax)
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
LBB0_7:
	movl	%ebx, (%rax)
	movq	_EL_VDPDMA@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	xorl	%eax, %eax
	callq	_SekCyclesDone
	movl	%eax, (%rsp)
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %edi
	movl	%ebx, %edx
	movl	%r12d, %ecx
	movl	%r15d, %r8d
	movl	%r14d, %r9d
	callq	_elprintf
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_Pico,24,3                      ## @Pico
	.comm	_dma_timings,8,3                ## @dma_timings
	.comm	_dma_bsycles,8,3                ## @dma_bsycles
	.comm	_EL_VDPDMA,4,2                  ## @EL_VDPDMA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"~Dma %i op=%i can=%i burn=%i [%i]"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CheckDMA                       ; -- Begin function CheckDMA
	.p2align	2
_CheckDMA:                              ; @CheckDMA
	.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
Lloh0:
	adrp	x8, _Pico@GOTPAGE
Lloh1:
	ldr	x8, [x8, _Pico@GOTPAGEOFF]
	ldr	x11, [x8, #8]
	ldr	w12, [x11, #92]
	asr	w13, w12, #6
	ldr	w9, [x8]
	ldp	w14, w10, [x8, #16]
	cmp	w14, #1
	cset	w14, ne
	tst	w12, #0x80
	csel	w19, w14, w13, eq
	ldr	w12, [x11, #48]
	ubfiz	w12, w12, #2, #1
	orr	w12, w12, w19
	tbnz	w10, #3, LBB0_2
; %bb.1:
	ldr	w11, [x11, #4]
	lsr	w11, w11, #3
	and	w11, w11, #0x8
	orr	w12, w11, w12
LBB0_2:
Lloh2:
	adrp	x11, _dma_timings@GOTPAGE
Lloh3:
	ldr	x11, [x11, _dma_timings@GOTPAGEOFF]
Lloh4:
	ldr	x13, [x11]
	sxtw	x11, w12
	ldr	w20, [x13, w12, sxtw #2]
	subs	w21, w9, w20
	b.le	LBB0_4
; %bb.3:
	tst	w11, #0x2
	mov	w9, #488
	csel	w22, w9, wzr, eq
	b	LBB0_7
LBB0_4:
	mov	w21, #0
	tbnz	w11, #1, LBB0_6
; %bb.5:
Lloh5:
	adrp	x10, _dma_bsycles@GOTPAGE
Lloh6:
	ldr	x10, [x10, _dma_bsycles@GOTPAGEOFF]
Lloh7:
	ldr	x10, [x10]
	ldr	w10, [x10, x11, lsl #2]
	mul	w9, w10, w9
	asr	w22, w9, #8
	b	LBB0_7
LBB0_6:
	mov	w22, #0
	and	w9, w10, #0xfffffffd
	str	w9, [x8, #20]
LBB0_7:
	str	w21, [x8]
Lloh8:
	adrp	x8, _EL_VDPDMA@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EL_VDPDMA@GOTPAGEOFF]
Lloh10:
	ldr	w23, [x8]
	bl	_SekCyclesDone
	mov	x6, x0
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x23
	mov	x2, x21
	mov	x3, x19
	mov	x4, x20
	mov	x5, x22
	bl	_elprintf
	mov	x0, x22
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_Pico,24,3                      ; @Pico
	.comm	_dma_timings,8,3                ; @dma_timings
	.comm	_dma_bsycles,8,3                ; @dma_bsycles
	.comm	_EL_VDPDMA,4,2                  ; @EL_VDPDMA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"~Dma %i op=%i can=%i burn=%i [%i]"

.subsections_via_symbols
