	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_cache_mode
_set_cache_mode:                        ## @set_cache_mode
	.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
	movl	%esi, %ebx
	movq	%rdi, %r15
	callq	_get_cache_mode
	movl	%eax, %r14d
	movl	4(%r15), %edi
	leaq	-28(%rbp), %rsi
	callq	_dm_cache_metadata_needs_check
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	callq	_cache_device_name
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_DMERR
	movl	$130, %ebx
	jmp	LBB0_5
LBB0_2:
	cmpl	$128, %ebx
	jne	LBB0_5
## %bb.3:
	cmpl	$0, -28(%rbp)
	je	LBB0_5
## %bb.4:
	movq	%r15, %rdi
	callq	_cache_device_name
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_DMERR
	cmpl	$128, %r14d
	movl	$129, %ebx
	cmovnel	%r14d, %ebx
LBB0_5:
	cmpl	$130, %r14d
	cmovel	%r14d, %ebx
	leal	-129(%rbx), %eax
	cmpl	$2, %eax
	jae	LBB0_6
## %bb.11:
	movl	4(%r15), %edi
	callq	_dm_cache_metadata_set_read_only
	jmp	LBB0_8
LBB0_6:
	cmpl	$128, %ebx
	jne	LBB0_8
## %bb.7:
	movl	4(%r15), %edi
	callq	_dm_cache_metadata_set_read_write
LBB0_8:
	movl	%ebx, (%r15)
	cmpl	%r14d, %ebx
	je	LBB0_10
## %bb.9:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_notify_mode_switch
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: unable to read needs_check flag, setting failure mode."

L_.str.1:                               ## @.str.1
	.asciz	"%s: unable to switch cache to write mode until repaired."

	.no_dead_strip	_set_cache_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_cache_mode
_set_cache_mode:                        ; @set_cache_mode
	.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	x21, x1
	mov	x19, x0
	bl	_get_cache_mode
	mov	x20, x0
	ldr	w0, [x19, #4]
	add	x1, sp, #12
	bl	_dm_cache_metadata_needs_check
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_cache_device_name
	mov	x1, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DMERR
	mov	w21, #130
	b	LBB0_5
LBB0_2:
	cmp	w21, #128
	b.ne	LBB0_5
; %bb.3:
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_cache_device_name
	mov	x1, x0
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DMERR
	mov	w8, #129
	cmp	w20, #128
	csel	w21, w8, w20, eq
LBB0_5:
	cmp	w20, #130
	csel	w21, w20, w21, eq
	sub	w8, w21, #129
	cmp	w8, #2
	b.hs	LBB0_7
; %bb.6:
	ldr	w0, [x19, #4]
	bl	_dm_cache_metadata_set_read_only
	b	LBB0_9
LBB0_7:
	cmp	w21, #128
	b.ne	LBB0_9
; %bb.8:
	ldr	w0, [x19, #4]
	bl	_dm_cache_metadata_set_read_write
LBB0_9:
	str	w21, [x19]
	cmp	w21, w20
	b.eq	LBB0_11
; %bb.10:
	mov	x0, x19
	mov	x1, x21
	bl	_notify_mode_switch
LBB0_11:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: unable to read needs_check flag, setting failure mode."

l_.str.1:                               ; @.str.1
	.asciz	"%s: unable to switch cache to write mode until repaired."

	.no_dead_strip	_set_cache_mode
.subsections_via_symbols
