	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calc_next_seg_no_from_timelines
_calc_next_seg_no_from_timelines:       ## @calc_next_seg_no_from_timelines
	.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
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r9
	movq	$-1, %rax
	testq	%r9, %r9
	je	LBB0_12
## %bb.1:
	movq	8(%rdi), %r8
	xorl	%edi, %edi
	xorl	%r11d, %r11d
	xorl	%r10d, %r10d
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
	movq	(%r8,%r10,8), %rdx
	movq	(%rdx), %rcx
	testq	%rcx, %rcx
	cmovgq	%rcx, %rdi
	cmpq	%rsi, %rdi
	ja	LBB0_11
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%rdx), %rcx
	movq	16(%rdx), %rdx
	testq	%rdx, %rdx
	je	LBB0_4
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	1(%rdx), %r15
	imulq	%rcx, %r15
	addq	%rdi, %r15
	leaq	(%r11,%rdx), %r14
	negq	%rdx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	addq	%rcx, %rdi
	cmpq	%rsi, %rdi
	ja	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_9 Depth=2
	decq	%rbx
	cmpq	%rbx, %rdx
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %r11
	movq	%r15, %rdi
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	addq	%rcx, %rdi
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r11
	incq	%r10
	cmpq	%r9, %r10
	jne	LBB0_2
	jmp	LBB0_12
LBB0_10:
	subq	%rbx, %r11
	incq	%r11
LBB0_11:
	movq	%r11, %rax
LBB0_12:
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_calc_next_seg_no_from_timelines
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calc_next_seg_no_from_timelines
_calc_next_seg_no_from_timelines:       ; @calc_next_seg_no_from_timelines
	.cfi_startproc
; %bb.0:
	ldr	x9, [x0]
	cbz	x9, LBB0_10
; %bb.1:
	mov	x8, x0
	mov	x11, #0
	mov	x0, #0
	mov	x10, #0
	ldr	x8, [x8, #8]
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	ldr	x14, [x8, x10, lsl #3]
	ldr	x12, [x14]
	cmp	x12, #0
	csel	x12, x12, x11, gt
	cmp	x12, x1
	b.hi	LBB0_11
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldp	x13, x14, [x14, #8]
	cbz	x14, LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	madd	x11, x13, x14, x13
	add	x11, x12, x11
	add	x15, x0, x14
	add	x0, x0, #1
LBB0_5:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x12, x12, x13
	cmp	x12, x1
	b.hi	LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	add	x0, x0, #1
	sub	x14, x14, #1
	cbnz	x14, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x15
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_2 Depth=1
	add	x11, x12, x13
LBB0_9:                                 ;   in Loop: Header=BB0_2 Depth=1
	add	x0, x0, #1
	add	x10, x10, #1
	cmp	x10, x9
	b.ne	LBB0_2
LBB0_10:
	mov	x0, #-1
LBB0_11:
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_calc_next_seg_no_from_timelines
.subsections_via_symbols
