	.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
	testl	%ecx, %ecx
	js	LBB0_23
## %bb.1:
	movl	%ecx, %r13d
	movq	_MAX_MTD_UBI_BEB_LIMIT@GOTPCREL(%rip), %rax
	cmpl	%ecx, (%rax)
	jl	LBB0_23
## %bb.2:
	movl	%edx, %r12d
	movl	%esi, %r15d
	movq	%rdi, %rbx
	testl	%r13d, %r13d
	jne	LBB0_4
## %bb.3:
	movq	_CONFIG_MTD_UBI_BEB_LIMIT@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_4:
	movq	_UBI_MAX_DEVICES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	testl	%esi, %esi
	jle	LBB0_10
## %bb.5:
	movq	_ubi_devices@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	xorl	%edx, %edx
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_7 Depth=1
	incq	%rdx
	cmpq	%rdx, %rsi
	je	LBB0_10
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rdx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	(%rbx), %eax
	movq	224(%rdi), %rdi
	cmpl	(%rdi), %eax
	jne	LBB0_6
## %bb.9:
	leaq	L_.str(%rip), %rdi
	xorl	%r15d, %r15d
	movl	%eax, %esi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_pr_err
	movq	_EEXIST@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_10:
	movq	8(%rbx), %rax
	movq	_MTD_UBIVOLUME@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.11:
	movl	(%rbx), %esi
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_14
LBB0_12:
	movq	_MTD_MLCNANDFLASH@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_15
## %bb.13:
	movl	(%rbx), %esi
	leaq	L_.str.2(%rip), %rdi
LBB0_14:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_pr_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_15:
	movq	_UBI_DEV_NUM_AUTO@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_20
## %bb.16:
	testl	%esi, %esi
	jle	LBB0_27
## %bb.17:
	movq	_ubi_devices@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rax,%r15,8)
	je	LBB0_28
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	incq	%r15
	cmpq	%r15, %rsi
	jne	LBB0_18
	jmp	LBB0_29
LBB0_20:
	cmpl	%r15d, %esi
	jle	LBB0_23
## %bb.21:
	movq	_ubi_devices@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%r15d, %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_30
## %bb.22:
	leaq	L_.str.4(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_pr_err
	movq	_EEXIST@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, %r15d
	jmp	LBB0_26
LBB0_23:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_24:
	xorl	%r15d, %r15d
LBB0_25:
	subl	(%rax), %r15d
LBB0_26:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_27:
	xorl	%r15d, %r15d
LBB0_28:
	cmpl	%esi, %r15d
	jne	LBB0_30
LBB0_29:
	leaq	L_.str.3(%rip), %rdi
	xorl	%r15d, %r15d
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_pr_err
	movq	_ENFILE@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_30:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$232, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_33
## %bb.31:
	movq	%rax, %r14
	leaq	88(%rax), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_device_initialize
	movq	_dev_release@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 104(%r14)
	movq	_ubi_class@GOTPCREL(%rip), %rax
	movq	%rax, 96(%r14)
	movq	_ubi_dev_groups@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 88(%r14)
	movq	%rbx, 224(%r14)
	movl	%r15d, (%r14)
	movl	%r12d, 4(%r14)
	movabsq	$8589934591, %rax               ## imm = 0x1FFFFFFFF
	movq	%rax, 8(%r14)
	leaq	168(%r14), %rdi
	callq	_mutex_init
	leaq	164(%r14), %rdi
	callq	_mutex_init
	leaq	160(%r14), %rdi
	callq	_mutex_init
	leaq	156(%r14), %rdi
	callq	_spin_lock_init
	leaq	152(%r14), %rdi
	callq	_init_rwsem
	leaq	148(%r14), %rdi
	callq	_init_rwsem
	movl	(%rbx), %edx
	leaq	L_.str.5(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_io_init
	movl	%eax, %r13d
	testl	%eax, %eax
	je	LBB0_34
LBB0_32:
	movl	116(%r14), %edi
	callq	_vfree
	movl	112(%r14), %edi
	callq	_vfree
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_put_device
	movl	%r13d, %r15d
	jmp	LBB0_26
LBB0_33:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_24
LBB0_34:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	movl	16(%r14), %edi
	callq	_vmalloc
	movl	%eax, 116(%r14)
	movl	%r12d, %r13d
	testl	%eax, %eax
	je	LBB0_32
## %bb.35:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_ubi_attach
	testl	%eax, %eax
	je	LBB0_37
## %bb.36:
	movl	%eax, %r13d
	movl	(%rbx), %edx
	leaq	L_.str.6(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_ubi_err
	jmp	LBB0_32
LBB0_37:
	movl	8(%r14), %esi
	cmpl	$-1, %esi
	je	LBB0_40
## %bb.38:
	movq	%r14, %rdi
	callq	_autoresize
	testl	%eax, %eax
	je	LBB0_40
## %bb.39:
	movl	%eax, %r13d
	movslq	%r15d, %r12
	jmp	LBB0_46
LBB0_40:
	movq	_ubi_devices@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%r15d, %r12
	movq	%r14, (%rax,%r12,8)
	movq	%r14, %rdi
	callq	_uif_init
	testl	%eax, %eax
	je	LBB0_42
## %bb.41:
	movl	%eax, %r13d
	jmp	LBB0_46
LBB0_42:
	movq	%r14, %rdi
	callq	_ubi_debugfs_init_dev
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_45
## %bb.43:
	movq	_ubi_thread@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	20(%r14), %ecx
	leaq	L_.str.7(%rip), %rdx
	movq	%r14, %rsi
	callq	_kthread_create
	movl	%eax, 128(%r14)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_47
## %bb.44:
	movl	128(%r14), %edi
	callq	_PTR_ERR
	movl	%eax, %r13d
	movl	20(%r14), %edx
	leaq	L_.str.8(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_ubi_err
	movq	%r14, %rdi
	callq	_ubi_debugfs_exit_dev
LBB0_45:
	movq	%r14, %rdi
	callq	_uif_close
LBB0_46:
	movq	_ubi_devices@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	$0, (%rax,%r12,8)
	movq	%r14, %rdi
	callq	_ubi_wl_close
	movq	%r14, %rdi
	callq	_ubi_free_internal_volumes
	movl	120(%r14), %edi
	callq	_vfree
	jmp	LBB0_32
LBB0_47:
	movl	(%rbx), %edx
	movl	16(%rbx), %ecx
	movl	24(%r14), %r8d
	sarl	$20, %r8d
	leaq	L_.str.9(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movl	16(%r14), %edx
	movl	28(%r14), %r8d
	movl	%edx, %ecx
	sarl	$10, %ecx
	leaq	L_.str.10(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movl	32(%r14), %edx
	movl	36(%r14), %ecx
	movl	40(%r14), %r8d
	leaq	L_.str.11(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movl	4(%r14), %edx
	movl	44(%r14), %ecx
	movl	48(%r14), %r8d
	leaq	L_.str.12(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movl	52(%r14), %edx
	movl	56(%r14), %ecx
	movl	60(%r14), %r8d
	leaq	L_.str.13(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movq	_UBI_INT_VOL_COUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	64(%r14), %edx
	movl	68(%r14), %r8d
	subl	%ecx, %edx
	leaq	L_.str.14(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movl	140(%r14), %edx
	movl	132(%r14), %r9d
	movl	136(%r14), %ecx
	movq	_CONFIG_MTD_UBI_WL_THRESHOLD@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	L_.str.15(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movl	72(%r14), %edx
	movl	76(%r14), %ecx
	movl	80(%r14), %r8d
	leaq	L_.str.16(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movq	%r14, %rbx
	addq	$124, %rbx
	movq	%rbx, %rdi
	callq	_spin_lock
	movl	$1, 84(%r14)
	movl	128(%r14), %edi
	callq	_wake_up_process
	movq	%rbx, %rdi
	callq	_spin_unlock
	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	_MAX_MTD_UBI_BEB_LIMIT,4,2      ## @MAX_MTD_UBI_BEB_LIMIT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CONFIG_MTD_UBI_BEB_LIMIT,4,2   ## @CONFIG_MTD_UBI_BEB_LIMIT
	.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	"ubi: mtd%d is already attached to ubi%d\n"

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

	.comm	_MTD_MLCNANDFLASH,8,3           ## @MTD_MLCNANDFLASH
L_.str.2:                               ## @.str.2
	.asciz	"ubi: refuse attaching mtd%d - MLC NAND is not supported\n"

	.comm	_UBI_DEV_NUM_AUTO,4,2           ## @UBI_DEV_NUM_AUTO
L_.str.3:                               ## @.str.3
	.asciz	"ubi: only %d UBI devices may be created\n"

	.comm	_ENFILE,4,2                     ## @ENFILE
L_.str.4:                               ## @.str.4
	.asciz	"ubi: ubi%i already exists\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_dev_release,4,2                ## @dev_release
	.comm	_ubi_class,4,2                  ## @ubi_class
	.comm	_ubi_dev_groups,4,2             ## @ubi_dev_groups
L_.str.5:                               ## @.str.5
	.asciz	"attaching mtd%d"

L_.str.6:                               ## @.str.6
	.asciz	"failed to attach mtd%d, error %d"

	.comm	_ubi_thread,4,2                 ## @ubi_thread
L_.str.7:                               ## @.str.7
	.asciz	"%s"

L_.str.8:                               ## @.str.8
	.asciz	"cannot spawn \"%s\", error %d"

L_.str.9:                               ## @.str.9
	.asciz	"attached mtd%d (name \"%s\", size %llu MiB)"

L_.str.10:                              ## @.str.10
	.asciz	"PEB size: %d bytes (%d KiB), LEB size: %d bytes"

L_.str.11:                              ## @.str.11
	.asciz	"min./max. I/O unit sizes: %d/%d, sub-page size %d"

L_.str.12:                              ## @.str.12
	.asciz	"VID header offset: %d (aligned %d), data offset: %d"

L_.str.13:                              ## @.str.13
	.asciz	"good PEBs: %d, bad PEBs: %d, corrupted PEBs: %d"

L_.str.14:                              ## @.str.14
	.asciz	"user volume: %d, internal volumes: %d, max. volumes count: %d"

	.comm	_UBI_INT_VOL_COUNT,4,2          ## @UBI_INT_VOL_COUNT
L_.str.15:                              ## @.str.15
	.asciz	"max/mean erase counter: %d/%d, WL threshold: %d, image sequence number: %u"

	.comm	_CONFIG_MTD_UBI_WL_THRESHOLD,4,2 ## @CONFIG_MTD_UBI_WL_THRESHOLD
L_.str.16:                              ## @.str.16
	.asciz	"available PEBs: %d, total reserved PEBs: %d, PEBs reserved for bad PEB handling: %d"

	.comm	_UBI_VOLUME_ADDED,4,2           ## @UBI_VOLUME_ADDED
	.comm	_UBI_FM_MAX_POOL_SIZE,4,2       ## @UBI_FM_MAX_POOL_SIZE
	.comm	_UBI_FM_MAX_START,4,2           ## @UBI_FM_MAX_START
	.comm	_UBI_FM_MIN_POOL_SIZE,4,2       ## @UBI_FM_MIN_POOL_SIZE
	.comm	_fm_autoconvert,4,2             ## @fm_autoconvert
	.comm	_fm_debug,8,3                   ## @fm_debug
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function ubi_attach_mtd_dev
lCPI0_0:
	.long	4294967295                      ; 0xffffffff
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_ubi_attach_mtd_dev
	.p2align	2
_ubi_attach_mtd_dev:                    ; @ubi_attach_mtd_dev
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	tbnz	w3, #31, LBB0_14
; %bb.1:
Lloh0:
	adrp	x8, _MAX_MTD_UBI_BEB_LIMIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_MTD_UBI_BEB_LIMIT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w3
	b.lt	LBB0_14
; %bb.2:
	mov	x24, x2
	mov	x19, x1
	mov	x21, x0
Lloh3:
	adrp	x8, _CONFIG_MTD_UBI_BEB_LIMIT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CONFIG_MTD_UBI_BEB_LIMIT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w3, #0
	csel	w23, w8, w3, eq
Lloh6:
	adrp	x8, _UBI_MAX_DEVICES@GOTPAGE
Lloh7:
	ldr	x8, [x8, _UBI_MAX_DEVICES@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	cmp	w1, #1
	b.lt	LBB0_9
; %bb.3:
	mov	x9, #0
Lloh9:
	adrp	x8, _ubi_devices@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ubi_devices@GOTPAGEOFF]
Lloh11:
	ldr	x10, [x8]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x9, x9, #1
	cmp	x1, x9
	b.eq	LBB0_9
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x10, x9, lsl #3]
	cbz	x11, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x21]
	ldr	x11, [x11, #224]
	ldr	w11, [x11]
	cmp	w8, w11
	b.ne	LBB0_4
; %bb.7:
	str	x9, [sp]
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x8
LBB0_8:
	bl	_pr_err
Lloh14:
	adrp	x8, _EEXIST@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
	b	LBB0_15
LBB0_9:
	ldr	x8, [x21, #8]
Lloh16:
	adrp	x9, _MTD_UBIVOLUME@GOTPAGE
Lloh17:
	ldr	x9, [x9, _MTD_UBIVOLUME@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.10:
	ldr	w1, [x21]
Lloh19:
	adrp	x0, l_.str.1@PAGE
Lloh20:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_13
LBB0_11:
Lloh21:
	adrp	x9, _MTD_MLCNANDFLASH@GOTPAGE
Lloh22:
	ldr	x9, [x9, _MTD_MLCNANDFLASH@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_17
; %bb.12:
	ldr	w1, [x21]
Lloh24:
	adrp	x0, l_.str.2@PAGE
Lloh25:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_13:
	bl	_pr_err
LBB0_14:
Lloh26:
	adrp	x8, _EINVAL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_16:
	mov	x0, x19
	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
	add	sp, sp, #96
	ret
LBB0_17:
Lloh28:
	adrp	x8, _UBI_DEV_NUM_AUTO@GOTPAGE
Lloh29:
	ldr	x8, [x8, _UBI_DEV_NUM_AUTO@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_22
; %bb.18:
	cmp	w1, #1
	b.lt	LBB0_25
; %bb.19:
	mov	x19, #0
Lloh31:
	adrp	x8, _ubi_devices@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ubi_devices@GOTPAGEOFF]
Lloh33:
	ldr	x8, [x8]
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x8, x19, lsl #3]
	cbz	x9, LBB0_26
; %bb.21:                               ;   in Loop: Header=BB0_20 Depth=1
	add	x19, x19, #1
	cmp	x1, x19
	b.ne	LBB0_20
	b	LBB0_28
LBB0_22:
	cmp	w1, w19
	b.le	LBB0_14
; %bb.23:
Lloh34:
	adrp	x8, _ubi_devices@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ubi_devices@GOTPAGEOFF]
Lloh36:
	ldr	x8, [x8]
	ldr	x8, [x8, w19, sxtw #3]
	cbz	x8, LBB0_29
; %bb.24:
Lloh37:
	adrp	x0, l_.str.4@PAGE
Lloh38:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x19
	b	LBB0_8
LBB0_25:
	mov	w19, #0
	b	LBB0_27
LBB0_26:
                                        ; kill: def $w19 killed $w19 killed $x19 def $x19
LBB0_27:
	cmp	w19, w1
	b.ne	LBB0_29
LBB0_28:
Lloh39:
	adrp	x0, l_.str.3@PAGE
Lloh40:
	add	x0, x0, l_.str.3@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_pr_err
Lloh41:
	adrp	x8, _ENFILE@GOTPAGE
Lloh42:
	ldr	x8, [x8, _ENFILE@GOTPAGEOFF]
	b	LBB0_15
LBB0_29:
Lloh43:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh44:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh45:
	ldr	w1, [x8]
	mov	w0, #232
	bl	_kzalloc
	cbz	x0, LBB0_32
; %bb.30:
	mov	x20, x0
	add	x22, x0, #88
	mov	x0, x22
	bl	_device_initialize
Lloh46:
	adrp	x8, _dev_release@GOTPAGE
Lloh47:
	ldr	x8, [x8, _dev_release@GOTPAGEOFF]
Lloh48:
	ldr	w8, [x8]
	str	w8, [x20, #104]
Lloh49:
	adrp	x8, _ubi_class@GOTPAGE
Lloh50:
	ldr	x8, [x8, _ubi_class@GOTPAGEOFF]
	str	x8, [x20, #96]
Lloh51:
	adrp	x8, _ubi_dev_groups@GOTPAGE
Lloh52:
	ldr	x8, [x8, _ubi_dev_groups@GOTPAGEOFF]
Lloh53:
	ldr	w8, [x8]
	str	w8, [x20, #88]
	str	x21, [x20, #224]
	stp	w19, w24, [x20]
Lloh54:
	adrp	x8, lCPI0_0@PAGE
Lloh55:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x20, #8]
	add	x0, x20, #168
	bl	_mutex_init
	add	x0, x20, #164
	bl	_mutex_init
	add	x0, x20, #160
	bl	_mutex_init
	add	x0, x20, #156
	bl	_spin_lock_init
	add	x0, x20, #152
	bl	_init_rwsem
	add	x0, x20, #148
	bl	_init_rwsem
	ldr	w2, [x21]
Lloh56:
	adrp	x1, l_.str.5@PAGE
Lloh57:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x20
	bl	_ubi_msg
	mov	x0, x20
	mov	x1, x23
	bl	_io_init
	mov	x23, x0
	cbz	w0, LBB0_33
LBB0_31:
	ldr	w0, [x20, #116]
	bl	_vfree
	ldr	w0, [x20, #112]
	bl	_vfree
	mov	x0, x22
	bl	_put_device
	mov	x19, x23
	b	LBB0_16
LBB0_32:
Lloh58:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh59:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_15
LBB0_33:
Lloh60:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh61:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh62:
	ldr	w23, [x8]
	ldr	w0, [x20, #16]
	bl	_vmalloc
	str	w0, [x20, #116]
	cbz	w0, LBB0_36
; %bb.34:
	mov	x0, x20
	mov	w1, #0
	bl	_ubi_attach
	cbz	w0, LBB0_37
; %bb.35:
	mov	x23, x0
	ldr	w2, [x21]
	str	x23, [sp]
Lloh63:
	adrp	x1, l_.str.6@PAGE
Lloh64:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x20
	bl	_ubi_err
	b	LBB0_31
LBB0_36:
	neg	w23, w23
	b	LBB0_31
LBB0_37:
	ldr	w1, [x20, #8]
	cmn	w1, #1
	b.eq	LBB0_40
; %bb.38:
	mov	x0, x20
	bl	_autoresize
	cbz	w0, LBB0_40
; %bb.39:
	mov	x23, x0
                                        ; kill: def $w19 killed $w19 killed $x19 def $x19
	sxtw	x24, w19
	b	LBB0_46
LBB0_40:
Lloh65:
	adrp	x8, _ubi_devices@GOTPAGE
Lloh66:
	ldr	x8, [x8, _ubi_devices@GOTPAGEOFF]
Lloh67:
	ldr	x8, [x8]
	sxtw	x24, w19
	str	x20, [x8, w19, sxtw #3]
	mov	x0, x20
	bl	_uif_init
	cbz	w0, LBB0_42
; %bb.41:
	mov	x23, x0
	b	LBB0_46
LBB0_42:
	mov	x0, x20
	bl	_ubi_debugfs_init_dev
	mov	x23, x0
	cbnz	w0, LBB0_45
; %bb.43:
Lloh68:
	adrp	x8, _ubi_thread@GOTPAGE
Lloh69:
	ldr	x8, [x8, _ubi_thread@GOTPAGEOFF]
Lloh70:
	ldr	w0, [x8]
	ldr	w3, [x20, #20]
Lloh71:
	adrp	x2, l_.str.7@PAGE
Lloh72:
	add	x2, x2, l_.str.7@PAGEOFF
	mov	x1, x20
	bl	_kthread_create
	str	w0, [x20, #128]
	bl	_IS_ERR
	cbz	x0, LBB0_47
; %bb.44:
	ldr	w0, [x20, #128]
	bl	_PTR_ERR
	mov	x23, x0
	ldr	w2, [x20, #20]
	str	x23, [sp]
Lloh73:
	adrp	x1, l_.str.8@PAGE
Lloh74:
	add	x1, x1, l_.str.8@PAGEOFF
	mov	x0, x20
	bl	_ubi_err
	mov	x0, x20
	bl	_ubi_debugfs_exit_dev
                                        ; kill: def $w23 killed $w23 killed $x23 def $x23
LBB0_45:
	mov	x0, x20
	bl	_uif_close
LBB0_46:
Lloh75:
	adrp	x8, _ubi_devices@GOTPAGE
Lloh76:
	ldr	x8, [x8, _ubi_devices@GOTPAGEOFF]
Lloh77:
	ldr	x8, [x8]
	str	xzr, [x8, x24, lsl #3]
	mov	x0, x20
	bl	_ubi_wl_close
	mov	x0, x20
	bl	_ubi_free_internal_volumes
	ldr	w0, [x20, #120]
	bl	_vfree
	b	LBB0_31
LBB0_47:
	ldr	w2, [x21]
	ldr	w8, [x20, #24]
	asr	w8, w8, #20
	ldr	w9, [x21, #16]
	stp	x9, x8, [sp]
Lloh78:
	adrp	x1, l_.str.9@PAGE
Lloh79:
	add	x1, x1, l_.str.9@PAGEOFF
	mov	x0, x20
	bl	_ubi_msg
	ldr	w2, [x20, #16]
	asr	w8, w2, #10
	ldr	w9, [x20, #28]
	stp	x8, x9, [sp]
Lloh80:
	adrp	x1, l_.str.10@PAGE
Lloh81:
	add	x1, x1, l_.str.10@PAGEOFF
	mov	x0, x20
	bl	_ubi_msg
	ldp	w2, w8, [x20, #32]
	ldr	w9, [x20, #40]
	stp	x8, x9, [sp]
Lloh82:
	adrp	x1, l_.str.11@PAGE
Lloh83:
	add	x1, x1, l_.str.11@PAGEOFF
	mov	x0, x20
	bl	_ubi_msg
	ldr	w2, [x20, #4]
	ldp	w8, w9, [x20, #44]
	stp	x8, x9, [sp]
Lloh84:
	adrp	x1, l_.str.12@PAGE
Lloh85:
	add	x1, x1, l_.str.12@PAGEOFF
	mov	x0, x20
	bl	_ubi_msg
	ldp	w2, w8, [x20, #52]
	ldr	w9, [x20, #60]
	stp	x8, x9, [sp]
Lloh86:
	adrp	x1, l_.str.13@PAGE
Lloh87:
	add	x1, x1, l_.str.13@PAGEOFF
	mov	x0, x20
	bl	_ubi_msg
Lloh88:
	adrp	x8, _UBI_INT_VOL_COUNT@GOTPAGE
Lloh89:
	ldr	x8, [x8, _UBI_INT_VOL_COUNT@GOTPAGEOFF]
Lloh90:
	ldr	w8, [x8]
	ldp	w9, w10, [x20, #64]
	sub	w2, w9, w8
	stp	x8, x10, [sp]
Lloh91:
	adrp	x1, l_.str.14@PAGE
Lloh92:
	add	x1, x1, l_.str.14@PAGEOFF
	mov	x0, x20
	bl	_ubi_msg
	ldp	w9, w2, [x20, #136]
Lloh93:
	adrp	x8, _CONFIG_MTD_UBI_WL_THRESHOLD@GOTPAGE
Lloh94:
	ldr	x8, [x8, _CONFIG_MTD_UBI_WL_THRESHOLD@GOTPAGEOFF]
Lloh95:
	ldr	w8, [x8]
	ldr	w10, [x20, #132]
	stp	x8, x10, [sp, #8]
	str	x9, [sp]
Lloh96:
	adrp	x1, l_.str.15@PAGE
Lloh97:
	add	x1, x1, l_.str.15@PAGEOFF
	mov	x0, x20
	bl	_ubi_msg
	ldp	w2, w8, [x20, #72]
	ldr	w9, [x20, #80]
	stp	x8, x9, [sp]
Lloh98:
	adrp	x1, l_.str.16@PAGE
Lloh99:
	add	x1, x1, l_.str.16@PAGEOFF
	mov	x0, x20
	bl	_ubi_msg
	add	x21, x20, #124
	mov	x0, x21
	bl	_spin_lock
	mov	w8, #1
	str	w8, [x20, #84]
	ldr	w0, [x20, #128]
	bl	_wake_up_process
	mov	x0, x21
	bl	_spin_unlock
Lloh100:
	adrp	x8, _UBI_VOLUME_ADDED@GOTPAGE
Lloh101:
	ldr	x8, [x8, _UBI_VOLUME_ADDED@GOTPAGEOFF]
Lloh102:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, #0
	bl	_ubi_notify_all
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh41, Lloh42
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpAdd	Lloh56, Lloh57
	.loh AdrpLdr	Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGot	Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGot	Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh60, Lloh61, Lloh62
	.loh AdrpAdd	Lloh63, Lloh64
	.loh AdrpLdrGotLdr	Lloh65, Lloh66, Lloh67
	.loh AdrpAdd	Lloh71, Lloh72
	.loh AdrpLdrGotLdr	Lloh68, Lloh69, Lloh70
	.loh AdrpAdd	Lloh73, Lloh74
	.loh AdrpLdrGotLdr	Lloh75, Lloh76, Lloh77
	.loh AdrpLdrGotLdr	Lloh100, Lloh101, Lloh102
	.loh AdrpAdd	Lloh98, Lloh99
	.loh AdrpAdd	Lloh96, Lloh97
	.loh AdrpLdrGotLdr	Lloh93, Lloh94, Lloh95
	.loh AdrpAdd	Lloh91, Lloh92
	.loh AdrpLdrGotLdr	Lloh88, Lloh89, Lloh90
	.loh AdrpAdd	Lloh86, Lloh87
	.loh AdrpAdd	Lloh84, Lloh85
	.loh AdrpAdd	Lloh82, Lloh83
	.loh AdrpAdd	Lloh80, Lloh81
	.loh AdrpAdd	Lloh78, Lloh79
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_MTD_UBI_BEB_LIMIT,4,2      ; @MAX_MTD_UBI_BEB_LIMIT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CONFIG_MTD_UBI_BEB_LIMIT,4,2   ; @CONFIG_MTD_UBI_BEB_LIMIT
	.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	"ubi: mtd%d is already attached to ubi%d\n"

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

	.comm	_MTD_MLCNANDFLASH,8,3           ; @MTD_MLCNANDFLASH
l_.str.2:                               ; @.str.2
	.asciz	"ubi: refuse attaching mtd%d - MLC NAND is not supported\n"

	.comm	_UBI_DEV_NUM_AUTO,4,2           ; @UBI_DEV_NUM_AUTO
l_.str.3:                               ; @.str.3
	.asciz	"ubi: only %d UBI devices may be created\n"

	.comm	_ENFILE,4,2                     ; @ENFILE
l_.str.4:                               ; @.str.4
	.asciz	"ubi: ubi%i already exists\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_dev_release,4,2                ; @dev_release
	.comm	_ubi_class,4,2                  ; @ubi_class
	.comm	_ubi_dev_groups,4,2             ; @ubi_dev_groups
l_.str.5:                               ; @.str.5
	.asciz	"attaching mtd%d"

l_.str.6:                               ; @.str.6
	.asciz	"failed to attach mtd%d, error %d"

	.comm	_ubi_thread,4,2                 ; @ubi_thread
l_.str.7:                               ; @.str.7
	.asciz	"%s"

l_.str.8:                               ; @.str.8
	.asciz	"cannot spawn \"%s\", error %d"

l_.str.9:                               ; @.str.9
	.asciz	"attached mtd%d (name \"%s\", size %llu MiB)"

l_.str.10:                              ; @.str.10
	.asciz	"PEB size: %d bytes (%d KiB), LEB size: %d bytes"

l_.str.11:                              ; @.str.11
	.asciz	"min./max. I/O unit sizes: %d/%d, sub-page size %d"

l_.str.12:                              ; @.str.12
	.asciz	"VID header offset: %d (aligned %d), data offset: %d"

l_.str.13:                              ; @.str.13
	.asciz	"good PEBs: %d, bad PEBs: %d, corrupted PEBs: %d"

l_.str.14:                              ; @.str.14
	.asciz	"user volume: %d, internal volumes: %d, max. volumes count: %d"

	.comm	_UBI_INT_VOL_COUNT,4,2          ; @UBI_INT_VOL_COUNT
l_.str.15:                              ; @.str.15
	.asciz	"max/mean erase counter: %d/%d, WL threshold: %d, image sequence number: %u"

	.comm	_CONFIG_MTD_UBI_WL_THRESHOLD,4,2 ; @CONFIG_MTD_UBI_WL_THRESHOLD
l_.str.16:                              ; @.str.16
	.asciz	"available PEBs: %d, total reserved PEBs: %d, PEBs reserved for bad PEB handling: %d"

	.comm	_UBI_VOLUME_ADDED,4,2           ; @UBI_VOLUME_ADDED
	.comm	_UBI_FM_MAX_POOL_SIZE,4,2       ; @UBI_FM_MAX_POOL_SIZE
	.comm	_UBI_FM_MAX_START,4,2           ; @UBI_FM_MAX_START
	.comm	_UBI_FM_MIN_POOL_SIZE,4,2       ; @UBI_FM_MIN_POOL_SIZE
	.comm	_fm_autoconvert,4,2             ; @fm_autoconvert
	.comm	_fm_debug,8,3                   ; @fm_debug
.subsections_via_symbols
