; LLVM IR from upupming/algorithm :: acwing/算法竞赛进阶指南/0x08-总结与练习/126. 最大的和 (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" }

@n = external dso_local global i32, align 4
@a = external dso_local global [110 x [110 x i32]], align 16
@s = external dso_local global [110 x [110 x i32]], align 16
@f = external dso_local global [110 x i32], align 16
@_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 i32, align 4
  %3 = alloca i32, align 4
  %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
  store i32 0, ptr %1, align 4
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %75, %0
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = icmp sle i32 %12, %13
  br i1 %14, label %16, label %15

15:                                               ; preds = %11
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %78

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

17:                                               ; preds = %71, %16
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = icmp sle i32 %18, %19
  br i1 %20, label %22, label %21

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

22:                                               ; preds = %17
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [110 x [110 x i32]], ptr @a, i64 0, i64 %24
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [110 x i32], ptr %25, i64 0, i64 %27
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %28)
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sub nsw i32 %30, 1
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %32
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [110 x i32], ptr %33, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %39
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = sub nsw i32 %41, 1
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [110 x i32], ptr %40, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = add nsw i32 %37, %45
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = sub nsw i32 %47, 1
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %49
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = sub nsw i32 %51, 1
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [110 x i32], ptr %50, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = sub nsw i32 %46, %55
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [110 x [110 x i32]], ptr @a, i64 0, i64 %58
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [110 x i32], ptr %59, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = add nsw i32 %56, %63
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %66
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [110 x i32], ptr %67, i64 0, i64 %69
  store i32 %64, ptr %70, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %22
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %4, align 4, !tbaa !5
  br label %17, !llvm.loop !9

74:                                               ; preds = %21
  br label %75

75:                                               ; preds = %74
  %76 = load i32, ptr %2, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !11

78:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %79 = load i32, ptr getelementptr inbounds ([110 x i32], ptr getelementptr inbounds ([110 x [110 x i32]], ptr @a, i64 0, i64 1), i64 0, i64 1), align 4, !tbaa !5
  store i32 %79, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %204, %78
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = load i32, ptr @n, align 4, !tbaa !5
  %83 = icmp sle i32 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %207

85:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %86 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %86, ptr %7, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %200, %85
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = load i32, ptr @n, align 4, !tbaa !5
  %90 = icmp sle i32 %88, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %87
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %203

92:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  %93 = load i32, ptr %7, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %94
  %96 = load i32, ptr %8, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [110 x i32], ptr %95, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %101
  %103 = load i32, ptr %8, align 4, !tbaa !5
  %104 = sub nsw i32 %103, 1
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [110 x i32], ptr %102, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = sub nsw i32 %99, %107
  %109 = load i32, ptr %6, align 4, !tbaa !5
  %110 = sub nsw i32 %109, 1
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %111
  %113 = load i32, ptr %8, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [110 x i32], ptr %112, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = sub nsw i32 %108, %116
  %118 = load i32, ptr %6, align 4, !tbaa !5
  %119 = sub nsw i32 %118, 1
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %120
  %122 = load i32, ptr %8, align 4, !tbaa !5
  %123 = sub nsw i32 %122, 1
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [110 x i32], ptr %121, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = add nsw i32 %117, %126
  store i32 %127, ptr getelementptr inbounds ([110 x i32], ptr @f, i64 0, i64 1), align 4, !tbaa !5
  store i32 2, ptr %8, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %196, %92
  %129 = load i32, ptr %8, align 4, !tbaa !5
  %130 = load i32, ptr @n, align 4, !tbaa !5
  %131 = icmp sle i32 %129, %130
  br i1 %131, label %132, label %199

132:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %133 = load i32, ptr %7, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %134
  %136 = load i32, ptr %8, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [110 x i32], ptr %135, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = load i32, ptr %7, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %141
  %143 = load i32, ptr %8, align 4, !tbaa !5
  %144 = sub nsw i32 %143, 1
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [110 x i32], ptr %142, i64 0, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = sub nsw i32 %139, %147
  %149 = load i32, ptr %6, align 4, !tbaa !5
  %150 = sub nsw i32 %149, 1
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %151
  %153 = load i32, ptr %8, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [110 x i32], ptr %152, i64 0, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = sub nsw i32 %148, %156
  %158 = load i32, ptr %6, align 4, !tbaa !5
  %159 = sub nsw i32 %158, 1
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %160
  %162 = load i32, ptr %8, align 4, !tbaa !5
  %163 = sub nsw i32 %162, 1
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [110 x i32], ptr %161, i64 0, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %167 = add nsw i32 %157, %166
  store i32 %167, ptr %9, align 4, !tbaa !5
  %168 = load i32, ptr %8, align 4, !tbaa !5
  %169 = sub nsw i32 %168, 1
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [110 x i32], ptr @f, i64 0, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !5
  %173 = icmp sgt i32 %172, 0
  br i1 %173, label %174, label %185

174:                                              ; preds = %132
  %175 = load i32, ptr %8, align 4, !tbaa !5
  %176 = sub nsw i32 %175, 1
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [110 x i32], ptr @f, i64 0, i64 %177
  %179 = load i32, ptr %178, align 4, !tbaa !5
  %180 = load i32, ptr %9, align 4, !tbaa !5
  %181 = add nsw i32 %179, %180
  %182 = load i32, ptr %8, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [110 x i32], ptr @f, i64 0, i64 %183
  store i32 %181, ptr %184, align 4, !tbaa !5
  br label %190

185:                                              ; preds = %132
  %186 = load i32, ptr %9, align 4, !tbaa !5
  %187 = load i32, ptr %8, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [110 x i32], ptr @f, i64 0, i64 %188
  store i32 %186, ptr %189, align 4, !tbaa !5
  br label %190

190:                                              ; preds = %185, %174
  %191 = load i32, ptr %8, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [110 x i32], ptr @f, i64 0, i64 %192
  %194 = 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) %193)
  %195 = load i32, ptr %194, align 4, !tbaa !5
  store i32 %195, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %196

196:                                              ; preds = %190
  %197 = load i32, ptr %8, align 4, !tbaa !5
  %198 = add nsw i32 %197, 1
  store i32 %198, ptr %8, align 4, !tbaa !5
  br label %128, !llvm.loop !12

199:                                              ; preds = %128
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %200

200:                                              ; preds = %199
  %201 = load i32, ptr %7, align 4, !tbaa !5
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %7, align 4, !tbaa !5
  br label %87, !llvm.loop !13

203:                                              ; preds = %91
  br label %204

204:                                              ; preds = %203
  %205 = load i32, ptr %6, align 4, !tbaa !5
  %206 = add nsw i32 %205, 1
  store i32 %206, ptr %6, align 4, !tbaa !5
  br label %80, !llvm.loop !14

207:                                              ; preds = %84
  %208 = load i32, ptr %5, align 4, !tbaa !5
  %209 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %208)
  %210 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %209, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  %211 = load i32, ptr %1, align 4
  ret i32 %211
}

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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)) #3

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { 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 #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}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !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" }

@n = external dso_local global i32, align 4
@a = external dso_local global [110 x [110 x i32]], align 16
@s = external dso_local local_unnamed_addr global [110 x [110 x i32]], align 16
@f = external dso_local global [110 x i32], align 16
@_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 i32, align 4
  %2 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %3 = load i32, ptr @n, align 4, !tbaa !5
  %.not65 = icmp slt i32 %3, 1
  br i1 %.not65, label %._crit_edge67.thread, label %.preheader62

._crit_edge67.thread:                             ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %4 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 444), align 4, !tbaa !5
  store i32 %4, ptr %1, align 4, !tbaa !5
  br label %._crit_edge85

.preheader62:                                     ; preds = %0, %._crit_edge
  %5 = phi i32 [ %8, %._crit_edge ], [ %3, %0 ]
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %._crit_edge ], [ 1, %0 ]
  %.not5563 = icmp slt i32 %5, 1
  br i1 %.not5563, label %.preheader62.._crit_edge_crit_edge, label %.lr.ph

.preheader62.._crit_edge_crit_edge:               ; preds = %.preheader62
  %.pre102 = sext i32 %5 to i64
  br label %._crit_edge

.lr.ph:                                           ; preds = %.preheader62
  %6 = add nsw i64 %indvars.iv88, -1
  br label %9

._crit_edge67:                                    ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %7 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 444), align 4, !tbaa !5
  store i32 %7, ptr %1, align 4, !tbaa !5
  %.not5282 = icmp slt i32 %8, 1
  br i1 %.not5282, label %._crit_edge85, label %.preheader

._crit_edge:                                      ; preds = %9, %.preheader62.._crit_edge_crit_edge
  %.pre-phi103 = phi i64 [ %.pre102, %.preheader62.._crit_edge_crit_edge ], [ %25, %9 ]
  %8 = phi i32 [ %5, %.preheader62.._crit_edge_crit_edge ], [ %24, %9 ]
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %.not.not = icmp slt i64 %indvars.iv88, %.pre-phi103
  br i1 %.not.not, label %.preheader62, label %._crit_edge67, !llvm.loop !9

9:                                                ; preds = %.lr.ph, %9
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %9 ]
  %10 = getelementptr inbounds [110 x [110 x i32]], ptr @a, i64 0, i64 %indvars.iv88, i64 %indvars.iv
  %11 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %12 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %6, i64 %indvars.iv
  %13 = load i32, ptr %12, align 4, !tbaa !5
  %14 = add nsw i64 %indvars.iv, -1
  %15 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %indvars.iv88, i64 %14
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = add nsw i32 %16, %13
  %18 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %6, i64 %14
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = sub i32 %17, %19
  %21 = load i32, ptr %10, align 4, !tbaa !5
  %22 = add nsw i32 %20, %21
  %23 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %indvars.iv88, i64 %indvars.iv
  store i32 %22, ptr %23, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %24 = load i32, ptr @n, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %.not55.not = icmp slt i64 %indvars.iv, %25
  br i1 %.not55.not, label %9, label %._crit_edge, !llvm.loop !12

.preheader:                                       ; preds = %._crit_edge67, %._crit_edge76
  %26 = phi i32 [ %47, %._crit_edge76 ], [ %7, %._crit_edge67 ]
  %27 = phi i32 [ %48, %._crit_edge76 ], [ %8, %._crit_edge67 ]
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %._crit_edge76 ], [ 1, %._crit_edge67 ]
  %28 = sext i32 %27 to i64
  %.not5373 = icmp sgt i64 %indvars.iv94, %28
  br i1 %.not5373, label %._crit_edge76, label %.lr.ph75

.lr.ph75:                                         ; preds = %.preheader
  %29 = add nsw i64 %indvars.iv94, -1
  %30 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %29
  %31 = getelementptr inbounds i8, ptr %30, i64 4
  %32 = icmp slt i32 %27, 2
  br i1 %32, label %.lr.ph75.split.us, label %.lr.ph75.split

.lr.ph75.split.us:                                ; preds = %.lr.ph75
  %33 = load i32, ptr %31, align 4, !tbaa !5
  %34 = load i32, ptr %30, align 8, !tbaa !5
  %35 = trunc nuw nsw i64 %indvars.iv94 to i32
  %smax = call i32 @llvm.smax.i32(i32 %27, i32 %35)
  %36 = zext nneg i32 %smax to i64
  %37 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %36
  %38 = getelementptr inbounds i8, ptr %37, i64 4
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = load i32, ptr %37, align 8, !tbaa !5
  %41 = add i32 %40, %33
  %42 = sub i32 %39, %41
  %43 = add nsw i32 %42, %34
  store i32 %43, ptr getelementptr inbounds (i8, ptr @f, i64 4), align 4, !tbaa !5
  br label %._crit_edge76

._crit_edge85:                                    ; preds = %._crit_edge76, %._crit_edge67.thread, %._crit_edge67
  %44 = phi i32 [ %7, %._crit_edge67 ], [ %4, %._crit_edge67.thread ], [ %47, %._crit_edge76 ]
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %44)
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %45, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

._crit_edge76.loopexit:                           ; preds = %._crit_edge72
  %.pre = sext i32 %82 to i64
  br label %._crit_edge76

._crit_edge76:                                    ; preds = %._crit_edge76.loopexit, %.lr.ph75.split.us, %.preheader
  %.pre-phi = phi i64 [ %.pre, %._crit_edge76.loopexit ], [ %28, %.lr.ph75.split.us ], [ %28, %.preheader ]
  %47 = phi i32 [ %81, %._crit_edge76.loopexit ], [ %26, %.lr.ph75.split.us ], [ %26, %.preheader ]
  %48 = phi i32 [ %82, %._crit_edge76.loopexit ], [ %27, %.lr.ph75.split.us ], [ %27, %.preheader ]
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %.not52.not = icmp slt i64 %indvars.iv94, %.pre-phi
  br i1 %.not52.not, label %.preheader, label %._crit_edge85, !llvm.loop !13

.lr.ph75.split:                                   ; preds = %.lr.ph75, %._crit_edge72
  %49 = phi i32 [ %81, %._crit_edge72 ], [ %26, %.lr.ph75 ]
  %50 = phi i32 [ %82, %._crit_edge72 ], [ %27, %.lr.ph75 ]
  %51 = phi i32 [ %83, %._crit_edge72 ], [ %27, %.lr.ph75 ]
  %indvars.iv96 = phi i64 [ %indvars.iv.next97, %._crit_edge72 ], [ %indvars.iv94, %.lr.ph75 ]
  %52 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %indvars.iv96
  %53 = getelementptr inbounds i8, ptr %52, i64 4
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = load i32, ptr %52, align 8, !tbaa !5
  %56 = load i32, ptr %31, align 4, !tbaa !5
  %57 = load i32, ptr %30, align 8, !tbaa !5
  %58 = add i32 %55, %56
  %59 = sub i32 %54, %58
  %60 = add nsw i32 %59, %57
  store i32 %60, ptr getelementptr inbounds (i8, ptr @f, i64 4), align 4, !tbaa !5
  %.not5468 = icmp slt i32 %51, 2
  br i1 %.not5468, label %.lr.ph75.split.._crit_edge72_crit_edge, label %.lr.ph71

.lr.ph75.split.._crit_edge72_crit_edge:           ; preds = %.lr.ph75.split
  %.pre100 = sext i32 %51 to i64
  br label %._crit_edge72

.lr.ph71:                                         ; preds = %.lr.ph75.split, %.lr.ph71
  %indvars.iv91 = phi i64 [ %indvars.iv.next92, %.lr.ph71 ], [ 2, %.lr.ph75.split ]
  %61 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %indvars.iv96, i64 %indvars.iv91
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = add nsw i64 %indvars.iv91, -1
  %64 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %indvars.iv96, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %29, i64 %indvars.iv91
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = getelementptr inbounds [110 x [110 x i32]], ptr @s, i64 0, i64 %29, i64 %63
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = add i32 %65, %67
  %71 = sub i32 %62, %70
  %72 = add nsw i32 %71, %69
  %73 = getelementptr inbounds [110 x i32], ptr @f, i64 0, i64 %63
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = call i32 @llvm.smax.i32(i32 %74, i32 0)
  %spec.select = add nsw i32 %72, %75
  %76 = getelementptr inbounds [110 x i32], ptr @f, i64 0, i64 %indvars.iv91
  store i32 %spec.select, ptr %76, align 4
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %76)
  %78 = load i32, ptr %77, align 4, !tbaa !5
  store i32 %78, ptr %1, align 4, !tbaa !5
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %79 = load i32, ptr @n, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %.not54.not = icmp slt i64 %indvars.iv91, %80
  br i1 %.not54.not, label %.lr.ph71, label %._crit_edge72, !llvm.loop !14

._crit_edge72:                                    ; preds = %.lr.ph71, %.lr.ph75.split.._crit_edge72_crit_edge
  %.pre-phi101 = phi i64 [ %.pre100, %.lr.ph75.split.._crit_edge72_crit_edge ], [ %80, %.lr.ph71 ]
  %81 = phi i32 [ %49, %.lr.ph75.split.._crit_edge72_crit_edge ], [ %78, %.lr.ph71 ]
  %82 = phi i32 [ %50, %.lr.ph75.split.._crit_edge72_crit_edge ], [ %79, %.lr.ph71 ]
  %83 = phi i32 [ %51, %.lr.ph75.split.._crit_edge72_crit_edge ], [ %79, %.lr.ph71 ]
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %.not53.not = icmp slt i64 %indvars.iv96, %.pre-phi101
  br i1 %.not53.not, label %.lr.ph75.split, label %._crit_edge76.loopexit, !llvm.loop !15
}

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 #1

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 #3

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !11}


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