; LLVM IR from HRI-EU/Rcs :: src/RcsCore (Rcs_mathTests)

; 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::CmdLineParser" = type { i8 }
%"class.Rcs::ViaPointSequence" = type { ptr, ptr, ptr, ptr, ptr, ptr, i8, i32, %"class.std::vector", %"class.std::vector.3" }
%"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.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = 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 }
%struct._MatNd = type { ptr, i32, i32, i32, i8 }

@RCS_GLOBAL_RLOG_CB = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [74 x i8], align 1
@RcsLogLevel = external global i32, align 4
@stderr = external global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.279 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.391 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.392 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.393 = external hidden unnamed_addr constant [29 x i8], align 1
@__func__.testViaPointGradient = external hidden unnamed_addr constant [21 x i8], align 1
@.str.394 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.395 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.396 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.397 = external hidden unnamed_addr constant [10 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

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

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN3Rcs13CmdLineParserC1EiPPc(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef, ptr noundef) unnamed_addr #2

declare noundef zeroext i1 @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPdS2_z(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, ptr noundef, ptr noundef, ...) #2

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

declare noundef zeroext i1 @_ZNK3Rcs13CmdLineParser11hasArgumentEPKcS2_z(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, ptr noundef, ...) #2

declare void @MatNd_printTwoArraysDiff(ptr noundef, ptr noundef, i32 noundef) #2

declare noundef zeroext i1 @_ZNK3Rcs16ViaPointSequence5checkEv(ptr noundef nonnull align 8 dereferenceable(104)) #2

; Function Attrs: nounwind
declare void @_ZN3Rcs16ViaPointSequenceD1Ev(ptr noundef nonnull align 8 dereferenceable(104)) unnamed_addr #1

declare zeroext i1 @MatNd_gnuplot(ptr noundef, ptr noundef) #2

declare noundef double @_ZNK3Rcs16ViaPointSequence2t0Ev(ptr noundef nonnull align 8 dereferenceable(104)) #2

declare noundef double @_ZNK3Rcs16ViaPointSequence2t1Ev(ptr noundef nonnull align 8 dereferenceable(104)) #2

; Function Attrs: mustprogress uwtable
define dso_local zeroext i1 @testViaPointGradient(i32 noundef %0, ptr noundef %1) #3 personality ptr @__gxx_personality_v0 {
  %3 = alloca i1, align 1
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca double, align 8
  %8 = alloca %"class.Rcs::CmdLineParser", align 1
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca %"class.Rcs::ViaPointSequence", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #4
  store i8 1, ptr %6, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store double 1.000000e-02, ptr %7, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #4
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = load ptr, ptr %5, align 8, !tbaa !9
  call void @_ZN3Rcs13CmdLineParserC1EiPPc(ptr noundef nonnull align 1 dereferenceable(1) %8, i32 noundef %18, ptr noundef %19)
  %20 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPdS2_z(ptr noundef nonnull align 1 dereferenceable(1) %8, ptr noundef @.str.279, ptr noundef %7, ptr noundef @.str.391)
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #4
  %21 = call noundef zeroext i1 (ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11hasArgumentEPKcS2_z(ptr noundef nonnull align 1 dereferenceable(1) %8, ptr noundef @.str.392, ptr noundef @.str.393)
  %22 = zext i1 %21 to i8
  store i8 %22, ptr %9, align 1, !tbaa !11
  %23 = load double, ptr %7, align 8, !tbaa !13
  %24 = fcmp ole double %23, 0.000000e+00
  br i1 %24, label %25, label %46

25:                                               ; preds = %2
  br label %26

26:                                               ; preds = %25
  %27 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %28 = icmp ne ptr %27, null
  br i1 %28, label %29, label %32

29:                                               ; preds = %26
  %30 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %31 = load double, ptr %7, align 8, !tbaa !13
  call void (i32, ptr, ptr, i32, ptr, ...) %30(i32 noundef 1, ptr noundef @.str.3, ptr noundef @__func__.testViaPointGradient, i32 noundef 3917, ptr noundef @.str.394, double noundef %31)
  br label %32

32:                                               ; preds = %29, %26
  %33 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %34 = icmp sle i32 1, %33
  br i1 %34, label %35, label %43

35:                                               ; preds = %32
  %36 = load ptr, ptr @stderr, align 8, !tbaa !9
  %37 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef @.str.5, ptr noundef @.str.3, ptr noundef @__func__.testViaPointGradient, i32 noundef 3917) #4
  %38 = load ptr, ptr @stderr, align 8, !tbaa !9
  %39 = load double, ptr %7, align 8, !tbaa !13
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef @.str.394, double noundef %39) #4
  %41 = load ptr, ptr @stderr, align 8, !tbaa !9
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef @.str.6) #4
  br label %43

43:                                               ; preds = %35, %32
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44
  store i1 false, ptr %3, align 1
  store i32 1, ptr %10, align 4
  br label %161

46:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 104, ptr %11) #4
  call void @_ZN3Rcs16ViaPointSequenceC1EPKcNS0_12ViaPointTypeE(ptr noundef nonnull align 8 dereferenceable(104) %11, ptr noundef @.str.395, i32 noundef 0)
  %47 = invoke noundef zeroext i1 @_ZNK3Rcs16ViaPointSequence5checkEv(ptr noundef nonnull align 8 dereferenceable(104) %11)
          to label %48 unwind label %58

48:                                               ; preds = %46
  %49 = zext i1 %47 to i32
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %51, label %75

51:                                               ; preds = %48
  br label %52

52:                                               ; preds = %51
  %53 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %62

55:                                               ; preds = %52
  %56 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  invoke void (i32, ptr, ptr, i32, ptr, ...) %56(i32 noundef 1, ptr noundef @.str.3, ptr noundef @__func__.testViaPointGradient, i32 noundef 3925, ptr noundef @.str.396)
          to label %57 unwind label %58

57:                                               ; preds = %55
  br label %62

58:                                               ; preds = %55, %46
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %12, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %13, align 4
  br label %160

62:                                               ; preds = %57, %52
  %63 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %64 = icmp sle i32 1, %63
  br i1 %64, label %65, label %72

65:                                               ; preds = %62
  %66 = load ptr, ptr @stderr, align 8, !tbaa !9
  %67 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef @.str.5, ptr noundef @.str.3, ptr noundef @__func__.testViaPointGradient, i32 noundef 3925) #4
  %68 = load ptr, ptr @stderr, align 8, !tbaa !9
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef @.str.396) #4
  %70 = load ptr, ptr @stderr, align 8, !tbaa !9
  %71 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef @.str.6) #4
  br label %72

72:                                               ; preds = %65, %62
  br label %73

73:                                               ; preds = %72
  br label %74

74:                                               ; preds = %73
  store i1 false, ptr %3, align 1
  store i32 1, ptr %10, align 4
  br label %159

75:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %76 = invoke noundef double @_ZNK3Rcs16ViaPointSequence2t1Ev(ptr noundef nonnull align 8 dereferenceable(104) %11)
          to label %77 unwind label %136

77:                                               ; preds = %75
  %78 = invoke noundef double @_ZNK3Rcs16ViaPointSequence2t0Ev(ptr noundef nonnull align 8 dereferenceable(104) %11)
          to label %79 unwind label %136

79:                                               ; preds = %77
  %80 = fsub double %76, %78
  %81 = load double, ptr %7, align 8, !tbaa !13
  %82 = fdiv double %80, %81
  store double %82, ptr %14, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %83 = load double, ptr %14, align 8, !tbaa !13
  %84 = fptoui double %83 to i32
  %85 = add i32 %84, 1
  %86 = invoke ptr @MatNd_create(i32 noundef 1, i32 noundef %85)
          to label %87 unwind label %140

87:                                               ; preds = %79
  store ptr %86, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %88 = load double, ptr %14, align 8, !tbaa !13
  %89 = fptoui double %88 to i32
  %90 = add i32 %89, 1
  %91 = invoke ptr @MatNd_create(i32 noundef 1, i32 noundef %90)
          to label %92 unwind label %144

92:                                               ; preds = %87
  store ptr %91, ptr %16, align 8, !tbaa !9
  %93 = load ptr, ptr %15, align 8, !tbaa !9
  %94 = invoke noundef double @_ZNK3Rcs16ViaPointSequence2t0Ev(ptr noundef nonnull align 8 dereferenceable(104) %11)
          to label %95 unwind label %144

95:                                               ; preds = %92
  %96 = invoke noundef double @_ZNK3Rcs16ViaPointSequence2t1Ev(ptr noundef nonnull align 8 dereferenceable(104) %11)
          to label %97 unwind label %144

97:                                               ; preds = %95
  %98 = load double, ptr %7, align 8, !tbaa !13
  %99 = invoke noundef zeroext i1 @_ZNK3Rcs16ViaPointSequence14gradientDxDviaEP6_MatNdjddd(ptr noundef nonnull align 8 dereferenceable(104) %11, ptr noundef %93, i32 noundef 2, double noundef %94, double noundef %96, double noundef %98)
          to label %100 unwind label %144

100:                                              ; preds = %97
  %101 = load ptr, ptr %16, align 8, !tbaa !9
  %102 = invoke noundef double @_ZNK3Rcs16ViaPointSequence2t0Ev(ptr noundef nonnull align 8 dereferenceable(104) %11)
          to label %103 unwind label %144

103:                                              ; preds = %100
  %104 = invoke noundef double @_ZNK3Rcs16ViaPointSequence2t1Ev(ptr noundef nonnull align 8 dereferenceable(104) %11)
          to label %105 unwind label %144

105:                                              ; preds = %103
  %106 = load double, ptr %7, align 8, !tbaa !13
  %107 = invoke noundef zeroext i1 @_ZNK3Rcs16ViaPointSequence16gradientDxDvia_aEP6_MatNdjddd(ptr noundef nonnull align 8 dereferenceable(104) %11, ptr noundef %101, i32 noundef 2, double noundef %102, double noundef %104, double noundef %106)
          to label %108 unwind label %144

108:                                              ; preds = %105
  %109 = load ptr, ptr %15, align 8, !tbaa !9
  %110 = load ptr, ptr %16, align 8, !tbaa !9
  invoke void @MatNd_printTwoArraysDiff(ptr noundef %109, ptr noundef %110, i32 noundef 8)
          to label %111 unwind label %144

111:                                              ; preds = %108
  %112 = load i8, ptr %9, align 1, !tbaa !11, !range !15, !noundef !16
  %113 = trunc i8 %112 to i1
  %114 = zext i1 %113 to i32
  %115 = icmp eq i32 %114, 1
  br i1 %115, label %116, label %153

116:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %117 = load ptr, ptr %15, align 8, !tbaa !9
  %118 = getelementptr inbounds %struct._MatNd, ptr %117, i32 0, i32 1
  %119 = load i32, ptr %118, align 8, !tbaa !17
  %120 = invoke ptr @MatNd_create(i32 noundef %119, i32 noundef 2)
          to label %121 unwind label %148

121:                                              ; preds = %116
  store ptr %120, ptr %17, align 8, !tbaa !9
  %122 = load ptr, ptr %17, align 8, !tbaa !9
  %123 = load ptr, ptr %15, align 8, !tbaa !9
  invoke void @MatNd_copyColumn(ptr noundef %122, i32 noundef 0, ptr noundef %123, i32 noundef 0)
          to label %124 unwind label %148

124:                                              ; preds = %121
  %125 = load ptr, ptr %17, align 8, !tbaa !9
  %126 = load ptr, ptr %16, align 8, !tbaa !9
  invoke void @MatNd_copyColumn(ptr noundef %125, i32 noundef 1, ptr noundef %126, i32 noundef 0)
          to label %127 unwind label %148

127:                                              ; preds = %124
  %128 = load ptr, ptr %17, align 8, !tbaa !9
  %129 = invoke zeroext i1 @MatNd_gnuplot(ptr noundef @.str.397, ptr noundef %128)
          to label %130 unwind label %148

130:                                              ; preds = %127
  %131 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %132 = icmp sle i32 2, %131
  br i1 %132, label %133, label %152

133:                                              ; preds = %130
  %134 = load double, ptr %7, align 8, !tbaa !13
  invoke void @_ZNK3Rcs16ViaPointSequence7gnuplotEdi(ptr noundef nonnull align 8 dereferenceable(104) %11, double noundef %134, i32 noundef 1)
          to label %135 unwind label %148

135:                                              ; preds = %133
  br label %152

136:                                              ; preds = %77, %75
  %137 = landingpad { ptr, i32 }
          cleanup
  %138 = extractvalue { ptr, i32 } %137, 0
  store ptr %138, ptr %12, align 8
  %139 = extractvalue { ptr, i32 } %137, 1
  store i32 %139, ptr %13, align 4
  br label %158

140:                                              ; preds = %79
  %141 = landingpad { ptr, i32 }
          cleanup
  %142 = extractvalue { ptr, i32 } %141, 0
  store ptr %142, ptr %12, align 8
  %143 = extractvalue { ptr, i32 } %141, 1
  store i32 %143, ptr %13, align 4
  br label %157

144:                                              ; preds = %108, %105, %103, %100, %97, %95, %92, %87
  %145 = landingpad { ptr, i32 }
          cleanup
  %146 = extractvalue { ptr, i32 } %145, 0
  store ptr %146, ptr %12, align 8
  %147 = extractvalue { ptr, i32 } %145, 1
  store i32 %147, ptr %13, align 4
  br label %156

148:                                              ; preds = %133, %127, %124, %121, %116
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %12, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  br label %156

152:                                              ; preds = %135, %130
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  br label %153

153:                                              ; preds = %152, %111
  %154 = load i8, ptr %6, align 1, !tbaa !11, !range !15, !noundef !16
  %155 = trunc i8 %154 to i1
  store i1 %155, ptr %3, align 1
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %159

156:                                              ; preds = %148, %144
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %157

157:                                              ; preds = %156, %140
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %158

158:                                              ; preds = %157, %136
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %160

159:                                              ; preds = %153, %74
  call void @_ZN3Rcs16ViaPointSequenceD1Ev(ptr noundef nonnull align 8 dereferenceable(104) %11) #4
  call void @llvm.lifetime.end.p0(i64 104, ptr %11) #4
  br label %161

160:                                              ; preds = %158, %58
  call void @_ZN3Rcs16ViaPointSequenceD1Ev(ptr noundef nonnull align 8 dereferenceable(104) %11) #4
  call void @llvm.lifetime.end.p0(i64 104, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #4
  br label %163

161:                                              ; preds = %159, %45
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #4
  %162 = load i1, ptr %3, align 1
  ret i1 %162

163:                                              ; preds = %160
  %164 = load ptr, ptr %12, align 8
  %165 = load i32, ptr %13, align 4
  %166 = insertvalue { ptr, i32 } poison, ptr %164, 0
  %167 = insertvalue { ptr, i32 } %166, i32 %165, 1
  resume { ptr, i32 } %167
}

declare void @_ZN3Rcs16ViaPointSequenceC1EPKcNS0_12ViaPointTypeE(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef, i32 noundef) unnamed_addr #2

declare noundef zeroext i1 @_ZNK3Rcs16ViaPointSequence14gradientDxDviaEP6_MatNdjddd(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef, i32 noundef, double noundef, double noundef, double noundef) #2

declare noundef zeroext i1 @_ZNK3Rcs16ViaPointSequence16gradientDxDvia_aEP6_MatNdjddd(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef, i32 noundef, double noundef, double noundef, double noundef) #2

declare void @MatNd_copyColumn(ptr noundef, i32 noundef, ptr noundef, i32 noundef) #2

declare void @_ZNK3Rcs16ViaPointSequence7gnuplotEdi(ptr noundef nonnull align 8 dereferenceable(104), double noundef, i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 = { 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 = !{!"bool", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!18, !6, i64 8}
!18 = !{!"_ZTS6_MatNd", !10, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !12, i64 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"

%"class.Rcs::CmdLineParser" = type { i8 }
%"class.Rcs::ViaPointSequence" = type { ptr, ptr, ptr, ptr, ptr, ptr, i8, i32, %"class.std::vector", %"class.std::vector.3" }
%"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.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = 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 }

@RCS_GLOBAL_RLOG_CB = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [74 x i8], align 1
@RcsLogLevel = external local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.279 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.391 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.392 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.393 = external hidden unnamed_addr constant [29 x i8], align 1
@__func__.testViaPointGradient = external hidden unnamed_addr constant [21 x i8], align 1
@.str.394 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.395 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.396 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.397 = external hidden unnamed_addr constant [10 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

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

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN3Rcs13CmdLineParserC1EiPPc(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef, ptr noundef) unnamed_addr #2

declare noundef zeroext i1 @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPdS2_z(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #2

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

declare noundef zeroext i1 @_ZNK3Rcs13CmdLineParser11hasArgumentEPKcS2_z(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, ptr noundef, ...) local_unnamed_addr #2

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

declare noundef zeroext i1 @_ZNK3Rcs16ViaPointSequence5checkEv(ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN3Rcs16ViaPointSequenceD1Ev(ptr noundef nonnull align 8 dereferenceable(104)) unnamed_addr #3

declare zeroext i1 @MatNd_gnuplot(ptr noundef, ptr noundef) local_unnamed_addr #2

declare noundef double @_ZNK3Rcs16ViaPointSequence2t0Ev(ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #2

declare noundef double @_ZNK3Rcs16ViaPointSequence2t1Ev(ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @testViaPointGradient(i32 noundef %0, ptr noundef %1) local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %3 = alloca double, align 8
  %4 = alloca %"class.Rcs::CmdLineParser", align 1
  %5 = alloca %"class.Rcs::ViaPointSequence", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  store double 1.000000e-02, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #5
  call void @_ZN3Rcs13CmdLineParserC1EiPPc(ptr noundef nonnull align 1 dereferenceable(1) %4, i32 noundef %0, ptr noundef %1)
  %6 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPdS2_z(ptr noundef nonnull align 1 dereferenceable(1) %4, ptr noundef nonnull @.str.279, ptr noundef nonnull %3, ptr noundef nonnull @.str.391)
  %7 = call noundef zeroext i1 (ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11hasArgumentEPKcS2_z(ptr noundef nonnull align 1 dereferenceable(1) %4, ptr noundef nonnull @.str.392, ptr noundef nonnull @.str.393)
  %8 = load double, ptr %3, align 8, !tbaa !5
  %9 = fcmp ugt double %8, 0.000000e+00
  br i1 %9, label %24, label %10

10:                                               ; preds = %2
  %11 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %.not32 = icmp eq ptr %11, null
  br i1 %.not32, label %13, label %12

12:                                               ; preds = %10
  call void (i32, ptr, ptr, i32, ptr, ...) %11(i32 noundef 1, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testViaPointGradient, i32 noundef 3917, ptr noundef nonnull @.str.394, double noundef %8)
  br label %13

13:                                               ; preds = %12, %10
  %14 = load i32, ptr @RcsLogLevel, align 4, !tbaa !11
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %16, label %94

16:                                               ; preds = %13
  %17 = load ptr, ptr @stderr, align 8, !tbaa !9
  %18 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testViaPointGradient, i32 noundef 3917) #6
  %19 = load ptr, ptr @stderr, align 8, !tbaa !9
  %20 = load double, ptr %3, align 8, !tbaa !5
  %21 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef nonnull @.str.394, double noundef %20) #6
  %22 = load ptr, ptr @stderr, align 8, !tbaa !9
  %23 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef nonnull @.str.6) #6
  br label %94

24:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %5) #5
  call void @_ZN3Rcs16ViaPointSequenceC1EPKcNS0_12ViaPointTypeE(ptr noundef nonnull align 8 dereferenceable(104) %5, ptr noundef nonnull @.str.395, i32 noundef 0)
  %25 = invoke noundef zeroext i1 @_ZNK3Rcs16ViaPointSequence5checkEv(ptr noundef nonnull align 8 dereferenceable(104) %5)
          to label %26 unwind label %30

26:                                               ; preds = %24
  br i1 %25, label %42, label %27

27:                                               ; preds = %26
  %28 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %.not = icmp eq ptr %28, null
  br i1 %.not, label %32, label %29

29:                                               ; preds = %27
  invoke void (i32, ptr, ptr, i32, ptr, ...) %28(i32 noundef 1, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testViaPointGradient, i32 noundef 3925, ptr noundef nonnull @.str.396)
          to label %32 unwind label %30

30:                                               ; preds = %29, %24
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %93

32:                                               ; preds = %29, %27
  %33 = load i32, ptr @RcsLogLevel, align 4, !tbaa !11
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %35, label %92

35:                                               ; preds = %32
  %36 = load ptr, ptr @stderr, align 8, !tbaa !9
  %37 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testViaPointGradient, i32 noundef 3925) #6
  %38 = load ptr, ptr @stderr, align 8, !tbaa !9
  %39 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef nonnull @.str.396) #6
  %40 = load ptr, ptr @stderr, align 8, !tbaa !9
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef nonnull @.str.6) #6
  br label %92

42:                                               ; preds = %26
  %43 = invoke noundef double @_ZNK3Rcs16ViaPointSequence2t1Ev(ptr noundef nonnull align 8 dereferenceable(104) %5)
          to label %44 unwind label %84

44:                                               ; preds = %42
  %45 = invoke noundef double @_ZNK3Rcs16ViaPointSequence2t0Ev(ptr noundef nonnull align 8 dereferenceable(104) %5)
          to label %46 unwind label %84

46:                                               ; preds = %44
  %47 = fsub double %43, %45
  %48 = load double, ptr %3, align 8, !tbaa !5
  %49 = fdiv double %47, %48
  %50 = fptoui double %49 to i32
  %51 = add i32 %50, 1
  %52 = invoke ptr @MatNd_create(i32 noundef 1, i32 noundef %51)
          to label %53 unwind label %86

53:                                               ; preds = %46
  %54 = invoke ptr @MatNd_create(i32 noundef 1, i32 noundef %51)
          to label %55 unwind label %88

55:                                               ; preds = %53
  %56 = invoke noundef double @_ZNK3Rcs16ViaPointSequence2t0Ev(ptr noundef nonnull align 8 dereferenceable(104) %5)
          to label %57 unwind label %88

57:                                               ; preds = %55
  %58 = invoke noundef double @_ZNK3Rcs16ViaPointSequence2t1Ev(ptr noundef nonnull align 8 dereferenceable(104) %5)
          to label %59 unwind label %88

59:                                               ; preds = %57
  %60 = load double, ptr %3, align 8, !tbaa !5
  %61 = invoke noundef zeroext i1 @_ZNK3Rcs16ViaPointSequence14gradientDxDviaEP6_MatNdjddd(ptr noundef nonnull align 8 dereferenceable(104) %5, ptr noundef %52, i32 noundef 2, double noundef %56, double noundef %58, double noundef %60)
          to label %62 unwind label %88

62:                                               ; preds = %59
  %63 = invoke noundef double @_ZNK3Rcs16ViaPointSequence2t0Ev(ptr noundef nonnull align 8 dereferenceable(104) %5)
          to label %64 unwind label %88

64:                                               ; preds = %62
  %65 = invoke noundef double @_ZNK3Rcs16ViaPointSequence2t1Ev(ptr noundef nonnull align 8 dereferenceable(104) %5)
          to label %66 unwind label %88

66:                                               ; preds = %64
  %67 = load double, ptr %3, align 8, !tbaa !5
  %68 = invoke noundef zeroext i1 @_ZNK3Rcs16ViaPointSequence16gradientDxDvia_aEP6_MatNdjddd(ptr noundef nonnull align 8 dereferenceable(104) %5, ptr noundef %54, i32 noundef 2, double noundef %63, double noundef %65, double noundef %67)
          to label %69 unwind label %88

69:                                               ; preds = %66
  invoke void @MatNd_printTwoArraysDiff(ptr noundef %52, ptr noundef %54, i32 noundef 8)
          to label %70 unwind label %88

70:                                               ; preds = %69
  br i1 %7, label %71, label %92

71:                                               ; preds = %70
  %72 = getelementptr inbounds i8, ptr %52, i64 8
  %73 = load i32, ptr %72, align 8, !tbaa !13
  %74 = invoke ptr @MatNd_create(i32 noundef %73, i32 noundef 2)
          to label %75 unwind label %90

75:                                               ; preds = %71
  invoke void @MatNd_copyColumn(ptr noundef %74, i32 noundef 0, ptr noundef nonnull %52, i32 noundef 0)
          to label %76 unwind label %90

76:                                               ; preds = %75
  invoke void @MatNd_copyColumn(ptr noundef %74, i32 noundef 1, ptr noundef %54, i32 noundef 0)
          to label %77 unwind label %90

77:                                               ; preds = %76
  %78 = invoke zeroext i1 @MatNd_gnuplot(ptr noundef nonnull @.str.397, ptr noundef %74)
          to label %79 unwind label %90

79:                                               ; preds = %77
  %80 = load i32, ptr @RcsLogLevel, align 4, !tbaa !11
  %81 = icmp sgt i32 %80, 1
  br i1 %81, label %82, label %92

82:                                               ; preds = %79
  %83 = load double, ptr %3, align 8, !tbaa !5
  invoke void @_ZNK3Rcs16ViaPointSequence7gnuplotEdi(ptr noundef nonnull align 8 dereferenceable(104) %5, double noundef %83, i32 noundef 1)
          to label %92 unwind label %90

84:                                               ; preds = %44, %42
  %85 = landingpad { ptr, i32 }
          cleanup
  br label %93

86:                                               ; preds = %46
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %93

88:                                               ; preds = %69, %66, %64, %62, %59, %57, %55, %53
  %89 = landingpad { ptr, i32 }
          cleanup
  br label %93

90:                                               ; preds = %82, %77, %76, %75, %71
  %91 = landingpad { ptr, i32 }
          cleanup
  br label %93

92:                                               ; preds = %70, %82, %79, %32, %35
  call void @_ZN3Rcs16ViaPointSequenceD1Ev(ptr noundef nonnull align 8 dereferenceable(104) %5) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %5) #5
  br label %94

93:                                               ; preds = %84, %88, %90, %86, %30
  %.pn30 = phi { ptr, i32 } [ %31, %30 ], [ %85, %84 ], [ %87, %86 ], [ %91, %90 ], [ %89, %88 ]
  call void @_ZN3Rcs16ViaPointSequenceD1Ev(ptr noundef nonnull align 8 dereferenceable(104) %5) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn30

94:                                               ; preds = %13, %16, %92
  %.1 = phi i1 [ %25, %92 ], [ false, %16 ], [ false, %13 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  ret i1 %.1
}

declare void @_ZN3Rcs16ViaPointSequenceC1EPKcNS0_12ViaPointTypeE(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef, i32 noundef) unnamed_addr #2

declare noundef zeroext i1 @_ZNK3Rcs16ViaPointSequence14gradientDxDviaEP6_MatNdjddd(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef, i32 noundef, double noundef, double noundef, double noundef) local_unnamed_addr #2

declare noundef zeroext i1 @_ZNK3Rcs16ViaPointSequence16gradientDxDvia_aEP6_MatNdjddd(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef, i32 noundef, double noundef, double noundef, double noundef) local_unnamed_addr #2

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

declare void @_ZNK3Rcs16ViaPointSequence7gnuplotEdi(ptr noundef nonnull align 8 dereferenceable(104), double noundef, i32 noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 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 = !{!"double", !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 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 8}
!14 = !{!"_ZTS6_MatNd", !10, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !15, i64 20}
!15 = !{!"bool", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass