; LLVM IR from simbody/simbody :: SimTKmath/Optimizers/src/IpOpt (IpTNLPAdapter)

; 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.SimTKIpopt::TNLPAdapter" = type { %"class.SimTKIpopt::NLP.base", %"class.SimTKIpopt::SmartPtr.6", %"class.SimTKIpopt::SmartPtr.7", double, double, i32, i32, double, double, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %"class.SimTKIpopt::SmartPtr", %"class.SimTKIpopt::SmartPtr", %"class.SimTKIpopt::SmartPtr", %"class.SimTKIpopt::SmartPtr", %"class.SimTKIpopt::SmartPtr.5", %"class.SimTKIpopt::SmartPtr", %"class.SimTKIpopt::SmartPtr.5", %"class.SimTKIpopt::SmartPtr", %"class.SimTKIpopt::SmartPtr.5", %"class.SimTKIpopt::SmartPtr", %"class.SimTKIpopt::SmartPtr.5", %"class.SimTKIpopt::SmartPtr.5", %"class.SimTKIpopt::SmartPtr.5", %"class.SimTKIpopt::SmartPtr.8", ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, %"class.SimTKIpopt::SmartPtr.9", %"class.SimTKIpopt::SmartPtr.10", %"class.SimTKIpopt::SmartPtr.9", %"class.SimTKIpopt::SmartPtr.10", %"class.SimTKIpopt::SmartPtr.9", %"class.SimTKIpopt::SmartPtr.10", %"class.SimTKIpopt::SmartPtr.10", %"class.SimTKIpopt::SmartPtr.9", %"class.SimTKIpopt::SmartPtr.10", %"class.SimTKIpopt::SmartPtr.9", ptr, ptr, ptr }
%"class.SimTKIpopt::NLP.base" = type { %"class.SimTKIpopt::ReferencedObject.base" }
%"class.SimTKIpopt::ReferencedObject.base" = type <{ ptr, i32 }>
%"class.SimTKIpopt::SmartPtr.6" = type { ptr }
%"class.SimTKIpopt::SmartPtr.7" = type { ptr }
%"class.SimTKIpopt::SmartPtr" = type { ptr }
%"class.SimTKIpopt::SmartPtr.5" = type { ptr }
%"class.SimTKIpopt::SmartPtr.8" = type { ptr }
%"class.SimTKIpopt::SmartPtr.10" = type { ptr }
%"class.SimTKIpopt::SmartPtr.9" = type { ptr }

@_ZTIN10SimTKIpopt6MatrixE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN10SimTKIpopt10GenTMatrixE = external constant ptr

; 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: nounwind willreturn memory(read)
declare ptr @__dynamic_cast(ptr, ptr, ptr, i64) #1

declare void @_ZN10SimTKIpopt11IpBlasDcopyEiPKdiPdi(i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10SimTKIpopt11TNLPAdapter14update_local_xERKNS_6VectorE(ptr noundef nonnull align 8 dereferenceable(400), ptr noundef nonnull align 8 dereferenceable(205)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10SimTKIpopt11TNLPAdapter10Eval_jac_cERKNS_6VectorERNS_6MatrixE(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef nonnull align 8 dereferenceable(205) %1, ptr noundef nonnull align 8 dereferenceable(69) %2) unnamed_addr #3 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %14 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #4
  store i8 0, ptr %8, align 1, !tbaa !9
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = call noundef zeroext i1 @_ZN10SimTKIpopt11TNLPAdapter14update_local_xERKNS_6VectorE(ptr noundef nonnull align 8 dereferenceable(400) %14, ptr noundef nonnull align 8 dereferenceable(205) %15)
  br i1 %16, label %17, label %18

17:                                               ; preds = %3
  store i8 1, ptr %8, align 1, !tbaa !9
  br label %18

18:                                               ; preds = %17, %3
  %19 = load i8, ptr %8, align 1, !tbaa !9, !range !11, !noundef !12
  %20 = trunc i8 %19 to i1
  %21 = call noundef zeroext i1 @_ZN10SimTKIpopt11TNLPAdapter19internal_eval_jac_gEb(ptr noundef nonnull align 8 dereferenceable(400) %14, i1 noundef zeroext %20)
  br i1 %21, label %22, label %70

22:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = icmp eq ptr %23, null
  br i1 %24, label %27, label %25

25:                                               ; preds = %22
  %26 = call ptr @__dynamic_cast(ptr %23, ptr @_ZTIN10SimTKIpopt6MatrixE, ptr @_ZTIN10SimTKIpopt10GenTMatrixE, i64 0) #4
  br label %28

27:                                               ; preds = %22
  br label %28

28:                                               ; preds = %27, %25
  %29 = phi ptr [ %26, %25 ], [ null, %27 ]
  store ptr %29, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = call noundef ptr @_ZN10SimTKIpopt10GenTMatrix6ValuesEv(ptr noundef nonnull align 8 dereferenceable(89) %30)
  store ptr %31, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !13
  br label %32

32:                                               ; preds = %54, %28
  %33 = load i32, ptr %11, align 4, !tbaa !13
  %34 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %14, i32 0, i32 15
  %35 = load i32, ptr %34, align 4, !tbaa !15
  %36 = icmp slt i32 %33, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %57

38:                                               ; preds = %32
  %39 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %14, i32 0, i32 39
  %40 = load ptr, ptr %39, align 8, !tbaa !31
  %41 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %14, i32 0, i32 56
  %42 = load ptr, ptr %41, align 8, !tbaa !32
  %43 = load i32, ptr %11, align 4, !tbaa !13
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds i32, ptr %42, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !13
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds double, ptr %40, i64 %47
  %49 = load double, ptr %48, align 8, !tbaa !33
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = load i32, ptr %11, align 4, !tbaa !13
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds double, ptr %50, i64 %52
  store double %49, ptr %53, align 8, !tbaa !33
  br label %54

54:                                               ; preds = %38
  %55 = load i32, ptr %11, align 4, !tbaa !13
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %11, align 4, !tbaa !13
  br label %32, !llvm.loop !34

57:                                               ; preds = %37
  %58 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %14, i32 0, i32 5
  %59 = load i32, ptr %58, align 8, !tbaa !36
  %60 = icmp eq i32 %59, 1
  br i1 %60, label %61, label %69

61:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store double 1.000000e+00, ptr %12, align 8, !tbaa !33
  %62 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %14, i32 0, i32 20
  %63 = load i32, ptr %62, align 8, !tbaa !37
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  %65 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %14, i32 0, i32 15
  %66 = load i32, ptr %65, align 4, !tbaa !15
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds double, ptr %64, i64 %67
  call void @_ZN10SimTKIpopt11IpBlasDcopyEiPKdiPdi(i32 noundef %63, ptr noundef %12, i32 noundef 0, ptr noundef %68, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %69

69:                                               ; preds = %61, %57
  store i1 true, ptr %4, align 1
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %71

70:                                               ; preds = %18
  store i1 false, ptr %4, align 1
  store i32 1, ptr %13, align 4
  br label %71

71:                                               ; preds = %70, %69
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #4
  %72 = load i1, ptr %4, align 1
  ret i1 %72
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10SimTKIpopt11TNLPAdapter19internal_eval_jac_gEb(ptr noundef nonnull align 8 dereferenceable(400), i1 noundef zeroext) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN10SimTKIpopt10GenTMatrix6ValuesEv(ptr noundef nonnull align 8 dereferenceable(89)) #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind willreturn memory(read) }
attributes #2 = { "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 = { 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 #4 = { 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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !14, i64 92}
!16 = !{!"_ZTSN10SimTKIpopt11TNLPAdapterE", !17, i64 0, !19, i64 16, !20, i64 24, !21, i64 32, !21, i64 40, !22, i64 48, !23, i64 52, !21, i64 56, !21, i64 64, !10, i64 72, !10, i64 73, !24, i64 76, !14, i64 80, !14, i64 84, !14, i64 88, !14, i64 92, !14, i64 96, !14, i64 100, !14, i64 104, !14, i64 108, !14, i64 112, !25, i64 116, !26, i64 120, !26, i64 128, !26, i64 136, !26, i64 144, !27, i64 152, !26, i64 160, !27, i64 168, !26, i64 176, !27, i64 184, !26, i64 192, !27, i64 200, !27, i64 208, !27, i64 216, !28, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !14, i64 272, !14, i64 276, !14, i64 280, !14, i64 284, !14, i64 288, !29, i64 296, !30, i64 304, !29, i64 312, !30, i64 320, !29, i64 328, !30, i64 336, !30, i64 344, !29, i64 352, !30, i64 360, !29, i64 368, !6, i64 376, !6, i64 384, !6, i64 392}
!17 = !{!"_ZTSN10SimTKIpopt3NLPE", !18, i64 0}
!18 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !14, i64 8}
!19 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_4TNLPEEE", !6, i64 0}
!20 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_10JournalistEEE", !6, i64 0}
!21 = !{!"double", !7, i64 0}
!22 = !{!"_ZTSN10SimTKIpopt11TNLPAdapter26FixedVariableTreatmentEnumE", !7, i64 0}
!23 = !{!"_ZTSN10SimTKIpopt11TNLPAdapter18DerivativeTestEnumE", !7, i64 0}
!24 = !{!"_ZTSN10SimTKIpopt24HessianApproximationTypeE", !7, i64 0}
!25 = !{!"_ZTSN10SimTKIpopt4TNLP14IndexStyleEnumE", !7, i64 0}
!26 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11VectorSpaceEEE", !6, i64 0}
!27 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11MatrixSpaceEEE", !6, i64 0}
!28 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_14SymMatrixSpaceEEE", !6, i64 0}
!29 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEE", !6, i64 0}
!30 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEEE", !6, i64 0}
!31 = !{!16, !6, i64 256}
!32 = !{!16, !6, i64 376}
!33 = !{!21, !21, i64 0}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = !{!16, !22, i64 48}
!37 = !{!16, !14, i64 112}


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

@_ZTIN10SimTKIpopt6MatrixE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN10SimTKIpopt10GenTMatrixE = external constant ptr

; 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: mustprogress nofree nounwind willreturn memory(read)
declare ptr @__dynamic_cast(ptr, ptr, ptr, i64) local_unnamed_addr #1

declare void @_ZN10SimTKIpopt11IpBlasDcopyEiPKdiPdi(i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10SimTKIpopt11TNLPAdapter14update_local_xERKNS_6VectorE(ptr noundef nonnull align 8 dereferenceable(400), ptr noundef nonnull align 8 dereferenceable(205)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10SimTKIpopt11TNLPAdapter10Eval_jac_cERKNS_6VectorERNS_6MatrixE(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef nonnull align 8 dereferenceable(205) %1, ptr noundef nonnull align 8 dereferenceable(69) %2) unnamed_addr #3 align 2 {
  %4 = alloca double, align 8
  %5 = tail call noundef zeroext i1 @_ZN10SimTKIpopt11TNLPAdapter14update_local_xERKNS_6VectorE(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef nonnull align 8 dereferenceable(205) %1)
  %6 = tail call noundef zeroext i1 @_ZN10SimTKIpopt11TNLPAdapter19internal_eval_jac_gEb(ptr noundef nonnull align 8 dereferenceable(400) %0, i1 noundef zeroext %5)
  br i1 %6, label %7, label %57

7:                                                ; preds = %3
  %8 = tail call ptr @__dynamic_cast(ptr nonnull %2, ptr nonnull @_ZTIN10SimTKIpopt6MatrixE, ptr nonnull @_ZTIN10SimTKIpopt10GenTMatrixE, i64 0) #4
  %9 = tail call noundef ptr @_ZN10SimTKIpopt10GenTMatrix6ValuesEv(ptr noundef nonnull align 8 dereferenceable(89) %8)
  %10 = getelementptr inbounds i8, ptr %0, i64 92
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %7
  %13 = getelementptr inbounds i8, ptr %0, i64 256
  %14 = load ptr, ptr %13, align 8, !tbaa !26
  %15 = getelementptr inbounds i8, ptr %0, i64 376
  %16 = load ptr, ptr %15, align 8, !tbaa !27
  %wide.trip.count = zext nneg i32 %11 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %17 = icmp ult i32 %11, 4
  br i1 %17, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %27

._crit_edge.loopexit.unr-lcssa:                   ; preds = %27, %.lr.ph
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next.3, %27 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %18 = getelementptr inbounds i32, ptr %16, i64 %indvars.iv.epil
  %19 = load i32, ptr %18, align 4, !tbaa !28
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds double, ptr %14, i64 %20
  %22 = load double, ptr %21, align 8, !tbaa !29
  %23 = getelementptr inbounds double, ptr %9, i64 %indvars.iv.epil
  store double %22, ptr %23, align 8, !tbaa !29
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.epil.preheader, !llvm.loop !30

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader, %7
  %24 = getelementptr inbounds i8, ptr %0, i64 48
  %25 = load i32, ptr %24, align 8, !tbaa !32
  %26 = icmp eq i32 %25, 1
  br i1 %26, label %52, label %57

27:                                               ; preds = %27, %.lr.ph.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.new ], [ %indvars.iv.next.3, %27 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.3, %27 ]
  %28 = getelementptr inbounds i32, ptr %16, i64 %indvars.iv
  %29 = load i32, ptr %28, align 4, !tbaa !28
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds double, ptr %14, i64 %30
  %32 = load double, ptr %31, align 8, !tbaa !29
  %33 = getelementptr inbounds double, ptr %9, i64 %indvars.iv
  store double %32, ptr %33, align 8, !tbaa !29
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %34 = getelementptr inbounds i32, ptr %16, i64 %indvars.iv.next
  %35 = load i32, ptr %34, align 4, !tbaa !28
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds double, ptr %14, i64 %36
  %38 = load double, ptr %37, align 8, !tbaa !29
  %39 = getelementptr inbounds double, ptr %9, i64 %indvars.iv.next
  store double %38, ptr %39, align 8, !tbaa !29
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %40 = getelementptr inbounds i32, ptr %16, i64 %indvars.iv.next.1
  %41 = load i32, ptr %40, align 4, !tbaa !28
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds double, ptr %14, i64 %42
  %44 = load double, ptr %43, align 8, !tbaa !29
  %45 = getelementptr inbounds double, ptr %9, i64 %indvars.iv.next.1
  store double %44, ptr %45, align 8, !tbaa !29
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %46 = getelementptr inbounds i32, ptr %16, i64 %indvars.iv.next.2
  %47 = load i32, ptr %46, align 4, !tbaa !28
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds double, ptr %14, i64 %48
  %50 = load double, ptr %49, align 8, !tbaa !29
  %51 = getelementptr inbounds double, ptr %9, i64 %indvars.iv.next.2
  store double %50, ptr %51, align 8, !tbaa !29
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %27, !llvm.loop !33

52:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  store double 1.000000e+00, ptr %4, align 8, !tbaa !29
  %53 = getelementptr inbounds i8, ptr %0, i64 112
  %54 = load i32, ptr %53, align 8, !tbaa !35
  %55 = sext i32 %11 to i64
  %56 = getelementptr inbounds double, ptr %9, i64 %55
  call void @_ZN10SimTKIpopt11IpBlasDcopyEiPKdiPdi(i32 noundef %54, ptr noundef nonnull %4, i32 noundef 0, ptr noundef %56, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  br label %57

57:                                               ; preds = %3, %._crit_edge, %52
  ret i1 %6
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10SimTKIpopt11TNLPAdapter19internal_eval_jac_gEb(ptr noundef nonnull align 8 dereferenceable(400), i1 noundef zeroext) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN10SimTKIpopt10GenTMatrix6ValuesEv(ptr noundef nonnull align 8 dereferenceable(89)) local_unnamed_addr #3 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn memory(read) }
attributes #2 = { "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 = { 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 #4 = { 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, !9, i64 92}
!6 = !{!"_ZTSN10SimTKIpopt11TNLPAdapterE", !7, i64 0, !12, i64 16, !14, i64 24, !15, i64 32, !15, i64 40, !16, i64 48, !17, i64 52, !15, i64 56, !15, i64 64, !18, i64 72, !18, i64 73, !19, i64 76, !9, i64 80, !9, i64 84, !9, i64 88, !9, i64 92, !9, i64 96, !9, i64 100, !9, i64 104, !9, i64 108, !9, i64 112, !20, i64 116, !21, i64 120, !21, i64 128, !21, i64 136, !21, i64 144, !22, i64 152, !21, i64 160, !22, i64 168, !21, i64 176, !22, i64 184, !21, i64 192, !22, i64 200, !22, i64 208, !22, i64 216, !23, i64 224, !13, i64 232, !13, i64 240, !13, i64 248, !13, i64 256, !13, i64 264, !9, i64 272, !9, i64 276, !9, i64 280, !9, i64 284, !9, i64 288, !24, i64 296, !25, i64 304, !24, i64 312, !25, i64 320, !24, i64 328, !25, i64 336, !25, i64 344, !24, i64 352, !25, i64 360, !24, i64 368, !13, i64 376, !13, i64 384, !13, i64 392}
!7 = !{!"_ZTSN10SimTKIpopt3NLPE", !8, i64 0}
!8 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !9, i64 8}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_4TNLPEEE", !13, i64 0}
!13 = !{!"any pointer", !10, i64 0}
!14 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_10JournalistEEE", !13, i64 0}
!15 = !{!"double", !10, i64 0}
!16 = !{!"_ZTSN10SimTKIpopt11TNLPAdapter26FixedVariableTreatmentEnumE", !10, i64 0}
!17 = !{!"_ZTSN10SimTKIpopt11TNLPAdapter18DerivativeTestEnumE", !10, i64 0}
!18 = !{!"bool", !10, i64 0}
!19 = !{!"_ZTSN10SimTKIpopt24HessianApproximationTypeE", !10, i64 0}
!20 = !{!"_ZTSN10SimTKIpopt4TNLP14IndexStyleEnumE", !10, i64 0}
!21 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11VectorSpaceEEE", !13, i64 0}
!22 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11MatrixSpaceEEE", !13, i64 0}
!23 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_14SymMatrixSpaceEEE", !13, i64 0}
!24 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEE", !13, i64 0}
!25 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEEE", !13, i64 0}
!26 = !{!6, !13, i64 256}
!27 = !{!6, !13, i64 376}
!28 = !{!9, !9, i64 0}
!29 = !{!15, !15, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.unroll.disable"}
!32 = !{!6, !16, i64 48}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!6, !9, i64 112}


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