; LLVM IR from Izaron/ACM-ICPC :: Timus Online Judge/Volume 2/1146. Maximum Sum (main)

; 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_istream" = type { ptr, i64, %"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_ostream" = type { ptr, %"class.std::basic_ios" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca [105 x [105 x i32]], align 16
  %3 = alloca [105 x [105 x i32]], align 16
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %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
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 44100, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 44100, ptr %3) #5
  %18 = getelementptr inbounds [105 x [105 x i32]], ptr %2, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %18, i8 0, i64 44100, i1 false)
  %19 = getelementptr inbounds [105 x [105 x i32]], ptr %3, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %19, i8 0, i64 44100, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 -1000000000, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %52, %0
  %22 = load i32, ptr %6, align 4, !tbaa !5
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = icmp sle i32 %22, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %55

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

27:                                               ; preds = %48, %26
  %28 = load i32, ptr %8, align 4, !tbaa !5
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = icmp sle i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %51

32:                                               ; preds = %27
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [105 x [105 x i32]], ptr %2, i64 0, i64 %34
  %36 = load i32, ptr %8, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [105 x i32], ptr %35, i64 0, i64 %37
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %38)
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [105 x [105 x i32]], ptr %2, i64 0, i64 %41
  %43 = load i32, ptr %8, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [105 x i32], ptr %42, i64 0, i64 %44
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %45)
  %47 = load i32, ptr %46, align 4, !tbaa !5
  store i32 %47, ptr %5, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %32
  %49 = load i32, ptr %8, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %8, align 4, !tbaa !5
  br label %27, !llvm.loop !9

51:                                               ; preds = %31
  br label %52

52:                                               ; preds = %51
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %6, align 4, !tbaa !5
  br label %21, !llvm.loop !11

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

56:                                               ; preds = %115, %55
  %57 = load i32, ptr %9, align 4, !tbaa !5
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = icmp sle i32 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %118

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

62:                                               ; preds = %111, %61
  %63 = load i32, ptr %10, align 4, !tbaa !5
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = icmp sle i32 %63, %64
  br i1 %65, label %67, label %66

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

67:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %99, %67
  %69 = load i32, ptr %11, align 4, !tbaa !5
  %70 = load i32, ptr %9, align 4, !tbaa !5
  %71 = icmp sle i32 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %102

73:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %95, %73
  %75 = load i32, ptr %12, align 4, !tbaa !5
  %76 = load i32, ptr %10, align 4, !tbaa !5
  %77 = icmp sle i32 %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  store i32 17, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %98

79:                                               ; preds = %74
  %80 = load i32, ptr %11, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [105 x [105 x i32]], ptr %2, i64 0, i64 %81
  %83 = load i32, ptr %12, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [105 x i32], ptr %82, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = load i32, ptr %9, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [105 x [105 x i32]], ptr %3, i64 0, i64 %88
  %90 = load i32, ptr %10, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [105 x i32], ptr %89, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = add nsw i32 %93, %86
  store i32 %94, ptr %92, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %79
  %96 = load i32, ptr %12, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %12, align 4, !tbaa !5
  br label %74, !llvm.loop !12

98:                                               ; preds = %78
  br label %99

99:                                               ; preds = %98
  %100 = load i32, ptr %11, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %11, align 4, !tbaa !5
  br label %68, !llvm.loop !13

102:                                              ; preds = %72
  %103 = load i32, ptr %9, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [105 x [105 x i32]], ptr %3, i64 0, i64 %104
  %106 = load i32, ptr %10, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [105 x i32], ptr %105, i64 0, i64 %107
  %109 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %108)
  %110 = load i32, ptr %109, align 4, !tbaa !5
  store i32 %110, ptr %5, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %102
  %112 = load i32, ptr %10, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %10, align 4, !tbaa !5
  br label %62, !llvm.loop !14

114:                                              ; preds = %66
  br label %115

115:                                              ; preds = %114
  %116 = load i32, ptr %9, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %9, align 4, !tbaa !5
  br label %56, !llvm.loop !15

118:                                              ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %193, %118
  %120 = load i32, ptr %13, align 4, !tbaa !5
  %121 = load i32, ptr %4, align 4, !tbaa !5
  %122 = icmp sle i32 %120, %121
  br i1 %122, label %124, label %123

123:                                              ; preds = %119
  store i32 20, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %196

124:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %189, %124
  %126 = load i32, ptr %14, align 4, !tbaa !5
  %127 = load i32, ptr %4, align 4, !tbaa !5
  %128 = icmp sle i32 %126, %127
  br i1 %128, label %130, label %129

129:                                              ; preds = %125
  store i32 23, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %192

130:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 1, ptr %15, align 4, !tbaa !5
  br label %131

131:                                              ; preds = %185, %130
  %132 = load i32, ptr %15, align 4, !tbaa !5
  %133 = load i32, ptr %13, align 4, !tbaa !5
  %134 = icmp sle i32 %132, %133
  br i1 %134, label %136, label %135

135:                                              ; preds = %131
  store i32 26, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %188

136:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 1, ptr %16, align 4, !tbaa !5
  br label %137

137:                                              ; preds = %181, %136
  %138 = load i32, ptr %16, align 4, !tbaa !5
  %139 = load i32, ptr %14, align 4, !tbaa !5
  %140 = icmp sle i32 %138, %139
  br i1 %140, label %142, label %141

141:                                              ; preds = %137
  store i32 29, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %184

142:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %143 = load i32, ptr %13, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [105 x [105 x i32]], ptr %3, i64 0, i64 %144
  %146 = load i32, ptr %16, align 4, !tbaa !5
  %147 = sub nsw i32 %146, 1
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [105 x i32], ptr %145, i64 0, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = load i32, ptr %15, align 4, !tbaa !5
  %152 = sub nsw i32 %151, 1
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [105 x [105 x i32]], ptr %3, i64 0, i64 %153
  %155 = load i32, ptr %14, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [105 x i32], ptr %154, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = add nsw i32 %150, %158
  %160 = load i32, ptr %15, align 4, !tbaa !5
  %161 = sub nsw i32 %160, 1
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [105 x [105 x i32]], ptr %3, i64 0, i64 %162
  %164 = load i32, ptr %16, align 4, !tbaa !5
  %165 = sub nsw i32 %164, 1
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [105 x i32], ptr %163, i64 0, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = sub nsw i32 %159, %168
  store i32 %169, ptr %17, align 4, !tbaa !5
  %170 = load i32, ptr %13, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [105 x [105 x i32]], ptr %3, i64 0, i64 %171
  %173 = load i32, ptr %14, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [105 x i32], ptr %172, i64 0, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !5
  %177 = load i32, ptr %17, align 4, !tbaa !5
  %178 = sub nsw i32 %176, %177
  store i32 %178, ptr %17, align 4, !tbaa !5
  %179 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %180 = load i32, ptr %179, align 4, !tbaa !5
  store i32 %180, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %181

181:                                              ; preds = %142
  %182 = load i32, ptr %16, align 4, !tbaa !5
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %16, align 4, !tbaa !5
  br label %137, !llvm.loop !16

184:                                              ; preds = %141
  br label %185

185:                                              ; preds = %184
  %186 = load i32, ptr %15, align 4, !tbaa !5
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %15, align 4, !tbaa !5
  br label %131, !llvm.loop !17

188:                                              ; preds = %135
  br label %189

189:                                              ; preds = %188
  %190 = load i32, ptr %14, align 4, !tbaa !5
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %14, align 4, !tbaa !5
  br label %125, !llvm.loop !18

192:                                              ; preds = %129
  br label %193

193:                                              ; preds = %192
  %194 = load i32, ptr %13, align 4, !tbaa !5
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr %13, align 4, !tbaa !5
  br label %119, !llvm.loop !19

196:                                              ; preds = %123
  %197 = load i32, ptr %5, align 4, !tbaa !5
  %198 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %197)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 44100, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 44100, ptr %2) #5
  %199 = load i32, ptr %1, align 4
  ret i32 %199
}

; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #3

; 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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { "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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


; 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_istream" = type { ptr, i64, %"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_ostream" = type { ptr, %"class.std::basic_ios" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca [105 x [105 x i32]], align 16
  %2 = alloca [105 x [105 x i32]], align 16
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 44100, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 44100, ptr nonnull %2) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(44100) %1, i8 0, i64 44100, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(44100) %2, i8 0, i64 44100, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %6 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  store i32 -1000000000, ptr %4, align 4, !tbaa !5
  %7 = load i32, ptr %3, align 4, !tbaa !5
  %.not71 = icmp slt i32 %7, 1
  br i1 %.not71, label %._crit_edge90, label %.preheader68

.preheader68:                                     ; preds = %0, %._crit_edge
  %8 = phi i32 [ %10, %._crit_edge ], [ -1000000000, %0 ]
  %9 = phi i32 [ %11, %._crit_edge ], [ %7, %0 ]
  %indvars.iv95 = phi i64 [ %indvars.iv.next96, %._crit_edge ], [ 1, %0 ]
  %.not6069 = icmp slt i32 %9, 1
  br i1 %.not6069, label %.preheader68.._crit_edge_crit_edge, label %.lr.ph

.preheader68.._crit_edge_crit_edge:               ; preds = %.preheader68
  %.pre153 = sext i32 %9 to i64
  br label %._crit_edge

.preheader67:                                     ; preds = %._crit_edge
  %.not5281 = icmp slt i32 %11, 1
  br i1 %.not5281, label %._crit_edge90, label %.preheader66

._crit_edge:                                      ; preds = %.lr.ph, %.preheader68.._crit_edge_crit_edge
  %.pre-phi154 = phi i64 [ %.pre153, %.preheader68.._crit_edge_crit_edge ], [ %17, %.lr.ph ]
  %10 = phi i32 [ %8, %.preheader68.._crit_edge_crit_edge ], [ %15, %.lr.ph ]
  %11 = phi i32 [ %9, %.preheader68.._crit_edge_crit_edge ], [ %16, %.lr.ph ]
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %.not.not = icmp slt i64 %indvars.iv95, %.pre-phi154
  br i1 %.not.not, label %.preheader68, label %.preheader67, !llvm.loop !9

.lr.ph:                                           ; preds = %.preheader68, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.preheader68 ]
  %12 = getelementptr inbounds [105 x [105 x i32]], ptr %1, i64 0, i64 %indvars.iv95, i64 %indvars.iv
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %14 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %15 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %15, ptr %4, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %16 = load i32, ptr %3, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %.not60.not = icmp slt i64 %indvars.iv, %17
  br i1 %.not60.not, label %.lr.ph, label %._crit_edge, !llvm.loop !12

.preheader66:                                     ; preds = %.preheader67, %._crit_edge80
  %18 = phi i32 [ %21, %._crit_edge80 ], [ %10, %.preheader67 ]
  %19 = phi i32 [ %22, %._crit_edge80 ], [ %11, %.preheader67 ]
  %indvars.iv119 = phi i64 [ %indvars.iv.next120, %._crit_edge80 ], [ 1, %.preheader67 ]
  %indvars.iv117 = phi i64 [ %indvars.iv.next118, %._crit_edge80 ], [ 2, %.preheader67 ]
  %.not5778 = icmp slt i32 %19, 1
  br i1 %.not5778, label %.preheader66.._crit_edge80_crit_edge, label %.preheader65

.preheader66.._crit_edge80_crit_edge:             ; preds = %.preheader66
  %.pre151 = sext i32 %19 to i64
  br label %._crit_edge80

.preheader63:                                     ; preds = %._crit_edge80
  %.not5388 = icmp slt i32 %22, 1
  br i1 %.not5388, label %._crit_edge90, label %.preheader62

.preheader65:                                     ; preds = %.preheader66, %30
  %indvars.iv112 = phi i64 [ %indvars.iv.next113, %30 ], [ 1, %.preheader66 ]
  %indvars.iv110 = phi i64 [ %indvars.iv.next111, %30 ], [ 2, %.preheader66 ]
  %20 = getelementptr inbounds [105 x [105 x i32]], ptr %2, i64 0, i64 %indvars.iv119, i64 %indvars.iv112
  %.promoted74 = load i32, ptr %20, align 4, !tbaa !5
  %min.iters.check = icmp ult i64 %indvars.iv112, 8
  %n.vec = and i64 %indvars.iv112, 9223372036854775800
  %ind.end = or disjoint i64 %n.vec, 1
  %cmp.n = icmp eq i64 %indvars.iv112, %n.vec
  br label %.preheader64

._crit_edge80:                                    ; preds = %30, %.preheader66.._crit_edge80_crit_edge
  %.pre-phi152 = phi i64 [ %.pre151, %.preheader66.._crit_edge80_crit_edge ], [ %34, %30 ]
  %21 = phi i32 [ %18, %.preheader66.._crit_edge80_crit_edge ], [ %32, %30 ]
  %22 = phi i32 [ %19, %.preheader66.._crit_edge80_crit_edge ], [ %33, %30 ]
  %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
  %.not52.not = icmp slt i64 %indvars.iv119, %.pre-phi152
  %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
  br i1 %.not52.not, label %.preheader66, label %.preheader63, !llvm.loop !13

.preheader64:                                     ; preds = %.preheader65, %.loopexit
  %indvars.iv103 = phi i64 [ 1, %.preheader65 ], [ %indvars.iv.next104, %.loopexit ]
  %.lcssa7576 = phi i32 [ %.promoted74, %.preheader65 ], [ %.lcssa175, %.loopexit ]
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader64
  %indvars.iv98.ph = phi i64 [ 1, %.preheader64 ], [ %ind.end, %middle.block ]
  %.ph = phi i32 [ %.lcssa7576, %.preheader64 ], [ %29, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.preheader64
  %23 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %.lcssa7576, i64 0
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ %23, %vector.ph ], [ %26, %vector.body ]
  %vec.phi186 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %27, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %24 = getelementptr inbounds [105 x [105 x i32]], ptr %1, i64 0, i64 %indvars.iv103, i64 %offset.idx
  %25 = getelementptr inbounds i8, ptr %24, i64 16
  %wide.load = load <4 x i32>, ptr %24, align 4, !tbaa !5
  %wide.load187 = load <4 x i32>, ptr %25, align 4, !tbaa !5
  %26 = add <4 x i32> %vec.phi, %wide.load
  %27 = add <4 x i32> %vec.phi186, %wide.load187
  %index.next = add nuw i64 %index, 8
  %28 = icmp eq i64 %index.next, %n.vec
  br i1 %28, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %27, %26
  %29 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  br i1 %cmp.n, label %.loopexit, label %scalar.ph.preheader

30:                                               ; preds = %.loopexit
  store i32 %.lcssa175, ptr %20, align 4, !tbaa !5
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %20)
  %32 = load i32, ptr %31, align 4, !tbaa !5
  store i32 %32, ptr %4, align 4, !tbaa !5
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %.not57.not = icmp slt i64 %indvars.iv112, %34
  %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
  br i1 %.not57.not, label %.preheader65, label %._crit_edge80, !llvm.loop !17

.loopexit:                                        ; preds = %scalar.ph, %middle.block
  %.lcssa175 = phi i32 [ %29, %middle.block ], [ %38, %scalar.ph ]
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %exitcond109.not = icmp eq i64 %indvars.iv.next104, %indvars.iv117
  br i1 %exitcond109.not, label %30, label %.preheader64, !llvm.loop !18

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv98 = phi i64 [ %indvars.iv.next99, %scalar.ph ], [ %indvars.iv98.ph, %scalar.ph.preheader ]
  %35 = phi i32 [ %38, %scalar.ph ], [ %.ph, %scalar.ph.preheader ]
  %36 = getelementptr inbounds [105 x [105 x i32]], ptr %1, i64 0, i64 %indvars.iv103, i64 %indvars.iv98
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = add nsw i32 %35, %37
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next99, %indvars.iv110
  br i1 %exitcond.not, label %.loopexit, label %scalar.ph, !llvm.loop !19

.preheader62:                                     ; preds = %.preheader63, %._crit_edge87
  %39 = phi i32 [ %44, %._crit_edge87 ], [ %21, %.preheader63 ]
  %40 = phi i32 [ %45, %._crit_edge87 ], [ %22, %.preheader63 ]
  %indvars.iv146 = phi i64 [ %indvars.iv.next147, %._crit_edge87 ], [ 1, %.preheader63 ]
  %indvars.iv144 = phi i64 [ %indvars.iv.next145, %._crit_edge87 ], [ 2, %.preheader63 ]
  %.not5485 = icmp slt i32 %40, 1
  br i1 %.not5485, label %.preheader62.._crit_edge87_crit_edge, label %.preheader61

.preheader62.._crit_edge87_crit_edge:             ; preds = %.preheader62
  %.pre = sext i32 %40 to i64
  br label %._crit_edge87

._crit_edge90:                                    ; preds = %._crit_edge87, %0, %.preheader67, %.preheader63
  %41 = phi i32 [ %21, %.preheader63 ], [ %10, %.preheader67 ], [ -1000000000, %0 ], [ %44, %._crit_edge87 ]
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %41)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 44100, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 44100, ptr nonnull %1) #6
  ret i32 0

.preheader61:                                     ; preds = %.preheader62, %48
  %indvars.iv139 = phi i64 [ %indvars.iv.next140, %48 ], [ 1, %.preheader62 ]
  %indvars.iv137 = phi i64 [ %indvars.iv.next138, %48 ], [ 2, %.preheader62 ]
  %43 = getelementptr inbounds [105 x [105 x i32]], ptr %2, i64 0, i64 %indvars.iv146, i64 %indvars.iv139
  br label %.preheader

._crit_edge87:                                    ; preds = %48, %.preheader62.._crit_edge87_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader62.._crit_edge87_crit_edge ], [ %50, %48 ]
  %44 = phi i32 [ %39, %.preheader62.._crit_edge87_crit_edge ], [ %63, %48 ]
  %45 = phi i32 [ %40, %.preheader62.._crit_edge87_crit_edge ], [ %49, %48 ]
  %indvars.iv.next147 = add nuw nsw i64 %indvars.iv146, 1
  %.not53.not = icmp slt i64 %indvars.iv146, %.pre-phi
  %indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 1
  br i1 %.not53.not, label %.preheader62, label %._crit_edge90, !llvm.loop !20

.preheader:                                       ; preds = %.preheader61, %51
  %indvars.iv130 = phi i64 [ 1, %.preheader61 ], [ %indvars.iv.next131, %51 ]
  %46 = add nsw i64 %indvars.iv130, -1
  %47 = getelementptr inbounds [105 x [105 x i32]], ptr %2, i64 0, i64 %46, i64 %indvars.iv139
  br label %52

48:                                               ; preds = %51
  %indvars.iv.next140 = add nuw nsw i64 %indvars.iv139, 1
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %.not54.not = icmp slt i64 %indvars.iv139, %50
  %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
  br i1 %.not54.not, label %.preheader61, label %._crit_edge87, !llvm.loop !21

51:                                               ; preds = %52
  %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
  %exitcond136.not = icmp eq i64 %indvars.iv.next131, %indvars.iv144
  br i1 %exitcond136.not, label %48, label %.preheader, !llvm.loop !22

52:                                               ; preds = %.preheader, %52
  %indvars.iv124 = phi i64 [ 1, %.preheader ], [ %indvars.iv.next125, %52 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %53 = add nsw i64 %indvars.iv124, -1
  %54 = getelementptr inbounds [105 x [105 x i32]], ptr %2, i64 0, i64 %indvars.iv146, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = load i32, ptr %47, align 4, !tbaa !5
  %57 = add nsw i32 %56, %55
  %58 = getelementptr inbounds [105 x [105 x i32]], ptr %2, i64 0, i64 %46, i64 %53
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %.neg = sub i32 %59, %57
  %60 = load i32, ptr %43, align 4, !tbaa !5
  %61 = add i32 %.neg, %60
  store i32 %61, ptr %5, align 4, !tbaa !5
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %63 = load i32, ptr %62, align 4, !tbaa !5
  store i32 %63, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
  %exitcond129.not = icmp eq i64 %indvars.iv.next125, %indvars.iv137
  br i1 %exitcond129.not, label %51, label %52, !llvm.loop !23
}

; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; 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 #4

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { "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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !11}
!14 = distinct !{!14, !10, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !16, !15}
!20 = distinct !{!20, !10, !11}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}


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