	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_packet
_read_packet:                           ## @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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	16(%rdi), %rax
	movq	(%rax), %rax
	movq	(%rax), %r13
	movq	8(%rdi), %r12
	movl	(%rdi), %edi
	callq	_avio_feof
	testq	%rax, %rax
	je	LBB0_4
LBB0_1:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
LBB0_2:
	movl	(%rax), %r15d
LBB0_3:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	(%r12), %rax
	movq	8(%r12), %rcx
	incq	%rax
	movq	%rax, (%r12)
	cmpq	%rcx, %rax
	jne	LBB0_9
## %bb.5:
	movl	16(%r12), %r15d
	movl	20(%r12), %r8d
	movl	24(%r12), %r9d
	movl	%r15d, %eax
	shll	$4, %eax
	subl	%r15d, %eax
	subl	%r15d, %eax
	leal	7(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$3, %ecx
	cmpl	%ecx, %r8d
	jge	LBB0_11
## %bb.6:
	movslq	%r8d, %rax
	imulq	$-1840700269, %rax, %rcx        ## imm = 0x92492493
	shrq	$32, %rcx
	addl	%r8d, %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	sarl	$3, %ecx
	addl	%eax, %ecx
	leal	(,%rcx,8), %r15d
	movl	%ecx, %edx
	shll	$4, %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	addl	%ecx, %eax
	addl	%r8d, %eax
	je	LBB0_11
## %bb.7:
	incb	%al
	movl	%eax, %ecx
	shrb	$7, %cl
	addb	%al, %cl
	sarb	%cl
	incb	%cl
	movsbl	%cl, %eax
	addl	%eax, %r15d
LBB0_11:
	subl	%r15d, %r9d
	jmp	LBB0_12
LBB0_9:
	jge	LBB0_1
## %bb.10:
	movl	28(%r12), %r15d
	movl	32(%r12), %r8d
	xorl	%r9d, %r9d
LBB0_12:
	movq	(%r13), %rax
	movq	_AV_CODEC_ID_ADPCM_THP@GOTPCREL(%rip), %rcx
	movq	_AV_CODEC_ID_ADPCM_THP_LE@GOTPCREL(%rip), %rdx
	cmpq	(%rcx), %rax
	je	LBB0_18
## %bb.13:
	cmpq	(%rdx), %rax
	je	LBB0_18
## %bb.14:
	imull	8(%r13), %r15d
	movl	(%rbx), %edi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_av_get_packet
	movl	%eax, %r12d
LBB0_15:
	movq	$0, 8(%r14)
	cmpl	%r15d, %r12d
	je	LBB0_3
## %bb.16:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_17:
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r15d
	jmp	LBB0_3
LBB0_18:
	cmpq	$0, 40(%r12)
	je	LBB0_27
## %bb.19:
	cmpq	$0, 48(%r12)
	jne	LBB0_21
## %bb.20:
	movl	8(%r13), %edi
	shll	$5, %edi
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movl	%r9d, -60(%rbp)                 ## 4-byte Spill
	callq	_av_mallocz
	movl	-60(%rbp), %r9d                 ## 4-byte Reload
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movq	%rax, 48(%r12)
	testq	%rax, %rax
	je	LBB0_29
LBB0_21:
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leal	-36(%rcx), %eax
	cmpl	%eax, %r15d
	jg	LBB0_28
## %bb.22:
	leal	36(%r15), %edi
	movl	8(%r13), %esi
	movl	%ecx, %eax
	cltd
	idivl	%esi
	cmpl	%eax, %edi
	jg	LBB0_28
## %bb.23:
	imull	%edi, %esi
	addl	$-8, %ecx
	cmpl	%ecx, %esi
	jg	LBB0_28
## %bb.24:
	movl	%r9d, -60(%rbp)                 ## 4-byte Spill
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	addl	$8, %esi
	movq	%r14, %rdi
	callq	_av_new_packet
	testq	%rax, %rax
	js	LBB0_29
## %bb.25:
	movq	16(%r14), %rax
	movq	%rax, -56(%rbp)
	movq	(%r13), %rax
	movl	8(%r13), %esi
	imull	%r15d, %esi
	movq	_AV_CODEC_ID_ADPCM_THP_LE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_30
## %bb.26:
	leaq	-56(%rbp), %rdi
	callq	_bytestream_put_le32
	leaq	-56(%rbp), %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_bytestream_put_le32
	jmp	LBB0_31
LBB0_27:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	callq	_av_log
LBB0_28:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_29:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_30:
	leaq	-56(%rbp), %rdi
	callq	_bytestream_put_be32
	leaq	-56(%rbp), %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_bytestream_put_be32
LBB0_31:
	movq	48(%r12), %rsi
	movl	8(%r13), %edx
	shll	$5, %edx
	leaq	-56(%rbp), %rdi
	callq	_bytestream_put_buffer
	movslq	8(%r13), %rdx
	shlq	$2, %rdx
	movq	(%r12), %rsi
	decq	%rsi
	imulq	%rdx, %rsi
	addq	40(%r12), %rsi
	leaq	-56(%rbp), %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_bytestream_put_buffer
	cmpl	$0, 8(%r13)
	jle	LBB0_36
## %bb.32:
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movslq	%r15d, %rax
	xorl	%r14d, %r14d
	shlq	$2, %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
LBB0_33:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %edi
	movq	-56(%rbp), %rsi
	movl	%r15d, %edx
	callq	_avio_read
	movl	%eax, %r12d
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	addq	%rax, -56(%rbp)
	movl	(%rbx), %edi
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	callq	_avio_skip
	cmpl	%r15d, %r12d
	jne	LBB0_37
## %bb.34:                              ##   in Loop: Header=BB0_33 Depth=1
	incl	%r14d
	cmpl	8(%r13), %r14d
	jl	LBB0_33
## %bb.35:
	movl	%r15d, %r12d
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_38
LBB0_36:
                                        ## implicit-def: $r12d
	jmp	LBB0_38
LBB0_37:
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_av_packet_unref
LBB0_38:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r14)
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.comm	_AV_CODEC_ID_ADPCM_THP,8,3      ## @AV_CODEC_ID_ADPCM_THP
	.comm	_AV_CODEC_ID_ADPCM_THP_LE,8,3   ## @AV_CODEC_ID_ADPCM_THP_LE
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"adpcm_thp requires ADPC chunk, but none was found.\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_packet
_read_packet:                           ; @read_packet
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	mov	x21, x0
	ldp	x24, x8, [x0, #8]
	ldr	x8, [x8]
	ldr	x25, [x8]
	ldr	w0, [x0]
	bl	_avio_feof
	cbz	x0, LBB0_4
LBB0_1:
Lloh0:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
LBB0_2:
	ldr	w20, [x8]
LBB0_3:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_4:
	ldp	x8, x9, [x24]
	add	x8, x8, #1
	str	x8, [x24]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.5:
	ldp	w20, w22, [x24, #16]
	ldr	w8, [x24, #24]
	mov	w9, #14
	mul	w10, w20, w9
	add	w11, w10, #7
	cmp	w10, #0
	csel	w10, w11, w10, lt
	cmp	w22, w10, asr #3
	b.ge	LBB0_8
; %bb.6:
	mov	w10, #9363
	movk	w10, #37449, lsl #16
	smull	x10, w22, w10
	lsr	x10, x10, #32
	add	w10, w10, w22
	asr	w11, w10, #3
	add	w10, w11, w10, lsr #31
	lsl	w20, w10, #3
	msub	w9, w10, w9, w22
	cbz	w9, LBB0_8
; %bb.7:
	add	w9, w9, #1
	and	w10, w9, #0x80
	add	w9, w9, w10, lsr #7
	sxtb	w9, w9
	add	w9, w20, w9, asr #1
	add	w20, w9, #1
LBB0_8:
	sub	w23, w8, w20
	b	LBB0_11
LBB0_9:
	b.ge	LBB0_1
; %bb.10:
	mov	w23, #0
	ldp	w20, w22, [x24, #28]
LBB0_11:
	ldr	x8, [x25]
Lloh2:
	adrp	x9, _AV_CODEC_ID_ADPCM_THP@GOTPAGE
Lloh3:
	ldr	x9, [x9, _AV_CODEC_ID_ADPCM_THP@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
Lloh5:
	adrp	x26, _AV_CODEC_ID_ADPCM_THP_LE@GOTPAGE
Lloh6:
	ldr	x26, [x26, _AV_CODEC_ID_ADPCM_THP_LE@GOTPAGEOFF]
	ldr	x10, [x26]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_21
; %bb.12:
	ldr	x8, [x24, #40]
	cbz	x8, LBB0_25
; %bb.13:
	ldr	x8, [x24, #48]
	cbnz	x8, LBB0_15
; %bb.14:
	ldr	w8, [x25, #8]
	lsl	w0, w8, #5
	bl	_av_mallocz
	str	x0, [x24, #48]
	cbz	x0, LBB0_27
LBB0_15:
Lloh7:
	adrp	x8, _INT_MAX@GOTPAGE
Lloh8:
	ldr	x8, [x8, _INT_MAX@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	sub	w9, w8, #36
	cmp	w20, w9
	b.gt	LBB0_26
; %bb.16:
	add	w9, w20, #36
	ldr	w10, [x25, #8]
	sdiv	w11, w8, w10
	cmp	w9, w11
	b.gt	LBB0_26
; %bb.17:
	mul	w9, w10, w9
	sub	w8, w8, #8
	cmp	w9, w8
	b.gt	LBB0_26
; %bb.18:
	add	w1, w9, #8
	mov	x0, x19
	bl	_av_new_packet
	tbnz	x0, #63, LBB0_27
; %bb.19:
	ldr	x8, [x19, #16]
	str	x8, [sp, #8]
	ldr	x8, [x25]
	ldr	x9, [x26]
	ldr	w10, [x25, #8]
	mul	w1, w10, w20
	add	x0, sp, #8
	cmp	x8, x9
	b.ne	LBB0_28
; %bb.20:
	bl	_bytestream_put_le32
	add	x0, sp, #8
	mov	x1, x22
	bl	_bytestream_put_le32
	b	LBB0_29
LBB0_21:
	ldr	w8, [x25, #8]
	mul	w20, w8, w20
	ldr	w0, [x21]
	mov	x1, x19
	mov	x2, x20
	bl	_av_get_packet
	mov	x24, x0
LBB0_22:
	str	xzr, [x19, #8]
	cmp	w24, w20
	b.eq	LBB0_3
; %bb.23:
Lloh10:
	adrp	x8, _EIO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_24:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x20, x0
	b	LBB0_3
LBB0_25:
Lloh12:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x2, l_.str@PAGE
Lloh16:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x21
	bl	_av_log
LBB0_26:
Lloh17:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
	b	LBB0_2
LBB0_27:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_24
LBB0_28:
	bl	_bytestream_put_be32
	add	x0, sp, #8
	mov	x1, x22
	bl	_bytestream_put_be32
LBB0_29:
	ldr	x1, [x24, #48]
	ldr	w8, [x25, #8]
	lsl	w2, w8, #5
	add	x0, sp, #8
	bl	_bytestream_put_buffer
	ldr	x8, [x24, #40]
	ldrsw	x9, [x25, #8]
	lsl	x2, x9, #2
	ldr	x9, [x24]
	sub	x9, x9, #1
	madd	x1, x9, x2, x8
	add	x0, sp, #8
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_bytestream_put_buffer
	ldr	w8, [x25, #8]
	cmp	w8, #1
	b.lt	LBB0_34
; %bb.30:
	mov	w26, #0
	sxtw	x27, w20
LBB0_31:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	ldr	x1, [sp, #8]
	mov	x2, x20
	bl	_avio_read
	mov	x24, x0
	ldr	x8, [sp, #8]
	add	x8, x8, x27, lsl #2
	str	x8, [sp, #8]
	ldr	w0, [x21]
	mov	x1, x23
	bl	_avio_skip
	cmp	w24, w20
	b.ne	LBB0_35
; %bb.32:                               ;   in Loop: Header=BB0_31 Depth=1
	add	w26, w26, #1
	ldr	w8, [x25, #8]
	cmp	w26, w8
	b.lt	LBB0_31
; %bb.33:
	mov	x24, x20
	str	w22, [x19]
	b	LBB0_22
LBB0_34:
                                        ; implicit-def: $w24
	str	w22, [x19]
	b	LBB0_22
LBB0_35:
	mov	x0, x19
	bl	_av_packet_unref
	str	w22, [x19]
	b	LBB0_22
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.comm	_AV_CODEC_ID_ADPCM_THP,8,3      ; @AV_CODEC_ID_ADPCM_THP
	.comm	_AV_CODEC_ID_ADPCM_THP_LE,8,3   ; @AV_CODEC_ID_ADPCM_THP_LE
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"adpcm_thp requires ADPC chunk, but none was found.\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_read_packet
.subsections_via_symbols
