	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_s5p_mfc_sleep                  ## -- Begin function s5p_mfc_sleep
	.p2align	4, 0x90
_s5p_mfc_sleep:                         ## @s5p_mfc_sleep
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	xorl	%eax, %eax
	callq	_mfc_debug_enter
	xorl	%eax, %eax
	callq	_s5p_mfc_clock_on
	movq	%rbx, %rdi
	callq	_s5p_mfc_clean_dev_int_flags
	movl	24(%rbx), %edi
	movq	_sleep_cmd@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdx
	callq	_s5p_mfc_hw_call
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_mfc_err
	jmp	LBB0_9
LBB0_2:
	movq	_S5P_MFC_R2H_CMD_SLEEP_RET@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	movq	%rbx, %rdi
	callq	_s5p_mfc_wait_for_done_dev
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_mfc_err
	jmp	LBB0_7
LBB0_4:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_s5p_mfc_clock_off
	movq	$0, 16(%rbx)
	movq	(%rbx), %rsi
	movq	8(%rbx), %rdx
	testq	%rsi, %rsi
	jne	LBB0_6
## %bb.5:
	cmpq	(%r15), %rdx
	jne	LBB0_6
## %bb.8:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_mfc_debug_leave
	jmp	LBB0_9
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_mfc_err
LBB0_7:
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
LBB0_9:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_sleep_cmd,4,2                  ## @sleep_cmd
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to send command to MFC - timeout\n"

	.comm	_S5P_MFC_R2H_CMD_SLEEP_RET,8,3  ## @S5P_MFC_R2H_CMD_SLEEP_RET
L_.str.1:                               ## @.str.1
	.asciz	"Failed to sleep\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.2:                               ## @.str.2
	.asciz	"Failed to sleep - error: %d int: %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_s5p_mfc_sleep                  ; -- Begin function s5p_mfc_sleep
	.p2align	2
_s5p_mfc_sleep:                         ; @s5p_mfc_sleep
	.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
	bl	_s5p_mfc_clock_on
	mov	x0, x19
	bl	_s5p_mfc_clean_dev_int_flags
	ldr	w0, [x19, #24]
Lloh0:
	adrp	x8, _sleep_cmd@GOTPAGE
Lloh1:
	ldr	x8, [x8, _sleep_cmd@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x2, x19
	bl	_s5p_mfc_hw_call
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_mfc_err
	b	LBB0_9
LBB0_2:
Lloh5:
	adrp	x20, _S5P_MFC_R2H_CMD_SLEEP_RET@GOTPAGE
Lloh6:
	ldr	x20, [x20, _S5P_MFC_R2H_CMD_SLEEP_RET@GOTPAGEOFF]
	ldr	x1, [x20]
	mov	x0, x19
	bl	_s5p_mfc_wait_for_done_dev
	cbz	x0, LBB0_4
; %bb.3:
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_4:
	bl	_s5p_mfc_clock_off
	str	xzr, [x19, #16]
	ldp	x8, x9, [x19]
	cbnz	x8, LBB0_7
; %bb.5:
	ldr	x10, [x20]
	cmp	x9, x10
	b.ne	LBB0_7
; %bb.6:
	bl	_mfc_debug_leave
	mov	w20, #0
	b	LBB0_9
LBB0_7:
	stp	x8, x9, [sp]
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_8:
	bl	_mfc_err
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_9:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_sleep_cmd,4,2                  ; @sleep_cmd
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to send command to MFC - timeout\n"

	.comm	_S5P_MFC_R2H_CMD_SLEEP_RET,8,3  ; @S5P_MFC_R2H_CMD_SLEEP_RET
l_.str.1:                               ; @.str.1
	.asciz	"Failed to sleep\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.2:                               ; @.str.2
	.asciz	"Failed to sleep - error: %d int: %d\n"

.subsections_via_symbols
