	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_mode_valid
_intel_mode_valid:                      ## @intel_mode_valid
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	callq	_to_i915
	cmpl	$1, (%rbx)
	jle	LBB0_2
## %bb.1:
	movq	_MODE_NO_VSCAN@GOTPCREL(%rip), %r15
	jmp	LBB0_23
LBB0_2:
	movq	%rax, %r14
	movl	4(%rbx), %eax
	movq	_DRM_MODE_FLAG_HSKEW@GOTPCREL(%rip), %rcx
	movq	_MODE_H_ILLEGAL@GOTPCREL(%rip), %r15
	testl	%eax, (%rcx)
	jne	LBB0_23
## %bb.3:
	movq	_DRM_MODE_FLAG_CSYNC@GOTPCREL(%rip), %rcx
	movq	_DRM_MODE_FLAG_NCSYNC@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_DRM_MODE_FLAG_PCSYNC@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	testl	%eax, %edx
	je	LBB0_5
## %bb.4:
	movq	_MODE_HSYNC@GOTPCREL(%rip), %r15
	jmp	LBB0_23
LBB0_5:
	movq	_DRM_MODE_FLAG_BCAST@GOTPCREL(%rip), %rcx
	movq	_DRM_MODE_FLAG_PIXMUX@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_DRM_MODE_FLAG_CLKDIV2@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	testl	%eax, %edx
	je	LBB0_7
## %bb.6:
	movq	_MODE_BAD@GOTPCREL(%rip), %r15
	jmp	LBB0_23
LBB0_7:
	movq	%r14, %rdi
	callq	_INTEL_GEN
	movl	$4096, %r12d                    ## imm = 0x1000
	movl	$8192, %r13d                    ## imm = 0x2000
	cmpl	$8, %eax
	jg	LBB0_8
## %bb.9:
	movq	%r14, %rdi
	callq	_IS_BROADWELL
	testq	%rax, %rax
	je	LBB0_11
LBB0_8:
	movl	$8192, %ecx                     ## imm = 0x2000
LBB0_13:
	cmpl	%r13d, 8(%rbx)
	jg	LBB0_23
## %bb.14:
	cmpl	%ecx, 12(%rbx)
	jg	LBB0_23
## %bb.15:
	cmpl	%ecx, 16(%rbx)
	jg	LBB0_23
## %bb.16:
	cmpl	%ecx, 20(%rbx)
	jg	LBB0_23
## %bb.17:
	movq	_MODE_V_ILLEGAL@GOTPCREL(%rip), %r15
	cmpl	%r12d, 24(%rbx)
	jg	LBB0_23
## %bb.18:
	cmpl	%ecx, 28(%rbx)
	jg	LBB0_23
## %bb.19:
	cmpl	%ecx, 32(%rbx)
	jg	LBB0_23
## %bb.20:
	cmpl	%ecx, 36(%rbx)
	jle	LBB0_22
## %bb.21:
	movq	_MODE_V_ILLEGAL@GOTPCREL(%rip), %r15
	jmp	LBB0_23
LBB0_11:
	movq	%r14, %rdi
	callq	_IS_HASWELL
	movl	$8192, %ecx                     ## imm = 0x2000
	testq	%rax, %rax
	jne	LBB0_13
## %bb.12:
	movq	%r14, %rdi
	callq	_INTEL_GEN
	xorl	%ecx, %ecx
	cmpl	$3, %eax
	setge	%cl
	movl	%ecx, %r13d
	shll	$11, %r13d
	addl	$2048, %r13d                    ## imm = 0x800
	shll	$12, %ecx
	addl	$4096, %ecx                     ## imm = 0x1000
	movl	%r13d, %r12d
	jmp	LBB0_13
LBB0_22:
	movq	_MODE_OK@GOTPCREL(%rip), %r15
LBB0_23:
	movl	(%r15), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MODE_NO_VSCAN,4,2              ## @MODE_NO_VSCAN
	.comm	_DRM_MODE_FLAG_HSKEW,4,2        ## @DRM_MODE_FLAG_HSKEW
	.comm	_MODE_H_ILLEGAL,4,2             ## @MODE_H_ILLEGAL
	.comm	_DRM_MODE_FLAG_CSYNC,4,2        ## @DRM_MODE_FLAG_CSYNC
	.comm	_DRM_MODE_FLAG_NCSYNC,4,2       ## @DRM_MODE_FLAG_NCSYNC
	.comm	_DRM_MODE_FLAG_PCSYNC,4,2       ## @DRM_MODE_FLAG_PCSYNC
	.comm	_MODE_HSYNC,4,2                 ## @MODE_HSYNC
	.comm	_DRM_MODE_FLAG_BCAST,4,2        ## @DRM_MODE_FLAG_BCAST
	.comm	_DRM_MODE_FLAG_PIXMUX,4,2       ## @DRM_MODE_FLAG_PIXMUX
	.comm	_DRM_MODE_FLAG_CLKDIV2,4,2      ## @DRM_MODE_FLAG_CLKDIV2
	.comm	_MODE_BAD,4,2                   ## @MODE_BAD
	.comm	_MODE_V_ILLEGAL,4,2             ## @MODE_V_ILLEGAL
	.comm	_MODE_OK,4,2                    ## @MODE_OK
	.no_dead_strip	_intel_mode_valid
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_mode_valid
_intel_mode_valid:                      ; @intel_mode_valid
	.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
	bl	_to_i915
	ldr	w8, [x19]
	cmp	w8, #1
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MUX@GOTPAGE
Lloh22:
	ldr	x10, [x10, _DRM_MODE_FLAG_PIXMUX@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh24:
	adrp	x10, _DRM_MODE_FLAG_CLKDIV2@GOTPAGE
Lloh25:
	ldr	x10, [x10, _DRM_MODE_FLAG_CLKDIV2@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
	orr	w9, w9, w10
	tst	w9, w8
	b.eq	LBB0_9
; %bb.7:
Lloh27:
	adrp	x8, _MODE_BAD@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MODE_BAD@GOTPAGEOFF]
LBB0_8:
	ldr	w0, [x8]
	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:
	mov	x20, x0
	bl	_INTEL_GEN
	cmp	w0, #8
	b.gt	LBB0_11
; %bb.10:
	mov	x0, x20
	bl	_IS_BROADWELL
	cbz	x0, LBB0_20
LBB0_11:
	mov	w21, #4096
	mov	w22, #8192
LBB0_12:
	mov	w9, #8192
LBB0_13:
	ldr	w8, [x19, #8]
	cmp	w8, w22
	b.gt	LBB0_3
; %bb.14:
	ldr	w8, [x19, #12]
	cmp	w8, w9
	b.gt	LBB0_3
; %bb.15:
	ldr	w8, [x19, #16]
	cmp	w8, w9
	b.gt	LBB0_3
; %bb.16:
	ldr	w8, [x19, #20]
	cmp	w8, w9
	b.gt	LBB0_3
; %bb.17:
	ldr	w8, [x19, #24]
	cmp	w8, w21
	b.gt	LBB0_19
; %bb.18:
	ldr	w8, [x19, #28]
	cmp	w8, w9
	b.le	LBB0_22
LBB0_19:
Lloh29:
	adrp	x8, _MODE_V_ILLEGAL@GOTPAGE
Lloh30:
	ldr	x8, [x8, _MODE_V_ILLEGAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_20:
	mov	x0, x20
	bl	_IS_HASWELL
	mov	w21, #4096
	mov	w22, #8192
	cbnz	x0, LBB0_12
; %bb.21:
	mov	x0, x20
	bl	_INTEL_GEN
	mov	w8, #2048
	cmp	w0, #2
	csel	w8, w21, w8, gt
	csel	w9, w22, w21, gt
	mov	x21, x8
	mov	x22, x8
	b	LBB0_13
LBB0_22:
	ldr	w10, [x19, #32]
Lloh31:
	adrp	x8, _MODE_V_ILLEGAL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _MODE_V_ILLEGAL@GOTPAGEOFF]
	cmp	w10, w9
	b.gt	LBB0_8
; %bb.23:
	ldr	w10, [x19, #36]
Lloh33:
	adrp	x11, _MODE_OK@GOTPAGE
Lloh34:
	ldr	x11, [x11, _MODE_OK@GOTPAGEOFF]
	cmp	w10, w9
	csel	x8, x8, x11, gt
	b	LBB0_8
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_MODE_NO_VSCAN,4,2              ; @MODE_NO_VSCAN
	.comm	_DRM_MODE_FLAG_HSKEW,4,2        ; @DRM_MODE_FLAG_HSKEW
	.comm	_MODE_H_ILLEGAL,4,2             ; @MODE_H_ILLEGAL
	.comm	_DRM_MODE_FLAG_CSYNC,4,2        ; @DRM_MODE_FLAG_CSYNC
	.comm	_DRM_MODE_FLAG_NCSYNC,4,2       ; @DRM_MODE_FLAG_NCSYNC
	.comm	_DRM_MODE_FLAG_PCSYNC,4,2       ; @DRM_MODE_FLAG_PCSYNC
	.comm	_MODE_HSYNC,4,2                 ; @MODE_HSYNC
	.comm	_DRM_MODE_FLAG_BCAST,4,2        ; @DRM_MODE_FLAG_BCAST
	.comm	_DRM_MODE_FLAG_PIXMUX,4,2       ; @DRM_MODE_FLAG_PIXMUX
	.comm	_DRM_MODE_FLAG_CLKDIV2,4,2      ; @DRM_MODE_FLAG_CLKDIV2
	.comm	_MODE_BAD,4,2                   ; @MODE_BAD
	.comm	_MODE_V_ILLEGAL,4,2             ; @MODE_V_ILLEGAL
	.comm	_MODE_OK,4,2                    ; @MODE_OK
	.no_dead_strip	_intel_mode_valid
.subsections_via_symbols
