	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_s5p_mfc_wakeup                 ## -- Begin function s5p_mfc_wakeup
	.p2align	4, 0x90
_s5p_mfc_wakeup:                        ## @s5p_mfc_wakeup
	.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
	movq	%rdi, %r14
	xorl	%eax, %eax
	callq	_mfc_debug_enter
	leaq	L_.str(%rip), %rsi
	movl	$2, %edi
	callq	_mfc_debug
	xorl	%eax, %eax
	callq	_s5p_mfc_clock_on
	movq	$0, 24(%r14)
	movq	%r14, %rdi
	callq	_s5p_mfc_reset
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_mfc_err
	xorl	%eax, %eax
	callq	_s5p_mfc_clock_off
	jmp	LBB0_10
LBB0_2:
	leaq	L_.str.2(%rip), %rsi
	movl	$2, %edi
	callq	_mfc_debug
	movq	%r14, %rdi
	callq	_s5p_mfc_init_memctrl
	movq	%r14, %rdi
	callq	_s5p_mfc_clear_cmds
	movq	%r14, %rdi
	callq	_s5p_mfc_clean_dev_int_flags
	movq	%r14, %rdi
	callq	_IS_MFCV8_PLUS
	movq	%r14, %rdi
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	callq	_s5p_mfc_v8_wait_wakeup
	jmp	LBB0_5
LBB0_4:
	callq	_s5p_mfc_wait_wakeup
LBB0_5:
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_s5p_mfc_clock_off
	testl	%ebx, %ebx
	jne	LBB0_10
## %bb.6:
	movq	$0, 16(%r14)
	movq	(%r14), %rsi
	movq	8(%r14), %rdx
	testq	%rsi, %rsi
	jne	LBB0_8
## %bb.7:
	movq	_S5P_MFC_R2H_CMD_WAKEUP_RET@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	jne	LBB0_8
## %bb.9:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_mfc_debug_leave
	jmp	LBB0_10
LBB0_8:
	leaq	L_.str.3(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_mfc_err
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MFC reset..\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to reset MFC - timeout\n"

L_.str.2:                               ## @.str.2
	.asciz	"Done MFC reset..\n"

	.comm	_S5P_MFC_R2H_CMD_WAKEUP_RET,8,3 ## @S5P_MFC_R2H_CMD_WAKEUP_RET
L_.str.3:                               ## @.str.3
	.asciz	"Failed to wakeup - error: %d int: %d\n"

	.comm	_EIO,4,2                        ## @EIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_s5p_mfc_wakeup                 ; -- Begin function s5p_mfc_wakeup
	.p2align	2
_s5p_mfc_wakeup:                        ; @s5p_mfc_wakeup
	.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
	mov	x19, x0
	bl	_mfc_debug_enter
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #2
	bl	_mfc_debug
	bl	_s5p_mfc_clock_on
	str	xzr, [x19, #24]
	mov	x0, x19
	bl	_s5p_mfc_reset
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_mfc_err
	bl	_s5p_mfc_clock_off
	b	LBB0_10
LBB0_2:
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #2
	bl	_mfc_debug
	mov	x0, x19
	bl	_s5p_mfc_init_memctrl
	mov	x0, x19
	bl	_s5p_mfc_clear_cmds
	mov	x0, x19
	bl	_s5p_mfc_clean_dev_int_flags
	mov	x0, x19
	bl	_IS_MFCV8_PLUS
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_s5p_mfc_v8_wait_wakeup
	b	LBB0_5
LBB0_4:
	mov	x0, x19
	bl	_s5p_mfc_wait_wakeup
LBB0_5:
	mov	x20, x0
	bl	_s5p_mfc_clock_off
	cbnz	w20, LBB0_10
; %bb.6:
	str	xzr, [x19, #16]
	ldp	x8, x9, [x19]
	cbnz	x8, LBB0_9
; %bb.7:
Lloh6:
	adrp	x10, _S5P_MFC_R2H_CMD_WAKEUP_RET@GOTPAGE
Lloh7:
	ldr	x10, [x10, _S5P_MFC_R2H_CMD_WAKEUP_RET@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_9
; %bb.8:
	bl	_mfc_debug_leave
	mov	w20, #0
	b	LBB0_10
LBB0_9:
	stp	x8, x9, [sp]
Lloh9:
	adrp	x0, l_.str.3@PAGE
Lloh10:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_mfc_err
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_10:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MFC reset..\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to reset MFC - timeout\n"

l_.str.2:                               ; @.str.2
	.asciz	"Done MFC reset..\n"

	.comm	_S5P_MFC_R2H_CMD_WAKEUP_RET,8,3 ; @S5P_MFC_R2H_CMD_WAKEUP_RET
l_.str.3:                               ; @.str.3
	.asciz	"Failed to wakeup - error: %d int: %d\n"

	.comm	_EIO,4,2                        ; @EIO
.subsections_via_symbols
