	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_leb_read_sg                ## -- Begin function ubi_leb_read_sg
	.p2align	4, 0x90
_ubi_leb_read_sg:                       ## @ubi_leb_read_sg
	.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, -48(%rbp)                 ## 4-byte Spill
	movl	%r8d, %r12d
	movl	%ecx, %r13d
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	24(%rax), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rdi
	movl	%r8d, %esi
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%r14d, %ecx
	movl	%r13d, %r8d
	callq	_dbg_gen
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%r13d, %edx
	movl	%r12d, %ecx
	callq	_leb_read_sanity_check
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	xorl	%r15d, %r15d
	testl	%r12d, %r12d
	je	LBB0_8
## %bb.3:
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rsp)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movl	%r14d, %ecx
	movl	%r13d, %r8d
	movl	%r12d, %r9d
	callq	_ubi_eba_read_leb_sg
	testl	%eax, %eax
	je	LBB0_8
## %bb.4:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_mtd_is_eccerr
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	8(%r14), %rax
	movq	_UBI_STATIC_VOLUME@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_ubi_warn
	movl	$1, 16(%r14)
LBB0_7:
	movl	%ebx, %r15d
	jmp	LBB0_8
LBB0_1:
	movl	%eax, %r15d
LBB0_8:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read %d bytes from LEB %d:%d:%d"

	.comm	_UBI_STATIC_VOLUME,8,3          ## @UBI_STATIC_VOLUME
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_sg                ; -- Begin function ubi_leb_read_sg
	.p2align	2
_ubi_leb_read_sg:                       ; @ubi_leb_read_sg
	.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, x5
	mov	x24, x4
	mov	x25, x3
	mov	x27, x2
	mov	x26, x1
	mov	x22, x0
	ldr	x19, [x0]
	ldr	x21, [x19, #24]
	ldr	w20, [x19]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x4
	mov	x2, x20
	mov	x3, x26
	mov	x4, x25
	bl	_dbg_gen
	mov	x0, x22
	mov	x1, x26
	mov	x2, x25
	mov	x3, x24
	bl	_leb_read_sanity_check
	tbnz	w0, #31, LBB0_6
; %bb.1:
	cbz	w24, LBB0_7
; %bb.2:
	mov	x0, x21
	mov	x1, x19
	mov	x2, x27
	mov	x3, x26
	mov	x4, x25
	mov	x5, x24
	mov	x6, x23
	bl	_ubi_eba_read_leb_sg
	mov	x22, x0
	cbz	w0, LBB0_8
; %bb.3:
	mov	x0, x22
	bl	_mtd_is_eccerr
	cbz	x0, LBB0_8
; %bb.4:
	ldr	x8, [x19, #8]
Lloh2:
	adrp	x9, _UBI_STATIC_VOLUME@GOTPAGE
Lloh3:
	ldr	x9, [x9, _UBI_STATIC_VOLUME@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.5:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	x2, x20
	bl	_ubi_warn
	mov	w8, #1
	str	w8, [x19, #16]
	b	LBB0_8
LBB0_6:
	mov	x22, x0
	b	LBB0_8
LBB0_7:
	mov	w22, #0
LBB0_8:
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read %d bytes from LEB %d:%d:%d"

	.comm	_UBI_STATIC_VOLUME,8,3          ; @UBI_STATIC_VOLUME
l_.str.1:                               ; @.str.1
	.asciz	"mark volume %d as corrupted"

.subsections_via_symbols
