; LLVM IR from Tunghohin/Competitive_Coding :: Codeforces/cf1678_E.ll (Z5solvev)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@cnt = external dso_local global i32, align 4
@son = external dso_local global [100010 x %"class.std::vector"], align 16
@cycles = external dso_local global [100010 x %"class.std::vector"], align 16
@ca = external dso_local global [100010 x i32], align 16
@cb = external dso_local global [100010 x i32], align 16
@vis = external dso_local global [100010 x i8], align 16
@val_c = external dso_local global [100010 x i32], 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 noundef zeroext i1 @_Z4compRSt6vectorIiSaIiEES2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsi(i32 noundef) #1

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

; Function Attrs: 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 uwtable
define dso_local void @_Z5solvev() #1 {
  %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 i64, align 8
  %14 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  store i32 0, ptr @cnt, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %34, %0
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %19 = icmp sle i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %37

21:                                               ; preds = %16
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [100010 x i8], ptr @vis, i64 0, i64 %23
  store i8 0, ptr %24, align 1, !tbaa !9
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [100010 x i32], ptr @val_c, i64 0, i64 %26
  store i32 0, ptr %27, align 4, !tbaa !5
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @cycles, i64 0, i64 %29
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #6
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @son, i64 0, i64 %32
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #6
  br label %34

34:                                               ; preds = %21
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %2, align 4, !tbaa !5
  br label %16, !llvm.loop !11

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

38:                                               ; preds = %48, %37
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = load i32, ptr %1, align 4, !tbaa !5
  %41 = icmp sle i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %51

43:                                               ; preds = %38
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100010 x i32], ptr @ca, i64 0, i64 %45
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %46)
  br label %48

48:                                               ; preds = %43
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %3, align 4, !tbaa !5
  br label %38, !llvm.loop !13

51:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %62, %51
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = load i32, ptr %1, align 4, !tbaa !5
  %55 = icmp sle i32 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %65

57:                                               ; preds = %52
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [100010 x i32], ptr @cb, i64 0, i64 %59
  %61 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %60)
  br label %62

62:                                               ; preds = %57
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %4, align 4, !tbaa !5
  br label %52, !llvm.loop !14

65:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %81, %65
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = load i32, ptr %1, align 4, !tbaa !5
  %69 = icmp sle i32 %67, %68
  br i1 %69, label %71, label %70

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

71:                                               ; preds = %66
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [100010 x i32], ptr @ca, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @son, i64 0, i64 %76
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [100010 x i32], ptr @cb, i64 0, i64 %79
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %77, ptr noundef nonnull align 4 dereferenceable(4) %80)
  br label %81

81:                                               ; preds = %71
  %82 = load i32, ptr %5, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %5, align 4, !tbaa !5
  br label %66, !llvm.loop !15

84:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %101, %84
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = load i32, ptr %1, align 4, !tbaa !5
  %88 = icmp sle i32 %86, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %104

90:                                               ; preds = %85
  %91 = load i32, ptr %6, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [100010 x i8], ptr @vis, i64 0, i64 %92
  %94 = load i8, ptr %93, align 1, !tbaa !9, !range !16, !noundef !17
  %95 = trunc i8 %94 to i1
  br i1 %95, label %100, label %96

96:                                               ; preds = %90
  %97 = load i32, ptr @cnt, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr @cnt, align 4, !tbaa !5
  %99 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z3dfsi(i32 noundef %99)
  br label %100

100:                                              ; preds = %96, %90
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %6, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %6, align 4, !tbaa !5
  br label %85, !llvm.loop !18

104:                                              ; preds = %89
  %105 = load i32, ptr @cnt, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds %"class.std::vector", ptr getelementptr inbounds (%"class.std::vector", ptr @cycles, i64 1), i64 %106
  call void @_ZSt4sortIPSt6vectorIiSaIiEEPFbRS2_S4_EEvT_S7_T0_(ptr noundef getelementptr inbounds (%"class.std::vector", ptr @cycles, i64 1), ptr noundef %107, ptr noundef @_Z4compRSt6vectorIiSaIiEES2_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %108 = load i32, ptr %1, align 4, !tbaa !5
  store i32 %108, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %165, %104
  %110 = load i32, ptr %9, align 4, !tbaa !5
  %111 = load i32, ptr @cnt, align 4, !tbaa !5
  %112 = icmp sle i32 %110, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %109
  store i32 17, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %168

114:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %161, %114
  %116 = load i32, ptr %11, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = load i32, ptr %9, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @cycles, i64 0, i64 %119
  %121 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %120) #6
  %122 = load i32, ptr %9, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @cycles, i64 0, i64 %123
  %125 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %124) #6
  %126 = urem i64 %125, 2
  %127 = icmp eq i64 %126, 1
  %128 = zext i1 %127 to i64
  %129 = sub i64 %121, %128
  %130 = icmp ult i64 %117, %129
  br i1 %130, label %132, label %131

131:                                              ; preds = %115
  store i32 20, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %164

132:                                              ; preds = %115
  %133 = load i32, ptr %11, align 4, !tbaa !5
  %134 = srem i32 %133, 2
  %135 = icmp eq i32 %134, 0
  br i1 %135, label %136, label %148

136:                                              ; preds = %132
  %137 = load i32, ptr %7, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %7, align 4, !tbaa !5
  %139 = load i32, ptr %9, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @cycles, i64 0, i64 %140
  %142 = load i32, ptr %11, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %141, i64 noundef %143) #6
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [100010 x i32], ptr @val_c, i64 0, i64 %146
  store i32 %137, ptr %147, align 4, !tbaa !5
  br label %160

148:                                              ; preds = %132
  %149 = load i32, ptr %8, align 4, !tbaa !5
  %150 = add nsw i32 %149, -1
  store i32 %150, ptr %8, align 4, !tbaa !5
  %151 = load i32, ptr %9, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @cycles, i64 0, i64 %152
  %154 = load i32, ptr %11, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %153, i64 noundef %155) #6
  %157 = load i32, ptr %156, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [100010 x i32], ptr @val_c, i64 0, i64 %158
  store i32 %149, ptr %159, align 4, !tbaa !5
  br label %160

160:                                              ; preds = %148, %136
  br label %161

161:                                              ; preds = %160
  %162 = load i32, ptr %11, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %11, align 4, !tbaa !5
  br label %115, !llvm.loop !19

164:                                              ; preds = %131
  br label %165

165:                                              ; preds = %164
  %166 = load i32, ptr %9, align 4, !tbaa !5
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %9, align 4, !tbaa !5
  br label %109, !llvm.loop !20

168:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %169

169:                                              ; preds = %187, %168
  %170 = load i32, ptr %12, align 4, !tbaa !5
  %171 = load i32, ptr %1, align 4, !tbaa !5
  %172 = icmp sle i32 %170, %171
  br i1 %172, label %174, label %173

173:                                              ; preds = %169
  store i32 23, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %190

174:                                              ; preds = %169
  %175 = load i32, ptr %12, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [100010 x i32], ptr @val_c, i64 0, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = icmp ne i32 %178, 0
  br i1 %179, label %186, label %180

180:                                              ; preds = %174
  %181 = load i32, ptr %7, align 4, !tbaa !5
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %7, align 4, !tbaa !5
  %183 = load i32, ptr %12, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [100010 x i32], ptr @val_c, i64 0, i64 %184
  store i32 %181, ptr %185, align 4, !tbaa !5
  br label %186

186:                                              ; preds = %180, %174
  br label %187

187:                                              ; preds = %186
  %188 = load i32, ptr %12, align 4, !tbaa !5
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %12, align 4, !tbaa !5
  br label %169, !llvm.loop !21

190:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store i64 0, ptr %13, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %191

191:                                              ; preds = %216, %190
  %192 = load i32, ptr %14, align 4, !tbaa !5
  %193 = load i32, ptr %1, align 4, !tbaa !5
  %194 = icmp sle i32 %192, %193
  br i1 %194, label %196, label %195

195:                                              ; preds = %191
  store i32 26, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %219

196:                                              ; preds = %191
  %197 = load i32, ptr %14, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [100010 x i32], ptr @ca, i64 0, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [100010 x i32], ptr @val_c, i64 0, i64 %201
  %203 = load i32, ptr %202, align 4, !tbaa !5
  %204 = load i32, ptr %14, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [100010 x i32], ptr @cb, i64 0, i64 %205
  %207 = load i32, ptr %206, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [100010 x i32], ptr @val_c, i64 0, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !5
  %211 = sub nsw i32 %203, %210
  %212 = call i32 @llvm.abs.i32(i32 %211, i1 true)
  %213 = sext i32 %212 to i64
  %214 = load i64, ptr %13, align 8, !tbaa !22
  %215 = add nsw i64 %214, %213
  store i64 %215, ptr %13, align 8, !tbaa !22
  br label %216

216:                                              ; preds = %196
  %217 = load i32, ptr %14, align 4, !tbaa !5
  %218 = add nsw i32 %217, 1
  store i32 %218, ptr %14, align 4, !tbaa !5
  br label %191, !llvm.loop !24

219:                                              ; preds = %195
  %220 = load i64, ptr %13, align 8, !tbaa !22
  %221 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %220)
  %222 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %221, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  ret void
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPSt6vectorIiSaIiEEPFbRS2_S4_EEvT_S7_T0_(ptr noundef, ptr noundef, ptr noundef) #4

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5

; 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) #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 = { "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 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@cnt = external dso_local local_unnamed_addr global i32, align 4
@son = external dso_local global [100010 x %"class.std::vector"], align 16
@cycles = external dso_local global [100010 x %"class.std::vector"], align 16
@ca = external dso_local global [100010 x i32], align 16
@cb = external dso_local global [100010 x i32], align 16
@vis = external dso_local local_unnamed_addr global [100010 x i8], align 16
@val_c = external dso_local local_unnamed_addr global [100010 x i32], 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 noundef zeroext i1 @_Z4compRSt6vectorIiSaIiEES2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsi(i32 noundef) local_unnamed_addr #1

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

; Function Attrs: 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 uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %2 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  store i32 0, ptr @cnt, align 4, !tbaa !5
  %3 = load i32, ptr %1, align 4, !tbaa !5
  %.not72 = icmp slt i32 %3, 0
  br i1 %.not72, label %._crit_edge, label %.lr.ph

.preheader71:                                     ; preds = %.lr.ph
  %.not5874 = icmp slt i32 %8, 1
  br i1 %.not5874, label %._crit_edge, label %.lr.ph76

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %4 = getelementptr inbounds [100010 x i8], ptr @vis, i64 0, i64 %indvars.iv
  store i8 0, ptr %4, align 1, !tbaa !9
  %5 = getelementptr inbounds [100010 x i32], ptr @val_c, i64 0, i64 %indvars.iv
  store i32 0, ptr %5, align 4, !tbaa !5
  %6 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @cycles, i64 0, i64 %indvars.iv
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  %7 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @son, i64 0, i64 %indvars.iv
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %8 = load i32, ptr %1, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %.not.not = icmp slt i64 %indvars.iv, %9
  br i1 %.not.not, label %.lr.ph, label %.preheader71, !llvm.loop !11

.preheader70:                                     ; preds = %.lr.ph76
  %.not5977 = icmp slt i32 %12, 1
  br i1 %.not5977, label %._crit_edge, label %.lr.ph79

.lr.ph76:                                         ; preds = %.preheader71, %.lr.ph76
  %indvars.iv109 = phi i64 [ %indvars.iv.next110, %.lr.ph76 ], [ 1, %.preheader71 ]
  %10 = getelementptr inbounds [100010 x i32], ptr @ca, i64 0, i64 %indvars.iv109
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %.not58.not = icmp slt i64 %indvars.iv109, %13
  br i1 %.not58.not, label %.lr.ph76, label %.preheader70, !llvm.loop !13

.preheader69:                                     ; preds = %.lr.ph79
  %.not6080 = icmp slt i32 %16, 1
  br i1 %.not6080, label %._crit_edge, label %.lr.ph82

.lr.ph79:                                         ; preds = %.preheader70, %.lr.ph79
  %indvars.iv112 = phi i64 [ %indvars.iv.next113, %.lr.ph79 ], [ 1, %.preheader70 ]
  %14 = getelementptr inbounds [100010 x i32], ptr @cb, i64 0, i64 %indvars.iv112
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %.not59.not = icmp slt i64 %indvars.iv112, %17
  br i1 %.not59.not, label %.lr.ph79, label %.preheader69, !llvm.loop !14

.preheader68:                                     ; preds = %.lr.ph82
  %.not6183 = icmp slt i32 %23, 1
  br i1 %.not6183, label %._crit_edge, label %.lr.ph85

.lr.ph82:                                         ; preds = %.preheader69, %.lr.ph82
  %indvars.iv115 = phi i64 [ %indvars.iv.next116, %.lr.ph82 ], [ 1, %.preheader69 ]
  %18 = getelementptr inbounds [100010 x i32], ptr @ca, i64 0, i64 %indvars.iv115
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @son, i64 0, i64 %20
  %22 = getelementptr inbounds [100010 x i32], ptr @cb, i64 0, i64 %indvars.iv115
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %.not60.not = icmp slt i64 %indvars.iv115, %24
  br i1 %.not60.not, label %.lr.ph82, label %.preheader68, !llvm.loop !15

._crit_edge:                                      ; preds = %38, %0, %.preheader71, %.preheader70, %.preheader69, %.preheader68
  %25 = load i32, ptr @cnt, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds %"class.std::vector", ptr getelementptr inbounds (i8, ptr @cycles, i64 24), i64 %26
  call void @_ZSt4sortIPSt6vectorIiSaIiEEPFbRS2_S4_EEvT_S7_T0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @cycles, i64 24), ptr noundef nonnull %27, ptr noundef nonnull @_Z4compRSt6vectorIiSaIiEES2_)
  %28 = load i32, ptr %1, align 4, !tbaa !5
  %29 = load i32, ptr @cnt, align 4, !tbaa !5
  %.not6292 = icmp slt i32 %29, 1
  br i1 %.not6292, label %.preheader66, label %.preheader67

.lr.ph85:                                         ; preds = %.preheader68, %38
  %30 = phi i32 [ %39, %38 ], [ %23, %.preheader68 ]
  %indvars.iv118 = phi i64 [ %indvars.iv.next119, %38 ], [ 1, %.preheader68 ]
  %31 = getelementptr inbounds [100010 x i8], ptr @vis, i64 0, i64 %indvars.iv118
  %32 = load i8, ptr %31, align 1, !tbaa !9, !range !16, !noundef !17
  %33 = trunc nuw i8 %32 to i1
  br i1 %33, label %38, label %34

34:                                               ; preds = %.lr.ph85
  %35 = load i32, ptr @cnt, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr @cnt, align 4, !tbaa !5
  %37 = trunc nuw nsw i64 %indvars.iv118 to i32
  call void @_Z3dfsi(i32 noundef %37)
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %.lr.ph85, %34
  %39 = phi i32 [ %30, %.lr.ph85 ], [ %.pre, %34 ]
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %40 = sext i32 %39 to i64
  %.not61.not = icmp slt i64 %indvars.iv118, %40
  br i1 %.not61.not, label %.lr.ph85, label %._crit_edge, !llvm.loop !18

.preheader67:                                     ; preds = %._crit_edge, %._crit_edge90
  %indvars.iv124 = phi i64 [ %indvars.iv.next125, %._crit_edge90 ], [ 1, %._crit_edge ]
  %.04894 = phi i32 [ %.1.lcssa, %._crit_edge90 ], [ %28, %._crit_edge ]
  %.04993 = phi i32 [ %.150.lcssa, %._crit_edge90 ], [ 1, %._crit_edge ]
  %41 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @cycles, i64 0, i64 %indvars.iv124
  %42 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #6
  %43 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #6
  %44 = and i64 %43, 1
  %.not = icmp eq i64 %42, %44
  br i1 %.not, label %._crit_edge90, label %.lr.ph89

.preheader66.loopexit:                            ; preds = %._crit_edge90
  %.pre135 = load i32, ptr %1, align 4, !tbaa !5
  br label %.preheader66

.preheader66:                                     ; preds = %.preheader66.loopexit, %._crit_edge
  %45 = phi i32 [ %28, %._crit_edge ], [ %.pre135, %.preheader66.loopexit ]
  %.049.lcssa = phi i32 [ 1, %._crit_edge ], [ %.150.lcssa, %.preheader66.loopexit ]
  %.not6397 = icmp slt i32 %45, 1
  br i1 %.not6397, label %._crit_edge106, label %.lr.ph100.preheader

.lr.ph100.preheader:                              ; preds = %.preheader66
  %46 = zext nneg i32 %45 to i64
  %47 = zext nneg i32 %45 to i64
  %48 = add nsw i64 %47, -1
  %xtraiter = and i64 %46, 1
  %49 = icmp eq i64 %48, 0
  br i1 %49, label %.preheader.unr-lcssa, label %.lr.ph100.preheader.new

.lr.ph100.preheader.new:                          ; preds = %.lr.ph100.preheader
  %unroll_iter = and i64 %46, 2147483646
  br label %.lr.ph100

._crit_edge90:                                    ; preds = %.lr.ph89, %.preheader67
  %.150.lcssa = phi i32 [ %.04993, %.preheader67 ], [ %.251, %.lr.ph89 ]
  %.1.lcssa = phi i32 [ %.04894, %.preheader67 ], [ %.2, %.lr.ph89 ]
  %indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
  %50 = load i32, ptr @cnt, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %.not62.not = icmp slt i64 %indvars.iv124, %51
  br i1 %.not62.not, label %.preheader67, label %.preheader66.loopexit, !llvm.loop !19

.lr.ph89:                                         ; preds = %.preheader67, %.lr.ph89
  %indvars.iv121 = phi i64 [ %indvars.iv.next122, %.lr.ph89 ], [ 0, %.preheader67 ]
  %.187 = phi i32 [ %.2, %.lr.ph89 ], [ %.04894, %.preheader67 ]
  %.15086 = phi i32 [ %.251, %.lr.ph89 ], [ %.04993, %.preheader67 ]
  %52 = and i64 %indvars.iv121, 1
  %53 = icmp ne i64 %52, 0
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %41, i64 noundef %indvars.iv121) #6
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100010 x i32], ptr @val_c, i64 0, i64 %56
  %.15086.sink = select i1 %53, i32 %.187, i32 %.15086
  %58 = trunc nuw nsw i64 %52 to i32
  %59 = xor i32 %58, 1
  %.251 = add nsw i32 %.15086, %59
  %60 = sext i1 %53 to i32
  %.2 = add nsw i32 %.187, %60
  store i32 %.15086.sink, ptr %57, align 4, !tbaa !5
  %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
  %61 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #6
  %62 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #6
  %63 = and i64 %62, 1
  %64 = sub i64 %61, %63
  %65 = icmp ugt i64 %64, %indvars.iv.next122
  br i1 %65, label %.lr.ph89, label %._crit_edge90, !llvm.loop !20

.preheader.unr-lcssa:                             ; preds = %78, %.lr.ph100.preheader
  %indvars.iv127.unr = phi i64 [ 1, %.lr.ph100.preheader ], [ %indvars.iv.next128.1, %78 ]
  %.398.unr = phi i32 [ %.049.lcssa, %.lr.ph100.preheader ], [ %.4.1, %78 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.lr.ph100.epil

.lr.ph100.epil:                                   ; preds = %.preheader.unr-lcssa
  %66 = getelementptr inbounds [100010 x i32], ptr @val_c, i64 0, i64 %indvars.iv127.unr
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %.not65.epil = icmp eq i32 %67, 0
  br i1 %.not65.epil, label %68, label %.preheader

68:                                               ; preds = %.lr.ph100.epil
  store i32 %.398.unr, ptr %66, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph100.epil, %68, %.preheader.unr-lcssa
  br i1 %.not6397, label %._crit_edge106, label %.lr.ph105.preheader

.lr.ph105.preheader:                              ; preds = %.preheader
  %xtraiter154 = and i64 %46, 1
  %69 = icmp eq i64 %48, 0
  br i1 %69, label %._crit_edge106.loopexit.unr-lcssa, label %.lr.ph105.preheader.new

.lr.ph105.preheader.new:                          ; preds = %.lr.ph105.preheader
  %unroll_iter157 = and i64 %46, 2147483646
  br label %.lr.ph105

.lr.ph100:                                        ; preds = %78, %.lr.ph100.preheader.new
  %indvars.iv127 = phi i64 [ 1, %.lr.ph100.preheader.new ], [ %indvars.iv.next128.1, %78 ]
  %.398 = phi i32 [ %.049.lcssa, %.lr.ph100.preheader.new ], [ %.4.1, %78 ]
  %niter = phi i64 [ 0, %.lr.ph100.preheader.new ], [ %niter.next.1, %78 ]
  %70 = getelementptr inbounds [100010 x i32], ptr @val_c, i64 0, i64 %indvars.iv127
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %.not65 = icmp eq i32 %71, 0
  br i1 %.not65, label %72, label %.lr.ph100.1

72:                                               ; preds = %.lr.ph100
  %73 = add nsw i32 %.398, 1
  store i32 %.398, ptr %70, align 4, !tbaa !5
  br label %.lr.ph100.1

.lr.ph100.1:                                      ; preds = %.lr.ph100, %72
  %.4 = phi i32 [ %.398, %.lr.ph100 ], [ %73, %72 ]
  %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
  %74 = getelementptr inbounds [100010 x i32], ptr @val_c, i64 0, i64 %indvars.iv.next128
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %.not65.1 = icmp eq i32 %75, 0
  br i1 %.not65.1, label %76, label %78

76:                                               ; preds = %.lr.ph100.1
  %77 = add nsw i32 %.4, 1
  store i32 %.4, ptr %74, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %76, %.lr.ph100.1
  %.4.1 = phi i32 [ %.4, %.lr.ph100.1 ], [ %77, %76 ]
  %indvars.iv.next128.1 = add nuw nsw i64 %indvars.iv127, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader.unr-lcssa, label %.lr.ph100, !llvm.loop !21

._crit_edge106.loopexit.unr-lcssa:                ; preds = %.lr.ph105, %.lr.ph105.preheader
  %.lcssa.ph = phi i64 [ poison, %.lr.ph105.preheader ], [ %122, %.lr.ph105 ]
  %indvars.iv130.unr = phi i64 [ 1, %.lr.ph105.preheader ], [ %indvars.iv.next131.1, %.lr.ph105 ]
  %.044103.unr = phi i64 [ 0, %.lr.ph105.preheader ], [ %122, %.lr.ph105 ]
  %lcmp.mod155.not = icmp eq i64 %xtraiter154, 0
  br i1 %lcmp.mod155.not, label %._crit_edge106, label %.lr.ph105.epil

.lr.ph105.epil:                                   ; preds = %._crit_edge106.loopexit.unr-lcssa
  %79 = getelementptr inbounds [100010 x i32], ptr @ca, i64 0, i64 %indvars.iv130.unr
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [100010 x i32], ptr @val_c, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = getelementptr inbounds [100010 x i32], ptr @cb, i64 0, i64 %indvars.iv130.unr
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100010 x i32], ptr @val_c, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = sub nsw i32 %83, %88
  %90 = call i32 @llvm.abs.i32(i32 %89, i1 true)
  %91 = zext nneg i32 %90 to i64
  %92 = add nuw nsw i64 %.044103.unr, %91
  br label %._crit_edge106

._crit_edge106:                                   ; preds = %.lr.ph105.epil, %._crit_edge106.loopexit.unr-lcssa, %.preheader66, %.preheader
  %.044.lcssa = phi i64 [ 0, %.preheader ], [ 0, %.preheader66 ], [ %.lcssa.ph, %._crit_edge106.loopexit.unr-lcssa ], [ %92, %.lr.ph105.epil ]
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.044.lcssa)
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %93, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret void

.lr.ph105:                                        ; preds = %.lr.ph105, %.lr.ph105.preheader.new
  %indvars.iv130 = phi i64 [ 1, %.lr.ph105.preheader.new ], [ %indvars.iv.next131.1, %.lr.ph105 ]
  %.044103 = phi i64 [ 0, %.lr.ph105.preheader.new ], [ %122, %.lr.ph105 ]
  %niter158 = phi i64 [ 0, %.lr.ph105.preheader.new ], [ %niter158.next.1, %.lr.ph105 ]
  %95 = getelementptr inbounds [100010 x i32], ptr @ca, i64 0, i64 %indvars.iv130
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [100010 x i32], ptr @val_c, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = getelementptr inbounds [100010 x i32], ptr @cb, i64 0, i64 %indvars.iv130
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [100010 x i32], ptr @val_c, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = sub nsw i32 %99, %104
  %106 = call i32 @llvm.abs.i32(i32 %105, i1 true)
  %107 = zext nneg i32 %106 to i64
  %108 = add nuw nsw i64 %.044103, %107
  %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
  %109 = getelementptr inbounds [100010 x i32], ptr @ca, i64 0, i64 %indvars.iv.next131
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [100010 x i32], ptr @val_c, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = getelementptr inbounds [100010 x i32], ptr @cb, i64 0, i64 %indvars.iv.next131
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [100010 x i32], ptr @val_c, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = sub nsw i32 %113, %118
  %120 = call i32 @llvm.abs.i32(i32 %119, i1 true)
  %121 = zext nneg i32 %120 to i64
  %122 = add nuw nsw i64 %108, %121
  %indvars.iv.next131.1 = add nuw nsw i64 %indvars.iv130, 2
  %niter158.next.1 = add i64 %niter158, 2
  %niter158.ncmp.1 = icmp eq i64 %niter158.next.1, %unroll_iter157
  br i1 %niter158.ncmp.1, label %._crit_edge106.loopexit.unr-lcssa, label %.lr.ph105, !llvm.loop !22
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPSt6vectorIiSaIiEEPFbRS2_S4_EEvT_S7_T0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5

; 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 #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 = { "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 = { 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 #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }

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

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


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