	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function isert_handle_scsi_cmd
_isert_handle_scsi_cmd:                 ## @isert_handle_scsi_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	%r8, %r15
	movq	%rcx, %r13
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movq	(%rdi), %rdi
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdx, %rsi
	movq	%r8, %rdx
	callq	_iscsit_setup_scsi_cmd
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movl	(%r12), %eax
	movl	4(%r12), %ecx
	movl	16(%r12), %r13d
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	cmpl	%r13d, %ecx
	jne	LBB0_5
## %bb.4:
	movq	_SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 32(%r12)
LBB0_5:
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	8(%r12), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	leaq	16(%r12), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_iscsit_process_scsi_cmd
	xorl	%r14d, %r14d
	testl	%eax, %eax
	js	LBB0_20
## %bb.6:
	je	LBB0_7
LBB0_13:
	movl	(%r15), %ecx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movq	%r15, %rdx
	movl	%eax, %r15d
	callq	_iscsit_sequence_cmd
	testl	%eax, %eax
	movl	%r15d, %eax
	jne	LBB0_17
## %bb.14:
	testl	%eax, %eax
	jne	LBB0_17
## %bb.15:
	cmpl	$0, -56(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_17
## %bb.16:
	movq	%r12, %rdi
	callq	_iscsit_set_unsolicited_dataout
	jmp	LBB0_20
LBB0_1:
	movl	%eax, %r14d
LBB0_20:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	testl	%eax, %eax
	je	LBB0_20
## %bb.18:
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_20
## %bb.19:
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_target_put_sess_cmd
	jmp	LBB0_20
LBB0_7:
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_20
## %bb.8:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	cmpl	%r13d, %edi
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	jne	LBB0_9
## %bb.10:
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_sg_init_table
	movq	%rbx, 24(%r12)
	movl	$1, 20(%r12)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_sg_set_buf
	leaq	L_.str.1(%rip), %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_isert_dbg
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	jmp	LBB0_11
LBB0_9:
	movl	%eax, %r13d
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_DIV_ROUND_UP
	movl	$1, %edi
	movl	%eax, %esi
	callq	_max
	movl	%eax, %ebx
	movq	24(%r12), %rdi
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdx
	movl	%ebx, %esi
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_sg_copy_from_buffer
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_isert_dbg
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%r13d, %eax
LBB0_11:
	addl	12(%r12), %ecx
	movl	%ecx, 12(%r12)
	cmpl	16(%r12), %ecx
	jne	LBB0_13
## %bb.12:
	leaq	40(%r12), %r13
	movq	%r13, %rdi
	callq	_spin_lock_bh
	movq	_ICF_GOT_LAST_DATAOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 48(%r12)
	movq	_ISTATE_RECEIVED_LAST_DATAOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%r12)
	movq	%r13, %rdi
	callq	_spin_unlock_bh
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC,4,2 ## @SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Copy Immediate sg_nents: %u imm_data_len: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Transfer Immediate imm_data_len: %d\n"

	.comm	_ICF_GOT_LAST_DATAOUT,4,2       ## @ICF_GOT_LAST_DATAOUT
	.comm	_ISTATE_RECEIVED_LAST_DATAOUT,4,2 ## @ISTATE_RECEIVED_LAST_DATAOUT
	.no_dead_strip	_isert_handle_scsi_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function isert_handle_scsi_cmd
_isert_handle_scsi_cmd:                 ; @isert_handle_scsi_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	x21, x4
	mov	x25, x3
	mov	x19, x2
	mov	x26, x1
	ldr	x22, [x0]
	mov	x0, x22
	mov	x1, x2
	mov	x2, x4
	bl	_iscsit_setup_scsi_cmd
	tbnz	w0, #31, LBB0_16
; %bb.1:
	ldp	w27, w24, [x19]
	mov	x20, x19
	ldr	w28, [x20, #16]!
	cmp	w27, #0
	ccmp	w24, w28, #0, ne
	b.ne	LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x19, #32]
	orr	w8, w9, w8
	str	w8, [x19, #32]
LBB0_3:
	ldr	w8, [x19, #8]
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	mov	x0, x22
	mov	x1, x19
	mov	x2, x21
	bl	_iscsit_process_scsi_cmd
	tbnz	w0, #31, LBB0_15
; %bb.4:
	mov	x23, x0
	cbz	w0, LBB0_12
LBB0_5:
	ldr	w3, [x21]
	mov	x0, x22
	mov	x1, x19
	mov	x2, x21
	bl	_iscsit_sequence_cmd
	cbnz	w0, LBB0_9
; %bb.6:
	cbnz	w23, LBB0_9
; %bb.7:
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_9
; %bb.8:
	mov	x0, x19
	bl	_iscsit_set_unsolicited_dataout
	b	LBB0_15
LBB0_9:
	mov	w0, #0
	cbz	w23, LBB0_16
; %bb.10:
	cbz	w27, LBB0_16
; %bb.11:
	mov	x0, x20
	bl	_target_put_sess_cmd
	b	LBB0_15
LBB0_12:
	cbz	w27, LBB0_15
; %bb.13:
	cmp	w24, w28
	b.ne	LBB0_17
; %bb.14:
	mov	w28, #1
	mov	x0, x26
	mov	w1, #1
	bl	_sg_init_table
	str	x26, [x19, #24]
	str	w28, [x19, #20]
	ldr	x1, [x25]
	mov	x0, x26
	mov	x2, x24
	bl	_sg_set_buf
Lloh3:
	adrp	x0, l_.str.1@PAGE
Lloh4:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x24
	b	LBB0_18
LBB0_15:
	mov	w0, #0
LBB0_16:
	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_17:
Lloh5:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x24
	bl	_DIV_ROUND_UP
	mov	x1, x0
	mov	w0, #1
	bl	_max
	mov	x26, x0
	ldr	x0, [x19, #24]
	ldr	x2, [x25]
	mov	x1, x26
	mov	x3, x24
	bl	_sg_copy_from_buffer
	str	x24, [sp]
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x26
LBB0_18:
	bl	_isert_dbg
	ldp	w8, w9, [x19, #12]
	add	w8, w8, w24
	cmp	w8, w9
	str	w8, [x19, #12]
	b.ne	LBB0_5
; %bb.19:
	add	x24, x19, #40
	mov	x0, x24
	bl	_spin_lock_bh
Lloh10:
	adrp	x8, _ICF_GOT_LAST_DATAOUT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ICF_GOT_LAST_DATAOUT@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	ldr	w9, [x19, #48]
	orr	w8, w9, w8
Lloh13:
	adrp	x9, _ISTATE_RECEIVED_LAST_DATAOUT@GOTPAGE
Lloh14:
	ldr	x9, [x9, _ISTATE_RECEIVED_LAST_DATAOUT@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #44]
	mov	x0, x24
	bl	_spin_unlock_bh
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC,4,2 ; @SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Copy Immediate sg_nents: %u imm_data_len: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Transfer Immediate imm_data_len: %d\n"

	.comm	_ICF_GOT_LAST_DATAOUT,4,2       ; @ICF_GOT_LAST_DATAOUT
	.comm	_ISTATE_RECEIVED_LAST_DATAOUT,4,2 ; @ISTATE_RECEIVED_LAST_DATAOUT
	.no_dead_strip	_isert_handle_scsi_cmd
.subsections_via_symbols
