	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_wcache
_set_wcache:                            ## @set_wcache
	.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
	cmpl	$2, %esi
	jb	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_2:
	movl	%esi, %r15d
	movq	%rdi, %r14
	movl	4(%rdi), %edi
	callq	_ata_id_flush_enabled
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	testl	%r15d, %r15d
	jne	LBB0_5
## %bb.6:
	movq	_SETFEATURES_WC_OFF@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_3:
	movl	$1, %ebx
	jmp	LBB0_12
LBB0_5:
	movq	_SETFEATURES_WC_ON@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_ide_do_setfeature
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.8:
	movq	_IDE_DFLAG_WCACHE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%r15d, %r15d
	je	LBB0_10
## %bb.9:
	orl	%eax, (%r14)
	jmp	LBB0_11
LBB0_10:
	notl	%eax
	andl	%eax, (%r14)
LBB0_11:
	xorl	%ebx, %ebx
LBB0_12:
	movq	%r14, %rdi
	callq	_update_ordered
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SETFEATURES_WC_ON,4,2          ## @SETFEATURES_WC_ON
	.comm	_SETFEATURES_WC_OFF,4,2         ## @SETFEATURES_WC_OFF
	.comm	_IDE_DFLAG_WCACHE,4,2           ## @IDE_DFLAG_WCACHE
	.no_dead_strip	_set_wcache
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_wcache
_set_wcache:                            ; @set_wcache
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	cmp	w1, #2
	b.lo	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_10
LBB0_2:
	mov	x21, x1
	mov	x19, x0
	ldr	w0, [x0, #4]
	bl	_ata_id_flush_enabled
	cbz	x0, LBB0_6
; %bb.3:
Lloh3:
	adrp	x8, _SETFEATURES_WC_ON@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SETFEATURES_WC_ON@GOTPAGEOFF]
Lloh5:
	adrp	x9, _SETFEATURES_WC_OFF@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SETFEATURES_WC_OFF@GOTPAGEOFF]
	cmp	w21, #0
	csel	x8, x9, x8, eq
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_ide_do_setfeature
	mov	x20, x0
	cbnz	w0, LBB0_9
; %bb.4:
Lloh7:
	adrp	x8, _IDE_DFLAG_WCACHE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _IDE_DFLAG_WCACHE@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	mov	w20, #0
	cbz	w21, LBB0_7
; %bb.5:
	ldr	w9, [x19]
	orr	w8, w9, w8
	b	LBB0_8
LBB0_6:
	mov	w20, #1
	b	LBB0_9
LBB0_7:
	ldr	w9, [x19]
	bic	w8, w9, w8
LBB0_8:
	str	w8, [x19]
LBB0_9:
	mov	x0, x19
	bl	_update_ordered
LBB0_10:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SETFEATURES_WC_ON,4,2          ; @SETFEATURES_WC_ON
	.comm	_SETFEATURES_WC_OFF,4,2         ; @SETFEATURES_WC_OFF
	.comm	_IDE_DFLAG_WCACHE,4,2           ; @IDE_DFLAG_WCACHE
	.no_dead_strip	_set_wcache
.subsections_via_symbols
