	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function add_device
_add_device:                            ## @add_device
	.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, -48(%rbp)                 ## 8-byte Spill
	testq	%rdi, %rdi
	je	LBB0_28
## %bb.1:
	movl	%edx, %r13d
	movl	%esi, %r15d
	movq	_FMODE_READ@GOTPCREL(%rip), %rax
	movq	_FMODE_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%rax), %ebx
	movq	_FMODE_EXCL@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$96, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_28
## %bb.2:
	movq	%rax, %r12
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	movq	%rax, %rdx
	callq	_blkdev_get_by_path
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	movl	%r15d, -52(%rbp)                ## 4-byte Spill
	je	LBB0_13
## %bb.3:
	testl	%r13d, %r13d
	js	LBB0_13
## %bb.4:
	xorl	%eax, %eax
	callq	_wait_for_device_probe
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_name_to_dev_t
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %edi
	movl	%ebx, %esi
	movq	%r12, %rdx
	callq	_blkdev_get_by_dev
	movq	%rax, %r14
LBB0_6:
	movq	%r14, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_13
## %bb.7:
	testl	%r13d, %r13d
	je	LBB0_13
## %bb.8:
	movl	$1, %r15d
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_msleep
	xorl	%eax, %eax
	callq	_wait_for_device_probe
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_name_to_dev_t
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	%eax, %edi
	movl	%ebx, %esi
	movq	%r12, %rdx
	callq	_blkdev_get_by_dev
	movq	%rax, %r14
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%r14, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	leal	1(%r15), %eax
	cmpl	%r13d, %r15d
	movl	%eax, %r15d
	jl	LBB0_9
LBB0_13:
	movq	%r14, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:
	leaq	L_.str(%rip), %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_27
LBB0_15:
	movq	%r14, 88(%r12)
	movl	8(%r14), %edi
	callq	_MAJOR
	movq	_MTD_BLOCK_MAJOR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_18
## %bb.16:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_17
LBB0_18:
	movq	88(%r12), %rax
	movq	(%rax), %rax
	movslq	(%rax), %rax
	movl	-52(%rbp), %r14d                ## 4-byte Reload
	movslq	%r14d, %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_19
## %bb.20:
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	je	LBB0_23
LBB0_22:
	leaq	L_.str.2(%rip), %rdi
LBB0_17:
	xorl	%eax, %eax
	callq	_pr_err
LBB0_27:
	movq	%r12, %rdi
	callq	_block2mtd_free_device
LBB0_28:
	xorl	%r12d, %r12d
LBB0_29:
	movq	%r12, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r14d
                                        ## kill: def $edx killed $edx def $rdx
	testq	%rdx, %rdx
	jne	LBB0_22
LBB0_23:
	movq	%r12, %rdi
	callq	_mutex_init
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_kasprintf
	testq	%rax, %rax
	je	LBB0_26
## %bb.24:
	leaq	8(%r12), %rdi
	movq	%rax, 8(%r12)
	movq	88(%r12), %rax
	movq	(%rax), %rax
	movq	_PAGE_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rax), %ecx
	movl	%ecx, 16(%r12)
	movl	%r14d, 20(%r12)
	movl	$1, 24(%r12)
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 72(%r12)
	movq	_MTD_RAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 68(%r12)
	movq	_MTD_CAP_RAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 64(%r12)
	movq	_block2mtd_erase@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 60(%r12)
	movq	_block2mtd_write@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%r12)
	movq	_block2mtd_sync@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 52(%r12)
	movq	_block2mtd_read@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%r12)
	movq	%r12, 40(%r12)
	movq	_THIS_MODULE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r12)
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_mtd_device_register
	testq	%rax, %rax
	je	LBB0_25
LBB0_26:
	movq	%r12, %rdi
	callq	_mutex_destroy
	jmp	LBB0_27
LBB0_25:
	movq	%r12, %rdi
	addq	$80, %rdi
	movq	_blkmtd_device_list@GOTPCREL(%rip), %rsi
	callq	_list_add
	movl	28(%r12), %r14d
	movq	8(%r12), %r15
	leaq	L_.str.5(%rip), %rdi
	callq	_strlen
	movslq	%eax, %rdx
	addq	%r15, %rdx
	movl	20(%r12), %r8d
	movl	%r8d, %ecx
	sarl	$10, %ecx
	leaq	L_.str.4(%rip), %rdi
	movl	%r14d, %esi
	callq	_pr_info
	jmp	LBB0_29
	.cfi_endproc
                                        ## -- End function
	.comm	_FMODE_READ,4,2                 ## @FMODE_READ
	.comm	_FMODE_WRITE,4,2                ## @FMODE_WRITE
	.comm	_FMODE_EXCL,4,2                 ## @FMODE_EXCL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error: cannot open device %s\n"

	.comm	_MTD_BLOCK_MAJOR,8,3            ## @MTD_BLOCK_MAJOR
L_.str.1:                               ## @.str.1
	.asciz	"attempting to use an MTD device as a block device\n"

L_.str.2:                               ## @.str.2
	.asciz	"erasesize must be a divisor of device size\n"

L_.str.3:                               ## @.str.3
	.asciz	"block2mtd: %s"

	.comm	_PAGE_MASK,4,2                  ## @PAGE_MASK
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_MTD_RAM,4,2                    ## @MTD_RAM
	.comm	_MTD_CAP_RAM,4,2                ## @MTD_CAP_RAM
	.comm	_block2mtd_erase,4,2            ## @block2mtd_erase
	.comm	_block2mtd_write,4,2            ## @block2mtd_write
	.comm	_block2mtd_sync,4,2             ## @block2mtd_sync
	.comm	_block2mtd_read,4,2             ## @block2mtd_read
	.comm	_THIS_MODULE,4,2                ## @THIS_MODULE
	.comm	_blkmtd_device_list,4,2         ## @blkmtd_device_list
L_.str.4:                               ## @.str.4
	.asciz	"mtd%d: [%s] erase_size = %dKiB [%d]\n"

L_.str.5:                               ## @.str.5
	.asciz	"block2mtd: "

	.no_dead_strip	_add_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function add_device
_add_device:                            ; @add_device
	.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
	cbz	x0, LBB0_22
; %bb.1:
	mov	x22, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _FMODE_READ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FMODE_READ@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
Lloh3:
	adrp	x8, _FMODE_WRITE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FMODE_WRITE@GOTPAGEOFF]
Lloh5:
	ldr	w24, [x8]
Lloh6:
	adrp	x8, _FMODE_EXCL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FMODE_EXCL@GOTPAGEOFF]
Lloh8:
	ldr	w26, [x8]
Lloh9:
	adrp	x25, _GFP_KERNEL@GOTPAGE
Lloh10:
	ldr	x25, [x25, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	w0, #96
	bl	_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_23
; %bb.2:
	orr	w8, w24, w23
	orr	w23, w8, w26
	mov	x0, x21
	mov	x1, x23
	mov	x2, x19
	bl	_blkdev_get_by_path
	mov	x24, x0
	bl	_IS_ERR
	cbz	x0, LBB0_12
; %bb.3:
	tbnz	w22, #31, LBB0_12
; %bb.4:
	bl	_wait_for_device_probe
	mov	x0, x21
	bl	_name_to_dev_t
	cbz	w0, LBB0_6
; %bb.5:
	mov	x1, x23
	mov	x2, x19
	bl	_blkdev_get_by_dev
	mov	x24, x0
LBB0_6:
	mov	x0, x24
	bl	_IS_ERR
	cmp	x0, #0
	ccmp	w22, #0, #4, ne
	b.eq	LBB0_12
; %bb.7:
	mov	w26, #1
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #1000
	bl	_msleep
	bl	_wait_for_device_probe
	mov	x0, x21
	bl	_name_to_dev_t
	cbz	w0, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x1, x23
	mov	x2, x19
	bl	_blkdev_get_by_dev
	mov	x24, x0
LBB0_10:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x24
	bl	_IS_ERR
	cbz	x0, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	add	w8, w26, #1
	cmp	w26, w22
	mov	x26, x8
	b.lt	LBB0_8
LBB0_12:
	mov	x0, x24
	bl	_IS_ERR
	cbz	x0, LBB0_14
; %bb.13:
	str	x21, [sp]
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	b	LBB0_21
LBB0_14:
	str	x24, [x19, #88]
	ldr	w0, [x24, #8]
	bl	_MAJOR
Lloh13:
	adrp	x8, _MTD_BLOCK_MAJOR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MTD_BLOCK_MAJOR@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_16
; %bb.15:
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
	b	LBB0_21
LBB0_16:
	ldr	x8, [x19, #88]
	ldr	x8, [x8]
	ldrsw	x8, [x8]
	sxtw	x9, w20
	sdiv	x10, x8, x9
	msub	x8, x10, x9, x8
	cbz	x8, LBB0_18
; %bb.17:
Lloh18:
	adrp	x0, l_.str.2@PAGE
Lloh19:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_err
	b	LBB0_21
LBB0_18:
	mov	x0, x19
	bl	_mutex_init
	ldr	w0, [x25]
Lloh20:
	adrp	x1, l_.str.3@PAGE
Lloh21:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, x21
	bl	_kasprintf
	cbz	x0, LBB0_20
; %bb.19:
	mov	x8, x19
	str	x0, [x8, #8]!
	ldr	x9, [x19, #88]
	ldr	x9, [x9]
	ldr	w9, [x9]
Lloh22:
	adrp	x10, _PAGE_MASK@GOTPAGE
Lloh23:
	ldr	x10, [x10, _PAGE_MASK@GOTPAGEOFF]
Lloh24:
	ldr	w10, [x10]
	and	w9, w10, w9
	stp	w9, w20, [x19, #16]
	mov	w9, #1
	str	w9, [x19, #24]
Lloh25:
	adrp	x9, _PAGE_SIZE@GOTPAGE
Lloh26:
	ldr	x9, [x9, _PAGE_SIZE@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	str	w9, [x19, #72]
Lloh28:
	adrp	x9, _MTD_RAM@GOTPAGE
Lloh29:
	ldr	x9, [x9, _MTD_RAM@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
Lloh31:
	adrp	x10, _MTD_CAP_RAM@GOTPAGE
Lloh32:
	ldr	x10, [x10, _MTD_CAP_RAM@GOTPAGEOFF]
Lloh33:
	ldr	w10, [x10]
	stp	w10, w9, [x19, #64]
Lloh34:
	adrp	x9, _block2mtd_erase@GOTPAGE
Lloh35:
	ldr	x9, [x9, _block2mtd_erase@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
Lloh37:
	adrp	x10, _block2mtd_write@GOTPAGE
Lloh38:
	ldr	x10, [x10, _block2mtd_write@GOTPAGEOFF]
Lloh39:
	ldr	w10, [x10]
Lloh40:
	adrp	x11, _block2mtd_sync@GOTPAGE
Lloh41:
	ldr	x11, [x11, _block2mtd_sync@GOTPAGEOFF]
	stp	w10, w9, [x19, #56]
Lloh42:
	ldr	w9, [x11]
Lloh43:
	adrp	x10, _block2mtd_read@GOTPAGE
Lloh44:
	ldr	x10, [x10, _block2mtd_read@GOTPAGEOFF]
Lloh45:
	ldr	w10, [x10]
	stp	w10, w9, [x19, #48]
	str	x19, [x19, #40]
Lloh46:
	adrp	x9, _THIS_MODULE@GOTPAGE
Lloh47:
	ldr	x9, [x9, _THIS_MODULE@GOTPAGEOFF]
Lloh48:
	ldr	w9, [x9]
	str	w9, [x19, #32]
	mov	x0, x8
	mov	x1, #0
	mov	w2, #0
	bl	_mtd_device_register
	cbz	x0, LBB0_24
LBB0_20:
	mov	x0, x19
	bl	_mutex_destroy
LBB0_21:
	mov	x0, x19
	bl	_block2mtd_free_device
LBB0_22:
	mov	x19, #0
LBB0_23:
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_24:
	add	x0, x19, #80
Lloh49:
	adrp	x1, _blkmtd_device_list@GOTPAGE
Lloh50:
	ldr	x1, [x1, _blkmtd_device_list@GOTPAGEOFF]
	bl	_list_add
	ldr	w20, [x19, #28]
	ldr	x21, [x19, #8]
Lloh51:
	adrp	x0, l_.str.5@PAGE
Lloh52:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_strlen
	add	x2, x21, w0, sxtw
	ldr	w4, [x19, #20]
	asr	w3, w4, #10
Lloh53:
	adrp	x0, l_.str.4@PAGE
Lloh54:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x20
	bl	_pr_info
	b	LBB0_23
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh53, Lloh54
	.loh AdrpAdd	Lloh51, Lloh52
	.loh AdrpLdrGot	Lloh49, Lloh50
	.cfi_endproc
                                        ; -- End function
	.comm	_FMODE_READ,4,2                 ; @FMODE_READ
	.comm	_FMODE_WRITE,4,2                ; @FMODE_WRITE
	.comm	_FMODE_EXCL,4,2                 ; @FMODE_EXCL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error: cannot open device %s\n"

	.comm	_MTD_BLOCK_MAJOR,8,3            ; @MTD_BLOCK_MAJOR
l_.str.1:                               ; @.str.1
	.asciz	"attempting to use an MTD device as a block device\n"

l_.str.2:                               ; @.str.2
	.asciz	"erasesize must be a divisor of device size\n"

l_.str.3:                               ; @.str.3
	.asciz	"block2mtd: %s"

	.comm	_PAGE_MASK,4,2                  ; @PAGE_MASK
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_MTD_RAM,4,2                    ; @MTD_RAM
	.comm	_MTD_CAP_RAM,4,2                ; @MTD_CAP_RAM
	.comm	_block2mtd_erase,4,2            ; @block2mtd_erase
	.comm	_block2mtd_write,4,2            ; @block2mtd_write
	.comm	_block2mtd_sync,4,2             ; @block2mtd_sync
	.comm	_block2mtd_read,4,2             ; @block2mtd_read
	.comm	_THIS_MODULE,4,2                ; @THIS_MODULE
	.comm	_blkmtd_device_list,4,2         ; @blkmtd_device_list
l_.str.4:                               ; @.str.4
	.asciz	"mtd%d: [%s] erase_size = %dKiB [%d]\n"

l_.str.5:                               ; @.str.5
	.asciz	"block2mtd: "

	.no_dead_strip	_add_device
.subsections_via_symbols
