	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mga_crtc_mode_set
_mga_crtc_mode_set:                     ## @mga_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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %rax
	movq	8(%rdi), %rsi
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	8(%rsi), %r13
	movq	(%rax), %rax
	movq	(%r13), %rsi
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	8(%rax), %r10
	movq	(%r10), %rax
	movslq	(%rax), %rax
	movl	-4(%rsi,%rax,4), %esi
	movl	%esi, -72(%rbp)                 ## 4-byte Spill
	movl	8(%r13), %ebx
	addl	$-128, %ebx
	xorl	%r11d, %r11d
	movb	$1, %r15b
	cmpl	$7, %ebx
	movl	%r8d, -108(%rbp)                ## 4-byte Spill
	movq	%r9, -144(%rbp)                 ## 8-byte Spill
	movl	%ecx, -104(%rbp)                ## 4-byte Spill
	movq	%rdi, -136(%rbp)                ## 8-byte Spill
	movq	%rdx, -128(%rbp)                ## 8-byte Spill
	ja	LBB0_1
## %bb.2:
	leaq	LJTI0_0(%rip), %rsi
	movslq	(%rsi,%rbx,4), %rdx
	addq	%rsi, %rdx
	xorl	%r14d, %r14d
	jmpq	*%rdx
LBB0_4:
	movq	_MGA1064_VREF_CTL@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	leaq	_mga_crtc_mode_set.dacvalue(%rip), %rsi
	movb	$7, (%rdx,%rsi)
	movl	$1090818336, %r14d              ## imm = 0x41049120
	jmp	LBB0_8
LBB0_3:
	movq	_MGA1064_VREF_CTL@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	leaq	_mga_crtc_mode_set.dacvalue(%rip), %rsi
	movb	$3, (%rdx,%rsi)
	movq	_MGA1064_PIX_CLK_CTL_SEL_PLL@GOTPCREL(%rip), %rdx
	movb	(%rdx), %dl
	movq	_MGA1064_MISC_CTL_VGA8@GOTPCREL(%rip), %rdi
	movb	(%rdi), %bl
	movq	_MGA1064_MISC_CTL_DAC_EN@GOTPCREL(%rip), %rdi
	orb	(%rdi), %bl
	movq	_MGA1064_MISC_CTL_DAC_RAM_CS@GOTPCREL(%rip), %rdi
	orb	(%rdi), %bl
	movq	_MGA1064_PIX_CLK_CTL@GOTPCREL(%rip), %rdi
	movq	(%rdi), %rdi
	movb	%dl, (%rdi,%rsi)
	movq	_MGA1064_MISC_CTL@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movb	%bl, (%rdx,%rsi)
	xorl	%r14d, %r14d
	cmpl	$0, 20(%r13)
	sete	%r14b
	shll	$14, %r14d
	orl	$1074041120, %r14d              ## imm = 0x40049120
	movl	$32768, %r11d                   ## imm = 0x8000
	jmp	LBB0_9
LBB0_6:
	movq	_MGA1064_MISC_CTL_VGA8@GOTPCREL(%rip), %rdx
	movq	_MGA1064_MISC_CTL_DAC_RAM_CS@GOTPCREL(%rip), %rsi
	movb	(%rsi), %bl
	orb	(%rdx), %bl
	movq	_MGA1064_MISC_CTL@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	leaq	_mga_crtc_mode_set.dacvalue(%rip), %rsi
	movb	%bl, (%rdx,%rsi)
	jmp	LBB0_7
LBB0_5:
	movq	_MGA1064_PIX_CLK_CTL_SEL_PLL@GOTPCREL(%rip), %rdx
	movb	(%rdx), %dl
	movq	_MGA1064_PIX_CLK_CTL@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	leaq	_mga_crtc_mode_set.dacvalue(%rip), %rdi
	movb	%dl, (%rsi,%rdi)
	movq	_MGA1064_MISC_CTL_VGA8@GOTPCREL(%rip), %rdx
	movq	_MGA1064_MISC_CTL_DAC_RAM_CS@GOTPCREL(%rip), %rsi
	movb	(%rsi), %bl
	orb	(%rdx), %bl
	movq	_MGA1064_MISC_CTL@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movb	%bl, (%rdx,%rdi)
LBB0_7:
	movl	$288, %r14d                     ## imm = 0x120
LBB0_8:
	movl	$45056, %r11d                   ## imm = 0xB000
LBB0_9:
	xorl	%r15d, %r15d
LBB0_10:
	leal	-1(%rax), %edx
	andl	$536870911, %edx                ## imm = 0x1FFFFFFF
	cmpl	$3, %edx
	ja	LBB0_18
## %bb.11:
	movq	_MGA1064_MUL_CTL_8bits@GOTPCREL(%rip), %rcx
	leaq	LJTI0_1(%rip), %rsi
	movslq	(%rsi,%rdx,4), %rdx
	addq	%rsi, %rdx
	jmpq	*%rdx
LBB0_12:
	cmpl	$15, 8(%r10)
	jne	LBB0_13
## %bb.14:
	movq	_MGA1064_MUL_CTL_15bits@GOTPCREL(%rip), %rcx
	jmp	LBB0_17
LBB0_15:
	movq	_MGA1064_MUL_CTL_24bits@GOTPCREL(%rip), %rcx
	jmp	LBB0_17
LBB0_16:
	movq	_MGA1064_MUL_CTL_32_24bits@GOTPCREL(%rip), %rcx
	jmp	LBB0_17
LBB0_13:
	movq	_MGA1064_MUL_CTL_16bits@GOTPCREL(%rip), %rcx
LBB0_17:
	movb	(%rcx), %al
	movq	_MGA1064_MUL_CTL@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	leaq	_mga_crtc_mode_set.dacvalue(%rip), %rdx
	movb	%al, (%rcx,%rdx)
LBB0_18:
	movl	%r15d, -80(%rbp)                ## 4-byte Spill
	movl	%r11d, -44(%rbp)                ## 4-byte Spill
	xorl	%ebx, %ebx
	leaq	_mga_crtc_mode_set.dacvalue(%rip), %r12
	movl	$153, %r15d
	jmp	LBB0_19
LBB0_32:                                ##   in Loop: Header=BB0_19 Depth=1
	movzbl	(%rbx,%r12), %esi
	movl	%ebx, %edi
	callq	_WREG_DAC
	.p2align	4, 0x90
LBB0_33:                                ##   in Loop: Header=BB0_19 Depth=1
	incq	%rbx
	cmpq	$80, %rbx
	je	LBB0_34
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	cmpq	$24, %rbx
	jb	LBB0_33
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=1
	leal	-27(%rbx), %eax
	cmpl	$2, %eax
	jb	LBB0_33
## %bb.21:                              ##   in Loop: Header=BB0_19 Depth=1
	leal	-31(%rbx), %eax
	cmpl	$11, %eax
	jb	LBB0_33
## %bb.22:                              ##   in Loop: Header=BB0_19 Depth=1
	movl	%ebx, %eax
	andl	$2147483640, %eax               ## imm = 0x7FFFFFF8
	cmpl	$48, %eax
	je	LBB0_33
## %bb.23:                              ##   in Loop: Header=BB0_19 Depth=1
	movq	%r13, %rdi
	callq	_IS_G200_SE
	testq	%rax, %rax
	je	LBB0_26
## %bb.24:                              ##   in Loop: Header=BB0_19 Depth=1
	cmpq	$46, %rbx
	je	LBB0_33
## %bb.25:                              ##   in Loop: Header=BB0_19 Depth=1
	movl	%ebx, %eax
	andl	$2147483646, %eax               ## imm = 0x7FFFFFFE
	cmpl	$44, %eax
	je	LBB0_33
LBB0_26:                                ##   in Loop: Header=BB0_19 Depth=1
	movl	8(%r13), %eax
	leal	-128(%rax), %ecx
	cmpl	$7, %ecx
	ja	LBB0_28
## %bb.27:                              ##   in Loop: Header=BB0_19 Depth=1
	btl	%ecx, %r15d
	jae	LBB0_28
## %bb.31:                              ##   in Loop: Header=BB0_19 Depth=1
	leal	-68(%rbx), %eax
	cmpl	$11, %eax
	jae	LBB0_32
	jmp	LBB0_33
LBB0_28:                                ##   in Loop: Header=BB0_19 Depth=1
	cmpl	$134, %eax
	jne	LBB0_32
## %bb.29:                              ##   in Loop: Header=BB0_19 Depth=1
	cmpq	$68, %rbx
	jb	LBB0_32
## %bb.30:                              ##   in Loop: Header=BB0_19 Depth=1
	cmpq	$79, %rbx
	jb	LBB0_33
	jmp	LBB0_32
LBB0_34:
	cmpl	$133, 8(%r13)
	jne	LBB0_36
## %bb.35:
	movl	$144, %edi
	xorl	%esi, %esi
	callq	_WREG_DAC
LBB0_36:
	testl	%r14d, %r14d
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	je	LBB0_38
## %bb.37:
	movl	(%rbx), %edi
	movq	_PCI_MGA_OPTION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edx
	callq	_pci_write_config_dword
LBB0_38:
	cmpb	$0, -80(%rbp)                   ## 1-byte Folded Reload
	jne	LBB0_40
## %bb.39:
	movl	(%rbx), %edi
	movq	_PCI_MGA_OPTION2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edx
	callq	_pci_write_config_dword
LBB0_40:
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movl	$2, %edi
	movl	$15, %esi
	callq	_WREG_SEQ
	movl	$3, %edi
	xorl	%esi, %esi
	callq	_WREG_SEQ
	movl	$4, %edi
	movl	$14, %esi
	callq	_WREG_SEQ
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rax
	movq	8(%rcx), %rcx
	movl	(%rax), %eax
	movq	(%rcx), %rcx
	movl	(%rcx), %ecx
	cltd
	idivl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	cmpl	$3, %ecx
	leal	(%rax,%rax,2), %edx
	cmovnel	%eax, %edx
	movb	$4, %cl
	subb	-72(%rbp), %cl                  ## 1-byte Folded Reload
	sarl	%cl, %edx
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	4(%rdx), %eax
	movl	8(%rdx), %ecx
	leal	7(%rax), %r13d
	testl	%eax, %eax
	cmovnsl	%eax, %r13d
	sarl	$3, %r13d
	decl	%r13d
	leal	7(%rcx), %r15d
	testl	%ecx, %ecx
	cmovnsl	%ecx, %r15d
	sarl	$3, %r15d
	decl	%r15d
	movl	12(%rdx), %eax
	leal	7(%rax), %ebx
	testl	%eax, %eax
	cmovnsl	%eax, %ebx
	sarl	$3, %ebx
	addl	$31, %ebx
	movl	16(%rdx), %ecx
	leal	7(%rcx), %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	sarl	$3, %eax
	leal	-1(%rax), %r12d
	movl	%r12d, %ecx
	orl	$2, %ecx
	andl	$7, %ecx
	cmpl	$6, %ecx
	jne	LBB0_42
## %bb.41:
	movl	%eax, %r12d
LBB0_42:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	20(%rax), %r14d
	movl	24(%rax), %ecx
	decl	%r14d
	decl	%ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	28(%rax), %ecx
	decl	%ecx
	movl	%ecx, -96(%rbp)                 ## 4-byte Spill
	movl	32(%rax), %eax
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	addl	$-2, %eax
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	xorl	%edi, %edi
	xorl	%esi, %esi
	callq	_WREG_GFX
	movl	$1, %edi
	xorl	%esi, %esi
	callq	_WREG_GFX
	movl	$2, %edi
	xorl	%esi, %esi
	callq	_WREG_GFX
	movl	$3, %edi
	xorl	%esi, %esi
	callq	_WREG_GFX
	movl	$4, %edi
	xorl	%esi, %esi
	callq	_WREG_GFX
	movl	$5, %edi
	movl	$64, %esi
	callq	_WREG_GFX
	movl	$6, %edi
	movl	$5, %esi
	callq	_WREG_GFX
	movl	$7, %edi
	movl	$15, %esi
	callq	_WREG_GFX
	movl	$8, %edi
	movl	$15, %esi
	callq	_WREG_GFX
	leal	-4(%r12), %esi
	movl	%esi, -100(%rbp)                ## 4-byte Spill
	xorl	%edi, %edi
	callq	_WREG_CRT
	movl	$1, %edi
	movl	%r13d, %esi
	callq	_WREG_CRT
	movl	$2, %edi
	movl	%r13d, %esi
	callq	_WREG_CRT
	movl	%r12d, %esi
	andl	$31, %esi
	orl	$128, %esi
	movl	$3, %edi
	callq	_WREG_CRT
	movl	$4, %edi
	movl	%r15d, %esi
	callq	_WREG_CRT
	movl	%r12d, %eax
	andl	$32, %eax
	andl	$31, %ebx
	leal	(%rbx,%rax,4), %esi
	movl	$5, %edi
	callq	_WREG_CRT
	movl	-68(%rbp), %ebx                 ## 4-byte Reload
	movzbl	%bl, %esi
	movl	$6, %edi
	callq	_WREG_CRT
	movl	%ebx, %ecx
	shrl	$8, %ecx
	andl	$1, %ecx
	movl	%r14d, %esi
	andl	$256, %esi                      ## imm = 0x100
	movl	%esi, %edx
	shrl	$7, %edx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movl	%r8d, %eax
	shrl	$6, %eax
	andl	$4, %eax
	movl	%esi, %edi
	shrl	$5, %edi
	orl	%edx, %edi
	shrl	$4, %esi
	orl	%edi, %esi
	movl	%ebx, %edx
	shrl	$4, %edx
	andl	$32, %edx
	orl	%ecx, %edx
	movl	%r14d, %ebx
	andl	$512, %ebx                      ## imm = 0x200
	movl	%r13d, -92(%rbp)                ## 4-byte Spill
	movq	%r12, %r13
	movl	%ebx, %r12d
	shrl	$3, %r12d
	movl	%r8d, %ecx
	shrl	$2, %ecx
	andl	$128, %ecx
	orl	%r12d, %esi
	orl	%eax, %esi
	orl	%ecx, %esi
	orl	%edx, %esi
	movl	$7, %edi
	callq	_WREG_CRT
	shrl	$4, %ebx
	orl	%r12d, %ebx
	movl	$9, %edi
	movl	%ebx, %esi
	callq	_WREG_CRT
	movl	$10, %edi
	xorl	%esi, %esi
	callq	_WREG_CRT
	movl	$11, %edi
	xorl	%esi, %esi
	callq	_WREG_CRT
	movl	$12, %edi
	xorl	%esi, %esi
	callq	_WREG_CRT
	movl	$13, %edi
	xorl	%esi, %esi
	callq	_WREG_CRT
	movl	$14, %edi
	xorl	%esi, %esi
	callq	_WREG_CRT
	movl	$15, %edi
	xorl	%esi, %esi
	callq	_WREG_CRT
	movzbl	-44(%rbp), %esi                 ## 1-byte Folded Reload
	movl	$16, %edi
	callq	_WREG_CRT
	movl	-96(%rbp), %esi                 ## 4-byte Reload
	andl	$15, %esi
	orl	$32, %esi
	movl	$17, %edi
	callq	_WREG_CRT
	movzbl	%r14b, %r12d
	movl	$18, %edi
	movl	%r12d, %esi
	callq	_WREG_CRT
	movl	-56(%rbp), %ebx                 ## 4-byte Reload
	movzbl	%bl, %esi
	movl	$19, %edi
	callq	_WREG_CRT
	movl	$20, %edi
	xorl	%esi, %esi
	callq	_WREG_CRT
	movl	$21, %edi
	movl	%r12d, %esi
	callq	_WREG_CRT
	movq	-120(%rbp), %rax                ## 8-byte Reload
	decl	%eax
	movzbl	%al, %esi
	movl	$22, %edi
	callq	_WREG_CRT
	movl	$23, %edi
	movl	$195, %esi
	callq	_WREG_CRT
	movl	$24, %edi
	movl	%r12d, %esi
	callq	_WREG_CRT
	shrl	$4, %ebx
	andb	$48, %bl
	movl	%ebx, -56(%rbp)                 ## 4-byte Spill
	movl	-100(%rbp), %eax                ## 4-byte Reload
	shrl	$8, %eax
	andl	$1, %eax
	movl	-92(%rbp), %ecx                 ## 4-byte Reload
	shrl	$7, %ecx
	andl	$2, %ecx
	shrl	$6, %r15d
	andl	$4, %r15d
	orl	%ecx, %r15d
	andl	$64, %r13d
	orl	%r15d, %r13d
	orl	%eax, %r13d
	movl	-68(%rbp), %eax                 ## 4-byte Reload
	shrl	$10, %eax
	andl	$3, %eax
	movl	%eax, %ecx
	movl	%r14d, %ebx
	andl	$1024, %ebx                     ## imm = 0x400
	movl	%ebx, %eax
	shrl	$8, %eax
	shrl	$7, %r14d
	andl	$24, %r14d
	orl	%eax, %r14d
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	shrl	$5, %eax
	andl	$96, %eax
	shrl	$3, %ebx
	orl	%r14d, %ebx
	orl	%eax, %ebx
	orl	%ecx, %ebx
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movq	(%rax), %rax
	movl	-72(%rbp), %ecx                 ## 4-byte Reload
	movl	$3, %esi
	shll	%cl, %esi
	movl	$-1, %edx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edx
	decb	%sil
	cmpl	$3, (%rax)
	notb	%dl
	movzbl	%sil, %eax
	movzbl	%dl, %r12d
	cmovel	%eax, %r12d
	orb	$-128, %r12b
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %eax
	cmpl	$131, %eax
	je	LBB0_45
## %bb.43:
	cmpl	$128, %eax
	jne	LBB0_44
LBB0_45:
	movq	%r13, %r14
	orb	$-120, %r14b
	jmp	LBB0_46
LBB0_44:
	movq	%r13, %r14
LBB0_46:
	movq	_MGA_MISC_OUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$45, %esi
	callq	_WREG8
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	36(%rax), %esi
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	callq	_mga_crtc_set_plls
	movzbl	-56(%rbp), %r15d                ## 1-byte Folded Reload
	xorl	%edi, %edi
	movl	%r15d, %esi
	callq	_WREG_ECRT
	movzbl	%r14b, %esi
	movl	$1, %edi
	callq	_WREG_ECRT
	movzbl	%bl, %esi
	movl	$2, %edi
	callq	_WREG_ECRT
	movzbl	%r12b, %esi
	movl	$3, %edi
	callq	_WREG_ECRT
	movl	$4, %edi
	xorl	%esi, %esi
	callq	_WREG_ECRT
	movl	$5, %edi
	xorl	%esi, %esi
	callq	_WREG_ECRT
	movl	8(%r13), %eax
	cmpl	$133, %eax
	je	LBB0_47
## %bb.48:
	cmpl	$131, %eax
	je	LBB0_49
LBB0_50:
	cmpl	$132, %eax
	jne	LBB0_52
LBB0_51:
	movl	$6, %edi
	xorl	%esi, %esi
	callq	_WREG_ECRT
LBB0_52:
	xorl	%edi, %edi
	movl	%r15d, %esi
	callq	_WREG_ECRT
	movq	_MGA_MISC_OUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$45, %esi
	callq	_WREG8
	cmpq	$0, -128(%rbp)                  ## 8-byte Folded Reload
	je	LBB0_54
## %bb.53:
	leaq	16(%r13), %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	$40, %edx
	callq	_memcpy
LBB0_54:
	movq	-136(%rbp), %rdi                ## 8-byte Reload
	movq	-144(%rbp), %rsi                ## 8-byte Reload
	movl	-104(%rbp), %edx                ## 4-byte Reload
	movl	-108(%rbp), %ecx                ## 4-byte Reload
	xorl	%r8d, %r8d
	callq	_mga_crtc_do_set_base
	cmpl	$133, 8(%r13)
	jne	LBB0_56
## %bb.55:
	movq	_MGAREG_MEMCTL@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_RREG32
	movl	%eax, %r14d
	movq	_MGAREG_SEQ_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	callq	_WREG8
	movq	_MGAREG_SEQ_DATA@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_RREG8
	movl	%eax, %ebx
	movl	%eax, %esi
	orl	$32, %esi
	movl	(%r12), %edi
	callq	_WREG8
	movl	(%r15), %edi
	movl	%r14d, %esi
	orl	$2097152, %esi                  ## imm = 0x200000
	callq	_WREG32
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_udelay
	movl	(%r15), %edi
	andl	$-2097153, %r14d                ## imm = 0xFFDFFFFF
	movl	%r14d, %esi
	callq	_WREG32
	movl	(%r12), %edi
	andl	$-33, %ebx
	movl	%ebx, %esi
	callq	_WREG8
LBB0_56:
	movq	%r13, %rdi
	callq	_IS_G200_SE
	testq	%rax, %rax
	je	LBB0_70
## %bb.57:
	movl	12(%r13), %eax
	cmpl	$4, %eax
	jl	LBB0_59
## %bb.58:
	movq	_MGAREG_CRTCEXT_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$6, %esi
	callq	_WREG8
	movq	_MGAREG_CRTCEXT_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	jmp	LBB0_69
LBB0_47:
	movl	$36, %edi
	movl	$5, %esi
	callq	_WREG_ECRT
	movl	8(%r13), %eax
	cmpl	$131, %eax
	jne	LBB0_50
LBB0_49:
	movl	$52, %edi
	movl	$5, %esi
	callq	_WREG_ECRT
	movl	8(%r13), %eax
	cmpl	$132, %eax
	je	LBB0_51
	jmp	LBB0_52
LBB0_59:
	cmpl	$2, %eax
	jl	LBB0_66
## %bb.60:
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movq	(%rax), %rax
	movl	(%rax), %eax
	xorl	%ecx, %ecx
	cmpl	$2, %eax
	sete	%cl
	leal	8(,%rcx,8), %ecx
	movl	$32, %eax
	cmovlel	%ecx, %eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	imull	36(%rcx), %eax
	xorl	%ebx, %ebx
	cmpl	$3100999, %eax                  ## imm = 0x2F5147
	jg	LBB0_65
## %bb.61:
	movl	$1, %ebx
	cmpl	$2600999, %eax                  ## imm = 0x27B027
	jg	LBB0_65
## %bb.62:
	movl	$2, %ebx
	cmpl	$1900999, %eax                  ## imm = 0x1D01C7
	jg	LBB0_65
## %bb.63:
	movl	$3, %ebx
	cmpl	$1160999, %eax                  ## imm = 0x11B727
	jg	LBB0_65
## %bb.64:
	xorl	%ebx, %ebx
	cmpl	$441000, %eax                   ## imm = 0x6BAA8
	setge	%bl
	xorl	$5, %ebx
LBB0_65:
	movq	_MGAREG_CRTCEXT_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$6, %esi
	callq	_WREG8
	movq	_MGAREG_CRTCEXT_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	jmp	LBB0_69
LBB0_66:
	movq	_MGAREG_CRTCEXT_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$6, %esi
	callq	_WREG8
	cmpl	$0, 12(%r13)
	movq	_MGAREG_CRTCEXT_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	jle	LBB0_68
## %bb.67:
	movl	$3, %esi
	jmp	LBB0_69
LBB0_1:
	xorl	%r14d, %r14d
	jmp	LBB0_10
LBB0_68:
	movl	$4, %esi
LBB0_69:
	callq	_WREG8
LBB0_70:
	xorl	%eax, %eax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_3, LBB0_3-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
LJTI0_0:
	.long	L0_0_set_4
	.long	L0_0_set_3
	.long	L0_0_set_3
	.long	L0_0_set_4
	.long	L0_0_set_5
	.long	L0_0_set_10
	.long	L0_0_set_6
	.long	L0_0_set_6
.set L0_1_set_17, LBB0_17-LJTI0_1
.set L0_1_set_12, LBB0_12-LJTI0_1
.set L0_1_set_15, LBB0_15-LJTI0_1
.set L0_1_set_16, LBB0_16-LJTI0_1
LJTI0_1:
	.long	L0_1_set_17
	.long	L0_1_set_12
	.long	L0_1_set_15
	.long	L0_1_set_16
	.end_data_region
                                        ## -- End function
	.section	__DATA,__data
	.p2align	4                               ## @mga_crtc_mode_set.dacvalue
_mga_crtc_mode_set.dacvalue:
	.ascii	"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\311\377\277 \037 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\260\000\3024\024\002\203\000\223\000w\000\000\000:"
	.space	16

	.comm	_MGA1064_VREF_CTL,8,3           ## @MGA1064_VREF_CTL
	.comm	_MGA1064_PIX_CLK_CTL_SEL_PLL,1,0 ## @MGA1064_PIX_CLK_CTL_SEL_PLL
	.comm	_MGA1064_PIX_CLK_CTL,8,3        ## @MGA1064_PIX_CLK_CTL
	.comm	_MGA1064_MISC_CTL_DAC_EN,1,0    ## @MGA1064_MISC_CTL_DAC_EN
	.comm	_MGA1064_MISC_CTL_VGA8,1,0      ## @MGA1064_MISC_CTL_VGA8
	.comm	_MGA1064_MISC_CTL_DAC_RAM_CS,1,0 ## @MGA1064_MISC_CTL_DAC_RAM_CS
	.comm	_MGA1064_MISC_CTL,8,3           ## @MGA1064_MISC_CTL
	.comm	_MGA1064_MUL_CTL_8bits,1,0      ## @MGA1064_MUL_CTL_8bits
	.comm	_MGA1064_MUL_CTL,8,3            ## @MGA1064_MUL_CTL
	.comm	_MGA1064_MUL_CTL_15bits,1,0     ## @MGA1064_MUL_CTL_15bits
	.comm	_MGA1064_MUL_CTL_16bits,1,0     ## @MGA1064_MUL_CTL_16bits
	.comm	_MGA1064_MUL_CTL_24bits,1,0     ## @MGA1064_MUL_CTL_24bits
	.comm	_MGA1064_MUL_CTL_32_24bits,1,0  ## @MGA1064_MUL_CTL_32_24bits
	.comm	_DRM_MODE_FLAG_NHSYNC,4,2       ## @DRM_MODE_FLAG_NHSYNC
	.comm	_DRM_MODE_FLAG_NVSYNC,4,2       ## @DRM_MODE_FLAG_NVSYNC
	.comm	_PCI_MGA_OPTION,4,2             ## @PCI_MGA_OPTION
	.comm	_PCI_MGA_OPTION2,4,2            ## @PCI_MGA_OPTION2
	.comm	_MGA_MISC_OUT,4,2               ## @MGA_MISC_OUT
	.comm	_MGAREG_MEMCTL,4,2              ## @MGAREG_MEMCTL
	.comm	_MGAREG_SEQ_INDEX,4,2           ## @MGAREG_SEQ_INDEX
	.comm	_MGAREG_SEQ_DATA,4,2            ## @MGAREG_SEQ_DATA
	.comm	_MGAREG_CRTCEXT_INDEX,4,2       ## @MGAREG_CRTCEXT_INDEX
	.comm	_MGAREG_CRTCEXT_DATA,4,2        ## @MGAREG_CRTCEXT_DATA
	.no_dead_strip	_mga_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 mga_crtc_mode_set
_mga_crtc_mode_set:                     ; @mga_crtc_mode_set
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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
	mov	x19, x1
	mov	w26, #0
	ldp	x8, x25, [x0]
	ldr	x20, [x25, #8]
	ldr	x8, [x8]
	ldr	x10, [x20]
	str	x8, [sp, #72]                   ; 8-byte Folded Spill
	ldr	x8, [x8, #8]
	ldr	x9, [x8]
	ldr	w9, [x9]
	sub	w9, w9, #1
	ldr	w11, [x10, w9, sxtw #2]
	ldr	w10, [x20, #8]
	mov	w28, #1
	sub	w10, w10, #128
Lloh0:
	adrp	x22, _mga_crtc_mode_set.dacvalue@PAGE
Lloh1:
	add	x22, x22, _mga_crtc_mode_set.dacvalue@PAGEOFF
	cmp	w10, #7
	str	w4, [sp, #52]                   ; 4-byte Folded Spill
	str	x5, [sp, #40]                   ; 8-byte Folded Spill
	str	w3, [sp, #36]                   ; 4-byte Folded Spill
	stp	x2, x0, [sp, #16]               ; 16-byte Folded Spill
	str	w11, [sp, #68]                  ; 4-byte Folded Spill
	b.hi	LBB0_59
; %bb.1:
Lloh2:
	adrp	x11, lJTI0_0@PAGE
Lloh3:
	add	x11, x11, lJTI0_0@PAGEOFF
	adr	x12, LBB0_2
	ldrb	w13, [x11, x10]
	add	x12, x12, x13, lsl #2
	mov	x27, x26
	br	x12
LBB0_2:
	mov	w28, #0
Lloh4:
	adrp	x10, _MGA1064_VREF_CTL@GOTPAGE
Lloh5:
	ldr	x10, [x10, _MGA1064_VREF_CTL@GOTPAGEOFF]
Lloh6:
	ldr	x10, [x10]
	mov	w11, #7
	strb	w11, [x22, x10]
	mov	w27, #37152
	movk	w27, #16644, lsl #16
	b	LBB0_7
LBB0_3:
	mov	w28, #0
Lloh7:
	adrp	x10, _MGA1064_VREF_CTL@GOTPAGE
Lloh8:
	ldr	x10, [x10, _MGA1064_VREF_CTL@GOTPAGEOFF]
Lloh9:
	ldr	x10, [x10]
	mov	w11, #3
	strb	w11, [x22, x10]
Lloh10:
	adrp	x10, _MGA1064_PIX_CLK_CTL_SEL_PLL@GOTPAGE
Lloh11:
	ldr	x10, [x10, _MGA1064_PIX_CLK_CTL_SEL_PLL@GOTPAGEOFF]
	ldrb	w10, [x10]
Lloh12:
	adrp	x11, _MGA1064_PIX_CLK_CTL@GOTPAGE
Lloh13:
	ldr	x11, [x11, _MGA1064_PIX_CLK_CTL@GOTPAGEOFF]
Lloh14:
	ldr	x11, [x11]
	strb	w10, [x22, x11]
Lloh15:
	adrp	x10, _MGA1064_MISC_CTL_DAC_EN@GOTPAGE
Lloh16:
	ldr	x10, [x10, _MGA1064_MISC_CTL_DAC_EN@GOTPAGEOFF]
Lloh17:
	adrp	x11, _MGA1064_MISC_CTL_VGA8@GOTPAGE
Lloh18:
	ldr	x11, [x11, _MGA1064_MISC_CTL_VGA8@GOTPAGEOFF]
	ldrb	w10, [x10]
	ldrb	w11, [x11]
	orr	w10, w11, w10
Lloh19:
	adrp	x11, _MGA1064_MISC_CTL_DAC_RAM_CS@GOTPAGE
Lloh20:
	ldr	x11, [x11, _MGA1064_MISC_CTL_DAC_RAM_CS@GOTPAGEOFF]
	ldrb	w11, [x11]
	orr	w10, w10, w11
Lloh21:
	adrp	x11, _MGA1064_MISC_CTL@GOTPAGE
Lloh22:
	ldr	x11, [x11, _MGA1064_MISC_CTL@GOTPAGEOFF]
Lloh23:
	ldr	x11, [x11]
	strb	w10, [x22, x11]
	ldr	w10, [x20, #20]
	mov	w11, #37152
	movk	w11, #16388, lsl #16
	orr	w12, w11, #0x4000
	cmp	w10, #0
	csel	w27, w12, w11, eq
	mov	w26, #32768
	b	LBB0_8
LBB0_4:
	mov	w28, #0
	b	LBB0_6
LBB0_5:
	mov	w28, #0
Lloh24:
	adrp	x10, _MGA1064_PIX_CLK_CTL_SEL_PLL@GOTPAGE
Lloh25:
	ldr	x10, [x10, _MGA1064_PIX_CLK_CTL_SEL_PLL@GOTPAGEOFF]
Lloh26:
	adrp	x11, _MGA1064_PIX_CLK_CTL@GOTPAGE
Lloh27:
	ldr	x11, [x11, _MGA1064_PIX_CLK_CTL@GOTPAGEOFF]
	ldrb	w10, [x10]
Lloh28:
	ldr	x11, [x11]
	strb	w10, [x22, x11]
LBB0_6:
Lloh29:
	adrp	x10, _MGA1064_MISC_CTL_VGA8@GOTPAGE
Lloh30:
	ldr	x10, [x10, _MGA1064_MISC_CTL_VGA8@GOTPAGEOFF]
	ldrb	w10, [x10]
Lloh31:
	adrp	x11, _MGA1064_MISC_CTL_DAC_RAM_CS@GOTPAGE
Lloh32:
	ldr	x11, [x11, _MGA1064_MISC_CTL_DAC_RAM_CS@GOTPAGEOFF]
	ldrb	w11, [x11]
Lloh33:
	adrp	x12, _MGA1064_MISC_CTL@GOTPAGE
Lloh34:
	ldr	x12, [x12, _MGA1064_MISC_CTL@GOTPAGEOFF]
	orr	w10, w11, w10
Lloh35:
	ldr	x11, [x12]
	strb	w10, [x22, x11]
	mov	w27, #288
LBB0_7:
	mov	w26, #45056
LBB0_8:
	and	w10, w9, #0x1fffffff
	cmp	w10, #3
	b.hi	LBB0_14
; %bb.9:
Lloh36:
	adrp	x9, _MGA1064_MUL_CTL_8bits@GOTPAGE
Lloh37:
	ldr	x9, [x9, _MGA1064_MUL_CTL_8bits@GOTPAGEOFF]
Lloh38:
	adrp	x11, lJTI0_1@PAGE
Lloh39:
	add	x11, x11, lJTI0_1@PAGEOFF
	adr	x12, LBB0_10
	ldrb	w13, [x11, x10]
	add	x12, x12, x13, lsl #2
	br	x12
LBB0_10:
	ldr	w8, [x8, #8]
Lloh40:
	adrp	x9, _MGA1064_MUL_CTL_16bits@GOTPAGE
Lloh41:
	ldr	x9, [x9, _MGA1064_MUL_CTL_16bits@GOTPAGEOFF]
Lloh42:
	adrp	x10, _MGA1064_MUL_CTL_15bits@GOTPAGE
Lloh43:
	ldr	x10, [x10, _MGA1064_MUL_CTL_15bits@GOTPAGEOFF]
	cmp	w8, #15
	csel	x9, x10, x9, eq
	b	LBB0_13
LBB0_11:
Lloh44:
	adrp	x9, _MGA1064_MUL_CTL_24bits@GOTPAGE
Lloh45:
	ldr	x9, [x9, _MGA1064_MUL_CTL_24bits@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:
Lloh46:
	adrp	x9, _MGA1064_MUL_CTL_32_24bits@GOTPAGE
Lloh47:
	ldr	x9, [x9, _MGA1064_MUL_CTL_32_24bits@GOTPAGEOFF]
LBB0_13:
	ldrb	w8, [x9]
Lloh48:
	adrp	x9, _MGA1064_MUL_CTL@GOTPAGE
Lloh49:
	ldr	x9, [x9, _MGA1064_MUL_CTL@GOTPAGEOFF]
Lloh50:
	ldr	x9, [x9]
	strb	w8, [x22, x9]
LBB0_14:
	mov	x21, #0
	mov	w23, #1
	mov	w24, #153
	b	LBB0_17
LBB0_15:                                ;   in Loop: Header=BB0_17 Depth=1
	ldrb	w1, [x22, x21]
	mov	x0, x21
	bl	_WREG_DAC
LBB0_16:                                ;   in Loop: Header=BB0_17 Depth=1
	add	x21, x21, #1
	cmp	x21, #80
	b.eq	LBB0_30
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	cmp	x21, #24
	b.lo	LBB0_16
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	sub	w8, w21, #27
	cmp	w8, #2
	b.lo	LBB0_16
; %bb.19:                               ;   in Loop: Header=BB0_17 Depth=1
	sub	w8, w21, #31
	cmp	w8, #11
	b.lo	LBB0_16
; %bb.20:                               ;   in Loop: Header=BB0_17 Depth=1
	and	w8, w21, #0x7ffffff8
	cmp	w8, #48
	b.eq	LBB0_16
; %bb.21:                               ;   in Loop: Header=BB0_17 Depth=1
	mov	x0, x20
	bl	_IS_G200_SE
	cbz	x0, LBB0_24
; %bb.22:                               ;   in Loop: Header=BB0_17 Depth=1
	cmp	x21, #46
	b.eq	LBB0_16
; %bb.23:                               ;   in Loop: Header=BB0_17 Depth=1
	and	w8, w21, #0x7ffffffe
	cmp	w8, #44
	b.eq	LBB0_16
LBB0_24:                                ;   in Loop: Header=BB0_17 Depth=1
	ldr	w8, [x20, #8]
	sub	w9, w8, #128
	cmp	w9, #7
	b.hi	LBB0_27
; %bb.25:                               ;   in Loop: Header=BB0_17 Depth=1
	lsl	w9, w23, w9
	tst	w9, w24
	b.eq	LBB0_27
; %bb.26:                               ;   in Loop: Header=BB0_17 Depth=1
	sub	w8, w21, #68
	cmp	w8, #11
	b.hs	LBB0_15
	b	LBB0_16
LBB0_27:                                ;   in Loop: Header=BB0_17 Depth=1
	cmp	w8, #134
	b.ne	LBB0_15
; %bb.28:                               ;   in Loop: Header=BB0_17 Depth=1
	cmp	x21, #68
	b.lo	LBB0_15
; %bb.29:                               ;   in Loop: Header=BB0_17 Depth=1
	cmp	x21, #79
	b.lo	LBB0_16
	b	LBB0_15
LBB0_30:
	ldr	w8, [x20, #8]
	cmp	w8, #133
	b.ne	LBB0_32
; %bb.31:
	mov	w0, #144
	mov	w1, #0
	bl	_WREG_DAC
LBB0_32:
	cbz	w27, LBB0_34
; %bb.33:
	ldr	w0, [x25]
Lloh51:
	adrp	x8, _PCI_MGA_OPTION@GOTPAGE
Lloh52:
	ldr	x8, [x8, _PCI_MGA_OPTION@GOTPAGEOFF]
Lloh53:
	ldr	w1, [x8]
	mov	x2, x27
	bl	_pci_write_config_dword
LBB0_34:
	tbnz	w28, #0, LBB0_36
; %bb.35:
	ldr	w0, [x25]
Lloh54:
	adrp	x8, _PCI_MGA_OPTION2@GOTPAGE
Lloh55:
	ldr	x8, [x8, _PCI_MGA_OPTION2@GOTPAGEOFF]
Lloh56:
	ldr	w1, [x8]
	mov	x2, x26
	bl	_pci_write_config_dword
LBB0_36:
	mov	w0, #2
	mov	w1, #15
	bl	_WREG_SEQ
	mov	w0, #3
	mov	w1, #0
	bl	_WREG_SEQ
	mov	w21, #4
	mov	w0, #4
	mov	w1, #14
	bl	_WREG_SEQ
	ldr	x9, [sp, #72]                   ; 8-byte Folded Reload
	ldp	x8, x9, [x9]
	ldr	w8, [x8]
	ldr	x9, [x9]
	ldr	w9, [x9]
	sdiv	w8, w8, w9
	add	w10, w8, w8, lsl #1
	cmp	w9, #3
	csel	w8, w10, w8, eq
	ldr	w9, [sp, #68]                   ; 4-byte Folded Reload
	sub	w9, w21, w9
	asr	w8, w8, w9
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	ldp	w8, w9, [x19, #4]
	add	w10, w8, #7
	cmp	w8, #0
	csel	w8, w10, w8, lt
	asr	w8, w8, #3
	sub	w26, w8, #1
	add	w8, w9, #7
	cmp	w9, #0
	csel	w8, w8, w9, lt
	asr	w8, w8, #3
	sub	w27, w8, #1
	ldp	w8, w9, [x19, #12]
	add	w10, w8, #7
	cmp	w8, #0
	csel	w8, w10, w8, lt
	asr	w8, w8, #3
	add	w21, w8, #31
	add	w8, w9, #7
	cmp	w9, #0
	csel	w8, w8, w9, lt
	asr	w8, w8, #3
	sub	w9, w8, #1
	orr	w10, w9, #0x2
	and	w10, w10, #0x7
	cmp	w10, #6
	csel	w25, w8, w9, eq
	ldp	w8, w9, [x19, #20]
	sub	w22, w8, #1
	sub	w23, w9, #1
	ldp	w8, w9, [x19, #28]
	str	x19, [sp, #56]                  ; 8-byte Folded Spill
	sub	w8, w8, #1
	stp	w8, w9, [sp, #4]                ; 8-byte Folded Spill
	sub	w24, w9, #2
	mov	w0, #0
	mov	w1, #0
	bl	_WREG_GFX
	mov	w0, #1
	mov	w1, #0
	bl	_WREG_GFX
	mov	w0, #2
	mov	w1, #0
	bl	_WREG_GFX
	mov	w0, #3
	mov	w1, #0
	bl	_WREG_GFX
	mov	w0, #4
	mov	w1, #0
	bl	_WREG_GFX
	mov	w0, #5
	mov	w1, #64
	bl	_WREG_GFX
	mov	w0, #6
	mov	w1, #5
	bl	_WREG_GFX
	mov	w0, #7
	mov	w1, #15
	bl	_WREG_GFX
	mov	w0, #8
	mov	w1, #15
	bl	_WREG_GFX
	lsr	w19, w25, #5
	sub	w28, w25, #4
	mov	w0, #0
	mov	x1, x28
	bl	_WREG_CRT
	mov	w0, #1
	mov	x1, x26
	bl	_WREG_CRT
	mov	w0, #2
	mov	x1, x26
	bl	_WREG_CRT
	mov	w1, #128
	bfxil	w1, w25, #0, #5
	mov	w0, #3
	bl	_WREG_CRT
	mov	w0, #4
	mov	x1, x27
	bl	_WREG_CRT
	and	w1, w21, #0x1f
	bfi	w1, w19, #7, #1
	mov	w0, #5
	bl	_WREG_CRT
	and	w1, w24, #0xff
	mov	w0, #6
	bl	_WREG_CRT
	ubfx	w8, w24, #8, #1
	and	w9, w22, #0x100
	lsr	w10, w23, #6
	and	w10, w10, #0x4
	lsr	w11, w9, #5
	lsr	w12, w24, #4
	and	w12, w12, #0x20
	and	w19, w22, #0x200
	lsr	w21, w19, #3
	lsr	w13, w23, #2
	and	w13, w13, #0x80
	orr	w11, w11, w9, lsr #7
	orr	w9, w11, w9, lsr #4
	orr	w9, w9, w21
	orr	w9, w9, w10
	orr	w9, w9, w13
	orr	w8, w9, w8
	orr	w1, w8, w12
	mov	w0, #7
	bl	_WREG_CRT
	orr	w1, w21, w19, lsr #4
	mov	w0, #9
	bl	_WREG_CRT
	mov	w0, #10
	mov	w1, #0
	bl	_WREG_CRT
	mov	w0, #11
	mov	w1, #0
	bl	_WREG_CRT
	mov	w0, #12
	mov	w1, #0
	bl	_WREG_CRT
	mov	w0, #13
	mov	w1, #0
	bl	_WREG_CRT
	mov	w0, #14
	mov	w1, #0
	bl	_WREG_CRT
	mov	w0, #15
	mov	w1, #0
	bl	_WREG_CRT
	and	w1, w23, #0xff
	mov	w0, #16
	bl	_WREG_CRT
	mov	w1, #32
	ldr	w8, [sp, #4]                    ; 4-byte Folded Reload
	bfxil	w1, w8, #0, #4
	mov	w0, #17
	bl	_WREG_CRT
	and	w21, w22, #0xff
	mov	w0, #18
	mov	x1, x21
	bl	_WREG_CRT
	ldr	w19, [sp, #12]                  ; 4-byte Folded Reload
	and	w1, w19, #0xff
	mov	w0, #19
	bl	_WREG_CRT
	mov	w0, #20
	mov	w1, #0
	bl	_WREG_CRT
	mov	w0, #21
	mov	x1, x21
	bl	_WREG_CRT
	ldr	w8, [sp, #8]                    ; 4-byte Folded Reload
	sub	w8, w8, #1
	and	w1, w8, #0xff
	mov	w0, #22
	bl	_WREG_CRT
	mov	w0, #23
	mov	w1, #195
	bl	_WREG_CRT
	mov	w0, #24
	mov	x1, x21
	bl	_WREG_CRT
	lsr	w8, w19, #4
	and	w21, w8, #0x30
	lsr	w8, w26, #7
	and	w8, w8, #0x2
	lsr	w9, w27, #6
	and	w9, w9, #0x4
	and	w10, w25, #0x40
	orr	w8, w9, w8
	orr	w25, w8, w10
	bfxil	w25, w28, #8, #1
	and	w8, w22, #0x400
	lsr	w9, w22, #7
	and	w9, w9, #0x18
	lsr	w10, w23, #5
	and	w10, w10, #0x60
	orr	w9, w9, w8, lsr #8
	orr	w8, w9, w8, lsr #3
	orr	w26, w8, w10
	bfxil	w26, w24, #10, #2
	ldr	x8, [sp, #72]                   ; 8-byte Folded Reload
	ldr	x8, [x8, #8]
	ldr	x8, [x8]
	ldr	w8, [x8]
	mov	w9, #3
	ldr	w11, [sp, #68]                  ; 4-byte Folded Reload
	lsl	w9, w9, w11
	sub	w9, w9, #1
	mov	w10, #-1
	lsl	w10, w10, w11
	cmp	w8, #3
	csinv	w8, w9, w10, eq
	orr	w23, w8, #0xffffff80
	ldr	w8, [x20, #8]
	cmp	w8, #131
	b.eq	LBB0_38
; %bb.37:
	cmp	w8, #128
	b.ne	LBB0_39
LBB0_38:
	mov	w8, #-120
	orr	w25, w25, w8
LBB0_39:
Lloh57:
	adrp	x22, _MGA_MISC_OUT@GOTPAGE
Lloh58:
	ldr	x22, [x22, _MGA_MISC_OUT@GOTPAGEOFF]
	ldr	w0, [x22]
	mov	w1, #45
	bl	_WREG8
	ldr	x19, [sp, #56]                  ; 8-byte Folded Reload
	ldr	w1, [x19, #36]
	mov	x0, x20
	bl	_mga_crtc_set_plls
	mov	w0, #0
	mov	x1, x21
	bl	_WREG_ECRT
	and	w1, w25, #0xff
	mov	w0, #1
	bl	_WREG_ECRT
	mov	w0, #2
	mov	x1, x26
	bl	_WREG_ECRT
	and	w1, w23, #0xff
	mov	w0, #3
	bl	_WREG_ECRT
	mov	w0, #4
	mov	w1, #0
	bl	_WREG_ECRT
	mov	w0, #5
	mov	w1, #0
	bl	_WREG_ECRT
	ldr	w8, [x20, #8]
	cmp	w8, #133
	b.eq	LBB0_50
; %bb.40:
	cmp	w8, #131
	b.eq	LBB0_51
LBB0_41:
	cmp	w8, #132
	b.ne	LBB0_43
LBB0_42:
	mov	w0, #6
	mov	w1, #0
	bl	_WREG_ECRT
LBB0_43:
	mov	w0, #0
	mov	x1, x21
	bl	_WREG_ECRT
	ldr	w0, [x22]
	mov	w1, #45
	bl	_WREG8
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	cbz	x8, LBB0_45
; %bb.44:
	add	x0, x20, #16
	mov	x1, x19
	mov	w2, #40
	bl	_memcpy
LBB0_45:
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	ldr	x1, [sp, #40]                   ; 8-byte Folded Reload
	ldr	w2, [sp, #36]                   ; 4-byte Folded Reload
	ldr	w3, [sp, #52]                   ; 4-byte Folded Reload
	mov	w4, #0
	bl	_mga_crtc_do_set_base
	ldr	w8, [x20, #8]
	cmp	w8, #133
	b.ne	LBB0_47
; %bb.46:
Lloh59:
	adrp	x19, _MGAREG_MEMCTL@GOTPAGE
Lloh60:
	ldr	x19, [x19, _MGAREG_MEMCTL@GOTPAGEOFF]
	ldr	w0, [x19]
	bl	_RREG32
	mov	x21, x0
Lloh61:
	adrp	x8, _MGAREG_SEQ_INDEX@GOTPAGE
Lloh62:
	ldr	x8, [x8, _MGAREG_SEQ_INDEX@GOTPAGEOFF]
Lloh63:
	ldr	w0, [x8]
	mov	w1, #1
	bl	_WREG8
Lloh64:
	adrp	x23, _MGAREG_SEQ_DATA@GOTPAGE
Lloh65:
	ldr	x23, [x23, _MGAREG_SEQ_DATA@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_RREG8
	mov	x22, x0
	orr	w1, w0, #0x20
	ldr	w0, [x23]
	bl	_WREG8
	ldr	w0, [x19]
	orr	w1, w21, #0x200000
	bl	_WREG32
	mov	w0, #1000
	bl	_udelay
	ldr	w0, [x19]
	ldr	x19, [sp, #56]                  ; 8-byte Folded Reload
	and	w1, w21, #0xffdfffff
	bl	_WREG32
	ldr	w0, [x23]
	and	w1, w22, #0xffffffdf
	bl	_WREG8
LBB0_47:
	mov	x0, x20
	bl	_IS_G200_SE
	cbz	x0, LBB0_68
; %bb.48:
	ldr	w8, [x20, #12]
	cmp	w8, #4
	b.lt	LBB0_52
; %bb.49:
Lloh66:
	adrp	x8, _MGAREG_CRTCEXT_INDEX@GOTPAGE
Lloh67:
	ldr	x8, [x8, _MGAREG_CRTCEXT_INDEX@GOTPAGEOFF]
Lloh68:
	ldr	w0, [x8]
	mov	w1, #6
	bl	_WREG8
Lloh69:
	adrp	x8, _MGAREG_CRTCEXT_DATA@GOTPAGE
Lloh70:
	ldr	x8, [x8, _MGAREG_CRTCEXT_DATA@GOTPAGEOFF]
Lloh71:
	ldr	w0, [x8]
	mov	w1, #0
	b	LBB0_67
LBB0_50:
	mov	w0, #36
	mov	w1, #5
	bl	_WREG_ECRT
	ldr	w8, [x20, #8]
	cmp	w8, #131
	b.ne	LBB0_41
LBB0_51:
	mov	w0, #52
	mov	w1, #5
	bl	_WREG_ECRT
	ldr	w8, [x20, #8]
	cmp	w8, #132
	b.eq	LBB0_42
	b	LBB0_43
LBB0_52:
	cmp	w8, #1
	b.le	LBB0_55
; %bb.53:
	ldr	x8, [sp, #72]                   ; 8-byte Folded Reload
	ldr	x8, [x8, #8]
	ldr	x8, [x8]
	ldr	w8, [x8]
	mov	w9, #8
	mov	w10, #16
	cmp	w8, #2
	csel	w8, w10, w9, eq
	mov	w9, #32
	csel	w8, w9, w8, gt
	ldr	w9, [x19, #36]
	mul	w8, w8, w9
	mov	w9, #20807
	movk	w9, #47, lsl #16
	cmp	w8, w9
	b.le	LBB0_57
; %bb.54:
	mov	w19, #0
	b	LBB0_66
LBB0_55:
Lloh72:
	adrp	x8, _MGAREG_CRTCEXT_INDEX@GOTPAGE
Lloh73:
	ldr	x8, [x8, _MGAREG_CRTCEXT_INDEX@GOTPAGEOFF]
Lloh74:
	ldr	w0, [x8]
	mov	w1, #6
	bl	_WREG8
	ldr	w8, [x20, #12]
Lloh75:
	adrp	x9, _MGAREG_CRTCEXT_DATA@GOTPAGE
Lloh76:
	ldr	x9, [x9, _MGAREG_CRTCEXT_DATA@GOTPAGEOFF]
Lloh77:
	ldr	w0, [x9]
	cmp	w8, #1
	b.lt	LBB0_60
; %bb.56:
	mov	w1, #3
	b	LBB0_67
LBB0_57:
	mov	w9, #45095
	movk	w9, #39, lsl #16
	cmp	w8, w9
	b.le	LBB0_61
; %bb.58:
	mov	w19, #1
	b	LBB0_66
LBB0_59:
	mov	x27, x26
	b	LBB0_8
LBB0_60:
	mov	w1, #4
	b	LBB0_67
LBB0_61:
	mov	w9, #455
	movk	w9, #29, lsl #16
	cmp	w8, w9
	b.le	LBB0_63
; %bb.62:
	mov	w19, #2
	b	LBB0_66
LBB0_63:
	mov	w9, #46887
	movk	w9, #17, lsl #16
	cmp	w8, w9
	b.le	LBB0_65
; %bb.64:
	mov	w19, #3
	b	LBB0_66
LBB0_65:
	mov	w9, #47783
	movk	w9, #6, lsl #16
	cmp	w8, w9
	mov	w8, #4
	cinc	w19, w8, le
LBB0_66:
Lloh78:
	adrp	x8, _MGAREG_CRTCEXT_INDEX@GOTPAGE
Lloh79:
	ldr	x8, [x8, _MGAREG_CRTCEXT_INDEX@GOTPAGEOFF]
Lloh80:
	ldr	w0, [x8]
	mov	w1, #6
	bl	_WREG8
Lloh81:
	adrp	x8, _MGAREG_CRTCEXT_DATA@GOTPAGE
Lloh82:
	ldr	x8, [x8, _MGAREG_CRTCEXT_DATA@GOTPAGEOFF]
Lloh83:
	ldr	w0, [x8]
	mov	x1, x19
LBB0_67:
	bl	_WREG8
LBB0_68:
	mov	w0, #0
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh44, Lloh45
	.loh AdrpLdrGot	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGot	Lloh57, Lloh58
	.loh AdrpLdrGot	Lloh64, Lloh65
	.loh AdrpLdrGotLdr	Lloh61, Lloh62, Lloh63
	.loh AdrpLdrGot	Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh69, Lloh70, Lloh71
	.loh AdrpLdrGotLdr	Lloh66, Lloh67, Lloh68
	.loh AdrpLdrGotLdr	Lloh75, Lloh76, Lloh77
	.loh AdrpLdrGotLdr	Lloh72, Lloh73, Lloh74
	.loh AdrpLdrGotLdr	Lloh81, Lloh82, Lloh83
	.loh AdrpLdrGotLdr	Lloh78, Lloh79, Lloh80
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_3-LBB0_2)>>2
	.byte	(LBB0_3-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_8-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
lJTI0_1:
	.byte	(LBB0_13-LBB0_10)>>2
	.byte	(LBB0_10-LBB0_10)>>2
	.byte	(LBB0_11-LBB0_10)>>2
	.byte	(LBB0_12-LBB0_10)>>2
                                        ; -- End function
	.section	__DATA,__data
_mga_crtc_mode_set.dacvalue:            ; @mga_crtc_mode_set.dacvalue
	.ascii	"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\311\377\277 \037 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\260\000\3024\024\002\203\000\223\000w\000\000\000:"
	.space	16

	.comm	_MGA1064_VREF_CTL,8,3           ; @MGA1064_VREF_CTL
	.comm	_MGA1064_PIX_CLK_CTL_SEL_PLL,1,0 ; @MGA1064_PIX_CLK_CTL_SEL_PLL
	.comm	_MGA1064_PIX_CLK_CTL,8,3        ; @MGA1064_PIX_CLK_CTL
	.comm	_MGA1064_MISC_CTL_DAC_EN,1,0    ; @MGA1064_MISC_CTL_DAC_EN
	.comm	_MGA1064_MISC_CTL_VGA8,1,0      ; @MGA1064_MISC_CTL_VGA8
	.comm	_MGA1064_MISC_CTL_DAC_RAM_CS,1,0 ; @MGA1064_MISC_CTL_DAC_RAM_CS
	.comm	_MGA1064_MISC_CTL,8,3           ; @MGA1064_MISC_CTL
	.comm	_MGA1064_MUL_CTL_8bits,1,0      ; @MGA1064_MUL_CTL_8bits
	.comm	_MGA1064_MUL_CTL,8,3            ; @MGA1064_MUL_CTL
	.comm	_MGA1064_MUL_CTL_15bits,1,0     ; @MGA1064_MUL_CTL_15bits
	.comm	_MGA1064_MUL_CTL_16bits,1,0     ; @MGA1064_MUL_CTL_16bits
	.comm	_MGA1064_MUL_CTL_24bits,1,0     ; @MGA1064_MUL_CTL_24bits
	.comm	_MGA1064_MUL_CTL_32_24bits,1,0  ; @MGA1064_MUL_CTL_32_24bits
	.comm	_DRM_MODE_FLAG_NHSYNC,4,2       ; @DRM_MODE_FLAG_NHSYNC
	.comm	_DRM_MODE_FLAG_NVSYNC,4,2       ; @DRM_MODE_FLAG_NVSYNC
	.comm	_PCI_MGA_OPTION,4,2             ; @PCI_MGA_OPTION
	.comm	_PCI_MGA_OPTION2,4,2            ; @PCI_MGA_OPTION2
	.comm	_MGA_MISC_OUT,4,2               ; @MGA_MISC_OUT
	.comm	_MGAREG_MEMCTL,4,2              ; @MGAREG_MEMCTL
	.comm	_MGAREG_SEQ_INDEX,4,2           ; @MGAREG_SEQ_INDEX
	.comm	_MGAREG_SEQ_DATA,4,2            ; @MGAREG_SEQ_DATA
	.comm	_MGAREG_CRTCEXT_INDEX,4,2       ; @MGAREG_CRTCEXT_INDEX
	.comm	_MGAREG_CRTCEXT_DATA,4,2        ; @MGAREG_CRTCEXT_DATA
	.no_dead_strip	_mga_crtc_mode_set
.subsections_via_symbols
