	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fpga_mgr_write_init_sg
_fpga_mgr_write_init_sg:                ## @fpga_mgr_write_init_sg
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.1:
	movq	%rdx, %r15
	movl	(%rdx), %edx
	movl	4(%r15), %esi
	movq	_SG_MITER_FROM_SG@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-48(%rbp), %r12
	movq	%r12, %rdi
	callq	_sg_miter_start
	movq	%r12, %rdi
	callq	_sg_miter_next
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	-48(%rbp), %rcx
	movq	(%rbx), %rax
	cmpq	(%rax), %rcx
	jge	LBB0_3
LBB0_4:
	leaq	-48(%rbp), %rdi
	callq	_sg_miter_stop
	movq	(%rbx), %rax
	movq	(%rax), %rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r12
	movl	(%r15), %esi
	movl	4(%r15), %edi
	movq	(%rbx), %rax
	movq	(%rax), %rcx
	movq	%r12, %rdx
	callq	_sg_copy_to_buffer
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	movq	%rax, %rcx
	callq	_fpga_mgr_write_init_buf
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_kfree
	jmp	LBB0_7
LBB0_8:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_fpga_mgr_write_init_buf        ## TAILCALL
LBB0_3:
	movq	-40(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_fpga_mgr_write_init_buf
	movl	%eax, %ebx
	leaq	-48(%rbp), %rdi
	callq	_sg_miter_stop
	jmp	LBB0_7
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SG_MITER_FROM_SG,4,2           ## @SG_MITER_FROM_SG
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_fpga_mgr_write_init_sg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fpga_mgr_write_init_sg
_fpga_mgr_write_init_sg:                ; @fpga_mgr_write_init_sg
	.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, x1
	mov	x20, x0
	ldr	x8, [x0]
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.1:
	mov	x21, x2
	ldp	w2, w1, [x2]
Lloh0:
	adrp	x8, _SG_MITER_FROM_SG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SG_MITER_FROM_SG@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	x0, sp
	bl	_sg_miter_start
	mov	x0, sp
	bl	_sg_miter_next
	cbz	x0, LBB0_3
; %bb.2:
	ldr	x3, [sp]
	ldr	x8, [x20]
	ldr	x8, [x8]
	cmp	x3, x8
	b.ge	LBB0_6
LBB0_3:
	mov	x0, sp
	bl	_sg_miter_stop
	ldr	x8, [x20]
	ldr	x0, [x8]
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_kmalloc
	cbz	x0, LBB0_7
; %bb.4:
	mov	x22, x0
	ldp	w1, w0, [x21]
	ldr	x8, [x20]
	ldr	x3, [x8]
	mov	x2, x22
	bl	_sg_copy_to_buffer
	mov	x3, x0
	mov	x0, x20
	mov	x1, x19
	mov	x2, x22
	bl	_fpga_mgr_write_init_buf
	mov	x19, x0
	mov	x0, x22
	bl	_kfree
	b	LBB0_8
LBB0_5:
	mov	x0, x20
	mov	x1, x19
	mov	x2, #0
	mov	x3, #0
	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
	b	_fpga_mgr_write_init_buf
LBB0_6:
	ldr	x2, [sp, #8]
	mov	x0, x20
	mov	x1, x19
	bl	_fpga_mgr_write_init_buf
	mov	x19, x0
	mov	x0, sp
	bl	_sg_miter_stop
	b	LBB0_8
LBB0_7:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_8:
	mov	x0, x19
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_SG_MITER_FROM_SG,4,2           ; @SG_MITER_FROM_SG
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_fpga_mgr_write_init_sg
.subsections_via_symbols
