; 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.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.85 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.245 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.246 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.247 = external hidden unnamed_addr constant [11 x i8], align 1
@__func__.MatNd_interpolateRowsEuler = external hidden unnamed_addr constant [27 x i8], align 1
@.str.248 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.249 = external hidden unnamed_addr constant [12 x i8], align 1

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

declare void @print_trace() #1

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @MatNd_interpolateRowsEuler(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca double, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [3 x double], align 16
  %10 = alloca double, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  br label %12

12:                                               ; preds = %2
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = icmp ne ptr %13, null
  br i1 %14, label %18, label %15

15:                                               ; preds = %12
  %16 = load ptr, ptr @stderr, align 8, !tbaa !5
  %17 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @__func__.MatNd_interpolateRowsEuler, i32 noundef 4534, ptr noundef @.str.85) #6
  call void @print_trace()
  call void @abort() #7
  unreachable

18:                                               ; preds = %12
  br label %19

19:                                               ; preds = %18
  br label %20

20:                                               ; preds = %19
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %26, label %23

23:                                               ; preds = %20
  %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_interpolateRowsEuler, i32 noundef 4535, ptr noundef @.str.245) #6
  call void @print_trace()
  call void @abort() #7
  unreachable

26:                                               ; preds = %20
  br label %27

27:                                               ; preds = %26
  br label %28

28:                                               ; preds = %27
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._MatNd, ptr %29, i32 0, i32 2
  %31 = load i32, ptr %30, align 4, !tbaa !9
  %32 = icmp eq i32 %31, 3
  br i1 %32, label %36, label %33

33:                                               ; preds = %28
  %34 = load ptr, ptr @stderr, align 8, !tbaa !5
  %35 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @__func__.MatNd_interpolateRowsEuler, i32 noundef 4536, ptr noundef @.str.248) #6
  call void @print_trace()
  call void @abort() #7
  unreachable

36:                                               ; preds = %28
  br label %37

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._MatNd, ptr %39, i32 0, i32 2
  %41 = load i32, ptr %40, align 4, !tbaa !9
  %42 = icmp eq i32 %41, 3
  br i1 %42, label %46, label %43

43:                                               ; preds = %38
  %44 = load ptr, ptr @stderr, align 8, !tbaa !5
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @__func__.MatNd_interpolateRowsEuler, i32 noundef 4537, ptr noundef @.str.249) #6
  call void @print_trace()
  call void @abort() #7
  unreachable

46:                                               ; preds = %38
  br label %47

47:                                               ; preds = %46
  br label %48

48:                                               ; preds = %47
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._MatNd, ptr %49, i32 0, i32 1
  %51 = load i32, ptr %50, align 8, !tbaa !13
  %52 = icmp ugt i32 %51, 1
  br i1 %52, label %56, label %53

53:                                               ; preds = %48
  %54 = load ptr, ptr @stderr, align 8, !tbaa !5
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @__func__.MatNd_interpolateRowsEuler, i32 noundef 4538, ptr noundef @.str.246) #6
  call void @print_trace()
  call void @abort() #7
  unreachable

56:                                               ; preds = %48
  br label %57

57:                                               ; preds = %56
  br label %58

58:                                               ; preds = %57
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._MatNd, ptr %59, i32 0, i32 1
  %61 = load i32, ptr %60, align 8, !tbaa !13
  %62 = icmp ugt i32 %61, 1
  br i1 %62, label %66, label %63

63:                                               ; preds = %58
  %64 = load ptr, ptr @stderr, align 8, !tbaa !5
  %65 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %64, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @__func__.MatNd_interpolateRowsEuler, i32 noundef 4539, ptr noundef @.str.247) #6
  call void @print_trace()
  call void @abort() #7
  unreachable

66:                                               ; preds = %58
  br label %67

67:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._MatNd, ptr %68, i32 0, i32 1
  %70 = load i32, ptr %69, align 8, !tbaa !13
  %71 = sub i32 %70, 1
  %72 = uitofp i32 %71 to double
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._MatNd, ptr %73, i32 0, i32 1
  %75 = load i32, ptr %74, align 8, !tbaa !13
  %76 = sub i32 %75, 1
  %77 = uitofp i32 %76 to double
  %78 = fdiv double %72, %77
  store double %78, ptr %5, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store ptr null, ptr %6, align 8, !tbaa !5
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct._MatNd, ptr %79, i32 0, i32 1
  %81 = load i32, ptr %80, align 8, !tbaa !13
  %82 = mul i32 %81, 1
  %83 = icmp ugt i32 %82, 1296
  br i1 %83, label %84, label %89

84:                                               ; preds = %67
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct._MatNd, ptr %85, i32 0, i32 1
  %87 = load i32, ptr %86, align 8, !tbaa !13
  %88 = call ptr @MatNd_create(i32 noundef %87, i32 noundef 1)
  store ptr %88, ptr %6, align 8, !tbaa !5
  br label %130

89:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._MatNd, ptr %90, i32 0, i32 1
  %92 = load i32, ptr %91, align 8, !tbaa !13
  %93 = mul i32 %92, 1
  %94 = icmp eq i32 %93, 0
  br i1 %94, label %95, label %96

95:                                               ; preds = %89
  br label %101

96:                                               ; preds = %89
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct._MatNd, ptr %97, i32 0, i32 1
  %99 = load i32, ptr %98, align 8, !tbaa !13
  %100 = mul i32 %99, 1
  br label %101

101:                                              ; preds = %96, %95
  %102 = phi i32 [ 1, %95 ], [ %100, %96 ]
  store i32 %102, ptr %7, align 4, !tbaa !16
  %103 = load i32, ptr %7, align 4, !tbaa !16
  %104 = zext i32 %103 to i64
  %105 = mul i64 %104, 8
  %106 = add i64 24, %105
  %107 = alloca i8, i64 %106, align 16
  store ptr %107, ptr %6, align 8, !tbaa !5
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._MatNd, ptr %108, i64 1
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct._MatNd, ptr %110, i32 0, i32 0
  store ptr %109, ptr %111, align 8, !tbaa !17
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct._MatNd, ptr %112, i32 0, i32 1
  %114 = load i32, ptr %113, align 8, !tbaa !13
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct._MatNd, ptr %115, i32 0, i32 1
  store i32 %114, ptr %116, align 8, !tbaa !13
  %117 = load ptr, ptr %6, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct._MatNd, ptr %117, i32 0, i32 2
  store i32 1, ptr %118, align 4, !tbaa !9
  %119 = load i32, ptr %7, align 4, !tbaa !16
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct._MatNd, ptr %120, i32 0, i32 3
  store i32 %119, ptr %121, align 8, !tbaa !18
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._MatNd, ptr %122, i32 0, i32 4
  store i8 1, ptr %123, align 4, !tbaa !19
  %124 = load ptr, ptr %6, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct._MatNd, ptr %124, i32 0, i32 0
  %126 = load ptr, ptr %125, align 8, !tbaa !17
  %127 = load i32, ptr %7, align 4, !tbaa !16
  %128 = zext i32 %127 to i64
  %129 = mul i64 %128, 8
  call void @llvm.memset.p0.i64(ptr align 8 %126, i8 0, i64 %129, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %130

130:                                              ; preds = %101, %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !16
  br label %131

131:                                              ; preds = %185, %130
  %132 = load i32, ptr %8, align 4, !tbaa !16
  %133 = load ptr, ptr %3, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct._MatNd, ptr %133, i32 0, i32 1
  %135 = load i32, ptr %134, align 8, !tbaa !13
  %136 = icmp ult i32 %132, %135
  br i1 %136, label %138, label %137

137:                                              ; preds = %131
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %188

138:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %139 = load i32, ptr %8, align 4, !tbaa !16
  %140 = uitofp i32 %139 to double
  %141 = load double, ptr %5, align 8, !tbaa !14
  %142 = fmul double %140, %141
  store double %142, ptr %10, align 8, !tbaa !14
  %143 = load double, ptr %10, align 8, !tbaa !14
  %144 = fcmp ole double %143, 0.000000e+00
  br i1 %144, label %145, label %149

145:                                              ; preds = %138
  %146 = getelementptr inbounds [3 x double], ptr %9, i64 0, i64 0
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = call ptr @MatNd_getRowPtr(ptr noundef %147, i32 noundef 0)
  call void @Vec3d_copy(ptr noundef %146, ptr noundef %148)
  br label %181

149:                                              ; preds = %138
  %150 = load double, ptr %10, align 8, !tbaa !14
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct._MatNd, ptr %151, i32 0, i32 1
  %153 = load i32, ptr %152, align 8, !tbaa !13
  %154 = sub i32 %153, 1
  %155 = uitofp i32 %154 to double
  %156 = fcmp oge double %150, %155
  br i1 %156, label %157, label %165

157:                                              ; preds = %149
  %158 = getelementptr inbounds [3 x double], ptr %9, i64 0, i64 0
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct._MatNd, ptr %160, i32 0, i32 1
  %162 = load i32, ptr %161, align 8, !tbaa !13
  %163 = sub i32 %162, 1
  %164 = call ptr @MatNd_getRowPtr(ptr noundef %159, i32 noundef %163)
  call void @Vec3d_copy(ptr noundef %158, ptr noundef %164)
  br label %180

165:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %166 = load double, ptr %10, align 8, !tbaa !14
  %167 = fptoui double %166 to i32
  store i32 %167, ptr %11, align 4, !tbaa !16
  %168 = getelementptr inbounds [3 x double], ptr %9, i64 0, i64 0
  %169 = load ptr, ptr %4, align 8, !tbaa !5
  %170 = load i32, ptr %11, align 4, !tbaa !16
  %171 = call ptr @MatNd_getRowPtr(ptr noundef %169, i32 noundef %170)
  %172 = load ptr, ptr %4, align 8, !tbaa !5
  %173 = load i32, ptr %11, align 4, !tbaa !16
  %174 = add i32 %173, 1
  %175 = call ptr @MatNd_getRowPtr(ptr noundef %172, i32 noundef %174)
  %176 = load double, ptr %10, align 8, !tbaa !14
  %177 = load i32, ptr %11, align 4, !tbaa !16
  %178 = uitofp i32 %177 to double
  %179 = fsub double %176, %178
  call void @Vec3d_slerp(ptr noundef %168, ptr noundef %171, ptr noundef %175, double noundef %179)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %180

180:                                              ; preds = %165, %157
  br label %181

181:                                              ; preds = %180, %145
  %182 = load ptr, ptr %3, align 8, !tbaa !5
  %183 = load i32, ptr %8, align 4, !tbaa !16
  %184 = getelementptr inbounds [3 x double], ptr %9, i64 0, i64 0
  call void @MatNd_setRow(ptr noundef %182, i32 noundef %183, ptr noundef %184, i32 noundef 3)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  br label %185

185:                                              ; preds = %181
  %186 = load i32, ptr %8, align 4, !tbaa !16
  %187 = add i32 %186, 1
  store i32 %187, ptr %8, align 4, !tbaa !16
  br label %131, !llvm.loop !20

188:                                              ; preds = %137
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void
}

declare void @Vec3d_copy(ptr noundef, ptr noundef) #1

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 12}
!10 = !{!"_MatNd", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !12, i64 20}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!10, !11, i64 8}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!11, !11, i64 0}
!17 = !{!10, !6, i64 0}
!18 = !{!10, !11, i64 16}
!19 = !{!10, !12, i64 20}
!20 = distinct !{!20, !21}
!21 = !{!"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.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.85 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.245 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.246 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.247 = external hidden unnamed_addr constant [11 x i8], align 1
@__func__.MatNd_interpolateRowsEuler = external hidden unnamed_addr constant [27 x i8], align 1
@.str.248 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.249 = external hidden unnamed_addr constant [12 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @MatNd_interpolateRowsEuler(ptr noundef %0, ptr noundef %1) local_unnamed_addr #3 {
  %3 = alloca [3 x double], align 16
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %4, label %7

4:                                                ; preds = %2
  %5 = load ptr, ptr @stderr, align 8, !tbaa !5
  %6 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %5, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_interpolateRowsEuler, i32 noundef 4534, ptr noundef nonnull @.str.85) #6
  tail call void @print_trace() #7
  tail call void @abort() #8
  unreachable

7:                                                ; preds = %2
  %.not47 = icmp eq ptr %1, null
  br i1 %.not47, label %8, label %11

8:                                                ; preds = %7
  %9 = load ptr, ptr @stderr, align 8, !tbaa !5
  %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_interpolateRowsEuler, i32 noundef 4535, ptr noundef nonnull @.str.245) #6
  tail call void @print_trace() #7
  tail call void @abort() #8
  unreachable

11:                                               ; preds = %7
  %12 = getelementptr inbounds i8, ptr %0, i64 12
  %13 = load i32, ptr %12, align 4, !tbaa !9
  %14 = icmp eq i32 %13, 3
  br i1 %14, label %18, label %15

15:                                               ; preds = %11
  %16 = load ptr, ptr @stderr, align 8, !tbaa !5
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_interpolateRowsEuler, i32 noundef 4536, ptr noundef nonnull @.str.248) #6
  tail call void @print_trace() #7
  tail call void @abort() #8
  unreachable

18:                                               ; preds = %11
  %19 = getelementptr inbounds i8, ptr %1, i64 12
  %20 = load i32, ptr %19, align 4, !tbaa !9
  %21 = icmp eq i32 %20, 3
  br i1 %21, label %25, label %22

22:                                               ; preds = %18
  %23 = load ptr, ptr @stderr, align 8, !tbaa !5
  %24 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_interpolateRowsEuler, i32 noundef 4537, ptr noundef nonnull @.str.249) #6
  tail call void @print_trace() #7
  tail call void @abort() #8
  unreachable

25:                                               ; preds = %18
  %26 = getelementptr inbounds i8, ptr %0, i64 8
  %27 = load i32, ptr %26, align 8, !tbaa !13
  %28 = icmp ugt i32 %27, 1
  br i1 %28, label %32, label %29

29:                                               ; preds = %25
  %30 = load ptr, ptr @stderr, align 8, !tbaa !5
  %31 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_interpolateRowsEuler, i32 noundef 4538, ptr noundef nonnull @.str.246) #6
  tail call void @print_trace() #7
  tail call void @abort() #8
  unreachable

32:                                               ; preds = %25
  %33 = getelementptr inbounds i8, ptr %1, i64 8
  %34 = load i32, ptr %33, align 8, !tbaa !13
  %35 = icmp ugt i32 %34, 1
  br i1 %35, label %39, label %36

36:                                               ; preds = %32
  %37 = load ptr, ptr @stderr, align 8, !tbaa !5
  %38 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_interpolateRowsEuler, i32 noundef 4539, ptr noundef nonnull @.str.247) #6
  tail call void @print_trace() #7
  tail call void @abort() #8
  unreachable

39:                                               ; preds = %32
  %40 = add i32 %34, -1
  %41 = uitofp i32 %40 to double
  %42 = add i32 %27, -1
  %43 = uitofp i32 %42 to double
  %44 = fdiv double %41, %43
  %45 = icmp ugt i32 %34, 1296
  br i1 %45, label %55, label %.thread

.thread:                                          ; preds = %39
  %46 = shl nuw nsw i32 %34, 3
  %47 = zext nneg i32 %46 to i64
  %48 = add nuw nsw i64 %47, 24
  %49 = alloca i8, i64 %48, align 16
  %50 = getelementptr inbounds i8, ptr %49, i64 24
  store ptr %50, ptr %49, align 16, !tbaa !14
  %51 = getelementptr inbounds i8, ptr %49, i64 8
  store i32 %34, ptr %51, align 8, !tbaa !13
  %52 = getelementptr inbounds i8, ptr %49, i64 12
  store i32 1, ptr %52, align 4, !tbaa !9
  %53 = getelementptr inbounds i8, ptr %49, i64 16
  store i32 %34, ptr %53, align 16, !tbaa !15
  %54 = getelementptr inbounds i8, ptr %49, i64 20
  store i8 1, ptr %54, align 4, !tbaa !16
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %50, i8 0, i64 %47, i1 false)
  br label %.lr.ph.preheader

55:                                               ; preds = %39
  %56 = tail call ptr @MatNd_create(i32 noundef %34, i32 noundef 1)
  %.pre = load i32, ptr %26, align 8, !tbaa !13
  %57 = icmp eq i32 %.pre, 0
  br i1 %57, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.thread, %55
  br label %.lr.ph

._crit_edge:                                      ; preds = %77, %55
  ret void

.lr.ph:                                           ; preds = %.lr.ph.preheader, %77
  %.048 = phi i32 [ %78, %77 ], [ 0, %.lr.ph.preheader ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  %58 = uitofp i32 %.048 to double
  %59 = fmul double %44, %58
  %60 = fcmp ugt double %59, 0.000000e+00
  br i1 %60, label %63, label %61

61:                                               ; preds = %.lr.ph
  %62 = call ptr @MatNd_getRowPtr(ptr noundef nonnull %1, i32 noundef 0)
  call void @Vec3d_copy(ptr noundef nonnull %3, ptr noundef %62) #7
  br label %77

63:                                               ; preds = %.lr.ph
  %64 = load i32, ptr %33, align 8, !tbaa !13
  %65 = add i32 %64, -1
  %66 = uitofp i32 %65 to double
  %67 = fcmp ult double %59, %66
  br i1 %67, label %70, label %68

68:                                               ; preds = %63
  %69 = call ptr @MatNd_getRowPtr(ptr noundef nonnull %1, i32 noundef %65)
  call void @Vec3d_copy(ptr noundef nonnull %3, ptr noundef %69) #7
  br label %77

70:                                               ; preds = %63
  %71 = fptoui double %59 to i32
  %72 = call ptr @MatNd_getRowPtr(ptr noundef nonnull %1, i32 noundef %71)
  %73 = add i32 %71, 1
  %74 = call ptr @MatNd_getRowPtr(ptr noundef nonnull %1, i32 noundef %73)
  %75 = uitofp i32 %71 to double
  %76 = fsub double %59, %75
  call void @Vec3d_slerp(ptr noundef nonnull %3, ptr noundef %72, ptr noundef %74, double noundef %76) #7
  br label %77

77:                                               ; preds = %68, %70, %61
  call void @MatNd_setRow(ptr noundef nonnull %0, i32 noundef %.048, ptr noundef nonnull %3, i32 noundef 3)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  %78 = add nuw i32 %.048, 1
  %79 = load i32, ptr %26, align 8, !tbaa !13
  %80 = icmp ult i32 %78, %79
  br i1 %80, label %.lr.ph, label %._crit_edge, !llvm.loop !17
}

declare void @Vec3d_copy(ptr noundef, ptr noundef) local_unnamed_addr #1

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { cold nounwind }
attributes #7 = { nounwind }
attributes #8 = { noreturn nounwind }

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass