	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ast_init_dram_reg
_ast_init_dram_reg:                     ## @ast_init_dram_reg
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r12
	movq	_AST_IO_CRTC_PORT@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r12, %rdi
	movl	$208, %edx
	movl	$255, %ecx
	callq	_ast_get_index_reg_mask
	testb	$-128, %al
	jne	LBB0_31
## %bb.1:
	movl	(%r12), %ecx
	movq	_ast2100_dram_table_data@GOTPCREL(%rip), %rax
	cmpl	$130, %ecx
	je	LBB0_7
## %bb.2:
	cmpl	$2200, %ecx                     ## imm = 0x898
	je	LBB0_7
## %bb.3:
	cmpl	$131, %ecx
	jne	LBB0_6
## %bb.4:
	movq	_ast2000_dram_table_data@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%r12, %rdi
	movl	$61444, %esi                    ## imm = 0xF004
	movl	$510525440, %edx                ## imm = 0x1E6E0000
	callq	_ast_write32
	movq	%r12, %rdi
	movl	$61440, %esi                    ## imm = 0xF000
	movl	$1, %edx
	callq	_ast_write32
	movq	%r12, %rdi
	movl	$65792, %esi                    ## imm = 0x10100
	movl	$168, %edx
	callq	_ast_write32
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	$65792, %esi                    ## imm = 0x10100
	callq	_ast_read32
	cmpl	$168, %eax
	jne	LBB0_5
	jmp	LBB0_11
LBB0_6:
	movq	_ast1100_dram_table_data@GOTPCREL(%rip), %rax
LBB0_7:
	movq	(%rax), %rbx
	movq	%r12, %rdi
	movl	$61444, %esi                    ## imm = 0xF004
	movl	$510525440, %edx                ## imm = 0x1E6E0000
	callq	_ast_write32
	movq	%r12, %rdi
	movl	$61440, %esi                    ## imm = 0xF000
	movl	$1, %edx
	callq	_ast_write32
	movq	%r12, %rdi
	movl	$73728, %esi                    ## imm = 0x12000
	movl	$378054824, %edx                ## imm = 0x1688A8A8
	callq	_ast_write32
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	$73728, %esi                    ## imm = 0x12000
	callq	_ast_read32
	cmpl	$1, %eax
	jne	LBB0_8
## %bb.9:
	movq	%r12, %rdi
	movl	$65536, %esi                    ## imm = 0x10000
	movl	$-60816631, %edx                ## imm = 0xFC600309
	callq	_ast_write32
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	$65536, %esi                    ## imm = 0x10000
	callq	_ast_read32
	cmpl	$1, %eax
	jne	LBB0_10
LBB0_11:
	addq	$4, %rbx
	movl	$65536, %r13d                   ## imm = 0x10000
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_12 Depth=1
	movl	(%rbx), %edi
	callq	_udelay
	movl	(%rbx), %edi
	callq	_udelay
	movl	(%rbx), %edi
	callq	_udelay
	movl	(%rbx), %edi
	callq	_udelay
	movl	(%rbx), %edi
	callq	_udelay
	movl	(%rbx), %edi
	callq	_udelay
	movl	(%rbx), %edi
	callq	_udelay
	movl	(%rbx), %edi
	callq	_udelay
	movl	(%rbx), %edi
	callq	_udelay
	movl	(%rbx), %edi
	callq	_udelay
	movl	(%rbx), %edi
	callq	_udelay
	movl	(%rbx), %edi
	callq	_udelay
	movl	(%rbx), %edi
	callq	_udelay
	movl	(%rbx), %edi
	callq	_udelay
	movl	(%rbx), %edi
	callq	_udelay
	addq	$8, %rbx
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	-4(%rbx), %esi
	cmpl	$4, %esi
	je	LBB0_17
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	cmpl	$65280, %esi                    ## imm = 0xFF00
	je	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	cmpl	$65535, %esi                    ## imm = 0xFFFF
	jne	LBB0_15
	jmp	LBB0_23
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_12 Depth=1
	cmpl	$131, (%r12)
	jne	LBB0_18
LBB0_15:                                ##   in Loop: Header=BB0_12 Depth=1
	addl	$65536, %esi                    ## imm = 0x10000
	movl	(%rbx), %edx
	jmp	LBB0_22
LBB0_18:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	8(%r12), %rax
	movl	$3465, %r14d                    ## imm = 0xD89
	movq	_AST_DRAM_1Gx16@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_21
## %bb.19:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	$3213, %r14d                    ## imm = 0xC8D
	movq	_AST_DRAM_1Gx32@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	(%rbx), %r14d
LBB0_21:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	%r12, %rdi
	movl	$73840, %esi                    ## imm = 0x12070
	callq	_ast_read32
                                        ## kill: def $eax killed $eax def $rax
	leal	(,%rax,4), %edx
	andl	$48, %edx
	orl	%r14d, %edx
	movl	-4(%rbx), %esi
	addl	%r13d, %esi
LBB0_22:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	%r12, %rdi
	callq	_ast_write32
	addq	$8, %rbx
	jmp	LBB0_12
LBB0_23:
	movq	%r12, %rdi
	movl	$65824, %esi                    ## imm = 0x10120
	callq	_ast_read32
	cmpl	$20577, %eax                    ## imm = 0x5061
	jne	LBB0_25
## %bb.24:
	movq	%r12, %rdi
	movl	$65540, %esi                    ## imm = 0x10004
	callq	_ast_read32
	xorl	%esi, %esi
	testb	$64, %al
	sete	%sil
	shll	$4, %esi
	addl	$16, %esi
	movq	%r12, %rdi
	callq	_cbrdlli_ast2150
LBB0_25:
	movl	(%r12), %eax
	leal	-128(%rax), %ecx
	cmpl	$3, %ecx
	jb	LBB0_29
## %bb.26:
	cmpl	$131, %eax
	je	LBB0_27
## %bb.28:
	cmpl	$132, %eax
	jne	LBB0_31
LBB0_29:
	movq	%r12, %rdi
	movl	$73740, %esi                    ## imm = 0x1200C
	callq	_ast_read32
	andl	$-3, %eax
	movq	%r12, %rdi
	movl	$73740, %esi                    ## imm = 0x1200C
	movl	%eax, %edx
	callq	_ast_write32
	movl	$73792, %r14d                   ## imm = 0x12040
	jmp	LBB0_30
LBB0_27:
	movl	$65856, %r14d                   ## imm = 0x10140
LBB0_30:
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_ast_read32
	orl	$64, %eax
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_ast_write32
	.p2align	4, 0x90
LBB0_31:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%r12, %rdi
	movl	$208, %edx
	movl	$255, %ecx
	callq	_ast_get_index_reg_mask
	testb	$64, %al
	je	LBB0_31
## %bb.32:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AST_IO_CRTC_PORT,4,2           ## @AST_IO_CRTC_PORT
	.comm	_ast2000_dram_table_data,8,3    ## @ast2000_dram_table_data
	.comm	_ast2100_dram_table_data,8,3    ## @ast2100_dram_table_data
	.comm	_ast1100_dram_table_data,8,3    ## @ast1100_dram_table_data
	.comm	_AST_DRAM_1Gx16,8,3             ## @AST_DRAM_1Gx16
	.comm	_AST_DRAM_1Gx32,8,3             ## @AST_DRAM_1Gx32
	.no_dead_strip	_ast_init_dram_reg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ast_init_dram_reg
_ast_init_dram_reg:                     ; @ast_init_dram_reg
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	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_31
; %bb.1:
	mov	w22, #8192
	movk	w22, #1, lsl #16
	ldr	w9, [x19]
Lloh2:
	adrp	x8, _ast2100_dram_table_data@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ast2100_dram_table_data@GOTPAGEOFF]
	cmp	w9, #130
	b.eq	LBB0_7
; %bb.2:
	cmp	w9, #2200
	b.eq	LBB0_7
; %bb.3:
	cmp	w9, #131
	b.ne	LBB0_6
; %bb.4:
Lloh4:
	adrp	x8, _ast2000_dram_table_data@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ast2000_dram_table_data@GOTPAGEOFF]
Lloh6:
	ldr	x24, [x8]
	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, #256
	movk	w1, #1, lsl #16
	mov	w2, #168
	bl	_ast_write32
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	w1, #256
	movk	w1, #1, lsl #16
	bl	_ast_read32
	cmp	w0, #168
	b.ne	LBB0_5
	b	LBB0_11
LBB0_6:
Lloh7:
	adrp	x8, _ast1100_dram_table_data@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ast1100_dram_table_data@GOTPAGEOFF]
LBB0_7:
	ldr	x24, [x8]
	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_8:                                 ; =>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_8
; %bb.9:
	mov	x0, x19
	mov	w1, #65536
	mov	w2, #777
	movk	w2, #64608, lsl #16
	bl	_ast_write32
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	w1, #65536
	bl	_ast_read32
	cmp	w0, #1
	b.ne	LBB0_10
LBB0_11:
Lloh9:
	adrp	x23, _AST_DRAM_1Gx16@GOTPAGE
Lloh10:
	ldr	x23, [x23, _AST_DRAM_1Gx16@GOTPAGEOFF]
	add	x24, x24, #4
Lloh11:
	adrp	x25, _AST_DRAM_1Gx32@GOTPAGE
Lloh12:
	ldr	x25, [x25, _AST_DRAM_1Gx32@GOTPAGEOFF]
	mov	w26, #3213
	mov	w27, #65280
	mov	w28, #65535
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	w0, [x24]
	bl	_udelay
	ldr	w0, [x24]
	bl	_udelay
	ldr	w0, [x24]
	bl	_udelay
	ldr	w0, [x24]
	bl	_udelay
	ldr	w0, [x24]
	bl	_udelay
	ldr	w0, [x24]
	bl	_udelay
	ldr	w0, [x24]
	bl	_udelay
	ldr	w0, [x24]
	bl	_udelay
	ldr	w0, [x24]
	bl	_udelay
	ldr	w0, [x24]
	bl	_udelay
	ldr	w0, [x24]
	bl	_udelay
	ldr	w0, [x24]
	bl	_udelay
	ldr	w0, [x24]
	bl	_udelay
	ldr	w0, [x24]
	bl	_udelay
	ldr	w0, [x24], #8
	bl	_udelay
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldur	w8, [x24, #-4]
	cmp	w8, #4
	b.eq	LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	cmp	w8, w27
	b.eq	LBB0_12
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	cmp	w8, w28
	b.ne	LBB0_17
	b	LBB0_23
LBB0_16:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	w9, [x19]
	cmp	w9, #131
	b.ne	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_13 Depth=1
	add	w1, w8, #16, lsl #12            ; =65536
	ldr	w2, [x24]
	b	LBB0_22
LBB0_18:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	x8, [x19, #8]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	w20, #3465
	b	LBB0_21
LBB0_20:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	w9, [x24]
	ldr	x10, [x25]
	cmp	x8, x10
	csel	w20, w26, w9, eq
LBB0_21:                                ;   in Loop: Header=BB0_13 Depth=1
	add	w1, w22, #112
	mov	x0, x19
	bl	_ast_read32
	lsl	w8, w0, #2
	and	w8, w8, #0x30
	ldur	w9, [x24, #-4]
	add	w1, w9, #16, lsl #12            ; =65536
	orr	w2, w8, w20
LBB0_22:                                ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x19
	bl	_ast_write32
	add	x24, x24, #8
	b	LBB0_13
LBB0_23:
	mov	w20, #256
	movk	w20, #1, lsl #16
	add	w1, w20, #32
	mov	x0, x19
	bl	_ast_read32
	mov	w8, #20577
	cmp	w0, w8
	b.ne	LBB0_25
; %bb.24:
	sub	w1, w20, #252
	mov	x0, x19
	bl	_ast_read32
	tst	w0, #0x40
	mov	w8, #16
	mov	w9, #32
	csel	w1, w9, w8, eq
	mov	x0, x19
	bl	_cbrdlli_ast2150
LBB0_25:
	ldr	w8, [x19]
	sub	w9, w8, #128
	cmp	w9, #3
	b.lo	LBB0_28
; %bb.26:
	cmp	w8, #131
	b.eq	LBB0_29
; %bb.27:
	cmp	w8, #132
	b.ne	LBB0_31
LBB0_28:
	add	w20, w22, #12
	mov	x0, x19
	mov	x1, x20
	bl	_ast_read32
	and	w2, w0, #0xfffffffd
	mov	x0, x19
	mov	x1, x20
	bl	_ast_write32
	add	w20, w22, #64
	b	LBB0_30
LBB0_29:
	add	w20, w20, #64
LBB0_30:
	mov	x0, x19
	mov	x1, x20
	bl	_ast_read32
	orr	w2, w0, #0x40
	mov	x0, x19
	mov	x1, x20
	bl	_ast_write32
LBB0_31:                                ; =>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_31
; %bb.32:
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_AST_IO_CRTC_PORT,4,2           ; @AST_IO_CRTC_PORT
	.comm	_ast2000_dram_table_data,8,3    ; @ast2000_dram_table_data
	.comm	_ast2100_dram_table_data,8,3    ; @ast2100_dram_table_data
	.comm	_ast1100_dram_table_data,8,3    ; @ast1100_dram_table_data
	.comm	_AST_DRAM_1Gx16,8,3             ; @AST_DRAM_1Gx16
	.comm	_AST_DRAM_1Gx32,8,3             ; @AST_DRAM_1Gx32
	.no_dead_strip	_ast_init_dram_reg
.subsections_via_symbols
