	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function update_gain_history
LCPI0_0:
	.quad	0x3ff0000000000000              ## double 1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_update_gain_history:                   ## @update_gain_history
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movsd	%xmm0, -48(%rbp)                ## 8-byte Spill
	movq	%rdi, %r14
	movq	32(%rdi), %rax
	movslq	%esi, %r15
	movl	(%rax,%r15,4), %edi
	callq	_cqueue_empty
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	16(%r14), %rax
	movl	(%rax,%r15,4), %edi
	callq	_cqueue_empty
	testq	%rax, %rax
	je	LBB0_8
LBB0_2:
	movl	(%r14), %eax
	movl	%eax, %ebx
	shrl	$31, %ebx
	addl	%eax, %ebx
	sarl	%ebx
	cmpq	$0, 40(%r14)
	je	LBB0_3
## %bb.4:
	movsd	-48(%rbp), %xmm0                ## 8-byte Reload
                                        ## xmm0 = mem[0],zero
	jmp	LBB0_5
LBB0_3:
	movsd	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero
LBB0_5:
	movsd	%xmm0, -40(%rbp)                ## 8-byte Spill
	movq	8(%r14), %rax
	movsd	%xmm0, (%rax,%r15,8)
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%r14), %rax
	movl	(%rax,%r15,4), %edi
	callq	_cqueue_size
	cmpl	%ebx, %eax
	jge	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	32(%r14), %rax
	movl	(%rax,%r15,4), %edi
	movsd	-40(%rbp), %xmm0                ## 8-byte Reload
                                        ## xmm0 = mem[0],zero
	callq	_cqueue_enqueue
	jmp	LBB0_7
LBB0_8:
	movq	32(%r14), %rax
	movl	(%rax,%r15,4), %edi
	movsd	-48(%rbp), %xmm0                ## 8-byte Reload
                                        ## xmm0 = mem[0],zero
	callq	_cqueue_enqueue
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	32(%r14), %rax
	movl	(%rax,%r15,4), %edi
	callq	_minimum_filter
	movq	16(%r14), %rax
	movl	(%rax,%r15,4), %edi
	callq	_cqueue_enqueue
	movq	32(%r14), %rax
	movl	(%rax,%r15,4), %edi
	callq	_cqueue_pop
LBB0_9:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_15 Depth 2
	movq	32(%r14), %rax
	movl	(%rax,%r15,4), %edi
	callq	_cqueue_size
	cmpl	(%r14), %eax
	jl	LBB0_18
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	32(%r14), %rax
	movl	(%rax,%r15,4), %edi
	callq	_cqueue_size
	xorl	%edi, %edi
	cmpl	(%r14), %eax
	sete	%dil
	callq	_av_assert0
	movq	16(%r14), %rax
	movl	(%rax,%r15,4), %edi
	callq	_cqueue_empty
	testq	%rax, %rax
	je	LBB0_16
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	(%r14), %eax
	movl	%eax, %r12d
	shrl	$31, %r12d
	addl	%eax, %r12d
	sarl	%r12d
	cmpq	$0, 40(%r14)
	movsd	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	32(%r14), %rax
	movl	(%rax,%r15,4), %edi
	xorl	%esi, %esi
	callq	_cqueue_peek
LBB0_13:                                ##   in Loop: Header=BB0_9 Depth=1
	movsd	%xmm0, -40(%rbp)                ## 8-byte Spill
	movq	16(%r14), %rax
	movl	(%rax,%r15,4), %edi
	callq	_cqueue_size
	cmpl	%r12d, %eax
	jge	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_9 Depth=1
	leal	1(%r12), %ebx
	.p2align	4, 0x90
LBB0_15:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	32(%r14), %rax
	movl	(%rax,%r15,4), %edi
	movl	%ebx, %esi
	callq	_cqueue_peek
	movaps	%xmm0, %xmm1
	movsd	-40(%rbp), %xmm0                ## 8-byte Reload
                                        ## xmm0 = mem[0],zero
	callq	_FFMIN
	movq	16(%r14), %rax
	movl	(%rax,%r15,4), %edi
	movsd	%xmm0, -40(%rbp)                ## 8-byte Spill
	callq	_cqueue_enqueue
	movq	16(%r14), %rax
	movl	(%rax,%r15,4), %edi
	callq	_cqueue_size
	incl	%ebx
	cmpl	%r12d, %eax
	jl	LBB0_15
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_18 Depth=1
	movq	16(%r14), %rax
	movl	(%rax,%r15,4), %edi
	callq	_cqueue_size
	xorl	%edi, %edi
	cmpl	(%r14), %eax
	sete	%dil
	callq	_av_assert0
	movq	16(%r14), %rax
	movl	(%rax,%r15,4), %esi
	movq	%r14, %rdi
	callq	_gaussian_filter
	movq	24(%r14), %rax
	movl	(%rax,%r15,4), %edi
	callq	_cqueue_enqueue
	movq	16(%r14), %rax
	movl	(%rax,%r15,4), %edi
	callq	_cqueue_pop
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r14), %rax
	movl	(%rax,%r15,4), %edi
	callq	_cqueue_size
	cmpl	(%r14), %eax
	jge	LBB0_17
## %bb.19:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_update_gain_history
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function update_gain_history
_update_gain_history:                   ; @update_gain_history
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [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 b8, -72
	.cfi_offset b9, -80
	fmov	d8, d0
                                        ; kill: def $w1 killed $w1 def $x1
	mov	x19, x0
	ldr	x8, [x0, #32]
	sxtw	x22, w1
	ldr	w0, [x8, w1, sxtw #2]
	bl	_cqueue_empty
	lsl	x21, x22, #2
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x22, lsl #2]
	bl	_cqueue_empty
	cbz	x0, LBB0_5
LBB0_2:
	ldr	w8, [x19]
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w20, w8, #1
	ldp	x9, x8, [x19, #32]
	cmp	x8, #0
	fmov	d0, #1.00000000
	fcsel	d9, d0, d8, eq
	ldr	x8, [x19, #8]
	str	d9, [x8, x22, lsl #3]
	ldr	w0, [x9, x22, lsl #2]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	bl	_cqueue_size
	cmp	w0, w20
	b.ge	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x19, #32]
	ldr	w0, [x8, x21]
	fmov	d0, d9
	bl	_cqueue_enqueue
	ldr	x8, [x19, #32]
	ldr	w0, [x8, x21]
	b	LBB0_3
LBB0_5:
	ldr	x8, [x19, #32]
	ldr	w0, [x8, x21]
	fmov	d0, d8
	bl	_cqueue_enqueue
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x19, #32]
	ldr	w0, [x8, x21]
	bl	_minimum_filter
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x21]
	bl	_cqueue_enqueue
	ldr	x8, [x19, #32]
	ldr	w0, [x8, x21]
	bl	_cqueue_pop
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_14 Depth 2
	ldr	x8, [x19, #32]
	ldr	w0, [x8, x21]
	bl	_cqueue_size
	ldr	w8, [x19]
	cmp	w0, w8
	b.lt	LBB0_15
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x19, #32]
	ldr	w0, [x8, x21]
	bl	_cqueue_size
	ldr	w8, [x19]
	cmp	w0, w8
	cset	w0, eq
	bl	_av_assert0
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x21]
	bl	_cqueue_empty
	cbz	x0, LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x19]
	cmp	w8, #0
	cinc	w20, w8, lt
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x19, #32]
	ldr	w0, [x8, x22, lsl #2]
	mov	w1, #0
	bl	_cqueue_peek
	fmov	d8, d0
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_7 Depth=1
	fmov	d8, #1.00000000
LBB0_12:                                ;   in Loop: Header=BB0_7 Depth=1
	asr	w23, w20, #1
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x22, lsl #2]
	bl	_cqueue_size
	cmp	w0, w23
	b.ge	LBB0_6
; %bb.13:                               ;   in Loop: Header=BB0_7 Depth=1
	add	w20, w23, #1
LBB0_14:                                ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x19, #32]
	ldr	w0, [x8, x21]
	mov	x1, x20
	bl	_cqueue_peek
	fmov	d1, d0
	fmov	d0, d8
	bl	_FFMIN
	fmov	d8, d0
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x21]
	bl	_cqueue_enqueue
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x21]
	bl	_cqueue_size
	add	w20, w20, #1
	cmp	w0, w23
	b.lt	LBB0_14
	b	LBB0_6
LBB0_15:
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x22, lsl #2]
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	bl	_cqueue_size
	ldr	w8, [x19]
	cmp	w0, w8
	b.lt	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x21]
	bl	_cqueue_size
	ldr	w8, [x19]
	cmp	w0, w8
	cset	w0, eq
	bl	_av_assert0
	ldr	x8, [x19, #16]
	ldr	w1, [x8, x21]
	mov	x0, x19
	bl	_gaussian_filter
	ldr	x8, [x19, #24]
	ldr	w0, [x8, x21]
	bl	_cqueue_enqueue
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x21]
	bl	_cqueue_pop
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x21]
	b	LBB0_16
LBB0_18:
	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	d9, d8, [sp], #80               ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_update_gain_history
.subsections_via_symbols
