	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function svag_read_header
_svag_read_header:                      ## @svag_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -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_8
## %bb.1:
	movq	%rax, %r14
	movl	(%rbx), %edi
	callq	_avio_rl32
	movq	%rax, %r15
	movq	_AVMEDIA_TYPE_AUDIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	8(%r14), %rcx
	movl	%eax, 20(%rcx)
	movq	_AV_CODEC_ID_ADPCM_PSX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rcx)
	movl	(%rbx), %edi
	callq	_avio_rl32
	movq	8(%r14), %rcx
	movq	%rax, 8(%rcx)
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movl	(%rbx), %edi
	callq	_avio_rl32
	movq	%rax, %rcx
	movq	8(%r14), %rax
	movl	%ecx, (%rax)
	leal	-9(%rcx), %eax
	cmpl	$-9, %eax
	jbe	LBB0_2
## %bb.4:
	shll	$4, %ecx
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%rax,8), %ecx
	leal	(%rcx,%rcx,2), %ecx
	addl	%eax, %ecx
	movl	%ecx, (%r14)
	movl	(%rbx), %edi
	callq	_avio_rl32
	movq	%rax, %rcx
	testl	%ecx, %ecx
	je	LBB0_2
## %bb.5:
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	8(%r14), %rsi
	movl	(%rsi), %edi
	xorl	%r15d, %r15d
	xorl	%edx, %edx
	divl	%edi
	cmpl	%ecx, %eax
	jae	LBB0_6
LBB0_2:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_7:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_6:
	imull	%ecx, %edi
	movl	%edi, 4(%rsi)
	movl	(%rbx), %ebx
	movl	%ebx, %edi
	callq	_avio_tell
	movl	$2048, %esi                     ## imm = 0x800
	subl	%eax, %esi
	movl	%ebx, %edi
	callq	_avio_skip
	movq	8(%r14), %rax
	movq	8(%rax), %rcx
	movq	%r14, %rdi
	movl	$64, %esi
	movl	$1, %edx
	callq	_avpriv_set_pts_info
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AVMEDIA_TYPE_AUDIO,4,2         ## @AVMEDIA_TYPE_AUDIO
	.comm	_AV_CODEC_ID_ADPCM_PSX,4,2      ## @AV_CODEC_ID_ADPCM_PSX
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.no_dead_strip	_svag_read_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function svag_read_header
_svag_read_header:                      ; @svag_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	x20, x0
	ldr	w0, [x0]
	mov	w1, #4
	bl	_avio_skip
	mov	x0, x20
	mov	x1, #0
	bl	_avformat_new_stream
	cbz	x0, LBB0_7
; %bb.1:
	mov	x19, x0
	ldr	w0, [x20]
	bl	_avio_rl32
	mov	x21, x0
Lloh0:
	adrp	x8, _AVMEDIA_TYPE_AUDIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVMEDIA_TYPE_AUDIO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	x9, [x19, #8]
Lloh3:
	adrp	x10, _AV_CODEC_ID_ADPCM_PSX@GOTPAGE
Lloh4:
	ldr	x10, [x10, _AV_CODEC_ID_ADPCM_PSX@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	stp	w10, w8, [x9, #16]
	ldr	w0, [x20]
	bl	_avio_rl32
	ldr	x8, [x19, #8]
	str	x0, [x8, #8]
	cbz	x0, LBB0_5
; %bb.2:
	ldr	w0, [x20]
	bl	_avio_rl32
	ldr	x8, [x19, #8]
	str	w0, [x8]
	sub	w8, w0, #9
	cmn	w8, #9
	b.ls	LBB0_5
; %bb.3:
	lsl	w8, w0, #4
	udiv	w8, w21, w8
	mov	w9, #28
	mul	w8, w8, w9
	str	w8, [x19]
	ldr	w0, [x20]
	bl	_avio_rl32
	cbz	w0, LBB0_5
; %bb.4:
Lloh6:
	adrp	x8, _INT_MAX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _INT_MAX@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x8]
	ldr	x8, [x19, #8]
	ldr	w9, [x8]
	udiv	w10, w10, w9
	cmp	w10, w0
	b.hs	LBB0_8
LBB0_5:
Lloh9:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
LBB0_6:
	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_7:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	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_8:
	mul	w9, w9, w0
	str	w9, [x8, #4]
	ldr	w20, [x20]
	mov	x0, x20
	bl	_avio_tell
	mov	w8, #2048
	sub	w1, w8, w0
	mov	x0, x20
	bl	_avio_skip
	ldr	x8, [x19, #8]
	ldr	x3, [x8, #8]
	mov	x0, x19
	mov	w1, #64
	mov	w2, #1
	bl	_avpriv_set_pts_info
	mov	w0, #0
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AVMEDIA_TYPE_AUDIO,4,2         ; @AVMEDIA_TYPE_AUDIO
	.comm	_AV_CODEC_ID_ADPCM_PSX,4,2      ; @AV_CODEC_ID_ADPCM_PSX
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.no_dead_strip	_svag_read_header
.subsections_via_symbols
