	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gain_scale
_gain_scale:                            ## @gain_scale
	.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	_SUBFRAME_LEN@GOTPCREL(%rip), %r13
	cmpl	$0, (%r13)
	jle	LBB0_9
## %bb.1:
	movq	%rsi, %r12
	movq	%rdi, %r14
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12,%rbx,4), %esi
	sarl	$2, %esi
	imull	%esi, %esi
	movl	%r15d, %edi
	callq	_av_sat_dadd32
	movl	%eax, %r15d
	incq	%rbx
	movslq	(%r13), %rax
	cmpq	%rax, %rbx
	jl	LBB0_2
## %bb.3:
	movl	$4104, %r13d                    ## imm = 0x1008
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	testl	%ebx, %ebx
	je	LBB0_6
## %bb.4:
	testl	%r15d, %r15d
	je	LBB0_6
## %bb.5:
	movl	%ebx, %edi
	movl	$31, %esi
	callq	_ff_g723_1_normalize_bits
	movl	%eax, %r13d
	movl	%r15d, %edi
	movl	$31, %esi
	callq	_ff_g723_1_normalize_bits
	movl	%r13d, %ecx
	shll	%cl, %ebx
	movl	%eax, %ecx
	shll	%cl, %r15d
	subl	%eax, %r13d
	addl	$5, %r13d
	movl	%r13d, %edi
	movl	$5, %esi
	callq	_av_clip_uintp2
	movl	%eax, %ecx
	sarl	$2, %ebx
	sarl	$16, %r15d
	movl	%ebx, %eax
	cltd
	idivl	%r15d
	shll	$16, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %eax
	movl	%eax, %edi
	callq	_square_root
	movl	%eax, %r13d
	addl	$8, %r13d
	movq	_SUBFRAME_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_6:
	testl	%eax, %eax
	movq	_SUBFRAME_LEN@GOTPCREL(%rip), %r15
	jle	LBB0_9
## %bb.7:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %eax
	leal	(%rax,%rax,4), %eax
	leal	(%rax,%rax,2), %edi
	addl	%r13d, %edi
	movl	%edi, %eax
	sarl	$4, %eax
	movl	%eax, (%r14)
	sarl	$8, %edi
	addl	%eax, %edi
	imull	(%r12,%rbx,4), %edi
	addl	$1024, %edi                     ## imm = 0x400
	sarl	$11, %edi
	callq	_av_clip_int16
	movl	%eax, (%r12,%rbx,4)
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_8
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SUBFRAME_LEN,4,2               ## @SUBFRAME_LEN
	.no_dead_strip	_gain_scale
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gain_scale
_gain_scale:                            ; @gain_scale
	.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
Lloh0:
	adrp	x24, _SUBFRAME_LEN@GOTPAGE
Lloh1:
	ldr	x24, [x24, _SUBFRAME_LEN@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.1:
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	mov	x23, #0
	mov	w22, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x19, x23, lsl #2]
	asr	w8, w8, #2
	mul	w1, w8, w8
	mov	x0, x22
	bl	_av_sat_dadd32
	mov	x22, x0
	add	x23, x23, #1
	ldrsw	x8, [x24]
	cmp	x23, x8
	b.lt	LBB0_2
; %bb.3:
	mov	w23, #4104
	cbz	w21, LBB0_6
; %bb.4:
	cbz	w22, LBB0_6
; %bb.5:
	mov	x0, x21
	mov	w1, #31
	bl	_ff_g723_1_normalize_bits
	mov	x23, x0
	mov	x0, x22
	mov	w1, #31
	bl	_ff_g723_1_normalize_bits
	lsl	w21, w21, w23
	lsl	w22, w22, w0
	sub	w8, w23, w0
	add	w0, w8, #5
	mov	w1, #5
	bl	_av_clip_uintp2
	asr	w8, w21, #2
	asr	w9, w22, #16
	sdiv	w8, w8, w9
	lsl	w8, w8, #16
	asr	w0, w8, w0
	bl	_square_root
	add	w23, w0, #8
	ldr	w8, [x24]
LBB0_6:
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.7:
	mov	x21, #0
	orr	w22, wzr, #0x400
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x20]
	lsl	w9, w8, #4
	sub	w8, w9, w8
	add	w8, w23, w8
	asr	w9, w8, #4
	str	w9, [x20]
	lsl	x25, x21, #2
	ldr	w10, [x19, x25]
	add	w8, w9, w8, asr #8
	madd	w8, w8, w10, w22
	asr	w0, w8, #11
	bl	_av_clip_int16
	str	w0, [x19, x25]
	add	x21, x21, #1
	ldrsw	x8, [x24]
	cmp	x21, x8
	b.lt	LBB0_8
LBB0_9:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_SUBFRAME_LEN,4,2               ; @SUBFRAME_LEN
	.no_dead_strip	_gain_scale
.subsections_via_symbols
