	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_t4_memory_rw_init              ## -- Begin function t4_memory_rw_init
	.p2align	4, 0x90
_t4_memory_rw_init:                     ## @t4_memory_rw_init
	.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
	movq	%r9, -48(%rbp)                  ## 8-byte Spill
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r13
	movl	%edx, %r14d
	movl	%esi, %ebx
	movq	%rdi, %r12
	movq	_MA_EDRAM0_BAR_A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_t4_read_reg
	movl	%eax, %edi
	callq	_EDRAM0_SIZE_G
	movl	%eax, %r15d
	movq	_MEM_HMA@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_2
## %bb.1:
	shll	$21, %r15d
	jmp	LBB0_5
LBB0_2:
	movq	_MEM_MC1@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_3
## %bb.4:
	movq	_MA_EXT_MEMORY0_BAR_A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_t4_read_reg
	movl	%eax, %edi
	callq	_EXT_MEM0_SIZE_G
	movq	_MEM_MC0@GOTPCREL(%rip), %rcx
	imull	(%rcx), %r15d
	addl	%eax, %r15d
	shll	$20, %r15d
	jmp	LBB0_5
LBB0_3:
	imull	%r15d, %r14d
	shll	$20, %r14d
	movl	%r14d, %r15d
LBB0_5:
	movl	%r15d, (%r13)
	movq	_PCIE_MEM_ACCESS_BASE_WIN_A@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	callq	_PCIE_MEM_ACCESS_REG
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_t4_read_reg
	cmpl	$-1, %eax
	je	LBB0_6
## %bb.7:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_WINDOW_G
	movq	_WINDOW_SHIFT_X@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	shll	%cl, %edx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%edx, (%rax)
	movl	%ebx, %edi
	callq	_PCIEOFST_G
	movq	_PCIEOFST_SHIFT_X@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	%eax, (%rbx)
	movl	8(%r12), %edi
	callq	_is_t4
	movq	%rax, %rcx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	je	LBB0_9
## %bb.8:
	movl	(%r12), %ecx
	subl	%ecx, (%rbx)
	jmp	LBB0_9
LBB0_6:
	movq	_ENXIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MA_EDRAM0_BAR_A,4,2            ## @MA_EDRAM0_BAR_A
	.comm	_MEM_HMA,4,2                    ## @MEM_HMA
	.comm	_MEM_MC1,4,2                    ## @MEM_MC1
	.comm	_MA_EXT_MEMORY0_BAR_A,4,2       ## @MA_EXT_MEMORY0_BAR_A
	.comm	_MEM_MC0,4,2                    ## @MEM_MC0
	.comm	_PCIE_MEM_ACCESS_BASE_WIN_A,4,2 ## @PCIE_MEM_ACCESS_BASE_WIN_A
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_WINDOW_SHIFT_X,4,2             ## @WINDOW_SHIFT_X
	.comm	_PCIEOFST_SHIFT_X,4,2           ## @PCIEOFST_SHIFT_X
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_t4_memory_rw_init              ; -- Begin function t4_memory_rw_init
	.p2align	2
_t4_memory_rw_init:                     ; @t4_memory_rw_init
	.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	x21, x5
	mov	x19, x4
	mov	x23, x3
	mov	x25, x2
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _MA_EDRAM0_BAR_A@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MA_EDRAM0_BAR_A@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_t4_read_reg
	bl	_EDRAM0_SIZE_G
	mov	x24, x0
Lloh3:
	adrp	x8, _MEM_HMA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MEM_HMA@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w25
	b.ne	LBB0_2
; %bb.1:
	lsl	w8, w24, #21
	b	LBB0_6
LBB0_2:
Lloh6:
	adrp	x8, _MEM_MC1@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MEM_MC1@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w25
	b.ne	LBB0_4
; %bb.3:
Lloh9:
	adrp	x8, _MA_EXT_MEMORY0_BAR_A@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MA_EXT_MEMORY0_BAR_A@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_t4_read_reg
	bl	_EXT_MEM0_SIZE_G
Lloh12:
	adrp	x8, _MEM_MC0@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MEM_MC0@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	madd	w8, w8, w24, w0
	b	LBB0_5
LBB0_4:
	mul	w8, w25, w24
LBB0_5:
	lsl	w8, w8, #20
LBB0_6:
	str	w8, [x23]
Lloh15:
	adrp	x8, _PCIE_MEM_ACCESS_BASE_WIN_A@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PCIE_MEM_ACCESS_BASE_WIN_A@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	mov	x1, x22
	bl	_PCIE_MEM_ACCESS_REG
	mov	x1, x0
	mov	x0, x20
	bl	_t4_read_reg
	cmn	w0, #1
	b.eq	LBB0_9
; %bb.7:
	mov	x22, x0
	bl	_WINDOW_G
Lloh18:
	adrp	x8, _WINDOW_SHIFT_X@GOTPAGE
Lloh19:
	ldr	x8, [x8, _WINDOW_SHIFT_X@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	add	w8, w8, w0
	mov	w9, #1
	lsl	w8, w9, w8
	str	w8, [x21]
	mov	x0, x22
	bl	_PCIEOFST_G
Lloh21:
	adrp	x8, _PCIEOFST_SHIFT_X@GOTPAGE
Lloh22:
	ldr	x8, [x8, _PCIEOFST_SHIFT_X@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	lsl	w8, w0, w8
	str	w8, [x19]
	ldr	w0, [x20, #8]
	bl	_is_t4
	cbz	x0, LBB0_10
; %bb.8:
	mov	w0, #0
	ldr	w8, [x20]
	ldr	w9, [x19]
	sub	w8, w9, w8
	str	w8, [x19]
	b	LBB0_10
LBB0_9:
Lloh24:
	adrp	x8, _ENXIO@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_MA_EDRAM0_BAR_A,4,2            ; @MA_EDRAM0_BAR_A
	.comm	_MEM_HMA,4,2                    ; @MEM_HMA
	.comm	_MEM_MC1,4,2                    ; @MEM_MC1
	.comm	_MA_EXT_MEMORY0_BAR_A,4,2       ; @MA_EXT_MEMORY0_BAR_A
	.comm	_MEM_MC0,4,2                    ; @MEM_MC0
	.comm	_PCIE_MEM_ACCESS_BASE_WIN_A,4,2 ; @PCIE_MEM_ACCESS_BASE_WIN_A
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_WINDOW_SHIFT_X,4,2             ; @WINDOW_SHIFT_X
	.comm	_PCIEOFST_SHIFT_X,4,2           ; @PCIEOFST_SHIFT_X
.subsections_via_symbols
