	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iser_send_command              ## -- Begin function iser_send_command
	.p2align	4, 0x90
_iser_send_command:                     ## @iser_send_command
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %rbx
	movq	40(%rsi), %r14
	movq	24(%rsi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	32(%rsi), %r12
	leaq	24(%r14), %r15
	movl	(%rbx), %eax
	incl	%eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	%eax, (%rbx)
	movl	4(%r12), %edi
	callq	_ntohl
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	_ISCSI_TX_SCSI_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%r14)
	movq	_iser_cmd_comp@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	%eax, 24(%r14)
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movq	%r15, %rsi
	callq	_iser_create_send_desc
	movq	_ISCSI_FLAG_CMD_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%r12, -104(%rbp)                ## 8-byte Spill
	andl	(%r12), %eax
	movq	%r13, -112(%rbp)                ## 8-byte Spill
	jne	LBB0_1
## %bb.2:
	movq	_ISER_DIR_OUT@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_ISER_DIR_IN@GOTPCREL(%rip), %rax
LBB0_3:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	8(%r15), %rcx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	16(%r15), %r13
	movq	(%rax), %rbx
	movq	%r12, %rdi
	callq	_scsi_sg_count
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	%r12, %rdi
	callq	_scsi_sglist
	leaq	(%rbx,%rbx,2), %r14
	movl	%eax, 16(%r13,%r14,8)
	movq	%r12, %rdi
	callq	_scsi_sg_count
	movq	%rax, 8(%r13,%r14,8)
LBB0_5:
	movq	%r12, %rdi
	callq	_scsi_bufflen
	leaq	(%rbx,%rbx,2), %r14
	movl	%eax, (%r13,%r14,8)
	movq	%r12, %rdi
	callq	_scsi_prot_sg_count
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	leaq	(,%r14,8), %rbx
	addq	%r13, %rbx
	movq	%r12, %rdi
	callq	_scsi_prot_sglist
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movl	%eax, 16(%r13,%r14,8)
	movq	%r12, %rdi
	callq	_scsi_prot_sg_count
	movq	%rax, 8(%r13,%r14,8)
	movl	(%rbx), %ebx
	movq	(%r12), %rax
	movl	(%rax), %edi
	callq	_ilog2
	movl	%eax, %ecx
	sarl	%cl, %ebx
	shll	$3, %ebx
	movl	%ebx, (%r13,%r14,8)
LBB0_7:
	movq	-104(%rbp), %r12                ## 8-byte Reload
	movl	(%r12), %eax
	movq	_ISCSI_FLAG_CMD_READ@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	movq	-112(%rbp), %r14                ## 8-byte Reload
	je	LBB0_10
## %bb.8:
	movq	%r14, %rdi
	callq	_iser_prepare_read_cmd
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.9:
	movl	(%r12), %eax
LBB0_10:
	movq	_ISCSI_FLAG_CMD_WRITE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_12
## %bb.11:
	movq	16(%r14), %rsi
	movq	8(%r14), %rdx
	addq	%rsi, %rdx
	movq	%r14, %rdi
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	callq	_iser_prepare_write_cmd
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
LBB0_12:
	movq	_ISER_TASK_STATUS_STARTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	callq	_iser_signal_comp
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movl	%eax, %edx
	callq	_iser_post_send
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_13
LBB0_14:
	movl	(%r14), %edx
	leaq	L_.str(%rip), %rdi
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %ecx
	callq	_iser_err
LBB0_15:
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	xorl	%ebx, %ebx
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_ISCSI_TX_SCSI_COMMAND,4,2      ## @ISCSI_TX_SCSI_COMMAND
	.comm	_iser_cmd_comp,4,2              ## @iser_cmd_comp
	.comm	_ISCSI_FLAG_CMD_READ,4,2        ## @ISCSI_FLAG_CMD_READ
	.comm	_ISER_DIR_IN,8,3                ## @ISER_DIR_IN
	.comm	_ISER_DIR_OUT,8,3               ## @ISER_DIR_OUT
	.comm	_ISCSI_FLAG_CMD_WRITE,4,2       ## @ISCSI_FLAG_CMD_WRITE
	.comm	_ISER_TASK_STATUS_STARTED,4,2   ## @ISER_TASK_STATUS_STARTED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"conn %p failed task->itt %d err %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iser_send_command              ; -- Begin function iser_send_command
	.p2align	2
_iser_send_command:                     ; @iser_send_command
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x28, x0
	ldr	x21, [x0]
	ldp	x27, x26, [x1, #32]
	ldr	x25, [x1, #24]
	ldr	w8, [x21]
	add	w8, w8, #1
	str	w8, [sp, #28]                   ; 4-byte Folded Spill
	str	w8, [x21]
	ldr	w0, [x27, #4]
	bl	_ntohl
	str	x0, [sp, #16]                   ; 8-byte Folded Spill
Lloh0:
	adrp	x8, _iser_cmd_comp@GOTPAGE
Lloh1:
	ldr	x8, [x8, _iser_cmd_comp@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mov	x23, x26
	str	w8, [x23, #24]!
Lloh3:
	adrp	x8, _ISCSI_TX_SCSI_COMMAND@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ISCSI_TX_SCSI_COMMAND@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x26, #28]
	mov	x0, x21
	mov	x1, x23
	bl	_iser_create_send_desc
	ldr	w8, [x27]
Lloh6:
	adrp	x11, _ISCSI_FLAG_CMD_READ@GOTPAGE
Lloh7:
	ldr	x11, [x11, _ISCSI_FLAG_CMD_READ@GOTPAGEOFF]
Lloh8:
	adrp	x9, _ISER_DIR_OUT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ISER_DIR_OUT@GOTPAGEOFF]
Lloh10:
	adrp	x10, _ISER_DIR_IN@GOTPAGE
Lloh11:
	ldr	x10, [x10, _ISER_DIR_IN@GOTPAGEOFF]
Lloh12:
	ldr	w11, [x11]
	tst	w11, w8
	csel	x8, x9, x10, eq
	ldr	x24, [x8]
	ldp	x22, x19, [x26, #8]
	mov	x0, x25
	bl	_scsi_sg_count
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x25
	bl	_scsi_sglist
	mov	w8, #24
	str	x20, [sp, #8]                   ; 8-byte Folded Spill
	mov	x20, x26
	mov	x26, x27
	mov	x27, x23
	mov	x23, x21
	mov	x21, x22
	mov	x22, x28
	madd	x28, x24, x8, x19
	str	w0, [x28, #16]
	mov	x0, x25
	bl	_scsi_sg_count
	str	x0, [x28, #8]
	mov	x28, x22
	mov	x22, x21
	mov	x21, x23
	mov	x23, x27
	mov	x27, x26
	mov	x26, x20
	ldr	x20, [sp, #8]                   ; 8-byte Folded Reload
LBB0_2:
	mov	x0, x25
	bl	_scsi_bufflen
	mov	w8, #24
	madd	x19, x24, x8, x19
	str	w0, [x19]
	mov	x0, x25
	bl	_scsi_prot_sg_count
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x25
	bl	_scsi_prot_sglist
	mov	w8, #24
	madd	x22, x24, x8, x22
	str	w0, [x22, #16]
	mov	x0, x25
	bl	_scsi_prot_sg_count
	str	x0, [x22, #8]
	ldr	w19, [x19]
	ldr	x8, [x25]
	ldr	w0, [x8]
	bl	_ilog2
	asr	w8, w19, w0
	lsl	w8, w8, #3
	str	w8, [x22]
LBB0_4:
	ldr	w8, [x27]
Lloh13:
	adrp	x9, _ISCSI_FLAG_CMD_READ@GOTPAGE
Lloh14:
	ldr	x9, [x9, _ISCSI_FLAG_CMD_READ@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.5:
	mov	x0, x20
	bl	_iser_prepare_read_cmd
	mov	x25, x0
	cbnz	w0, LBB0_10
; %bb.6:
	ldr	w8, [x27]
LBB0_7:
Lloh16:
	adrp	x9, _ISCSI_FLAG_CMD_WRITE@GOTPAGE
Lloh17:
	ldr	x9, [x9, _ISCSI_FLAG_CMD_WRITE@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.8:
	ldp	x8, x1, [x20, #8]
	add	x2, x8, x1
	mov	x0, x20
	ldr	x3, [sp, #16]                   ; 8-byte Folded Reload
	bl	_iser_prepare_write_cmd
	mov	x25, x0
	cbnz	w0, LBB0_10
LBB0_9:
Lloh19:
	adrp	x8, _ISER_TASK_STATUS_STARTED@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ISER_TASK_STATUS_STARTED@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	str	w8, [x26]
	ldr	w0, [sp, #28]                   ; 4-byte Folded Reload
	bl	_iser_signal_comp
	mov	x2, x0
	mov	x0, x21
	mov	x1, x23
	bl	_iser_post_send
	mov	x25, x0
	cbz	w0, LBB0_11
LBB0_10:
	ldr	w2, [x20]
Lloh22:
	adrp	x0, l_.str@PAGE
Lloh23:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x28
	mov	x3, x25
	bl	_iser_err
LBB0_11:
	mov	x0, x25
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh12
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_ISCSI_TX_SCSI_COMMAND,4,2      ; @ISCSI_TX_SCSI_COMMAND
	.comm	_iser_cmd_comp,4,2              ; @iser_cmd_comp
	.comm	_ISCSI_FLAG_CMD_READ,4,2        ; @ISCSI_FLAG_CMD_READ
	.comm	_ISER_DIR_IN,8,3                ; @ISER_DIR_IN
	.comm	_ISER_DIR_OUT,8,3               ; @ISER_DIR_OUT
	.comm	_ISCSI_FLAG_CMD_WRITE,4,2       ; @ISCSI_FLAG_CMD_WRITE
	.comm	_ISER_TASK_STATUS_STARTED,4,2   ; @ISER_TASK_STATUS_STARTED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"conn %p failed task->itt %d err %d\n"

.subsections_via_symbols
