	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function DoDMA
_DoDMA:                                 ## @DoDMA
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $r8d killed $r8d def $r8
	movl	%ecx, %r15d
	movl	%edx, %r13d
	movl	%edi, %r12d
	testl	%esi, %esi
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	je	LBB0_1
## %bb.26:
	movl	%r13d, %eax
	andl	$536870911, %eax                ## imm = 0x1FFFFFFF
	addl	$-94371840, %eax                ## imm = 0xFA600000
	cmpl	$6225920, %eax                  ## imm = 0x5F0000
	jae	LBB0_27
## %bb.31:
	xorl	%r14d, %r14d
	testb	$2, %r12b
	je	LBB0_33
## %bb.32:
	movl	%r12d, %edi
	callq	_MappedMemoryReadWord
	movl	%r13d, %edi
	movl	%eax, %esi
	callq	_MappedMemoryWriteWord
	movq	-48(%rbp), %r8                  ## 8-byte Reload
	addl	%r15d, %r13d
	addl	$2, %r12d
	movl	$2, %r14d
LBB0_33:
	cmpl	$3, %r8d
	jl	LBB0_36
## %bb.34:
	leal	-2(%r8), %eax
	cmpl	%eax, %r14d
	jae	LBB0_36
	.p2align	4, 0x90
LBB0_35:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movl	%r12d, %edi
	movl	%eax, %r12d
	callq	_MappedMemoryReadLong
	movl	%eax, %ebx
	movl	%eax, %esi
	sarl	$16, %esi
	movl	%r13d, %edi
	callq	_MappedMemoryWriteWord
	addl	%r15d, %r13d
	movl	%r13d, %edi
	movl	%ebx, %esi
	callq	_MappedMemoryWriteWord
	movl	%r12d, %eax
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	addl	%r15d, %r13d
	addl	$4, %r12d
	addl	$4, %r14d
	cmpl	%eax, %r14d
	jl	LBB0_35
LBB0_36:
	cmpl	-48(%rbp), %r14d                ## 4-byte Folded Reload
	jge	LBB0_10
## %bb.37:
	movl	%r12d, %edi
	callq	_MappedMemoryReadWord
	movl	%r13d, %edi
	movl	%eax, %esi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_MappedMemoryWriteWord          ## TAILCALL
LBB0_1:
	movl	%r12d, %ecx
	andl	$503316480, %ecx                ## imm = 0x1E000000
	movb	$1, %al
	cmpl	$100663296, %ecx                ## imm = 0x6000000
	je	LBB0_5
## %bb.2:
	movl	%r12d, %ecx
	andl	$535822336, %ecx                ## imm = 0x1FF00000
	cmpl	$2097152, %ecx                  ## imm = 0x200000
	je	LBB0_5
## %bb.3:
	cmpl	$94371840, %ecx                 ## imm = 0x5A00000
	je	LBB0_5
## %bb.4:
	movl	%r12d, %eax
	andl	$502267904, %eax                ## imm = 0x1DF00000
	cmpl	$96468992, %eax                 ## imm = 0x5C00000
	sete	%al
LBB0_5:
	movl	%r13d, %ecx
	andl	$536870911, %ecx                ## imm = 0x1FFFFFFF
	addl	$-94371840, %ecx                ## imm = 0xFA600000
	cmpl	$6225919, %ecx                  ## imm = 0x5EFFFF
	ja	LBB0_17
## %bb.6:
	testb	%al, %al
	je	LBB0_7
## %bb.11:
	testb	$2, %r12b
	jne	LBB0_12
## %bb.13:
	movl	%r12d, %edi
	callq	_MappedMemoryReadLong
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, %r12d
	jmp	LBB0_14
LBB0_27:
	movl	%r13d, %r14d
	testl	%r8d, %r8d
	jle	LBB0_30
## %bb.28:
	xorl	%ebx, %ebx
	movl	%r13d, %r14d
	.p2align	4, 0x90
LBB0_29:                                ## =>This Inner Loop Header: Depth=1
	leal	(%r12,%rbx), %edi
	callq	_MappedMemoryReadLong
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_MappedMemoryWriteLong
	addl	%r15d, %r14d
	addl	$4, %ebx
	cmpl	-48(%rbp), %ebx                 ## 4-byte Folded Reload
	jl	LBB0_29
LBB0_30:
	subl	%r13d, %r14d
	movl	%r13d, %edi
	movl	%r14d, %esi
	jmp	LBB0_25
LBB0_17:
	testb	%al, %al
	je	LBB0_18
## %bb.21:
	movl	%r12d, %edi
	callq	_MappedMemoryReadLong
	movl	%r13d, %ebx
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	jle	LBB0_24
## %bb.22:
	movl	%eax, %r12d
	xorl	%r14d, %r14d
	movl	%r13d, %ebx
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	movl	%r12d, %esi
	callq	_MappedMemoryWriteLong
	addl	%r15d, %ebx
	addl	$4, %r14d
	cmpl	-48(%rbp), %r14d                ## 4-byte Folded Reload
	jl	LBB0_23
	jmp	LBB0_24
LBB0_7:
	testl	%r8d, %r8d
	jle	LBB0_10
## %bb.8:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %edi
	callq	_MappedMemoryReadLong
	movl	%eax, %r14d
	movl	%eax, %esi
	sarl	$16, %esi
	movl	%r13d, %edi
	callq	_MappedMemoryWriteWord
	addl	%r15d, %r13d
	movl	%r13d, %edi
	movl	%r14d, %esi
	callq	_MappedMemoryWriteWord
	addl	%r15d, %r13d
	addl	$4, %ebx
	cmpl	-48(%rbp), %ebx                 ## 4-byte Folded Reload
	jl	LBB0_9
	jmp	LBB0_10
LBB0_18:
	movl	%r13d, %ebx
	testl	%r8d, %r8d
	jle	LBB0_24
## %bb.19:
	xorl	%r14d, %r14d
	movl	%r13d, %ebx
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %edi
	callq	_MappedMemoryReadLong
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_MappedMemoryWriteLong
	addl	%r15d, %ebx
	addl	$4, %r14d
	cmpl	-48(%rbp), %r14d                ## 4-byte Folded Reload
	jl	LBB0_20
LBB0_24:
	subl	%r13d, %ebx
	movl	%r13d, %edi
	movl	%ebx, %esi
LBB0_25:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_SH2WriteNotify                 ## TAILCALL
LBB0_12:
	movl	%r12d, %edi
	callq	_MappedMemoryReadWord
	movl	%eax, %ebx
	shll	$16, %ebx
	addl	$2, %r12d
	movl	%r12d, %edi
	callq	_MappedMemoryReadWord
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, %r12d
	orl	%ebx, %r12d
LBB0_14:
	testl	%ecx, %ecx
	jle	LBB0_10
## %bb.15:
	movl	%r12d, %r14d
	sarl	$16, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %edi
	movl	%r14d, %esi
	callq	_MappedMemoryWriteWord
	addl	%r15d, %r13d
	movl	%r13d, %edi
	movl	%r12d, %esi
	callq	_MappedMemoryWriteWord
	addl	%r15d, %r13d
	addl	$4, %ebx
	cmpl	-48(%rbp), %ebx                 ## 4-byte Folded Reload
	jl	LBB0_16
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMAMemoryType,8,3              ## @DMAMemoryType
	.comm	_HighWram,8,3                   ## @HighWram
	.comm	_LowWram,8,3                    ## @LowWram
	.no_dead_strip	_DoDMA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function DoDMA
_DoDMA:                                 ; @DoDMA
	.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, x4
	mov	x21, x3
	mov	x20, x2
	mov	x22, x0
	cbz	w1, LBB0_4
; %bb.1:
	and	w8, w20, #0x1fffffff
	mov	w9, #-94371840
	add	w8, w8, w9
	cmp	w8, #1520, lsl #12              ; =6225920
	b.hs	LBB0_8
; %bb.2:
	tbnz	w22, #1, LBB0_15
; %bb.3:
	mov	w24, #0
	cmp	w19, #3
	b.ge	LBB0_16
	b	LBB0_18
LBB0_4:
	and	w8, w22, #0x1e000000
	mov	w9, #1
	mov	w10, #100663296
	and	w11, w22, #0x1ff00000
	mov	w12, #1
	mov	w13, #94371840
	mov	w14, #502267904
	and	w14, w22, w14
	mov	w15, #96468992
	cmp	w14, w15
	cset	w14, eq
	cmp	w11, w13
	csel	w13, w12, w14, eq
	cmp	w11, #512, lsl #12              ; =2097152
	csel	w11, w12, w13, eq
	cmp	w8, w10
	csel	w8, w9, w11, eq
	and	w9, w20, #0x1fffffff
	mov	w10, #-94371840
	add	w9, w9, w10
	lsr	w9, w9, #16
	cmp	w9, #94
	b.hi	LBB0_11
; %bb.5:
	tbz	w8, #0, LBB0_20
; %bb.6:
	tbnz	w22, #1, LBB0_27
; %bb.7:
	mov	x0, x22
	bl	_MappedMemoryReadLong
	mov	x22, x0
	b	LBB0_28
LBB0_8:
	mov	x23, x20
	cmp	w19, #1
	b.lt	LBB0_26
; %bb.9:
	mov	w24, #0
	mov	x23, x20
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	add	w0, w22, w24
	bl	_MappedMemoryReadLong
	mov	x1, x0
	mov	x0, x23
	bl	_MappedMemoryWriteLong
	add	w23, w23, w21
	add	w24, w24, #4
	cmp	w24, w19
	b.lt	LBB0_10
	b	LBB0_26
LBB0_11:
	tbz	w8, #0, LBB0_23
; %bb.12:
	mov	x0, x22
	bl	_MappedMemoryReadLong
	mov	x23, x20
	cmp	w19, #1
	b.lt	LBB0_26
; %bb.13:
	mov	x22, x0
	mov	w24, #0
	mov	x23, x20
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	mov	x1, x22
	bl	_MappedMemoryWriteLong
	add	w23, w23, w21
	add	w24, w24, #4
	cmp	w24, w19
	b.lt	LBB0_14
	b	LBB0_26
LBB0_15:
	mov	x0, x22
	bl	_MappedMemoryReadWord
	mov	x1, x0
	mov	x0, x20
	bl	_MappedMemoryWriteWord
	add	w20, w21, w20
	add	w22, w22, #2
	mov	w24, #2
	cmp	w19, #3
	b.lt	LBB0_18
LBB0_16:
	sub	w25, w19, #2
	cmp	w24, w25
	b.hs	LBB0_18
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_MappedMemoryReadLong
	mov	x23, x0
	asr	w1, w0, #16
	mov	x0, x20
	bl	_MappedMemoryWriteWord
	add	w20, w20, w21
	mov	x0, x20
	mov	x1, x23
	bl	_MappedMemoryWriteWord
	add	w20, w20, w21
	add	w22, w22, #4
	add	w24, w24, #4
	cmp	w24, w25
	b.lt	LBB0_17
LBB0_18:
	cmp	w24, w19
	b.ge	LBB0_31
; %bb.19:
	mov	x0, x22
	bl	_MappedMemoryReadWord
	mov	x1, x0
	mov	x0, x20
	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
	b	_MappedMemoryWriteWord
LBB0_20:
	cmp	w19, #1
	b.lt	LBB0_31
; %bb.21:
	mov	w24, #0
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_MappedMemoryReadLong
	mov	x23, x0
	asr	w1, w0, #16
	mov	x0, x20
	bl	_MappedMemoryWriteWord
	add	w20, w20, w21
	mov	x0, x20
	mov	x1, x23
	bl	_MappedMemoryWriteWord
	add	w20, w20, w21
	add	w24, w24, #4
	cmp	w24, w19
	b.lt	LBB0_22
	b	LBB0_31
LBB0_23:
	mov	x23, x20
	cmp	w19, #1
	b.lt	LBB0_26
; %bb.24:
	mov	w24, #0
	mov	x23, x20
LBB0_25:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_MappedMemoryReadLong
	mov	x1, x0
	mov	x0, x23
	bl	_MappedMemoryWriteLong
	add	w23, w23, w21
	add	w24, w24, #4
	cmp	w24, w19
	b.lt	LBB0_25
LBB0_26:
	sub	w1, w23, w20
	mov	x0, x20
	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
	b	_SH2WriteNotify
LBB0_27:
	mov	x0, x22
	bl	_MappedMemoryReadWord
	mov	x23, x0
	add	w0, w22, #2
	bl	_MappedMemoryReadWord
	orr	w22, w0, w23, lsl #16
LBB0_28:
	cmp	w19, #1
	b.lt	LBB0_31
; %bb.29:
	mov	w24, #0
	asr	w23, w22, #16
LBB0_30:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x23
	bl	_MappedMemoryWriteWord
	add	w20, w20, w21
	mov	x0, x20
	mov	x1, x22
	bl	_MappedMemoryWriteWord
	add	w20, w20, w21
	add	w24, w24, #4
	cmp	w24, w19
	b.lt	LBB0_30
LBB0_31:
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_DMAMemoryType,8,3              ; @DMAMemoryType
	.comm	_HighWram,8,3                   ; @HighWram
	.comm	_LowWram,8,3                    ; @LowWram
	.no_dead_strip	_DoDMA
.subsections_via_symbols
