	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sc_enable                      ## -- Begin function sc_enable
	.p2align	4, 0x90
_sc_enable:                             ## @sc_enable
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movq	%rdi, %r13
	movq	72(%rdi), %rbx
	leaq	4(%rdi), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movl	(%r13), %r14d
	movq	_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SC
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_read_kctxt_csr
	movl	%eax, %ebx
	movq	_CTRL_CTXT_ENABLE_SMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SC
	xorl	%r12d, %r12d
	testl	%ebx, %eax
	jne	LBB0_9
## %bb.3:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	64(%r13), %rax
	movq	$0, (%rax)
	movl	$0, 8(%r13)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%r13)
	movups	%xmm0, 32(%r13)
	movups	%xmm0, 48(%r13)
	movq	%r13, %rdi
	callq	_reset_buffers_allocated
	movl	(%r13), %r14d
	movq	_ERR_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SC
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_read_kctxt_csr
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r14d
	movl	(%r13), %r15d
	movq	_ERR_CLEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SC
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	movl	%r14d, %ecx
	callq	_write_kctxt_csr
LBB0_5:
	movq	%rbx, %rdi
	callq	_spin_lock
	movq	_SEND_PIO_INIT_CTXT_PIO_CTXT_NUM_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	(%r13), %edx
	movq	_SEND_PIO_INIT_CTXT_PIO_CTXT_NUM_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %edx
	movq	_SEND_PIO_INIT_CTXT_PIO_SINGLE_CTXT_INIT_SMASK@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_SEND_PIO_INIT_CTXT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_write_csr
	movl	$2, %edi
	callq	_udelay
	movq	%rbx, %rdi
	callq	_pio_init_wait_progress
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_spin_unlock
	testl	%r14d, %r14d
	je	LBB0_7
## %bb.6:
	movl	(%r13), %ecx
	movl	12(%r13), %edx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r14d, %r8d
	callq	_dd_dev_err
	movl	%r14d, %r12d
	jmp	LBB0_8
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_10
LBB0_7:
	movq	_CTRL_CTXT_ENABLE_SMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SC
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	orl	%eax, %r14d
	movl	(%r13), %r15d
	movq	_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SC
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	movl	%r14d, %ecx
	callq	_write_kctxt_csr
	movl	(%r13), %r14d
	movq	_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SC
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_read_kctxt_csr
	movq	_SCF_ENABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 8(%r13)
LBB0_8:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
LBB0_9:
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
LBB0_10:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CTRL,4,2                       ## @CTRL
	.comm	_CTRL_CTXT_ENABLE_SMASK,4,2     ## @CTRL_CTXT_ENABLE_SMASK
	.comm	_ERR_STATUS,4,2                 ## @ERR_STATUS
	.comm	_ERR_CLEAR,4,2                  ## @ERR_CLEAR
	.comm	_SEND_PIO_INIT_CTXT_PIO_CTXT_NUM_MASK,4,2 ## @SEND_PIO_INIT_CTXT_PIO_CTXT_NUM_MASK
	.comm	_SEND_PIO_INIT_CTXT_PIO_CTXT_NUM_SHIFT,4,2 ## @SEND_PIO_INIT_CTXT_PIO_CTXT_NUM_SHIFT
	.comm	_SEND_PIO_INIT_CTXT_PIO_SINGLE_CTXT_INIT_SMASK,4,2 ## @SEND_PIO_INIT_CTXT_PIO_SINGLE_CTXT_INIT_SMASK
	.comm	_SEND_PIO_INIT_CTXT,4,2         ## @SEND_PIO_INIT_CTXT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sctxt%u(%u): Context not enabled due to init failure %d\n"

	.comm	_SCF_ENABLED,4,2                ## @SCF_ENABLED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sc_enable                      ; -- Begin function sc_enable
	.p2align	2
_sc_enable:                             ; @sc_enable
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	ldr	x21, [x0, #72]
	add	x19, x0, #4
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	w22, [x20]
Lloh0:
	adrp	x25, _CTRL@GOTPAGE
Lloh1:
	ldr	x25, [x25, _CTRL@GOTPAGEOFF]
	ldr	w0, [x25]
	bl	_SC
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_read_kctxt_csr
	mov	x22, x0
Lloh2:
	adrp	x26, _CTRL_CTXT_ENABLE_SMASK@GOTPAGE
Lloh3:
	ldr	x26, [x26, _CTRL_CTXT_ENABLE_SMASK@GOTPAGEOFF]
	ldr	w0, [x26]
	bl	_SC
	tst	w0, w22
	b.eq	LBB0_4
; %bb.2:
	mov	w23, #0
	b	LBB0_9
LBB0_3:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_10
LBB0_4:
	ldr	x8, [x20, #64]
	str	xzr, [x8]
	str	wzr, [x20, #8]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [x20, #32]
	str	q0, [x20, #16]
	mov	x0, x20
	bl	_reset_buffers_allocated
	ldr	w23, [x20]
Lloh7:
	adrp	x8, _ERR_STATUS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ERR_STATUS@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	bl	_SC
	mov	x2, x0
	mov	x0, x21
	mov	x1, x23
	bl	_read_kctxt_csr
	cbz	w0, LBB0_6
; %bb.5:
	mov	x23, x0
	ldr	w24, [x20]
Lloh10:
	adrp	x8, _ERR_CLEAR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ERR_CLEAR@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	bl	_SC
	mov	x2, x0
	mov	x0, x21
	mov	x1, x24
	mov	x3, x23
	bl	_write_kctxt_csr
LBB0_6:
	mov	x0, x21
	bl	_spin_lock
	ldr	w8, [x20]
Lloh13:
	adrp	x9, _SEND_PIO_INIT_CTXT_PIO_CTXT_NUM_MASK@GOTPAGE
Lloh14:
	ldr	x9, [x9, _SEND_PIO_INIT_CTXT_PIO_CTXT_NUM_MASK@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh16:
	adrp	x9, _SEND_PIO_INIT_CTXT_PIO_CTXT_NUM_SHIFT@GOTPAGE
Lloh17:
	ldr	x9, [x9, _SEND_PIO_INIT_CTXT_PIO_CTXT_NUM_SHIFT@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
Lloh19:
	adrp	x10, _SEND_PIO_INIT_CTXT_PIO_SINGLE_CTXT_INIT_SMASK@GOTPAGE
Lloh20:
	ldr	x10, [x10, _SEND_PIO_INIT_CTXT_PIO_SINGLE_CTXT_INIT_SMASK@GOTPAGEOFF]
	lsl	w8, w8, w9
Lloh21:
	ldr	w9, [x10]
	orr	w2, w8, w9
Lloh22:
	adrp	x8, _SEND_PIO_INIT_CTXT@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SEND_PIO_INIT_CTXT@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_write_csr
	mov	w0, #2
	bl	_udelay
	mov	x0, x21
	bl	_pio_init_wait_progress
	mov	x23, x0
	mov	x0, x21
	bl	_spin_unlock
	cbz	w23, LBB0_8
; %bb.7:
	ldr	w2, [x20, #12]
	ldr	w3, [x20]
Lloh25:
	adrp	x1, l_.str@PAGE
Lloh26:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x4, x23
	bl	_dd_dev_err
	b	LBB0_9
LBB0_8:
	ldr	w0, [x26]
	bl	_SC
	orr	w22, w0, w22
	ldr	w23, [x20]
	ldr	w0, [x25]
	bl	_SC
	mov	x2, x0
	mov	x0, x21
	mov	x1, x23
	mov	x3, x22
	bl	_write_kctxt_csr
	ldr	w22, [x20]
	ldr	w0, [x25]
	bl	_SC
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_read_kctxt_csr
	mov	w23, #0
Lloh27:
	adrp	x8, _SCF_ENABLED@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SCF_ENABLED@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	ldr	w9, [x20, #8]
	orr	w8, w9, w8
	str	w8, [x20, #8]
LBB0_9:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
LBB0_10:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CTRL,4,2                       ; @CTRL
	.comm	_CTRL_CTXT_ENABLE_SMASK,4,2     ; @CTRL_CTXT_ENABLE_SMASK
	.comm	_ERR_STATUS,4,2                 ; @ERR_STATUS
	.comm	_ERR_CLEAR,4,2                  ; @ERR_CLEAR
	.comm	_SEND_PIO_INIT_CTXT_PIO_CTXT_NUM_MASK,4,2 ; @SEND_PIO_INIT_CTXT_PIO_CTXT_NUM_MASK
	.comm	_SEND_PIO_INIT_CTXT_PIO_CTXT_NUM_SHIFT,4,2 ; @SEND_PIO_INIT_CTXT_PIO_CTXT_NUM_SHIFT
	.comm	_SEND_PIO_INIT_CTXT_PIO_SINGLE_CTXT_INIT_SMASK,4,2 ; @SEND_PIO_INIT_CTXT_PIO_SINGLE_CTXT_INIT_SMASK
	.comm	_SEND_PIO_INIT_CTXT,4,2         ; @SEND_PIO_INIT_CTXT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sctxt%u(%u): Context not enabled due to init failure %d\n"

	.comm	_SCF_ENABLED,4,2                ; @SCF_ENABLED
.subsections_via_symbols
