	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cs_hsi_write_on_data
_cs_hsi_write_on_data:                  ## @cs_hsi_write_on_data
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	leaq	24(%rdi), %r14
	movq	%r14, %rdi
	callq	_spin_lock
	movq	(%r15), %rax
	movq	_CS_STATE_CONFIGURED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.4:
	movl	8(%r15), %eax
	movq	_SSI_CHANNEL_STATE_ERROR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.5:
	movq	_EIO@GOTPCREL(%rip), %rbx
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_2
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rbx
	leaq	L_.str(%rip), %rsi
LBB0_2:
	movq	32(%r15), %rdi
	callq	_dev_err
	movl	(%rbx), %ebx
	movl	%ebx, %r12d
	negl	%r12d
	movq	%r14, %rdi
	callq	_spin_unlock
	movq	_EIO@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_12
## %bb.3:
	movq	16(%r15), %rsi
	movq	%r15, %rdi
LBB0_11:
	callq	_cs_hsi_data_write_error
LBB0_12:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_SSI_CHANNEL_STATE_WRITING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%eax, %ecx
	je	LBB0_8
## %bb.7:
	movq	_EBUSY@GOTPCREL(%rip), %rbx
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_2
LBB0_8:
	orl	%eax, %ecx
	movl	%ecx, 8(%r15)
	movq	%r14, %rdi
	callq	_spin_unlock
	movl	%ebx, 12(%r15)
	movq	48(%r15), %rax
	movl	%ebx, %ecx
	movq	(%rax,%rcx,8), %rsi
	addq	56(%r15), %rsi
	movq	16(%r15), %r14
	movl	4(%r14), %edi
	movl	40(%r15), %edx
	callq	_sg_init_one
	movq	_cs_hsi_write_on_data_complete@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movq	32(%r15), %rdi
	movq	%r14, %rsi
	callq	_hsi_async_write
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:
	movl	%eax, %r12d
	movq	%r15, %rdi
	movq	%r14, %rsi
	jmp	LBB0_11
LBB0_9:
	xorl	%r12d, %r12d
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_CS_STATE_CONFIGURED,8,3        ## @CS_STATE_CONFIGURED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Not configured, aborting\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SSI_CHANNEL_STATE_ERROR,4,2    ## @SSI_CHANNEL_STATE_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"HSI error, aborting\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_SSI_CHANNEL_STATE_WRITING,4,2  ## @SSI_CHANNEL_STATE_WRITING
L_.str.2:                               ## @.str.2
	.asciz	"Write pending on data channel.\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_cs_hsi_write_on_data_complete,4,2 ## @cs_hsi_write_on_data_complete
	.no_dead_strip	_cs_hsi_write_on_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cs_hsi_write_on_data
_cs_hsi_write_on_data:                  ; @cs_hsi_write_on_data
	.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
	mov	x21, x1
	mov	x19, x0
	add	x20, x0, #24
	mov	x0, x20
	bl	_spin_lock
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _CS_STATE_CONFIGURED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CS_STATE_CONFIGURED@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	ldr	w8, [x19, #8]
Lloh3:
	adrp	x9, _SSI_CHANNEL_STATE_ERROR@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SSI_CHANNEL_STATE_ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.2:
Lloh6:
	adrp	x21, _EIO@GOTPAGE
Lloh7:
	ldr	x21, [x21, _EIO@GOTPAGEOFF]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_3:
Lloh10:
	adrp	x21, _EINVAL@GOTPAGE
Lloh11:
	ldr	x21, [x21, _EINVAL@GOTPAGEOFF]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
LBB0_4:
	ldr	x0, [x19, #32]
	bl	_dev_err
	ldr	w22, [x21]
	neg	w21, w22
	mov	x0, x20
	bl	_spin_unlock
Lloh14:
	adrp	x8, _EIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_7
; %bb.5:
	ldr	x1, [x19, #16]
	mov	x0, x19
LBB0_6:
	bl	_cs_hsi_data_write_error
LBB0_7:
	mov	x0, x21
	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
LBB0_8:
Lloh17:
	adrp	x9, _SSI_CHANNEL_STATE_WRITING@GOTPAGE
Lloh18:
	ldr	x9, [x9, _SSI_CHANNEL_STATE_WRITING@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:
Lloh20:
	adrp	x21, _EBUSY@GOTPAGE
Lloh21:
	ldr	x21, [x21, _EBUSY@GOTPAGEOFF]
Lloh22:
	adrp	x1, l_.str.2@PAGE
Lloh23:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_4
LBB0_10:
	orr	w8, w9, w8
	str	w8, [x19, #8]
	mov	x0, x20
	bl	_spin_unlock
	str	w21, [x19, #12]
	ldp	x9, x8, [x19, #48]
	ldr	x9, [x9, w21, uxtw #3]
	add	x1, x9, x8
	ldr	x20, [x19, #16]
	ldr	w0, [x20, #4]
	ldr	w2, [x19, #40]
	bl	_sg_init_one
Lloh24:
	adrp	x8, _cs_hsi_write_on_data_complete@GOTPAGE
Lloh25:
	ldr	x8, [x8, _cs_hsi_write_on_data_complete@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	str	w8, [x20]
	ldr	x0, [x19, #32]
	mov	x1, x20
	bl	_hsi_async_write
	mov	x21, x0
	cbz	w0, LBB0_7
; %bb.11:
	mov	x0, x19
	mov	x1, x20
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_CS_STATE_CONFIGURED,8,3        ; @CS_STATE_CONFIGURED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Not configured, aborting\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SSI_CHANNEL_STATE_ERROR,4,2    ; @SSI_CHANNEL_STATE_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"HSI error, aborting\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_SSI_CHANNEL_STATE_WRITING,4,2  ; @SSI_CHANNEL_STATE_WRITING
l_.str.2:                               ; @.str.2
	.asciz	"Write pending on data channel.\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_cs_hsi_write_on_data_complete,4,2 ; @cs_hsi_write_on_data_complete
	.no_dead_strip	_cs_hsi_write_on_data
.subsections_via_symbols
