; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/IPC/IPC15FLA/TREEPAL (brute)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z3lpsRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %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
  %15 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %16) #5
  %18 = trunc i64 %17 to i32
  store i32 %18, ptr %3, align 4, !tbaa !9
  %19 = load i32, ptr %3, align 4, !tbaa !9
  %20 = zext i32 %19 to i64
  %21 = load i32, ptr %3, align 4, !tbaa !9
  %22 = zext i32 %21 to i64
  %23 = call ptr @llvm.stacksave.p0()
  store ptr %23, ptr %4, align 8
  %24 = mul nuw i64 %20, %22
  %25 = alloca i32, i64 %24, align 16
  store i64 %20, ptr %5, align 8
  store i64 %22, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %39, %1
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = load i32, ptr %3, align 4, !tbaa !9
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %42

31:                                               ; preds = %26
  %32 = load i32, ptr %7, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = mul nsw i64 %33, %22
  %35 = getelementptr inbounds i32, ptr %25, i64 %34
  %36 = load i32, ptr %7, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds i32, ptr %35, i64 %37
  store i32 1, ptr %38, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %31
  %40 = load i32, ptr %7, align 4, !tbaa !9
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %7, align 4, !tbaa !9
  br label %26, !llvm.loop !11

42:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !9
  br label %43

43:                                               ; preds = %72, %42
  %44 = load i32, ptr %8, align 4, !tbaa !9
  %45 = load i32, ptr %3, align 4, !tbaa !9
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %75

48:                                               ; preds = %43
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  %50 = load i32, ptr %8, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %49, i64 noundef %51)
  %53 = load i8, ptr %52, align 1, !tbaa !13
  %54 = sext i8 %53 to i32
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = load i32, ptr %8, align 4, !tbaa !9
  %57 = sub nsw i32 %56, 1
  %58 = sext i32 %57 to i64
  %59 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %55, i64 noundef %58)
  %60 = load i8, ptr %59, align 1, !tbaa !13
  %61 = sext i8 %60 to i32
  %62 = icmp eq i32 %54, %61
  %63 = zext i1 %62 to i32
  %64 = load i32, ptr %8, align 4, !tbaa !9
  %65 = sub nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  %67 = mul nsw i64 %66, %22
  %68 = getelementptr inbounds i32, ptr %25, i64 %67
  %69 = load i32, ptr %8, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds i32, ptr %68, i64 %70
  store i32 %63, ptr %71, align 4, !tbaa !9
  br label %72

72:                                               ; preds = %48
  %73 = load i32, ptr %8, align 4, !tbaa !9
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %8, align 4, !tbaa !9
  br label %43, !llvm.loop !14

75:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 3, ptr %9, align 4, !tbaa !9
  br label %76

76:                                               ; preds = %148, %75
  %77 = load i32, ptr %9, align 4, !tbaa !9
  %78 = load i32, ptr %3, align 4, !tbaa !9
  %79 = icmp sle i32 %77, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %76
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %151

81:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %82

82:                                               ; preds = %144, %81
  %83 = load i32, ptr %11, align 4, !tbaa !9
  %84 = load i32, ptr %9, align 4, !tbaa !9
  %85 = add nsw i32 %83, %84
  %86 = sub nsw i32 %85, 1
  %87 = load i32, ptr %3, align 4, !tbaa !9
  %88 = icmp slt i32 %86, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %82
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %147

90:                                               ; preds = %82
  %91 = load i32, ptr %11, align 4, !tbaa !9
  %92 = add nsw i32 %91, 1
  %93 = sext i32 %92 to i64
  %94 = mul nsw i64 %93, %22
  %95 = getelementptr inbounds i32, ptr %25, i64 %94
  %96 = load i32, ptr %11, align 4, !tbaa !9
  %97 = load i32, ptr %9, align 4, !tbaa !9
  %98 = add nsw i32 %96, %97
  %99 = sub nsw i32 %98, 2
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i32, ptr %95, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !9
  %103 = icmp ne i32 %102, 0
  br i1 %103, label %104, label %132

104:                                              ; preds = %90
  %105 = load ptr, ptr %2, align 8, !tbaa !5
  %106 = load i32, ptr %11, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %105, i64 noundef %107)
  %109 = load i8, ptr %108, align 1, !tbaa !13
  %110 = sext i8 %109 to i32
  %111 = load ptr, ptr %2, align 8, !tbaa !5
  %112 = load i32, ptr %11, align 4, !tbaa !9
  %113 = load i32, ptr %9, align 4, !tbaa !9
  %114 = add nsw i32 %112, %113
  %115 = sub nsw i32 %114, 1
  %116 = sext i32 %115 to i64
  %117 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %111, i64 noundef %116)
  %118 = load i8, ptr %117, align 1, !tbaa !13
  %119 = sext i8 %118 to i32
  %120 = icmp eq i32 %110, %119
  br i1 %120, label %121, label %132

121:                                              ; preds = %104
  %122 = load i32, ptr %11, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = mul nsw i64 %123, %22
  %125 = getelementptr inbounds i32, ptr %25, i64 %124
  %126 = load i32, ptr %11, align 4, !tbaa !9
  %127 = load i32, ptr %9, align 4, !tbaa !9
  %128 = add nsw i32 %126, %127
  %129 = sub nsw i32 %128, 1
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds i32, ptr %125, i64 %130
  store i32 1, ptr %131, align 4, !tbaa !9
  br label %143

132:                                              ; preds = %104, %90
  %133 = load i32, ptr %11, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = mul nsw i64 %134, %22
  %136 = getelementptr inbounds i32, ptr %25, i64 %135
  %137 = load i32, ptr %11, align 4, !tbaa !9
  %138 = load i32, ptr %9, align 4, !tbaa !9
  %139 = add nsw i32 %137, %138
  %140 = sub nsw i32 %139, 1
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds i32, ptr %136, i64 %141
  store i32 0, ptr %142, align 4, !tbaa !9
  br label %143

143:                                              ; preds = %132, %121
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %11, align 4, !tbaa !9
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %11, align 4, !tbaa !9
  br label %82, !llvm.loop !15

147:                                              ; preds = %89
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %9, align 4, !tbaa !9
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %9, align 4, !tbaa !9
  br label %76, !llvm.loop !16

151:                                              ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 1, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %152

152:                                              ; preds = %186, %151
  %153 = load i32, ptr %13, align 4, !tbaa !9
  %154 = load i32, ptr %3, align 4, !tbaa !9
  %155 = icmp slt i32 %153, %154
  br i1 %155, label %157, label %156

156:                                              ; preds = %152
  store i32 14, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %189

157:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %158 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %158, ptr %14, align 4, !tbaa !9
  br label %159

159:                                              ; preds = %182, %157
  %160 = load i32, ptr %14, align 4, !tbaa !9
  %161 = load i32, ptr %3, align 4, !tbaa !9
  %162 = icmp slt i32 %160, %161
  br i1 %162, label %164, label %163

163:                                              ; preds = %159
  store i32 17, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %185

164:                                              ; preds = %159
  %165 = load i32, ptr %13, align 4, !tbaa !9
  %166 = sext i32 %165 to i64
  %167 = mul nsw i64 %166, %22
  %168 = getelementptr inbounds i32, ptr %25, i64 %167
  %169 = load i32, ptr %14, align 4, !tbaa !9
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds i32, ptr %168, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !9
  %173 = icmp ne i32 %172, 0
  br i1 %173, label %174, label %181

174:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %175 = load i32, ptr %14, align 4, !tbaa !9
  %176 = load i32, ptr %13, align 4, !tbaa !9
  %177 = sub nsw i32 %175, %176
  %178 = add nsw i32 %177, 1
  store i32 %178, ptr %15, align 4, !tbaa !9
  %179 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %180 = load i32, ptr %179, align 4, !tbaa !9
  store i32 %180, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %181

181:                                              ; preds = %174, %164
  br label %182

182:                                              ; preds = %181
  %183 = load i32, ptr %14, align 4, !tbaa !9
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %14, align 4, !tbaa !9
  br label %159, !llvm.loop !17

185:                                              ; preds = %163
  br label %186

186:                                              ; preds = %185
  %187 = load i32, ptr %13, align 4, !tbaa !9
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %13, align 4, !tbaa !9
  br label %152, !llvm.loop !18

189:                                              ; preds = %156
  %190 = load i32, ptr %12, align 4, !tbaa !9
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %191 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %191)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  ret i32 %190
}

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #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 = { 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 nosync nounwind willreturn }
attributes #4 = { inlinehint 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 #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


; 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 nounwind uwtable
define dso_local noundef i32 @_Z3lpsRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %0) local_unnamed_addr #0 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  %5 = trunc i64 %4 to i32
  %6 = and i64 %4, 4294967295
  %7 = mul nuw i64 %6, %6
  %8 = alloca i32, i64 %7, align 16
  %9 = icmp sgt i32 %5, 0
  br i1 %9, label %.lr.ph.preheader, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #3
  br label %._crit_edge70

.lr.ph.preheader:                                 ; preds = %1
  %wide.trip.count = and i64 %4, 2147483647
  %10 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %4, 3
  %11 = icmp ult i64 %10, 3
  br i1 %11, label %.preheader61.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter
  br label %.lr.ph

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

.lr.ph.epil:                                      ; preds = %.preheader61.unr-lcssa, %.lr.ph.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph.epil ], [ %indvars.iv.unr, %.preheader61.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.preheader61.unr-lcssa ]
  %12 = mul nuw nsw i64 %6, %indvars.iv.epil
  %13 = getelementptr inbounds i32, ptr %8, i64 %12
  %14 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv.epil
  store i32 1, ptr %14, align 4, !tbaa !5
  %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 %.preheader61, label %.lr.ph.epil, !llvm.loop !9

.preheader61:                                     ; preds = %.lr.ph.epil, %.preheader61.unr-lcssa
  %.not = icmp eq i32 %5, 1
  br i1 %.not, label %._crit_edge, label %.lr.ph64.preheader

.lr.ph64.preheader:                               ; preds = %.preheader61
  %wide.trip.count75 = and i64 %4, 2147483647
  br label %.lr.ph64

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.3, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %15 = mul nuw nsw i64 %6, %indvars.iv
  %16 = getelementptr inbounds i32, ptr %8, i64 %15
  %17 = getelementptr inbounds i32, ptr %16, i64 %indvars.iv
  store i32 1, ptr %17, align 16, !tbaa !5
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %18 = mul nuw nsw i64 %6, %indvars.iv.next
  %19 = getelementptr inbounds i32, ptr %8, i64 %18
  %20 = getelementptr inbounds i32, ptr %19, i64 %indvars.iv.next
  store i32 1, ptr %20, align 4, !tbaa !5
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %21 = mul nuw nsw i64 %6, %indvars.iv.next.1
  %22 = getelementptr inbounds i32, ptr %8, i64 %21
  %23 = getelementptr inbounds i32, ptr %22, i64 %indvars.iv.next.1
  store i32 1, ptr %23, align 8, !tbaa !5
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %24 = mul nuw nsw i64 %6, %indvars.iv.next.2
  %25 = getelementptr inbounds i32, ptr %8, i64 %24
  %26 = getelementptr inbounds i32, ptr %25, i64 %indvars.iv.next.2
  store i32 1, ptr %26, align 4, !tbaa !5
  %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 %.preheader61.unr-lcssa, label %.lr.ph, !llvm.loop !11

.preheader60:                                     ; preds = %.lr.ph64
  %.not66 = icmp slt i32 %5, 3
  br i1 %.not66, label %._crit_edge, label %.preheader59.preheader

.preheader59.preheader:                           ; preds = %.preheader60
  %27 = and i64 %4, 2147483647
  %28 = add nuw nsw i64 %4, 1
  %wide.trip.count83 = and i64 %28, 4294967295
  br label %.preheader59

.lr.ph64:                                         ; preds = %.lr.ph64.preheader, %.lr.ph64
  %indvars.iv72 = phi i64 [ 1, %.lr.ph64.preheader ], [ %indvars.iv.next73, %.lr.ph64 ]
  %29 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv72)
  %30 = load i8, ptr %29, align 1, !tbaa !13
  %31 = add nsw i64 %indvars.iv72, -1
  %32 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %31)
  %33 = load i8, ptr %32, align 1, !tbaa !13
  %34 = icmp eq i8 %30, %33
  %35 = zext i1 %34 to i32
  %36 = mul nuw nsw i64 %6, %31
  %37 = getelementptr inbounds i32, ptr %8, i64 %36
  %38 = getelementptr inbounds i32, ptr %37, i64 %indvars.iv72
  store i32 %35, ptr %38, align 4, !tbaa !5
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %exitcond76.not = icmp eq i64 %indvars.iv.next73, %wide.trip.count75
  br i1 %exitcond76.not, label %.preheader60, label %.lr.ph64, !llvm.loop !14

.preheader59:                                     ; preds = %.preheader59.preheader, %39
  %indvars.iv80 = phi i64 [ 3, %.preheader59.preheader ], [ %indvars.iv.next81, %39 ]
  br label %40

._crit_edge:                                      ; preds = %39, %.preheader61, %.preheader60
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #3
  store i32 1, ptr %2, align 4, !tbaa !5
  br i1 %9, label %.preheader.preheader, label %._crit_edge70

.preheader.preheader:                             ; preds = %._crit_edge
  %wide.trip.count94 = and i64 %4, 2147483647
  br label %.preheader

39:                                               ; preds = %55
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %exitcond84.not = icmp eq i64 %indvars.iv.next81, %wide.trip.count83
  br i1 %exitcond84.not, label %._crit_edge, label %.preheader59, !llvm.loop !15

40:                                               ; preds = %.preheader59, %55
  %indvars.iv77 = phi i64 [ 0, %.preheader59 ], [ %indvars.iv.next78, %55 ]
  %41 = add nuw nsw i64 %indvars.iv77, %indvars.iv80
  %42 = add nsw i64 %41, -1
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %43 = mul nuw nsw i64 %6, %indvars.iv.next78
  %44 = getelementptr inbounds i32, ptr %8, i64 %43
  %45 = getelementptr i32, ptr %44, i64 %41
  %46 = getelementptr i8, ptr %45, i64 -8
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %.not58 = icmp eq i32 %47, 0
  br i1 %.not58, label %54, label %48

48:                                               ; preds = %40
  %49 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv77)
  %50 = load i8, ptr %49, align 1, !tbaa !13
  %51 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %42)
  %52 = load i8, ptr %51, align 1, !tbaa !13
  %53 = icmp eq i8 %50, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %48, %40
  br label %55

55:                                               ; preds = %48, %54
  %.sink = phi i32 [ 0, %54 ], [ 1, %48 ]
  %56 = mul nuw nsw i64 %6, %indvars.iv77
  %57 = getelementptr inbounds i32, ptr %8, i64 %56
  %58 = getelementptr inbounds i32, ptr %57, i64 %42
  store i32 %.sink, ptr %58, align 4, !tbaa !5
  %59 = add nuw nsw i64 %indvars.iv.next78, %indvars.iv80
  %.not57 = icmp ugt i64 %59, %27
  br i1 %.not57, label %39, label %40, !llvm.loop !16

.preheader:                                       ; preds = %.preheader.preheader, %64
  %60 = phi i32 [ 1, %.preheader.preheader ], [ %76, %64 ]
  %indvars.iv85 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next86, %64 ]
  %61 = mul nuw nsw i64 %6, %indvars.iv85
  %62 = getelementptr inbounds i32, ptr %8, i64 %61
  br label %65

._crit_edge70:                                    ; preds = %64, %._crit_edge.thread, %._crit_edge
  %63 = phi i32 [ 1, %._crit_edge ], [ 1, %._crit_edge.thread ], [ %76, %64 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #3
  ret i32 %63

64:                                               ; preds = %75
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %exitcond95.not = icmp eq i64 %indvars.iv.next86, %wide.trip.count94
  br i1 %exitcond95.not, label %._crit_edge70, label %.preheader, !llvm.loop !17

65:                                               ; preds = %.preheader, %75
  %66 = phi i32 [ %60, %.preheader ], [ %76, %75 ]
  %indvars.iv87 = phi i64 [ %indvars.iv85, %.preheader ], [ %indvars.iv.next88, %75 ]
  %67 = getelementptr inbounds i32, ptr %62, i64 %indvars.iv87
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %.not56 = icmp eq i32 %68, 0
  br i1 %.not56, label %75, label %69

69:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  %70 = sub nuw nsw i64 %indvars.iv87, %indvars.iv85
  %71 = trunc i64 %70 to i32
  %72 = add i32 %71, 1
  store i32 %72, ptr %3, align 4, !tbaa !5
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %74 = load i32, ptr %73, align 4, !tbaa !5
  store i32 %74, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  br label %75

75:                                               ; preds = %65, %69
  %76 = phi i32 [ %66, %65 ], [ %74, %69 ]
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %exitcond92.not = icmp eq i64 %indvars.iv.next88, %wide.trip.count94
  br i1 %exitcond92.not, label %64, label %65, !llvm.loop !18
}

; 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 nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; 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 nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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


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