	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_leb_read                   ## -- Begin function ubi_leb_read
	.p2align	4, 0x90
_ubi_leb_read:                          ## @ubi_leb_read
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -44(%rbp)                 ## 4-byte Spill
	movl	%r8d, %r15d
	movl	%ecx, %r12d
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movl	%esi, %r13d
	movq	(%rdi), %r14
	movq	40(%r14), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	(%r14), %ebx
	leaq	L_.str(%rip), %rdi
	movl	%r8d, %esi
	movl	%ebx, %edx
	movl	%r13d, %ecx
	movl	%r12d, %r8d
	callq	_dbg_gen
	testl	%ebx, %ebx
	js	LBB0_6
## %bb.1:
	testl	%r13d, %r13d
	js	LBB0_6
## %bb.2:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpl	(%rax), %ebx
	jge	LBB0_6
## %bb.3:
	movl	%r15d, %eax
	orl	%r12d, %eax
	js	LBB0_6
## %bb.4:
	movl	4(%r14), %eax
	cmpl	%r13d, %eax
	jle	LBB0_6
## %bb.5:
	leal	(%r15,%r12), %ecx
	cmpl	8(%r14), %ecx
	jle	LBB0_8
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_7:
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_19:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	16(%r14), %rdx
	movq	_UBI_STATIC_VOLUME@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	jne	LBB0_11
## %bb.9:
	decl	%eax
	cmpl	%r13d, %eax
	jne	LBB0_11
## %bb.10:
	cmpl	24(%r14), %ecx
	jg	LBB0_6
LBB0_11:
	cmpq	$0, 32(%r14)
	je	LBB0_13
## %bb.12:
	movq	_EBADF@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_13:
	movq	%r15, %r9
	xorl	%r15d, %r15d
	testl	%r9d, %r9d
	je	LBB0_19
## %bb.14:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rsp)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movl	%r13d, %edx
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%r12d, %r8d
                                        ## kill: def $r9d killed $r9d killed $r9
	callq	_ubi_eba_read_leb
	testl	%eax, %eax
	je	LBB0_19
## %bb.15:
	movl	%eax, %r12d
	movq	_EBADMSG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r12d, %eax
	jne	LBB0_18
## %bb.16:
	movq	16(%r14), %rax
	movq	_UBI_STATIC_VOLUME@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_18
## %bb.17:
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	callq	_ubi_warn
	movl	$1, 28(%r14)
LBB0_18:
	movl	%r12d, %r15d
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read %d bytes from LEB %d:%d:%d"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_UBI_STATIC_VOLUME,8,3          ## @UBI_STATIC_VOLUME
	.comm	_EBADF,4,2                      ## @EBADF
	.comm	_EBADMSG,4,2                    ## @EBADMSG
L_.str.1:                               ## @.str.1
	.asciz	"mark volume %d as corrupted"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_leb_read                   ; -- Begin function ubi_leb_read
	.p2align	2
_ubi_leb_read:                          ; @ubi_leb_read
	.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	x21, x5
	mov	x22, x4
	mov	x23, x3
	mov	x24, x2
	mov	x25, x1
	ldr	x19, [x0]
	ldr	x26, [x19, #40]
	ldr	w20, [x19]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x4
	mov	x2, x20
	mov	x3, x25
	mov	x4, x23
	bl	_dbg_gen
	tbnz	w20, #31, LBB0_6
; %bb.1:
	tbnz	w25, #31, LBB0_6
; %bb.2:
	ldr	w8, [x26]
	cmp	w20, w8
	b.ge	LBB0_6
; %bb.3:
	orr	w8, w22, w23
	tbnz	w8, #31, LBB0_6
; %bb.4:
	ldr	w9, [x19, #4]
	cmp	w9, w25
	b.le	LBB0_6
; %bb.5:
	ldr	w10, [x19, #8]
	add	w8, w22, w23
	cmp	w8, w10
	b.le	LBB0_9
LBB0_6:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_8:
	mov	x0, x21
	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_9:
	ldr	x10, [x19, #16]
Lloh4:
	adrp	x27, _UBI_STATIC_VOLUME@GOTPAGE
Lloh5:
	ldr	x27, [x27, _UBI_STATIC_VOLUME@GOTPAGEOFF]
	ldr	x11, [x27]
	sub	w9, w9, #1
	cmp	x10, x11
	ccmp	w9, w25, #0, eq
	b.ne	LBB0_11
; %bb.10:
	ldr	w9, [x19, #24]
	cmp	w8, w9
	b.gt	LBB0_6
LBB0_11:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_13
; %bb.12:
Lloh6:
	adrp	x8, _EBADF@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EBADF@GOTPAGEOFF]
	b	LBB0_7
LBB0_13:
	cbz	w22, LBB0_18
; %bb.14:
	mov	x0, x26
	mov	x1, x19
	mov	x2, x25
	mov	x3, x24
	mov	x4, x23
	mov	x5, x22
	mov	x6, x21
	bl	_ubi_eba_read_leb
	mov	x21, x0
	cbz	w0, LBB0_8
; %bb.15:
Lloh8:
	adrp	x8, _EBADMSG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EBADMSG@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmn	w21, w8
	b.ne	LBB0_8
; %bb.16:
	ldr	x8, [x19, #16]
	ldr	x9, [x27]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.17:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_ubi_warn
	mov	w8, #1
	str	w8, [x19, #28]
	b	LBB0_8
LBB0_18:
	mov	w21, #0
	b	LBB0_8
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read %d bytes from LEB %d:%d:%d"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_UBI_STATIC_VOLUME,8,3          ; @UBI_STATIC_VOLUME
	.comm	_EBADF,4,2                      ; @EBADF
	.comm	_EBADMSG,4,2                    ; @EBADMSG
l_.str.1:                               ; @.str.1
	.asciz	"mark volume %d as corrupted"

.subsections_via_symbols
