	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i9xx_plane_ctl
_i9xx_plane_ctl:                        ## @i9xx_plane_ctl
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	16(%rsi), %rax
	movl	(%rax), %edi
	callq	_to_i915
	movq	%rax, %r14
	movq	8(%rbx), %r12
	movl	(%rbx), %r15d
	movq	_DISPLAY_PLANE_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_IS_G4X
	testq	%rax, %rax
	jne	LBB0_4
## %bb.1:
	movq	%r14, %rdi
	movl	$5, %esi
	callq	_IS_GEN
	testq	%rax, %rax
	jne	LBB0_4
## %bb.2:
	movq	%r14, %rdi
	movl	$6, %esi
	callq	_IS_GEN
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_IS_IVYBRIDGE
	testq	%rax, %rax
	je	LBB0_5
LBB0_4:
	movq	_DISPPLANE_TRICKLE_FEED_DISABLE@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
LBB0_5:
	movq	8(%r12), %rax
	movl	(%rax), %edi
	leal	-128(%rdi), %eax
	cmpl	$7, %eax
	jae	LBB0_6
## %bb.7:
	cltq
	leaq	l_switch.table.i9xx_plane_ctl(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	orl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_INTEL_GEN
	cmpl	$4, %eax
	jl	LBB0_10
## %bb.8:
	movq	(%r12), %rax
	movq	_I915_FORMAT_MOD_X_TILED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.9:
	movq	_DISPPLANE_TILED@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
LBB0_10:
	movq	_DRM_MODE_ROTATE_180@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r15d, %eax
	je	LBB0_12
## %bb.11:
	movq	_DISPPLANE_ROTATE_180@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_12:
	movq	_DRM_MODE_REFLECT_X@GOTPCREL(%rip), %rcx
	andl	(%rcx), %r15d
	je	LBB0_14
## %bb.13:
	movq	_DISPPLANE_MIRROR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
LBB0_14:
	orl	%r15d, %ebx
	orl	%ebx, %eax
	jmp	LBB0_15
LBB0_6:
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_MISSING_CASE
	xorl	%eax, %eax
LBB0_15:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DISPLAY_PLANE_ENABLE,4,2       ## @DISPLAY_PLANE_ENABLE
	.comm	_DISPPLANE_TRICKLE_FEED_DISABLE,4,2 ## @DISPPLANE_TRICKLE_FEED_DISABLE
	.comm	_DISPPLANE_8BPP,4,2             ## @DISPPLANE_8BPP
	.comm	_DISPPLANE_BGRX555,4,2          ## @DISPPLANE_BGRX555
	.comm	_DISPPLANE_BGRX565,4,2          ## @DISPPLANE_BGRX565
	.comm	_DISPPLANE_BGRX888,4,2          ## @DISPPLANE_BGRX888
	.comm	_DISPPLANE_RGBX888,4,2          ## @DISPPLANE_RGBX888
	.comm	_DISPPLANE_BGRX101010,4,2       ## @DISPPLANE_BGRX101010
	.comm	_DISPPLANE_RGBX101010,4,2       ## @DISPPLANE_RGBX101010
	.comm	_I915_FORMAT_MOD_X_TILED,8,3    ## @I915_FORMAT_MOD_X_TILED
	.comm	_DISPPLANE_TILED,4,2            ## @DISPPLANE_TILED
	.comm	_DRM_MODE_ROTATE_180,4,2        ## @DRM_MODE_ROTATE_180
	.comm	_DISPPLANE_ROTATE_180,4,2       ## @DISPPLANE_ROTATE_180
	.comm	_DRM_MODE_REFLECT_X,4,2         ## @DRM_MODE_REFLECT_X
	.comm	_DISPPLANE_MIRROR,4,2           ## @DISPPLANE_MIRROR
	.no_dead_strip	_i9xx_plane_ctl
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.i9xx_plane_ctl
l_switch.table.i9xx_plane_ctl:
	.quad	_DISPPLANE_BGRX888
	.quad	_DISPPLANE_BGRX101010
	.quad	_DISPPLANE_BGRX555
	.quad	_DISPPLANE_RGBX888
	.quad	_DISPPLANE_RGBX101010
	.quad	_DISPPLANE_BGRX565
	.quad	_DISPPLANE_8BPP

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i9xx_plane_ctl
_i9xx_plane_ctl:                        ; @i9xx_plane_ctl
	.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	x20, x1
	ldr	x8, [x1, #16]
	ldr	w0, [x8]
	bl	_to_i915
	mov	x19, x0
	ldr	x21, [x20, #8]
	ldr	w20, [x20]
Lloh0:
	adrp	x8, _DISPLAY_PLANE_ENABLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DISPLAY_PLANE_ENABLE@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	bl	_IS_G4X
	cbnz	x0, LBB0_4
; %bb.1:
	mov	x0, x19
	mov	w1, #5
	bl	_IS_GEN
	cbnz	x0, LBB0_4
; %bb.2:
	mov	x0, x19
	mov	w1, #6
	bl	_IS_GEN
	cbnz	x0, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_IS_IVYBRIDGE
	cbz	x0, LBB0_5
LBB0_4:
Lloh3:
	adrp	x8, _DISPPLANE_TRICKLE_FEED_DISABLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DISPPLANE_TRICKLE_FEED_DISABLE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	orr	w22, w8, w22
LBB0_5:
	ldr	x8, [x21, #8]
	ldr	w0, [x8]
	sub	w8, w0, #128
	cmp	w8, #7
	b.hs	LBB0_10
; %bb.6:
Lloh6:
	adrp	x9, l_switch.table.i9xx_plane_ctl@PAGE
Lloh7:
	add	x9, x9, l_switch.table.i9xx_plane_ctl@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	ldr	w8, [x8]
	orr	w22, w8, w22
	mov	x0, x19
	bl	_INTEL_GEN
	cmp	w0, #4
	b.lt	LBB0_9
; %bb.7:
	ldr	x8, [x21]
Lloh8:
	adrp	x9, _I915_FORMAT_MOD_X_TILED@GOTPAGE
Lloh9:
	ldr	x9, [x9, _I915_FORMAT_MOD_X_TILED@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.8:
Lloh11:
	adrp	x8, _DISPPLANE_TILED@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DISPPLANE_TILED@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	orr	w22, w8, w22
LBB0_9:
Lloh14:
	adrp	x8, _DRM_MODE_ROTATE_180@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DRM_MODE_ROTATE_180@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, _DISPPLANE_ROTATE_180@GOTPAGE
Lloh18:
	ldr	x9, [x9, _DISPPLANE_ROTATE_180@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	tst	w8, w20
	csel	w8, wzr, w9, eq
	orr	w8, w8, w22
Lloh20:
	adrp	x9, _DRM_MODE_REFLECT_X@GOTPAGE
Lloh21:
	ldr	x9, [x9, _DRM_MODE_REFLECT_X@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
Lloh23:
	adrp	x10, _DISPPLANE_MIRROR@GOTPAGE
Lloh24:
	ldr	x10, [x10, _DISPPLANE_MIRROR@GOTPAGEOFF]
Lloh25:
	ldr	w10, [x10]
	tst	w9, w20
	csel	w9, wzr, w10, eq
	orr	w0, w8, w9
	b	LBB0_11
LBB0_10:
	bl	_MISSING_CASE
	mov	w0, #0
LBB0_11:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_DISPLAY_PLANE_ENABLE,4,2       ; @DISPLAY_PLANE_ENABLE
	.comm	_DISPPLANE_TRICKLE_FEED_DISABLE,4,2 ; @DISPPLANE_TRICKLE_FEED_DISABLE
	.comm	_DISPPLANE_8BPP,4,2             ; @DISPPLANE_8BPP
	.comm	_DISPPLANE_BGRX555,4,2          ; @DISPPLANE_BGRX555
	.comm	_DISPPLANE_BGRX565,4,2          ; @DISPPLANE_BGRX565
	.comm	_DISPPLANE_BGRX888,4,2          ; @DISPPLANE_BGRX888
	.comm	_DISPPLANE_RGBX888,4,2          ; @DISPPLANE_RGBX888
	.comm	_DISPPLANE_BGRX101010,4,2       ; @DISPPLANE_BGRX101010
	.comm	_DISPPLANE_RGBX101010,4,2       ; @DISPPLANE_RGBX101010
	.comm	_I915_FORMAT_MOD_X_TILED,8,3    ; @I915_FORMAT_MOD_X_TILED
	.comm	_DISPPLANE_TILED,4,2            ; @DISPPLANE_TILED
	.comm	_DRM_MODE_ROTATE_180,4,2        ; @DRM_MODE_ROTATE_180
	.comm	_DISPPLANE_ROTATE_180,4,2       ; @DISPPLANE_ROTATE_180
	.comm	_DRM_MODE_REFLECT_X,4,2         ; @DRM_MODE_REFLECT_X
	.comm	_DISPPLANE_MIRROR,4,2           ; @DISPPLANE_MIRROR
	.no_dead_strip	_i9xx_plane_ctl
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.i9xx_plane_ctl
l_switch.table.i9xx_plane_ctl:
	.quad	_DISPPLANE_BGRX888
	.quad	_DISPPLANE_BGRX101010
	.quad	_DISPPLANE_BGRX555
	.quad	_DISPPLANE_RGBX888
	.quad	_DISPPLANE_RGBX101010
	.quad	_DISPPLANE_BGRX565
	.quad	_DISPPLANE_8BPP

.subsections_via_symbols
