	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function venus_suspend_1xx
_venus_suspend_1xx:                     ## @venus_suspend_1xx
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_to_hfi_priv
	xorl	%r15d, %r15d
	cmpl	$0, 20(%rax)
	je	LBB0_13
## %bb.1:
	movq	%rax, %r14
	cmpl	$0, (%rax)
	je	LBB0_2
LBB0_13:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	(%rbx), %r13
	movq	%r14, %r12
	addq	$16, %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	%r14, %rdi
	callq	_venus_is_valid_state
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	je	LBB0_3
## %bb.4:
	movq	%r13, %rbx
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_venus_prepare_power_collapse
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %r13d
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movl	%r13d, %r15d
	jmp	LBB0_13
LBB0_3:
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_13
LBB0_6:
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	8(%r14), %rax
	movq	_HFI_CMD_SYS_PC_PREP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.8:
	movq	%r14, %rdi
	callq	_venus_are_queues_empty
	testl	%eax, %eax
	jle	LBB0_7
## %bb.9:
	movq	_CPU_CS_SCIACMDARG0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_venus_readl
	movq	_CPU_CS_SCIACMDARG0_PC_READY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
## %bb.10:
	movq	%r14, %rdi
	callq	_venus_power_off
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_mutex_unlock
	movl	%ebx, %r15d
	jmp	LBB0_13
LBB0_7:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_13
LBB0_12:
	movl	$1, (%r14)
	movq	%r12, %rdi
	callq	_mutex_unlock
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bad state, cannot suspend\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"prepare for power collapse fail (%d)\n"

	.comm	_HFI_CMD_SYS_PC_PREP,8,3        ## @HFI_CMD_SYS_PC_PREP
	.comm	_CPU_CS_SCIACMDARG0,4,2         ## @CPU_CS_SCIACMDARG0
	.comm	_CPU_CS_SCIACMDARG0_PC_READY,4,2 ## @CPU_CS_SCIACMDARG0_PC_READY
	.no_dead_strip	_venus_suspend_1xx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function venus_suspend_1xx
_venus_suspend_1xx:                     ; @venus_suspend_1xx
	.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	x19, x0
	bl	_to_hfi_priv
	ldr	w8, [x0, #20]
	cbz	w8, LBB0_2
; %bb.1:
	mov	x20, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_4
LBB0_2:
	mov	w21, #0
LBB0_3:
	mov	x0, x21
	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
LBB0_4:
	ldr	x22, [x19]
	add	x19, x20, #16
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x20
	bl	_venus_is_valid_state
	mov	x21, x0
	mov	x0, x19
	bl	_mutex_unlock
	cbz	w21, LBB0_7
; %bb.5:
	mov	x0, x20
	mov	w1, #1
	bl	_venus_prepare_power_collapse
	cbz	w0, LBB0_8
; %bb.6:
	mov	x21, x0
	str	x21, [sp]
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_dev_err
	b	LBB0_3
LBB0_7:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_dev_err
	b	LBB0_15
LBB0_8:
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x20, #8]
Lloh4:
	adrp	x9, _HFI_CMD_SYS_PC_PREP@GOTPAGE
Lloh5:
	ldr	x9, [x9, _HFI_CMD_SYS_PC_PREP@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_14
; %bb.9:
	mov	x0, x20
	bl	_venus_are_queues_empty
	cmp	w0, #0
	b.le	LBB0_14
; %bb.10:
Lloh7:
	adrp	x8, _CPU_CS_SCIACMDARG0@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CPU_CS_SCIACMDARG0@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_venus_readl
Lloh10:
	adrp	x8, _CPU_CS_SCIACMDARG0_PC_READY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CPU_CS_SCIACMDARG0_PC_READY@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_14
; %bb.11:
	mov	x0, x20
	bl	_venus_power_off
	mov	x21, x0
	cbnz	w0, LBB0_13
; %bb.12:
	mov	w8, #1
	str	w8, [x20]
LBB0_13:
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_3
LBB0_14:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_15:
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bad state, cannot suspend\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"prepare for power collapse fail (%d)\n"

	.comm	_HFI_CMD_SYS_PC_PREP,8,3        ; @HFI_CMD_SYS_PC_PREP
	.comm	_CPU_CS_SCIACMDARG0,4,2         ; @CPU_CS_SCIACMDARG0
	.comm	_CPU_CS_SCIACMDARG0_PC_READY,4,2 ; @CPU_CS_SCIACMDARG0_PC_READY
	.no_dead_strip	_venus_suspend_1xx
.subsections_via_symbols
