; 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"

%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.SVar = type { %"class.Eigen::Matrix.53", %"class.Eigen::Matrix.27" }
%"class.Eigen::Matrix.53" = type { %"class.Eigen::PlainObjectBase.54" }
%"class.Eigen::PlainObjectBase.54" = type { %"class.Eigen::DenseStorage.62" }
%"class.Eigen::DenseStorage.62" = type { ptr, i64 }

; 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: mustprogress uwtable
declare dso_local void @_Z34computeNumericalDerivative_elasticPK11SParametersPK6SCurveRKN5Eigen6MatrixIdLi2ELin1ELi0ELi2ELin1EEEdRNS6_IdLin1ELin1ELi0ELin1ELin1EEEi(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16), double noundef, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z34computeNumericalDerivative_bendingPK11SParametersPK6SCurveRKN5Eigen6MatrixIdLi2ELin1ELi0ELi2ELin1EEEdRNS6_IdLin1ELin1ELi0ELin1ELin1EEEi(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16), double noundef, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z30computeNumericalDerivative_fitPK11SParametersPK6SCurveRKN5Eigen6MatrixIdLi2ELin1ELi0ELi2ELin1EEEdRNS6_IdLin1ELin1ELi0ELin1ELin1EEEi(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16), double noundef, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z26ComputeNumericalDerivativePK11SParametersPK6SCurveRK4SVardRN5Eigen6MatrixIdLin1ELin1ELi0ELin1ELin1EEE(ptr noundef %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(32) %2, double noundef %3, ptr noundef nonnull align 8 dereferenceable(24) %4) #1 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca double, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store double %3, ptr %9, align 8, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %13 = load ptr, ptr %7, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.SCurve, ptr %13, i32 0, i32 0
  %15 = load i8, ptr %14, align 8, !tbaa !11, !range !22, !noundef !23
  %16 = trunc i8 %15 to i1
  br i1 %16, label %17, label %21

17:                                               ; preds = %5
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.SCurve, ptr %18, i32 0, i32 1
  %20 = load i32, ptr %19, align 4, !tbaa !24
  br label %26

21:                                               ; preds = %5
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.SCurve, ptr %22, i32 0, i32 1
  %24 = load i32, ptr %23, align 4, !tbaa !24
  %25 = sub nsw i32 %24, 1
  br label %26

26:                                               ; preds = %21, %17
  %27 = phi i32 [ %20, %17 ], [ %25, %21 ]
  store i32 %27, ptr %11, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.SCurve, ptr %28, i32 0, i32 0
  %30 = load i8, ptr %29, align 8, !tbaa !11, !range !22, !noundef !23
  %31 = trunc i8 %30 to i1
  br i1 %31, label %32, label %36

32:                                               ; preds = %26
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.SCurve, ptr %33, i32 0, i32 1
  %35 = load i32, ptr %34, align 4, !tbaa !24
  br label %41

36:                                               ; preds = %26
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.SCurve, ptr %37, i32 0, i32 1
  %39 = load i32, ptr %38, align 4, !tbaa !24
  %40 = sub nsw i32 %39, 2
  br label %41

41:                                               ; preds = %36, %32
  %42 = phi i32 [ %35, %32 ], [ %40, %36 ]
  store i32 %42, ptr %12, align 4, !tbaa !25
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIdLin1ELin1ELi0ELin1ELin1EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1) %43)
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.SVar, ptr %47, i32 0, i32 0
  %49 = load double, ptr %9, align 8, !tbaa !9
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_Z34computeNumericalDerivative_elasticPK11SParametersPK6SCurveRKN5Eigen6MatrixIdLi2ELin1ELi0ELi2ELin1EEEdRNS6_IdLin1ELin1ELi0ELin1ELin1EEEi(ptr noundef %45, ptr noundef %46, ptr noundef nonnull align 8 dereferenceable(16) %48, double noundef %49, ptr noundef nonnull align 8 dereferenceable(24) %50, i32 noundef 0)
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.SVar, ptr %53, i32 0, i32 0
  %55 = load double, ptr %9, align 8, !tbaa !9
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  %57 = load i32, ptr %11, align 4, !tbaa !25
  call void @_Z34computeNumericalDerivative_bendingPK11SParametersPK6SCurveRKN5Eigen6MatrixIdLi2ELin1ELi0ELi2ELin1EEEdRNS6_IdLin1ELin1ELi0ELin1ELin1EEEi(ptr noundef %51, ptr noundef %52, ptr noundef nonnull align 8 dereferenceable(16) %54, double noundef %55, ptr noundef nonnull align 8 dereferenceable(24) %56, i32 noundef %57)
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.SVar, ptr %60, i32 0, i32 0
  %62 = load double, ptr %9, align 8, !tbaa !9
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = load i32, ptr %11, align 4, !tbaa !25
  %65 = load i32, ptr %12, align 4, !tbaa !25
  %66 = add nsw i32 %64, %65
  call void @_Z30computeNumericalDerivative_fitPK11SParametersPK6SCurveRKN5Eigen6MatrixIdLi2ELin1ELi0ELi2ELin1EEEdRNS6_IdLin1ELin1ELi0ELin1ELin1EEEi(ptr noundef %58, ptr noundef %59, ptr noundef nonnull align 8 dereferenceable(16) %61, double noundef %62, ptr noundef nonnull align 8 dereferenceable(24) %63, i32 noundef %66)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  ret void
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 #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, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTS6SCurve", !13, i64 0, !14, i64 4, !15, i64 8, !15, i64 24, !19, i64 40}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTSN5Eigen6MatrixIdLin1ELi1ELi0ELin1ELi1EEE", !16, i64 0}
!16 = !{!"_ZTSN5Eigen15PlainObjectBaseINS_6MatrixIdLin1ELi1ELi0ELin1ELi1EEEEE", !17, i64 0}
!17 = !{!"_ZTSN5Eigen12DenseStorageIdLin1ELin1ELi1ELi0EEE", !6, i64 0, !18, i64 8}
!18 = !{!"long", !7, i64 0}
!19 = !{!"_ZTSN5Eigen6MatrixIiLin1ELi1ELi0ELin1ELi1EEE", !20, i64 0}
!20 = !{!"_ZTSN5Eigen15PlainObjectBaseINS_6MatrixIiLin1ELi1ELi0ELin1ELi1EEEEE", !21, i64 0}
!21 = !{!"_ZTSN5Eigen12DenseStorageIiLin1ELin1ELi1ELi0EEE", !6, i64 0, !18, i64 8}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = !{!12, !14, i64 4}
!25 = !{!14, !14, i64 0}


; 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"

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z34computeNumericalDerivative_elasticPK11SParametersPK6SCurveRKN5Eigen6MatrixIdLi2ELin1ELi0ELi2ELin1EEEdRNS6_IdLin1ELin1ELi0ELin1ELin1EEEi(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16), double noundef, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z34computeNumericalDerivative_bendingPK11SParametersPK6SCurveRKN5Eigen6MatrixIdLi2ELin1ELi0ELi2ELin1EEEdRNS6_IdLin1ELin1ELi0ELin1ELin1EEEi(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16), double noundef, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z30computeNumericalDerivative_fitPK11SParametersPK6SCurveRKN5Eigen6MatrixIdLi2ELin1ELi0ELi2ELin1EEEdRNS6_IdLin1ELin1ELi0ELin1ELin1EEEi(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16), double noundef, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z26ComputeNumericalDerivativePK11SParametersPK6SCurveRK4SVardRN5Eigen6MatrixIdLin1ELin1ELi0ELin1ELin1EEE(ptr noundef %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(32) %2, double noundef %3, ptr noundef nonnull align 8 dereferenceable(24) %4) local_unnamed_addr #0 {
  %6 = load i8, ptr %1, align 8, !tbaa !5, !range !19, !noundef !20
  %7 = trunc nuw i8 %6 to i1
  %8 = getelementptr inbounds i8, ptr %1, i64 4
  %9 = load i32, ptr %8, align 4, !tbaa !21
  %10 = add nsw i32 %9, -2
  %not. = xor i1 %7, true
  %11 = sext i1 %not. to i32
  %12 = add nsw i32 %9, %11
  %13 = select i1 %7, i32 %9, i32 %10
  %14 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Eigen9DenseBaseINS_6MatrixIdLin1ELin1ELi0ELin1ELin1EEEE7setZeroEv(ptr noundef nonnull align 1 dereferenceable(1) %4)
  tail call void @_Z34computeNumericalDerivative_elasticPK11SParametersPK6SCurveRKN5Eigen6MatrixIdLi2ELin1ELi0ELi2ELin1EEEdRNS6_IdLin1ELin1ELi0ELin1ELin1EEEi(ptr noundef %0, ptr noundef nonnull %1, ptr noundef nonnull align 8 dereferenceable(16) %2, double noundef %3, ptr noundef nonnull align 8 dereferenceable(24) %4, i32 noundef 0)
  tail call void @_Z34computeNumericalDerivative_bendingPK11SParametersPK6SCurveRKN5Eigen6MatrixIdLi2ELin1ELi0ELi2ELin1EEEdRNS6_IdLin1ELin1ELi0ELin1ELin1EEEi(ptr noundef %0, ptr noundef nonnull %1, ptr noundef nonnull align 8 dereferenceable(16) %2, double noundef %3, ptr noundef nonnull align 8 dereferenceable(24) %4, i32 noundef %12)
  %15 = add nsw i32 %13, %12
  tail call void @_Z30computeNumericalDerivative_fitPK11SParametersPK6SCurveRKN5Eigen6MatrixIdLi2ELin1ELi0ELi2ELin1EEEdRNS6_IdLin1ELin1ELi0ELin1ELin1EEEi(ptr noundef %0, ptr noundef nonnull %1, ptr noundef nonnull align 8 dereferenceable(16) %2, double noundef %3, ptr noundef nonnull align 8 dereferenceable(24) %4, i32 noundef %15)
  ret void
}

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

attributes #0 = { 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 #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" }

!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}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass