	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2                               ## -- Begin function SetCost
LCPI0_0:
	.long	0x40000000                      ## float 2
LCPI0_1:
	.long	0x3f800000                      ## float 1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_SetCost:                               ## @SetCost
	.cfi_startproc
## %bb.0:
	testq	%rsi, %rsi
	je	LBB0_20
## %bb.1:
	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
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	cmpq	$4, %rsi
	jae	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	xorl	%edi, %edi
	jmp	LBB0_11
LBB0_20:
	xorl	%edi, %edi
	jmp	_FastLog2                       ## TAILCALL
LBB0_3:
	movq	%r15, %rax
	andq	$-4, %rax
	leaq	-4(%rax), %rdx
	movq	%rdx, %rsi
	shrq	$2, %rsi
	incq	%rsi
	movl	%esi, %ecx
	andl	$3, %ecx
	cmpq	$12, %rdx
	jae	LBB0_5
## %bb.4:
	pxor	%xmm0, %xmm0
	xorl	%edx, %edx
	pxor	%xmm1, %xmm1
	jmp	LBB0_7
LBB0_5:
	andq	$-4, %rsi
	pxor	%xmm0, %xmm0
	xorl	%edx, %edx
	pxor	%xmm1, %xmm1
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%r12,%rdx,8), %xmm2
	paddq	%xmm0, %xmm2
	movdqu	16(%r12,%rdx,8), %xmm0
	paddq	%xmm1, %xmm0
	movdqu	32(%r12,%rdx,8), %xmm1
	movdqu	48(%r12,%rdx,8), %xmm3
	movdqu	64(%r12,%rdx,8), %xmm4
	paddq	%xmm1, %xmm4
	paddq	%xmm2, %xmm4
	movdqu	80(%r12,%rdx,8), %xmm2
	paddq	%xmm3, %xmm2
	paddq	%xmm0, %xmm2
	movdqu	96(%r12,%rdx,8), %xmm0
	paddq	%xmm4, %xmm0
	movdqu	112(%r12,%rdx,8), %xmm1
	paddq	%xmm2, %xmm1
	addq	$16, %rdx
	addq	$-4, %rsi
	jne	LBB0_6
LBB0_7:
	testq	%rcx, %rcx
	je	LBB0_10
## %bb.8:
	leaq	(%r12,%rdx,8), %rdx
	addq	$16, %rdx
	shlq	$5, %rcx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	-16(%rdx,%rsi), %xmm2
	paddq	%xmm2, %xmm0
	movdqu	(%rdx,%rsi), %xmm2
	paddq	%xmm2, %xmm1
	addq	$32, %rsi
	cmpq	%rsi, %rcx
	jne	LBB0_9
LBB0_10:
	paddq	%xmm1, %xmm0
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	paddq	%xmm0, %xmm1
	movq	%xmm1, %rdi
	cmpq	%r15, %rax
	je	LBB0_12
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	addq	(%r12,%rax,8), %rdi
	incq	%rax
	cmpq	%rax, %r15
	jne	LBB0_11
LBB0_12:
	callq	_FastLog2
	testq	%r15, %r15
	je	LBB0_19
## %bb.13:
	xorps	%xmm0, %xmm0
	cvtsi2ss	%rax, %xmm0
	movss	LCPI0_0(%rip), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	movss	%xmm0, -40(%rbp)                ## 4-byte Spill
	addss	%xmm0, %xmm1
	movss	%xmm1, -36(%rbp)                ## 4-byte Spill
	xorl	%ebx, %ebx
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_14 Depth=1
	movss	-36(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%r14,%rbx,4)
LBB0_18:                                ##   in Loop: Header=BB0_14 Depth=1
	incq	%rbx
	cmpq	%rbx, %r15
	je	LBB0_19
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12,%rbx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.16:                              ##   in Loop: Header=BB0_14 Depth=1
	callq	_FastLog2
	xorps	%xmm0, %xmm0
	cvtsi2ss	%rax, %xmm0
	movss	-40(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	subss	%xmm0, %xmm1
	movss	%xmm1, (%r14,%rbx,4)
	movss	LCPI0_1(%rip), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	ucomiss	%xmm1, %xmm0
	jbe	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	$1065353216, (%r14,%rbx,4)      ## imm = 0x3F800000
	jmp	LBB0_18
LBB0_19:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_SetCost
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function SetCost
_SetCost:                               ; @SetCost
	.cfi_startproc
; %bb.0:
	cbz	x1, LBB0_3
; %bb.1:
	stp	d11, d10, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	d9, d8, [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 b8, -56
	.cfi_offset b9, -64
	.cfi_offset b10, -72
	.cfi_offset b11, -80
	.cfi_remember_state
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	cmp	x1, #8
	b.hs	LBB0_4
; %bb.2:
	mov	x8, #0
	mov	x0, #0
	b	LBB0_7
LBB0_3:
	.cfi_def_cfa wsp, 0
	.cfi_same_value w30
	.cfi_same_value w29
	.cfi_same_value w19
	.cfi_same_value w20
	.cfi_same_value w21
	.cfi_same_value w22
	.cfi_same_value b8
	.cfi_same_value b9
	.cfi_same_value b10
	.cfi_same_value b11
	mov	x0, #0
	b	_FastLog2
LBB0_4:
	.cfi_restore_state
	and	x8, x20, #0xfffffffffffffff8
	add	x9, x21, #32
	movi.2d	v0, #0000000000000000
	mov	x10, x8
	movi.2d	v1, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q4, q5, [x9, #-32]
	ldp	q6, q7, [x9], #64
	add.2d	v0, v4, v0
	add.2d	v1, v5, v1
	add.2d	v2, v6, v2
	add.2d	v3, v7, v3
	subs	x10, x10, #8
	b.ne	LBB0_5
; %bb.6:
	add.2d	v0, v1, v0
	add.2d	v0, v2, v0
	add.2d	v0, v3, v0
	addp.2d	d0, v0
	fmov	x0, d0
	cmp	x8, x20
	b.eq	LBB0_9
LBB0_7:
	sub	x9, x20, x8
	add	x8, x21, x8, lsl #3
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x8], #8
	add	x0, x10, x0
	subs	x9, x9, #1
	b.ne	LBB0_8
LBB0_9:
	bl	_FastLog2
	cbz	x20, LBB0_16
; %bb.10:
	scvtf	s8, x0
	fmov	s0, #2.00000000
	fadd	s9, s8, s0
	fmov	s10, #1.00000000
	mov	w22, #1065353216
	b	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_13 Depth=1
	str	s9, [x19]
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x19, x19, #4
	add	x21, x21, #8
	subs	x20, x20, #1
	b.eq	LBB0_16
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x21]
	cbz	x0, LBB0_11
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	bl	_FastLog2
	scvtf	s0, x0
	fsub	s0, s8, s0
	str	s0, [x19]
	fcmp	s0, s10
	b.pl	LBB0_12
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	str	w22, [x19]
	b	LBB0_12
LBB0_16:
	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	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	ldp	d11, d10, [sp], #80             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_SetCost
.subsections_via_symbols
