	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_open_volume_nm             ## -- Begin function ubi_open_volume_nm
	.p2align	4, 0x90
_ubi_open_volume_nm:                    ## @ubi_open_volume_nm
	.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
	movl	%edx, %r12d
	movq	%rsi, %r15
	movl	%edi, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movq	%r15, %rdx
	movl	%r12d, %ecx
	callq	_dbg_gen
	testq	%r15, %r15
	je	LBB0_1
## %bb.3:
	movq	_UBI_VOL_NAME_MAX@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	incl	%esi
	movq	%r15, %rdi
	callq	_strnlen
	cmpl	(%r14), %eax
	jle	LBB0_4
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%edi, %edi
	subl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_4:
	testl	%ebx, %ebx
	js	LBB0_1
## %bb.5:
	movl	%eax, %r13d
	movq	_UBI_MAX_DEVICES@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jle	LBB0_1
## %bb.6:
	movl	%r12d, -48(%rbp)                ## 4-byte Spill
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edi
	callq	_ubi_get_device
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %r12
	movq	%rax, %rbx
	addq	$4, %rbx
	movq	%rbx, %rdi
	callq	_spin_lock
	movl	(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_15
## %bb.9:
	xorl	%r14d, %r14d
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_10 Depth=1
	incq	%r14
	movslq	%eax, %rcx
	cmpq	%rcx, %r14
	jge	LBB0_15
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rcx
	movq	(%rcx,%r14,8), %rcx
	testq	%rcx, %rcx
	je	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	(%rcx), %r13d
	jne	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	4(%rcx), %esi
	movq	%r15, %rdi
	callq	_strcmp
	testl	%eax, %eax
	je	LBB0_16
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	(%r12), %eax
	jmp	LBB0_14
LBB0_15:
	movq	%rbx, %rdi
	callq	_spin_unlock
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	callq	_ERR_PTR
LBB0_17:
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_ubi_put_device
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_16:
	movq	%rbx, %rdi
	callq	_spin_unlock
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%r14d, %esi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	callq	_ubi_open_volume
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"open device %d, volume %s, mode %d"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_UBI_VOL_NAME_MAX,4,2           ## @UBI_VOL_NAME_MAX
	.comm	_UBI_MAX_DEVICES,4,2            ## @UBI_MAX_DEVICES
	.comm	_ENODEV,4,2                     ## @ENODEV
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_open_volume_nm             ; -- Begin function ubi_open_volume_nm
	.p2align	2
_ubi_open_volume_nm:                    ; @ubi_open_volume_nm
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x2
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x21
	mov	x3, x19
	bl	_dbg_gen
	cbz	x21, LBB0_2
; %bb.1:
Lloh2:
	adrp	x22, _UBI_VOL_NAME_MAX@GOTPAGE
Lloh3:
	ldr	x22, [x22, _UBI_VOL_NAME_MAX@GOTPAGEOFF]
	ldr	w8, [x22]
	add	w1, w8, #1
	mov	x0, x21
	bl	_strnlen
	ldr	w8, [x22]
	cmp	w0, w8
	b.le	LBB0_4
LBB0_2:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_ERR_PTR
LBB0_4:
	tbnz	w20, #31, LBB0_2
; %bb.5:
Lloh6:
	adrp	x8, _UBI_MAX_DEVICES@GOTPAGE
Lloh7:
	ldr	x8, [x8, _UBI_MAX_DEVICES@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w20
	b.le	LBB0_2
; %bb.6:
	mov	x23, x0
	mov	x0, x20
	bl	_ubi_get_device
	cbz	x0, LBB0_16
; %bb.7:
	mov	x22, x0
	add	x24, x0, #4
	mov	x0, x24
	bl	_spin_lock
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.8:
	mov	x25, #0
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x25, x25, #1
	cmp	x25, w8, sxtw
	b.ge	LBB0_14
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x22, #8]
	ldr	x9, [x9, x25, lsl #3]
	cbz	x9, LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w10, [x9]
	cmp	w23, w10
	b.ne	LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w1, [x9, #4]
	mov	x0, x21
	bl	_strcmp
	cbz	w0, LBB0_17
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w8, [x22]
	b	LBB0_9
LBB0_14:
	mov	x0, x24
	bl	_spin_unlock
Lloh9:
	adrp	x8, _ENODEV@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	bl	_ERR_PTR
LBB0_15:
	mov	x19, x0
	mov	x0, x22
	bl	_ubi_put_device
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_16:
Lloh12:
	adrp	x8, _ENODEV@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_3
LBB0_17:
	mov	x0, x24
	bl	_spin_unlock
	mov	x0, x20
	mov	x1, x25
	mov	x2, x19
	bl	_ubi_open_volume
	b	LBB0_15
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"open device %d, volume %s, mode %d"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_UBI_VOL_NAME_MAX,4,2           ; @UBI_VOL_NAME_MAX
	.comm	_UBI_MAX_DEVICES,4,2            ; @UBI_MAX_DEVICES
	.comm	_ENODEV,4,2                     ; @ENODEV
.subsections_via_symbols
