	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv50_crtc_set_dither
_nv50_crtc_set_dither:                  ## @nv50_crtc_set_dither
	.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
	movl	%esi, %r14d
	movq	%rdi, %r12
	movl	16(%rdi), %edi
	callq	_nv50_mast
	movq	%rax, %r15
	movq	%r12, %rdi
	callq	_nouveau_crtc_connector_get
	movq	(%rax), %r13
	movq	_DITHERING_MODE_AUTO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %r13
	jne	LBB0_3
## %bb.1:
	movq	8(%r12), %rcx
	movl	12(%rax), %edx
	leal	(%rdx,%rdx,2), %edx
	xorl	%r13d, %r13d
	cmpl	%edx, (%rcx)
	jle	LBB0_3
## %bb.2:
	movq	_DITHERING_MODE_DYNAMIC2X2@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
LBB0_3:
	movl	8(%rax), %ecx
	movq	_DITHERING_DEPTH_AUTO@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_6
## %bb.4:
	cmpl	$8, 12(%rax)
	jl	LBB0_7
## %bb.5:
	movq	_DITHERING_DEPTH_8BPC@GOTPCREL(%rip), %rax
	orl	(%rax), %r13d
	jmp	LBB0_7
LBB0_6:
	orl	%r13d, %ecx
	movl	%ecx, %r13d
LBB0_7:
	movq	%r15, %rdi
	movl	$4, %esi
	callq	_evo_wait
	testq	%rax, %rax
	je	LBB0_16
## %bb.8:
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_nv50_vers
	movq	_NVD0_DISP_MAST_CLASS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_10
## %bb.9:
	movl	(%r12), %esi
	shll	$10, %esi
	addl	$2208, %esi                     ## imm = 0x8A0
	jmp	LBB0_13
LBB0_10:
	movq	%r15, %rdi
	callq	_nv50_vers
	movq	_NVE0_DISP_MAST_CLASS@GOTPCREL(%rip), %rcx
	movl	(%r12), %edx
	shll	$8, %edx
	leal	(%rdx,%rdx,2), %esi
	cmpq	(%rcx), %rax
	jge	LBB0_12
## %bb.11:
	addl	$1168, %esi                     ## imm = 0x490
	jmp	LBB0_13
LBB0_12:
	addl	$1184, %esi                     ## imm = 0x4A0
LBB0_13:
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_evo_mthd
	movq	%rbx, %rdi
	movl	%r13d, %esi
	callq	_evo_data
	testl	%r14d, %r14d
	je	LBB0_15
## %bb.14:
	movq	%rbx, %rdi
	movl	$128, %esi
	movl	$1, %edx
	callq	_evo_mthd
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_evo_data
LBB0_15:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_evo_kick
LBB0_16:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DITHERING_MODE_AUTO,8,3        ## @DITHERING_MODE_AUTO
	.comm	_DITHERING_MODE_DYNAMIC2X2,4,2  ## @DITHERING_MODE_DYNAMIC2X2
	.comm	_DITHERING_DEPTH_AUTO,4,2       ## @DITHERING_DEPTH_AUTO
	.comm	_DITHERING_DEPTH_8BPC,4,2       ## @DITHERING_DEPTH_8BPC
	.comm	_NVD0_DISP_MAST_CLASS,8,3       ## @NVD0_DISP_MAST_CLASS
	.comm	_NVE0_DISP_MAST_CLASS,8,3       ## @NVE0_DISP_MAST_CLASS
	.no_dead_strip	_nv50_crtc_set_dither
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv50_crtc_set_dither
_nv50_crtc_set_dither:                  ; @nv50_crtc_set_dither
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x22, x0
	ldr	w0, [x0, #16]
	bl	_nv50_mast
	mov	x19, x0
	mov	x0, x22
	bl	_nouveau_crtc_connector_get
	ldr	x21, [x0]
Lloh0:
	adrp	x8, _DITHERING_MODE_AUTO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DITHERING_MODE_AUTO@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x21, x8
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [x22, #8]
	ldr	w8, [x8]
	ldr	w9, [x0, #12]
	add	w9, w9, w9, lsl #1
Lloh3:
	adrp	x10, _DITHERING_MODE_DYNAMIC2X2@GOTPAGE
Lloh4:
	ldr	x10, [x10, _DITHERING_MODE_DYNAMIC2X2@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	cmp	w8, w9
	csel	w21, w10, wzr, gt
LBB0_2:
	ldr	w8, [x0, #8]
Lloh6:
	adrp	x9, _DITHERING_DEPTH_AUTO@GOTPAGE
Lloh7:
	ldr	x9, [x9, _DITHERING_DEPTH_AUTO@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_5
; %bb.3:
	ldr	w8, [x0, #12]
	cmp	w8, #8
	b.lt	LBB0_6
; %bb.4:
Lloh9:
	adrp	x8, _DITHERING_DEPTH_8BPC@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DITHERING_DEPTH_8BPC@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
LBB0_5:
	orr	w21, w8, w21
LBB0_6:
	mov	x0, x19
	mov	w1, #4
	bl	_evo_wait
	cbz	x0, LBB0_13
; %bb.7:
	mov	x23, x0
	mov	x0, x19
	bl	_nv50_vers
Lloh12:
	adrp	x8, _NVD0_DISP_MAST_CLASS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _NVD0_DISP_MAST_CLASS@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ge	LBB0_9
; %bb.8:
	ldr	w8, [x22]
	lsl	w8, w8, #10
	add	w1, w8, #2208
	b	LBB0_10
LBB0_9:
	mov	x0, x19
	bl	_nv50_vers
Lloh15:
	adrp	x8, _NVE0_DISP_MAST_CLASS@GOTPAGE
Lloh16:
	ldr	x8, [x8, _NVE0_DISP_MAST_CLASS@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	ldr	w9, [x22]
	add	w9, w9, w9, lsl #1
	lsl	w9, w9, #8
	cmp	x0, x8
	add	w8, w9, #1184
	add	w9, w9, #1168
	csel	w1, w8, w9, ge
LBB0_10:
	mov	x0, x23
	mov	w2, #1
	bl	_evo_mthd
	mov	x0, x23
	mov	x1, x21
	bl	_evo_data
	cbz	w20, LBB0_12
; %bb.11:
	mov	x0, x23
	mov	w1, #128
	mov	w2, #1
	bl	_evo_mthd
	mov	x0, x23
	mov	w1, #0
	bl	_evo_data
LBB0_12:
	mov	x0, x23
	mov	x1, x19
	bl	_evo_kick
LBB0_13:
	mov	w0, #0
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_DITHERING_MODE_AUTO,8,3        ; @DITHERING_MODE_AUTO
	.comm	_DITHERING_MODE_DYNAMIC2X2,4,2  ; @DITHERING_MODE_DYNAMIC2X2
	.comm	_DITHERING_DEPTH_AUTO,4,2       ; @DITHERING_DEPTH_AUTO
	.comm	_DITHERING_DEPTH_8BPC,4,2       ; @DITHERING_DEPTH_8BPC
	.comm	_NVD0_DISP_MAST_CLASS,8,3       ; @NVD0_DISP_MAST_CLASS
	.comm	_NVE0_DISP_MAST_CLASS,8,3       ; @NVE0_DISP_MAST_CLASS
	.no_dead_strip	_nv50_crtc_set_dither
.subsections_via_symbols
