	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iser_prepare_write_cmd
_iser_prepare_write_cmd:                ## @iser_prepare_write_cmd
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %r13
	movq	_ISER_DIR_OUT@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	leaq	(,%rax,4), %rbx
	addq	56(%r13), %rbx
	movl	%ecx, -56(%rbp)                 ## 4-byte Spill
	movl	%edx, -60(%rbp)                 ## 4-byte Spill
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	8(%r13), %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	callq	_iser_dma_map_task_data
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_1
LBB0_12:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	48(%r13), %edi
	callq	_scsi_prot_sg_count
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	(%r15), %rdx
	leaq	(,%rdx,4), %rsi
	addq	40(%r13), %rsi
	movl	(%r12), %ecx
	movq	%r13, %rdi
	callq	_iser_dma_map_task_data
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_12
LBB0_3:
	movq	(%r15), %rsi
	xorl	%edx, %edx
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, (%rbx)
	sete	%dl
	movq	%r13, %rdi
	callq	_iser_reg_rdma_mem
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rdi
	callq	_iser_err
	jmp	LBB0_12
LBB0_5:
	movq	32(%r13), %rcx
	movq	(%r15), %r12
	movl	-60(%rbp), %r14d                ## 4-byte Reload
	cmpl	-56(%rbp), %r14d                ## 4-byte Folded Reload
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	jae	LBB0_9
## %bb.6:
	movq	_ISER_WSV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 24(%r13)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, (%rbx)
	movq	%rcx, %rbx
	jbe	LBB0_8
## %bb.7:
	leaq	(%r12,%r12,2), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	16(%rcx,%rax,8), %edi
	callq	_cpu_to_be32
	movl	%eax, 20(%r13)
	movl	%r14d, %edi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addq	8(%rbx,%rax,8), %rdi
	callq	_cpu_to_be64
	movq	%rbx, %rcx
	movl	%eax, 16(%r13)
LBB0_8:
	movl	(%r15), %esi
	leaq	(%r12,%r12,2), %rax
	movl	16(%rcx,%rax,8), %edx
	movq	8(%rbx,%rax,8), %rcx
	leaq	L_.str.1(%rip), %rdi
	movl	%r14d, %r8d
	xorl	%eax, %eax
	callq	_iser_dbg
	movq	%rbx, %rcx
LBB0_9:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	testl	%ebx, %ebx
	je	LBB0_10
## %bb.11:
	movl	(%r15), %esi
	leaq	L_.str.2(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%ebx, %edx
	xorl	%eax, %eax
	movq	%rcx, %r15
	callq	_iser_dbg
	leaq	(%r12,%r12,2), %rax
	movq	8(%r15,%rax,8), %rcx
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movq	%rcx, 24(%rdx)
	movl	%ebx, 16(%rdx)
	movl	(%r15,%rax,8), %eax
	movl	%eax, 20(%rdx)
	movl	$2, (%r13)
	jmp	LBB0_12
LBB0_10:
	xorl	%r14d, %r14d
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_ISER_DIR_OUT,8,3               ## @ISER_DIR_OUT
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to register write cmd RDMA mem\n"

	.comm	_ISER_WSV,4,2                   ## @ISER_WSV
L_.str.1:                               ## @.str.1
	.asciz	"Cmd itt:%d, WRITE tags, RKEY:%#.4X VA:%#llX + unsol:%d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Cmd itt:%d, WRITE, adding imm.data sz: %d\n"

	.no_dead_strip	_iser_prepare_write_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iser_prepare_write_cmd
_iser_prepare_write_cmd:                ; @iser_prepare_write_cmd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x24, x3
	mov	x22, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x19, [x0, #8]
	ldr	x8, [x19, #56]
Lloh0:
	adrp	x28, _ISER_DIR_OUT@GOTPAGE
Lloh1:
	ldr	x28, [x28, _ISER_DIR_OUT@GOTPAGEOFF]
	ldr	x2, [x28]
	add	x23, x8, x2, lsl #2
	ldr	x26, [x19, #8]
Lloh2:
	adrp	x27, _DMA_TO_DEVICE@GOTPAGE
Lloh3:
	ldr	x27, [x27, _DMA_TO_DEVICE@GOTPAGEOFF]
	ldr	w3, [x27]
	mov	x0, x19
	mov	x1, x23
	bl	_iser_dma_map_task_data
	mov	x25, x0
	cbz	w0, LBB0_2
LBB0_1:
	mov	x0, x25
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_2:
	ldr	w0, [x19, #48]
	bl	_scsi_prot_sg_count
	cbz	x0, LBB0_4
; %bb.3:
	ldr	x8, [x19, #40]
	ldr	x2, [x28]
	add	x1, x8, x2, lsl #2
	ldr	w3, [x27]
	mov	x0, x19
	bl	_iser_dma_map_task_data
	mov	x25, x0
	cbnz	w0, LBB0_1
LBB0_4:
	ldr	x1, [x28]
	ldr	w8, [x23]
	cmp	w8, w20
	cset	w2, eq
	mov	x0, x19
	bl	_iser_reg_rdma_mem
	cbz	w0, LBB0_6
; %bb.5:
	mov	x25, x0
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_iser_err
	b	LBB0_1
LBB0_6:
	ldr	x27, [x19, #32]
	ldr	x28, [x28]
	cmp	w22, w24
	b.hs	LBB0_10
; %bb.7:
Lloh6:
	adrp	x8, _ISER_WSV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ISER_WSV@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	w9, [x19, #24]
	orr	w8, w9, w8
	str	w8, [x19, #24]
	ldr	w8, [x23]
	cmp	w8, w20
	b.ls	LBB0_9
; %bb.8:
	mov	w8, #24
	madd	x23, x28, x8, x27
	ldr	w0, [x23, #16]
	bl	_cpu_to_be32
	str	w0, [x19, #20]
	ldr	x8, [x23, #8]
	add	x0, x8, w22, uxtw
	bl	_cpu_to_be64
	str	w0, [x19, #16]
LBB0_9:
	ldr	w1, [x21]
	mov	w8, #24
	madd	x8, x28, x8, x27
	ldr	w2, [x8, #16]
	ldr	x8, [x8, #8]
	stp	x8, x22, [sp]
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_iser_dbg
LBB0_10:
	cbz	w20, LBB0_12
; %bb.11:
	ldr	w1, [x21]
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x2, x20
	bl	_iser_dbg
	mov	w25, #0
	mov	w8, #24
	madd	x8, x28, x8, x27
	ldr	x9, [x8, #8]
	str	x9, [x26, #24]
	ldr	w8, [x8]
	stp	w20, w8, [x26, #16]
	mov	w8, #2
	str	w8, [x19]
	b	LBB0_1
LBB0_12:
	mov	w25, #0
	b	LBB0_1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_ISER_DIR_OUT,8,3               ; @ISER_DIR_OUT
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to register write cmd RDMA mem\n"

	.comm	_ISER_WSV,4,2                   ; @ISER_WSV
l_.str.1:                               ; @.str.1
	.asciz	"Cmd itt:%d, WRITE tags, RKEY:%#.4X VA:%#llX + unsol:%d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Cmd itt:%d, WRITE, adding imm.data sz: %d\n"

	.no_dead_strip	_iser_prepare_write_cmd
.subsections_via_symbols
