	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ast_detect_config_mode
_ast_detect_config_mode:                ## @ast_detect_config_mode
	.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	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	8(%rdi), %r15
	movq	8(%rax), %rdi
	movq	_ast_use_defaults@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%r15)
	movl	$-1, (%rsi)
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdx
	callq	_of_property_read_u32
	testl	%eax, %eax
	je	LBB0_11
## %bb.2:
	movq	(%rbx), %rax
LBB0_3:
	movq	(%rax), %rax
	movq	_PCI_CHIP_AST2000@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.4:
	movq	_AST_IO_CRTC_PORT@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	movl	$208, %edx
	movl	$255, %ecx
	callq	_ast_get_index_reg_mask
	movl	%eax, %ebx
	movl	(%r12), %esi
	movq	%r15, %rdi
	movl	$209, %edx
	movl	$255, %ecx
	callq	_ast_get_index_reg_mask
	testb	$-128, %bl
	je	LBB0_6
## %bb.5:
	andl	$16, %eax
	jne	LBB0_9
LBB0_6:
	movq	%r15, %rdi
	movl	$61444, %esi                    ## imm = 0xF004
	callq	_ast_read32
	cmpl	$-1, %eax
	je	LBB0_9
## %bb.7:
	movq	_ast_use_p2a@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	leaq	L_.str.2(%rip), %rdi
	callq	_DRM_INFO
	movq	%r15, %rdi
	movl	$61444, %esi                    ## imm = 0xF004
	movl	$510525440, %edx                ## imm = 0x1E6E0000
	callq	_ast_write32
	movq	%r15, %rdi
	movl	$61440, %esi                    ## imm = 0xF000
	movl	$1, %edx
	callq	_ast_write32
	movq	%r15, %rdi
	movl	$73852, %esi                    ## imm = 0x1207C
	callq	_ast_read32
	movl	%eax, (%r14)
LBB0_8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_10
LBB0_11:
	movq	_ast_use_dt@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	leaq	L_.str.1(%rip), %rdi
LBB0_10:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DRM_INFO                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ast_use_defaults,4,2           ## @ast_use_defaults
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"aspeed,scu-revision-id"

	.comm	_ast_use_dt,4,2                 ## @ast_use_dt
L_.str.1:                               ## @.str.1
	.asciz	"Using device-tree for configuration\n"

	.comm	_PCI_CHIP_AST2000,8,3           ## @PCI_CHIP_AST2000
	.comm	_AST_IO_CRTC_PORT,4,2           ## @AST_IO_CRTC_PORT
	.comm	_ast_use_p2a,4,2                ## @ast_use_p2a
L_.str.2:                               ## @.str.2
	.asciz	"Using P2A bridge for configuration\n"

L_.str.3:                               ## @.str.3
	.asciz	"P2A bridge disabled, using default configuration\n"

	.no_dead_strip	_ast_detect_config_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ast_detect_config_mode
_ast_detect_config_mode:                ; @ast_detect_config_mode
	.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, x1
	mov	x21, x0
	ldp	x8, x20, [x0]
	ldr	x0, [x8, #8]
Lloh0:
	adrp	x9, _ast_use_defaults@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ast_use_defaults@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	str	w9, [x20]
	mov	w9, #-1
	str	w9, [x1]
	cbz	x0, LBB0_3
; %bb.1:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_of_property_read_u32
	cbz	w0, LBB0_10
; %bb.2:
	ldr	x8, [x21]
LBB0_3:
	ldr	x8, [x8]
Lloh5:
	adrp	x9, _PCI_CHIP_AST2000@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PCI_CHIP_AST2000@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.4:
Lloh8:
	adrp	x22, _AST_IO_CRTC_PORT@GOTPAGE
Lloh9:
	ldr	x22, [x22, _AST_IO_CRTC_PORT@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x20
	mov	w2, #208
	mov	w3, #255
	bl	_ast_get_index_reg_mask
	mov	x21, x0
	ldr	w1, [x22]
	mov	x0, x20
	mov	w2, #209
	mov	w3, #255
	bl	_ast_get_index_reg_mask
	tbz	w21, #7, LBB0_6
; %bb.5:
	tbnz	w0, #4, LBB0_9
LBB0_6:
	mov	x0, x20
	mov	w1, #61444
	bl	_ast_read32
	cmn	w0, #1
	b.eq	LBB0_9
; %bb.7:
Lloh10:
	adrp	x8, _ast_use_p2a@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ast_use_p2a@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w8, [x20]
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_INFO
	mov	x0, x20
	mov	w1, #61444
	mov	w2, #510525440
	bl	_ast_write32
	mov	x0, x20
	mov	w1, #61440
	mov	w2, #1
	bl	_ast_write32
	mov	x0, x20
	mov	w1, #8316
	movk	w1, #1, lsl #16
	bl	_ast_read32
	str	w0, [x19]
LBB0_8:
	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_9:
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_11
LBB0_10:
Lloh17:
	adrp	x8, _ast_use_dt@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ast_use_dt@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	str	w8, [x20]
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_11:
	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	_DRM_INFO
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_ast_use_defaults,4,2           ; @ast_use_defaults
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"aspeed,scu-revision-id"

	.comm	_ast_use_dt,4,2                 ; @ast_use_dt
l_.str.1:                               ; @.str.1
	.asciz	"Using device-tree for configuration\n"

	.comm	_PCI_CHIP_AST2000,8,3           ; @PCI_CHIP_AST2000
	.comm	_AST_IO_CRTC_PORT,4,2           ; @AST_IO_CRTC_PORT
	.comm	_ast_use_p2a,4,2                ; @ast_use_p2a
l_.str.2:                               ; @.str.2
	.asciz	"Using P2A bridge for configuration\n"

l_.str.3:                               ; @.str.3
	.asciz	"P2A bridge disabled, using default configuration\n"

	.no_dead_strip	_ast_detect_config_mode
.subsections_via_symbols
