	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function emc_setup_hw
_emc_setup_hw:                          ## @emc_setup_hw
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_EMC_REFRESH_OVERFLOW_INT@GOTPCREL(%rip), %rax
	movq	_EMC_CLKCHANGE_COMPLETE_INT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%rax), %ebx
	movq	_EMC_CFG_2@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	addq	(%r14), %rdi
	callq	_readl_relaxed
	movq	_EMC_CLKCHANGE_PD_ENABLE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_3
## %bb.1:
	movq	_EMC_CLKCHANGE_SR_ENABLE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
LBB0_3:
	movq	_EMC_CLKCHANGE_REQ_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	%eax, %edi
	movq	(%r15), %rsi
	addq	(%r14), %rsi
	callq	_writel_relaxed
	movq	_EMC_INTMASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	movl	%ebx, %edi
	callq	_writel_relaxed
	movq	_EMC_INTSTATUS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	movl	%ebx, %edi
	callq	_writel_relaxed
	xorl	%eax, %eax
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	8(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_EMC_REFRESH_OVERFLOW_INT,4,2   ## @EMC_REFRESH_OVERFLOW_INT
	.comm	_EMC_CLKCHANGE_COMPLETE_INT,4,2 ## @EMC_CLKCHANGE_COMPLETE_INT
	.comm	_EMC_CFG_2,8,3                  ## @EMC_CFG_2
	.comm	_EMC_CLKCHANGE_PD_ENABLE,4,2    ## @EMC_CLKCHANGE_PD_ENABLE
	.comm	_EMC_CLKCHANGE_SR_ENABLE,4,2    ## @EMC_CLKCHANGE_SR_ENABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bootloader didn't specify DRAM auto-suspend mode\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EMC_CLKCHANGE_REQ_ENABLE,4,2   ## @EMC_CLKCHANGE_REQ_ENABLE
	.comm	_EMC_INTMASK,8,3                ## @EMC_INTMASK
	.comm	_EMC_INTSTATUS,8,3              ## @EMC_INTSTATUS
	.no_dead_strip	_emc_setup_hw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function emc_setup_hw
_emc_setup_hw:                          ; @emc_setup_hw
	.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	x8, _EMC_REFRESH_OVERFLOW_INT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EMC_REFRESH_OVERFLOW_INT@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
Lloh3:
	adrp	x8, _EMC_CLKCHANGE_COMPLETE_INT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EMC_CLKCHANGE_COMPLETE_INT@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
	ldr	x8, [x0]
Lloh6:
	adrp	x21, _EMC_CFG_2@GOTPAGE
Lloh7:
	ldr	x21, [x21, _EMC_CFG_2@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl_relaxed
Lloh8:
	adrp	x8, _EMC_CLKCHANGE_PD_ENABLE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EMC_CLKCHANGE_PD_ENABLE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_2
; %bb.1:
Lloh11:
	adrp	x8, _EMC_CLKCHANGE_SR_ENABLE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EMC_CLKCHANGE_SR_ENABLE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_4
LBB0_2:
Lloh14:
	adrp	x8, _EMC_CLKCHANGE_REQ_ENABLE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EMC_CLKCHANGE_REQ_ENABLE@GOTPAGEOFF]
	orr	w20, w22, w20
Lloh16:
	ldr	w8, [x8]
	orr	w0, w8, w0
	ldr	x8, [x19]
	ldr	x9, [x21]
	add	x1, x9, x8
	bl	_writel_relaxed
	ldr	x8, [x19]
Lloh17:
	adrp	x9, _EMC_INTMASK@GOTPAGE
Lloh18:
	ldr	x9, [x9, _EMC_INTMASK@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x20
	bl	_writel_relaxed
	ldr	x8, [x19]
Lloh20:
	adrp	x9, _EMC_INTSTATUS@GOTPAGE
Lloh21:
	ldr	x9, [x9, _EMC_INTSTATUS@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x20
	bl	_writel_relaxed
	mov	w0, #0
LBB0_3:
	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_4:
	ldr	w0, [x19, #8]
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh25:
	adrp	x8, _EINVAL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_EMC_REFRESH_OVERFLOW_INT,4,2   ; @EMC_REFRESH_OVERFLOW_INT
	.comm	_EMC_CLKCHANGE_COMPLETE_INT,4,2 ; @EMC_CLKCHANGE_COMPLETE_INT
	.comm	_EMC_CFG_2,8,3                  ; @EMC_CFG_2
	.comm	_EMC_CLKCHANGE_PD_ENABLE,4,2    ; @EMC_CLKCHANGE_PD_ENABLE
	.comm	_EMC_CLKCHANGE_SR_ENABLE,4,2    ; @EMC_CLKCHANGE_SR_ENABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bootloader didn't specify DRAM auto-suspend mode\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EMC_CLKCHANGE_REQ_ENABLE,4,2   ; @EMC_CLKCHANGE_REQ_ENABLE
	.comm	_EMC_INTMASK,8,3                ; @EMC_INTMASK
	.comm	_EMC_INTSTATUS,8,3              ; @EMC_INTSTATUS
	.no_dead_strip	_emc_setup_hw
.subsections_via_symbols
