	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function init_nandsim
_init_nandsim:                          ## @init_nandsim
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	32(%rdi), %r15
	movq	24(%r15), %r14
	movq	%r14, %rdi
	callq	_NS_IS_INITIALIZED
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_NS_ERR
LBB0_2:
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_51
LBB0_3:
	movq	$0, 16(%r15)
	movq	_NAND_BUSWIDTH_16@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ecx, %ecx
	andl	(%r15), %eax
	setne	%cl
	leal	8(,%rcx,8), %eax
	movl	%eax, (%r14)
	movq	(%rbx), %rdi
	movq	%rdi, 16(%r14)
	movq	8(%rbx), %rsi
	movq	%rsi, 24(%r14)
	movq	16(%rbx), %rax
	movq	%rax, 32(%r14)
	movl	24(%rbx), %ecx
	movl	%ecx, 40(%r14)
	addq	%rsi, %rax
	movq	%rax, 48(%r14)
	callq	_divide
	movq	%rax, 56(%r14)
	imulq	32(%r14), %rax
	addq	16(%r14), %rax
	movq	%rax, 104(%r14)
	movslq	40(%r14), %rdi
	callq	_ffs
	decq	%rax
	movq	%rax, 64(%r14)
	movq	8(%r15), %rax
	movq	%rax, 72(%r14)
	movq	32(%r14), %rdi
	callq	_ffs
	decq	%rax
	movq	%rax, 80(%r14)
	movslq	40(%r14), %rcx
	movq	24(%r14), %rsi
	movq	%rcx, %rax
	orq	%rsi, %rax
	shrq	$32, %rax
	je	LBB0_4
## %bb.5:
	movq	%rcx, %rax
	xorl	%edx, %edx
	divq	%rsi
	jmp	LBB0_6
LBB0_4:
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $eax killed $eax def $rax
LBB0_6:
	movl	%eax, 88(%r14)
	imull	32(%r14), %eax
	addl	%ecx, %eax
	movl	%eax, 92(%r14)
	movl	$0, 4(%r14)
	cmpq	$2048, %rsi                     ## imm = 0x800
	je	LBB0_13
## %bb.7:
	cmpq	$512, %rsi                      ## imm = 0x200
	je	LBB0_10
## %bb.8:
	cmpq	$256, %rsi                      ## imm = 0x100
	jne	LBB0_12
## %bb.9:
	movq	_OPT_PAGE256@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_13:
	movq	_OPT_PAGE2048@GOTPCREL(%rip), %rax
LBB0_14:
	movl	(%rax), %eax
LBB0_15:
	movl	%eax, 4(%r14)
LBB0_16:
	movq	_OPT_SMALLPAGE@GOTPCREL(%rip), %rdx
	movq	16(%r14), %rcx
	testl	%eax, (%rdx)
	je	LBB0_20
## %bb.17:
	cmpq	$33554432, %rcx                 ## imm = 0x2000000
	jg	LBB0_19
## %bb.18:
	movl	$3, 96(%r14)
	movl	$2, %eax
	jmp	LBB0_24
LBB0_20:
	cmpq	$134217728, %rcx                ## imm = 0x8000000
	jg	LBB0_22
## %bb.21:
	movl	$4, 96(%r14)
	movl	$2, %eax
	jmp	LBB0_24
LBB0_10:
	movq	_OPT_PAGE512@GOTPCREL(%rip), %rcx
	movq	_OPT_AUTOINCR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	movl	%eax, 4(%r14)
	cmpl	$8, (%r14)
	jne	LBB0_16
## %bb.11:
	movq	_OPT_PAGE512_8BIT@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	jmp	LBB0_15
LBB0_12:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_NS_ERR
	jmp	LBB0_2
LBB0_19:
	movl	$4, 96(%r14)
	jmp	LBB0_23
LBB0_22:
	movl	$5, 96(%r14)
LBB0_23:
	movl	$3, %eax
LBB0_24:
	movl	%eax, 100(%r14)
	movq	_parts_num@GOTPCREL(%rip), %r15
	movl	(%r15), %ebx
	movq	120(%r14), %rdi
	callq	_ARRAY_SIZE
	cmpl	%eax, %ebx
	jle	LBB0_27
## %bb.25:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_26
LBB0_27:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	16(%r14), %rdx
	movl	(%r15), %r14d
	testl	%r14d, %r14d
	jle	LBB0_28
## %bb.29:
	movl	$2, %r13d
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_30:                                ## =>This Inner Loop Header: Depth=1
	movq	_parts@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	40(%rcx), %rbx
	imulq	(%rax,%r15,8), %rbx
	testq	%rbx, %rbx
	movq	%rcx, %r14
	je	LBB0_32
## %bb.31:                              ##   in Loop: Header=BB0_30 Depth=1
	subq	%rbx, %rdx
	jl	LBB0_32
## %bb.33:                              ##   in Loop: Header=BB0_30 Depth=1
	movl	%r15d, %edi
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r12
	callq	_get_partition_name
	movq	%r12, %rdx
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	120(%r14), %rcx
	movq	%rax, (%rcx,%r13,8)
	movq	%r12, -8(%rcx,%r13,8)
	movq	%rbx, -16(%rcx,%r13,8)
	addq	%rbx, %r12
	incq	%r15
	movq	%r14, %rcx
	movq	_parts_num@GOTPCREL(%rip), %rax
	movslq	(%rax), %r14
	addq	$3, %r13
	cmpq	%r14, %r15
	jl	LBB0_30
	jmp	LBB0_34
LBB0_28:
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
LBB0_34:
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movl	%r14d, 8(%r13)
	testq	%rdx, %rdx
	je	LBB0_38
## %bb.35:
	movq	%rdx, %rbx
	movq	120(%r13), %rdi
	callq	_ARRAY_SIZE
	cmpl	%eax, %r14d
	jge	LBB0_36
## %bb.37:
	movl	%r15d, %edi
	callq	_get_partition_name
	movq	120(%r13), %rcx
	movl	%r15d, %edx
	leaq	(%rdx,%rdx,2), %rdx
	movq	%rax, 16(%rcx,%rdx,8)
	movq	%r12, 8(%rcx,%rdx,8)
	movq	%rbx, (%rcx,%rdx,8)
	incl	8(%r13)
LBB0_38:
	movq	_nand_flash_ids@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	$0, 16(%rax)
	movq	%r13, %r14
	je	LBB0_44
## %bb.39:
	movq	_second_id_byte@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_NAND_NO_AUTOINCR@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movq	_OPT_AUTOINCR@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	jmp	LBB0_40
	.p2align	4, 0x90
LBB0_43:                                ##   in Loop: Header=BB0_40 Depth=1
	cmpq	$0, 40(%rax)
	leaq	24(%rax), %rax
	je	LBB0_44
LBB0_40:                                ## =>This Inner Loop Header: Depth=1
	cmpq	(%rax), %rcx
	jne	LBB0_43
## %bb.41:                              ##   in Loop: Header=BB0_40 Depth=1
	testl	%edx, 8(%rax)
	jne	LBB0_43
## %bb.42:                              ##   in Loop: Header=BB0_40 Depth=1
	orl	%esi, 4(%r14)
	jmp	LBB0_43
LBB0_44:
	cmpl	$16, (%r14)
	jne	LBB0_46
## %bb.45:
	leaq	L_.str.4(%rip), %rdi
	callq	_NS_WARN
LBB0_46:
	movq	16(%r14), %rsi
	shrq	$20, %rsi
	leaq	L_.str.5(%rip), %rdi
	callq	_printk
	movq	24(%r14), %rsi
	leaq	L_.str.6(%rip), %rdi
	callq	_printk
	movq	32(%r14), %rsi
	leaq	L_.str.7(%rip), %rdi
	callq	_printk
	movl	40(%r14), %eax
	sarl	$10, %eax
	movslq	%eax, %rsi
	leaq	L_.str.8(%rip), %rdi
	callq	_printk
	movq	56(%r14), %rsi
	leaq	L_.str.9(%rip), %rdi
	callq	_printk
	movslq	88(%r14), %rsi
	leaq	L_.str.10(%rip), %rdi
	callq	_printk
	movslq	(%r14), %rsi
	leaq	L_.str.11(%rip), %rdi
	callq	_printk
	movq	64(%r14), %rsi
	leaq	L_.str.12(%rip), %rdi
	callq	_printk
	movq	72(%r14), %rsi
	leaq	L_.str.13(%rip), %rdi
	callq	_printk
	movq	80(%r14), %rsi
	leaq	L_.str.14(%rip), %rdi
	callq	_printk
	movq	104(%r14), %rsi
	shrq	$10, %rsi
	leaq	L_.str.15(%rip), %rdi
	callq	_printk
	movslq	96(%r14), %rsi
	leaq	L_.str.16(%rip), %rdi
	callq	_printk
	movslq	100(%r14), %rsi
	leaq	L_.str.17(%rip), %rdi
	callq	_printk
	movslq	4(%r14), %rsi
	leaq	L_.str.18(%rip), %rdi
	callq	_printk
	movq	%r14, %rdi
	callq	_alloc_device
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_50
## %bb.47:
	movl	48(%r14), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	movl	%eax, 112(%r14)
	movq	48(%r14), %rdx
	testl	%eax, %eax
	je	LBB0_48
## %bb.52:
	movl	%eax, %edi
	movl	$255, %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memset
	xorl	%ebx, %ebx
	jmp	LBB0_51
LBB0_32:
	leaq	L_.str.3(%rip), %rdi
LBB0_26:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_NS_ERR
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_49:
	subl	(%rax), %ebx
LBB0_50:
	movq	%r14, %rdi
	callq	_free_device
LBB0_51:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_36:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_NS_ERR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movq	%r13, %r14
	jmp	LBB0_50
LBB0_48:
	leaq	L_.str.19(%rip), %rdi
	xorl	%ebx, %ebx
	movq	%rdx, %rsi
	xorl	%eax, %eax
	callq	_NS_ERR
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_49
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"init_nandsim: nandsim is already initialized\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_NAND_BUSWIDTH_16,4,2           ## @NAND_BUSWIDTH_16
	.comm	_OPT_PAGE256,4,2                ## @OPT_PAGE256
	.comm	_OPT_PAGE512,4,2                ## @OPT_PAGE512
	.comm	_OPT_AUTOINCR,4,2               ## @OPT_AUTOINCR
	.comm	_OPT_PAGE512_8BIT,4,2           ## @OPT_PAGE512_8BIT
	.comm	_OPT_PAGE2048,4,2               ## @OPT_PAGE2048
L_.str.1:                               ## @.str.1
	.asciz	"init_nandsim: unknown page size %u\n"

	.comm	_OPT_SMALLPAGE,4,2              ## @OPT_SMALLPAGE
	.comm	_parts_num,4,2                  ## @parts_num
L_.str.2:                               ## @.str.2
	.asciz	"too many partitions.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_parts,8,3                      ## @parts
L_.str.3:                               ## @.str.3
	.asciz	"bad partition size.\n"

	.comm	_nand_flash_ids,8,3             ## @nand_flash_ids
	.comm	_second_id_byte,8,3             ## @second_id_byte
	.comm	_NAND_NO_AUTOINCR,4,2           ## @NAND_NO_AUTOINCR
L_.str.4:                               ## @.str.4
	.asciz	"16-bit flashes support wasn't tested\n"

L_.str.5:                               ## @.str.5
	.asciz	"flash size: %llu MiB\n"

L_.str.6:                               ## @.str.6
	.asciz	"page size: %u bytes\n"

L_.str.7:                               ## @.str.7
	.asciz	"OOB area size: %u bytes\n"

L_.str.8:                               ## @.str.8
	.asciz	"sector size: %u KiB\n"

L_.str.9:                               ## @.str.9
	.asciz	"pages number: %u\n"

L_.str.10:                              ## @.str.10
	.asciz	"pages per sector: %u\n"

L_.str.11:                              ## @.str.11
	.asciz	"bus width: %u\n"

L_.str.12:                              ## @.str.12
	.asciz	"bits in sector size: %u\n"

L_.str.13:                              ## @.str.13
	.asciz	"bits in page size: %u\n"

L_.str.14:                              ## @.str.14
	.asciz	"bits in OOB size: %u\n"

L_.str.15:                              ## @.str.15
	.asciz	"flash size with OOB: %llu KiB\n"

L_.str.16:                              ## @.str.16
	.asciz	"page address bytes: %u\n"

L_.str.17:                              ## @.str.17
	.asciz	"sector address bytes: %u\n"

L_.str.18:                              ## @.str.18
	.asciz	"options: %#x\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.19:                              ## @.str.19
	.asciz	"init_nandsim: unable to allocate %u bytes for the internal buffer\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_init_nandsim
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function init_nandsim
_init_nandsim:                          ; @init_nandsim
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x20, x0
	ldr	x21, [x0, #32]
	ldr	x19, [x21, #24]
	mov	x0, x19
	bl	_NS_IS_INITIALIZED
	cbz	x0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
LBB0_2:
	bl	_NS_ERR
Lloh2:
	adrp	x8, _EIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_47
LBB0_3:
	str	xzr, [x21, #16]
	ldr	w8, [x21]
Lloh5:
	adrp	x9, _NAND_BUSWIDTH_16@GOTPAGE
Lloh6:
	ldr	x9, [x9, _NAND_BUSWIDTH_16@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	mov	w8, #16
	mov	w9, #8
	csel	w8, w9, w8, eq
	str	w8, [x19]
	ldp	x0, x1, [x20]
	stp	x0, x1, [x19, #16]
	ldr	x8, [x20, #16]
	str	x8, [x19, #32]
	ldr	w9, [x20, #24]
	str	w9, [x19, #40]
	add	x8, x8, x1
	str	x8, [x19, #48]
	bl	_divide
	str	x0, [x19, #56]
	ldr	x8, [x19, #16]
	ldr	x9, [x19, #32]
	madd	x8, x9, x0, x8
	str	x8, [x19, #104]
	ldrsw	x0, [x19, #40]
	bl	_ffs
	sub	x8, x0, #1
	ldr	x9, [x21, #8]
	stp	x8, x9, [x19, #64]
	ldr	x0, [x19, #32]
	bl	_ffs
	sub	x8, x0, #1
	str	x8, [x19, #80]
	ldrsw	x9, [x19, #40]
	ldr	x8, [x19, #24]
	udiv	x10, x9, x8
	ldr	w11, [x19, #32]
	madd	w9, w11, w10, w9
	stp	w10, w9, [x19, #88]
	str	wzr, [x19, #4]
	cmp	x8, #2048
	b.eq	LBB0_7
; %bb.4:
	cmp	x8, #512
	b.eq	LBB0_16
; %bb.5:
	cmp	x8, #256
	b.ne	LBB0_18
; %bb.6:
Lloh8:
	adrp	x8, _OPT_PAGE256@GOTPAGE
Lloh9:
	ldr	x8, [x8, _OPT_PAGE256@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh10:
	adrp	x8, _OPT_PAGE2048@GOTPAGE
Lloh11:
	ldr	x8, [x8, _OPT_PAGE2048@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
LBB0_9:
	str	w8, [x19, #4]
LBB0_10:
Lloh12:
	adrp	x9, _OPT_SMALLPAGE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _OPT_SMALLPAGE@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x9]
	ldr	x9, [x19, #16]
	tst	w10, w8
	b.eq	LBB0_13
; %bb.11:
	mov	w8, #33554432
	cmp	x9, x8
	b.gt	LBB0_19
; %bb.12:
	mov	w8, #3
	b	LBB0_15
LBB0_13:
	mov	w8, #134217728
	cmp	x9, x8
	b.gt	LBB0_20
; %bb.14:
	mov	w8, #4
LBB0_15:
	str	w8, [x19, #96]
	mov	w8, #2
	b	LBB0_22
LBB0_16:
Lloh15:
	adrp	x8, _OPT_PAGE512@GOTPAGE
Lloh16:
	ldr	x8, [x8, _OPT_PAGE512@GOTPAGEOFF]
Lloh17:
	adrp	x9, _OPT_AUTOINCR@GOTPAGE
Lloh18:
	ldr	x9, [x9, _OPT_AUTOINCR@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x19, #4]
	ldr	w9, [x19]
	cmp	w9, #8
	b.ne	LBB0_10
; %bb.17:
Lloh21:
	adrp	x9, _OPT_PAGE512_8BIT@GOTPAGE
Lloh22:
	ldr	x9, [x9, _OPT_PAGE512_8BIT@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w8, w9, w8
	b	LBB0_9
LBB0_18:
	str	x8, [sp]
Lloh24:
	adrp	x0, l_.str.1@PAGE
Lloh25:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_2
LBB0_19:
	mov	w8, #4
	b	LBB0_21
LBB0_20:
	mov	w8, #5
LBB0_21:
	str	w8, [x19, #96]
	mov	w8, #3
LBB0_22:
	str	w8, [x19, #100]
Lloh26:
	adrp	x23, _parts_num@GOTPAGE
Lloh27:
	ldr	x23, [x23, _parts_num@GOTPAGEOFF]
	ldr	w20, [x23]
	ldr	x0, [x19, #120]
	bl	_ARRAY_SIZE
	cmp	w20, w0
	b.le	LBB0_24
LBB0_23:
Lloh28:
	adrp	x0, l_.str.2@PAGE
Lloh29:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_44
LBB0_24:
	ldr	x21, [x19, #16]
	ldr	w26, [x23]
	cmp	w26, #1
	b.lt	LBB0_29
; %bb.25:
	mov	x24, #0
	mov	x20, #0
	mov	x22, #0
Lloh30:
	adrp	x25, _parts@GOTPAGE
Lloh31:
	ldr	x25, [x25, _parts@GOTPAGEOFF]
LBB0_26:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x25]
	ldr	x8, [x8, x20, lsl #3]
	ldrsw	x9, [x19, #40]
	mul	x26, x8, x9
	cmp	x26, #0
	ccmp	x21, x26, #8, ne
	b.lt	LBB0_43
; %bb.27:                               ;   in Loop: Header=BB0_26 Depth=1
	mov	x0, x20
	bl	_get_partition_name
	ldr	x8, [x19, #120]
	add	x8, x8, x24
	stp	x22, x0, [x8, #8]
	str	x26, [x8]
	add	x22, x26, x22
	sub	x21, x21, x26
	add	x20, x20, #1
	ldrsw	x26, [x23]
	add	x24, x24, #24
	cmp	x20, x26
	b.lt	LBB0_26
; %bb.28:
	str	w26, [x19, #8]
	cbnz	x21, LBB0_30
	b	LBB0_32
LBB0_29:
	mov	w20, #0
	mov	x22, #0
	str	w26, [x19, #8]
	cbz	x21, LBB0_32
LBB0_30:
	ldr	x0, [x19, #120]
	bl	_ARRAY_SIZE
	cmp	w26, w0
	b.ge	LBB0_23
; %bb.31:
	mov	x0, x20
	bl	_get_partition_name
	ldr	x8, [x19, #120]
	mov	w9, #24
	umaddl	x8, w20, w9, x8
	stp	x22, x0, [x8, #8]
	str	x21, [x8]
	ldr	w8, [x19, #8]
	add	w8, w8, #1
	str	w8, [x19, #8]
LBB0_32:
Lloh32:
	adrp	x8, _nand_flash_ids@GOTPAGE
Lloh33:
	ldr	x8, [x8, _nand_flash_ids@GOTPAGEOFF]
Lloh34:
	ldr	x8, [x8]
	ldr	x9, [x8, #16]
	cbz	x9, LBB0_38
; %bb.33:
Lloh35:
	adrp	x9, _second_id_byte@GOTPAGE
Lloh36:
	ldr	x9, [x9, _second_id_byte@GOTPAGEOFF]
Lloh37:
	ldr	x9, [x9]
Lloh38:
	adrp	x10, _NAND_NO_AUTOINCR@GOTPAGE
Lloh39:
	ldr	x10, [x10, _NAND_NO_AUTOINCR@GOTPAGEOFF]
Lloh40:
	ldr	w10, [x10]
Lloh41:
	adrp	x11, _OPT_AUTOINCR@GOTPAGE
Lloh42:
	ldr	x11, [x11, _OPT_AUTOINCR@GOTPAGEOFF]
Lloh43:
	ldr	w11, [x11]
	b	LBB0_35
LBB0_34:                                ;   in Loop: Header=BB0_35 Depth=1
	ldr	x12, [x8, #40]
	add	x8, x8, #24
	cbz	x12, LBB0_38
LBB0_35:                                ; =>This Inner Loop Header: Depth=1
	ldr	x12, [x8]
	cmp	x9, x12
	b.ne	LBB0_34
; %bb.36:                               ;   in Loop: Header=BB0_35 Depth=1
	ldr	w12, [x8, #8]
	tst	w10, w12
	b.ne	LBB0_34
; %bb.37:                               ;   in Loop: Header=BB0_35 Depth=1
	ldr	w12, [x19, #4]
	orr	w12, w12, w11
	str	w12, [x19, #4]
	b	LBB0_34
LBB0_38:
	ldr	w8, [x19]
	cmp	w8, #16
	b.ne	LBB0_40
; %bb.39:
Lloh44:
	adrp	x0, l_.str.4@PAGE
Lloh45:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_NS_WARN
LBB0_40:
	ldr	x8, [x19, #16]
	lsr	x1, x8, #20
Lloh46:
	adrp	x0, l_.str.5@PAGE
Lloh47:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_printk
	ldr	x1, [x19, #24]
Lloh48:
	adrp	x0, l_.str.6@PAGE
Lloh49:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_printk
	ldr	x1, [x19, #32]
Lloh50:
	adrp	x0, l_.str.7@PAGE
Lloh51:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_printk
	ldr	w8, [x19, #40]
	sbfx	x1, x8, #10, #22
Lloh52:
	adrp	x0, l_.str.8@PAGE
Lloh53:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_printk
	ldr	x1, [x19, #56]
Lloh54:
	adrp	x0, l_.str.9@PAGE
Lloh55:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_printk
	ldrsw	x1, [x19, #88]
Lloh56:
	adrp	x0, l_.str.10@PAGE
Lloh57:
	add	x0, x0, l_.str.10@PAGEOFF
	bl	_printk
	ldrsw	x1, [x19]
Lloh58:
	adrp	x0, l_.str.11@PAGE
Lloh59:
	add	x0, x0, l_.str.11@PAGEOFF
	bl	_printk
	ldr	x1, [x19, #64]
Lloh60:
	adrp	x0, l_.str.12@PAGE
Lloh61:
	add	x0, x0, l_.str.12@PAGEOFF
	bl	_printk
	ldr	x1, [x19, #72]
Lloh62:
	adrp	x0, l_.str.13@PAGE
Lloh63:
	add	x0, x0, l_.str.13@PAGEOFF
	bl	_printk
	ldr	x1, [x19, #80]
Lloh64:
	adrp	x0, l_.str.14@PAGE
Lloh65:
	add	x0, x0, l_.str.14@PAGEOFF
	bl	_printk
	ldr	x8, [x19, #104]
	lsr	x1, x8, #10
Lloh66:
	adrp	x0, l_.str.15@PAGE
Lloh67:
	add	x0, x0, l_.str.15@PAGEOFF
	bl	_printk
	ldrsw	x1, [x19, #96]
Lloh68:
	adrp	x0, l_.str.16@PAGE
Lloh69:
	add	x0, x0, l_.str.16@PAGEOFF
	bl	_printk
	ldrsw	x1, [x19, #100]
Lloh70:
	adrp	x0, l_.str.17@PAGE
Lloh71:
	add	x0, x0, l_.str.17@PAGEOFF
	bl	_printk
	ldrsw	x1, [x19, #4]
Lloh72:
	adrp	x0, l_.str.18@PAGE
Lloh73:
	add	x0, x0, l_.str.18@PAGEOFF
	bl	_printk
	mov	x0, x19
	bl	_alloc_device
	mov	x20, x0
	cbnz	w0, LBB0_46
; %bb.41:
	ldr	w0, [x19, #48]
Lloh74:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh75:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh76:
	ldr	w1, [x8]
	bl	_kmalloc
	str	w0, [x19, #112]
	ldr	x2, [x19, #48]
	cbz	w0, LBB0_48
; %bb.42:
	mov	w1, #255
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_memset
	mov	w20, #0
	b	LBB0_47
LBB0_43:
Lloh77:
	adrp	x0, l_.str.3@PAGE
Lloh78:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_44:
	bl	_NS_ERR
Lloh79:
	adrp	x8, _EINVAL@GOTPAGE
Lloh80:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_45:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_46:
	mov	x0, x19
	bl	_free_device
LBB0_47:
	mov	x0, x20
	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
	add	sp, sp, #96
	ret
LBB0_48:
	str	x2, [sp]
Lloh81:
	adrp	x0, l_.str.19@PAGE
Lloh82:
	add	x0, x0, l_.str.19@PAGEOFF
	bl	_NS_ERR
Lloh83:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh84:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_45
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh19
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpAdd	Lloh72, Lloh73
	.loh AdrpAdd	Lloh70, Lloh71
	.loh AdrpAdd	Lloh68, Lloh69
	.loh AdrpAdd	Lloh66, Lloh67
	.loh AdrpAdd	Lloh64, Lloh65
	.loh AdrpAdd	Lloh62, Lloh63
	.loh AdrpAdd	Lloh60, Lloh61
	.loh AdrpAdd	Lloh58, Lloh59
	.loh AdrpAdd	Lloh56, Lloh57
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpAdd	Lloh52, Lloh53
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh74, Lloh75, Lloh76
	.loh AdrpAdd	Lloh77, Lloh78
	.loh AdrpLdrGot	Lloh79, Lloh80
	.loh AdrpLdrGot	Lloh83, Lloh84
	.loh AdrpAdd	Lloh81, Lloh82
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"init_nandsim: nandsim is already initialized\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_NAND_BUSWIDTH_16,4,2           ; @NAND_BUSWIDTH_16
	.comm	_OPT_PAGE256,4,2                ; @OPT_PAGE256
	.comm	_OPT_PAGE512,4,2                ; @OPT_PAGE512
	.comm	_OPT_AUTOINCR,4,2               ; @OPT_AUTOINCR
	.comm	_OPT_PAGE512_8BIT,4,2           ; @OPT_PAGE512_8BIT
	.comm	_OPT_PAGE2048,4,2               ; @OPT_PAGE2048
l_.str.1:                               ; @.str.1
	.asciz	"init_nandsim: unknown page size %u\n"

	.comm	_OPT_SMALLPAGE,4,2              ; @OPT_SMALLPAGE
	.comm	_parts_num,4,2                  ; @parts_num
l_.str.2:                               ; @.str.2
	.asciz	"too many partitions.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_parts,8,3                      ; @parts
l_.str.3:                               ; @.str.3
	.asciz	"bad partition size.\n"

	.comm	_nand_flash_ids,8,3             ; @nand_flash_ids
	.comm	_second_id_byte,8,3             ; @second_id_byte
	.comm	_NAND_NO_AUTOINCR,4,2           ; @NAND_NO_AUTOINCR
l_.str.4:                               ; @.str.4
	.asciz	"16-bit flashes support wasn't tested\n"

l_.str.5:                               ; @.str.5
	.asciz	"flash size: %llu MiB\n"

l_.str.6:                               ; @.str.6
	.asciz	"page size: %u bytes\n"

l_.str.7:                               ; @.str.7
	.asciz	"OOB area size: %u bytes\n"

l_.str.8:                               ; @.str.8
	.asciz	"sector size: %u KiB\n"

l_.str.9:                               ; @.str.9
	.asciz	"pages number: %u\n"

l_.str.10:                              ; @.str.10
	.asciz	"pages per sector: %u\n"

l_.str.11:                              ; @.str.11
	.asciz	"bus width: %u\n"

l_.str.12:                              ; @.str.12
	.asciz	"bits in sector size: %u\n"

l_.str.13:                              ; @.str.13
	.asciz	"bits in page size: %u\n"

l_.str.14:                              ; @.str.14
	.asciz	"bits in OOB size: %u\n"

l_.str.15:                              ; @.str.15
	.asciz	"flash size with OOB: %llu KiB\n"

l_.str.16:                              ; @.str.16
	.asciz	"page address bytes: %u\n"

l_.str.17:                              ; @.str.17
	.asciz	"sector address bytes: %u\n"

l_.str.18:                              ; @.str.18
	.asciz	"options: %#x\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.19:                              ; @.str.19
	.asciz	"init_nandsim: unable to allocate %u bytes for the internal buffer\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_init_nandsim
.subsections_via_symbols
