; LLVM IR from Yinxiaoli/iros2015_folding :: src/folding_planner/src (Registration)

; 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.Eigen::Block" = type { %"class.Eigen::BlockImpl" }
%"class.Eigen::BlockImpl" = type { %"class.Eigen::internal::BlockImpl_dense" }
%"class.Eigen::internal::BlockImpl_dense" = type { %"class.Eigen::MapBase.base", ptr, i64 }
%"class.Eigen::MapBase.base" = type <{ ptr, [2 x i8] }>
%"class.Eigen::Matrix" = type { %"class.Eigen::PlainObjectBase" }
%"class.Eigen::PlainObjectBase" = type { %"class.Eigen::DenseStorage" }
%"class.Eigen::DenseStorage" = type { %"struct.Eigen::internal::plain_array" }
%"struct.Eigen::internal::plain_array" = type { [2 x double] }
%struct.SCurve = type { i8, i32, %"class.Eigen::Matrix.27", %"class.Eigen::Matrix.27", %"class.Eigen::Matrix.37" }
%"class.Eigen::Matrix.27" = type { %"class.Eigen::PlainObjectBase.28" }
%"class.Eigen::PlainObjectBase.28" = type { %"class.Eigen::DenseStorage.36" }
%"class.Eigen::DenseStorage.36" = type { ptr, i64 }
%"class.Eigen::Matrix.37" = type { %"class.Eigen::PlainObjectBase.38" }
%"class.Eigen::PlainObjectBase.38" = type { %"class.Eigen::DenseStorage.46" }
%"class.Eigen::DenseStorage.46" = type { ptr, i64 }
%struct.SParameters = type { double, double, double, double, %"struct._BlueTail::_Image::SImage", %struct.SRegion, i32, double, double, double, double, i32, double }
%"struct._BlueTail::_Image::SImage" = type { i32, i32, ptr }
%struct.SRegion = type { double, double, double, double }

; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Eigen9DenseBaseINS_6MatrixIdLi2ELin1ELi0ELi2ELin1EEEE3colEl(ptr dead_on_unwind noalias writable sret(%"class.Eigen::Block") align 8, ptr noundef nonnull align 1 dereferenceable(1), i64 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Eigen6MatrixIdLi2ELi1ELi0ELi2ELi1EEC2INS_5BlockIKNS0_IdLi2ELin1ELi0ELi2ELin1EEELi2ELi1ELb1EEEEERKNS_10MatrixBaseIT_EE(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Eigen15DenseCoeffsBaseINS_6MatrixIdLin1ELi1ELi0ELin1ELi1EEELi0EEclEl(ptr noundef nonnull align 1 dereferenceable(1), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_Z21computeEnergy_bendingPK11SParametersPK6SCurveRKN5Eigen6MatrixIdLi2ELin1ELi0ELi2ELin1EEE(ptr noundef %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(16) %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %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 double, align 8
  %14 = alloca double, align 8
  %15 = alloca %"class.Eigen::Matrix", align 16
  %16 = alloca %"class.Eigen::Block", align 8
  %17 = alloca %"class.Eigen::Matrix", align 16
  %18 = alloca %"class.Eigen::Block", align 8
  %19 = alloca %"class.Eigen::Matrix", align 16
  %20 = alloca %"class.Eigen::Block", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.SCurve, ptr %21, i32 0, i32 0
  %23 = load i8, ptr %22, align 8, !tbaa !9, !range !20, !noundef !21
  %24 = trunc i8 %23 to i1
  br i1 %24, label %25, label %29

25:                                               ; preds = %3
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.SCurve, ptr %26, i32 0, i32 1
  %28 = load i32, ptr %27, align 4, !tbaa !22
  br label %34

29:                                               ; preds = %3
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.SCurve, ptr %30, i32 0, i32 1
  %32 = load i32, ptr %31, align 4, !tbaa !22
  %33 = sub nsw i32 %32, 2
  br label %34

34:                                               ; preds = %29, %25
  %35 = phi i32 [ %28, %25 ], [ %33, %29 ]
  store i32 %35, ptr %7, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  store double 0.000000e+00, ptr %8, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 0, ptr %9, align 4, !tbaa !23
  br label %36

36:                                               ; preds = %157, %34
  %37 = load i32, ptr %9, align 4, !tbaa !23
  %38 = load i32, ptr %7, align 4, !tbaa !23
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %160

41:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.SCurve, ptr %42, i32 0, i32 0
  %44 = load i8, ptr %43, align 8, !tbaa !9, !range !20, !noundef !21
  %45 = trunc i8 %44 to i1
  br i1 %45, label %46, label %57

46:                                               ; preds = %41
  %47 = load i32, ptr %9, align 4, !tbaa !23
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.SCurve, ptr %48, i32 0, i32 1
  %50 = load i32, ptr %49, align 4, !tbaa !22
  %51 = add nsw i32 %47, %50
  %52 = sub nsw i32 %51, 1
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.SCurve, ptr %53, i32 0, i32 1
  %55 = load i32, ptr %54, align 4, !tbaa !22
  %56 = srem i32 %52, %55
  br label %59

57:                                               ; preds = %41
  %58 = load i32, ptr %9, align 4, !tbaa !23
  br label %59

59:                                               ; preds = %57, %46
  %60 = phi i32 [ %56, %46 ], [ %58, %57 ]
  store i32 %60, ptr %10, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.SCurve, ptr %61, i32 0, i32 0
  %63 = load i8, ptr %62, align 8, !tbaa !9, !range !20, !noundef !21
  %64 = trunc i8 %63 to i1
  br i1 %64, label %65, label %67

65:                                               ; preds = %59
  %66 = load i32, ptr %9, align 4, !tbaa !23
  br label %70

67:                                               ; preds = %59
  %68 = load i32, ptr %9, align 4, !tbaa !23
  %69 = add nsw i32 %68, 1
  br label %70

70:                                               ; preds = %67, %65
  %71 = phi i32 [ %66, %65 ], [ %69, %67 ]
  store i32 %71, ptr %11, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.SCurve, ptr %72, i32 0, i32 0
  %74 = load i8, ptr %73, align 8, !tbaa !9, !range !20, !noundef !21
  %75 = trunc i8 %74 to i1
  br i1 %75, label %76, label %83

76:                                               ; preds = %70
  %77 = load i32, ptr %9, align 4, !tbaa !23
  %78 = add nsw i32 %77, 1
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.SCurve, ptr %79, i32 0, i32 1
  %81 = load i32, ptr %80, align 4, !tbaa !22
  %82 = srem i32 %78, %81
  br label %86

83:                                               ; preds = %70
  %84 = load i32, ptr %9, align 4, !tbaa !23
  %85 = add nsw i32 %84, 2
  br label %86

86:                                               ; preds = %83, %76
  %87 = phi i32 [ %82, %76 ], [ %85, %83 ]
  store i32 %87, ptr %12, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.SCurve, ptr %88, i32 0, i32 0
  %90 = load i8, ptr %89, align 8, !tbaa !9, !range !20, !noundef !21
  %91 = trunc i8 %90 to i1
  br i1 %91, label %92, label %108

92:                                               ; preds = %86
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.SCurve, ptr %93, i32 0, i32 3
  %95 = load i32, ptr %9, align 4, !tbaa !23
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.SCurve, ptr %96, i32 0, i32 1
  %98 = load i32, ptr %97, align 4, !tbaa !22
  %99 = add nsw i32 %95, %98
  %100 = sub nsw i32 %99, 1
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.SCurve, ptr %101, i32 0, i32 1
  %103 = load i32, ptr %102, align 4, !tbaa !22
  %104 = srem i32 %100, %103
  %105 = sext i32 %104 to i64
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Eigen15DenseCoeffsBaseINS_6MatrixIdLin1ELi1ELi0ELin1ELi1EEELi0EEclEl(ptr noundef nonnull align 1 dereferenceable(1) %94, i64 noundef %105)
  %107 = load double, ptr %106, align 8, !tbaa !24
  br label %115

108:                                              ; preds = %86
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.SCurve, ptr %109, i32 0, i32 3
  %111 = load i32, ptr %9, align 4, !tbaa !23
  %112 = sext i32 %111 to i64
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Eigen15DenseCoeffsBaseINS_6MatrixIdLin1ELi1ELi0ELin1ELi1EEELi0EEclEl(ptr noundef nonnull align 1 dereferenceable(1) %110, i64 noundef %112)
  %114 = load double, ptr %113, align 8, !tbaa !24
  br label %115

115:                                              ; preds = %108, %92
  %116 = phi double [ %107, %92 ], [ %114, %108 ]
  store double %116, ptr %13, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.SCurve, ptr %117, i32 0, i32 0
  %119 = load i8, ptr %118, align 8, !tbaa !9, !range !20, !noundef !21
  %120 = trunc i8 %119 to i1
  br i1 %120, label %121, label %128

121:                                              ; preds = %115
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.SCurve, ptr %122, i32 0, i32 3
  %124 = load i32, ptr %9, align 4, !tbaa !23
  %125 = sext i32 %124 to i64
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Eigen15DenseCoeffsBaseINS_6MatrixIdLin1ELi1ELi0ELin1ELi1EEELi0EEclEl(ptr noundef nonnull align 1 dereferenceable(1) %123, i64 noundef %125)
  %127 = load double, ptr %126, align 8, !tbaa !24
  br label %136

128:                                              ; preds = %115
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.SCurve, ptr %129, i32 0, i32 3
  %131 = load i32, ptr %9, align 4, !tbaa !23
  %132 = add nsw i32 %131, 1
  %133 = sext i32 %132 to i64
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Eigen15DenseCoeffsBaseINS_6MatrixIdLin1ELi1ELi0ELin1ELi1EEELi0EEclEl(ptr noundef nonnull align 1 dereferenceable(1) %130, i64 noundef %133)
  %135 = load double, ptr %134, align 8, !tbaa !24
  br label %136

136:                                              ; preds = %128, %121
  %137 = phi double [ %127, %121 ], [ %135, %128 ]
  store double %137, ptr %14, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #3
  %138 = load ptr, ptr %6, align 8, !tbaa !5
  %139 = load i32, ptr %10, align 4, !tbaa !23
  %140 = sext i32 %139 to i64
  call void @_ZNK5Eigen9DenseBaseINS_6MatrixIdLi2ELin1ELi0ELi2ELin1EEEE3colEl(ptr dead_on_unwind writable sret(%"class.Eigen::Block") align 8 %16, ptr noundef nonnull align 1 dereferenceable(1) %138, i64 noundef %140)
  call void @_ZN5Eigen6MatrixIdLi2ELi1ELi0ELi2ELi1EEC2INS_5BlockIKNS0_IdLi2ELin1ELi0ELi2ELin1EEELi2ELi1ELb1EEEEERKNS_10MatrixBaseIT_EE(ptr noundef nonnull align 16 dereferenceable(16) %15, ptr noundef nonnull align 1 dereferenceable(1) %16)
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #3
  %141 = load ptr, ptr %6, align 8, !tbaa !5
  %142 = load i32, ptr %11, align 4, !tbaa !23
  %143 = sext i32 %142 to i64
  call void @_ZNK5Eigen9DenseBaseINS_6MatrixIdLi2ELin1ELi0ELi2ELin1EEEE3colEl(ptr dead_on_unwind writable sret(%"class.Eigen::Block") align 8 %18, ptr noundef nonnull align 1 dereferenceable(1) %141, i64 noundef %143)
  call void @_ZN5Eigen6MatrixIdLi2ELi1ELi0ELi2ELi1EEC2INS_5BlockIKNS0_IdLi2ELin1ELi0ELi2ELin1EEELi2ELi1ELb1EEEEERKNS_10MatrixBaseIT_EE(ptr noundef nonnull align 16 dereferenceable(16) %17, ptr noundef nonnull align 1 dereferenceable(1) %18)
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #3
  %144 = load ptr, ptr %6, align 8, !tbaa !5
  %145 = load i32, ptr %12, align 4, !tbaa !23
  %146 = sext i32 %145 to i64
  call void @_ZNK5Eigen9DenseBaseINS_6MatrixIdLi2ELin1ELi0ELi2ELin1EEEE3colEl(ptr dead_on_unwind writable sret(%"class.Eigen::Block") align 8 %20, ptr noundef nonnull align 1 dereferenceable(1) %144, i64 noundef %146)
  call void @_ZN5Eigen6MatrixIdLi2ELi1ELi0ELi2ELi1EEC2INS_5BlockIKNS0_IdLi2ELin1ELi0ELi2ELin1EEELi2ELi1ELb1EEEEERKNS_10MatrixBaseIT_EE(ptr noundef nonnull align 16 dereferenceable(16) %19, ptr noundef nonnull align 1 dereferenceable(1) %20)
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.SParameters, ptr %147, i32 0, i32 1
  %149 = load ptr, ptr %5, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.SCurve, ptr %149, i32 0, i32 2
  %151 = load i32, ptr %9, align 4, !tbaa !23
  %152 = sext i32 %151 to i64
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Eigen15DenseCoeffsBaseINS_6MatrixIdLin1ELi1ELi0ELin1ELi1EEELi0EEclEl(ptr noundef nonnull align 1 dereferenceable(1) %150, i64 noundef %152)
  %154 = call noundef double @_Z27computeSegmentBendingEnergyRKN5Eigen6MatrixIdLi2ELi1ELi0ELi2ELi1EEES3_S3_RKdS5_S5_S5_(ptr noundef nonnull align 16 dereferenceable(16) %15, ptr noundef nonnull align 16 dereferenceable(16) %17, ptr noundef nonnull align 16 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(8) %148, ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %153)
  %155 = load double, ptr %8, align 8, !tbaa !24
  %156 = fadd double %155, %154
  store double %156, ptr %8, align 8, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %157

157:                                              ; preds = %136
  %158 = load i32, ptr %9, align 4, !tbaa !23
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %9, align 4, !tbaa !23
  br label %36, !llvm.loop !26

160:                                              ; preds = %40
  %161 = load double, ptr %8, align 8, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  ret double %161
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_Z27computeSegmentBendingEnergyRKN5Eigen6MatrixIdLi2ELi1ELi0ELi2ELi1EEES3_S3_RKdS5_S5_S5_(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { 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++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTS6SCurve", !11, i64 0, !12, i64 4, !13, i64 8, !13, i64 24, !17, i64 40}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTSN5Eigen6MatrixIdLin1ELi1ELi0ELin1ELi1EEE", !14, i64 0}
!14 = !{!"_ZTSN5Eigen15PlainObjectBaseINS_6MatrixIdLin1ELi1ELi0ELin1ELi1EEEEE", !15, i64 0}
!15 = !{!"_ZTSN5Eigen12DenseStorageIdLin1ELin1ELi1ELi0EEE", !6, i64 0, !16, i64 8}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_ZTSN5Eigen6MatrixIiLin1ELi1ELi0ELin1ELi1EEE", !18, i64 0}
!18 = !{!"_ZTSN5Eigen15PlainObjectBaseINS_6MatrixIiLin1ELi1ELi0ELin1ELi1EEEEE", !19, i64 0}
!19 = !{!"_ZTSN5Eigen12DenseStorageIiLin1ELin1ELi1ELi0EEE", !6, i64 0, !16, i64 8}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!10, !12, i64 4}
!23 = !{!12, !12, i64 0}
!24 = !{!25, !25, i64 0}
!25 = !{!"double", !7, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"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"

%"class.Eigen::Block" = type { %"class.Eigen::BlockImpl" }
%"class.Eigen::BlockImpl" = type { %"class.Eigen::internal::BlockImpl_dense" }
%"class.Eigen::internal::BlockImpl_dense" = type { %"class.Eigen::MapBase.base", ptr, i64 }
%"class.Eigen::MapBase.base" = type <{ ptr, [2 x i8] }>
%"class.Eigen::Matrix" = type { %"class.Eigen::PlainObjectBase" }
%"class.Eigen::PlainObjectBase" = type { %"class.Eigen::DenseStorage" }
%"class.Eigen::DenseStorage" = type { %"struct.Eigen::internal::plain_array" }
%"struct.Eigen::internal::plain_array" = type { [2 x double] }

; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Eigen9DenseBaseINS_6MatrixIdLi2ELin1ELi0ELi2ELin1EEEE3colEl(ptr dead_on_unwind noalias writable sret(%"class.Eigen::Block") align 8, ptr noundef nonnull align 1 dereferenceable(1), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Eigen6MatrixIdLi2ELi1ELi0ELi2ELi1EEC2INS_5BlockIKNS0_IdLi2ELin1ELi0ELi2ELin1EEELi2ELi1ELb1EEEEERKNS_10MatrixBaseIT_EE(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Eigen15DenseCoeffsBaseINS_6MatrixIdLin1ELi1ELi0ELin1ELi1EEELi0EEclEl(ptr noundef nonnull align 1 dereferenceable(1), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_Z21computeEnergy_bendingPK11SParametersPK6SCurveRKN5Eigen6MatrixIdLi2ELin1ELi0ELi2ELin1EEE(ptr noundef %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(16) %2) local_unnamed_addr #2 {
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca %"class.Eigen::Matrix", align 16
  %7 = alloca %"class.Eigen::Block", align 8
  %8 = alloca %"class.Eigen::Matrix", align 16
  %9 = alloca %"class.Eigen::Block", align 8
  %10 = alloca %"class.Eigen::Matrix", align 16
  %11 = alloca %"class.Eigen::Block", align 8
  %12 = load i8, ptr %1, align 8, !tbaa !5, !range !19, !noundef !20
  %13 = trunc nuw i8 %12 to i1
  %14 = getelementptr inbounds i8, ptr %1, i64 4
  %15 = load i32, ptr %14, align 4, !tbaa !21
  %16 = add nsw i32 %15, -2
  %17 = select i1 %13, i32 %15, i32 %16
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %3
  %19 = getelementptr inbounds i8, ptr %1, i64 24
  %20 = getelementptr inbounds i8, ptr %1, i64 4
  %21 = getelementptr inbounds i8, ptr %0, i64 8
  %22 = getelementptr inbounds i8, ptr %1, i64 8
  br label %23

._crit_edge:                                      ; preds = %53, %3
  %.0.lcssa = phi double [ 0.000000e+00, %3 ], [ %60, %53 ]
  ret double %.0.lcssa

23:                                               ; preds = %.lr.ph, %53
  %.044 = phi double [ 0.000000e+00, %.lr.ph ], [ %60, %53 ]
  %.04043 = phi i32 [ 0, %.lr.ph ], [ %41, %53 ]
  %24 = load i8, ptr %1, align 8, !tbaa !5, !range !19, !noundef !20
  %25 = trunc nuw i8 %24 to i1
  br i1 %25, label %26, label %34

26:                                               ; preds = %23
  %27 = load i32, ptr %20, align 4, !tbaa !21
  %28 = add i32 %.04043, -1
  %29 = add i32 %28, %27
  %30 = srem i32 %29, %27
  %31 = add nuw nsw i32 %.04043, 1
  %32 = srem i32 %31, %27
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %33 = sext i32 %30 to i64
  br label %38

34:                                               ; preds = %23
  %35 = add nuw nsw i32 %.04043, 1
  %36 = add nuw nsw i32 %.04043, 2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %37 = zext nneg i32 %.04043 to i64
  br label %38

38:                                               ; preds = %34, %26
  %.sink = phi i64 [ %37, %34 ], [ %33, %26 ]
  %39 = phi i32 [ %36, %34 ], [ %32, %26 ]
  %40 = phi i32 [ %.04043, %34 ], [ %30, %26 ]
  %41 = phi i32 [ %35, %34 ], [ %31, %26 ]
  %42 = phi i32 [ %35, %34 ], [ %.04043, %26 ]
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Eigen15DenseCoeffsBaseINS_6MatrixIdLin1ELi1ELi0ELin1ELi1EEELi0EEclEl(ptr noundef nonnull align 1 dereferenceable(1) %19, i64 noundef %.sink)
  %44 = load double, ptr %43, align 8, !tbaa !22
  store double %44, ptr %4, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %45 = load i8, ptr %1, align 8, !tbaa !5, !range !19, !noundef !20
  %46 = trunc nuw i8 %45 to i1
  br i1 %46, label %47, label %50

47:                                               ; preds = %38
  %48 = zext nneg i32 %.04043 to i64
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Eigen15DenseCoeffsBaseINS_6MatrixIdLin1ELi1ELi0ELin1ELi1EEELi0EEclEl(ptr noundef nonnull align 1 dereferenceable(1) %19, i64 noundef %48)
  br label %53

50:                                               ; preds = %38
  %51 = zext nneg i32 %41 to i64
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Eigen15DenseCoeffsBaseINS_6MatrixIdLin1ELi1ELi0ELin1ELi1EEELi0EEclEl(ptr noundef nonnull align 1 dereferenceable(1) %19, i64 noundef %51)
  %.pre = zext nneg i32 %.04043 to i64
  br label %53

53:                                               ; preds = %50, %47
  %.pre-phi = phi i64 [ %.pre, %50 ], [ %48, %47 ]
  %.in41 = phi ptr [ %52, %50 ], [ %49, %47 ]
  %54 = load double, ptr %.in41, align 8, !tbaa !22
  store double %54, ptr %5, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #3
  %55 = sext i32 %40 to i64
  call void @_ZNK5Eigen9DenseBaseINS_6MatrixIdLi2ELin1ELi0ELi2ELin1EEEE3colEl(ptr dead_on_unwind nonnull writable sret(%"class.Eigen::Block") align 8 %7, ptr noundef nonnull align 1 dereferenceable(1) %2, i64 noundef %55)
  call void @_ZN5Eigen6MatrixIdLi2ELi1ELi0ELi2ELi1EEC2INS_5BlockIKNS0_IdLi2ELin1ELi0ELi2ELin1EEELi2ELi1ELb1EEEEERKNS_10MatrixBaseIT_EE(ptr noundef nonnull align 16 dereferenceable(16) %6, ptr noundef nonnull align 1 dereferenceable(1) %7)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #3
  %56 = zext nneg i32 %42 to i64
  call void @_ZNK5Eigen9DenseBaseINS_6MatrixIdLi2ELin1ELi0ELi2ELin1EEEE3colEl(ptr dead_on_unwind nonnull writable sret(%"class.Eigen::Block") align 8 %9, ptr noundef nonnull align 1 dereferenceable(1) %2, i64 noundef %56)
  call void @_ZN5Eigen6MatrixIdLi2ELi1ELi0ELi2ELi1EEC2INS_5BlockIKNS0_IdLi2ELin1ELi0ELi2ELin1EEELi2ELi1ELb1EEEEERKNS_10MatrixBaseIT_EE(ptr noundef nonnull align 16 dereferenceable(16) %8, ptr noundef nonnull align 1 dereferenceable(1) %9)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #3
  %57 = sext i32 %39 to i64
  call void @_ZNK5Eigen9DenseBaseINS_6MatrixIdLi2ELin1ELi0ELi2ELin1EEEE3colEl(ptr dead_on_unwind nonnull writable sret(%"class.Eigen::Block") align 8 %11, ptr noundef nonnull align 1 dereferenceable(1) %2, i64 noundef %57)
  call void @_ZN5Eigen6MatrixIdLi2ELi1ELi0ELi2ELi1EEC2INS_5BlockIKNS0_IdLi2ELin1ELi0ELi2ELin1EEELi2ELi1ELb1EEEEERKNS_10MatrixBaseIT_EE(ptr noundef nonnull align 16 dereferenceable(16) %10, ptr noundef nonnull align 1 dereferenceable(1) %11)
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Eigen15DenseCoeffsBaseINS_6MatrixIdLin1ELi1ELi0ELin1ELi1EEELi0EEclEl(ptr noundef nonnull align 1 dereferenceable(1) %22, i64 noundef %.pre-phi)
  %59 = call noundef double @_Z27computeSegmentBendingEnergyRKN5Eigen6MatrixIdLi2ELi1ELi0ELi2ELi1EEES3_S3_RKdS5_S5_S5_(ptr noundef nonnull align 16 dereferenceable(16) %6, ptr noundef nonnull align 16 dereferenceable(16) %8, ptr noundef nonnull align 16 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %58)
  %60 = fadd double %.044, %59
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  %61 = icmp slt i32 %41, %17
  br i1 %61, label %23, label %._crit_edge, !llvm.loop !24
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_Z27computeSegmentBendingEnergyRKN5Eigen6MatrixIdLi2ELi1ELi0ELi2ELi1EEES3_S3_RKdS5_S5_S5_(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { 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, !7, i64 0}
!6 = !{!"_ZTS6SCurve", !7, i64 0, !10, i64 4, !11, i64 8, !11, i64 24, !16, i64 40}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTSN5Eigen6MatrixIdLin1ELi1ELi0ELin1ELi1EEE", !12, i64 0}
!12 = !{!"_ZTSN5Eigen15PlainObjectBaseINS_6MatrixIdLin1ELi1ELi0ELin1ELi1EEEEE", !13, i64 0}
!13 = !{!"_ZTSN5Eigen12DenseStorageIdLin1ELin1ELi1ELi0EEE", !14, i64 0, !15, i64 8}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!"long", !8, i64 0}
!16 = !{!"_ZTSN5Eigen6MatrixIiLin1ELi1ELi0ELin1ELi1EEE", !17, i64 0}
!17 = !{!"_ZTSN5Eigen15PlainObjectBaseINS_6MatrixIiLin1ELi1ELi0ELin1ELi1EEEEE", !18, i64 0}
!18 = !{!"_ZTSN5Eigen12DenseStorageIiLin1ELin1ELi1ELi0EEE", !14, i64 0, !15, i64 8}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!6, !10, i64 4}
!22 = !{!23, !23, i64 0}
!23 = !{!"double", !8, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


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