; 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 }
%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.22 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.165 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.166 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.168 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.169 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.212 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.223 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.224 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.237 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.242 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.253 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.254 = external hidden unnamed_addr constant [59 x i8], align 1
@__func__.testArcLengthInterpolation = external hidden unnamed_addr constant [27 x i8], align 1
@.str.255 = external hidden unnamed_addr constant [158 x i8], align 1
@.str.256 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.257 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.258 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.259 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.260 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.261 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.262 = external hidden unnamed_addr constant [138 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

; 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 ptr @MatNd_create(i32 noundef, i32 noundef) #2

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

declare void @MatNd_destroy(ptr noundef) #2

declare i32 @fflush(ptr noundef) #2

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

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

declare i32 @system(ptr noundef) #2

declare ptr @MatNd_createFromFile(ptr noundef) #2

declare void @print_trace() #2

; Function Attrs: noreturn nounwind
declare void @abort() #3

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

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

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #2

declare i32 @fclose(ptr noundef) #2

declare void @_ZN3Rcs13CmdLineParser5printEv() #2

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

declare void @MatNd_computeMinimumJerkTrajectory(ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local zeroext i1 @testArcLengthInterpolation(i32 noundef %0, ptr noundef %1) #4 {
  %3 = alloca i1, align 1
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca [256 x i8], align 16
  %9 = alloca ptr, align 8
  %10 = alloca %"class.Rcs::CmdLineParser", align 1
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca double, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca double, align 8
  %18 = alloca i32, align 4
  %19 = alloca %struct._MatNd, align 8
  %20 = alloca double, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  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 4, ptr %6) #7
  store i32 40, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 1, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 256, ptr %8) #7
  call void @llvm.memset.p0.i64(ptr align 16 %8, i8 0, i64 256, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store ptr null, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #7
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = load ptr, ptr %5, align 8, !tbaa !9
  call void @_ZN3Rcs13CmdLineParserC1EiPPc(ptr noundef nonnull align 1 dereferenceable(1) %10, i32 noundef %24, ptr noundef %25)
  %26 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPiS2_z(ptr noundef nonnull align 1 dereferenceable(1) %10, ptr noundef @.str.223, ptr noundef %6, ptr noundef @.str.224)
  %27 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 0
  %28 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPcS2_z(ptr noundef nonnull align 1 dereferenceable(1) %10, ptr noundef @.str.253, ptr noundef %27, ptr noundef @.str.254)
  %29 = call noundef zeroext i1 (ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11hasArgumentEPKcS2_z(ptr noundef nonnull align 1 dereferenceable(1) %10, ptr noundef @.str.212, ptr noundef null)
  br i1 %29, label %30, label %42

30:                                               ; preds = %2
  br label %31

31:                                               ; preds = %30
  %32 = load ptr, ptr @stderr, align 8, !tbaa !9
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef @.str.22, ptr noundef @__func__.testArcLengthInterpolation, i32 noundef 2622) #7
  %34 = load ptr, ptr @stderr, align 8, !tbaa !9
  %35 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef @.str.255) #7
  %36 = load ptr, ptr @stderr, align 8, !tbaa !9
  %37 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef @.str.6) #7
  %38 = load ptr, ptr @stderr, align 8, !tbaa !9
  %39 = call i32 @fflush(ptr noundef %38)
  br label %40

40:                                               ; preds = %31
  br label %41

41:                                               ; preds = %40
  call void @_ZN3Rcs13CmdLineParser5printEv()
  store i1 true, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %275

42:                                               ; preds = %2
  %43 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 0
  %44 = call i64 @strlen(ptr noundef %43) #8
  %45 = icmp ugt i64 %44, 0
  br i1 %45, label %46, label %89

46:                                               ; preds = %42
  br label %47

47:                                               ; preds = %46
  %48 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %49 = icmp ne ptr %48, null
  br i1 %49, label %50, label %53

50:                                               ; preds = %47
  %51 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %52 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 0
  call void (i32, ptr, ptr, i32, ptr, ...) %51(i32 noundef 1, ptr noundef @.str.3, ptr noundef @__func__.testArcLengthInterpolation, i32 noundef 2629, ptr noundef @.str.256, ptr noundef %52)
  br label %53

53:                                               ; preds = %50, %47
  %54 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %55 = icmp sle i32 1, %54
  br i1 %55, label %56, label %64

56:                                               ; preds = %53
  %57 = load ptr, ptr @stderr, align 8, !tbaa !9
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %57, ptr noundef @.str.5, ptr noundef @.str.3, ptr noundef @__func__.testArcLengthInterpolation, i32 noundef 2629) #7
  %59 = load ptr, ptr @stderr, align 8, !tbaa !9
  %60 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 0
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %59, ptr noundef @.str.256, ptr noundef %60) #7
  %62 = load ptr, ptr @stderr, align 8, !tbaa !9
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %62, ptr noundef @.str.6) #7
  br label %64

64:                                               ; preds = %56, %53
  br label %65

65:                                               ; preds = %64
  br label %66

66:                                               ; preds = %65
  %67 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 0
  %68 = call ptr @MatNd_createFromFile(ptr noundef %67)
  store ptr %68, ptr %9, align 8, !tbaa !9
  br label %69

69:                                               ; preds = %66
  %70 = load ptr, ptr %9, align 8, !tbaa !9
  %71 = icmp ne ptr %70, null
  br i1 %71, label %80, label %72

72:                                               ; preds = %69
  %73 = load ptr, ptr @stderr, align 8, !tbaa !9
  %74 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %73, ptr noundef @.str.237, ptr noundef @.str.3, ptr noundef @__func__.testArcLengthInterpolation, i32 noundef 2631, ptr noundef @.str.257) #7
  %75 = load ptr, ptr @stderr, align 8, !tbaa !9
  %76 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 0
  %77 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %75, ptr noundef @.str.258, ptr noundef %76) #7
  %78 = load ptr, ptr @stderr, align 8, !tbaa !9
  %79 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef @.str.6) #7
  call void @print_trace()
  call void @exit(i32 noundef 1) #9
  unreachable

80:                                               ; preds = %69
  br label %81

81:                                               ; preds = %80
  br label %82

82:                                               ; preds = %81
  %83 = load ptr, ptr %9, align 8, !tbaa !9
  %84 = getelementptr inbounds %struct._MatNd, ptr %83, i32 0, i32 1
  %85 = load i32, ptr %84, align 8, !tbaa !11
  store i32 %85, ptr %6, align 4, !tbaa !5
  %86 = load ptr, ptr %9, align 8, !tbaa !9
  %87 = getelementptr inbounds %struct._MatNd, ptr %86, i32 0, i32 2
  %88 = load i32, ptr %87, align 4, !tbaa !14
  store i32 %88, ptr %7, align 4, !tbaa !5
  br label %136

89:                                               ; preds = %42
  br label %90

90:                                               ; preds = %89
  %91 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %92 = icmp ne ptr %91, null
  br i1 %92, label %93, label %95

93:                                               ; preds = %90
  %94 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  call void (i32, ptr, ptr, i32, ptr, ...) %94(i32 noundef 1, ptr noundef @.str.3, ptr noundef @__func__.testArcLengthInterpolation, i32 noundef 2637, ptr noundef @.str.259)
  br label %95

95:                                               ; preds = %93, %90
  %96 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %97 = icmp sle i32 1, %96
  br i1 %97, label %98, label %105

98:                                               ; preds = %95
  %99 = load ptr, ptr @stderr, align 8, !tbaa !9
  %100 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %99, ptr noundef @.str.5, ptr noundef @.str.3, ptr noundef @__func__.testArcLengthInterpolation, i32 noundef 2637) #7
  %101 = load ptr, ptr @stderr, align 8, !tbaa !9
  %102 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %101, ptr noundef @.str.259) #7
  %103 = load ptr, ptr @stderr, align 8, !tbaa !9
  %104 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %103, ptr noundef @.str.6) #7
  br label %105

105:                                              ; preds = %98, %95
  br label %106

106:                                              ; preds = %105
  br label %107

107:                                              ; preds = %106
  store i32 1, ptr %7, align 4, !tbaa !5
  %108 = load i32, ptr %6, align 4, !tbaa !5
  %109 = load i32, ptr %7, align 4, !tbaa !5
  %110 = call ptr @MatNd_create(i32 noundef %108, i32 noundef %109)
  store ptr %110, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %132, %107
  %112 = load i32, ptr %12, align 4, !tbaa !5
  %113 = load i32, ptr %6, align 4, !tbaa !5
  %114 = icmp slt i32 %112, %113
  br i1 %114, label %116, label %115

115:                                              ; preds = %111
  store i32 10, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %135

116:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %117 = load i32, ptr %12, align 4, !tbaa !5
  %118 = sitofp i32 %117 to double
  %119 = load i32, ptr %6, align 4, !tbaa !5
  %120 = sub nsw i32 %119, 1
  %121 = sitofp i32 %120 to double
  %122 = fdiv double %118, %121
  store double %122, ptr %13, align 8, !tbaa !15
  %123 = load double, ptr %13, align 8, !tbaa !15
  %124 = fmul double 0x400921FB54442D18, %123
  %125 = call double @sin(double noundef %124) #7
  %126 = load ptr, ptr %9, align 8, !tbaa !9
  %127 = getelementptr inbounds %struct._MatNd, ptr %126, i32 0, i32 0
  %128 = load ptr, ptr %127, align 8, !tbaa !17
  %129 = load i32, ptr %12, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds double, ptr %128, i64 %130
  store double %125, ptr %131, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %132

132:                                              ; preds = %116
  %133 = load i32, ptr %12, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %12, align 4, !tbaa !5
  br label %111, !llvm.loop !18

135:                                              ; preds = %115
  br label %136

136:                                              ; preds = %135, %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %137 = load i32, ptr %6, align 4, !tbaa !5
  %138 = call ptr @MatNd_create(i32 noundef %137, i32 noundef 5)
  store ptr %138, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %139 = load i32, ptr %6, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  %141 = call ptr @MatNd_create(i32 noundef %140, i32 noundef 1)
  store ptr %141, ptr %15, align 8, !tbaa !9
  %142 = load ptr, ptr %15, align 8, !tbaa !9
  call void @MatNd_computeMinimumJerkTrajectory(ptr noundef %142, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %143

143:                                              ; preds = %162, %136
  %144 = load i32, ptr %16, align 4, !tbaa !5
  %145 = load i32, ptr %6, align 4, !tbaa !5
  %146 = icmp slt i32 %144, %145
  br i1 %146, label %148, label %147

147:                                              ; preds = %143
  store i32 13, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %165

148:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %149 = load i32, ptr %16, align 4, !tbaa !5
  %150 = sitofp i32 %149 to double
  %151 = load i32, ptr %6, align 4, !tbaa !5
  %152 = sitofp i32 %151 to double
  %153 = fdiv double %150, %152
  store double %153, ptr %17, align 8, !tbaa !15
  %154 = load ptr, ptr %14, align 8, !tbaa !9
  %155 = load i32, ptr %16, align 4, !tbaa !5
  %156 = load double, ptr %17, align 8, !tbaa !15
  call void @MatNd_set(ptr noundef %154, i32 noundef %155, i32 noundef 0, double noundef %156)
  %157 = load ptr, ptr %14, align 8, !tbaa !9
  %158 = load i32, ptr %16, align 4, !tbaa !5
  %159 = load ptr, ptr %9, align 8, !tbaa !9
  %160 = load i32, ptr %16, align 4, !tbaa !5
  %161 = call double @MatNd_get(ptr noundef %159, i32 noundef %160, i32 noundef 0)
  call void @MatNd_set(ptr noundef %157, i32 noundef %158, i32 noundef 1, double noundef %161)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %162

162:                                              ; preds = %148
  %163 = load i32, ptr %16, align 4, !tbaa !5
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %16, align 4, !tbaa !5
  br label %143, !llvm.loop !20

165:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %166

166:                                              ; preds = %221, %165
  %167 = load i32, ptr %18, align 4, !tbaa !5
  %168 = load i32, ptr %6, align 4, !tbaa !5
  %169 = icmp slt i32 %167, %168
  br i1 %169, label %171, label %170

170:                                              ; preds = %166
  store i32 16, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %224

171:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #7
  %172 = load ptr, ptr %14, align 8, !tbaa !9
  %173 = load i32, ptr %18, align 4, !tbaa !5
  %174 = call ptr @MatNd_getElePtr(ptr noundef %172, i32 noundef %173, i32 noundef 3)
  call void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8 %19, i32 noundef 1, i32 noundef 1, ptr noundef %174)
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %175 = load ptr, ptr %9, align 8, !tbaa !9
  %176 = load ptr, ptr %15, align 8, !tbaa !9
  %177 = getelementptr inbounds %struct._MatNd, ptr %176, i32 0, i32 0
  %178 = load ptr, ptr %177, align 8, !tbaa !17
  %179 = load i32, ptr %18, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds double, ptr %178, i64 %180
  %182 = load double, ptr %181, align 8, !tbaa !15
  %183 = call double @MatNd_interpolateArcLength(ptr noundef %19, ptr noundef null, ptr noundef %175, double noundef %182)
  store double %183, ptr %20, align 8, !tbaa !15
  %184 = load ptr, ptr %14, align 8, !tbaa !9
  %185 = load i32, ptr %18, align 4, !tbaa !5
  %186 = load double, ptr %20, align 8, !tbaa !15
  call void @MatNd_set(ptr noundef %184, i32 noundef %185, i32 noundef 2, double noundef %186)
  br label %187

187:                                              ; preds = %171
  %188 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %189 = icmp ne ptr %188, null
  br i1 %189, label %190, label %200

190:                                              ; preds = %187
  %191 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %192 = load ptr, ptr %15, align 8, !tbaa !9
  %193 = getelementptr inbounds %struct._MatNd, ptr %192, i32 0, i32 0
  %194 = load ptr, ptr %193, align 8, !tbaa !17
  %195 = load i32, ptr %18, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds double, ptr %194, i64 %196
  %198 = load double, ptr %197, align 8, !tbaa !15
  %199 = load double, ptr %20, align 8, !tbaa !15
  call void (i32, ptr, ptr, i32, ptr, ...) %191(i32 noundef 1, ptr noundef @.str.3, ptr noundef @__func__.testArcLengthInterpolation, i32 noundef 2682, ptr noundef @.str.260, double noundef %198, double noundef %199)
  br label %200

200:                                              ; preds = %190, %187
  %201 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %202 = icmp sle i32 1, %201
  br i1 %202, label %203, label %218

203:                                              ; preds = %200
  %204 = load ptr, ptr @stderr, align 8, !tbaa !9
  %205 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %204, ptr noundef @.str.5, ptr noundef @.str.3, ptr noundef @__func__.testArcLengthInterpolation, i32 noundef 2682) #7
  %206 = load ptr, ptr @stderr, align 8, !tbaa !9
  %207 = load ptr, ptr %15, align 8, !tbaa !9
  %208 = getelementptr inbounds %struct._MatNd, ptr %207, i32 0, i32 0
  %209 = load ptr, ptr %208, align 8, !tbaa !17
  %210 = load i32, ptr %18, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds double, ptr %209, i64 %211
  %213 = load double, ptr %212, align 8, !tbaa !15
  %214 = load double, ptr %20, align 8, !tbaa !15
  %215 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %206, ptr noundef @.str.260, double noundef %213, double noundef %214) #7
  %216 = load ptr, ptr @stderr, align 8, !tbaa !9
  %217 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %216, ptr noundef @.str.6) #7
  br label %218

218:                                              ; preds = %203, %200
  br label %219

219:                                              ; preds = %218
  br label %220

220:                                              ; preds = %219
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #7
  br label %221

221:                                              ; preds = %220
  %222 = load i32, ptr %18, align 4, !tbaa !5
  %223 = add nsw i32 %222, 1
  store i32 %223, ptr %18, align 4, !tbaa !5
  br label %166, !llvm.loop !21

224:                                              ; preds = %170
  %225 = load ptr, ptr %14, align 8, !tbaa !9
  %226 = call zeroext i1 @MatNd_toFile(ptr noundef %225, ptr noundef @.str.261)
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  store ptr @.str.262, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %227 = call noalias ptr @fopen(ptr noundef @.str.242, ptr noundef @.str.165)
  store ptr %227, ptr %22, align 8, !tbaa !9
  br label %228

228:                                              ; preds = %224
  %229 = load ptr, ptr %22, align 8, !tbaa !9
  %230 = icmp ne ptr %229, null
  br i1 %230, label %234, label %231

231:                                              ; preds = %228
  %232 = load ptr, ptr @stderr, align 8, !tbaa !9
  %233 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %232, ptr noundef @.str.57, ptr noundef @.str.3, ptr noundef @__func__.testArcLengthInterpolation, i32 noundef 2698, ptr noundef @.str.166) #7
  call void @print_trace()
  call void @abort() #9
  unreachable

234:                                              ; preds = %228
  br label %235

235:                                              ; preds = %234
  br label %236

236:                                              ; preds = %235
  %237 = load ptr, ptr %22, align 8, !tbaa !9
  %238 = load ptr, ptr %21, align 8, !tbaa !9
  %239 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %237, ptr noundef %238) #7
  %240 = load ptr, ptr %22, align 8, !tbaa !9
  %241 = call i32 @fflush(ptr noundef %240)
  %242 = load ptr, ptr %22, align 8, !tbaa !9
  %243 = call i32 @fclose(ptr noundef %242)
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %244 = call i32 @system(ptr noundef @.str.169)
  store i32 %244, ptr %23, align 4, !tbaa !5
  %245 = load i32, ptr %23, align 4, !tbaa !5
  %246 = icmp eq i32 %245, -1
  br i1 %246, label %247, label %259

247:                                              ; preds = %236
  br label %248

248:                                              ; preds = %247
  %249 = load ptr, ptr @stderr, align 8, !tbaa !9
  %250 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %249, ptr noundef @.str.22, ptr noundef @__func__.testArcLengthInterpolation, i32 noundef 2707) #7
  %251 = load ptr, ptr @stderr, align 8, !tbaa !9
  %252 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %251, ptr noundef @.str.168) #7
  %253 = load ptr, ptr @stderr, align 8, !tbaa !9
  %254 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %253, ptr noundef @.str.6) #7
  %255 = load ptr, ptr @stderr, align 8, !tbaa !9
  %256 = call i32 @fflush(ptr noundef %255)
  br label %257

257:                                              ; preds = %248
  br label %258

258:                                              ; preds = %257
  br label %271

259:                                              ; preds = %236
  br label %260

260:                                              ; preds = %259
  %261 = load ptr, ptr @stderr, align 8, !tbaa !9
  %262 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %261, ptr noundef @.str.22, ptr noundef @__func__.testArcLengthInterpolation, i32 noundef 2711) #7
  %263 = load ptr, ptr @stderr, align 8, !tbaa !9
  %264 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %263, ptr noundef @.str.169) #7
  %265 = load ptr, ptr @stderr, align 8, !tbaa !9
  %266 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %265, ptr noundef @.str.6) #7
  %267 = load ptr, ptr @stderr, align 8, !tbaa !9
  %268 = call i32 @fflush(ptr noundef %267)
  br label %269

269:                                              ; preds = %260
  br label %270

270:                                              ; preds = %269
  br label %271

271:                                              ; preds = %270, %258
  %272 = load ptr, ptr %15, align 8, !tbaa !9
  call void @MatNd_destroy(ptr noundef %272)
  %273 = load ptr, ptr %14, align 8, !tbaa !9
  call void @MatNd_destroy(ptr noundef %273)
  %274 = load ptr, ptr %9, align 8, !tbaa !9
  call void @MatNd_destroy(ptr noundef %274)
  store i1 true, ptr %3, align 1
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %275

275:                                              ; preds = %271, %41
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 256, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %276 = load i1, ptr %3, align 1
  ret i1 %276
}

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #6

declare void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8, i32 noundef, i32 noundef, ptr noundef) #2

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

declare double @MatNd_interpolateArcLength(ptr noundef, ptr noundef, ptr noundef, double 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 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind willreturn memory(read) "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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"_ZTS6_MatNd", !10, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !13, i64 20}
!13 = !{!"bool", !7, i64 0}
!14 = !{!12, !6, i64 12}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!12, !10, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}


; 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 }
%struct._MatNd = type { ptr, i32, i32, i32, i8 }

@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.22 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.165 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.166 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.168 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.169 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.212 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.223 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.224 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.237 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.242 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.253 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.254 = external hidden unnamed_addr constant [59 x i8], align 1
@__func__.testArcLengthInterpolation = external hidden unnamed_addr constant [27 x i8], align 1
@.str.255 = external hidden unnamed_addr constant [158 x i8], align 1
@.str.256 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.257 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.258 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.259 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.260 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.261 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.262 = external hidden unnamed_addr constant [138 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

; 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 ptr @MatNd_create(i32 noundef, i32 noundef) local_unnamed_addr #2

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

declare void @MatNd_destroy(ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #1

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

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

; Function Attrs: nofree
declare noundef i32 @system(ptr nocapture noundef readonly) local_unnamed_addr #3

declare ptr @MatNd_createFromFile(ptr noundef) local_unnamed_addr #2

declare void @print_trace() local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #4

declare noundef zeroext i1 @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPiS2_z(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, ptr noundef, ptr 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

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #1

declare void @_ZN3Rcs13CmdLineParser5printEv() local_unnamed_addr #2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @testArcLengthInterpolation(i32 noundef %0, ptr noundef %1) local_unnamed_addr #6 {
  %3 = alloca i32, align 4
  %4 = alloca [256 x i8], align 16
  %5 = alloca %"class.Rcs::CmdLineParser", align 1
  %6 = alloca %struct._MatNd, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  store i32 40, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %4) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %4, i8 0, i64 256, i1 false)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #8
  call void @_ZN3Rcs13CmdLineParserC1EiPPc(ptr noundef nonnull align 1 dereferenceable(1) %5, i32 noundef %0, ptr noundef %1)
  %7 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPiS2_z(ptr noundef nonnull align 1 dereferenceable(1) %5, ptr noundef nonnull @.str.223, ptr noundef nonnull %3, ptr noundef nonnull @.str.224)
  %8 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPcS2_z(ptr noundef nonnull align 1 dereferenceable(1) %5, ptr noundef nonnull @.str.253, ptr noundef nonnull %4, ptr noundef nonnull @.str.254)
  %9 = call noundef zeroext i1 (ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11hasArgumentEPKcS2_z(ptr noundef nonnull align 1 dereferenceable(1) %5, ptr noundef nonnull @.str.212, ptr noundef null)
  br i1 %9, label %10, label %19

10:                                               ; preds = %2
  %11 = load ptr, ptr @stderr, align 8, !tbaa !9
  %12 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.22, ptr noundef nonnull @__func__.testArcLengthInterpolation, i32 noundef 2622) #9
  %13 = load ptr, ptr @stderr, align 8, !tbaa !9
  %14 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.255) #9
  %15 = load ptr, ptr @stderr, align 8, !tbaa !9
  %16 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.6) #9
  %17 = load ptr, ptr @stderr, align 8, !tbaa !9
  %18 = call i32 @fflush(ptr noundef %17)
  call void @_ZN3Rcs13CmdLineParser5printEv()
  br label %138

19:                                               ; preds = %2
  %char0 = load i8, ptr %4, align 16
  %.not = icmp eq i8 %char0, 0
  %20 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %.not59 = icmp eq ptr %20, null
  br i1 %.not, label %45, label %21

21:                                               ; preds = %19
  br i1 %.not59, label %23, label %22

22:                                               ; preds = %21
  call void (i32, ptr, ptr, i32, ptr, ...) %20(i32 noundef 1, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testArcLengthInterpolation, i32 noundef 2629, ptr noundef nonnull @.str.256, ptr noundef nonnull %4)
  br label %23

23:                                               ; preds = %22, %21
  %24 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %26, label %33

26:                                               ; preds = %23
  %27 = load ptr, ptr @stderr, align 8, !tbaa !9
  %28 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testArcLengthInterpolation, i32 noundef 2629) #9
  %29 = load ptr, ptr @stderr, align 8, !tbaa !9
  %30 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef nonnull @.str.256, ptr noundef nonnull %4) #9
  %31 = load ptr, ptr @stderr, align 8, !tbaa !9
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef nonnull @.str.6) #9
  br label %33

33:                                               ; preds = %26, %23
  %34 = call ptr @MatNd_createFromFile(ptr noundef nonnull %4)
  %.not61 = icmp eq ptr %34, null
  br i1 %.not61, label %35, label %42

35:                                               ; preds = %33
  %36 = load ptr, ptr @stderr, align 8, !tbaa !9
  %37 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef nonnull @.str.237, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testArcLengthInterpolation, i32 noundef 2631, ptr noundef nonnull @.str.257) #9
  %38 = load ptr, ptr @stderr, align 8, !tbaa !9
  %39 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef nonnull @.str.258, ptr noundef nonnull %4) #9
  %40 = load ptr, ptr @stderr, align 8, !tbaa !9
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef nonnull @.str.6) #9
  call void @print_trace()
  call void @exit(i32 noundef 1) #10
  unreachable

42:                                               ; preds = %33
  %43 = getelementptr inbounds i8, ptr %34, i64 8
  %44 = load i32, ptr %43, align 8, !tbaa !11
  store i32 %44, ptr %3, align 4, !tbaa !5
  br label %.loopexit

45:                                               ; preds = %19
  br i1 %.not59, label %47, label %46

46:                                               ; preds = %45
  call void (i32, ptr, ptr, i32, ptr, ...) %20(i32 noundef 1, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testArcLengthInterpolation, i32 noundef 2637, ptr noundef nonnull @.str.259)
  br label %47

47:                                               ; preds = %46, %45
  %48 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %49 = icmp sgt i32 %48, 0
  br i1 %49, label %50, label %57

50:                                               ; preds = %47
  %51 = load ptr, ptr @stderr, align 8, !tbaa !9
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testArcLengthInterpolation, i32 noundef 2637) #9
  %53 = load ptr, ptr @stderr, align 8, !tbaa !9
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef nonnull @.str.259) #9
  %55 = load ptr, ptr @stderr, align 8, !tbaa !9
  %56 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.6) #9
  br label %57

57:                                               ; preds = %50, %47
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = call ptr @MatNd_create(i32 noundef %58, i32 noundef 1)
  %60 = load i32, ptr %3, align 4, !tbaa !5
  %61 = icmp sgt i32 %60, 0
  br i1 %61, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %57, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %57 ]
  %62 = phi i32 [ %72, %.lr.ph ], [ %60, %57 ]
  %63 = trunc nuw nsw i64 %indvars.iv to i32
  %64 = uitofp nneg i32 %63 to double
  %65 = add nsw i32 %62, -1
  %66 = sitofp i32 %65 to double
  %67 = fdiv double %64, %66
  %68 = fmul double %67, 0x400921FB54442D18
  %69 = call double @sin(double noundef %68) #8
  %70 = load ptr, ptr %59, align 8, !tbaa !14
  %71 = getelementptr inbounds double, ptr %70, i64 %indvars.iv
  store double %69, ptr %71, align 8, !tbaa !15
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %72 = load i32, ptr %3, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = icmp slt i64 %indvars.iv.next, %73
  br i1 %74, label %.lr.ph, label %.loopexit, !llvm.loop !17

.loopexit:                                        ; preds = %.lr.ph, %57, %42
  %75 = phi i32 [ %44, %42 ], [ %60, %57 ], [ %72, %.lr.ph ]
  %.049 = phi ptr [ %34, %42 ], [ %59, %57 ], [ %59, %.lr.ph ]
  %76 = call ptr @MatNd_create(i32 noundef %75, i32 noundef 5)
  %77 = load i32, ptr %3, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  %79 = call ptr @MatNd_create(i32 noundef %78, i32 noundef 1)
  call void @MatNd_computeMinimumJerkTrajectory(ptr noundef %79, ptr noundef null)
  %80 = load i32, ptr %3, align 4, !tbaa !5
  %81 = icmp sgt i32 %80, 0
  br i1 %81, label %.lr.ph66, label %._crit_edge

.preheader:                                       ; preds = %.lr.ph66
  %82 = icmp sgt i32 %89, 0
  br i1 %82, label %.lr.ph68, label %._crit_edge

.lr.ph66:                                         ; preds = %.loopexit, %.lr.ph66
  %83 = phi i32 [ %89, %.lr.ph66 ], [ %80, %.loopexit ]
  %.05265 = phi i32 [ %88, %.lr.ph66 ], [ 0, %.loopexit ]
  %84 = uitofp nneg i32 %.05265 to double
  %85 = sitofp i32 %83 to double
  %86 = fdiv double %84, %85
  call void @MatNd_set(ptr noundef %76, i32 noundef %.05265, i32 noundef 0, double noundef %86)
  %87 = call double @MatNd_get(ptr noundef %.049, i32 noundef %.05265, i32 noundef 0)
  call void @MatNd_set(ptr noundef %76, i32 noundef %.05265, i32 noundef 1, double noundef %87)
  %88 = add nuw nsw i32 %.05265, 1
  %89 = load i32, ptr %3, align 4, !tbaa !5
  %90 = icmp slt i32 %88, %89
  br i1 %90, label %.lr.ph66, label %.preheader, !llvm.loop !19

._crit_edge:                                      ; preds = %117, %.loopexit, %.preheader
  %91 = call zeroext i1 @MatNd_toFile(ptr noundef %76, ptr noundef nonnull @.str.261)
  %92 = call noalias ptr @fopen(ptr noundef nonnull @.str.242, ptr noundef nonnull @.str.165)
  %.not62 = icmp eq ptr %92, null
  br i1 %.not62, label %121, label %124

.lr.ph68:                                         ; preds = %.preheader, %117
  %indvars.iv70 = phi i64 [ %indvars.iv.next71, %117 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #8
  %93 = trunc nuw nsw i64 %indvars.iv70 to i32
  %94 = call ptr @MatNd_getElePtr(ptr noundef %76, i32 noundef %93, i32 noundef 3)
  call void @MatNd_fromPtr(ptr dead_on_unwind nonnull writable sret(%struct._MatNd) align 8 %6, i32 noundef 1, i32 noundef 1, ptr noundef %94)
  %95 = load ptr, ptr %79, align 8, !tbaa !14
  %96 = getelementptr inbounds double, ptr %95, i64 %indvars.iv70
  %97 = load double, ptr %96, align 8, !tbaa !15
  %98 = call double @MatNd_interpolateArcLength(ptr noundef nonnull %6, ptr noundef null, ptr noundef %.049, double noundef %97)
  call void @MatNd_set(ptr noundef %76, i32 noundef %93, i32 noundef 2, double noundef %98)
  %99 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %.not63 = icmp eq ptr %99, null
  br i1 %.not63, label %104, label %100

100:                                              ; preds = %.lr.ph68
  %101 = load ptr, ptr %79, align 8, !tbaa !14
  %102 = getelementptr inbounds double, ptr %101, i64 %indvars.iv70
  %103 = load double, ptr %102, align 8, !tbaa !15
  call void (i32, ptr, ptr, i32, ptr, ...) %99(i32 noundef 1, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testArcLengthInterpolation, i32 noundef 2682, ptr noundef nonnull @.str.260, double noundef %103, double noundef %98)
  br label %104

104:                                              ; preds = %100, %.lr.ph68
  %105 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %106 = icmp sgt i32 %105, 0
  br i1 %106, label %107, label %117

107:                                              ; preds = %104
  %108 = load ptr, ptr @stderr, align 8, !tbaa !9
  %109 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %108, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testArcLengthInterpolation, i32 noundef 2682) #9
  %110 = load ptr, ptr @stderr, align 8, !tbaa !9
  %111 = load ptr, ptr %79, align 8, !tbaa !14
  %112 = getelementptr inbounds double, ptr %111, i64 %indvars.iv70
  %113 = load double, ptr %112, align 8, !tbaa !15
  %114 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %110, ptr noundef nonnull @.str.260, double noundef %113, double noundef %98) #9
  %115 = load ptr, ptr @stderr, align 8, !tbaa !9
  %116 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %115, ptr noundef nonnull @.str.6) #9
  br label %117

117:                                              ; preds = %107, %104
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #8
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %118 = load i32, ptr %3, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = icmp slt i64 %indvars.iv.next71, %119
  br i1 %120, label %.lr.ph68, label %._crit_edge, !llvm.loop !20

121:                                              ; preds = %._crit_edge
  %122 = load ptr, ptr @stderr, align 8, !tbaa !9
  %123 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %122, ptr noundef nonnull @.str.57, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testArcLengthInterpolation, i32 noundef 2698, ptr noundef nonnull @.str.166) #9
  call void @print_trace()
  call void @abort() #10
  unreachable

124:                                              ; preds = %._crit_edge
  %125 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %92, ptr noundef nonnull @.str.262) #8
  %126 = call i32 @fflush(ptr noundef nonnull %92)
  %127 = call i32 @fclose(ptr noundef nonnull %92)
  %128 = call i32 @system(ptr noundef nonnull @.str.169)
  %129 = icmp eq i32 %128, -1
  %130 = load ptr, ptr @stderr, align 8, !tbaa !9
  %. = select i1 %129, i32 2707, i32 2711
  %.str.168..str.169 = select i1 %129, ptr @.str.168, ptr @.str.169
  %131 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %130, ptr noundef nonnull @.str.22, ptr noundef nonnull @__func__.testArcLengthInterpolation, i32 noundef %.) #9
  %132 = load ptr, ptr @stderr, align 8, !tbaa !9
  %133 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %132, ptr noundef nonnull %.str.168..str.169) #9
  %134 = load ptr, ptr @stderr, align 8, !tbaa !9
  %135 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %134, ptr noundef nonnull @.str.6) #9
  %136 = load ptr, ptr @stderr, align 8, !tbaa !9
  %137 = call i32 @fflush(ptr noundef %136)
  call void @MatNd_destroy(ptr noundef %79)
  call void @MatNd_destroy(ptr noundef %76)
  call void @MatNd_destroy(ptr noundef %.049)
  br label %138

138:                                              ; preds = %124, %10
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  ret i1 true
}

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

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

declare void @MatNd_fromPtr(ptr dead_on_unwind writable sret(%struct._MatNd) align 8, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

declare double @MatNd_interpolateArcLength(ptr noundef, ptr noundef, ptr noundef, double 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 = { nofree "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 = { 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 #5 = { 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 #6 = { 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 #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind }
attributes #9 = { cold nounwind }
attributes #10 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"_ZTS6_MatNd", !10, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !13, i64 20}
!13 = !{!"bool", !7, i64 0}
!14 = !{!12, !10, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass