	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function jh057n_prepare
_jh057n_prepare:                        ## @jh057n_prepare
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	callq	_panel_to_jh057n
	xorl	%ebx, %ebx
	cmpl	$0, (%rax)
	je	LBB0_1
LBB0_6:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_1:
	movq	%rax, %r14
	movl	12(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_DRM_DEV_DEBUG_DRIVER
	movl	4(%r14), %edi
	callq	_regulator_enable
	testl	%eax, %eax
	js	LBB0_2
## %bb.3:
	movl	16(%r14), %edi
	callq	_regulator_enable
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movl	8(%r14), %edi
	movl	$1, %esi
	callq	_gpiod_set_value_cansleep
	movl	$20, %edi
	movl	$40, %esi
	callq	_usleep_range
	movl	8(%r14), %edi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_gpiod_set_value_cansleep
	movl	$20, %edi
	callq	_msleep
	movl	$1, (%r14)
	jmp	LBB0_6
LBB0_2:
	movl	%eax, %ebx
	movl	12(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	callq	_DRM_DEV_ERROR
	jmp	LBB0_6
LBB0_4:
	movl	%eax, %ebx
	movl	12(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edx
	callq	_DRM_DEV_ERROR
	movl	4(%r14), %edi
	callq	_regulator_disable
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Resetting the panel\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to enable vcc supply: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to enable iovcc supply: %d\n"

	.no_dead_strip	_jh057n_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function jh057n_prepare
_jh057n_prepare:                        ; @jh057n_prepare
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	bl	_panel_to_jh057n
	ldr	w8, [x0]
	cbz	w8, LBB0_3
; %bb.1:
	mov	w20, #0
LBB0_2:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_3:
	mov	x19, x0
	ldr	w0, [x0, #12]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_DRM_DEV_DEBUG_DRIVER
	ldr	w0, [x19, #4]
	bl	_regulator_enable
	tbnz	w0, #31, LBB0_6
; %bb.4:
	ldr	w0, [x19, #16]
	bl	_regulator_enable
	tbnz	w0, #31, LBB0_7
; %bb.5:
	ldr	w0, [x19, #8]
	mov	w21, #1
	mov	w1, #1
	bl	_gpiod_set_value_cansleep
	mov	w0, #20
	mov	w1, #40
	bl	_usleep_range
	ldr	w0, [x19, #8]
	mov	w1, #0
	bl	_gpiod_set_value_cansleep
	mov	w0, #20
	bl	_msleep
	mov	w20, #0
	str	w21, [x19]
	b	LBB0_2
LBB0_6:
	mov	x20, x0
	ldr	w0, [x19, #12]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_DRM_DEV_ERROR
	b	LBB0_2
LBB0_7:
	mov	x20, x0
	ldr	w0, [x19, #12]
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x20
	bl	_DRM_DEV_ERROR
	ldr	w0, [x19, #4]
	bl	_regulator_disable
	b	LBB0_2
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Resetting the panel\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to enable vcc supply: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to enable iovcc supply: %d\n"

	.no_dead_strip	_jh057n_prepare
.subsections_via_symbols
