	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cdn_dp_enable_phy
_cdn_dp_enable_phy:                     ## @cdn_dp_enable_phy
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	cmpl	$0, (%rsi)
	je	LBB0_1
LBB0_4:
	movq	_GRF_SOC_CON26@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DPTX_HPD_SEL_MASK@GOTPCREL(%rip), %rax
	movq	_DPTX_HPD_SEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r14, %rdi
	callq	_cdn_dp_grf_write
	testl	%eax, %eax
	je	LBB0_10
## %bb.5:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_6:
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_DRM_DEV_ERROR
	jmp	LBB0_7
LBB0_1:
	movl	4(%r15), %edi
	callq	_phy_power_on
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_9
LBB0_10:
	movq	%r14, %rdi
	callq	_cdn_dp_get_hpd_status
	testl	%eax, %eax
	jle	LBB0_11
## %bb.14:
	movl	16(%r15), %edi
	movq	_EXTCON_DISP_DP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_EXTCON_PROP_USB_TYPEC_POLARITY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-32(%rbp), %rcx
	callq	_extcon_get_property
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_13
LBB0_3:
	movl	$1, (%r15)
	jmp	LBB0_4
LBB0_11:
	movl	%eax, %ebx
	jne	LBB0_7
## %bb.12:
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
LBB0_13:
	xorl	%eax, %eax
	callq	_DRM_DEV_ERROR
LBB0_7:
	movl	4(%r15), %edi
	callq	_phy_power_off
	testq	%rax, %rax
	je	LBB0_19
## %bb.8:
	movl	(%r14), %edi
	leaq	L_.str.5(%rip), %rsi
LBB0_9:
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_DRM_DEV_ERROR
	jmp	LBB0_20
LBB0_19:
	movl	$0, (%r15)
LBB0_20:
	movq	_GRF_SOC_CON26@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DPTX_HPD_SEL_MASK@GOTPCREL(%rip), %rax
	movq	_DPTX_HPD_DEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r14, %rdi
	callq	_cdn_dp_grf_write
LBB0_21:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	%r15, %rdi
	callq	_cdn_dp_get_port_lanes
	movl	%eax, 12(%r15)
	movl	-32(%rbp), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_cdn_dp_set_host_cap
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_6
LBB0_18:
	movl	8(%r15), %eax
	movl	%eax, 4(%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"phy power on failed: %d\n"

	.comm	_GRF_SOC_CON26,4,2              ## @GRF_SOC_CON26
	.comm	_DPTX_HPD_SEL_MASK,4,2          ## @DPTX_HPD_SEL_MASK
	.comm	_DPTX_HPD_SEL,4,2               ## @DPTX_HPD_SEL
L_.str.1:                               ## @.str.1
	.asciz	"Failed to write HPD_SEL %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"hpd does not exist\n"

	.comm	_EXTCON_DISP_DP,4,2             ## @EXTCON_DISP_DP
	.comm	_EXTCON_PROP_USB_TYPEC_POLARITY,4,2 ## @EXTCON_PROP_USB_TYPEC_POLARITY
L_.str.3:                               ## @.str.3
	.asciz	"get property failed\n"

L_.str.4:                               ## @.str.4
	.asciz	"set host capabilities failed: %d\n"

L_.str.5:                               ## @.str.5
	.asciz	"phy power off failed: %d"

	.comm	_DPTX_HPD_DEL,4,2               ## @DPTX_HPD_DEL
	.no_dead_strip	_cdn_dp_enable_phy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cdn_dp_enable_phy
_cdn_dp_enable_phy:                     ; @cdn_dp_enable_phy
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	w8, [x1]
Lloh0:
	adrp	x22, _GRF_SOC_CON26@GOTPAGE
Lloh1:
	ldr	x22, [x22, _GRF_SOC_CON26@GOTPAGEOFF]
Lloh2:
	adrp	x23, _DPTX_HPD_SEL_MASK@GOTPAGE
Lloh3:
	ldr	x23, [x23, _DPTX_HPD_SEL_MASK@GOTPAGEOFF]
	cbz	w8, LBB0_6
LBB0_1:
	ldr	w1, [x22]
	ldr	w8, [x23]
Lloh4:
	adrp	x9, _DPTX_HPD_SEL@GOTPAGE
Lloh5:
	ldr	x9, [x9, _DPTX_HPD_SEL@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_cdn_dp_grf_write
	cbz	w0, LBB0_8
; %bb.2:
	mov	x21, x0
	ldr	w0, [x19]
	str	x21, [sp]
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_3:
	bl	_DRM_DEV_ERROR
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
LBB0_4:
	ldr	w0, [x20, #4]
	bl	_phy_power_off
	cbz	x0, LBB0_11
; %bb.5:
	ldr	w0, [x19]
	mov	x8, x21
	str	x8, [sp]
Lloh9:
	adrp	x1, l_.str.5@PAGE
Lloh10:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_DRM_DEV_ERROR
	b	LBB0_12
LBB0_6:
	ldr	w0, [x20, #4]
	bl	_phy_power_on
	cbz	w0, LBB0_14
; %bb.7:
	mov	x21, x0
	ldr	w0, [x19]
	str	x21, [sp]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_DRM_DEV_ERROR
	b	LBB0_12
LBB0_8:
	mov	x0, x19
	bl	_cdn_dp_get_hpd_status
	cmp	w0, #0
	b.le	LBB0_15
; %bb.9:
	ldr	w0, [x20, #16]
Lloh13:
	adrp	x8, _EXTCON_DISP_DP@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EXTCON_DISP_DP@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x8, _EXTCON_PROP_USB_TYPEC_POLARITY@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EXTCON_PROP_USB_TYPEC_POLARITY@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	add	x3, sp, #8
	bl	_extcon_get_property
	cbz	w0, LBB0_17
; %bb.10:
	mov	x21, x0
	ldr	w0, [x19]
Lloh19:
	adrp	x1, l_.str.3@PAGE
Lloh20:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_DRM_DEV_ERROR
	b	LBB0_4
LBB0_11:
	str	wzr, [x20]
LBB0_12:
	ldr	w1, [x22]
	ldr	w8, [x23]
Lloh21:
	adrp	x9, _DPTX_HPD_DEL@GOTPAGE
Lloh22:
	ldr	x9, [x9, _DPTX_HPD_DEL@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_cdn_dp_grf_write
LBB0_13:
	mov	x0, x21
	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
LBB0_14:
	mov	w8, #1
	str	w8, [x20]
	b	LBB0_1
LBB0_15:
	mov	x21, x0
	cbnz	w0, LBB0_4
; %bb.16:
	ldr	w0, [x19]
Lloh24:
	adrp	x1, l_.str.2@PAGE
Lloh25:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_DRM_DEV_ERROR
	b	LBB0_4
LBB0_17:
	mov	x0, x20
	bl	_cdn_dp_get_port_lanes
	mov	x1, x0
	str	w0, [x20, #12]
	ldr	w2, [sp, #8]
	mov	x0, x19
	bl	_cdn_dp_set_host_cap
	mov	x21, x0
	cbz	w0, LBB0_19
; %bb.18:
	ldr	w0, [x19]
	str	x21, [sp]
Lloh26:
	adrp	x1, l_.str.4@PAGE
Lloh27:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_3
LBB0_19:
	ldr	w8, [x20, #8]
	str	w8, [x19, #4]
	b	LBB0_13
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"phy power on failed: %d\n"

	.comm	_GRF_SOC_CON26,4,2              ; @GRF_SOC_CON26
	.comm	_DPTX_HPD_SEL_MASK,4,2          ; @DPTX_HPD_SEL_MASK
	.comm	_DPTX_HPD_SEL,4,2               ; @DPTX_HPD_SEL
l_.str.1:                               ; @.str.1
	.asciz	"Failed to write HPD_SEL %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"hpd does not exist\n"

	.comm	_EXTCON_DISP_DP,4,2             ; @EXTCON_DISP_DP
	.comm	_EXTCON_PROP_USB_TYPEC_POLARITY,4,2 ; @EXTCON_PROP_USB_TYPEC_POLARITY
l_.str.3:                               ; @.str.3
	.asciz	"get property failed\n"

l_.str.4:                               ; @.str.4
	.asciz	"set host capabilities failed: %d\n"

l_.str.5:                               ; @.str.5
	.asciz	"phy power off failed: %d"

	.comm	_DPTX_HPD_DEL,4,2               ; @DPTX_HPD_DEL
	.no_dead_strip	_cdn_dp_enable_phy
.subsections_via_symbols
