; LLVM IR from Discngine/fpocket :: src (voronoi)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.s_vvertice = type { i32, i32, i32, i32, i32, float, float, float, float, i32, i32, [4 x i32], [4 x ptr], [3 x float], float }
%struct.s_atm = type { i32, float, float, float, float, float, float, float, [5 x i8], [7 x i8], [16 x i8], [16 x i8], [3 x i8], [8 x i8], i32, i32, i32, i32, i32, i32, i32, float, float, float, float, float, float, float, i8, i8, float, float, float, float, i16, ptr, i32 }

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
define dso_local void @set_barycenter(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #2
  store float 0.000000e+00, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #2
  store float 0.000000e+00, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #2
  store float 0.000000e+00, ptr %6, align 4, !tbaa !9
  store i32 0, ptr %3, align 4, !tbaa !11
  br label %7

7:                                                ; preds = %41, %1
  %8 = load i32, ptr %3, align 4, !tbaa !11
  %9 = icmp slt i32 %8, 4
  br i1 %9, label %10, label %44

10:                                               ; preds = %7
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.s_vvertice, ptr %11, i32 0, i32 12
  %13 = load i32, ptr %3, align 4, !tbaa !11
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [4 x ptr], ptr %12, i64 0, i64 %14
  %16 = load ptr, ptr %15, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.s_atm, ptr %16, i32 0, i32 5
  %18 = load float, ptr %17, align 4, !tbaa !13
  %19 = load float, ptr %4, align 4, !tbaa !9
  %20 = fadd float %19, %18
  store float %20, ptr %4, align 4, !tbaa !9
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.s_vvertice, ptr %21, i32 0, i32 12
  %23 = load i32, ptr %3, align 4, !tbaa !11
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [4 x ptr], ptr %22, i64 0, i64 %24
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.s_atm, ptr %26, i32 0, i32 6
  %28 = load float, ptr %27, align 8, !tbaa !16
  %29 = load float, ptr %5, align 4, !tbaa !9
  %30 = fadd float %29, %28
  store float %30, ptr %5, align 4, !tbaa !9
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.s_vvertice, ptr %31, i32 0, i32 12
  %33 = load i32, ptr %3, align 4, !tbaa !11
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [4 x ptr], ptr %32, i64 0, i64 %34
  %36 = load ptr, ptr %35, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.s_atm, ptr %36, i32 0, i32 7
  %38 = load float, ptr %37, align 4, !tbaa !17
  %39 = load float, ptr %6, align 4, !tbaa !9
  %40 = fadd float %39, %38
  store float %40, ptr %6, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %10
  %42 = load i32, ptr %3, align 4, !tbaa !11
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %3, align 4, !tbaa !11
  br label %7, !llvm.loop !18

44:                                               ; preds = %7
  %45 = load float, ptr %4, align 4, !tbaa !9
  %46 = fpext float %45 to double
  %47 = fmul double %46, 2.500000e-01
  %48 = fptrunc double %47 to float
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.s_vvertice, ptr %49, i32 0, i32 13
  %51 = getelementptr inbounds [3 x float], ptr %50, i64 0, i64 0
  store float %48, ptr %51, align 8, !tbaa !9
  %52 = load float, ptr %5, align 4, !tbaa !9
  %53 = fpext float %52 to double
  %54 = fmul double %53, 2.500000e-01
  %55 = fptrunc double %54 to float
  %56 = load ptr, ptr %2, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.s_vvertice, ptr %56, i32 0, i32 13
  %58 = getelementptr inbounds [3 x float], ptr %57, i64 0, i64 1
  store float %55, ptr %58, align 4, !tbaa !9
  %59 = load float, ptr %6, align 4, !tbaa !9
  %60 = fpext float %59 to double
  %61 = fmul double %60, 2.500000e-01
  %62 = fptrunc double %61 to float
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.s_vvertice, ptr %63, i32 0, i32 13
  %65 = getelementptr inbounds [3 x float], ptr %64, i64 0, i64 2
  store float %62, ptr %65, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 20}
!14 = !{!"s_atm", !12, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !7, i64 32, !7, i64 37, !7, i64 44, !7, i64 60, !7, i64 76, !7, i64 79, !12, i64 88, !12, i64 92, !12, i64 96, !12, i64 100, !12, i64 104, !12, i64 108, !12, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !7, i64 144, !7, i64 145, !10, i64 148, !10, i64 152, !10, i64 156, !10, i64 160, !15, i64 164, !6, i64 168, !12, i64 176}
!15 = !{!"short", !7, i64 0}
!16 = !{!14, !10, i64 24}
!17 = !{!14, !10, i64 28}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @set_barycenter(ptr nocapture noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 64
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 20
  %5 = getelementptr inbounds i8, ptr %3, i64 28
  %6 = load float, ptr %5, align 4, !tbaa !9
  %7 = fadd float %6, 0.000000e+00
  %8 = getelementptr inbounds i8, ptr %0, i64 72
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %9, i64 20
  %11 = getelementptr inbounds i8, ptr %9, i64 28
  %12 = load float, ptr %11, align 4, !tbaa !9
  %13 = fadd float %7, %12
  %14 = getelementptr inbounds i8, ptr %0, i64 80
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %15, i64 20
  %17 = getelementptr inbounds i8, ptr %15, i64 28
  %18 = load float, ptr %17, align 4, !tbaa !9
  %19 = fadd float %13, %18
  %20 = getelementptr inbounds i8, ptr %0, i64 88
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %21, i64 20
  %23 = getelementptr inbounds i8, ptr %21, i64 28
  %24 = load float, ptr %23, align 4, !tbaa !9
  %25 = fadd float %19, %24
  %26 = getelementptr inbounds i8, ptr %0, i64 96
  %27 = load <2 x float>, ptr %4, align 4, !tbaa !14
  %28 = fadd <2 x float> %27, zeroinitializer
  %29 = load <2 x float>, ptr %10, align 4, !tbaa !14
  %30 = fadd <2 x float> %28, %29
  %31 = load <2 x float>, ptr %16, align 4, !tbaa !14
  %32 = fadd <2 x float> %30, %31
  %33 = load <2 x float>, ptr %22, align 4, !tbaa !14
  %34 = fadd <2 x float> %32, %33
  %35 = fmul <2 x float> %34, <float 2.500000e-01, float 2.500000e-01>
  store <2 x float> %35, ptr %26, align 8, !tbaa !14
  %36 = fmul float %25, 2.500000e-01
  %37 = getelementptr inbounds i8, ptr %0, i64 104
  store float %36, ptr %37, align 8, !tbaa !14
  ret void
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !12, i64 28}
!10 = !{!"s_atm", !11, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !7, i64 32, !7, i64 37, !7, i64 44, !7, i64 60, !7, i64 76, !7, i64 79, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !12, i64 116, !12, i64 120, !12, i64 124, !12, i64 128, !12, i64 132, !12, i64 136, !12, i64 140, !7, i64 144, !7, i64 145, !12, i64 148, !12, i64 152, !12, i64 156, !12, i64 160, !13, i64 164, !6, i64 168, !11, i64 176}
!11 = !{!"int", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!12, !12, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LICMPass,LoopRotatePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass