; LLVM IR from eyangch/competitive-programming :: GoogleCodeJam/2020Qual (vestigium)

; 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" }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@T = external dso_local global i32, align 4
@N = external dso_local global i32, align 4
@m = external dso_local global [100 x [100 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %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
  %10 = alloca %"class.std::set", align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.std::set", align 8
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::pair", align 8
  store i32 0, ptr %1, align 4
  %20 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %21 = getelementptr i8, ptr %20, i64 -24
  %22 = load i64, ptr %21, align 8
  %23 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %22
  %24 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %23, ptr noundef null)
  %25 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @T)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !8
  br label %27

27:                                               ; preds = %193, %0
  %28 = load i32, ptr %2, align 4, !tbaa !8
  %29 = load i32, ptr @T, align 4, !tbaa !8
  %30 = icmp sle i32 %28, %29
  br i1 %30, label %32, label %31

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

32:                                               ; preds = %27
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %34 = load i32, ptr %2, align 4, !tbaa !8
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %33, i32 noundef %34)
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef @.str.1)
  %37 = 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 %4) #6
  store i32 0, ptr %4, align 4, !tbaa !8
  br label %38

38:                                               ; preds = %61, %32
  %39 = load i32, ptr %4, align 4, !tbaa !8
  %40 = load i32, ptr @N, align 4, !tbaa !8
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

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

43:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !8
  br label %44

44:                                               ; preds = %57, %43
  %45 = load i32, ptr %5, align 4, !tbaa !8
  %46 = load i32, ptr @N, align 4, !tbaa !8
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %49, label %48

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

49:                                               ; preds = %44
  %50 = load i32, ptr %4, align 4, !tbaa !8
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %51
  %53 = load i32, ptr %5, align 4, !tbaa !8
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [100 x i32], ptr %52, i64 0, i64 %54
  %56 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %55)
  br label %57

57:                                               ; preds = %49
  %58 = load i32, ptr %5, align 4, !tbaa !8
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %5, align 4, !tbaa !8
  br label %44, !llvm.loop !11

60:                                               ; preds = %48
  br label %61

61:                                               ; preds = %60
  %62 = load i32, ptr %4, align 4, !tbaa !8
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %4, align 4, !tbaa !8
  br label %38, !llvm.loop !13

64:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !8
  br label %65

65:                                               ; preds = %80, %64
  %66 = load i32, ptr %7, align 4, !tbaa !8
  %67 = load i32, ptr @N, align 4, !tbaa !8
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %70, label %69

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

70:                                               ; preds = %65
  %71 = load i32, ptr %7, align 4, !tbaa !8
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %72
  %74 = load i32, ptr %7, align 4, !tbaa !8
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [100 x i32], ptr %73, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !8
  %78 = load i32, ptr %6, align 4, !tbaa !8
  %79 = add nsw i32 %78, %77
  store i32 %79, ptr %6, align 4, !tbaa !8
  br label %80

80:                                               ; preds = %70
  %81 = load i32, ptr %7, align 4, !tbaa !8
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %7, align 4, !tbaa !8
  br label %65, !llvm.loop !14

83:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !8
  br label %84

84:                                               ; preds = %130, %83
  %85 = load i32, ptr %9, align 4, !tbaa !8
  %86 = load i32, ptr @N, align 4, !tbaa !8
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %89, label %88

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

89:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 48, ptr %10) #6
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !8
  br label %90

90:                                               ; preds = %125, %89
  %91 = load i32, ptr %11, align 4, !tbaa !8
  %92 = load i32, ptr @N, align 4, !tbaa !8
  %93 = icmp slt i32 %91, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %90
  store i32 17, ptr %3, align 4
  br label %128

95:                                               ; preds = %90
  %96 = load i32, ptr %9, align 4, !tbaa !8
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %97
  %99 = load i32, ptr %11, align 4, !tbaa !8
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [100 x i32], ptr %98, i64 0, i64 %100
  %102 = invoke noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(48) %10, ptr noundef nonnull align 4 dereferenceable(4) %101)
          to label %103 unwind label %108

103:                                              ; preds = %95
  %104 = icmp ne i64 %102, 0
  br i1 %104, label %105, label %112

105:                                              ; preds = %103
  %106 = load i32, ptr %8, align 4, !tbaa !8
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %8, align 4, !tbaa !8
  store i32 17, ptr %3, align 4
  br label %128

108:                                              ; preds = %112, %95
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %12, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %10) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %196

112:                                              ; preds = %103
  %113 = load i32, ptr %9, align 4, !tbaa !8
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %114
  %116 = load i32, ptr %11, align 4, !tbaa !8
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [100 x i32], ptr %115, i64 0, i64 %117
  %119 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %10, ptr noundef nonnull align 4 dereferenceable(4) %118)
          to label %120 unwind label %108

120:                                              ; preds = %112
  %121 = getelementptr inbounds { ptr, i8 }, ptr %14, i32 0, i32 0
  %122 = extractvalue { ptr, i8 } %119, 0
  store ptr %122, ptr %121, align 8
  %123 = getelementptr inbounds { ptr, i8 }, ptr %14, i32 0, i32 1
  %124 = extractvalue { ptr, i8 } %119, 1
  store i8 %124, ptr %123, align 8
  br label %125

125:                                              ; preds = %120
  %126 = load i32, ptr %11, align 4, !tbaa !8
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %11, align 4, !tbaa !8
  br label %90, !llvm.loop !15

128:                                              ; preds = %105, %94
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %129

129:                                              ; preds = %128
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %10) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %10) #6
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %9, align 4, !tbaa !8
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %9, align 4, !tbaa !8
  br label %84, !llvm.loop !16

133:                                              ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !8
  br label %134

134:                                              ; preds = %180, %133
  %135 = load i32, ptr %16, align 4, !tbaa !8
  %136 = load i32, ptr @N, align 4, !tbaa !8
  %137 = icmp slt i32 %135, %136
  br i1 %137, label %139, label %138

138:                                              ; preds = %134
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %183

139:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 48, ptr %17) #6
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %17) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !8
  br label %140

140:                                              ; preds = %175, %139
  %141 = load i32, ptr %18, align 4, !tbaa !8
  %142 = load i32, ptr @N, align 4, !tbaa !8
  %143 = icmp slt i32 %141, %142
  br i1 %143, label %145, label %144

144:                                              ; preds = %140
  store i32 23, ptr %3, align 4
  br label %178

145:                                              ; preds = %140
  %146 = load i32, ptr %18, align 4, !tbaa !8
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %147
  %149 = load i32, ptr %16, align 4, !tbaa !8
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [100 x i32], ptr %148, i64 0, i64 %150
  %152 = invoke noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(48) %17, ptr noundef nonnull align 4 dereferenceable(4) %151)
          to label %153 unwind label %158

153:                                              ; preds = %145
  %154 = icmp ne i64 %152, 0
  br i1 %154, label %155, label %162

155:                                              ; preds = %153
  %156 = load i32, ptr %15, align 4, !tbaa !8
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %15, align 4, !tbaa !8
  store i32 23, ptr %3, align 4
  br label %178

158:                                              ; preds = %162, %145
  %159 = landingpad { ptr, i32 }
          cleanup
  %160 = extractvalue { ptr, i32 } %159, 0
  store ptr %160, ptr %12, align 8
  %161 = extractvalue { ptr, i32 } %159, 1
  store i32 %161, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %17) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %196

162:                                              ; preds = %153
  %163 = load i32, ptr %18, align 4, !tbaa !8
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %164
  %166 = load i32, ptr %16, align 4, !tbaa !8
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [100 x i32], ptr %165, i64 0, i64 %167
  %169 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %17, ptr noundef nonnull align 4 dereferenceable(4) %168)
          to label %170 unwind label %158

170:                                              ; preds = %162
  %171 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 0
  %172 = extractvalue { ptr, i8 } %169, 0
  store ptr %172, ptr %171, align 8
  %173 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 1
  %174 = extractvalue { ptr, i8 } %169, 1
  store i8 %174, ptr %173, align 8
  br label %175

175:                                              ; preds = %170
  %176 = load i32, ptr %18, align 4, !tbaa !8
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %18, align 4, !tbaa !8
  br label %140, !llvm.loop !17

178:                                              ; preds = %155, %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %179

179:                                              ; preds = %178
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %17) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %17) #6
  br label %180

180:                                              ; preds = %179
  %181 = load i32, ptr %16, align 4, !tbaa !8
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %16, align 4, !tbaa !8
  br label %134, !llvm.loop !18

183:                                              ; preds = %138
  %184 = load i32, ptr %6, align 4, !tbaa !8
  %185 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %184)
  %186 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %185, ptr noundef @.str.2)
  %187 = load i32, ptr %8, align 4, !tbaa !8
  %188 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %186, i32 noundef %187)
  %189 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %188, ptr noundef @.str.2)
  %190 = load i32, ptr %15, align 4, !tbaa !8
  %191 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %189, i32 noundef %190)
  %192 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %191, ptr noundef @.str.3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %193

193:                                              ; preds = %183
  %194 = load i32, ptr %2, align 4, !tbaa !8
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr %2, align 4, !tbaa !8
  br label %27, !llvm.loop !19

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

197:                                              ; preds = %31
  %198 = load i32, ptr %1, align 4
  ret i32 %198

199:                                              ; preds = %196
  %200 = load ptr, ptr %12, align 8
  %201 = load i32, ptr %13, align 4
  %202 = insertvalue { ptr, i32 } poison, ptr %200, 0
  %203 = insertvalue { ptr, i32 } %202, i32 %201, 1
  resume { ptr, i32 } %203
}

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

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #5 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #5 align 2

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

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 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"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" }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }

@T = external dso_local global i32, align 4
@N = external dso_local global i32, align 4
@m = external dso_local global [100 x [100 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::set", align 8
  %2 = alloca %"class.std::set", align 8
  %3 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %4 = getelementptr i8, ptr %3, i64 -24
  %5 = load i64, ptr %4, align 8
  %6 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %5
  %7 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %6, ptr noundef null)
  %8 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %9 = 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) @T)
  %10 = load i32, ptr @T, align 4, !tbaa !8
  %.not84 = icmp slt i32 %10, 1
  br i1 %.not84, label %._crit_edge88, label %.lr.ph87

._crit_edge88:                                    ; preds = %._crit_edge82, %0
  ret i32 0

.lr.ph87:                                         ; preds = %0, %._crit_edge82
  %.085 = phi i32 [ %90, %._crit_edge82 ], [ 1, %0 ]
  %11 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %12 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %11, i32 noundef %.085)
  %13 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull @.str.1)
  %14 = 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)
  %15 = load i32, ptr @N, align 4, !tbaa !8
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.preheader, label %._crit_edge82

.preheader58:                                     ; preds = %._crit_edge
  %17 = icmp sgt i32 %55, 0
  br i1 %17, label %.lr.ph65.preheader, label %._crit_edge82

.lr.ph65.preheader:                               ; preds = %.preheader58
  %wide.trip.count = zext nneg i32 %55 to i64
  %min.iters.check = icmp ult i32 %55, 8
  br i1 %min.iters.check, label %.lr.ph65.preheader129, label %vector.ph

.lr.ph65.preheader129:                            ; preds = %middle.block, %.lr.ph65.preheader
  %indvars.iv96.ph = phi i64 [ 0, %.lr.ph65.preheader ], [ %n.vec, %middle.block ]
  %.05163.ph = phi i32 [ 0, %.lr.ph65.preheader ], [ %52, %middle.block ]
  br label %.lr.ph65

vector.ph:                                        ; preds = %.lr.ph65.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  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> [ zeroinitializer, %vector.ph ], [ %49, %vector.body ]
  %vec.phi128 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %50, %vector.body ]
  %18 = or disjoint i64 %index, 1
  %19 = or disjoint i64 %index, 2
  %20 = or disjoint i64 %index, 3
  %21 = or disjoint i64 %index, 4
  %22 = or disjoint i64 %index, 5
  %23 = or disjoint i64 %index, 6
  %24 = or disjoint i64 %index, 7
  %25 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %index, i64 %index
  %26 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %18, i64 %18
  %27 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %19, i64 %19
  %28 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %20, i64 %20
  %29 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %21, i64 %21
  %30 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %22, i64 %22
  %31 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %23, i64 %23
  %32 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %24, i64 %24
  %33 = load i32, ptr %25, align 16, !tbaa !8
  %34 = load i32, ptr %26, align 4, !tbaa !8
  %35 = load i32, ptr %27, align 8, !tbaa !8
  %36 = load i32, ptr %28, align 4, !tbaa !8
  %37 = insertelement <4 x i32> poison, i32 %33, i64 0
  %38 = insertelement <4 x i32> %37, i32 %34, i64 1
  %39 = insertelement <4 x i32> %38, i32 %35, i64 2
  %40 = insertelement <4 x i32> %39, i32 %36, i64 3
  %41 = load i32, ptr %29, align 16, !tbaa !8
  %42 = load i32, ptr %30, align 4, !tbaa !8
  %43 = load i32, ptr %31, align 8, !tbaa !8
  %44 = load i32, ptr %32, align 4, !tbaa !8
  %45 = insertelement <4 x i32> poison, i32 %41, i64 0
  %46 = insertelement <4 x i32> %45, i32 %42, i64 1
  %47 = insertelement <4 x i32> %46, i32 %43, i64 2
  %48 = insertelement <4 x i32> %47, i32 %44, i64 3
  %49 = add <4 x i32> %40, %vec.phi
  %50 = add <4 x i32> %48, %vec.phi128
  %index.next = add nuw i64 %index, 8
  %51 = icmp eq i64 %index.next, %n.vec
  br i1 %51, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %50, %49
  %52 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader57, label %.lr.ph65.preheader129

.preheader:                                       ; preds = %.lr.ph87, %._crit_edge
  %53 = phi i32 [ %55, %._crit_edge ], [ %15, %.lr.ph87 ]
  %indvars.iv93 = phi i64 [ %indvars.iv.next94, %._crit_edge ], [ 0, %.lr.ph87 ]
  %54 = icmp sgt i32 %53, 0
  br i1 %54, label %.lr.ph, label %.preheader.._crit_edge_crit_edge

.preheader.._crit_edge_crit_edge:                 ; preds = %.preheader
  %.pre = sext i32 %53 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.preheader.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader.._crit_edge_crit_edge ], [ %60, %.lr.ph ]
  %55 = phi i32 [ %53, %.preheader.._crit_edge_crit_edge ], [ %59, %.lr.ph ]
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %56 = icmp slt i64 %indvars.iv.next94, %.pre-phi
  br i1 %56, label %.preheader, label %.preheader58, !llvm.loop !15

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader ]
  %57 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %indvars.iv93, i64 %indvars.iv
  %58 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %57)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %59 = load i32, ptr @N, align 4, !tbaa !8
  %60 = sext i32 %59 to i64
  %61 = icmp slt i64 %indvars.iv.next, %60
  br i1 %61, label %.lr.ph, label %._crit_edge, !llvm.loop !17

.preheader57:                                     ; preds = %.lr.ph65, %middle.block
  %.lcssa126 = phi i32 [ %52, %middle.block ], [ %64, %.lr.ph65 ]
  br label %.lr.ph73

.lr.ph65:                                         ; preds = %.lr.ph65.preheader129, %.lr.ph65
  %indvars.iv96 = phi i64 [ %indvars.iv.next97, %.lr.ph65 ], [ %indvars.iv96.ph, %.lr.ph65.preheader129 ]
  %.05163 = phi i32 [ %64, %.lr.ph65 ], [ %.05163.ph, %.lr.ph65.preheader129 ]
  %62 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %indvars.iv96, i64 %indvars.iv96
  %63 = load i32, ptr %62, align 4, !tbaa !8
  %64 = add nsw i32 %63, %.05163
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next97, %wide.trip.count
  br i1 %exitcond.not, label %.preheader57, label %.lr.ph65, !llvm.loop !18

.preheader56:                                     ; preds = %.loopexit55
  %65 = icmp sgt i32 %81, 0
  br i1 %65, label %.lr.ph81, label %._crit_edge82

.lr.ph73:                                         ; preds = %.preheader57, %.loopexit55
  %indvars.iv102 = phi i64 [ %indvars.iv.next103, %.loopexit55 ], [ 0, %.preheader57 ]
  %.04870 = phi i32 [ %.149, %.loopexit55 ], [ 0, %.preheader57 ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %1) #7
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #7
  %66 = load i32, ptr @N, align 4, !tbaa !8
  %67 = icmp sgt i32 %66, 0
  br i1 %67, label %.lr.ph69, label %.loopexit55

.lr.ph69:                                         ; preds = %.lr.ph73, %77
  %indvars.iv99 = phi i64 [ %indvars.iv.next100, %77 ], [ 0, %.lr.ph73 ]
  %68 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %indvars.iv102, i64 %indvars.iv99
  %69 = invoke noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %68)
          to label %70 unwind label %73

70:                                               ; preds = %.lr.ph69
  %.not53 = icmp eq i64 %69, 0
  br i1 %.not53, label %75, label %71

71:                                               ; preds = %70
  %72 = add nsw i32 %.04870, 1
  br label %.loopexit55

73:                                               ; preds = %75, %.lr.ph69
  %74 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #7
  br label %110

75:                                               ; preds = %70
  %76 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %68)
          to label %77 unwind label %73

77:                                               ; preds = %75
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %78 = load i32, ptr @N, align 4, !tbaa !8
  %79 = sext i32 %78 to i64
  %80 = icmp slt i64 %indvars.iv.next100, %79
  br i1 %80, label %.lr.ph69, label %.loopexit55, !llvm.loop !19

.loopexit55:                                      ; preds = %77, %.lr.ph73, %71
  %.149 = phi i32 [ %72, %71 ], [ %.04870, %.lr.ph73 ], [ %.04870, %77 ]
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #7
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %81 = load i32, ptr @N, align 4, !tbaa !8
  %82 = sext i32 %81 to i64
  %83 = icmp slt i64 %indvars.iv.next103, %82
  br i1 %83, label %.lr.ph73, label %.preheader56, !llvm.loop !20

._crit_edge82:                                    ; preds = %.loopexit, %.lr.ph87, %.preheader58, %.preheader56
  %.048.lcssa119 = phi i32 [ %.149, %.preheader56 ], [ 0, %.preheader58 ], [ 0, %.lr.ph87 ], [ %.149, %.loopexit ]
  %.051.lcssa115118 = phi i32 [ %.lcssa126, %.preheader56 ], [ 0, %.preheader58 ], [ 0, %.lr.ph87 ], [ %.lcssa126, %.loopexit ]
  %.041.lcssa = phi i32 [ 0, %.preheader56 ], [ 0, %.preheader58 ], [ 0, %.lr.ph87 ], [ %.1, %.loopexit ]
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.051.lcssa115118)
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %84, ptr noundef nonnull @.str.2)
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %85, i32 noundef %.048.lcssa119)
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %86, ptr noundef nonnull @.str.2)
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %87, i32 noundef %.041.lcssa)
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %88, ptr noundef nonnull @.str.3)
  %90 = add nuw nsw i32 %.085, 1
  %91 = load i32, ptr @T, align 4, !tbaa !8
  %.not.not = icmp slt i32 %.085, %91
  br i1 %.not.not, label %.lr.ph87, label %._crit_edge88, !llvm.loop !21

.lr.ph81:                                         ; preds = %.preheader56, %.loopexit
  %indvars.iv108 = phi i64 [ %indvars.iv.next109, %.loopexit ], [ 0, %.preheader56 ]
  %.04178 = phi i32 [ %.1, %.loopexit ], [ 0, %.preheader56 ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %2) #7
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  %92 = load i32, ptr @N, align 4, !tbaa !8
  %93 = icmp sgt i32 %92, 0
  br i1 %93, label %.lr.ph77, label %.loopexit

.lr.ph77:                                         ; preds = %.lr.ph81, %103
  %indvars.iv105 = phi i64 [ %indvars.iv.next106, %103 ], [ 0, %.lr.ph81 ]
  %94 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %indvars.iv105, i64 %indvars.iv108
  %95 = invoke noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 4 dereferenceable(4) %94)
          to label %96 unwind label %99

96:                                               ; preds = %.lr.ph77
  %.not52 = icmp eq i64 %95, 0
  br i1 %.not52, label %101, label %97

97:                                               ; preds = %96
  %98 = add nsw i32 %.04178, 1
  br label %.loopexit

99:                                               ; preds = %101, %.lr.ph77
  %100 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #7
  br label %110

101:                                              ; preds = %96
  %102 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 4 dereferenceable(4) %94)
          to label %103 unwind label %99

103:                                              ; preds = %101
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %104 = load i32, ptr @N, align 4, !tbaa !8
  %105 = sext i32 %104 to i64
  %106 = icmp slt i64 %indvars.iv.next106, %105
  br i1 %106, label %.lr.ph77, label %.loopexit, !llvm.loop !22

.loopexit:                                        ; preds = %103, %.lr.ph81, %97
  %.1 = phi i32 [ %98, %97 ], [ %.04178, %.lr.ph81 ], [ %.04178, %103 ]
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #7
  %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
  %107 = load i32, ptr @N, align 4, !tbaa !8
  %108 = sext i32 %107 to i64
  %109 = icmp slt i64 %indvars.iv.next109, %108
  br i1 %109, label %.lr.ph81, label %._crit_edge82, !llvm.loop !23

110:                                              ; preds = %99, %73
  %.pn = phi { ptr, i32 } [ %74, %73 ], [ %100, %99 ]
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #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 #2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x 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 = { 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 #2 = { "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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12, !16}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12, !14, !13}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}


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