	.file	"extr_boot.c_wlcore_boot_upload_nvs.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"NVS file is needed during boot"
	.align 8
.LC1:
	.string	"nvs size is not as expected: %zu != %zu"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"nvs burst write 0x%x: 0x%x"
.LC3:
	.string	"nvs data is malformed"
	.text
	.p2align 4
	.globl	wlcore_boot_upload_nvs
	.type	wlcore_boot_upload_nvs, @function
wlcore_boot_upload_nvs:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	r12, QWORD PTR [rdi]
	test	r12, r12
	je	.L25
	mov	esi, DWORD PTR 12[rdi]
	mov	eax, DWORD PTR 8[rdi]
	mov	rbp, rdi
	test	DWORD PTR WLCORE_QUIRK_LEGACY_NVS[rip], eax
	jne	.L26
	cmp	esi, 16
	jne	.L8
.L5:
	cmp	QWORD PTR 8[r12], 0
	je	.L9
	mov	DWORD PTR 16[rbp], 1
.L9:
	mov	rax, QWORD PTR 40[rbp]
	mov	r14, QWORD PTR [r12]
	lea	r13, .LC2[rip]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR [rax]
	mov	QWORD PTR 88[r14], rdx
	mov	rdx, QWORD PTR 8[rax]
	mov	QWORD PTR 80[r14], rdx
	mov	rdx, QWORD PTR 16[rax]
	mov	QWORD PTR 48[r14], rdx
	mov	rdx, QWORD PTR 24[rax]
	mov	QWORD PTR 40[r14], rdx
	mov	rdx, QWORD PTR 32[rax]
	mov	QWORD PTR 32[r14], rdx
	mov	rax, QWORD PTR 40[rax]
	mov	QWORD PTR 24[r14], rax
.L10:
	mov	rax, QWORD PTR [r14]
	mov	QWORD PTR 8[rsp], rax
	test	rax, rax
	je	.L27
	mov	r15, QWORD PTR 8[r14]
	mov	rax, QWORD PTR 16[r14]
	xor	ebx, ebx
	add	r14, 24
	and	r15d, 254
	sal	rax, 8
	or	r15, rax
	add	r15, QWORD PTR 32[rbp]
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L29:
	mov	r12, QWORD PTR 8[r14]
	mov	rax, QWORD PTR 16[r14]
	mov	rdx, r15
	mov	rsi, r13
	mov	edi, DWORD PTR DEBUG_BOOT[rip]
	sal	rax, 16
	sal	r12, 8
	or	r12, rax
	mov	rax, QWORD PTR 24[r14]
	or	r12, QWORD PTR [r14]
	sal	rax, 24
	or	r12, rax
	mov	rcx, r12
	call	wl1271_debug@PLT
	mov	rdx, r12
	mov	rsi, r15
	mov	rdi, rbp
	call	wlcore_write32@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L1
	mov	r12, QWORD PTR 0[rbp]
	add	r14, 32
	add	r15, 4
	add	rbx, 1
	cmp	QWORD PTR 8[rsp], rbx
	je	.L28
.L12:
	add	r12, 64
	lea	rax, 24[r14]
	cmp	r12, rax
	ja	.L29
.L11:
	lea	rdi, .LC3[rip]
	xor	eax, eax
	call	wl1271_error@PLT
	mov	r12d, DWORD PTR EILSEQ[rip]
	neg	r12d
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore_state
	cmp	esi, 16
	je	.L5
	cmp	DWORD PTR WL1271_INI_LEGACY_NVS_FILE_SIZE[rip], esi
	je	.L6
.L8:
	mov	edx, 16
	lea	rdi, .LC1[rip]
	xor	eax, eax
	call	wl1271_error@PLT
	mov	rdi, QWORD PTR 0[rbp]
	call	kfree@PLT
	mov	r12d, DWORD PTR EILSEQ[rip]
	mov	QWORD PTR 0[rbp], 0
	mov	DWORD PTR 12[rbp], 0
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L28:
	lea	rax, 64[r12]
	cmp	r14, rax
	jb	.L10
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L6:
	cmp	QWORD PTR 8[r12], 0
	je	.L30
	mov	DWORD PTR 16[rdi], 1
	jmp	.L8
.L30:
	mov	eax, DWORD PTR 16[rdi]
	test	eax, eax
	je	.L9
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L25:
	lea	rdi, .LC0[rip]
	xor	eax, eax
	call	wl1271_error@PLT
	mov	r12d, DWORD PTR ENODEV[rip]
	neg	r12d
	jmp	.L1
.L27:
	mov	rdi, r14
	mov	esi, 4
	sub	rdi, r12
	sar	rdi, 3
	add	edi, 7
	call	ALIGN@PLT
	mov	rbx, QWORD PTR 0[rbp]
	cdqe
	lea	r13, [r12+rax*8]
	lea	rax, 64[rbx]
	cmp	r13, rax
	jnb	.L11
	mov	rax, QWORD PTR 24[rbp]
	mov	rdx, QWORD PTR PART_WORK[rip]
	mov	rdi, rbp
	lea	rsi, [rax+rdx*4]
	call	wlcore_set_partition@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L1
	mov	rax, r13
	mov	r12d, 8
	mov	edx, DWORD PTR GFP_KERNEL[rip]
	mov	rdi, r13
	sub	rax, rbx
	sar	rax, 3
	sub	r12, rax
	mov	rsi, r12
	call	kmemdup@PLT
	mov	r13, rax
	test	rax, rax
	je	.L31
	mov	esi, DWORD PTR REG_CMD_MBOX_ADDRESS[rip]
	mov	rcx, r12
	mov	rdi, rbp
	xor	r8d, r8d
	mov	rdx, rax
	call	wlcore_write_data@PLT
	mov	rdi, r13
	mov	r12d, eax
	call	kfree@PLT
	jmp	.L1
.L31:
	mov	r12d, DWORD PTR ENOMEM[rip]
	neg	r12d
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	wlcore_boot_upload_nvs, .-wlcore_boot_upload_nvs
	.comm	WLCORE_QUIRK_LEGACY_NVS,4,4
	.comm	WL1271_INI_LEGACY_NVS_FILE_SIZE,4,4
	.comm	REG_CMD_MBOX_ADDRESS,4,4
	.comm	PART_WORK,8,8
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	ENODEV,4,4
	.comm	EILSEQ,4,4
	.comm	DEBUG_BOOT,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_boot.c_wlcore_boot_upload_nvs.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"NVS file is needed during boot\000"
	.align	2
.LC1:
	.ascii	"nvs size is not as expected: %zu != %zu\000"
	.align	2
.LC2:
	.ascii	"nvs burst write 0x%x: 0x%x\000"
	.align	2
.LC3:
	.ascii	"nvs data is malformed\000"
	.text
	.align	2
	.global	wlcore_boot_upload_nvs
	.syntax unified
	.arm
	.fpu softvfp
	.type	wlcore_boot_upload_nvs, %function
wlcore_boot_upload_nvs:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r4, [r0]
	sub	sp, sp, #12
	cmp	r4, #0
	beq	.L28
	ldr	r2, .L35
	ldr	r3, [r0, #4]
	ldr	r5, [r2]
	mov	r7, r0
	ands	r5, r3, r5
	ldr	r1, [r0, #8]
	bne	.L29
	cmp	r1, #8
	bne	.L8
.L5:
	ldr	r3, [r4, #4]
	cmp	r3, #0
	movne	r3, #1
	strne	r3, [r7, #12]
.L9:
	ldr	r3, [r7, #24]
	ldr	fp, [r4]
	ldr	r3, [r3]
	ldr	r10, .L35+4
	ldr	r2, [r3]
	ldr	r9, .L35+8
	str	r2, [fp, #44]
	ldr	r2, [r3, #4]
	str	r2, [fp, #40]
	ldr	r2, [r3, #8]
	str	r2, [fp, #24]
	ldr	r2, [r3, #12]
	str	r2, [fp, #20]
	ldr	r2, [r3, #16]
	str	r2, [fp, #16]
	ldr	r3, [r3, #20]
	str	r3, [fp, #12]
.L10:
	ldr	r8, [fp]
	cmp	r8, #0
	beq	.L30
	ldr	r5, [fp, #4]
	ldr	r3, [fp, #8]
	and	r5, r5, #254
	orr	r5, r5, r3, lsl #8
	ldr	r3, [r7, #20]
	mov	r6, #0
	add	ip, fp, #28
	add	r5, r5, r3
	b	.L12
.L32:
	ldr	r4, [ip, #-8]
	ldr	r3, [ip, #-12]
	ldr	r2, [ip, #-16]
	lsl	r4, r4, #16
	orr	r4, r4, r3, lsl #8
	ldr	r3, [ip, #-4]
	orr	r4, r4, r2
	orr	r4, r4, r3, lsl #24
	mov	r3, r4
	mov	r2, r5
	mov	r1, r9
	ldr	r0, [r10]
	mov	fp, ip
	bl	wl1271_debug
	mov	r2, r4
	mov	r1, r5
	mov	r0, r7
	bl	wlcore_write32
	subs	r4, r0, #0
	blt	.L1
	cmp	r8, r6
	ldr	r4, [r7]
	add	r5, r5, #4
	add	ip, fp, #16
	beq	.L31
.L12:
	add	r4, r4, #16
	sub	r3, ip, #4
	cmp	r4, r3
	add	r6, r6, #1
	bhi	.L32
.L11:
	ldr	r0, .L35+12
	bl	wl1271_error
	ldr	r3, .L35+16
	ldr	r0, [r3]
	rsb	r4, r0, #0
.L1:
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L29:
	cmp	r1, #8
	beq	.L5
	ldr	r3, .L35+20
	ldr	r3, [r3]
	cmp	r3, r1
	beq	.L6
.L19:
	mov	r2, #8
	ldr	r0, .L35+24
	bl	wl1271_error
	ldr	r0, [r7]
	bl	kfree
	ldr	r2, .L35+16
	mov	r3, #0
	ldr	r0, [r2]
	str	r3, [r7]
	rsb	r4, r0, #0
	mov	r0, r4
	str	r3, [r7, #8]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L31:
	add	r3, r4, #16
	cmp	fp, r3
	bcc	.L10
	b	.L11
.L6:
	ldr	r3, [r4, #4]
	cmp	r3, #0
	beq	.L33
	mov	r3, #1
	str	r3, [r0, #12]
	b	.L19
.L8:
	mov	r2, #8
	ldr	r0, .L35+24
	bl	wl1271_error
	ldr	r0, [r7]
	bl	kfree
	ldr	r3, .L35+16
	str	r5, [r7]
	ldr	r0, [r3]
	str	r5, [r7, #8]
	rsb	r4, r0, #0
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L33:
	ldr	r3, [r0, #12]
	cmp	r3, #0
	beq	.L9
	b	.L19
.L28:
	ldr	r0, .L35+28
	bl	wl1271_error
	ldr	r3, .L35+32
	ldr	r0, [r3]
	rsb	r4, r0, #0
	b	.L1
.L30:
	sub	r0, fp, r4
	asr	r0, r0, #2
	mov	r1, #4
	add	r0, r0, #7
	bl	ALIGN
	ldr	r5, [r7]
	add	r6, r4, r0, lsl #2
	add	r3, r5, #16
	cmp	r6, r3
	bcs	.L11
	ldr	r2, .L35+36
	ldr	r3, [r7, #16]
	ldr	r1, [r2]
	mov	r0, r7
	add	r1, r3, r1, lsl #2
	bl	wlcore_set_partition
	subs	r4, r0, #0
	blt	.L1
	sub	r4, r6, r5
	ldr	r3, .L35+40
	asr	r4, r4, #2
	rsb	r4, r4, #4
	mov	r0, r6
	mov	r1, r4
	ldr	r2, [r3]
	bl	kmemdup
	subs	r5, r0, #0
	beq	.L34
	ldr	r2, .L35+44
	str	r8, [sp]
	mov	r3, r4
	ldr	r1, [r2]
	mov	r0, r7
	mov	r2, r5
	bl	wlcore_write_data
	mov	r4, r0
	mov	r0, r5
	bl	kfree
	b	.L1
.L34:
	ldr	r3, .L35+48
	ldr	r0, [r3]
	rsb	r4, r0, #0
	b	.L1
.L36:
	.align	2
.L35:
	.word	WLCORE_QUIRK_LEGACY_NVS
	.word	DEBUG_BOOT
	.word	.LC2
	.word	.LC3
	.word	EILSEQ
	.word	WL1271_INI_LEGACY_NVS_FILE_SIZE
	.word	.LC1
	.word	.LC0
	.word	ENODEV
	.word	PART_WORK
	.word	GFP_KERNEL
	.word	REG_CMD_MBOX_ADDRESS
	.word	ENOMEM
	.size	wlcore_boot_upload_nvs, .-wlcore_boot_upload_nvs
	.comm	WLCORE_QUIRK_LEGACY_NVS,4,4
	.comm	WL1271_INI_LEGACY_NVS_FILE_SIZE,4,4
	.comm	REG_CMD_MBOX_ADDRESS,4,4
	.comm	PART_WORK,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	ENODEV,4,4
	.comm	EILSEQ,4,4
	.comm	DEBUG_BOOT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
