	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mga_crtc_prepare
_mga_crtc_prepare:                      ## @mga_crtc_prepare
	.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
	movq	%rdi, %r14
	movq	(%rdi), %rax
	movq	(%rax), %r15
	movq	_MGAREG_CRTC_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$17, %esi
	callq	_WREG8
	movq	_MGAREG_CRTC_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG8
	orl	$128, %eax
	movl	$17, %edi
	movl	%eax, %esi
	callq	_WREG_CRT
	movq	(%r15), %rax
	movq	_G200_SE_A@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_2
## %bb.1:
	movq	_G200_SE_B@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_2
## %bb.3:
	movq	_MGAREG_SEQ_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	callq	_WREG8
	movq	_MGAREG_SEQ_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG8
	movl	%eax, %ebx
	xorl	%edi, %edi
	movl	$1, %esi
	callq	_WREG_SEQ
	orl	$32, %ebx
	movl	$1, %edi
	movl	%ebx, %esi
	callq	_WREG_SEQ
	jmp	LBB0_4
LBB0_2:
	xorl	%edi, %edi
	movl	$1, %esi
	callq	_WREG_SEQ
	movl	$50, %edi
	callq	_msleep
	movl	$1, %edi
	movl	$32, %esi
	callq	_WREG_SEQ
	movl	$20, %edi
	callq	_msleep
LBB0_4:
	movq	(%r15), %rax
	movq	_G200_WB@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_6
## %bb.5:
	movq	_G200_EW3@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
LBB0_6:
	movq	%r14, %rdi
	callq	_mga_g200wb_prepare
LBB0_7:
	movl	$17, %edi
	xorl	%esi, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_WREG_CRT                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MGAREG_CRTC_INDEX,4,2          ## @MGAREG_CRTC_INDEX
	.comm	_MGAREG_CRTC_DATA,4,2           ## @MGAREG_CRTC_DATA
	.comm	_G200_SE_A,8,3                  ## @G200_SE_A
	.comm	_G200_SE_B,8,3                  ## @G200_SE_B
	.comm	_MGAREG_SEQ_INDEX,4,2           ## @MGAREG_SEQ_INDEX
	.comm	_MGAREG_SEQ_DATA,4,2            ## @MGAREG_SEQ_DATA
	.comm	_G200_WB,8,3                    ## @G200_WB
	.comm	_G200_EW3,8,3                   ## @G200_EW3
	.no_dead_strip	_mga_crtc_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mga_crtc_prepare
_mga_crtc_prepare:                      ; @mga_crtc_prepare
	.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
	ldr	x8, [x0]
	ldr	x21, [x8]
Lloh0:
	adrp	x8, _MGAREG_CRTC_INDEX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MGAREG_CRTC_INDEX@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	mov	w1, #17
	bl	_WREG8
Lloh3:
	adrp	x8, _MGAREG_CRTC_DATA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MGAREG_CRTC_DATA@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_RREG8
	orr	w1, w0, #0x80
	mov	w0, #17
	bl	_WREG_CRT
	ldr	x8, [x21]
Lloh6:
	adrp	x9, _G200_SE_A@GOTPAGE
Lloh7:
	ldr	x9, [x9, _G200_SE_A@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
Lloh9:
	adrp	x10, _G200_SE_B@GOTPAGE
Lloh10:
	ldr	x10, [x10, _G200_SE_B@GOTPAGEOFF]
Lloh11:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_2
; %bb.1:
	mov	w0, #0
	mov	w1, #1
	bl	_WREG_SEQ
	mov	w0, #50
	bl	_msleep
	mov	w0, #1
	mov	w1, #32
	bl	_WREG_SEQ
	mov	w0, #20
	bl	_msleep
	b	LBB0_3
LBB0_2:
Lloh12:
	adrp	x8, _MGAREG_SEQ_INDEX@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MGAREG_SEQ_INDEX@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	mov	w1, #1
	bl	_WREG8
Lloh15:
	adrp	x8, _MGAREG_SEQ_DATA@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MGAREG_SEQ_DATA@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	bl	_RREG8
	mov	x20, x0
	mov	w0, #0
	mov	w1, #1
	bl	_WREG_SEQ
	orr	w1, w20, #0x20
	mov	w0, #1
	bl	_WREG_SEQ
LBB0_3:
	ldr	x8, [x21]
Lloh18:
	adrp	x9, _G200_WB@GOTPAGE
Lloh19:
	ldr	x9, [x9, _G200_WB@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
Lloh21:
	adrp	x10, _G200_EW3@GOTPAGE
Lloh22:
	ldr	x10, [x10, _G200_EW3@GOTPAGEOFF]
Lloh23:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_mga_g200wb_prepare
LBB0_5:
	mov	w0, #17
	mov	w1, #0
	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	_WREG_CRT
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_MGAREG_CRTC_INDEX,4,2          ; @MGAREG_CRTC_INDEX
	.comm	_MGAREG_CRTC_DATA,4,2           ; @MGAREG_CRTC_DATA
	.comm	_G200_SE_A,8,3                  ; @G200_SE_A
	.comm	_G200_SE_B,8,3                  ; @G200_SE_B
	.comm	_MGAREG_SEQ_INDEX,4,2           ; @MGAREG_SEQ_INDEX
	.comm	_MGAREG_SEQ_DATA,4,2            ; @MGAREG_SEQ_DATA
	.comm	_G200_WB,8,3                    ; @G200_WB
	.comm	_G200_EW3,8,3                   ; @G200_EW3
	.no_dead_strip	_mga_crtc_prepare
.subsections_via_symbols
