	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_leb_change                 ## -- Begin function ubi_leb_change
	.p2align	4, 0x90
_ubi_leb_change:                        ## @ubi_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	%esi, %r12d
	movq	%rdi, %r14
	movq	8(%rdi), %rbx
	movq	32(%rbx), %r15
	movl	(%rbx), %r13d
	leaq	L_.str(%rip), %rdi
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, %esi
	movl	%r13d, %edx
	movl	%r12d, %ecx
	callq	_dbg_gen
	testl	%r13d, %r13d
	js	LBB0_2
## %bb.1:
	cmpl	(%r15), %r13d
	jge	LBB0_2
## %bb.4:
	movq	(%r14), %rax
	movq	_UBI_READONLY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_6
## %bb.5:
	movq	8(%rbx), %rax
	movq	_UBI_STATIC_VOLUME@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
LBB0_6:
	movq	_EROFS@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_7:
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_ubi_leb_valid
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	testl	%r8d, %r8d
	js	LBB0_2
## %bb.8:
	testl	%eax, %eax
	je	LBB0_2
## %bb.9:
	cmpl	%r8d, 16(%rbx)
	jl	LBB0_2
## %bb.10:
	movl	4(%r15), %eax
	decl	%eax
	testl	%r8d, %eax
	je	LBB0_11
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_15:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	cmpq	$0, 24(%rbx)
	je	LBB0_13
## %bb.12:
	movq	_EBADF@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_13:
	testl	%r8d, %r8d
	je	LBB0_14
## %bb.16:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%r12d, %edx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ubi_eba_atomic_leb_change      ## TAILCALL
LBB0_14:
	xorl	%eax, %eax
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"atomically write %d bytes to LEB %d:%d"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_leb_change                 ; -- Begin function ubi_leb_change
	.p2align	2
_ubi_leb_change:                        ; @ubi_leb_change
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x24, x0
	ldr	x22, [x0, #8]
	ldr	x23, [x22, #32]
	ldr	w25, [x22]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x3
	mov	x2, x25
	mov	x3, x21
	bl	_dbg_gen
	tbnz	w25, #31, LBB0_9
; %bb.1:
	ldr	w8, [x23]
	cmp	w25, w8
	b.ge	LBB0_9
; %bb.2:
	ldr	x8, [x24]
Lloh2:
	adrp	x9, _UBI_READONLY@GOTPAGE
Lloh3:
	ldr	x9, [x9, _UBI_READONLY@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_4
; %bb.3:
	ldr	x8, [x22, #8]
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_5
LBB0_4:
Lloh8:
	adrp	x8, _EROFS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EROFS@GOTPAGEOFF]
	b	LBB0_10
LBB0_5:
	mov	x0, x22
	mov	x1, x21
	bl	_ubi_leb_valid
	tbnz	w19, #31, LBB0_9
; %bb.6:
	cbz	w0, LBB0_9
; %bb.7:
	ldr	w8, [x22, #16]
	cmp	w8, w19
	b.lt	LBB0_9
; %bb.8:
	ldr	w8, [x23, #4]
	sub	w8, w8, #1
	tst	w8, w19
	b.eq	LBB0_12
LBB0_9:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_12:
	ldr	x8, [x22, #24]
	cbz	x8, LBB0_14
; %bb.13:
Lloh12:
	adrp	x8, _EBADF@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EBADF@GOTPAGEOFF]
	b	LBB0_10
LBB0_14:
	cbz	w19, LBB0_16
; %bb.15:
	mov	x0, x23
	mov	x1, x22
	mov	x2, x21
	mov	x3, x20
	mov	x4, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_ubi_eba_atomic_leb_change
LBB0_16:
	mov	w0, #0
	b	LBB0_11
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"atomically write %d bytes to LEB %d:%d"

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