	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mmhub_v1_0_init_system_aperture_regs
_mmhub_v1_0_init_system_aperture_regs:  ## @mmhub_v1_0_init_system_aperture_regs
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_MMHUB@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	_mmMC_VM_AGP_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	callq	_WREG32_SOC15
	movl	(%r12), %edi
	movq	_mmMC_VM_AGP_BOT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movsbl	23(%rbx), %ecx
	xorl	%esi, %esi
	callq	_WREG32_SOC15
	movl	(%r12), %edi
	movq	_mmMC_VM_AGP_TOP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movsbl	27(%rbx), %ecx
	xorl	%esi, %esi
	callq	_WREG32_SOC15
	movl	(%r12), %r14d
	movq	_mmMC_VM_SYSTEM_APERTURE_LOW_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	20(%rbx), %esi
	movl	36(%rbx), %edi
	callq	_min
	sarl	$18, %eax
	movl	%r14d, %edi
	xorl	%esi, %esi
	movl	%r15d, %edx
	movl	%eax, %ecx
	callq	_WREG32_SOC15
	movq	(%rbx), %rax
	movq	_CHIP_RAVEN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.1:
	cmpl	$8, 8(%rbx)
	jl	LBB0_3
## %bb.2:
	movl	(%r12), %r14d
	movq	_mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	24(%rbx), %esi
	movl	28(%rbx), %edi
	sarl	$18, %edi
	incl	%edi
	sarl	$18, %esi
	callq	_max
	jmp	LBB0_4
LBB0_3:
	movl	(%r12), %r14d
	movq	_mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	24(%rbx), %esi
	movl	28(%rbx), %edi
	callq	_max
	sarl	$18, %eax
LBB0_4:
	movl	%r14d, %edi
	xorl	%esi, %esi
	movl	%r15d, %edx
	movl	%eax, %ecx
	callq	_WREG32_SOC15
	movq	%rbx, %rdi
	callq	_amdgpu_sriov_vf
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	40(%rbx), %ecx
	subl	32(%rbx), %ecx
	addl	16(%rbx), %ecx
	movl	(%r12), %edi
	movq	_mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	sarl	$12, %ecx
	xorl	%esi, %esi
	callq	_WREG32_SOC15
	movl	(%r12), %edi
	movq	_mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_WREG32_SOC15
	movl	(%r12), %edi
	movq	_mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_LO32@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	12(%rbx), %ecx
	sarl	$12, %ecx
	xorl	%esi, %esi
	callq	_WREG32_SOC15
	movl	(%r12), %edi
	movq	_mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_WREG32_SOC15
	movl	(%r12), %edi
	movq	_mmVM_L2_PROTECTION_FAULT_CNTL2@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	xorl	%esi, %esi
	callq	_RREG32_SOC15
	movq	_VM_L2_PROTECTION_FAULT_CNTL2@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	movl	$1, %ecx
	callq	_REG_SET_FIELD
	movl	(%r12), %edi
	movl	(%rbx), %edx
	xorl	%esi, %esi
	movl	%eax, %ecx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_WREG32_SOC15                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MMHUB,4,2                      ## @MMHUB
	.comm	_mmMC_VM_AGP_BASE,4,2           ## @mmMC_VM_AGP_BASE
	.comm	_mmMC_VM_AGP_BOT,4,2            ## @mmMC_VM_AGP_BOT
	.comm	_mmMC_VM_AGP_TOP,4,2            ## @mmMC_VM_AGP_TOP
	.comm	_mmMC_VM_SYSTEM_APERTURE_LOW_ADDR,4,2 ## @mmMC_VM_SYSTEM_APERTURE_LOW_ADDR
	.comm	_CHIP_RAVEN,8,3                 ## @CHIP_RAVEN
	.comm	_mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR,4,2 ## @mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR
	.comm	_mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB,4,2 ## @mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB
	.comm	_mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB,4,2 ## @mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB
	.comm	_mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_LO32,4,2 ## @mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_LO32
	.comm	_mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32,4,2 ## @mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32
	.comm	_mmVM_L2_PROTECTION_FAULT_CNTL2,4,2 ## @mmVM_L2_PROTECTION_FAULT_CNTL2
	.comm	_VM_L2_PROTECTION_FAULT_CNTL2,4,2 ## @VM_L2_PROTECTION_FAULT_CNTL2
	.comm	_ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY,4,2 ## @ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY
	.no_dead_strip	_mmhub_v1_0_init_system_aperture_regs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mmhub_v1_0_init_system_aperture_regs
_mmhub_v1_0_init_system_aperture_regs:  ; @mmhub_v1_0_init_system_aperture_regs
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x22, _MMHUB@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MMHUB@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh2:
	adrp	x8, _mmMC_VM_AGP_BASE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _mmMC_VM_AGP_BASE@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	w1, #0
	mov	w3, #0
	bl	_WREG32_SOC15
	ldr	w0, [x22]
Lloh5:
	adrp	x8, _mmMC_VM_AGP_BOT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _mmMC_VM_AGP_BOT@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	ldrsb	w3, [x19, #23]
	mov	w1, #0
	bl	_WREG32_SOC15
	ldr	w0, [x22]
Lloh8:
	adrp	x8, _mmMC_VM_AGP_TOP@GOTPAGE
Lloh9:
	ldr	x8, [x8, _mmMC_VM_AGP_TOP@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	ldrsb	w3, [x19, #27]
	mov	w1, #0
	bl	_WREG32_SOC15
	ldr	w20, [x22]
Lloh11:
	adrp	x8, _mmMC_VM_SYSTEM_APERTURE_LOW_ADDR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _mmMC_VM_SYSTEM_APERTURE_LOW_ADDR@GOTPAGEOFF]
Lloh13:
	ldr	w21, [x8]
	ldr	w0, [x19, #36]
	ldr	w1, [x19, #20]
	bl	_min
	asr	w3, w0, #18
	mov	x0, x20
	mov	w1, #0
	mov	x2, x21
	bl	_WREG32_SOC15
	ldr	x8, [x19]
Lloh14:
	adrp	x9, _CHIP_RAVEN@GOTPAGE
Lloh15:
	ldr	x9, [x9, _CHIP_RAVEN@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	ldr	w8, [x19, #8]
	cmp	w8, #8
	b.lt	LBB0_3
; %bb.2:
	ldr	w20, [x22]
Lloh17:
	adrp	x8, _mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR@GOTPAGEOFF]
Lloh19:
	ldr	w21, [x8]
	ldp	w9, w8, [x19, #24]
	asr	w8, w8, #18
	add	w0, w8, #1
	asr	w1, w9, #18
	bl	_max
	mov	x3, x0
	b	LBB0_4
LBB0_3:
	ldr	w20, [x22]
Lloh20:
	adrp	x8, _mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR@GOTPAGE
Lloh21:
	ldr	x8, [x8, _mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR@GOTPAGEOFF]
Lloh22:
	ldr	w21, [x8]
	ldp	w1, w0, [x19, #24]
	bl	_max
	asr	w3, w0, #18
LBB0_4:
	mov	x0, x20
	mov	w1, #0
	mov	x2, x21
	bl	_WREG32_SOC15
	mov	x0, x19
	bl	_amdgpu_sriov_vf
	cbz	x0, LBB0_6
; %bb.5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_6:
	ldr	w8, [x19, #40]
	ldr	w9, [x19, #32]
	ldr	w10, [x19, #16]
	sub	w8, w8, w9
	add	w8, w8, w10
	ldr	w0, [x22]
Lloh23:
	adrp	x9, _mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB@GOTPAGE
Lloh24:
	ldr	x9, [x9, _mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x9]
	asr	w3, w8, #12
	mov	w1, #0
	bl	_WREG32_SOC15
	ldr	w0, [x22]
Lloh26:
	adrp	x8, _mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB@GOTPAGE
Lloh27:
	ldr	x8, [x8, _mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_WREG32_SOC15
	ldr	w0, [x22]
Lloh29:
	adrp	x8, _mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_LO32@GOTPAGE
Lloh30:
	ldr	x8, [x8, _mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_LO32@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	ldr	w8, [x19, #12]
	asr	w3, w8, #12
	mov	w1, #0
	bl	_WREG32_SOC15
	ldr	w0, [x22]
Lloh32:
	adrp	x8, _mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32@GOTPAGE
Lloh33:
	ldr	x8, [x8, _mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32@GOTPAGEOFF]
Lloh34:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_WREG32_SOC15
	ldr	w0, [x22]
Lloh35:
	adrp	x19, _mmVM_L2_PROTECTION_FAULT_CNTL2@GOTPAGE
Lloh36:
	ldr	x19, [x19, _mmVM_L2_PROTECTION_FAULT_CNTL2@GOTPAGEOFF]
	ldr	w2, [x19]
	mov	w1, #0
	bl	_RREG32_SOC15
Lloh37:
	adrp	x8, _VM_L2_PROTECTION_FAULT_CNTL2@GOTPAGE
Lloh38:
	ldr	x8, [x8, _VM_L2_PROTECTION_FAULT_CNTL2@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
Lloh40:
	adrp	x8, _ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY@GOTPAGE
Lloh41:
	ldr	x8, [x8, _ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY@GOTPAGEOFF]
Lloh42:
	ldr	w2, [x8]
	mov	w3, #1
	bl	_REG_SET_FIELD
	mov	x3, x0
	ldr	w0, [x22]
	ldr	w2, [x19]
	mov	w1, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_WREG32_SOC15
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_MMHUB,4,2                      ; @MMHUB
	.comm	_mmMC_VM_AGP_BASE,4,2           ; @mmMC_VM_AGP_BASE
	.comm	_mmMC_VM_AGP_BOT,4,2            ; @mmMC_VM_AGP_BOT
	.comm	_mmMC_VM_AGP_TOP,4,2            ; @mmMC_VM_AGP_TOP
	.comm	_mmMC_VM_SYSTEM_APERTURE_LOW_ADDR,4,2 ; @mmMC_VM_SYSTEM_APERTURE_LOW_ADDR
	.comm	_CHIP_RAVEN,8,3                 ; @CHIP_RAVEN
	.comm	_mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR,4,2 ; @mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR
	.comm	_mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB,4,2 ; @mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB
	.comm	_mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB,4,2 ; @mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB
	.comm	_mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_LO32,4,2 ; @mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_LO32
	.comm	_mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32,4,2 ; @mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32
	.comm	_mmVM_L2_PROTECTION_FAULT_CNTL2,4,2 ; @mmVM_L2_PROTECTION_FAULT_CNTL2
	.comm	_VM_L2_PROTECTION_FAULT_CNTL2,4,2 ; @VM_L2_PROTECTION_FAULT_CNTL2
	.comm	_ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY,4,2 ; @ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY
	.no_dead_strip	_mmhub_v1_0_init_system_aperture_regs
.subsections_via_symbols
