	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtdchar_open
_mtdchar_open:                          ## @mtdchar_open
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	callq	_iminor
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	callq	_pr_debug
	movq	_FMODE_WRITE@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, (%r15)
	je	LBB0_3
## %bb.1:
	movl	%ebx, %eax
	andl	$1, %eax
	je	LBB0_3
## %bb.2:
	movq	_EACCES@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_3:
	sarl	%ebx
	movq	_mtd_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	xorl	%edi, %edi
	movl	%ebx, %esi
	callq	_get_mtd_device
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	%r14, %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_13
LBB0_5:
	movq	(%r14), %rax
	movq	_MTD_ABSENT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.6:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_7:
	movl	(%r12), %eax
	testl	%eax, (%r15)
	je	LBB0_10
## %bb.8:
	movq	_MTD_WRITEABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r14)
	je	LBB0_9
LBB0_10:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$8, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.15:
	movq	%r14, (%rax)
	movq	%rax, 8(%r15)
	movq	_mtd_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	xorl	%ebx, %ebx
	jmp	LBB0_14
LBB0_11:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_9:
	movq	_EACCES@GOTPCREL(%rip), %rax
LBB0_12:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_put_mtd_device
LBB0_13:
	movq	_mtd_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
LBB0_14:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MTD_open\n"

	.comm	_FMODE_WRITE,4,2                ## @FMODE_WRITE
	.comm	_EACCES,4,2                     ## @EACCES
	.comm	_mtd_mutex,4,2                  ## @mtd_mutex
	.comm	_MTD_ABSENT,8,3                 ## @MTD_ABSENT
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_MTD_WRITEABLE,4,2              ## @MTD_WRITEABLE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_mtdchar_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtdchar_open
_mtdchar_open:                          ; @mtdchar_open
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x1
	bl	_iminor
	mov	x20, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
Lloh2:
	adrp	x21, _FMODE_WRITE@GOTPAGE
Lloh3:
	ldr	x21, [x21, _FMODE_WRITE@GOTPAGEOFF]
	ldr	w8, [x19]
	ldr	w9, [x21]
	and	w8, w9, w8
	and	w9, w20, #0x1
	cmp	w8, #0
	ccmp	w9, #0, #4, ne
	b.ne	LBB0_3
; %bb.1:
	asr	w20, w20, #1
Lloh4:
	adrp	x0, _mtd_mutex@GOTPAGE
Lloh5:
	ldr	x0, [x0, _mtd_mutex@GOTPAGEOFF]
	bl	_mutex_lock
	mov	x0, #0
	mov	x1, x20
	bl	_get_mtd_device
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.2:
	mov	x0, x20
	bl	_PTR_ERR
	mov	x19, x0
	b	LBB0_13
LBB0_3:
Lloh6:
	adrp	x8, _EACCES@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_14
LBB0_4:
	ldr	x8, [x20]
Lloh9:
	adrp	x9, _MTD_ABSENT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MTD_ABSENT@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
Lloh12:
	adrp	x8, _ENODEV@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_12
LBB0_6:
	ldr	w8, [x19]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.7:
	ldr	w8, [x20, #8]
Lloh14:
	adrp	x9, _MTD_WRITEABLE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _MTD_WRITEABLE@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
LBB0_8:
Lloh17:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	w0, #8
	bl	_kzalloc
	cbz	x0, LBB0_10
; %bb.9:
	str	x20, [x0]
	str	x0, [x19, #8]
Lloh20:
	adrp	x0, _mtd_mutex@GOTPAGE
Lloh21:
	ldr	x0, [x0, _mtd_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	w19, #0
	b	LBB0_14
LBB0_10:
Lloh22:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh24:
	adrp	x8, _EACCES@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w19, w8
	mov	x0, x20
	bl	_put_mtd_device
LBB0_13:
Lloh26:
	adrp	x0, _mtd_mutex@GOTPAGE
Lloh27:
	ldr	x0, [x0, _mtd_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
LBB0_14:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MTD_open\n"

	.comm	_FMODE_WRITE,4,2                ; @FMODE_WRITE
	.comm	_EACCES,4,2                     ; @EACCES
	.comm	_mtd_mutex,4,2                  ; @mtd_mutex
	.comm	_MTD_ABSENT,8,3                 ; @MTD_ABSENT
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_MTD_WRITEABLE,4,2              ; @MTD_WRITEABLE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_mtdchar_open
.subsections_via_symbols
