	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s5p_mfc_v8_wait_wakeup
_s5p_mfc_v8_wait_wakeup:                ## @s5p_mfc_v8_wait_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
	movl	$1, (%rdi)
	movq	_S5P_FIMV_RISC_ON_V6@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$1, %esi
	callq	_mfc_write
	movq	_S5P_MFC_R2H_CMD_FW_STATUS_RET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_s5p_mfc_wait_for_done_dev
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
LBB0_7:
	callq	_mfc_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_2:
	leaq	L_.str.1(%rip), %rsi
	movl	$2, %edi
	callq	_mfc_debug
	movl	4(%r14), %edi
	movq	_wakeup_cmd@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdx
	callq	_s5p_mfc_hw_call
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rdi
	callq	_mfc_err
LBB0_8:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_4:
	movq	_S5P_MFC_R2H_CMD_WAKEUP_RET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_s5p_mfc_wait_for_done_dev
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_7
LBB0_5:
	xorl	%ebx, %ebx
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_S5P_FIMV_RISC_ON_V6,4,2        ## @S5P_FIMV_RISC_ON_V6
	.comm	_S5P_MFC_R2H_CMD_FW_STATUS_RET,4,2 ## @S5P_MFC_R2H_CMD_FW_STATUS_RET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to reset MFCV8\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"Write command to wakeup MFCV8\n"

	.comm	_wakeup_cmd,4,2                 ## @wakeup_cmd
L_.str.2:                               ## @.str.2
	.asciz	"Failed to send command to MFCV8 - timeout\n"

	.comm	_S5P_MFC_R2H_CMD_WAKEUP_RET,4,2 ## @S5P_MFC_R2H_CMD_WAKEUP_RET
L_.str.3:                               ## @.str.3
	.asciz	"Failed to wakeup MFC\n"

	.no_dead_strip	_s5p_mfc_v8_wait_wakeup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s5p_mfc_v8_wait_wakeup
_s5p_mfc_v8_wait_wakeup:                ; @s5p_mfc_v8_wait_wakeup
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	mov	w8, #1
	str	w8, [x0]
Lloh0:
	adrp	x8, _S5P_FIMV_RISC_ON_V6@GOTPAGE
Lloh1:
	ldr	x8, [x8, _S5P_FIMV_RISC_ON_V6@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #1
	bl	_mfc_write
Lloh3:
	adrp	x8, _S5P_MFC_R2H_CMD_FW_STATUS_RET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _S5P_MFC_R2H_CMD_FW_STATUS_RET@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_s5p_mfc_wait_for_done_dev
	cbz	x0, LBB0_3
; %bb.1:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
LBB0_2:
	bl	_mfc_err
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_5
LBB0_3:
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #2
	bl	_mfc_debug
	ldr	w0, [x19, #4]
Lloh13:
	adrp	x8, _wakeup_cmd@GOTPAGE
Lloh14:
	ldr	x8, [x8, _wakeup_cmd@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x2, x19
	bl	_s5p_mfc_hw_call
	cbz	w0, LBB0_6
; %bb.4:
	mov	x20, x0
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_mfc_err
LBB0_5:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_6:
Lloh18:
	adrp	x8, _S5P_MFC_R2H_CMD_WAKEUP_RET@GOTPAGE
Lloh19:
	ldr	x8, [x8, _S5P_MFC_R2H_CMD_WAKEUP_RET@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_s5p_mfc_wait_for_done_dev
	cbz	x0, LBB0_8
; %bb.7:
Lloh21:
	adrp	x0, l_.str.3@PAGE
Lloh22:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_2
LBB0_8:
	mov	w20, #0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_S5P_FIMV_RISC_ON_V6,4,2        ; @S5P_FIMV_RISC_ON_V6
	.comm	_S5P_MFC_R2H_CMD_FW_STATUS_RET,4,2 ; @S5P_MFC_R2H_CMD_FW_STATUS_RET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to reset MFCV8\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"Write command to wakeup MFCV8\n"

	.comm	_wakeup_cmd,4,2                 ; @wakeup_cmd
l_.str.2:                               ; @.str.2
	.asciz	"Failed to send command to MFCV8 - timeout\n"

	.comm	_S5P_MFC_R2H_CMD_WAKEUP_RET,4,2 ; @S5P_MFC_R2H_CMD_WAKEUP_RET
l_.str.3:                               ; @.str.3
	.asciz	"Failed to wakeup MFC\n"

	.no_dead_strip	_s5p_mfc_v8_wait_wakeup
.subsections_via_symbols
