; LLVM IR from eyangch/competitive-programming :: Codeforces/1528/d.ll (Z3dijx)

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

@N = external dso_local global i64, align 8
@D = external dso_local global [600 x [600 x i64]], align 16
@vis = external dso_local global [600 x [600 x i8]], align 16
@G = external dso_local global [600 x %"class.std::vector"], align 16
@mn = external dso_local global [600 x i64], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3dijx(i64 noundef %0) #0 {
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %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 i64, align 8
  %14 = alloca i64, align 8
  store i64 %0, ptr %2, align 8, !tbaa !5
  %15 = load i64, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds [600 x [600 x i64]], ptr @D, i64 0, i64 %15
  %17 = load i64, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds [600 x i64], ptr %16, i64 0, i64 %17
  store i64 0, ptr %18, align 8, !tbaa !5
  br label %19

19:                                               ; preds = %191, %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  store i64 -1, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  store i64 1000000000000000, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  store i64 0, ptr %5, align 8, !tbaa !5
  br label %20

20:                                               ; preds = %49, %19
  %21 = load i64, ptr %5, align 8, !tbaa !5
  %22 = load i64, ptr @N, align 8, !tbaa !5
  %23 = icmp slt i64 %21, %22
  br i1 %23, label %25, label %24

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

25:                                               ; preds = %20
  %26 = load i64, ptr %2, align 8, !tbaa !5
  %27 = getelementptr inbounds [600 x [600 x i8]], ptr @vis, i64 0, i64 %26
  %28 = load i64, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds [600 x i8], ptr %27, i64 0, i64 %28
  %30 = load i8, ptr %29, align 1, !tbaa !9, !range !11, !noundef !12
  %31 = trunc i8 %30 to i1
  br i1 %31, label %32, label %33

32:                                               ; preds = %25
  br label %49

33:                                               ; preds = %25
  %34 = load i64, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds [600 x [600 x i64]], ptr @D, i64 0, i64 %34
  %36 = load i64, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds [600 x i64], ptr %35, i64 0, i64 %36
  %38 = load i64, ptr %37, align 8, !tbaa !5
  %39 = load i64, ptr %4, align 8, !tbaa !5
  %40 = icmp slt i64 %38, %39
  br i1 %40, label %41, label %48

41:                                               ; preds = %33
  %42 = load i64, ptr %5, align 8, !tbaa !5
  store i64 %42, ptr %3, align 8, !tbaa !5
  %43 = load i64, ptr %2, align 8, !tbaa !5
  %44 = getelementptr inbounds [600 x [600 x i64]], ptr @D, i64 0, i64 %43
  %45 = load i64, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds [600 x i64], ptr %44, i64 0, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !5
  store i64 %47, ptr %4, align 8, !tbaa !5
  br label %48

48:                                               ; preds = %41, %33
  br label %49

49:                                               ; preds = %48, %32
  %50 = load i64, ptr %5, align 8, !tbaa !5
  %51 = add nsw i64 %50, 1
  store i64 %51, ptr %5, align 8, !tbaa !5
  br label %20, !llvm.loop !13

52:                                               ; preds = %24
  %53 = load i64, ptr %3, align 8, !tbaa !5
  %54 = icmp eq i64 %53, -1
  br i1 %54, label %55, label %56

55:                                               ; preds = %52
  store i32 3, ptr %6, align 4
  br label %189

56:                                               ; preds = %52
  %57 = load i64, ptr %2, align 8, !tbaa !5
  %58 = getelementptr inbounds [600 x [600 x i8]], ptr @vis, i64 0, i64 %57
  %59 = load i64, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds [600 x i8], ptr %58, i64 0, i64 %59
  store i8 1, ptr %60, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %61 = load i64, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds [600 x i64], ptr @mn, i64 0, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !5
  store i64 %63, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %64 = load i64, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds [600 x %"class.std::vector"], ptr @G, i64 0, i64 %64
  %66 = load i64, ptr %7, align 8, !tbaa !5
  %67 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %65, i64 noundef %66) #4
  %68 = getelementptr inbounds %"struct.std::pair", ptr %67, i32 0, i32 1
  %69 = load i64, ptr %68, align 8, !tbaa !15
  store i64 %69, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %70 = load i64, ptr %2, align 8, !tbaa !5
  %71 = getelementptr inbounds [600 x [600 x i64]], ptr @D, i64 0, i64 %70
  %72 = load i64, ptr %3, align 8, !tbaa !5
  %73 = getelementptr inbounds [600 x i64], ptr %71, i64 0, i64 %72
  %74 = load i64, ptr %73, align 8, !tbaa !5
  %75 = load i64, ptr @N, align 8, !tbaa !5
  %76 = srem i64 %74, %75
  store i64 %76, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %77 = load i64, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds [600 x %"class.std::vector"], ptr @G, i64 0, i64 %77
  %79 = load i64, ptr %7, align 8, !tbaa !5
  %80 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %78, i64 noundef %79) #4
  %81 = getelementptr inbounds %"struct.std::pair", ptr %80, i32 0, i32 0
  %82 = load i64, ptr %81, align 8, !tbaa !17
  %83 = load i64, ptr %9, align 8, !tbaa !5
  %84 = add nsw i64 %82, %83
  store i64 %84, ptr %10, align 8, !tbaa !5
  br label %85

85:                                               ; preds = %89, %56
  %86 = load i64, ptr %10, align 8, !tbaa !5
  %87 = load i64, ptr @N, align 8, !tbaa !5
  %88 = icmp sge i64 %86, %87
  br i1 %88, label %89, label %93

89:                                               ; preds = %85
  %90 = load i64, ptr @N, align 8, !tbaa !5
  %91 = load i64, ptr %10, align 8, !tbaa !5
  %92 = sub nsw i64 %91, %90
  store i64 %92, ptr %10, align 8, !tbaa !5
  br label %85, !llvm.loop !18

93:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store i64 1, ptr %11, align 8, !tbaa !5
  br label %94

94:                                               ; preds = %185, %93
  %95 = load i64, ptr %11, align 8, !tbaa !5
  %96 = load i64, ptr %3, align 8, !tbaa !5
  %97 = getelementptr inbounds [600 x %"class.std::vector"], ptr @G, i64 0, i64 %96
  %98 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %97) #4
  %99 = icmp sle i64 %95, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %94
  store i32 9, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %188

101:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %102 = load i64, ptr %7, align 8, !tbaa !5
  %103 = load i64, ptr %11, align 8, !tbaa !5
  %104 = add nsw i64 %102, %103
  store i64 %104, ptr %12, align 8, !tbaa !5
  br label %105

105:                                              ; preds = %111, %101
  %106 = load i64, ptr %12, align 8, !tbaa !5
  %107 = load i64, ptr %3, align 8, !tbaa !5
  %108 = getelementptr inbounds [600 x %"class.std::vector"], ptr @G, i64 0, i64 %107
  %109 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %108) #4
  %110 = icmp uge i64 %106, %109
  br i1 %110, label %111, label %117

111:                                              ; preds = %105
  %112 = load i64, ptr %3, align 8, !tbaa !5
  %113 = getelementptr inbounds [600 x %"class.std::vector"], ptr @G, i64 0, i64 %112
  %114 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %113) #4
  %115 = load i64, ptr %12, align 8, !tbaa !5
  %116 = sub i64 %115, %114
  store i64 %116, ptr %12, align 8, !tbaa !5
  br label %105, !llvm.loop !19

117:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %118 = load i64, ptr %3, align 8, !tbaa !5
  %119 = getelementptr inbounds [600 x %"class.std::vector"], ptr @G, i64 0, i64 %118
  %120 = load i64, ptr %12, align 8, !tbaa !5
  %121 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %119, i64 noundef %120) #4
  %122 = getelementptr inbounds %"struct.std::pair", ptr %121, i32 0, i32 0
  %123 = load i64, ptr %122, align 8, !tbaa !17
  %124 = load i64, ptr %9, align 8, !tbaa !5
  %125 = add nsw i64 %123, %124
  store i64 %125, ptr %13, align 8, !tbaa !5
  br label %126

126:                                              ; preds = %130, %117
  %127 = load i64, ptr %13, align 8, !tbaa !5
  %128 = load i64, ptr @N, align 8, !tbaa !5
  %129 = icmp sge i64 %127, %128
  br i1 %129, label %130, label %134

130:                                              ; preds = %126
  %131 = load i64, ptr @N, align 8, !tbaa !5
  %132 = load i64, ptr %13, align 8, !tbaa !5
  %133 = sub nsw i64 %132, %131
  store i64 %133, ptr %13, align 8, !tbaa !5
  br label %126, !llvm.loop !20

134:                                              ; preds = %126
  br label %135

135:                                              ; preds = %167, %134
  br label %136

136:                                              ; preds = %135
  %137 = load i64, ptr %2, align 8, !tbaa !5
  %138 = getelementptr inbounds [600 x [600 x i64]], ptr @D, i64 0, i64 %137
  %139 = load i64, ptr %10, align 8, !tbaa !5
  %140 = getelementptr inbounds [600 x i64], ptr %138, i64 0, i64 %139
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %141 = load i64, ptr %2, align 8, !tbaa !5
  %142 = getelementptr inbounds [600 x [600 x i64]], ptr @D, i64 0, i64 %141
  %143 = load i64, ptr %3, align 8, !tbaa !5
  %144 = getelementptr inbounds [600 x i64], ptr %142, i64 0, i64 %143
  %145 = load i64, ptr %144, align 8, !tbaa !5
  %146 = load i64, ptr %8, align 8, !tbaa !5
  %147 = add nsw i64 %145, %146
  store i64 %147, ptr %14, align 8, !tbaa !5
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %140, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %149 = load i64, ptr %148, align 8, !tbaa !5
  %150 = load i64, ptr %2, align 8, !tbaa !5
  %151 = getelementptr inbounds [600 x [600 x i64]], ptr @D, i64 0, i64 %150
  %152 = load i64, ptr %10, align 8, !tbaa !5
  %153 = getelementptr inbounds [600 x i64], ptr %151, i64 0, i64 %152
  store i64 %149, ptr %153, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  %154 = load i64, ptr %8, align 8, !tbaa !5
  %155 = add nsw i64 %154, 1
  store i64 %155, ptr %8, align 8, !tbaa !5
  %156 = load i64, ptr %10, align 8, !tbaa !5
  %157 = add nsw i64 %156, 1
  store i64 %157, ptr %10, align 8, !tbaa !5
  %158 = load i64, ptr %10, align 8, !tbaa !5
  %159 = load i64, ptr @N, align 8, !tbaa !5
  %160 = icmp eq i64 %158, %159
  br i1 %160, label %161, label %162

161:                                              ; preds = %136
  store i64 0, ptr %10, align 8, !tbaa !5
  br label %162

162:                                              ; preds = %161, %136
  %163 = load i64, ptr %10, align 8, !tbaa !5
  %164 = load i64, ptr %13, align 8, !tbaa !5
  %165 = icmp eq i64 %163, %164
  br i1 %165, label %166, label %167

166:                                              ; preds = %162
  br label %168

167:                                              ; preds = %162
  br label %135, !llvm.loop !21

168:                                              ; preds = %166
  %169 = load i64, ptr %3, align 8, !tbaa !5
  %170 = getelementptr inbounds [600 x %"class.std::vector"], ptr @G, i64 0, i64 %169
  %171 = load i64, ptr %12, align 8, !tbaa !5
  %172 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %170, i64 noundef %171) #4
  %173 = getelementptr inbounds %"struct.std::pair", ptr %172, i32 0, i32 1
  %174 = load i64, ptr %173, align 8, !tbaa !15
  %175 = load i64, ptr %8, align 8, !tbaa !5
  %176 = icmp slt i64 %174, %175
  br i1 %176, label %177, label %184

177:                                              ; preds = %168
  %178 = load i64, ptr %3, align 8, !tbaa !5
  %179 = getelementptr inbounds [600 x %"class.std::vector"], ptr @G, i64 0, i64 %178
  %180 = load i64, ptr %12, align 8, !tbaa !5
  %181 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %179, i64 noundef %180) #4
  %182 = getelementptr inbounds %"struct.std::pair", ptr %181, i32 0, i32 1
  %183 = load i64, ptr %182, align 8, !tbaa !15
  store i64 %183, ptr %8, align 8, !tbaa !5
  br label %184

184:                                              ; preds = %177, %168
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %185

185:                                              ; preds = %184
  %186 = load i64, ptr %11, align 8, !tbaa !5
  %187 = add nsw i64 %186, 1
  store i64 %187, ptr %11, align 8, !tbaa !5
  br label %94, !llvm.loop !22

188:                                              ; preds = %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  store i32 0, ptr %6, align 4
  br label %189

189:                                              ; preds = %188, %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  %190 = load i32, ptr %6, align 4
  switch i32 %190, label %193 [
    i32 0, label %191
    i32 3, label %192
  ]

191:                                              ; preds = %189
  br label %19, !llvm.loop !23

192:                                              ; preds = %189
  ret void

193:                                              ; preds = %189
  unreachable
}

; 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

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


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

@N = external dso_local local_unnamed_addr global i64, align 8
@D = external dso_local global [600 x [600 x i64]], align 16
@vis = external dso_local local_unnamed_addr global [600 x [600 x i8]], align 16
@G = external dso_local global [600 x %"class.std::vector"], align 16
@mn = external dso_local local_unnamed_addr global [600 x i64], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z3dijx(i64 noundef %0) local_unnamed_addr #0 {
  %2 = alloca i64, align 8
  %3 = getelementptr inbounds [600 x [600 x i64]], ptr @D, i64 0, i64 %0, i64 %0
  store i64 0, ptr %3, align 8, !tbaa !5
  %4 = load i64, ptr @N, align 8, !tbaa !5
  %5 = icmp sgt i64 %4, 0
  br i1 %5, label %.lr.ph.preheader, label %._crit_edge.thread

.loopexit:                                        ; preds = %83, %.preheader80
  %6 = load i64, ptr @N, align 8, !tbaa !5
  %7 = icmp sgt i64 %6, 0
  br i1 %7, label %.lr.ph.preheader, label %._crit_edge.thread

.lr.ph.preheader:                                 ; preds = %1, %.loopexit
  %8 = phi i64 [ %6, %.loopexit ], [ %4, %1 ]
  %xtraiter = and i64 %8, 1
  %9 = icmp eq i64 %8, 1
  br i1 %9, label %._crit_edge.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %8, 9223372036854775806
  br label %.lr.ph

._crit_edge.unr-lcssa:                            ; preds = %33, %.lr.ph.preheader
  %.161.lcssa.ph = phi i64 [ poison, %.lr.ph.preheader ], [ %.161.1, %33 ]
  %.06083.unr = phi i64 [ -1, %.lr.ph.preheader ], [ %.161.1, %33 ]
  %.06582.unr = phi i64 [ 1000000000000000, %.lr.ph.preheader ], [ %.166.1, %33 ]
  %.06881.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %34, %33 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.unr-lcssa
  %10 = getelementptr inbounds [600 x [600 x i8]], ptr @vis, i64 0, i64 %0, i64 %.06881.unr
  %11 = load i8, ptr %10, align 1, !tbaa !9, !range !11, !noundef !12
  %12 = trunc nuw i8 %11 to i1
  br i1 %12, label %._crit_edge, label %13

13:                                               ; preds = %.lr.ph.epil
  %14 = getelementptr inbounds [600 x [600 x i64]], ptr @D, i64 0, i64 %0, i64 %.06881.unr
  %15 = load i64, ptr %14, align 8, !tbaa !5
  %16 = icmp slt i64 %15, %.06582.unr
  %spec.select77.epil = select i1 %16, i64 %.06881.unr, i64 %.06083.unr
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.epil, %13, %._crit_edge.unr-lcssa
  %.161.lcssa = phi i64 [ %.161.lcssa.ph, %._crit_edge.unr-lcssa ], [ %.06083.unr, %.lr.ph.epil ], [ %spec.select77.epil, %13 ]
  %17 = icmp eq i64 %.161.lcssa, -1
  br i1 %17, label %._crit_edge.thread, label %35

.lr.ph:                                           ; preds = %33, %.lr.ph.preheader.new
  %.06083 = phi i64 [ -1, %.lr.ph.preheader.new ], [ %.161.1, %33 ]
  %.06582 = phi i64 [ 1000000000000000, %.lr.ph.preheader.new ], [ %.166.1, %33 ]
  %.06881 = phi i64 [ 0, %.lr.ph.preheader.new ], [ %34, %33 ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %33 ]
  %18 = getelementptr inbounds [600 x [600 x i8]], ptr @vis, i64 0, i64 %0, i64 %.06881
  %19 = load i8, ptr %18, align 2, !tbaa !9, !range !11, !noundef !12
  %20 = trunc nuw i8 %19 to i1
  br i1 %20, label %.lr.ph.1, label %21

21:                                               ; preds = %.lr.ph
  %22 = getelementptr inbounds [600 x [600 x i64]], ptr @D, i64 0, i64 %0, i64 %.06881
  %23 = load i64, ptr %22, align 16, !tbaa !5
  %24 = icmp slt i64 %23, %.06582
  %spec.select = call i64 @llvm.smin.i64(i64 %23, i64 %.06582)
  %spec.select77 = select i1 %24, i64 %.06881, i64 %.06083
  br label %.lr.ph.1

.lr.ph.1:                                         ; preds = %21, %.lr.ph
  %.166 = phi i64 [ %.06582, %.lr.ph ], [ %spec.select, %21 ]
  %.161 = phi i64 [ %.06083, %.lr.ph ], [ %spec.select77, %21 ]
  %25 = or disjoint i64 %.06881, 1
  %26 = getelementptr inbounds [600 x [600 x i8]], ptr @vis, i64 0, i64 %0, i64 %25
  %27 = load i8, ptr %26, align 1, !tbaa !9, !range !11, !noundef !12
  %28 = trunc nuw i8 %27 to i1
  br i1 %28, label %33, label %29

29:                                               ; preds = %.lr.ph.1
  %30 = getelementptr inbounds [600 x [600 x i64]], ptr @D, i64 0, i64 %0, i64 %25
  %31 = load i64, ptr %30, align 8, !tbaa !5
  %32 = icmp slt i64 %31, %.166
  %spec.select.1 = call i64 @llvm.smin.i64(i64 %31, i64 %.166)
  %spec.select77.1 = select i1 %32, i64 %25, i64 %.161
  br label %33

33:                                               ; preds = %29, %.lr.ph.1
  %.166.1 = phi i64 [ %.166, %.lr.ph.1 ], [ %spec.select.1, %29 ]
  %.161.1 = phi i64 [ %.161, %.lr.ph.1 ], [ %spec.select77.1, %29 ]
  %34 = add nuw nsw i64 %.06881, 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 %._crit_edge.unr-lcssa, label %.lr.ph, !llvm.loop !13

35:                                               ; preds = %._crit_edge
  %36 = getelementptr inbounds [600 x [600 x i8]], ptr @vis, i64 0, i64 %0, i64 %.161.lcssa
  store i8 1, ptr %36, align 1, !tbaa !9
  %37 = getelementptr inbounds [600 x i64], ptr @mn, i64 0, i64 %.161.lcssa
  %38 = load i64, ptr %37, align 8, !tbaa !5
  %39 = getelementptr inbounds [600 x %"class.std::vector"], ptr @G, i64 0, i64 %.161.lcssa
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %39, i64 noundef %38) #4
  %41 = getelementptr inbounds i8, ptr %40, i64 8
  %42 = load i64, ptr %41, align 8, !tbaa !15
  %43 = getelementptr inbounds [600 x [600 x i64]], ptr @D, i64 0, i64 %0, i64 %.161.lcssa
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %45 = load i64, ptr @N, align 8, !tbaa !5
  %46 = srem i64 %44, %45
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %39, i64 noundef %38) #4
  %48 = load i64, ptr %47, align 8, !tbaa !17
  %49 = add nsw i64 %48, %46
  %50 = load i64, ptr @N, align 8, !tbaa !5
  br label %51

51:                                               ; preds = %51, %35
  %.059 = phi i64 [ %49, %35 ], [ %52, %51 ]
  %.not = icmp slt i64 %.059, %50
  %52 = sub nsw i64 %.059, %50
  br i1 %.not, label %.preheader80, label %51, !llvm.loop !18

.preheader80:                                     ; preds = %51
  %53 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %39) #4
  %.not7390 = icmp slt i64 %53, 1
  br i1 %.not7390, label %.loopexit, label %.lr.ph94

.lr.ph94:                                         ; preds = %.preheader80, %83
  %.05893 = phi i64 [ %84, %83 ], [ 1, %.preheader80 ]
  %.192 = phi i64 [ %.0, %83 ], [ %.059, %.preheader80 ]
  %.06291 = phi i64 [ %.264, %83 ], [ %42, %.preheader80 ]
  %54 = add nsw i64 %.05893, %38
  %55 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %39) #4
  %.not7484 = icmp ult i64 %54, %55
  br i1 %.not7484, label %._crit_edge88, label %.lr.ph87

.lr.ph87:                                         ; preds = %.lr.ph94, %.lr.ph87
  %.05785 = phi i64 [ %57, %.lr.ph87 ], [ %54, %.lr.ph94 ]
  %56 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %39) #4
  %57 = sub i64 %.05785, %56
  %58 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %39) #4
  %.not74 = icmp ult i64 %57, %58
  br i1 %.not74, label %._crit_edge88, label %.lr.ph87, !llvm.loop !19

._crit_edge88:                                    ; preds = %.lr.ph87, %.lr.ph94
  %.057.lcssa = phi i64 [ %54, %.lr.ph94 ], [ %57, %.lr.ph87 ]
  %59 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %39, i64 noundef %.057.lcssa) #4
  %60 = load i64, ptr %59, align 8, !tbaa !17
  %61 = add nsw i64 %60, %46
  %62 = load i64, ptr @N, align 8, !tbaa !5
  br label %63

63:                                               ; preds = %63, %._crit_edge88
  %.0 = phi i64 [ %61, %._crit_edge88 ], [ %64, %63 ]
  %.not75 = icmp slt i64 %.0, %62
  %64 = sub nsw i64 %.0, %62
  br i1 %.not75, label %.preheader, label %63, !llvm.loop !20

.preheader:                                       ; preds = %63, %.preheader
  %.163 = phi i64 [ %70, %.preheader ], [ %.06291, %63 ]
  %.2 = phi i64 [ %spec.store.select, %.preheader ], [ %.192, %63 ]
  %65 = getelementptr inbounds [600 x [600 x i64]], ptr @D, i64 0, i64 %0, i64 %.2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  %66 = load i64, ptr %43, align 8, !tbaa !5
  %67 = add nsw i64 %66, %.163
  store i64 %67, ptr %2, align 8, !tbaa !5
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %65, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %69 = load i64, ptr %68, align 8, !tbaa !5
  store i64 %69, ptr %65, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  %70 = add nsw i64 %.163, 1
  %71 = add nsw i64 %.2, 1
  %72 = load i64, ptr @N, align 8, !tbaa !5
  %73 = icmp eq i64 %71, %72
  %spec.store.select = select i1 %73, i64 0, i64 %71
  %74 = icmp eq i64 %spec.store.select, %.0
  br i1 %74, label %75, label %.preheader, !llvm.loop !21

75:                                               ; preds = %.preheader
  %76 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %39, i64 noundef %.057.lcssa) #4
  %77 = getelementptr inbounds i8, ptr %76, i64 8
  %78 = load i64, ptr %77, align 8, !tbaa !15
  %.not76 = icmp sgt i64 %78, %.163
  br i1 %.not76, label %83, label %79

79:                                               ; preds = %75
  %80 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %39, i64 noundef %.057.lcssa) #4
  %81 = getelementptr inbounds i8, ptr %80, i64 8
  %82 = load i64, ptr %81, align 8, !tbaa !15
  br label %83

83:                                               ; preds = %79, %75
  %.264 = phi i64 [ %82, %79 ], [ %70, %75 ]
  %84 = add nuw nsw i64 %.05893, 1
  %85 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %39) #4
  %.not73.not = icmp slt i64 %.05893, %85
  br i1 %.not73.not, label %.lr.ph94, label %.loopexit, !llvm.loop !22

._crit_edge.thread:                               ; preds = %._crit_edge, %.loopexit, %1
  ret void
}

; 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

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

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

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

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

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

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


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