	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cosm_stop                      ## -- Begin function cosm_stop
	.p2align	4, 0x90
_cosm_stop:                             ## @cosm_stop
	.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
	movl	%esi, %r15d
	movq	%rdi, %rbx
	leaq	24(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	(%rbx), %r13
	movq	_MIC_READY@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	testl	%r15d, %r15d
	jne	LBB0_2
## %bb.1:
	cmpq	%r12, %r13
	je	LBB0_10
LBB0_2:
	movq	_MIC_RESETTING@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	cmpq	%rsi, %r13
	jne	LBB0_6
## %bb.3:
	movq	8(%rbx), %rax
	movq	_MIC_RESET_FAILED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movl	$0, 16(%rbx)
	je	LBB0_5
## %bb.4:
	cmpq	%r12, %rax
	jne	LBB0_8
	jmp	LBB0_5
LBB0_6:
	movq	_MIC_RESET_FAILED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_cosm_set_state
	movl	$0, 16(%rbx)
	cmpq	-48(%rbp), %r13                 ## 8-byte Folded Reload
	je	LBB0_5
## %bb.7:
	cmpq	%r12, %r13
	je	LBB0_5
LBB0_8:
	movq	32(%rbx), %rax
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	*8(%rax)
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_cosm_hw_reset
	movq	_MIC_NOP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_cosm_set_shutdown_status
	movq	32(%rbx), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	(%rbx), %rsi
	movq	%rbx, %rdi
	callq	*%rax
	jmp	LBB0_10
LBB0_5:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_cosm_hw_reset
	movq	_MIC_NOP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_cosm_set_shutdown_status
LBB0_10:
	movq	%r14, %rdi
	callq	_mutex_unlock
	addq	$20, %rbx
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_flush_work                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MIC_READY,8,3                  ## @MIC_READY
	.comm	_MIC_RESETTING,8,3              ## @MIC_RESETTING
	.comm	_MIC_RESET_FAILED,8,3           ## @MIC_RESET_FAILED
	.comm	_MIC_NOP,4,2                    ## @MIC_NOP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cosm_stop                      ; -- Begin function cosm_stop
	.p2align	2
_cosm_stop:                             ; @cosm_stop
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x1
	mov	x19, x0
	add	x20, x0, #24
	mov	x0, x20
	bl	_mutex_lock
	ldr	x23, [x19]
Lloh0:
	adrp	x8, _MIC_READY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MIC_READY@GOTPAGEOFF]
Lloh2:
	ldr	x22, [x8]
	cbnz	w21, LBB0_2
; %bb.1:
	cmp	x23, x22
	b.eq	LBB0_8
LBB0_2:
Lloh3:
	adrp	x8, _MIC_RESETTING@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MIC_RESETTING@GOTPAGEOFF]
Lloh5:
	ldr	x1, [x8]
	cmp	x23, x1
	b.ne	LBB0_6
; %bb.3:
	ldr	x8, [x19, #8]
Lloh6:
	adrp	x9, _MIC_RESET_FAILED@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MIC_RESET_FAILED@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	str	wzr, [x19, #16]
	cmp	x8, x9
	ccmp	x8, x22, #4, ne
	b.eq	LBB0_7
LBB0_4:
	ldr	x8, [x19, #32]
	ldr	x8, [x8, #8]
	mov	x0, x19
	mov	x1, x21
	blr	x8
	mov	x0, x19
	mov	x1, x21
	bl	_cosm_hw_reset
Lloh9:
	adrp	x8, _MIC_NOP@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MIC_NOP@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_cosm_set_shutdown_status
	ldr	x8, [x19, #32]
	ldr	x8, [x8]
	cbz	x8, LBB0_8
; %bb.5:
	ldr	x1, [x19]
	mov	x0, x19
	blr	x8
	b	LBB0_8
LBB0_6:
Lloh12:
	adrp	x8, _MIC_RESET_FAILED@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MIC_RESET_FAILED@GOTPAGEOFF]
Lloh14:
	ldr	x24, [x8]
	mov	x0, x19
	bl	_cosm_set_state
	str	wzr, [x19, #16]
	cmp	x23, x24
	ccmp	x23, x22, #4, ne
	b.ne	LBB0_4
LBB0_7:
	mov	x0, x19
	mov	x1, x21
	bl	_cosm_hw_reset
Lloh15:
	adrp	x8, _MIC_NOP@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MIC_NOP@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_cosm_set_shutdown_status
LBB0_8:
	mov	x0, x20
	bl	_mutex_unlock
	add	x0, x19, #20
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_flush_work
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_MIC_READY,8,3                  ; @MIC_READY
	.comm	_MIC_RESETTING,8,3              ; @MIC_RESETTING
	.comm	_MIC_RESET_FAILED,8,3           ; @MIC_RESET_FAILED
	.comm	_MIC_NOP,4,2                    ; @MIC_NOP
.subsections_via_symbols
