	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_eba_write_leb_st           ## -- Begin function ubi_eba_write_leb_st
	.p2align	4, 0x90
_ubi_eba_write_leb_st:                  ## @ubi_eba_write_leb_st
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $r9d killed $r9d def $r9
	cmpq	$0, 8(%rdi)
	je	LBB0_3
## %bb.1:
	movq	_EROFS@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_19
LBB0_3:
	movl	%r8d, %r12d
	movl	%edx, %r13d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	(%rsi), %r15d
	leal	-1(%r9), %eax
	movl	4(%rdi), %esi
	cmpl	%edx, %eax
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%r9, -96(%rbp)                  ## 8-byte Spill
	jne	LBB0_5
## %bb.4:
	movl	%r12d, %edi
	callq	_ALIGN
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	jmp	LBB0_6
LBB0_5:
	decl	%esi
	xorl	%edi, %edi
	testl	%r12d, %esi
	sete	%dil
	callq	_ubi_assert
	movl	%r12d, -48(%rbp)                ## 4-byte Spill
LBB0_6:
	movq	_GFP_NOFS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_ubi_alloc_vid_buf
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	movq	%rax, %rbx
	callq	_ubi_get_vid_hdr
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movl	%r13d, %edx
	callq	_leb_write_lock
	movl	%r15d, %r13d
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_18
## %bb.9:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_ubi_next_sqnum
	movl	%eax, %edi
	callq	_cpu_to_be64
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	%rax, (%rbx)
	movl	%r13d, %edi
	callq	_cpu_to_be32
	movq	%rax, 64(%rbx)
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_cpu_to_be32
	movq	%rax, 56(%rbx)
	movq	%r14, %rdi
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	movl	%r13d, %esi
	callq	_ubi_get_compat
	movl	%eax, 48(%rbx)
	movq	-88(%rbp), %r15                 ## 8-byte Reload
	movl	4(%r15), %edi
	callq	_cpu_to_be32
	movq	%rax, 40(%rbx)
	movq	_UBI_CRC32_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movl	%r12d, %edx
	callq	_crc32
	movl	%eax, %r13d
	movq	_UBI_VID_STATIC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movl	%r12d, %edi
	callq	_cpu_to_be32
	movq	%rax, 24(%rbx)
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_cpu_to_be32
	movq	%rax, 16(%rbx)
	movl	%r13d, %edi
	callq	_cpu_to_be32
	movq	%rax, 8(%rbx)
	movq	%r15, %r13
	movq	8(%r15), %rax
	movq	(%rax), %rax
	movslq	-44(%rbp), %rcx                 ## 4-byte Folded Reload
	movq	(%rax,%rcx,8), %rdi
	shrq	$63, %rdi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_ubi_assert
	movq	_UBI_IO_RETRIES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	js	LBB0_10
## %bb.11:
	movl	$-1, %r12d
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	xorl	%r8d, %r8d
	movl	-48(%rbp), %r9d                 ## 4-byte Reload
	callq	_try_write_vid_and_data
	movl	%eax, %r15d
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r15d, %eax
	jne	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	cmpl	$0, (%r14)
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	%r14, %rdi
	callq	_ubi_next_sqnum
	movl	%eax, %edi
	callq	_cpu_to_be64
	movq	%rax, (%rbx)
	movq	%r14, %rdi
	leaq	L_.str(%rip), %rsi
	callq	_ubi_msg
	incl	%r12d
	movq	_UBI_IO_RETRIES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jl	LBB0_12
LBB0_15:
	testl	%r15d, %r15d
	je	LBB0_10
## %bb.16:
	movq	%r14, %rdi
	callq	_ubi_ro_mode
	jmp	LBB0_17
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_10:
	xorl	%r15d, %r15d
LBB0_17:
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	%r14, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_leb_write_unlock
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
LBB0_18:
	movq	%rbx, %rdi
	callq	_ubi_free_vid_buf
LBB0_19:
	movl	%r15d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EROFS,4,2                      ## @EROFS
	.comm	_GFP_NOFS,4,2                   ## @GFP_NOFS
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_UBI_CRC32_INIT,4,2             ## @UBI_CRC32_INIT
	.comm	_UBI_VID_STATIC,4,2             ## @UBI_VID_STATIC
	.comm	_UBI_IO_RETRIES,4,2             ## @UBI_IO_RETRIES
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"try another PEB"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_eba_write_leb_st           ; -- Begin function ubi_eba_write_leb_st
	.p2align	2
_ubi_eba_write_leb_st:                  ; @ubi_eba_write_leb_st
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _EROFS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EROFS@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_19
LBB0_3:
	mov	x27, x5
	mov	x28, x4
	mov	x22, x3
	mov	x19, x2
	mov	x23, x1
	mov	x20, x0
	ldr	w21, [x1]
	sub	w8, w5, #1
	ldr	w1, [x0, #4]
	cmp	w8, w2
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x28
	bl	_ALIGN
	mov	x25, x0
	b	LBB0_6
LBB0_5:
	sub	w8, w1, #1
	tst	w8, w28
	cset	w0, eq
	bl	_ubi_assert
	mov	x25, x28
LBB0_6:
Lloh2:
	adrp	x8, _GFP_NOFS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_NOFS@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_ubi_alloc_vid_buf
	cbz	x0, LBB0_15
; %bb.7:
	mov	x24, x0
	str	w25, [sp, #12]                  ; 4-byte Folded Spill
	bl	_ubi_get_vid_hdr
	mov	x26, x0
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	bl	_leb_write_lock
	mov	x25, x21
	mov	x21, x0
	cbnz	w0, LBB0_18
; %bb.8:
	mov	x0, x20
	bl	_ubi_next_sqnum
	bl	_cpu_to_be64
	str	x0, [x26]
	mov	x0, x25
	bl	_cpu_to_be32
	str	x0, [x26, #64]
	mov	x0, x19
	bl	_cpu_to_be32
	str	x0, [x26, #56]
	mov	x0, x20
	str	w25, [sp, #8]                   ; 4-byte Folded Spill
	mov	x1, x25
	bl	_ubi_get_compat
	str	w0, [x26, #48]
	ldr	w0, [x23, #4]
	bl	_cpu_to_be32
	str	x0, [x26, #40]
Lloh5:
	adrp	x8, _UBI_CRC32_INIT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _UBI_CRC32_INIT@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	x1, x22
	mov	x2, x28
	bl	_crc32
	mov	x21, x0
Lloh8:
	adrp	x8, _UBI_VID_STATIC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _UBI_VID_STATIC@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [x26, #32]
	mov	x0, x28
	bl	_cpu_to_be32
	str	x0, [x26, #24]
	mov	x0, x27
	bl	_cpu_to_be32
	str	x0, [x26, #16]
	mov	x0, x21
	bl	_cpu_to_be32
	str	x0, [x26, #8]
	ldr	x8, [x23, #8]
	ldr	x8, [x8]
	ldr	x8, [x8, w19, sxtw #3]
	lsr	x0, x8, #63
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_ubi_assert
Lloh11:
	adrp	x28, _UBI_IO_RETRIES@GOTPAGE
Lloh12:
	ldr	x28, [x28, _UBI_IO_RETRIES@GOTPAGEOFF]
	ldr	w8, [x28]
	tbnz	w8, #31, LBB0_16
; %bb.9:
	mov	w27, #-1
	ldr	w25, [sp, #12]                  ; 4-byte Folded Reload
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	mov	x1, x19
	mov	x2, x24
	mov	x3, x22
	mov	w4, #0
	mov	x5, x25
	bl	_try_write_vid_and_data
	mov	x21, x0
Lloh13:
	adrp	x8, _EIO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w8, [x20]
	cbz	w8, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x20
	bl	_ubi_next_sqnum
	bl	_cpu_to_be64
	str	x0, [x26]
	mov	x0, x20
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	bl	_ubi_msg
	ldr	w8, [x28]
	add	w27, w27, #1
	cmp	w27, w8
	b.lt	LBB0_10
LBB0_13:
	cbz	w21, LBB0_17
; %bb.14:
	mov	x0, x20
	bl	_ubi_ro_mode
	b	LBB0_17
LBB0_15:
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_2
LBB0_16:
	mov	w21, #0
LBB0_17:
	mov	x0, x20
	ldr	w1, [sp, #8]                    ; 4-byte Folded Reload
	mov	x2, x19
	bl	_leb_write_unlock
LBB0_18:
	mov	x0, x24
	bl	_ubi_free_vid_buf
LBB0_19:
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_EROFS,4,2                      ; @EROFS
	.comm	_GFP_NOFS,4,2                   ; @GFP_NOFS
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_UBI_CRC32_INIT,4,2             ; @UBI_CRC32_INIT
	.comm	_UBI_VID_STATIC,4,2             ; @UBI_VID_STATIC
	.comm	_UBI_IO_RETRIES,4,2             ; @UBI_IO_RETRIES
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"try another PEB"

.subsections_via_symbols
