	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_leb_map                    ## -- Begin function ubi_leb_map
	.p2align	4, 0x90
_ubi_leb_map:                           ## @ubi_leb_map
	.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
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	8(%rdi), %r12
	movq	24(%r12), %r15
	movl	16(%r12), %esi
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %edx
	callq	_dbg_gen
	movq	(%rbx), %rax
	movq	_UBI_READONLY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_2
## %bb.1:
	movq	(%r12), %rax
	movq	_UBI_STATIC_VOLUME@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
LBB0_2:
	movq	_EROFS@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_ubi_leb_valid
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	cmpq	$0, 8(%r12)
	je	LBB0_8
## %bb.7:
	movq	_EBADF@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_8:
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_ubi_eba_is_mapped
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	_EBADMSG@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_10:
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	%r14d, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ubi_eba_write_leb              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"map LEB %d:%d"

	.comm	_UBI_READONLY,8,3               ## @UBI_READONLY
	.comm	_UBI_STATIC_VOLUME,8,3          ## @UBI_STATIC_VOLUME
	.comm	_EROFS,4,2                      ## @EROFS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EBADF,4,2                      ## @EBADF
	.comm	_EBADMSG,4,2                    ## @EBADMSG
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_leb_map                    ; -- Begin function ubi_leb_map
	.p2align	2
_ubi_leb_map:                           ; @ubi_leb_map
	.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
	mov	x22, x0
	ldr	x20, [x0, #8]
	ldr	x21, [x20, #24]
	ldr	w1, [x20, #16]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x19
	bl	_dbg_gen
	ldr	x8, [x22]
Lloh2:
	adrp	x9, _UBI_READONLY@GOTPAGE
Lloh3:
	ldr	x9, [x9, _UBI_READONLY@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_2
; %bb.1:
	ldr	x8, [x20]
Lloh5:
	adrp	x9, _UBI_STATIC_VOLUME@GOTPAGE
Lloh6:
	ldr	x9, [x9, _UBI_STATIC_VOLUME@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
LBB0_2:
Lloh8:
	adrp	x8, _EROFS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EROFS@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w0, w8
	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
LBB0_4:
	mov	x0, x20
	mov	x1, x19
	bl	_ubi_leb_valid
	cbz	w0, LBB0_7
; %bb.5:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_8
; %bb.6:
Lloh10:
	adrp	x8, _EBADF@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EBADF@GOTPAGEOFF]
	b	LBB0_3
LBB0_7:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_3
LBB0_8:
	mov	x0, x20
	mov	x1, x19
	bl	_ubi_eba_is_mapped
	cbz	x0, LBB0_10
; %bb.9:
Lloh14:
	adrp	x8, _EBADMSG@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EBADMSG@GOTPAGEOFF]
	b	LBB0_3
LBB0_10:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	mov	x3, #0
	mov	w4, #0
	mov	w5, #0
	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
	b	_ubi_eba_write_leb
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"map LEB %d:%d"

	.comm	_UBI_READONLY,8,3               ; @UBI_READONLY
	.comm	_UBI_STATIC_VOLUME,8,3          ; @UBI_STATIC_VOLUME
	.comm	_EROFS,4,2                      ; @EROFS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EBADF,4,2                      ; @EBADF
	.comm	_EBADMSG,4,2                    ; @EBADMSG
.subsections_via_symbols
