; LLVM IR from vmartinv/eldiego :: flow/konig.ll (Z6koningv)

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

@nodes = external dso_local global i32, align 4
@g = external dso_local global [2200 x %"class.std::vector"], align 16
@match = external dso_local global [2200 x i32], align 16
@s = external dso_local global [2200 x i32], align 16
@kq = external dso_local global %"class.std::queue", align 8

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z6koningv() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %23, %0
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = load i32, ptr @nodes, align 4, !tbaa !5
  %13 = sub nsw i32 %12, 2
  %14 = icmp slt i32 %11, %13
  br i1 %14, label %16, label %15

15:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  br label %26

16:                                               ; preds = %10
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [2200 x i32], ptr @match, i64 0, i64 %18
  store i32 -1, ptr %19, align 4, !tbaa !5
  %20 = load i32, ptr %1, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [2200 x i32], ptr @s, i64 0, i64 %21
  store i32 -1, ptr %22, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %16
  %24 = load i32, ptr %1, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %1, align 4, !tbaa !5
  br label %10, !llvm.loop !9

26:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %76, %26
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = load i32, ptr @nodes, align 4, !tbaa !5
  %30 = sub nsw i32 %29, 2
  %31 = icmp slt i32 %28, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %27
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %79

33:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [2200 x %"class.std::vector"], ptr @g, i64 0, i64 %35
  %37 = call ptr @_ZNSt6vectorI4EdgeSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #4
  %38 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  store ptr %37, ptr %38, align 8
  br label %39

39:                                               ; preds = %73, %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [2200 x %"class.std::vector"], ptr @g, i64 0, i64 %41
  %43 = call ptr @_ZNSt6vectorI4EdgeSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %42) #4
  %44 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  store ptr %43, ptr %44, align 8
  %45 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4EdgeSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br i1 %45, label %47, label %46

46:                                               ; preds = %39
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  br label %75

47:                                               ; preds = %39
  %48 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4EdgeSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  %49 = getelementptr inbounds %struct.Edge, ptr %48, i32 0, i32 0
  %50 = load i32, ptr %49, align 8, !tbaa !11
  %51 = load i32, ptr @nodes, align 4, !tbaa !5
  %52 = sub nsw i32 %51, 2
  %53 = icmp slt i32 %50, %52
  br i1 %53, label %54, label %72

54:                                               ; preds = %47
  %55 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4EdgeSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  %56 = getelementptr inbounds %struct.Edge, ptr %55, i32 0, i32 2
  %57 = load i64, ptr %56, align 8, !tbaa !14
  %58 = icmp sgt i64 %57, 0
  br i1 %58, label %59, label %72

59:                                               ; preds = %54
  %60 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4EdgeSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  %61 = getelementptr inbounds %struct.Edge, ptr %60, i32 0, i32 0
  %62 = load i32, ptr %61, align 8, !tbaa !11
  %63 = load i32, ptr %2, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [2200 x i32], ptr @match, i64 0, i64 %64
  store i32 %62, ptr %65, align 4, !tbaa !5
  %66 = load i32, ptr %2, align 4, !tbaa !5
  %67 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4EdgeSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  %68 = getelementptr inbounds %struct.Edge, ptr %67, i32 0, i32 0
  %69 = load i32, ptr %68, align 8, !tbaa !11
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [2200 x i32], ptr @match, i64 0, i64 %70
  store i32 %66, ptr %71, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %59, %54, %47
  br label %73

73:                                               ; preds = %72
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4EdgeSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  br label %39, !llvm.loop !15

75:                                               ; preds = %46
  br label %76

76:                                               ; preds = %75
  %77 = load i32, ptr %2, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %2, align 4, !tbaa !5
  br label %27, !llvm.loop !16

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

80:                                               ; preds = %97, %79
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = load i32, ptr @nodes, align 4, !tbaa !5
  %83 = sub nsw i32 %82, 2
  %84 = icmp slt i32 %81, %83
  br i1 %84, label %86, label %85

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

86:                                               ; preds = %80
  %87 = load i32, ptr %6, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [2200 x i32], ptr @match, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = icmp eq i32 %90, -1
  br i1 %91, label %92, label %96

92:                                               ; preds = %86
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [2200 x i32], ptr @s, i64 0, i64 %94
  store i32 0, ptr %95, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @kq, ptr noundef nonnull align 4 dereferenceable(4) %6)
  br label %96

96:                                               ; preds = %92, %86
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %6, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %6, align 4, !tbaa !5
  br label %80, !llvm.loop !17

100:                                              ; preds = %85
  br label %101

101:                                              ; preds = %174, %100
  %102 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @kq)
  %103 = xor i1 %102, true
  br i1 %103, label %104, label %175

104:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) @kq)
  %106 = load i32, ptr %105, align 4, !tbaa !5
  store i32 %106, ptr %7, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @kq)
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [2200 x i32], ptr @s, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = srem i32 %110, 2
  %112 = icmp eq i32 %111, 1
  br i1 %112, label %113, label %128

113:                                              ; preds = %104
  %114 = load i32, ptr %7, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [2200 x i32], ptr @s, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  %119 = load i32, ptr %7, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [2200 x i32], ptr @match, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [2200 x i32], ptr @s, i64 0, i64 %123
  store i32 %118, ptr %124, align 4, !tbaa !5
  %125 = load i32, ptr %7, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [2200 x i32], ptr @match, i64 0, i64 %126
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @kq, ptr noundef nonnull align 4 dereferenceable(4) %127)
  br label %174

128:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %129 = load i32, ptr %7, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [2200 x %"class.std::vector"], ptr @g, i64 0, i64 %130
  %132 = call ptr @_ZNSt6vectorI4EdgeSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %131) #4
  %133 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %132, ptr %133, align 8
  br label %134

134:                                              ; preds = %171, %128
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %135 = load i32, ptr %7, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [2200 x %"class.std::vector"], ptr @g, i64 0, i64 %136
  %138 = call ptr @_ZNSt6vectorI4EdgeSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %137) #4
  %139 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %138, ptr %139, align 8
  %140 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4EdgeSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br i1 %140, label %142, label %141

141:                                              ; preds = %134
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %173

142:                                              ; preds = %134
  %143 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4EdgeSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  %144 = getelementptr inbounds %struct.Edge, ptr %143, i32 0, i32 0
  %145 = load i32, ptr %144, align 8, !tbaa !11
  %146 = load i32, ptr @nodes, align 4, !tbaa !5
  %147 = sub nsw i32 %146, 2
  %148 = icmp slt i32 %145, %147
  br i1 %148, label %149, label %170

149:                                              ; preds = %142
  %150 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4EdgeSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  %151 = getelementptr inbounds %struct.Edge, ptr %150, i32 0, i32 0
  %152 = load i32, ptr %151, align 8, !tbaa !11
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [2200 x i32], ptr @s, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = icmp eq i32 %155, -1
  br i1 %156, label %157, label %170

157:                                              ; preds = %149
  %158 = load i32, ptr %7, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [2200 x i32], ptr @s, i64 0, i64 %159
  %161 = load i32, ptr %160, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  %163 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4EdgeSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  %164 = getelementptr inbounds %struct.Edge, ptr %163, i32 0, i32 0
  %165 = load i32, ptr %164, align 8, !tbaa !11
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [2200 x i32], ptr @s, i64 0, i64 %166
  store i32 %162, ptr %167, align 4, !tbaa !5
  %168 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4EdgeSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  %169 = getelementptr inbounds %struct.Edge, ptr %168, i32 0, i32 0
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @kq, ptr noundef nonnull align 4 dereferenceable(4) %169)
  br label %170

170:                                              ; preds = %157, %149, %142
  br label %171

171:                                              ; preds = %170
  %172 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4EdgeSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  br label %134, !llvm.loop !18

173:                                              ; preds = %141
  br label %174

174:                                              ; preds = %173, %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %101, !llvm.loop !19

175:                                              ; preds = %101
  ret void
}

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

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

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

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

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4, !13, i64 8, !13, i64 16}
!13 = !{!"long long", !7, i64 0}
!14 = !{!12, !13, i64 8}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


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

@nodes = external dso_local local_unnamed_addr global i32, align 4
@g = external dso_local global [2200 x %"class.std::vector"], align 16
@match = external dso_local global [2200 x i32], align 16
@s = external dso_local local_unnamed_addr global [2200 x i32], align 16
@kq = external dso_local global %"class.std::queue", align 8

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z6koningv() local_unnamed_addr #1 {
  %1 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %2 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %3 = alloca i32, align 4
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = load i32, ptr @nodes, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 2
  br i1 %7, label %.lr.ph22.preheader, label %._crit_edge23.thread

._crit_edge23.thread:                             ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  br label %._crit_edge27

.lr.ph22.preheader:                               ; preds = %0
  %8 = add nsw i32 %6, -2
  %9 = zext nneg i32 %8 to i64
  %10 = shl nuw nsw i64 %9, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @match, i8 -1, i64 %10, i1 false), !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @s, i8 -1, i64 %10, i1 false), !tbaa !5
  br label %.lr.ph22

._crit_edge23:                                    ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  %11 = icmp sgt i32 %18, 2
  br i1 %11, label %.lr.ph26, label %._crit_edge27

.lr.ph22:                                         ; preds = %.lr.ph22.preheader, %._crit_edge
  %indvars.iv = phi i64 [ 0, %.lr.ph22.preheader ], [ %indvars.iv.next, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %12 = getelementptr inbounds [2200 x %"class.std::vector"], ptr @g, i64 0, i64 %indvars.iv
  %13 = call ptr @_ZNSt6vectorI4EdgeSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  store ptr %13, ptr %1, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %14 = call ptr @_ZNSt6vectorI4EdgeSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  store ptr %14, ptr %2, align 8
  %15 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4EdgeSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  br i1 %15, label %.lr.ph20, label %._crit_edge

.lr.ph20:                                         ; preds = %.lr.ph22
  %16 = getelementptr inbounds [2200 x i32], ptr @match, i64 0, i64 %indvars.iv
  %17 = trunc nuw nsw i64 %indvars.iv to i32
  br label %22

._crit_edge:                                      ; preds = %40, %.lr.ph22
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = load i32, ptr @nodes, align 4, !tbaa !5
  %19 = add nsw i32 %18, -2
  %20 = sext i32 %19 to i64
  %21 = icmp slt i64 %indvars.iv.next, %20
  br i1 %21, label %.lr.ph22, label %._crit_edge23, !llvm.loop !9

22:                                               ; preds = %.lr.ph20, %40
  %23 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4EdgeSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #5
  %24 = load i32, ptr %23, align 8, !tbaa !11
  %25 = load i32, ptr @nodes, align 4, !tbaa !5
  %26 = add nsw i32 %25, -2
  %27 = icmp slt i32 %24, %26
  br i1 %27, label %28, label %40

28:                                               ; preds = %22
  %29 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4EdgeSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #5
  %30 = getelementptr inbounds i8, ptr %29, i64 8
  %31 = load i64, ptr %30, align 8, !tbaa !14
  %32 = icmp sgt i64 %31, 0
  br i1 %32, label %33, label %40

33:                                               ; preds = %28
  %34 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4EdgeSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #5
  %35 = load i32, ptr %34, align 8, !tbaa !11
  store i32 %35, ptr %16, align 4, !tbaa !5
  %36 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4EdgeSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #5
  %37 = load i32, ptr %36, align 8, !tbaa !11
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [2200 x i32], ptr @match, i64 0, i64 %38
  store i32 %17, ptr %39, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %22, %28, %33
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4EdgeSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %42 = call ptr @_ZNSt6vectorI4EdgeSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  store ptr %42, ptr %2, align 8
  %43 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4EdgeSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  br i1 %43, label %22, label %._crit_edge, !llvm.loop !15

._crit_edge27:                                    ; preds = %52, %._crit_edge23.thread, %._crit_edge23
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  %44 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @kq)
  br i1 %44, label %._crit_edge33, label %.lr.ph32

.lr.ph26:                                         ; preds = %._crit_edge23, %52
  %45 = phi i32 [ %53, %52 ], [ %18, %._crit_edge23 ]
  %storemerge24 = phi i32 [ %55, %52 ], [ 0, %._crit_edge23 ]
  %46 = sext i32 %storemerge24 to i64
  %47 = getelementptr inbounds [2200 x i32], ptr @match, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = icmp eq i32 %48, -1
  br i1 %49, label %50, label %52

50:                                               ; preds = %.lr.ph26
  %51 = getelementptr inbounds [2200 x i32], ptr @s, i64 0, i64 %46
  store i32 0, ptr %51, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @kq, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %.pre = load i32, ptr %3, align 4, !tbaa !5
  %.pre36 = load i32, ptr @nodes, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %.lr.ph26, %50
  %53 = phi i32 [ %45, %.lr.ph26 ], [ %.pre36, %50 ]
  %54 = phi i32 [ %storemerge24, %.lr.ph26 ], [ %.pre, %50 ]
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %3, align 4, !tbaa !5
  %56 = add nsw i32 %53, -2
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %.lr.ph26, label %._crit_edge27, !llvm.loop !16

.lr.ph32:                                         ; preds = %._crit_edge27, %100
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) @kq)
  %59 = load i32, ptr %58, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @kq)
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [2200 x i32], ptr @s, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = and i32 %62, -2147483647
  %64 = icmp eq i32 %63, 1
  br i1 %64, label %65, label %71

65:                                               ; preds = %.lr.ph32
  %66 = add nuw nsw i32 %62, 1
  %67 = getelementptr inbounds [2200 x i32], ptr @match, i64 0, i64 %60
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [2200 x i32], ptr @s, i64 0, i64 %69
  store i32 %66, ptr %70, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @kq, ptr noundef nonnull align 4 dereferenceable(4) %67)
  br label %100

71:                                               ; preds = %.lr.ph32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %72 = getelementptr inbounds [2200 x %"class.std::vector"], ptr @g, i64 0, i64 %60
  %73 = call ptr @_ZNSt6vectorI4EdgeSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %72) #5
  store ptr %73, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %74 = call ptr @_ZNSt6vectorI4EdgeSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %72) #5
  store ptr %74, ptr %5, align 8
  %75 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4EdgeSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br i1 %75, label %.lr.ph29, label %._crit_edge30

._crit_edge30:                                    ; preds = %96, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %100

.lr.ph29:                                         ; preds = %71, %96
  %76 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4EdgeSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %77 = load i32, ptr %76, align 8, !tbaa !11
  %78 = load i32, ptr @nodes, align 4, !tbaa !5
  %79 = add nsw i32 %78, -2
  %80 = icmp slt i32 %77, %79
  br i1 %80, label %81, label %96

81:                                               ; preds = %.lr.ph29
  %82 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4EdgeSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %83 = load i32, ptr %82, align 8, !tbaa !11
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [2200 x i32], ptr @s, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = icmp eq i32 %86, -1
  br i1 %87, label %88, label %96

88:                                               ; preds = %81
  %89 = load i32, ptr %61, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  %91 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4EdgeSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %92 = load i32, ptr %91, align 8, !tbaa !11
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [2200 x i32], ptr @s, i64 0, i64 %93
  store i32 %90, ptr %94, align 4, !tbaa !5
  %95 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4EdgeSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @kq, ptr noundef nonnull align 4 dereferenceable(4) %95)
  br label %96

96:                                               ; preds = %.lr.ph29, %81, %88
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4EdgeSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %98 = call ptr @_ZNSt6vectorI4EdgeSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %72) #5
  store ptr %98, ptr %5, align 8
  %99 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4EdgeSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br i1 %99, label %.lr.ph29, label %._crit_edge30, !llvm.loop !17

100:                                              ; preds = %._crit_edge30, %65
  %101 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @kq)
  br i1 %101, label %._crit_edge33, label %.lr.ph32, !llvm.loop !18

._crit_edge33:                                    ; preds = %100, %._crit_edge27
  ret void
}

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

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

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

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

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

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4, !13, i64 8, !13, i64 16}
!13 = !{!"long long", !7, i64 0}
!14 = !{!12, !13, i64 8}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}


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