; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Codesprints 2016/Codesprint June/Problem F/F.ll (Z3dfsi)

; 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::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@ways = external dso_local global [21 x [21 x i64]], align 16
@k = external dso_local global i32, align 4
@f = external dso_local global i32, align 4
@fc = external dso_local global [5 x i32], align 16
@ptr = external dso_local global [100100 x i32], align 16
@g = external dso_local global [100100 x %"class.std::vector"], align 16
@dp = external dso_local global [100100 x [5 x [21 x i64]]], align 16
@st = external dso_local global %"class.std::stack", align 8

; 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 nounwind uwtable
declare dso_local noundef i64 @_Z1Cii(i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3dfsi(i32 noundef %0) #2 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @st, ptr noundef nonnull align 4 dereferenceable(4) %2)
  br label %22

22:                                               ; preds = %227, %1
  %23 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @st)
  %24 = xor i1 %23, true
  br i1 %24, label %25, label %228

25:                                               ; preds = %22
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) @st)
  %27 = load i32, ptr %26, align 4, !tbaa !5
  store i32 %27, ptr %2, align 4, !tbaa !5
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [100100 x i32], ptr @ptr, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %34
  %36 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #4
  %37 = icmp eq i64 %32, %36
  br i1 %37, label %38, label %216

38:                                               ; preds = %25
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %40
  %42 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #4
  %43 = icmp eq i64 %42, 0
  br i1 %43, label %44, label %86

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

45:                                               ; preds = %82, %44
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = load i32, ptr @f, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %50, label %49

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

50:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [5 x i32], ptr @fc, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  store i32 %54, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %78, %50
  %56 = load i32, ptr %6, align 4, !tbaa !5
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) @k)
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = icmp sle i32 %56, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %55
  store i32 7, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %81

61:                                               ; preds = %55
  %62 = load i32, ptr %5, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [21 x [21 x i64]], ptr @ways, i64 0, i64 %63
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [21 x i64], ptr %64, i64 0, i64 %66
  %68 = load i64, ptr %67, align 8, !tbaa !9
  %69 = load i32, ptr %2, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100100 x [5 x [21 x i64]]], ptr @dp, i64 0, i64 %70
  %72 = load i32, ptr %3, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [5 x [21 x i64]], ptr %71, i64 0, i64 %73
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [21 x i64], ptr %74, i64 0, i64 %76
  store i64 %68, ptr %77, align 8, !tbaa !9
  br label %78

78:                                               ; preds = %61
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %6, align 4, !tbaa !5
  br label %55, !llvm.loop !11

81:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %3, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %3, align 4, !tbaa !5
  br label %45, !llvm.loop !13

85:                                               ; preds = %49
  br label %215

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

87:                                               ; preds = %211, %86
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = load i32, ptr @f, align 4, !tbaa !5
  %90 = icmp slt i32 %88, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %87
  store i32 10, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %214

92:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %93 = load i32, ptr %7, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [5 x i32], ptr @fc, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  store i32 %96, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %97 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) @k)
  %98 = load i32, ptr %97, align 4, !tbaa !5
  store i32 %98, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %207, %92
  %100 = load i32, ptr %10, align 4, !tbaa !5
  %101 = load i32, ptr %9, align 4, !tbaa !5
  %102 = icmp sle i32 %100, %101
  br i1 %102, label %104, label %103

103:                                              ; preds = %99
  store i32 13, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %210

104:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %105 = load i32, ptr %8, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [21 x [21 x i64]], ptr @ways, i64 0, i64 %106
  %108 = load i32, ptr %10, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [21 x i64], ptr %107, i64 0, i64 %109
  %111 = load i64, ptr %110, align 8, !tbaa !9
  store i64 %111, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store i64 1, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %112 = load i32, ptr %2, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %113
  %115 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %114) #4
  %116 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %115, ptr %116, align 8
  br label %117

117:                                              ; preds = %191, %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %118 = load i32, ptr %2, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %119
  %121 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %120) #4
  %122 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %121, ptr %122, align 8
  %123 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br i1 %123, label %125, label %124

124:                                              ; preds = %117
  store i32 16, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %193

125:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %126 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #4
  %127 = load i32, ptr %126, align 4, !tbaa !5
  store i32 %127, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  store i64 0, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %183, %125
  %129 = load i32, ptr %17, align 4, !tbaa !5
  %130 = load i32, ptr @f, align 4, !tbaa !5
  %131 = icmp slt i32 %129, %130
  br i1 %131, label %133, label %132

132:                                              ; preds = %128
  store i32 19, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %186

133:                                              ; preds = %128
  %134 = load i32, ptr %17, align 4, !tbaa !5
  %135 = load i32, ptr %7, align 4, !tbaa !5
  %136 = icmp eq i32 %134, %135
  br i1 %136, label %137, label %138

137:                                              ; preds = %133
  br label %183

138:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %139 = load i32, ptr %17, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [5 x i32], ptr @fc, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  store i32 %142, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %143 = load i32, ptr @k, align 4, !tbaa !5
  %144 = load i32, ptr %10, align 4, !tbaa !5
  %145 = sub nsw i32 %143, %144
  store i32 %145, ptr %20, align 4, !tbaa !5
  %146 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %20)
  %147 = load i32, ptr %146, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  store i32 %147, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  store i32 1, ptr %21, align 4, !tbaa !5
  br label %148

148:                                              ; preds = %179, %138
  %149 = load i32, ptr %21, align 4, !tbaa !5
  %150 = load i32, ptr %19, align 4, !tbaa !5
  %151 = icmp sle i32 %149, %150
  br i1 %151, label %153, label %152

152:                                              ; preds = %148
  store i32 22, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  br label %182

153:                                              ; preds = %148
  %154 = load i32, ptr @k, align 4, !tbaa !5
  %155 = load i32, ptr %10, align 4, !tbaa !5
  %156 = sub nsw i32 %154, %155
  %157 = load i32, ptr %21, align 4, !tbaa !5
  %158 = call noundef i64 @_Z1Cii(i32 noundef %156, i32 noundef %157)
  %159 = load i32, ptr %15, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [100100 x [5 x [21 x i64]]], ptr @dp, i64 0, i64 %160
  %162 = load i32, ptr %17, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [5 x [21 x i64]], ptr %161, i64 0, i64 %163
  %165 = load i32, ptr %21, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [21 x i64], ptr %164, i64 0, i64 %166
  %168 = load i64, ptr %167, align 8, !tbaa !9
  %169 = mul nsw i64 %158, %168
  %170 = srem i64 %169, 1000000009
  %171 = load i64, ptr %16, align 8, !tbaa !9
  %172 = add nsw i64 %171, %170
  store i64 %172, ptr %16, align 8, !tbaa !9
  %173 = load i64, ptr %16, align 8, !tbaa !9
  %174 = icmp sge i64 %173, 1000000009
  br i1 %174, label %175, label %178

175:                                              ; preds = %153
  %176 = load i64, ptr %16, align 8, !tbaa !9
  %177 = sub nsw i64 %176, 1000000009
  store i64 %177, ptr %16, align 8, !tbaa !9
  br label %178

178:                                              ; preds = %175, %153
  br label %179

179:                                              ; preds = %178
  %180 = load i32, ptr %21, align 4, !tbaa !5
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr %21, align 4, !tbaa !5
  br label %148, !llvm.loop !14

182:                                              ; preds = %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %183

183:                                              ; preds = %182, %137
  %184 = load i32, ptr %17, align 4, !tbaa !5
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %17, align 4, !tbaa !5
  br label %128, !llvm.loop !15

186:                                              ; preds = %132
  %187 = load i64, ptr %12, align 8, !tbaa !9
  %188 = load i64, ptr %16, align 8, !tbaa !9
  %189 = mul nsw i64 %187, %188
  %190 = srem i64 %189, 1000000009
  store i64 %190, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %191

191:                                              ; preds = %186
  %192 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #4
  br label %117, !llvm.loop !16

193:                                              ; preds = %124
  %194 = load i64, ptr %12, align 8, !tbaa !9
  %195 = load i64, ptr %11, align 8, !tbaa !9
  %196 = mul nsw i64 %194, %195
  %197 = srem i64 %196, 1000000009
  %198 = load i32, ptr %2, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [100100 x [5 x [21 x i64]]], ptr @dp, i64 0, i64 %199
  %201 = load i32, ptr %7, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [5 x [21 x i64]], ptr %200, i64 0, i64 %202
  %204 = load i32, ptr %10, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [21 x i64], ptr %203, i64 0, i64 %205
  store i64 %197, ptr %206, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %207

207:                                              ; preds = %193
  %208 = load i32, ptr %10, align 4, !tbaa !5
  %209 = add nsw i32 %208, 1
  store i32 %209, ptr %10, align 4, !tbaa !5
  br label %99, !llvm.loop !17

210:                                              ; preds = %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %211

211:                                              ; preds = %210
  %212 = load i32, ptr %7, align 4, !tbaa !5
  %213 = add nsw i32 %212, 1
  store i32 %213, ptr %7, align 4, !tbaa !5
  br label %87, !llvm.loop !18

214:                                              ; preds = %91
  br label %215

215:                                              ; preds = %214, %85
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @st)
  br label %227

216:                                              ; preds = %25
  %217 = load i32, ptr %2, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %218
  %220 = load i32, ptr %2, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [100100 x i32], ptr @ptr, i64 0, i64 %221
  %223 = load i32, ptr %222, align 4, !tbaa !5
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr %222, align 4, !tbaa !5
  %225 = sext i32 %223 to i64
  %226 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %219, i64 noundef %225) #4
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @st, ptr noundef nonnull align 4 dereferenceable(4) %226)
  br label %227

227:                                              ; preds = %216, %215
  br label %22, !llvm.loop !19

228:                                              ; preds = %22
  ret void
}

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

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

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

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

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

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

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

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

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

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

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

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


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

%"class.std::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::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@ways = external dso_local local_unnamed_addr global [21 x [21 x i64]], align 16
@k = external dso_local global i32, align 4
@f = external dso_local local_unnamed_addr global i32, align 4
@fc = external dso_local local_unnamed_addr global [5 x i32], align 16
@ptr = external dso_local local_unnamed_addr global [100100 x i32], align 16
@g = external dso_local global [100100 x %"class.std::vector"], align 16
@dp = external dso_local local_unnamed_addr global [100100 x [5 x [21 x i64]]], align 16
@st = external dso_local global %"class.std::stack", align 8

; 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 nounwind uwtable
declare dso_local noundef i64 @_Z1Cii(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3dfsi(i32 noundef %0) local_unnamed_addr #2 {
  %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
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @st, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %9 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @st)
  br i1 %9, label %._crit_edge81, label %.lr.ph80

.lr.ph80:                                         ; preds = %1, %116
  %10 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) @st)
  %11 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %11, ptr %2, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds [100100 x i32], ptr @ptr, i64 0, i64 %12
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %12
  %17 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #4
  %18 = icmp eq i64 %17, %15
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %20
  br i1 %18, label %22, label %110

22:                                               ; preds = %.lr.ph80
  %23 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #4
  %24 = icmp eq i64 %23, 0
  %25 = load i32, ptr @f, align 4, !tbaa !5
  %26 = icmp sgt i32 %25, 0
  br i1 %24, label %.preheader, label %.preheader49

.preheader49:                                     ; preds = %22
  br i1 %26, label %.lr.ph71, label %.loopexit

.preheader:                                       ; preds = %22
  br i1 %26, label %.lr.ph78, label %.loopexit

.lr.ph78:                                         ; preds = %.preheader, %._crit_edge76
  %indvars.iv98 = phi i64 [ %indvars.iv.next99, %._crit_edge76 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %27 = getelementptr inbounds [5 x i32], ptr @fc, i64 0, i64 %indvars.iv98
  %28 = load i32, ptr %27, align 4, !tbaa !5
  store i32 %28, ptr %3, align 4, !tbaa !5
  %29 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) @k)
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %.not4872 = icmp slt i32 %30, 1
  br i1 %.not4872, label %._crit_edge76, label %.lr.ph75

._crit_edge76:                                    ; preds = %.lr.ph75, %.lr.ph78
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %31 = load i32, ptr @f, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = icmp slt i64 %indvars.iv.next99, %32
  br i1 %33, label %.lr.ph78, label %.loopexit, !llvm.loop !9

.lr.ph75:                                         ; preds = %.lr.ph78, %.lr.ph75
  %indvars.iv95 = phi i64 [ %indvars.iv.next96, %.lr.ph75 ], [ 1, %.lr.ph78 ]
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [21 x [21 x i64]], ptr @ways, i64 0, i64 %35, i64 %indvars.iv95
  %37 = load i64, ptr %36, align 8, !tbaa !11
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [100100 x [5 x [21 x i64]]], ptr @dp, i64 0, i64 %39, i64 %indvars.iv98, i64 %indvars.iv95
  store i64 %37, ptr %40, align 8, !tbaa !11
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %41 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) @k)
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %.not48.not = icmp slt i64 %indvars.iv95, %43
  br i1 %.not48.not, label %.lr.ph75, label %._crit_edge76, !llvm.loop !13

.lr.ph71:                                         ; preds = %.preheader49, %._crit_edge69
  %indvars.iv92 = phi i64 [ %indvars.iv.next93, %._crit_edge69 ], [ 0, %.preheader49 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %44 = getelementptr inbounds [5 x i32], ptr @fc, i64 0, i64 %indvars.iv92
  %45 = load i32, ptr %44, align 4, !tbaa !5
  store i32 %45, ptr %4, align 4, !tbaa !5
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) @k)
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %.not65 = icmp slt i32 %47, 1
  br i1 %.not65, label %._crit_edge69, label %.lr.ph68.preheader

.lr.ph68.preheader:                               ; preds = %.lr.ph71
  %48 = add nuw i32 %47, 1
  %wide.trip.count90 = zext i32 %48 to i64
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  br label %.lr.ph68

._crit_edge69:                                    ; preds = %._crit_edge63, %.lr.ph71
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %49 = load i32, ptr @f, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = icmp slt i64 %indvars.iv.next93, %50
  br i1 %51, label %.lr.ph71, label %.loopexit, !llvm.loop !14

.lr.ph68:                                         ; preds = %.lr.ph68.preheader, %._crit_edge63
  %52 = phi i32 [ %.pre, %.lr.ph68.preheader ], [ %68, %._crit_edge63 ]
  %indvars.iv87 = phi i64 [ 1, %.lr.ph68.preheader ], [ %indvars.iv.next88, %._crit_edge63 ]
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [21 x [21 x i64]], ptr @ways, i64 0, i64 %54, i64 %indvars.iv87
  %56 = load i64, ptr %55, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %57 = sext i32 %52 to i64
  %58 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %57
  %59 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %58) #4
  store ptr %59, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %60 = load i32, ptr %2, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %61
  %63 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %62) #4
  store ptr %63, ptr %6, align 8
  %64 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br i1 %64, label %.lr.ph62.preheader, label %._crit_edge63

.lr.ph62.preheader:                               ; preds = %.lr.ph68
  %65 = trunc nuw nsw i64 %indvars.iv87 to i32
  br label %.lr.ph62

._crit_edge63:                                    ; preds = %._crit_edge58, %.lr.ph68
  %.041.lcssa = phi i64 [ 1, %.lr.ph68 ], [ %77, %._crit_edge58 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  %66 = mul nsw i64 %.041.lcssa, %56
  %67 = srem i64 %66, 1000000009
  %68 = load i32, ptr %2, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [100100 x [5 x [21 x i64]]], ptr @dp, i64 0, i64 %69, i64 %indvars.iv92, i64 %indvars.iv87
  store i64 %67, ptr %70, align 8, !tbaa !11
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %exitcond91.not = icmp eq i64 %indvars.iv.next88, %wide.trip.count90
  br i1 %exitcond91.not, label %._crit_edge69, label %.lr.ph68, !llvm.loop !15

.lr.ph62:                                         ; preds = %.lr.ph62.preheader, %._crit_edge58
  %.04160 = phi i64 [ %77, %._crit_edge58 ], [ 1, %.lr.ph62.preheader ]
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  %72 = load i32, ptr @f, align 4, !tbaa !5
  %73 = icmp sgt i32 %72, 0
  br i1 %73, label %.lr.ph57, label %._crit_edge58

.lr.ph57:                                         ; preds = %.lr.ph62
  %74 = load i32, ptr %71, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  br label %84

._crit_edge58:                                    ; preds = %106, %.lr.ph62
  %.040.lcssa = phi i64 [ 0, %.lr.ph62 ], [ %.3, %106 ]
  %76 = mul nsw i64 %.040.lcssa, %.04160
  %77 = srem i64 %76, 1000000009
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %79 = load i32, ptr %2, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %80
  %82 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %81) #4
  store ptr %82, ptr %6, align 8
  %83 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br i1 %83, label %.lr.ph62, label %._crit_edge63, !llvm.loop !16

84:                                               ; preds = %.lr.ph57, %106
  %85 = phi i32 [ %72, %.lr.ph57 ], [ %107, %106 ]
  %indvars.iv84 = phi i64 [ 0, %.lr.ph57 ], [ %indvars.iv.next85, %106 ]
  %.04054 = phi i64 [ 0, %.lr.ph57 ], [ %.3, %106 ]
  %86 = icmp eq i64 %indvars.iv84, %indvars.iv92
  br i1 %86, label %106, label %87

87:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %88 = getelementptr inbounds [5 x i32], ptr @fc, i64 0, i64 %indvars.iv84
  %89 = load i32, ptr %88, align 4, !tbaa !5
  store i32 %89, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  %90 = load i32, ptr @k, align 4, !tbaa !5
  %91 = sub nsw i32 %90, %65
  store i32 %91, ptr %8, align 4, !tbaa !5
  %92 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %93 = load i32, ptr %92, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  %.not4751 = icmp slt i32 %93, 1
  br i1 %.not4751, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %87
  %94 = add nuw i32 %93, 1
  %wide.trip.count = zext i32 %94 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %87
  %.1.lcssa = phi i64 [ %.04054, %87 ], [ %spec.select, %.lr.ph ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  %.pre101 = load i32, ptr @f, align 4, !tbaa !5
  br label %106

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %.152 = phi i64 [ %.04054, %.lr.ph.preheader ], [ %spec.select, %.lr.ph ]
  %95 = load i32, ptr @k, align 4, !tbaa !5
  %96 = sub nsw i32 %95, %65
  %97 = trunc nuw nsw i64 %indvars.iv to i32
  %98 = call noundef i64 @_Z1Cii(i32 noundef %96, i32 noundef %97)
  %99 = getelementptr inbounds [100100 x [5 x [21 x i64]]], ptr @dp, i64 0, i64 %75, i64 %indvars.iv84, i64 %indvars.iv
  %100 = load i64, ptr %99, align 8, !tbaa !11
  %101 = mul nsw i64 %100, %98
  %102 = srem i64 %101, 1000000009
  %103 = add nsw i64 %102, %.152
  %104 = icmp sgt i64 %103, 1000000008
  %105 = add nsw i64 %103, -1000000009
  %spec.select = select i1 %104, i64 %105, i64 %103
  %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_edge, label %.lr.ph, !llvm.loop !17

106:                                              ; preds = %84, %._crit_edge
  %107 = phi i32 [ %85, %84 ], [ %.pre101, %._crit_edge ]
  %.3 = phi i64 [ %.04054, %84 ], [ %.1.lcssa, %._crit_edge ]
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  %108 = sext i32 %107 to i64
  %109 = icmp slt i64 %indvars.iv.next85, %108
  br i1 %109, label %84, label %._crit_edge58, !llvm.loop !18

.loopexit:                                        ; preds = %._crit_edge69, %._crit_edge76, %.preheader49, %.preheader
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @st)
  br label %116

110:                                              ; preds = %.lr.ph80
  %111 = getelementptr inbounds [100100 x i32], ptr @ptr, i64 0, i64 %20
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %111, align 4, !tbaa !5
  %114 = sext i32 %112 to i64
  %115 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %114) #4
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @st, ptr noundef nonnull align 4 dereferenceable(4) %115)
  br label %116

116:                                              ; preds = %110, %.loopexit
  %117 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @st)
  br i1 %117, label %._crit_edge81, label %.lr.ph80, !llvm.loop !19

._crit_edge81:                                    ; preds = %116, %1
  ret void
}

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

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

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

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

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

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

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

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

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

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

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

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


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