	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_crtc_set_crc_source      ## -- Begin function intel_crtc_set_crc_source
	.p2align	4, 0x90
_intel_crtc_set_crc_source:             ## @intel_crtc_set_crc_source
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movl	8(%rdi), %edi
	callq	_to_i915
	movq	%rax, %r14
	movq	(%rax), %r13
	movq	(%r15), %r12
	movl	$0, -48(%rbp)
	leaq	-44(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_display_crc_ctl_parse_source
	testq	%rax, %rax
	js	LBB0_1
## %bb.2:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	(%r15), %rdi
	callq	_POWER_DOMAIN_PIPE
	movl	%eax, %ebx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_intel_display_power_get_if_enabled
	testl	%eax, %eax
	je	LBB0_3
## %bb.5:
	movl	%eax, %r12d
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movl	-44(%rbp), %ecx
	movq	_INTEL_PIPE_CRC_SOURCE_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%ecx, -64(%rbp)                 ## 4-byte Spill
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	cmpl	%eax, %ecx
	je	LBB0_7
## %bb.6:
	movq	%r15, %rdi
	callq	_to_intel_crtc
	movl	%eax, %edi
	movl	$1, %esi
	callq	_intel_crtc_crc_setup_workarounds
LBB0_7:
	movq	(%r15), %rsi
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rcx
	movq	%r14, %rdi
	callq	_get_new_crc_ctl_reg
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.8:
	movl	-44(%rbp), %eax
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	shlq	$4, %rdx
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	%eax, (%rcx,%rdx)
	movq	(%r15), %rdi
	callq	_PIPE_CRC_CTL
	movl	-48(%rbp), %esi
	movl	%eax, %edi
	callq	_I915_WRITE
	movq	(%r15), %rdi
	callq	_PIPE_CRC_CTL
	movl	%eax, %edi
	callq	_POSTING_READ
	cmpl	$0, -44(%rbp)
	jne	LBB0_12
## %bb.9:
	movq	%r14, %rdi
	callq	_IS_VALLEYVIEW
	testq	%rax, %rax
	jne	LBB0_11
## %bb.10:
	movq	%r14, %rdi
	callq	_IS_CHERRYVIEW
	testq	%rax, %rax
	je	LBB0_12
LBB0_11:
	movq	(%r15), %rsi
	movq	%r14, %rdi
	callq	_vlv_undo_pipe_scramble_reset
LBB0_12:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	$0, 8(%rax,%rcx)
LBB0_13:
	movl	-60(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, -64(%rbp)                 ## 4-byte Folded Reload
	jne	LBB0_15
## %bb.14:
	movq	%r15, %rdi
	callq	_to_intel_crtc
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_intel_crtc_crc_setup_workarounds
LBB0_15:
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	callq	_intel_display_power_put
	jmp	LBB0_16
LBB0_1:
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	callq	_DRM_DEBUG_DRIVER
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_DEBUG_KMS
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_16:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown source %s\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Trying to capture CRC while pipe is off\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_INTEL_PIPE_CRC_SOURCE_NONE,4,2 ## @INTEL_PIPE_CRC_SOURCE_NONE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_crtc_set_crc_source      ; -- Begin function intel_crtc_set_crc_source
	.p2align	2
_intel_crtc_set_crc_source:             ; @intel_crtc_set_crc_source
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x21, x1
	mov	x20, x0
	ldr	w0, [x0, #8]
	bl	_to_i915
	mov	x19, x0
	ldr	x24, [x0]
	ldr	x25, [x20]
	str	wzr, [sp, #8]
	add	x1, sp, #12
	mov	x0, x21
	bl	_display_crc_ctl_parse_source
	tbnz	x0, #63, LBB0_8
; %bb.1:
	ldr	x0, [x20]
	bl	_POWER_DOMAIN_PIPE
	mov	x21, x0
	mov	x0, x19
	mov	x1, x21
	bl	_intel_display_power_get_if_enabled
	cbz	w0, LBB0_9
; %bb.2:
	mov	x22, x0
	ldr	w26, [sp, #12]
Lloh0:
	adrp	x8, _INTEL_PIPE_CRC_SOURCE_NONE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INTEL_PIPE_CRC_SOURCE_NONE@GOTPAGEOFF]
Lloh2:
	ldr	w27, [x8]
	cmp	w26, w27
	b.eq	LBB0_4
; %bb.3:
	mov	x0, x20
	bl	_to_intel_crtc
	mov	w1, #1
	bl	_intel_crtc_crc_setup_workarounds
LBB0_4:
	ldr	x1, [x20]
	add	x2, sp, #12
	add	x3, sp, #8
	mov	x0, x19
	bl	_get_new_crc_ctl_reg
	mov	x23, x0
	cbz	w0, LBB0_12
; %bb.5:
	cmp	w26, w27
	b.ne	LBB0_7
LBB0_6:
	mov	x0, x20
	bl	_to_intel_crtc
	mov	w1, #0
	bl	_intel_crtc_crc_setup_workarounds
LBB0_7:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	bl	_intel_display_power_put
	b	LBB0_11
LBB0_8:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_DRM_DEBUG_DRIVER
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG_KMS
Lloh9:
	adrp	x8, _EIO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_11:
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_12:
	ldr	w8, [sp, #12]
	lsl	x9, x25, #4
	str	w8, [x24, x9]
	ldr	x0, [x20]
	bl	_PIPE_CRC_CTL
	ldr	w1, [sp, #8]
	bl	_I915_WRITE
	ldr	x0, [x20]
	bl	_PIPE_CRC_CTL
	bl	_POSTING_READ
	ldr	w8, [sp, #12]
	cbnz	w8, LBB0_16
; %bb.13:
	mov	x0, x19
	bl	_IS_VALLEYVIEW
	cbnz	x0, LBB0_15
; %bb.14:
	mov	x0, x19
	bl	_IS_CHERRYVIEW
	cbz	x0, LBB0_16
LBB0_15:
	ldr	x1, [x20]
	mov	x0, x19
	bl	_vlv_undo_pipe_scramble_reset
LBB0_16:
	add	x8, x24, x25, lsl #4
	str	xzr, [x8, #8]
	cmp	w26, w27
	b.eq	LBB0_6
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown source %s\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Trying to capture CRC while pipe is off\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_INTEL_PIPE_CRC_SOURCE_NONE,4,2 ; @INTEL_PIPE_CRC_SOURCE_NONE
.subsections_via_symbols
