	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mov_write_stts_tag
_mov_write_stts_tag:                    ## @mov_write_stts_tag
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	16(%rsi), %rax
	movq	(%rax), %rax
	movq	_AVMEDIA_TYPE_AUDIO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.1:
	cmpl	$0, 8(%r12)
	je	LBB0_2
LBB0_4:
	movl	4(%r12), %edi
	movq	$-1, %r15
	testl	%edi, %edi
	je	LBB0_5
## %bb.6:
	movl	$8, %esi
	callq	_av_malloc_array
	testq	%rax, %rax
	je	LBB0_19
## %bb.7:
	movq	%rax, %r13
	cmpl	$0, 4(%r12)
	jle	LBB0_14
## %bb.8:
	xorl	%r15d, %r15d
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_get_cluster_duration
	movl	%eax, 4(%r13)
	movl	$1, (%r13)
	cmpl	$2, 4(%r12)
	jl	LBB0_14
## %bb.9:
	movl	$1, %ebx
	xorl	%r15d, %r15d
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	%eax, 12(%r13,%r15,8)
	movl	$1, 8(%r13,%r15,8)
	incq	%r15
LBB0_13:                                ##   in Loop: Header=BB0_10 Depth=1
	incl	%ebx
	cmpl	4(%r12), %ebx
	jge	LBB0_14
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_get_cluster_duration
	cmpl	4(%r13,%r15,8), %eax
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	incl	(%r13,%r15,8)
	jmp	LBB0_13
LBB0_5:
	xorl	%r13d, %r13d
LBB0_14:
	incq	%r15
LBB0_15:
	leaq	16(,%r15,8), %r12
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_avio_wb32
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_ffio_wfourcc
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_avio_wb32
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_avio_wb32
	testq	%r15, %r15
	je	LBB0_18
## %bb.16:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movslq	(%r13,%rbx,8), %rsi
	movq	%r14, %rdi
	callq	_avio_wb32
	movslq	4(%r13,%rbx,8), %rsi
	movq	%r14, %rdi
	callq	_avio_wb32
	incq	%rbx
	cmpq	%rbx, %r15
	jne	LBB0_17
LBB0_18:
	movq	%r13, %rdi
	callq	_av_free
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	$8, %edi
	callq	_av_malloc
	testq	%rax, %rax
	je	LBB0_19
## %bb.3:
	movq	%rax, %r13
	movl	(%r12), %eax
	movl	%eax, (%r13)
	movl	$1, 4(%r13)
	movl	$1, %r15d
	jmp	LBB0_15
LBB0_19:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AVMEDIA_TYPE_AUDIO,8,3         ## @AVMEDIA_TYPE_AUDIO
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"stts"

	.no_dead_strip	_mov_write_stts_tag
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mov_write_stts_tag
_mov_write_stts_tag:                    ; @mov_write_stts_tag
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x1
	mov	x19, x0
	ldr	x8, [x1, #16]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _AVMEDIA_TYPE_AUDIO@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AVMEDIA_TYPE_AUDIO@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	w8, [x21, #8]
	cbz	w8, LBB0_12
LBB0_2:
	ldr	w0, [x21, #4]
	cbz	w0, LBB0_11
; %bb.3:
	mov	w1, #8
	bl	_av_malloc_array
	cbz	x0, LBB0_14
; %bb.4:
	mov	x20, x0
	ldr	w8, [x21, #4]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.5:
	mov	x0, x21
	mov	w1, #0
	bl	_get_cluster_duration
	mov	w24, #1
	stp	w24, w0, [x20]
	ldr	w8, [x21, #4]
	cmp	w8, #2
	b.lt	LBB0_16
; %bb.6:
	mov	x23, #0
	mov	w22, #1
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	x23, x23, #1
	add	x8, x20, x23, lsl #3
	stp	w24, w0, [x8]
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	w22, w22, #1
	ldr	w8, [x21, #4]
	cmp	w22, w8
	b.ge	LBB0_17
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	x1, x22
	bl	_get_cluster_duration
	add	x8, x20, x23, lsl #3
	ldr	w8, [x8, #4]
	cmp	w0, w8
	b.ne	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	lsl	x8, x23, #3
	ldr	w9, [x20, x8]
	add	w9, w9, #1
	str	w9, [x20, x8]
	b	LBB0_8
LBB0_11:
	mov	x20, #0
	mov	x23, #-1
	b	LBB0_17
LBB0_12:
	mov	w0, #8
	bl	_av_malloc
	cbz	x0, LBB0_14
; %bb.13:
	mov	x20, x0
	ldr	w8, [x21]
	mov	w21, #1
	stp	w8, w21, [x0]
	b	LBB0_18
LBB0_14:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_AVERROR
LBB0_15:
	mov	x23, #-1
	b	LBB0_17
LBB0_16:
	mov	x23, #0
LBB0_17:
	add	x21, x23, #1
LBB0_18:
	lsl	x8, x21, #3
	add	x22, x8, #16
	mov	x0, x19
	mov	x1, x22
	bl	_avio_wb32
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ffio_wfourcc
	mov	x0, x19
	mov	x1, #0
	bl	_avio_wb32
	mov	x0, x19
	mov	x1, x21
	bl	_avio_wb32
	cbz	x21, LBB0_21
; %bb.19:
	add	x23, x20, #4
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldursw	x1, [x23, #-4]
	mov	x0, x19
	bl	_avio_wb32
	ldrsw	x1, [x23]
	mov	x0, x19
	bl	_avio_wb32
	add	x23, x23, #8
	subs	x21, x21, #1
	b.ne	LBB0_20
LBB0_21:
	mov	x0, x20
	bl	_av_free
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_AVMEDIA_TYPE_AUDIO,8,3         ; @AVMEDIA_TYPE_AUDIO
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"stts"

	.no_dead_strip	_mov_write_stts_tag
.subsections_via_symbols
