	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wl1251_boot_upload_nvs
_wl1251_boot_upload_nvs:                ## @wl1251_boot_upload_nvs
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r12
	testq	%r12, %r12
	je	LBB0_1
## %bb.2:
	movq	8(%rdi), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movl	16(%rdi), %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	(%r12), %r14
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, %rbx
	testq	%r14, %r14
	je	LBB0_7
## %bb.3:
	movq	_DEBUG_BOOT@GOTPCREL(%rip), %rdx
	leaq	L_.str(%rip), %r12
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	movl	8(%rbx), %eax
	movl	$254, %ecx
	andl	%ecx, %eax
	movl	16(%rbx), %r13d
	shll	$8, %r13d
	orl	%eax, %r13d
	addq	$24, %rbx
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%rbx), %rax
	movq	16(%rbx), %rcx
	shlq	$8, %rax
	orq	(%rbx), %rax
	shlq	$16, %rcx
	movq	24(%rbx), %r15
	shlq	$24, %r15
	orq	%rcx, %r15
	orq	%rax, %r15
	movl	(%rdx), %edi
	movq	%r12, %rsi
	movl	%r13d, %edx
	movq	%r15, %rcx
	callq	_wl1251_debug
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	movq	%r15, %rdx
	callq	_wl1251_mem_write32
	movq	_DEBUG_BOOT@GOTPCREL(%rip), %rdx
	addq	$32, %rbx
	addl	$4, %r13d
	decq	%r14
	jne	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	(%rbx), %r14
	testq	%r14, %r14
	jne	LBB0_5
LBB0_7:
	addq	$56, %rbx
	movq	%rbx, %rax
	subq	-56(%rbp), %rax                 ## 8-byte Folded Reload
	sarq	$3, %rax
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	subq	%rax, %rdi
	movl	$4, %esi
	callq	_ALIGN
	movq	%rax, %r13
	movq	_WL1251_PART_DOWN_MEM_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_WL1251_PART_DOWN_REG_START@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_WL1251_PART_DOWN_REG_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_wl1251_set_partition
	testq	%r13, %r13
	je	LBB0_10
## %bb.8:
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	leal	(%rax,%r15), %r12d
	movq	8(%rbx,%r15,8), %rax
	movq	16(%rbx,%r15,8), %rcx
	shlq	$8, %rax
	orq	(%rbx,%r15,8), %rax
	shlq	$16, %rcx
	movq	24(%rbx,%r15,8), %r14
	shlq	$24, %r14
	orq	%rcx, %r14
	orq	%rax, %r14
	movq	_DEBUG_BOOT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r12d, %edx
	movq	%r14, %rcx
	callq	_wl1251_debug
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %esi
	movq	%r14, %rdx
	callq	_wl1251_mem_write32
	addq	$4, %r15
	cmpq	%r13, %r15
	jb	LBB0_9
LBB0_10:
	xorl	%eax, %eax
	jmp	LBB0_11
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_DEBUG_BOOT,4,2                 ## @DEBUG_BOOT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"nvs burst write 0x%x: 0x%x"

	.comm	_WL1251_PART_DOWN_MEM_SIZE,4,2  ## @WL1251_PART_DOWN_MEM_SIZE
	.comm	_WL1251_PART_DOWN_REG_START,4,2 ## @WL1251_PART_DOWN_REG_START
	.comm	_WL1251_PART_DOWN_REG_SIZE,4,2  ## @WL1251_PART_DOWN_REG_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"nvs write table 0x%x: 0x%x"

	.no_dead_strip	_wl1251_boot_upload_nvs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wl1251_boot_upload_nvs
_wl1251_boot_upload_nvs:                ; @wl1251_boot_upload_nvs
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	ldr	x24, [x0]
	cbz	x24, LBB0_6
; %bb.1:
	mov	x19, x0
	ldr	x25, [x0, #8]
	ldr	w20, [x0, #16]
	ldr	x27, [x24]
	cbz	x27, LBB0_7
; %bb.2:
Lloh0:
	adrp	x28, _DEBUG_BOOT@GOTPAGE
Lloh1:
	ldr	x28, [x28, _DEBUG_BOOT@GOTPAGEOFF]
Lloh2:
	adrp	x21, l_.str@PAGE
Lloh3:
	add	x21, x21, l_.str@PAGEOFF
	mov	x26, x24
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
	ldr	w8, [x26, #8]
	and	w22, w8, #0xfe
	ldr	w8, [x26, #16]
	bfi	w22, w8, #8, #24
	add	x26, x26, #24
LBB0_4:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	x8, x9, [x26]
	orr	x8, x8, x9, lsl #8
	ldp	x9, x10, [x26, #16]
	orr	x8, x8, x9, lsl #16
	orr	x23, x8, x10, lsl #24
	ldr	w0, [x28]
	mov	x1, x21
	mov	x2, x22
	mov	x3, x23
	bl	_wl1251_debug
	mov	x0, x19
	mov	x1, x22
	mov	x2, x23
	bl	_wl1251_mem_write32
	add	x26, x26, #32
	add	w22, w22, #4
	subs	x27, x27, #1
	b.ne	LBB0_4
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x27, [x26]
	cbnz	x27, LBB0_3
	b	LBB0_8
LBB0_6:
Lloh4:
	adrp	x8, _ENODEV@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_7:
	mov	x26, x24
LBB0_8:
	add	x26, x26, #56
	sub	x8, x26, x24
	sub	x0, x25, x8, asr #3
	mov	w1, #4
	bl	_ALIGN
	mov	x21, x0
Lloh7:
	adrp	x8, _WL1251_PART_DOWN_MEM_SIZE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _WL1251_PART_DOWN_MEM_SIZE@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
Lloh10:
	adrp	x8, _WL1251_PART_DOWN_REG_START@GOTPAGE
Lloh11:
	ldr	x8, [x8, _WL1251_PART_DOWN_REG_START@GOTPAGEOFF]
Lloh12:
	ldr	w3, [x8]
Lloh13:
	adrp	x8, _WL1251_PART_DOWN_REG_SIZE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _WL1251_PART_DOWN_REG_SIZE@GOTPAGEOFF]
Lloh15:
	ldr	w4, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_wl1251_set_partition
	cbz	x21, LBB0_11
; %bb.9:
	mov	x25, #0
Lloh16:
	adrp	x27, _DEBUG_BOOT@GOTPAGE
Lloh17:
	ldr	x27, [x27, _DEBUG_BOOT@GOTPAGEOFF]
Lloh18:
	adrp	x22, l_.str.1@PAGE
Lloh19:
	add	x22, x22, l_.str.1@PAGEOFF
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	add	x8, x26, x25, lsl #3
	add	w23, w20, w25
	ldp	x9, x10, [x8]
	orr	x9, x9, x10, lsl #8
	ldp	x10, x8, [x8, #16]
	orr	x9, x9, x10, lsl #16
	orr	x24, x9, x8, lsl #24
	ldr	w0, [x27]
	mov	x1, x22
	mov	x2, x23
	mov	x3, x24
	bl	_wl1251_debug
	mov	x0, x19
	mov	x1, x23
	mov	x2, x24
	bl	_wl1251_mem_write32
	add	x25, x25, #4
	cmp	x25, x21
	b.lo	LBB0_10
LBB0_11:
	mov	w0, #0
LBB0_12:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_DEBUG_BOOT,4,2                 ; @DEBUG_BOOT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"nvs burst write 0x%x: 0x%x"

	.comm	_WL1251_PART_DOWN_MEM_SIZE,4,2  ; @WL1251_PART_DOWN_MEM_SIZE
	.comm	_WL1251_PART_DOWN_REG_START,4,2 ; @WL1251_PART_DOWN_REG_START
	.comm	_WL1251_PART_DOWN_REG_SIZE,4,2  ; @WL1251_PART_DOWN_REG_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"nvs write table 0x%x: 0x%x"

	.no_dead_strip	_wl1251_boot_upload_nvs
.subsections_via_symbols
