; LLVM IR from opensim-org/opensim-core :: Vendors/lepton/src (ParsedExpression)

; 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.Lepton::ExpressionTreeNode" = type { ptr, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Lepton::ExpressionTreeNode, std::allocator<Lepton::ExpressionTreeNode>>::_Vector_impl" }
%"struct.std::_Vector_base<Lepton::ExpressionTreeNode, std::allocator<Lepton::ExpressionTreeNode>>::_Vector_impl" = type { %"struct.std::_Vector_base<Lepton::ExpressionTreeNode, std::allocator<Lepton::ExpressionTreeNode>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Lepton::ExpressionTreeNode, std::allocator<Lepton::ExpressionTreeNode>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNK6Lepton18ExpressionTreeNode12getOperationEv(ptr noundef nonnull align 8 dereferenceable(32)) #0

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

declare i32 @__gxx_personality_v0(...)

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

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6Lepton18ExpressionTreeNode11getChildrenEv(ptr noundef nonnull align 8 dereferenceable(32)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

declare noundef nonnull align 8 dereferenceable(32) ptr @_ZN6Lepton18ExpressionTreeNodeaSERKS0_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #0

; Function Attrs: nounwind
declare void @_ZN6Lepton18ExpressionTreeNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIN6Lepton18ExpressionTreeNodeEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Lepton16ParsedExpression13differentiateERKNS_18ExpressionTreeNodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind noalias writable sret(%"class.Lepton::ExpressionTreeNode") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %2) #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca %"class.std::allocator", align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.Lepton::ExpressionTreeNode", align 8
  store ptr %0, ptr %4, align 8
  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 24, ptr %7) #5
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6Lepton18ExpressionTreeNode11getChildrenEv(ptr noundef nonnull align 8 dereferenceable(32) %13)
  %15 = call noundef i64 @_ZNKSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #5
  call void @_ZNSaIN6Lepton18ExpressionTreeNodeEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  invoke void @_ZNSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %15, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %16 unwind label %23

16:                                               ; preds = %3
  call void @_ZNSt15__new_allocatorIN6Lepton18ExpressionTreeNodeEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %17

17:                                               ; preds = %41, %16
  %18 = load i32, ptr %11, align 4, !tbaa !9
  %19 = call noundef i64 @_ZNKSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %20 = trunc i64 %19 to i32
  %21 = icmp slt i32 %18, %20
  br i1 %21, label %27, label %22

22:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %53

23:                                               ; preds = %3
  %24 = landingpad { ptr, i32 }
          cleanup
  %25 = extractvalue { ptr, i32 } %24, 0
  store ptr %25, ptr %9, align 8
  %26 = extractvalue { ptr, i32 } %24, 1
  store i32 %26, ptr %10, align 4
  call void @_ZNSt15__new_allocatorIN6Lepton18ExpressionTreeNodeEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  br label %70

27:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #5
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6Lepton18ExpressionTreeNode11getChildrenEv(ptr noundef nonnull align 8 dereferenceable(32) %28)
          to label %30 unwind label %44

30:                                               ; preds = %27
  %31 = load i32, ptr %11, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %32) #5
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN6Lepton16ParsedExpression13differentiateERKNS_18ExpressionTreeNodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind writable sret(%"class.Lepton::ExpressionTreeNode") align 8 %12, ptr noundef nonnull align 8 dereferenceable(32) %33, ptr noundef nonnull align 8 dereferenceable(32) %34)
          to label %35 unwind label %44

35:                                               ; preds = %30
  %36 = load i32, ptr %11, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %37) #5
  %39 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6Lepton18ExpressionTreeNodeaSERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %38, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %40 unwind label %48

40:                                               ; preds = %35
  call void @_ZN6Lepton18ExpressionTreeNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #5
  br label %41

41:                                               ; preds = %40
  %42 = load i32, ptr %11, align 4, !tbaa !9
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %11, align 4, !tbaa !9
  br label %17, !llvm.loop !11

44:                                               ; preds = %30, %27
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %9, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %10, align 4
  br label %52

48:                                               ; preds = %35
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %9, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %10, align 4
  call void @_ZN6Lepton18ExpressionTreeNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  br label %52

52:                                               ; preds = %48, %44
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %69

53:                                               ; preds = %22
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK6Lepton18ExpressionTreeNode12getOperationEv(ptr noundef nonnull align 8 dereferenceable(32) %54)
          to label %56 unwind label %65

56:                                               ; preds = %53
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6Lepton18ExpressionTreeNode11getChildrenEv(ptr noundef nonnull align 8 dereferenceable(32) %57)
          to label %59 unwind label %65

59:                                               ; preds = %56
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = load ptr, ptr %55, align 8, !tbaa !13
  %62 = getelementptr inbounds ptr, ptr %61, i64 7
  %63 = load ptr, ptr %62, align 8
  invoke void %63(ptr dead_on_unwind writable sret(%"class.Lepton::ExpressionTreeNode") align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(32) %60)
          to label %64 unwind label %65

64:                                               ; preds = %59
  call void @_ZNSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  ret void

65:                                               ; preds = %59, %56, %53
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %9, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %10, align 4
  br label %69

69:                                               ; preds = %65, %52
  call void @_ZNSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  br label %70

70:                                               ; preds = %69, %23
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  br label %71

71:                                               ; preds = %70
  %72 = load ptr, ptr %9, align 8
  %73 = load i32, ptr %10, align 4
  %74 = insertvalue { ptr, i32 } poison, ptr %72, 0
  %75 = insertvalue { ptr, i32 } %74, i32 %73, 1
  resume { ptr, i32 } %75
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIN6Lepton18ExpressionTreeNodeEED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

attributes #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, 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"

%"class.Lepton::ExpressionTreeNode" = type { ptr, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Lepton::ExpressionTreeNode, std::allocator<Lepton::ExpressionTreeNode>>::_Vector_impl" }
%"struct.std::_Vector_base<Lepton::ExpressionTreeNode, std::allocator<Lepton::ExpressionTreeNode>>::_Vector_impl" = type { %"struct.std::_Vector_base<Lepton::ExpressionTreeNode, std::allocator<Lepton::ExpressionTreeNode>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Lepton::ExpressionTreeNode, std::allocator<Lepton::ExpressionTreeNode>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNK6Lepton18ExpressionTreeNode12getOperationEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0

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

declare i32 @__gxx_personality_v0(...)

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

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6Lepton18ExpressionTreeNode11getChildrenEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

declare noundef nonnull align 8 dereferenceable(32) ptr @_ZN6Lepton18ExpressionTreeNodeaSERKS0_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0

; Function Attrs: nounwind
declare void @_ZN6Lepton18ExpressionTreeNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIN6Lepton18ExpressionTreeNodeEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Lepton16ParsedExpression13differentiateERKNS_18ExpressionTreeNodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind noalias writable sret(%"class.Lepton::ExpressionTreeNode") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %2) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca %"class.Lepton::ExpressionTreeNode", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  %7 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6Lepton18ExpressionTreeNode11getChildrenEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %8 = tail call noundef i64 @_ZNKSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #5
  call void @_ZNSaIN6Lepton18ExpressionTreeNodeEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  invoke void @_ZNSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %8, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %9 unwind label %14

9:                                                ; preds = %3
  call void @_ZNSt15__new_allocatorIN6Lepton18ExpressionTreeNodeEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #5
  %10 = call noundef i64 @_ZNKSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %11 = trunc i64 %10 to i32
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %22, %9
  %13 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK6Lepton18ExpressionTreeNode12getOperationEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %31 unwind label %38

14:                                               ; preds = %3
  %15 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIN6Lepton18ExpressionTreeNodeEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #5
  br label %41

.lr.ph:                                           ; preds = %9, %22
  %indvars.iv = phi i64 [ %indvars.iv.next, %22 ], [ 0, %9 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #5
  %16 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6Lepton18ExpressionTreeNode11getChildrenEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %17 unwind label %26

17:                                               ; preds = %.lr.ph
  %18 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %indvars.iv) #5
  invoke void @_ZN6Lepton16ParsedExpression13differentiateERKNS_18ExpressionTreeNodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind nonnull writable sret(%"class.Lepton::ExpressionTreeNode") align 8 %6, ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %19 unwind label %26

19:                                               ; preds = %17
  %20 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv) #5
  %21 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6Lepton18ExpressionTreeNodeaSERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %22 unwind label %28

22:                                               ; preds = %19
  call void @_ZN6Lepton18ExpressionTreeNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %23 = call noundef i64 @_ZNKSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %sext = shl i64 %23, 32
  %24 = ashr exact i64 %sext, 32
  %25 = icmp slt i64 %indvars.iv.next, %24
  br i1 %25, label %.lr.ph, label %._crit_edge, !llvm.loop !5

26:                                               ; preds = %17, %.lr.ph
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %30

28:                                               ; preds = %19
  %29 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6Lepton18ExpressionTreeNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  br label %30

30:                                               ; preds = %28, %26
  %.pn = phi { ptr, i32 } [ %29, %28 ], [ %27, %26 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  br label %40

31:                                               ; preds = %._crit_edge
  %32 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6Lepton18ExpressionTreeNode11getChildrenEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %33 unwind label %38

33:                                               ; preds = %31
  %34 = load ptr, ptr %13, align 8, !tbaa !7
  %35 = getelementptr inbounds i8, ptr %34, i64 56
  %36 = load ptr, ptr %35, align 8
  invoke void %36(ptr dead_on_unwind writable sret(%"class.Lepton::ExpressionTreeNode") align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(24) %32, ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %37 unwind label %38

37:                                               ; preds = %33
  call void @_ZNSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  ret void

38:                                               ; preds = %33, %31, %._crit_edge
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %40

40:                                               ; preds = %38, %30
  %.pn.pn = phi { ptr, i32 } [ %.pn, %30 ], [ %39, %38 ]
  call void @_ZNSt6vectorIN6Lepton18ExpressionTreeNodeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  br label %41

41:                                               ; preds = %40, %14
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %40 ], [ %15, %14 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  resume { ptr, i32 } %.pn.pn.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIN6Lepton18ExpressionTreeNodeEED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

attributes #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"vtable pointer", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass