	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ast_post_chip_2300
_ast_post_chip_2300:                    ## @ast_post_chip_2300
	.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
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rbx
	movq	_AST_IO_CRTC_PORT@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	movl	$208, %edx
	movl	$255, %ecx
	callq	_ast_get_index_reg_mask
	testb	$-128, %al
	jne	LBB0_11
## %bb.1:
	movq	%rbx, %rdi
	movl	$61444, %esi                    ## imm = 0xF004
	movl	$510525440, %edx                ## imm = 0x1E6E0000
	callq	_ast_write32
	movq	%rbx, %rdi
	movl	$61440, %esi                    ## imm = 0xF000
	movl	$1, %edx
	callq	_ast_write32
	movq	%rbx, %rdi
	movl	$73728, %esi                    ## imm = 0x12000
	movl	$378054824, %edx                ## imm = 0x1688A8A8
	callq	_ast_write32
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movl	$73728, %esi                    ## imm = 0x12000
	callq	_ast_read32
	cmpl	$1, %eax
	jne	LBB0_2
## %bb.3:
	movq	%rbx, %rdi
	movl	$65536, %esi                    ## imm = 0x10000
	movl	$-60816631, %edx                ## imm = 0xFC600309
	callq	_ast_write32
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movl	$65536, %esi                    ## imm = 0x10000
	callq	_ast_read32
	cmpl	$1, %eax
	jne	LBB0_4
## %bb.5:
	movq	%rbx, %rdi
	movl	$73736, %esi                    ## imm = 0x12008
	callq	_ast_read32
	orl	$115, %eax
	movq	%rbx, %rdi
	movl	$73736, %esi                    ## imm = 0x12008
	movl	%eax, %edx
	callq	_ast_write32
	movl	$396, -56(%rbp)                 ## imm = 0x18C
	movq	_AST_DDR3@GOTPCREL(%rip), %r14
	movq	(%r14), %r12
	movq	%r12, -48(%rbp)
	movq	%rbx, %rdi
	movl	$510533744, %esi                ## imm = 0x1E6E2070
	callq	_ast_mindwm
                                        ## kill: def $eax killed $eax def $rax
	testl	$16777216, %eax                 ## imm = 0x1000000
	je	LBB0_7
## %bb.6:
	movq	_AST_DDR2@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r12
	movq	%r12, -48(%rbp)
LBB0_7:
	movl	%eax, %ecx
	shrl	$27, %ecx
	andl	$3, %ecx
	leaq	l_switch.table.ast_post_chip_2300(%rip), %rdx
	movq	(%rdx,%rcx,8), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -36(%rbp)
	shrl	$2, %eax
	andl	$3, %eax
	leaq	l_switch.table.ast_post_chip_2300.1(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	cmpq	(%r14), %r12
	jne	LBB0_9
## %bb.8:
	leaq	-56(%rbp), %r14
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_get_ddr3_info
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_ddr3_init
	jmp	LBB0_10
LBB0_9:
	leaq	-56(%rbp), %r14
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_get_ddr2_info
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_ddr2_init
LBB0_10:
	movq	%rbx, %rdi
	movl	$510533696, %esi                ## imm = 0x1E6E2040
	callq	_ast_mindwm
	orl	$64, %eax
	movq	%rbx, %rdi
	movl	$510533696, %esi                ## imm = 0x1E6E2040
	movl	%eax, %edx
	callq	_ast_moutdwm
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%rbx, %rdi
	movl	$208, %edx
	movl	$255, %ecx
	callq	_ast_get_index_reg_mask
	testb	$64, %al
	je	LBB0_11
## %bb.12:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AST_IO_CRTC_PORT,4,2           ## @AST_IO_CRTC_PORT
	.comm	_AST_DDR3,8,3                   ## @AST_DDR3
	.comm	_AST_DDR2,8,3                   ## @AST_DDR2
	.comm	_AST_DRAM_512Mx16,4,2           ## @AST_DRAM_512Mx16
	.comm	_AST_DRAM_1Gx16,4,2             ## @AST_DRAM_1Gx16
	.comm	_AST_DRAM_2Gx16,4,2             ## @AST_DRAM_2Gx16
	.comm	_AST_DRAM_4Gx16,4,2             ## @AST_DRAM_4Gx16
	.comm	_AST_VIDMEM_SIZE_8M,4,2         ## @AST_VIDMEM_SIZE_8M
	.comm	_AST_VIDMEM_SIZE_16M,4,2        ## @AST_VIDMEM_SIZE_16M
	.comm	_AST_VIDMEM_SIZE_32M,4,2        ## @AST_VIDMEM_SIZE_32M
	.comm	_AST_VIDMEM_SIZE_64M,4,2        ## @AST_VIDMEM_SIZE_64M
	.no_dead_strip	_ast_post_chip_2300
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.ast_post_chip_2300
l_switch.table.ast_post_chip_2300:
	.quad	_AST_DRAM_512Mx16
	.quad	_AST_DRAM_1Gx16
	.quad	_AST_DRAM_2Gx16
	.quad	_AST_DRAM_4Gx16

	.p2align	3                               ## @switch.table.ast_post_chip_2300.1
l_switch.table.ast_post_chip_2300.1:
	.quad	_AST_VIDMEM_SIZE_8M
	.quad	_AST_VIDMEM_SIZE_16M
	.quad	_AST_VIDMEM_SIZE_32M
	.quad	_AST_VIDMEM_SIZE_64M

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ast_post_chip_2300
_ast_post_chip_2300:                    ; @ast_post_chip_2300
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	ldr	x19, [x0]
Lloh0:
	adrp	x21, _AST_IO_CRTC_PORT@GOTPAGE
Lloh1:
	ldr	x21, [x21, _AST_IO_CRTC_PORT@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #208
	mov	w3, #255
	bl	_ast_get_index_reg_mask
	tbnz	w0, #7, LBB0_11
; %bb.1:
	mov	w20, #8192
	movk	w20, #1, lsl #16
	mov	x0, x19
	mov	w1, #61444
	mov	w2, #510525440
	bl	_ast_write32
	mov	x0, x19
	mov	w1, #61440
	mov	w2, #1
	bl	_ast_write32
	mov	x0, x19
	mov	w1, #8192
	movk	w1, #1, lsl #16
	mov	w2, #43176
	movk	w2, #5768, lsl #16
	bl	_ast_write32
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	w1, #8192
	movk	w1, #1, lsl #16
	bl	_ast_read32
	cmp	w0, #1
	b.ne	LBB0_2
; %bb.3:
	mov	x0, x19
	mov	w1, #65536
	mov	w2, #777
	movk	w2, #64608, lsl #16
	bl	_ast_write32
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	w1, #65536
	bl	_ast_read32
	cmp	w0, #1
	b.ne	LBB0_4
; %bb.5:
	mov	w23, #8256
	movk	w23, #7790, lsl #16
	add	w20, w20, #8
	mov	x0, x19
	mov	x1, x20
	bl	_ast_read32
	mov	w8, #115
	orr	w2, w0, w8
	mov	x0, x19
	mov	x1, x20
	bl	_ast_write32
	mov	w8, #396
	str	w8, [sp, #8]
Lloh2:
	adrp	x20, _AST_DDR3@GOTPAGE
Lloh3:
	ldr	x20, [x20, _AST_DDR3@GOTPAGEOFF]
	ldr	x22, [x20]
	str	x22, [sp, #16]
	orr	w1, w23, #0x30
	mov	x0, x19
	bl	_ast_mindwm
	tbz	w0, #24, LBB0_7
; %bb.6:
Lloh4:
	adrp	x8, _AST_DDR2@GOTPAGE
Lloh5:
	ldr	x8, [x8, _AST_DDR2@GOTPAGEOFF]
Lloh6:
	ldr	x22, [x8]
	str	x22, [sp, #16]
LBB0_7:
	ubfx	w8, w0, #27, #2
Lloh7:
	adrp	x9, l_switch.table.ast_post_chip_2300@PAGE
Lloh8:
	add	x9, x9, l_switch.table.ast_post_chip_2300@PAGEOFF
	ldr	x8, [x9, w8, uxtw #3]
	ldr	w8, [x8]
	str	w8, [sp, #28]
	ubfx	w8, w0, #2, #2
Lloh9:
	adrp	x9, l_switch.table.ast_post_chip_2300.1@PAGE
Lloh10:
	add	x9, x9, l_switch.table.ast_post_chip_2300.1@PAGEOFF
	ldr	x8, [x9, w8, uxtw #3]
	ldr	w8, [x8]
	str	w8, [sp, #24]
	ldr	x8, [x20]
	add	x1, sp, #8
	mov	x0, x19
	cmp	x22, x8
	b.ne	LBB0_9
; %bb.8:
	bl	_get_ddr3_info
	add	x1, sp, #8
	mov	x0, x19
	bl	_ddr3_init
	b	LBB0_10
LBB0_9:
	bl	_get_ddr2_info
	add	x1, sp, #8
	mov	x0, x19
	bl	_ddr2_init
LBB0_10:
	mov	x0, x19
	mov	w1, #8256
	movk	w1, #7790, lsl #16
	bl	_ast_mindwm
	orr	w2, w0, #0x40
	mov	x0, x19
	mov	w1, #8256
	movk	w1, #7790, lsl #16
	bl	_ast_moutdwm
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #208
	mov	w3, #255
	bl	_ast_get_index_reg_mask
	tbz	w0, #6, LBB0_11
; %bb.12:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_AST_IO_CRTC_PORT,4,2           ; @AST_IO_CRTC_PORT
	.comm	_AST_DDR3,8,3                   ; @AST_DDR3
	.comm	_AST_DDR2,8,3                   ; @AST_DDR2
	.comm	_AST_DRAM_512Mx16,4,2           ; @AST_DRAM_512Mx16
	.comm	_AST_DRAM_1Gx16,4,2             ; @AST_DRAM_1Gx16
	.comm	_AST_DRAM_2Gx16,4,2             ; @AST_DRAM_2Gx16
	.comm	_AST_DRAM_4Gx16,4,2             ; @AST_DRAM_4Gx16
	.comm	_AST_VIDMEM_SIZE_8M,4,2         ; @AST_VIDMEM_SIZE_8M
	.comm	_AST_VIDMEM_SIZE_16M,4,2        ; @AST_VIDMEM_SIZE_16M
	.comm	_AST_VIDMEM_SIZE_32M,4,2        ; @AST_VIDMEM_SIZE_32M
	.comm	_AST_VIDMEM_SIZE_64M,4,2        ; @AST_VIDMEM_SIZE_64M
	.no_dead_strip	_ast_post_chip_2300
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.ast_post_chip_2300
l_switch.table.ast_post_chip_2300:
	.quad	_AST_DRAM_512Mx16
	.quad	_AST_DRAM_1Gx16
	.quad	_AST_DRAM_2Gx16
	.quad	_AST_DRAM_4Gx16

	.p2align	3                               ; @switch.table.ast_post_chip_2300.1
l_switch.table.ast_post_chip_2300.1:
	.quad	_AST_VIDMEM_SIZE_8M
	.quad	_AST_VIDMEM_SIZE_16M
	.quad	_AST_VIDMEM_SIZE_32M
	.quad	_AST_VIDMEM_SIZE_64M

.subsections_via_symbols
