	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function estimate_sid_gain
_estimate_sid_gain:                     ## @estimate_sid_gain
	.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
	movl	(%rdi), %eax
	addl	%eax, %eax
	movl	$16, %ecx
	subl	%eax, %ecx
	testl	%ecx, %ecx
	jle	LBB0_6
## %bb.1:
	movl	4(%rdi), %eax
	testl	%eax, %eax
	je	LBB0_8
## %bb.2:
	cmpl	$30, %ecx
	ja	LBB0_4
## %bb.3:
	movl	%eax, %edi
	shll	%cl, %edi
	movl	%edi, %edx
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %edx
	cmpl	%eax, %edx
	je	LBB0_12
LBB0_4:
	testl	%eax, %eax
	js	LBB0_10
## %bb.5:
	movq	_INT32_MAX@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_6:
	movl	4(%rdi), %edi
	cmpl	$-32, %ecx
	jg	LBB0_9
## %bb.7:
	sarl	$31, %edi
	jmp	LBB0_12
LBB0_8:
	xorl	%edi, %edi
	jmp	LBB0_12
LBB0_9:
	negl	%eax
	movb	$-16, %cl
	subb	%al, %cl
	sarl	%cl, %edi
	jmp	LBB0_12
LBB0_10:
	movq	_INT32_MIN@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %edi
LBB0_12:
	movq	_cng_filt@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	imull	(%rax), %edi
	sarl	$16, %edi
	callq	_av_clipl_int32
	movl	%eax, %r13d
	movq	_cng_bseg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	$63, %ecx
	cmpl	8(%rax), %r13d
	jge	LBB0_22
## %bb.13:
	movl	4(%rax), %r12d
	cmpl	%r12d, %r13d
	jge	LBB0_15
## %bb.14:
	xorl	%r14d, %r14d
	cmpl	(%rax), %r13d
	setge	%r14b
	movl	$3, %r15d
	jmp	LBB0_16
LBB0_15:
	movl	$4, %r15d
	movl	$3, %r14d
LBB0_16:
	movl	%r14d, %edi
	movl	$3, %esi
	callq	_FFMIN
	movl	$1, %ebx
	movl	%r15d, %ecx
	shll	%cl, %ebx
	movl	%eax, %ecx
	movl	%ebx, %eax
	shll	%cl, %eax
	shll	$5, %r14d
	movl	%ebx, %esi
	shrl	%esi
	addl	%r14d, %eax
	imull	%eax, %eax
	movl	%esi, %edi
	negl	%edi
	cmpl	%eax, %r13d
	cmovgel	%esi, %edi
	addl	%ebx, %edi
	movl	%ebx, %edx
	movl	%edi, %esi
	shll	%cl, %esi
	shrl	$2, %edx
	addl	%r14d, %esi
	imull	%esi, %esi
	movl	%edx, %eax
	negl	%eax
	cmpl	%esi, %r13d
	cmovgel	%edx, %eax
	addl	%edi, %eax
	movl	%ebx, %edx
	shrl	$3, %edx
	movl	%eax, %edi
	shll	%cl, %edi
	addl	%r14d, %edi
	imull	%edi, %edi
	movl	%edx, %esi
	negl	%esi
	cmpl	%edi, %r13d
	cmovgel	%edx, %esi
	addl	%eax, %esi
	cmpl	%r12d, %r13d
	jl	LBB0_18
## %bb.17:
	movl	%esi, %eax
	shll	%cl, %eax
	shrl	$4, %ebx
	addl	%r14d, %eax
	imull	%eax, %eax
	movl	%ebx, %edx
	negl	%edx
	cmpl	%eax, %r13d
	cmovgel	%ebx, %edx
	addl	%edx, %esi
LBB0_18:
	movl	%esi, %edx
	shll	%cl, %edx
	addl	%r14d, %edx
	imull	%edx, %edx
	cmpl	%r13d, %edx
	jle	LBB0_20
## %bb.19:
	leal	-1(%rsi), %eax
	shll	%cl, %eax
	addl	%r14d, %eax
	imull	%eax, %eax
	shll	$4, %ecx
	addl	%esi, %ecx
	cmpl	%edx, %eax
	adcl	$-1, %ecx
	jmp	LBB0_21
LBB0_20:
	leal	1(%rsi), %eax
	shll	%cl, %eax
	addl	%r14d, %eax
	imull	%eax, %eax
	shll	$4, %ecx
	addl	%esi, %ecx
	cmpl	%edx, %eax
	sbbl	$-1, %ecx
LBB0_21:
	addl	$-16, %ecx
LBB0_22:
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INT32_MIN,4,2                  ## @INT32_MIN
	.comm	_INT32_MAX,4,2                  ## @INT32_MAX
	.comm	_cng_filt,8,3                   ## @cng_filt
	.comm	_cng_bseg,8,3                   ## @cng_bseg
	.no_dead_strip	_estimate_sid_gain
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function estimate_sid_gain
_estimate_sid_gain:                     ; @estimate_sid_gain
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	w8, [x0]
	lsl	w8, w8, #1
	mov	w9, #16
	sub	w9, w9, w8
	cmp	w9, #1
	b.lt	LBB0_5
; %bb.1:
	ldr	w10, [x0, #4]
	cbz	w10, LBB0_6
; %bb.2:
	cmp	w9, #30
	lsl	w8, w10, w9
	asr	w9, w8, w9
	ccmp	w9, w10, #0, ls
	b.eq	LBB0_9
; %bb.3:
	tbnz	w10, #31, LBB0_7
; %bb.4:
Lloh0:
	adrp	x8, _INT32_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INT32_MAX@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:
	ldr	w10, [x0, #4]
	mov	w11, #-16
	neg	w8, w8
	sub	w8, w11, w8
	asr	w8, w10, w8
	asr	w10, w10, #31
	cmn	w9, #32
	csel	w8, w8, w10, gt
	b	LBB0_9
LBB0_6:
	mov	w8, #0
	b	LBB0_9
LBB0_7:
Lloh2:
	adrp	x8, _INT32_MIN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _INT32_MIN@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
LBB0_9:
Lloh4:
	adrp	x9, _cng_filt@GOTPAGE
Lloh5:
	ldr	x9, [x9, _cng_filt@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	ldr	w9, [x9]
	mul	w8, w8, w9
	asr	w0, w8, #16
	bl	_av_clipl_int32
Lloh7:
	adrp	x8, _cng_bseg@GOTPAGE
Lloh8:
	ldr	x8, [x8, _cng_bseg@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	ldr	w9, [x8, #8]
	cmp	w0, w9
	b.ge	LBB0_12
; %bb.10:
	mov	x19, x0
	ldr	w21, [x8, #4]
	cmp	w0, w21
	b.ge	LBB0_13
; %bb.11:
	ldr	w8, [x8]
	cmp	w19, w8
	cset	w20, ge
	mov	w22, #3
	b	LBB0_14
LBB0_12:
	mov	w0, #63
	b	LBB0_20
LBB0_13:
	mov	w22, #4
	mov	w20, #3
LBB0_14:
	mov	x0, x20
	mov	w1, #3
	bl	_FFMIN
	lsl	w8, w20, #5
	mov	w9, #1
	lsl	w10, w9, w22
	lsr	w9, w10, #1
	lsl	w11, w10, w0
	add	w11, w11, w8
	mul	w11, w11, w11
	cmp	w19, w11
	cneg	w9, w9, lt
	lsr	w11, w10, #2
	add	w9, w9, w10
	lsl	w12, w9, w0
	add	w12, w12, w8
	mul	w12, w12, w12
	cmp	w19, w12
	cneg	w11, w11, lt
	add	w9, w11, w9
	lsr	w11, w10, #3
	lsl	w12, w9, w0
	add	w12, w12, w8
	mul	w12, w12, w12
	cmp	w19, w12
	cneg	w11, w11, lt
	add	w9, w11, w9
	cmp	w19, w21
	b.lt	LBB0_16
; %bb.15:
	lsr	w10, w10, #4
	lsl	w11, w9, w0
	add	w11, w11, w8
	mul	w11, w11, w11
	cmp	w19, w11
	cneg	w10, w10, lt
	add	w9, w10, w9
LBB0_16:
	lsl	w10, w9, w0
	add	w10, w10, w8
	mul	w10, w10, w10
	cmp	w10, w19
	b.le	LBB0_18
; %bb.17:
	sub	w11, w9, #1
	lsl	w11, w11, w0
	add	w8, w11, w8
	mul	w8, w8, w8
	cmp	w8, w10
	cset	w8, hs
	add	w9, w9, w0, lsl #4
	sub	w8, w9, w8
	b	LBB0_19
LBB0_18:
	add	w11, w9, #1
	lsl	w11, w11, w0
	add	w8, w11, w8
	mul	w8, w8, w8
	cmp	w8, w10
	add	w8, w9, w0, lsl #4
	cinc	w8, w8, hs
LBB0_19:
	sub	w0, w8, #16
LBB0_20:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_INT32_MIN,4,2                  ; @INT32_MIN
	.comm	_INT32_MAX,4,2                  ; @INT32_MAX
	.comm	_cng_filt,8,3                   ; @cng_filt
	.comm	_cng_bseg,8,3                   ; @cng_bseg
	.no_dead_strip	_estimate_sid_gain
.subsections_via_symbols
