	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function ff_ac3_bit_alloc_calc_psd
LCPI0_0:
	.long	3072                            ## 0xc00
	.long	3072                            ## 0xc00
	.long	3072                            ## 0xc00
	.long	3072                            ## 0xc00
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_ff_ac3_bit_alloc_calc_psd
	.p2align	4, 0x90
_ff_ac3_bit_alloc_calc_psd:             ## @ff_ac3_bit_alloc_calc_psd
	.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	%r8, %r13
	movq	%rcx, %r12
	movl	%edx, %r8d
                                        ## kill: def $esi killed $esi def $rsi
	movslq	%esi, %r10
	cmpl	%edx, %esi
	jge	LBB0_15
## %bb.1:
	movslq	%r8d, %r11
	movq	%r11, %r9
	subq	%r10, %r9
	movq	%r10, %rdx
	cmpq	$8, %r9
	jb	LBB0_11
## %bb.2:
	leaq	(%r12,%r10,4), %rax
	leaq	(%rdi,%r10,4), %rcx
	subq	%rcx, %rax
	movq	%r10, %rdx
	cmpq	$32, %rax
	jb	LBB0_11
## %bb.3:
	movl	%r8d, %r14d
	movq	%r9, %rdx
	andq	$-8, %rdx
	leaq	-8(%rdx), %rax
	movq	%rax, %r8
	shrq	$3, %r8
	incq	%r8
	movq	%r13, %r15
	movq	%rsi, %r13
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%r8, %rsi
	andq	$-2, %rsi
	leaq	(%r12,%r10,4), %rax
	addq	$48, %rax
	leaq	(%rdi,%r10,4), %rcx
	addq	$48, %rcx
	xorl	%ebx, %ebx
	movdqa	LCPI0_0(%rip), %xmm0            ## xmm0 = [3072,3072,3072,3072]
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	-48(%rcx,%rbx,4), %xmm1
	movdqu	-32(%rcx,%rbx,4), %xmm2
	pslld	$7, %xmm1
	movdqa	%xmm0, %xmm3
	psubd	%xmm1, %xmm3
	pslld	$7, %xmm2
	movdqa	%xmm0, %xmm1
	psubd	%xmm2, %xmm1
	movdqu	%xmm3, -48(%rax,%rbx,4)
	movdqu	%xmm1, -32(%rax,%rbx,4)
	movdqu	-16(%rcx,%rbx,4), %xmm1
	movdqu	(%rcx,%rbx,4), %xmm2
	pslld	$7, %xmm1
	movdqa	%xmm0, %xmm3
	psubd	%xmm1, %xmm3
	pslld	$7, %xmm2
	movdqa	%xmm0, %xmm1
	psubd	%xmm2, %xmm1
	movdqu	%xmm3, -16(%rax,%rbx,4)
	movdqu	%xmm1, (%rax,%rbx,4)
	addq	$16, %rbx
	addq	$-2, %rsi
	jne	LBB0_6
## %bb.7:
	testb	$1, %r8b
	je	LBB0_9
LBB0_8:
	addq	%r10, %rbx
	movdqu	(%rdi,%rbx,4), %xmm0
	movdqu	16(%rdi,%rbx,4), %xmm1
	pslld	$7, %xmm0
	movdqa	LCPI0_0(%rip), %xmm2            ## xmm2 = [3072,3072,3072,3072]
	movdqa	%xmm2, %xmm3
	psubd	%xmm0, %xmm3
	pslld	$7, %xmm1
	psubd	%xmm1, %xmm2
	movdqu	%xmm3, (%r12,%rbx,4)
	movdqu	%xmm2, 16(%r12,%rbx,4)
LBB0_9:
	cmpq	%rdx, %r9
	movl	%r14d, %r8d
	movq	%r13, %rsi
	movq	%r15, %r13
	je	LBB0_15
## %bb.10:
	addq	%r10, %rdx
LBB0_11:
	movl	%r8d, %ecx
	subl	%edx, %ecx
	movq	%rdx, %rax
	notq	%rax
	addq	%r11, %rax
	movq	%rsi, %r9
	andq	$3, %rcx
	je	LBB0_13
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rdi,%rdx,4), %esi
	shll	$7, %esi
	movl	$3072, %ebx                     ## imm = 0xC00
	subl	%esi, %ebx
	movl	%ebx, (%r12,%rdx,4)
	incq	%rdx
	decq	%rcx
	jne	LBB0_12
LBB0_13:
	cmpq	$3, %rax
	movq	%r9, %rsi
	jb	LBB0_15
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rdi,%rdx,4), %eax
	shll	$7, %eax
	movl	$3072, %ecx                     ## imm = 0xC00
	subl	%eax, %ecx
	movl	%ecx, (%r12,%rdx,4)
	movl	4(%rdi,%rdx,4), %eax
	shll	$7, %eax
	movl	$3072, %ecx                     ## imm = 0xC00
	subl	%eax, %ecx
	movl	%ecx, 4(%r12,%rdx,4)
	movl	8(%rdi,%rdx,4), %eax
	shll	$7, %eax
	movl	$3072, %ecx                     ## imm = 0xC00
	subl	%eax, %ecx
	movl	%ecx, 8(%r12,%rdx,4)
	movl	12(%rdi,%rdx,4), %eax
	shll	$7, %eax
	movl	$3072, %ecx                     ## imm = 0xC00
	subl	%eax, %ecx
	movl	%ecx, 12(%r12,%rdx,4)
	addq	$4, %rdx
	cmpq	%rdx, %r11
	jne	LBB0_14
LBB0_15:
	movq	_ff_ac3_bin_to_band_tab@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	(%rax,%r10,4), %rcx
	movq	_ff_ac3_band_start_tab@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_16 Depth=1
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	%ebx, (%r13,%rax,4)
	movq	_ff_ac3_band_start_tab@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rdx, %rcx
	movl	%r14d, %esi
	cmpl	%r8d, (%rax,%rdx,4)
	jge	LBB0_21
LBB0_16:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_18 Depth 2
	movslq	%esi, %r14
	movl	(%r12,%r14,4), %ebx
	leaq	1(%rcx), %rdx
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movl	4(%rax,%rcx,4), %edi
	movq	%rsi, %r15
	movl	%r8d, %esi
	callq	_FFMIN
	incl	%r14d
	cmpl	%eax, %r14d
	jge	LBB0_20
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movslq	%r14d, %rcx
	leaq	(%r12,%rcx,4), %r13
	notl	%r15d
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	addl	%eax, %r15d
	xorl	%r14d, %r14d
	movq	%r15, %r12
	.p2align	4, 0x90
LBB0_18:                                ##   Parent Loop BB0_16 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r13,%r14,4), %esi
	movl	%ebx, %edi
	callq	_FFMAX
	movl	%eax, %r15d
	movl	(%r13,%r14,4), %eax
	addl	%ebx, %eax
	incl	%eax
	sarl	%eax
	movl	%r15d, %edi
	subl	%eax, %edi
	movl	$255, %esi
	callq	_FFMIN
	movq	_ff_ac3_log_add_tab@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cltq
	movl	%r15d, %ebx
	addl	(%rcx,%rax,4), %ebx
	incq	%r14
	cmpl	%r14d, %r12d
	jne	LBB0_18
## %bb.19:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, %r14d
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_20
LBB0_21:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	xorl	%ebx, %ebx
	testb	$1, %r8b
	jne	LBB0_8
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_ff_ac3_bin_to_band_tab,8,3     ## @ff_ac3_bin_to_band_tab
	.comm	_ff_ac3_band_start_tab,8,3      ## @ff_ac3_band_start_tab
	.comm	_ff_ac3_log_add_tab,8,3         ## @ff_ac3_log_add_tab
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_ac3_bit_alloc_calc_psd      ; -- Begin function ff_ac3_bit_alloc_calc_psd
	.p2align	2
_ff_ac3_bit_alloc_calc_psd:             ; @ff_ac3_bit_alloc_calc_psd
	.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, x4
	mov	x25, x3
	mov	x20, x2
	mov	x22, x1
	sxtw	x8, w22
	cmp	w1, w2
	b.ge	LBB0_8
; %bb.1:
	sxtw	x9, w20
	sub	x10, x9, x8
	mov	x11, x8
	cmp	x10, #16
	b.lo	LBB0_6
; %bb.2:
	lsl	x13, x8, #2
	add	x11, x13, x25
	add	x12, x13, x0
	sub	x12, x11, x12
	mov	x11, x8
	cmp	x12, #64
	b.lo	LBB0_6
; %bb.3:
	and	x12, x10, #0xfffffffffffffff0
	add	x11, x12, x8
	add	x14, x13, #32
	add	x13, x25, x14
	add	x14, x0, x14
	movi.4s	v0, #12, lsl #8
	mov	x15, x12
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q1, q2, [x14, #-32]
	ldp	q3, q4, [x14], #64
	shl.4s	v1, v1, #7
	sub.4s	v1, v0, v1
	shl.4s	v2, v2, #7
	sub.4s	v2, v0, v2
	shl.4s	v3, v3, #7
	sub.4s	v3, v0, v3
	shl.4s	v4, v4, #7
	sub.4s	v4, v0, v4
	stp	q1, q2, [x13, #-32]
	stp	q3, q4, [x13], #64
	subs	x15, x15, #16
	b.ne	LBB0_4
; %bb.5:
	cmp	x10, x12
	b.eq	LBB0_8
LBB0_6:
	lsl	x12, x11, #2
	add	x10, x0, x12
	add	x12, x25, x12
	sub	x9, x9, x11
	mov	w11, #3072
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w13, [x10], #4
	sub	w13, w11, w13, lsl #7
	str	w13, [x12], #4
	subs	x9, x9, #1
	b.ne	LBB0_7
LBB0_8:
Lloh0:
	adrp	x9, _ff_ac3_bin_to_band_tab@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ff_ac3_bin_to_band_tab@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldrsw	x27, [x9, x8, lsl #2]
Lloh3:
	adrp	x21, _ff_ac3_band_start_tab@GOTPAGE
Lloh4:
	ldr	x21, [x21, _ff_ac3_band_start_tab@GOTPAGEOFF]
	ldr	x8, [x21]
Lloh5:
	adrp	x26, _ff_ac3_log_add_tab@GOTPAGE
Lloh6:
	ldr	x26, [x26, _ff_ac3_log_add_tab@GOTPAGEOFF]
	str	x20, [sp, #8]                   ; 8-byte Folded Spill
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	str	w23, [x19, x27, lsl #2]
	ldr	x8, [x21]
	ldr	w10, [x8, x28, lsl #2]
	mov	x27, x28
	mov	x22, x9
	cmp	w10, w20
	b.ge	LBB0_14
LBB0_10:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_12 Depth 2
	ldr	w23, [x25, w22, sxtw #2]
	add	x28, x27, #1
	ldr	w0, [x8, x28, lsl #2]
	mov	x1, x20
	bl	_FFMIN
	add	w9, w22, #1
	cmp	w9, w0
	b.ge	LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x24, x0
	mov	x20, x19
	mov	x21, x25
	add	x19, x25, w9, sxtw #2
	mvn	w8, w22
	add	w25, w8, w0
LBB0_12:                                ;   Parent Loop BB0_10 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w1, [x19]
	mov	x0, x23
	bl	_FFMAX
	mov	x22, x0
	ldr	w8, [x19], #4
	add	w8, w23, w8
	add	w8, w8, #1
	sub	w0, w0, w8, asr #1
	mov	w1, #255
	bl	_FFMIN
	ldr	x8, [x26]
	ldr	w8, [x8, w0, sxtw #2]
	add	w23, w8, w22
	subs	w25, w25, #1
	b.ne	LBB0_12
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x9, x24
	mov	x19, x20
	mov	x25, x21
	ldr	x20, [sp, #8]                   ; 8-byte Folded Reload
Lloh7:
	adrp	x21, _ff_ac3_band_start_tab@GOTPAGE
Lloh8:
	ldr	x21, [x21, _ff_ac3_band_start_tab@GOTPAGEOFF]
	b	LBB0_9
LBB0_14:
	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
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ff_ac3_bin_to_band_tab,8,3     ; @ff_ac3_bin_to_band_tab
	.comm	_ff_ac3_band_start_tab,8,3      ; @ff_ac3_band_start_tab
	.comm	_ff_ac3_log_add_tab,8,3         ; @ff_ac3_log_add_tab
.subsections_via_symbols
