; LLVM IR from div-bargali/Data-Structures-and-Algorithms :: C++/Algorithms/Pattern-Searching (manachers)

; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [19 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.1 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3minii(i32 noundef, i32 noundef) #0

; 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 norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca [100 x i8], align 16
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 100, ptr %2) #6
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %16 = getelementptr inbounds [100 x i8], ptr %2, i64 0, i64 0
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %16)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %18 = getelementptr inbounds [100 x i8], ptr %2, i64 0, i64 0
  %19 = call i64 @strlen(ptr noundef %18) #7
  %20 = trunc i64 %19 to i32
  store i32 %20, ptr %3, align 4, !tbaa !5
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = mul nsw i32 2, %21
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %3, align 4, !tbaa !5
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = zext i32 %24 to i64
  %26 = call ptr @llvm.stacksave.p0()
  store ptr %26, ptr %4, align 8
  %27 = alloca i32, i64 %25, align 16
  store i64 %25, ptr %5, align 8
  %28 = getelementptr inbounds i32, ptr %27, i64 0
  store i32 0, ptr %28, align 16, !tbaa !5
  %29 = getelementptr inbounds i32, ptr %27, i64 1
  store i32 1, ptr %29, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 2, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 -1, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 -1, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 -1, ptr %14, align 4, !tbaa !5
  store i32 2, ptr %8, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %152, %0
  %31 = load i32, ptr %8, align 4, !tbaa !5
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %34, label %155

34:                                               ; preds = %30
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = mul nsw i32 2, %35
  %37 = load i32, ptr %8, align 4, !tbaa !5
  %38 = sub nsw i32 %36, %37
  store i32 %38, ptr %9, align 4, !tbaa !5
  %39 = load i32, ptr %8, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds i32, ptr %27, i64 %40
  store i32 0, ptr %41, align 4, !tbaa !5
  %42 = load i32, ptr %7, align 4, !tbaa !5
  %43 = load i32, ptr %8, align 4, !tbaa !5
  %44 = sub nsw i32 %42, %43
  store i32 %44, ptr %14, align 4, !tbaa !5
  %45 = load i32, ptr %14, align 4, !tbaa !5
  %46 = icmp sgt i32 %45, 0
  br i1 %46, label %47, label %57

47:                                               ; preds = %34
  %48 = load i32, ptr %9, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds i32, ptr %27, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = load i32, ptr %14, align 4, !tbaa !5
  %53 = call noundef i32 @_Z3minii(i32 noundef %51, i32 noundef %52)
  %54 = load i32, ptr %8, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds i32, ptr %27, i64 %55
  store i32 %53, ptr %56, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %47, %34
  br label %58

58:                                               ; preds = %115, %57
  %59 = load i32, ptr %8, align 4, !tbaa !5
  %60 = load i32, ptr %8, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds i32, ptr %27, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = add nsw i32 %59, %63
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %67, label %113

67:                                               ; preds = %58
  %68 = load i32, ptr %8, align 4, !tbaa !5
  %69 = load i32, ptr %8, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds i32, ptr %27, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = sub nsw i32 %68, %72
  %74 = icmp sgt i32 %73, 0
  br i1 %74, label %75, label %113

75:                                               ; preds = %67
  %76 = load i32, ptr %8, align 4, !tbaa !5
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i32, ptr %27, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = add nsw i32 %76, %80
  %82 = add nsw i32 %81, 1
  %83 = srem i32 %82, 2
  %84 = icmp eq i32 %83, 0
  br i1 %84, label %111, label %85

85:                                               ; preds = %75
  %86 = load i32, ptr %8, align 4, !tbaa !5
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds i32, ptr %27, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = add nsw i32 %86, %90
  %92 = add nsw i32 %91, 1
  %93 = sdiv i32 %92, 2
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [100 x i8], ptr %2, i64 0, i64 %94
  %96 = load i8, ptr %95, align 1, !tbaa !9
  %97 = sext i8 %96 to i32
  %98 = load i32, ptr %8, align 4, !tbaa !5
  %99 = load i32, ptr %8, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i32, ptr %27, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = sub nsw i32 %98, %102
  %104 = sub nsw i32 %103, 1
  %105 = sdiv i32 %104, 2
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [100 x i8], ptr %2, i64 0, i64 %106
  %108 = load i8, ptr %107, align 1, !tbaa !9
  %109 = sext i8 %108 to i32
  %110 = icmp eq i32 %97, %109
  br label %111

111:                                              ; preds = %85, %75
  %112 = phi i1 [ true, %75 ], [ %110, %85 ]
  br label %113

113:                                              ; preds = %111, %67, %58
  %114 = phi i1 [ false, %67 ], [ false, %58 ], [ %112, %111 ]
  br i1 %114, label %115, label %121

115:                                              ; preds = %113
  %116 = load i32, ptr %8, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds i32, ptr %27, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %118, align 4, !tbaa !5
  br label %58, !llvm.loop !10

121:                                              ; preds = %113
  %122 = load i32, ptr %8, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds i32, ptr %27, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = load i32, ptr %10, align 4, !tbaa !5
  %127 = icmp sgt i32 %125, %126
  br i1 %127, label %128, label %134

128:                                              ; preds = %121
  %129 = load i32, ptr %8, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds i32, ptr %27, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !5
  store i32 %132, ptr %10, align 4, !tbaa !5
  %133 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %133, ptr %11, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %128, %121
  %135 = load i32, ptr %8, align 4, !tbaa !5
  %136 = load i32, ptr %8, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds i32, ptr %27, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = add nsw i32 %135, %139
  %141 = load i32, ptr %7, align 4, !tbaa !5
  %142 = icmp sgt i32 %140, %141
  br i1 %142, label %143, label %151

143:                                              ; preds = %134
  %144 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %144, ptr %6, align 4, !tbaa !5
  %145 = load i32, ptr %8, align 4, !tbaa !5
  %146 = load i32, ptr %8, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds i32, ptr %27, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = add nsw i32 %145, %149
  store i32 %150, ptr %7, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %143, %134
  br label %152

152:                                              ; preds = %151
  %153 = load i32, ptr %8, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %8, align 4, !tbaa !5
  br label %30, !llvm.loop !12

155:                                              ; preds = %30
  %156 = load i32, ptr %11, align 4, !tbaa !5
  %157 = load i32, ptr %10, align 4, !tbaa !5
  %158 = sub nsw i32 %156, %157
  %159 = sdiv i32 %158, 2
  store i32 %159, ptr %12, align 4, !tbaa !5
  %160 = load i32, ptr %12, align 4, !tbaa !5
  %161 = load i32, ptr %10, align 4, !tbaa !5
  %162 = add nsw i32 %160, %161
  %163 = sub nsw i32 %162, 1
  store i32 %163, ptr %13, align 4, !tbaa !5
  %164 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %165 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %165, ptr %8, align 4, !tbaa !5
  br label %166

166:                                              ; preds = %176, %155
  %167 = load i32, ptr %8, align 4, !tbaa !5
  %168 = load i32, ptr %13, align 4, !tbaa !5
  %169 = icmp sle i32 %167, %168
  br i1 %169, label %170, label %179

170:                                              ; preds = %166
  %171 = load i32, ptr %8, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [100 x i8], ptr %2, i64 0, i64 %172
  %174 = load i8, ptr %173, align 1, !tbaa !9
  %175 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %174)
  br label %176

176:                                              ; preds = %170
  %177 = load i32, ptr %8, align 4, !tbaa !5
  %178 = add nsw i32 %177, 1
  store i32 %178, ptr %8, align 4, !tbaa !5
  br label %166, !llvm.loop !13

179:                                              ; preds = %166
  %180 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %181 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %181)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 100, ptr %2) #6
  %182 = load i32, ptr %1, align 4
  ret i32 %182
}

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull) #3

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress norecurse 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind willreturn memory(read) "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 = { nocallback nofree nosync nounwind willreturn }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}


; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [19 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.1 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3minii(i32 noundef, i32 noundef) 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

; 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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca [100 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %1) #7
  %2 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %3 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %1)
  %4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %1) #8
  %5 = trunc i64 %4 to i32
  %6 = shl i32 %5, 1
  %7 = or disjoint i32 %6, 1
  %8 = zext i32 %7 to i64
  %9 = call ptr @llvm.stacksave.p0()
  %10 = alloca i32, i64 %8, align 16
  store i32 0, ptr %10, align 16, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %10, i64 4
  store i32 1, ptr %11, align 4, !tbaa !5
  %.not79 = icmp slt i32 %5, 1
  br i1 %.not79, label %._crit_edge.thread, label %.lr.ph85.preheader

._crit_edge.thread:                               ; preds = %0
  %12 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
  br label %._crit_edge92

.lr.ph85.preheader:                               ; preds = %0
  %13 = or disjoint i32 %6, 1
  %smax = call i32 @llvm.smax.i32(i32 %6, i32 2)
  %14 = or disjoint i32 %smax, 1
  %wide.trip.count = zext nneg i32 %14 to i64
  br label %.lr.ph85

.lr.ph85:                                         ; preds = %.lr.ph85.preheader, %.critedge
  %indvars.iv93 = phi i64 [ 2, %.lr.ph85.preheader ], [ %indvars.iv.next94, %.critedge ]
  %indvars.iv.in = phi i32 [ %6, %.lr.ph85.preheader ], [ %indvars.iv, %.critedge ]
  %.084 = phi i32 [ 0, %.lr.ph85.preheader ], [ %spec.select65, %.critedge ]
  %.04883 = phi i32 [ 0, %.lr.ph85.preheader ], [ %spec.select, %.critedge ]
  %.05281 = phi i32 [ 2, %.lr.ph85.preheader ], [ %.153, %.critedge ]
  %.05480 = phi i32 [ 1, %.lr.ph85.preheader ], [ %.155, %.critedge ]
  %indvars.iv = add i32 %indvars.iv.in, -1
  %15 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv93
  store i32 0, ptr %15, align 4, !tbaa !5
  %16 = trunc nuw nsw i64 %indvars.iv93 to i32
  %17 = sub nsw i32 %.05281, %16
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %19, label %26

19:                                               ; preds = %.lr.ph85
  %20 = shl nsw i32 %.05480, 1
  %21 = sub nsw i32 %20, %16
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds i32, ptr %10, i64 %22
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = call noundef i32 @_Z3minii(i32 noundef %24, i32 noundef %17)
  br label %26

26:                                               ; preds = %19, %.lr.ph85
  %.promoted = phi i32 [ %25, %19 ], [ 0, %.lr.ph85 ]
  %27 = add nsw i32 %.promoted, %16
  %.not6368 = icmp sgt i32 %27, %6
  br i1 %.not6368, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %26, %.critedge2
  %28 = phi i32 [ %47, %.critedge2 ], [ %27, %26 ]
  %29 = phi i32 [ %46, %.critedge2 ], [ %.promoted, %26 ]
  %30 = sub nsw i32 %16, %29
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %32, label %.critedge

32:                                               ; preds = %.lr.ph
  %33 = and i32 %28, 1
  %.not64 = icmp eq i32 %33, 0
  br i1 %.not64, label %34, label %.critedge2

34:                                               ; preds = %32
  %35 = or disjoint i32 %28, 1
  %36 = sdiv i32 %35, 2
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [100 x i8], ptr %1, i64 0, i64 %37
  %39 = load i8, ptr %38, align 1, !tbaa !9
  %40 = add nsw i32 %30, -1
  %41 = lshr i32 %40, 1
  %42 = zext nneg i32 %41 to i64
  %43 = getelementptr inbounds [100 x i8], ptr %1, i64 0, i64 %42
  %44 = load i8, ptr %43, align 1, !tbaa !9
  %45 = icmp eq i8 %39, %44
  br i1 %45, label %.critedge2, label %.critedge

.critedge2:                                       ; preds = %32, %34
  %46 = add nsw i32 %29, 1
  %47 = add nsw i32 %46, %16
  %.not63 = icmp sgt i32 %47, %6
  br i1 %.not63, label %.critedge, label %.lr.ph, !llvm.loop !10

.critedge:                                        ; preds = %34, %.critedge2, %.lr.ph, %26
  %.lcssa67 = phi i32 [ %.promoted, %26 ], [ %29, %.lr.ph ], [ %indvars.iv, %.critedge2 ], [ %29, %34 ]
  %.lcssa = phi i32 [ %27, %26 ], [ %28, %.lr.ph ], [ %13, %.critedge2 ], [ %28, %34 ]
  store i32 %.lcssa67, ptr %15, align 4, !tbaa !5
  %48 = icmp sgt i32 %.lcssa67, %.04883
  %spec.select = call i32 @llvm.smax.i32(i32 %.lcssa67, i32 %.04883)
  %spec.select65 = select i1 %48, i32 %16, i32 %.084
  %49 = icmp sgt i32 %.lcssa, %.05281
  %.155 = select i1 %49, i32 %16, i32 %.05480
  %.153 = call i32 @llvm.smax.i32(i32 %.lcssa, i32 %.05281)
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph85, !llvm.loop !12

._crit_edge:                                      ; preds = %.critedge
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
  %.not62.not88 = icmp sgt i32 %spec.select, 0
  br i1 %.not62.not88, label %.lr.ph91.preheader, label %._crit_edge92

.lr.ph91.preheader:                               ; preds = %._crit_edge
  %51 = sub nsw i32 %spec.select65, %spec.select
  %52 = sdiv i32 %51, 2
  %53 = add nsw i32 %52, %spec.select
  %54 = sext i32 %52 to i64
  %55 = sext i32 %53 to i64
  br label %.lr.ph91

.lr.ph91:                                         ; preds = %.lr.ph91.preheader, %.lr.ph91
  %indvars.iv96 = phi i64 [ %54, %.lr.ph91.preheader ], [ %indvars.iv.next97, %.lr.ph91 ]
  %56 = getelementptr inbounds [100 x i8], ptr %1, i64 0, i64 %indvars.iv96
  %57 = load i8, ptr %56, align 1, !tbaa !9
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %57)
  %indvars.iv.next97 = add nsw i64 %indvars.iv96, 1
  %.not62.not = icmp slt i64 %indvars.iv.next97, %55
  br i1 %.not62.not, label %.lr.ph91, label %._crit_edge92, !llvm.loop !13

._crit_edge92:                                    ; preds = %.lr.ph91, %._crit_edge.thread, %._crit_edge
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.2)
  call void @llvm.stackrestore.p0(ptr %9)
  call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %1) #7
  ret i32 0
}

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress norecurse 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}


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