	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xvag_read_header
_xvag_read_header:                      ## @xvag_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	movl	$4, %esi
	callq	_avio_skip
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_avformat_new_stream
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %r14
	movq	_AVMEDIA_TYPE_AUDIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%r14), %rcx
	movl	%eax, 20(%rcx)
	movl	(%rbx), %edi
	callq	_avio_rl32
	movq	%rax, %r15
	movl	%r15d, %edi
	callq	_av_bswap32
	cmpl	%r15d, %eax
	jae	LBB0_4
## %bb.2:
	movl	%r15d, %edi
	callq	_av_bswap32
	movl	%eax, %r15d
	movl	(%rbx), %edi
	movl	$28, %esi
	callq	_avio_skip
	movl	(%rbx), %edi
	callq	_avio_rb32
	movq	%rax, %r12
	movl	(%rbx), %edi
	callq	_avio_rb32
	movq	(%r14), %rcx
	movl	%eax, (%rcx)
	movl	(%rbx), %edi
	movl	$4, %esi
	callq	_avio_skip
	movl	(%rbx), %edi
	callq	_avio_rb32
	movq	%rax, 16(%r14)
	movl	(%rbx), %edi
	movl	$8, %esi
	callq	_avio_skip
	movl	(%rbx), %edi
	callq	_avio_rb32
	jmp	LBB0_5
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_4:
	movl	(%rbx), %edi
	movl	$28, %esi
	callq	_avio_skip
	movl	(%rbx), %edi
	callq	_avio_rl32
	movq	%rax, %r12
	movl	(%rbx), %edi
	callq	_avio_rl32
	movq	(%r14), %rcx
	movl	%eax, (%rcx)
	movl	(%rbx), %edi
	movl	$4, %esi
	callq	_avio_skip
	movl	(%rbx), %edi
	callq	_avio_rl32
	movq	%rax, 16(%r14)
	movl	(%rbx), %edi
	movl	$8, %esi
	callq	_avio_skip
	movl	(%rbx), %edi
	callq	_avio_rl32
LBB0_5:
	movq	(%r14), %rcx
	movq	%rax, 8(%rcx)
	testq	%rax, %rax
	je	LBB0_12
## %bb.6:
	movl	(%rcx), %eax
	testl	%eax, %eax
	jle	LBB0_12
## %bb.7:
	movq	_FF_SANE_NB_CHANNELS@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	jg	LBB0_12
## %bb.8:
	cmpl	$28, %r12d
	jne	LBB0_15
## %bb.9:
	movq	_AV_CODEC_ID_ADPCM_PSX@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, 16(%rcx)
	shll	$4, %eax
	movl	%eax, 4(%rcx)
	movl	(%rbx), %r12d
	movl	%r12d, %edi
	callq	_avio_tell
	subl	%eax, %r15d
	movl	%r12d, %edi
	movl	%r15d, %esi
	callq	_avio_skip
	movl	(%rbx), %edi
	callq	_avio_rb16
	cmpl	$65531, %eax                    ## imm = 0xFFFB
	jne	LBB0_11
## %bb.10:
	movq	_AV_CODEC_ID_MP3@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%r14), %rcx
	movl	%eax, 16(%rcx)
	movl	$4096, 4(%rcx)                  ## imm = 0x1000
	movq	_AVSTREAM_PARSE_FULL_RAW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
LBB0_11:
	movl	(%rbx), %edi
	movl	$-2, %esi
	callq	_avio_skip
	movq	(%r14), %rax
	movq	8(%rax), %rcx
	movq	%r14, %rdi
	movl	$64, %esi
	movl	$1, %edx
	callq	_avpriv_set_pts_info
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_12:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %eax
LBB0_14:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r12d, %edx
	callq	_avpriv_request_sample
	movq	_AVERROR_PATCHWELCOME@GOTPCREL(%rip), %rax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AVMEDIA_TYPE_AUDIO,4,2         ## @AVMEDIA_TYPE_AUDIO
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_FF_SANE_NB_CHANNELS,4,2        ## @FF_SANE_NB_CHANNELS
	.comm	_AV_CODEC_ID_ADPCM_PSX,4,2      ## @AV_CODEC_ID_ADPCM_PSX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"codec %X"

	.comm	_AVERROR_PATCHWELCOME,4,2       ## @AVERROR_PATCHWELCOME
	.comm	_AV_CODEC_ID_MP3,4,2            ## @AV_CODEC_ID_MP3
	.comm	_AVSTREAM_PARSE_FULL_RAW,4,2    ## @AVSTREAM_PARSE_FULL_RAW
	.no_dead_strip	_xvag_read_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xvag_read_header
_xvag_read_header:                      ; @xvag_read_header
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldr	w0, [x0]
	mov	w1, #4
	bl	_avio_skip
	mov	x0, x19
	mov	x1, #0
	bl	_avformat_new_stream
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x8, _AVMEDIA_TYPE_AUDIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVMEDIA_TYPE_AUDIO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	x9, [x0]
	str	w8, [x9, #20]
	ldr	w0, [x19]
	bl	_avio_rl32
	mov	x21, x0
	bl	_av_bswap32
	cmp	w0, w21
	b.hs	LBB0_4
; %bb.2:
	mov	x0, x21
	bl	_av_bswap32
	mov	x21, x0
	ldr	w0, [x19]
	mov	w1, #28
	bl	_avio_skip
	ldr	w0, [x19]
	bl	_avio_rb32
	mov	x22, x0
	ldr	w0, [x19]
	bl	_avio_rb32
	ldr	x8, [x20]
	str	w0, [x8]
	ldr	w0, [x19]
	mov	w1, #4
	bl	_avio_skip
	ldr	w0, [x19]
	bl	_avio_rb32
	str	x0, [x20, #16]
	ldr	w0, [x19]
	mov	w1, #8
	bl	_avio_skip
	ldr	w0, [x19]
	bl	_avio_rb32
	b	LBB0_5
LBB0_3:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_AVERROR
LBB0_4:
	ldr	w0, [x19]
	mov	w1, #28
	bl	_avio_skip
	ldr	w0, [x19]
	bl	_avio_rl32
	mov	x22, x0
	ldr	w0, [x19]
	bl	_avio_rl32
	ldr	x8, [x20]
	str	w0, [x8]
	ldr	w0, [x19]
	mov	w1, #4
	bl	_avio_skip
	ldr	w0, [x19]
	bl	_avio_rl32
	str	x0, [x20, #16]
	ldr	w0, [x19]
	mov	w1, #8
	bl	_avio_skip
	ldr	w0, [x19]
	bl	_avio_rl32
LBB0_5:
	ldr	x8, [x20]
	str	x0, [x8, #8]
	cbz	x0, LBB0_12
; %bb.6:
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_12
; %bb.7:
Lloh6:
	adrp	x10, _FF_SANE_NB_CHANNELS@GOTPAGE
Lloh7:
	ldr	x10, [x10, _FF_SANE_NB_CHANNELS@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	cmp	w9, w10
	b.gt	LBB0_12
; %bb.8:
	cmp	w22, #28
	b.ne	LBB0_15
; %bb.9:
Lloh9:
	adrp	x10, _AV_CODEC_ID_ADPCM_PSX@GOTPAGE
Lloh10:
	ldr	x10, [x10, _AV_CODEC_ID_ADPCM_PSX@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	str	w10, [x8, #16]
	lsl	w9, w9, #4
	str	w9, [x8, #4]
	ldr	w22, [x19]
	mov	x0, x22
	bl	_avio_tell
	sub	w1, w21, w0
	mov	x0, x22
	bl	_avio_skip
	ldr	w0, [x19]
	bl	_avio_rb16
	mov	w8, #65531
	cmp	w0, w8
	b.ne	LBB0_11
; %bb.10:
Lloh12:
	adrp	x8, _AV_CODEC_ID_MP3@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AV_CODEC_ID_MP3@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	ldr	x9, [x20]
	str	w8, [x9, #16]
	mov	w8, #4096
	str	w8, [x9, #4]
Lloh15:
	adrp	x8, _AVSTREAM_PARSE_FULL_RAW@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AVSTREAM_PARSE_FULL_RAW@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	w8, [x20, #8]
LBB0_11:
	ldr	w0, [x19]
	mov	w1, #-2
	bl	_avio_skip
	ldr	x8, [x20]
	ldr	x3, [x8, #8]
	mov	x0, x20
	mov	w1, #64
	mov	w2, #1
	bl	_avpriv_set_pts_info
	mov	w0, #0
	b	LBB0_14
LBB0_12:
Lloh18:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
LBB0_13:
	ldr	w0, [x8]
LBB0_14:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_15:
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x22
	bl	_avpriv_request_sample
Lloh22:
	adrp	x8, _AVERROR_PATCHWELCOME@GOTPAGE
Lloh23:
	ldr	x8, [x8, _AVERROR_PATCHWELCOME@GOTPAGEOFF]
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AVMEDIA_TYPE_AUDIO,4,2         ; @AVMEDIA_TYPE_AUDIO
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_FF_SANE_NB_CHANNELS,4,2        ; @FF_SANE_NB_CHANNELS
	.comm	_AV_CODEC_ID_ADPCM_PSX,4,2      ; @AV_CODEC_ID_ADPCM_PSX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"codec %X"

	.comm	_AVERROR_PATCHWELCOME,4,2       ; @AVERROR_PATCHWELCOME
	.comm	_AV_CODEC_ID_MP3,4,2            ; @AV_CODEC_ID_MP3
	.comm	_AVSTREAM_PARSE_FULL_RAW,4,2    ; @AVSTREAM_PARSE_FULL_RAW
	.no_dead_strip	_xvag_read_header
.subsections_via_symbols
