	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function km_ks_dist
LCPI0_0:
	.quad	0x3ff0000000000000              ## double 1
	.quad	0x3ff0000000000000              ## double 1
LCPI0_1:
	.quad	0x7fffffffffffffff              ## double NaN
	.quad	0x7fffffffffffffff              ## double NaN
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_km_ks_dist
	.p2align	4, 0x90
_km_ks_dist:                            ## @km_ks_dist
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	testl	%edi, %edi
	jg	LBB0_2
## %bb.1:
	xorpd	%xmm0, %xmm0
	testl	%edx, %edx
	jle	LBB0_14
LBB0_2:
	movd	%edi, %xmm0
	pinsrd	$1, %edx, %xmm0
	cvtdq2pd	%xmm0, %xmm0
	movapd	LCPI0_0(%rip), %xmm1            ## xmm1 = [1.0E+0,1.0E+0]
	divpd	%xmm0, %xmm1
	xorpd	%xmm2, %xmm2
	xorpd	%xmm0, %xmm0
	xorl	%r9d, %r9d
	movapd	LCPI0_1(%rip), %xmm3            ## xmm3 = [NaN,NaN]
	xorl	%r8d, %r8d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movapd	%xmm0, %xmm4
	cmpl	%edi, %r9d
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movapd	%xmm1, %xmm0
	addpd	%xmm2, %xmm0
	incl	%r8d
	blendpd	$2, %xmm0, %xmm2                ## xmm2 = xmm2[0],xmm0[1]
	movl	%edi, %r9d
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	cmpl	%edx, %r8d
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	incl	%r9d
	addsd	%xmm1, %xmm2
	movl	%edx, %r8d
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movslq	%r9d, %rax
	movsd	(%rsi,%rax,8), %xmm0            ## xmm0 = mem[0],zero
	movslq	%r8d, %rax
	movsd	(%rcx,%rax,8), %xmm5            ## xmm5 = mem[0],zero
	ucomisd	%xmm0, %xmm5
	jbe	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	incl	%r9d
	addsd	%xmm1, %xmm2
	jmp	LBB0_12
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	ucomisd	%xmm5, %xmm0
	jbe	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	movapd	%xmm1, %xmm0
	addpd	%xmm2, %xmm0
	incl	%r8d
	blendpd	$2, %xmm0, %xmm2                ## xmm2 = xmm2[0],xmm0[1]
	jmp	LBB0_12
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	addpd	%xmm1, %xmm2
	incl	%r9d
	incl	%r8d
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movapd	%xmm2, %xmm5
	unpckhpd	%xmm2, %xmm5                    ## xmm5 = xmm5[1],xmm2[1]
	movapd	%xmm2, %xmm0
	subsd	%xmm5, %xmm0
	andpd	%xmm3, %xmm0
	maxsd	%xmm4, %xmm0
	cmpl	%edi, %r9d
	jl	LBB0_3
## %bb.13:                              ##   in Loop: Header=BB0_3 Depth=1
	cmpl	%edx, %r8d
	jl	LBB0_3
LBB0_14:
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_km_ks_dist                     ; -- Begin function km_ks_dist
	.p2align	2
_km_ks_dist:                            ; @km_ks_dist
	.cfi_startproc
; %bb.0:
	cmp	w0, #0
	b.gt	LBB0_2
; %bb.1:
	movi	d0, #0000000000000000
	cmp	w2, #1
	b.lt	LBB0_14
LBB0_2:
	mov	w9, #0
	mov	w8, #0
	scvtf	d0, w0
	fmov	d4, #1.00000000
	fdiv	d1, d4, d0
	scvtf	d5, w2
	movi	d0, #0000000000000000
	movi	d2, #0000000000000000
	movi	d3, #0000000000000000
	fdiv	d4, d4, d5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w9, w0
	b.ne	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	fadd	d2, d4, d2
	add	w8, w8, #1
	mov	x9, x0
	b	LBB0_12
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	cmp	w8, w2
	b.ne	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	fadd	d3, d1, d3
	add	w9, w9, #1
	mov	x8, x2
	b	LBB0_12
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	d5, [x1, w9, sxtw #3]
	ldr	d6, [x3, w8, sxtw #3]
	fcmp	d5, d6
	b.pl	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	fadd	d3, d1, d3
	add	w9, w9, #1
	b	LBB0_12
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	fadd	d2, d4, d2
	b.gt	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_3 Depth=1
	fadd	d3, d1, d3
	add	w9, w9, #1
LBB0_11:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w8, w8, #1
LBB0_12:                                ;   in Loop: Header=BB0_3 Depth=1
	fabd	d5, d3, d2
	fcmp	d0, d5
	fcsel	d0, d5, d0, mi
	cmp	w9, w0
	b.lt	LBB0_3
; %bb.13:                               ;   in Loop: Header=BB0_3 Depth=1
	cmp	w8, w2
	b.lt	LBB0_3
LBB0_14:
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
