; LLVM IR from Izaron/ACM-ICPC :: Russian Olympiad in Informatics/Final Stage 2016 (twopaths)

; 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 }

@n = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@neig = external dso_local global [1600005 x %"class.std::vector"], align 16
@parent = external dso_local global [1600005 x i32], align 16
@as = external dso_local global [1600005 x i32], align 16
@bs = external dso_local global [1600005 x i32], align 16
@cs = external dso_local global [1600005 x i32], align 16
@step = external dso_local global [1600005 x i32], align 16
@razz = external dso_local global [1600005 x i32], align 16
@logTable = external dso_local global [1600005 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10buildTablev() #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z9getPredokii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6dfsWayii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z7getCurriiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %16 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %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)
  store i32 0, ptr @logTable, align 16, !tbaa !8
  store i32 0, ptr getelementptr inbounds ([1600005 x i32], ptr @logTable, i64 0, i64 1), align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 2, ptr %2, align 4, !tbaa !8
  br label %22

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

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

26:                                               ; preds = %22
  %27 = load i32, ptr %2, align 4, !tbaa !8
  %28 = sdiv i32 %27, 2
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [1600005 x i32], ptr @logTable, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !8
  %32 = add nsw i32 %31, 1
  %33 = load i32, ptr %2, align 4, !tbaa !8
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [1600005 x i32], ptr @logTable, i64 0, i64 %34
  store i32 %32, ptr %35, align 4, !tbaa !8
  br label %36

36:                                               ; preds = %26
  %37 = load i32, ptr %2, align 4, !tbaa !8
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %2, align 4, !tbaa !8
  br label %22, !llvm.loop !11

39:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !8
  br label %40

40:                                               ; preds = %59, %39
  %41 = load i32, ptr %5, align 4, !tbaa !8
  %42 = icmp slt i32 %41, 1600005
  br i1 %42, label %44, label %43

43:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %62

44:                                               ; preds = %40
  br label %45

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

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

54:                                               ; preds = %45
  %55 = load i32, ptr %3, align 4, !tbaa !8
  %56 = load i32, ptr %5, align 4, !tbaa !8
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [1600005 x i32], ptr @razz, i64 0, i64 %57
  store i32 %55, ptr %58, align 4, !tbaa !8
  br label %59

59:                                               ; preds = %54
  %60 = load i32, ptr %5, align 4, !tbaa !8
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %5, align 4, !tbaa !8
  br label %40, !llvm.loop !14

62:                                               ; preds = %43
  store i32 1, ptr getelementptr inbounds ([1600005 x i32], ptr @step, i64 0, i64 1), align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 2, ptr %6, align 4, !tbaa !8
  br label %63

63:                                               ; preds = %77, %62
  %64 = load i32, ptr %6, align 4, !tbaa !8
  %65 = icmp slt i32 %64, 30
  br i1 %65, label %67, label %66

66:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %80

67:                                               ; preds = %63
  %68 = load i32, ptr %6, align 4, !tbaa !8
  %69 = sub nsw i32 %68, 1
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [1600005 x i32], ptr @step, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !8
  %73 = mul nsw i32 %72, 2
  %74 = load i32, ptr %6, align 4, !tbaa !8
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [1600005 x i32], ptr @step, i64 0, i64 %75
  store i32 %73, ptr %76, align 4, !tbaa !8
  br label %77

77:                                               ; preds = %67
  %78 = load i32, ptr %6, align 4, !tbaa !8
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %6, align 4, !tbaa !8
  br label %63, !llvm.loop !15

80:                                               ; preds = %66
  %81 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @k)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 1, ptr %7, align 4, !tbaa !8
  br label %82

82:                                               ; preds = %103, %80
  %83 = load i32, ptr %7, align 4, !tbaa !8
  %84 = load i32, ptr @n, align 4, !tbaa !8
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %87, label %86

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

87:                                               ; preds = %82
  %88 = load i32, ptr %7, align 4, !tbaa !8
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [1600005 x i32], ptr @parent, i64 0, i64 %89
  %91 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %90)
  %92 = load i32, ptr %7, align 4, !tbaa !8
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [1600005 x i32], ptr @parent, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !8
  %96 = add nsw i32 %95, -1
  store i32 %96, ptr %94, align 4, !tbaa !8
  %97 = load i32, ptr %7, align 4, !tbaa !8
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [1600005 x i32], ptr @parent, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !8
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [1600005 x %"class.std::vector"], ptr @neig, i64 0, i64 %101
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %102, ptr noundef nonnull align 4 dereferenceable(4) %7)
  br label %103

103:                                              ; preds = %87
  %104 = load i32, ptr %7, align 4, !tbaa !8
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %7, align 4, !tbaa !8
  br label %82, !llvm.loop !16

106:                                              ; preds = %86
  call void @_Z6dfsWayii(i32 noundef 0, i32 noundef 0)
  call void @_Z10buildTablev()
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !8
  br label %107

107:                                              ; preds = %142, %106
  %108 = load i32, ptr %8, align 4, !tbaa !8
  %109 = load i32, ptr @k, align 4, !tbaa !8
  %110 = icmp slt i32 %108, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %107
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %145

112:                                              ; preds = %107
  %113 = load i32, ptr %8, align 4, !tbaa !8
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [1600005 x i32], ptr @as, i64 0, i64 %114
  %116 = load i32, ptr %8, align 4, !tbaa !8
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [1600005 x i32], ptr @bs, i64 0, i64 %117
  %119 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %115, ptr noundef %118)
  %120 = load i32, ptr %8, align 4, !tbaa !8
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [1600005 x i32], ptr @as, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !8
  %124 = add nsw i32 %123, -1
  store i32 %124, ptr %122, align 4, !tbaa !8
  %125 = load i32, ptr %8, align 4, !tbaa !8
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [1600005 x i32], ptr @bs, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !8
  %129 = add nsw i32 %128, -1
  store i32 %129, ptr %127, align 4, !tbaa !8
  %130 = load i32, ptr %8, align 4, !tbaa !8
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [1600005 x i32], ptr @as, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !8
  %134 = load i32, ptr %8, align 4, !tbaa !8
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [1600005 x i32], ptr @bs, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !8
  %138 = call noundef i32 @_Z9getPredokii(i32 noundef %133, i32 noundef %137)
  %139 = load i32, ptr %8, align 4, !tbaa !8
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [1600005 x i32], ptr @cs, i64 0, i64 %140
  store i32 %138, ptr %141, align 4, !tbaa !8
  br label %142

142:                                              ; preds = %112
  %143 = load i32, ptr %8, align 4, !tbaa !8
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %8, align 4, !tbaa !8
  br label %107, !llvm.loop !17

145:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 1, ptr %11, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !8
  br label %146

146:                                              ; preds = %248, %145
  %147 = load i32, ptr %12, align 4, !tbaa !8
  %148 = load i32, ptr @k, align 4, !tbaa !8
  %149 = icmp slt i32 %147, %148
  br i1 %149, label %151, label %150

150:                                              ; preds = %146
  store i32 19, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %251

151:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %152 = load i32, ptr %12, align 4, !tbaa !8
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %14, align 4, !tbaa !8
  br label %154

154:                                              ; preds = %244, %151
  %155 = load i32, ptr %14, align 4, !tbaa !8
  %156 = load i32, ptr @k, align 4, !tbaa !8
  %157 = icmp slt i32 %155, %156
  br i1 %157, label %159, label %158

158:                                              ; preds = %154
  store i32 22, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %247

159:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !8
  %160 = load i32, ptr %12, align 4, !tbaa !8
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [1600005 x i32], ptr @as, i64 0, i64 %161
  %163 = load i32, ptr %162, align 4, !tbaa !8
  %164 = load i32, ptr %12, align 4, !tbaa !8
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [1600005 x i32], ptr @cs, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !8
  %168 = load i32, ptr %14, align 4, !tbaa !8
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [1600005 x i32], ptr @as, i64 0, i64 %169
  %171 = load i32, ptr %170, align 4, !tbaa !8
  %172 = load i32, ptr %14, align 4, !tbaa !8
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [1600005 x i32], ptr @cs, i64 0, i64 %173
  %175 = load i32, ptr %174, align 4, !tbaa !8
  %176 = call noundef i32 @_Z7getCurriiii(i32 noundef %163, i32 noundef %167, i32 noundef %171, i32 noundef %175)
  %177 = load i32, ptr %15, align 4, !tbaa !8
  %178 = add nsw i32 %177, %176
  store i32 %178, ptr %15, align 4, !tbaa !8
  %179 = load i32, ptr %12, align 4, !tbaa !8
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [1600005 x i32], ptr @as, i64 0, i64 %180
  %182 = load i32, ptr %181, align 4, !tbaa !8
  %183 = load i32, ptr %12, align 4, !tbaa !8
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [1600005 x i32], ptr @cs, i64 0, i64 %184
  %186 = load i32, ptr %185, align 4, !tbaa !8
  %187 = load i32, ptr %14, align 4, !tbaa !8
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [1600005 x i32], ptr @bs, i64 0, i64 %188
  %190 = load i32, ptr %189, align 4, !tbaa !8
  %191 = load i32, ptr %14, align 4, !tbaa !8
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [1600005 x i32], ptr @cs, i64 0, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !8
  %195 = call noundef i32 @_Z7getCurriiii(i32 noundef %182, i32 noundef %186, i32 noundef %190, i32 noundef %194)
  %196 = load i32, ptr %15, align 4, !tbaa !8
  %197 = add nsw i32 %196, %195
  store i32 %197, ptr %15, align 4, !tbaa !8
  %198 = load i32, ptr %12, align 4, !tbaa !8
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [1600005 x i32], ptr @bs, i64 0, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !8
  %202 = load i32, ptr %12, align 4, !tbaa !8
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [1600005 x i32], ptr @cs, i64 0, i64 %203
  %205 = load i32, ptr %204, align 4, !tbaa !8
  %206 = load i32, ptr %14, align 4, !tbaa !8
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [1600005 x i32], ptr @as, i64 0, i64 %207
  %209 = load i32, ptr %208, align 4, !tbaa !8
  %210 = load i32, ptr %14, align 4, !tbaa !8
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [1600005 x i32], ptr @cs, i64 0, i64 %211
  %213 = load i32, ptr %212, align 4, !tbaa !8
  %214 = call noundef i32 @_Z7getCurriiii(i32 noundef %201, i32 noundef %205, i32 noundef %209, i32 noundef %213)
  %215 = load i32, ptr %15, align 4, !tbaa !8
  %216 = add nsw i32 %215, %214
  store i32 %216, ptr %15, align 4, !tbaa !8
  %217 = load i32, ptr %12, align 4, !tbaa !8
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [1600005 x i32], ptr @bs, i64 0, i64 %218
  %220 = load i32, ptr %219, align 4, !tbaa !8
  %221 = load i32, ptr %12, align 4, !tbaa !8
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [1600005 x i32], ptr @cs, i64 0, i64 %222
  %224 = load i32, ptr %223, align 4, !tbaa !8
  %225 = load i32, ptr %14, align 4, !tbaa !8
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [1600005 x i32], ptr @bs, i64 0, i64 %226
  %228 = load i32, ptr %227, align 4, !tbaa !8
  %229 = load i32, ptr %14, align 4, !tbaa !8
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [1600005 x i32], ptr @cs, i64 0, i64 %230
  %232 = load i32, ptr %231, align 4, !tbaa !8
  %233 = call noundef i32 @_Z7getCurriiii(i32 noundef %220, i32 noundef %224, i32 noundef %228, i32 noundef %232)
  %234 = load i32, ptr %15, align 4, !tbaa !8
  %235 = add nsw i32 %234, %233
  store i32 %235, ptr %15, align 4, !tbaa !8
  %236 = load i32, ptr %15, align 4, !tbaa !8
  %237 = load i32, ptr %9, align 4, !tbaa !8
  %238 = icmp sgt i32 %236, %237
  br i1 %238, label %239, label %243

239:                                              ; preds = %159
  %240 = load i32, ptr %15, align 4, !tbaa !8
  store i32 %240, ptr %9, align 4, !tbaa !8
  %241 = load i32, ptr %12, align 4, !tbaa !8
  store i32 %241, ptr %10, align 4, !tbaa !8
  %242 = load i32, ptr %14, align 4, !tbaa !8
  store i32 %242, ptr %11, align 4, !tbaa !8
  br label %243

243:                                              ; preds = %239, %159
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %244

244:                                              ; preds = %243
  %245 = load i32, ptr %14, align 4, !tbaa !8
  %246 = add nsw i32 %245, 1
  store i32 %246, ptr %14, align 4, !tbaa !8
  br label %154, !llvm.loop !18

247:                                              ; preds = %158
  br label %248

248:                                              ; preds = %247
  %249 = load i32, ptr %12, align 4, !tbaa !8
  %250 = add nsw i32 %249, 1
  store i32 %250, ptr %12, align 4, !tbaa !8
  br label %146, !llvm.loop !19

251:                                              ; preds = %150
  %252 = load i32, ptr %9, align 4, !tbaa !8
  %253 = load i32, ptr %10, align 4, !tbaa !8
  %254 = add nsw i32 %253, 1
  %255 = load i32, ptr %11, align 4, !tbaa !8
  %256 = add nsw i32 %255, 1
  %257 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %252, i32 noundef %254, i32 noundef %256)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  %258 = load i32, ptr %1, align 4
  ret i32 %258
}

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

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

declare i32 @__isoc99_scanf(ptr noundef, ...) #3

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

declare i32 @printf(ptr noundef, ...) #3

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

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

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

@n = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@neig = external dso_local global [1600005 x %"class.std::vector"], align 16
@parent = external dso_local global [1600005 x i32], align 16
@as = external dso_local global [1600005 x i32], align 16
@bs = external dso_local global [1600005 x i32], align 16
@cs = external dso_local local_unnamed_addr global [1600005 x i32], align 16
@step = external dso_local local_unnamed_addr global [1600005 x i32], align 16
@razz = external dso_local local_unnamed_addr global [1600005 x i32], align 16
@logTable = external dso_local local_unnamed_addr global [1600005 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10buildTablev() local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z9getPredokii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6dfsWayii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z7getCurriiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

8:                                                ; preds = %14, %0
  %indvars.iv = phi i64 [ 2, %0 ], [ %indvars.iv.next.1, %14 ]
  %9 = lshr exact i64 %indvars.iv, 1
  %10 = getelementptr inbounds [1600005 x i32], ptr @logTable, i64 0, i64 %9
  %11 = load i32, ptr %10, align 4, !tbaa !8
  %12 = add nsw i32 %11, 1
  %13 = getelementptr inbounds [1600005 x i32], ptr @logTable, i64 0, i64 %indvars.iv
  store i32 %12, ptr %13, align 8, !tbaa !8
  %exitcond.not = icmp eq i64 %indvars.iv, 1600004
  br i1 %exitcond.not, label %.preheader77, label %14, !llvm.loop !11

14:                                               ; preds = %8
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %15 = lshr exact i64 %indvars.iv, 1
  %16 = getelementptr inbounds [1600005 x i32], ptr @logTable, i64 0, i64 %15
  %17 = load i32, ptr %16, align 4, !tbaa !8
  %18 = add nsw i32 %17, 1
  %19 = getelementptr inbounds [1600005 x i32], ptr @logTable, i64 0, i64 %indvars.iv.next
  store i32 %18, ptr %19, align 4, !tbaa !8
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  br label %8

.preheader77:                                     ; preds = %8, %._crit_edge.1
  %indvars.iv114 = phi i64 [ %indvars.iv.next115.1, %._crit_edge.1 ], [ 0, %8 ]
  %.07084 = phi i32 [ %.171.lcssa.1, %._crit_edge.1 ], [ 1, %8 ]
  %.07283 = phi i32 [ %.173.lcssa.1, %._crit_edge.1 ], [ 0, %8 ]
  %20 = sext i32 %.07084 to i64
  %21 = icmp sgt i64 %indvars.iv114, %20
  br i1 %21, label %.lr.ph, label %._crit_edge

22:                                               ; preds = %._crit_edge
  store <4 x i32> <i32 1, i32 2, i32 4, i32 8>, ptr getelementptr inbounds (i8, ptr @step, i64 4), align 4, !tbaa !8
  store <4 x i32> <i32 16, i32 32, i32 64, i32 128>, ptr getelementptr inbounds (i8, ptr @step, i64 20), align 4, !tbaa !8
  store <4 x i32> <i32 256, i32 512, i32 1024, i32 2048>, ptr getelementptr inbounds (i8, ptr @step, i64 36), align 4, !tbaa !8
  store <4 x i32> <i32 4096, i32 8192, i32 16384, i32 32768>, ptr getelementptr inbounds (i8, ptr @step, i64 52), align 4, !tbaa !8
  store <4 x i32> <i32 65536, i32 131072, i32 262144, i32 524288>, ptr getelementptr inbounds (i8, ptr @step, i64 68), align 4, !tbaa !8
  store <4 x i32> <i32 1048576, i32 2097152, i32 4194304, i32 8388608>, ptr getelementptr inbounds (i8, ptr @step, i64 84), align 4, !tbaa !8
  store <4 x i32> <i32 16777216, i32 33554432, i32 67108864, i32 134217728>, ptr getelementptr inbounds (i8, ptr @step, i64 100), align 4, !tbaa !8
  store i32 268435456, ptr getelementptr inbounds (i8, ptr @step, i64 116), align 4, !tbaa !8
  %23 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @k)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 1, ptr %1, align 4, !tbaa !8
  %24 = load i32, ptr @n, align 4, !tbaa !8
  %25 = icmp sgt i32 %24, 1
  br i1 %25, label %.lr.ph89, label %._crit_edge90

.lr.ph:                                           ; preds = %.preheader77, %.lr.ph
  %.17181 = phi i32 [ %26, %.lr.ph ], [ %.07084, %.preheader77 ]
  %.17380 = phi i32 [ %27, %.lr.ph ], [ %.07283, %.preheader77 ]
  %26 = shl nsw i32 %.17181, 1
  %27 = add nsw i32 %.17380, 1
  %28 = sext i32 %26 to i64
  %29 = icmp sgt i64 %indvars.iv114, %28
  br i1 %29, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph, %.preheader77
  %.173.lcssa = phi i32 [ %.07283, %.preheader77 ], [ %27, %.lr.ph ]
  %.171.lcssa = phi i32 [ %.07084, %.preheader77 ], [ %26, %.lr.ph ]
  %30 = getelementptr inbounds [1600005 x i32], ptr @razz, i64 0, i64 %indvars.iv114
  store i32 %.173.lcssa, ptr %30, align 8, !tbaa !8
  %indvars.iv.next115 = or disjoint i64 %indvars.iv114, 1
  %exitcond117.not = icmp eq i64 %indvars.iv114, 1600004
  br i1 %exitcond117.not, label %22, label %.preheader77.1, !llvm.loop !14

.preheader77.1:                                   ; preds = %._crit_edge
  %31 = sext i32 %.171.lcssa to i64
  %.not = icmp slt i64 %indvars.iv114, %31
  br i1 %.not, label %._crit_edge.1, label %.lr.ph.1

.lr.ph.1:                                         ; preds = %.preheader77.1, %.lr.ph.1
  %.17181.1 = phi i32 [ %32, %.lr.ph.1 ], [ %.171.lcssa, %.preheader77.1 ]
  %.17380.1 = phi i32 [ %33, %.lr.ph.1 ], [ %.173.lcssa, %.preheader77.1 ]
  %32 = shl nsw i32 %.17181.1, 1
  %33 = add nsw i32 %.17380.1, 1
  %34 = sext i32 %32 to i64
  %.not142 = icmp slt i64 %indvars.iv114, %34
  br i1 %.not142, label %._crit_edge.1, label %.lr.ph.1, !llvm.loop !13

._crit_edge.1:                                    ; preds = %.lr.ph.1, %.preheader77.1
  %.173.lcssa.1 = phi i32 [ %.173.lcssa, %.preheader77.1 ], [ %33, %.lr.ph.1 ]
  %.171.lcssa.1 = phi i32 [ %.171.lcssa, %.preheader77.1 ], [ %32, %.lr.ph.1 ]
  %35 = getelementptr inbounds [1600005 x i32], ptr @razz, i64 0, i64 %indvars.iv.next115
  store i32 %.173.lcssa.1, ptr %35, align 4, !tbaa !8
  %indvars.iv.next115.1 = add nuw nsw i64 %indvars.iv114, 2
  br label %.preheader77

._crit_edge90:                                    ; preds = %.lr.ph89, %22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  call void @_Z6dfsWayii(i32 noundef 0, i32 noundef 0)
  call void @_Z10buildTablev()
  %36 = load i32, ptr @k, align 4, !tbaa !8
  %37 = icmp sgt i32 %36, 0
  br i1 %37, label %.lr.ph93, label %._crit_edge108

.lr.ph89:                                         ; preds = %22, %.lr.ph89
  %storemerge87 = phi i32 [ %49, %.lr.ph89 ], [ 1, %22 ]
  %38 = sext i32 %storemerge87 to i64
  %39 = getelementptr inbounds [1600005 x i32], ptr @parent, i64 0, i64 %38
  %40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %39)
  %41 = load i32, ptr %1, align 4, !tbaa !8
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [1600005 x i32], ptr @parent, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !8
  %45 = add nsw i32 %44, -1
  store i32 %45, ptr %43, align 4, !tbaa !8
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [1600005 x %"class.std::vector"], ptr @neig, i64 0, i64 %46
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %47, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %48 = load i32, ptr %1, align 4, !tbaa !8
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %1, align 4, !tbaa !8
  %50 = load i32, ptr @n, align 4, !tbaa !8
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %.lr.ph89, label %._crit_edge90, !llvm.loop !15

.preheader:                                       ; preds = %.lr.ph93
  %52 = icmp sgt i32 %62, 0
  br i1 %52, label %.lr.ph107, label %._crit_edge108

.lr.ph93:                                         ; preds = %._crit_edge90, %.lr.ph93
  %indvars.iv122 = phi i64 [ %indvars.iv.next123, %.lr.ph93 ], [ 0, %._crit_edge90 ]
  %53 = getelementptr inbounds [1600005 x i32], ptr @as, i64 0, i64 %indvars.iv122
  %54 = getelementptr inbounds [1600005 x i32], ptr @bs, i64 0, i64 %indvars.iv122
  %55 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %53, ptr noundef nonnull %54)
  %56 = load i32, ptr %53, align 4, !tbaa !8
  %57 = add nsw i32 %56, -1
  store i32 %57, ptr %53, align 4, !tbaa !8
  %58 = load i32, ptr %54, align 4, !tbaa !8
  %59 = add nsw i32 %58, -1
  store i32 %59, ptr %54, align 4, !tbaa !8
  %60 = call noundef i32 @_Z9getPredokii(i32 noundef %57, i32 noundef %59)
  %61 = getelementptr inbounds [1600005 x i32], ptr @cs, i64 0, i64 %indvars.iv122
  store i32 %60, ptr %61, align 4, !tbaa !8
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %62 = load i32, ptr @k, align 4, !tbaa !8
  %63 = sext i32 %62 to i64
  %64 = icmp slt i64 %indvars.iv.next123, %63
  br i1 %64, label %.lr.ph93, label %.preheader, !llvm.loop !16

.loopexit.loopexit:                               ; preds = %77
  %.pre = sext i32 %106 to i64
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.lr.ph107
  %.pre-phi = phi i64 [ %.pre, %.loopexit.loopexit ], [ %71, %.lr.ph107 ]
  %65 = phi i32 [ %106, %.loopexit.loopexit ], [ %70, %.lr.ph107 ]
  %.165.lcssa = phi i32 [ %.266, %.loopexit.loopexit ], [ %.064103, %.lr.ph107 ]
  %.162.lcssa = phi i32 [ %.263, %.loopexit.loopexit ], [ %.061104, %.lr.ph107 ]
  %.1.lcssa = phi i32 [ %.2, %.loopexit.loopexit ], [ %.060105, %.lr.ph107 ]
  %66 = icmp slt i64 %indvars.iv.next131, %.pre-phi
  %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1
  br i1 %66, label %.lr.ph107, label %._crit_edge108.loopexit, !llvm.loop !17

._crit_edge108.loopexit:                          ; preds = %.loopexit
  %67 = add nsw i32 %.162.lcssa, 1
  %68 = add nsw i32 %.1.lcssa, 1
  br label %._crit_edge108

._crit_edge108:                                   ; preds = %._crit_edge90, %._crit_edge108.loopexit, %.preheader
  %.064.lcssa = phi i32 [ 0, %.preheader ], [ %.165.lcssa, %._crit_edge108.loopexit ], [ 0, %._crit_edge90 ]
  %.061.lcssa = phi i32 [ 1, %.preheader ], [ %67, %._crit_edge108.loopexit ], [ 1, %._crit_edge90 ]
  %.060.lcssa = phi i32 [ 2, %.preheader ], [ %68, %._crit_edge108.loopexit ], [ 2, %._crit_edge90 ]
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %.064.lcssa, i32 noundef %.061.lcssa, i32 noundef %.060.lcssa)
  ret i32 0

.lr.ph107:                                        ; preds = %.preheader, %.loopexit
  %70 = phi i32 [ %65, %.loopexit ], [ %62, %.preheader ]
  %indvars.iv130 = phi i64 [ %indvars.iv.next131, %.loopexit ], [ 0, %.preheader ]
  %indvars.iv125 = phi i64 [ %indvars.iv.next126, %.loopexit ], [ 1, %.preheader ]
  %.060105 = phi i32 [ %.1.lcssa, %.loopexit ], [ 1, %.preheader ]
  %.061104 = phi i32 [ %.162.lcssa, %.loopexit ], [ 0, %.preheader ]
  %.064103 = phi i32 [ %.165.lcssa, %.loopexit ], [ 0, %.preheader ]
  %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
  %71 = sext i32 %70 to i64
  %72 = icmp slt i64 %indvars.iv.next131, %71
  br i1 %72, label %.lr.ph99, label %.loopexit

.lr.ph99:                                         ; preds = %.lr.ph107
  %73 = getelementptr inbounds [1600005 x i32], ptr @as, i64 0, i64 %indvars.iv130
  %74 = getelementptr inbounds [1600005 x i32], ptr @cs, i64 0, i64 %indvars.iv130
  %75 = getelementptr inbounds [1600005 x i32], ptr @bs, i64 0, i64 %indvars.iv130
  %76 = trunc nuw nsw i64 %indvars.iv130 to i32
  br label %77

77:                                               ; preds = %.lr.ph99, %77
  %indvars.iv127 = phi i64 [ %indvars.iv125, %.lr.ph99 ], [ %indvars.iv.next128, %77 ]
  %.196 = phi i32 [ %.060105, %.lr.ph99 ], [ %.2, %77 ]
  %.16295 = phi i32 [ %.061104, %.lr.ph99 ], [ %.263, %77 ]
  %.16594 = phi i32 [ %.064103, %.lr.ph99 ], [ %.266, %77 ]
  %78 = load i32, ptr %73, align 4, !tbaa !8
  %79 = load i32, ptr %74, align 4, !tbaa !8
  %80 = getelementptr inbounds [1600005 x i32], ptr @as, i64 0, i64 %indvars.iv127
  %81 = load i32, ptr %80, align 4, !tbaa !8
  %82 = getelementptr inbounds [1600005 x i32], ptr @cs, i64 0, i64 %indvars.iv127
  %83 = load i32, ptr %82, align 4, !tbaa !8
  %84 = call noundef i32 @_Z7getCurriiii(i32 noundef %78, i32 noundef %79, i32 noundef %81, i32 noundef %83)
  %85 = load i32, ptr %73, align 4, !tbaa !8
  %86 = load i32, ptr %74, align 4, !tbaa !8
  %87 = getelementptr inbounds [1600005 x i32], ptr @bs, i64 0, i64 %indvars.iv127
  %88 = load i32, ptr %87, align 4, !tbaa !8
  %89 = load i32, ptr %82, align 4, !tbaa !8
  %90 = call noundef i32 @_Z7getCurriiii(i32 noundef %85, i32 noundef %86, i32 noundef %88, i32 noundef %89)
  %91 = add nsw i32 %90, %84
  %92 = load i32, ptr %75, align 4, !tbaa !8
  %93 = load i32, ptr %74, align 4, !tbaa !8
  %94 = load i32, ptr %80, align 4, !tbaa !8
  %95 = load i32, ptr %82, align 4, !tbaa !8
  %96 = call noundef i32 @_Z7getCurriiii(i32 noundef %92, i32 noundef %93, i32 noundef %94, i32 noundef %95)
  %97 = add nsw i32 %91, %96
  %98 = load i32, ptr %75, align 4, !tbaa !8
  %99 = load i32, ptr %74, align 4, !tbaa !8
  %100 = load i32, ptr %87, align 4, !tbaa !8
  %101 = load i32, ptr %82, align 4, !tbaa !8
  %102 = call noundef i32 @_Z7getCurriiii(i32 noundef %98, i32 noundef %99, i32 noundef %100, i32 noundef %101)
  %103 = add nsw i32 %97, %102
  %104 = icmp sgt i32 %103, %.16594
  %.266 = call i32 @llvm.smax.i32(i32 %103, i32 %.16594)
  %.263 = select i1 %104, i32 %76, i32 %.16295
  %105 = trunc nuw nsw i64 %indvars.iv127 to i32
  %.2 = select i1 %104, i32 %105, i32 %.196
  %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
  %106 = load i32, ptr @k, align 4, !tbaa !8
  %107 = trunc nuw i64 %indvars.iv.next128 to i32
  %108 = icmp sgt i32 %106, %107
  br i1 %108, label %77, label %.loopexit.loopexit, !llvm.loop !18
}

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5

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

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


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