; LLVM IR from ShahjalalShohag/code-library :: Miscellaneous (MEX of all Subarrays)

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

%struct.ST = type { [400036 x i32] }
%"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<std::array<int, 3>, std::array<int, 3>, std::_Identity<std::array<int, 3>>, std::less<std::array<int, 3>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::array<int, 3>, std::array<int, 3>, std::_Identity<std::array<int, 3>>, std::less<std::array<int, 3>>>::_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::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::array" = type { [3 x i32] }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>

@t = external dso_local global %struct.ST, align 4
@a = external dso_local global [100009 x i32], align 16
@f = external dso_local global [100009 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 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::set", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %15 = alloca %"struct.std::array", align 4
  %16 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %17 = alloca %"struct.std::array", align 4
  %18 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %19 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca %"struct.std::array", align 4
  %25 = alloca %"struct.std::pair", align 8
  %26 = alloca i32, align 4
  %27 = alloca %"struct.std::array", align 4
  %28 = alloca %"struct.std::pair", align 8
  %29 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %30 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %31 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %32 = getelementptr i8, ptr %31, i64 -24
  %33 = load i64, ptr %32, align 8
  %34 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %33
  %35 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %34, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 1, ptr %3, align 4, !tbaa !8
  br label %37

37:                                               ; preds = %52, %0
  %38 = load i32, ptr %3, align 4, !tbaa !8
  %39 = load i32, ptr %2, align 4, !tbaa !8
  %40 = icmp sle i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %55

42:                                               ; preds = %37
  %43 = load i32, ptr %3, align 4, !tbaa !8
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100009 x i32], ptr @a, i64 0, i64 %44
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %45)
  %47 = load i32, ptr %3, align 4, !tbaa !8
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [100009 x i32], ptr @a, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !8
  %51 = add nsw i32 %50, -1
  store i32 %51, ptr %49, align 4, !tbaa !8
  br label %52

52:                                               ; preds = %42
  %53 = load i32, ptr %3, align 4, !tbaa !8
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %3, align 4, !tbaa !8
  br label %37, !llvm.loop !11

55:                                               ; preds = %41
  %56 = load i32, ptr %2, align 4, !tbaa !8
  call void @_ZN2ST5buildEiii(ptr noundef nonnull align 4 dereferenceable(1600144) @t, i32 noundef 1, i32 noundef 0, i32 noundef %56)
  call void @llvm.lifetime.start.p0(i64 48, ptr %4) #8
  call void @_ZNSt3setISt5arrayIiLm3EESt4lessIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 1, ptr %5, align 4, !tbaa !8
  br label %57

57:                                               ; preds = %208, %55
  %58 = load i32, ptr %5, align 4, !tbaa !8
  %59 = load i32, ptr %2, align 4, !tbaa !8
  %60 = icmp sle i32 %58, %59
  br i1 %60, label %62, label %61

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

62:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  %63 = load i32, ptr %5, align 4, !tbaa !8
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [100009 x i32], ptr @a, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !8
  store i32 %66, ptr %7, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  %67 = load i32, ptr %5, align 4, !tbaa !8
  %68 = sub nsw i32 %67, 1
  store i32 %68, ptr %9, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %69 = load i32, ptr %2, align 4, !tbaa !8
  %70 = load i32, ptr %7, align 4, !tbaa !8
  %71 = sub nsw i32 %70, 1
  %72 = invoke noundef i32 @_ZN2ST7get_minEiiiii(ptr noundef nonnull align 4 dereferenceable(1600144) @t, i32 noundef 1, i32 noundef 0, i32 noundef %69, i32 noundef 0, i32 noundef %71)
          to label %73 unwind label %112

73:                                               ; preds = %62
  store i32 %72, ptr %10, align 4, !tbaa !8
  %74 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %75 unwind label %112

75:                                               ; preds = %73
  %76 = load i32, ptr %74, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  store i32 %76, ptr %8, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %77 = load i32, ptr %2, align 4, !tbaa !8
  %78 = load i32, ptr %7, align 4, !tbaa !8
  %79 = invoke noundef i32 @_ZN2ST7get_minEiiiii(ptr noundef nonnull align 4 dereferenceable(1600144) @t, i32 noundef 1, i32 noundef 0, i32 noundef %77, i32 noundef 0, i32 noundef %78)
          to label %80 unwind label %116

80:                                               ; preds = %75
  %81 = add nsw i32 %79, 1
  store i32 %81, ptr %13, align 4, !tbaa !8
  %82 = load i32, ptr %13, align 4, !tbaa !8
  %83 = load i32, ptr %8, align 4, !tbaa !8
  %84 = icmp sle i32 %82, %83
  br i1 %84, label %85, label %130

85:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #8
  %86 = getelementptr inbounds %"struct.std::array", ptr %15, i32 0, i32 0
  %87 = load i32, ptr %13, align 4, !tbaa !8
  store i32 %87, ptr %86, align 4, !tbaa !8
  %88 = getelementptr inbounds i32, ptr %86, i64 1
  store i32 -1, ptr %88, align 4, !tbaa !8
  %89 = getelementptr inbounds i32, ptr %86, i64 2
  store i32 -1, ptr %89, align 4, !tbaa !8
  %90 = invoke ptr @_ZNSt3setISt5arrayIiLm3EESt4lessIS1_ESaIS1_EE11lower_boundERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 4 dereferenceable(12) %15)
          to label %91 unwind label %120

91:                                               ; preds = %85
  %92 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %14, i32 0, i32 0
  store ptr %90, ptr %92, align 8
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #8
  br label %93

93:                                               ; preds = %110, %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %94 = call ptr @_ZNKSt3setISt5arrayIiLm3EESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #8
  %95 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %16, i32 0, i32 0
  store ptr %94, ptr %95, align 8
  %96 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5arrayIiLm3EEES4_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %16) #8
  br i1 %96, label %97, label %103

97:                                               ; preds = %93
  %98 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt23_Rb_tree_const_iteratorISt5arrayIiLm3EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  %99 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %98, i64 noundef 1) #8
  %100 = load i32, ptr %99, align 4, !tbaa !8
  %101 = load i32, ptr %8, align 4, !tbaa !8
  %102 = icmp sle i32 %100, %101
  br label %103

103:                                              ; preds = %97, %93
  %104 = phi i1 [ false, %93 ], [ %102, %97 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br i1 %104, label %105, label %128

105:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #8
  %106 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt23_Rb_tree_const_iteratorISt5arrayIiLm3EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %106, i64 12, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %14, i64 8, i1 false), !tbaa.struct !15
  %107 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %19, i32 0, i32 0
  %108 = load ptr, ptr %107, align 8
  %109 = invoke ptr @_ZNSt3setISt5arrayIiLm3EESt4lessIS1_ESaIS1_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS1_E(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr %108)
          to label %110 unwind label %124

110:                                              ; preds = %105
  %111 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %18, i32 0, i32 0
  store ptr %109, ptr %111, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %18, i64 8, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #8
  br label %93, !llvm.loop !18

112:                                              ; preds = %73, %62
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %11, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %216

116:                                              ; preds = %130, %75
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %11, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %12, align 4
  br label %215

120:                                              ; preds = %85
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %11, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #8
  br label %129

124:                                              ; preds = %105
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %11, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #8
  br label %129

128:                                              ; preds = %103
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %130

129:                                              ; preds = %124, %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %215

130:                                              ; preds = %128, %80
  %131 = load i32, ptr %2, align 4, !tbaa !8
  %132 = load i32, ptr %7, align 4, !tbaa !8
  %133 = load i32, ptr %5, align 4, !tbaa !8
  invoke void @_ZN2ST3updEiiiii(ptr noundef nonnull align 4 dereferenceable(1600144) @t, i32 noundef 1, i32 noundef 0, i32 noundef %131, i32 noundef %132, i32 noundef %133)
          to label %134 unwind label %116

134:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %135 = load i32, ptr %8, align 4, !tbaa !8
  store i32 %135, ptr %20, align 4, !tbaa !8
  br label %136

136:                                              ; preds = %164, %134
  %137 = load i32, ptr %20, align 4, !tbaa !8
  %138 = load i32, ptr %13, align 4, !tbaa !8
  %139 = icmp sge i32 %137, %138
  br i1 %139, label %141, label %140

140:                                              ; preds = %136
  store i32 10, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %185

141:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %142 = load i32, ptr %2, align 4, !tbaa !8
  %143 = load i32, ptr %20, align 4, !tbaa !8
  %144 = invoke noundef i32 @_ZN2ST7get_mexEiiii(ptr noundef nonnull align 4 dereferenceable(1600144) @t, i32 noundef 1, i32 noundef 0, i32 noundef %142, i32 noundef %143)
          to label %145 unwind label %171

145:                                              ; preds = %141
  store i32 %144, ptr %21, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %146 = load i32, ptr %2, align 4, !tbaa !8
  %147 = load i32, ptr %21, align 4, !tbaa !8
  %148 = invoke noundef i32 @_ZN2ST7get_minEiiiii(ptr noundef nonnull align 4 dereferenceable(1600144) @t, i32 noundef 1, i32 noundef 0, i32 noundef %146, i32 noundef 0, i32 noundef %147)
          to label %149 unwind label %175

149:                                              ; preds = %145
  %150 = add nsw i32 %148, 1
  store i32 %150, ptr %23, align 4, !tbaa !8
  %151 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %23)
          to label %152 unwind label %175

152:                                              ; preds = %149
  %153 = load i32, ptr %151, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  store i32 %153, ptr %22, align 4, !tbaa !8
  %154 = load i32, ptr %21, align 4, !tbaa !8
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [100009 x i32], ptr @f, i64 0, i64 %155
  store i32 1, ptr %156, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #8
  %157 = getelementptr inbounds %"struct.std::array", ptr %24, i32 0, i32 0
  %158 = load i32, ptr %22, align 4, !tbaa !8
  store i32 %158, ptr %157, align 4, !tbaa !8
  %159 = getelementptr inbounds i32, ptr %157, i64 1
  %160 = load i32, ptr %20, align 4, !tbaa !8
  store i32 %160, ptr %159, align 4, !tbaa !8
  %161 = getelementptr inbounds i32, ptr %157, i64 2
  %162 = load i32, ptr %21, align 4, !tbaa !8
  store i32 %162, ptr %161, align 4, !tbaa !8
  %163 = invoke { ptr, i8 } @_ZNSt3setISt5arrayIiLm3EESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 4 dereferenceable(12) %24)
          to label %164 unwind label %179

164:                                              ; preds = %152
  %165 = getelementptr inbounds { ptr, i8 }, ptr %25, i32 0, i32 0
  %166 = extractvalue { ptr, i8 } %163, 0
  store ptr %166, ptr %165, align 8
  %167 = getelementptr inbounds { ptr, i8 }, ptr %25, i32 0, i32 1
  %168 = extractvalue { ptr, i8 } %163, 1
  store i8 %168, ptr %167, align 8
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #8
  %169 = load i32, ptr %22, align 4, !tbaa !8
  %170 = sub nsw i32 %169, 1
  store i32 %170, ptr %20, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %136, !llvm.loop !19

171:                                              ; preds = %141
  %172 = landingpad { ptr, i32 }
          cleanup
  %173 = extractvalue { ptr, i32 } %172, 0
  store ptr %173, ptr %11, align 8
  %174 = extractvalue { ptr, i32 } %172, 1
  store i32 %174, ptr %12, align 4
  br label %184

175:                                              ; preds = %149, %145
  %176 = landingpad { ptr, i32 }
          cleanup
  %177 = extractvalue { ptr, i32 } %176, 0
  store ptr %177, ptr %11, align 8
  %178 = extractvalue { ptr, i32 } %176, 1
  store i32 %178, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %183

179:                                              ; preds = %152
  %180 = landingpad { ptr, i32 }
          cleanup
  %181 = extractvalue { ptr, i32 } %180, 0
  store ptr %181, ptr %11, align 8
  %182 = extractvalue { ptr, i32 } %180, 1
  store i32 %182, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #8
  br label %183

183:                                              ; preds = %179, %175
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %184

184:                                              ; preds = %183, %171
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %215

185:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  %186 = load i32, ptr %5, align 4, !tbaa !8
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [100009 x i32], ptr @a, i64 0, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !8
  %190 = icmp ne i32 %189, 0
  %191 = xor i1 %190, true
  %192 = zext i1 %191 to i32
  store i32 %192, ptr %26, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 12, ptr %27) #8
  %193 = getelementptr inbounds %"struct.std::array", ptr %27, i32 0, i32 0
  %194 = load i32, ptr %5, align 4, !tbaa !8
  store i32 %194, ptr %193, align 4, !tbaa !8
  %195 = getelementptr inbounds i32, ptr %193, i64 1
  %196 = load i32, ptr %5, align 4, !tbaa !8
  store i32 %196, ptr %195, align 4, !tbaa !8
  %197 = getelementptr inbounds i32, ptr %193, i64 2
  %198 = load i32, ptr %26, align 4, !tbaa !8
  store i32 %198, ptr %197, align 4, !tbaa !8
  %199 = invoke { ptr, i8 } @_ZNSt3setISt5arrayIiLm3EESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 4 dereferenceable(12) %27)
          to label %200 unwind label %211

200:                                              ; preds = %185
  %201 = getelementptr inbounds { ptr, i8 }, ptr %28, i32 0, i32 0
  %202 = extractvalue { ptr, i8 } %199, 0
  store ptr %202, ptr %201, align 8
  %203 = getelementptr inbounds { ptr, i8 }, ptr %28, i32 0, i32 1
  %204 = extractvalue { ptr, i8 } %199, 1
  store i8 %204, ptr %203, align 8
  call void @llvm.lifetime.end.p0(i64 12, ptr %27) #8
  %205 = load i32, ptr %26, align 4, !tbaa !8
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [100009 x i32], ptr @f, i64 0, i64 %206
  store i32 1, ptr %207, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %208

208:                                              ; preds = %200
  %209 = load i32, ptr %5, align 4, !tbaa !8
  %210 = add nsw i32 %209, 1
  store i32 %210, ptr %5, align 4, !tbaa !8
  br label %57, !llvm.loop !20

211:                                              ; preds = %185
  %212 = landingpad { ptr, i32 }
          cleanup
  %213 = extractvalue { ptr, i32 } %212, 0
  store ptr %213, ptr %11, align 8
  %214 = extractvalue { ptr, i32 } %212, 1
  store i32 %214, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  br label %215

215:                                              ; preds = %211, %184, %129, %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %216

216:                                              ; preds = %215, %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %239

217:                                              ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  store i32 0, ptr %29, align 4, !tbaa !8
  br label %218

218:                                              ; preds = %224, %217
  %219 = load i32, ptr %29, align 4, !tbaa !8
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [100009 x i32], ptr @f, i64 0, i64 %220
  %222 = load i32, ptr %221, align 4, !tbaa !8
  %223 = icmp ne i32 %222, 0
  br i1 %223, label %224, label %227

224:                                              ; preds = %218
  %225 = load i32, ptr %29, align 4, !tbaa !8
  %226 = add nsw i32 %225, 1
  store i32 %226, ptr %29, align 4, !tbaa !8
  br label %218, !llvm.loop !21

227:                                              ; preds = %218
  %228 = load i32, ptr %29, align 4, !tbaa !8
  %229 = add nsw i32 %228, 1
  %230 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %229)
          to label %231 unwind label %235

231:                                              ; preds = %227
  %232 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %230, i8 noundef signext 10)
          to label %233 unwind label %235

233:                                              ; preds = %231
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  call void @_ZNSt3setISt5arrayIiLm3EESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  %234 = load i32, ptr %1, align 4
  ret i32 %234

235:                                              ; preds = %231, %227
  %236 = landingpad { ptr, i32 }
          cleanup
  %237 = extractvalue { ptr, i32 } %236, 0
  store ptr %237, ptr %11, align 8
  %238 = extractvalue { ptr, i32 } %236, 1
  store i32 %238, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %239

239:                                              ; preds = %235, %216
  call void @_ZNSt3setISt5arrayIiLm3EESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %240

240:                                              ; preds = %239
  %241 = load ptr, ptr %11, align 8
  %242 = load i32, ptr %12, align 4
  %243 = insertvalue { ptr, i32 } poison, ptr %241, 0
  %244 = insertvalue { ptr, i32 } %243, i32 %242, 1
  resume { ptr, i32 } %244
}

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

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

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

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.end.p0(i64 immarg, ptr nocapture) #3

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN2ST7get_minEiiiii(ptr noundef nonnull align 4 dereferenceable(1600144), i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #4 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5arrayIiLm3EEES4_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt23_Rb_tree_const_iteratorISt5arrayIiLm3EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN2ST7get_mexEiiii(ptr noundef nonnull align 4 dereferenceable(1600144), i32 noundef, i32 noundef, i32 noundef, i32 noundef) #4 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #7

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setISt5arrayIiLm3EESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2 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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 #8 = { 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 = !{i64 0, i64 12, !14}
!14 = !{!10, !10, i64 0}
!15 = !{i64 0, i64 8, !16}
!16 = !{!17, !17, i64 0}
!17 = !{!"any pointer", !10, i64 0}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !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"

%struct.ST = type { [400036 x i32] }
%"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<std::array<int, 3>, std::array<int, 3>, std::_Identity<std::array<int, 3>>, std::less<std::array<int, 3>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::array<int, 3>, std::array<int, 3>, std::_Identity<std::array<int, 3>>, std::less<std::array<int, 3>>>::_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::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::array" = type { [3 x i32] }

@t = external dso_local global %struct.ST, align 4
@a = external dso_local global [100009 x i32], align 16
@f = external dso_local local_unnamed_addr global [100009 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 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::set", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %7 = alloca %"struct.std::array", align 4
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::array", align 4
  %11 = alloca %"struct.std::array", align 4
  %12 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %13 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %14 = getelementptr i8, ptr %13, i64 -24
  %15 = load i64, ptr %14, align 8
  %16 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %15
  %17 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %16, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %19 = load i32, ptr %1, align 4, !tbaa !8
  %.not64 = icmp slt i32 %19, 1
  br i1 %.not64, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa = phi i32 [ %19, %0 ], [ %31, %.lr.ph ]
  call void @_ZN2ST5buildEiii(ptr noundef nonnull align 4 dereferenceable(1600144) @t, i32 noundef 1, i32 noundef 0, i32 noundef %.lcssa)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %2) #7
  call void @_ZNSt3setISt5arrayIiLm3EESt4lessIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  %20 = load i32, ptr %1, align 4, !tbaa !8
  %.not5072 = icmp slt i32 %20, 1
  br i1 %.not5072, label %.preheader.preheader, label %.lr.ph75

.preheader.preheader:                             ; preds = %99, %._crit_edge
  br label %.preheader

.lr.ph75:                                         ; preds = %._crit_edge
  %21 = getelementptr inbounds i8, ptr %7, i64 4
  %22 = getelementptr inbounds i8, ptr %7, i64 8
  %23 = getelementptr inbounds i8, ptr %10, i64 4
  %24 = getelementptr inbounds i8, ptr %10, i64 8
  %25 = getelementptr inbounds i8, ptr %11, i64 4
  %26 = getelementptr inbounds i8, ptr %11, i64 8
  br label %33

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %27 = getelementptr inbounds [100009 x i32], ptr @a, i64 0, i64 %indvars.iv
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %27)
  %29 = load i32, ptr %27, align 4, !tbaa !8
  %30 = add nsw i32 %29, -1
  store i32 %30, ptr %27, align 4, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %31 = load i32, ptr %1, align 4, !tbaa !8
  %32 = sext i32 %31 to i64
  %.not.not = icmp slt i64 %indvars.iv, %32
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

33:                                               ; preds = %.lr.ph75, %99
  %indvars.iv78 = phi i64 [ 1, %.lr.ph75 ], [ %indvars.iv.next79, %99 ]
  %34 = phi i32 [ %20, %.lr.ph75 ], [ %102, %99 ]
  %35 = getelementptr inbounds [100009 x i32], ptr @a, i64 0, i64 %indvars.iv78
  %36 = load i32, ptr %35, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %37 = trunc i64 %indvars.iv78 to i32
  %38 = add i32 %37, -1
  store i32 %38, ptr %3, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %39 = add nsw i32 %36, -1
  %40 = invoke noundef i32 @_ZN2ST7get_minEiiiii(ptr noundef nonnull align 4 dereferenceable(1600144) @t, i32 noundef 1, i32 noundef 0, i32 noundef %34, i32 noundef 0, i32 noundef %39)
          to label %41 unwind label %62

41:                                               ; preds = %33
  store i32 %40, ptr %4, align 4, !tbaa !8
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %43 = load i32, ptr %42, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %44 = load i32, ptr %1, align 4, !tbaa !8
  %45 = invoke noundef i32 @_ZN2ST7get_minEiiiii(ptr noundef nonnull align 4 dereferenceable(1600144) @t, i32 noundef 1, i32 noundef 0, i32 noundef %44, i32 noundef 0, i32 noundef %36)
          to label %46 unwind label %64

46:                                               ; preds = %41
  %47 = add nsw i32 %45, 1
  store i32 %47, ptr %5, align 4, !tbaa !8
  %.not52.not = icmp slt i32 %45, %43
  br i1 %.not52.not, label %48, label %71

48:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #7
  store i32 %47, ptr %7, align 4, !tbaa !8
  store i32 -1, ptr %21, align 4, !tbaa !8
  store i32 -1, ptr %22, align 4, !tbaa !8
  %49 = invoke ptr @_ZNSt3setISt5arrayIiLm3EESt4lessIS1_ESaIS1_EE11lower_boundERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 4 dereferenceable(12) %7)
          to label %50 unwind label %66

50:                                               ; preds = %48
  store ptr %49, ptr %6, align 8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %51 = call ptr @_ZNKSt3setISt5arrayIiLm3EESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  store ptr %51, ptr %8, align 8
  %52 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5arrayIiLm3EEES4_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br i1 %52, label %.lr.ph67, label %.critedge

.lr.ph67:                                         ; preds = %50, %59
  %53 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt23_Rb_tree_const_iteratorISt5arrayIiLm3EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %53, i64 noundef 1) #7
  %55 = load i32, ptr %54, align 4, !tbaa !8
  %.not53 = icmp sgt i32 %55, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br i1 %.not53, label %.loopexit, label %56

56:                                               ; preds = %.lr.ph67
  %57 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt23_Rb_tree_const_iteratorISt5arrayIiLm3EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %.sroa.015.0.copyload = load ptr, ptr %6, align 8, !tbaa !13
  %58 = invoke ptr @_ZNSt3setISt5arrayIiLm3EESt4lessIS1_ESaIS1_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS1_E(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr %.sroa.015.0.copyload)
          to label %59 unwind label %68

59:                                               ; preds = %56
  store ptr %58, ptr %6, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %60 = call ptr @_ZNKSt3setISt5arrayIiLm3EESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  store ptr %60, ptr %8, align 8
  %61 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5arrayIiLm3EEES4_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br i1 %61, label %.lr.ph67, label %.critedge, !llvm.loop !15

62:                                               ; preds = %33
  %63 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br label %118

64:                                               ; preds = %71, %41
  %65 = landingpad { ptr, i32 }
          cleanup
  br label %106

66:                                               ; preds = %48
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #7
  br label %70

68:                                               ; preds = %56
  %69 = landingpad { ptr, i32 }
          cleanup
  br label %70

.critedge:                                        ; preds = %59, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph67, %.critedge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %71

70:                                               ; preds = %68, %66
  %.pn58 = phi { ptr, i32 } [ %69, %68 ], [ %67, %66 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %106

71:                                               ; preds = %.loopexit, %46
  %72 = load i32, ptr %1, align 4, !tbaa !8
  %73 = trunc nuw nsw i64 %indvars.iv78 to i32
  invoke void @_ZN2ST3updEiiiii(ptr noundef nonnull align 4 dereferenceable(1600144) @t, i32 noundef 1, i32 noundef 0, i32 noundef %72, i32 noundef %36, i32 noundef %73)
          to label %.preheader63 unwind label %64

.preheader63:                                     ; preds = %71
  %74 = load i32, ptr %5, align 4, !tbaa !8
  %.not5468 = icmp slt i32 %43, %74
  br i1 %.not5468, label %._crit_edge71, label %.lr.ph70

._crit_edge71:                                    ; preds = %90, %.preheader63
  %75 = load i32, ptr %35, align 4, !tbaa !8
  %.not55 = icmp eq i32 %75, 0
  %76 = zext i1 %.not55 to i32
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #7
  store i32 %73, ptr %11, align 4, !tbaa !8
  store i32 %73, ptr %25, align 4, !tbaa !8
  store i32 %76, ptr %26, align 4, !tbaa !8
  %77 = invoke { ptr, i8 } @_ZNSt3setISt5arrayIiLm3EESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 4 dereferenceable(12) %11)
          to label %99 unwind label %104

.lr.ph70:                                         ; preds = %.preheader63, %90
  %.04769 = phi i32 [ %91, %90 ], [ %43, %.preheader63 ]
  %78 = load i32, ptr %1, align 4, !tbaa !8
  %79 = invoke noundef i32 @_ZN2ST7get_mexEiiii(ptr noundef nonnull align 4 dereferenceable(1600144) @t, i32 noundef 1, i32 noundef 0, i32 noundef %78, i32 noundef %.04769)
          to label %80 unwind label %93

80:                                               ; preds = %.lr.ph70
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %81 = load i32, ptr %1, align 4, !tbaa !8
  %82 = invoke noundef i32 @_ZN2ST7get_minEiiiii(ptr noundef nonnull align 4 dereferenceable(1600144) @t, i32 noundef 1, i32 noundef 0, i32 noundef %81, i32 noundef 0, i32 noundef %79)
          to label %83 unwind label %95

83:                                               ; preds = %80
  %84 = add nsw i32 %82, 1
  store i32 %84, ptr %9, align 4, !tbaa !8
  %85 = 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) %9)
  %86 = load i32, ptr %85, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  %87 = sext i32 %79 to i64
  %88 = getelementptr inbounds [100009 x i32], ptr @f, i64 0, i64 %87
  store i32 1, ptr %88, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #7
  store i32 %86, ptr %10, align 4, !tbaa !8
  store i32 %.04769, ptr %23, align 4, !tbaa !8
  store i32 %79, ptr %24, align 4, !tbaa !8
  %89 = invoke { ptr, i8 } @_ZNSt3setISt5arrayIiLm3EESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %90 unwind label %97

90:                                               ; preds = %83
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #7
  %91 = add nsw i32 %86, -1
  %92 = load i32, ptr %5, align 4, !tbaa !8
  %.not54.not = icmp sgt i32 %86, %92
  br i1 %.not54.not, label %.lr.ph70, label %._crit_edge71, !llvm.loop !16

93:                                               ; preds = %.lr.ph70
  %94 = landingpad { ptr, i32 }
          cleanup
  br label %106

95:                                               ; preds = %80
  %96 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  br label %106

97:                                               ; preds = %83
  %98 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #7
  br label %106

99:                                               ; preds = %._crit_edge71
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #7
  %100 = zext i1 %.not55 to i64
  %101 = getelementptr inbounds [100009 x i32], ptr @f, i64 0, i64 %100
  store i32 1, ptr %101, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %102 = load i32, ptr %1, align 4, !tbaa !8
  %103 = sext i32 %102 to i64
  %.not50.not = icmp slt i64 %indvars.iv78, %103
  br i1 %.not50.not, label %33, label %.preheader.preheader, !llvm.loop !17

104:                                              ; preds = %._crit_edge71
  %105 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #7
  br label %106

106:                                              ; preds = %93, %97, %95, %104, %70, %64
  %.pn58.pn = phi { ptr, i32 } [ %.pn58, %70 ], [ %105, %104 ], [ %65, %64 ], [ %94, %93 ], [ %98, %97 ], [ %96, %95 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %118

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %indvars.iv81 = phi i64 [ %indvars.iv.next82, %.preheader ], [ 0, %.preheader.preheader ]
  %107 = getelementptr inbounds [100009 x i32], ptr @f, i64 0, i64 %indvars.iv81
  %108 = load i32, ptr %107, align 4, !tbaa !8
  %.not51 = icmp eq i32 %108, 0
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  br i1 %.not51, label %109, label %.preheader, !llvm.loop !18

109:                                              ; preds = %.preheader
  %110 = trunc nuw nsw i64 %indvars.iv81 to i32
  %111 = add nuw nsw i32 %110, 1
  %112 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %111)
          to label %113 unwind label %116

113:                                              ; preds = %109
  %114 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %112, i8 noundef signext 10)
          to label %115 unwind label %116

115:                                              ; preds = %113
  call void @_ZNSt3setISt5arrayIiLm3EESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

116:                                              ; preds = %113, %109
  %117 = landingpad { ptr, i32 }
          cleanup
  br label %118

118:                                              ; preds = %62, %106, %116
  %.pn58.pn.pn.pn = phi { ptr, i32 } [ %117, %116 ], [ %.pn58.pn, %106 ], [ %63, %62 ]
  call void @_ZNSt3setISt5arrayIiLm3EESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn58.pn.pn.pn
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

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

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

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.end.p0(i64 immarg, ptr nocapture) #3

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN2ST7get_minEiiiii(ptr noundef nonnull align 4 dereferenceable(1600144), i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5arrayIiLm3EEES4_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setISt5arrayIiLm3EESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt23_Rb_tree_const_iteratorISt5arrayIiLm3EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN2ST7get_mexEiiii(ptr noundef nonnull align 4 dereferenceable(1600144), i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #4 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #6

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 nounwind uwtable
declare dso_local void @_ZNSt3setISt5arrayIiLm3EESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2 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 = { "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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #6 = { 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 #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}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !10, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


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