	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cdv_intel_crt_detect_hotplug
_cdv_intel_crt_detect_hotplug:          ## @cdv_intel_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_PORT_HOTPLUG_EN@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_REG_READ
	movq	_CRT_HOTPLUG_DETECT_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	notl	%r15d
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	andl	%eax, %r15d
	movq	_CRT_HOTPLUG_FORCE_DETECT@GOTPCREL(%rip), %r13
	orl	(%r13), %r15d
	movq	_CRT_HOTPLUG_ACTIVATION_PERIOD_64@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movq	_CRT_HOTPLUG_VOLTAGE_COMPARE_50@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movl	(%r12), %edi
	movl	%r15d, %esi
	callq	_REG_WRITE
	movq	_jiffies@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_msecs_to_jiffies
	movq	%rax, %rbx
	addq	-56(%rbp), %rbx                 ## 8-byte Folded Reload
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edi
	callq	_REG_READ
	testl	%eax, (%r13)
	je	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$1, %edi
	callq	_msleep
	movq	(%r14), %rsi
	movq	%rbx, %rdi
	callq	_time_after
	testq	%rax, %rax
	jne	LBB0_1
LBB0_3:
	movl	(%r12), %edi
	movl	%r15d, %esi
	callq	_REG_WRITE
	movq	(%r14), %r15
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_msecs_to_jiffies
	movq	%rax, %rbx
	addq	%r15, %rbx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edi
	callq	_REG_READ
	testl	%eax, (%r13)
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	$1, %edi
	callq	_msleep
	movq	(%r14), %rsi
	movq	%rbx, %rdi
	callq	_time_after
	testq	%rax, %rax
	jne	LBB0_4
LBB0_6:
	movq	_PORT_HOTPLUG_STAT@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_REG_READ
	movq	_CRT_HOTPLUG_MONITOR_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_CRT_HOTPLUG_MONITOR_NONE@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpl	(%rcx), %eax
	setne	%bl
	movl	(%r14), %edi
	movq	_CRT_HOTPLUG_INT_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_REG_WRITE
	movl	(%r12), %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_REG_WRITE
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PORT_HOTPLUG_EN,4,2            ## @PORT_HOTPLUG_EN
	.comm	_CRT_HOTPLUG_DETECT_MASK,4,2    ## @CRT_HOTPLUG_DETECT_MASK
	.comm	_CRT_HOTPLUG_FORCE_DETECT,4,2   ## @CRT_HOTPLUG_FORCE_DETECT
	.comm	_CRT_HOTPLUG_ACTIVATION_PERIOD_64,4,2 ## @CRT_HOTPLUG_ACTIVATION_PERIOD_64
	.comm	_CRT_HOTPLUG_VOLTAGE_COMPARE_50,4,2 ## @CRT_HOTPLUG_VOLTAGE_COMPARE_50
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_PORT_HOTPLUG_STAT,4,2          ## @PORT_HOTPLUG_STAT
	.comm	_CRT_HOTPLUG_MONITOR_MASK,4,2   ## @CRT_HOTPLUG_MONITOR_MASK
	.comm	_CRT_HOTPLUG_MONITOR_NONE,4,2   ## @CRT_HOTPLUG_MONITOR_NONE
	.comm	_CRT_HOTPLUG_INT_STATUS,4,2     ## @CRT_HOTPLUG_INT_STATUS
	.no_dead_strip	_cdv_intel_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 cdv_intel_crt_detect_hotplug
_cdv_intel_crt_detect_hotplug:          ; @cdv_intel_crt_detect_hotplug
	.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
Lloh0:
	adrp	x22, _PORT_HOTPLUG_EN@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PORT_HOTPLUG_EN@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_REG_READ
	mov	x19, x0
Lloh2:
	adrp	x8, _CRT_HOTPLUG_DETECT_MASK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CRT_HOTPLUG_DETECT_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x23, _CRT_HOTPLUG_FORCE_DETECT@GOTPAGE
Lloh6:
	ldr	x23, [x23, _CRT_HOTPLUG_FORCE_DETECT@GOTPAGEOFF]
	bic	w8, w0, w8
	ldr	w9, [x23]
	orr	w8, w8, w9
Lloh7:
	adrp	x9, _CRT_HOTPLUG_ACTIVATION_PERIOD_64@GOTPAGE
Lloh8:
	ldr	x9, [x9, _CRT_HOTPLUG_ACTIVATION_PERIOD_64@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh10:
	adrp	x9, _CRT_HOTPLUG_VOLTAGE_COMPARE_50@GOTPAGE
Lloh11:
	ldr	x9, [x9, _CRT_HOTPLUG_VOLTAGE_COMPARE_50@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w20, w8, w9
	ldr	w0, [x22]
	mov	x1, x20
	bl	_REG_WRITE
Lloh13:
	adrp	x24, _jiffies@GOTPAGE
Lloh14:
	ldr	x24, [x24, _jiffies@GOTPAGEOFF]
	ldr	x21, [x24]
	mov	w0, #1000
	bl	_msecs_to_jiffies
	add	x21, x0, x21
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x22]
	bl	_REG_READ
	ldr	w8, [x23]
	tst	w8, w0
	b.eq	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w0, #1
	bl	_msleep
	ldr	x1, [x24]
	mov	x0, x21
	bl	_time_after
	cbnz	x0, LBB0_1
LBB0_3:
	ldr	w0, [x22]
	mov	x1, x20
	bl	_REG_WRITE
	ldr	x20, [x24]
	mov	w0, #1000
	bl	_msecs_to_jiffies
	add	x20, x0, x20
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x22]
	bl	_REG_READ
	ldr	w8, [x23]
	tst	w8, w0
	b.eq	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #1
	bl	_msleep
	ldr	x1, [x24]
	mov	x0, x20
	bl	_time_after
	cbnz	x0, LBB0_4
LBB0_6:
Lloh15:
	adrp	x21, _PORT_HOTPLUG_STAT@GOTPAGE
Lloh16:
	ldr	x21, [x21, _PORT_HOTPLUG_STAT@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_REG_READ
Lloh17:
	adrp	x8, _CRT_HOTPLUG_MONITOR_MASK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _CRT_HOTPLUG_MONITOR_MASK@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh20:
	adrp	x9, _CRT_HOTPLUG_MONITOR_NONE@GOTPAGE
Lloh21:
	ldr	x9, [x9, _CRT_HOTPLUG_MONITOR_NONE@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w20, ne
	ldr	w0, [x21]
Lloh23:
	adrp	x8, _CRT_HOTPLUG_INT_STATUS@GOTPAGE
Lloh24:
	ldr	x8, [x8, _CRT_HOTPLUG_INT_STATUS@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	bl	_REG_WRITE
	ldr	w0, [x22]
	mov	x1, x19
	bl	_REG_WRITE
	mov	x0, x20
	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 AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_PORT_HOTPLUG_EN,4,2            ; @PORT_HOTPLUG_EN
	.comm	_CRT_HOTPLUG_DETECT_MASK,4,2    ; @CRT_HOTPLUG_DETECT_MASK
	.comm	_CRT_HOTPLUG_FORCE_DETECT,4,2   ; @CRT_HOTPLUG_FORCE_DETECT
	.comm	_CRT_HOTPLUG_ACTIVATION_PERIOD_64,4,2 ; @CRT_HOTPLUG_ACTIVATION_PERIOD_64
	.comm	_CRT_HOTPLUG_VOLTAGE_COMPARE_50,4,2 ; @CRT_HOTPLUG_VOLTAGE_COMPARE_50
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_PORT_HOTPLUG_STAT,4,2          ; @PORT_HOTPLUG_STAT
	.comm	_CRT_HOTPLUG_MONITOR_MASK,4,2   ; @CRT_HOTPLUG_MONITOR_MASK
	.comm	_CRT_HOTPLUG_MONITOR_NONE,4,2   ; @CRT_HOTPLUG_MONITOR_NONE
	.comm	_CRT_HOTPLUG_INT_STATUS,4,2     ; @CRT_HOTPLUG_INT_STATUS
	.no_dead_strip	_cdv_intel_crt_detect_hotplug
.subsections_via_symbols
