	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ast_crtc_mode_set
_ast_crtc_mode_set:                     ## @ast_crtc_mode_set
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	(%rdi), %r14
	movq	(%r14), %rbx
	movq	(%rbx), %rax
	movq	_AST1180@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_3
LBB0_2:
	movq	%r9, %r15
	movq	%rdi, %r12
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%r8d, -56(%rbp)                 ## 4-byte Spill
	leaq	-48(%rbp), %rcx
	movq	%r13, %rdx
	callq	_ast_get_vbios_mode_info
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movq	%rbx, %rdi
	callq	_ast_open_key
	movq	_AST_IO_CRTC_PORT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$161, %edx
	movl	$6, %ecx
	callq	_ast_set_index_reg
	movq	%r15, %rbx
	leaq	-48(%rbp), %r15
	movq	%r12, %rdi
	movq	%r13, %rsi
	movq	%r15, %rdx
	callq	_ast_set_std_reg
	movq	%r12, %rdi
	movq	%r13, %rsi
	movq	%r15, %rdx
	callq	_ast_set_crtc_reg
	movq	%r12, %rdi
	callq	_ast_set_offset_reg
	movq	%r14, %rdi
	movq	%r13, %rsi
	movq	%r15, %rdx
	callq	_ast_set_dclk_reg
	movq	%r12, %rdi
	movq	%r13, %rsi
	movq	%r15, %rdx
	callq	_ast_set_ext_reg
	movq	%r14, %rdi
	movq	%r13, %rsi
	movq	%r15, %rdx
	callq	_ast_set_sync_reg
	movq	%r12, %rdi
	movq	%r13, %rsi
	movq	%r15, %rdx
	callq	_ast_set_dac_reg
	movq	%r12, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	movq	%rbx, %rcx
	callq	_ast_crtc_mode_set_base
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_5:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AST1180,8,3                    ## @AST1180
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"AST 1180 modesetting not supported\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AST_IO_CRTC_PORT,4,2           ## @AST_IO_CRTC_PORT
	.no_dead_strip	_ast_crtc_mode_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ast_crtc_mode_set
_ast_crtc_mode_set:                     ; @ast_crtc_mode_set
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	ldr	x24, [x0]
	ldr	x25, [x24]
	ldr	x8, [x25]
Lloh0:
	adrp	x9, _AST1180@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AST1180@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_4
LBB0_2:
	mov	x19, x5
	mov	x20, x4
	mov	x21, x3
	mov	x23, x2
	mov	x22, x0
	add	x3, sp, #8
	bl	_ast_get_vbios_mode_info
	cbz	w0, LBB0_4
; %bb.3:
	mov	x0, x25
	bl	_ast_open_key
Lloh5:
	adrp	x8, _AST_IO_CRTC_PORT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AST_IO_CRTC_PORT@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x25
	mov	w2, #161
	mov	w3, #6
	bl	_ast_set_index_reg
	add	x2, sp, #8
	mov	x0, x22
	mov	x1, x23
	bl	_ast_set_std_reg
	add	x2, sp, #8
	mov	x0, x22
	mov	x1, x23
	bl	_ast_set_crtc_reg
	mov	x0, x22
	bl	_ast_set_offset_reg
	add	x2, sp, #8
	mov	x0, x24
	mov	x1, x23
	bl	_ast_set_dclk_reg
	add	x2, sp, #8
	mov	x0, x22
	mov	x1, x23
	bl	_ast_set_ext_reg
	add	x2, sp, #8
	mov	x0, x24
	mov	x1, x23
	bl	_ast_set_sync_reg
	add	x2, sp, #8
	mov	x0, x22
	mov	x1, x23
	bl	_ast_set_dac_reg
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	x3, x19
	bl	_ast_crtc_mode_set_base
	mov	w0, #0
	b	LBB0_5
LBB0_4:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_AST1180,8,3                    ; @AST1180
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"AST 1180 modesetting not supported\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AST_IO_CRTC_PORT,4,2           ; @AST_IO_CRTC_PORT
	.no_dead_strip	_ast_crtc_mode_set
.subsections_via_symbols
