; LLVM IR from eyangch/competitive-programming :: Codeforces/1475 (g)

; 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::unordered_set" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }

@T = external dso_local global i32, align 4
@N = external dso_local global i32, align 4
@a = external dso_local global [200000 x i32], align 16
@sieve = external dso_local global [200001 x i32], align 16
@dp = external dso_local global [200001 x i32], align 16
@f = external dso_local global %"class.std::unordered_set", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11get_factorsRSt6vectorIiSaIiEE(ptr noundef nonnull align 8 dereferenceable(24)) #0

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

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

24:                                               ; preds = %51, %0
  %25 = load i32, ptr %2, align 4, !tbaa !8
  %26 = icmp slt i32 %25, 200001
  br i1 %26, label %28, label %27

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

28:                                               ; preds = %24
  %29 = load i32, ptr %2, align 4, !tbaa !8
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [200001 x i32], ptr @sieve, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !8
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %35

34:                                               ; preds = %28
  br label %51

35:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %36 = load i32, ptr %2, align 4, !tbaa !8
  store i32 %36, ptr %4, align 4, !tbaa !8
  br label %37

37:                                               ; preds = %46, %35
  %38 = load i32, ptr %4, align 4, !tbaa !8
  %39 = icmp slt i32 %38, 200001
  br i1 %39, label %41, label %40

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

41:                                               ; preds = %37
  %42 = load i32, ptr %2, align 4, !tbaa !8
  %43 = load i32, ptr %4, align 4, !tbaa !8
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [200001 x i32], ptr @sieve, i64 0, i64 %44
  store i32 %42, ptr %45, align 4, !tbaa !8
  br label %46

46:                                               ; preds = %41
  %47 = load i32, ptr %2, align 4, !tbaa !8
  %48 = load i32, ptr %4, align 4, !tbaa !8
  %49 = add nsw i32 %48, %47
  store i32 %49, ptr %4, align 4, !tbaa !8
  br label %37, !llvm.loop !11

50:                                               ; preds = %40
  br label %51

51:                                               ; preds = %50, %34
  %52 = load i32, ptr %2, align 4, !tbaa !8
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %2, align 4, !tbaa !8
  br label %24, !llvm.loop !13

54:                                               ; preds = %27
  %55 = 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)
  br label %56

56:                                               ; preds = %212, %54
  %57 = load i32, ptr @T, align 4, !tbaa !8
  %58 = add nsw i32 %57, -1
  store i32 %58, ptr @T, align 4, !tbaa !8
  %59 = icmp ne i32 %57, 0
  br i1 %59, label %60, label %218

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

61:                                               ; preds = %69, %60
  %62 = load i32, ptr %5, align 4, !tbaa !8
  %63 = icmp slt i32 %62, 200001
  br i1 %63, label %65, label %64

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

65:                                               ; preds = %61
  %66 = load i32, ptr %5, align 4, !tbaa !8
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %67
  store i32 0, ptr %68, align 4, !tbaa !8
  br label %69

69:                                               ; preds = %65
  %70 = load i32, ptr %5, align 4, !tbaa !8
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %5, align 4, !tbaa !8
  br label %61, !llvm.loop !14

72:                                               ; preds = %64
  %73 = 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 %6) #7
  store i32 0, ptr %6, align 4, !tbaa !8
  br label %74

74:                                               ; preds = %84, %72
  %75 = load i32, ptr %6, align 4, !tbaa !8
  %76 = load i32, ptr @N, align 4, !tbaa !8
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %79, label %78

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

79:                                               ; preds = %74
  %80 = load i32, ptr %6, align 4, !tbaa !8
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %81
  %83 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %82)
  br label %84

84:                                               ; preds = %79
  %85 = load i32, ptr %6, align 4, !tbaa !8
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %6, align 4, !tbaa !8
  br label %74, !llvm.loop !15

87:                                               ; preds = %78
  %88 = load i32, ptr @N, align 4, !tbaa !8
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i32, ptr @a, i64 %89
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @a, ptr noundef %90)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !8
  br label %91

91:                                               ; preds = %194, %87
  %92 = load i32, ptr %8, align 4, !tbaa !8
  %93 = load i32, ptr @N, align 4, !tbaa !8
  %94 = icmp slt i32 %92, %93
  br i1 %94, label %96, label %95

95:                                               ; preds = %91
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %198

96:                                               ; preds = %91
  %97 = load i32, ptr %8, align 4, !tbaa !8
  %98 = icmp sgt i32 %97, 0
  br i1 %98, label %99, label %119

99:                                               ; preds = %96
  %100 = load i32, ptr %8, align 4, !tbaa !8
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !8
  %104 = load i32, ptr %8, align 4, !tbaa !8
  %105 = sub nsw i32 %104, 1
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !8
  %109 = icmp eq i32 %103, %108
  br i1 %109, label %110, label %119

110:                                              ; preds = %99
  %111 = load i32, ptr %8, align 4, !tbaa !8
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !8
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !8
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %116, align 4, !tbaa !8
  br label %194

119:                                              ; preds = %99, %96
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #7
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %120 = load i32, ptr %8, align 4, !tbaa !8
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !8
  store i32 %123, ptr %10, align 4, !tbaa !8
  br label %124

124:                                              ; preds = %136, %119
  br label %125

125:                                              ; preds = %124
  %126 = load i32, ptr %10, align 4, !tbaa !8
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [200001 x i32], ptr @sieve, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !8
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %132, label %131

131:                                              ; preds = %125
  br label %147

132:                                              ; preds = %125
  %133 = load i32, ptr %10, align 4, !tbaa !8
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [200001 x i32], ptr @sieve, i64 0, i64 %134
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(4) %135)
          to label %136 unwind label %143

136:                                              ; preds = %132
  %137 = load i32, ptr %10, align 4, !tbaa !8
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [200001 x i32], ptr @sieve, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !8
  %141 = load i32, ptr %10, align 4, !tbaa !8
  %142 = sdiv i32 %141, %140
  store i32 %142, ptr %10, align 4, !tbaa !8
  br label %124, !llvm.loop !16

143:                                              ; preds = %147, %132
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %11, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %12, align 4
  br label %197

147:                                              ; preds = %131
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(56) @f) #7
  invoke void @_Z11get_factorsRSt6vectorIiSaIiEE(ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %148 unwind label %143

148:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store ptr @f, ptr %13, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %149 = call ptr @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) @f) #7
  %150 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %14, i32 0, i32 0
  %151 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %150, i32 0, i32 0
  store ptr %149, ptr %151, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %152 = call ptr @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) @f) #7
  %153 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %15, i32 0, i32 0
  %154 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %153, i32 0, i32 0
  store ptr %152, ptr %154, align 8
  br label %155

155:                                              ; preds = %179, %148
  %156 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIiLb0EEES3_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  br i1 %156, label %158, label %157

157:                                              ; preds = %155
  store i32 21, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %185

158:                                              ; preds = %155
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %159 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt8__detail14_Node_iteratorIiLb1ELb0EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  %160 = load i32, ptr %159, align 4, !tbaa !8
  store i32 %160, ptr %16, align 4, !tbaa !8
  %161 = load i32, ptr %8, align 4, !tbaa !8
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !8
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %165
  %167 = load i32, ptr %16, align 4, !tbaa !8
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %168
  %170 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %166, ptr noundef nonnull align 4 dereferenceable(4) %169)
          to label %171 unwind label %181

171:                                              ; preds = %158
  %172 = load i32, ptr %170, align 4, !tbaa !8
  %173 = load i32, ptr %8, align 4, !tbaa !8
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !8
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %177
  store i32 %172, ptr %178, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %179

179:                                              ; preds = %171
  %180 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorIiLb1ELb0EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  br label %155

181:                                              ; preds = %158
  %182 = landingpad { ptr, i32 }
          cleanup
  %183 = extractvalue { ptr, i32 } %182, 0
  store ptr %183, ptr %11, align 8
  %184 = extractvalue { ptr, i32 } %182, 1
  store i32 %184, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %197

185:                                              ; preds = %157
  %186 = load i32, ptr %8, align 4, !tbaa !8
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !8
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %190
  %192 = load i32, ptr %191, align 4, !tbaa !8
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %191, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #7
  br label %194

194:                                              ; preds = %185, %110
  %195 = load i32, ptr %8, align 4, !tbaa !8
  %196 = add nsw i32 %195, 1
  store i32 %196, ptr %8, align 4, !tbaa !8
  br label %91, !llvm.loop !19

197:                                              ; preds = %181, %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %220

198:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !8
  br label %199

199:                                              ; preds = %209, %198
  %200 = load i32, ptr %17, align 4, !tbaa !8
  %201 = icmp slt i32 %200, 200001
  br i1 %201, label %203, label %202

202:                                              ; preds = %199
  store i32 23, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %212

203:                                              ; preds = %199
  %204 = load i32, ptr %17, align 4, !tbaa !8
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %205
  %207 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %206)
  %208 = load i32, ptr %207, align 4, !tbaa !8
  store i32 %208, ptr %7, align 4, !tbaa !8
  br label %209

209:                                              ; preds = %203
  %210 = load i32, ptr %17, align 4, !tbaa !8
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %17, align 4, !tbaa !8
  br label %199, !llvm.loop !20

212:                                              ; preds = %202
  %213 = load i32, ptr @N, align 4, !tbaa !8
  %214 = load i32, ptr %7, align 4, !tbaa !8
  %215 = sub nsw i32 %213, %214
  %216 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %215)
  %217 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %216, ptr noundef @.str)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %56, !llvm.loop !21

218:                                              ; preds = %56
  %219 = load i32, ptr %1, align 4
  ret i32 %219

220:                                              ; preds = %197
  %221 = load ptr, ptr %11, align 8
  %222 = load i32, ptr %12, align 4
  %223 = insertvalue { ptr, i32 } poison, ptr %221, 0
  %224 = insertvalue { ptr, i32 } %223, i32 %222, 1
  resume { ptr, i32 } %224
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(56)) #2 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)) #6

; 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) #5

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #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 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = !{!18, !18, i64 0}
!18 = !{!"any pointer", !10, i64 0}
!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"

%"class.std::unordered_set" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }

@T = external dso_local global i32, align 4
@N = external dso_local global i32, align 4
@a = external dso_local global [200000 x i32], align 16
@sieve = external dso_local global [200001 x i32], align 16
@dp = external dso_local global [200001 x i32], align 16
@f = external dso_local global %"class.std::unordered_set", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11get_factorsRSt6vectorIiSaIiEE(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIiLb0EEES3_(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 noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt8__detail14_Node_iteratorIiLb1ELb0EEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %4 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %5 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %6 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %8
  %10 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef null)
  br label %15

11:                                               ; preds = %.loopexit48
  %12 = 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)
  %13 = load i32, ptr @T, align 4, !tbaa !8
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr @T, align 4, !tbaa !8
  %.not67 = icmp eq i32 %13, 0
  br i1 %.not67, label %._crit_edge68, label %.preheader46

15:                                               ; preds = %.loopexit48.1, %0
  %indvars.iv = phi i64 [ 2, %0 ], [ %indvars.iv.next.1, %.loopexit48.1 ]
  %16 = getelementptr inbounds [200001 x i32], ptr @sieve, i64 0, i64 %indvars.iv
  %17 = load i32, ptr %16, align 8, !tbaa !8
  %.not45 = icmp eq i32 %17, 0
  br i1 %.not45, label %.lr.ph.preheader, label %.loopexit48

.lr.ph.preheader:                                 ; preds = %15
  %18 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv70 = phi i64 [ %indvars.iv, %.lr.ph.preheader ], [ %indvars.iv.next71, %.lr.ph ]
  %19 = getelementptr inbounds [200001 x i32], ptr @sieve, i64 0, i64 %indvars.iv70
  store i32 %18, ptr %19, align 8, !tbaa !8
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, %indvars.iv
  %20 = icmp ult i64 %indvars.iv.next71, 200001
  br i1 %20, label %.lr.ph, label %.loopexit48, !llvm.loop !11

.loopexit48:                                      ; preds = %.lr.ph, %15
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, 200000
  br i1 %exitcond.not, label %11, label %21, !llvm.loop !13

21:                                               ; preds = %.loopexit48
  %22 = getelementptr inbounds [200001 x i32], ptr @sieve, i64 0, i64 %indvars.iv.next
  %23 = load i32, ptr %22, align 4, !tbaa !8
  %.not45.1 = icmp eq i32 %23, 0
  br i1 %.not45.1, label %.lr.ph.preheader.1, label %.loopexit48.1

.lr.ph.preheader.1:                               ; preds = %21
  %24 = trunc nuw nsw i64 %indvars.iv.next to i32
  br label %.lr.ph.1

.lr.ph.1:                                         ; preds = %.lr.ph.1, %.lr.ph.preheader.1
  %indvars.iv70.1 = phi i64 [ %indvars.iv.next, %.lr.ph.preheader.1 ], [ %indvars.iv.next71.1, %.lr.ph.1 ]
  %25 = getelementptr inbounds [200001 x i32], ptr @sieve, i64 0, i64 %indvars.iv70.1
  store i32 %24, ptr %25, align 4, !tbaa !8
  %indvars.iv.next71.1 = add nuw nsw i64 %indvars.iv70.1, %indvars.iv.next
  %26 = icmp ult i64 %indvars.iv.next71.1, 200001
  br i1 %26, label %.lr.ph.1, label %.loopexit48.1, !llvm.loop !11

.loopexit48.1:                                    ; preds = %.lr.ph.1, %21
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  br label %15

.preheader46:                                     ; preds = %11, %92
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800004) @dp, i8 0, i64 800004, i1 false), !tbaa !8
  %27 = 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)
  %28 = load i32, ptr @N, align 4, !tbaa !8
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.lr.ph54, label %.preheader46.._crit_edge_crit_edge

.preheader46.._crit_edge_crit_edge:               ; preds = %.preheader46
  %.pre87 = sext i32 %28 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph54, %.preheader46.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre87, %.preheader46.._crit_edge_crit_edge ], [ %36, %.lr.ph54 ]
  %30 = getelementptr inbounds i32, ptr @a, i64 %.pre-phi
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @a, ptr noundef nonnull %30)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  store i32 0, ptr %1, align 4, !tbaa !8
  %31 = load i32, ptr @N, align 4, !tbaa !8
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %.lr.ph65, label %.preheader.preheader

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

.lr.ph54:                                         ; preds = %.preheader46, %.lr.ph54
  %indvars.iv77 = phi i64 [ %indvars.iv.next78, %.lr.ph54 ], [ 0, %.preheader46 ]
  %33 = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %indvars.iv77
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %33)
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %35 = load i32, ptr @N, align 4, !tbaa !8
  %36 = sext i32 %35 to i64
  %37 = icmp slt i64 %indvars.iv.next78, %36
  br i1 %37, label %.lr.ph54, label %._crit_edge, !llvm.loop !14

.lr.ph65:                                         ; preds = %._crit_edge, %88
  %38 = phi i32 [ %89, %88 ], [ %31, %._crit_edge ]
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %88 ], [ 0, %._crit_edge ]
  %.not43 = icmp eq i64 %indvars.iv80, 0
  br i1 %.not43, label %51, label %39

39:                                               ; preds = %.lr.ph65
  %40 = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %indvars.iv80
  %41 = load i32, ptr %40, align 4, !tbaa !8
  %42 = add nsw i64 %indvars.iv80, -1
  %43 = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !8
  %45 = icmp eq i32 %41, %44
  br i1 %45, label %46, label %51

46:                                               ; preds = %39
  %47 = sext i32 %41 to i64
  %48 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !8
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %48, align 4, !tbaa !8
  br label %88

51:                                               ; preds = %39, %.lr.ph65
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #8
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  %52 = getelementptr inbounds [200000 x i32], ptr @a, i64 0, i64 %indvars.iv80
  %53 = load i32, ptr %52, align 4, !tbaa !8
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [200001 x i32], ptr @sieve, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !8
  %.not4455 = icmp eq i32 %56, 0
  br i1 %.not4455, label %._crit_edge59, label %.lr.ph58

.lr.ph58:                                         ; preds = %51, %58
  %57 = phi ptr [ %62, %58 ], [ %55, %51 ]
  %.03856 = phi i32 [ %60, %58 ], [ %53, %51 ]
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(4) %57)
          to label %58 unwind label %.loopexit

58:                                               ; preds = %.lr.ph58
  %59 = load i32, ptr %57, align 4, !tbaa !8
  %60 = sdiv i32 %.03856, %59
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [200001 x i32], ptr @sieve, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !8
  %.not44 = icmp eq i32 %63, 0
  br i1 %.not44, label %._crit_edge59, label %.lr.ph58, !llvm.loop !15

.loopexit:                                        ; preds = %.lr.ph58
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %64

.loopexit.split-lp:                               ; preds = %._crit_edge59
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %64

64:                                               ; preds = %.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  resume { ptr, i32 } %lpad.phi

._crit_edge59:                                    ; preds = %58, %51
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(56) @f) #8
  invoke void @_Z11get_factorsRSt6vectorIiSaIiEE(ptr noundef nonnull align 8 dereferenceable(24) %2)
          to label %65 unwind label %.loopexit.split-lp

65:                                               ; preds = %._crit_edge59
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %66 = call ptr @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) @f) #8
  store ptr %66, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %67 = call ptr @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) @f) #8
  store ptr %67, ptr %4, align 8
  %68 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIiLb0EEES3_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  br i1 %68, label %.lr.ph61, label %._crit_edge62

._crit_edge62:                                    ; preds = %.lr.ph61, %65
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  %69 = load i32, ptr %52, align 4, !tbaa !8
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !8
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %71, align 4, !tbaa !8
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #8
  %.pre = load i32, ptr @N, align 4, !tbaa !8
  br label %88

.lr.ph61:                                         ; preds = %65, %.lr.ph61
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt8__detail14_Node_iteratorIiLb1ELb0EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  %75 = load i32, ptr %74, align 4, !tbaa !8
  %76 = load i32, ptr %52, align 4, !tbaa !8
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %77
  %79 = sext i32 %75 to i64
  %80 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %79
  %81 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %78, ptr noundef nonnull align 4 dereferenceable(4) %80)
  %82 = load i32, ptr %81, align 4, !tbaa !8
  %83 = load i32, ptr %52, align 4, !tbaa !8
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %84
  store i32 %82, ptr %85, align 4, !tbaa !8
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorIiLb1ELb0EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  %87 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIiLb0EEES3_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  br i1 %87, label %.lr.ph61, label %._crit_edge62

88:                                               ; preds = %._crit_edge62, %46
  %89 = phi i32 [ %.pre, %._crit_edge62 ], [ %38, %46 ]
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %90 = sext i32 %89 to i64
  %91 = icmp slt i64 %indvars.iv.next81, %90
  br i1 %91, label %.lr.ph65, label %.preheader.preheader, !llvm.loop !16

92:                                               ; preds = %.preheader
  %93 = load i32, ptr @N, align 4, !tbaa !8
  %94 = sub nsw i32 %93, %101
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %94)
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %95, ptr noundef nonnull @.str)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %97 = load i32, ptr @T, align 4, !tbaa !8
  %98 = add nsw i32 %97, -1
  store i32 %98, ptr @T, align 4, !tbaa !8
  %.not = icmp eq i32 %97, 0
  br i1 %.not, label %._crit_edge68, label %.preheader46, !llvm.loop !17

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %.preheader ], [ 0, %.preheader.preheader ]
  %99 = getelementptr inbounds [200001 x i32], ptr @dp, i64 0, i64 %indvars.iv83
  %100 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %99)
  %101 = load i32, ptr %100, align 4, !tbaa !8
  store i32 %101, ptr %1, align 4, !tbaa !8
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %exitcond86.not = icmp eq i64 %indvars.iv.next84, 200001
  br i1 %exitcond86.not, label %92, label %.preheader, !llvm.loop !18

._crit_edge68:                                    ; preds = %92, %11
  ret i32 0
}

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

; 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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #2 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 #6

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


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