; LLVM IR from csviragh/robotsim :: src/utilities (dynamics_utils)

; 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.phase_t = type { ptr, ptr, ptr, ptr, i32, i32 }

@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [42 x i8], align 1
@RandomizePhaseOnPlane.StepCount = external hidden global i32, align 4
@RandomizePhaseOnPlane.MaxStep = external hidden global i32, align 4
@RandomizePhaseOnPlane.IsArrangementCorrect = external hidden global i8, align 1
@RandomizePhaseOnPlane.AgentsCoordinates = external hidden global [3 x double], align 16
@RandomizePhaseOnPlane.TempCoord = external hidden global [3 x double], align 16
@RandomizePhaseOnPlane.YAxis = external hidden global [3 x double], align 16
@RandomizePhaseOnPlane.c = external hidden global double, align 8
@RandomizePhaseOnPlane.d = external hidden global double, align 8

; 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
declare dso_local void @InsertAgentsVelocity(ptr noundef, ptr noundef, i32 noundef) #1

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

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #2

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

declare double @VectAbs(ptr noundef) #3

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

declare void @FillVect(ptr noundef, double noundef, double noundef, double noundef) #3

declare double @randomizeDouble(double noundef, double noundef) #3

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

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

; Function Attrs: nounwind uwtable
define dso_local void @RandomizePhaseOnPlane(ptr noundef %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, ptr noundef %6, ptr noundef %7, i32 noundef %8, i32 noundef %9, double noundef %10) #1 {
  %12 = alloca ptr, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca double, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  store ptr %0, ptr %12, align 8, !tbaa !5
  store double %1, ptr %13, align 8, !tbaa !9
  store double %2, ptr %14, align 8, !tbaa !9
  store double %3, ptr %15, align 8, !tbaa !9
  store double %4, ptr %16, align 8, !tbaa !9
  store double %5, ptr %17, align 8, !tbaa !9
  store ptr %6, ptr %18, align 8, !tbaa !5
  store ptr %7, ptr %19, align 8, !tbaa !5
  store i32 %8, ptr %20, align 4, !tbaa !11
  store i32 %9, ptr %21, align 4, !tbaa !11
  store double %10, ptr %22, align 8, !tbaa !9
  store i32 0, ptr @RandomizePhaseOnPlane.StepCount, align 4, !tbaa !11
  %25 = load ptr, ptr %12, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.phase_t, ptr %25, i32 0, i32 5
  %27 = load i32, ptr %26, align 4, !tbaa !13
  %28 = mul nsw i32 100, %27
  store i32 %28, ptr @RandomizePhaseOnPlane.MaxStep, align 4, !tbaa !11
  store i8 0, ptr @RandomizePhaseOnPlane.IsArrangementCorrect, align 1, !tbaa !15
  call void @NullVect(ptr noundef @RandomizePhaseOnPlane.AgentsCoordinates, i32 noundef 3)
  %29 = load ptr, ptr %18, align 8, !tbaa !5
  %30 = load ptr, ptr %19, align 8, !tbaa !5
  call void @VectorialProduct(ptr noundef @RandomizePhaseOnPlane.YAxis, ptr noundef %29, ptr noundef %30)
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %31 = load i32, ptr %20, align 4, !tbaa !11
  store i32 %31, ptr %23, align 4, !tbaa !11
  br label %32

32:                                               ; preds = %121, %11
  %33 = load i32, ptr %23, align 4, !tbaa !11
  %34 = load i32, ptr %21, align 4, !tbaa !11
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %36, label %124

36:                                               ; preds = %32
  br label %37

37:                                               ; preds = %115, %36
  %38 = load i8, ptr @RandomizePhaseOnPlane.IsArrangementCorrect, align 1, !tbaa !15, !range !17, !noundef !18
  %39 = trunc i8 %38 to i1
  %40 = zext i1 %39 to i32
  %41 = icmp eq i32 0, %40
  br i1 %41, label %42, label %120

42:                                               ; preds = %37
  store i8 1, ptr @RandomizePhaseOnPlane.IsArrangementCorrect, align 1, !tbaa !15
  %43 = load double, ptr %13, align 8, !tbaa !9
  %44 = fneg double %43
  %45 = fdiv double %44, 2.000000e+00
  %46 = load double, ptr %13, align 8, !tbaa !9
  %47 = fdiv double %46, 2.000000e+00
  %48 = call double @randomizeDouble(double noundef %45, double noundef %47)
  store double %48, ptr @RandomizePhaseOnPlane.c, align 8, !tbaa !9
  %49 = load double, ptr %14, align 8, !tbaa !9
  %50 = fneg double %49
  %51 = fdiv double %50, 2.000000e+00
  %52 = load double, ptr %14, align 8, !tbaa !9
  %53 = fdiv double %52, 2.000000e+00
  %54 = call double @randomizeDouble(double noundef %51, double noundef %53)
  store double %54, ptr @RandomizePhaseOnPlane.d, align 8, !tbaa !9
  %55 = load double, ptr %15, align 8, !tbaa !9
  %56 = load double, ptr @RandomizePhaseOnPlane.c, align 8, !tbaa !9
  %57 = load ptr, ptr %19, align 8, !tbaa !5
  %58 = getelementptr inbounds double, ptr %57, i64 0
  %59 = load double, ptr %58, align 8, !tbaa !9
  %60 = call double @llvm.fmuladd.f64(double %56, double %59, double %55)
  %61 = load double, ptr @RandomizePhaseOnPlane.d, align 8, !tbaa !9
  %62 = load double, ptr @RandomizePhaseOnPlane.YAxis, align 16, !tbaa !9
  %63 = call double @llvm.fmuladd.f64(double %61, double %62, double %60)
  %64 = load double, ptr %16, align 8, !tbaa !9
  %65 = load double, ptr @RandomizePhaseOnPlane.c, align 8, !tbaa !9
  %66 = load ptr, ptr %19, align 8, !tbaa !5
  %67 = getelementptr inbounds double, ptr %66, i64 1
  %68 = load double, ptr %67, align 8, !tbaa !9
  %69 = call double @llvm.fmuladd.f64(double %65, double %68, double %64)
  %70 = load double, ptr @RandomizePhaseOnPlane.d, align 8, !tbaa !9
  %71 = load double, ptr getelementptr inbounds ([3 x double], ptr @RandomizePhaseOnPlane.YAxis, i64 0, i64 1), align 8, !tbaa !9
  %72 = call double @llvm.fmuladd.f64(double %70, double %71, double %69)
  %73 = load double, ptr %17, align 8, !tbaa !9
  %74 = load double, ptr @RandomizePhaseOnPlane.c, align 8, !tbaa !9
  %75 = load ptr, ptr %19, align 8, !tbaa !5
  %76 = getelementptr inbounds double, ptr %75, i64 2
  %77 = load double, ptr %76, align 8, !tbaa !9
  %78 = call double @llvm.fmuladd.f64(double %74, double %77, double %73)
  %79 = load double, ptr @RandomizePhaseOnPlane.d, align 8, !tbaa !9
  %80 = load double, ptr getelementptr inbounds ([3 x double], ptr @RandomizePhaseOnPlane.YAxis, i64 0, i64 2), align 16, !tbaa !9
  %81 = call double @llvm.fmuladd.f64(double %79, double %80, double %78)
  call void @FillVect(ptr noundef @RandomizePhaseOnPlane.AgentsCoordinates, double noundef %63, double noundef %72, double noundef %81)
  store i32 0, ptr %24, align 4, !tbaa !11
  br label %82

82:                                               ; preds = %103, %42
  %83 = load i32, ptr %24, align 4, !tbaa !11
  %84 = load ptr, ptr %12, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.phase_t, ptr %84, i32 0, i32 5
  %86 = load i32, ptr %85, align 4, !tbaa !13
  %87 = icmp slt i32 %83, %86
  br i1 %87, label %88, label %106

88:                                               ; preds = %82
  %89 = load i32, ptr %23, align 4, !tbaa !11
  %90 = load i32, ptr %24, align 4, !tbaa !11
  %91 = icmp eq i32 %89, %90
  br i1 %91, label %92, label %95

92:                                               ; preds = %88
  %93 = load i32, ptr %21, align 4, !tbaa !11
  %94 = sub nsw i32 %93, 1
  store i32 %94, ptr %24, align 4, !tbaa !11
  br label %103

95:                                               ; preds = %88
  %96 = load ptr, ptr %12, align 8, !tbaa !5
  %97 = load i32, ptr %24, align 4, !tbaa !11
  call void @GetAgentsCoordinates(ptr noundef @RandomizePhaseOnPlane.TempCoord, ptr noundef %96, i32 noundef %97)
  call void @VectDifference(ptr noundef @RandomizePhaseOnPlane.TempCoord, ptr noundef @RandomizePhaseOnPlane.TempCoord, ptr noundef @RandomizePhaseOnPlane.AgentsCoordinates)
  %98 = call double @VectAbs(ptr noundef @RandomizePhaseOnPlane.TempCoord)
  %99 = load double, ptr %22, align 8, !tbaa !9
  %100 = fcmp ole double %98, %99
  br i1 %100, label %101, label %102

101:                                              ; preds = %95
  store i8 0, ptr @RandomizePhaseOnPlane.IsArrangementCorrect, align 1, !tbaa !15
  br label %102

102:                                              ; preds = %101, %95
  br label %103

103:                                              ; preds = %102, %92
  %104 = load i32, ptr %24, align 4, !tbaa !11
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %24, align 4, !tbaa !11
  br label %82, !llvm.loop !19

106:                                              ; preds = %82
  %107 = load i32, ptr @RandomizePhaseOnPlane.StepCount, align 4, !tbaa !11
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr @RandomizePhaseOnPlane.StepCount, align 4, !tbaa !11
  %109 = load i32, ptr @RandomizePhaseOnPlane.StepCount, align 4, !tbaa !11
  %110 = load i32, ptr @RandomizePhaseOnPlane.MaxStep, align 4, !tbaa !11
  %111 = icmp sgt i32 %109, %110
  br i1 %111, label %112, label %115

112:                                              ; preds = %106
  %113 = load ptr, ptr @stderr, align 8, !tbaa !5
  %114 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %113, ptr noundef @.str.1) #6
  call void @exit(i32 noundef -1) #7
  unreachable

115:                                              ; preds = %106
  %116 = load ptr, ptr %12, align 8, !tbaa !5
  %117 = load i32, ptr %23, align 4, !tbaa !11
  call void @InsertAgentsCoordinates(ptr noundef %116, ptr noundef @RandomizePhaseOnPlane.AgentsCoordinates, i32 noundef %117)
  call void @NullVect(ptr noundef @RandomizePhaseOnPlane.AgentsCoordinates, i32 noundef 3)
  %118 = load ptr, ptr %12, align 8, !tbaa !5
  %119 = load i32, ptr %23, align 4, !tbaa !11
  call void @InsertAgentsVelocity(ptr noundef %118, ptr noundef @RandomizePhaseOnPlane.AgentsCoordinates, i32 noundef %119)
  store i8 0, ptr @RandomizePhaseOnPlane.IsArrangementCorrect, align 1, !tbaa !15
  br label %37, !llvm.loop !21

120:                                              ; preds = %37
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %23, align 4, !tbaa !11
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %23, align 4, !tbaa !11
  br label %32, !llvm.loop !22

124:                                              ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  ret void
}

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

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 = { noreturn 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 #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 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { noreturn 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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 36}
!14 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !12, i64 32, !12, i64 36}
!15 = !{!16, !16, i64 0}
!16 = !{!"_Bool", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = distinct !{!22, !20}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [42 x i8], align 1
@RandomizePhaseOnPlane.StepCount = external hidden local_unnamed_addr global i32, align 4
@RandomizePhaseOnPlane.MaxStep = external hidden local_unnamed_addr global i32, align 4
@RandomizePhaseOnPlane.IsArrangementCorrect = external hidden local_unnamed_addr global i8, align 1
@RandomizePhaseOnPlane.AgentsCoordinates = external hidden global [3 x double], align 16
@RandomizePhaseOnPlane.TempCoord = external hidden global [3 x double], align 16
@RandomizePhaseOnPlane.YAxis = external hidden global [3 x double], align 16
@RandomizePhaseOnPlane.c = external hidden local_unnamed_addr global double, align 8
@RandomizePhaseOnPlane.d = external hidden local_unnamed_addr global double, align 8

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

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

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #1

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

declare double @VectAbs(ptr noundef) local_unnamed_addr #2

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

declare void @FillVect(ptr noundef, double noundef, double noundef, double noundef) local_unnamed_addr #2

declare double @randomizeDouble(double noundef, double noundef) local_unnamed_addr #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @RandomizePhaseOnPlane(ptr noundef %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, ptr noundef %6, ptr noundef %7, i32 noundef %8, i32 noundef %9, double noundef %10) local_unnamed_addr #0 {
  store i32 0, ptr @RandomizePhaseOnPlane.StepCount, align 4, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 36
  %13 = load i32, ptr %12, align 4, !tbaa !9
  %14 = mul nsw i32 %13, 100
  store i32 %14, ptr @RandomizePhaseOnPlane.MaxStep, align 4, !tbaa !5
  store i8 0, ptr @RandomizePhaseOnPlane.IsArrangementCorrect, align 1, !tbaa !12
  tail call void @NullVect(ptr noundef nonnull @RandomizePhaseOnPlane.AgentsCoordinates, i32 noundef 3) #5
  tail call void @VectorialProduct(ptr noundef nonnull @RandomizePhaseOnPlane.YAxis, ptr noundef %6, ptr noundef %7) #5
  %15 = icmp slt i32 %8, %9
  br i1 %15, label %thread-pre-split.lr.ph, label %._crit_edge34

thread-pre-split.lr.ph:                           ; preds = %11
  %16 = fmul double %1, -5.000000e-01
  %17 = fmul double %1, 5.000000e-01
  %18 = fmul double %2, -5.000000e-01
  %19 = fmul double %2, 5.000000e-01
  %20 = getelementptr inbounds i8, ptr %7, i64 8
  %21 = getelementptr inbounds i8, ptr %7, i64 16
  %22 = add nsw i32 %9, -1
  %23 = load i8, ptr @RandomizePhaseOnPlane.IsArrangementCorrect, align 1, !tbaa !12
  %24 = icmp eq i8 %23, 0
  br i1 %24, label %.lr.ph31, label %._crit_edge34

.lr.ph31:                                         ; preds = %thread-pre-split.lr.ph, %57
  store i8 1, ptr @RandomizePhaseOnPlane.IsArrangementCorrect, align 1, !tbaa !12
  %25 = tail call double @randomizeDouble(double noundef %16, double noundef %17) #5
  store double %25, ptr @RandomizePhaseOnPlane.c, align 8, !tbaa !14
  %26 = tail call double @randomizeDouble(double noundef %18, double noundef %19) #5
  store double %26, ptr @RandomizePhaseOnPlane.d, align 8, !tbaa !14
  %27 = load double, ptr @RandomizePhaseOnPlane.c, align 8, !tbaa !14
  %28 = load double, ptr %7, align 8, !tbaa !14
  %29 = tail call double @llvm.fmuladd.f64(double %27, double %28, double %3)
  %30 = load double, ptr @RandomizePhaseOnPlane.YAxis, align 16, !tbaa !14
  %31 = tail call double @llvm.fmuladd.f64(double %26, double %30, double %29)
  %32 = load double, ptr %20, align 8, !tbaa !14
  %33 = tail call double @llvm.fmuladd.f64(double %27, double %32, double %4)
  %34 = load double, ptr getelementptr inbounds (i8, ptr @RandomizePhaseOnPlane.YAxis, i64 8), align 8, !tbaa !14
  %35 = tail call double @llvm.fmuladd.f64(double %26, double %34, double %33)
  %36 = load double, ptr %21, align 8, !tbaa !14
  %37 = tail call double @llvm.fmuladd.f64(double %27, double %36, double %5)
  %38 = load double, ptr getelementptr inbounds (i8, ptr @RandomizePhaseOnPlane.YAxis, i64 16), align 16, !tbaa !14
  %39 = tail call double @llvm.fmuladd.f64(double %26, double %38, double %37)
  tail call void @FillVect(ptr noundef nonnull @RandomizePhaseOnPlane.AgentsCoordinates, double noundef %31, double noundef %35, double noundef %39) #5
  %40 = load i32, ptr %12, align 4, !tbaa !9
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph31, %47
  %.030 = phi i32 [ %48, %47 ], [ 0, %.lr.ph31 ]
  %42 = icmp eq i32 %.030, %8
  br i1 %42, label %47, label %43

43:                                               ; preds = %.lr.ph
  tail call void @GetAgentsCoordinates(ptr noundef nonnull @RandomizePhaseOnPlane.TempCoord, ptr noundef nonnull %0, i32 noundef %.030)
  tail call void @VectDifference(ptr noundef nonnull @RandomizePhaseOnPlane.TempCoord, ptr noundef nonnull @RandomizePhaseOnPlane.TempCoord, ptr noundef nonnull @RandomizePhaseOnPlane.AgentsCoordinates) #5
  %44 = tail call double @VectAbs(ptr noundef nonnull @RandomizePhaseOnPlane.TempCoord) #5
  %45 = fcmp ugt double %44, %10
  br i1 %45, label %47, label %46

46:                                               ; preds = %43
  store i8 0, ptr @RandomizePhaseOnPlane.IsArrangementCorrect, align 1, !tbaa !12
  br label %47

47:                                               ; preds = %.lr.ph, %43, %46
  %.1 = phi i32 [ %.030, %46 ], [ %.030, %43 ], [ %22, %.lr.ph ]
  %48 = add nsw i32 %.1, 1
  %49 = load i32, ptr %12, align 4, !tbaa !9
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %.lr.ph, label %._crit_edge, !llvm.loop !16

._crit_edge:                                      ; preds = %47, %.lr.ph31
  %51 = load i32, ptr @RandomizePhaseOnPlane.StepCount, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr @RandomizePhaseOnPlane.StepCount, align 4, !tbaa !5
  %53 = load i32, ptr @RandomizePhaseOnPlane.MaxStep, align 4, !tbaa !5
  %.not = icmp slt i32 %51, %53
  br i1 %.not, label %57, label %54

54:                                               ; preds = %._crit_edge
  %55 = load ptr, ptr @stderr, align 8, !tbaa !18
  %56 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.1) #6
  tail call void @exit(i32 noundef -1) #7
  unreachable

57:                                               ; preds = %._crit_edge
  tail call void @InsertAgentsCoordinates(ptr noundef nonnull %0, ptr noundef nonnull @RandomizePhaseOnPlane.AgentsCoordinates, i32 noundef %8)
  tail call void @NullVect(ptr noundef nonnull @RandomizePhaseOnPlane.AgentsCoordinates, i32 noundef 3) #5
  tail call void @InsertAgentsVelocity(ptr noundef nonnull %0, ptr noundef nonnull @RandomizePhaseOnPlane.AgentsCoordinates, i32 noundef %8)
  store i8 0, ptr @RandomizePhaseOnPlane.IsArrangementCorrect, align 1, !tbaa !12
  br label %.lr.ph31, !llvm.loop !19

._crit_edge34:                                    ; preds = %thread-pre-split.lr.ph, %11
  ret void
}

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

attributes #0 = { 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 #1 = { noreturn 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 #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 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { cold nounwind }
attributes #7 = { noreturn 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 36}
!10 = !{!"", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !6, i64 32, !6, i64 36}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!11, !11, i64 0}
!19 = distinct !{!19, !17}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass