	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ddr_setup                      ## -- Begin function ddr_setup
	.p2align	4, 0x90
_ddr_setup:                             ## @ddr_setup
	.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
	movl	%edi, %ebx
	movq	_C_BLKEN_DDR_ON@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	movq	_C_DDR_BLKEN_REG@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	movl	%eax, (%rcx)
	movq	_C_TP_DDR2_25_CL6_1GB@GOTPCREL(%rip), %rdi
	callq	_ddr_timing_initialisation
	movq	_C_CP_DDR2_25_CL6@GOTPCREL(%rip), %rdi
	movl	%ebx, %esi
	callq	_ddr_normal_initialisation
	movq	_DDR_ROUTE_CPU0_WRDATA_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$3, %eax
	shll	%cl, %eax
	movq	_DDR_ROUTE_CPU0_RDDATA_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %dl
	movq	_DDR_ROUTE_CPU1_INSTR_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$2, %esi
	shll	%cl, %esi
	movl	$3, %edi
	btsl	%edx, %eax
	movq	_DDR_ROUTE_CPU1_RDDATA_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$3, %edx
	shll	%cl, %edx
	orl	%esi, %edx
	orl	%eax, %edx
	movq	_DDR_ROUTE_CPU1_WRDATA_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %edi
	orl	%edx, %edi
	movq	_C_DDR_TRANSACTION_ROUTING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%edi, (%rax)
	movl	$65535, %eax                    ## imm = 0xFFFF
	addl	(%r14), %eax
	movq	(%r15), %rcx
	movl	%eax, (%rcx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_C_TP_DDR2_25_CL6_1GB,4,2       ## @C_TP_DDR2_25_CL6_1GB
	.comm	_C_CP_DDR2_25_CL6,4,2           ## @C_CP_DDR2_25_CL6
	.comm	_C_BLKEN_DDR_ON,4,2             ## @C_BLKEN_DDR_ON
	.comm	_C_DDR_BLKEN_REG,8,3            ## @C_DDR_BLKEN_REG
	.comm	_DDR_ROUTE_CPU0_INSTR_SHIFT,4,2 ## @DDR_ROUTE_CPU0_INSTR_SHIFT
	.comm	_DDR_ROUTE_CPU0_RDDATA_SHIFT,4,2 ## @DDR_ROUTE_CPU0_RDDATA_SHIFT
	.comm	_DDR_ROUTE_CPU0_WRDATA_SHIFT,4,2 ## @DDR_ROUTE_CPU0_WRDATA_SHIFT
	.comm	_DDR_ROUTE_CPU1_INSTR_SHIFT,4,2 ## @DDR_ROUTE_CPU1_INSTR_SHIFT
	.comm	_DDR_ROUTE_CPU1_RDDATA_SHIFT,4,2 ## @DDR_ROUTE_CPU1_RDDATA_SHIFT
	.comm	_DDR_ROUTE_CPU1_WRDATA_SHIFT,4,2 ## @DDR_ROUTE_CPU1_WRDATA_SHIFT
	.comm	_C_DDR_TRANSACTION_ROUTING,8,3  ## @C_DDR_TRANSACTION_ROUTING
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ddr_setup                      ; -- Begin function ddr_setup
	.p2align	2
_ddr_setup:                             ; @ddr_setup
	.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	x20, _C_BLKEN_DDR_ON@GOTPAGE
Lloh1:
	ldr	x20, [x20, _C_BLKEN_DDR_ON@GOTPAGEOFF]
	ldr	w8, [x20]
Lloh2:
	adrp	x21, _C_DDR_BLKEN_REG@GOTPAGE
Lloh3:
	ldr	x21, [x21, _C_DDR_BLKEN_REG@GOTPAGEOFF]
	ldr	x9, [x21]
	str	w8, [x9]
Lloh4:
	adrp	x0, _C_TP_DDR2_25_CL6_1GB@GOTPAGE
Lloh5:
	ldr	x0, [x0, _C_TP_DDR2_25_CL6_1GB@GOTPAGEOFF]
	bl	_ddr_timing_initialisation
Lloh6:
	adrp	x0, _C_CP_DDR2_25_CL6@GOTPAGE
Lloh7:
	ldr	x0, [x0, _C_CP_DDR2_25_CL6@GOTPAGEOFF]
	mov	x1, x19
	bl	_ddr_normal_initialisation
Lloh8:
	adrp	x8, _DDR_ROUTE_CPU0_RDDATA_SHIFT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DDR_ROUTE_CPU0_RDDATA_SHIFT@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	mov	w9, #1
Lloh11:
	adrp	x10, _DDR_ROUTE_CPU0_WRDATA_SHIFT@GOTPAGE
Lloh12:
	ldr	x10, [x10, _DDR_ROUTE_CPU0_WRDATA_SHIFT@GOTPAGEOFF]
	lsl	w8, w9, w8
Lloh13:
	ldr	w9, [x10]
	mov	w10, #3
	lsl	w9, w10, w9
Lloh14:
	adrp	x11, _DDR_ROUTE_CPU1_INSTR_SHIFT@GOTPAGE
Lloh15:
	ldr	x11, [x11, _DDR_ROUTE_CPU1_INSTR_SHIFT@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh16:
	ldr	w9, [x11]
	mov	w11, #2
	lsl	w9, w11, w9
Lloh17:
	adrp	x11, _DDR_ROUTE_CPU1_RDDATA_SHIFT@GOTPAGE
Lloh18:
	ldr	x11, [x11, _DDR_ROUTE_CPU1_RDDATA_SHIFT@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh19:
	ldr	w9, [x11]
	lsl	w9, w10, w9
	orr	w8, w8, w9
Lloh20:
	adrp	x9, _DDR_ROUTE_CPU1_WRDATA_SHIFT@GOTPAGE
Lloh21:
	ldr	x9, [x9, _DDR_ROUTE_CPU1_WRDATA_SHIFT@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	lsl	w9, w10, w9
	orr	w8, w8, w9
Lloh23:
	adrp	x9, _C_DDR_TRANSACTION_ROUTING@GOTPAGE
Lloh24:
	ldr	x9, [x9, _C_DDR_TRANSACTION_ROUTING@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	str	w8, [x9]
	ldr	w8, [x20]
	mov	w9, #65535
	add	w8, w8, w9
	ldr	x9, [x21]
	str	w8, [x9]
	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
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_C_TP_DDR2_25_CL6_1GB,4,2       ; @C_TP_DDR2_25_CL6_1GB
	.comm	_C_CP_DDR2_25_CL6,4,2           ; @C_CP_DDR2_25_CL6
	.comm	_C_BLKEN_DDR_ON,4,2             ; @C_BLKEN_DDR_ON
	.comm	_C_DDR_BLKEN_REG,8,3            ; @C_DDR_BLKEN_REG
	.comm	_DDR_ROUTE_CPU0_INSTR_SHIFT,4,2 ; @DDR_ROUTE_CPU0_INSTR_SHIFT
	.comm	_DDR_ROUTE_CPU0_RDDATA_SHIFT,4,2 ; @DDR_ROUTE_CPU0_RDDATA_SHIFT
	.comm	_DDR_ROUTE_CPU0_WRDATA_SHIFT,4,2 ; @DDR_ROUTE_CPU0_WRDATA_SHIFT
	.comm	_DDR_ROUTE_CPU1_INSTR_SHIFT,4,2 ; @DDR_ROUTE_CPU1_INSTR_SHIFT
	.comm	_DDR_ROUTE_CPU1_RDDATA_SHIFT,4,2 ; @DDR_ROUTE_CPU1_RDDATA_SHIFT
	.comm	_DDR_ROUTE_CPU1_WRDATA_SHIFT,4,2 ; @DDR_ROUTE_CPU1_WRDATA_SHIFT
	.comm	_C_DDR_TRANSACTION_ROUTING,8,3  ; @C_DDR_TRANSACTION_ROUTING
.subsections_via_symbols
