	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ish_fw_xfer_ishtp
_ish_fw_xfer_ishtp:                     ## @ish_fw_xfer_ishtp
	.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	$24, %rsp
	.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
	movq	_LOADER_SHIM_IPC_BUF_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_IPC_FRAGMENT_DATA_PREAMBLE@GOTPCREL(%rip), %rax
	movq	%rdi, %rcx
	subq	(%rax), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	_LOADER_CMD_XFER_FRAGMENT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 28(%rax)
	movq	_LOADER_XFER_MODE_ISHTP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	%ecx, 24(%rax)
	movq	(%rbx), %rax
	testq	%rax, %rax
	jle	LBB0_7
## %bb.3:
	movq	%r15, %r14
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	leaq	(%r15,%rsi), %rcx
	movq	%rax, %r12
	subq	%r15, %r12
	xorl	%edx, %edx
	cmpq	%rax, %rcx
	cmovlq	%rsi, %r12
	setge	%dl
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movl	%edx, (%r13)
	movq	%r15, 16(%r13)
	movq	%r12, 8(%r13)
	movl	32(%r13), %edi
	leaq	(,%r15,4), %rsi
	addq	8(%rbx), %rsi
	movq	%r12, %rdx
	callq	_memcpy
	movq	%r14, %rdi
	callq	_cl_data_to_dev
	movq	16(%r13), %rdx
	movq	8(%r13), %rcx
	movl	(%r13), %r8d
	movl	%eax, %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movq	_IPC_FRAGMENT_DATA_PREAMBLE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	addq	%r12, %rdx
	movq	%r14, %rdi
	movq	%r13, %rsi
	leaq	-64(%rbp), %rcx
	movl	$4, %r8d
	callq	_loader_cl_send
	testl	%eax, %eax
	js	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_5 Depth=1
	addq	%r12, %r15
	movq	(%rbx), %rax
	cmpq	%r15, %rax
	jg	LBB0_5
LBB0_7:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfree
	xorl	%r13d, %r13d
	jmp	LBB0_8
LBB0_1:
	movl	$1, (%r15)
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_8
LBB0_6:
	movl	%eax, %r13d
	movl	$1, (%r14)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfree
LBB0_8:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LOADER_SHIM_IPC_BUF_SIZE,8,3   ## @LOADER_SHIM_IPC_BUF_SIZE
	.comm	_IPC_FRAGMENT_DATA_PREAMBLE,8,3 ## @IPC_FRAGMENT_DATA_PREAMBLE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_LOADER_CMD_XFER_FRAGMENT,4,2   ## @LOADER_CMD_XFER_FRAGMENT
	.comm	_LOADER_XFER_MODE_ISHTP,4,2     ## @LOADER_XFER_MODE_ISHTP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"xfer_mode=ipc offset=0x%08x size=0x%08x is_last=%d\n"

	.no_dead_strip	_ish_fw_xfer_ishtp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ish_fw_xfer_ishtp
_ish_fw_xfer_ishtp:                     ; @ish_fw_xfer_ishtp
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _LOADER_SHIM_IPC_BUF_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LOADER_SHIM_IPC_BUF_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x22, [x8]
Lloh3:
	adrp	x25, _IPC_FRAGMENT_DATA_PREAMBLE@GOTPAGE
Lloh4:
	ldr	x25, [x25, _IPC_FRAGMENT_DATA_PREAMBLE@GOTPAGEOFF]
	ldr	x23, [x25]
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_kzalloc
	cbz	x0, LBB0_6
; %bb.1:
	mov	x21, x0
Lloh8:
	adrp	x8, _LOADER_CMD_XFER_FRAGMENT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _LOADER_CMD_XFER_FRAGMENT@GOTPAGEOFF]
Lloh10:
	adrp	x9, _LOADER_XFER_MODE_ISHTP@GOTPAGE
Lloh11:
	ldr	x9, [x9, _LOADER_XFER_MODE_ISHTP@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	ldr	w9, [x9]
	stp	w9, w8, [x0, #24]
	ldr	x8, [x20]
	cmp	x8, #1
	b.lt	LBB0_5
; %bb.2:
	mov	x26, #0
	sub	x27, x22, x23
Lloh14:
	adrp	x22, l_.str@PAGE
Lloh15:
	add	x22, x22, l_.str@PAGEOFF
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	sub	x9, x8, x26
	add	x10, x26, x27
	cmp	x10, x8
	cset	w8, ge
	csel	x23, x27, x9, lt
	str	w8, [x21]
	stp	x23, x26, [x21, #8]
	ldr	w0, [x21, #32]
	ldr	x8, [x20, #8]
	add	x1, x8, x26, lsl #2
	mov	x2, x23
	bl	_memcpy
	mov	x0, x19
	bl	_cl_data_to_dev
	ldp	x3, x2, [x21, #8]
	ldr	w4, [x21]
	mov	x1, x22
	bl	_dev_dbg
	ldr	x8, [x25]
	add	x2, x8, x23
	add	x3, sp, #8
	mov	x0, x19
	mov	x1, x21
	mov	w4, #4
	bl	_loader_cl_send
	tbnz	w0, #31, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x20]
	add	x26, x23, x26
	cmp	x8, x26
	b.gt	LBB0_3
LBB0_5:
	mov	x0, x21
	bl	_kfree
	mov	w24, #0
	b	LBB0_8
LBB0_6:
	mov	w8, #1
	str	w8, [x19]
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_8
LBB0_7:
	mov	x24, x0
	mov	w8, #1
	str	w8, [x19]
	mov	x0, x21
	bl	_kfree
LBB0_8:
	mov	x0, x24
	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
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh12
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_LOADER_SHIM_IPC_BUF_SIZE,8,3   ; @LOADER_SHIM_IPC_BUF_SIZE
	.comm	_IPC_FRAGMENT_DATA_PREAMBLE,8,3 ; @IPC_FRAGMENT_DATA_PREAMBLE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_LOADER_CMD_XFER_FRAGMENT,4,2   ; @LOADER_CMD_XFER_FRAGMENT
	.comm	_LOADER_XFER_MODE_ISHTP,4,2     ; @LOADER_XFER_MODE_ISHTP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"xfer_mode=ipc offset=0x%08x size=0x%08x is_last=%d\n"

	.no_dead_strip	_ish_fw_xfer_ishtp
.subsections_via_symbols
