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

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

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef, i32 noundef, ptr noundef, ...) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK10SimTKIpopt10Journalist20PrintStringOverLinesENS_13EJournalLevelENS_16EJournalCategoryEiiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(40) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 8 dereferenceable(32) %5) #0 align 2 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca [1024 x i8], align 16
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i8, align 1
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !11
  store i32 %3, ptr %10, align 4, !tbaa !13
  store i32 %4, ptr %11, align 4, !tbaa !13
  store ptr %5, ptr %12, align 8, !tbaa !5
  %22 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 1024, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  store i64 0, ptr %14, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  store i64 0, ptr %15, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #3
  store i8 1, ptr %16, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  store i32 0, ptr %17, align 4, !tbaa !13
  br label %23

23:                                               ; preds = %142, %6
  %24 = load i64, ptr %14, align 8, !tbaa !15
  %25 = load ptr, ptr %12, align 8, !tbaa !5
  %26 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %25) #3
  %27 = icmp ult i64 %24, %26
  br i1 %27, label %28, label %143

28:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %29 = load i64, ptr %14, align 8, !tbaa !15
  store i64 %29, ptr %18, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  store i32 0, ptr %19, align 4, !tbaa !13
  br label %30

30:                                               ; preds = %58, %28
  %31 = load i32, ptr %19, align 4, !tbaa !13
  %32 = load i32, ptr %11, align 4, !tbaa !13
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %34, label %39

34:                                               ; preds = %30
  %35 = load i64, ptr %18, align 8, !tbaa !15
  %36 = load ptr, ptr %12, align 8, !tbaa !5
  %37 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %36) #3
  %38 = icmp ult i64 %35, %37
  br label %39

39:                                               ; preds = %34, %30
  %40 = phi i1 [ false, %30 ], [ %38, %34 ]
  br i1 %40, label %41, label %65

41:                                               ; preds = %39
  %42 = load ptr, ptr %12, align 8, !tbaa !5
  %43 = load i64, ptr %18, align 8, !tbaa !15
  %44 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %42, i64 noundef %43) #3
  %45 = load i8, ptr %44, align 1, !tbaa !19
  %46 = load i32, ptr %17, align 4, !tbaa !13
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 %47
  store i8 %45, ptr %48, align 1, !tbaa !19
  %49 = load ptr, ptr %12, align 8, !tbaa !5
  %50 = load i64, ptr %18, align 8, !tbaa !15
  %51 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %49, i64 noundef %50) #3
  %52 = load i8, ptr %51, align 1, !tbaa !19
  %53 = sext i8 %52 to i32
  %54 = icmp eq i32 %53, 32
  br i1 %54, label %55, label %58

55:                                               ; preds = %41
  %56 = load i64, ptr %18, align 8, !tbaa !15
  %57 = add i64 %56, 1
  store i64 %57, ptr %15, align 8, !tbaa !15
  br label %58

58:                                               ; preds = %55, %41
  %59 = load i32, ptr %19, align 4, !tbaa !13
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %19, align 4, !tbaa !13
  %61 = load i32, ptr %17, align 4, !tbaa !13
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %17, align 4, !tbaa !13
  %63 = load i64, ptr %18, align 8, !tbaa !15
  %64 = add i64 %63, 1
  store i64 %64, ptr %18, align 8, !tbaa !15
  br label %30, !llvm.loop !20

65:                                               ; preds = %39
  %66 = load i64, ptr %18, align 8, !tbaa !15
  %67 = load ptr, ptr %12, align 8, !tbaa !5
  %68 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %67) #3
  %69 = icmp eq i64 %66, %68
  br i1 %69, label %70, label %77

70:                                               ; preds = %65
  %71 = load i32, ptr %17, align 4, !tbaa !13
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 %72
  store i8 0, ptr %73, align 1, !tbaa !19
  %74 = load i32, ptr %8, align 4, !tbaa !9
  %75 = load i32, ptr %9, align 4, !tbaa !11
  %76 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 0
  call void (ptr, i32, i32, ptr, ...) @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %22, i32 noundef %74, i32 noundef %75, ptr noundef @.str, ptr noundef %76)
  store i32 3, ptr %20, align 4
  br label %140

77:                                               ; preds = %65
  %78 = load i64, ptr %15, align 8, !tbaa !15
  %79 = load i64, ptr %14, align 8, !tbaa !15
  %80 = icmp eq i64 %78, %79
  br i1 %80, label %81, label %108

81:                                               ; preds = %77
  %82 = load ptr, ptr %12, align 8, !tbaa !5
  %83 = load i64, ptr %18, align 8, !tbaa !15
  %84 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %82, i64 noundef %83) #3
  %85 = load i8, ptr %84, align 1, !tbaa !19
  %86 = sext i8 %85 to i32
  %87 = icmp eq i32 %86, 32
  br i1 %87, label %88, label %96

88:                                               ; preds = %81
  %89 = load i32, ptr %17, align 4, !tbaa !13
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 %90
  store i8 0, ptr %91, align 1, !tbaa !19
  %92 = load i64, ptr %18, align 8, !tbaa !15
  %93 = add i64 %92, 1
  store i64 %93, ptr %15, align 8, !tbaa !15
  %94 = load i64, ptr %18, align 8, !tbaa !15
  %95 = add i64 %94, 1
  store i64 %95, ptr %14, align 8, !tbaa !15
  br label %107

96:                                               ; preds = %81
  %97 = load i32, ptr %17, align 4, !tbaa !13
  %98 = sub nsw i32 %97, 1
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 %99
  store i8 45, ptr %100, align 1, !tbaa !19
  %101 = load i32, ptr %17, align 4, !tbaa !13
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 %102
  store i8 0, ptr %103, align 1, !tbaa !19
  %104 = load i64, ptr %18, align 8, !tbaa !15
  %105 = sub i64 %104, 1
  store i64 %105, ptr %15, align 8, !tbaa !15
  %106 = load i64, ptr %15, align 8, !tbaa !15
  store i64 %106, ptr %14, align 8, !tbaa !15
  br label %107

107:                                              ; preds = %96, %88
  br label %118

108:                                              ; preds = %77
  %109 = load i32, ptr %17, align 4, !tbaa !13
  %110 = sext i32 %109 to i64
  %111 = load i64, ptr %18, align 8, !tbaa !15
  %112 = load i64, ptr %15, align 8, !tbaa !15
  %113 = sub i64 %111, %112
  %114 = sub i64 %110, %113
  %115 = sub i64 %114, 1
  %116 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 %115
  store i8 0, ptr %116, align 1, !tbaa !19
  %117 = load i64, ptr %15, align 8, !tbaa !15
  store i64 %117, ptr %14, align 8, !tbaa !15
  br label %118

118:                                              ; preds = %108, %107
  %119 = load i32, ptr %8, align 4, !tbaa !9
  %120 = load i32, ptr %9, align 4, !tbaa !11
  %121 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 0
  call void (ptr, i32, i32, ptr, ...) @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %22, i32 noundef %119, i32 noundef %120, ptr noundef @.str.1, ptr noundef %121)
  %122 = load i8, ptr %16, align 1, !tbaa !17, !range !22, !noundef !23
  %123 = trunc i8 %122 to i1
  br i1 %123, label %124, label %138

124:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  store i32 0, ptr %21, align 4, !tbaa !13
  br label %125

125:                                              ; preds = %134, %124
  %126 = load i32, ptr %21, align 4, !tbaa !13
  %127 = load i32, ptr %10, align 4, !tbaa !13
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %130, label %129

129:                                              ; preds = %125
  store i32 6, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  br label %137

130:                                              ; preds = %125
  %131 = load i32, ptr %21, align 4, !tbaa !13
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 %132
  store i8 32, ptr %133, align 1, !tbaa !19
  br label %134

134:                                              ; preds = %130
  %135 = load i32, ptr %21, align 4, !tbaa !13
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %21, align 4, !tbaa !13
  br label %125, !llvm.loop !24

137:                                              ; preds = %129
  store i8 0, ptr %16, align 1, !tbaa !17
  br label %138

138:                                              ; preds = %137, %118
  %139 = load i32, ptr %10, align 4, !tbaa !13
  store i32 %139, ptr %17, align 4, !tbaa !13
  store i32 0, ptr %20, align 4
  br label %140

140:                                              ; preds = %138, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  %141 = load i32, ptr %20, align 4
  switch i32 %141, label %144 [
    i32 0, label %142
    i32 3, label %143
  ]

142:                                              ; preds = %140
  br label %23, !llvm.loop !25

143:                                              ; preds = %140, %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 1024, ptr %13) #3
  ret void

144:                                              ; preds = %140
  unreachable
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #2 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 = { 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 }

!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 = !{!"_ZTSN10SimTKIpopt13EJournalLevelE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTSN10SimTKIpopt16EJournalCategoryE", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = distinct !{!24, !21}
!25 = distinct !{!25, !21}


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

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK10SimTKIpopt10Journalist20PrintStringOverLinesENS_13EJournalLevelENS_16EJournalCategoryEiiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(40) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 8 dereferenceable(32) %5) local_unnamed_addr #0 align 2 {
  %7 = alloca [1024 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %7) #4
  %8 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  %.not81 = icmp eq i64 %8, 0
  br i1 %.not81, label %.loopexit65, label %.preheader64.lr.ph

.preheader64.lr.ph:                               ; preds = %6
  %9 = icmp sgt i32 %4, 0
  %10 = icmp sgt i32 %3, 0
  %11 = zext i32 %3 to i64
  br label %.preheader64

.preheader64:                                     ; preds = %.preheader64.lr.ph, %.loopexit
  %.04880 = phi i32 [ 0, %.preheader64.lr.ph ], [ %3, %.loopexit ]
  %.04979 = phi i1 [ true, %.preheader64.lr.ph ], [ false, %.loopexit ]
  %.05578 = phi i64 [ 0, %.preheader64.lr.ph ], [ %.3, %.loopexit ]
  br i1 %9, label %.lr.ph.preheader, label %.critedge

.lr.ph.preheader:                                 ; preds = %.preheader64
  %12 = sext i32 %.04880 to i64
  %13 = add i32 %.04880, %4
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %16
  %indvars.iv = phi i64 [ %12, %.lr.ph.preheader ], [ %indvars.iv.next, %16 ]
  %.04669 = phi i32 [ 0, %.lr.ph.preheader ], [ %24, %16 ]
  %.04768 = phi i64 [ %.05578, %.lr.ph.preheader ], [ %23, %16 ]
  %.15366 = phi i64 [ %.05578, %.lr.ph.preheader ], [ %spec.select, %16 ]
  %14 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  %15 = icmp ult i64 %.04768, %14
  br i1 %15, label %16, label %.critedge.loopexit.split.loop.exit88

16:                                               ; preds = %.lr.ph
  %17 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %5, i64 noundef %.04768) #4
  %18 = load i8, ptr %17, align 1, !tbaa !5
  %19 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 %indvars.iv
  store i8 %18, ptr %19, align 1, !tbaa !5
  %20 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %5, i64 noundef %.04768) #4
  %21 = load i8, ptr %20, align 1, !tbaa !5
  %22 = icmp eq i8 %21, 32
  %23 = add nuw i64 %.04768, 1
  %spec.select = select i1 %22, i64 %23, i64 %.15366
  %24 = add nuw nsw i32 %.04669, 1
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i32 %24, %4
  br i1 %exitcond.not, label %.critedge, label %.lr.ph, !llvm.loop !8

.critedge.loopexit.split.loop.exit88:             ; preds = %.lr.ph
  %25 = trunc nsw i64 %indvars.iv to i32
  br label %.critedge

.critedge:                                        ; preds = %16, %.critedge.loopexit.split.loop.exit88, %.preheader64
  %.153.lcssa = phi i64 [ %.05578, %.preheader64 ], [ %.15366, %.critedge.loopexit.split.loop.exit88 ], [ %spec.select, %16 ]
  %.1.lcssa = phi i32 [ %.04880, %.preheader64 ], [ %25, %.critedge.loopexit.split.loop.exit88 ], [ %13, %16 ]
  %.047.lcssa = phi i64 [ %.05578, %.preheader64 ], [ %.04768, %.critedge.loopexit.split.loop.exit88 ], [ %23, %16 ]
  %26 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  %27 = icmp eq i64 %.047.lcssa, %26
  br i1 %27, label %.thread, label %30

.thread:                                          ; preds = %.critedge
  %28 = sext i32 %.1.lcssa to i64
  %29 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 %28
  store i8 0, ptr %29, align 1, !tbaa !5
  call void (ptr, i32, i32, ptr, ...) @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %0, i32 noundef %1, i32 noundef %2, ptr noundef nonnull @.str, ptr noundef nonnull %7)
  br label %.loopexit65

30:                                               ; preds = %.critedge
  %31 = icmp eq i64 %.153.lcssa, %.05578
  br i1 %31, label %32, label %47

32:                                               ; preds = %30
  %33 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %5, i64 noundef %.047.lcssa) #4
  %34 = load i8, ptr %33, align 1, !tbaa !5
  %35 = icmp eq i8 %34, 32
  br i1 %35, label %36, label %40

36:                                               ; preds = %32
  %37 = sext i32 %.1.lcssa to i64
  %38 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 %37
  store i8 0, ptr %38, align 1, !tbaa !5
  %39 = add i64 %.047.lcssa, 1
  br label %53

40:                                               ; preds = %32
  %41 = add nsw i32 %.1.lcssa, -1
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 %42
  store i8 45, ptr %43, align 1, !tbaa !5
  %44 = sext i32 %.1.lcssa to i64
  %45 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 %44
  store i8 0, ptr %45, align 1, !tbaa !5
  %46 = add i64 %.047.lcssa, -1
  br label %53

47:                                               ; preds = %30
  %48 = sext i32 %.1.lcssa to i64
  %49 = xor i64 %.047.lcssa, -1
  %50 = add i64 %.153.lcssa, %49
  %51 = add i64 %50, %48
  %52 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 %51
  store i8 0, ptr %52, align 1, !tbaa !5
  br label %53

53:                                               ; preds = %36, %40, %47
  %.3 = phi i64 [ %39, %36 ], [ %46, %40 ], [ %.153.lcssa, %47 ]
  call void (ptr, i32, i32, ptr, ...) @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %0, i32 noundef %1, i32 noundef %2, ptr noundef nonnull @.str.1, ptr noundef nonnull %7)
  %brmerge.not = and i1 %10, %.04979
  br i1 %brmerge.not, label %.lr.ph77.preheader, label %.loopexit

.lr.ph77.preheader:                               ; preds = %53
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %7, i8 32, i64 %11, i1 false), !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph77.preheader, %53
  %54 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  %55 = icmp ult i64 %.3, %54
  br i1 %55, label %.preheader64, label %.loopexit65

.loopexit65:                                      ; preds = %.loopexit, %6, %.thread
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %7) #4
  ret void
}

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}


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