	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_attach_mtd_dev             ## -- Begin function ubi_attach_mtd_dev
	.p2align	4, 0x90
_ubi_attach_mtd_dev:                    ## @ubi_attach_mtd_dev
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	_UBI_MAX_DEVICES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	testl	%esi, %esi
	jle	LBB0_6
## %bb.1:
	movq	_ubi_devices@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	xorl	%edx, %edx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%rdx
	cmpq	%rdx, %rsi
	je	LBB0_6
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rdx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r15), %rax
	movq	144(%rdi), %rdi
	cmpq	(%rdi), %rax
	jne	LBB0_2
## %bb.5:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%eax, %esi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_dbg_err
	movq	_EEXIST@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_6:
	movq	8(%r15), %rax
	movq	_MTD_UBIVOLUME@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.7:
	movq	(%r15), %rsi
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_ubi_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_8:
	movq	_UBI_DEV_NUM_AUTO@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_13
## %bb.9:
	testl	%esi, %esi
	jle	LBB0_17
## %bb.10:
	movq	_ubi_devices@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rax,%rbx,8)
	je	LBB0_18
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	incq	%rbx
	cmpq	%rbx, %rsi
	jne	LBB0_11
	jmp	LBB0_19
LBB0_13:
	cmpl	%ebx, %esi
	jle	LBB0_16
## %bb.14:
	movq	_ubi_devices@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%ebx, %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_20
## %bb.15:
	leaq	L_.str.3(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_dbg_err
	movq	_EEXIST@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	movl	%r14d, %ebx
	jmp	LBB0_26
LBB0_16:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_24
LBB0_17:
	xorl	%ebx, %ebx
LBB0_18:
	cmpl	%esi, %ebx
	jne	LBB0_20
LBB0_19:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_dbg_err
	movq	_ENFILE@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_20:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$152, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_23
## %bb.21:
	movq	%rax, %r14
	movq	%r15, 144(%rax)
	movl	%ebx, (%rax)
	movl	%r12d, 4(%rax)
	movl	$-1, 8(%rax)
	leaq	136(%rax), %rdi
	callq	_mutex_init
	leaq	132(%r14), %rdi
	callq	_mutex_init
	leaq	128(%r14), %rdi
	callq	_mutex_init
	leaq	124(%r14), %rdi
	callq	_spin_lock_init
	movl	(%r15), %esi
	leaq	L_.str.4(%rip), %rdi
	xorl	%r13d, %r13d
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_ubi_msg
	movq	%r14, %rdi
	callq	_io_init
	movl	%eax, %r12d
	testl	%eax, %eax
	je	LBB0_27
LBB0_22:
	movq	72(%r14), %rdi
	callq	_vfree
	movq	64(%r14), %rdi
	callq	_vfree
	movq	%r14, %rdi
	callq	_kfree
	movl	%r12d, %ebx
	jmp	LBB0_26
LBB0_23:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_24:
	xorl	%ebx, %ebx
LBB0_25:
	subl	(%rax), %ebx
LBB0_26:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_27:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	movl	116(%r14), %edi
	callq	_vmalloc
	movq	%rax, 72(%r14)
	testq	%rax, %rax
	je	LBB0_31
## %bb.28:
	movl	116(%r14), %edi
	callq	_vmalloc
	movq	%rax, 64(%r14)
	movl	%r13d, %r12d
	testq	%rax, %rax
	je	LBB0_22
## %bb.29:
	movq	%r14, %rdi
	callq	_attach_by_scanning
	testl	%eax, %eax
	je	LBB0_32
## %bb.30:
	movl	%eax, %r12d
	leaq	L_.str.5(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_dbg_err
	jmp	LBB0_22
LBB0_31:
	movl	%r13d, %r12d
	jmp	LBB0_22
LBB0_32:
	movl	8(%r14), %esi
	cmpl	$-1, %esi
	je	LBB0_35
## %bb.33:
	movq	%r14, %rdi
	callq	_autoresize
	testl	%eax, %eax
	je	LBB0_35
## %bb.34:
	movl	%eax, %r12d
	movq	%r14, %rdi
	callq	_ubi_wl_close
	movq	%r14, %rdi
	callq	_free_user_volumes
	jmp	LBB0_39
LBB0_35:
	movq	%r14, %rdi
	callq	_uif_init
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_38
## %bb.36:
	movq	_ubi_thread@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	112(%r14), %edx
	movq	%r14, %rsi
	callq	_kthread_create
	movl	%eax, 100(%r14)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_40
## %bb.37:
	movl	100(%r14), %edi
	callq	_PTR_ERR
	movl	%eax, %r12d
	movslq	112(%r14), %rsi
	leaq	L_.str.6(%rip), %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_ubi_err
	movq	%r14, %rdi
	callq	_uif_close
LBB0_38:
	movq	%r14, %rdi
	callq	_ubi_wl_close
LBB0_39:
	movq	%r14, %rdi
	callq	_free_internal_volumes
	movq	80(%r14), %rdi
	callq	_vfree
	jmp	LBB0_22
LBB0_40:
	movl	(%r15), %esi
	leaq	L_.str.7(%rip), %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_ubi_msg
	movl	16(%r15), %esi
	leaq	L_.str.8(%rip), %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movl	12(%r14), %esi
	sarl	$20, %esi
	leaq	L_.str.9(%rip), %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movl	16(%r14), %esi
	leaq	L_.str.10(%rip), %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movl	20(%r14), %esi
	leaq	L_.str.11(%rip), %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movl	24(%r14), %esi
	leaq	L_.str.12(%rip), %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movq	_CONFIG_MTD_UBI_WL_THRESHOLD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.13(%rip), %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movq	_UBI_INT_VOL_COUNT@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	L_.str.14(%rip), %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movl	28(%r14), %esi
	subl	(%r15), %esi
	leaq	L_.str.15(%rip), %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movl	32(%r14), %esi
	leaq	L_.str.16(%rip), %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movl	36(%r14), %esi
	leaq	L_.str.17(%rip), %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movl	40(%r14), %esi
	leaq	L_.str.18(%rip), %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movl	104(%r14), %edx
	movl	108(%r14), %esi
	leaq	L_.str.19(%rip), %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movl	44(%r14), %esi
	leaq	L_.str.20(%rip), %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	leaq	96(%r14), %r15
	movq	%r15, %rdi
	callq	_spin_lock
	movq	_DBG_DISABLE_BGT@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_42
## %bb.41:
	movl	$1, 48(%r14)
LBB0_42:
	movl	100(%r14), %edi
	callq	_wake_up_process
	movq	%r15, %rdi
	callq	_spin_unlock
	movq	%r14, %rdi
	addq	$88, %rdi
	movl	$1, 88(%r14)
	movq	_ubi_reboot_notifier@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 92(%r14)
	callq	_register_reboot_notifier
	movq	_ubi_devices@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%ebx, %rcx
	movq	%r14, (%rax,%rcx,8)
	movq	_UBI_VOLUME_ADDED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_ubi_notify_all
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	_UBI_MAX_DEVICES,4,2            ## @UBI_MAX_DEVICES
	.comm	_ubi_devices,8,3                ## @ubi_devices
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mtd%d is already attached to ubi%d"

	.comm	_EEXIST,4,2                     ## @EEXIST
	.comm	_MTD_UBIVOLUME,8,3              ## @MTD_UBIVOLUME
L_.str.1:                               ## @.str.1
	.asciz	"refuse attaching mtd%d - it is already emulated on top of UBI"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_UBI_DEV_NUM_AUTO,4,2           ## @UBI_DEV_NUM_AUTO
L_.str.2:                               ## @.str.2
	.asciz	"only %d UBI devices may be created"

	.comm	_ENFILE,4,2                     ## @ENFILE
L_.str.3:                               ## @.str.3
	.asciz	"ubi%d already exists"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.4:                               ## @.str.4
	.asciz	"attaching mtd%d to ubi%d"

L_.str.5:                               ## @.str.5
	.asciz	"failed to attach by scanning, error %d"

	.comm	_ubi_thread,4,2                 ## @ubi_thread
L_.str.6:                               ## @.str.6
	.asciz	"cannot spawn \"%s\", error %d"

L_.str.7:                               ## @.str.7
	.asciz	"attached mtd%d to ubi%d"

L_.str.8:                               ## @.str.8
	.asciz	"MTD device name:            \"%s\""

L_.str.9:                               ## @.str.9
	.asciz	"MTD device size:            %llu MiB"

L_.str.10:                              ## @.str.10
	.asciz	"number of good PEBs:        %d"

L_.str.11:                              ## @.str.11
	.asciz	"number of bad PEBs:         %d"

L_.str.12:                              ## @.str.12
	.asciz	"max. allowed volumes:       %d"

L_.str.13:                              ## @.str.13
	.asciz	"wear-leveling threshold:    %d"

	.comm	_CONFIG_MTD_UBI_WL_THRESHOLD,4,2 ## @CONFIG_MTD_UBI_WL_THRESHOLD
L_.str.14:                              ## @.str.14
	.asciz	"number of internal volumes: %d"

	.comm	_UBI_INT_VOL_COUNT,4,2          ## @UBI_INT_VOL_COUNT
L_.str.15:                              ## @.str.15
	.asciz	"number of user volumes:     %d"

L_.str.16:                              ## @.str.16
	.asciz	"available PEBs:             %d"

L_.str.17:                              ## @.str.17
	.asciz	"total number of reserved PEBs: %d"

L_.str.18:                              ## @.str.18
	.asciz	"number of PEBs reserved for bad PEB handling: %d"

L_.str.19:                              ## @.str.19
	.asciz	"max/mean erase counter: %d/%d"

L_.str.20:                              ## @.str.20
	.asciz	"image sequence number: %d"

	.comm	_DBG_DISABLE_BGT,4,2            ## @DBG_DISABLE_BGT
	.comm	_ubi_reboot_notifier,4,2        ## @ubi_reboot_notifier
	.comm	_UBI_VOLUME_ADDED,4,2           ## @UBI_VOLUME_ADDED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_attach_mtd_dev             ; -- Begin function ubi_attach_mtd_dev
	.p2align	2
_ubi_attach_mtd_dev:                    ; @ubi_attach_mtd_dev
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x22, x2
	mov	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _UBI_MAX_DEVICES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _UBI_MAX_DEVICES@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	cmp	w1, #1
	b.lt	LBB0_7
; %bb.1:
	mov	x9, #0
Lloh3:
	adrp	x8, _ubi_devices@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ubi_devices@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x8]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x9, x9, #1
	cmp	x1, x9
	b.eq	LBB0_7
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x10, x9, lsl #3]
	cbz	x11, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x21]
	ldr	x11, [x11, #144]
	ldr	x11, [x11]
	cmp	x8, x11
	b.ne	LBB0_2
; %bb.5:
	str	x9, [sp]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x8
LBB0_6:
	bl	_dbg_err
Lloh8:
	adrp	x8, _EEXIST@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
	b	LBB0_25
LBB0_7:
	ldr	x8, [x21, #8]
Lloh10:
	adrp	x9, _MTD_UBIVOLUME@GOTPAGE
Lloh11:
	ldr	x9, [x9, _MTD_UBIVOLUME@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.8:
	ldr	x1, [x21]
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ubi_err
LBB0_9:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_25
LBB0_10:
Lloh17:
	adrp	x8, _UBI_DEV_NUM_AUTO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _UBI_DEV_NUM_AUTO@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_15
; %bb.11:
	cmp	w1, #1
	b.lt	LBB0_18
; %bb.12:
	mov	x19, #0
Lloh20:
	adrp	x8, _ubi_devices@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ubi_devices@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x8, x19, lsl #3]
	cbz	x9, LBB0_20
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	add	x19, x19, #1
	cmp	x1, x19
	b.ne	LBB0_13
	b	LBB0_19
LBB0_15:
	cmp	w1, w19
	b.le	LBB0_9
; %bb.16:
Lloh23:
	adrp	x8, _ubi_devices@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ubi_devices@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	ldr	x8, [x8, w19, sxtw #3]
	cbz	x8, LBB0_21
; %bb.17:
Lloh26:
	adrp	x0, l_.str.3@PAGE
Lloh27:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x19
	b	LBB0_6
LBB0_18:
	mov	w19, #0
	cmp	w19, w1
	b.ne	LBB0_21
LBB0_19:
Lloh28:
	adrp	x0, l_.str.2@PAGE
Lloh29:
	add	x0, x0, l_.str.2@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_dbg_err
Lloh30:
	adrp	x8, _ENFILE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ENFILE@GOTPAGEOFF]
	b	LBB0_25
LBB0_20:
                                        ; kill: def $w19 killed $w19 killed $x19 def $x19
	cmp	w19, w1
	b.eq	LBB0_19
LBB0_21:
Lloh32:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh33:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	mov	w0, #152
	bl	_kzalloc
	cbz	x0, LBB0_24
; %bb.22:
	mov	x20, x0
	str	x21, [x0, #144]
	stp	w19, w22, [x0]
	mov	w8, #-1
	str	w8, [x0, #8]
	add	x0, x0, #136
	bl	_mutex_init
	add	x0, x20, #132
	bl	_mutex_init
	add	x0, x20, #128
	bl	_mutex_init
	add	x0, x20, #124
	bl	_spin_lock_init
	ldr	w1, [x21]
	str	x19, [sp]
Lloh35:
	adrp	x0, l_.str.4@PAGE
Lloh36:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_ubi_msg
	mov	x0, x20
	bl	_io_init
	mov	x22, x0
	cbz	w0, LBB0_27
LBB0_23:
	ldr	x0, [x20, #72]
	bl	_vfree
	ldr	x0, [x20, #64]
	bl	_vfree
	mov	x0, x20
	bl	_kfree
	mov	x19, x22
	b	LBB0_26
LBB0_24:
Lloh37:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_25:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_26:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_27:
Lloh39:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh40:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	neg	w22, w8
	ldr	w0, [x20, #116]
	bl	_vmalloc
	str	x0, [x20, #72]
	cbz	x0, LBB0_23
; %bb.28:
	ldr	w0, [x20, #116]
	bl	_vmalloc
	str	x0, [x20, #64]
	cbz	x0, LBB0_23
; %bb.29:
	mov	x0, x20
	bl	_attach_by_scanning
	cbz	w0, LBB0_31
; %bb.30:
	mov	x22, x0
Lloh42:
	adrp	x0, l_.str.5@PAGE
Lloh43:
	add	x0, x0, l_.str.5@PAGEOFF
	mov	x1, x22
	bl	_dbg_err
	b	LBB0_23
LBB0_31:
	ldr	w1, [x20, #8]
	cmn	w1, #1
	b.eq	LBB0_34
; %bb.32:
	mov	x0, x20
	bl	_autoresize
	cbz	w0, LBB0_34
; %bb.33:
	mov	x22, x0
	mov	x0, x20
	bl	_ubi_wl_close
	mov	x0, x20
	bl	_free_user_volumes
	b	LBB0_38
LBB0_34:
	mov	x0, x20
	bl	_uif_init
	mov	x22, x0
	cbnz	w0, LBB0_37
; %bb.35:
Lloh44:
	adrp	x8, _ubi_thread@GOTPAGE
Lloh45:
	ldr	x8, [x8, _ubi_thread@GOTPAGEOFF]
Lloh46:
	ldr	w0, [x8]
	ldr	w2, [x20, #112]
	mov	x1, x20
	bl	_kthread_create
	str	w0, [x20, #100]
	bl	_IS_ERR
	cbz	x0, LBB0_39
; %bb.36:
	ldr	w0, [x20, #100]
	bl	_PTR_ERR
	mov	x22, x0
	ldrsw	x1, [x20, #112]
	str	x22, [sp]
Lloh47:
	adrp	x0, l_.str.6@PAGE
Lloh48:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_ubi_err
	mov	x0, x20
	bl	_uif_close
LBB0_37:
	mov	x0, x20
	bl	_ubi_wl_close
LBB0_38:
	mov	x0, x20
	bl	_free_internal_volumes
	ldr	x0, [x20, #80]
	bl	_vfree
	b	LBB0_23
LBB0_39:
	ldr	w1, [x21]
	mov	x8, x19
	str	x8, [sp]
Lloh49:
	adrp	x0, l_.str.7@PAGE
Lloh50:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_ubi_msg
	ldr	w1, [x21, #16]
Lloh51:
	adrp	x0, l_.str.8@PAGE
Lloh52:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_ubi_msg
	ldr	w8, [x20, #12]
	asr	w1, w8, #20
Lloh53:
	adrp	x0, l_.str.9@PAGE
Lloh54:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_ubi_msg
	ldr	w1, [x20, #16]
Lloh55:
	adrp	x0, l_.str.10@PAGE
Lloh56:
	add	x0, x0, l_.str.10@PAGEOFF
	bl	_ubi_msg
	ldr	w1, [x20, #20]
Lloh57:
	adrp	x0, l_.str.11@PAGE
Lloh58:
	add	x0, x0, l_.str.11@PAGEOFF
	bl	_ubi_msg
	ldr	w1, [x20, #24]
Lloh59:
	adrp	x0, l_.str.12@PAGE
Lloh60:
	add	x0, x0, l_.str.12@PAGEOFF
	bl	_ubi_msg
Lloh61:
	adrp	x8, _CONFIG_MTD_UBI_WL_THRESHOLD@GOTPAGE
Lloh62:
	ldr	x8, [x8, _CONFIG_MTD_UBI_WL_THRESHOLD@GOTPAGEOFF]
Lloh63:
	ldr	w1, [x8]
Lloh64:
	adrp	x0, l_.str.13@PAGE
Lloh65:
	add	x0, x0, l_.str.13@PAGEOFF
	bl	_ubi_msg
Lloh66:
	adrp	x21, _UBI_INT_VOL_COUNT@GOTPAGE
Lloh67:
	ldr	x21, [x21, _UBI_INT_VOL_COUNT@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh68:
	adrp	x0, l_.str.14@PAGE
Lloh69:
	add	x0, x0, l_.str.14@PAGEOFF
	bl	_ubi_msg
	ldr	w8, [x20, #28]
	ldr	w9, [x21]
	sub	w1, w8, w9
Lloh70:
	adrp	x0, l_.str.15@PAGE
Lloh71:
	add	x0, x0, l_.str.15@PAGEOFF
	bl	_ubi_msg
	ldr	w1, [x20, #32]
Lloh72:
	adrp	x0, l_.str.16@PAGE
Lloh73:
	add	x0, x0, l_.str.16@PAGEOFF
	bl	_ubi_msg
	ldr	w1, [x20, #36]
Lloh74:
	adrp	x0, l_.str.17@PAGE
Lloh75:
	add	x0, x0, l_.str.17@PAGEOFF
	bl	_ubi_msg
	ldr	w1, [x20, #40]
Lloh76:
	adrp	x0, l_.str.18@PAGE
Lloh77:
	add	x0, x0, l_.str.18@PAGEOFF
	bl	_ubi_msg
	ldp	w8, w1, [x20, #104]
	str	x8, [sp]
Lloh78:
	adrp	x0, l_.str.19@PAGE
Lloh79:
	add	x0, x0, l_.str.19@PAGEOFF
	bl	_ubi_msg
	ldr	w1, [x20, #44]
Lloh80:
	adrp	x0, l_.str.20@PAGE
Lloh81:
	add	x0, x0, l_.str.20@PAGEOFF
	bl	_ubi_msg
	add	x21, x20, #96
	mov	x0, x21
	bl	_spin_lock
Lloh82:
	adrp	x8, _DBG_DISABLE_BGT@GOTPAGE
Lloh83:
	ldr	x8, [x8, _DBG_DISABLE_BGT@GOTPAGEOFF]
Lloh84:
	ldr	w8, [x8]
	cbnz	w8, LBB0_41
; %bb.40:
	mov	w8, #1
	str	w8, [x20, #48]
LBB0_41:
	ldr	w0, [x20, #100]
	bl	_wake_up_process
	mov	x0, x21
	bl	_spin_unlock
	mov	w8, #1
	mov	x0, x20
	str	w8, [x0, #88]!
Lloh85:
	adrp	x8, _ubi_reboot_notifier@GOTPAGE
Lloh86:
	ldr	x8, [x8, _ubi_reboot_notifier@GOTPAGEOFF]
Lloh87:
	ldr	w8, [x8]
	str	w8, [x20, #92]
	bl	_register_reboot_notifier
Lloh88:
	adrp	x8, _ubi_devices@GOTPAGE
Lloh89:
	ldr	x8, [x8, _ubi_devices@GOTPAGEOFF]
Lloh90:
	ldr	x8, [x8]
	str	x20, [x8, w19, sxtw #3]
Lloh91:
	adrp	x8, _UBI_VOLUME_ADDED@GOTPAGE
Lloh92:
	ldr	x8, [x8, _UBI_VOLUME_ADDED@GOTPAGEOFF]
Lloh93:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, #0
	bl	_ubi_notify_all
	b	LBB0_26
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh82, Lloh83, Lloh84
	.loh AdrpAdd	Lloh80, Lloh81
	.loh AdrpAdd	Lloh78, Lloh79
	.loh AdrpAdd	Lloh76, Lloh77
	.loh AdrpAdd	Lloh74, Lloh75
	.loh AdrpAdd	Lloh72, Lloh73
	.loh AdrpAdd	Lloh70, Lloh71
	.loh AdrpAdd	Lloh68, Lloh69
	.loh AdrpLdrGot	Lloh66, Lloh67
	.loh AdrpAdd	Lloh64, Lloh65
	.loh AdrpLdrGotLdr	Lloh61, Lloh62, Lloh63
	.loh AdrpAdd	Lloh59, Lloh60
	.loh AdrpAdd	Lloh57, Lloh58
	.loh AdrpAdd	Lloh55, Lloh56
	.loh AdrpAdd	Lloh53, Lloh54
	.loh AdrpAdd	Lloh51, Lloh52
	.loh AdrpAdd	Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh91, Lloh92, Lloh93
	.loh AdrpLdrGotLdr	Lloh88, Lloh89, Lloh90
	.loh AdrpLdrGotLdr	Lloh85, Lloh86, Lloh87
	.cfi_endproc
                                        ; -- End function
	.comm	_UBI_MAX_DEVICES,4,2            ; @UBI_MAX_DEVICES
	.comm	_ubi_devices,8,3                ; @ubi_devices
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mtd%d is already attached to ubi%d"

	.comm	_EEXIST,4,2                     ; @EEXIST
	.comm	_MTD_UBIVOLUME,8,3              ; @MTD_UBIVOLUME
l_.str.1:                               ; @.str.1
	.asciz	"refuse attaching mtd%d - it is already emulated on top of UBI"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_UBI_DEV_NUM_AUTO,4,2           ; @UBI_DEV_NUM_AUTO
l_.str.2:                               ; @.str.2
	.asciz	"only %d UBI devices may be created"

	.comm	_ENFILE,4,2                     ; @ENFILE
l_.str.3:                               ; @.str.3
	.asciz	"ubi%d already exists"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.4:                               ; @.str.4
	.asciz	"attaching mtd%d to ubi%d"

l_.str.5:                               ; @.str.5
	.asciz	"failed to attach by scanning, error %d"

	.comm	_ubi_thread,4,2                 ; @ubi_thread
l_.str.6:                               ; @.str.6
	.asciz	"cannot spawn \"%s\", error %d"

l_.str.7:                               ; @.str.7
	.asciz	"attached mtd%d to ubi%d"

l_.str.8:                               ; @.str.8
	.asciz	"MTD device name:            \"%s\""

l_.str.9:                               ; @.str.9
	.asciz	"MTD device size:            %llu MiB"

l_.str.10:                              ; @.str.10
	.asciz	"number of good PEBs:        %d"

l_.str.11:                              ; @.str.11
	.asciz	"number of bad PEBs:         %d"

l_.str.12:                              ; @.str.12
	.asciz	"max. allowed volumes:       %d"

l_.str.13:                              ; @.str.13
	.asciz	"wear-leveling threshold:    %d"

	.comm	_CONFIG_MTD_UBI_WL_THRESHOLD,4,2 ; @CONFIG_MTD_UBI_WL_THRESHOLD
l_.str.14:                              ; @.str.14
	.asciz	"number of internal volumes: %d"

	.comm	_UBI_INT_VOL_COUNT,4,2          ; @UBI_INT_VOL_COUNT
l_.str.15:                              ; @.str.15
	.asciz	"number of user volumes:     %d"

l_.str.16:                              ; @.str.16
	.asciz	"available PEBs:             %d"

l_.str.17:                              ; @.str.17
	.asciz	"total number of reserved PEBs: %d"

l_.str.18:                              ; @.str.18
	.asciz	"number of PEBs reserved for bad PEB handling: %d"

l_.str.19:                              ; @.str.19
	.asciz	"max/mean erase counter: %d/%d"

l_.str.20:                              ; @.str.20
	.asciz	"image sequence number: %d"

	.comm	_DBG_DISABLE_BGT,4,2            ; @DBG_DISABLE_BGT
	.comm	_ubi_reboot_notifier,4,2        ; @ubi_reboot_notifier
	.comm	_UBI_VOLUME_ADDED,4,2           ; @UBI_VOLUME_ADDED
.subsections_via_symbols
