	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amr_read_packet
_amr_read_packet:                       ## @amr_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, %r14
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	(%rax), %rax
	movq	(%rax), %r12
	movl	(%rdi), %edi
	callq	_avio_tell
	movl	%eax, %r13d
	movq	16(%rbx), %r15
	movl	(%rbx), %edi
	callq	_avio_feof
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_13:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movl	(%rbx), %edi
	callq	_avio_r8
	movq	(%r12), %rdx
	movq	_AV_CODEC_ID_AMR_NB@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_4
## %bb.3:
	movq	_amrnb_packed_size@GOTPCREL(%rip), %rdx
	jmp	LBB0_6
LBB0_4:
	movq	_AV_CODEC_ID_AMR_WB@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_14
## %bb.5:
	movq	_amrwb_packed_size@GOTPCREL(%rip), %rdx
LBB0_6:
	movl	%eax, %ecx
	shrl	$3, %ecx
	andl	$15, %ecx
	movq	(%rdx), %rdx
	movl	%ecx, %ecx
	movl	(%rdx,%rcx,4), %r13d
	testl	%r13d, %r13d
	je	LBB0_14
## %bb.7:
	movl	%eax, %r14d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	callq	_av_new_packet
	movq	_AV_CODEC_ID_AMR_NB@GOTPCREL(%rip), %r8
	testq	%rax, %rax
	je	LBB0_8
LBB0_14:
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_8:
	movl	%r14d, %edi
	movl	(%r15), %eax
	movq	_UINT64_MAX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	subl	%r13d, %ecx
	cmpl	%ecx, %eax
	jge	LBB0_10
## %bb.9:
	addl	%r13d, %eax
	movl	%eax, (%r15)
	movl	4(%r15), %ecx
	incl	%ecx
	movl	%ecx, 4(%r15)
	cltd
	idivl	%ecx
	imull	$400, %eax, %eax                ## imm = 0x190
	movq	8(%rbx), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx), %rcx
	movl	%eax, 8(%rcx)
LBB0_10:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	$0, 16(%r14)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 12(%r14)
	movq	(%r14), %rsi
	movl	%edi, (%rsi)
	movq	(%r12), %rax
	cmpq	(%r8), %rax
	movl	$160, %eax
	movl	$320, %ecx                      ## imm = 0x140
	cmovel	%eax, %ecx
	movl	%ecx, 8(%r14)
	movl	(%rbx), %edi
	addq	$4, %rsi
	decl	%r13d
	movl	%r13d, %edx
	callq	_avio_read
	movl	%eax, %ebx
	xorl	%eax, %eax
	cmpl	%r13d, %ebx
	je	LBB0_13
## %bb.11:
	movq	%r14, %rdi
	callq	_av_packet_unref
	testl	%ebx, %ebx
	jns	LBB0_14
## %bb.12:
	movl	%ebx, %eax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.comm	_AV_CODEC_ID_AMR_NB,8,3         ## @AV_CODEC_ID_AMR_NB
	.comm	_amrnb_packed_size,8,3          ## @amrnb_packed_size
	.comm	_AV_CODEC_ID_AMR_WB,8,3         ## @AV_CODEC_ID_AMR_WB
	.comm	_amrwb_packed_size,8,3          ## @amrwb_packed_size
	.comm	_EIO,4,2                        ## @EIO
	.comm	_UINT64_MAX,4,2                 ## @UINT64_MAX
	.no_dead_strip	_amr_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amr_read_packet
_amr_read_packet:                       ; @amr_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	x20, x0
	ldr	x8, [x0, #8]
	ldr	x8, [x8]
	ldr	x24, [x8]
	ldr	w0, [x0]
	bl	_avio_tell
	mov	x21, x0
	ldr	x25, [x20, #16]
	ldr	w0, [x20]
	bl	_avio_feof
	cbz	x0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
LBB0_2:
	mov	x0, x20
	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_3:
	ldr	w0, [x20]
	bl	_avio_r8
	mov	x22, x0
	ldr	x8, [x24]
Lloh3:
	adrp	x26, _AV_CODEC_ID_AMR_NB@GOTPAGE
Lloh4:
	ldr	x26, [x26, _AV_CODEC_ID_AMR_NB@GOTPAGEOFF]
	ldr	x9, [x26]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.4:
Lloh5:
	adrp	x8, _amrnb_packed_size@GOTPAGE
Lloh6:
	ldr	x8, [x8, _amrnb_packed_size@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:
Lloh7:
	adrp	x9, _AV_CODEC_ID_AMR_WB@GOTPAGE
Lloh8:
	ldr	x9, [x9, _AV_CODEC_ID_AMR_WB@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.6:
Lloh10:
	adrp	x8, _amrwb_packed_size@GOTPAGE
Lloh11:
	ldr	x8, [x8, _amrwb_packed_size@GOTPAGEOFF]
LBB0_7:
	ubfx	w9, w22, #3, #4
	ldr	x8, [x8]
	ldr	w23, [x8, w9, uxtw #2]
	cbz	w23, LBB0_9
; %bb.8:
	mov	x0, x19
	mov	x1, x23
	bl	_av_new_packet
	cbz	x0, LBB0_10
LBB0_9:
Lloh12:
	adrp	x8, _EIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	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
	b	_AVERROR
LBB0_10:
	ldr	w8, [x25]
Lloh15:
	adrp	x9, _UINT64_MAX@GOTPAGE
Lloh16:
	ldr	x9, [x9, _UINT64_MAX@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	sub	w9, w9, w23
	cmp	w8, w9
	b.ge	LBB0_12
; %bb.11:
	add	w8, w8, w23
	ldr	w9, [x25, #4]
	add	w9, w9, #1
	stp	w8, w9, [x25]
	sdiv	w8, w8, w9
	mov	w9, #400
	mul	w8, w8, w9
	ldr	x9, [x20, #8]
	ldr	x9, [x9]
	ldr	x9, [x9]
	str	w8, [x9, #8]
LBB0_12:
	str	xzr, [x19, #16]
	str	w21, [x19, #12]
	ldr	x1, [x19]
	str	w22, [x1], #4
	ldr	x8, [x24]
	ldr	x9, [x26]
	cmp	x8, x9
	mov	w8, #320
	mov	w9, #160
	csel	w8, w9, w8, eq
	str	w8, [x19, #8]
	ldr	w0, [x20]
	sub	w21, w23, #1
	mov	x2, x21
	bl	_avio_read
	cmp	w0, w21
	b.ne	LBB0_14
; %bb.13:
	mov	w20, #0
	b	LBB0_2
LBB0_14:
	mov	x20, x0
	mov	x0, x19
	bl	_av_packet_unref
	tbz	w20, #31, LBB0_9
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.comm	_AV_CODEC_ID_AMR_NB,8,3         ; @AV_CODEC_ID_AMR_NB
	.comm	_amrnb_packed_size,8,3          ; @amrnb_packed_size
	.comm	_AV_CODEC_ID_AMR_WB,8,3         ; @AV_CODEC_ID_AMR_WB
	.comm	_amrwb_packed_size,8,3          ; @amrwb_packed_size
	.comm	_EIO,4,2                        ; @EIO
	.comm	_UINT64_MAX,4,2                 ; @UINT64_MAX
	.no_dead_strip	_amr_read_packet
.subsections_via_symbols
