; LLVM IR from csviragh/robotsim :: src (algo_spp_evol_stat)

; 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.sit_parameters_t = type { i32, double, double, double, double, double, double, double, i32, double }
%struct.phase_t = type { ptr, ptr, ptr, ptr, i32, i32 }
%struct.stat_utils_t = type { double, double, ptr, i32 }

@AdjacencyAllocated = external dso_local global i8, align 1
@Data_Corr_Sum = external dso_local global double, align 8
@Data_CorrStd_Sum = external dso_local global double, align 8
@Data_CorrMin_Sum = external dso_local global double, align 8
@Data_CorrMax_Sum = external dso_local global double, align 8
@Data_MinCluster_Sum = external dso_local global double, align 8
@Data_MaxCluster_Sum = external dso_local global double, align 8
@Data_IndependentAgents_Sum = external dso_local global double, align 8
@Data_Corr_StDev = external dso_local global double, align 8
@Data_CorrStd_StDev = external dso_local global double, align 8
@Data_CorrMin_StDev = external dso_local global double, align 8
@Data_CorrMax_StDev = external dso_local global double, align 8
@Data_MinCluster_StDev = external dso_local global double, align 8
@Data_MaxCluster_StDev = external dso_local global double, align 8
@Data_IndependentAgents_StDev = external dso_local global double, align 8
@f_ClusterDependentParams = external dso_local global ptr, align 8
@f_ClusterParams = external dso_local global ptr, align 8
@Visited = external dso_local global ptr, align 8
@Dimension = external hidden global i32, align 4
@Adjacency = external dso_local global ptr, align 8
@SaveClusterDependentParams.AgentsCoordinates = external hidden global [3 x double], align 16
@SaveClusterDependentParams.NeighboursCoordinates = external hidden global [3 x double], align 16
@SaveClusterDependentParams.NumberOfAgentsInCluster = external hidden global i32, align 4
@SaveClusterDependentParams.NumberOfAgentsInithCluster = external hidden global i32, align 4
@SaveClusterDependentParams.AgentsNotInCluster = external hidden global i32, align 4
@SaveClusterDependentParams.MaxClusterSize = external hidden global i32, align 4
@SaveClusterDependentParams.MinClusterSize = external hidden global i32, align 4
@SaveClusterDependentParams.Avg = external hidden global double, align 8
@SaveClusterDependentParams.StDev = external hidden global double, align 8
@SaveClusterDependentParams.Min = external hidden global double, align 8
@SaveClusterDependentParams.Max = external hidden global double, align 8
@SaveClusterDependentParams.Temp = external hidden global double, align 8
@SaveClusterDependentParams.IsItInCluster = external hidden global i8, align 1
@.str.16 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #0

; Function Attrs: nounwind uwtable
declare dso_local void @ConstructAdjacency(ptr noundef, ptr noundef, double noundef) #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @CreateCluster(i32 noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local double @GetInteractionRange() #1

; Function Attrs: nounwind uwtable
define dso_local void @SaveClusterDependentParams(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %12 = load i8, ptr @AdjacencyAllocated, align 1, !tbaa !9, !range !11, !noundef !12
  %13 = trunc i8 %12 to i1
  %14 = zext i1 %13 to i32
  %15 = icmp eq i32 0, %14
  br i1 %15, label %16, label %25

16:                                               ; preds = %4
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.sit_parameters_t, ptr %17, i32 0, i32 0
  %19 = load i32, ptr %18, align 8, !tbaa !13
  store i32 %19, ptr @Dimension, align 4, !tbaa !17
  %20 = load i32, ptr @Dimension, align 4, !tbaa !17
  %21 = load i32, ptr @Dimension, align 4, !tbaa !17
  %22 = call ptr @doubleMatrix(i32 noundef %20, i32 noundef %21)
  store ptr %22, ptr @Adjacency, align 8, !tbaa !5
  %23 = load i32, ptr @Dimension, align 4, !tbaa !17
  %24 = call ptr @BooleanData(i32 noundef %23)
  store ptr %24, ptr @Visited, align 8, !tbaa !5
  store i8 1, ptr @AdjacencyAllocated, align 1, !tbaa !9
  br label %25

25:                                               ; preds = %16, %4
  %26 = load ptr, ptr @Adjacency, align 8, !tbaa !5
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = call double @GetInteractionRange()
  call void @ConstructAdjacency(ptr noundef %26, ptr noundef %27, double noundef %28)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store double 2.000000e+222, ptr @SaveClusterDependentParams.Min, align 8, !tbaa !18
  store double 0.000000e+00, ptr @SaveClusterDependentParams.Max, align 8, !tbaa !18
  store double 0.000000e+00, ptr @SaveClusterDependentParams.Avg, align 8, !tbaa !18
  store double 0.000000e+00, ptr @SaveClusterDependentParams.StDev, align 8, !tbaa !18
  store i32 0, ptr @SaveClusterDependentParams.NumberOfAgentsInCluster, align 4, !tbaa !17
  store i32 0, ptr @SaveClusterDependentParams.AgentsNotInCluster, align 4, !tbaa !17
  store i32 0, ptr @SaveClusterDependentParams.MaxClusterSize, align 4, !tbaa !17
  store i32 0, ptr @SaveClusterDependentParams.MinClusterSize, align 4, !tbaa !17
  store i32 0, ptr %9, align 4, !tbaa !17
  br label %29

29:                                               ; preds = %167, %25
  %30 = load i32, ptr %9, align 4, !tbaa !17
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.sit_parameters_t, ptr %31, i32 0, i32 0
  %33 = load i32, ptr %32, align 8, !tbaa !13
  %34 = icmp slt i32 %30, %33
  br i1 %34, label %35, label %170

35:                                               ; preds = %29
  store i32 1, ptr @SaveClusterDependentParams.NumberOfAgentsInithCluster, align 4, !tbaa !17
  store i8 0, ptr @SaveClusterDependentParams.IsItInCluster, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !17
  br label %36

36:                                               ; preds = %47, %35
  %37 = load i32, ptr %11, align 4, !tbaa !17
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.sit_parameters_t, ptr %38, i32 0, i32 0
  %40 = load i32, ptr %39, align 8, !tbaa !13
  %41 = icmp slt i32 %37, %40
  br i1 %41, label %42, label %50

42:                                               ; preds = %36
  %43 = load ptr, ptr @Visited, align 8, !tbaa !5
  %44 = load i32, ptr %11, align 4, !tbaa !17
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds i8, ptr %43, i64 %45
  store i8 0, ptr %46, align 1, !tbaa !9
  br label %47

47:                                               ; preds = %42
  %48 = load i32, ptr %11, align 4, !tbaa !17
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %11, align 4, !tbaa !17
  br label %36, !llvm.loop !19

50:                                               ; preds = %36
  %51 = load i32, ptr %9, align 4, !tbaa !17
  %52 = load ptr, ptr @Adjacency, align 8, !tbaa !5
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.phase_t, ptr %53, i32 0, i32 5
  %55 = load i32, ptr %54, align 4, !tbaa !21
  call void @CreateCluster(i32 noundef %51, ptr noundef %52, i32 noundef %55)
  store i32 0, ptr %11, align 4, !tbaa !17
  br label %56

56:                                               ; preds = %75, %50
  %57 = load i32, ptr %11, align 4, !tbaa !17
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.sit_parameters_t, ptr %58, i32 0, i32 0
  %60 = load i32, ptr %59, align 8, !tbaa !13
  %61 = icmp slt i32 %57, %60
  br i1 %61, label %62, label %78

62:                                               ; preds = %56
  %63 = load ptr, ptr @Visited, align 8, !tbaa !5
  %64 = load i32, ptr %11, align 4, !tbaa !17
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds i8, ptr %63, i64 %65
  %67 = load i8, ptr %66, align 1, !tbaa !9, !range !11, !noundef !12
  %68 = trunc i8 %67 to i1
  %69 = zext i1 %68 to i32
  %70 = icmp eq i32 1, %69
  br i1 %70, label %71, label %74

71:                                               ; preds = %62
  %72 = load i32, ptr @SaveClusterDependentParams.NumberOfAgentsInithCluster, align 4, !tbaa !17
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr @SaveClusterDependentParams.NumberOfAgentsInithCluster, align 4, !tbaa !17
  br label %74

74:                                               ; preds = %71, %62
  br label %75

75:                                               ; preds = %74
  %76 = load i32, ptr %11, align 4, !tbaa !17
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %11, align 4, !tbaa !17
  br label %56, !llvm.loop !23

78:                                               ; preds = %56
  %79 = load i32, ptr @SaveClusterDependentParams.NumberOfAgentsInithCluster, align 4, !tbaa !17
  %80 = icmp sgt i32 %79, 2
  br i1 %80, label %81, label %82

81:                                               ; preds = %78
  store i8 1, ptr @SaveClusterDependentParams.IsItInCluster, align 1, !tbaa !9
  br label %82

82:                                               ; preds = %81, %78
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = load i32, ptr %9, align 4, !tbaa !17
  call void @GetAgentsVelocity(ptr noundef @SaveClusterDependentParams.AgentsCoordinates, ptr noundef %83, i32 noundef %84)
  call void @UnitVect(ptr noundef @SaveClusterDependentParams.AgentsCoordinates, ptr noundef @SaveClusterDependentParams.AgentsCoordinates)
  store i32 0, ptr %10, align 4, !tbaa !17
  br label %85

85:                                               ; preds = %128, %82
  %86 = load i32, ptr %10, align 4, !tbaa !17
  %87 = load i32, ptr %9, align 4, !tbaa !17
  %88 = icmp slt i32 %86, %87
  br i1 %88, label %89, label %131

89:                                               ; preds = %85
  %90 = load i32, ptr %9, align 4, !tbaa !17
  %91 = load i32, ptr %10, align 4, !tbaa !17
  %92 = icmp ne i32 %90, %91
  br i1 %92, label %93, label %127

93:                                               ; preds = %89
  %94 = load ptr, ptr @Visited, align 8, !tbaa !5
  %95 = load i32, ptr %10, align 4, !tbaa !17
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds i8, ptr %94, i64 %96
  %98 = load i8, ptr %97, align 1, !tbaa !9, !range !11, !noundef !12
  %99 = trunc i8 %98 to i1
  %100 = zext i1 %99 to i32
  %101 = icmp eq i32 %100, 1
  br i1 %101, label %102, label %127

102:                                              ; preds = %93
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = load i32, ptr %10, align 4, !tbaa !17
  call void @GetAgentsVelocity(ptr noundef @SaveClusterDependentParams.NeighboursCoordinates, ptr noundef %103, i32 noundef %104)
  call void @UnitVect(ptr noundef @SaveClusterDependentParams.NeighboursCoordinates, ptr noundef @SaveClusterDependentParams.NeighboursCoordinates)
  %105 = call double @ScalarProduct(ptr noundef @SaveClusterDependentParams.AgentsCoordinates, ptr noundef @SaveClusterDependentParams.NeighboursCoordinates, i32 noundef 3)
  store double %105, ptr @SaveClusterDependentParams.Temp, align 8, !tbaa !18
  %106 = load double, ptr @SaveClusterDependentParams.Temp, align 8, !tbaa !18
  %107 = load double, ptr @SaveClusterDependentParams.Avg, align 8, !tbaa !18
  %108 = fadd double %107, %106
  store double %108, ptr @SaveClusterDependentParams.Avg, align 8, !tbaa !18
  %109 = load double, ptr @SaveClusterDependentParams.Temp, align 8, !tbaa !18
  %110 = load double, ptr @SaveClusterDependentParams.Temp, align 8, !tbaa !18
  %111 = load double, ptr @SaveClusterDependentParams.StDev, align 8, !tbaa !18
  %112 = call double @llvm.fmuladd.f64(double %109, double %110, double %111)
  store double %112, ptr @SaveClusterDependentParams.StDev, align 8, !tbaa !18
  %113 = load double, ptr @SaveClusterDependentParams.Temp, align 8, !tbaa !18
  %114 = load double, ptr @SaveClusterDependentParams.Max, align 8, !tbaa !18
  %115 = fcmp ogt double %113, %114
  br i1 %115, label %116, label %118

116:                                              ; preds = %102
  %117 = load double, ptr @SaveClusterDependentParams.Temp, align 8, !tbaa !18
  store double %117, ptr @SaveClusterDependentParams.Max, align 8, !tbaa !18
  br label %118

118:                                              ; preds = %116, %102
  %119 = load double, ptr @SaveClusterDependentParams.Temp, align 8, !tbaa !18
  %120 = load double, ptr @SaveClusterDependentParams.Min, align 8, !tbaa !18
  %121 = fcmp olt double %119, %120
  br i1 %121, label %122, label %124

122:                                              ; preds = %118
  %123 = load double, ptr @SaveClusterDependentParams.Temp, align 8, !tbaa !18
  store double %123, ptr @SaveClusterDependentParams.Min, align 8, !tbaa !18
  br label %124

124:                                              ; preds = %122, %118
  %125 = load i32, ptr @SaveClusterDependentParams.NumberOfAgentsInCluster, align 4, !tbaa !17
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr @SaveClusterDependentParams.NumberOfAgentsInCluster, align 4, !tbaa !17
  br label %127

127:                                              ; preds = %124, %93, %89
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %10, align 4, !tbaa !17
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %10, align 4, !tbaa !17
  br label %85, !llvm.loop !24

131:                                              ; preds = %85
  %132 = load i32, ptr @SaveClusterDependentParams.NumberOfAgentsInithCluster, align 4, !tbaa !17
  %133 = load i32, ptr @SaveClusterDependentParams.MaxClusterSize, align 4, !tbaa !17
  %134 = icmp sgt i32 %132, %133
  br i1 %134, label %135, label %140

135:                                              ; preds = %131
  %136 = load i32, ptr @SaveClusterDependentParams.NumberOfAgentsInithCluster, align 4, !tbaa !17
  %137 = icmp sgt i32 %136, 1
  br i1 %137, label %138, label %140

138:                                              ; preds = %135
  %139 = load i32, ptr @SaveClusterDependentParams.NumberOfAgentsInithCluster, align 4, !tbaa !17
  store i32 %139, ptr @SaveClusterDependentParams.MaxClusterSize, align 4, !tbaa !17
  br label %140

140:                                              ; preds = %138, %135, %131
  %141 = load i32, ptr @SaveClusterDependentParams.NumberOfAgentsInithCluster, align 4, !tbaa !17
  %142 = load i32, ptr @SaveClusterDependentParams.MinClusterSize, align 4, !tbaa !17
  %143 = icmp slt i32 %141, %142
  br i1 %143, label %144, label %150

144:                                              ; preds = %140
  %145 = load i32, ptr @SaveClusterDependentParams.NumberOfAgentsInithCluster, align 4, !tbaa !17
  %146 = icmp sgt i32 %145, 1
  br i1 %146, label %147, label %150

147:                                              ; preds = %144
  %148 = load i32, ptr @SaveClusterDependentParams.MinClusterSize, align 4, !tbaa !17
  %149 = icmp sgt i32 %148, 0
  br i1 %149, label %156, label %150

150:                                              ; preds = %147, %144, %140
  %151 = load i32, ptr @SaveClusterDependentParams.MinClusterSize, align 4, !tbaa !17
  %152 = icmp eq i32 %151, 0
  br i1 %152, label %153, label %158

153:                                              ; preds = %150
  %154 = load i32, ptr @SaveClusterDependentParams.NumberOfAgentsInithCluster, align 4, !tbaa !17
  %155 = icmp sgt i32 %154, 1
  br i1 %155, label %156, label %158

156:                                              ; preds = %153, %147
  %157 = load i32, ptr @SaveClusterDependentParams.NumberOfAgentsInithCluster, align 4, !tbaa !17
  store i32 %157, ptr @SaveClusterDependentParams.MinClusterSize, align 4, !tbaa !17
  br label %158

158:                                              ; preds = %156, %153, %150
  %159 = load i8, ptr @SaveClusterDependentParams.IsItInCluster, align 1, !tbaa !9, !range !11, !noundef !12
  %160 = trunc i8 %159 to i1
  %161 = zext i1 %160 to i32
  %162 = icmp eq i32 %161, 1
  %163 = zext i1 %162 to i64
  %164 = select i1 %162, i32 0, i32 1
  %165 = load i32, ptr @SaveClusterDependentParams.AgentsNotInCluster, align 4, !tbaa !17
  %166 = add nsw i32 %165, %164
  store i32 %166, ptr @SaveClusterDependentParams.AgentsNotInCluster, align 4, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %167

167:                                              ; preds = %158
  %168 = load i32, ptr %9, align 4, !tbaa !17
  %169 = add nsw i32 %168, 1
  store i32 %169, ptr %9, align 4, !tbaa !17
  br label %29, !llvm.loop !25

170:                                              ; preds = %29
  %171 = load i32, ptr @SaveClusterDependentParams.NumberOfAgentsInCluster, align 4, !tbaa !17
  %172 = icmp sgt i32 %171, 0
  br i1 %172, label %173, label %187

173:                                              ; preds = %170
  %174 = load i32, ptr @SaveClusterDependentParams.NumberOfAgentsInCluster, align 4, !tbaa !17
  %175 = sitofp i32 %174 to double
  %176 = load double, ptr @SaveClusterDependentParams.Avg, align 8, !tbaa !18
  %177 = fdiv double %176, %175
  store double %177, ptr @SaveClusterDependentParams.Avg, align 8, !tbaa !18
  %178 = load i32, ptr @SaveClusterDependentParams.NumberOfAgentsInCluster, align 4, !tbaa !17
  %179 = sitofp i32 %178 to double
  %180 = load double, ptr @SaveClusterDependentParams.StDev, align 8, !tbaa !18
  %181 = fdiv double %180, %179
  store double %181, ptr @SaveClusterDependentParams.StDev, align 8, !tbaa !18
  %182 = load double, ptr @SaveClusterDependentParams.Avg, align 8, !tbaa !18
  %183 = load double, ptr @SaveClusterDependentParams.Avg, align 8, !tbaa !18
  %184 = load double, ptr @SaveClusterDependentParams.StDev, align 8, !tbaa !18
  %185 = fneg double %182
  %186 = call double @llvm.fmuladd.f64(double %185, double %183, double %184)
  store double %186, ptr @SaveClusterDependentParams.StDev, align 8, !tbaa !18
  br label %188

187:                                              ; preds = %170
  store double 0.000000e+00, ptr @SaveClusterDependentParams.Avg, align 8, !tbaa !18
  store double 0.000000e+00, ptr @SaveClusterDependentParams.StDev, align 8, !tbaa !18
  store double 0.000000e+00, ptr @SaveClusterDependentParams.Min, align 8, !tbaa !18
  store double 0.000000e+00, ptr @SaveClusterDependentParams.Max, align 8, !tbaa !18
  br label %188

188:                                              ; preds = %187, %173
  %189 = load double, ptr @SaveClusterDependentParams.StDev, align 8, !tbaa !18
  %190 = fcmp olt double %189, 0.000000e+00
  br i1 %190, label %191, label %192

191:                                              ; preds = %188
  store double 0.000000e+00, ptr @SaveClusterDependentParams.StDev, align 8, !tbaa !18
  br label %192

192:                                              ; preds = %191, %188
  %193 = load ptr, ptr %8, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.stat_utils_t, ptr %193, i32 0, i32 3
  %195 = load i32, ptr %194, align 8, !tbaa !26
  %196 = icmp eq i32 1, %195
  br i1 %196, label %197, label %216

197:                                              ; preds = %192
  %198 = load ptr, ptr @f_ClusterDependentParams, align 8, !tbaa !5
  %199 = load ptr, ptr %8, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.stat_utils_t, ptr %199, i32 0, i32 0
  %201 = load double, ptr %200, align 8, !tbaa !28
  %202 = load double, ptr @SaveClusterDependentParams.Avg, align 8, !tbaa !18
  %203 = load double, ptr @SaveClusterDependentParams.StDev, align 8, !tbaa !18
  %204 = call double @sqrt(double noundef %203) #5
  %205 = load double, ptr @SaveClusterDependentParams.Min, align 8, !tbaa !18
  %206 = load double, ptr @SaveClusterDependentParams.Max, align 8, !tbaa !18
  %207 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %198, ptr noundef @.str.16, double noundef %201, double noundef %202, double noundef %204, double noundef %205, double noundef %206) #5
  %208 = load ptr, ptr @f_ClusterParams, align 8, !tbaa !5
  %209 = load ptr, ptr %8, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.stat_utils_t, ptr %209, i32 0, i32 0
  %211 = load double, ptr %210, align 8, !tbaa !28
  %212 = load i32, ptr @SaveClusterDependentParams.MinClusterSize, align 4, !tbaa !17
  %213 = load i32, ptr @SaveClusterDependentParams.MaxClusterSize, align 4, !tbaa !17
  %214 = load i32, ptr @SaveClusterDependentParams.AgentsNotInCluster, align 4, !tbaa !17
  %215 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %208, ptr noundef @.str.17, double noundef %211, i32 noundef %212, i32 noundef %213, i32 noundef %214) #5
  br label %320

216:                                              ; preds = %192
  %217 = load double, ptr @SaveClusterDependentParams.Avg, align 8, !tbaa !18
  %218 = load ptr, ptr %6, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.sit_parameters_t, ptr %218, i32 0, i32 5
  %220 = load double, ptr %219, align 8, !tbaa !29
  %221 = load double, ptr @Data_Corr_Sum, align 8, !tbaa !18
  %222 = call double @llvm.fmuladd.f64(double %217, double %220, double %221)
  store double %222, ptr @Data_Corr_Sum, align 8, !tbaa !18
  %223 = load double, ptr @SaveClusterDependentParams.StDev, align 8, !tbaa !18
  %224 = call double @sqrt(double noundef %223) #5
  %225 = load ptr, ptr %6, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.sit_parameters_t, ptr %225, i32 0, i32 5
  %227 = load double, ptr %226, align 8, !tbaa !29
  %228 = load double, ptr @Data_CorrStd_Sum, align 8, !tbaa !18
  %229 = call double @llvm.fmuladd.f64(double %224, double %227, double %228)
  store double %229, ptr @Data_CorrStd_Sum, align 8, !tbaa !18
  %230 = load double, ptr @SaveClusterDependentParams.Min, align 8, !tbaa !18
  %231 = load ptr, ptr %6, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.sit_parameters_t, ptr %231, i32 0, i32 5
  %233 = load double, ptr %232, align 8, !tbaa !29
  %234 = load double, ptr @Data_CorrMin_Sum, align 8, !tbaa !18
  %235 = call double @llvm.fmuladd.f64(double %230, double %233, double %234)
  store double %235, ptr @Data_CorrMin_Sum, align 8, !tbaa !18
  %236 = load double, ptr @SaveClusterDependentParams.Max, align 8, !tbaa !18
  %237 = load ptr, ptr %6, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.sit_parameters_t, ptr %237, i32 0, i32 5
  %239 = load double, ptr %238, align 8, !tbaa !29
  %240 = load double, ptr @Data_CorrMax_Sum, align 8, !tbaa !18
  %241 = call double @llvm.fmuladd.f64(double %236, double %239, double %240)
  store double %241, ptr @Data_CorrMax_Sum, align 8, !tbaa !18
  %242 = load i32, ptr @SaveClusterDependentParams.MinClusterSize, align 4, !tbaa !17
  %243 = sitofp i32 %242 to double
  %244 = load ptr, ptr %6, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.sit_parameters_t, ptr %244, i32 0, i32 5
  %246 = load double, ptr %245, align 8, !tbaa !29
  %247 = load double, ptr @Data_MinCluster_Sum, align 8, !tbaa !18
  %248 = call double @llvm.fmuladd.f64(double %243, double %246, double %247)
  store double %248, ptr @Data_MinCluster_Sum, align 8, !tbaa !18
  %249 = load i32, ptr @SaveClusterDependentParams.MaxClusterSize, align 4, !tbaa !17
  %250 = sitofp i32 %249 to double
  %251 = load ptr, ptr %6, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.sit_parameters_t, ptr %251, i32 0, i32 5
  %253 = load double, ptr %252, align 8, !tbaa !29
  %254 = load double, ptr @Data_MaxCluster_Sum, align 8, !tbaa !18
  %255 = call double @llvm.fmuladd.f64(double %250, double %253, double %254)
  store double %255, ptr @Data_MaxCluster_Sum, align 8, !tbaa !18
  %256 = load i32, ptr @SaveClusterDependentParams.AgentsNotInCluster, align 4, !tbaa !17
  %257 = sitofp i32 %256 to double
  %258 = load ptr, ptr %6, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.sit_parameters_t, ptr %258, i32 0, i32 5
  %260 = load double, ptr %259, align 8, !tbaa !29
  %261 = load double, ptr @Data_IndependentAgents_Sum, align 8, !tbaa !18
  %262 = call double @llvm.fmuladd.f64(double %257, double %260, double %261)
  store double %262, ptr @Data_IndependentAgents_Sum, align 8, !tbaa !18
  %263 = load double, ptr @SaveClusterDependentParams.Avg, align 8, !tbaa !18
  %264 = load double, ptr @SaveClusterDependentParams.Avg, align 8, !tbaa !18
  %265 = fmul double %263, %264
  %266 = load ptr, ptr %6, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.sit_parameters_t, ptr %266, i32 0, i32 5
  %268 = load double, ptr %267, align 8, !tbaa !29
  %269 = load double, ptr @Data_Corr_StDev, align 8, !tbaa !18
  %270 = call double @llvm.fmuladd.f64(double %265, double %268, double %269)
  store double %270, ptr @Data_Corr_StDev, align 8, !tbaa !18
  %271 = load double, ptr @SaveClusterDependentParams.StDev, align 8, !tbaa !18
  %272 = load ptr, ptr %6, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.sit_parameters_t, ptr %272, i32 0, i32 5
  %274 = load double, ptr %273, align 8, !tbaa !29
  %275 = load double, ptr @Data_CorrStd_StDev, align 8, !tbaa !18
  %276 = call double @llvm.fmuladd.f64(double %271, double %274, double %275)
  store double %276, ptr @Data_CorrStd_StDev, align 8, !tbaa !18
  %277 = load double, ptr @SaveClusterDependentParams.Min, align 8, !tbaa !18
  %278 = load double, ptr @SaveClusterDependentParams.Min, align 8, !tbaa !18
  %279 = fmul double %277, %278
  %280 = load ptr, ptr %6, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct.sit_parameters_t, ptr %280, i32 0, i32 5
  %282 = load double, ptr %281, align 8, !tbaa !29
  %283 = load double, ptr @Data_CorrMin_StDev, align 8, !tbaa !18
  %284 = call double @llvm.fmuladd.f64(double %279, double %282, double %283)
  store double %284, ptr @Data_CorrMin_StDev, align 8, !tbaa !18
  %285 = load double, ptr @SaveClusterDependentParams.Max, align 8, !tbaa !18
  %286 = load double, ptr @SaveClusterDependentParams.Max, align 8, !tbaa !18
  %287 = fmul double %285, %286
  %288 = load ptr, ptr %6, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.sit_parameters_t, ptr %288, i32 0, i32 5
  %290 = load double, ptr %289, align 8, !tbaa !29
  %291 = load double, ptr @Data_CorrMax_StDev, align 8, !tbaa !18
  %292 = call double @llvm.fmuladd.f64(double %287, double %290, double %291)
  store double %292, ptr @Data_CorrMax_StDev, align 8, !tbaa !18
  %293 = load i32, ptr @SaveClusterDependentParams.MinClusterSize, align 4, !tbaa !17
  %294 = load i32, ptr @SaveClusterDependentParams.MinClusterSize, align 4, !tbaa !17
  %295 = mul nsw i32 %293, %294
  %296 = sitofp i32 %295 to double
  %297 = load ptr, ptr %6, align 8, !tbaa !5
  %298 = getelementptr inbounds %struct.sit_parameters_t, ptr %297, i32 0, i32 5
  %299 = load double, ptr %298, align 8, !tbaa !29
  %300 = load double, ptr @Data_MinCluster_StDev, align 8, !tbaa !18
  %301 = call double @llvm.fmuladd.f64(double %296, double %299, double %300)
  store double %301, ptr @Data_MinCluster_StDev, align 8, !tbaa !18
  %302 = load i32, ptr @SaveClusterDependentParams.MaxClusterSize, align 4, !tbaa !17
  %303 = load i32, ptr @SaveClusterDependentParams.MaxClusterSize, align 4, !tbaa !17
  %304 = mul nsw i32 %302, %303
  %305 = sitofp i32 %304 to double
  %306 = load ptr, ptr %6, align 8, !tbaa !5
  %307 = getelementptr inbounds %struct.sit_parameters_t, ptr %306, i32 0, i32 5
  %308 = load double, ptr %307, align 8, !tbaa !29
  %309 = load double, ptr @Data_MaxCluster_StDev, align 8, !tbaa !18
  %310 = call double @llvm.fmuladd.f64(double %305, double %308, double %309)
  store double %310, ptr @Data_MaxCluster_StDev, align 8, !tbaa !18
  %311 = load i32, ptr @SaveClusterDependentParams.AgentsNotInCluster, align 4, !tbaa !17
  %312 = load i32, ptr @SaveClusterDependentParams.AgentsNotInCluster, align 4, !tbaa !17
  %313 = mul nsw i32 %311, %312
  %314 = sitofp i32 %313 to double
  %315 = load ptr, ptr %6, align 8, !tbaa !5
  %316 = getelementptr inbounds %struct.sit_parameters_t, ptr %315, i32 0, i32 5
  %317 = load double, ptr %316, align 8, !tbaa !29
  %318 = load double, ptr @Data_IndependentAgents_StDev, align 8, !tbaa !18
  %319 = call double @llvm.fmuladd.f64(double %314, double %317, double %318)
  store double %319, ptr @Data_IndependentAgents_StDev, align 8, !tbaa !18
  br label %320

320:                                              ; preds = %216, %197
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret void
}

declare ptr @doubleMatrix(i32 noundef, i32 noundef) #3

declare ptr @BooleanData(i32 noundef) #3

declare void @GetAgentsVelocity(ptr noundef, ptr noundef, i32 noundef) #3

declare void @UnitVect(ptr noundef, ptr noundef) #3

declare double @ScalarProduct(ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

; Function Attrs: nounwind
declare double @sqrt(double noundef) #0

attributes #0 = { nounwind "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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 = !{!"_Bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !15, i64 0}
!14 = !{!"", !15, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !16, i64 40, !16, i64 48, !16, i64 56, !15, i64 64, !16, i64 72}
!15 = !{!"int", !7, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!15, !15, i64 0}
!18 = !{!16, !16, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!22, !15, i64 36}
!22 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !15, i64 32, !15, i64 36}
!23 = distinct !{!23, !20}
!24 = distinct !{!24, !20}
!25 = distinct !{!25, !20}
!26 = !{!27, !15, i64 24}
!27 = !{!"", !16, i64 0, !16, i64 8, !6, i64 16, !15, i64 24}
!28 = !{!27, !16, i64 0}
!29 = !{!14, !16, i64 40}


; 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"

@AdjacencyAllocated = external dso_local local_unnamed_addr global i8, align 1
@Data_Corr_Sum = external dso_local local_unnamed_addr global double, align 8
@Data_CorrStd_Sum = external dso_local local_unnamed_addr global double, align 8
@Data_CorrMin_Sum = external dso_local local_unnamed_addr global double, align 8
@Data_CorrMax_Sum = external dso_local local_unnamed_addr global double, align 8
@Data_MinCluster_Sum = external dso_local local_unnamed_addr global double, align 8
@Data_MaxCluster_Sum = external dso_local local_unnamed_addr global double, align 8
@Data_IndependentAgents_Sum = external dso_local local_unnamed_addr global double, align 8
@Data_Corr_StDev = external dso_local local_unnamed_addr global double, align 8
@Data_CorrStd_StDev = external dso_local local_unnamed_addr global double, align 8
@Data_CorrMin_StDev = external dso_local local_unnamed_addr global double, align 8
@Data_CorrMax_StDev = external dso_local local_unnamed_addr global double, align 8
@Data_MinCluster_StDev = external dso_local local_unnamed_addr global double, align 8
@Data_MaxCluster_StDev = external dso_local local_unnamed_addr global double, align 8
@Data_IndependentAgents_StDev = external dso_local local_unnamed_addr global double, align 8
@f_ClusterDependentParams = external dso_local local_unnamed_addr global ptr, align 8
@f_ClusterParams = external dso_local local_unnamed_addr global ptr, align 8
@Visited = external dso_local local_unnamed_addr global ptr, align 8
@Dimension = external hidden local_unnamed_addr global i32, align 4
@Adjacency = external dso_local local_unnamed_addr global ptr, align 8
@SaveClusterDependentParams.AgentsCoordinates = external hidden global [3 x double], align 16
@SaveClusterDependentParams.NeighboursCoordinates = external hidden global [3 x double], align 16
@SaveClusterDependentParams.NumberOfAgentsInCluster = external hidden local_unnamed_addr global i32, align 4
@SaveClusterDependentParams.NumberOfAgentsInithCluster = external hidden local_unnamed_addr global i32, align 4
@SaveClusterDependentParams.AgentsNotInCluster = external hidden local_unnamed_addr global i32, align 4
@SaveClusterDependentParams.MaxClusterSize = external hidden local_unnamed_addr global i32, align 4
@SaveClusterDependentParams.MinClusterSize = external hidden local_unnamed_addr global i32, align 4
@SaveClusterDependentParams.Avg = external hidden local_unnamed_addr global double, align 8
@SaveClusterDependentParams.StDev = external hidden local_unnamed_addr global double, align 8
@SaveClusterDependentParams.Min = external hidden local_unnamed_addr global double, align 8
@SaveClusterDependentParams.Max = external hidden local_unnamed_addr global double, align 8
@SaveClusterDependentParams.Temp = external hidden local_unnamed_addr global double, align 8
@SaveClusterDependentParams.IsItInCluster = external hidden local_unnamed_addr global i8, align 1
@.str.16 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @ConstructAdjacency(ptr noundef, ptr noundef, double noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @CreateCluster(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local double @GetInteractionRange() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @SaveClusterDependentParams(ptr noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readnone %2, ptr nocapture noundef readonly %3) local_unnamed_addr #1 {
  %5 = load i8, ptr @AdjacencyAllocated, align 1, !tbaa !5, !range !9, !noundef !10
  %6 = icmp eq i8 %5, 0
  br i1 %6, label %7, label %12

7:                                                ; preds = %4
  %8 = load i32, ptr %1, align 8, !tbaa !11
  store i32 %8, ptr @Dimension, align 4, !tbaa !15
  %9 = tail call ptr @doubleMatrix(i32 noundef %8, i32 noundef %8) #6
  store ptr %9, ptr @Adjacency, align 8, !tbaa !16
  %10 = load i32, ptr @Dimension, align 4, !tbaa !15
  %11 = tail call ptr @BooleanData(i32 noundef %10) #6
  store ptr %11, ptr @Visited, align 8, !tbaa !16
  store i8 1, ptr @AdjacencyAllocated, align 1, !tbaa !5
  br label %12

12:                                               ; preds = %7, %4
  %13 = load ptr, ptr @Adjacency, align 8, !tbaa !16
  %14 = tail call double @GetInteractionRange()
  tail call void @ConstructAdjacency(ptr noundef %13, ptr noundef %0, double noundef %14)
  store double 2.000000e+222, ptr @SaveClusterDependentParams.Min, align 8, !tbaa !18
  store double 0.000000e+00, ptr @SaveClusterDependentParams.Max, align 8, !tbaa !18
  store double 0.000000e+00, ptr @SaveClusterDependentParams.Avg, align 8, !tbaa !18
  store double 0.000000e+00, ptr @SaveClusterDependentParams.StDev, align 8, !tbaa !18
  store i32 0, ptr @SaveClusterDependentParams.NumberOfAgentsInCluster, align 4, !tbaa !15
  store i32 0, ptr @SaveClusterDependentParams.AgentsNotInCluster, align 4, !tbaa !15
  store i32 0, ptr @SaveClusterDependentParams.MaxClusterSize, align 4, !tbaa !15
  store i32 0, ptr @SaveClusterDependentParams.MinClusterSize, align 4, !tbaa !15
  %15 = load i32, ptr %1, align 8, !tbaa !11
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph67, label %.thread

.lr.ph67:                                         ; preds = %12
  %17 = getelementptr inbounds i8, ptr %0, i64 36
  br label %18

18:                                               ; preds = %.lr.ph67, %80
  %indvars.iv74 = phi i64 [ 0, %.lr.ph67 ], [ %indvars.iv.next75, %80 ]
  store i32 1, ptr @SaveClusterDependentParams.NumberOfAgentsInithCluster, align 4, !tbaa !15
  store i8 0, ptr @SaveClusterDependentParams.IsItInCluster, align 1, !tbaa !5
  %19 = load i32, ptr %1, align 8, !tbaa !11
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %18
  %21 = load ptr, ptr @Visited, align 8, !tbaa !16
  %22 = zext nneg i32 %19 to i64
  tail call void @llvm.memset.p0.i64(ptr align 1 %21, i8 0, i64 %22, i1 false), !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %18
  %23 = load ptr, ptr @Adjacency, align 8, !tbaa !16
  %24 = load i32, ptr %17, align 4, !tbaa !19
  %25 = trunc nuw nsw i64 %indvars.iv74 to i32
  tail call void @CreateCluster(i32 noundef %25, ptr noundef %23, i32 noundef %24)
  %26 = load i32, ptr %1, align 8, !tbaa !11
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph59, label %._crit_edge60

.lr.ph59:                                         ; preds = %._crit_edge
  %28 = load ptr, ptr @Visited, align 8, !tbaa !16
  br label %29

29:                                               ; preds = %.lr.ph59, %37
  %30 = phi i32 [ %26, %.lr.ph59 ], [ %38, %37 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph59 ], [ %indvars.iv.next, %37 ]
  %31 = getelementptr inbounds i8, ptr %28, i64 %indvars.iv
  %32 = load i8, ptr %31, align 1, !tbaa !5, !range !9, !noundef !10
  %33 = trunc nuw i8 %32 to i1
  br i1 %33, label %34, label %37

34:                                               ; preds = %29
  %35 = load i32, ptr @SaveClusterDependentParams.NumberOfAgentsInithCluster, align 4, !tbaa !15
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr @SaveClusterDependentParams.NumberOfAgentsInithCluster, align 4, !tbaa !15
  %.pre = load i32, ptr %1, align 8, !tbaa !11
  br label %37

37:                                               ; preds = %29, %34
  %38 = phi i32 [ %30, %29 ], [ %.pre, %34 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %39 = sext i32 %38 to i64
  %40 = icmp slt i64 %indvars.iv.next, %39
  br i1 %40, label %29, label %._crit_edge60, !llvm.loop !21

._crit_edge60:                                    ; preds = %37, %._crit_edge
  %41 = load i32, ptr @SaveClusterDependentParams.NumberOfAgentsInithCluster, align 4, !tbaa !15
  %42 = icmp sgt i32 %41, 2
  br i1 %42, label %43, label %44

43:                                               ; preds = %._crit_edge60
  store i8 1, ptr @SaveClusterDependentParams.IsItInCluster, align 1, !tbaa !5
  br label %44

44:                                               ; preds = %43, %._crit_edge60
  tail call void @GetAgentsVelocity(ptr noundef nonnull @SaveClusterDependentParams.AgentsCoordinates, ptr noundef %0, i32 noundef %25) #6
  tail call void @UnitVect(ptr noundef nonnull @SaveClusterDependentParams.AgentsCoordinates, ptr noundef nonnull @SaveClusterDependentParams.AgentsCoordinates) #6
  %.not = icmp eq i64 %indvars.iv74, 0
  br i1 %.not, label %._crit_edge64, label %.lr.ph63.preheader

.lr.ph63.preheader:                               ; preds = %44
  %.pre78 = load ptr, ptr @Visited, align 8, !tbaa !16
  br label %.lr.ph63

.lr.ph63:                                         ; preds = %.lr.ph63.preheader, %66
  %45 = phi ptr [ %.pre78, %.lr.ph63.preheader ], [ %67, %66 ]
  %indvars.iv71 = phi i64 [ 0, %.lr.ph63.preheader ], [ %indvars.iv.next72, %66 ]
  %46 = getelementptr inbounds i8, ptr %45, i64 %indvars.iv71
  %47 = load i8, ptr %46, align 1, !tbaa !5, !range !9, !noundef !10
  %48 = trunc nuw i8 %47 to i1
  br i1 %48, label %49, label %66

49:                                               ; preds = %.lr.ph63
  %50 = trunc nuw nsw i64 %indvars.iv71 to i32
  tail call void @GetAgentsVelocity(ptr noundef nonnull @SaveClusterDependentParams.NeighboursCoordinates, ptr noundef %0, i32 noundef %50) #6
  tail call void @UnitVect(ptr noundef nonnull @SaveClusterDependentParams.NeighboursCoordinates, ptr noundef nonnull @SaveClusterDependentParams.NeighboursCoordinates) #6
  %51 = tail call double @ScalarProduct(ptr noundef nonnull @SaveClusterDependentParams.AgentsCoordinates, ptr noundef nonnull @SaveClusterDependentParams.NeighboursCoordinates, i32 noundef 3) #6
  store double %51, ptr @SaveClusterDependentParams.Temp, align 8, !tbaa !18
  %52 = load double, ptr @SaveClusterDependentParams.Avg, align 8, !tbaa !18
  %53 = fadd double %51, %52
  store double %53, ptr @SaveClusterDependentParams.Avg, align 8, !tbaa !18
  %54 = load double, ptr @SaveClusterDependentParams.StDev, align 8, !tbaa !18
  %55 = tail call double @llvm.fmuladd.f64(double %51, double %51, double %54)
  store double %55, ptr @SaveClusterDependentParams.StDev, align 8, !tbaa !18
  %56 = load double, ptr @SaveClusterDependentParams.Max, align 8, !tbaa !18
  %57 = fcmp ogt double %51, %56
  %.pre77 = load ptr, ptr @Visited, align 8, !tbaa !16
  br i1 %57, label %58, label %59

58:                                               ; preds = %49
  store double %51, ptr @SaveClusterDependentParams.Max, align 8, !tbaa !18
  br label %59

59:                                               ; preds = %58, %49
  %60 = load double, ptr @SaveClusterDependentParams.Min, align 8, !tbaa !18
  %61 = fcmp olt double %51, %60
  br i1 %61, label %62, label %63

62:                                               ; preds = %59
  store double %51, ptr @SaveClusterDependentParams.Min, align 8, !tbaa !18
  br label %63

63:                                               ; preds = %62, %59
  %64 = load i32, ptr @SaveClusterDependentParams.NumberOfAgentsInCluster, align 4, !tbaa !15
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr @SaveClusterDependentParams.NumberOfAgentsInCluster, align 4, !tbaa !15
  br label %66

66:                                               ; preds = %.lr.ph63, %63
  %67 = phi ptr [ %45, %.lr.ph63 ], [ %.pre77, %63 ]
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next72, %indvars.iv74
  br i1 %exitcond.not, label %._crit_edge64, label %.lr.ph63, !llvm.loop !23

._crit_edge64:                                    ; preds = %66, %44
  %68 = load i32, ptr @SaveClusterDependentParams.NumberOfAgentsInithCluster, align 4
  %69 = load i32, ptr @SaveClusterDependentParams.MaxClusterSize, align 4, !tbaa !15
  %70 = icmp sgt i32 %68, %69
  %71 = icmp sgt i32 %68, 1
  %or.cond = and i1 %71, %70
  br i1 %or.cond, label %72, label %73

72:                                               ; preds = %._crit_edge64
  store i32 %68, ptr @SaveClusterDependentParams.MaxClusterSize, align 4, !tbaa !15
  br label %73

73:                                               ; preds = %72, %._crit_edge64
  %74 = load i32, ptr @SaveClusterDependentParams.MinClusterSize, align 4
  %75 = icmp slt i32 %68, %74
  %76 = icmp sgt i32 %74, 0
  %77 = and i1 %75, %76
  %78 = icmp eq i32 %74, 0
  %or.cond555 = or i1 %78, %77
  %or.cond54 = and i1 %71, %or.cond555
  br i1 %or.cond54, label %79, label %80

79:                                               ; preds = %73
  store i32 %68, ptr @SaveClusterDependentParams.MinClusterSize, align 4, !tbaa !15
  br label %80

80:                                               ; preds = %73, %79
  %81 = load i8, ptr @SaveClusterDependentParams.IsItInCluster, align 1, !tbaa !5, !range !9, !noundef !10
  %82 = xor i8 %81, 1
  %not. = zext nneg i8 %82 to i32
  %83 = load i32, ptr @SaveClusterDependentParams.AgentsNotInCluster, align 4, !tbaa !15
  %84 = add nsw i32 %83, %not.
  store i32 %84, ptr @SaveClusterDependentParams.AgentsNotInCluster, align 4, !tbaa !15
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %85 = load i32, ptr %1, align 8, !tbaa !11
  %86 = sext i32 %85 to i64
  %87 = icmp slt i64 %indvars.iv.next75, %86
  br i1 %87, label %18, label %._crit_edge68, !llvm.loop !24

._crit_edge68:                                    ; preds = %80
  %.pre79 = load i32, ptr @SaveClusterDependentParams.NumberOfAgentsInCluster, align 4, !tbaa !15
  %88 = icmp sgt i32 %.pre79, 0
  br i1 %88, label %89, label %.thread

.thread:                                          ; preds = %12, %._crit_edge68
  store double 0.000000e+00, ptr @SaveClusterDependentParams.Avg, align 8, !tbaa !18
  store double 0.000000e+00, ptr @SaveClusterDependentParams.StDev, align 8, !tbaa !18
  store double 0.000000e+00, ptr @SaveClusterDependentParams.Min, align 8, !tbaa !18
  br label %.sink.split

89:                                               ; preds = %._crit_edge68
  %90 = uitofp nneg i32 %.pre79 to double
  %91 = load double, ptr @SaveClusterDependentParams.Avg, align 8, !tbaa !18
  %92 = fdiv double %91, %90
  store double %92, ptr @SaveClusterDependentParams.Avg, align 8, !tbaa !18
  %93 = load double, ptr @SaveClusterDependentParams.StDev, align 8, !tbaa !18
  %94 = fdiv double %93, %90
  %95 = fneg double %92
  %96 = tail call double @llvm.fmuladd.f64(double %95, double %92, double %94)
  store double %96, ptr @SaveClusterDependentParams.StDev, align 8, !tbaa !18
  %97 = fcmp olt double %96, 0.000000e+00
  br i1 %97, label %.sink.split, label %98

.sink.split:                                      ; preds = %89, %.thread
  %SaveClusterDependentParams.Max.sink = phi ptr [ @SaveClusterDependentParams.Max, %.thread ], [ @SaveClusterDependentParams.StDev, %89 ]
  %.ph = phi double [ 0.000000e+00, %.thread ], [ %92, %89 ]
  store double 0.000000e+00, ptr %SaveClusterDependentParams.Max.sink, align 8, !tbaa !18
  br label %98

98:                                               ; preds = %.sink.split, %89
  %99 = phi double [ %96, %89 ], [ 0.000000e+00, %.sink.split ]
  %100 = phi double [ %92, %89 ], [ %.ph, %.sink.split ]
  %101 = getelementptr inbounds i8, ptr %3, i64 24
  %102 = load i32, ptr %101, align 8, !tbaa !25
  %103 = icmp eq i32 %102, 1
  br i1 %103, label %104, label %117

104:                                              ; preds = %98
  %105 = load ptr, ptr @f_ClusterDependentParams, align 8, !tbaa !16
  %106 = load double, ptr %3, align 8, !tbaa !27
  %107 = tail call double @sqrt(double noundef %99) #6
  %108 = load double, ptr @SaveClusterDependentParams.Min, align 8, !tbaa !18
  %109 = load double, ptr @SaveClusterDependentParams.Max, align 8, !tbaa !18
  %110 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %105, ptr noundef nonnull @.str.16, double noundef %106, double noundef %100, double noundef %107, double noundef %108, double noundef %109) #6
  %111 = load ptr, ptr @f_ClusterParams, align 8, !tbaa !16
  %112 = load double, ptr %3, align 8, !tbaa !27
  %113 = load i32, ptr @SaveClusterDependentParams.MinClusterSize, align 4, !tbaa !15
  %114 = load i32, ptr @SaveClusterDependentParams.MaxClusterSize, align 4, !tbaa !15
  %115 = load i32, ptr @SaveClusterDependentParams.AgentsNotInCluster, align 4, !tbaa !15
  %116 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %111, ptr noundef nonnull @.str.17, double noundef %112, i32 noundef %113, i32 noundef %114, i32 noundef %115) #6
  br label %169

117:                                              ; preds = %98
  %118 = getelementptr inbounds i8, ptr %1, i64 40
  %119 = load double, ptr %118, align 8, !tbaa !28
  %120 = load double, ptr @Data_Corr_Sum, align 8, !tbaa !18
  %121 = tail call double @llvm.fmuladd.f64(double %100, double %119, double %120)
  store double %121, ptr @Data_Corr_Sum, align 8, !tbaa !18
  %122 = tail call double @sqrt(double noundef %99) #6
  %123 = load double, ptr %118, align 8, !tbaa !28
  %124 = load double, ptr @Data_CorrStd_Sum, align 8, !tbaa !18
  %125 = tail call double @llvm.fmuladd.f64(double %122, double %123, double %124)
  store double %125, ptr @Data_CorrStd_Sum, align 8, !tbaa !18
  %126 = load double, ptr @SaveClusterDependentParams.Min, align 8, !tbaa !18
  %127 = load double, ptr @Data_CorrMin_Sum, align 8, !tbaa !18
  %128 = tail call double @llvm.fmuladd.f64(double %126, double %123, double %127)
  store double %128, ptr @Data_CorrMin_Sum, align 8, !tbaa !18
  %129 = load double, ptr @SaveClusterDependentParams.Max, align 8, !tbaa !18
  %130 = load double, ptr @Data_CorrMax_Sum, align 8, !tbaa !18
  %131 = tail call double @llvm.fmuladd.f64(double %129, double %123, double %130)
  store double %131, ptr @Data_CorrMax_Sum, align 8, !tbaa !18
  %132 = load i32, ptr @SaveClusterDependentParams.MinClusterSize, align 4, !tbaa !15
  %133 = sitofp i32 %132 to double
  %134 = load double, ptr @Data_MinCluster_Sum, align 8, !tbaa !18
  %135 = tail call double @llvm.fmuladd.f64(double %133, double %123, double %134)
  store double %135, ptr @Data_MinCluster_Sum, align 8, !tbaa !18
  %136 = load i32, ptr @SaveClusterDependentParams.MaxClusterSize, align 4, !tbaa !15
  %137 = sitofp i32 %136 to double
  %138 = load double, ptr @Data_MaxCluster_Sum, align 8, !tbaa !18
  %139 = tail call double @llvm.fmuladd.f64(double %137, double %123, double %138)
  store double %139, ptr @Data_MaxCluster_Sum, align 8, !tbaa !18
  %140 = load i32, ptr @SaveClusterDependentParams.AgentsNotInCluster, align 4, !tbaa !15
  %141 = sitofp i32 %140 to double
  %142 = load double, ptr @Data_IndependentAgents_Sum, align 8, !tbaa !18
  %143 = tail call double @llvm.fmuladd.f64(double %141, double %123, double %142)
  store double %143, ptr @Data_IndependentAgents_Sum, align 8, !tbaa !18
  %144 = load double, ptr @SaveClusterDependentParams.Avg, align 8, !tbaa !18
  %145 = fmul double %144, %144
  %146 = load double, ptr @Data_Corr_StDev, align 8, !tbaa !18
  %147 = tail call double @llvm.fmuladd.f64(double %145, double %123, double %146)
  store double %147, ptr @Data_Corr_StDev, align 8, !tbaa !18
  %148 = load double, ptr @SaveClusterDependentParams.StDev, align 8, !tbaa !18
  %149 = load double, ptr @Data_CorrStd_StDev, align 8, !tbaa !18
  %150 = tail call double @llvm.fmuladd.f64(double %148, double %123, double %149)
  store double %150, ptr @Data_CorrStd_StDev, align 8, !tbaa !18
  %151 = fmul double %126, %126
  %152 = load double, ptr @Data_CorrMin_StDev, align 8, !tbaa !18
  %153 = tail call double @llvm.fmuladd.f64(double %151, double %123, double %152)
  store double %153, ptr @Data_CorrMin_StDev, align 8, !tbaa !18
  %154 = fmul double %129, %129
  %155 = load double, ptr @Data_CorrMax_StDev, align 8, !tbaa !18
  %156 = tail call double @llvm.fmuladd.f64(double %154, double %123, double %155)
  store double %156, ptr @Data_CorrMax_StDev, align 8, !tbaa !18
  %157 = mul nsw i32 %132, %132
  %158 = uitofp nneg i32 %157 to double
  %159 = load double, ptr @Data_MinCluster_StDev, align 8, !tbaa !18
  %160 = tail call double @llvm.fmuladd.f64(double %158, double %123, double %159)
  store double %160, ptr @Data_MinCluster_StDev, align 8, !tbaa !18
  %161 = mul nsw i32 %136, %136
  %162 = uitofp nneg i32 %161 to double
  %163 = load double, ptr @Data_MaxCluster_StDev, align 8, !tbaa !18
  %164 = tail call double @llvm.fmuladd.f64(double %162, double %123, double %163)
  store double %164, ptr @Data_MaxCluster_StDev, align 8, !tbaa !18
  %165 = mul nsw i32 %140, %140
  %166 = uitofp nneg i32 %165 to double
  %167 = load double, ptr @Data_IndependentAgents_StDev, align 8, !tbaa !18
  %168 = tail call double @llvm.fmuladd.f64(double %166, double %123, double %167)
  store double %168, ptr @Data_IndependentAgents_StDev, align 8, !tbaa !18
  br label %169

169:                                              ; preds = %117, %104
  ret void
}

declare ptr @doubleMatrix(i32 noundef, i32 noundef) local_unnamed_addr #2

declare ptr @BooleanData(i32 noundef) local_unnamed_addr #2

declare void @GetAgentsVelocity(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @UnitVect(ptr noundef, ptr noundef) local_unnamed_addr #2

declare double @ScalarProduct(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

attributes #0 = { nofree nounwind "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 #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 = { "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 #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { mustprogress nofree nounwind willreturn memory(write) "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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 = !{!"_Bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}
!11 = !{!12, !13, i64 0}
!12 = !{!"", !13, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !13, i64 64, !14, i64 72}
!13 = !{!"int", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!13, !13, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{!14, !14, i64 0}
!19 = !{!20, !13, i64 36}
!20 = !{!"", !17, i64 0, !17, i64 8, !17, i64 16, !17, i64 24, !13, i64 32, !13, i64 36}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = distinct !{!24, !22}
!25 = !{!26, !13, i64 24}
!26 = !{!"", !14, i64 0, !14, i64 8, !17, i64 16, !13, i64 24}
!27 = !{!26, !14, i64 0}
!28 = !{!12, !14, i64 40}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass