	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vscsi_task_management
_vscsi_task_management:                 ## @vscsi_task_management
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	addq	$8, %rdi
	movq	_MA_OWNED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_mtx_assert
	leaq	4(%r15), %r12
	movq	%r12, %rdi
	callq	_TAILQ_FIRST
	movq	%rax, %r14
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_panic
LBB0_2:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, 24(%r14)
	movq	_queue@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_TAILQ_REMOVE
	movl	(%r13), %edx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_TAILQ_INSERT_TAIL
	movl	$24, (%r14)
	movq	8(%r14), %rax
	movl	32(%rax), %edi
	movq	_M_BESTFIT@GOTPCREL(%rip), %rax
	movq	_M_NOWAIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r14, %rcx
	addq	$16, %rcx
	movl	$24, %esi
	callq	_vmem_alloc
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_panic
LBB0_4:
	movq	8(%r14), %rax
	movq	24(%rax), %r12
	movq	16(%r14), %rbx
	leaq	(%r12,%rbx,4), %r15
	movl	(%r14), %esi
	movq	%r15, %rdi
	callq	_bzero
	movq	_SRP_TSK_MGMT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r12,%rbx,4)
	movq	%r14, 8(%r12,%rbx,4)
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movl	4(%r13), %edi
	callq	_CAM_EXTLUN_BYTE_SWIZZLE
	movl	%eax, %edi
	callq	_htobe64
	movl	%eax, 4(%r12,%rbx,4)
	movl	(%r13), %esi
	cmpl	$128, %esi
	jne	LBB0_6
## %bb.5:
	movl	$8, (%r15)
	jmp	LBB0_7
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_panic
LBB0_7:
	movq	8(%r14), %rax
	movl	16(%rax), %esi
	movl	20(%rax), %edi
	movq	_BUS_DMASYNC_PREWRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_bus_dmamap_sync
	movq	8(%r14), %rax
	movq	_H_SEND_CRQ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	(%rax), %esi
	movabsq	$549755813912, %rdx             ## imm = 0x8000000018
	movl	$1, %ecx
	callq	_phyp_hcall
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	leaq	L_.str.3(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_panic                          ## TAILCALL
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MA_OWNED,4,2                   ## @MA_OWNED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SCSI queue flooded"

	.comm	_queue,4,2                      ## @queue
	.comm	_M_BESTFIT,4,2                  ## @M_BESTFIT
	.comm	_M_NOWAIT,4,2                   ## @M_NOWAIT
L_.str.1:                               ## @.str.1
	.asciz	"Error during VMEM allocation (%d)"

	.comm	_SRP_TSK_MGMT,4,2               ## @SRP_TSK_MGMT
L_.str.2:                               ## @.str.2
	.asciz	"Unimplemented code %d"

	.comm	_BUS_DMASYNC_PREWRITE,4,2       ## @BUS_DMASYNC_PREWRITE
	.comm	_H_SEND_CRQ,4,2                 ## @H_SEND_CRQ
L_.str.3:                               ## @.str.3
	.asciz	"CRQ send failure (%d)"

	.no_dead_strip	_vscsi_task_management
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vscsi_task_management
_vscsi_task_management:                 ; @vscsi_task_management
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x1
	mov	x21, x0
	add	x0, x0, #8
Lloh0:
	adrp	x8, _MA_OWNED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MA_OWNED@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_mtx_assert
	add	x22, x21, #4
	mov	x0, x22
	bl	_TAILQ_FIRST
	mov	x19, x0
	cbnz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_panic
LBB0_2:
	str	x20, [x19, #24]
Lloh5:
	adrp	x23, _queue@GOTPAGE
Lloh6:
	ldr	x23, [x23, _queue@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x22
	mov	x1, x19
	bl	_TAILQ_REMOVE
	ldr	w2, [x23]
	mov	x0, x21
	mov	x1, x19
	bl	_TAILQ_INSERT_TAIL
	mov	w8, #24
	str	w8, [x19]
	ldr	x8, [x19, #8]
	ldr	w0, [x8, #32]
Lloh7:
	adrp	x8, _M_BESTFIT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _M_BESTFIT@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _M_NOWAIT@GOTPAGE
Lloh11:
	ldr	x9, [x9, _M_NOWAIT@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w2, w9, w8
	add	x3, x19, #16
	mov	w1, #24
	bl	_vmem_alloc
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_4
; %bb.3:
	str	x0, [sp]
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_panic
LBB0_4:
	ldp	x8, x9, [x19, #8]
	ldr	x8, [x8, #24]
	add	x21, x8, x9, lsl #2
	ldr	w1, [x19]
	mov	x0, x21
	bl	_bzero
Lloh15:
	adrp	x8, _SRP_TSK_MGMT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SRP_TSK_MGMT@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	w8, [x21, #16]
	str	x19, [x21, #8]
	ldr	w0, [x20, #4]
	bl	_CAM_EXTLUN_BYTE_SWIZZLE
	bl	_htobe64
	str	w0, [x21, #4]
	ldr	w8, [x20]
	cmp	w8, #128
	b.ne	LBB0_6
; %bb.5:
	mov	w8, #8
	str	w8, [x21]
	b	LBB0_7
LBB0_6:
	str	x8, [sp]
Lloh18:
	adrp	x0, l_.str.2@PAGE
Lloh19:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_panic
LBB0_7:
	ldr	x8, [x19, #8]
	ldp	w1, w0, [x8, #16]
Lloh20:
	adrp	x8, _BUS_DMASYNC_PREWRITE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _BUS_DMASYNC_PREWRITE@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	bl	_bus_dmamap_sync
	ldr	x8, [x19, #8]
Lloh23:
	adrp	x9, _H_SEND_CRQ@GOTPAGE
Lloh24:
	ldr	x9, [x9, _H_SEND_CRQ@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x9]
	ldr	w1, [x8]
	mov	x2, #24
	movk	x2, #128, lsl #32
	mov	w3, #1
	bl	_phyp_hcall
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_9
; %bb.8:
	str	x0, [sp]
Lloh26:
	adrp	x0, l_.str.3@PAGE
Lloh27:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_panic
LBB0_9:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_MA_OWNED,4,2                   ; @MA_OWNED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SCSI queue flooded"

	.comm	_queue,4,2                      ; @queue
	.comm	_M_BESTFIT,4,2                  ; @M_BESTFIT
	.comm	_M_NOWAIT,4,2                   ; @M_NOWAIT
l_.str.1:                               ; @.str.1
	.asciz	"Error during VMEM allocation (%d)"

	.comm	_SRP_TSK_MGMT,4,2               ; @SRP_TSK_MGMT
l_.str.2:                               ; @.str.2
	.asciz	"Unimplemented code %d"

	.comm	_BUS_DMASYNC_PREWRITE,4,2       ; @BUS_DMASYNC_PREWRITE
	.comm	_H_SEND_CRQ,4,2                 ; @H_SEND_CRQ
l_.str.3:                               ; @.str.3
	.asciz	"CRQ send failure (%d)"

	.no_dead_strip	_vscsi_task_management
.subsections_via_symbols
