; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2018-19/Feb 2019/Gold/paintbarn.ll (Z5solvev)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.0" = type { i8 }

@val = external dso_local global [205 x [205 x i32]], align 16
@mx = external dso_local global [205 x [205 x i32]], align 16
@pre = external dso_local global [205 x i32], align 16
@suf = external dso_local global [205 x i32], align 16
@ans = external dso_local global i32, align 4

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z6getMaxSt6vectorIiSaIiEE(ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5ckmaxIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator.0", align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::vector", align 8
  %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
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #3
  store i32 1, ptr %1, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %74, %0
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = icmp slt i32 %16, 201
  br i1 %17, label %19, label %18

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

19:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #3
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #3
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 201, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %20 unwind label %26

20:                                               ; preds = %19
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %21 = load i32, ptr %1, align 4, !tbaa !5
  store i32 %21, ptr %7, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %61, %20
  %23 = load i32, ptr %7, align 4, !tbaa !5
  %24 = icmp slt i32 %23, 201
  br i1 %24, label %30, label %25

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

26:                                               ; preds = %19
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %5, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %6, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #3
  br label %77

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

31:                                               ; preds = %48, %30
  %32 = load i32, ptr %8, align 4, !tbaa !5
  %33 = icmp slt i32 %32, 201
  br i1 %33, label %35, label %34

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

35:                                               ; preds = %31
  %36 = load i32, ptr %7, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [205 x [205 x i32]], ptr @val, i64 0, i64 %37
  %39 = load i32, ptr %8, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [205 x i32], ptr %38, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = load i32, ptr %8, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %44) #3
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = add nsw i32 %46, %42
  store i32 %47, ptr %45, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %35
  %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 %31, !llvm.loop !9

51:                                               ; preds = %34
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %52 unwind label %64

52:                                               ; preds = %51
  %53 = invoke noundef i32 @_Z6getMaxSt6vectorIiSaIiEE(ptr noundef %9)
          to label %54 unwind label %68

54:                                               ; preds = %52
  %55 = load i32, ptr %1, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [205 x [205 x i32]], ptr @mx, i64 0, i64 %56
  %58 = load i32, ptr %7, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [205 x i32], ptr %57, i64 0, i64 %59
  store i32 %53, ptr %60, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #3
  br label %61

61:                                               ; preds = %54
  %62 = load i32, ptr %7, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %7, align 4, !tbaa !5
  br label %22, !llvm.loop !11

64:                                               ; preds = %51
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %5, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %6, align 4
  br label %72

68:                                               ; preds = %52
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %5, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %6, align 4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #3
  br label %72

72:                                               ; preds = %68, %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #3
  br label %77

73:                                               ; preds = %25
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #3
  br label %74

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

77:                                               ; preds = %72, %26
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #3
  br label %173

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

79:                                               ; preds = %113, %78
  %80 = load i32, ptr %10, align 4, !tbaa !5
  %81 = icmp slt i32 %80, 201
  br i1 %81, label %83, label %82

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

83:                                               ; preds = %79
  %84 = load i32, ptr %10, align 4, !tbaa !5
  %85 = sub nsw i32 %84, 1
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [205 x i32], ptr @pre, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = load i32, ptr %10, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [205 x i32], ptr @pre, i64 0, i64 %90
  store i32 %88, ptr %91, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %109, %83
  %93 = load i32, ptr %11, align 4, !tbaa !5
  %94 = load i32, ptr %10, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  %96 = icmp slt i32 %93, %95
  br i1 %96, label %98, label %97

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

98:                                               ; preds = %92
  %99 = load i32, ptr %10, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [205 x i32], ptr @pre, i64 0, i64 %100
  %102 = load i32, ptr %11, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [205 x [205 x i32]], ptr @mx, i64 0, i64 %103
  %105 = load i32, ptr %10, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [205 x i32], ptr %104, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  call void @_Z5ckmaxIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %101, i32 noundef %108)
  br label %109

109:                                              ; preds = %98
  %110 = load i32, ptr %11, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %11, align 4, !tbaa !5
  br label %92, !llvm.loop !13

112:                                              ; preds = %97
  br label %113

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

116:                                              ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  store i32 200, ptr %12, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %150, %116
  %118 = load i32, ptr %12, align 4, !tbaa !5
  %119 = icmp sge i32 %118, 1
  br i1 %119, label %121, label %120

120:                                              ; preds = %117
  store i32 17, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %153

121:                                              ; preds = %117
  %122 = load i32, ptr %12, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [205 x i32], ptr @suf, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = load i32, ptr %12, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [205 x i32], ptr @suf, i64 0, i64 %128
  store i32 %126, ptr %129, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %130 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %130, ptr %13, align 4, !tbaa !5
  br label %131

131:                                              ; preds = %146, %121
  %132 = load i32, ptr %13, align 4, !tbaa !5
  %133 = icmp slt i32 %132, 201
  br i1 %133, label %135, label %134

134:                                              ; preds = %131
  store i32 20, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  br label %149

135:                                              ; preds = %131
  %136 = load i32, ptr %12, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [205 x i32], ptr @suf, i64 0, i64 %137
  %139 = load i32, ptr %12, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [205 x [205 x i32]], ptr @mx, i64 0, i64 %140
  %142 = load i32, ptr %13, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [205 x i32], ptr %141, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  call void @_Z5ckmaxIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %138, i32 noundef %145)
  br label %146

146:                                              ; preds = %135
  %147 = load i32, ptr %13, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %13, align 4, !tbaa !5
  br label %131, !llvm.loop !15

149:                                              ; preds = %134
  br label %150

150:                                              ; preds = %149
  %151 = load i32, ptr %12, align 4, !tbaa !5
  %152 = add nsw i32 %151, -1
  store i32 %152, ptr %12, align 4, !tbaa !5
  br label %117, !llvm.loop !16

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

154:                                              ; preds = %169, %153
  %155 = load i32, ptr %14, align 4, !tbaa !5
  %156 = icmp slt i32 %155, 202
  br i1 %156, label %158, label %157

157:                                              ; preds = %154
  store i32 23, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  br label %172

158:                                              ; preds = %154
  %159 = load i32, ptr %14, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [205 x i32], ptr @suf, i64 0, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = load i32, ptr %14, align 4, !tbaa !5
  %164 = sub nsw i32 %163, 1
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [205 x i32], ptr @pre, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = add nsw i32 %162, %167
  call void @_Z5ckmaxIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %168)
  br label %169

169:                                              ; preds = %158
  %170 = load i32, ptr %14, align 4, !tbaa !5
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %14, align 4, !tbaa !5
  br label %154, !llvm.loop !17

172:                                              ; preds = %157
  ret void

173:                                              ; preds = %77
  %174 = load ptr, ptr %5, align 8
  %175 = load i32, ptr %6, align 4
  %176 = insertvalue { ptr, i32 } poison, ptr %174, 0
  %177 = insertvalue { ptr, i32 } %176, i32 %175, 1
  resume { ptr, i32 } %177
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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}


; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.0" = type { i8 }

@val = external dso_local local_unnamed_addr global [205 x [205 x i32]], align 16
@mx = external dso_local local_unnamed_addr global [205 x [205 x i32]], align 16
@pre = external dso_local global [205 x i32], align 16
@suf = external dso_local global [205 x i32], align 16
@ans = external dso_local global i32, align 4

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z6getMaxSt6vectorIiSaIiEE(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5ckmaxIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca %"class.std::allocator.0", align 1
  %3 = alloca %"class.std::vector", align 8
  br label %4

4:                                                ; preds = %0, %._crit_edge
  %indvars.iv64 = phi i64 [ 1, %0 ], [ %indvars.iv.next65, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #3
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #3
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 201, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %.preheader52.lr.ph unwind label %5

.preheader52.lr.ph:                               ; preds = %4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #3
  br label %.preheader52

.preheader52:                                     ; preds = %.preheader52.lr.ph, %16
  %indvars.iv66 = phi i64 [ %indvars.iv64, %.preheader52.lr.ph ], [ %indvars.iv.next67, %16 ]
  br label %8

._crit_edge:                                      ; preds = %16
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #3
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %exitcond71.not = icmp eq i64 %indvars.iv.next65, 201
  br i1 %exitcond71.not, label %.preheader51, label %4, !llvm.loop !5

5:                                                ; preds = %4
  %6 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #3
  br label %23

7:                                                ; preds = %8
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %1)
          to label %14 unwind label %18

8:                                                ; preds = %.preheader52, %8
  %indvars.iv = phi i64 [ 1, %.preheader52 ], [ %indvars.iv.next, %8 ]
  %9 = getelementptr inbounds [205 x [205 x i32]], ptr @val, i64 0, i64 %indvars.iv66, i64 %indvars.iv
  %10 = load i32, ptr %9, align 4, !tbaa !7
  %11 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #3
  %12 = load i32, ptr %11, align 4, !tbaa !7
  %13 = add nsw i32 %12, %10
  store i32 %13, ptr %11, align 4, !tbaa !7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 201
  br i1 %exitcond.not, label %7, label %8, !llvm.loop !11

14:                                               ; preds = %7
  %15 = invoke noundef i32 @_Z6getMaxSt6vectorIiSaIiEE(ptr noundef nonnull %3)
          to label %16 unwind label %20

16:                                               ; preds = %14
  %17 = getelementptr inbounds [205 x [205 x i32]], ptr @mx, i64 0, i64 %indvars.iv64, i64 %indvars.iv66
  store i32 %15, ptr %17, align 4, !tbaa !7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #3
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %exitcond69.not = icmp eq i64 %indvars.iv.next67, 201
  br i1 %exitcond69.not, label %._crit_edge, label %.preheader52, !llvm.loop !12

18:                                               ; preds = %7
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %22

20:                                               ; preds = %14
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #3
  br label %22

22:                                               ; preds = %20, %18
  %.pn = phi { ptr, i32 } [ %21, %20 ], [ %19, %18 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #3
  br label %23

23:                                               ; preds = %22, %5
  %.pn.pn = phi { ptr, i32 } [ %.pn, %22 ], [ %6, %5 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #3
  resume { ptr, i32 } %.pn.pn

.preheader51:                                     ; preds = %._crit_edge, %28
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %28 ], [ 1, %._crit_edge ]
  %indvars.iv78 = phi i64 [ %indvars.iv.next79, %28 ], [ 2, %._crit_edge ]
  %24 = add nsw i64 %indvars.iv80, -1
  %25 = getelementptr inbounds [205 x i32], ptr @pre, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !7
  %27 = getelementptr inbounds [205 x i32], ptr @pre, i64 0, i64 %indvars.iv80
  store i32 %26, ptr %27, align 4, !tbaa !7
  br label %29

28:                                               ; preds = %29
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %exitcond85.not = icmp eq i64 %indvars.iv.next81, 201
  br i1 %exitcond85.not, label %.lr.ph.preheader, label %.preheader51, !llvm.loop !13

29:                                               ; preds = %.preheader51, %29
  %indvars.iv72 = phi i64 [ 1, %.preheader51 ], [ %indvars.iv.next73, %29 ]
  %30 = getelementptr inbounds [205 x [205 x i32]], ptr @mx, i64 0, i64 %indvars.iv72, i64 %indvars.iv80
  %31 = load i32, ptr %30, align 4, !tbaa !7
  call void @_Z5ckmaxIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %27, i32 noundef %31)
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %exitcond77.not = icmp eq i64 %indvars.iv.next73, %indvars.iv78
  br i1 %exitcond77.not, label %28, label %29, !llvm.loop !14

.lr.ph.preheader:                                 ; preds = %28, %._crit_edge60
  %indvars.iv86 = phi i64 [ %indvars.iv.next87, %._crit_edge60 ], [ 200, %28 ]
  %32 = add nuw nsw i64 %indvars.iv86, 1
  %33 = getelementptr inbounds [205 x i32], ptr @suf, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !7
  %35 = getelementptr inbounds [205 x i32], ptr @suf, i64 0, i64 %indvars.iv86
  store i32 %34, ptr %35, align 4, !tbaa !7
  br label %.lr.ph

._crit_edge60:                                    ; preds = %.lr.ph
  %indvars.iv.next87 = add nsw i64 %indvars.iv86, -1
  %36 = icmp ugt i64 %indvars.iv86, 1
  br i1 %36, label %.lr.ph.preheader, label %.preheader, !llvm.loop !15

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv88 = phi i64 [ %indvars.iv86, %.lr.ph.preheader ], [ %indvars.iv.next89, %.lr.ph ]
  %37 = getelementptr inbounds [205 x [205 x i32]], ptr @mx, i64 0, i64 %indvars.iv86, i64 %indvars.iv88
  %38 = load i32, ptr %37, align 4, !tbaa !7
  call void @_Z5ckmaxIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %35, i32 noundef %38)
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond91.not = icmp eq i64 %indvars.iv.next89, 201
  br i1 %exitcond91.not, label %._crit_edge60, label %.lr.ph, !llvm.loop !16

39:                                               ; preds = %.preheader
  ret void

.preheader:                                       ; preds = %._crit_edge60, %.preheader
  %indvars.iv93 = phi i64 [ %indvars.iv.next94, %.preheader ], [ 1, %._crit_edge60 ]
  %40 = getelementptr inbounds [205 x i32], ptr @suf, i64 0, i64 %indvars.iv93
  %41 = load i32, ptr %40, align 4, !tbaa !7
  %42 = add nsw i64 %indvars.iv93, -1
  %43 = getelementptr inbounds [205 x i32], ptr @pre, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !7
  %45 = add nsw i32 %44, %41
  call void @_Z5ckmaxIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %45)
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %exitcond96.not = icmp eq i64 %indvars.iv.next94, 202
  br i1 %exitcond96.not, label %39, label %.preheader, !llvm.loop !17
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

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

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


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