	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function valleyview_crt_detect_hotplug
_valleyview_crt_detect_hotplug:         ## @valleyview_crt_detect_hotplug
	.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	(%rdi), %rbx
	callq	_intel_attached_crt
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_to_i915
	movq	%rax, %r14
	movl	(%r13), %esi
	movq	%rax, %rdi
	callq	_intel_hpd_disable
	movl	%eax, %r15d
	movl	4(%r13), %edi
	callq	_I915_READ
	movl	%eax, %r12d
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	movq	_ADPA_CRT_HOTPLUG_FORCE_TRIGGER@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	orl	%r12d, %esi
	movl	4(%r13), %edi
	callq	_I915_WRITE
	movl	4(%r13), %esi
	movl	(%rbx), %edx
	movq	%r14, %rdi
	movl	$1000, %ecx                     ## imm = 0x3E8
	callq	_intel_de_wait_for_clear
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	movl	4(%r13), %edi
	movl	%r12d, %esi
	callq	_I915_WRITE
LBB0_2:
	movl	4(%r13), %edi
	callq	_I915_READ
	movq	_ADPA_CRT_HOTPLUG_MONITOR_MASK@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	setne	%bl
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	testl	%r15d, %r15d
	je	LBB0_4
## %bb.3:
	movl	(%r13), %esi
	movq	%r14, %rdi
	callq	_intel_hpd_enable
LBB0_4:
	movl	%ebx, %eax
	addq	$8, %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	"trigger hotplug detect cycle: adpa=0x%x\n"

	.comm	_ADPA_CRT_HOTPLUG_FORCE_TRIGGER,4,2 ## @ADPA_CRT_HOTPLUG_FORCE_TRIGGER
L_.str.1:                               ## @.str.1
	.asciz	"timed out waiting for FORCE_TRIGGER"

	.comm	_ADPA_CRT_HOTPLUG_MONITOR_MASK,4,2 ## @ADPA_CRT_HOTPLUG_MONITOR_MASK
L_.str.2:                               ## @.str.2
	.asciz	"valleyview hotplug adpa=0x%x, result %d\n"

	.no_dead_strip	_valleyview_crt_detect_hotplug
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function valleyview_crt_detect_hotplug
_valleyview_crt_detect_hotplug:         ; @valleyview_crt_detect_hotplug
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldr	x20, [x0]
	bl	_intel_attached_crt
	mov	x19, x0
	mov	x0, x20
	bl	_to_i915
	mov	x20, x0
	ldr	w1, [x19]
	bl	_intel_hpd_disable
	mov	x21, x0
	ldr	w0, [x19, #4]
	bl	_I915_READ
	mov	x22, x0
	str	x22, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_KMS
Lloh2:
	adrp	x23, _ADPA_CRT_HOTPLUG_FORCE_TRIGGER@GOTPAGE
Lloh3:
	ldr	x23, [x23, _ADPA_CRT_HOTPLUG_FORCE_TRIGGER@GOTPAGEOFF]
	ldr	w8, [x23]
	orr	w1, w8, w22
	ldr	w0, [x19, #4]
	bl	_I915_WRITE
	ldr	w1, [x19, #4]
	ldr	w2, [x23]
	mov	x0, x20
	mov	w3, #1000
	bl	_intel_de_wait_for_clear
	cbz	x0, LBB0_2
; %bb.1:
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG_KMS
	ldr	w0, [x19, #4]
	mov	x1, x22
	bl	_I915_WRITE
LBB0_2:
	ldr	w0, [x19, #4]
	bl	_I915_READ
                                        ; kill: def $w0 killed $w0 def $x0
Lloh6:
	adrp	x8, _ADPA_CRT_HOTPLUG_MONITOR_MASK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ADPA_CRT_HOTPLUG_MONITOR_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w0
	cset	w22, ne
	stp	x0, x22, [sp]
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_DEBUG_KMS
	cbz	w21, LBB0_4
; %bb.3:
	ldr	w1, [x19]
	mov	x0, x20
	bl	_intel_hpd_enable
LBB0_4:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"trigger hotplug detect cycle: adpa=0x%x\n"

	.comm	_ADPA_CRT_HOTPLUG_FORCE_TRIGGER,4,2 ; @ADPA_CRT_HOTPLUG_FORCE_TRIGGER
l_.str.1:                               ; @.str.1
	.asciz	"timed out waiting for FORCE_TRIGGER"

	.comm	_ADPA_CRT_HOTPLUG_MONITOR_MASK,4,2 ; @ADPA_CRT_HOTPLUG_MONITOR_MASK
l_.str.2:                               ; @.str.2
	.asciz	"valleyview hotplug adpa=0x%x, result %d\n"

	.no_dead_strip	_valleyview_crt_detect_hotplug
.subsections_via_symbols
