	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_calc_data_len              ## -- Begin function ubi_calc_data_len
	.p2align	4, 0x90
_ubi_calc_data_len:                     ## @ubi_calc_data_len
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	(%rdi), %eax
	decl	%eax
	xorl	%edi, %edi
	testl	%edx, %eax
	sete	%dil
	callq	_ubi_assert
	movl	%r15d, %eax
	movl	%r15d, %edi
	sarl	$31, %edi
	andl	%r15d, %edi
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	testl	%eax, %eax
	jle	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	leaq	-1(%rax), %rcx
	cmpl	$255, -4(%rbx,%rax,4)
	movq	%rcx, %rax
	je	LBB0_1
## %bb.3:
	incl	%ecx
	movl	%ecx, %edi
LBB0_4:
	movl	(%r14), %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ALIGN                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_calc_data_len              ; -- Begin function ubi_calc_data_len
	.p2align	2
_ubi_calc_data_len:                     ; @ubi_calc_data_len
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	w8, [x0]
	sub	w8, w8, #1
	tst	w8, w2
	cset	w0, eq
	bl	_ubi_assert
	cmp	w20, #0
	csel	w0, w20, wzr, lt
	sub	x8, x21, #4
	mov	w9, w20
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w9, #1
	b.lt	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	sub	x10, x9, #1
	ldr	w11, [x8, x9, lsl #2]
	mov	x9, x10
	cmp	w11, #255
	b.eq	LBB0_1
; %bb.3:
	add	w0, w10, #1
LBB0_4:
	ldr	w1, [x19]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_ALIGN
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
