	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_resize_volume              ## -- Begin function ubi_resize_volume
	.p2align	4, 0x90
_ubi_resize_volume:                     ## @ubi_resize_volume
	.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), %r12
	movq	48(%r12), %r15
	cmpq	$0, 32(%r15)
	je	LBB0_4
## %bb.1:
	movq	_EROFS@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
LBB0_2:
	subl	(%rax), %r13d
LBB0_3:
	movl	%r13d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	%esi, %ebx
	movl	(%r12), %r14d
	movl	24(%r15), %esi
	movl	4(%r12), %ecx
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %edx
	movl	%ebx, %r8d
	callq	_dbg_gen
	movq	8(%r12), %rax
	movq	_UBI_STATIC_VOLUME@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.5:
	movl	16(%r12), %ecx
	cmpl	%ebx, %ecx
	jle	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rsi
	xorl	%r13d, %r13d
	movq	%r15, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_ubi_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_7:
	xorl	%r13d, %r13d
	cmpl	%ebx, 4(%r12)
	je	LBB0_3
## %bb.8:
	movl	%r14d, -68(%rbp)                ## 4-byte Spill
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_ubi_eba_create_table
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	%r14, %rdi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_10:
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	leaq	12(%r15), %r14
	movq	%r14, %rdi
	callq	_spin_lock
	movl	20(%r12), %ebx
	movq	%r14, %rdi
	callq	_spin_unlock
	cmpl	$2, %ebx
	jl	LBB0_12
## %bb.11:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_26
LBB0_12:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movl	%ecx, %r14d
	subl	4(%r12), %r14d
	jle	LBB0_17
## %bb.13:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_spin_lock
	movl	(%r15), %ecx
	movl	%ecx, %eax
	subl	%r14d, %eax
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%r14d, %edx
	jge	LBB0_22
## %bb.14:
	movq	%rsi, %r14
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_ubi_err
	movl	4(%r15), %edx
	testl	%edx, %edx
	je	LBB0_16
## %bb.15:
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_ubi_err
LBB0_16:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_26
LBB0_17:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	jns	LBB0_23
## %bb.18:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	negl	%eax
	cmpl	$2, %eax
	movl	$1, %ebx
	cmovgel	%eax, %ebx
	xorl	%r14d, %r14d
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	leal	(%rax,%r14), %edx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_ubi_eba_unmap_leb
	testl	%eax, %eax
	jne	LBB0_30
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=1
	incl	%r14d
	cmpl	%r14d, %ebx
	jne	LBB0_19
## %bb.21:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_lock
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addl	%eax, 8(%r15)
	subl	%eax, (%r15)
	movq	%r15, %rdi
	callq	_ubi_update_reserved
	movq	%r12, %rdi
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rsi
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movl	%ebx, %edx
	callq	_ubi_eba_copy_table
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_ubi_eba_replace_table
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
	movq	_UBI_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	-68(%rbp), %esi                 ## 4-byte Reload
	callq	_ubi_wl_flush
	movq	%rbx, %rcx
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_24
	jmp	LBB0_23
LBB0_22:
	movl	%eax, (%r15)
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	addl	%edx, 8(%r15)
	movl	4(%r12), %edx
	movq	%r12, %rdi
	movq	%rsi, %r14
	callq	_ubi_eba_copy_table
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_ubi_eba_replace_table
	movq	%rbx, %rdi
	callq	_spin_unlock
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
LBB0_23:
	movq	%rcx, %rbx
	movl	%ebx, %edi
	callq	_cpu_to_be32
	movl	%eax, -88(%rbp)
	leaq	-88(%rbp), %rdx
	movq	%r15, %rdi
	movl	-68(%rbp), %esi                 ## 4-byte Reload
	callq	_ubi_change_vtbl_record
	movq	%rbx, %rdx
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_27
LBB0_24:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	jle	LBB0_26
## %bb.25:
	movq	%r14, %r12
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	%ebx, %r13d
	movl	%eax, %ebx
	callq	_spin_lock
	subl	%ebx, 8(%r15)
	addl	%ebx, (%r15)
	movl	%r13d, %ebx
	movq	%r14, %rdi
	movq	%r12, %r14
	callq	_spin_unlock
LBB0_26:
	movq	%r14, %rdi
	callq	_kfree
	movl	%ebx, %r13d
	jmp	LBB0_3
LBB0_27:
	movl	%edx, 4(%r12)
	movq	8(%r12), %rax
	movq	_UBI_DYNAMIC_VOLUME@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_29
## %bb.28:
	movl	%edx, 16(%r12)
	movq	32(%r12), %rax
	movq	%rax, 24(%r12)
	movslq	%edx, %rcx
	imulq	%rax, %rcx
	movq	%rcx, 40(%r12)
LBB0_29:
	movq	_UBI_VOLUME_RESIZED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_ubi_volume_notify
	movq	%r15, %rdi
	callq	_self_check_volumes
	jmp	LBB0_3
LBB0_30:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	%eax, %ebx
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_EROFS,4,2                      ## @EROFS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"re-size device %d, volume %d to from %d to %d PEBs"

	.comm	_UBI_STATIC_VOLUME,8,3          ## @UBI_STATIC_VOLUME
L_.str.1:                               ## @.str.1
	.asciz	"too small size %d, %d LEBs contain data"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EBUSY,4,2                      ## @EBUSY
L_.str.2:                               ## @.str.2
	.asciz	"not enough PEBs: requested %d, available %d"

L_.str.3:                               ## @.str.3
	.asciz	"%d PEBs are corrupted and not used"

	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.comm	_UBI_ALL,4,2                    ## @UBI_ALL
	.comm	_UBI_DYNAMIC_VOLUME,8,3         ## @UBI_DYNAMIC_VOLUME
	.comm	_UBI_VOLUME_RESIZED,4,2         ## @UBI_VOLUME_RESIZED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_resize_volume              ; -- Begin function ubi_resize_volume
	.p2align	2
_ubi_resize_volume:                     ; @ubi_resize_volume
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x22, [x0]
	ldr	x19, [x22, #48]
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _EROFS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EROFS@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w26, w8
LBB0_3:
	mov	x0, x26
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_4:
	mov	x21, x1
	ldr	w1, [x19, #24]
	ldp	w24, w3, [x22]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x24
	mov	x4, x21
	bl	_dbg_gen
	ldr	x8, [x22, #8]
Lloh4:
	adrp	x9, _UBI_STATIC_VOLUME@GOTPAGE
Lloh5:
	ldr	x9, [x9, _UBI_STATIC_VOLUME@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.5:
	ldr	w8, [x22, #16]
	cmp	w8, w21
	b.le	LBB0_7
; %bb.6:
	str	x8, [sp]
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_ubi_err
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_2
LBB0_7:
	ldr	w8, [x22, #4]
	cmp	w8, w21
	b.ne	LBB0_9
LBB0_8:
	mov	w26, #0
	b	LBB0_3
LBB0_9:
	mov	x0, x22
	mov	x1, x21
	bl	_ubi_eba_create_table
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_11
; %bb.10:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_PTR_ERR
LBB0_11:
	add	x23, x19, #12
	mov	x0, x23
	bl	_spin_lock
	ldr	w25, [x22, #20]
	mov	x0, x23
	bl	_spin_unlock
	cmp	w25, #1
	b.le	LBB0_13
; %bb.12:
Lloh11:
	adrp	x8, _EBUSY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_18
LBB0_13:
	ldr	w8, [x22, #4]
	sub	w25, w21, w8
	cmp	w25, #1
	b.lt	LBB0_20
; %bb.14:
	mov	x0, x23
	bl	_spin_lock
	ldr	w8, [x19]
	subs	w9, w8, w25
	b.ge	LBB0_25
; %bb.15:
	str	x8, [sp]
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x2, x25
	bl	_ubi_err
	ldr	w2, [x19, #4]
	cbz	w2, LBB0_17
; %bb.16:
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_ubi_err
LBB0_17:
	mov	x0, x23
	bl	_spin_unlock
Lloh17:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
LBB0_18:
	ldr	w8, [x8]
	neg	w26, w8
LBB0_19:
	mov	x0, x20
	bl	_kfree
	b	LBB0_3
LBB0_20:
	tbz	w25, #31, LBB0_26
; %bb.21:
	mov	w27, #0
	neg	w8, w25
	cmp	w8, #1
	mov	w8, #1
	csneg	w28, w8, w25, le
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	add	w2, w21, w27
	mov	x0, x19
	mov	x1, x22
	bl	_ubi_eba_unmap_leb
	cbnz	w0, LBB0_32
; %bb.23:                               ;   in Loop: Header=BB0_22 Depth=1
	add	w27, w27, #1
	cmp	w28, w27
	b.ne	LBB0_22
; %bb.24:
	mov	x0, x23
	bl	_spin_lock
	ldr	w8, [x19, #8]
	add	w8, w8, w25
	str	w8, [x19, #8]
	ldr	w8, [x19]
	sub	w8, w8, w25
	str	w8, [x19]
	mov	x0, x19
	bl	_ubi_update_reserved
	mov	x0, x22
	mov	x1, x20
	mov	x2, x21
	bl	_ubi_eba_copy_table
	mov	x0, x22
	mov	x1, x20
	bl	_ubi_eba_replace_table
	mov	x0, x23
	bl	_spin_unlock
Lloh19:
	adrp	x8, _UBI_ALL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _UBI_ALL@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x24
	bl	_ubi_wl_flush
	mov	x26, x0
	cbnz	w0, LBB0_27
	b	LBB0_26
LBB0_25:
	str	w9, [x19]
	ldr	w8, [x19, #8]
	add	w8, w8, w25
	str	w8, [x19, #8]
	ldr	w2, [x22, #4]
	mov	x0, x22
	mov	x1, x20
	bl	_ubi_eba_copy_table
	mov	x0, x22
	mov	x1, x20
	bl	_ubi_eba_replace_table
	mov	x0, x23
	bl	_spin_unlock
LBB0_26:
	mov	x0, x21
	bl	_cpu_to_be32
	str	w0, [sp, #8]
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x24
	bl	_ubi_change_vtbl_record
	mov	x26, x0
	cbz	w0, LBB0_29
LBB0_27:
	cmp	w25, #1
	b.lt	LBB0_19
LBB0_28:
	mov	x0, x23
	bl	_spin_lock
	ldr	w8, [x19, #8]
	sub	w8, w8, w25
	str	w8, [x19, #8]
	ldr	w8, [x19]
	add	w8, w8, w25
	str	w8, [x19]
	mov	x0, x23
	bl	_spin_unlock
	b	LBB0_19
LBB0_29:
	str	w21, [x22, #4]
	ldr	x8, [x22, #8]
Lloh22:
	adrp	x9, _UBI_DYNAMIC_VOLUME@GOTPAGE
Lloh23:
	ldr	x9, [x9, _UBI_DYNAMIC_VOLUME@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_31
; %bb.30:
	str	w21, [x22, #16]
	ldr	x8, [x22, #32]
	str	x8, [x22, #24]
	sxtw	x9, w21
	mul	x8, x8, x9
	str	x8, [x22, #40]
LBB0_31:
Lloh25:
	adrp	x8, _UBI_VOLUME_RESIZED@GOTPAGE
Lloh26:
	ldr	x8, [x8, _UBI_VOLUME_RESIZED@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x22
	bl	_ubi_volume_notify
	mov	x0, x19
	bl	_self_check_volumes
	b	LBB0_8
LBB0_32:
	mov	x26, x0
	cmp	w25, #1
	b.ge	LBB0_28
	b	LBB0_19
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_EROFS,4,2                      ; @EROFS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"re-size device %d, volume %d to from %d to %d PEBs"

	.comm	_UBI_STATIC_VOLUME,8,3          ; @UBI_STATIC_VOLUME
l_.str.1:                               ; @.str.1
	.asciz	"too small size %d, %d LEBs contain data"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EBUSY,4,2                      ; @EBUSY
l_.str.2:                               ; @.str.2
	.asciz	"not enough PEBs: requested %d, available %d"

l_.str.3:                               ; @.str.3
	.asciz	"%d PEBs are corrupted and not used"

	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.comm	_UBI_ALL,4,2                    ; @UBI_ALL
	.comm	_UBI_DYNAMIC_VOLUME,8,3         ; @UBI_DYNAMIC_VOLUME
	.comm	_UBI_VOLUME_RESIZED,4,2         ; @UBI_VOLUME_RESIZED
.subsections_via_symbols
