	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtdblock_open
_mtdblock_open:                         ## @mtdblock_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	%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
	movq	8(%rdi), %r13
	movslq	(%rdi), %r15
	movq	_MTD_DEBUG_LEVEL1@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_DEBUG
	movq	_mtdblks_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	_mtdblks@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	(%rax,%r15,8), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	incl	(%rax)
	movq	_mtdblks_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	jmp	LBB0_8
LBB0_2:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$40, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %rbx
	movl	$1, (%rax)
	movq	%r13, 16(%rax)
	movq	%rax, %rdi
	addq	$36, %rdi
	callq	_mutex_init
	movq	_STATE_EMPTY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	16(%rbx), %rax
	movq	_MTD_NO_ERASE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	jne	LBB0_7
## %bb.5:
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%rax, 24(%rbx)
	movq	$0, 8(%rbx)
LBB0_7:
	movq	(%r12), %rax
	movq	%rbx, (%rax,%r15,8)
	movq	_mtdblks_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_DEBUG
LBB0_8:
	xorl	%eax, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_mtdblks_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_MTD_DEBUG_LEVEL1,4,2           ## @MTD_DEBUG_LEVEL1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mtdblock_open\n"

	.comm	_mtdblks_lock,4,2               ## @mtdblks_lock
	.comm	_mtdblks,8,3                    ## @mtdblks
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_STATE_EMPTY,4,2                ## @STATE_EMPTY
	.comm	_MTD_NO_ERASE,4,2               ## @MTD_NO_ERASE
L_.str.1:                               ## @.str.1
	.asciz	"ok\n"

	.no_dead_strip	_mtdblock_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtdblock_open
_mtdblock_open:                         ; @mtdblock_open
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	ldr	x23, [x0, #8]
	ldrsw	x21, [x0]
Lloh0:
	adrp	x20, _MTD_DEBUG_LEVEL1@GOTPAGE
Lloh1:
	ldr	x20, [x20, _MTD_DEBUG_LEVEL1@GOTPAGEOFF]
	ldr	w0, [x20]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_DEBUG
Lloh4:
	adrp	x0, _mtdblks_lock@GOTPAGE
Lloh5:
	ldr	x0, [x0, _mtdblks_lock@GOTPAGEOFF]
	bl	_mutex_lock
Lloh6:
	adrp	x22, _mtdblks@GOTPAGE
Lloh7:
	ldr	x22, [x22, _mtdblks@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	x8, [x8, x21, lsl #3]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
Lloh8:
	adrp	x0, _mtdblks_lock@GOTPAGE
Lloh9:
	ldr	x0, [x0, _mtdblks_lock@GOTPAGEOFF]
	bl	_mutex_unlock
	b	LBB0_7
LBB0_2:
Lloh10:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	w0, #40
	bl	_kzalloc
	cbz	x0, LBB0_9
; %bb.3:
	mov	x19, x0
	mov	w8, #1
	str	w8, [x0]
	str	x23, [x0, #16]
	add	x0, x0, #36
	bl	_mutex_init
Lloh13:
	adrp	x8, _STATE_EMPTY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _STATE_EMPTY@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	str	w8, [x19, #32]
	ldr	x8, [x19, #16]
	ldr	w9, [x8]
Lloh16:
	adrp	x10, _MTD_NO_ERASE@GOTPAGE
Lloh17:
	ldr	x10, [x10, _MTD_NO_ERASE@GOTPAGEOFF]
Lloh18:
	ldr	w10, [x10]
	tst	w10, w9
	b.ne	LBB0_6
; %bb.4:
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_6
; %bb.5:
	str	x8, [x19, #24]
	str	xzr, [x19, #8]
LBB0_6:
	ldr	x8, [x22]
	str	x19, [x8, x21, lsl #3]
Lloh19:
	adrp	x0, _mtdblks_lock@GOTPAGE
Lloh20:
	ldr	x0, [x0, _mtdblks_lock@GOTPAGEOFF]
	bl	_mutex_unlock
	ldr	w0, [x20]
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_DEBUG
LBB0_7:
	mov	w0, #0
LBB0_8:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_9:
Lloh23:
	adrp	x0, _mtdblks_lock@GOTPAGE
Lloh24:
	ldr	x0, [x0, _mtdblks_lock@GOTPAGEOFF]
	bl	_mutex_unlock
Lloh25:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_MTD_DEBUG_LEVEL1,4,2           ; @MTD_DEBUG_LEVEL1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mtdblock_open\n"

	.comm	_mtdblks_lock,4,2               ; @mtdblks_lock
	.comm	_mtdblks,8,3                    ; @mtdblks
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_STATE_EMPTY,4,2                ; @STATE_EMPTY
	.comm	_MTD_NO_ERASE,4,2               ; @MTD_NO_ERASE
l_.str.1:                               ; @.str.1
	.asciz	"ok\n"

	.no_dead_strip	_mtdblock_open
.subsections_via_symbols
