	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sc_free                        ## -- Begin function sc_free
	.p2align	4, 0x90
_sc_free:                               ## @sc_free
	.cfi_startproc
## %bb.0:
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.1:
	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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_SCF_IN_FREE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 48(%rdi)
	movq	40(%rdi), %rbx
	addq	$36, %rdi
	callq	_list_empty
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dd_dev_err
LBB0_3:
	movq	(%r14), %r15
	movq	8(%r14), %r12
	movq	%r14, %rdi
	callq	_sc_disable
	leaq	32(%r14), %rdi
	callq	_flush_work
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	8(%rbx), %rax
	movq	$0, (%rax,%r15,8)
	movq	_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SC
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	callq	_write_kctxt_csr
	movq	_CHECK_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SC
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	callq	_write_kctxt_csr
	movq	_ERR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SC
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	callq	_write_kctxt_csr
	movq	_CHECK_PARTITION_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SC
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	callq	_write_kctxt_csr
	movq	_CHECK_OPCODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SC
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	callq	_write_kctxt_csr
	movq	_CREDIT_RETURN_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SC
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	callq	_write_kctxt_csr
	movq	_CREDIT_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SC
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	callq	_write_kctxt_csr
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	callq	_sc_hw_free
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	movq	24(%r14), %rdi
	callq	_kfree
	movl	16(%r14), %edi
	callq	_free_percpu
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
LBB0_4:
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SCF_IN_FREE,4,2                ## @SCF_IN_FREE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"piowait list not empty!\n"

	.comm	_CTRL,4,2                       ## @CTRL
	.comm	_CHECK_ENABLE,4,2               ## @CHECK_ENABLE
	.comm	_ERR_MASK,4,2                   ## @ERR_MASK
	.comm	_CHECK_PARTITION_KEY,4,2        ## @CHECK_PARTITION_KEY
	.comm	_CHECK_OPCODE,4,2               ## @CHECK_OPCODE
	.comm	_CREDIT_RETURN_ADDR,4,2         ## @CREDIT_RETURN_ADDR
	.comm	_CREDIT_CTRL,4,2                ## @CREDIT_CTRL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sc_free                        ; -- Begin function sc_free
	.p2align	2
_sc_free:                               ; @sc_free
	.cfi_startproc
; %bb.0:
	cbz	x0, LBB0_4
; %bb.1:
	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
	mov	x19, x0
Lloh0:
	adrp	x8, _SCF_IN_FREE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SCF_IN_FREE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x0, #48]
	orr	w8, w9, w8
	str	w8, [x0, #48]
	ldr	x20, [x0, #40]
	add	x0, x0, #36
	bl	_list_empty
	cbnz	w0, LBB0_3
; %bb.2:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dd_dev_err
LBB0_3:
	ldp	x21, x22, [x19]
	mov	x0, x19
	bl	_sc_disable
	add	x0, x19, #32
	bl	_flush_work
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	x8, [x20, #8]
	str	xzr, [x8, x21, lsl #3]
Lloh5:
	adrp	x8, _CTRL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CTRL@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_SC
	mov	x2, x0
	mov	x0, x20
	mov	x1, x22
	mov	w3, #0
	bl	_write_kctxt_csr
Lloh8:
	adrp	x8, _CHECK_ENABLE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CHECK_ENABLE@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_SC
	mov	x2, x0
	mov	x0, x20
	mov	x1, x22
	mov	w3, #0
	bl	_write_kctxt_csr
Lloh11:
	adrp	x8, _ERR_MASK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ERR_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	bl	_SC
	mov	x2, x0
	mov	x0, x20
	mov	x1, x22
	mov	w3, #0
	bl	_write_kctxt_csr
Lloh14:
	adrp	x8, _CHECK_PARTITION_KEY@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CHECK_PARTITION_KEY@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_SC
	mov	x2, x0
	mov	x0, x20
	mov	x1, x22
	mov	w3, #0
	bl	_write_kctxt_csr
Lloh17:
	adrp	x8, _CHECK_OPCODE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _CHECK_OPCODE@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	bl	_SC
	mov	x2, x0
	mov	x0, x20
	mov	x1, x22
	mov	w3, #0
	bl	_write_kctxt_csr
Lloh20:
	adrp	x8, _CREDIT_RETURN_ADDR@GOTPAGE
Lloh21:
	ldr	x8, [x8, _CREDIT_RETURN_ADDR@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	bl	_SC
	mov	x2, x0
	mov	x0, x20
	mov	x1, x22
	mov	w3, #0
	bl	_write_kctxt_csr
Lloh23:
	adrp	x8, _CREDIT_CTRL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _CREDIT_CTRL@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	bl	_SC
	mov	x2, x0
	mov	x0, x20
	mov	x1, x22
	mov	w3, #0
	bl	_write_kctxt_csr
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	_sc_hw_free
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	ldr	x0, [x19, #24]
	bl	_kfree
	ldr	w0, [x19, #16]
	bl	_free_percpu
	mov	x0, x19
	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
	b	_kfree
LBB0_4:
	.cfi_def_cfa wsp, 0
	.cfi_same_value w30
	.cfi_same_value w29
	.cfi_same_value w19
	.cfi_same_value w20
	.cfi_same_value w21
	.cfi_same_value w22
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_SCF_IN_FREE,4,2                ; @SCF_IN_FREE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"piowait list not empty!\n"

	.comm	_CTRL,4,2                       ; @CTRL
	.comm	_CHECK_ENABLE,4,2               ; @CHECK_ENABLE
	.comm	_ERR_MASK,4,2                   ; @ERR_MASK
	.comm	_CHECK_PARTITION_KEY,4,2        ; @CHECK_PARTITION_KEY
	.comm	_CHECK_OPCODE,4,2               ; @CHECK_OPCODE
	.comm	_CREDIT_RETURN_ADDR,4,2         ; @CREDIT_RETURN_ADDR
	.comm	_CREDIT_CTRL,4,2                ; @CREDIT_CTRL
.subsections_via_symbols
