	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function imc_refine_bit_allocation
LCPI0_0:
	.quad	0x3ff8000000000000              ## double 1.5
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_imc_refine_bit_allocation:             ## @imc_refine_bit_allocation
	.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	%rsi, %r12
	movq	%rdi, %r14
	movq	_BANDS@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_10
## %bb.1:
	movq	(%r12), %r10
	movq	8(%r12), %r9
	movq	_band_tab@GOTPCREL(%rip), %rax
	movq	(%rax), %r11
	movq	64(%r12), %r8
	xorl	%esi, %esi
	movsd	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_3 Depth=1
	movslq	(%r15), %rax
	cmpq	%rax, %rsi
	jge	LBB0_10
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	movq	%rsi, %rdi
	movl	$0, (%r10,%rsi,4)
	movl	$0, (%r9,%rsi,4)
	movslq	(%r11,%rsi,4), %rbx
	incq	%rsi
	movl	4(%r11,%rdi,4), %ecx
	cmpl	%ecx, %ebx
	jge	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	48(%r12), %rax
	movl	(%r10,%rdi,4), %edx
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	addl	(%rax,%rbx,8), %edx
	movl	%edx, (%r10,%rdi,4)
	incq	%rbx
	movslq	(%r11,%rsi,4), %rcx
	cmpq	%rcx, %rbx
	jl	LBB0_5
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	cmpq	$0, (%r8,%rdi,8)
	je	LBB0_2
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	subl	(%r11,%rdi,4), %ecx
	xorps	%xmm1, %xmm1
	cvtsi2sd	%ecx, %xmm1
	mulsd	%xmm0, %xmm1
	movl	(%r10,%rdi,4), %eax
	testl	%eax, %eax
	jle	LBB0_2
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	cvttsd2si	%xmm1, %ecx
	cmpl	%ecx, %eax
	jge	LBB0_2
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$1, (%r9,%rdi,4)
	jmp	LBB0_2
LBB0_10:
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_imc_get_skip_coeff
	cmpl	$0, (%r15)
	jle	LBB0_34
## %bb.11:
	movq	16(%r12), %r11
	movq	24(%r12), %r8
	movq	64(%r12), %r9
	movq	_band_tab@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	xorl	%ebx, %ebx
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_13 Depth=1
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jge	LBB0_16
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movl	(%r8,%rbx,4), %esi
	movl	%esi, (%r11,%rbx,4)
	incq	%rbx
	cmpq	$0, (%r9,%rdi,8)
	je	LBB0_12
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movslq	4(%r13,%rdi,4), %rax
	movslq	(%r13,%rdi,4), %rdx
	subq	%rdx, %rax
	movq	32(%r12), %rdx
	movl	(%rdx,%rdi,4), %ecx
	movl	%eax, %edx
	subl	%ecx, %edx
	je	LBB0_12
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	(%r14), %rcx
	movl	(%rcx,%rax,4), %eax
	movslq	%edx, %r10
	cltd
	idivl	(%rcx,%r10,4)
	imull	%esi, %eax
	movl	%eax, (%r11,%rdi,4)
	jmp	LBB0_12
LBB0_16:
	movl	%eax, %r9d
	testl	%r9d, %r9d
	jle	LBB0_34
## %bb.17:
	movq	64(%r12), %r8
	movq	_band_tab@GOTPCREL(%rip), %rax
	movq	(%rax), %r10
	xorl	%edi, %edi
	xorl	%edx, %edx
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_20 Depth=1
	movq	40(%r12), %rax
	subl	(%rax,%rdi,8), %edx
LBB0_19:                                ##   in Loop: Header=BB0_20 Depth=1
	incq	%rdi
	cmpq	%r9, %rdi
	je	LBB0_35
LBB0_20:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_29 Depth 2
	cmpq	$0, (%r8,%rdi,8)
	je	LBB0_19
## %bb.21:                              ##   in Loop: Header=BB0_20 Depth=1
	movslq	(%r10,%rdi,4), %rbx
	movslq	4(%r10,%rdi,4), %rcx
	cmpl	%ecx, %ebx
	jge	LBB0_18
## %bb.22:                              ##   in Loop: Header=BB0_20 Depth=1
	movq	56(%r12), %rax
	movl	%ecx, %esi
	subl	%ebx, %esi
	testb	$1, %sil
	jne	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_20 Depth=1
	movq	%rbx, %rsi
	jmp	LBB0_27
LBB0_24:                                ##   in Loop: Header=BB0_20 Depth=1
	cmpq	$0, (%rax,%rbx,8)
	je	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_20 Depth=1
	movq	48(%r12), %rsi
	addl	(%rsi,%rbx,8), %edx
	movq	$0, (%rsi,%rbx,8)
LBB0_26:                                ##   in Loop: Header=BB0_20 Depth=1
	leaq	1(%rbx), %rsi
LBB0_27:                                ##   in Loop: Header=BB0_20 Depth=1
	notq	%rbx
	addq	%rcx, %rbx
	jne	LBB0_29
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_28:                                ##   in Loop: Header=BB0_29 Depth=2
	addq	$2, %rsi
	cmpq	%rsi, %rcx
	je	LBB0_18
LBB0_29:                                ##   Parent Loop BB0_20 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	$0, (%rax,%rsi,8)
	je	LBB0_31
## %bb.30:                              ##   in Loop: Header=BB0_29 Depth=2
	movq	48(%r12), %rbx
	addl	(%rbx,%rsi,8), %edx
	movq	$0, (%rbx,%rsi,8)
LBB0_31:                                ##   in Loop: Header=BB0_29 Depth=2
	cmpq	$0, 8(%rax,%rsi,8)
	je	LBB0_28
## %bb.32:                              ##   in Loop: Header=BB0_29 Depth=2
	movq	48(%r12), %rbx
	addl	8(%rbx,%rsi,8), %edx
	movq	$0, 8(%rbx,%rsi,8)
	jmp	LBB0_28
LBB0_34:
	xorl	%edx, %edx
LBB0_35:
	movq	%r14, %rdi
	movq	%r12, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_imc_adjust_bit_allocation      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_BANDS,4,2                      ## @BANDS
	.comm	_band_tab,8,3                   ## @band_tab
	.no_dead_strip	_imc_refine_bit_allocation
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function imc_refine_bit_allocation
_imc_refine_bit_allocation:             ; @imc_refine_bit_allocation
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x22, _BANDS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _BANDS@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh2:
	adrp	x21, _band_tab@GOTPAGE
Lloh3:
	ldr	x21, [x21, _band_tab@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.1:
	mov	x11, #0
	ldp	x8, x9, [x19]
	ldr	x10, [x21]
	fmov	d0, #1.50000000
	mov	w12, #1
	ldr	x13, [x19, #64]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldrsw	x14, [x22]
	cmp	x11, x14
	b.ge	LBB0_10
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	mov	x14, x11
	lsl	x15, x11, #2
	str	wzr, [x8, x15]
	str	wzr, [x9, x15]
	ldrsw	x16, [x10, x15]
	add	x11, x11, #1
	ldr	w17, [x10, x11, lsl #2]
	cmp	w16, w17
	b.ge	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [x19, #48]
	ldr	w1, [x8, x14, lsl #2]
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x17, [x0, x16, lsl #3]
	add	w1, w1, w17
	str	w1, [x8, x14, lsl #2]
	add	x16, x16, #1
	ldrsw	x17, [x10, x11, lsl #2]
	cmp	x16, x17
	b.lt	LBB0_5
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x16, [x13, x14, lsl #3]
	cbz	x16, LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w16, [x8, x15]
	cmp	w16, #1
	b.lt	LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w15, [x10, x15]
	sub	w15, w17, w15
	scvtf	d1, w15
	fmul	d1, d1, d0
	fcvtzs	w15, d1
	cmp	w16, w15
	b.ge	LBB0_2
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	str	w12, [x9, x14, lsl #2]
	b	LBB0_2
LBB0_10:
	mov	x0, x20
	mov	x1, x19
	bl	_imc_get_skip_coeff
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_26
; %bb.11:
	mov	x8, #0
	ldp	x10, x9, [x19, #16]
	ldr	x11, [x19, #64]
	ldr	x12, [x21]
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x8, x8, #1
	ldrsw	x13, [x22]
	cmp	x8, x13
	b.ge	LBB0_16
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	lsl	x14, x8, #2
	ldr	w13, [x9, x14]
	str	w13, [x10, x14]
	ldr	x15, [x11, x8, lsl #3]
	cbz	x15, LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	add	x15, x12, x14
	ldp	w15, w16, [x15]
	ldr	x17, [x19, #32]
	ldr	w14, [x17, x14]
	sub	w15, w16, w15
	subs	w14, w15, w14
	b.eq	LBB0_12
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	x16, [x20]
	ldr	w15, [x16, w15, sxtw #2]
	ldr	w14, [x16, w14, sxtw #2]
	sdiv	w14, w15, w14
	mul	w13, w14, w13
	str	w13, [x10, x8, lsl #2]
	b	LBB0_12
LBB0_16:
	and	x8, x13, #0xffffffff
	cmp	w8, #1
	b.lt	LBB0_26
; %bb.17:
	mov	x11, #0
	mov	w2, #0
	ldr	x9, [x19, #64]
	ldr	x10, [x21]
	b	LBB0_19
LBB0_18:                                ;   in Loop: Header=BB0_19 Depth=1
	ldr	x13, [x19, #40]
	ldr	x11, [x13, x11, lsl #3]
	sub	w2, w2, w11
	mov	x11, x12
	cmp	x11, x8
	b.eq	LBB0_27
LBB0_19:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_23 Depth 2
	ldr	x12, [x9, x11, lsl #3]
	cbz	x12, LBB0_25
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=1
	ldrsw	x13, [x10, x11, lsl #2]
	add	x12, x11, #1
	ldrsw	x14, [x10, x12, lsl #2]
	cmp	w13, w14
	b.ge	LBB0_18
; %bb.21:                               ;   in Loop: Header=BB0_19 Depth=1
	ldr	x15, [x19, #56]
	b	LBB0_23
LBB0_22:                                ;   in Loop: Header=BB0_23 Depth=2
	add	x13, x13, #1
	cmp	x14, x13
	b.eq	LBB0_18
LBB0_23:                                ;   Parent Loop BB0_19 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x16, [x15, x13, lsl #3]
	cbz	x16, LBB0_22
; %bb.24:                               ;   in Loop: Header=BB0_23 Depth=2
	ldr	x16, [x19, #48]
	lsl	x17, x13, #3
	ldr	x0, [x16, x17]
	add	w2, w2, w0
	str	xzr, [x16, x17]
	b	LBB0_22
LBB0_25:                                ;   in Loop: Header=BB0_19 Depth=1
	add	x11, x11, #1
	cmp	x11, x8
	b.ne	LBB0_19
	b	LBB0_27
LBB0_26:
	mov	w2, #0
LBB0_27:
	mov	x0, x20
	mov	x1, x19
	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
	b	_imc_adjust_bit_allocation
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_BANDS,4,2                      ; @BANDS
	.comm	_band_tab,8,3                   ; @band_tab
	.no_dead_strip	_imc_refine_bit_allocation
.subsections_via_symbols
