	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vpk_read_header
_vpk_read_header:                       ## @vpk_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %r13
	movq	$0, 8(%r13)
	xorl	%esi, %esi
	callq	_avformat_new_stream
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	movq	%rax, %r14
	movl	(%rbx), %edi
	movl	$4, %esi
	callq	_avio_skip
	movl	(%rbx), %edi
	callq	_avio_rl32
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%rax,8), %ecx
	leal	(%rcx,%rcx,2), %ecx
	leal	(%rax,%rcx), %edx
	addl	$15, %edx
                                        ## kill: def $eax killed $eax killed $rax
	addl	%ecx, %eax
	cmovnsl	%eax, %edx
	sarl	$4, %edx
	movl	%edx, (%r14)
	movl	(%rbx), %edi
	callq	_avio_rl32
	movl	%eax, %r15d
	movq	_AVMEDIA_TYPE_AUDIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	8(%r14), %rcx
	movl	%eax, 16(%rcx)
	movq	_AV_CODEC_ID_ADPCM_PSX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rcx)
	movl	(%rbx), %edi
	callq	_avio_rl32
	movq	8(%r14), %rcx
	movl	%eax, (%rcx)
	movl	(%rbx), %edi
	callq	_avio_rl32
	movq	8(%r14), %rcx
	movl	%eax, 4(%rcx)
	testl	%eax, %eax
	jle	LBB0_3
## %bb.2:
	cmpl	$0, (%rcx)
	jle	LBB0_3
## %bb.4:
	movl	(%rbx), %edi
	callq	_avio_rl32
	movl	%eax, %ecx
	movq	8(%r14), %rax
	movl	%ecx, 8(%rax)
	testl	%ecx, %ecx
	jle	LBB0_3
## %bb.5:
	movl	(%rax), %eax
	cltd
	idivl	%ecx
	cltq
	leaq	(%rax,%rax,8), %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rax,%rdx), %rdi
	addq	$15, %rdi
	addq	%rax, %rdx
	cmovnsq	%rdx, %rdi
	shrq	$4, %rdi
	testl	%edi, %edi
	je	LBB0_3
## %bb.6:
	movl	(%r14), %esi
	leal	(%rdi,%rsi), %eax
	decl	%eax
	xorl	%r12d, %r12d
	xorl	%edx, %edx
	divl	%edi
	movl	%eax, (%r13)
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	%edi
	imull	%edx, %ecx
	shll	$4, %ecx
	shrl	$2, %ecx
	imulq	$613566757, %rcx, %rax          ## imm = 0x24924925
	shrq	$32, %rax
	movl	%eax, 4(%r13)
	movl	(%rbx), %edi
	callq	_avio_tell
	cmpl	%eax, %r15d
	jae	LBB0_7
LBB0_3:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_8:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_7:
	movl	(%rbx), %ebx
	movl	%ebx, %edi
	callq	_avio_tell
	subl	%eax, %r15d
	movl	%ebx, %edi
	movl	%r15d, %esi
	callq	_avio_skip
	movq	8(%r14), %rax
	movl	4(%rax), %ecx
	movq	%r14, %rdi
	movl	$64, %esi
	movl	$1, %edx
	callq	_avpriv_set_pts_info
	jmp	LBB0_8
	.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
	.no_dead_strip	_vpk_read_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vpk_read_header
_vpk_read_header:                       ; @vpk_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	x22, [x0, #8]
	str	xzr, [x22, #8]
	mov	x1, #0
	bl	_avformat_new_stream
	cbz	x0, LBB0_8
; %bb.1:
	mov	x19, x0
	ldr	w0, [x20]
	mov	w1, #4
	bl	_avio_skip
	ldr	w0, [x20]
	bl	_avio_rl32
	mov	w8, #28
	mul	w8, w0, w8
	add	w9, w8, #15
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #4
	str	w8, [x19]
	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, #12]
	ldr	w0, [x20]
	bl	_avio_rl32
	ldr	x8, [x19, #8]
	str	w0, [x8]
	ldr	w0, [x20]
	bl	_avio_rl32
	ldr	x8, [x19, #8]
	str	w0, [x8, #4]
	cmp	w0, #1
	b.lt	LBB0_6
; %bb.2:
	ldr	w8, [x8]
	cmp	w8, #0
	b.le	LBB0_6
; %bb.3:
	ldr	w0, [x20]
	bl	_avio_rl32
	ldr	x8, [x19, #8]
	str	w0, [x8, #8]
	cmp	w0, #0
	b.le	LBB0_6
; %bb.4:
	ldr	w8, [x8]
	sdiv	w8, w8, w0
	mov	w9, #28
	smull	x8, w8, w9
	add	x9, x8, #15
	cmp	x8, #0
	csel	x8, x9, x8, lt
	lsr	x8, x8, #4
	cbz	w8, LBB0_6
; %bb.5:
	ldr	w9, [x19]
	add	w10, w8, w9
	sub	w10, w10, #1
	udiv	w10, w10, w8
	udiv	w11, w9, w8
	msub	w8, w11, w8, w9
	mul	w8, w0, w8
	ubfiz	w8, w8, #2, #28
	mov	w9, #18725
	movk	w9, #9362, lsl #16
	umull	x8, w8, w9
	lsr	x8, x8, #32
	stp	w10, w8, [x22]
	ldr	w0, [x20]
	bl	_avio_tell
	cmp	w21, w0
	b.hs	LBB0_9
LBB0_6:
Lloh6:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
LBB0_7:
	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_8:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	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_9:
	ldr	w20, [x20]
	mov	x0, x20
	bl	_avio_tell
	sub	w1, w21, w0
	mov	x0, x20
	bl	_avio_skip
	ldr	x8, [x19, #8]
	ldr	w3, [x8, #4]
	mov	x0, x19
	mov	w1, #64
	mov	w2, #1
	bl	_avpriv_set_pts_info
	mov	w0, #0
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.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
	.no_dead_strip	_vpk_read_header
.subsections_via_symbols
