	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rsd_read_packet
_rsd_read_packet:                       ## @rsd_read_packet
	.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	%rsi, %r15
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	(%rax), %rax
	movq	(%rax), %rbx
	movl	(%rdi), %edi
	callq	_avio_feof
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	jmp	LBB0_29
LBB0_2:
	movl	(%r14), %edi
	callq	_avio_tell
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	(%rbx), %rax
	movq	_AV_CODEC_ID_ADPCM_IMA_RAD@GOTPCREL(%rip), %rcx
	movq	_AV_CODEC_ID_XMA2@GOTPCREL(%rip), %r13
	cmpq	(%rcx), %rax
	je	LBB0_22
## %bb.3:
	movq	_AV_CODEC_ID_ADPCM_PSX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_22
## %bb.4:
	movq	_AV_CODEC_ID_ADPCM_IMA_WAV@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_22
## %bb.5:
	cmpq	(%r13), %rax
	je	LBB0_22
## %bb.6:
	movq	16(%rbx), %r12
	movl	$87, %edi
	movl	$65, %esi
	movl	$68, %edx
	movl	$80, %ecx
	callq	_MKTAG
	movl	$1024, %edx                     ## imm = 0x400
	cmpq	%rax, %r12
	jne	LBB0_23
## %bb.7:
	cmpl	$2, 24(%rbx)
	jl	LBB0_23
## %bb.8:
	movl	8(%rbx), %esi
	movq	%r15, %rdi
	callq	_av_new_packet
	testl	%eax, %eax
	js	LBB0_30
## %bb.9:
	cmpl	$0, 24(%rbx)
	jle	LBB0_32
## %bb.10:
	movq	%rbx, %r13
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	callq	_avio_r8
	movq	(%r15), %rcx
	movl	%ebx, %edx
	movl	%eax, (%rcx,%rdx,4)
	movl	(%r14), %edi
	callq	_avio_r8
	movq	(%r15), %rcx
	leal	1(%rbx), %edx
	movl	%eax, (%rcx,%rdx,4)
	incq	%r12
	movslq	24(%r13), %rax
	addl	$8, %ebx
	cmpq	%rax, %r12
	jl	LBB0_11
## %bb.12:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	testl	%eax, %eax
	jle	LBB0_31
## %bb.13:
	movl	$3, %ebx
	xorl	%r12d, %r12d
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	callq	_avio_r8
	movq	(%r15), %rcx
	leal	-1(%rbx), %edx
	movl	%eax, (%rcx,%rdx,4)
	movl	(%r14), %edi
	callq	_avio_r8
	movq	(%r15), %rcx
	movl	%ebx, %edx
	movl	%eax, (%rcx,%rdx,4)
	incq	%r12
	movslq	24(%r13), %rax
	addl	$8, %ebx
	cmpq	%rax, %r12
	jl	LBB0_14
## %bb.15:
	testl	%eax, %eax
	jle	LBB0_31
## %bb.16:
	movl	$5, %ebx
	xorl	%r12d, %r12d
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	callq	_avio_r8
	movq	(%r15), %rcx
	leal	-1(%rbx), %edx
	movl	%eax, (%rcx,%rdx,4)
	movl	(%r14), %edi
	callq	_avio_r8
	movq	(%r15), %rcx
	movl	%ebx, %edx
	movl	%eax, (%rcx,%rdx,4)
	incq	%r12
	movslq	24(%r13), %rax
	addl	$8, %ebx
	cmpq	%rax, %r12
	jl	LBB0_17
## %bb.18:
	testl	%eax, %eax
	jle	LBB0_31
## %bb.19:
	movl	$7, %ebx
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	callq	_avio_r8
	movq	(%r15), %rcx
	leal	-1(%rbx), %edx
	movl	%eax, (%rcx,%rdx,4)
	movl	(%r14), %edi
	callq	_avio_r8
	movq	(%r15), %rcx
	movl	%ebx, %edx
	movl	%eax, (%rcx,%rdx,4)
	incq	%r13
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movslq	24(%rax), %rax
	addl	$8, %ebx
	cmpq	%rax, %r13
	jl	LBB0_20
## %bb.21:
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	_AV_CODEC_ID_XMA2@GOTPCREL(%rip), %r13
	jmp	LBB0_25
LBB0_22:
	movl	8(%rbx), %edx
LBB0_23:
	movl	(%r14), %edi
	movq	%r15, %rsi
	callq	_av_get_packet
	movl	%eax, %r12d
LBB0_24:
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
LBB0_25:
	movq	(%rbx), %rax
	cmpq	(%r13), %rax
	jne	LBB0_28
## %bb.26:
	cmpl	$0, 8(%r15)
	jle	LBB0_28
## %bb.27:
	movq	(%r15), %rax
	movl	(%rax), %eax
	andl	$-4, %eax
	shll	$7, %eax
	movl	%eax, 12(%r15)
LBB0_28:
	movl	%ecx, 24(%r15)
	movq	$0, 16(%r15)
LBB0_29:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_30:
	movl	%eax, %r12d
	jmp	LBB0_29
LBB0_31:
	xorl	%r12d, %r12d
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	_AV_CODEC_ID_XMA2@GOTPCREL(%rip), %r13
	jmp	LBB0_24
LBB0_32:
	xorl	%r12d, %r12d
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.comm	_AV_CODEC_ID_ADPCM_IMA_RAD,8,3  ## @AV_CODEC_ID_ADPCM_IMA_RAD
	.comm	_AV_CODEC_ID_ADPCM_PSX,8,3      ## @AV_CODEC_ID_ADPCM_PSX
	.comm	_AV_CODEC_ID_ADPCM_IMA_WAV,8,3  ## @AV_CODEC_ID_ADPCM_IMA_WAV
	.comm	_AV_CODEC_ID_XMA2,8,3           ## @AV_CODEC_ID_XMA2
	.no_dead_strip	_rsd_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rsd_read_packet
_rsd_read_packet:                       ; @rsd_read_packet
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
	mov	x21, x0
	ldr	x8, [x0, #8]
	ldr	x8, [x8]
	ldr	x22, [x8]
	ldr	w0, [x0]
	bl	_avio_feof
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	b	LBB0_25
LBB0_2:
	ldr	w0, [x21]
	bl	_avio_tell
	mov	x20, x0
	ldr	x8, [x22]
Lloh3:
	adrp	x9, _AV_CODEC_ID_ADPCM_IMA_RAD@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AV_CODEC_ID_ADPCM_IMA_RAD@GOTPAGEOFF]
Lloh5:
	adrp	x10, _AV_CODEC_ID_ADPCM_PSX@GOTPAGE
Lloh6:
	ldr	x10, [x10, _AV_CODEC_ID_ADPCM_PSX@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
Lloh8:
	ldr	x10, [x10]
Lloh9:
	adrp	x11, _AV_CODEC_ID_ADPCM_IMA_WAV@GOTPAGE
Lloh10:
	ldr	x11, [x11, _AV_CODEC_ID_ADPCM_IMA_WAV@GOTPAGEOFF]
Lloh11:
	adrp	x23, _AV_CODEC_ID_XMA2@GOTPAGE
Lloh12:
	ldr	x23, [x23, _AV_CODEC_ID_XMA2@GOTPAGEOFF]
Lloh13:
	ldr	x11, [x11]
	ldr	x12, [x23]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	ccmp	x8, x11, #4, ne
	ccmp	x8, x12, #4, ne
	b.ne	LBB0_4
; %bb.3:
	ldr	w2, [x22, #8]
	b	LBB0_20
LBB0_4:
	ldr	x24, [x22, #16]
	mov	w0, #87
	mov	w1, #65
	mov	w2, #68
	mov	w3, #80
	bl	_MKTAG
	cmp	x24, x0
	b.ne	LBB0_19
; %bb.5:
	ldr	w8, [x22, #24]
	cmp	w8, #2
	b.lt	LBB0_19
; %bb.6:
	ldr	w1, [x22, #8]
	mov	x0, x19
	bl	_av_new_packet
	tbnz	w0, #31, LBB0_25
; %bb.7:
	ldr	w8, [x22, #24]
	cmp	w8, #1
	b.lt	LBB0_26
; %bb.8:
	mov	w24, #0
	mov	x25, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	bl	_avio_r8
	ldr	x8, [x19]
	str	w0, [x8, w24, uxtw #2]
	ldr	w0, [x21]
	bl	_avio_r8
	ldr	x8, [x19]
	add	w9, w24, #1
	str	w0, [x8, w9, uxtw #2]
	add	x25, x25, #1
	ldrsw	x8, [x22, #24]
	add	w24, w24, #8
	cmp	x25, x8
	b.lt	LBB0_9
; %bb.10:
	cmp	w8, #1
	b.lt	LBB0_26
; %bb.11:
	mov	x24, #0
	mov	w25, #3
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	bl	_avio_r8
	ldr	x8, [x19]
	sub	w9, w25, #1
	str	w0, [x8, w9, uxtw #2]
	ldr	w0, [x21]
	bl	_avio_r8
	ldr	x8, [x19]
	str	w0, [x8, w25, uxtw #2]
	add	x24, x24, #1
	ldrsw	x8, [x22, #24]
	add	w25, w25, #8
	cmp	x24, x8
	b.lt	LBB0_12
; %bb.13:
	cmp	w8, #1
	b.lt	LBB0_26
; %bb.14:
	mov	x24, #0
	mov	w25, #5
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	bl	_avio_r8
	ldr	x8, [x19]
	sub	w9, w25, #1
	str	w0, [x8, w9, uxtw #2]
	ldr	w0, [x21]
	bl	_avio_r8
	ldr	x8, [x19]
	str	w0, [x8, w25, uxtw #2]
	add	x24, x24, #1
	ldrsw	x8, [x22, #24]
	add	w25, w25, #8
	cmp	x24, x8
	b.lt	LBB0_15
; %bb.16:
	cmp	w8, #1
	b.lt	LBB0_26
; %bb.17:
	mov	x24, #0
	mov	w25, #7
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	bl	_avio_r8
	ldr	x8, [x19]
	sub	w9, w25, #1
	str	w0, [x8, w9, uxtw #2]
	ldr	w0, [x21]
	bl	_avio_r8
	mov	x8, x0
	mov	w0, #0
	ldr	x9, [x19]
	str	w8, [x9, w25, uxtw #2]
	add	x24, x24, #1
	ldrsw	x8, [x22, #24]
	add	w25, w25, #8
	cmp	x24, x8
	b.lt	LBB0_18
	b	LBB0_21
LBB0_19:
	mov	w2, #1024
LBB0_20:
	ldr	w0, [x21]
	mov	x1, x19
	bl	_av_get_packet
LBB0_21:
	ldr	x8, [x22]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_24
; %bb.22:
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_24
; %bb.23:
	ldr	x8, [x19]
	ldr	w8, [x8]
	lsl	w8, w8, #7
	and	w8, w8, #0xfffffe00
	str	w8, [x19, #12]
LBB0_24:
	str	w20, [x19, #24]
	str	xzr, [x19, #16]
LBB0_25:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_26:
	mov	w0, #0
	b	LBB0_21
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh13
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.comm	_AV_CODEC_ID_ADPCM_IMA_RAD,8,3  ; @AV_CODEC_ID_ADPCM_IMA_RAD
	.comm	_AV_CODEC_ID_ADPCM_PSX,8,3      ; @AV_CODEC_ID_ADPCM_PSX
	.comm	_AV_CODEC_ID_ADPCM_IMA_WAV,8,3  ; @AV_CODEC_ID_ADPCM_IMA_WAV
	.comm	_AV_CODEC_ID_XMA2,8,3           ; @AV_CODEC_ID_XMA2
	.no_dead_strip	_rsd_read_packet
.subsections_via_symbols
