	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mpc8_read_header
_mpc8_read_header:                      ## @mpc8_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, %r14
	movq	(%rdi), %r13
	movq	8(%rdi), %rbx
	movl	$0, -48(%rbp)
	movq	%r13, %rdi
	callq	_avio_tell
	movl	%eax, (%rbx)
	movq	%r13, %rdi
	callq	_avio_rl32
	movq	_TAG_MPCK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.1:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	callq	_avio_feof
	testl	%eax, %eax
	je	LBB0_12
LBB0_2:
	movl	-48(%rbp), %eax
	movq	_TAG_STREAMHDR@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_11
## %bb.3:
	movq	%r13, %rdi
	callq	_avio_tell
	movl	%eax, %r15d
	movq	%r13, %rdi
	movl	$4, %esi
	callq	_avio_skip
	movq	%r13, %rdi
	callq	_avio_r8
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	%eax, 4(%rbx)
	cmpl	$8, %eax
	jne	LBB0_16
## %bb.4:
	movq	%r13, %rdi
	callq	_ffio_read_varlen
	movl	%eax, 8(%rbx)
	movq	%r13, %rdi
	callq	_ffio_read_varlen
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_avformat_new_stream
	testq	%rax, %rax
	je	LBB0_17
## %bb.5:
	movq	%rax, %r12
	movq	_AVMEDIA_TYPE_AUDIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	8(%r12), %rsi
	movl	%eax, 24(%rsi)
	movq	_AV_CODEC_ID_MUSEPACK8@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rsi)
	movl	$16, (%rsi)
	movq	%r14, %rdi
	movq	%r13, %rdx
	movl	$2, %ecx
	callq	_ff_get_extradata
	testq	%rax, %rax
	js	LBB0_17
## %bb.6:
	movq	8(%r12), %rcx
	movq	8(%rcx), %rdx
	movl	4(%rdx), %eax
	sarl	$4, %eax
	incl	%eax
	movl	%eax, 4(%rcx)
	movq	_mpc8_rate@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rdx), %esi
	sarl	$5, %esi
	movslq	%esi, %rsi
	movl	(%rax,%rsi,4), %eax
	movl	%eax, 16(%rcx)
	movb	4(%rdx), %cl
	addb	%cl, %cl
	andb	$6, %cl
	movl	$1152, %ebx                     ## imm = 0x480
	movl	$1152, %edx                     ## imm = 0x480
	shll	%cl, %edx
	movq	%r12, %rdi
	movl	$32, %esi
	movl	%eax, %ecx
	callq	_avpriv_set_pts_info
	movq	$0, 16(%r12)
	movq	8(%r12), %rax
	movq	8(%rax), %rax
	movb	4(%rax), %cl
	addb	%cl, %cl
	andb	$6, %cl
	shll	%cl, %ebx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %eax
	cltd
	idivl	%ebx
	movl	%eax, (%r12)
	movq	%r13, %rdi
	callq	_avio_tell
	subl	%eax, %r15d
	addl	-44(%rbp), %r15d
	movl	%r15d, -44(%rbp)
	testl	%r15d, %r15d
	jle	LBB0_8
## %bb.7:
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_avio_skip
LBB0_8:
	movq	_AVIO_SEEKABLE_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%r15d, %r15d
	testl	%eax, (%r13)
	je	LBB0_21
## %bb.9:
	movq	(%r14), %rdi
	callq	_avio_tell
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_ff_ape_parse_tag
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, 12(%rcx)
	movq	(%r14), %rdi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, %esi
	callq	_avio_seek
	jmp	LBB0_21
LBB0_10:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	jmp	LBB0_19
LBB0_11:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	jmp	LBB0_19
LBB0_12:
	leaq	-48(%rbp), %r15
	leaq	-44(%rbp), %r12
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_avio_tell
	movl	%eax, %ebx
	movq	%r13, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	callq	_mpc8_get_chunk_header
	movl	-44(%rbp), %ecx
	testl	%ecx, %ecx
	js	LBB0_18
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	-48(%rbp), %esi
	movq	_TAG_STREAMHDR@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	je	LBB0_2
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_mpc8_handle_chunk
	movq	%r13, %rdi
	callq	_avio_feof
	testl	%eax, %eax
	je	LBB0_13
	jmp	LBB0_2
LBB0_16:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_avpriv_report_missing_feature
	movq	_AVERROR_PATCHWELCOME@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_17:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r15d
	jmp	LBB0_21
LBB0_18:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
LBB0_19:
	movq	%r14, %rdi
	callq	_av_log
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
LBB0_20:
	movl	(%rax), %r15d
LBB0_21:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TAG_MPCK,8,3                   ## @TAG_MPCK
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Not a Musepack8 file\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
L_.str.1:                               ## @.str.1
	.asciz	"Invalid chunk length\n"

	.comm	_TAG_STREAMHDR,4,2              ## @TAG_STREAMHDR
L_.str.2:                               ## @.str.2
	.asciz	"Stream header not found\n"

L_.str.3:                               ## @.str.3
	.asciz	"Stream version %d"

	.comm	_AVERROR_PATCHWELCOME,4,2       ## @AVERROR_PATCHWELCOME
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AVMEDIA_TYPE_AUDIO,4,2         ## @AVMEDIA_TYPE_AUDIO
	.comm	_AV_CODEC_ID_MUSEPACK8,4,2      ## @AV_CODEC_ID_MUSEPACK8
	.comm	_mpc8_rate,8,3                  ## @mpc8_rate
	.comm	_AVIO_SEEKABLE_NORMAL,4,2       ## @AVIO_SEEKABLE_NORMAL
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.no_dead_strip	_mpc8_read_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mpc8_read_header
_mpc8_read_header:                      ; @mpc8_read_header
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
	ldp	x20, x23, [x0]
	str	wzr, [sp, #12]
	mov	x0, x20
	bl	_avio_tell
	str	w0, [x23]
	mov	x0, x20
	bl	_avio_rl32
Lloh0:
	adrp	x8, _TAG_MPCK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TAG_MPCK@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.1:
	mov	x0, x20
	bl	_avio_feof
	cbz	w0, LBB0_13
LBB0_2:
	ldr	w8, [sp, #12]
Lloh3:
	adrp	x9, _TAG_STREAMHDR@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TAG_STREAMHDR@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_12
; %bb.3:
	mov	x0, x20
	bl	_avio_tell
	mov	x21, x0
	mov	x0, x20
	mov	w1, #4
	bl	_avio_skip
	mov	x0, x20
	bl	_avio_r8
	str	w0, [x23, #4]
	cmp	w0, #8
	b.ne	LBB0_17
; %bb.4:
	mov	x0, x20
	bl	_ffio_read_varlen
	str	w0, [x23, #8]
	mov	x0, x20
	bl	_ffio_read_varlen
	mov	x0, x19
	mov	x1, #0
	bl	_avformat_new_stream
	cbz	x0, LBB0_18
; %bb.5:
	mov	x22, x0
Lloh6:
	adrp	x8, _AVMEDIA_TYPE_AUDIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AVMEDIA_TYPE_AUDIO@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _AV_CODEC_ID_MUSEPACK8@GOTPAGE
Lloh10:
	ldr	x9, [x9, _AV_CODEC_ID_MUSEPACK8@GOTPAGEOFF]
	ldr	x1, [x0, #8]
Lloh11:
	ldr	w9, [x9]
	stp	w9, w8, [x1, #20]
	mov	w8, #16
	str	w8, [x1]
	mov	x0, x19
	mov	x2, x20
	mov	w3, #2
	bl	_ff_get_extradata
	tbnz	x0, #63, LBB0_18
; %bb.6:
	ldr	x8, [x22, #8]
	ldr	x9, [x8, #8]
	ldr	w10, [x9, #4]
	asr	w10, w10, #4
	add	w10, w10, #1
Lloh12:
	adrp	x11, _mpc8_rate@GOTPAGE
Lloh13:
	ldr	x11, [x11, _mpc8_rate@GOTPAGEOFF]
	str	w10, [x8, #4]
Lloh14:
	ldr	x10, [x11]
	ldr	w11, [x9]
	asr	w11, w11, #5
	ldr	w3, [x10, w11, sxtw #2]
	str	w3, [x8, #16]
	ldr	w8, [x9, #4]
	ubfiz	w8, w8, #1, #2
	mov	w24, #1152
	lsl	w2, w24, w8
	mov	x0, x22
	mov	w1, #32
	bl	_avpriv_set_pts_info
	str	xzr, [x22, #16]
	ldr	w8, [x23, #8]
	ldr	x9, [x22, #8]
	ldr	x9, [x9, #8]
	ldr	w9, [x9, #4]
	ubfiz	w9, w9, #1, #2
	lsl	w9, w24, w9
	sdiv	w8, w8, w9
	str	w8, [x22]
	mov	x0, x20
	bl	_avio_tell
	ldr	w8, [sp, #8]
	sub	w9, w21, w0
	add	w1, w9, w8
	str	w1, [sp, #8]
	cmp	w1, #1
	b.lt	LBB0_8
; %bb.7:
	mov	x0, x20
	bl	_avio_skip
LBB0_8:
	ldr	w8, [x20]
Lloh15:
	adrp	x9, _AVIO_SEEKABLE_NORMAL@GOTPAGE
Lloh16:
	ldr	x9, [x9, _AVIO_SEEKABLE_NORMAL@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:
	ldr	x0, [x19]
	bl	_avio_tell
	mov	x20, x0
	mov	x0, x19
	bl	_ff_ape_parse_tag
	str	w0, [x23, #12]
	ldr	x0, [x19]
Lloh18:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	mov	x1, x20
	bl	_avio_seek
LBB0_10:
	mov	w0, #0
	b	LBB0_22
LBB0_11:
Lloh21:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x2, l_.str@PAGE
Lloh25:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_20
LBB0_12:
Lloh26:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh27:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
Lloh29:
	adrp	x2, l_.str.2@PAGE
Lloh30:
	add	x2, x2, l_.str.2@PAGEOFF
	b	LBB0_20
LBB0_13:
Lloh31:
	adrp	x22, _TAG_STREAMHDR@GOTPAGE
Lloh32:
	ldr	x22, [x22, _TAG_STREAMHDR@GOTPAGEOFF]
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_avio_tell
	mov	x21, x0
	add	x1, sp, #12
	add	x2, sp, #8
	mov	x0, x20
	bl	_mpc8_get_chunk_header
	ldr	w3, [sp, #8]
	tbnz	w3, #31, LBB0_19
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w1, [sp, #12]
	ldr	w8, [x22]
	cmp	w1, w8
	b.eq	LBB0_2
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	x0, x19
	mov	x2, x21
	bl	_mpc8_handle_chunk
	mov	x0, x20
	bl	_avio_feof
	cbz	w0, LBB0_14
	b	LBB0_2
LBB0_17:
	mov	x2, x0
Lloh33:
	adrp	x1, l_.str.3@PAGE
Lloh34:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_avpriv_report_missing_feature
Lloh35:
	adrp	x8, _AVERROR_PATCHWELCOME@GOTPAGE
Lloh36:
	ldr	x8, [x8, _AVERROR_PATCHWELCOME@GOTPAGEOFF]
	b	LBB0_21
LBB0_18:
Lloh37:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh39:
	ldr	w0, [x8]
	bl	_AVERROR
	b	LBB0_22
LBB0_19:
Lloh40:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh41:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh42:
	ldr	w1, [x8]
Lloh43:
	adrp	x2, l_.str.1@PAGE
Lloh44:
	add	x2, x2, l_.str.1@PAGEOFF
LBB0_20:
	mov	x0, x19
	bl	_av_log
Lloh45:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh46:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
LBB0_21:
	ldr	w0, [x8]
LBB0_22:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.comm	_TAG_MPCK,8,3                   ; @TAG_MPCK
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Not a Musepack8 file\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
l_.str.1:                               ; @.str.1
	.asciz	"Invalid chunk length\n"

	.comm	_TAG_STREAMHDR,4,2              ; @TAG_STREAMHDR
l_.str.2:                               ; @.str.2
	.asciz	"Stream header not found\n"

l_.str.3:                               ; @.str.3
	.asciz	"Stream version %d"

	.comm	_AVERROR_PATCHWELCOME,4,2       ; @AVERROR_PATCHWELCOME
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AVMEDIA_TYPE_AUDIO,4,2         ; @AVMEDIA_TYPE_AUDIO
	.comm	_AV_CODEC_ID_MUSEPACK8,4,2      ; @AV_CODEC_ID_MUSEPACK8
	.comm	_mpc8_rate,8,3                  ; @mpc8_rate
	.comm	_AVIO_SEEKABLE_NORMAL,4,2       ; @AVIO_SEEKABLE_NORMAL
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.no_dead_strip	_mpc8_read_header
.subsections_via_symbols
