	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cs_hsi_write_on_control_complete
_cs_hsi_write_on_control_complete:      ## @cs_hsi_write_on_control_complete
	.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
	movq	%rdi, %rbx
	movq	8(%rdi), %r14
	movl	(%rdi), %edx
	movq	_HSI_STATUS_COMPLETED@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jne	LBB0_1
## %bb.3:
	leaq	8(%r14), %r15
	movq	%r15, %rdi
	callq	_spin_lock
	movq	_SSI_CHANNEL_STATE_WRITING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 12(%r14)
	movq	%rbx, %rdi
	callq	_cs_release_cmd
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock                    ## TAILCALL
LBB0_1:
	movq	_HSI_STATUS_ERROR@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jne	LBB0_2
## %bb.4:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_cs_hsi_control_write_error     ## TAILCALL
LBB0_2:
	movq	(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_HSI_STATUS_COMPLETED,4,2       ## @HSI_STATUS_COMPLETED
	.comm	_SSI_CHANNEL_STATE_WRITING,4,2  ## @SSI_CHANNEL_STATE_WRITING
	.comm	_HSI_STATUS_ERROR,4,2           ## @HSI_STATUS_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unexpected status in control write callback %d\n"

	.no_dead_strip	_cs_hsi_write_on_control_complete
.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_control_complete
_cs_hsi_write_on_control_complete:      ; @cs_hsi_write_on_control_complete
	.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	x19, x0
	ldr	x20, [x0, #8]
	ldr	w2, [x0]
Lloh0:
	adrp	x8, _HSI_STATUS_COMPLETED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HSI_STATUS_COMPLETED@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w2, w8
	b.ne	LBB0_2
; %bb.1:
	add	x21, x20, #8
	mov	x0, x21
	bl	_spin_lock
Lloh3:
	adrp	x8, _SSI_CHANNEL_STATE_WRITING@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SSI_CHANNEL_STATE_WRITING@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [x20, #12]
	bic	w8, w9, w8
	str	w8, [x20, #12]
	mov	x0, x19
	bl	_cs_release_cmd
	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
	b	_spin_unlock
LBB0_2:
Lloh6:
	adrp	x8, _HSI_STATUS_ERROR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _HSI_STATUS_ERROR@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w2, w8
	b.ne	LBB0_4
; %bb.3:
	mov	x0, x20
	mov	x1, 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	_cs_hsi_control_write_error
LBB0_4:
	ldr	x0, [x20]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	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	_dev_err
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_HSI_STATUS_COMPLETED,4,2       ; @HSI_STATUS_COMPLETED
	.comm	_SSI_CHANNEL_STATE_WRITING,4,2  ; @SSI_CHANNEL_STATE_WRITING
	.comm	_HSI_STATUS_ERROR,4,2           ; @HSI_STATUS_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unexpected status in control write callback %d\n"

	.no_dead_strip	_cs_hsi_write_on_control_complete
.subsections_via_symbols
