	.file	"extr_stratix10-soc.c_s10_ops_write_init.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Requesting partial reconfiguration.\n"
	.align 8
.LC1:
	.string	"Requesting full reconfiguration.\n"
	.align 8
.LC2:
	.string	"timeout waiting for RECONFIG_REQUEST\n"
	.align 8
.LC3:
	.string	"error (%d) waiting for RECONFIG_REQUEST\n"
	.text
	.p2align 4
	.type	s10_ops_write_init, @function
s10_ops_write_init:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	rbx, QWORD PTR [rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	DWORD PTR 4[rsp], 0
	mov	eax, DWORD PTR [rsi]
	mov	r13, QWORD PTR 24[rbx]
	test	DWORD PTR FPGA_MGR_PARTIAL_RECONFIG[rip], eax
	je	.L2
	lea	rsi, .LC0[rip]
	mov	rdi, r13
	call	dev_dbg@PLT
	mov	edi, DWORD PTR COMMAND_RECONFIG_FLAG_PARTIAL[rip]
	call	BIT@PLT
	or	DWORD PTR 4[rsp], eax
.L3:
	lea	r14, 20[rbx]
	mov	rdi, r14
	call	reinit_completion@PLT
	mov	esi, DWORD PTR COMMAND_RECONFIG[rip]
	lea	rdx, 4[rsp]
	mov	rdi, rbx
	mov	ecx, 4
	call	s10_svc_send_msg@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L4
	mov	esi, DWORD PTR S10_RECONFIG_TIMEOUT[rip]
	mov	rdi, r14
	call	wait_for_completion_interruptible_timeout@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L17
	js	.L18
	mov	edi, DWORD PTR SVC_STATUS_RECONFIG_REQUEST_OK[rip]
	lea	rsi, 16[rbx]
	call	test_and_clear_bit@PLT
	test	eax, eax
	je	.L7
	xor	r12d, r12d
	cmp	QWORD PTR NUM_SVC_BUFS[rip], 0
	jne	.L8
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rdx, r12
	add	r12, 1
	sal	rdx, 4
	add	rdx, QWORD PTR 8[rbx]
	cmp	QWORD PTR NUM_SVC_BUFS[rip], r12
	mov	QWORD PTR [rdx], rax
	mov	QWORD PTR 8[rdx], 0
	jbe	.L10
.L8:
	mov	esi, DWORD PTR SVC_BUF_SIZE[rip]
	mov	edi, DWORD PTR [rbx]
	call	stratix10_svc_allocate_memory@PLT
	test	rax, rax
	jne	.L9
	mov	rdi, rbp
	call	s10_free_buffers@PLT
	mov	r12d, DWORD PTR ENOMEM[rip]
	neg	r12d
	.p2align 4,,10
	.p2align 3
.L4:
	mov	edi, DWORD PTR [rbx]
	call	stratix10_svc_done@PLT
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L19
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	lea	rsi, .LC1[rip]
	mov	rdi, r13
	call	dev_dbg@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L17:
	lea	rsi, .LC2[rip]
	mov	rdi, r13
	xor	eax, eax
	call	dev_err@PLT
	mov	r12d, DWORD PTR ETIMEDOUT[rip]
	neg	r12d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L18:
	mov	edx, eax
	lea	rsi, .LC3[rip]
	mov	rdi, r13
	xor	eax, eax
	call	dev_err@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L7:
	mov	r12d, DWORD PTR ETIMEDOUT[rip]
	neg	r12d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L10:
	xor	r12d, r12d
	jmp	.L4
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	s10_ops_write_init, .-s10_ops_write_init
	.comm	SVC_STATUS_RECONFIG_REQUEST_OK,4,4
	.comm	SVC_BUF_SIZE,4,4
	.comm	S10_RECONFIG_TIMEOUT,4,4
	.comm	NUM_SVC_BUFS,8,8
	.comm	FPGA_MGR_PARTIAL_RECONFIG,4,4
	.comm	ETIMEDOUT,4,4
	.comm	ENOMEM,4,4
	.comm	COMMAND_RECONFIG_FLAG_PARTIAL,4,4
	.comm	COMMAND_RECONFIG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_stratix10-soc.c_s10_ops_write_init.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Requesting partial reconfiguration.\012\000"
	.align	2
.LC1:
	.ascii	"Requesting full reconfiguration.\012\000"
	.align	2
.LC2:
	.ascii	"timeout waiting for RECONFIG_REQUEST\012\000"
	.align	2
.LC3:
	.ascii	"error (%d) waiting for RECONFIG_REQUEST\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	s10_ops_write_init, %function
s10_ops_write_init:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r3, #0
	push	{r4, r5, r6, r7, r8, r9, lr}
	ldr	r2, .L19
	ldr	r1, [r1]
	ldr	r2, [r2]
	ldr	r5, [r0]
	tst	r1, r2
	ldr	r2, .L19+4
	sub	sp, sp, #12
	ldr	r2, [r2]
	str	r2, [sp, #4]
	mov	r2,#0
	mov	r6, r0
	ldr	r8, [r5, #16]
	str	r3, [sp]
	beq	.L2
	ldr	r1, .L19+8
	mov	r0, r8
	bl	dev_dbg
	ldr	r3, .L19+12
	ldr	r0, [r3]
	bl	BIT
	ldr	r3, [sp]
	orr	r3, r3, r0
	str	r3, [sp]
.L3:
	add	r7, r5, #12
	mov	r0, r7
	bl	reinit_completion
	ldr	r2, .L19+16
	mov	r3, #4
	ldr	r1, [r2]
	mov	r0, r5
	mov	r2, sp
	bl	s10_svc_send_msg
	subs	r4, r0, #0
	blt	.L4
	ldr	r3, .L19+20
	mov	r0, r7
	ldr	r1, [r3]
	bl	wait_for_completion_interruptible_timeout
	subs	r4, r0, #0
	beq	.L16
	blt	.L17
	ldr	r3, .L19+24
	add	r1, r5, #8
	ldr	r0, [r3]
	bl	test_and_clear_bit
	cmp	r0, #0
	beq	.L7
	ldr	r7, .L19+28
	ldr	r3, [r7]
	cmp	r3, #0
	beq	.L10
	mov	r4, #0
	ldr	r8, .L19+32
	mov	r9, r4
	b	.L8
.L9:
	ldr	r3, [r5, #4]
	ldr	r2, [r7]
	str	r0, [r3, r4, lsl #3]
	add	r3, r3, r4, lsl #3
	add	r4, r4, #1
	cmp	r2, r4
	str	r9, [r3, #4]
	bls	.L10
.L8:
	ldr	r1, [r8]
	ldr	r0, [r5]
	bl	stratix10_svc_allocate_memory
	cmp	r0, #0
	bne	.L9
	mov	r0, r6
	bl	s10_free_buffers
	ldr	r3, .L19+36
	ldr	r4, [r3]
	rsb	r4, r4, #0
.L4:
	ldr	r0, [r5]
	bl	stratix10_svc_done
	ldr	r3, .L19+4
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L18
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L2:
	mov	r0, r8
	ldr	r1, .L19+40
	bl	dev_dbg
	b	.L3
.L16:
	mov	r0, r8
	ldr	r1, .L19+44
	bl	dev_err
	ldr	r3, .L19+48
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L4
.L17:
	mov	r0, r8
	mov	r2, r4
	ldr	r1, .L19+52
	bl	dev_err
	b	.L4
.L7:
	ldr	r3, .L19+48
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L4
.L10:
	mov	r4, #0
	b	.L4
.L18:
	bl	__stack_chk_fail
.L20:
	.align	2
.L19:
	.word	FPGA_MGR_PARTIAL_RECONFIG
	.word	.LC4
	.word	.LC0
	.word	COMMAND_RECONFIG_FLAG_PARTIAL
	.word	COMMAND_RECONFIG
	.word	S10_RECONFIG_TIMEOUT
	.word	SVC_STATUS_RECONFIG_REQUEST_OK
	.word	NUM_SVC_BUFS
	.word	SVC_BUF_SIZE
	.word	ENOMEM
	.word	.LC1
	.word	.LC2
	.word	ETIMEDOUT
	.word	.LC3
	.size	s10_ops_write_init, .-s10_ops_write_init
	.comm	SVC_STATUS_RECONFIG_REQUEST_OK,4,4
	.comm	SVC_BUF_SIZE,4,4
	.comm	S10_RECONFIG_TIMEOUT,4,4
	.comm	NUM_SVC_BUFS,4,4
	.comm	FPGA_MGR_PARTIAL_RECONFIG,4,4
	.comm	ETIMEDOUT,4,4
	.comm	ENOMEM,4,4
	.comm	COMMAND_RECONFIG_FLAG_PARTIAL,4,4
	.comm	COMMAND_RECONFIG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
