	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ps8622_pre_enable
_ps8622_pre_enable:                     ## @ps8622_pre_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	callq	_bridge_to_ps8622
	cmpl	$0, (%rax)
	je	LBB0_1
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_1:
	movq	%rax, %rbx
	movl	4(%rax), %edi
	xorl	%esi, %esi
	callq	_gpiod_set_value
	movq	16(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.2:
	callq	_regulator_enable
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_4:
	movl	12(%rbx), %edi
	callq	_drm_panel_prepare
	testq	%rax, %rax
	je	LBB0_5
## %bb.8:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_DRM_ERROR                      ## TAILCALL
LBB0_5:
	movl	8(%rbx), %edi
	movl	$1, %esi
	callq	_gpiod_set_value
	movq	_PS8622_RST_HIGH_T2_MIN_US@GOTPCREL(%rip), %rax
	movq	_PS8622_POWER_RISE_T1_MAX_US@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	addl	(%rax), %edi
	movq	_PS8622_RST_HIGH_T2_MAX_US@GOTPCREL(%rip), %rax
	movq	_PS8622_POWER_RISE_T1_MIN_US@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	addl	(%rax), %esi
	callq	_usleep_range
	movl	4(%rbx), %edi
	movl	$1, %esi
	callq	_gpiod_set_value
	movl	$20000, %edi                    ## imm = 0x4E20
	movl	$30000, %esi                    ## imm = 0x7530
	callq	_usleep_range
	movq	%rbx, %rdi
	callq	_ps8622_send_config
	testl	%eax, %eax
	je	LBB0_6
## %bb.9:
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_DRM_ERROR                      ## TAILCALL
LBB0_6:
	movl	$1, (%rbx)
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fails to enable ps8622->v12"

L_.str.1:                               ## @.str.1
	.asciz	"failed to prepare panel\n"

	.comm	_PS8622_RST_HIGH_T2_MIN_US,4,2  ## @PS8622_RST_HIGH_T2_MIN_US
	.comm	_PS8622_POWER_RISE_T1_MAX_US,4,2 ## @PS8622_POWER_RISE_T1_MAX_US
	.comm	_PS8622_RST_HIGH_T2_MAX_US,4,2  ## @PS8622_RST_HIGH_T2_MAX_US
	.comm	_PS8622_POWER_RISE_T1_MIN_US,4,2 ## @PS8622_POWER_RISE_T1_MIN_US
L_.str.2:                               ## @.str.2
	.asciz	"Failed to send config to bridge (%d)\n"

	.no_dead_strip	_ps8622_pre_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ps8622_pre_enable
_ps8622_pre_enable:                     ; @ps8622_pre_enable
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	bl	_bridge_to_ps8622
	ldr	w8, [x0]
	cbz	w8, LBB0_2
LBB0_1:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_2:
	mov	x19, x0
	ldr	w0, [x0, #4]
	mov	w1, #0
	bl	_gpiod_set_value
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_5
; %bb.3:
	bl	_regulator_enable
	cbz	w0, LBB0_5
; %bb.4:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_5:
	ldr	w0, [x19, #12]
	bl	_drm_panel_prepare
	cbz	x0, LBB0_7
; %bb.6:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_DRM_ERROR
LBB0_7:
	ldr	w0, [x19, #8]
	mov	w20, #1
	mov	w1, #1
	bl	_gpiod_set_value
Lloh4:
	adrp	x8, _PS8622_RST_HIGH_T2_MIN_US@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PS8622_RST_HIGH_T2_MIN_US@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _PS8622_POWER_RISE_T1_MAX_US@GOTPAGE
Lloh8:
	ldr	x9, [x9, _PS8622_POWER_RISE_T1_MAX_US@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
Lloh10:
	adrp	x10, _PS8622_RST_HIGH_T2_MAX_US@GOTPAGE
Lloh11:
	ldr	x10, [x10, _PS8622_RST_HIGH_T2_MAX_US@GOTPAGEOFF]
	add	w0, w9, w8
Lloh12:
	ldr	w8, [x10]
Lloh13:
	adrp	x9, _PS8622_POWER_RISE_T1_MIN_US@GOTPAGE
Lloh14:
	ldr	x9, [x9, _PS8622_POWER_RISE_T1_MIN_US@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	add	w1, w9, w8
	bl	_usleep_range
	ldr	w0, [x19, #4]
	mov	w1, #1
	bl	_gpiod_set_value
	mov	w0, #20000
	mov	w1, #30000
	bl	_usleep_range
	mov	x0, x19
	bl	_ps8622_send_config
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_9
; %bb.8:
	str	x0, [sp]
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_1
LBB0_9:
	str	w20, [x19]
	b	LBB0_1
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fails to enable ps8622->v12"

l_.str.1:                               ; @.str.1
	.asciz	"failed to prepare panel\n"

	.comm	_PS8622_RST_HIGH_T2_MIN_US,4,2  ; @PS8622_RST_HIGH_T2_MIN_US
	.comm	_PS8622_POWER_RISE_T1_MAX_US,4,2 ; @PS8622_POWER_RISE_T1_MAX_US
	.comm	_PS8622_RST_HIGH_T2_MAX_US,4,2  ; @PS8622_RST_HIGH_T2_MAX_US
	.comm	_PS8622_POWER_RISE_T1_MIN_US,4,2 ; @PS8622_POWER_RISE_T1_MIN_US
l_.str.2:                               ; @.str.2
	.asciz	"Failed to send config to bridge (%d)\n"

	.no_dead_strip	_ps8622_pre_enable
.subsections_via_symbols
