	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_update_fastmap             ## -- Begin function ubi_update_fastmap
	.p2align	4, 0x90
_ubi_update_fastmap:                    ## @ubi_update_fastmap
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	leaq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_down_write
	leaq	12(%r13), %r15
	movq	%r15, %rdi
	callq	_down_write
	leaq	16(%r13), %r12
	movq	%r12, %rdi
	callq	_down_write
	movq	%r13, %rdi
	callq	_ubi_refill_pools
	cmpq	$0, 40(%r13)
	jne	LBB0_2
## %bb.1:
	cmpq	$0, 32(%r13)
	je	LBB0_4
LBB0_2:
	movq	%r12, %rdi
	callq	_up_write
	movq	%r15, %rdi
	callq	_up_write
	movq	%r14, %rdi
	callq	_up_write
	xorl	%ebx, %ebx
LBB0_3:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	%r13, %rdi
	callq	_ubi_ensure_anchor_pebs
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_up_write
	movq	%r15, %rdi
	callq	_up_write
	movq	%r14, %rdi
	callq	_up_write
	jmp	LBB0_3
LBB0_6:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.7:
	movq	%rax, %rsi
	movl	(%r13), %eax
	cltd
	idivl	4(%r13)
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, (%rsi)
	movq	24(%r13), %rbx
	movq	$0, 24(%r13)
	movq	_UBI_FM_MAX_BLOCKS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	jle	LBB0_11
## %bb.8:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_ubi_err
LBB0_9:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	xorl	%edx, %edx
	subl	(%rax), %edx
	jmp	LBB0_44
LBB0_10:
	movq	%r12, %rdi
	callq	_up_write
	movq	%r15, %rdi
	callq	_up_write
	movq	%r14, %rdi
	callq	_up_write
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_3
LBB0_11:
	cmpl	$2, %eax
	jl	LBB0_28
## %bb.12:
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	leaq	20(%r13), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	jmp	LBB0_16
LBB0_13:                                ##   in Loop: Header=BB0_16 Depth=1
	movq	8(%rbx), %rax
	movq	8(%rax,%r14,8), %rax
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	8(%rdx), %rcx
	movq	%rax, 8(%rcx,%r14,8)
LBB0_14:                                ##   in Loop: Header=BB0_16 Depth=1
	movq	8(%rbx), %rax
	movq	$0, 8(%rax,%r14,8)
LBB0_15:                                ##   in Loop: Header=BB0_16 Depth=1
	movslq	(%rdx), %rax
	leaq	1(%r14), %rcx
	addq	$2, %r14
	cmpq	%rax, %r14
	movq	%rcx, %r14
	jge	LBB0_27
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	callq	_spin_lock
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_ubi_wl_get_fm_peb
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_spin_unlock
	testq	%rbx, %rbx
	je	LBB0_20
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	8(%rdx), %rax
	movq	%rbx, 8(%rax,%r14,8)
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	testq	%rbx, %rbx
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	je	LBB0_15
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	8(%rbx), %rax
	movq	8(%rax,%r14,8), %rsi
	testq	%rsi, %rsi
	je	LBB0_15
## %bb.19:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	16(%rbx), %rax
	movl	4(%rax,%r14,4), %ecx
	leal	1(%r14), %edx
	movq	%r13, %rdi
	callq	_ubi_wl_put_fm_peb
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	jmp	LBB0_14
LBB0_20:                                ##   in Loop: Header=BB0_16 Depth=1
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	testq	%rbx, %rbx
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	je	LBB0_37
## %bb.21:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	8(%rbx), %rax
	movq	8(%rax,%r14,8), %rax
	testq	%rax, %rax
	je	LBB0_37
## %bb.22:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	4(%rax), %esi
	movq	%r13, %rdi
	callq	_erase_block
	testl	%eax, %eax
	jns	LBB0_13
## %bb.23:
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	callq	_ubi_err
	leal	1(%r14), %eax
	testl	$-2, %eax
	je	LBB0_26
## %bb.24:
	xorl	%ebx, %ebx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
LBB0_25:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%rcx), %rax
	movq	8(%rax,%rbx,8), %rsi
	leaq	1(%rbx), %rdx
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%ecx, %ecx
	callq	_ubi_wl_put_fm_peb
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	8(%rcx), %rax
	movq	$0, 8(%rax,%rbx,8)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, %rbx
	cmpq	%rax, %r14
	jne	LBB0_25
LBB0_26:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	jmp	LBB0_44
LBB0_27:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
LBB0_28:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	testq	%rbx, %rbx
	movq	%rbx, %r15
	je	LBB0_32
## %bb.29:
	cmpl	(%r15), %eax
	jge	LBB0_32
## %bb.30:
	movslq	%eax, %rbx
LBB0_31:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movq	16(%r15), %rcx
	movq	(%rax,%rbx,8), %rsi
	movl	(%rcx,%rbx,4), %ecx
	movq	%r13, %rdi
	movl	%ebx, %edx
	callq	_ubi_wl_put_fm_peb
	movq	8(%r15), %rax
	movq	$0, (%rax,%rbx,8)
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_31
LBB0_32:
	leaq	20(%r13), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_ubi_wl_get_fm_peb
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_spin_unlock
	testq	%r15, %r15
	je	LBB0_35
## %bb.33:
	leaq	8(%r15), %rbx
	movq	8(%r15), %rax
	movq	(%rax), %rsi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	testq	%rdx, %rdx
	je	LBB0_41
## %bb.34:
	movq	16(%r15), %rax
	movl	(%rax), %ecx
	movq	%r13, %rdi
	movq	%rdx, %r15
	xorl	%edx, %edx
	callq	_ubi_wl_put_fm_peb
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	8(%rsi), %rax
	movq	%r15, (%rax)
	xorl	%ecx, %ecx
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_43
LBB0_35:
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_50
## %bb.36:
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	%rsi, %rbx
	addq	$8, %rbx
	jmp	LBB0_43
LBB0_37:
	leaq	L_.str.2(%rip), %rsi
	movq	%r13, %rdi
	callq	_ubi_err
	leal	1(%r14), %eax
	testl	$-2, %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	je	LBB0_40
## %bb.38:
	movl	$1, %ebx
LBB0_39:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%rcx), %rax
	movq	(%rax,%rbx,8), %rsi
	movq	%r13, %rdi
	movl	%ebx, %edx
	xorl	%ecx, %ecx
	callq	_ubi_wl_put_fm_peb
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	8(%rcx), %rax
	movq	$0, (%rax,%rbx,8)
	incq	%rbx
	decq	%r14
	jne	LBB0_39
LBB0_40:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	xorl	%edx, %edx
	subl	(%rax), %edx
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_44
LBB0_41:
	movl	4(%rsi), %esi
	movq	%r13, %rdi
	callq	_erase_block
	testl	%eax, %eax
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	js	LBB0_53
## %bb.42:
	movq	(%rbx), %rcx
	movq	(%rcx), %rdx
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	8(%rsi), %rcx
	movq	%rdx, (%rcx)
	movq	8(%rsi), %rcx
	movq	(%rcx), %rcx
	movl	%eax, (%rcx)
	xorl	%ecx, %ecx
LBB0_43:
	movq	(%rbx), %rax
	movq	%rcx, (%rax)
	movq	%r13, %rdi
	callq	_ubi_write_fastmap
	movl	%eax, %edx
	testl	%eax, %eax
	je	LBB0_49
LBB0_44:
	leaq	L_.str.5(%rip), %rsi
	movq	%r13, %rdi
	callq	_ubi_warn
	movq	%r13, %rdi
	callq	_invalidate_fastmap
	testl	%eax, %eax
	js	LBB0_46
## %bb.45:
	movq	%r13, %rdi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	callq	_return_fm_pebs
	movq	%r13, %rdi
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rsi
	callq	_return_fm_pebs
	xorl	%ebx, %ebx
	jmp	LBB0_47
LBB0_46:
	movl	%eax, %ebx
	leaq	L_.str.6(%rip), %rsi
	movq	%r13, %rdi
	callq	_ubi_err
	movq	%r13, %rdi
	callq	_ubi_ro_mode
	movq	-48(%rbp), %r13                 ## 8-byte Reload
LBB0_47:
	movq	%r13, %rdi
	callq	_kfree
LBB0_48:
	movq	%r12, %rdi
	callq	_up_write
	movq	%r15, %rdi
	callq	_up_write
	movq	%r14, %rdi
	callq	_up_write
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfree
	jmp	LBB0_3
LBB0_49:
	xorl	%ebx, %ebx
	jmp	LBB0_48
LBB0_50:
	leaq	L_.str.4(%rip), %rsi
	movq	%r13, %rdi
	callq	_ubi_err
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpl	$2, (%rcx)
	jl	LBB0_9
## %bb.51:
	movl	$1, %ebx
LBB0_52:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%rcx), %rax
	movq	(%rax,%rbx,8), %rsi
	movq	%r13, %rdi
	movl	%ebx, %edx
	xorl	%ecx, %ecx
	callq	_ubi_wl_put_fm_peb
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	8(%rcx), %rax
	movq	$0, (%rax,%rbx,8)
	incq	%rbx
	movslq	(%rcx), %rax
	cmpq	%rax, %rbx
	jl	LBB0_52
	jmp	LBB0_9
LBB0_53:
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	leaq	L_.str.3(%rip), %rsi
	movq	%r13, %rdi
	callq	_ubi_err
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpl	$2, (%rcx)
	jl	LBB0_57
## %bb.54:
	movl	$1, %ebx
LBB0_55:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%rcx), %rax
	movq	(%rax,%rbx,8), %rsi
	movq	%r13, %rdi
	movl	%ebx, %edx
	xorl	%ecx, %ecx
	callq	_ubi_wl_put_fm_peb
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	8(%rcx), %rax
	movq	$0, (%rax,%rbx,8)
	incq	%rbx
	movslq	(%rcx), %rax
	cmpq	%rax, %rbx
	jl	LBB0_55
LBB0_57:
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	jmp	LBB0_44
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_UBI_FM_MAX_BLOCKS,4,2          ## @UBI_FM_MAX_BLOCKS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fastmap too large"

	.comm	_ENOSPC,4,2                     ## @ENOSPC
L_.str.1:                               ## @.str.1
	.asciz	"could not erase old fastmap PEB"

L_.str.2:                               ## @.str.2
	.asciz	"could not get any free erase block"

L_.str.3:                               ## @.str.3
	.asciz	"could not erase old anchor PEB"

L_.str.4:                               ## @.str.4
	.asciz	"could not find any anchor PEB"

L_.str.5:                               ## @.str.5
	.asciz	"Unable to write new fastmap, err=%i"

L_.str.6:                               ## @.str.6
	.asciz	"Unable to invalidate current fastmap!"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_update_fastmap             ; -- Begin function ubi_update_fastmap
	.p2align	2
_ubi_update_fastmap:                    ; @ubi_update_fastmap
	.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
	mov	x22, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_down_write
	add	x20, x22, #12
	mov	x0, x20
	bl	_down_write
	add	x21, x22, #16
	mov	x0, x21
	bl	_down_write
	mov	x0, x22
	bl	_ubi_refill_pools
	ldr	x8, [x22, #40]
	cbnz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x22, #32]
	cbz	x8, LBB0_4
LBB0_2:
	mov	x0, x21
	bl	_up_write
	mov	x0, x20
	bl	_up_write
	mov	x0, x19
	bl	_up_write
	mov	w25, #0
LBB0_3:
	mov	x0, x25
	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
LBB0_4:
	mov	x0, x22
	bl	_ubi_ensure_anchor_pebs
	cbz	w0, LBB0_6
; %bb.5:
	mov	x25, x0
	mov	x0, x21
	bl	_up_write
	mov	x0, x20
	bl	_up_write
	mov	x0, x19
	bl	_up_write
	b	LBB0_3
LBB0_6:
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kzalloc
	cbz	x0, LBB0_10
; %bb.7:
	mov	x24, x0
	ldp	w8, w9, [x22]
	sdiv	w8, w8, w9
	str	w8, [x0]
	ldr	x23, [x22, #24]
	str	xzr, [x22, #24]
Lloh3:
	adrp	x9, _UBI_FM_MAX_BLOCKS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _UBI_FM_MAX_BLOCKS@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.le	LBB0_11
; %bb.8:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_ubi_err
LBB0_9:
Lloh8:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_41
LBB0_10:
	mov	x0, x21
	bl	_up_write
	mov	x0, x20
	bl	_up_write
	mov	x0, x19
	bl	_up_write
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_3
LBB0_11:
	cmp	w8, #2
	b.lt	LBB0_26
; %bb.12:
	mov	x27, #0
	add	x26, x22, #20
	b	LBB0_16
LBB0_13:                                ;   in Loop: Header=BB0_16 Depth=1
	ldr	x8, [x23, #8]
	lsl	x9, x27, #3
	add	x8, x8, x9
	ldr	x8, [x8, #8]
	ldr	x10, [x24, #8]
	add	x9, x10, x9
	str	x8, [x9, #8]
LBB0_14:                                ;   in Loop: Header=BB0_16 Depth=1
	ldr	x8, [x23, #8]
	add	x8, x8, x27, lsl #3
	str	xzr, [x8, #8]
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	ldrsw	x8, [x24]
	add	x9, x27, #2
	add	x27, x27, #1
	cmp	x9, x8
	b.ge	LBB0_26
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x26
	bl	_spin_lock
	mov	x0, x22
	mov	w1, #0
	bl	_ubi_wl_get_fm_peb
	mov	x25, x0
	mov	x0, x26
	bl	_spin_unlock
	cbz	x25, LBB0_20
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	x8, [x24, #8]
	add	x8, x8, x27, lsl #3
	str	x25, [x8, #8]
	cbz	x23, LBB0_15
; %bb.18:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	x8, [x23, #8]
	add	x8, x8, x27, lsl #3
	ldr	x1, [x8, #8]
	cbz	x1, LBB0_15
; %bb.19:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	x8, [x23, #16]
	add	x8, x8, x27, lsl #2
	ldr	w3, [x8, #4]
	add	w2, w27, #1
	mov	x0, x22
	bl	_ubi_wl_put_fm_peb
	b	LBB0_14
LBB0_20:                                ;   in Loop: Header=BB0_16 Depth=1
	cbz	x23, LBB0_35
; %bb.21:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	x8, [x23, #8]
	add	x8, x8, x27, lsl #3
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_35
; %bb.22:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	w1, [x8, #4]
	mov	x0, x22
	bl	_erase_block
	tbz	w0, #31, LBB0_13
; %bb.23:
	mov	x25, x0
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_ubi_err
	add	w8, w27, #1
	tst	x8, #0xfffffffe
	b.eq	LBB0_41
; %bb.24:
	mov	x26, #0
LBB0_25:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24, #8]
	lsl	x28, x26, #3
	add	x8, x8, x28
	ldr	x1, [x8, #8]
	add	x26, x26, #1
	mov	x0, x22
	mov	x2, x26
	mov	w3, #0
	bl	_ubi_wl_put_fm_peb
	ldr	x8, [x24, #8]
	add	x8, x8, x28
	str	xzr, [x8, #8]
	cmp	x27, x26
	b.ne	LBB0_25
	b	LBB0_41
LBB0_26:
	cbz	x23, LBB0_30
; %bb.27:
	ldr	w9, [x23]
	cmp	w8, w9
	b.ge	LBB0_30
; %bb.28:
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
	sxtw	x25, w8
LBB0_29:                                ; =>This Inner Loop Header: Depth=1
	lsl	x26, x25, #3
	ldp	x8, x9, [x23, #8]
	ldr	x1, [x8, x26]
	ldr	w3, [x9, x25, lsl #2]
	mov	x0, x22
	mov	x2, x25
	bl	_ubi_wl_put_fm_peb
	ldr	x8, [x23, #8]
	str	xzr, [x8, x26]
	add	x25, x25, #1
	ldrsw	x8, [x23]
	cmp	x25, x8
	b.lt	LBB0_29
LBB0_30:
	add	x25, x22, #20
	mov	x0, x25
	bl	_spin_lock
	mov	x0, x22
	mov	w1, #1
	bl	_ubi_wl_get_fm_peb
	mov	x26, x0
	mov	x0, x25
	bl	_spin_unlock
	cbz	x23, LBB0_33
; %bb.31:
	mov	x27, x23
	ldr	x8, [x27, #8]!
	ldr	x1, [x8]
	cbz	x26, LBB0_38
; %bb.32:
	ldr	x8, [x23, #16]
	ldr	w3, [x8]
	mov	x0, x22
	mov	w2, #0
	bl	_ubi_wl_put_fm_peb
	ldr	x8, [x24, #8]
	str	x26, [x8]
	mov	x26, #0
	b	LBB0_40
LBB0_33:
	cbz	x26, LBB0_46
; %bb.34:
	add	x27, x24, #8
	b	LBB0_40
LBB0_35:
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x22
	bl	_ubi_err
	add	w8, w27, #1
	tst	x8, #0xfffffffe
	b.eq	LBB0_9
; %bb.36:
	mov	w25, #1
LBB0_37:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24, #8]
	lsl	x26, x25, #3
	ldr	x1, [x8, x26]
	mov	x0, x22
	mov	x2, x25
	mov	w3, #0
	bl	_ubi_wl_put_fm_peb
	ldr	x8, [x24, #8]
	str	xzr, [x8, x26]
	add	x25, x25, #1
	subs	x27, x27, #1
	b.ne	LBB0_37
	b	LBB0_9
LBB0_38:
	ldr	w1, [x1, #4]
	mov	x0, x22
	bl	_erase_block
	mov	x25, x0
	tbnz	w0, #31, LBB0_49
; %bb.39:
	mov	x26, #0
	ldr	x8, [x27]
	ldr	x8, [x8]
	ldr	x9, [x24, #8]
	str	x8, [x9]
	ldr	x8, [x24, #8]
	ldr	x8, [x8]
	str	w25, [x8]
LBB0_40:
	ldr	x8, [x27]
	str	x26, [x8]
	mov	x0, x22
	mov	x1, x24
	bl	_ubi_write_fastmap
	mov	x25, x0
	cbz	w0, LBB0_45
LBB0_41:
Lloh18:
	adrp	x1, l_.str.5@PAGE
Lloh19:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x22
	mov	x2, x25
	bl	_ubi_warn
	mov	x0, x22
	bl	_invalidate_fastmap
	tbnz	w0, #31, LBB0_43
; %bb.42:
	mov	x0, x22
	mov	x1, x23
	bl	_return_fm_pebs
	mov	x0, x22
	mov	x1, x24
	bl	_return_fm_pebs
	mov	w25, #0
	b	LBB0_44
LBB0_43:
	mov	x25, x0
Lloh20:
	adrp	x1, l_.str.6@PAGE
Lloh21:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x22
	bl	_ubi_err
	mov	x0, x22
	bl	_ubi_ro_mode
LBB0_44:
	mov	x0, x24
	bl	_kfree
LBB0_45:
	mov	x0, x21
	bl	_up_write
	mov	x0, x20
	bl	_up_write
	mov	x0, x19
	bl	_up_write
	mov	x0, x23
	bl	_kfree
	b	LBB0_3
LBB0_46:
Lloh22:
	adrp	x1, l_.str.4@PAGE
Lloh23:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x22
	bl	_ubi_err
	ldr	w8, [x24]
	cmp	w8, #2
	b.lt	LBB0_9
; %bb.47:
	mov	w25, #1
LBB0_48:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24, #8]
	lsl	x26, x25, #3
	ldr	x1, [x8, x26]
	mov	x0, x22
	mov	x2, x25
	mov	w3, #0
	bl	_ubi_wl_put_fm_peb
	ldr	x8, [x24, #8]
	str	xzr, [x8, x26]
	add	x25, x25, #1
	ldrsw	x8, [x24]
	cmp	x25, x8
	b.lt	LBB0_48
	b	LBB0_9
LBB0_49:
Lloh24:
	adrp	x1, l_.str.3@PAGE
Lloh25:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x22
	bl	_ubi_err
	ldr	w8, [x24]
	cmp	w8, #2
	b.lt	LBB0_41
; %bb.50:
	mov	w26, #1
LBB0_51:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24, #8]
	lsl	x27, x26, #3
	ldr	x1, [x8, x27]
	mov	x0, x22
	mov	x2, x26
	mov	w3, #0
	bl	_ubi_wl_put_fm_peb
	ldr	x8, [x24, #8]
	str	xzr, [x8, x27]
	add	x26, x26, #1
	ldrsw	x8, [x24]
	cmp	x26, x8
	b.lt	LBB0_51
	b	LBB0_41
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_UBI_FM_MAX_BLOCKS,4,2          ; @UBI_FM_MAX_BLOCKS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fastmap too large"

	.comm	_ENOSPC,4,2                     ; @ENOSPC
l_.str.1:                               ; @.str.1
	.asciz	"could not erase old fastmap PEB"

l_.str.2:                               ; @.str.2
	.asciz	"could not get any free erase block"

l_.str.3:                               ; @.str.3
	.asciz	"could not erase old anchor PEB"

l_.str.4:                               ; @.str.4
	.asciz	"could not find any anchor PEB"

l_.str.5:                               ; @.str.5
	.asciz	"Unable to write new fastmap, err=%i"

l_.str.6:                               ; @.str.6
	.asciz	"Unable to invalidate current fastmap!"

.subsections_via_symbols
