	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calculate_bitrate
_calculate_bitrate:                     ## @calculate_bitrate
	.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, %r15
	movq	16(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	(%rdi), %ecx
	testl	%ecx, %ecx
	jle	LBB0_15
## %bb.1:
	xorl	%ebx, %ebx
	movl	$8, %r14d
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_5 Depth=1
	xorl	%r12d, %r12d
	xorl	%edx, %edx
LBB0_3:                                 ##   in Loop: Header=BB0_5 Depth=1
	decl	%edx
	movslq	%edx, %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movl	8(%r8,%rcx,4), %esi
	movl	%eax, %edi
	callq	_FFMAX
                                        ## kill: def $eax killed $eax def $rax
	addl	%r12d, %r13d
	movl	(%r15), %ecx
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	movslq	%ecx, %rdx
	cmpq	%rdx, %rbx
	jge	LBB0_16
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
                                        ##     Child Loop BB0_13 Depth 2
	movq	8(%r15), %rdx
	movq	(%rdx,%rbx,8), %rdx
	movl	(%rdx), %esi
	testq	%rsi, %rsi
	je	LBB0_4
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	24(%rdx), %r8
	testl	%esi, %esi
	jle	LBB0_2
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	leal	-1(%rsi), %edx
	cmpl	$9, %esi
	jae	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	xorl	%r9d, %r9d
	xorl	%r12d, %r12d
	jmp	LBB0_12
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	%esi, %ecx
	andl	$7, %ecx
	testq	%rcx, %rcx
	cmoveq	%r14, %rcx
	movq	%rsi, %r9
	subq	%rcx, %r9
	pxor	%xmm0, %xmm0
	movq	%r9, %rdi
	movq	%r8, %rcx
	pxor	%xmm1, %xmm1
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movd	(%rcx), %xmm2                   ## xmm2 = mem[0],zero,zero,zero
	pinsrd	$1, 12(%rcx), %xmm2
	pinsrd	$2, 24(%rcx), %xmm2
	pinsrd	$3, 36(%rcx), %xmm2
	movd	48(%rcx), %xmm3                 ## xmm3 = mem[0],zero,zero,zero
	pinsrd	$1, 60(%rcx), %xmm3
	pinsrd	$2, 72(%rcx), %xmm3
	pinsrd	$3, 84(%rcx), %xmm3
	paddd	%xmm2, %xmm0
	paddd	%xmm3, %xmm1
	addq	$96, %rcx
	addq	$-8, %rdi
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	paddd	%xmm0, %xmm1
	pshufd	$238, %xmm1, %xmm0              ## xmm0 = xmm1[2,3,2,3]
	paddd	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	paddd	%xmm0, %xmm1
	movd	%xmm1, %r12d
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	leaq	(%r9,%r9,2), %rcx
	leaq	(%r8,%rcx,4), %rcx
	subq	%r9, %rsi
	.p2align	4, 0x90
LBB0_13:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	addl	(%rcx), %r12d
	addq	$12, %rcx
	decq	%rsi
	jne	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_5 Depth=1
	incq	%rdx
	jmp	LBB0_3
LBB0_15:
	xorl	%eax, %eax
	xorl	%r13d, %r13d
LBB0_16:
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	(%rdx), %edx
	leal	(%rdx,%rdx,8), %edx
	movslq	%edx, %rdx
	imulq	$1717986919, %rdx, %rdx         ## imm = 0x66666667
	movq	%rdx, %rsi
	shrq	$63, %rsi
	sarq	$34, %rdx
	addl	%esi, %edx
	cmpl	%edx, %eax
	jl	LBB0_17
## %bb.18:
	leal	(%r13,%r13,8), %edx
	movslq	%edx, %rdx
	imulq	$1717986919, %rdx, %rdx         ## imm = 0x66666667
	movq	%rdx, %rsi
	shrq	$63, %rsi
	sarq	$34, %rdx
	addl	%esi, %edx
	cmpl	%eax, %edx
	jle	LBB0_20
LBB0_17:
	xorl	%r13d, %r13d
LBB0_36:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	leal	(%rax,%rax,8), %eax
	cltq
	imulq	$1717986919, %rax, %rax         ## imm = 0x66666667
	movq	%rax, %rdx
	shrq	$63, %rdx
	sarq	$34, %rax
	addl	%edx, %eax
	cmpl	%eax, %r13d
	movl	$0, %r13d
	jl	LBB0_36
## %bb.21:
	movl	$1, %r13d
	testl	%ecx, %ecx
	jle	LBB0_36
## %bb.22:
	xorl	%ebx, %ebx
	movl	$8, %r14d
	jmp	LBB0_24
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_24 Depth=1
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jge	LBB0_36
LBB0_24:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_28 Depth 2
                                        ##     Child Loop BB0_31 Depth 2
	movq	8(%r15), %rax
	movq	(%rax,%rbx,8), %r12
	movslq	(%r12), %rax
	testq	%rax, %rax
	jle	LBB0_23
## %bb.25:                              ##   in Loop: Header=BB0_24 Depth=1
	movl	%eax, %ecx
	movq	24(%r12), %r8
	cmpl	$9, %ecx
	jae	LBB0_27
## %bb.26:                              ##   in Loop: Header=BB0_24 Depth=1
	xorl	%esi, %esi
	xorl	%edi, %edi
	jmp	LBB0_30
	.p2align	4, 0x90
LBB0_27:                                ##   in Loop: Header=BB0_24 Depth=1
	movl	%ecx, %edx
	andl	$7, %edx
	testq	%rdx, %rdx
	cmoveq	%r14, %rdx
	movq	%rcx, %rsi
	subq	%rdx, %rsi
	pxor	%xmm0, %xmm0
	movq	%rsi, %rdi
	movq	%r8, %rdx
	pxor	%xmm1, %xmm1
	.p2align	4, 0x90
LBB0_28:                                ##   Parent Loop BB0_24 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movd	(%rdx), %xmm2                   ## xmm2 = mem[0],zero,zero,zero
	pinsrd	$1, 12(%rdx), %xmm2
	pinsrd	$2, 24(%rdx), %xmm2
	pinsrd	$3, 36(%rdx), %xmm2
	movd	48(%rdx), %xmm3                 ## xmm3 = mem[0],zero,zero,zero
	pinsrd	$1, 60(%rdx), %xmm3
	pinsrd	$2, 72(%rdx), %xmm3
	pinsrd	$3, 84(%rdx), %xmm3
	paddd	%xmm2, %xmm0
	paddd	%xmm3, %xmm1
	addq	$96, %rdx
	addq	$-8, %rdi
	jne	LBB0_28
## %bb.29:                              ##   in Loop: Header=BB0_24 Depth=1
	paddd	%xmm0, %xmm1
	pshufd	$238, %xmm1, %xmm0              ## xmm0 = xmm1[2,3,2,3]
	paddd	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edi
LBB0_30:                                ##   in Loop: Header=BB0_24 Depth=1
	leaq	-1(%rax), %r9
	leaq	(%rsi,%rsi,2), %rdx
	leaq	(%r8,%rdx,4), %rdx
	subq	%rsi, %rcx
	.p2align	4, 0x90
LBB0_31:                                ##   Parent Loop BB0_24 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	addl	(%rdx), %edi
	addq	$12, %rdx
	decq	%rcx
	jne	LBB0_31
## %bb.32:                              ##   in Loop: Header=BB0_24 Depth=1
	cmpl	$2, %eax
	jl	LBB0_23
## %bb.33:                              ##   in Loop: Header=BB0_24 Depth=1
	movq	8(%r12), %rax
	cmpq	$0, (%rax)
	jg	LBB0_23
## %bb.34:                              ##   in Loop: Header=BB0_24 Depth=1
	movq	24(%r12), %rax
	leaq	(%r9,%r9,2), %rcx
	movl	4(%rax,%rcx,4), %edx
	subl	4(%rax), %edx
	shll	$3, %edi
	movl	20(%r12), %esi
	imull	16(%r12), %edx
	callq	_av_rescale
	testl	%eax, %eax
	jle	LBB0_23
## %bb.35:                              ##   in Loop: Header=BB0_24 Depth=1
	movl	%eax, %eax
	movq	8(%r12), %rcx
	movq	%rax, (%rcx)
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_calculate_bitrate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calculate_bitrate
_calculate_bitrate:                     ; @calculate_bitrate
	.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, x0
	ldr	x21, [x0, #16]
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.1:
	mov	x22, #0
	mov	w20, #0
	mov	w0, #0
	mov	w23, #12
	mov	w24, #16
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w25, #0
	mov	x9, #0
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	sub	w9, w9, #1
	smaddl	x8, w9, w23, x8
	ldr	w1, [x8, #8]
	bl	_FFMAX
	add	w20, w25, w20
	ldr	w8, [x19]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x22, x22, #1
	cmp	x22, w8, sxtw
	b.ge	LBB0_16
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
                                        ;     Child Loop BB0_13 Depth 2
	ldr	x9, [x19, #8]
	ldr	x9, [x9, x22, lsl #3]
	ldr	w10, [x9]
	cbz	w10, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x9, #24]
	cmp	w10, #1
	b.lt	LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	sub	w9, w10, #1
	cmp	w10, #17
	b.hs	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x11, #0
	mov	w25, #0
	b	LBB0_12
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	ands	x11, x10, #0xf
	csel	x11, x24, x11, eq
	sub	x11, x10, x11
	add	x13, x8, #96
	movi.2d	v0, #0000000000000000
	mov	x12, x11
	movi.2d	v1, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_10:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	sub	x14, x13, #96
	sub	x15, x13, #48
	ld3.4s	{ v4, v5, v6 }, [x14]
	ld3.4s	{ v16, v17, v18 }, [x15]
	add	x14, x13, #192
	ld3.4s	{ v19, v20, v21 }, [x13], #48
	ld3.4s	{ v22, v23, v24 }, [x13]
	add.4s	v0, v4, v0
	add.4s	v1, v16, v1
	add.4s	v2, v19, v2
	add.4s	v3, v22, v3
	mov	x13, x14
	subs	x12, x12, #16
	b.ne	LBB0_10
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	add.4s	v0, v1, v0
	add.4s	v0, v2, v0
	add.4s	v0, v3, v0
	addv.4s	s0, v0
	fmov	w25, s0
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=1
	madd	x12, x11, x23, x8
	sub	x10, x10, x11
LBB0_13:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w11, [x12], #12
	add	w25, w11, w25
	subs	x10, x10, #1
	b.ne	LBB0_13
; %bb.14:                               ;   in Loop: Header=BB0_5 Depth=1
	add	x9, x9, #1
	b	LBB0_3
LBB0_15:
	mov	w0, #0
	mov	w20, #0
LBB0_16:
	ldr	w9, [x21]
	add	w10, w9, w9, lsl #3
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	smull	x10, w10, w9
	lsr	x11, x10, #63
	asr	x10, x10, #34
	add	w10, w10, w11
	cmp	w0, w10
	b.lt	LBB0_19
; %bb.17:
	add	w10, w20, w20, lsl #3
	smull	x9, w10, w9
	lsr	x10, x9, #63
	asr	x9, x9, #34
	add	w9, w9, w10
	cmp	w9, w0
	b.gt	LBB0_19
; %bb.18:
	add	w9, w0, w0, lsl #3
	mov	w10, #26215
	movk	w10, #26214, lsl #16
	smull	x9, w9, w10
	lsr	x10, x9, #63
	asr	x9, x9, #34
	add	w9, w9, w10
	cmp	w20, w9
	b.ge	LBB0_21
LBB0_19:
	mov	w0, #0
LBB0_20:
	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_21:
	cmp	w8, #1
	b.lt	LBB0_36
; %bb.22:
	mov	x20, #0
	mov	w21, #12
	mov	w22, #16
	b	LBB0_24
LBB0_23:                                ;   in Loop: Header=BB0_24 Depth=1
	add	x20, x20, #1
	ldrsw	x8, [x19]
	cmp	x20, x8
	b.ge	LBB0_36
LBB0_24:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_28 Depth 2
                                        ;     Child Loop BB0_31 Depth 2
	ldr	x8, [x19, #8]
	ldr	x23, [x8, x20, lsl #3]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_23
; %bb.25:                               ;   in Loop: Header=BB0_24 Depth=1
	ldr	x9, [x23, #24]
	cmp	w8, #17
	b.hs	LBB0_27
; %bb.26:                               ;   in Loop: Header=BB0_24 Depth=1
	mov	x10, #0
	mov	w11, #0
	b	LBB0_30
LBB0_27:                                ;   in Loop: Header=BB0_24 Depth=1
	ands	x10, x8, #0xf
	csel	x10, x22, x10, eq
	sub	x10, x8, x10
	add	x12, x9, #96
	movi.2d	v0, #0000000000000000
	mov	x11, x10
	movi.2d	v1, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_28:                                ;   Parent Loop BB0_24 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	sub	x13, x12, #96
	sub	x14, x12, #48
	ld3.4s	{ v4, v5, v6 }, [x13]
	ld3.4s	{ v16, v17, v18 }, [x14]
	add	x13, x12, #192
	ld3.4s	{ v19, v20, v21 }, [x12], #48
	ld3.4s	{ v22, v23, v24 }, [x12]
	add.4s	v0, v4, v0
	add.4s	v1, v16, v1
	add.4s	v2, v19, v2
	add.4s	v3, v22, v3
	mov	x12, x13
	subs	x11, x11, #16
	b.ne	LBB0_28
; %bb.29:                               ;   in Loop: Header=BB0_24 Depth=1
	add.4s	v0, v1, v0
	add.4s	v0, v2, v0
	add.4s	v0, v3, v0
	addv.4s	s0, v0
	fmov	w11, s0
LBB0_30:                                ;   in Loop: Header=BB0_24 Depth=1
	sxtw	x12, w8
	sub	x12, x12, #1
	madd	x9, x10, x21, x9
	sub	x10, x8, x10
LBB0_31:                                ;   Parent Loop BB0_24 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w13, [x9], #12
	add	w11, w13, w11
	subs	x10, x10, #1
	b.ne	LBB0_31
; %bb.32:                               ;   in Loop: Header=BB0_24 Depth=1
	cmp	w8, #2
	b.lt	LBB0_23
; %bb.33:                               ;   in Loop: Header=BB0_24 Depth=1
	ldr	x8, [x23, #8]
	ldr	x8, [x8]
	cmp	x8, #0
	b.gt	LBB0_23
; %bb.34:                               ;   in Loop: Header=BB0_24 Depth=1
	ldr	x8, [x23, #24]
	mul	x9, x12, x21
	add	x9, x8, x9
	ldr	w9, [x9, #4]
	ldr	w8, [x8, #4]
	sub	w8, w9, w8
	lsl	w0, w11, #3
	ldp	w9, w1, [x23, #16]
	mul	w2, w9, w8
	bl	_av_rescale
	cmp	w0, #1
	b.lt	LBB0_23
; %bb.35:                               ;   in Loop: Header=BB0_24 Depth=1
	mov	w8, w0
	ldr	x9, [x23, #8]
	str	x8, [x9]
	b	LBB0_23
LBB0_36:
	mov	w0, #1
	b	LBB0_20
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_calculate_bitrate
.subsections_via_symbols
