; LLVM IR from eyangch/competitive-programming :: Codeforces/1770 (d)

; 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<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_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" }

@MOD = external dso_local global i64, align 8
@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@A = external dso_local global [100000 x i64], align 16
@B = external dso_local global [100000 x i64], align 16
@G = external dso_local global [100000 x %"class.std::vector"], align 16
@vis = external dso_local global [100000 x i64], align 16
@sz = external dso_local global [100000 x i64], align 16
@de = external dso_local global [100000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

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

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

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

24:                                               ; preds = %228, %0
  %25 = load i64, ptr @T, align 8, !tbaa !8
  %26 = add nsw i64 %25, -1
  store i64 %26, ptr @T, align 8, !tbaa !8
  %27 = icmp ne i64 %25, 0
  br i1 %27, label %28, label %229

28:                                               ; preds = %24
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %30

30:                                               ; preds = %44, %28
  %31 = load i64, ptr %2, align 8, !tbaa !8
  %32 = load i64, ptr @N, align 8, !tbaa !8
  %33 = icmp slt i64 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %47

35:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #7
  call void @llvm.memset.p0.i64(ptr align 8 %3, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  %36 = load i64, ptr %2, align 8, !tbaa !8
  %37 = getelementptr inbounds [100000 x %"class.std::vector"], ptr @G, i64 0, i64 %36
  call void @_ZNSt6vectorIxSaIxEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %37) #7
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #7
  %38 = load i64, ptr %2, align 8, !tbaa !8
  %39 = getelementptr inbounds [100000 x i64], ptr @vis, i64 0, i64 %38
  store i64 -1, ptr %39, align 8, !tbaa !8
  %40 = load i64, ptr %2, align 8, !tbaa !8
  %41 = getelementptr inbounds [100000 x i64], ptr @sz, i64 0, i64 %40
  store i64 0, ptr %41, align 8, !tbaa !8
  %42 = load i64, ptr %2, align 8, !tbaa !8
  %43 = getelementptr inbounds [100000 x i64], ptr @de, i64 0, i64 %42
  store i64 0, ptr %43, align 8, !tbaa !8
  br label %44

44:                                               ; preds = %35
  %45 = load i64, ptr %2, align 8, !tbaa !8
  %46 = add nsw i64 %45, 1
  store i64 %46, ptr %2, align 8, !tbaa !8
  br label %30, !llvm.loop !11

47:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store i64 0, ptr %4, align 8, !tbaa !8
  br label %48

48:                                               ; preds = %61, %47
  %49 = load i64, ptr %4, align 8, !tbaa !8
  %50 = load i64, ptr @N, align 8, !tbaa !8
  %51 = icmp slt i64 %49, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %64

53:                                               ; preds = %48
  %54 = load i64, ptr %4, align 8, !tbaa !8
  %55 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %54
  %56 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %55)
  %57 = load i64, ptr %4, align 8, !tbaa !8
  %58 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %57
  %59 = load i64, ptr %58, align 8, !tbaa !8
  %60 = add nsw i64 %59, -1
  store i64 %60, ptr %58, align 8, !tbaa !8
  br label %61

61:                                               ; preds = %53
  %62 = load i64, ptr %4, align 8, !tbaa !8
  %63 = add nsw i64 %62, 1
  store i64 %63, ptr %4, align 8, !tbaa !8
  br label %48, !llvm.loop !13

64:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store i64 0, ptr %5, align 8, !tbaa !8
  br label %65

65:                                               ; preds = %78, %64
  %66 = load i64, ptr %5, align 8, !tbaa !8
  %67 = load i64, ptr @N, align 8, !tbaa !8
  %68 = icmp slt i64 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %81

70:                                               ; preds = %65
  %71 = load i64, ptr %5, align 8, !tbaa !8
  %72 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %71
  %73 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %72)
  %74 = load i64, ptr %5, align 8, !tbaa !8
  %75 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !8
  %77 = add nsw i64 %76, -1
  store i64 %77, ptr %75, align 8, !tbaa !8
  br label %78

78:                                               ; preds = %70
  %79 = load i64, ptr %5, align 8, !tbaa !8
  %80 = add nsw i64 %79, 1
  store i64 %80, ptr %5, align 8, !tbaa !8
  br label %65, !llvm.loop !14

81:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store i64 0, ptr %6, align 8, !tbaa !8
  br label %82

82:                                               ; preds = %100, %81
  %83 = load i64, ptr %6, align 8, !tbaa !8
  %84 = load i64, ptr @N, align 8, !tbaa !8
  %85 = icmp slt i64 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %103

87:                                               ; preds = %82
  %88 = load i64, ptr %6, align 8, !tbaa !8
  %89 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %88
  %90 = load i64, ptr %89, align 8, !tbaa !8
  %91 = getelementptr inbounds [100000 x %"class.std::vector"], ptr @G, i64 0, i64 %90
  %92 = load i64, ptr %6, align 8, !tbaa !8
  %93 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %92
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %91, ptr noundef nonnull align 8 dereferenceable(8) %93)
  %94 = load i64, ptr %6, align 8, !tbaa !8
  %95 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %94
  %96 = load i64, ptr %95, align 8, !tbaa !8
  %97 = getelementptr inbounds [100000 x %"class.std::vector"], ptr @G, i64 0, i64 %96
  %98 = load i64, ptr %6, align 8, !tbaa !8
  %99 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %98
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %97, ptr noundef nonnull align 8 dereferenceable(8) %99)
  br label %100

100:                                              ; preds = %87
  %101 = load i64, ptr %6, align 8, !tbaa !8
  %102 = add nsw i64 %101, 1
  store i64 %102, ptr %6, align 8, !tbaa !8
  br label %82, !llvm.loop !15

103:                                              ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 0, ptr %7, align 8, !tbaa !8
  br label %104

104:                                              ; preds = %119, %103
  %105 = load i64, ptr %7, align 8, !tbaa !8
  %106 = load i64, ptr @N, align 8, !tbaa !8
  %107 = icmp slt i64 %105, %106
  br i1 %107, label %109, label %108

108:                                              ; preds = %104
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %122

109:                                              ; preds = %104
  %110 = load i64, ptr %7, align 8, !tbaa !8
  %111 = getelementptr inbounds [100000 x i64], ptr @vis, i64 0, i64 %110
  %112 = load i64, ptr %111, align 8, !tbaa !8
  %113 = xor i64 %112, -1
  %114 = icmp ne i64 %113, 0
  br i1 %114, label %115, label %116

115:                                              ; preds = %109
  br label %119

116:                                              ; preds = %109
  %117 = load i64, ptr %7, align 8, !tbaa !8
  %118 = load i64, ptr %7, align 8, !tbaa !8
  call void @_Z3dfsxx(i64 noundef %117, i64 noundef %118)
  br label %119

119:                                              ; preds = %116, %115
  %120 = load i64, ptr %7, align 8, !tbaa !8
  %121 = add nsw i64 %120, 1
  store i64 %121, ptr %7, align 8, !tbaa !8
  br label %104, !llvm.loop !16

122:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 0, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 0, ptr %10, align 8, !tbaa !8
  br label %123

123:                                              ; preds = %157, %122
  %124 = load i64, ptr %10, align 8, !tbaa !8
  %125 = load i64, ptr @N, align 8, !tbaa !8
  %126 = icmp slt i64 %124, %125
  br i1 %126, label %128, label %127

127:                                              ; preds = %123
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %160

128:                                              ; preds = %123
  %129 = load i64, ptr %10, align 8, !tbaa !8
  %130 = getelementptr inbounds [100000 x i64], ptr @vis, i64 0, i64 %129
  %131 = load i64, ptr %130, align 8, !tbaa !8
  %132 = getelementptr inbounds [100000 x i64], ptr @sz, i64 0, i64 %131
  %133 = load i64, ptr %132, align 8, !tbaa !8
  %134 = add nsw i64 %133, 1
  store i64 %134, ptr %132, align 8, !tbaa !8
  %135 = load i64, ptr %10, align 8, !tbaa !8
  %136 = getelementptr inbounds [100000 x %"class.std::vector"], ptr @G, i64 0, i64 %135
  %137 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %136) #7
  %138 = load i64, ptr %10, align 8, !tbaa !8
  %139 = getelementptr inbounds [100000 x i64], ptr @vis, i64 0, i64 %138
  %140 = load i64, ptr %139, align 8, !tbaa !8
  %141 = getelementptr inbounds [100000 x i64], ptr @de, i64 0, i64 %140
  %142 = load i64, ptr %141, align 8, !tbaa !8
  %143 = add i64 %142, %137
  store i64 %143, ptr %141, align 8, !tbaa !8
  %144 = load i64, ptr %10, align 8, !tbaa !8
  %145 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %144
  %146 = load i64, ptr %145, align 8, !tbaa !8
  %147 = load i64, ptr %10, align 8, !tbaa !8
  %148 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %147
  %149 = load i64, ptr %148, align 8, !tbaa !8
  %150 = icmp eq i64 %146, %149
  br i1 %150, label %151, label %156

151:                                              ; preds = %128
  %152 = load i64, ptr %8, align 8, !tbaa !8
  %153 = add nsw i64 %152, 1
  store i64 %153, ptr %8, align 8, !tbaa !8
  %154 = load i64, ptr %9, align 8, !tbaa !8
  %155 = add nsw i64 %154, -1
  store i64 %155, ptr %9, align 8, !tbaa !8
  br label %156

156:                                              ; preds = %151, %128
  br label %157

157:                                              ; preds = %156
  %158 = load i64, ptr %10, align 8, !tbaa !8
  %159 = add nsw i64 %158, 1
  store i64 %159, ptr %10, align 8, !tbaa !8
  br label %123, !llvm.loop !17

160:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store i64 1, ptr %11, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store i64 0, ptr %12, align 8, !tbaa !8
  br label %161

161:                                              ; preds = %185, %160
  %162 = load i64, ptr %12, align 8, !tbaa !8
  %163 = load i64, ptr @N, align 8, !tbaa !8
  %164 = icmp slt i64 %162, %163
  br i1 %164, label %166, label %165

165:                                              ; preds = %161
  store i32 22, ptr %13, align 4
  br label %188

166:                                              ; preds = %161
  %167 = load i64, ptr %12, align 8, !tbaa !8
  %168 = getelementptr inbounds [100000 x i64], ptr @de, i64 0, i64 %167
  %169 = load i64, ptr %168, align 8, !tbaa !8
  %170 = load i64, ptr %12, align 8, !tbaa !8
  %171 = getelementptr inbounds [100000 x i64], ptr @sz, i64 0, i64 %170
  %172 = load i64, ptr %171, align 8, !tbaa !8
  %173 = mul nsw i64 2, %172
  %174 = icmp ne i64 %169, %173
  br i1 %174, label %175, label %176

175:                                              ; preds = %166
  store i64 0, ptr %11, align 8, !tbaa !8
  store i32 22, ptr %13, align 4
  br label %188

176:                                              ; preds = %166
  %177 = load i64, ptr %12, align 8, !tbaa !8
  %178 = getelementptr inbounds [100000 x i64], ptr @sz, i64 0, i64 %177
  %179 = load i64, ptr %178, align 8, !tbaa !8
  %180 = icmp ne i64 %179, 0
  br i1 %180, label %181, label %184

181:                                              ; preds = %176
  %182 = load i64, ptr %9, align 8, !tbaa !8
  %183 = add nsw i64 %182, 1
  store i64 %183, ptr %9, align 8, !tbaa !8
  br label %184

184:                                              ; preds = %181, %176
  br label %185

185:                                              ; preds = %184
  %186 = load i64, ptr %12, align 8, !tbaa !8
  %187 = add nsw i64 %186, 1
  store i64 %187, ptr %12, align 8, !tbaa !8
  br label %161, !llvm.loop !18

188:                                              ; preds = %175, %165
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %189

189:                                              ; preds = %188
  %190 = load i64, ptr %11, align 8, !tbaa !8
  %191 = icmp ne i64 %190, 0
  br i1 %191, label %195, label %192

192:                                              ; preds = %189
  %193 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %194 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %193, i8 noundef signext 10)
  br label %228

195:                                              ; preds = %189
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store i64 1, ptr %14, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store i64 0, ptr %15, align 8, !tbaa !8
  br label %196

196:                                              ; preds = %207, %195
  %197 = load i64, ptr %15, align 8, !tbaa !8
  %198 = load i64, ptr %8, align 8, !tbaa !8
  %199 = icmp slt i64 %197, %198
  br i1 %199, label %201, label %200

200:                                              ; preds = %196
  store i32 25, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %210

201:                                              ; preds = %196
  %202 = load i64, ptr %14, align 8, !tbaa !8
  %203 = load i64, ptr @N, align 8, !tbaa !8
  %204 = mul nsw i64 %202, %203
  %205 = load i64, ptr @MOD, align 8, !tbaa !8
  %206 = srem i64 %204, %205
  store i64 %206, ptr %14, align 8, !tbaa !8
  br label %207

207:                                              ; preds = %201
  %208 = load i64, ptr %15, align 8, !tbaa !8
  %209 = add nsw i64 %208, 1
  store i64 %209, ptr %15, align 8, !tbaa !8
  br label %196, !llvm.loop !19

210:                                              ; preds = %200
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store i64 0, ptr %16, align 8, !tbaa !8
  br label %211

211:                                              ; preds = %221, %210
  %212 = load i64, ptr %16, align 8, !tbaa !8
  %213 = load i64, ptr %9, align 8, !tbaa !8
  %214 = icmp slt i64 %212, %213
  br i1 %214, label %216, label %215

215:                                              ; preds = %211
  store i32 28, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %224

216:                                              ; preds = %211
  %217 = load i64, ptr %14, align 8, !tbaa !8
  %218 = mul nsw i64 %217, 2
  %219 = load i64, ptr @MOD, align 8, !tbaa !8
  %220 = srem i64 %218, %219
  store i64 %220, ptr %14, align 8, !tbaa !8
  br label %221

221:                                              ; preds = %216
  %222 = load i64, ptr %16, align 8, !tbaa !8
  %223 = add nsw i64 %222, 1
  store i64 %223, ptr %16, align 8, !tbaa !8
  br label %211, !llvm.loop !20

224:                                              ; preds = %215
  %225 = load i64, ptr %14, align 8, !tbaa !8
  %226 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %225)
  %227 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %226, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %228

228:                                              ; preds = %224, %192
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %24, !llvm.loop !21

229:                                              ; preds = %24
  %230 = load i32, ptr %1, align 4
  ret i32 %230
}

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

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 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) #6

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

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

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


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

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

@MOD = external dso_local local_unnamed_addr global i64, align 8
@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@A = external dso_local global [100000 x i64], align 16
@B = external dso_local global [100000 x i64], align 16
@G = external dso_local global [100000 x %"class.std::vector"], align 16
@vis = external dso_local local_unnamed_addr global [100000 x i64], align 16
@sz = external dso_local local_unnamed_addr global [100000 x i64], align 16
@de = external dso_local local_unnamed_addr global [100000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca %"class.std::vector", align 8
  %2 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %3 = getelementptr i8, ptr %2, i64 -24
  %4 = load i64, ptr %3, align 8
  %5 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %4
  %6 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %5, ptr noundef null)
  %7 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  %9 = load i64, ptr @T, align 8, !tbaa !8
  %10 = add nsw i64 %9, -1
  store i64 %10, ptr @T, align 8, !tbaa !8
  %.not103 = icmp eq i64 %9, 0
  br i1 %.not103, label %._crit_edge106, label %.lr.ph105

.lr.ph105:                                        ; preds = %0, %119
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %12 = load i64, ptr @N, align 8, !tbaa !8
  %13 = icmp sgt i64 %12, 0
  br i1 %13, label %.lr.ph, label %._crit_edge

.preheader74:                                     ; preds = %.lr.ph
  %14 = icmp sgt i64 %20, 0
  br i1 %14, label %.lr.ph78, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph105, %.lr.ph
  %.06476 = phi i64 [ %19, %.lr.ph ], [ 0, %.lr.ph105 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %1, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %15 = getelementptr inbounds [100000 x %"class.std::vector"], ptr @G, i64 0, i64 %.06476
  call void @_ZNSt6vectorIxSaIxEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  %16 = getelementptr inbounds [100000 x i64], ptr @vis, i64 0, i64 %.06476
  store i64 -1, ptr %16, align 8, !tbaa !8
  %17 = getelementptr inbounds [100000 x i64], ptr @sz, i64 0, i64 %.06476
  store i64 0, ptr %17, align 8, !tbaa !8
  %18 = getelementptr inbounds [100000 x i64], ptr @de, i64 0, i64 %.06476
  store i64 0, ptr %18, align 8, !tbaa !8
  %19 = add nuw nsw i64 %.06476, 1
  %20 = load i64, ptr @N, align 8, !tbaa !8
  %21 = icmp slt i64 %19, %20
  br i1 %21, label %.lr.ph, label %.preheader74, !llvm.loop !11

.preheader73:                                     ; preds = %.lr.ph78
  %22 = icmp sgt i64 %28, 0
  br i1 %22, label %.lr.ph80, label %._crit_edge

.lr.ph78:                                         ; preds = %.preheader74, %.lr.ph78
  %.06377 = phi i64 [ %27, %.lr.ph78 ], [ 0, %.preheader74 ]
  %23 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %.06377
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %23)
  %25 = load i64, ptr %23, align 8, !tbaa !8
  %26 = add nsw i64 %25, -1
  store i64 %26, ptr %23, align 8, !tbaa !8
  %27 = add nuw nsw i64 %.06377, 1
  %28 = load i64, ptr @N, align 8, !tbaa !8
  %29 = icmp slt i64 %27, %28
  br i1 %29, label %.lr.ph78, label %.preheader73, !llvm.loop !13

.preheader72:                                     ; preds = %.lr.ph80
  %30 = icmp sgt i64 %36, 0
  br i1 %30, label %.lr.ph82, label %._crit_edge

.lr.ph80:                                         ; preds = %.preheader73, %.lr.ph80
  %.06279 = phi i64 [ %35, %.lr.ph80 ], [ 0, %.preheader73 ]
  %31 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %.06279
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %31)
  %33 = load i64, ptr %31, align 8, !tbaa !8
  %34 = add nsw i64 %33, -1
  store i64 %34, ptr %31, align 8, !tbaa !8
  %35 = add nuw nsw i64 %.06279, 1
  %36 = load i64, ptr @N, align 8, !tbaa !8
  %37 = icmp slt i64 %35, %36
  br i1 %37, label %.lr.ph80, label %.preheader72, !llvm.loop !14

.preheader71:                                     ; preds = %.lr.ph82
  %38 = icmp sgt i64 %46, 0
  br i1 %38, label %.lr.ph84, label %._crit_edge

.lr.ph82:                                         ; preds = %.preheader72, %.lr.ph82
  %.06181 = phi i64 [ %45, %.lr.ph82 ], [ 0, %.preheader72 ]
  %39 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %.06181
  %40 = load i64, ptr %39, align 8, !tbaa !8
  %41 = getelementptr inbounds [100000 x %"class.std::vector"], ptr @G, i64 0, i64 %40
  %42 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %.06181
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %41, ptr noundef nonnull align 8 dereferenceable(8) %42)
  %43 = load i64, ptr %42, align 8, !tbaa !8
  %44 = getelementptr inbounds [100000 x %"class.std::vector"], ptr @G, i64 0, i64 %43
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %44, ptr noundef nonnull align 8 dereferenceable(8) %39)
  %45 = add nuw nsw i64 %.06181, 1
  %46 = load i64, ptr @N, align 8, !tbaa !8
  %47 = icmp slt i64 %45, %46
  br i1 %47, label %.lr.ph82, label %.preheader71, !llvm.loop !15

.preheader70:                                     ; preds = %53
  %48 = icmp sgt i64 %54, 0
  br i1 %48, label %.lr.ph88, label %._crit_edge

.lr.ph84:                                         ; preds = %.preheader71, %53
  %49 = phi i64 [ %54, %53 ], [ %46, %.preheader71 ]
  %.06083 = phi i64 [ %55, %53 ], [ 0, %.preheader71 ]
  %50 = getelementptr inbounds [100000 x i64], ptr @vis, i64 0, i64 %.06083
  %51 = load i64, ptr %50, align 8, !tbaa !8
  %.not68 = icmp eq i64 %51, -1
  br i1 %.not68, label %52, label %53

52:                                               ; preds = %.lr.ph84
  call void @_Z3dfsxx(i64 noundef %.06083, i64 noundef %.06083)
  %.pre = load i64, ptr @N, align 8, !tbaa !8
  br label %53

53:                                               ; preds = %.lr.ph84, %52
  %54 = phi i64 [ %49, %.lr.ph84 ], [ %.pre, %52 ]
  %55 = add nuw nsw i64 %.06083, 1
  %56 = icmp slt i64 %55, %54
  br i1 %56, label %.lr.ph84, label %.preheader70, !llvm.loop !16

.preheader69:                                     ; preds = %.lr.ph88
  %57 = icmp sgt i64 %77, 0
  br i1 %57, label %.lr.ph93, label %.critedge.preheader

.lr.ph88:                                         ; preds = %.preheader70, %.lr.ph88
  %.05587 = phi i64 [ %76, %.lr.ph88 ], [ 0, %.preheader70 ]
  %.05686 = phi i64 [ %.157, %.lr.ph88 ], [ 0, %.preheader70 ]
  %.05885 = phi i64 [ %.159, %.lr.ph88 ], [ 0, %.preheader70 ]
  %58 = getelementptr inbounds [100000 x i64], ptr @vis, i64 0, i64 %.05587
  %59 = load i64, ptr %58, align 8, !tbaa !8
  %60 = getelementptr inbounds [100000 x i64], ptr @sz, i64 0, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !8
  %62 = add nsw i64 %61, 1
  store i64 %62, ptr %60, align 8, !tbaa !8
  %63 = getelementptr inbounds [100000 x %"class.std::vector"], ptr @G, i64 0, i64 %.05587
  %64 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %63) #7
  %65 = load i64, ptr %58, align 8, !tbaa !8
  %66 = getelementptr inbounds [100000 x i64], ptr @de, i64 0, i64 %65
  %67 = load i64, ptr %66, align 8, !tbaa !8
  %68 = add i64 %67, %64
  store i64 %68, ptr %66, align 8, !tbaa !8
  %69 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %.05587
  %70 = load i64, ptr %69, align 8, !tbaa !8
  %71 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %.05587
  %72 = load i64, ptr %71, align 8, !tbaa !8
  %73 = icmp eq i64 %70, %72
  %74 = zext i1 %73 to i64
  %.159 = add i64 %.05885, %74
  %75 = sext i1 %73 to i64
  %.157 = add nsw i64 %.05686, %75
  %76 = add nuw nsw i64 %.05587, 1
  %77 = load i64, ptr @N, align 8, !tbaa !8
  %78 = icmp slt i64 %76, %77
  br i1 %78, label %.lr.ph88, label %.preheader69, !llvm.loop !17

.critedge.preheader:                              ; preds = %89, %.preheader69
  %.2.lcssa = phi i64 [ %.157, %.preheader69 ], [ %spec.select, %89 ]
  %.not133 = icmp eq i64 %.159, 0
  br i1 %.not133, label %.preheader, label %.lr.ph97

.lr.ph97:                                         ; preds = %.critedge.preheader
  %79 = load i64, ptr @MOD, align 8, !tbaa !8
  %80 = add i64 %.05885, -1
  %81 = zext i1 %73 to i64
  %82 = add i64 %80, %81
  %xtraiter = and i64 %.159, 3
  %83 = icmp ult i64 %82, 3
  br i1 %83, label %.preheader.loopexit.unr-lcssa, label %.lr.ph97.new

.lr.ph97.new:                                     ; preds = %.lr.ph97
  %unroll_iter = and i64 %.159, -4
  br label %.critedge

.lr.ph93:                                         ; preds = %.preheader69, %89
  %.05392 = phi i64 [ %91, %89 ], [ 0, %.preheader69 ]
  %.291 = phi i64 [ %spec.select, %89 ], [ %.157, %.preheader69 ]
  %84 = getelementptr inbounds [100000 x i64], ptr @de, i64 0, i64 %.05392
  %85 = load i64, ptr %84, align 8, !tbaa !8
  %86 = getelementptr inbounds [100000 x i64], ptr @sz, i64 0, i64 %.05392
  %87 = load i64, ptr %86, align 8, !tbaa !8
  %88 = shl nsw i64 %87, 1
  %.not65 = icmp eq i64 %85, %88
  br i1 %.not65, label %89, label %92

89:                                               ; preds = %.lr.ph93
  %.not66 = icmp ne i64 %87, 0
  %90 = zext i1 %.not66 to i64
  %spec.select = add nsw i64 %.291, %90
  %91 = add nuw nsw i64 %.05392, 1
  %exitcond.not = icmp eq i64 %91, %77
  br i1 %exitcond.not, label %.critedge.preheader, label %.lr.ph93, !llvm.loop !18

92:                                               ; preds = %.lr.ph93
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  br label %119

.preheader.loopexit.unr-lcssa:                    ; preds = %.critedge, %.lr.ph97
  %.lcssa146.ph = phi i64 [ poison, %.lr.ph97 ], [ %106, %.critedge ]
  %.05295.unr = phi i64 [ 1, %.lr.ph97 ], [ %106, %.critedge ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.critedge.epil

.critedge.epil:                                   ; preds = %.preheader.loopexit.unr-lcssa, %.critedge.epil
  %.05295.epil = phi i64 [ %95, %.critedge.epil ], [ %.05295.unr, %.preheader.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.critedge.epil ], [ 0, %.preheader.loopexit.unr-lcssa ]
  %94 = mul nsw i64 %.05295.epil, %77
  %95 = srem i64 %94, %79
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader, label %.critedge.epil, !llvm.loop !19

.preheader:                                       ; preds = %.preheader.loopexit.unr-lcssa, %.critedge.epil, %.critedge.preheader
  %.052.lcssa = phi i64 [ 1, %.critedge.preheader ], [ %.lcssa146.ph, %.preheader.loopexit.unr-lcssa ], [ %95, %.critedge.epil ]
  %96 = icmp sgt i64 %.2.lcssa, 0
  br i1 %96, label %.lr.ph101, label %._crit_edge

.lr.ph101:                                        ; preds = %.preheader
  %97 = load i64, ptr @MOD, align 8, !tbaa !8
  %xtraiter150 = and i64 %.2.lcssa, 3
  %98 = icmp ult i64 %.2.lcssa, 4
  br i1 %98, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph101.new

.lr.ph101.new:                                    ; preds = %.lr.ph101
  %unroll_iter154 = and i64 %.2.lcssa, 9223372036854775804
  br label %110

.critedge:                                        ; preds = %.critedge, %.lr.ph97.new
  %.05295 = phi i64 [ 1, %.lr.ph97.new ], [ %106, %.critedge ]
  %niter = phi i64 [ 0, %.lr.ph97.new ], [ %niter.next.3, %.critedge ]
  %99 = mul nsw i64 %.05295, %77
  %100 = srem i64 %99, %79
  %101 = mul nsw i64 %100, %77
  %102 = srem i64 %101, %79
  %103 = mul nsw i64 %102, %77
  %104 = srem i64 %103, %79
  %105 = mul nsw i64 %104, %77
  %106 = srem i64 %105, %79
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader.loopexit.unr-lcssa, label %.critedge, !llvm.loop !21

._crit_edge.loopexit.unr-lcssa:                   ; preds = %110, %.lr.ph101
  %.lcssa147.ph = phi i64 [ poison, %.lr.ph101 ], [ %118, %110 ]
  %.199.unr = phi i64 [ %.052.lcssa, %.lr.ph101 ], [ %118, %110 ]
  %lcmp.mod152.not = icmp eq i64 %xtraiter150, 0
  br i1 %lcmp.mod152.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader
  %.199.epil = phi i64 [ %108, %.epil.preheader ], [ %.199.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter151 = phi i64 [ %epil.iter151.next, %.epil.preheader ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %107 = shl nsw i64 %.199.epil, 1
  %108 = srem i64 %107, %97
  %epil.iter151.next = add i64 %epil.iter151, 1
  %epil.iter151.cmp.not = icmp eq i64 %epil.iter151.next, %xtraiter150
  br i1 %epil.iter151.cmp.not, label %._crit_edge, label %.epil.preheader, !llvm.loop !22

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader, %.lr.ph105, %.preheader74, %.preheader73, %.preheader72, %.preheader71, %.preheader70, %.preheader
  %.1.lcssa = phi i64 [ %.052.lcssa, %.preheader ], [ 1, %.preheader70 ], [ 1, %.preheader71 ], [ 1, %.preheader72 ], [ 1, %.preheader73 ], [ 1, %.preheader74 ], [ 1, %.lr.ph105 ], [ %.lcssa147.ph, %._crit_edge.loopexit.unr-lcssa ], [ %108, %.epil.preheader ]
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.1.lcssa)
  br label %119

110:                                              ; preds = %110, %.lr.ph101.new
  %.199 = phi i64 [ %.052.lcssa, %.lr.ph101.new ], [ %118, %110 ]
  %niter155 = phi i64 [ 0, %.lr.ph101.new ], [ %niter155.next.3, %110 ]
  %111 = shl nsw i64 %.199, 1
  %112 = srem i64 %111, %97
  %113 = shl nsw i64 %112, 1
  %114 = srem i64 %113, %97
  %115 = shl nsw i64 %114, 1
  %116 = srem i64 %115, %97
  %117 = shl nsw i64 %116, 1
  %118 = srem i64 %117, %97
  %niter155.next.3 = add i64 %niter155, 4
  %niter155.ncmp.3 = icmp eq i64 %niter155.next.3, %unroll_iter154
  br i1 %niter155.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %110, !llvm.loop !23

119:                                              ; preds = %._crit_edge, %92
  %.sink = phi ptr [ %109, %._crit_edge ], [ %93, %92 ]
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %.sink, i8 noundef signext 10)
  %121 = load i64, ptr @T, align 8, !tbaa !8
  %122 = add nsw i64 %121, -1
  store i64 %122, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %121, 0
  br i1 %.not, label %._crit_edge106, label %.lr.ph105, !llvm.loop !24

._crit_edge106:                                   ; preds = %119, %0
  ret i32 0
}

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

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

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

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #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

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

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

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


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