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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct._MatNd = type { ptr, i32, i32, i32, i8 }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.260 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.261 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.267 = external hidden unnamed_addr constant [34 x i8], align 1
@__func__.MatNd_interpolateArcLengthEuler = external hidden unnamed_addr constant [32 x i8], align 1
@.str.268 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.269 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.270 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.271 = external hidden unnamed_addr constant [27 x i8], align 1

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

declare void @print_trace() #1

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @MatNd_getRowPtr(ptr noundef, i32 noundef) #4

declare void @VecNd_copy(ptr noundef, ptr noundef, i32 noundef) #1

declare void @Vec3d_slerp(ptr noundef, ptr noundef, ptr noundef, double noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @MatNd_interpolateArcLengthEuler(ptr noundef %0, ptr noundef %1, ptr noundef %2, double noundef %3) #4 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store double %3, ptr %8, align 8, !tbaa !9
  br label %18

18:                                               ; preds = %4
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct._MatNd, ptr %19, i32 0, i32 2
  %21 = load i32, ptr %20, align 4, !tbaa !11
  %22 = icmp eq i32 %21, 3
  br i1 %22, label %26, label %23

23:                                               ; preds = %18
  %24 = load ptr, ptr @stderr, align 8, !tbaa !5
  %25 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @__func__.MatNd_interpolateArcLengthEuler, i32 noundef 5074, ptr noundef @.str.268) #5
  call void @print_trace()
  call void @abort() #6
  unreachable

26:                                               ; preds = %18
  br label %27

27:                                               ; preds = %26
  br label %28

28:                                               ; preds = %27
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._MatNd, ptr %29, i32 0, i32 1
  %31 = load i32, ptr %30, align 8, !tbaa !15
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._MatNd, ptr %32, i32 0, i32 1
  %34 = load i32, ptr %33, align 8, !tbaa !15
  %35 = icmp eq i32 %31, %34
  br i1 %35, label %39, label %36

36:                                               ; preds = %28
  %37 = load ptr, ptr @stderr, align 8, !tbaa !5
  %38 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @__func__.MatNd_interpolateArcLengthEuler, i32 noundef 5075, ptr noundef @.str.269) #5
  call void @print_trace()
  call void @abort() #6
  unreachable

39:                                               ; preds = %28
  br label %40

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %40
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct._MatNd, ptr %42, i32 0, i32 2
  %44 = load i32, ptr %43, align 4, !tbaa !11
  %45 = icmp eq i32 %44, 1
  br i1 %45, label %49, label %46

46:                                               ; preds = %41
  %47 = load ptr, ptr @stderr, align 8, !tbaa !5
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @__func__.MatNd_interpolateArcLengthEuler, i32 noundef 5076, ptr noundef @.str.270) #5
  call void @print_trace()
  call void @abort() #6
  unreachable

49:                                               ; preds = %41
  br label %50

50:                                               ; preds = %49
  br label %51

51:                                               ; preds = %50
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._MatNd, ptr %52, i32 0, i32 1
  %54 = load i32, ptr %53, align 8, !tbaa !15
  %55 = icmp eq i32 %54, 1
  br i1 %55, label %59, label %56

56:                                               ; preds = %51
  %57 = load ptr, ptr @stderr, align 8, !tbaa !5
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %57, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @__func__.MatNd_interpolateArcLengthEuler, i32 noundef 5077, ptr noundef @.str.260) #5
  call void @print_trace()
  call void @abort() #6
  unreachable

59:                                               ; preds = %51
  br label %60

60:                                               ; preds = %59
  br label %61

61:                                               ; preds = %60
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct._MatNd, ptr %62, i32 0, i32 2
  %64 = load i32, ptr %63, align 4, !tbaa !11
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._MatNd, ptr %65, i32 0, i32 2
  %67 = load i32, ptr %66, align 4, !tbaa !11
  %68 = icmp eq i32 %64, %67
  br i1 %68, label %72, label %69

69:                                               ; preds = %61
  %70 = load ptr, ptr @stderr, align 8, !tbaa !5
  %71 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @__func__.MatNd_interpolateArcLengthEuler, i32 noundef 5078, ptr noundef @.str.261) #5
  call void @print_trace()
  call void @abort() #6
  unreachable

72:                                               ; preds = %61
  br label %73

73:                                               ; preds = %72
  br label %74

74:                                               ; preds = %73
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct._MatNd, ptr %75, i32 0, i32 2
  %77 = load i32, ptr %76, align 4, !tbaa !11
  %78 = icmp eq i32 %77, 1
  br i1 %78, label %82, label %79

79:                                               ; preds = %74
  %80 = load ptr, ptr @stderr, align 8, !tbaa !5
  %81 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %80, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @__func__.MatNd_interpolateArcLengthEuler, i32 noundef 5079, ptr noundef @.str.270) #5
  call void @print_trace()
  call void @abort() #6
  unreachable

82:                                               ; preds = %74
  br label %83

83:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct._MatNd, ptr %84, i32 0, i32 2
  %86 = load i32, ptr %85, align 4, !tbaa !11
  store i32 %86, ptr %9, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._MatNd, ptr %87, i32 0, i32 1
  %89 = load i32, ptr %88, align 8, !tbaa !15
  store i32 %89, ptr %10, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %90 = load i32, ptr %10, align 4, !tbaa !16
  %91 = sub i32 %90, 1
  store i32 %91, ptr %11, align 4, !tbaa !16
  %92 = load double, ptr %8, align 8, !tbaa !9
  %93 = fcmp ole double %92, 0.000000e+00
  br i1 %93, label %94, label %101

94:                                               ; preds = %83
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._MatNd, ptr %95, i32 0, i32 0
  %97 = load ptr, ptr %96, align 8, !tbaa !17
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = call ptr @MatNd_getRowPtr(ptr noundef %98, i32 noundef 0)
  %100 = load i32, ptr %9, align 4, !tbaa !16
  call void @VecNd_copy(ptr noundef %97, ptr noundef %99, i32 noundef %100)
  store i32 1, ptr %12, align 4
  br label %248

101:                                              ; preds = %83
  %102 = load double, ptr %8, align 8, !tbaa !9
  %103 = fcmp oge double %102, 1.000000e+00
  br i1 %103, label %104, label %113

104:                                              ; preds = %101
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct._MatNd, ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8, !tbaa !17
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = load i32, ptr %10, align 4, !tbaa !16
  %110 = sub i32 %109, 1
  %111 = call ptr @MatNd_getRowPtr(ptr noundef %108, i32 noundef %110)
  %112 = load i32, ptr %9, align 4, !tbaa !16
  call void @VecNd_copy(ptr noundef %107, ptr noundef %111, i32 noundef %112)
  store i32 1, ptr %12, align 4
  br label %248

113:                                              ; preds = %101
  br label %114

114:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 1, ptr %13, align 4, !tbaa !16
  br label %115

115:                                              ; preds = %189, %114
  %116 = load i32, ptr %13, align 4, !tbaa !16
  %117 = load i32, ptr %10, align 4, !tbaa !16
  %118 = icmp ult i32 %116, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %115
  store i32 14, ptr %12, align 4
  br label %192

120:                                              ; preds = %115
  br label %121

121:                                              ; preds = %120
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._MatNd, ptr %122, i32 0, i32 0
  %124 = load ptr, ptr %123, align 8, !tbaa !17
  %125 = load i32, ptr %13, align 4, !tbaa !16
  %126 = zext i32 %125 to i64
  %127 = getelementptr inbounds double, ptr %124, i64 %126
  %128 = load double, ptr %127, align 8, !tbaa !9
  %129 = load ptr, ptr %6, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct._MatNd, ptr %129, i32 0, i32 0
  %131 = load ptr, ptr %130, align 8, !tbaa !17
  %132 = load i32, ptr %13, align 4, !tbaa !16
  %133 = sub i32 %132, 1
  %134 = zext i32 %133 to i64
  %135 = getelementptr inbounds double, ptr %131, i64 %134
  %136 = load double, ptr %135, align 8, !tbaa !9
  %137 = fcmp oge double %128, %136
  br i1 %137, label %162, label %138

138:                                              ; preds = %121
  %139 = load ptr, ptr @stderr, align 8, !tbaa !5
  %140 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %139, ptr noundef @.str, ptr noundef @.str.1, ptr noundef @__func__.MatNd_interpolateArcLengthEuler, i32 noundef 5100, ptr noundef @.str.271) #5
  %141 = load ptr, ptr @stderr, align 8, !tbaa !5
  %142 = load i32, ptr %13, align 4, !tbaa !16
  %143 = load ptr, ptr %6, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct._MatNd, ptr %143, i32 0, i32 0
  %145 = load ptr, ptr %144, align 8, !tbaa !17
  %146 = load i32, ptr %13, align 4, !tbaa !16
  %147 = zext i32 %146 to i64
  %148 = getelementptr inbounds double, ptr %145, i64 %147
  %149 = load double, ptr %148, align 8, !tbaa !9
  %150 = load i32, ptr %13, align 4, !tbaa !16
  %151 = load ptr, ptr %6, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct._MatNd, ptr %151, i32 0, i32 0
  %153 = load ptr, ptr %152, align 8, !tbaa !17
  %154 = load i32, ptr %13, align 4, !tbaa !16
  %155 = sub i32 %154, 1
  %156 = zext i32 %155 to i64
  %157 = getelementptr inbounds double, ptr %153, i64 %156
  %158 = load double, ptr %157, align 8, !tbaa !9
  %159 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %141, ptr noundef @.str.267, i32 noundef %142, double noundef %149, i32 noundef %150, double noundef %158) #5
  %160 = load ptr, ptr @stderr, align 8, !tbaa !5
  %161 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %160, ptr noundef @.str.4) #5
  call void @print_trace()
  call void @exit(i32 noundef 1) #6
  unreachable

162:                                              ; preds = %121
  br label %163

163:                                              ; preds = %162
  br label %164

164:                                              ; preds = %163
  %165 = load ptr, ptr %6, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct._MatNd, ptr %165, i32 0, i32 0
  %167 = load ptr, ptr %166, align 8, !tbaa !17
  %168 = load i32, ptr %13, align 4, !tbaa !16
  %169 = sub i32 %168, 1
  %170 = zext i32 %169 to i64
  %171 = getelementptr inbounds double, ptr %167, i64 %170
  %172 = load double, ptr %171, align 8, !tbaa !9
  %173 = load double, ptr %8, align 8, !tbaa !9
  %174 = fcmp ole double %172, %173
  br i1 %174, label %175, label %188

175:                                              ; preds = %164
  %176 = load ptr, ptr %6, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct._MatNd, ptr %176, i32 0, i32 0
  %178 = load ptr, ptr %177, align 8, !tbaa !17
  %179 = load i32, ptr %13, align 4, !tbaa !16
  %180 = zext i32 %179 to i64
  %181 = getelementptr inbounds double, ptr %178, i64 %180
  %182 = load double, ptr %181, align 8, !tbaa !9
  %183 = load double, ptr %8, align 8, !tbaa !9
  %184 = fcmp ogt double %182, %183
  br i1 %184, label %185, label %188

185:                                              ; preds = %175
  %186 = load i32, ptr %13, align 4, !tbaa !16
  %187 = sub i32 %186, 1
  store i32 %187, ptr %11, align 4, !tbaa !16
  store i32 14, ptr %12, align 4
  br label %192

188:                                              ; preds = %175, %164
  br label %189

189:                                              ; preds = %188
  %190 = load i32, ptr %13, align 4, !tbaa !16
  %191 = add i32 %190, 1
  store i32 %191, ptr %13, align 4, !tbaa !16
  br label %115, !llvm.loop !18

192:                                              ; preds = %185, %119
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %193

193:                                              ; preds = %192
  %194 = load i32, ptr %11, align 4, !tbaa !16
  %195 = load i32, ptr %10, align 4, !tbaa !16
  %196 = sub i32 %195, 1
  %197 = icmp eq i32 %194, %196
  br i1 %197, label %198, label %207

198:                                              ; preds = %193
  %199 = load ptr, ptr %5, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct._MatNd, ptr %199, i32 0, i32 0
  %201 = load ptr, ptr %200, align 8, !tbaa !17
  %202 = load ptr, ptr %7, align 8, !tbaa !5
  %203 = load i32, ptr %10, align 4, !tbaa !16
  %204 = sub i32 %203, 1
  %205 = call ptr @MatNd_getRowPtr(ptr noundef %202, i32 noundef %204)
  %206 = load i32, ptr %9, align 4, !tbaa !16
  call void @VecNd_copy(ptr noundef %201, ptr noundef %205, i32 noundef %206)
  store i32 1, ptr %12, align 4
  br label %248

207:                                              ; preds = %193
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %208 = load ptr, ptr %7, align 8, !tbaa !5
  %209 = load i32, ptr %11, align 4, !tbaa !16
  %210 = call ptr @MatNd_getRowPtr(ptr noundef %208, i32 noundef %209)
  store ptr %210, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %211 = load ptr, ptr %7, align 8, !tbaa !5
  %212 = load i32, ptr %11, align 4, !tbaa !16
  %213 = add i32 %212, 1
  %214 = call ptr @MatNd_getRowPtr(ptr noundef %211, i32 noundef %213)
  store ptr %214, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %215 = load ptr, ptr %6, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct._MatNd, ptr %215, i32 0, i32 0
  %217 = load ptr, ptr %216, align 8, !tbaa !17
  %218 = load i32, ptr %11, align 4, !tbaa !16
  %219 = zext i32 %218 to i64
  %220 = getelementptr inbounds double, ptr %217, i64 %219
  %221 = load double, ptr %220, align 8, !tbaa !9
  store double %221, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %222 = load ptr, ptr %6, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct._MatNd, ptr %222, i32 0, i32 0
  %224 = load ptr, ptr %223, align 8, !tbaa !17
  %225 = load i32, ptr %11, align 4, !tbaa !16
  %226 = add i32 %225, 1
  %227 = zext i32 %226 to i64
  %228 = getelementptr inbounds double, ptr %224, i64 %227
  %229 = load double, ptr %228, align 8, !tbaa !9
  store double %229, ptr %17, align 8, !tbaa !9
  %230 = load double, ptr %17, align 8, !tbaa !9
  %231 = load double, ptr %16, align 8, !tbaa !9
  %232 = fsub double %230, %231
  %233 = fcmp ogt double %232, 0.000000e+00
  br i1 %233, label %234, label %247

234:                                              ; preds = %207
  %235 = load ptr, ptr %5, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct._MatNd, ptr %235, i32 0, i32 0
  %237 = load ptr, ptr %236, align 8, !tbaa !17
  %238 = load ptr, ptr %14, align 8, !tbaa !5
  %239 = load ptr, ptr %15, align 8, !tbaa !5
  %240 = load double, ptr %8, align 8, !tbaa !9
  %241 = load double, ptr %16, align 8, !tbaa !9
  %242 = fsub double %240, %241
  %243 = load double, ptr %17, align 8, !tbaa !9
  %244 = load double, ptr %16, align 8, !tbaa !9
  %245 = fsub double %243, %244
  %246 = fdiv double %242, %245
  call void @Vec3d_slerp(ptr noundef %237, ptr noundef %238, ptr noundef %239, double noundef %246)
  br label %247

247:                                              ; preds = %234, %207
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  store i32 0, ptr %12, align 4
  br label %248

248:                                              ; preds = %247, %198, %104, %94
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  %249 = load i32, ptr %12, align 4
  switch i32 %249, label %251 [
    i32 0, label %250
    i32 1, label %250
  ]

250:                                              ; preds = %248, %248
  ret void

251:                                              ; preds = %248
  unreachable
}

attributes #0 = { 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 #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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !13, i64 12}
!12 = !{!"_MatNd", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !14, i64 20}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{!12, !13, i64 8}
!16 = !{!13, !13, i64 0}
!17 = !{!12, !6, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.260 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.261 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.267 = external hidden unnamed_addr constant [34 x i8], align 1
@__func__.MatNd_interpolateArcLengthEuler = external hidden unnamed_addr constant [32 x i8], align 1
@.str.268 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.269 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.270 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.271 = external hidden unnamed_addr constant [27 x i8], align 1

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

declare void @print_trace() local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @MatNd_getRowPtr(ptr noundef, i32 noundef) local_unnamed_addr #3

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

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

; Function Attrs: nounwind uwtable
define dso_local void @MatNd_interpolateArcLengthEuler(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr noundef %2, double noundef %3) local_unnamed_addr #3 {
  %5 = getelementptr inbounds i8, ptr %2, i64 12
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = icmp eq i32 %6, 3
  br i1 %7, label %11, label %8

8:                                                ; preds = %4
  %9 = load ptr, ptr @stderr, align 8, !tbaa !12
  %10 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %9, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_interpolateArcLengthEuler, i32 noundef 5074, ptr noundef nonnull @.str.268) #4
  tail call void @print_trace() #5
  tail call void @abort() #6
  unreachable

11:                                               ; preds = %4
  %12 = getelementptr inbounds i8, ptr %1, i64 8
  %13 = load i32, ptr %12, align 8, !tbaa !13
  %14 = getelementptr inbounds i8, ptr %2, i64 8
  %15 = load i32, ptr %14, align 8, !tbaa !13
  %16 = icmp eq i32 %13, %15
  br i1 %16, label %20, label %17

17:                                               ; preds = %11
  %18 = load ptr, ptr @stderr, align 8, !tbaa !12
  %19 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_interpolateArcLengthEuler, i32 noundef 5075, ptr noundef nonnull @.str.269) #4
  tail call void @print_trace() #5
  tail call void @abort() #6
  unreachable

20:                                               ; preds = %11
  %21 = getelementptr inbounds i8, ptr %1, i64 12
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = icmp eq i32 %22, 1
  br i1 %23, label %27, label %24

24:                                               ; preds = %20
  %25 = load ptr, ptr @stderr, align 8, !tbaa !12
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_interpolateArcLengthEuler, i32 noundef 5076, ptr noundef nonnull @.str.270) #4
  tail call void @print_trace() #5
  tail call void @abort() #6
  unreachable

27:                                               ; preds = %20
  %28 = getelementptr inbounds i8, ptr %0, i64 8
  %29 = load i32, ptr %28, align 8, !tbaa !13
  %30 = icmp eq i32 %29, 1
  br i1 %30, label %34, label %31

31:                                               ; preds = %27
  %32 = load ptr, ptr @stderr, align 8, !tbaa !12
  %33 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_interpolateArcLengthEuler, i32 noundef 5077, ptr noundef nonnull @.str.260) #4
  tail call void @print_trace() #5
  tail call void @abort() #6
  unreachable

34:                                               ; preds = %27
  %35 = getelementptr inbounds i8, ptr %0, i64 12
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = icmp eq i32 %36, 3
  br i1 %37, label %41, label %38

38:                                               ; preds = %34
  %39 = load ptr, ptr @stderr, align 8, !tbaa !12
  %40 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_interpolateArcLengthEuler, i32 noundef 5078, ptr noundef nonnull @.str.261) #4
  tail call void @print_trace() #5
  tail call void @abort() #6
  unreachable

41:                                               ; preds = %34
  %42 = add i32 %13, -1
  %43 = fcmp ugt double %3, 0.000000e+00
  br i1 %43, label %47, label %44

44:                                               ; preds = %41
  %45 = load ptr, ptr %0, align 8, !tbaa !14
  %46 = tail call ptr @MatNd_getRowPtr(ptr noundef nonnull %2, i32 noundef 0)
  tail call void @VecNd_copy(ptr noundef %45, ptr noundef %46, i32 noundef 3) #5
  br label %98

47:                                               ; preds = %41
  %48 = fcmp ult double %3, 1.000000e+00
  br i1 %48, label %.preheader, label %51

.preheader:                                       ; preds = %47
  %49 = icmp ugt i32 %13, 1
  br i1 %49, label %.lr.ph, label %.thread

.lr.ph:                                           ; preds = %.preheader
  %50 = load ptr, ptr %1, align 8, !tbaa !14
  %wide.trip.count = zext i32 %13 to i64
  %.pre = load double, ptr %50, align 8, !tbaa !15
  br label %54

51:                                               ; preds = %47
  %52 = load ptr, ptr %0, align 8, !tbaa !14
  %53 = tail call ptr @MatNd_getRowPtr(ptr noundef nonnull %2, i32 noundef %42)
  tail call void @VecNd_copy(ptr noundef %52, ptr noundef %53, i32 noundef 3) #5
  br label %98

54:                                               ; preds = %.lr.ph, %76
  %55 = phi double [ %.pre, %.lr.ph ], [ %57, %76 ]
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %76 ]
  %56 = getelementptr inbounds double, ptr %50, i64 %indvars.iv
  %57 = load double, ptr %56, align 8, !tbaa !15
  %58 = fcmp ult double %57, %55
  br i1 %58, label %59, label %73

59:                                               ; preds = %54
  %60 = trunc nuw i64 %indvars.iv to i32
  %61 = load ptr, ptr @stderr, align 8, !tbaa !12
  %62 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_interpolateArcLengthEuler, i32 noundef 5100, ptr noundef nonnull @.str.271) #4
  %63 = load ptr, ptr @stderr, align 8, !tbaa !12
  %64 = load ptr, ptr %1, align 8, !tbaa !14
  %65 = getelementptr inbounds double, ptr %64, i64 %indvars.iv
  %66 = load double, ptr %65, align 8, !tbaa !15
  %67 = getelementptr double, ptr %64, i64 %indvars.iv
  %68 = getelementptr i8, ptr %67, i64 -8
  %69 = load double, ptr %68, align 8, !tbaa !15
  %70 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %63, ptr noundef nonnull @.str.267, i32 noundef %60, double noundef %66, i32 noundef %60, double noundef %69) #4
  %71 = load ptr, ptr @stderr, align 8, !tbaa !12
  %72 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef nonnull @.str.4) #4
  tail call void @print_trace() #5
  tail call void @exit(i32 noundef 1) #6
  unreachable

73:                                               ; preds = %54
  %74 = fcmp ole double %55, %3
  %75 = fcmp ogt double %57, %3
  %or.cond = and i1 %75, %74
  br i1 %or.cond, label %79, label %76

76:                                               ; preds = %73
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.thread, label %54, !llvm.loop !17

.thread:                                          ; preds = %76, %.preheader
  %77 = load ptr, ptr %0, align 8, !tbaa !14
  %78 = tail call ptr @MatNd_getRowPtr(ptr noundef %2, i32 noundef %42)
  tail call void @VecNd_copy(ptr noundef %77, ptr noundef %78, i32 noundef 3) #5
  br label %98

79:                                               ; preds = %73
  %80 = add nsw i64 %indvars.iv, -1
  %81 = trunc nuw i64 %indvars.iv to i32
  %82 = trunc nuw i64 %80 to i32
  %83 = tail call ptr @MatNd_getRowPtr(ptr noundef %2, i32 noundef %82)
  %84 = tail call ptr @MatNd_getRowPtr(ptr noundef %2, i32 noundef %81)
  %85 = load ptr, ptr %1, align 8, !tbaa !14
  %86 = and i64 %80, 4294967295
  %87 = getelementptr inbounds double, ptr %85, i64 %86
  %88 = load double, ptr %87, align 8, !tbaa !15
  %89 = and i64 %indvars.iv, 4294967295
  %90 = getelementptr inbounds double, ptr %85, i64 %89
  %91 = load double, ptr %90, align 8, !tbaa !15
  %92 = fsub double %91, %88
  %93 = fcmp ogt double %92, 0.000000e+00
  br i1 %93, label %94, label %98

94:                                               ; preds = %79
  %95 = load ptr, ptr %0, align 8, !tbaa !14
  %96 = fsub double %3, %88
  %97 = fdiv double %96, %92
  tail call void @Vec3d_slerp(ptr noundef %95, ptr noundef %83, ptr noundef %84, double noundef %97) #5
  br label %98

98:                                               ; preds = %79, %94, %.thread, %51, %44
  ret void
}

attributes #0 = { 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 #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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { cold nounwind }
attributes #5 = { nounwind }
attributes #6 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 12}
!6 = !{!"_MatNd", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !11, i64 20}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_Bool", !8, i64 0}
!12 = !{!7, !7, i64 0}
!13 = !{!6, !10, i64 8}
!14 = !{!6, !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !8, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


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