	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s10_ops_write_init
_s10_ops_write_init:                    ## @s10_ops_write_init
	.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	%rdi, %r14
	movq	(%rdi), %r12
	movq	24(%r12), %r15
	movl	$0, -48(%rbp)
	movq	_FPGA_MGR_PARTIAL_RECONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rsi)
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_dbg
	movq	_COMMAND_RECONFIG_FLAG_PARTIAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT
	movl	%eax, -48(%rbp)
	jmp	LBB0_3
LBB0_2:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_dbg
LBB0_3:
	leaq	20(%r12), %r13
	movq	%r13, %rdi
	callq	_reinit_completion
	movq	_COMMAND_RECONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%r12, %rdi
	movl	$4, %ecx
	callq	_s10_svc_send_msg
	testl	%eax, %eax
	js	LBB0_12
## %bb.4:
	movq	_S10_RECONFIG_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_wait_for_completion_interruptible_timeout
	testl	%eax, %eax
	je	LBB0_13
## %bb.5:
	js	LBB0_14
## %bb.6:
	movq	_SVC_STATUS_RECONFIG_REQUEST_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	16(%r12), %rsi
	callq	_test_and_clear_bit
	testl	%eax, %eax
	je	LBB0_15
## %bb.7:
	movq	_NUM_SVC_BUFS@GOTPCREL(%rip), %r15
	cmpq	$0, (%r15)
	je	LBB0_11
## %bb.8:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	$8, %ebx
	xorl	%r13d, %r13d
	movq	_SVC_BUF_SIZE@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edi
	movl	(%r14), %esi
	callq	_stratix10_svc_allocate_memory
	testq	%rax, %rax
	je	LBB0_16
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	8(%r12), %rcx
	movq	%rax, -8(%rcx,%rbx)
	movq	$0, (%rcx,%rbx)
	incq	%r13
	addq	$16, %rbx
	cmpq	(%r15), %r13
	jb	LBB0_9
LBB0_11:
	xorl	%ebx, %ebx
	jmp	LBB0_19
LBB0_12:
	movl	%eax, %ebx
	jmp	LBB0_19
LBB0_13:
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_14:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_19
LBB0_15:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_16:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_s10_free_buffers
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_17:
	xorl	%ebx, %ebx
LBB0_18:
	subl	(%rax), %ebx
LBB0_19:
	movl	(%r12), %edi
	callq	_stratix10_svc_done
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FPGA_MGR_PARTIAL_RECONFIG,4,2  ## @FPGA_MGR_PARTIAL_RECONFIG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Requesting partial reconfiguration.\n"

	.comm	_COMMAND_RECONFIG_FLAG_PARTIAL,4,2 ## @COMMAND_RECONFIG_FLAG_PARTIAL
L_.str.1:                               ## @.str.1
	.asciz	"Requesting full reconfiguration.\n"

	.comm	_COMMAND_RECONFIG,4,2           ## @COMMAND_RECONFIG
	.comm	_S10_RECONFIG_TIMEOUT,4,2       ## @S10_RECONFIG_TIMEOUT
L_.str.2:                               ## @.str.2
	.asciz	"timeout waiting for RECONFIG_REQUEST\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
L_.str.3:                               ## @.str.3
	.asciz	"error (%d) waiting for RECONFIG_REQUEST\n"

	.comm	_SVC_STATUS_RECONFIG_REQUEST_OK,4,2 ## @SVC_STATUS_RECONFIG_REQUEST_OK
	.comm	_NUM_SVC_BUFS,8,3               ## @NUM_SVC_BUFS
	.comm	_SVC_BUF_SIZE,4,2               ## @SVC_BUF_SIZE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_s10_ops_write_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s10_ops_write_init
_s10_ops_write_init:                    ; @s10_ops_write_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x0
	ldr	x19, [x0]
	ldr	x21, [x19, #24]
	str	wzr, [sp, #8]
	ldr	w8, [x1]
Lloh0:
	adrp	x9, _FPGA_MGR_PARTIAL_RECONFIG@GOTPAGE
Lloh1:
	ldr	x9, [x9, _FPGA_MGR_PARTIAL_RECONFIG@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_dbg
Lloh5:
	adrp	x8, _COMMAND_RECONFIG_FLAG_PARTIAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _COMMAND_RECONFIG_FLAG_PARTIAL@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_BIT
	str	w0, [sp, #8]
	b	LBB0_3
LBB0_2:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_dbg
LBB0_3:
	add	x23, x19, #20
	mov	x0, x23
	bl	_reinit_completion
Lloh10:
	adrp	x8, _COMMAND_RECONFIG@GOTPAGE
Lloh11:
	ldr	x8, [x8, _COMMAND_RECONFIG@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	mov	w3, #4
	bl	_s10_svc_send_msg
	tbnz	w0, #31, LBB0_12
; %bb.4:
Lloh13:
	adrp	x8, _S10_RECONFIG_TIMEOUT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _S10_RECONFIG_TIMEOUT@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_wait_for_completion_interruptible_timeout
	cbz	w0, LBB0_13
; %bb.5:
	mov	x22, x0
	tbnz	w0, #31, LBB0_16
; %bb.6:
Lloh16:
	adrp	x8, _SVC_STATUS_RECONFIG_REQUEST_OK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SVC_STATUS_RECONFIG_REQUEST_OK@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	add	x1, x19, #16
	bl	_test_and_clear_bit
	cbz	w0, LBB0_14
; %bb.7:
Lloh19:
	adrp	x21, _NUM_SVC_BUFS@GOTPAGE
Lloh20:
	ldr	x21, [x21, _NUM_SVC_BUFS@GOTPAGEOFF]
	ldr	x8, [x21]
	cbz	x8, LBB0_11
; %bb.8:
	mov	x22, #0
	mov	x23, #0
Lloh21:
	adrp	x24, _SVC_BUF_SIZE@GOTPAGE
Lloh22:
	ldr	x24, [x24, _SVC_BUF_SIZE@GOTPAGEOFF]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19]
	ldr	w1, [x24]
	bl	_stratix10_svc_allocate_memory
	cbz	x0, LBB0_18
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x19, #8]
	add	x8, x8, x22
	stp	x0, xzr, [x8]
	add	x23, x23, #1
	ldr	x8, [x21]
	add	x22, x22, #16
	cmp	x23, x8
	b.lo	LBB0_9
LBB0_11:
	mov	w22, #0
	b	LBB0_17
LBB0_12:
	mov	x22, x0
	b	LBB0_17
LBB0_13:
Lloh23:
	adrp	x1, l_.str.2@PAGE
Lloh24:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_dev_err
LBB0_14:
Lloh25:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_17
LBB0_16:
	str	x22, [sp]
Lloh27:
	adrp	x1, l_.str.3@PAGE
Lloh28:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_dev_err
LBB0_17:
	ldr	w0, [x19]
	bl	_stratix10_svc_done
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_18:
	mov	x0, x20
	bl	_s10_free_buffers
Lloh29:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_FPGA_MGR_PARTIAL_RECONFIG,4,2  ; @FPGA_MGR_PARTIAL_RECONFIG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Requesting partial reconfiguration.\n"

	.comm	_COMMAND_RECONFIG_FLAG_PARTIAL,4,2 ; @COMMAND_RECONFIG_FLAG_PARTIAL
l_.str.1:                               ; @.str.1
	.asciz	"Requesting full reconfiguration.\n"

	.comm	_COMMAND_RECONFIG,4,2           ; @COMMAND_RECONFIG
	.comm	_S10_RECONFIG_TIMEOUT,4,2       ; @S10_RECONFIG_TIMEOUT
l_.str.2:                               ; @.str.2
	.asciz	"timeout waiting for RECONFIG_REQUEST\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
l_.str.3:                               ; @.str.3
	.asciz	"error (%d) waiting for RECONFIG_REQUEST\n"

	.comm	_SVC_STATUS_RECONFIG_REQUEST_OK,4,2 ; @SVC_STATUS_RECONFIG_REQUEST_OK
	.comm	_NUM_SVC_BUFS,8,3               ; @NUM_SVC_BUFS
	.comm	_SVC_BUF_SIZE,4,2               ; @SVC_BUF_SIZE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_s10_ops_write_init
.subsections_via_symbols
