	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tmv_read_header
_tmv_read_header:                       ## @tmv_read_header
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %r13
	movq	8(%rdi), %r14
	movq	%r13, %rdi
	callq	_avio_rl32
	movq	_TMV_TAG@GOTPCREL(%rip), %rcx
	movl	$-1, %r15d
	cmpq	(%rcx), %rax
	jne	LBB0_20
## %bb.1:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_avformat_new_stream
	testq	%rax, %rax
	je	LBB0_21
## %bb.2:
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_avformat_new_stream
	testq	%rax, %rax
	je	LBB0_21
## %bb.3:
	movq	%rax, %r12
	movq	%r13, %rdi
	callq	_avio_rl16
	movq	(%r12), %rcx
	movl	%eax, (%rcx)
	testl	%eax, %eax
	je	LBB0_4
## %bb.6:
	movq	%r13, %rdi
	callq	_avio_rl16
	movl	%eax, (%r14)
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movq	%r13, %rdi
	callq	_avio_r8
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str.2(%rip), %rdx
	movq	%rbx, %rdi
	movl	%eax, %ecx
	jmp	LBB0_12
LBB0_21:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_4:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	jmp	LBB0_5
LBB0_7:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
LBB0_5:
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_20
LBB0_10:
	movq	%r13, %rdi
	callq	_avio_r8
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	callq	_avio_r8
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	imull	%eax, %ecx
	addl	%ecx, %ecx
	movl	%ecx, 4(%r14)
	movq	%r13, %rdi
	callq	_avio_r8
	movq	_TMV_PADDING@GOTPCREL(%rip), %r13
	movq	_TMV_STEREO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	(%r13), %ecx
	orl	%edx, %ecx
	notl	%ecx
	andl	%eax, %ecx
	je	LBB0_13
## %bb.11:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
	movq	%rbx, %rdi
LBB0_12:
	xorl	%eax, %eax
	callq	_av_log
LBB0_20:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	movq	_AVMEDIA_TYPE_AUDIO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	(%r12), %rdi
	movl	%ecx, 32(%rdi)
	movq	_AV_CODEC_ID_PCM_U8@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 28(%rdi)
	xorl	%ecx, %ecx
	testl	%eax, %edx
	sete	%cl
	movl	%eax, %r15d
	jne	LBB0_14
## %bb.15:
	movq	_AV_CH_LAYOUT_MONO@GOTPCREL(%rip), %rdx
	jmp	LBB0_16
LBB0_14:
	movq	_AV_CH_LAYOUT_STEREO@GOTPCREL(%rip), %rdx
LBB0_16:
	movl	$2, %esi
	subl	%ecx, %esi
	movl	(%rdx), %ecx
	movl	%esi, 4(%rdi)
	movl	%ecx, 36(%rdi)
	movl	$8, 8(%rdi)
	movl	(%rdi), %ecx
	leal	(,%rcx,8), %edx
	movl	%edx, 12(%rdi)
	movq	%r12, %rdi
	movl	$32, %esi
	movl	$1, %edx
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_avpriv_set_pts_info
	movq	(%r12), %rax
	movl	4(%rax), %edx
	imull	(%rax), %edx
	movl	%edx, -48(%rbp)
	movl	(%r14), %ecx
	leaq	-44(%rbp), %rsi
	movl	%ecx, -44(%rbp)
	leaq	-48(%rbp), %rdi
	movl	$-1, %r8d
	callq	_av_reduce
	movq	_AVMEDIA_TYPE_VIDEO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	(%r12), %rcx
	movl	%eax, 32(%rcx)
	movq	_AV_CODEC_ID_TMV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rcx)
	movq	_AV_PIX_FMT_PAL8@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rcx)
	shll	$3, %ebx
	movl	%ebx, 16(%rcx)
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	shll	$3, %eax
	movl	%eax, 20(%rcx)
	movl	-48(%rbp), %ecx
	movl	-44(%rbp), %edx
	movq	%r12, %rdi
	movl	$32, %esi
	callq	_avpriv_set_pts_info
	movl	4(%r14), %ecx
	testl	%r15d, (%r13)
	je	LBB0_17
## %bb.18:
	movl	(%r14), %edx
	leal	(%rdx,%rcx), %eax
	addl	$511, %eax                      ## imm = 0x1FF
                                        ## kill: def $edx killed $edx killed $rdx
	addl	%ecx, %edx
	andl	$-512, %eax                     ## imm = 0xFE00
	subl	%edx, %eax
	movl	%eax, 8(%r14)
	jmp	LBB0_19
LBB0_17:
	movl	8(%r14), %eax
LBB0_19:
	addl	%ecx, %eax
	imull	-48(%rbp), %eax
	shll	$3, %eax
	xorl	%r15d, %r15d
	xorl	%edx, %edx
	divl	-44(%rbp)
	movq	(%r12), %rcx
	movl	%eax, 12(%rcx)
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_TMV_TAG,8,3                    ## @TMV_TAG
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid sample rate\n"

L_.str.1:                               ## @.str.1
	.asciz	"invalid audio chunk size\n"

L_.str.2:                               ## @.str.2
	.asciz	"unsupported compression method %d\n"

	.comm	_TMV_PADDING,4,2                ## @TMV_PADDING
	.comm	_TMV_STEREO,4,2                 ## @TMV_STEREO
L_.str.3:                               ## @.str.3
	.asciz	"unsupported features 0x%02x\n"

	.comm	_AVMEDIA_TYPE_AUDIO,4,2         ## @AVMEDIA_TYPE_AUDIO
	.comm	_AV_CODEC_ID_PCM_U8,4,2         ## @AV_CODEC_ID_PCM_U8
	.comm	_AV_CH_LAYOUT_STEREO,4,2        ## @AV_CH_LAYOUT_STEREO
	.comm	_AV_CH_LAYOUT_MONO,4,2          ## @AV_CH_LAYOUT_MONO
	.comm	_AVMEDIA_TYPE_VIDEO,4,2         ## @AVMEDIA_TYPE_VIDEO
	.comm	_AV_CODEC_ID_TMV,4,2            ## @AV_CODEC_ID_TMV
	.comm	_AV_PIX_FMT_PAL8,4,2            ## @AV_PIX_FMT_PAL8
	.no_dead_strip	_tmv_read_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tmv_read_header
_tmv_read_header:                       ; @tmv_read_header
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x0
	ldp	x22, x25, [x0]
	mov	x0, x22
	bl	_avio_rl32
Lloh0:
	adrp	x8, _TMV_TAG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TMV_TAG@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_13
; %bb.1:
	mov	x0, x20
	mov	x1, #0
	bl	_avformat_new_stream
	cbz	x0, LBB0_7
; %bb.2:
	mov	x19, x0
	mov	x0, x20
	mov	x1, #0
	bl	_avformat_new_stream
	cbz	x0, LBB0_7
; %bb.3:
	mov	x21, x0
	mov	x0, x22
	bl	_avio_rl16
	ldr	x8, [x21]
	str	w0, [x8]
	cbz	w0, LBB0_8
; %bb.4:
	mov	x0, x22
	bl	_avio_rl16
	str	w0, [x25]
	cbz	w0, LBB0_9
; %bb.5:
	mov	x0, x22
	bl	_avio_r8
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_10
; %bb.6:
Lloh3:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	str	x0, [sp]
Lloh6:
	adrp	x2, l_.str.2@PAGE
Lloh7:
	add	x2, x2, l_.str.2@PAGEOFF
	b	LBB0_12
LBB0_7:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_AVERROR
LBB0_8:
Lloh11:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x2, l_.str@PAGE
Lloh15:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_12
LBB0_9:
Lloh16:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
Lloh19:
	adrp	x2, l_.str.1@PAGE
Lloh20:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_12
LBB0_10:
	mov	x0, x22
	bl	_avio_r8
	mov	x23, x0
	mov	x0, x22
	bl	_avio_r8
	mov	x24, x0
	mul	w8, w23, w0
	lsl	w8, w8, #1
	str	w8, [x25, #4]
	mov	x0, x22
	bl	_avio_r8
Lloh21:
	adrp	x26, _TMV_PADDING@GOTPAGE
Lloh22:
	ldr	x26, [x26, _TMV_PADDING@GOTPAGEOFF]
	ldr	w9, [x26]
Lloh23:
	adrp	x8, _TMV_STEREO@GOTPAGE
Lloh24:
	ldr	x8, [x8, _TMV_STEREO@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	orr	w9, w8, w9
	bics	w9, w0, w9
	b.eq	LBB0_15
; %bb.11:
Lloh26:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh27:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	str	x9, [sp]
Lloh29:
	adrp	x2, l_.str.3@PAGE
Lloh30:
	add	x2, x2, l_.str.3@PAGEOFF
LBB0_12:
	mov	x0, x20
	bl	_av_log
LBB0_13:
	mov	w0, #-1
LBB0_14:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_15:
	mov	x22, x0
Lloh31:
	adrp	x9, _AVMEDIA_TYPE_AUDIO@GOTPAGE
Lloh32:
	ldr	x9, [x9, _AVMEDIA_TYPE_AUDIO@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	ldr	x10, [x21]
Lloh34:
	adrp	x11, _AV_CODEC_ID_PCM_U8@GOTPAGE
Lloh35:
	ldr	x11, [x11, _AV_CODEC_ID_PCM_U8@GOTPAGEOFF]
Lloh36:
	ldr	w11, [x11]
	stp	w11, w9, [x10, #28]
	tst	w8, w0
	mov	w8, #1
Lloh37:
	adrp	x9, _AV_CH_LAYOUT_MONO@GOTPAGE
Lloh38:
	ldr	x9, [x9, _AV_CH_LAYOUT_MONO@GOTPAGEOFF]
	cinc	w8, w8, ne
Lloh39:
	adrp	x11, _AV_CH_LAYOUT_STEREO@GOTPAGE
Lloh40:
	ldr	x11, [x11, _AV_CH_LAYOUT_STEREO@GOTPAGEOFF]
	csel	x9, x9, x11, eq
	ldr	w9, [x9]
	str	w9, [x10, #36]
	mov	w9, #8
	stp	w8, w9, [x10, #4]
	ldr	w3, [x10]
	lsl	w8, w3, #3
	str	w8, [x10, #12]
	mov	x0, x21
	mov	w1, #32
	mov	w2, #1
	bl	_avpriv_set_pts_info
	ldr	x8, [x21]
	ldp	w9, w8, [x8]
	mul	w2, w8, w9
	ldr	w3, [x25]
	add	x8, sp, #8
	orr	x1, x8, #0x4
	stp	w2, w3, [sp, #8]
	add	x0, sp, #8
	mov	w4, #-1
	bl	_av_reduce
Lloh41:
	adrp	x8, _AVMEDIA_TYPE_VIDEO@GOTPAGE
Lloh42:
	ldr	x8, [x8, _AVMEDIA_TYPE_VIDEO@GOTPAGEOFF]
Lloh43:
	ldr	w8, [x8]
	ldr	x9, [x19]
	str	w8, [x9, #32]
Lloh44:
	adrp	x8, _AV_CODEC_ID_TMV@GOTPAGE
Lloh45:
	ldr	x8, [x8, _AV_CODEC_ID_TMV@GOTPAGEOFF]
Lloh46:
	ldr	w8, [x8]
Lloh47:
	adrp	x10, _AV_PIX_FMT_PAL8@GOTPAGE
Lloh48:
	ldr	x10, [x10, _AV_PIX_FMT_PAL8@GOTPAGEOFF]
Lloh49:
	ldr	w10, [x10]
	stp	w10, w8, [x9, #24]
	lsl	w8, w23, #3
	lsl	w10, w24, #3
	stp	w8, w10, [x9, #16]
	ldp	w3, w2, [sp, #8]
	mov	x0, x19
	mov	w1, #32
	bl	_avpriv_set_pts_info
	ldr	w9, [x26]
	ldr	w8, [x25, #4]
	tst	w9, w22
	b.eq	LBB0_17
; %bb.16:
	ldr	w9, [x25]
	add	w9, w9, w8
	add	w10, w9, #511
	and	w10, w10, #0xfffffe00
	sub	w9, w10, w9
	str	w9, [x25, #8]
	b	LBB0_18
LBB0_17:
	ldr	w9, [x25, #8]
LBB0_18:
	mov	w0, #0
	add	w8, w9, w8
	ldp	w9, w10, [sp, #8]
	mul	w8, w9, w8
	lsl	w8, w8, #3
	udiv	w8, w8, w10
	ldr	x9, [x19]
	str	w8, [x9, #12]
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_TMV_TAG,8,3                    ; @TMV_TAG
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid sample rate\n"

l_.str.1:                               ; @.str.1
	.asciz	"invalid audio chunk size\n"

l_.str.2:                               ; @.str.2
	.asciz	"unsupported compression method %d\n"

	.comm	_TMV_PADDING,4,2                ; @TMV_PADDING
	.comm	_TMV_STEREO,4,2                 ; @TMV_STEREO
l_.str.3:                               ; @.str.3
	.asciz	"unsupported features 0x%02x\n"

	.comm	_AVMEDIA_TYPE_AUDIO,4,2         ; @AVMEDIA_TYPE_AUDIO
	.comm	_AV_CODEC_ID_PCM_U8,4,2         ; @AV_CODEC_ID_PCM_U8
	.comm	_AV_CH_LAYOUT_STEREO,4,2        ; @AV_CH_LAYOUT_STEREO
	.comm	_AV_CH_LAYOUT_MONO,4,2          ; @AV_CH_LAYOUT_MONO
	.comm	_AVMEDIA_TYPE_VIDEO,4,2         ; @AVMEDIA_TYPE_VIDEO
	.comm	_AV_CODEC_ID_TMV,4,2            ; @AV_CODEC_ID_TMV
	.comm	_AV_PIX_FMT_PAL8,4,2            ; @AV_PIX_FMT_PAL8
	.no_dead_strip	_tmv_read_header
.subsections_via_symbols
