; LLVM IR from HRI-EU/Rcs :: src/RcsCore/ViaPointSequence.ll (ZN3Rcs16ViaPointSequence4testEv)

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

%"class.Rcs::ViaPointSequence" = type { ptr, ptr, ptr, ptr, ptr, ptr, i8, i32, %"class.std::vector", %"class.std::vector.0" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@stderr = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [77 x i8], align 1
@RcsLogLevel = external global i32, align 4
@.str.81 = external hidden unnamed_addr constant [36 x i8], align 1
@__func__._ZN3Rcs16ViaPointSequence4testEv = external hidden unnamed_addr constant [5 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

declare double @MatNd_get(ptr noundef, i32 noundef, i32 noundef) #1

declare void @MatNd_set(ptr noundef, i32 noundef, i32 noundef, double noundef) #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3Rcs16ViaPointSequence5checkEv(ptr noundef nonnull align 8 dereferenceable(104)) #3 align 2

declare ptr @MatNd_create(i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3Rcs16ViaPointSequence7gnuplotEdi(ptr noundef nonnull align 8 dereferenceable(104), double noundef, i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3Rcs16ViaPointSequence5printEv(ptr noundef nonnull align 8 dereferenceable(104)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3Rcs16ViaPointSequence4testEv() #3 align 2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca %"class.Rcs::ViaPointSequence", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  %11 = call i32 @Math_getRandomInteger(i32 noundef 2, i32 noundef 10)
  store i32 %11, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = call ptr @MatNd_create(i32 noundef %12, i32 noundef 5)
  store ptr %13, ptr %2, align 8, !tbaa !9
  %14 = load ptr, ptr %2, align 8, !tbaa !9
  %15 = call double @Math_getRandomNumber(double noundef -1.000000e+01, double noundef 1.000000e+01)
  call void @MatNd_set(ptr noundef %14, i32 noundef 0, i32 noundef 0, double noundef %15)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %61, %0
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %64

21:                                               ; preds = %16
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %24, label %35

24:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %25 = load ptr, ptr %2, align 8, !tbaa !9
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = sub nsw i32 %26, 1
  %28 = call double @MatNd_get(ptr noundef %25, i32 noundef %27, i32 noundef 0)
  store double %28, ptr %4, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %29 = load double, ptr %4, align 8, !tbaa !11
  %30 = call double @Math_getRandomNumber(double noundef 2.000000e-01, double noundef 2.000000e+00)
  %31 = fadd double %29, %30
  store double %31, ptr %5, align 8, !tbaa !11
  %32 = load ptr, ptr %2, align 8, !tbaa !9
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = load double, ptr %5, align 8, !tbaa !11
  call void @MatNd_set(ptr noundef %32, i32 noundef %33, i32 noundef 0, double noundef %34)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  br label %35

35:                                               ; preds = %24, %21
  %36 = load ptr, ptr %2, align 8, !tbaa !9
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = call double @Math_getRandomNumber(double noundef -5.000000e+00, double noundef 5.000000e+00)
  call void @MatNd_set(ptr noundef %36, i32 noundef %37, i32 noundef 1, double noundef %38)
  %39 = load ptr, ptr %2, align 8, !tbaa !9
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = call double @Math_getRandomNumber(double noundef -5.000000e+00, double noundef 5.000000e+00)
  call void @MatNd_set(ptr noundef %39, i32 noundef %40, i32 noundef 2, double noundef %41)
  %42 = load ptr, ptr %2, align 8, !tbaa !9
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = call double @Math_getRandomNumber(double noundef -5.000000e+00, double noundef 5.000000e+00)
  call void @MatNd_set(ptr noundef %42, i32 noundef %43, i32 noundef 3, double noundef %44)
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %52, label %47

47:                                               ; preds = %35
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = load i32, ptr %1, align 4, !tbaa !5
  %50 = sub nsw i32 %49, 1
  %51 = icmp eq i32 %48, %50
  br i1 %51, label %52, label %55

52:                                               ; preds = %47, %35
  %53 = load ptr, ptr %2, align 8, !tbaa !9
  %54 = load i32, ptr %3, align 4, !tbaa !5
  call void @MatNd_set(ptr noundef %53, i32 noundef %54, i32 noundef 4, double noundef 7.000000e+00)
  br label %60

55:                                               ; preds = %47
  %56 = load ptr, ptr %2, align 8, !tbaa !9
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = call i32 @Math_getRandomInteger(i32 noundef 1, i32 noundef 7)
  %59 = sitofp i32 %58 to double
  call void @MatNd_set(ptr noundef %56, i32 noundef %57, i32 noundef 4, double noundef %59)
  br label %60

60:                                               ; preds = %55, %52
  br label %61

61:                                               ; preds = %60
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %3, align 4, !tbaa !5
  br label %16, !llvm.loop !13

64:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 104, ptr %6) #5
  %65 = load ptr, ptr %2, align 8, !tbaa !9
  call void @_ZN3Rcs16ViaPointSequenceC1EPK6_MatNdNS0_12ViaPointTypeE(ptr noundef nonnull align 8 dereferenceable(104) %6, ptr noundef %65, i32 noundef 0)
  %66 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %67 = icmp sle i32 1, %66
  br i1 %67, label %68, label %74

68:                                               ; preds = %64
  invoke void @_ZNK3Rcs16ViaPointSequence7gnuplotEdi(ptr noundef nonnull align 8 dereferenceable(104) %6, double noundef 1.000000e-02, i32 noundef 7)
          to label %69 unwind label %70

69:                                               ; preds = %68
  br label %74

70:                                               ; preds = %68
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %7, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %8, align 4
  br label %108

74:                                               ; preds = %69, %64
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  %75 = invoke noundef zeroext i1 @_ZNK3Rcs16ViaPointSequence5checkEv(ptr noundef nonnull align 8 dereferenceable(104) %6)
          to label %76 unwind label %96

76:                                               ; preds = %74
  %77 = zext i1 %75 to i8
  store i8 %77, ptr %9, align 1, !tbaa !15
  %78 = load i8, ptr %9, align 1, !tbaa !15, !range !17, !noundef !18
  %79 = trunc i8 %78 to i1
  %80 = zext i1 %79 to i32
  %81 = icmp eq i32 %80, 0
  br i1 %81, label %82, label %104

82:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %83 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  store i32 %83, ptr %10, align 4, !tbaa !5
  store i32 5, ptr @RcsLogLevel, align 4, !tbaa !5
  %84 = invoke noundef zeroext i1 @_ZNK3Rcs16ViaPointSequence5checkEv(ptr noundef nonnull align 8 dereferenceable(104) %6)
          to label %85 unwind label %100

85:                                               ; preds = %82
  invoke void @_ZNK3Rcs16ViaPointSequence7gnuplotEdi(ptr noundef nonnull align 8 dereferenceable(104) %6, double noundef 1.000000e-02, i32 noundef 7)
          to label %86 unwind label %100

86:                                               ; preds = %85
  invoke void @_ZNK3Rcs16ViaPointSequence5printEv(ptr noundef nonnull align 8 dereferenceable(104) %6)
          to label %87 unwind label %100

87:                                               ; preds = %86
  %88 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %88, ptr @RcsLogLevel, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %87
  %90 = load ptr, ptr @stderr, align 8, !tbaa !9
  %91 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %90, ptr noundef @.str.81, ptr noundef @.str.2, ptr noundef @__func__._ZN3Rcs16ViaPointSequence4testEv, i32 noundef 1910) #5
  %92 = invoke i32 @getchar()
          to label %93 unwind label %100

93:                                               ; preds = %89
  br label %94

94:                                               ; preds = %93
  br label %95

95:                                               ; preds = %94
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %104

96:                                               ; preds = %74
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %7, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %8, align 4
  br label %107

100:                                              ; preds = %89, %86, %85, %82
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %7, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %107

104:                                              ; preds = %95, %76
  %105 = load i8, ptr %9, align 1, !tbaa !15, !range !17, !noundef !18
  %106 = trunc i8 %105 to i1
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  call void @_ZN3Rcs16ViaPointSequenceD1Ev(ptr noundef nonnull align 8 dereferenceable(104) %6) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  ret i1 %106

107:                                              ; preds = %100, %96
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  br label %108

108:                                              ; preds = %107, %70
  call void @_ZN3Rcs16ViaPointSequenceD1Ev(ptr noundef nonnull align 8 dereferenceable(104) %6) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  br label %109

109:                                              ; preds = %108
  %110 = load ptr, ptr %7, align 8
  %111 = load i32, ptr %8, align 4
  %112 = insertvalue { ptr, i32 } poison, ptr %110, 0
  %113 = insertvalue { ptr, i32 } %112, i32 %111, 1
  resume { ptr, i32 } %113
}

declare i32 @Math_getRandomInteger(i32 noundef, i32 noundef) #1

declare double @Math_getRandomNumber(double noundef, double noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare i32 @getchar() #4

declare void @_ZN3Rcs16ViaPointSequenceC1EPK6_MatNdNS0_12ViaPointTypeE(ptr, ptr, i32)

declare void @_ZN3Rcs16ViaPointSequenceD1Ev(ptr)

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind "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 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 #4 = { inlinehint mustprogress 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{i8 0, i8 2}
!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"

%"class.Rcs::ViaPointSequence" = type { ptr, ptr, ptr, ptr, ptr, ptr, i8, i32, %"class.std::vector", %"class.std::vector.0" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@stderr = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [77 x i8], align 1
@RcsLogLevel = external local_unnamed_addr global i32, align 4
@.str.81 = external hidden unnamed_addr constant [36 x i8], align 1
@__func__._ZN3Rcs16ViaPointSequence4testEv = external hidden unnamed_addr constant [5 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

declare double @MatNd_get(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @MatNd_set(ptr noundef, i32 noundef, i32 noundef, double noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3Rcs16ViaPointSequence5checkEv(ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #3 align 2

declare ptr @MatNd_create(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3Rcs16ViaPointSequence7gnuplotEdi(ptr noundef nonnull align 8 dereferenceable(104), double noundef, i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3Rcs16ViaPointSequence5printEv(ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3Rcs16ViaPointSequence4testEv() local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.Rcs::ViaPointSequence", align 8
  %2 = tail call i32 @Math_getRandomInteger(i32 noundef 2, i32 noundef 10)
  %3 = tail call ptr @MatNd_create(i32 noundef %2, i32 noundef 5)
  %4 = tail call double @Math_getRandomNumber(double noundef -1.000000e+01, double noundef 1.000000e+01)
  tail call void @MatNd_set(ptr noundef %3, i32 noundef 0, i32 noundef 0, double noundef %4)
  %5 = icmp sgt i32 %2, 0
  br i1 %5, label %6, label %._crit_edge

6:                                                ; preds = %0
  %7 = add nsw i32 %2, -1
  %8 = tail call double @Math_getRandomNumber(double noundef -5.000000e+00, double noundef 5.000000e+00)
  tail call void @MatNd_set(ptr noundef %3, i32 noundef 0, i32 noundef 1, double noundef %8)
  %9 = tail call double @Math_getRandomNumber(double noundef -5.000000e+00, double noundef 5.000000e+00)
  tail call void @MatNd_set(ptr noundef %3, i32 noundef 0, i32 noundef 2, double noundef %9)
  %10 = tail call double @Math_getRandomNumber(double noundef -5.000000e+00, double noundef 5.000000e+00)
  tail call void @MatNd_set(ptr noundef %3, i32 noundef 0, i32 noundef 3, double noundef %10)
  tail call void @MatNd_set(ptr noundef %3, i32 noundef 0, i32 noundef 4, double noundef 7.000000e+00)
  %exitcond.peel.not = icmp eq i32 %2, 1
  br i1 %exitcond.peel.not, label %._crit_edge, label %.peel.next

._crit_edge:                                      ; preds = %25, %6, %0
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %1) #5
  call void @_ZN3Rcs16ViaPointSequenceC1EPK6_MatNdNS0_12ViaPointTypeE(ptr noundef nonnull align 8 dereferenceable(104) %1, ptr noundef %3, i32 noundef 0)
  %11 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %27, label %30

.peel.next:                                       ; preds = %6, %25
  %.037 = phi i32 [ %26, %25 ], [ 1, %6 ]
  %13 = add nsw i32 %.037, -1
  %14 = tail call double @MatNd_get(ptr noundef %3, i32 noundef %13, i32 noundef 0)
  %15 = tail call double @Math_getRandomNumber(double noundef 2.000000e-01, double noundef 2.000000e+00)
  %16 = fadd double %14, %15
  tail call void @MatNd_set(ptr noundef %3, i32 noundef %.037, i32 noundef 0, double noundef %16)
  %17 = tail call double @Math_getRandomNumber(double noundef -5.000000e+00, double noundef 5.000000e+00)
  tail call void @MatNd_set(ptr noundef %3, i32 noundef %.037, i32 noundef 1, double noundef %17)
  %18 = tail call double @Math_getRandomNumber(double noundef -5.000000e+00, double noundef 5.000000e+00)
  tail call void @MatNd_set(ptr noundef %3, i32 noundef %.037, i32 noundef 2, double noundef %18)
  %19 = tail call double @Math_getRandomNumber(double noundef -5.000000e+00, double noundef 5.000000e+00)
  tail call void @MatNd_set(ptr noundef %3, i32 noundef %.037, i32 noundef 3, double noundef %19)
  %20 = icmp eq i32 %.037, %7
  br i1 %20, label %21, label %22

21:                                               ; preds = %.peel.next
  tail call void @MatNd_set(ptr noundef %3, i32 noundef %7, i32 noundef 4, double noundef 7.000000e+00)
  br label %25

22:                                               ; preds = %.peel.next
  %23 = tail call i32 @Math_getRandomInteger(i32 noundef 1, i32 noundef 7)
  %24 = sitofp i32 %23 to double
  tail call void @MatNd_set(ptr noundef %3, i32 noundef %.037, i32 noundef 4, double noundef %24)
  br label %25

25:                                               ; preds = %21, %22
  %26 = add nuw nsw i32 %.037, 1
  %exitcond.not = icmp eq i32 %26, %2
  br i1 %exitcond.not, label %._crit_edge, label %.peel.next, !llvm.loop !9

27:                                               ; preds = %._crit_edge
  invoke void @_ZNK3Rcs16ViaPointSequence7gnuplotEdi(ptr noundef nonnull align 8 dereferenceable(104) %1, double noundef 1.000000e-02, i32 noundef 7)
          to label %30 unwind label %28

28:                                               ; preds = %27
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %47

30:                                               ; preds = %27, %._crit_edge
  %31 = invoke noundef zeroext i1 @_ZNK3Rcs16ViaPointSequence5checkEv(ptr noundef nonnull align 8 dereferenceable(104) %1)
          to label %32 unwind label %42

32:                                               ; preds = %30
  br i1 %31, label %46, label %33

33:                                               ; preds = %32
  %34 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  store i32 5, ptr @RcsLogLevel, align 4, !tbaa !5
  %35 = invoke noundef zeroext i1 @_ZNK3Rcs16ViaPointSequence5checkEv(ptr noundef nonnull align 8 dereferenceable(104) %1)
          to label %36 unwind label %44

36:                                               ; preds = %33
  invoke void @_ZNK3Rcs16ViaPointSequence7gnuplotEdi(ptr noundef nonnull align 8 dereferenceable(104) %1, double noundef 1.000000e-02, i32 noundef 7)
          to label %37 unwind label %44

37:                                               ; preds = %36
  invoke void @_ZNK3Rcs16ViaPointSequence5printEv(ptr noundef nonnull align 8 dereferenceable(104) %1)
          to label %38 unwind label %44

38:                                               ; preds = %37
  store i32 %34, ptr @RcsLogLevel, align 4, !tbaa !5
  %39 = load ptr, ptr @stderr, align 8, !tbaa !12
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef nonnull @.str.81, ptr noundef nonnull @.str.2, ptr noundef nonnull @__func__._ZN3Rcs16ViaPointSequence4testEv, i32 noundef 1910) #6
  %41 = call i32 @getchar()
  br label %46

42:                                               ; preds = %30
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %47

44:                                               ; preds = %37, %36, %33
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %47

46:                                               ; preds = %38, %32
  call void @_ZN3Rcs16ViaPointSequenceD1Ev(ptr noundef nonnull align 8 dereferenceable(104) %1) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %1) #5
  ret i1 %31

47:                                               ; preds = %42, %44, %28
  %.pn.pn = phi { ptr, i32 } [ %29, %28 ], [ %45, %44 ], [ %43, %42 ]
  call void @_ZN3Rcs16ViaPointSequenceD1Ev(ptr noundef nonnull align 8 dereferenceable(104) %1) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn.pn
}

declare i32 @Math_getRandomInteger(i32 noundef, i32 noundef) local_unnamed_addr #1

declare double @Math_getRandomNumber(double noundef, double noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nofree nounwind uwtable
declare noundef i32 @getchar() local_unnamed_addr #4

declare void @_ZN3Rcs16ViaPointSequenceC1EPK6_MatNdNS0_12ViaPointTypeE(ptr, ptr, i32) local_unnamed_addr

declare void @_ZN3Rcs16ViaPointSequenceD1Ev(ptr) local_unnamed_addr

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #3 = { mustprogress 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 #4 = { inlinehint mustprogress nofree 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 #5 = { nounwind }
attributes #6 = { cold 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++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass