	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function psp_v11_0_mode1_reset
_psp_v11_0_mode1_reset:                 ## @psp_v11_0_mode1_reset
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_MP0@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	_mmMP0_SMN_C2PMSG_64@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	callq	_SOC15_REG_OFFSET
	movl	%eax, %ebx
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	$-2147483648, %edx              ## imm = 0x80000000
	movl	$-2147418113, %ecx              ## imm = 0x8000FFFF
	xorl	%r8d, %r8d
	callq	_psp_wait_for
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_2
LBB0_3:
	movq	_GFX_CTRL_CMD_ID_MODE1_RST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_WREG32
	movl	$500, %edi                      ## imm = 0x1F4
	callq	_msleep
	movl	(%r12), %edi
	movq	_mmMP0_SMN_C2PMSG_33@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	callq	_SOC15_REG_OFFSET
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	$-2147483648, %edx              ## imm = 0x80000000
	movl	$-2147483648, %ecx              ## imm = 0x80000000
	xorl	%r8d, %r8d
	callq	_psp_wait_for
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
LBB0_2:
	callq	_DRM_INFO
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
LBB0_6:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	leaq	L_.str.2(%rip), %rdi
	callq	_DRM_INFO
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_MP0,4,2                        ## @MP0
	.comm	_mmMP0_SMN_C2PMSG_64,4,2        ## @mmMP0_SMN_C2PMSG_64
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"psp is not working correctly before mode1 reset!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFX_CTRL_CMD_ID_MODE1_RST,4,2  ## @GFX_CTRL_CMD_ID_MODE1_RST
	.comm	_mmMP0_SMN_C2PMSG_33,4,2        ## @mmMP0_SMN_C2PMSG_33
L_.str.1:                               ## @.str.1
	.asciz	"psp mode 1 reset failed!\n"

L_.str.2:                               ## @.str.2
	.asciz	"psp mode1 reset succeed \n"

	.no_dead_strip	_psp_v11_0_mode1_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function psp_v11_0_mode1_reset
_psp_v11_0_mode1_reset:                 ; @psp_v11_0_mode1_reset
	.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
	mov	x19, x0
Lloh0:
	adrp	x21, _MP0@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MP0@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh2:
	adrp	x8, _mmMP0_SMN_C2PMSG_64@GOTPAGE
Lloh3:
	ldr	x8, [x8, _mmMP0_SMN_C2PMSG_64@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_SOC15_REG_OFFSET
	mov	x20, x0
	mov	x0, x19
	mov	x1, x20
	mov	w2, #-2147483648
	mov	w3, #-2147418113
	mov	w4, #0
	bl	_psp_wait_for
	cbz	w0, LBB0_2
; %bb.1:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
Lloh7:
	adrp	x8, _GFX_CTRL_CMD_ID_MODE1_RST@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GFX_CTRL_CMD_ID_MODE1_RST@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_WREG32
	mov	w0, #500
	bl	_msleep
	ldr	w0, [x21]
Lloh10:
	adrp	x8, _mmMP0_SMN_C2PMSG_33@GOTPAGE
Lloh11:
	ldr	x8, [x8, _mmMP0_SMN_C2PMSG_33@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_SOC15_REG_OFFSET
	mov	x1, x0
	mov	x0, x19
	mov	w2, #-2147483648
	mov	w3, #-2147483648
	mov	w4, #0
	bl	_psp_wait_for
	cbz	w0, LBB0_6
; %bb.3:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_4:
	bl	_DRM_INFO
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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_6:
Lloh18:
	adrp	x0, l_.str.2@PAGE
Lloh19:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_INFO
	mov	w0, #0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_MP0,4,2                        ; @MP0
	.comm	_mmMP0_SMN_C2PMSG_64,4,2        ; @mmMP0_SMN_C2PMSG_64
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"psp is not working correctly before mode1 reset!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFX_CTRL_CMD_ID_MODE1_RST,4,2  ; @GFX_CTRL_CMD_ID_MODE1_RST
	.comm	_mmMP0_SMN_C2PMSG_33,4,2        ; @mmMP0_SMN_C2PMSG_33
l_.str.1:                               ; @.str.1
	.asciz	"psp mode 1 reset failed!\n"

l_.str.2:                               ; @.str.2
	.asciz	"psp mode1 reset succeed \n"

	.no_dead_strip	_psp_v11_0_mode1_reset
.subsections_via_symbols
