	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vscsi_srp_login
_vscsi_srp_login:                       ## @vscsi_srp_login
	.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	%rdi, %r14
	addq	$16, %rdi
	movq	_MA_OWNED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_mtx_assert
	leaq	12(%r14), %r15
	movq	%r15, %rdi
	callq	_TAILQ_FIRST
	movq	%rax, %r13
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_panic
LBB0_2:
	movq	$0, 24(%r13)
	movq	_queue@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_TAILQ_REMOVE
	leaq	8(%r14), %rdi
	movl	(%r12), %edx
	movq	%r13, %rsi
	callq	_TAILQ_INSERT_TAIL
	movl	$64, (%r13)
	movq	8(%r13), %rax
	movl	24(%rax), %edi
	movq	_M_BESTFIT@GOTPCREL(%rip), %rax
	movq	_M_NOWAIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r13, %rcx
	addq	$16, %rcx
	movl	$64, %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(%r13), %rax
	movq	16(%rax), %r15
	movq	16(%r13), %rbx
	leaq	(%r15,%rbx,4), %rdi
	movl	(%r13), %esi
	callq	_bzero
	movq	_SRP_LOGIN_REQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r15,%rbx,4)
	movq	%r13, 16(%r15,%rbx,4)
	movl	$256, %edi                      ## imm = 0x100
	callq	_htobe64
	movl	%eax, 12(%r15,%rbx,4)
	movl	$3, %edi
	callq	_htobe16
	movl	%eax, 8(%r15,%rbx,4)
	movq	$0, (%r15,%rbx,4)
	movl	(%r14), %esi
	movl	4(%r14), %edi
	movq	_BUS_DMASYNC_PREWRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_bus_dmamap_sync
	movq	_H_SEND_CRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%r13), %rax
	movl	(%rax), %esi
	movabsq	$549755813952, %rdx             ## imm = 0x8000000040
	movl	$1, %ecx
	callq	_phyp_hcall
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	leaq	L_.str.2(%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_5:
	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_LOGIN_REQ,4,2              ## @SRP_LOGIN_REQ
	.comm	_BUS_DMASYNC_PREWRITE,4,2       ## @BUS_DMASYNC_PREWRITE
	.comm	_H_SEND_CRQ,4,2                 ## @H_SEND_CRQ
L_.str.2:                               ## @.str.2
	.asciz	"CRQ send failure (%d)"

	.no_dead_strip	_vscsi_srp_login
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vscsi_srp_login
_vscsi_srp_login:                       ; @vscsi_srp_login
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	add	x0, x0, #16
Lloh0:
	adrp	x8, _MA_OWNED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MA_OWNED@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_mtx_assert
	add	x21, x19, #12
	mov	x0, x21
	bl	_TAILQ_FIRST
	mov	x20, 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	xzr, [x20, #24]
Lloh5:
	adrp	x22, _queue@GOTPAGE
Lloh6:
	ldr	x22, [x22, _queue@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x21
	mov	x1, x20
	bl	_TAILQ_REMOVE
	add	x0, x19, #8
	ldr	w2, [x22]
	mov	x1, x20
	bl	_TAILQ_INSERT_TAIL
	mov	w8, #64
	str	w8, [x20]
	ldr	x8, [x20, #8]
	ldr	w0, [x8, #24]
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, x20, #16
	mov	w1, #64
	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, [x20, #8]
	ldr	x8, [x8, #16]
	add	x21, x8, x9, lsl #2
	ldr	w1, [x20]
	mov	x0, x21
	bl	_bzero
Lloh15:
	adrp	x8, _SRP_LOGIN_REQ@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SRP_LOGIN_REQ@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	w8, [x21, #24]
	str	x20, [x21, #16]
	mov	w0, #256
	bl	_htobe64
	str	w0, [x21, #12]
	mov	w0, #3
	bl	_htobe16
	str	w0, [x21, #8]
	str	xzr, [x21]
	ldp	w1, w0, [x19]
Lloh18:
	adrp	x8, _BUS_DMASYNC_PREWRITE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _BUS_DMASYNC_PREWRITE@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	bl	_bus_dmamap_sync
Lloh21:
	adrp	x8, _H_SEND_CRQ@GOTPAGE
Lloh22:
	ldr	x8, [x8, _H_SEND_CRQ@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	ldr	x8, [x20, #8]
	ldr	w1, [x8]
	mov	x2, #64
	movk	x2, #128, lsl #32
	mov	w3, #1
	bl	_phyp_hcall
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_6
; %bb.5:
	str	x0, [sp]
Lloh24:
	adrp	x0, l_.str.2@PAGE
Lloh25:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_panic
LBB0_6:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	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	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh24, Lloh25
	.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_LOGIN_REQ,4,2              ; @SRP_LOGIN_REQ
	.comm	_BUS_DMASYNC_PREWRITE,4,2       ; @BUS_DMASYNC_PREWRITE
	.comm	_H_SEND_CRQ,4,2                 ; @H_SEND_CRQ
l_.str.2:                               ; @.str.2
	.asciz	"CRQ send failure (%d)"

	.no_dead_strip	_vscsi_srp_login
.subsections_via_symbols
