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

; 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::StdInterfaceTNLP" = type { %"class.SimTKIpopt::TNLP.base", %"class.SimTKIpopt::SmartPtr", i32, i32, ptr, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%"class.SimTKIpopt::TNLP.base" = type { %"class.SimTKIpopt::ReferencedObject.base" }
%"class.SimTKIpopt::ReferencedObject.base" = type <{ ptr, i32 }>
%"class.SimTKIpopt::SmartPtr" = type { 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: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_ZN10SimTKIpopt16StdInterfaceTNLP18get_starting_pointEibPdbS1_S1_ibS1_(ptr noundef nonnull align 8 dereferenceable(216) %0, i32 noundef %1, i1 noundef zeroext %2, ptr noundef %3, i1 noundef zeroext %4, ptr noundef %5, ptr noundef %6, i32 noundef %7, i1 noundef zeroext %8, ptr noundef %9) unnamed_addr #1 align 2 {
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i8, align 1
  %14 = alloca ptr, align 8
  %15 = alloca i8, align 1
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i8, align 1
  %20 = alloca ptr, align 8
  %21 = alloca i8, align 1
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  store ptr %0, ptr %11, align 8, !tbaa !5
  store i32 %1, ptr %12, align 4, !tbaa !9
  %26 = zext i1 %2 to i8
  store i8 %26, ptr %13, align 1, !tbaa !11
  store ptr %3, ptr %14, align 8, !tbaa !5
  %27 = zext i1 %4 to i8
  store i8 %27, ptr %15, align 1, !tbaa !11
  store ptr %5, ptr %16, align 8, !tbaa !5
  store ptr %6, ptr %17, align 8, !tbaa !5
  store i32 %7, ptr %18, align 4, !tbaa !9
  %28 = zext i1 %8 to i8
  store i8 %28, ptr %19, align 1, !tbaa !11
  store ptr %9, ptr %20, align 8, !tbaa !5
  %29 = load ptr, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #2
  store i8 1, ptr %21, align 1, !tbaa !11
  %30 = load i8, ptr %13, align 1, !tbaa !11, !range !13, !noundef !14
  %31 = trunc i8 %30 to i1
  br i1 %31, label %32, label %53

32:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #2
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %49, %32
  %34 = load i32, ptr %22, align 4, !tbaa !9
  %35 = load i32, ptr %12, align 4, !tbaa !9
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #2
  br label %52

38:                                               ; preds = %33
  %39 = getelementptr inbounds %"class.SimTKIpopt::StdInterfaceTNLP", ptr %29, i32 0, i32 11
  %40 = load ptr, ptr %39, align 8, !tbaa !15
  %41 = load i32, ptr %22, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds double, ptr %40, i64 %42
  %44 = load double, ptr %43, align 8, !tbaa !20
  %45 = load ptr, ptr %14, align 8, !tbaa !5
  %46 = load i32, ptr %22, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds double, ptr %45, i64 %47
  store double %44, ptr %48, align 8, !tbaa !20
  br label %49

49:                                               ; preds = %38
  %50 = load i32, ptr %22, align 4, !tbaa !9
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %22, align 4, !tbaa !9
  br label %33, !llvm.loop !22

52:                                               ; preds = %37
  br label %53

53:                                               ; preds = %52, %10
  %54 = load i8, ptr %15, align 1, !tbaa !11, !range !13, !noundef !14
  %55 = trunc i8 %54 to i1
  br i1 %55, label %56, label %109

56:                                               ; preds = %53
  %57 = getelementptr inbounds %"class.SimTKIpopt::StdInterfaceTNLP", ptr %29, i32 0, i32 13
  %58 = load ptr, ptr %57, align 8, !tbaa !24
  %59 = icmp eq ptr %58, null
  br i1 %59, label %60, label %61

60:                                               ; preds = %56
  store i8 0, ptr %21, align 1, !tbaa !11
  br label %82

61:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #2
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %62

62:                                               ; preds = %78, %61
  %63 = load i32, ptr %23, align 4, !tbaa !9
  %64 = load i32, ptr %12, align 4, !tbaa !9
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #2
  br label %81

67:                                               ; preds = %62
  %68 = getelementptr inbounds %"class.SimTKIpopt::StdInterfaceTNLP", ptr %29, i32 0, i32 13
  %69 = load ptr, ptr %68, align 8, !tbaa !24
  %70 = load i32, ptr %23, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds double, ptr %69, i64 %71
  %73 = load double, ptr %72, align 8, !tbaa !20
  %74 = load ptr, ptr %16, align 8, !tbaa !5
  %75 = load i32, ptr %23, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds double, ptr %74, i64 %76
  store double %73, ptr %77, align 8, !tbaa !20
  br label %78

78:                                               ; preds = %67
  %79 = load i32, ptr %23, align 4, !tbaa !9
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %23, align 4, !tbaa !9
  br label %62, !llvm.loop !25

81:                                               ; preds = %66
  br label %82

82:                                               ; preds = %81, %60
  %83 = getelementptr inbounds %"class.SimTKIpopt::StdInterfaceTNLP", ptr %29, i32 0, i32 14
  %84 = load ptr, ptr %83, align 8, !tbaa !26
  %85 = icmp eq ptr %84, null
  br i1 %85, label %86, label %87

86:                                               ; preds = %82
  store i8 0, ptr %21, align 1, !tbaa !11
  br label %108

87:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #2
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %104, %87
  %89 = load i32, ptr %24, align 4, !tbaa !9
  %90 = load i32, ptr %12, align 4, !tbaa !9
  %91 = icmp slt i32 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #2
  br label %107

93:                                               ; preds = %88
  %94 = getelementptr inbounds %"class.SimTKIpopt::StdInterfaceTNLP", ptr %29, i32 0, i32 14
  %95 = load ptr, ptr %94, align 8, !tbaa !26
  %96 = load i32, ptr %24, align 4, !tbaa !9
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds double, ptr %95, i64 %97
  %99 = load double, ptr %98, align 8, !tbaa !20
  %100 = load ptr, ptr %17, align 8, !tbaa !5
  %101 = load i32, ptr %24, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds double, ptr %100, i64 %102
  store double %99, ptr %103, align 8, !tbaa !20
  br label %104

104:                                              ; preds = %93
  %105 = load i32, ptr %24, align 4, !tbaa !9
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %24, align 4, !tbaa !9
  br label %88, !llvm.loop !27

107:                                              ; preds = %92
  br label %108

108:                                              ; preds = %107, %86
  br label %109

109:                                              ; preds = %108, %53
  %110 = load i8, ptr %19, align 1, !tbaa !11, !range !13, !noundef !14
  %111 = trunc i8 %110 to i1
  br i1 %111, label %112, label %139

112:                                              ; preds = %109
  %113 = getelementptr inbounds %"class.SimTKIpopt::StdInterfaceTNLP", ptr %29, i32 0, i32 12
  %114 = load ptr, ptr %113, align 8, !tbaa !28
  %115 = icmp eq ptr %114, null
  br i1 %115, label %116, label %117

116:                                              ; preds = %112
  store i8 0, ptr %21, align 1, !tbaa !11
  br label %138

117:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #2
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %118

118:                                              ; preds = %134, %117
  %119 = load i32, ptr %25, align 4, !tbaa !9
  %120 = load i32, ptr %18, align 4, !tbaa !9
  %121 = icmp slt i32 %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #2
  br label %137

123:                                              ; preds = %118
  %124 = getelementptr inbounds %"class.SimTKIpopt::StdInterfaceTNLP", ptr %29, i32 0, i32 12
  %125 = load ptr, ptr %124, align 8, !tbaa !28
  %126 = load i32, ptr %25, align 4, !tbaa !9
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds double, ptr %125, i64 %127
  %129 = load double, ptr %128, align 8, !tbaa !20
  %130 = load ptr, ptr %20, align 8, !tbaa !5
  %131 = load i32, ptr %25, align 4, !tbaa !9
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds double, ptr %130, i64 %132
  store double %129, ptr %133, align 8, !tbaa !20
  br label %134

134:                                              ; preds = %123
  %135 = load i32, ptr %25, align 4, !tbaa !9
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %25, align 4, !tbaa !9
  br label %118, !llvm.loop !29

137:                                              ; preds = %122
  br label %138

138:                                              ; preds = %137, %116
  br label %139

139:                                              ; preds = %138, %109
  %140 = load i8, ptr %21, align 1, !tbaa !11, !range !13, !noundef !14
  %141 = trunc i8 %140 to i1
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #2
  ret i1 %141
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !6, i64 80}
!16 = !{!"_ZTSN10SimTKIpopt16StdInterfaceTNLPE", !17, i64 0, !19, i64 16, !10, i64 24, !10, i64 28, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !10, i64 64, !10, i64 68, !10, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208}
!17 = !{!"_ZTSN10SimTKIpopt4TNLPE", !18, i64 0}
!18 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !10, i64 8}
!19 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_10JournalistEEE", !6, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"double", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!16, !6, i64 96}
!25 = distinct !{!25, !23}
!26 = !{!16, !6, i64 104}
!27 = distinct !{!27, !23}
!28 = !{!16, !6, i64 88}
!29 = distinct !{!29, !23}


; 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 nofree norecurse nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local noundef zeroext i1 @_ZN10SimTKIpopt16StdInterfaceTNLP18get_starting_pointEibPdbS1_S1_ibS1_(ptr nocapture noundef nonnull readonly align 8 dereferenceable(216) %0, i32 noundef %1, i1 noundef zeroext %2, ptr nocapture noundef writeonly %3, i1 noundef zeroext %4, ptr nocapture noundef writeonly %5, ptr nocapture noundef writeonly %6, i32 noundef %7, i1 noundef zeroext %8, ptr nocapture noundef writeonly %9) unnamed_addr #0 align 2 {
  %11 = ptrtoint ptr %9 to i64
  %12 = ptrtoint ptr %6 to i64
  %13 = ptrtoint ptr %5 to i64
  %14 = icmp sgt i32 %1, 0
  %or.cond = and i1 %14, %2
  br i1 %or.cond, label %.lr.ph, label %.loopexit37

.lr.ph:                                           ; preds = %10
  %15 = ptrtoint ptr %3 to i64
  %16 = getelementptr inbounds i8, ptr %0, i64 80
  %17 = load ptr, ptr %16, align 8, !tbaa !5
  %wide.trip.count = zext nneg i32 %1 to i64
  %min.iters.check = icmp ult i32 %1, 6
  %18 = ptrtoint ptr %17 to i64
  %19 = sub i64 %15, %18
  %diff.check = icmp ult i64 %19, 32
  %or.cond109 = select i1 %min.iters.check, i1 true, i1 %diff.check
  br i1 %or.cond109, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %wide.trip.count, 2147483644
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %20 = getelementptr inbounds double, ptr %17, i64 %index
  %21 = getelementptr inbounds i8, ptr %20, i64 16
  %wide.load = load <2 x double>, ptr %20, align 8, !tbaa !14
  %wide.load62 = load <2 x double>, ptr %21, align 8, !tbaa !14
  %22 = getelementptr inbounds double, ptr %3, i64 %index
  %23 = getelementptr inbounds i8, ptr %22, i64 16
  store <2 x double> %wide.load, ptr %22, align 8, !tbaa !14
  store <2 x double> %wide.load62, ptr %23, align 8, !tbaa !14
  %index.next = add nuw i64 %index, 4
  %24 = icmp eq i64 %index.next, %n.vec
  br i1 %24, label %middle.block, label %vector.body, !llvm.loop !16

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.loopexit37, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %scalar.ph.prol ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %25 = getelementptr inbounds double, ptr %17, i64 %indvars.iv.prol
  %26 = load double, ptr %25, align 8, !tbaa !14
  %27 = getelementptr inbounds double, ptr %3, i64 %indvars.iv.prol
  store double %26, ptr %27, align 8, !tbaa !14
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !20

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %28 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %29 = icmp ugt i64 %28, -4
  br i1 %29, label %.loopexit37, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %30 = getelementptr inbounds double, ptr %17, i64 %indvars.iv
  %31 = load double, ptr %30, align 8, !tbaa !14
  %32 = getelementptr inbounds double, ptr %3, i64 %indvars.iv
  store double %31, ptr %32, align 8, !tbaa !14
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %33 = getelementptr inbounds double, ptr %17, i64 %indvars.iv.next
  %34 = load double, ptr %33, align 8, !tbaa !14
  %35 = getelementptr inbounds double, ptr %3, i64 %indvars.iv.next
  store double %34, ptr %35, align 8, !tbaa !14
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %36 = getelementptr inbounds double, ptr %17, i64 %indvars.iv.next.1
  %37 = load double, ptr %36, align 8, !tbaa !14
  %38 = getelementptr inbounds double, ptr %3, i64 %indvars.iv.next.1
  store double %37, ptr %38, align 8, !tbaa !14
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %39 = getelementptr inbounds double, ptr %17, i64 %indvars.iv.next.2
  %40 = load double, ptr %39, align 8, !tbaa !14
  %41 = getelementptr inbounds double, ptr %3, i64 %indvars.iv.next.2
  store double %40, ptr %41, align 8, !tbaa !14
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %.loopexit37, label %scalar.ph, !llvm.loop !22

.loopexit37:                                      ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %10
  br i1 %4, label %42, label %.loopexit33

42:                                               ; preds = %.loopexit37
  %43 = getelementptr inbounds i8, ptr %0, i64 96
  %44 = load ptr, ptr %43, align 8, !tbaa !23
  %45 = ptrtoint ptr %44 to i64
  %46 = icmp ne ptr %44, null
  br i1 %46, label %.preheader34, label %.loopexit35

.preheader34:                                     ; preds = %42
  br i1 %14, label %.lr.ph40.preheader, label %.loopexit35.thread

.lr.ph40.preheader:                               ; preds = %.preheader34
  %wide.trip.count49 = zext nneg i32 %1 to i64
  %min.iters.check67 = icmp ult i32 %1, 6
  %47 = sub i64 %13, %45
  %diff.check64 = icmp ult i64 %47, 32
  %or.cond110 = or i1 %min.iters.check67, %diff.check64
  br i1 %or.cond110, label %.lr.ph40.preheader115, label %vector.ph68

vector.ph68:                                      ; preds = %.lr.ph40.preheader
  %n.vec70 = and i64 %wide.trip.count49, 2147483644
  br label %vector.body72

vector.body72:                                    ; preds = %vector.body72, %vector.ph68
  %index73 = phi i64 [ 0, %vector.ph68 ], [ %index.next76, %vector.body72 ]
  %48 = getelementptr inbounds double, ptr %44, i64 %index73
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  %wide.load74 = load <2 x double>, ptr %48, align 8, !tbaa !14
  %wide.load75 = load <2 x double>, ptr %49, align 8, !tbaa !14
  %50 = getelementptr inbounds double, ptr %5, i64 %index73
  %51 = getelementptr inbounds i8, ptr %50, i64 16
  store <2 x double> %wide.load74, ptr %50, align 8, !tbaa !14
  store <2 x double> %wide.load75, ptr %51, align 8, !tbaa !14
  %index.next76 = add nuw i64 %index73, 4
  %52 = icmp eq i64 %index.next76, %n.vec70
  br i1 %52, label %middle.block65, label %vector.body72, !llvm.loop !24

middle.block65:                                   ; preds = %vector.body72
  %cmp.n77 = icmp eq i64 %n.vec70, %wide.trip.count49
  br i1 %cmp.n77, label %.loopexit35, label %.lr.ph40.preheader115

.lr.ph40.preheader115:                            ; preds = %middle.block65, %.lr.ph40.preheader
  %indvars.iv46.ph = phi i64 [ 0, %.lr.ph40.preheader ], [ %n.vec70, %middle.block65 ]
  %xtraiter116 = and i64 %wide.trip.count49, 3
  %lcmp.mod117.not = icmp eq i64 %xtraiter116, 0
  br i1 %lcmp.mod117.not, label %.lr.ph40.prol.loopexit, label %.lr.ph40.prol

.lr.ph40.prol:                                    ; preds = %.lr.ph40.preheader115, %.lr.ph40.prol
  %indvars.iv46.prol = phi i64 [ %indvars.iv.next47.prol, %.lr.ph40.prol ], [ %indvars.iv46.ph, %.lr.ph40.preheader115 ]
  %prol.iter118 = phi i64 [ %prol.iter118.next, %.lr.ph40.prol ], [ 0, %.lr.ph40.preheader115 ]
  %53 = getelementptr inbounds double, ptr %44, i64 %indvars.iv46.prol
  %54 = load double, ptr %53, align 8, !tbaa !14
  %55 = getelementptr inbounds double, ptr %5, i64 %indvars.iv46.prol
  store double %54, ptr %55, align 8, !tbaa !14
  %indvars.iv.next47.prol = add nuw nsw i64 %indvars.iv46.prol, 1
  %prol.iter118.next = add i64 %prol.iter118, 1
  %prol.iter118.cmp.not = icmp eq i64 %prol.iter118.next, %xtraiter116
  br i1 %prol.iter118.cmp.not, label %.lr.ph40.prol.loopexit, label %.lr.ph40.prol, !llvm.loop !25

.lr.ph40.prol.loopexit:                           ; preds = %.lr.ph40.prol, %.lr.ph40.preheader115
  %indvars.iv46.unr = phi i64 [ %indvars.iv46.ph, %.lr.ph40.preheader115 ], [ %indvars.iv.next47.prol, %.lr.ph40.prol ]
  %56 = sub nsw i64 %indvars.iv46.ph, %wide.trip.count49
  %57 = icmp ugt i64 %56, -4
  br i1 %57, label %.loopexit35, label %.lr.ph40

.lr.ph40:                                         ; preds = %.lr.ph40.prol.loopexit, %.lr.ph40
  %indvars.iv46 = phi i64 [ %indvars.iv.next47.3, %.lr.ph40 ], [ %indvars.iv46.unr, %.lr.ph40.prol.loopexit ]
  %58 = getelementptr inbounds double, ptr %44, i64 %indvars.iv46
  %59 = load double, ptr %58, align 8, !tbaa !14
  %60 = getelementptr inbounds double, ptr %5, i64 %indvars.iv46
  store double %59, ptr %60, align 8, !tbaa !14
  %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
  %61 = getelementptr inbounds double, ptr %44, i64 %indvars.iv.next47
  %62 = load double, ptr %61, align 8, !tbaa !14
  %63 = getelementptr inbounds double, ptr %5, i64 %indvars.iv.next47
  store double %62, ptr %63, align 8, !tbaa !14
  %indvars.iv.next47.1 = add nuw nsw i64 %indvars.iv46, 2
  %64 = getelementptr inbounds double, ptr %44, i64 %indvars.iv.next47.1
  %65 = load double, ptr %64, align 8, !tbaa !14
  %66 = getelementptr inbounds double, ptr %5, i64 %indvars.iv.next47.1
  store double %65, ptr %66, align 8, !tbaa !14
  %indvars.iv.next47.2 = add nuw nsw i64 %indvars.iv46, 3
  %67 = getelementptr inbounds double, ptr %44, i64 %indvars.iv.next47.2
  %68 = load double, ptr %67, align 8, !tbaa !14
  %69 = getelementptr inbounds double, ptr %5, i64 %indvars.iv.next47.2
  store double %68, ptr %69, align 8, !tbaa !14
  %indvars.iv.next47.3 = add nuw nsw i64 %indvars.iv46, 4
  %exitcond50.not.3 = icmp eq i64 %indvars.iv.next47.3, %wide.trip.count49
  br i1 %exitcond50.not.3, label %.loopexit35, label %.lr.ph40, !llvm.loop !26

.loopexit35:                                      ; preds = %.lr.ph40.prol.loopexit, %.lr.ph40, %middle.block65, %42
  %70 = getelementptr inbounds i8, ptr %0, i64 104
  %71 = load ptr, ptr %70, align 8, !tbaa !27
  %72 = icmp ne ptr %71, null
  %brmerge.not = and i1 %72, %14
  %.mux = and i1 %72, %46
  br i1 %brmerge.not, label %.lr.ph42.preheader, label %.loopexit33

.loopexit35.thread:                               ; preds = %.preheader34
  %73 = getelementptr inbounds i8, ptr %0, i64 104
  %74 = load ptr, ptr %73, align 8, !tbaa !27
  %75 = icmp ne ptr %74, null
  br label %.loopexit33

.lr.ph42.preheader:                               ; preds = %.loopexit35
  %76 = ptrtoint ptr %71 to i64
  %wide.trip.count54 = zext nneg i32 %1 to i64
  %min.iters.check82 = icmp ult i32 %1, 6
  %77 = sub i64 %12, %76
  %diff.check79 = icmp ult i64 %77, 32
  %or.cond111 = or i1 %min.iters.check82, %diff.check79
  br i1 %or.cond111, label %.lr.ph42.preheader114, label %vector.ph83

vector.ph83:                                      ; preds = %.lr.ph42.preheader
  %n.vec85 = and i64 %wide.trip.count54, 2147483644
  br label %vector.body87

vector.body87:                                    ; preds = %vector.body87, %vector.ph83
  %index88 = phi i64 [ 0, %vector.ph83 ], [ %index.next91, %vector.body87 ]
  %78 = getelementptr inbounds double, ptr %71, i64 %index88
  %79 = getelementptr inbounds i8, ptr %78, i64 16
  %wide.load89 = load <2 x double>, ptr %78, align 8, !tbaa !14
  %wide.load90 = load <2 x double>, ptr %79, align 8, !tbaa !14
  %80 = getelementptr inbounds double, ptr %6, i64 %index88
  %81 = getelementptr inbounds i8, ptr %80, i64 16
  store <2 x double> %wide.load89, ptr %80, align 8, !tbaa !14
  store <2 x double> %wide.load90, ptr %81, align 8, !tbaa !14
  %index.next91 = add nuw i64 %index88, 4
  %82 = icmp eq i64 %index.next91, %n.vec85
  br i1 %82, label %middle.block80, label %vector.body87, !llvm.loop !28

middle.block80:                                   ; preds = %vector.body87
  %cmp.n92 = icmp eq i64 %n.vec85, %wide.trip.count54
  br i1 %cmp.n92, label %.loopexit33, label %.lr.ph42.preheader114

.lr.ph42.preheader114:                            ; preds = %middle.block80, %.lr.ph42.preheader
  %indvars.iv51.ph = phi i64 [ 0, %.lr.ph42.preheader ], [ %n.vec85, %middle.block80 ]
  %xtraiter119 = and i64 %wide.trip.count54, 3
  %lcmp.mod120.not = icmp eq i64 %xtraiter119, 0
  br i1 %lcmp.mod120.not, label %.lr.ph42.prol.loopexit, label %.lr.ph42.prol

.lr.ph42.prol:                                    ; preds = %.lr.ph42.preheader114, %.lr.ph42.prol
  %indvars.iv51.prol = phi i64 [ %indvars.iv.next52.prol, %.lr.ph42.prol ], [ %indvars.iv51.ph, %.lr.ph42.preheader114 ]
  %prol.iter121 = phi i64 [ %prol.iter121.next, %.lr.ph42.prol ], [ 0, %.lr.ph42.preheader114 ]
  %83 = getelementptr inbounds double, ptr %71, i64 %indvars.iv51.prol
  %84 = load double, ptr %83, align 8, !tbaa !14
  %85 = getelementptr inbounds double, ptr %6, i64 %indvars.iv51.prol
  store double %84, ptr %85, align 8, !tbaa !14
  %indvars.iv.next52.prol = add nuw nsw i64 %indvars.iv51.prol, 1
  %prol.iter121.next = add i64 %prol.iter121, 1
  %prol.iter121.cmp.not = icmp eq i64 %prol.iter121.next, %xtraiter119
  br i1 %prol.iter121.cmp.not, label %.lr.ph42.prol.loopexit, label %.lr.ph42.prol, !llvm.loop !29

.lr.ph42.prol.loopexit:                           ; preds = %.lr.ph42.prol, %.lr.ph42.preheader114
  %indvars.iv51.unr = phi i64 [ %indvars.iv51.ph, %.lr.ph42.preheader114 ], [ %indvars.iv.next52.prol, %.lr.ph42.prol ]
  %86 = sub nsw i64 %indvars.iv51.ph, %wide.trip.count54
  %87 = icmp ugt i64 %86, -4
  br i1 %87, label %.loopexit33, label %.lr.ph42

.lr.ph42:                                         ; preds = %.lr.ph42.prol.loopexit, %.lr.ph42
  %indvars.iv51 = phi i64 [ %indvars.iv.next52.3, %.lr.ph42 ], [ %indvars.iv51.unr, %.lr.ph42.prol.loopexit ]
  %88 = getelementptr inbounds double, ptr %71, i64 %indvars.iv51
  %89 = load double, ptr %88, align 8, !tbaa !14
  %90 = getelementptr inbounds double, ptr %6, i64 %indvars.iv51
  store double %89, ptr %90, align 8, !tbaa !14
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
  %91 = getelementptr inbounds double, ptr %71, i64 %indvars.iv.next52
  %92 = load double, ptr %91, align 8, !tbaa !14
  %93 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.next52
  store double %92, ptr %93, align 8, !tbaa !14
  %indvars.iv.next52.1 = add nuw nsw i64 %indvars.iv51, 2
  %94 = getelementptr inbounds double, ptr %71, i64 %indvars.iv.next52.1
  %95 = load double, ptr %94, align 8, !tbaa !14
  %96 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.next52.1
  store double %95, ptr %96, align 8, !tbaa !14
  %indvars.iv.next52.2 = add nuw nsw i64 %indvars.iv51, 3
  %97 = getelementptr inbounds double, ptr %71, i64 %indvars.iv.next52.2
  %98 = load double, ptr %97, align 8, !tbaa !14
  %99 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.next52.2
  store double %98, ptr %99, align 8, !tbaa !14
  %indvars.iv.next52.3 = add nuw nsw i64 %indvars.iv51, 4
  %exitcond55.not.3 = icmp eq i64 %indvars.iv.next52.3, %wide.trip.count54
  br i1 %exitcond55.not.3, label %.loopexit33, label %.lr.ph42, !llvm.loop !30

.loopexit33:                                      ; preds = %.lr.ph42.prol.loopexit, %.lr.ph42, %middle.block80, %.loopexit35.thread, %.loopexit35, %.loopexit37
  %.1 = phi i1 [ true, %.loopexit37 ], [ %.mux, %.loopexit35 ], [ %75, %.loopexit35.thread ], [ %46, %middle.block80 ], [ %46, %.lr.ph42 ], [ %46, %.lr.ph42.prol.loopexit ]
  br i1 %8, label %100, label %.loopexit

100:                                              ; preds = %.loopexit33
  %101 = getelementptr inbounds i8, ptr %0, i64 88
  %102 = load ptr, ptr %101, align 8, !tbaa !31
  %103 = ptrtoint ptr %102 to i64
  %104 = icmp eq ptr %102, null
  br i1 %104, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %100
  %105 = icmp sgt i32 %7, 0
  br i1 %105, label %.lr.ph44.preheader, label %.loopexit

.lr.ph44.preheader:                               ; preds = %.preheader
  %wide.trip.count59 = zext nneg i32 %7 to i64
  %min.iters.check97 = icmp ult i32 %7, 6
  %106 = sub i64 %11, %103
  %diff.check94 = icmp ult i64 %106, 32
  %or.cond112 = or i1 %min.iters.check97, %diff.check94
  br i1 %or.cond112, label %.lr.ph44.preheader113, label %vector.ph98

vector.ph98:                                      ; preds = %.lr.ph44.preheader
  %n.vec100 = and i64 %wide.trip.count59, 2147483644
  br label %vector.body102

vector.body102:                                   ; preds = %vector.body102, %vector.ph98
  %index103 = phi i64 [ 0, %vector.ph98 ], [ %index.next106, %vector.body102 ]
  %107 = getelementptr inbounds double, ptr %102, i64 %index103
  %108 = getelementptr inbounds i8, ptr %107, i64 16
  %wide.load104 = load <2 x double>, ptr %107, align 8, !tbaa !14
  %wide.load105 = load <2 x double>, ptr %108, align 8, !tbaa !14
  %109 = getelementptr inbounds double, ptr %9, i64 %index103
  %110 = getelementptr inbounds i8, ptr %109, i64 16
  store <2 x double> %wide.load104, ptr %109, align 8, !tbaa !14
  store <2 x double> %wide.load105, ptr %110, align 8, !tbaa !14
  %index.next106 = add nuw i64 %index103, 4
  %111 = icmp eq i64 %index.next106, %n.vec100
  br i1 %111, label %middle.block95, label %vector.body102, !llvm.loop !32

middle.block95:                                   ; preds = %vector.body102
  %cmp.n107 = icmp eq i64 %n.vec100, %wide.trip.count59
  br i1 %cmp.n107, label %.loopexit, label %.lr.ph44.preheader113

.lr.ph44.preheader113:                            ; preds = %middle.block95, %.lr.ph44.preheader
  %indvars.iv56.ph = phi i64 [ 0, %.lr.ph44.preheader ], [ %n.vec100, %middle.block95 ]
  %xtraiter122 = and i64 %wide.trip.count59, 3
  %lcmp.mod123.not = icmp eq i64 %xtraiter122, 0
  br i1 %lcmp.mod123.not, label %.lr.ph44.prol.loopexit, label %.lr.ph44.prol

.lr.ph44.prol:                                    ; preds = %.lr.ph44.preheader113, %.lr.ph44.prol
  %indvars.iv56.prol = phi i64 [ %indvars.iv.next57.prol, %.lr.ph44.prol ], [ %indvars.iv56.ph, %.lr.ph44.preheader113 ]
  %prol.iter124 = phi i64 [ %prol.iter124.next, %.lr.ph44.prol ], [ 0, %.lr.ph44.preheader113 ]
  %112 = getelementptr inbounds double, ptr %102, i64 %indvars.iv56.prol
  %113 = load double, ptr %112, align 8, !tbaa !14
  %114 = getelementptr inbounds double, ptr %9, i64 %indvars.iv56.prol
  store double %113, ptr %114, align 8, !tbaa !14
  %indvars.iv.next57.prol = add nuw nsw i64 %indvars.iv56.prol, 1
  %prol.iter124.next = add i64 %prol.iter124, 1
  %prol.iter124.cmp.not = icmp eq i64 %prol.iter124.next, %xtraiter122
  br i1 %prol.iter124.cmp.not, label %.lr.ph44.prol.loopexit, label %.lr.ph44.prol, !llvm.loop !33

.lr.ph44.prol.loopexit:                           ; preds = %.lr.ph44.prol, %.lr.ph44.preheader113
  %indvars.iv56.unr = phi i64 [ %indvars.iv56.ph, %.lr.ph44.preheader113 ], [ %indvars.iv.next57.prol, %.lr.ph44.prol ]
  %115 = sub nsw i64 %indvars.iv56.ph, %wide.trip.count59
  %116 = icmp ugt i64 %115, -4
  br i1 %116, label %.loopexit, label %.lr.ph44

.lr.ph44:                                         ; preds = %.lr.ph44.prol.loopexit, %.lr.ph44
  %indvars.iv56 = phi i64 [ %indvars.iv.next57.3, %.lr.ph44 ], [ %indvars.iv56.unr, %.lr.ph44.prol.loopexit ]
  %117 = getelementptr inbounds double, ptr %102, i64 %indvars.iv56
  %118 = load double, ptr %117, align 8, !tbaa !14
  %119 = getelementptr inbounds double, ptr %9, i64 %indvars.iv56
  store double %118, ptr %119, align 8, !tbaa !14
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %120 = getelementptr inbounds double, ptr %102, i64 %indvars.iv.next57
  %121 = load double, ptr %120, align 8, !tbaa !14
  %122 = getelementptr inbounds double, ptr %9, i64 %indvars.iv.next57
  store double %121, ptr %122, align 8, !tbaa !14
  %indvars.iv.next57.1 = add nuw nsw i64 %indvars.iv56, 2
  %123 = getelementptr inbounds double, ptr %102, i64 %indvars.iv.next57.1
  %124 = load double, ptr %123, align 8, !tbaa !14
  %125 = getelementptr inbounds double, ptr %9, i64 %indvars.iv.next57.1
  store double %124, ptr %125, align 8, !tbaa !14
  %indvars.iv.next57.2 = add nuw nsw i64 %indvars.iv56, 3
  %126 = getelementptr inbounds double, ptr %102, i64 %indvars.iv.next57.2
  %127 = load double, ptr %126, align 8, !tbaa !14
  %128 = getelementptr inbounds double, ptr %9, i64 %indvars.iv.next57.2
  store double %127, ptr %128, align 8, !tbaa !14
  %indvars.iv.next57.3 = add nuw nsw i64 %indvars.iv56, 4
  %exitcond60.not.3 = icmp eq i64 %indvars.iv.next57.3, %wide.trip.count59
  br i1 %exitcond60.not.3, label %.loopexit, label %.lr.ph44, !llvm.loop !34

.loopexit:                                        ; preds = %.lr.ph44.prol.loopexit, %.lr.ph44, %middle.block95, %.preheader, %100, %.loopexit33
  %.2 = phi i1 [ %.1, %.loopexit33 ], [ false, %100 ], [ %.1, %.preheader ], [ %.1, %middle.block95 ], [ %.1, %.lr.ph44 ], [ %.1, %.lr.ph44.prol.loopexit ]
  ret i1 %.2
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) 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, !13, i64 80}
!6 = !{!"_ZTSN10SimTKIpopt16StdInterfaceTNLPE", !7, i64 0, !12, i64 16, !9, i64 24, !9, i64 28, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !9, i64 64, !9, i64 68, !9, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !13, i64 104, !13, i64 112, !13, i64 120, !13, i64 128, !13, i64 136, !13, i64 144, !13, i64 152, !13, i64 160, !13, i64 168, !13, i64 176, !13, i64 184, !13, i64 192, !13, i64 200, !13, i64 208}
!7 = !{!"_ZTSN10SimTKIpopt4TNLPE", !8, i64 0}
!8 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !9, i64 8}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_10JournalistEEE", !13, i64 0}
!13 = !{!"any pointer", !10, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !10, i64 0}
!16 = distinct !{!16, !17, !18, !19}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = distinct !{!22, !17, !18}
!23 = !{!6, !13, i64 96}
!24 = distinct !{!24, !17, !18, !19}
!25 = distinct !{!25, !21}
!26 = distinct !{!26, !17, !18}
!27 = !{!6, !13, i64 104}
!28 = distinct !{!28, !17, !18, !19}
!29 = distinct !{!29, !21}
!30 = distinct !{!30, !17, !18}
!31 = !{!6, !13, i64 88}
!32 = distinct !{!32, !17, !18, !19}
!33 = distinct !{!33, !21}
!34 = distinct !{!34, !17, !18}


; Effective O3 passes: AggressiveInstCombinePass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass