; 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
@PlaceAgentsInsideARing.MaxStep = external hidden global i32, align 4
@PlaceAgentsInsideARing.RandomPlaceVector = external hidden global [3 x double], align 16
@PlaceAgentsInsideARing.ActualAgentsVelocity = external hidden global [3 x double], align 16
@PlaceAgentsInsideARing.AgentjsCoords = external hidden global [3 x double], align 16
@PlaceAgentsInsideARing.DiffCoords = external hidden global [3 x double], align 16
@PlaceAgentsInsideARing.temp = external hidden global double, align 8
@PlaceAgentsInsideARing.isArrangementCorrect = external hidden global i8, align 1

; 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: nounwind uwtable
define dso_local void @PlaceAgentsInsideARing(ptr noundef %0, double noundef %1, i32 noundef %2, i32 noundef %3, double noundef %4, double noundef %5, double noundef %6, double noundef %7, double noundef %8) #1 {
  %10 = alloca ptr, align 8
  %11 = alloca double, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store double %1, ptr %11, align 8, !tbaa !9
  store i32 %2, ptr %12, align 4, !tbaa !11
  store i32 %3, ptr %13, align 4, !tbaa !11
  store double %4, ptr %14, align 8, !tbaa !9
  store double %5, ptr %15, align 8, !tbaa !9
  store double %6, ptr %16, align 8, !tbaa !9
  store double %7, ptr %17, align 8, !tbaa !9
  store double %8, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %22 = load ptr, ptr %10, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.phase_t, ptr %22, i32 0, i32 5
  %24 = load i32, ptr %23, align 4, !tbaa !13
  %25 = mul nsw i32 100, %24
  store i32 %25, ptr @PlaceAgentsInsideARing.MaxStep, align 4, !tbaa !11
  store i8 0, ptr @PlaceAgentsInsideARing.isArrangementCorrect, align 1, !tbaa !15
  %26 = load i32, ptr %12, align 4, !tbaa !11
  store i32 %26, ptr %19, align 4, !tbaa !11
  br label %27

27:                                               ; preds = %36, %9
  %28 = load i32, ptr %19, align 4, !tbaa !11
  %29 = load i32, ptr %13, align 4, !tbaa !11
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %31, label %39

31:                                               ; preds = %27
  call void @FillVect(ptr noundef @PlaceAgentsInsideARing.RandomPlaceVector, double noundef 2.000000e+22, double noundef 2.000000e+22, double noundef 2.000000e+22)
  %32 = load ptr, ptr %10, align 8, !tbaa !5
  %33 = load i32, ptr %19, align 4, !tbaa !11
  call void @InsertAgentsCoordinates(ptr noundef %32, ptr noundef @PlaceAgentsInsideARing.RandomPlaceVector, i32 noundef %33)
  call void @NullVect(ptr noundef @PlaceAgentsInsideARing.RandomPlaceVector, i32 noundef 3)
  %34 = load ptr, ptr %10, align 8, !tbaa !5
  %35 = load i32, ptr %19, align 4, !tbaa !11
  call void @InsertAgentsVelocity(ptr noundef %34, ptr noundef @PlaceAgentsInsideARing.RandomPlaceVector, i32 noundef %35)
  br label %36

36:                                               ; preds = %31
  %37 = load i32, ptr %19, align 4, !tbaa !11
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %19, align 4, !tbaa !11
  br label %27, !llvm.loop !17

39:                                               ; preds = %27
  call void @NullVect(ptr noundef @PlaceAgentsInsideARing.ActualAgentsVelocity, i32 noundef 3)
  store i32 0, ptr %21, align 4, !tbaa !11
  %40 = load i32, ptr %12, align 4, !tbaa !11
  store i32 %40, ptr %19, align 4, !tbaa !11
  br label %41

41:                                               ; preds = %113, %39
  %42 = load i32, ptr %19, align 4, !tbaa !11
  %43 = load i32, ptr %13, align 4, !tbaa !11
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %45, label %116

45:                                               ; preds = %41
  br label %46

46:                                               ; preds = %107, %45
  %47 = load i8, ptr @PlaceAgentsInsideARing.isArrangementCorrect, align 1, !tbaa !15, !range !19, !noundef !20
  %48 = trunc i8 %47 to i1
  %49 = zext i1 %48 to i32
  %50 = icmp eq i32 0, %49
  br i1 %50, label %51, label %108

51:                                               ; preds = %46
  store i8 1, ptr @PlaceAgentsInsideARing.isArrangementCorrect, align 1, !tbaa !15
  %52 = call double @randomizeDouble(double noundef 0.000000e+00, double noundef 0x401921FB54442D18)
  store double %52, ptr @PlaceAgentsInsideARing.RandomPlaceVector, align 16, !tbaa !9
  %53 = load double, ptr %11, align 8, !tbaa !9
  %54 = call double @randomizeDouble(double noundef 0.000000e+00, double noundef %53)
  store double %54, ptr @PlaceAgentsInsideARing.temp, align 8, !tbaa !9
  %55 = load double, ptr %15, align 8, !tbaa !9
  %56 = load double, ptr @PlaceAgentsInsideARing.temp, align 8, !tbaa !9
  %57 = load double, ptr @PlaceAgentsInsideARing.RandomPlaceVector, align 16, !tbaa !9
  %58 = call double @cos(double noundef %57) #6
  %59 = call double @llvm.fmuladd.f64(double %56, double %58, double %55)
  store double %59, ptr getelementptr inbounds ([3 x double], ptr @PlaceAgentsInsideARing.RandomPlaceVector, i64 0, i64 1), align 8, !tbaa !9
  %60 = load double, ptr %14, align 8, !tbaa !9
  %61 = load double, ptr @PlaceAgentsInsideARing.temp, align 8, !tbaa !9
  %62 = load double, ptr @PlaceAgentsInsideARing.RandomPlaceVector, align 16, !tbaa !9
  %63 = call double @sin(double noundef %62) #6
  %64 = call double @llvm.fmuladd.f64(double %61, double %63, double %60)
  store double %64, ptr @PlaceAgentsInsideARing.RandomPlaceVector, align 16, !tbaa !9
  %65 = load double, ptr %16, align 8, !tbaa !9
  %66 = load double, ptr %17, align 8, !tbaa !9
  %67 = fdiv double %66, 2.000000e+00
  %68 = fsub double %65, %67
  %69 = load double, ptr %16, align 8, !tbaa !9
  %70 = load double, ptr %17, align 8, !tbaa !9
  %71 = fdiv double %70, 2.000000e+00
  %72 = fadd double %69, %71
  %73 = call double @randomizeDouble(double noundef %68, double noundef %72)
  store double %73, ptr getelementptr inbounds ([3 x double], ptr @PlaceAgentsInsideARing.RandomPlaceVector, i64 0, i64 2), align 16, !tbaa !9
  store i32 0, ptr %20, align 4, !tbaa !11
  br label %74

74:                                               ; preds = %95, %51
  %75 = load i32, ptr %20, align 4, !tbaa !11
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.phase_t, ptr %76, i32 0, i32 5
  %78 = load i32, ptr %77, align 4, !tbaa !13
  %79 = icmp slt i32 %75, %78
  br i1 %79, label %80, label %98

80:                                               ; preds = %74
  %81 = load i32, ptr %19, align 4, !tbaa !11
  %82 = load i32, ptr %20, align 4, !tbaa !11
  %83 = icmp eq i32 %81, %82
  br i1 %83, label %84, label %87

84:                                               ; preds = %80
  %85 = load i32, ptr %13, align 4, !tbaa !11
  %86 = sub nsw i32 %85, 1
  store i32 %86, ptr %20, align 4, !tbaa !11
  br label %95

87:                                               ; preds = %80
  %88 = load ptr, ptr %10, align 8, !tbaa !5
  %89 = load i32, ptr %20, align 4, !tbaa !11
  call void @GetAgentsCoordinates(ptr noundef @PlaceAgentsInsideARing.AgentjsCoords, ptr noundef %88, i32 noundef %89)
  call void @VectDifference(ptr noundef @PlaceAgentsInsideARing.DiffCoords, ptr noundef @PlaceAgentsInsideARing.AgentjsCoords, ptr noundef @PlaceAgentsInsideARing.RandomPlaceVector)
  %90 = call double @VectAbs(ptr noundef @PlaceAgentsInsideARing.DiffCoords)
  %91 = load double, ptr %18, align 8, !tbaa !9
  %92 = fcmp ole double %90, %91
  br i1 %92, label %93, label %94

93:                                               ; preds = %87
  store i8 0, ptr @PlaceAgentsInsideARing.isArrangementCorrect, align 1, !tbaa !15
  br label %94

94:                                               ; preds = %93, %87
  br label %95

95:                                               ; preds = %94, %84
  %96 = load i32, ptr %20, align 4, !tbaa !11
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %20, align 4, !tbaa !11
  br label %74, !llvm.loop !21

98:                                               ; preds = %74
  %99 = load i32, ptr %21, align 4, !tbaa !11
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %21, align 4, !tbaa !11
  %101 = load i32, ptr %21, align 4, !tbaa !11
  %102 = load i32, ptr @PlaceAgentsInsideARing.MaxStep, align 4, !tbaa !11
  %103 = icmp sgt i32 %101, %102
  br i1 %103, label %104, label %107

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

107:                                              ; preds = %98
  br label %46, !llvm.loop !22

108:                                              ; preds = %46
  %109 = load ptr, ptr %10, align 8, !tbaa !5
  %110 = load i32, ptr %19, align 4, !tbaa !11
  call void @InsertAgentsVelocity(ptr noundef %109, ptr noundef @PlaceAgentsInsideARing.ActualAgentsVelocity, i32 noundef %110)
  %111 = load ptr, ptr %10, align 8, !tbaa !5
  %112 = load i32, ptr %19, align 4, !tbaa !11
  call void @InsertAgentsCoordinates(ptr noundef %111, ptr noundef @PlaceAgentsInsideARing.RandomPlaceVector, i32 noundef %112)
  store i8 0, ptr @PlaceAgentsInsideARing.isArrangementCorrect, align 1, !tbaa !15
  br label %113

113:                                              ; preds = %108
  %114 = load i32, ptr %19, align 4, !tbaa !11
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %19, align 4, !tbaa !11
  br label %41, !llvm.loop !23

116:                                              ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  ret void
}

; Function Attrs: nounwind
declare double @cos(double noundef) #4

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

; Function Attrs: nounwind
declare double @sin(double noundef) #4

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 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}
!23 = distinct !{!23, !18}


; 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
@PlaceAgentsInsideARing.MaxStep = external hidden local_unnamed_addr global i32, align 4
@PlaceAgentsInsideARing.RandomPlaceVector = external hidden global [3 x double], align 16
@PlaceAgentsInsideARing.ActualAgentsVelocity = external hidden global [3 x double], align 16
@PlaceAgentsInsideARing.AgentjsCoords = external hidden global [3 x double], align 16
@PlaceAgentsInsideARing.DiffCoords = external hidden global [3 x double], align 16
@PlaceAgentsInsideARing.temp = external hidden local_unnamed_addr global double, align 8
@PlaceAgentsInsideARing.isArrangementCorrect = external hidden local_unnamed_addr global i8, align 1

; 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: nounwind uwtable
define dso_local void @PlaceAgentsInsideARing(ptr noundef %0, double noundef %1, i32 noundef %2, i32 noundef %3, double noundef %4, double noundef %5, double noundef %6, double noundef %7, double noundef %8) local_unnamed_addr #0 {
  %10 = getelementptr inbounds i8, ptr %0, i64 36
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %12 = mul nsw i32 %11, 100
  store i32 %12, ptr @PlaceAgentsInsideARing.MaxStep, align 4, !tbaa !11
  store i8 0, ptr @PlaceAgentsInsideARing.isArrangementCorrect, align 1, !tbaa !12
  %13 = icmp slt i32 %2, %3
  br i1 %13, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %9
  tail call void @NullVect(ptr noundef nonnull @PlaceAgentsInsideARing.ActualAgentsVelocity, i32 noundef 3) #6
  br label %._crit_edge48

.lr.ph:                                           ; preds = %9, %.lr.ph
  %.03641 = phi i32 [ %14, %.lr.ph ], [ %2, %9 ]
  tail call void @FillVect(ptr noundef nonnull @PlaceAgentsInsideARing.RandomPlaceVector, double noundef 2.000000e+22, double noundef 2.000000e+22, double noundef 2.000000e+22) #6
  tail call void @InsertAgentsCoordinates(ptr noundef %0, ptr noundef nonnull @PlaceAgentsInsideARing.RandomPlaceVector, i32 noundef %.03641)
  tail call void @NullVect(ptr noundef nonnull @PlaceAgentsInsideARing.RandomPlaceVector, i32 noundef 3) #6
  tail call void @InsertAgentsVelocity(ptr noundef %0, ptr noundef nonnull @PlaceAgentsInsideARing.RandomPlaceVector, i32 noundef %.03641)
  %14 = add i32 %.03641, 1
  %exitcond.not = icmp eq i32 %14, %3
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !14

._crit_edge:                                      ; preds = %.lr.ph
  tail call void @NullVect(ptr noundef nonnull @PlaceAgentsInsideARing.ActualAgentsVelocity, i32 noundef 3) #6
  br i1 %13, label %.preheader.lr.ph, label %._crit_edge48

.preheader.lr.ph:                                 ; preds = %._crit_edge
  %15 = fmul double %7, 5.000000e-01
  %16 = fsub double %6, %15
  %17 = fadd double %15, %6
  %18 = add nsw i32 %3, -1
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %49
  %.047 = phi i32 [ 0, %.preheader.lr.ph ], [ %.1, %49 ]
  %.13746 = phi i32 [ %2, %.preheader.lr.ph ], [ %50, %49 ]
  br label %19

19:                                               ; preds = %.preheader, %._crit_edge45
  %.1 = phi i32 [ %44, %._crit_edge45 ], [ %.047, %.preheader ]
  %20 = load i8, ptr @PlaceAgentsInsideARing.isArrangementCorrect, align 1, !tbaa !12, !range !16, !noundef !17
  %21 = icmp eq i8 %20, 0
  br i1 %21, label %22, label %49

22:                                               ; preds = %19
  store i8 1, ptr @PlaceAgentsInsideARing.isArrangementCorrect, align 1, !tbaa !12
  %23 = tail call double @randomizeDouble(double noundef 0.000000e+00, double noundef 0x401921FB54442D18) #6
  store double %23, ptr @PlaceAgentsInsideARing.RandomPlaceVector, align 16, !tbaa !18
  %24 = tail call double @randomizeDouble(double noundef 0.000000e+00, double noundef %1) #6
  store double %24, ptr @PlaceAgentsInsideARing.temp, align 8, !tbaa !18
  %25 = load double, ptr @PlaceAgentsInsideARing.RandomPlaceVector, align 16, !tbaa !18
  %26 = tail call double @cos(double noundef %25) #6
  %27 = tail call double @llvm.fmuladd.f64(double %24, double %26, double %5)
  store double %27, ptr getelementptr inbounds (i8, ptr @PlaceAgentsInsideARing.RandomPlaceVector, i64 8), align 8, !tbaa !18
  %28 = load double, ptr @PlaceAgentsInsideARing.temp, align 8, !tbaa !18
  %29 = load double, ptr @PlaceAgentsInsideARing.RandomPlaceVector, align 16, !tbaa !18
  %30 = tail call double @sin(double noundef %29) #6
  %31 = tail call double @llvm.fmuladd.f64(double %28, double %30, double %4)
  store double %31, ptr @PlaceAgentsInsideARing.RandomPlaceVector, align 16, !tbaa !18
  %32 = tail call double @randomizeDouble(double noundef %16, double noundef %17) #6
  store double %32, ptr getelementptr inbounds (i8, ptr @PlaceAgentsInsideARing.RandomPlaceVector, i64 16), align 16, !tbaa !18
  %33 = load i32, ptr %10, align 4, !tbaa !5
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %.lr.ph44, label %._crit_edge45

.lr.ph44:                                         ; preds = %22, %40
  %.03442 = phi i32 [ %41, %40 ], [ 0, %22 ]
  %35 = icmp eq i32 %.13746, %.03442
  br i1 %35, label %40, label %36

36:                                               ; preds = %.lr.ph44
  tail call void @GetAgentsCoordinates(ptr noundef nonnull @PlaceAgentsInsideARing.AgentjsCoords, ptr noundef nonnull %0, i32 noundef %.03442)
  tail call void @VectDifference(ptr noundef nonnull @PlaceAgentsInsideARing.DiffCoords, ptr noundef nonnull @PlaceAgentsInsideARing.AgentjsCoords, ptr noundef nonnull @PlaceAgentsInsideARing.RandomPlaceVector) #6
  %37 = tail call double @VectAbs(ptr noundef nonnull @PlaceAgentsInsideARing.DiffCoords) #6
  %38 = fcmp ugt double %37, %8
  br i1 %38, label %40, label %39

39:                                               ; preds = %36
  store i8 0, ptr @PlaceAgentsInsideARing.isArrangementCorrect, align 1, !tbaa !12
  br label %40

40:                                               ; preds = %.lr.ph44, %36, %39
  %.135 = phi i32 [ %.03442, %39 ], [ %.03442, %36 ], [ %18, %.lr.ph44 ]
  %41 = add nsw i32 %.135, 1
  %42 = load i32, ptr %10, align 4, !tbaa !5
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %.lr.ph44, label %._crit_edge45, !llvm.loop !20

._crit_edge45:                                    ; preds = %40, %22
  %44 = add nsw i32 %.1, 1
  %45 = load i32, ptr @PlaceAgentsInsideARing.MaxStep, align 4, !tbaa !11
  %.not = icmp slt i32 %.1, %45
  br i1 %.not, label %19, label %46, !llvm.loop !21

46:                                               ; preds = %._crit_edge45
  %47 = load ptr, ptr @stderr, align 8, !tbaa !22
  %48 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef nonnull @.str.1) #7
  tail call void @exit(i32 noundef -1) #8
  unreachable

49:                                               ; preds = %19
  tail call void @InsertAgentsVelocity(ptr noundef %0, ptr noundef nonnull @PlaceAgentsInsideARing.ActualAgentsVelocity, i32 noundef %.13746)
  tail call void @InsertAgentsCoordinates(ptr noundef %0, ptr noundef nonnull @PlaceAgentsInsideARing.RandomPlaceVector, i32 noundef %.13746)
  store i8 0, ptr @PlaceAgentsInsideARing.isArrangementCorrect, align 1, !tbaa !12
  %50 = add i32 %.13746, 1
  %exitcond50.not = icmp eq i32 %50, %3
  br i1 %exitcond50.not, label %._crit_edge48, label %.preheader, !llvm.loop !23

._crit_edge48:                                    ; preds = %49, %._crit_edge.thread, %._crit_edge
  ret void
}

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

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

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

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


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