	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function venus_prepare_power_collapse
_venus_prepare_power_collapse:          ## @venus_prepare_power_collapse
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	_venus_hw_rsp_timeout@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%rax, %r12
	movq	%r15, %rdi
	callq	_init_completion
	leaq	-40(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_pkt_sys_pc_prep
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_venus_iface_cmdq_write
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_1
LBB0_4:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	xorl	%ebx, %ebx
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.2:
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	%r15, %rdi
	callq	_venus_flush_debug_queue
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_venus_hw_rsp_timeout,4,2       ## @venus_hw_rsp_timeout
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_venus_prepare_power_collapse
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function venus_prepare_power_collapse
_venus_prepare_power_collapse:          ; @venus_prepare_power_collapse
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _venus_hw_rsp_timeout@GOTPAGE
Lloh1:
	ldr	x8, [x8, _venus_hw_rsp_timeout@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	mov	x21, x0
	mov	x0, x19
	bl	_init_completion
	add	x0, sp, #8
	bl	_pkt_sys_pc_prep
	add	x1, sp, #8
	mov	x0, x19
	bl	_venus_iface_cmdq_write
	cbnz	w0, LBB0_5
; %bb.1:
	cbz	w20, LBB0_3
; %bb.2:
	mov	x0, x19
	mov	x1, x21
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_4
LBB0_3:
	mov	w0, #0
	b	LBB0_5
LBB0_4:
	mov	x0, x19
	bl	_venus_flush_debug_queue
Lloh3:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_venus_hw_rsp_timeout,4,2       ; @venus_hw_rsp_timeout
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_venus_prepare_power_collapse
.subsections_via_symbols
