	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_eba_atomic_leb_change      ## -- Begin function ubi_eba_atomic_leb_change
	.p2align	4, 0x90
_ubi_eba_atomic_leb_change:             ## @ubi_eba_atomic_leb_change
	.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
	cmpq	$0, 8(%rdi)
	je	LBB0_3
## %bb.1:
	movq	_EROFS@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_21:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	%r8d, %r13d
	movl	%edx, %r14d
	movq	%rsi, %r15
	movq	%rdi, %rbx
	testl	%r8d, %r8d
	je	LBB0_4
## %bb.6:
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movl	(%r15), %r12d
	movq	_GFP_NOFS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ubi_alloc_vid_buf
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %rdi
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	callq	_ubi_get_vid_hdr
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movl	%r14d, %edx
	callq	_leb_write_lock
	movl	%r12d, %ecx
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_20
## %bb.9:
	movq	%rbx, %rdi
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	callq	_ubi_next_sqnum
	movl	%eax, %edi
	callq	_cpu_to_be64
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%rax, 8(%r12)
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	callq	_cpu_to_be32
	movq	%rax, 64(%r12)
	movl	%r14d, %edi
	callq	_cpu_to_be32
	movq	%rax, 56(%r12)
	movq	%rbx, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_ubi_get_compat
	movl	%eax, 48(%r12)
	movl	4(%r15), %edi
	callq	_cpu_to_be32
	movq	%rax, 40(%r12)
	movq	_UBI_CRC32_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%r13d, %edx
	callq	_crc32
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_UBI_VID_DYNAMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r12)
	movl	%r13d, %edi
	callq	_cpu_to_be32
	movq	%rax, 24(%r12)
	movl	$1, (%r12)
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_cpu_to_be32
	movq	%rax, 16(%r12)
	leaq	L_.str(%rip), %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	%r14d, %edx
	callq	_dbg_eba
	movq	_UBI_IO_RETRIES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	js	LBB0_10
## %bb.11:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movl	$-1, %r14d
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	xorl	%r8d, %r8d
	movl	%r13d, %r9d
	callq	_try_write_vid_and_data
	movl	%eax, %r12d
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r12d, %eax
	jne	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	cmpl	$0, 4(%rbx)
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	%rbx, %rdi
	callq	_ubi_next_sqnum
	movl	%eax, %edi
	callq	_cpu_to_be64
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, 8(%rcx)
	movq	%rbx, %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_ubi_msg
	incl	%r14d
	movq	_UBI_IO_RETRIES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jl	LBB0_12
LBB0_15:
	testl	%r12d, %r12d
	je	LBB0_16
## %bb.17:
	movq	%rbx, %rdi
	callq	_ubi_ro_mode
	jmp	LBB0_18
LBB0_4:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_ubi_eba_unmap_leb
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.5:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ubi_eba_write_leb              ## TAILCALL
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_10:
	xorl	%r12d, %r12d
	jmp	LBB0_19
LBB0_16:
	xorl	%r12d, %r12d
LBB0_18:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
LBB0_19:
	movq	%rbx, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	%r14d, %edx
	callq	_leb_write_unlock
LBB0_20:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_ubi_free_vid_buf
	jmp	LBB0_21
	.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_DYNAMIC,4,2            ## @UBI_VID_DYNAMIC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"change LEB %d:%d"

	.comm	_UBI_IO_RETRIES,4,2             ## @UBI_IO_RETRIES
	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.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_atomic_leb_change      ; -- Begin function ubi_eba_atomic_leb_change
	.p2align	2
_ubi_eba_atomic_leb_change:             ; @ubi_eba_atomic_leb_change
	.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_4
; %bb.1:
Lloh0:
	adrp	x8, _EROFS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EROFS@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w27, w8
LBB0_3:
	mov	x0, x27
	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
LBB0_4:
	mov	x24, x4
	mov	x20, x2
	mov	x22, x1
	mov	x19, x0
	cbz	w4, LBB0_15
; %bb.5:
	mov	x25, x3
	ldr	w23, [x22]
Lloh2:
	adrp	x8, _GFP_NOFS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_NOFS@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ubi_alloc_vid_buf
	cbz	x0, LBB0_17
; %bb.6:
	mov	x21, x0
	bl	_ubi_get_vid_hdr
	mov	x26, x0
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x19
	mov	x1, x23
	mov	x2, x20
	bl	_leb_write_lock
	mov	x27, x0
	cbnz	w0, LBB0_20
; %bb.7:
	mov	x0, x19
	bl	_ubi_next_sqnum
	bl	_cpu_to_be64
	str	x0, [x26, #8]
	mov	x0, x23
	bl	_cpu_to_be32
	str	x0, [x26, #64]
	mov	x0, x20
	bl	_cpu_to_be32
	str	x0, [x26, #56]
	mov	x0, x19
	mov	x1, x23
	bl	_ubi_get_compat
	str	w0, [x26, #48]
	ldr	w0, [x22, #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, x25
	mov	x2, x24
	bl	_crc32
	mov	x27, x0
Lloh8:
	adrp	x8, _UBI_VID_DYNAMIC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _UBI_VID_DYNAMIC@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [x26, #32]
	mov	x0, x24
	bl	_cpu_to_be32
	str	x0, [x26, #24]
	mov	w8, #1
	str	w8, [x26]
	mov	x0, x27
	bl	_cpu_to_be32
	str	x0, [x26, #16]
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x23
	mov	x2, x20
	bl	_dbg_eba
Lloh13:
	adrp	x28, _UBI_IO_RETRIES@GOTPAGE
Lloh14:
	ldr	x28, [x28, _UBI_IO_RETRIES@GOTPAGEOFF]
	ldr	w8, [x28]
	tbnz	w8, #31, LBB0_18
; %bb.8:
	str	w23, [sp, #12]                  ; 4-byte Folded Spill
	mov	w23, #-1
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x20
	mov	x2, x21
	mov	x3, x25
	mov	w4, #0
	mov	x5, x24
	bl	_try_write_vid_and_data
	mov	x27, x0
Lloh15:
	adrp	x8, _EIO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x19
	bl	_ubi_next_sqnum
	bl	_cpu_to_be64
	str	x0, [x26, #8]
	mov	x0, x19
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_ubi_msg
	ldr	w8, [x28]
	add	w23, w23, #1
	cmp	w23, w8
	b.lt	LBB0_9
LBB0_12:
	cbz	w27, LBB0_14
; %bb.13:
	mov	x0, x19
	bl	_ubi_ro_mode
LBB0_14:
	ldr	w23, [sp, #12]                  ; 4-byte Folded Reload
	b	LBB0_19
LBB0_15:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x20
	bl	_ubi_eba_unmap_leb
	mov	x27, x0
	cbnz	w0, LBB0_3
; %bb.16:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x20
	mov	x3, #0
	mov	w4, #0
	mov	w5, #0
	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
	b	_ubi_eba_write_leb
LBB0_17:
Lloh20:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_2
LBB0_18:
	mov	w27, #0
LBB0_19:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x20
	bl	_leb_write_unlock
LBB0_20:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	bl	_ubi_free_vid_buf
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.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_DYNAMIC,4,2            ; @UBI_VID_DYNAMIC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"change LEB %d:%d"

	.comm	_UBI_IO_RETRIES,4,2             ; @UBI_IO_RETRIES
	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"try another PEB"

.subsections_via_symbols
