	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function calculate_sfm
LCPI0_0:
	.quad	0x3ff0000000000000              ## double 1
LCPI0_1:
	.quad	0x54b249ad2594c37d              ## double 1.0E+100
LCPI0_2:
	.quad	0x2b2bff2ee48e0530              ## double 1.0E-100
LCPI0_3:
	.quad	0x406cc845a1cac083              ## double 230.2585
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_calculate_sfm:                         ## @calculate_sfm
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	cmpl	%ecx, %edx
	jge	LBB0_10
## %bb.1:
	movq	(%rsi), %rax
	movsd	(%rdi), %xmm1                   ## xmm1 = mem[0],zero
	movslq	%edx, %rdx
	movslq	%ecx, %rbx
	xorpd	%xmm5, %xmm5
	movsd	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero
	xorl	%ecx, %ecx
	movsd	LCPI0_1(%rip), %xmm2            ## xmm2 = mem[0],zero
	movsd	LCPI0_2(%rip), %xmm3            ## xmm3 = mem[0],zero
	xorl	%r14d, %r14d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	mulsd	%xmm3, %xmm0
	incl	%r14d
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rdx
	cmpq	%rdx, %rbx
	je	LBB0_8
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movsd	(%rax,%rdx,8), %xmm4            ## xmm4 = mem[0],zero
	ucomisd	%xmm1, %xmm4
	jbe	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	incl	%ecx
	addsd	%xmm4, %xmm5
	mulsd	%xmm4, %xmm0
	ucomisd	%xmm2, %xmm0
	ja	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	ucomisd	%xmm0, %xmm3
	jbe	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	mulsd	%xmm2, %xmm0
	decl	%r14d
	jmp	LBB0_7
LBB0_8:
	cmpl	$1, %ecx
	jle	LBB0_10
## %bb.9:
	xorps	%xmm1, %xmm1
	cvtsi2sd	%ecx, %xmm1
	movsd	%xmm1, -24(%rbp)                ## 8-byte Spill
	divsd	%xmm1, %xmm5
	movsd	%xmm5, -32(%rbp)                ## 8-byte Spill
	movq	8(%rsi), %rbx
	movsd	%xmm5, (%rbx)
	callq	_log
	xorps	%xmm1, %xmm1
	cvtsi2sd	%r14d, %xmm1
	mulsd	LCPI0_3(%rip), %xmm1
	addsd	%xmm0, %xmm1
	divsd	-24(%rbp), %xmm1                ## 8-byte Folded Reload
	movsd	%xmm1, -24(%rbp)                ## 8-byte Spill
	movsd	-32(%rbp), %xmm0                ## 8-byte Reload
                                        ## xmm0 = mem[0],zero
	callq	_log
	movsd	%xmm0, 8(%rbx)
	subsd	-24(%rbp), %xmm0                ## 8-byte Folded Reload
	jmp	LBB0_11
LBB0_10:
	movsd	8(%rdi), %xmm0                  ## xmm0 = mem[0],zero
	movq	8(%rsi), %rbx
	movsd	%xmm0, (%rbx)
	movsd	16(%rsi), %xmm0                 ## xmm0 = mem[0],zero
	movsd	%xmm0, 8(%rbx)
	movsd	16(%rsi), %xmm0                 ## xmm0 = mem[0],zero
LBB0_11:
	movsd	%xmm0, 16(%rbx)
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_calculate_sfm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calculate_sfm
_calculate_sfm:                         ; @calculate_sfm
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [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 b8, -40
	.cfi_offset b9, -48
                                        ; kill: def $w3 killed $w3 def $x3
	cmp	w2, w3
	b.ge	LBB0_10
; %bb.1:
	mov	w8, #0
	mov	w19, #0
	ldr	x9, [x1]
	sxtw	x10, w3
	ldr	d2, [x0]
	add	x9, x9, w2, sxtw #3
	sub	x10, x10, w2, sxtw
	movi	d1, #0000000000000000
	fmov	d0, #1.00000000
	mov	x11, #50045
	movk	x11, #9620, lsl #16
	movk	x11, #18861, lsl #32
	movk	x11, #21682, lsl #48
	mov	x12, #1328
	movk	x12, #58510, lsl #16
	movk	x12, #65326, lsl #32
	movk	x12, #11051, lsl #48
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	fmov	d3, x12
	fmul	d0, d0, d3
	add	w19, w19, #1
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x9, x9, #8
	subs	x10, x10, #1
	b.eq	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	d3, [x9]
	fcmp	d3, d2
	b.le	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w8, w8, #1
	fadd	d1, d1, d3
	fmul	d0, d0, d3
	fmov	d3, x11
	fcmp	d0, d3
	b.gt	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	fmov	d3, x12
	fcmp	d0, d3
	b.pl	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	fmov	d3, x11
	fmul	d0, d0, d3
	sub	w19, w19, #1
	b	LBB0_3
LBB0_8:
	cmp	w8, #1
	b.le	LBB0_10
; %bb.9:
	scvtf	d9, w8
	fdiv	d8, d1, d9
	ldr	x20, [x1, #8]
	str	d8, [x20]
	bl	_log
	scvtf	d1, w19
	mov	x8, #49283
	movk	x8, #41418, lsl #16
	movk	x8, #51269, lsl #32
	movk	x8, #16492, lsl #48
	fmov	d2, x8
	fmadd	d0, d1, d2, d0
	fdiv	d9, d0, d9
	fmov	d0, d8
	bl	_log
	str	d0, [x20, #8]
	fsub	d0, d0, d9
	b	LBB0_11
LBB0_10:
	ldr	d0, [x0, #8]
	ldr	x20, [x1, #8]
	str	d0, [x20]
	ldr	d0, [x1, #16]
	str	d0, [x20, #8]
	ldr	d0, [x1, #16]
LBB0_11:
	str	d0, [x20, #16]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp], #48               ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_calculate_sfm
.subsections_via_symbols
