	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function analogix_dp_bridge_atomic_enable
_analogix_dp_bridge_atomic_enable:      ## @analogix_dp_bridge_atomic_enable
	.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	%rsi, %rbx
	movq	(%rdi), %r15
	movq	%r15, %rdi
	callq	_analogix_dp_get_new_crtc
	testq	%rax, %rax
	je	LBB0_10
## %bb.1:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_drm_atomic_get_old_crtc_state
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	cmpq	$0, (%rax)
	je	LBB0_5
## %bb.3:
	movq	%r15, %rdi
	callq	_analogix_dp_disable_psr
	testl	%eax, %eax
	je	LBB0_10
## %bb.4:
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DRM_ERROR                      ## TAILCALL
LBB0_5:
	movq	(%r15), %rax
	movq	_DRM_MODE_DPMS_ON@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	je	LBB0_10
## %bb.6:
	movq	_MAX_PLL_LOCK_LOOP@GOTPCREL(%rip), %r13
	cmpl	$0, (%r13)
	jle	LBB0_12
## %bb.7:
	leaq	L_.str.1(%rip), %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_analogix_dp_set_bridge
	testq	%rax, %rax
	je	LBB0_9
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	8(%r15), %edi
	movq	%r14, %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_err
	incl	%ebx
	movl	$10, %edi
	movl	$11, %esi
	callq	_usleep_range
	cmpl	(%r13), %ebx
	jl	LBB0_8
LBB0_12:
	movl	8(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
LBB0_9:
	movq	(%r12), %rax
	movq	%rax, (%r15)
LBB0_10:
	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	"Failed to disable psr %d\n"

	.comm	_DRM_MODE_DPMS_ON,8,3           ## @DRM_MODE_DPMS_ON
	.comm	_MAX_PLL_LOCK_LOOP,4,2          ## @MAX_PLL_LOCK_LOOP
L_.str.1:                               ## @.str.1
	.asciz	"failed to set bridge, retry: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"too many times retry set bridge, give it up\n"

	.no_dead_strip	_analogix_dp_bridge_atomic_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function analogix_dp_bridge_atomic_enable
_analogix_dp_bridge_atomic_enable:      ; @analogix_dp_bridge_atomic_enable
	.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
	ldr	x19, [x0]
	mov	x0, x19
	bl	_analogix_dp_get_new_crtc
	cbz	x0, LBB0_12
; %bb.1:
	mov	x1, x0
	mov	x0, x20
	bl	_drm_atomic_get_old_crtc_state
	cbz	x0, LBB0_5
; %bb.2:
	ldr	x8, [x0]
	cbz	x8, LBB0_5
; %bb.3:
	mov	x0, x19
	bl	_analogix_dp_disable_psr
	cbz	w0, LBB0_12
; %bb.4:
	mov	x1, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	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
	b	_DRM_ERROR
LBB0_5:
	ldr	x8, [x19]
Lloh2:
	adrp	x21, _DRM_MODE_DPMS_ON@GOTPAGE
Lloh3:
	ldr	x21, [x21, _DRM_MODE_DPMS_ON@GOTPAGEOFF]
	ldr	x9, [x21]
	cmp	x8, x9
	b.eq	LBB0_12
; %bb.6:
Lloh4:
	adrp	x22, _MAX_PLL_LOCK_LOOP@GOTPAGE
Lloh5:
	ldr	x22, [x22, _MAX_PLL_LOCK_LOOP@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.7:
	mov	w23, #0
Lloh6:
	adrp	x20, l_.str.1@PAGE
Lloh7:
	add	x20, x20, l_.str.1@PAGEOFF
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_analogix_dp_set_bridge
	cbz	x0, LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w0, [x19, #8]
	str	x23, [sp]
	mov	x1, x20
	bl	_dev_err
	add	w23, w23, #1
	mov	w0, #10
	mov	w1, #11
	bl	_usleep_range
	ldr	w8, [x22]
	cmp	w23, w8
	b.lt	LBB0_8
LBB0_10:
	ldr	w0, [x19, #8]
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	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
	b	_dev_err
LBB0_11:
	ldr	x8, [x21]
	str	x8, [x19]
LBB0_12:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to disable psr %d\n"

	.comm	_DRM_MODE_DPMS_ON,8,3           ; @DRM_MODE_DPMS_ON
	.comm	_MAX_PLL_LOCK_LOOP,4,2          ; @MAX_PLL_LOCK_LOOP
l_.str.1:                               ; @.str.1
	.asciz	"failed to set bridge, retry: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"too many times retry set bridge, give it up\n"

	.no_dead_strip	_analogix_dp_bridge_atomic_enable
.subsections_via_symbols
