	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_lspcon_set_mode            ## -- Begin function drm_lspcon_set_mode
	.p2align	4, 0x90
_drm_lspcon_set_mode:                   ## @drm_lspcon_set_mode
	.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, %r15
	movl	$0, -44(%rbp)
	movq	_DRM_LSPCON_MODE_PCON@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jne	LBB0_2
## %bb.1:
	movq	_DP_DUAL_MODE_LSPCON_MODE_PCON@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
LBB0_2:
	movq	_DP_DUAL_MODE_LSPCON_MODE_CHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	movl	$4, %ecx
	callq	_drm_dp_dual_mode_write
	testl	%eax, %eax
	js	LBB0_10
## %bb.3:
	movl	$-200, %ebx
	leaq	-48(%rbp), %r12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_drm_lspcon_get_mode
	testl	%eax, %eax
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	%r14d, -48(%rbp)
	je	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	$10, %edi
	callq	_msleep
	addl	$10, %ebx
	jne	LBB0_4
## %bb.8:
	leaq	L_.str.5(%rip), %rdi
	callq	_DRM_ERROR
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_9
LBB0_10:
	movl	%eax, %r13d
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_9
LBB0_5:
	movl	%eax, %r13d
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_9
LBB0_11:
	movq	_DRM_LSPCON_MODE_LS@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	leaq	L_.str.3(%rip), %rax
	leaq	L_.str.4(%rip), %rsi
	cmoveq	%rax, %rsi
	leaq	L_.str.2(%rip), %rdi
	callq	_DRM_DEBUG_KMS
	xorl	%r13d, %r13d
LBB0_9:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_LSPCON_MODE_PCON,4,2       ## @DRM_LSPCON_MODE_PCON
	.comm	_DP_DUAL_MODE_LSPCON_MODE_PCON,4,2 ## @DP_DUAL_MODE_LSPCON_MODE_PCON
	.comm	_DP_DUAL_MODE_LSPCON_MODE_CHANGE,4,2 ## @DP_DUAL_MODE_LSPCON_MODE_CHANGE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"LSPCON mode change failed\n"

L_.str.1:                               ## @.str.1
	.asciz	"can't confirm LSPCON mode change\n"

L_.str.2:                               ## @.str.2
	.asciz	"LSPCON mode changed to %s\n"

	.comm	_DRM_LSPCON_MODE_LS,4,2         ## @DRM_LSPCON_MODE_LS
L_.str.3:                               ## @.str.3
	.asciz	"LS"

L_.str.4:                               ## @.str.4
	.asciz	"PCON"

L_.str.5:                               ## @.str.5
	.asciz	"LSPCON mode change timed out\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_lspcon_set_mode            ; -- Begin function drm_lspcon_set_mode
	.p2align	2
_drm_lspcon_set_mode:                   ; @drm_lspcon_set_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x1
	mov	x20, x0
	str	wzr, [sp, #12]
Lloh0:
	adrp	x8, _DRM_LSPCON_MODE_PCON@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRM_LSPCON_MODE_PCON@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _DP_DUAL_MODE_LSPCON_MODE_PCON@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DP_DUAL_MODE_LSPCON_MODE_PCON@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [sp, #12]
LBB0_2:
Lloh6:
	adrp	x8, _DP_DUAL_MODE_LSPCON_MODE_CHANGE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DP_DUAL_MODE_LSPCON_MODE_CHANGE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x20
	mov	w3, #4
	bl	_drm_dp_dual_mode_write
	tbnz	w0, #31, LBB0_8
; %bb.3:
	mov	w22, #-200
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #8
	mov	x0, x20
	bl	_drm_lspcon_get_mode
	cbnz	w0, LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [sp, #8]
	cmp	w8, w19
	b.eq	LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #10
	bl	_msleep
	adds	w22, w22, #10
	b.ne	LBB0_4
; %bb.7:
Lloh9:
	adrp	x0, l_.str.5@PAGE
Lloh10:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_DRM_ERROR
Lloh11:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_11
LBB0_8:
	mov	x21, x0
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_11
LBB0_9:
	mov	x21, x0
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_11
LBB0_10:
Lloh18:
	adrp	x8, _DRM_LSPCON_MODE_LS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _DRM_LSPCON_MODE_LS@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	adrp	x9, l_.str.4@PAGE
Lloh22:
	add	x9, x9, l_.str.4@PAGEOFF
Lloh23:
	adrp	x10, l_.str.3@PAGE
Lloh24:
	add	x10, x10, l_.str.3@PAGEOFF
	cmp	w8, w19
	csel	x1, x10, x9, eq
Lloh25:
	adrp	x0, l_.str.2@PAGE
Lloh26:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_DEBUG_KMS
	mov	w21, #0
LBB0_11:
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_LSPCON_MODE_PCON,4,2       ; @DRM_LSPCON_MODE_PCON
	.comm	_DP_DUAL_MODE_LSPCON_MODE_PCON,4,2 ; @DP_DUAL_MODE_LSPCON_MODE_PCON
	.comm	_DP_DUAL_MODE_LSPCON_MODE_CHANGE,4,2 ; @DP_DUAL_MODE_LSPCON_MODE_CHANGE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"LSPCON mode change failed\n"

l_.str.1:                               ; @.str.1
	.asciz	"can't confirm LSPCON mode change\n"

l_.str.2:                               ; @.str.2
	.asciz	"LSPCON mode changed to %s\n"

	.comm	_DRM_LSPCON_MODE_LS,4,2         ; @DRM_LSPCON_MODE_LS
l_.str.3:                               ; @.str.3
	.asciz	"LS"

l_.str.4:                               ; @.str.4
	.asciz	"PCON"

l_.str.5:                               ; @.str.5
	.asciz	"LSPCON mode change timed out\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
.subsections_via_symbols
