	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_open_volume                ## -- Begin function ubi_open_volume
	.p2align	4, 0x90
_ubi_open_volume:                       ## @ubi_open_volume
	.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
	movl	%edx, %r12d
	movl	%esi, %r15d
	movl	%edi, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movl	%r15d, %edx
	movl	%r12d, %ecx
	callq	_dbg_gen
	testl	%ebx, %ebx
	js	LBB0_2
## %bb.1:
	movq	_UBI_MAX_DEVICES@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jle	LBB0_2
## %bb.5:
	leal	-128(%r12), %eax
	cmpl	$3, %eax
	jae	LBB0_2
## %bb.6:
	movl	%ebx, %edi
	callq	_ubi_get_device
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %r13
	movq	%rax, %rdi
	testl	%r15d, %r15d
	js	LBB0_10
## %bb.9:
	cmpl	%r15d, (%rdi)
	jle	LBB0_10
## %bb.11:
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_12
## %bb.13:
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	movq	_THIS_MODULE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_try_module_get
	testl	%eax, %eax
	je	LBB0_35
## %bb.14:
	leaq	4(%r13), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_spin_lock
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rax), %rax
	movl	%r15d, %ecx
	movq	(%rax,%rcx,8), %rcx
	testq	%rcx, %rcx
	je	LBB0_34
## %bb.15:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	cmpl	$128, %r12d
	je	LBB0_20
## %bb.16:
	cmpl	$130, %r12d
	je	LBB0_23
## %bb.17:
	cmpl	$129, %r12d
	jne	LBB0_27
## %bb.18:
	cmpl	$0, (%rcx)
	jne	LBB0_34
## %bb.19:
	incl	4(%rcx)
	jmp	LBB0_27
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%edi, %edi
	subl	(%rax), %edi
LBB0_4:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_10:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_37
LBB0_7:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_12:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_36
LBB0_20:
	cmpl	$0, (%rcx)
	jne	LBB0_34
## %bb.21:
	movl	8(%rcx), %eax
	testl	%eax, %eax
	jg	LBB0_34
## %bb.22:
	incl	%eax
	movl	%eax, 8(%rcx)
	jmp	LBB0_27
LBB0_23:
	cmpl	$0, (%rcx)
	jne	LBB0_34
## %bb.24:
	cmpl	$0, 8(%rcx)
	jne	LBB0_34
## %bb.25:
	cmpl	$0, 4(%rcx)
	je	LBB0_26
LBB0_34:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
	movq	_THIS_MODULE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_module_put
LBB0_35:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfree
LBB0_36:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_37:
	callq	_ubi_put_device
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	movl	%r15d, %edx
	movl	%r14d, %ecx
	callq	_dbg_err
	movl	%r14d, %edi
	jmp	LBB0_4
LBB0_26:
	movl	$1, (%rcx)
LBB0_27:
	leaq	24(%rcx), %rdi
	movq	%rcx, %r14
	callq	_get_device
	incl	12(%r14)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%r14, 8(%rbx)
	movl	%r12d, (%rbx)
	addq	$8, %r13
	movq	%r13, %rdi
	callq	_mutex_lock
	movq	%r14, %rax
	cmpl	$0, 16(%r14)
	jne	LBB0_33
## %bb.28:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %esi
	callq	_ubi_check_volume
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_29
## %bb.30:
	cmpl	$1, %r12d
	jne	LBB0_32
## %bb.31:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	12(%rax), %edx
	leaq	L_.str.1(%rip), %rdi
	movl	%r15d, %esi
	callq	_ubi_warn
	movl	$1, 20(%r14)
LBB0_32:
	movl	$1, 16(%r14)
LBB0_33:
	movq	%r13, %rdi
	callq	_mutex_unlock
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_29:
	movq	%r13, %rdi
	callq	_mutex_unlock
	movq	%rbx, %rdi
	callq	_ubi_close_volume
	movl	%r12d, %edi
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"open device %d, volume %d, mode %d"

	.comm	_UBI_MAX_DEVICES,4,2            ## @UBI_MAX_DEVICES
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_THIS_MODULE,4,2                ## @THIS_MODULE
	.comm	_EBUSY,4,2                      ## @EBUSY
L_.str.1:                               ## @.str.1
	.asciz	"volume %d on UBI device %d is corrupted"

L_.str.2:                               ## @.str.2
	.asciz	"cannot open device %d, volume %d, error %d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_open_volume                ; -- Begin function ubi_open_volume
	.p2align	2
_ubi_open_volume:                       ; @ubi_open_volume
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x2
	mov	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	mov	x2, x19
	mov	x3, x23
	bl	_dbg_gen
	tbnz	w21, #31, LBB0_14
; %bb.1:
Lloh2:
	adrp	x8, _UBI_MAX_DEVICES@GOTPAGE
Lloh3:
	ldr	x8, [x8, _UBI_MAX_DEVICES@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w8, w21
	b.le	LBB0_14
; %bb.2:
	sub	w8, w23, #128
	cmp	w8, #3
	b.hs	LBB0_14
; %bb.3:
	mov	x0, x21
	bl	_ubi_get_device
	cbz	x0, LBB0_20
; %bb.4:
	mov	x20, x0
	tbnz	w19, #31, LBB0_17
; %bb.5:
	ldr	w8, [x20]
	cmp	w8, w19
	b.le	LBB0_17
; %bb.6:
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kmalloc
	cbz	x0, LBB0_21
; %bb.7:
	mov	x22, x0
Lloh8:
	adrp	x8, _ENODEV@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w24, w8
Lloh11:
	adrp	x27, _THIS_MODULE@GOTPAGE
Lloh12:
	ldr	x27, [x27, _THIS_MODULE@GOTPAGEOFF]
	ldr	w0, [x27]
	bl	_try_module_get
	cbz	w0, LBB0_29
; %bb.8:
	add	x25, x20, #4
	mov	x0, x25
	bl	_spin_lock
	ldr	x8, [x20, #16]
	ldr	x26, [x8, w19, uxtw #3]
	cbz	x26, LBB0_28
; %bb.9:
Lloh13:
	adrp	x8, _EBUSY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w24, w8
	cmp	w23, #128
	b.eq	LBB0_22
; %bb.10:
	cmp	w23, #130
	b.eq	LBB0_25
; %bb.11:
	cmp	w23, #129
	b.ne	LBB0_31
; %bb.12:
	ldr	w8, [x26]
	cbnz	w8, LBB0_28
; %bb.13:
	ldr	w8, [x26, #4]
	add	w8, w8, #1
	str	w8, [x26, #4]
	b	LBB0_31
LBB0_14:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_16:
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_ERR_PTR
LBB0_17:
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_18:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_19:
	mov	x0, x20
	bl	_ubi_put_device
Lloh20:
	adrp	x0, l_.str.2@PAGE
Lloh21:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x21
	mov	x2, x19
	mov	x3, x24
	bl	_dbg_err
	mov	x0, x24
	b	LBB0_16
LBB0_20:
Lloh22:
	adrp	x8, _ENODEV@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_15
LBB0_21:
Lloh24:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_18
LBB0_22:
	ldr	w8, [x26]
	cbnz	w8, LBB0_28
; %bb.23:
	ldr	w8, [x26, #8]
	cmp	w8, #0
	b.gt	LBB0_28
; %bb.24:
	add	w8, w8, #1
	str	w8, [x26, #8]
	b	LBB0_31
LBB0_25:
	ldr	w8, [x26]
	cbnz	w8, LBB0_28
; %bb.26:
	ldr	w8, [x26, #8]
	cbnz	w8, LBB0_28
; %bb.27:
	ldr	w8, [x26, #4]
	cbz	w8, LBB0_30
LBB0_28:
	mov	x0, x25
	bl	_spin_unlock
	ldr	w0, [x27]
	bl	_module_put
LBB0_29:
	mov	x0, x22
	bl	_kfree
	b	LBB0_19
LBB0_30:
	mov	w8, #1
	str	w8, [x26]
LBB0_31:
	add	x0, x26, #24
	bl	_get_device
	ldr	w8, [x26, #12]
	add	w8, w8, #1
	str	w8, [x26, #12]
	mov	x0, x25
	bl	_spin_unlock
	str	x26, [x22, #8]
	str	w23, [x22]
	add	x21, x20, #8
	mov	x0, x21
	bl	_mutex_lock
	ldr	w8, [x26, #16]
	cbnz	w8, LBB0_36
; %bb.32:
	mov	x0, x20
	mov	x1, x19
	bl	_ubi_check_volume
	mov	x23, x0
	tbnz	w0, #31, LBB0_37
; %bb.33:
	cmp	w23, #1
	b.ne	LBB0_35
; %bb.34:
	ldr	w2, [x20, #12]
Lloh26:
	adrp	x0, l_.str.1@PAGE
Lloh27:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_ubi_warn
	mov	w8, #1
	str	w8, [x26, #20]
LBB0_35:
	mov	w8, #1
	str	w8, [x26, #16]
LBB0_36:
	mov	x0, x21
	bl	_mutex_unlock
	mov	x0, x22
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_37:
	mov	x0, x21
	bl	_mutex_unlock
	mov	x0, x22
	bl	_ubi_close_volume
	mov	x0, x23
	b	LBB0_16
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"open device %d, volume %d, mode %d"

	.comm	_UBI_MAX_DEVICES,4,2            ; @UBI_MAX_DEVICES
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_THIS_MODULE,4,2                ; @THIS_MODULE
	.comm	_EBUSY,4,2                      ; @EBUSY
l_.str.1:                               ; @.str.1
	.asciz	"volume %d on UBI device %d is corrupted"

l_.str.2:                               ; @.str.2
	.asciz	"cannot open device %d, volume %d, error %d"

.subsections_via_symbols
