; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/92 Beta Division 1/Problem A (A)

; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int>>, std::less<char>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int>>, std::less<char>>::_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 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::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 }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair" = type { i8, i32 }

@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@n = external dso_local global i32, align 4
@up = external dso_local global i32, align 4
@cnt = external dso_local global i32, align 4
@m = external dso_local global %"class.std::map", align 8
@primes = external dso_local global %"class.std::vector", align 8
@mark = external dso_local global [1001 x i32], align 16
@res = external dso_local global [1001 x i8], align 16
@c = external dso_local global i8, align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %12 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %13 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %17 = alloca i32, align 4
  %18 = alloca %"struct.std::_Rb_tree_iterator", align 8
  store i32 0, ptr %1, align 4
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  %20 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #5
  %21 = trunc i64 %20 to i32
  store i32 %21, ptr @n, align 4, !tbaa !5
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = icmp sle i32 %22, 3
  br i1 %23, label %24, label %28

24:                                               ; preds = %0
  %25 = call i32 @puts(ptr noundef @.str)
  %26 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #5
  %27 = call i32 @puts(ptr noundef %26)
  store i32 0, ptr %1, align 4
  br label %255

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

29:                                               ; preds = %41, %28
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %44

34:                                               ; preds = %29
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %36)
  %38 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @m, ptr noundef nonnull align 1 dereferenceable(1) %37)
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %38, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %34
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %2, align 4, !tbaa !5
  br label %29, !llvm.loop !9

44:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 2, ptr %3, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) @primes, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 3, ptr %4, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %74, %44
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = icmp sle i32 %46, 1000
  br i1 %47, label %49, label %48

48:                                               ; preds = %45
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %77

49:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #5
  store i8 1, ptr %6, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %66, %49
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @primes) #5
  %54 = icmp ult i64 %52, %53
  br i1 %54, label %56, label %55

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

56:                                               ; preds = %50
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = load i32, ptr %7, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @primes, i64 noundef %59) #5
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = srem i32 %57, %61
  %63 = icmp eq i32 %62, 0
  br i1 %63, label %64, label %65

64:                                               ; preds = %56
  store i8 0, ptr %6, align 1, !tbaa !11
  br label %65

65:                                               ; preds = %64, %56
  br label %66

66:                                               ; preds = %65
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %7, align 4, !tbaa !5
  br label %50, !llvm.loop !13

69:                                               ; preds = %55
  %70 = load i8, ptr %6, align 1, !tbaa !11, !range !14, !noundef !15
  %71 = trunc i8 %70 to i1
  br i1 %71, label %72, label %73

72:                                               ; preds = %69
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @primes, ptr noundef nonnull align 4 dereferenceable(4) %4)
  br label %73

73:                                               ; preds = %72, %69
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  br label %74

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

77:                                               ; preds = %48
  store i32 0, ptr @up, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %93, %77
  %79 = load i32, ptr @up, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @primes) #5
  %82 = icmp ult i64 %80, %81
  br i1 %82, label %83, label %91

83:                                               ; preds = %78
  %84 = load i32, ptr @up, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @primes, i64 noundef %85) #5
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = load i32, ptr @n, align 4, !tbaa !5
  %89 = sdiv i32 %88, 2
  %90 = icmp sle i32 %87, %89
  br label %91

91:                                               ; preds = %83, %78
  %92 = phi i1 [ false, %78 ], [ %90, %83 ]
  br i1 %92, label %93, label %96

93:                                               ; preds = %91
  %94 = load i32, ptr @up, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr @up, align 4, !tbaa !5
  br label %78, !llvm.loop !17

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

97:                                               ; preds = %125, %96
  %98 = load i32, ptr %8, align 4, !tbaa !5
  %99 = load i32, ptr @up, align 4, !tbaa !5
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %97
  store i32 13, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %128

102:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %103 = load i32, ptr %8, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @primes, i64 noundef %104) #5
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = sub nsw i32 %106, 1
  store i32 %107, ptr %9, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %117, %102
  %109 = load i32, ptr %9, align 4, !tbaa !5
  %110 = load i32, ptr @n, align 4, !tbaa !5
  %111 = icmp slt i32 %109, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %108
  store i32 16, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %124

113:                                              ; preds = %108
  %114 = load i32, ptr %9, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [1001 x i32], ptr @mark, i64 0, i64 %115
  store i32 1, ptr %116, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %113
  %118 = load i32, ptr %8, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @primes, i64 noundef %119) #5
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = load i32, ptr %9, align 4, !tbaa !5
  %123 = add nsw i32 %122, %121
  store i32 %123, ptr %9, align 4, !tbaa !5
  br label %108, !llvm.loop !18

124:                                              ; preds = %112
  br label %125

125:                                              ; preds = %124
  %126 = load i32, ptr %8, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %8, align 4, !tbaa !5
  br label %97, !llvm.loop !19

128:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %141, %128
  %130 = load i32, ptr %10, align 4, !tbaa !5
  %131 = load i32, ptr @n, align 4, !tbaa !5
  %132 = icmp slt i32 %130, %131
  br i1 %132, label %134, label %133

133:                                              ; preds = %129
  store i32 19, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %144

134:                                              ; preds = %129
  %135 = load i32, ptr %10, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [1001 x i32], ptr @mark, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = load i32, ptr @cnt, align 4, !tbaa !5
  %140 = add nsw i32 %139, %138
  store i32 %140, ptr @cnt, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %134
  %142 = load i32, ptr %10, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %10, align 4, !tbaa !5
  br label %129, !llvm.loop !20

144:                                              ; preds = %133
  store i8 46, ptr @c, align 1, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %145 = call ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @m) #5
  %146 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %11, i32 0, i32 0
  store ptr %145, ptr %146, align 8
  br label %147

147:                                              ; preds = %163, %144
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %148 = call ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @m) #5
  %149 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %12, i32 0, i32 0
  store ptr %148, ptr %149, align 8
  %150 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKciEES5_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br i1 %150, label %152, label %151

151:                                              ; preds = %147
  store i32 22, ptr %5, align 4
  br label %166

152:                                              ; preds = %147
  %153 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKciEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  %154 = getelementptr inbounds %"struct.std::pair", ptr %153, i32 0, i32 1
  %155 = load i32, ptr %154, align 4, !tbaa !22
  %156 = load i32, ptr @cnt, align 4, !tbaa !5
  %157 = icmp sge i32 %155, %156
  br i1 %157, label %158, label %162

158:                                              ; preds = %152
  %159 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKciEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  %160 = getelementptr inbounds %"struct.std::pair", ptr %159, i32 0, i32 0
  %161 = load i8, ptr %160, align 4, !tbaa !24
  store i8 %161, ptr @c, align 1, !tbaa !21
  store i32 22, ptr %5, align 4
  br label %166

162:                                              ; preds = %152
  br label %163

163:                                              ; preds = %162
  %164 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKciEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %11, i32 noundef 0) #5
  %165 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %13, i32 0, i32 0
  store ptr %164, ptr %165, align 8
  br label %147, !llvm.loop !25

166:                                              ; preds = %158, %151
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %167

167:                                              ; preds = %166
  %168 = load i8, ptr @c, align 1, !tbaa !21
  %169 = sext i8 %168 to i32
  %170 = icmp eq i32 %169, 46
  br i1 %170, label %171, label %173

171:                                              ; preds = %167
  %172 = call i32 @puts(ptr noundef @.str.4)
  store i32 0, ptr %1, align 4
  br label %255

173:                                              ; preds = %167
  %174 = load i32, ptr @n, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [1001 x i8], ptr @res, i64 0, i64 %175
  store i8 0, ptr %176, align 1, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %177

177:                                              ; preds = %206, %173
  %178 = load i32, ptr %14, align 4, !tbaa !5
  %179 = load i32, ptr @up, align 4, !tbaa !5
  %180 = icmp slt i32 %178, %179
  br i1 %180, label %182, label %181

181:                                              ; preds = %177
  store i32 25, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %209

182:                                              ; preds = %177
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %183 = load i32, ptr %14, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @primes, i64 noundef %184) #5
  %186 = load i32, ptr %185, align 4, !tbaa !5
  %187 = sub nsw i32 %186, 1
  store i32 %187, ptr %15, align 4, !tbaa !5
  br label %188

188:                                              ; preds = %198, %182
  %189 = load i32, ptr %15, align 4, !tbaa !5
  %190 = load i32, ptr @n, align 4, !tbaa !5
  %191 = icmp slt i32 %189, %190
  br i1 %191, label %193, label %192

192:                                              ; preds = %188
  store i32 28, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %205

193:                                              ; preds = %188
  %194 = load i8, ptr @c, align 1, !tbaa !21
  %195 = load i32, ptr %15, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [1001 x i8], ptr @res, i64 0, i64 %196
  store i8 %194, ptr %197, align 1, !tbaa !21
  br label %198

198:                                              ; preds = %193
  %199 = load i32, ptr %14, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @primes, i64 noundef %200) #5
  %202 = load i32, ptr %201, align 4, !tbaa !5
  %203 = load i32, ptr %15, align 4, !tbaa !5
  %204 = add nsw i32 %203, %202
  store i32 %204, ptr %15, align 4, !tbaa !5
  br label %188, !llvm.loop !26

205:                                              ; preds = %192
  br label %206

206:                                              ; preds = %205
  %207 = load i32, ptr %14, align 4, !tbaa !5
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %14, align 4, !tbaa !5
  br label %177, !llvm.loop !27

209:                                              ; preds = %181
  %210 = load i32, ptr @cnt, align 4, !tbaa !5
  %211 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @m, ptr noundef nonnull align 1 dereferenceable(1) @c)
  %212 = load i32, ptr %211, align 4, !tbaa !5
  %213 = sub nsw i32 %212, %210
  store i32 %213, ptr %211, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %214 = call ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @m) #5
  %215 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %16, i32 0, i32 0
  store ptr %214, ptr %215, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %216

216:                                              ; preds = %249, %209
  %217 = load i32, ptr %17, align 4, !tbaa !5
  %218 = load i32, ptr @n, align 4, !tbaa !5
  %219 = icmp slt i32 %217, %218
  br i1 %219, label %221, label %220

220:                                              ; preds = %216
  store i32 31, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %252

221:                                              ; preds = %216
  %222 = load i32, ptr %17, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [1001 x i32], ptr @mark, i64 0, i64 %223
  %225 = load i32, ptr %224, align 4, !tbaa !5
  %226 = icmp eq i32 %225, 0
  br i1 %226, label %227, label %248

227:                                              ; preds = %221
  br label %228

228:                                              ; preds = %233, %227
  %229 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKciEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  %230 = getelementptr inbounds %"struct.std::pair", ptr %229, i32 0, i32 1
  %231 = load i32, ptr %230, align 4, !tbaa !22
  %232 = icmp eq i32 %231, 0
  br i1 %232, label %233, label %236

233:                                              ; preds = %228
  %234 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKciEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %16, i32 noundef 0) #5
  %235 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %18, i32 0, i32 0
  store ptr %234, ptr %235, align 8
  br label %228, !llvm.loop !28

236:                                              ; preds = %228
  %237 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKciEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  %238 = getelementptr inbounds %"struct.std::pair", ptr %237, i32 0, i32 0
  %239 = load i8, ptr %238, align 4, !tbaa !24
  %240 = load i32, ptr %17, align 4, !tbaa !5
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [1001 x i8], ptr @res, i64 0, i64 %241
  store i8 %239, ptr %242, align 1, !tbaa !21
  %243 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKciEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  %244 = getelementptr inbounds %"struct.std::pair", ptr %243, i32 0, i32 0
  %245 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @m, ptr noundef nonnull align 1 dereferenceable(1) %244)
  %246 = load i32, ptr %245, align 4, !tbaa !5
  %247 = add nsw i32 %246, -1
  store i32 %247, ptr %245, align 4, !tbaa !5
  br label %248

248:                                              ; preds = %236, %221
  br label %249

249:                                              ; preds = %248
  %250 = load i32, ptr %17, align 4, !tbaa !5
  %251 = add nsw i32 %250, 1
  store i32 %251, ptr %17, align 4, !tbaa !5
  br label %216, !llvm.loop !29

252:                                              ; preds = %220
  %253 = call i32 @puts(ptr noundef @.str)
  %254 = call i32 @puts(ptr noundef @res)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %255

255:                                              ; preds = %252, %171, %24
  %256 = load i32, ptr %1, align 4
  ret i32 %256
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

declare i32 @puts(ptr noundef) #1

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKciEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = !{!7, !7, i64 0}
!22 = !{!23, !6, i64 4}
!23 = !{!"_ZTSSt4pairIKciE", !7, i64 0, !6, i64 4}
!24 = !{!23, !7, i64 0}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10}
!29 = distinct !{!29, !10}


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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int>>, std::less<char>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int>>, std::less<char>>::_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 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::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 }
%"struct.std::_Rb_tree_iterator" = type { ptr }

@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@n = external dso_local local_unnamed_addr global i32, align 4
@up = external dso_local local_unnamed_addr global i32, align 4
@cnt = external dso_local local_unnamed_addr global i32, align 4
@m = external dso_local global %"class.std::map", align 8
@primes = external dso_local global %"class.std::vector", align 8
@mark = external dso_local local_unnamed_addr global [1001 x i32], align 16
@res = external dso_local global [1001 x i8], align 16
@c = external dso_local global i8, align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %4 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %5 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %6 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  %7 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #7
  %8 = trunc i64 %7 to i32
  store i32 %8, ptr @n, align 4, !tbaa !5
  %9 = icmp slt i32 %8, 4
  br i1 %9, label %10, label %.lr.ph

10:                                               ; preds = %0
  %11 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str)
  %12 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #7
  %13 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) %12)
  br label %151

._crit_edge:                                      ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 2, ptr %1, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) @primes, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 3, ptr %2, align 4, !tbaa !5
  br label %.preheader42

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %14 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv)
  %15 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @m, ptr noundef nonnull align 1 dereferenceable(1) %14)
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = add nsw i32 %16, 1
  store i32 %17, ptr %15, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = icmp slt i64 %indvars.iv.next, %19
  br i1 %20, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader42:                                     ; preds = %._crit_edge, %31
  %21 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @primes) #7
  %.not78 = icmp eq i64 %21, 0
  br i1 %.not78, label %.critedge77, label %.lr.ph47

22:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr @up, align 4, !tbaa !5
  %23 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @primes) #7
  %.not79 = icmp eq i64 %23, 0
  br i1 %.not79, label %.critedge, label %.lr.ph50

._crit_edge48:                                    ; preds = %.lr.ph47
  br i1 %spec.select, label %.critedge77, label %31

.lr.ph47:                                         ; preds = %.preheader42, %.lr.ph47
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %.lr.ph47 ], [ 0, %.preheader42 ]
  %.03845 = phi i1 [ %spec.select, %.lr.ph47 ], [ true, %.preheader42 ]
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @primes, i64 noundef %indvars.iv83) #7
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = srem i32 %24, %26
  %28 = icmp ne i32 %27, 0
  %spec.select = select i1 %28, i1 %.03845, i1 false
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %29 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @primes) #7
  %30 = icmp ugt i64 %29, %indvars.iv.next84
  br i1 %30, label %.lr.ph47, label %._crit_edge48, !llvm.loop !11

.critedge77:                                      ; preds = %.preheader42, %._crit_edge48
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @primes, ptr noundef nonnull align 4 dereferenceable(4) %2)
  br label %31

31:                                               ; preds = %.critedge77, %._crit_edge48
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = add nsw i32 %32, 2
  store i32 %33, ptr %2, align 4, !tbaa !5
  %34 = icmp slt i32 %32, 999
  br i1 %34, label %.preheader42, label %22, !llvm.loop !12

.lr.ph50:                                         ; preds = %22, %41
  %35 = load i32, ptr @up, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @primes, i64 noundef %36) #7
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = sdiv i32 %39, 2
  %.not = icmp sgt i32 %38, %40
  br i1 %.not, label %.critedge, label %41

41:                                               ; preds = %.lr.ph50
  %42 = load i32, ptr @up, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr @up, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @primes) #7
  %46 = icmp ugt i64 %45, %44
  br i1 %46, label %.lr.ph50, label %.critedge, !llvm.loop !13

.critedge:                                        ; preds = %.lr.ph50, %41, %22
  %47 = load i32, ptr @up, align 4, !tbaa !5
  %48 = icmp sgt i32 %47, 0
  br i1 %48, label %.lr.ph57, label %.critedge..preheader41_crit_edge

.critedge..preheader41_crit_edge:                 ; preds = %.critedge
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %.preheader41

.preheader41:                                     ; preds = %._crit_edge55, %.critedge..preheader41_crit_edge
  %49 = phi i32 [ %.pre, %.critedge..preheader41_crit_edge ], [ %62, %._crit_edge55 ]
  %50 = icmp sgt i32 %49, 0
  br i1 %50, label %.lr.ph59.preheader, label %73

.lr.ph59.preheader:                               ; preds = %.preheader41
  %cnt.promoted = load i32, ptr @cnt, align 4, !tbaa !5
  %wide.trip.count = zext nneg i32 %49 to i64
  %min.iters.check = icmp ult i32 %49, 8
  br i1 %min.iters.check, label %.lr.ph59.preheader104, label %vector.ph

.lr.ph59.preheader104:                            ; preds = %middle.block, %.lr.ph59.preheader
  %indvars.iv88.ph = phi i64 [ 0, %.lr.ph59.preheader ], [ %n.vec, %middle.block ]
  %.ph = phi i32 [ %cnt.promoted, %.lr.ph59.preheader ], [ %57, %middle.block ]
  br label %.lr.ph59

vector.ph:                                        ; preds = %.lr.ph59.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  %51 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %cnt.promoted, i64 0
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ %51, %vector.ph ], [ %54, %vector.body ]
  %vec.phi102 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %55, %vector.body ]
  %52 = getelementptr inbounds [1001 x i32], ptr @mark, i64 0, i64 %index
  %53 = getelementptr inbounds i8, ptr %52, i64 16
  %wide.load = load <4 x i32>, ptr %52, align 16, !tbaa !5
  %wide.load103 = load <4 x i32>, ptr %53, align 16, !tbaa !5
  %54 = add <4 x i32> %vec.phi, %wide.load
  %55 = add <4 x i32> %vec.phi102, %wide.load103
  %index.next = add nuw i64 %index, 8
  %56 = icmp eq i64 %index.next, %n.vec
  br i1 %56, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %55, %54
  %57 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge60, label %.lr.ph59.preheader104

.lr.ph57:                                         ; preds = %.critedge, %._crit_edge55
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %._crit_edge55 ], [ 0, %.critedge ]
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @primes, i64 noundef %indvars.iv85) #7
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = load i32, ptr @n, align 4, !tbaa !5
  %.not80 = icmp sgt i32 %59, %60
  br i1 %.not80, label %._crit_edge55, label %.lr.ph54.preheader

.lr.ph54.preheader:                               ; preds = %.lr.ph57
  %61 = add nsw i32 %59, -1
  br label %.lr.ph54

._crit_edge55:                                    ; preds = %.lr.ph54, %.lr.ph57
  %62 = phi i32 [ %60, %.lr.ph57 ], [ %71, %.lr.ph54 ]
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %63 = load i32, ptr @up, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = icmp slt i64 %indvars.iv.next86, %64
  br i1 %65, label %.lr.ph57, label %.preheader41, !llvm.loop !17

.lr.ph54:                                         ; preds = %.lr.ph54.preheader, %.lr.ph54
  %.03552 = phi i32 [ %70, %.lr.ph54 ], [ %61, %.lr.ph54.preheader ]
  %66 = sext i32 %.03552 to i64
  %67 = getelementptr inbounds [1001 x i32], ptr @mark, i64 0, i64 %66
  store i32 1, ptr %67, align 4, !tbaa !5
  %68 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @primes, i64 noundef %indvars.iv85) #7
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = add nsw i32 %69, %.03552
  %71 = load i32, ptr @n, align 4, !tbaa !5
  %72 = icmp slt i32 %70, %71
  br i1 %72, label %.lr.ph54, label %._crit_edge55, !llvm.loop !18

._crit_edge60:                                    ; preds = %.lr.ph59, %middle.block
  %.lcssa = phi i32 [ %57, %middle.block ], [ %80, %.lr.ph59 ]
  store i32 %.lcssa, ptr @cnt, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %._crit_edge60, %.preheader41
  store i8 46, ptr @c, align 1, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %74 = call ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @m) #7
  store ptr %74, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %75 = call ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @m) #7
  store ptr %75, ptr %4, align 8
  %76 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKciEES5_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br i1 %76, label %.lr.ph62, label %thread-pre-split

.lr.ph59:                                         ; preds = %.lr.ph59.preheader104, %.lr.ph59
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %.lr.ph59 ], [ %indvars.iv88.ph, %.lr.ph59.preheader104 ]
  %77 = phi i32 [ %80, %.lr.ph59 ], [ %.ph, %.lr.ph59.preheader104 ]
  %78 = getelementptr inbounds [1001 x i32], ptr @mark, i64 0, i64 %indvars.iv88
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = add nsw i32 %77, %79
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge60, label %.lr.ph59, !llvm.loop !20

.lr.ph62:                                         ; preds = %73, %88
  %81 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKciEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %82 = getelementptr inbounds i8, ptr %81, i64 4
  %83 = load i32, ptr %82, align 4, !tbaa !21
  %84 = load i32, ptr @cnt, align 4, !tbaa !5
  %.not40 = icmp slt i32 %83, %84
  br i1 %.not40, label %88, label %85

85:                                               ; preds = %.lr.ph62
  %86 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKciEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %87 = load i8, ptr %86, align 4, !tbaa !23
  store i8 %87, ptr @c, align 1, !tbaa !19
  br label %92

88:                                               ; preds = %.lr.ph62
  %89 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKciEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %90 = call ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @m) #7
  store ptr %90, ptr %4, align 8
  %91 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKciEES5_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br i1 %91, label %.lr.ph62, label %thread-pre-split, !llvm.loop !24

thread-pre-split:                                 ; preds = %88, %73
  %.pr = load i8, ptr @c, align 1, !tbaa !19
  br label %92

92:                                               ; preds = %thread-pre-split, %85
  %93 = phi i8 [ %.pr, %thread-pre-split ], [ %87, %85 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %94 = icmp eq i8 %93, 46
  br i1 %94, label %95, label %97

95:                                               ; preds = %92
  %96 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.4)
  br label %151

97:                                               ; preds = %92
  %98 = load i32, ptr @n, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [1001 x i8], ptr @res, i64 0, i64 %99
  store i8 0, ptr %100, align 1, !tbaa !19
  %101 = load i32, ptr @up, align 4, !tbaa !5
  %102 = icmp sgt i32 %101, 0
  br i1 %102, label %.lr.ph69, label %._crit_edge70

._crit_edge70:                                    ; preds = %._crit_edge66, %97
  %103 = load i32, ptr @cnt, align 4, !tbaa !5
  %104 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @m, ptr noundef nonnull align 1 dereferenceable(1) @c)
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = sub nsw i32 %105, %103
  store i32 %106, ptr %104, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %107 = call ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @m) #7
  store ptr %107, ptr %5, align 8
  %108 = load i32, ptr @n, align 4, !tbaa !5
  %109 = icmp sgt i32 %108, 0
  br i1 %109, label %.lr.ph75, label %._crit_edge76

.lr.ph69:                                         ; preds = %97, %._crit_edge66
  %indvars.iv91 = phi i64 [ %indvars.iv.next92, %._crit_edge66 ], [ 0, %97 ]
  %110 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @primes, i64 noundef %indvars.iv91) #7
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = load i32, ptr @n, align 4, !tbaa !5
  %.not81 = icmp sgt i32 %111, %112
  br i1 %.not81, label %._crit_edge66, label %.lr.ph65.preheader

.lr.ph65.preheader:                               ; preds = %.lr.ph69
  %113 = add nsw i32 %111, -1
  br label %.lr.ph65

._crit_edge66:                                    ; preds = %.lr.ph65, %.lr.ph69
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %114 = load i32, ptr @up, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = icmp slt i64 %indvars.iv.next92, %115
  br i1 %116, label %.lr.ph69, label %._crit_edge70, !llvm.loop !25

.lr.ph65:                                         ; preds = %.lr.ph65.preheader, %.lr.ph65
  %.03163 = phi i32 [ %122, %.lr.ph65 ], [ %113, %.lr.ph65.preheader ]
  %117 = load i8, ptr @c, align 1, !tbaa !19
  %118 = sext i32 %.03163 to i64
  %119 = getelementptr inbounds [1001 x i8], ptr @res, i64 0, i64 %118
  store i8 %117, ptr %119, align 1, !tbaa !19
  %120 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @primes, i64 noundef %indvars.iv91) #7
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = add nsw i32 %121, %.03163
  %123 = load i32, ptr @n, align 4, !tbaa !5
  %124 = icmp slt i32 %122, %123
  br i1 %124, label %.lr.ph65, label %._crit_edge66, !llvm.loop !26

._crit_edge76:                                    ; preds = %147, %._crit_edge70
  %125 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str)
  %126 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @res)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %151

.lr.ph75:                                         ; preds = %._crit_edge70, %147
  %127 = phi i32 [ %148, %147 ], [ %108, %._crit_edge70 ]
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %147 ], [ 0, %._crit_edge70 ]
  %128 = getelementptr inbounds [1001 x i32], ptr @mark, i64 0, i64 %indvars.iv94
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = icmp eq i32 %129, 0
  br i1 %130, label %.preheader, label %147

.preheader:                                       ; preds = %.lr.ph75
  %131 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKciEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %132 = getelementptr inbounds i8, ptr %131, i64 4
  %133 = load i32, ptr %132, align 4, !tbaa !21
  %134 = icmp eq i32 %133, 0
  br i1 %134, label %.lr.ph71, label %._crit_edge72

.lr.ph71:                                         ; preds = %.preheader, %.lr.ph71
  %135 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKciEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef 0) #7
  %136 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKciEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %137 = getelementptr inbounds i8, ptr %136, i64 4
  %138 = load i32, ptr %137, align 4, !tbaa !21
  %139 = icmp eq i32 %138, 0
  br i1 %139, label %.lr.ph71, label %._crit_edge72, !llvm.loop !27

._crit_edge72:                                    ; preds = %.lr.ph71, %.preheader
  %140 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKciEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %141 = load i8, ptr %140, align 4, !tbaa !23
  %142 = getelementptr inbounds [1001 x i8], ptr @res, i64 0, i64 %indvars.iv94
  store i8 %141, ptr %142, align 1, !tbaa !19
  %143 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKciEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %144 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @m, ptr noundef nonnull align 1 dereferenceable(1) %143)
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = add nsw i32 %145, -1
  store i32 %146, ptr %144, align 4, !tbaa !5
  %.pre97 = load i32, ptr @n, align 4, !tbaa !5
  br label %147

147:                                              ; preds = %.lr.ph75, %._crit_edge72
  %148 = phi i32 [ %127, %.lr.ph75 ], [ %.pre97, %._crit_edge72 ]
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %149 = sext i32 %148 to i64
  %150 = icmp slt i64 %indvars.iv.next95, %149
  br i1 %150, label %.lr.ph75, label %._crit_edge76, !llvm.loop !28

151:                                              ; preds = %._crit_edge76, %95, %10
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) 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) #4

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !10, !16, !15}
!21 = !{!22, !6, i64 4}
!22 = !{!"_ZTSSt4pairIKciE", !7, i64 0, !6, i64 4}
!23 = !{!22, !7, i64 0}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10}


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