; LLVM IR from ShahjalalShohag/code-library :: Number Theory (K Divisors)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

@_ZN3pcf3lenE = external dso_local global i32, align 4
@_ZN3pcf6primesE = external dso_local global [1000010 x i32], align 16
@pw = external dso_local global [1010 x [41 x i64]], align 16
@s = external dso_local global [2020 x i32], align 16
@d = external dso_local global [2020 x %"class.std::vector"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3pcf4initEv() #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z9backtrackxii(i64 noundef, i32 noundef, i32 noundef) #1

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

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

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

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

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

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

29:                                               ; preds = %37, %27
  %30 = load i32, ptr %4, align 4, !tbaa !8
  %31 = icmp slt i32 %30, 2020
  br i1 %31, label %33, label %32

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

33:                                               ; preds = %29
  %34 = load i32, ptr %4, align 4, !tbaa !8
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [2020 x %"class.std::vector"], ptr @d, i64 0, i64 %35
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef nonnull align 4 dereferenceable(4) %2)
  br label %37

37:                                               ; preds = %33
  %38 = load i32, ptr %2, align 4, !tbaa !8
  %39 = load i32, ptr %4, align 4, !tbaa !8
  %40 = add nsw i32 %39, %38
  store i32 %40, ptr %4, align 4, !tbaa !8
  br label %29, !llvm.loop !11

41:                                               ; preds = %32
  %42 = load i32, ptr %2, align 4, !tbaa !8
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [2020 x %"class.std::vector"], ptr @d, i64 0, i64 %43
  %45 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %44) #6
  %46 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  store ptr %45, ptr %46, align 8
  %47 = load i32, ptr %2, align 4, !tbaa !8
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [2020 x %"class.std::vector"], ptr @d, i64 0, i64 %48
  %50 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %49) #6
  %51 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  store ptr %50, ptr %51, align 8
  %52 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8
  %54 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  %55 = load ptr, ptr %54, align 8
  call void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %53, ptr %55)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !8
  br label %56

56:                                               ; preds = %97, %41
  %57 = load i32, ptr %7, align 4, !tbaa !8
  %58 = load i32, ptr @_ZN3pcf3lenE, align 4, !tbaa !8
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  store i32 8, ptr %3, align 4
  br label %100

61:                                               ; preds = %56
  %62 = load i32, ptr %7, align 4, !tbaa !8
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [1000010 x i32], ptr @_ZN3pcf6primesE, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !8
  %66 = load i32, ptr %2, align 4, !tbaa !8
  %67 = icmp sgt i32 %65, %66
  br i1 %67, label %68, label %69

68:                                               ; preds = %61
  store i32 8, ptr %3, align 4
  br label %100

69:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %70 = load i32, ptr %2, align 4, !tbaa !8
  store i32 %70, ptr %8, align 4, !tbaa !8
  br label %71

71:                                               ; preds = %79, %69
  %72 = load i32, ptr %8, align 4, !tbaa !8
  %73 = load i32, ptr %7, align 4, !tbaa !8
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [1000010 x i32], ptr @_ZN3pcf6primesE, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !8
  %77 = srem i32 %72, %76
  %78 = icmp eq i32 %77, 0
  br i1 %78, label %79, label %96

79:                                               ; preds = %71
  %80 = load i32, ptr %7, align 4, !tbaa !8
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [1000010 x i32], ptr @_ZN3pcf6primesE, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !8
  %84 = load i32, ptr %8, align 4, !tbaa !8
  %85 = sdiv i32 %84, %83
  store i32 %85, ptr %8, align 4, !tbaa !8
  %86 = load i32, ptr %7, align 4, !tbaa !8
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [1000010 x i32], ptr @_ZN3pcf6primesE, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !8
  %90 = sub nsw i32 %89, 1
  %91 = load i32, ptr %2, align 4, !tbaa !8
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [2020 x i32], ptr @s, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !8
  %95 = add nsw i32 %94, %90
  store i32 %95, ptr %93, align 4, !tbaa !8
  br label %71, !llvm.loop !13

96:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %7, align 4, !tbaa !8
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %7, align 4, !tbaa !8
  br label %56, !llvm.loop !14

100:                                              ; preds = %68, %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %101

101:                                              ; preds = %100
  br label %102

102:                                              ; preds = %101
  %103 = load i32, ptr %2, align 4, !tbaa !8
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %2, align 4, !tbaa !8
  br label %23, !llvm.loop !15

105:                                              ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 2, ptr %9, align 4, !tbaa !8
  br label %106

106:                                              ; preds = %157, %105
  %107 = load i32, ptr %9, align 4, !tbaa !8
  %108 = icmp slt i32 %107, 1010
  br i1 %108, label %110, label %109

109:                                              ; preds = %106
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %160

110:                                              ; preds = %106
  %111 = load i32, ptr %9, align 4, !tbaa !8
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %112
  %114 = getelementptr inbounds [41 x i64], ptr %113, i64 0, i64 0
  store i64 1, ptr %114, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !8
  br label %115

115:                                              ; preds = %153, %110
  %116 = load i32, ptr %10, align 4, !tbaa !8
  %117 = icmp slt i32 %116, 41
  br i1 %117, label %119, label %118

118:                                              ; preds = %115
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %156

119:                                              ; preds = %115
  %120 = load i32, ptr %9, align 4, !tbaa !8
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %121
  %123 = load i32, ptr %10, align 4, !tbaa !8
  %124 = sub nsw i32 %123, 1
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [41 x i64], ptr %122, i64 0, i64 %125
  %127 = load i64, ptr %126, align 8, !tbaa !16
  %128 = load i32, ptr %9, align 4, !tbaa !8
  %129 = sext i32 %128 to i64
  %130 = mul nsw i64 %127, %129
  %131 = load i32, ptr %9, align 4, !tbaa !8
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %132
  %134 = load i32, ptr %10, align 4, !tbaa !8
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [41 x i64], ptr %133, i64 0, i64 %135
  store i64 %130, ptr %136, align 8, !tbaa !16
  %137 = load i32, ptr %9, align 4, !tbaa !8
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %138
  %140 = load i32, ptr %10, align 4, !tbaa !8
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [41 x i64], ptr %139, i64 0, i64 %141
  %143 = load i64, ptr %142, align 8, !tbaa !16
  %144 = icmp sgt i64 %143, 1000000000009
  br i1 %144, label %145, label %152

145:                                              ; preds = %119
  %146 = load i32, ptr %9, align 4, !tbaa !8
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %147
  %149 = load i32, ptr %10, align 4, !tbaa !8
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [41 x i64], ptr %148, i64 0, i64 %150
  store i64 1000000000009, ptr %151, align 8, !tbaa !16
  br label %152

152:                                              ; preds = %145, %119
  br label %153

153:                                              ; preds = %152
  %154 = load i32, ptr %10, align 4, !tbaa !8
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %10, align 4, !tbaa !8
  br label %115, !llvm.loop !18

156:                                              ; preds = %118
  br label %157

157:                                              ; preds = %156
  %158 = load i32, ptr %9, align 4, !tbaa !8
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %9, align 4, !tbaa !8
  br label %106, !llvm.loop !19

160:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !8
  %161 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %11)
  br label %162

162:                                              ; preds = %166, %160
  %163 = load i32, ptr %11, align 4, !tbaa !8
  %164 = add nsw i32 %163, -1
  store i32 %164, ptr %11, align 4, !tbaa !8
  %165 = icmp ne i32 %163, 0
  br i1 %165, label %166, label %189

166:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %167 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %168 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %167, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %169 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %168, ptr noundef nonnull align 8 dereferenceable(8) %15)
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %170 = load i64, ptr %14, align 8, !tbaa !16
  %171 = load i64, ptr %15, align 8, !tbaa !16
  %172 = trunc i64 %171 to i32
  %173 = call noundef i64 @_Z9backtrackxii(i64 noundef %170, i32 noundef %172, i32 noundef 0)
  store i64 %173, ptr %16, align 8, !tbaa !16
  %174 = load i64, ptr %13, align 8, !tbaa !16
  %175 = sub nsw i64 %174, 1
  %176 = load i64, ptr %15, align 8, !tbaa !16
  %177 = trunc i64 %176 to i32
  %178 = call noundef i64 @_Z9backtrackxii(i64 noundef %175, i32 noundef %177, i32 noundef 0)
  %179 = load i64, ptr %16, align 8, !tbaa !16
  %180 = sub nsw i64 %179, %178
  store i64 %180, ptr %16, align 8, !tbaa !16
  %181 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %182 = load i32, ptr %12, align 4, !tbaa !8
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %12, align 4, !tbaa !8
  %184 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %181, i32 noundef %183)
  %185 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %184, ptr noundef @.str.2)
  %186 = load i64, ptr %16, align 8, !tbaa !16
  %187 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %185, i64 noundef %186)
  %188 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %187, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %162, !llvm.loop !20

189:                                              ; preds = %162
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  %190 = load i32, ptr %1, align 4
  ret i32 %190
}

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

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

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

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: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

; 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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 = !{!17, !17, i64 0}
!17 = !{!"long long", !10, i64 0}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !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::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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@_ZN3pcf3lenE = external dso_local local_unnamed_addr global i32, align 4
@_ZN3pcf6primesE = external dso_local local_unnamed_addr global [1000010 x i32], align 16
@pw = external dso_local local_unnamed_addr global [1010 x [41 x i64]], align 16
@s = external dso_local local_unnamed_addr global [2020 x i32], align 16
@d = external dso_local global [2020 x %"class.std::vector"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3pcf4initEv() local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z9backtrackxii(i64 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %7 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %9
  %11 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  tail call void @_ZN3pcf4initEv()
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 2, ptr %1, align 4, !tbaa !8
  br label %.preheader38

12:                                               ; preds = %._crit_edge44
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  br label %50

13:                                               ; preds = %.preheader38
  %14 = sext i32 %27 to i64
  %15 = getelementptr inbounds [2020 x %"class.std::vector"], ptr @d, i64 0, i64 %14
  %16 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  %17 = load i32, ptr %1, align 4, !tbaa !8
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [2020 x %"class.std::vector"], ptr @d, i64 0, i64 %18
  %20 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #7
  call void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %16, ptr %20)
  %21 = load i32, ptr @_ZN3pcf3lenE, align 4, !tbaa !8
  %22 = icmp sgt i32 %21, 0
  %.pre = load i32, ptr %1, align 4, !tbaa !8
  br i1 %22, label %.lr.ph43, label %._crit_edge44

.lr.ph43:                                         ; preds = %13
  %23 = sext i32 %.pre to i64
  %24 = getelementptr inbounds [2020 x i32], ptr @s, i64 0, i64 %23
  %wide.trip.count = zext nneg i32 %21 to i64
  br label %30

.preheader38:                                     ; preds = %.preheader38.backedge, %0
  %.03439 = phi i32 [ 2, %0 ], [ %.03439.be, %.preheader38.backedge ]
  %25 = sext i32 %.03439 to i64
  %26 = getelementptr inbounds [2020 x %"class.std::vector"], ptr @d, i64 0, i64 %25
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %26, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %27 = load i32, ptr %1, align 4, !tbaa !8
  %28 = add nsw i32 %27, %.03439
  %29 = icmp slt i32 %28, 2020
  br i1 %29, label %.preheader38.backedge, label %13

.preheader38.backedge:                            ; preds = %.preheader38, %._crit_edge44
  %.03439.be = phi i32 [ %28, %.preheader38 ], [ %44, %._crit_edge44 ]
  br label %.preheader38, !llvm.loop !11

30:                                               ; preds = %.lr.ph43, %43
  %indvars.iv = phi i64 [ 0, %.lr.ph43 ], [ %indvars.iv.next, %43 ]
  %31 = getelementptr inbounds [1000010 x i32], ptr @_ZN3pcf6primesE, i64 0, i64 %indvars.iv
  %32 = load i32, ptr %31, align 4, !tbaa !8
  %33 = icmp sgt i32 %32, %.pre
  br i1 %33, label %._crit_edge44, label %.preheader

.preheader:                                       ; preds = %30
  %34 = srem i32 %.pre, %32
  %35 = icmp eq i32 %34, 0
  br i1 %35, label %.lr.ph, label %43

.lr.ph:                                           ; preds = %.preheader
  %36 = add nsw i32 %32, -1
  %.promoted = load i32, ptr %24, align 4, !tbaa !8
  br label %37

37:                                               ; preds = %.lr.ph, %37
  %38 = phi i32 [ %.promoted, %.lr.ph ], [ %40, %37 ]
  %.03240 = phi i32 [ %.pre, %.lr.ph ], [ %39, %37 ]
  %39 = sdiv i32 %.03240, %32
  %40 = add nsw i32 %36, %38
  %41 = srem i32 %39, %32
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %37, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %37
  store i32 %40, ptr %24, align 4, !tbaa !8
  br label %43

43:                                               ; preds = %._crit_edge, %.preheader
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge44, label %30, !llvm.loop !14

._crit_edge44:                                    ; preds = %43, %30, %13
  %44 = add nsw i32 %.pre, 1
  store i32 %44, ptr %1, align 4, !tbaa !8
  %45 = icmp slt i32 %.pre, 2019
  br i1 %45, label %.preheader38.backedge, label %12

46:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %48 = load i32, ptr %2, align 4, !tbaa !8
  %49 = add nsw i32 %48, -1
  store i32 %49, ptr %2, align 4, !tbaa !8
  %.not49 = icmp eq i32 %48, 0
  br i1 %.not49, label %._crit_edge53, label %.lr.ph52

50:                                               ; preds = %12, %50
  %indvars.iv59 = phi i64 [ 2, %12 ], [ %indvars.iv.next60, %50 ]
  %51 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59
  store i64 1, ptr %51, align 8, !tbaa !15
  %52 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 1
  %spec.select = call i64 @llvm.smin.i64(i64 %indvars.iv59, i64 1000000000009)
  store i64 %spec.select, ptr %52, align 8, !tbaa !15
  %53 = mul nuw nsw i64 %spec.select, %indvars.iv59
  %54 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 2
  %spec.select.1 = call i64 @llvm.smin.i64(i64 %53, i64 1000000000009)
  store i64 %spec.select.1, ptr %54, align 8, !tbaa !15
  %55 = mul nuw nsw i64 %spec.select.1, %indvars.iv59
  %56 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 3
  %spec.select.2 = call i64 @llvm.smin.i64(i64 %55, i64 1000000000009)
  store i64 %spec.select.2, ptr %56, align 8, !tbaa !15
  %57 = mul nuw nsw i64 %spec.select.2, %indvars.iv59
  %58 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 4
  %spec.select.3 = call i64 @llvm.smin.i64(i64 %57, i64 1000000000009)
  store i64 %spec.select.3, ptr %58, align 8, !tbaa !15
  %59 = mul nsw i64 %spec.select.3, %indvars.iv59
  %60 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 5
  %spec.select.4 = call i64 @llvm.smin.i64(i64 %59, i64 1000000000009)
  store i64 %spec.select.4, ptr %60, align 8, !tbaa !15
  %61 = mul nsw i64 %spec.select.4, %indvars.iv59
  %62 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 6
  %spec.select.5 = call i64 @llvm.smin.i64(i64 %61, i64 1000000000009)
  store i64 %spec.select.5, ptr %62, align 8, !tbaa !15
  %63 = mul nsw i64 %spec.select.5, %indvars.iv59
  %64 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 7
  %spec.select.6 = call i64 @llvm.smin.i64(i64 %63, i64 1000000000009)
  store i64 %spec.select.6, ptr %64, align 8, !tbaa !15
  %65 = mul nsw i64 %spec.select.6, %indvars.iv59
  %66 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 8
  %spec.select.7 = call i64 @llvm.smin.i64(i64 %65, i64 1000000000009)
  store i64 %spec.select.7, ptr %66, align 8, !tbaa !15
  %67 = mul nsw i64 %spec.select.7, %indvars.iv59
  %68 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 9
  %spec.select.8 = call i64 @llvm.smin.i64(i64 %67, i64 1000000000009)
  store i64 %spec.select.8, ptr %68, align 8, !tbaa !15
  %69 = mul nsw i64 %spec.select.8, %indvars.iv59
  %70 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 10
  %spec.select.9 = call i64 @llvm.smin.i64(i64 %69, i64 1000000000009)
  store i64 %spec.select.9, ptr %70, align 8, !tbaa !15
  %71 = mul nsw i64 %spec.select.9, %indvars.iv59
  %72 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 11
  %spec.select.10 = call i64 @llvm.smin.i64(i64 %71, i64 1000000000009)
  store i64 %spec.select.10, ptr %72, align 8, !tbaa !15
  %73 = mul nsw i64 %spec.select.10, %indvars.iv59
  %74 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 12
  %spec.select.11 = call i64 @llvm.smin.i64(i64 %73, i64 1000000000009)
  store i64 %spec.select.11, ptr %74, align 8, !tbaa !15
  %75 = mul nsw i64 %spec.select.11, %indvars.iv59
  %76 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 13
  %spec.select.12 = call i64 @llvm.smin.i64(i64 %75, i64 1000000000009)
  store i64 %spec.select.12, ptr %76, align 8, !tbaa !15
  %77 = mul nsw i64 %spec.select.12, %indvars.iv59
  %78 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 14
  %spec.select.13 = call i64 @llvm.smin.i64(i64 %77, i64 1000000000009)
  store i64 %spec.select.13, ptr %78, align 8, !tbaa !15
  %79 = mul nsw i64 %spec.select.13, %indvars.iv59
  %80 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 15
  %spec.select.14 = call i64 @llvm.smin.i64(i64 %79, i64 1000000000009)
  store i64 %spec.select.14, ptr %80, align 8, !tbaa !15
  %81 = mul nsw i64 %spec.select.14, %indvars.iv59
  %82 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 16
  %spec.select.15 = call i64 @llvm.smin.i64(i64 %81, i64 1000000000009)
  store i64 %spec.select.15, ptr %82, align 8, !tbaa !15
  %83 = mul nsw i64 %spec.select.15, %indvars.iv59
  %84 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 17
  %spec.select.16 = call i64 @llvm.smin.i64(i64 %83, i64 1000000000009)
  store i64 %spec.select.16, ptr %84, align 8, !tbaa !15
  %85 = mul nsw i64 %spec.select.16, %indvars.iv59
  %86 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 18
  %spec.select.17 = call i64 @llvm.smin.i64(i64 %85, i64 1000000000009)
  store i64 %spec.select.17, ptr %86, align 8, !tbaa !15
  %87 = mul nsw i64 %spec.select.17, %indvars.iv59
  %88 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 19
  %spec.select.18 = call i64 @llvm.smin.i64(i64 %87, i64 1000000000009)
  store i64 %spec.select.18, ptr %88, align 8, !tbaa !15
  %89 = mul nsw i64 %spec.select.18, %indvars.iv59
  %90 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 20
  %spec.select.19 = call i64 @llvm.smin.i64(i64 %89, i64 1000000000009)
  store i64 %spec.select.19, ptr %90, align 8, !tbaa !15
  %91 = mul nsw i64 %spec.select.19, %indvars.iv59
  %92 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 21
  %spec.select.20 = call i64 @llvm.smin.i64(i64 %91, i64 1000000000009)
  store i64 %spec.select.20, ptr %92, align 8, !tbaa !15
  %93 = mul nsw i64 %spec.select.20, %indvars.iv59
  %94 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 22
  %spec.select.21 = call i64 @llvm.smin.i64(i64 %93, i64 1000000000009)
  store i64 %spec.select.21, ptr %94, align 8, !tbaa !15
  %95 = mul nsw i64 %spec.select.21, %indvars.iv59
  %96 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 23
  %spec.select.22 = call i64 @llvm.smin.i64(i64 %95, i64 1000000000009)
  store i64 %spec.select.22, ptr %96, align 8, !tbaa !15
  %97 = mul nsw i64 %spec.select.22, %indvars.iv59
  %98 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 24
  %spec.select.23 = call i64 @llvm.smin.i64(i64 %97, i64 1000000000009)
  store i64 %spec.select.23, ptr %98, align 8, !tbaa !15
  %99 = mul nsw i64 %spec.select.23, %indvars.iv59
  %100 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 25
  %spec.select.24 = call i64 @llvm.smin.i64(i64 %99, i64 1000000000009)
  store i64 %spec.select.24, ptr %100, align 8, !tbaa !15
  %101 = mul nsw i64 %spec.select.24, %indvars.iv59
  %102 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 26
  %spec.select.25 = call i64 @llvm.smin.i64(i64 %101, i64 1000000000009)
  store i64 %spec.select.25, ptr %102, align 8, !tbaa !15
  %103 = mul nsw i64 %spec.select.25, %indvars.iv59
  %104 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 27
  %spec.select.26 = call i64 @llvm.smin.i64(i64 %103, i64 1000000000009)
  store i64 %spec.select.26, ptr %104, align 8, !tbaa !15
  %105 = mul nsw i64 %spec.select.26, %indvars.iv59
  %106 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 28
  %spec.select.27 = call i64 @llvm.smin.i64(i64 %105, i64 1000000000009)
  store i64 %spec.select.27, ptr %106, align 8, !tbaa !15
  %107 = mul nsw i64 %spec.select.27, %indvars.iv59
  %108 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 29
  %spec.select.28 = call i64 @llvm.smin.i64(i64 %107, i64 1000000000009)
  store i64 %spec.select.28, ptr %108, align 8, !tbaa !15
  %109 = mul nsw i64 %spec.select.28, %indvars.iv59
  %110 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 30
  %spec.select.29 = call i64 @llvm.smin.i64(i64 %109, i64 1000000000009)
  store i64 %spec.select.29, ptr %110, align 8, !tbaa !15
  %111 = mul nsw i64 %spec.select.29, %indvars.iv59
  %112 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 31
  %spec.select.30 = call i64 @llvm.smin.i64(i64 %111, i64 1000000000009)
  store i64 %spec.select.30, ptr %112, align 8, !tbaa !15
  %113 = mul nsw i64 %spec.select.30, %indvars.iv59
  %114 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 32
  %spec.select.31 = call i64 @llvm.smin.i64(i64 %113, i64 1000000000009)
  store i64 %spec.select.31, ptr %114, align 8, !tbaa !15
  %115 = mul nsw i64 %spec.select.31, %indvars.iv59
  %116 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 33
  %spec.select.32 = call i64 @llvm.smin.i64(i64 %115, i64 1000000000009)
  store i64 %spec.select.32, ptr %116, align 8, !tbaa !15
  %117 = mul nsw i64 %spec.select.32, %indvars.iv59
  %118 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 34
  %spec.select.33 = call i64 @llvm.smin.i64(i64 %117, i64 1000000000009)
  store i64 %spec.select.33, ptr %118, align 8, !tbaa !15
  %119 = mul nsw i64 %spec.select.33, %indvars.iv59
  %120 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 35
  %spec.select.34 = call i64 @llvm.smin.i64(i64 %119, i64 1000000000009)
  store i64 %spec.select.34, ptr %120, align 8, !tbaa !15
  %121 = mul nsw i64 %spec.select.34, %indvars.iv59
  %122 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 36
  %spec.select.35 = call i64 @llvm.smin.i64(i64 %121, i64 1000000000009)
  store i64 %spec.select.35, ptr %122, align 8, !tbaa !15
  %123 = mul nsw i64 %spec.select.35, %indvars.iv59
  %124 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 37
  %spec.select.36 = call i64 @llvm.smin.i64(i64 %123, i64 1000000000009)
  store i64 %spec.select.36, ptr %124, align 8, !tbaa !15
  %125 = mul nsw i64 %spec.select.36, %indvars.iv59
  %126 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 38
  %spec.select.37 = call i64 @llvm.smin.i64(i64 %125, i64 1000000000009)
  store i64 %spec.select.37, ptr %126, align 8, !tbaa !15
  %127 = mul nsw i64 %spec.select.37, %indvars.iv59
  %128 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 39
  %spec.select.38 = call i64 @llvm.smin.i64(i64 %127, i64 1000000000009)
  store i64 %spec.select.38, ptr %128, align 8, !tbaa !15
  %129 = mul nsw i64 %spec.select.38, %indvars.iv59
  %130 = getelementptr inbounds [1010 x [41 x i64]], ptr @pw, i64 0, i64 %indvars.iv59, i64 40
  %spec.select.39 = call i64 @llvm.smin.i64(i64 %129, i64 1000000000009)
  store i64 %spec.select.39, ptr %130, align 8, !tbaa !15
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %exitcond62.not = icmp eq i64 %indvars.iv.next60, 1010
  br i1 %exitcond62.not, label %46, label %50, !llvm.loop !17

.lr.ph52:                                         ; preds = %46, %.lr.ph52
  %.050 = phi i32 [ %145, %.lr.ph52 ], [ 0, %46 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %131 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %132 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %131, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %133 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %132, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %134 = load i64, ptr %4, align 8, !tbaa !15
  %135 = load i64, ptr %5, align 8, !tbaa !15
  %136 = trunc i64 %135 to i32
  %137 = call noundef i64 @_Z9backtrackxii(i64 noundef %134, i32 noundef %136, i32 noundef 0)
  %138 = load i64, ptr %3, align 8, !tbaa !15
  %139 = add nsw i64 %138, -1
  %140 = load i64, ptr %5, align 8, !tbaa !15
  %141 = trunc i64 %140 to i32
  %142 = call noundef i64 @_Z9backtrackxii(i64 noundef %139, i32 noundef %141, i32 noundef 0)
  %143 = sub nsw i64 %137, %142
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %145 = add nuw nsw i32 %.050, 1
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %144, i32 noundef %145)
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %146, ptr noundef nonnull @.str.2)
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %147, i64 noundef %143)
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %148, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %150 = load i32, ptr %2, align 4, !tbaa !8
  %151 = add nsw i32 %150, -1
  store i32 %151, ptr %2, align 4, !tbaa !8
  %.not = icmp eq i32 %150, 0
  br i1 %.not, label %._crit_edge53, label %.lr.ph52, !llvm.loop !18

._crit_edge53:                                    ; preds = %.lr.ph52, %46
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  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

; 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 #1 align 2

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

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: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

; 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: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #6

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

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

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


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