	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mp4_write_box_tkhd
_mp4_write_box_tkhd:                    ## @mp4_write_box_tkhd
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	movq	(%rcx), %r15
	movq	(%r15), %rcx
	movq	(%rax,%rcx,8), %r12
	movq	_MP4_64BITS_TIME@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	leaq	L_.str(%rip), %rdx
	movl	%r14d, %esi
	callq	_WRITE_U8
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	movl	$7, %esi
	callq	_WRITE_U24
	leaq	L_.str.2(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	testl	%r14d, %r14d
	je	LBB0_2
## %bb.1:
	callq	_WRITE_U64
	leaq	L_.str.3(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_WRITE_U64
	movl	(%r15), %esi
	incl	%esi
	leaq	L_.str.4(%rip), %rdx
	movq	%rbx, %rdi
	callq	_WRITE_U32
	leaq	L_.str.5(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_WRITE_U32
	movq	_MP4_TIMESCALE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	(%rbx), %eax
	cltq
	imulq	$1125899907, %rax, %rsi         ## imm = 0x431BDE83
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$50, %rsi
	addl	%eax, %esi
	leaq	L_.str.6(%rip), %rdx
	movq	%rbx, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_WRITE_U64
	jmp	LBB0_3
LBB0_2:
	callq	_WRITE_U32
	leaq	L_.str.3(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_WRITE_U32
	movl	(%r15), %esi
	incl	%esi
	leaq	L_.str.4(%rip), %rdx
	movq	%rbx, %rdi
	callq	_WRITE_U32
	leaq	L_.str.5(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_WRITE_U32
	movq	_MP4_TIMESCALE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	(%rbx), %eax
	cltq
	imulq	$1125899907, %rax, %rsi         ## imm = 0x431BDE83
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$50, %rsi
	addl	%eax, %esi
	leaq	L_.str.6(%rip), %rdx
	movq	%rbx, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_WRITE_U32
LBB0_3:
	leaq	L_.str.5(%rip), %r15
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movq	%r15, %rdx
	callq	_WRITE_U32
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movq	%r15, %rdx
	callq	_WRITE_U32
	leaq	L_.str.7(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_WRITE_U16
	leaq	L_.str.8(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_WRITE_U16
	movq	(%r12), %rax
	movq	(%rax), %rax
	movq	_VC_CONTAINER_ES_TYPE_AUDIO@GOTPCREL(%rip), %rcx
	xorl	%esi, %esi
	cmpq	(%rcx), %rax
	sete	%sil
	shll	$8, %esi
	leaq	L_.str.9(%rip), %rdx
	movq	%rbx, %rdi
	callq	_WRITE_U16
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movq	%r15, %rdx
	callq	_WRITE_U16
	leaq	L_.str.10(%rip), %r15
	movq	%rbx, %rdi
	movl	$65536, %esi                    ## imm = 0x10000
	movq	%r15, %rdx
	callq	_WRITE_U32
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movq	%r15, %rdx
	callq	_WRITE_U32
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movq	%r15, %rdx
	callq	_WRITE_U32
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movq	%r15, %rdx
	callq	_WRITE_U32
	movq	%rbx, %rdi
	movl	$65536, %esi                    ## imm = 0x10000
	movq	%r15, %rdx
	callq	_WRITE_U32
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movq	%r15, %rdx
	callq	_WRITE_U32
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movq	%r15, %rdx
	callq	_WRITE_U32
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movq	%r15, %rdx
	callq	_WRITE_U32
	movq	%rbx, %rdi
	movl	$1073741824, %esi               ## imm = 0x40000000
	movq	%r15, %rdx
	callq	_WRITE_U32
	movq	(%r12), %rax
	movq	(%rax), %rcx
	movq	_VC_CONTAINER_ES_TYPE_VIDEO@GOTPCREL(%rip), %rdx
	movl	$0, %r15d
	cmpq	(%rdx), %rcx
	jne	LBB0_7
## %bb.4:
	movq	8(%rax), %rax
	movl	(%rax), %r14d
	movl	4(%rax), %r15d
	shll	$16, %r14d
	shll	$16, %r15d
	movq	16(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_7
## %bb.5:
	movl	8(%rax), %esi
	testl	%esi, %esi
	je	LBB0_7
## %bb.6:
	imull	%ecx, %r14d
	movl	%r14d, %eax
	cltd
	idivl	%esi
	movl	%eax, %r14d
LBB0_7:
	leaq	L_.str.11(%rip), %rdx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_WRITE_U32
	leaq	L_.str.12(%rip), %rdx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_WRITE_U32
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_STREAM_STATUS                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MP4_64BITS_TIME,4,2            ## @MP4_64BITS_TIME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"version"

L_.str.1:                               ## @.str.1
	.asciz	"flags"

L_.str.2:                               ## @.str.2
	.asciz	"creation_time"

L_.str.3:                               ## @.str.3
	.asciz	"modification_time"

L_.str.4:                               ## @.str.4
	.asciz	"track_ID"

L_.str.5:                               ## @.str.5
	.asciz	"reserved"

	.comm	_MP4_TIMESCALE,4,2              ## @MP4_TIMESCALE
L_.str.6:                               ## @.str.6
	.asciz	"duration"

L_.str.7:                               ## @.str.7
	.asciz	"layer"

L_.str.8:                               ## @.str.8
	.asciz	"alternate_group"

	.comm	_VC_CONTAINER_ES_TYPE_AUDIO,8,3 ## @VC_CONTAINER_ES_TYPE_AUDIO
L_.str.9:                               ## @.str.9
	.asciz	"volume"

L_.str.10:                              ## @.str.10
	.asciz	"matrix"

	.comm	_VC_CONTAINER_ES_TYPE_VIDEO,8,3 ## @VC_CONTAINER_ES_TYPE_VIDEO
	.comm	_VC_CONTAINER_ES_TYPE_SUBPICTURE,8,3 ## @VC_CONTAINER_ES_TYPE_SUBPICTURE
L_.str.11:                              ## @.str.11
	.asciz	"width"

L_.str.12:                              ## @.str.12
	.asciz	"height"

	.no_dead_strip	_mp4_write_box_tkhd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mp4_write_box_tkhd
_mp4_write_box_tkhd:                    ; @mp4_write_box_tkhd
	.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	x19, x0
	mov	w22, #16960
	movk	w22, #15, lsl #16
	ldp	x9, x8, [x0, #8]
	ldr	x23, [x8]
	ldr	x8, [x23]
	ldr	x21, [x9, x8, lsl #3]
Lloh0:
	adrp	x8, _MP4_64BITS_TIME@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MP4_64BITS_TIME@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x1, x20
	bl	_WRITE_U8
Lloh5:
	adrp	x2, l_.str.1@PAGE
Lloh6:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	w1, #7
	bl	_WRITE_U24
Lloh7:
	adrp	x2, l_.str.2@PAGE
Lloh8:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	cbz	w20, LBB0_2
; %bb.1:
	bl	_WRITE_U64
Lloh9:
	adrp	x2, l_.str.3@PAGE
Lloh10:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	bl	_WRITE_U64
	ldr	w8, [x23]
	add	w1, w8, #1
Lloh11:
	adrp	x2, l_.str.4@PAGE
Lloh12:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_WRITE_U32
Lloh13:
	adrp	x2, l_.str.5@PAGE
Lloh14:
	add	x2, x2, l_.str.5@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	bl	_WRITE_U32
	ldr	w8, [x19]
Lloh15:
	adrp	x9, _MP4_TIMESCALE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MP4_TIMESCALE@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	mul	w8, w9, w8
	sdiv	w1, w8, w22
Lloh18:
	adrp	x2, l_.str.6@PAGE
Lloh19:
	add	x2, x2, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_WRITE_U64
	b	LBB0_3
LBB0_2:
	bl	_WRITE_U32
Lloh20:
	adrp	x2, l_.str.3@PAGE
Lloh21:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	bl	_WRITE_U32
	ldr	w8, [x23]
	add	w1, w8, #1
Lloh22:
	adrp	x2, l_.str.4@PAGE
Lloh23:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_WRITE_U32
Lloh24:
	adrp	x2, l_.str.5@PAGE
Lloh25:
	add	x2, x2, l_.str.5@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	bl	_WRITE_U32
	ldr	w8, [x19]
Lloh26:
	adrp	x9, _MP4_TIMESCALE@GOTPAGE
Lloh27:
	ldr	x9, [x9, _MP4_TIMESCALE@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	mul	w8, w9, w8
	sdiv	w1, w8, w22
Lloh29:
	adrp	x2, l_.str.6@PAGE
Lloh30:
	add	x2, x2, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_WRITE_U32
LBB0_3:
Lloh31:
	adrp	x20, l_.str.5@PAGE
Lloh32:
	add	x20, x20, l_.str.5@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	mov	x2, x20
	bl	_WRITE_U32
	mov	x0, x19
	mov	w1, #0
	mov	x2, x20
	bl	_WRITE_U32
Lloh33:
	adrp	x2, l_.str.7@PAGE
Lloh34:
	add	x2, x2, l_.str.7@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	bl	_WRITE_U16
Lloh35:
	adrp	x2, l_.str.8@PAGE
Lloh36:
	add	x2, x2, l_.str.8@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	bl	_WRITE_U16
	ldr	x8, [x21]
	ldr	x8, [x8]
Lloh37:
	adrp	x9, _VC_CONTAINER_ES_TYPE_AUDIO@GOTPAGE
Lloh38:
	ldr	x9, [x9, _VC_CONTAINER_ES_TYPE_AUDIO@GOTPAGEOFF]
Lloh39:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w8, eq
	lsl	w1, w8, #8
Lloh40:
	adrp	x2, l_.str.9@PAGE
Lloh41:
	add	x2, x2, l_.str.9@PAGEOFF
	mov	x0, x19
	bl	_WRITE_U16
	mov	x0, x19
	mov	w1, #0
	mov	x2, x20
	bl	_WRITE_U16
Lloh42:
	adrp	x20, l_.str.10@PAGE
Lloh43:
	add	x20, x20, l_.str.10@PAGEOFF
	mov	x0, x19
	mov	w1, #65536
	mov	x2, x20
	bl	_WRITE_U32
	mov	x0, x19
	mov	w1, #0
	mov	x2, x20
	bl	_WRITE_U32
	mov	x0, x19
	mov	w1, #0
	mov	x2, x20
	bl	_WRITE_U32
	mov	x0, x19
	mov	w1, #0
	mov	x2, x20
	bl	_WRITE_U32
	mov	x0, x19
	mov	w1, #65536
	mov	x2, x20
	bl	_WRITE_U32
	mov	x0, x19
	mov	w1, #0
	mov	x2, x20
	bl	_WRITE_U32
	mov	x0, x19
	mov	w1, #0
	mov	x2, x20
	bl	_WRITE_U32
	mov	x0, x19
	mov	w1, #0
	mov	x2, x20
	bl	_WRITE_U32
	mov	x0, x19
	mov	w1, #1073741824
	mov	x2, x20
	bl	_WRITE_U32
	mov	w1, #0
	mov	w20, #0
	ldr	x8, [x21]
	ldr	x9, [x8]
Lloh44:
	adrp	x10, _VC_CONTAINER_ES_TYPE_VIDEO@GOTPAGE
Lloh45:
	ldr	x10, [x10, _VC_CONTAINER_ES_TYPE_VIDEO@GOTPAGEOFF]
Lloh46:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_7
; %bb.4:
	ldr	x8, [x8, #8]
	ldp	w9, w10, [x8]
	lsl	w1, w9, #16
	lsl	w20, w10, #16
	ldr	x9, [x8, #16]
	cbz	x9, LBB0_7
; %bb.5:
	ldr	w8, [x8, #8]
	cbz	w8, LBB0_7
; %bb.6:
	mul	w9, w1, w9
	sdiv	w1, w9, w8
LBB0_7:
Lloh47:
	adrp	x2, l_.str.11@PAGE
Lloh48:
	add	x2, x2, l_.str.11@PAGEOFF
	mov	x0, x19
	bl	_WRITE_U32
Lloh49:
	adrp	x2, l_.str.12@PAGE
Lloh50:
	add	x2, x2, l_.str.12@PAGEOFF
	mov	x0, x19
	mov	x1, x20
	bl	_WRITE_U32
	mov	x0, x19
	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	_STREAM_STATUS
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh49, Lloh50
	.loh AdrpAdd	Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_MP4_64BITS_TIME,4,2            ; @MP4_64BITS_TIME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"version"

l_.str.1:                               ; @.str.1
	.asciz	"flags"

l_.str.2:                               ; @.str.2
	.asciz	"creation_time"

l_.str.3:                               ; @.str.3
	.asciz	"modification_time"

l_.str.4:                               ; @.str.4
	.asciz	"track_ID"

l_.str.5:                               ; @.str.5
	.asciz	"reserved"

	.comm	_MP4_TIMESCALE,4,2              ; @MP4_TIMESCALE
l_.str.6:                               ; @.str.6
	.asciz	"duration"

l_.str.7:                               ; @.str.7
	.asciz	"layer"

l_.str.8:                               ; @.str.8
	.asciz	"alternate_group"

	.comm	_VC_CONTAINER_ES_TYPE_AUDIO,8,3 ; @VC_CONTAINER_ES_TYPE_AUDIO
l_.str.9:                               ; @.str.9
	.asciz	"volume"

l_.str.10:                              ; @.str.10
	.asciz	"matrix"

	.comm	_VC_CONTAINER_ES_TYPE_VIDEO,8,3 ; @VC_CONTAINER_ES_TYPE_VIDEO
	.comm	_VC_CONTAINER_ES_TYPE_SUBPICTURE,8,3 ; @VC_CONTAINER_ES_TYPE_SUBPICTURE
l_.str.11:                              ; @.str.11
	.asciz	"width"

l_.str.12:                              ; @.str.12
	.asciz	"height"

	.no_dead_strip	_mp4_write_box_tkhd
.subsections_via_symbols
