	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ber_calc_len                   ## -- Begin function ber_calc_len
	.p2align	4, 0x90
_ber_calc_len:                          ## @ber_calc_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	32(%rdi), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.1:
	movq	(%r14), %rax
	movq	_BER_TYPE_SEQUENCE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.2:
	movq	_BER_TYPE_SET@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
LBB0_3:
	callq	_ber_calc_len
	movq	%rax, 8(%r14)
LBB0_4:
	movq	16(%r14), %rcx
	movq	_BER_TYPE_SINGLE_MAX@GOTPCREL(%rip), %rax
	movl	$2, %ebx
	cmpq	(%rax), %rcx
	jbe	LBB0_7
## %bb.5:
	movl	$2, %ebx
	movq	%rcx, %rdx
	movq	%rcx, %rax
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	incq	%rbx
	shrq	$7, %rax
	cmpq	$127, %rdx
	movq	%rax, %rdx
	ja	LBB0_6
LBB0_7:
	movq	8(%r14), %rax
	movq	_BER_TAG_MORE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jb	LBB0_11
## %bb.8:
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:
	movq	%rax, %rdx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	incq	%rbx
	shrq	$8, %rdx
	cmpq	$255, %rax
	movq	%rdx, %rax
	ja	LBB0_10
LBB0_11:
	movq	24(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_13
## %bb.12:
	callq	_ber_calc_len
	addq	%rax, %rbx
	movq	16(%r14), %rcx
LBB0_13:
	movq	_BER_TYPE_EOC@GOTPCREL(%rip), %rax
	xorq	(%rax), %rcx
	movq	8(%r14), %rdx
	addq	%rdx, %rbx
	xorl	%eax, %eax
	orq	%rdx, %rcx
	cmovneq	%rbx, %rax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BER_TYPE_SEQUENCE,8,3          ## @BER_TYPE_SEQUENCE
	.comm	_BER_TYPE_SET,8,3               ## @BER_TYPE_SET
	.comm	_BER_TYPE_SINGLE_MAX,8,3        ## @BER_TYPE_SINGLE_MAX
	.comm	_BER_TAG_MORE,8,3               ## @BER_TAG_MORE
	.comm	_BER_TYPE_EOC,8,3               ## @BER_TYPE_EOC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ber_calc_len                   ; -- Begin function ber_calc_len
	.p2align	2
_ber_calc_len:                          ; @ber_calc_len
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x0, [x0, #32]
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _BER_TYPE_SEQUENCE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BER_TYPE_SEQUENCE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x10, _BER_TYPE_SET@GOTPAGE
Lloh4:
	ldr	x10, [x10, _BER_TYPE_SET@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_3
; %bb.2:
	bl	_ber_calc_len
	str	x0, [x19, #8]
LBB0_3:
	ldr	x8, [x19, #16]
Lloh6:
	adrp	x9, _BER_TYPE_SINGLE_MAX@GOTPAGE
Lloh7:
	ldr	x9, [x9, _BER_TYPE_SINGLE_MAX@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	mov	w20, #2
	cmp	x8, x9
	b.ls	LBB0_6
; %bb.4:
	mov	x9, x8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	add	x20, x20, #1
	lsr	x10, x9, #7
	cmp	x9, #127
	mov	x9, x10
	b.hi	LBB0_5
LBB0_6:
	ldr	x9, [x19, #8]
Lloh9:
	adrp	x10, _BER_TAG_MORE@GOTPAGE
Lloh10:
	ldr	x10, [x10, _BER_TAG_MORE@GOTPAGEOFF]
Lloh11:
	ldr	x10, [x10]
	cmp	x9, x10
	ccmp	x9, #0, #4, hs
	b.eq	LBB0_8
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	add	x20, x20, #1
	lsr	x10, x9, #8
	cmp	x9, #255
	mov	x9, x10
	b.hi	LBB0_7
LBB0_8:
	ldr	x0, [x19, #24]
	cbz	x0, LBB0_10
; %bb.9:
	bl	_ber_calc_len
	add	x20, x0, x20
	ldr	x8, [x19, #16]
LBB0_10:
Lloh12:
	adrp	x9, _BER_TYPE_EOC@GOTPAGE
Lloh13:
	ldr	x9, [x9, _BER_TYPE_EOC@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	ldr	x10, [x19, #8]
	cmp	x10, #0
	ccmp	x8, x9, #0, eq
	add	x8, x10, x20
	csel	x0, xzr, x8, eq
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_BER_TYPE_SEQUENCE,8,3          ; @BER_TYPE_SEQUENCE
	.comm	_BER_TYPE_SET,8,3               ; @BER_TYPE_SET
	.comm	_BER_TYPE_SINGLE_MAX,8,3        ; @BER_TYPE_SINGLE_MAX
	.comm	_BER_TAG_MORE,8,3               ; @BER_TAG_MORE
	.comm	_BER_TYPE_EOC,8,3               ; @BER_TYPE_EOC
.subsections_via_symbols
