	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mov_write_mvhd_tag
_mov_write_mvhd_tag:                    ## @mov_write_mvhd_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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movl	(%rsi), %ecx
	testl	%ecx, %ecx
	jle	LBB0_1
## %bb.2:
	movq	16(%r15), %rax
	movl	$1, %r13d
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	xorl	%r14d, %r14d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%r12
	movslq	%ecx, %rdx
	addq	$32, %rbx
	cmpq	%rdx, %r12
	jge	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rax,%rbx)
	jle	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	16(%rax,%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	24(%rax,%rbx), %edi
	movq	_MOV_TIMESCALE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AV_ROUND_UP@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_av_rescale_rnd
	cmpq	%rax, %r14
	cmovleq	%rax, %r14
	movq	16(%r15), %rax
	movl	8(%rax,%rbx), %ecx
	cmpl	%ecx, %r13d
	cmovlel	%ecx, %r13d
	movl	(%r15), %ecx
	jmp	LBB0_6
LBB0_1:
	movl	$1, %r13d
	xorl	%r14d, %r14d
LBB0_7:
	movq	_FF_MOV_FLAG_EMPTY_MOOV@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%eax, %eax
	andl	4(%r15), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	cmovneq	%rax, %r14
	movq	_UINT32_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	cmpq	%rax, %r14
	setge	%r12b
	movl	$120, %eax
	movl	$108, %esi
	cmovgel	%eax, %esi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_avio_wb32
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_ffio_wfourcc
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_avio_w8
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_avio_wb24
	movq	8(%r15), %rsi
	cmpq	-56(%rbp), %r14                 ## 8-byte Folded Reload
	jl	LBB0_9
## %bb.8:
	movq	%rbx, %rdi
	callq	_avio_wb64
	movq	8(%r15), %rsi
	movq	%rbx, %rdi
	callq	_avio_wb64
	movq	_MOV_TIMESCALE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_avio_wb32
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_avio_wb64
	jmp	LBB0_10
LBB0_9:
	movq	%rbx, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_avio_wb32
	movl	8(%r15), %esi
	movq	%rbx, %rdi
	callq	_avio_wb32
	movq	_MOV_TIMESCALE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_avio_wb32
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_avio_wb32
LBB0_10:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movq	%rbx, %rdi
	movl	$65536, %esi                    ## imm = 0x10000
	callq	_avio_wb32
	movq	%rbx, %rdi
	movl	$256, %esi                      ## imm = 0x100
	callq	_avio_wb16
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_avio_wb16
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_avio_wb32
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_avio_wb32
	movl	$0, (%rsp)
	movq	%rbx, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	xorl	%r9d, %r9d
	callq	_write_matrix
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_avio_wb32
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_avio_wb32
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_avio_wb32
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_avio_wb32
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_avio_wb32
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_avio_wb32
	incl	%r13d
	testl	%r14d, %r14d
	movl	$2, %esi
	cmovel	%r13d, %esi
	movq	%rbx, %rdi
	callq	_avio_wb32
	movl	$108, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MOV_TIMESCALE,4,2              ## @MOV_TIMESCALE
	.comm	_AV_ROUND_UP,4,2                ## @AV_ROUND_UP
	.comm	_FF_MOV_FLAG_EMPTY_MOOV,4,2     ## @FF_MOV_FLAG_EMPTY_MOOV
	.comm	_UINT32_MAX,8,3                 ## @UINT32_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mvhd"

	.no_dead_strip	_mov_write_mvhd_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_mvhd_tag
_mov_write_mvhd_tag:                    ; @mov_write_mvhd_tag
	.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	x20, x1
	mov	x19, x0
	ldr	w9, [x1]
Lloh0:
	adrp	x24, _MOV_TIMESCALE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _MOV_TIMESCALE@GOTPAGEOFF]
	cmp	w9, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x22, #0
	mov	x25, #0
	mov	x21, #0
	ldr	x8, [x20, #16]
	mov	w23, #1
Lloh2:
	adrp	x26, _AV_ROUND_UP@GOTPAGE
Lloh3:
	ldr	x26, [x26, _AV_ROUND_UP@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x25, x25, #1
	add	x22, x22, #32
	cmp	x25, w9, sxtw
	b.ge	LBB0_7
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x8, x22]
	cmp	x10, #1
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x10, x8, x22
	ldr	x2, [x10, #16]
	cbz	x2, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x10, #24]
	ldr	w1, [x24]
	ldr	w3, [x26]
	bl	_av_rescale_rnd
	cmp	x21, x0
	csel	x21, x21, x0, gt
	ldr	x8, [x20, #16]
	add	x9, x8, x22
	ldr	w9, [x9, #8]
	cmp	w23, w9
	csel	w23, w23, w9, gt
	ldr	w9, [x20]
	b	LBB0_2
LBB0_6:
	mov	x21, #0
	mov	w23, #1
LBB0_7:
Lloh4:
	adrp	x8, _FF_MOV_FLAG_EMPTY_MOOV@GOTPAGE
Lloh5:
	ldr	x8, [x8, _FF_MOV_FLAG_EMPTY_MOOV@GOTPAGEOFF]
	ldr	w9, [x20, #4]
Lloh6:
	ldr	w8, [x8]
	ands	w25, w8, w9
	csel	x21, x21, xzr, eq
Lloh7:
	adrp	x8, _UINT32_MAX@GOTPAGE
Lloh8:
	ldr	x8, [x8, _UINT32_MAX@GOTPAGEOFF]
Lloh9:
	ldr	x26, [x8]
	cmp	x21, x26
	cset	w22, ge
	mov	w8, #108
	mov	w9, #120
	csel	w1, w9, w8, ge
	mov	x0, x19
	bl	_avio_wb32
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ffio_wfourcc
	mov	x0, x19
	mov	x1, x22
	bl	_avio_w8
	mov	x0, x19
	mov	w1, #0
	bl	_avio_wb24
	ldr	x1, [x20, #8]
	mov	x0, x19
	cmp	x21, x26
	b.lt	LBB0_9
; %bb.8:
	bl	_avio_wb64
	ldr	x1, [x20, #8]
	mov	x0, x19
	bl	_avio_wb64
	ldr	w1, [x24]
	mov	x0, x19
	bl	_avio_wb32
	mov	x0, x19
	mov	x1, x21
	bl	_avio_wb64
	b	LBB0_10
LBB0_9:
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_avio_wb32
	ldr	w1, [x20, #8]
	mov	x0, x19
	bl	_avio_wb32
	ldr	w1, [x24]
	mov	x0, x19
	bl	_avio_wb32
	mov	x0, x19
	mov	x1, x21
	bl	_avio_wb32
LBB0_10:
	mov	x0, x19
	mov	w1, #65536
	bl	_avio_wb32
	mov	x0, x19
	mov	w1, #256
	bl	_avio_wb16
	mov	x0, x19
	mov	w1, #0
	bl	_avio_wb16
	mov	x0, x19
	mov	w1, #0
	bl	_avio_wb32
	mov	x0, x19
	mov	w1, #0
	bl	_avio_wb32
	mov	x0, x19
	mov	w1, #1
	mov	w2, #0
	mov	w3, #0
	mov	w4, #1
	mov	w5, #0
	mov	w6, #0
	bl	_write_matrix
	mov	x0, x19
	mov	w1, #0
	bl	_avio_wb32
	mov	x0, x19
	mov	w1, #0
	bl	_avio_wb32
	mov	x0, x19
	mov	w1, #0
	bl	_avio_wb32
	mov	x0, x19
	mov	w1, #0
	bl	_avio_wb32
	mov	x0, x19
	mov	w1, #0
	bl	_avio_wb32
	mov	x0, x19
	mov	w1, #0
	bl	_avio_wb32
	cmp	w25, #0
	mov	w8, #2
	csinc	w1, w8, w23, ne
	mov	x0, x19
	bl	_avio_wb32
	mov	w0, #108
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_MOV_TIMESCALE,4,2              ; @MOV_TIMESCALE
	.comm	_AV_ROUND_UP,4,2                ; @AV_ROUND_UP
	.comm	_FF_MOV_FLAG_EMPTY_MOOV,4,2     ; @FF_MOV_FLAG_EMPTY_MOOV
	.comm	_UINT32_MAX,8,3                 ; @UINT32_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mvhd"

	.no_dead_strip	_mov_write_mvhd_tag
.subsections_via_symbols
