	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_modeset_vga_set_state    ## -- Begin function intel_modeset_vga_set_state
	.p2align	4, 0x90
_intel_modeset_vga_set_state:           ## @intel_modeset_vga_set_state
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r12
	callq	_INTEL_GEN
	cmpl	$6, %eax
	jl	LBB0_1
## %bb.2:
	movq	_SNB_GMCH_CTRL@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_INTEL_GMCH_CTRL@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %r15d
	movl	(%r12), %edi
	leaq	-36(%rbp), %rdx
	movl	%r15d, %esi
	callq	_pci_read_config_word
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
LBB0_8:
	callq	_DRM_ERROR
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	-36(%rbp), %eax
	movq	_INTEL_GMCH_VGA_DISABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	testl	%eax, %edx
	sete	%sil
	testl	%r14d, %r14d
	sete	%cl
	xorl	%ebx, %ebx
	xorb	%sil, %cl
	jne	LBB0_9
## %bb.6:
	movl	%edx, %ecx
	orl	%eax, %ecx
	notl	%edx
	andl	%eax, %edx
	testl	%r14d, %r14d
	cmovel	%ecx, %edx
	movl	%edx, -36(%rbp)
	movl	(%r12), %edi
	movl	%r15d, %esi
	callq	_pci_write_config_word
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_SNB_GMCH_CTRL,4,2              ## @SNB_GMCH_CTRL
	.comm	_INTEL_GMCH_CTRL,4,2            ## @INTEL_GMCH_CTRL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read control word\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_INTEL_GMCH_VGA_DISABLE,4,2     ## @INTEL_GMCH_VGA_DISABLE
L_.str.1:                               ## @.str.1
	.asciz	"failed to write control word\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_modeset_vga_set_state    ; -- Begin function intel_modeset_vga_set_state
	.p2align	2
_intel_modeset_vga_set_state:           ; @intel_modeset_vga_set_state
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x1
	mov	x19, x0
	bl	_INTEL_GEN
Lloh0:
	adrp	x8, _SNB_GMCH_CTRL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SNB_GMCH_CTRL@GOTPAGEOFF]
Lloh2:
	adrp	x9, _INTEL_GMCH_CTRL@GOTPAGE
Lloh3:
	ldr	x9, [x9, _INTEL_GMCH_CTRL@GOTPAGEOFF]
	cmp	w0, #5
	csel	x8, x8, x9, gt
	ldr	w21, [x8]
	ldr	w0, [x19]
	add	x2, sp, #12
	mov	x1, x21
	bl	_pci_read_config_word
	cbz	x0, LBB0_4
; %bb.1:
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
LBB0_2:
	bl	_DRM_ERROR
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_4:
	ldr	w8, [sp, #12]
Lloh9:
	adrp	x9, _INTEL_GMCH_VGA_DISABLE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _INTEL_GMCH_VGA_DISABLE@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w10, eq
	cmp	w20, #0
	cset	w11, eq
	eor	w10, w11, w10
	tbz	w10, #0, LBB0_6
; %bb.5:
	mov	w0, #0
	b	LBB0_3
LBB0_6:
	orr	w10, w9, w8
	bic	w8, w8, w9
	cmp	w20, #0
	csel	w2, w10, w8, eq
	str	w2, [sp, #12]
	ldr	w0, [x19]
	mov	x1, x21
	bl	_pci_write_config_word
	cbz	x0, LBB0_3
; %bb.7:
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_2
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_SNB_GMCH_CTRL,4,2              ; @SNB_GMCH_CTRL
	.comm	_INTEL_GMCH_CTRL,4,2            ; @INTEL_GMCH_CTRL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read control word\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_INTEL_GMCH_VGA_DISABLE,4,2     ; @INTEL_GMCH_VGA_DISABLE
l_.str.1:                               ; @.str.1
	.asciz	"failed to write control word\n"

.subsections_via_symbols
