; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2012-13/Nov 2012/12 Nov G3.ll (Z4testi)

; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<std::pair<char, std::pair<int, int>>, std::allocator<std::pair<char, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<char, std::pair<int, int>>, std::allocator<std::pair<char, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<char, std::pair<int, int>>, std::allocator<std::pair<char, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<char, std::pair<int, int>>, std::allocator<std::pair<char, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.10" = type { ptr }
%"struct.std::pair.8" = type { i8, %"struct.std::pair" }
%"struct.std::pair" = type { i32, i32 }

@ans = external dso_local global i32, align 4
@n = external dso_local global [40001 x i8], align 16
@done = external dso_local global [40001 x i8], align 16
@adj = external dso_local global [40001 x %"class.std::vector"], align 16
@t = external dso_local global [2 x %"class.std::map"], align 16
@todo = external dso_local global %"class.std::vector.3", 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: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4testi(i32 noundef %0) #3 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator.10", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator.10", align 8
  %14 = alloca %"struct.std::pair.8", align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator.10", align 8
  %23 = alloca %"class.__gnu_cxx::__normal_iterator.10", align 8
  %24 = alloca %"struct.std::pair.8", align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %33, %1
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = icmp slt i32 %26, 2
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %25
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [2 x %"class.std::map"], ptr @t, i64 0, i64 %31
  call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %32) #5
  br label %33

33:                                               ; preds = %29
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %3, align 4, !tbaa !5
  br label %25, !llvm.loop !9

36:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds ([2 x %"class.std::map"], ptr @t, i64 0, i64 1), ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i32 0, ptr %37, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  %38 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @t, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i32 0, ptr %38, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [40001 x %"class.std::vector"], ptr @adj, i64 0, i64 %40
  store ptr %41, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %42 = load ptr, ptr %6, align 8, !tbaa !11
  %43 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %42) #5
  %44 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %43, ptr %44, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %45 = load ptr, ptr %6, align 8, !tbaa !11
  %46 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %45) #5
  %47 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %46, ptr %47, align 8
  br label %48

48:                                               ; preds = %173, %36
  %49 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  br i1 %49, label %51, label %50

50:                                               ; preds = %48
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %175

51:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  %53 = load i32, ptr %52, align 4, !tbaa !5
  store i32 %53, ptr %10, align 4, !tbaa !5
  %54 = load i32, ptr %10, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [40001 x i8], ptr @done, i64 0, i64 %55
  %57 = load i8, ptr %56, align 1, !tbaa !13, !range !15, !noundef !16
  %58 = trunc i8 %57 to i1
  br i1 %58, label %172, label %59

59:                                               ; preds = %51
  %60 = load i32, ptr %2, align 4, !tbaa !5
  %61 = load i32, ptr %10, align 4, !tbaa !5
  call void @_Z4dfs3iiiii(i32 noundef %60, i32 noundef %61, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store ptr @todo, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %62 = call ptr @_ZNSt6vectorISt4pairIcS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @todo) #5
  %63 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.10", ptr %12, i32 0, i32 0
  store ptr %62, ptr %63, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %64 = call ptr @_ZNSt6vectorISt4pairIcS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @todo) #5
  %65 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.10", ptr %13, i32 0, i32 0
  store ptr %64, ptr %65, align 8
  br label %66

66:                                               ; preds = %130, %59
  %67 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIcS1_IiiEESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  br i1 %67, label %69, label %68

68:                                               ; preds = %66
  store i32 7, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %132

69:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #5
  %70 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIcS1_IiiEESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %70, i64 12, i1 false)
  %71 = getelementptr inbounds %"struct.std::pair.8", ptr %14, i32 0, i32 0
  %72 = load i8, ptr %71, align 4, !tbaa !17
  %73 = sext i8 %72 to i32
  %74 = icmp eq i32 %73, 40
  br i1 %74, label %75, label %102

75:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %76 = getelementptr inbounds %"struct.std::pair.8", ptr %14, i32 0, i32 1
  %77 = getelementptr inbounds %"struct.std::pair", ptr %76, i32 0, i32 0
  %78 = load i32, ptr %77, align 4, !tbaa !20
  %79 = load i32, ptr %2, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [40001 x i8], ptr @n, i64 0, i64 %80
  %82 = load i8, ptr %81, align 1, !tbaa !21
  %83 = sext i8 %82 to i32
  %84 = icmp eq i32 %83, 40
  %85 = zext i1 %84 to i64
  %86 = select i1 %84, i32 1, i32 -1
  %87 = add nsw i32 %78, %86
  store i32 %87, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %88 = load i32, ptr %15, align 4, !tbaa !5
  %89 = sub nsw i32 0, %88
  store i32 %89, ptr %16, align 4, !tbaa !5
  %90 = call noundef i64 @_ZNKSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds ([2 x %"class.std::map"], ptr @t, i64 0, i64 1), ptr noundef nonnull align 4 dereferenceable(4) %16)
  %91 = icmp ne i64 %90, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br i1 %91, label %92, label %101

92:                                               ; preds = %75
  %93 = getelementptr inbounds %"struct.std::pair.8", ptr %14, i32 0, i32 1
  %94 = getelementptr inbounds %"struct.std::pair", ptr %93, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %95 = load i32, ptr %15, align 4, !tbaa !5
  %96 = sub nsw i32 0, %95
  store i32 %96, ptr %17, align 4, !tbaa !5
  %97 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds ([2 x %"class.std::map"], ptr @t, i64 0, i64 1), ptr noundef nonnull align 4 dereferenceable(4) %17)
  %98 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %94, ptr noundef nonnull align 4 dereferenceable(4) %97)
  %99 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @ans, ptr noundef nonnull align 4 dereferenceable(4) %98)
  %100 = load i32, ptr %99, align 4, !tbaa !5
  store i32 %100, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %101

101:                                              ; preds = %92, %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %129

102:                                              ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %103 = getelementptr inbounds %"struct.std::pair.8", ptr %14, i32 0, i32 1
  %104 = getelementptr inbounds %"struct.std::pair", ptr %103, i32 0, i32 0
  %105 = load i32, ptr %104, align 4, !tbaa !20
  %106 = load i32, ptr %2, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [40001 x i8], ptr @n, i64 0, i64 %107
  %109 = load i8, ptr %108, align 1, !tbaa !21
  %110 = sext i8 %109 to i32
  %111 = icmp eq i32 %110, 40
  %112 = zext i1 %111 to i64
  %113 = select i1 %111, i32 1, i32 -1
  %114 = add nsw i32 %105, %113
  store i32 %114, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %115 = load i32, ptr %18, align 4, !tbaa !5
  %116 = sub nsw i32 0, %115
  store i32 %116, ptr %19, align 4, !tbaa !5
  %117 = call noundef i64 @_ZNKSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48) @t, ptr noundef nonnull align 4 dereferenceable(4) %19)
  %118 = icmp ne i64 %117, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br i1 %118, label %119, label %128

119:                                              ; preds = %102
  %120 = getelementptr inbounds %"struct.std::pair.8", ptr %14, i32 0, i32 1
  %121 = getelementptr inbounds %"struct.std::pair", ptr %120, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %122 = load i32, ptr %18, align 4, !tbaa !5
  %123 = sub nsw i32 0, %122
  store i32 %123, ptr %20, align 4, !tbaa !5
  %124 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @t, ptr noundef nonnull align 4 dereferenceable(4) %20)
  %125 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %121, ptr noundef nonnull align 4 dereferenceable(4) %124)
  %126 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @ans, ptr noundef nonnull align 4 dereferenceable(4) %125)
  %127 = load i32, ptr %126, align 4, !tbaa !5
  store i32 %127, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %128

128:                                              ; preds = %119, %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %129

129:                                              ; preds = %128, %101
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #5
  br label %130

130:                                              ; preds = %129
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIcS1_IiiEESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  br label %66

132:                                              ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  store ptr @todo, ptr %21, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %133 = call ptr @_ZNSt6vectorISt4pairIcS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @todo) #5
  %134 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.10", ptr %22, i32 0, i32 0
  store ptr %133, ptr %134, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %135 = call ptr @_ZNSt6vectorISt4pairIcS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @todo) #5
  %136 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.10", ptr %23, i32 0, i32 0
  store ptr %135, ptr %136, align 8
  br label %137

137:                                              ; preds = %169, %132
  %138 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIcS1_IiiEESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23) #5
  br i1 %138, label %140, label %139

139:                                              ; preds = %137
  store i32 9, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %171

140:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #5
  %141 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIcS1_IiiEESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 4 %141, i64 12, i1 false)
  %142 = getelementptr inbounds %"struct.std::pair.8", ptr %24, i32 0, i32 0
  %143 = load i8, ptr %142, align 4, !tbaa !17
  %144 = sext i8 %143 to i32
  %145 = icmp eq i32 %144, 40
  br i1 %145, label %146, label %157

146:                                              ; preds = %140
  %147 = getelementptr inbounds %"struct.std::pair.8", ptr %24, i32 0, i32 1
  %148 = getelementptr inbounds %"struct.std::pair", ptr %147, i32 0, i32 0
  %149 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @t, ptr noundef nonnull align 4 dereferenceable(4) %148)
  %150 = getelementptr inbounds %"struct.std::pair.8", ptr %24, i32 0, i32 1
  %151 = getelementptr inbounds %"struct.std::pair", ptr %150, i32 0, i32 1
  %152 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %149, ptr noundef nonnull align 4 dereferenceable(4) %151)
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = getelementptr inbounds %"struct.std::pair.8", ptr %24, i32 0, i32 1
  %155 = getelementptr inbounds %"struct.std::pair", ptr %154, i32 0, i32 0
  %156 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @t, ptr noundef nonnull align 4 dereferenceable(4) %155)
  store i32 %153, ptr %156, align 4, !tbaa !5
  br label %168

157:                                              ; preds = %140
  %158 = getelementptr inbounds %"struct.std::pair.8", ptr %24, i32 0, i32 1
  %159 = getelementptr inbounds %"struct.std::pair", ptr %158, i32 0, i32 0
  %160 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds ([2 x %"class.std::map"], ptr @t, i64 0, i64 1), ptr noundef nonnull align 4 dereferenceable(4) %159)
  %161 = getelementptr inbounds %"struct.std::pair.8", ptr %24, i32 0, i32 1
  %162 = getelementptr inbounds %"struct.std::pair", ptr %161, i32 0, i32 1
  %163 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %160, ptr noundef nonnull align 4 dereferenceable(4) %162)
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = getelementptr inbounds %"struct.std::pair.8", ptr %24, i32 0, i32 1
  %166 = getelementptr inbounds %"struct.std::pair", ptr %165, i32 0, i32 0
  %167 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds ([2 x %"class.std::map"], ptr @t, i64 0, i64 1), ptr noundef nonnull align 4 dereferenceable(4) %166)
  store i32 %164, ptr %167, align 4, !tbaa !5
  br label %168

168:                                              ; preds = %157, %146
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #5
  br label %169

169:                                              ; preds = %168
  %170 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIcS1_IiiEESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #5
  br label %137

171:                                              ; preds = %139
  call void @_ZNSt6vectorISt4pairIcS0_IiiEESaIS2_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @todo) #5
  br label %172

172:                                              ; preds = %171, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %173

173:                                              ; preds = %172
  %174 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  br label %48

175:                                              ; preds = %50
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!18, !7, i64 0}
!18 = !{!"_ZTSSt4pairIcS_IiiEE", !7, i64 0, !19, i64 4}
!19 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!20 = !{!18, !6, i64 4}
!21 = !{!7, !7, i64 0}


; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<std::pair<char, std::pair<int, int>>, std::allocator<std::pair<char, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<char, std::pair<int, int>>, std::allocator<std::pair<char, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<char, std::pair<int, int>>, std::allocator<std::pair<char, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<char, std::pair<int, int>>, std::allocator<std::pair<char, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.10" = type { ptr }
%"struct.std::pair.8" = type { i8, %"struct.std::pair" }
%"struct.std::pair" = type { i32, i32 }

@ans = external dso_local global i32, align 4
@n = external dso_local local_unnamed_addr global [40001 x i8], align 16
@done = external dso_local local_unnamed_addr global [40001 x i8], align 16
@adj = external dso_local global [40001 x %"class.std::vector"], align 16
@t = external dso_local global [2 x %"class.std::map"], align 16
@todo = external dso_local global %"class.std::vector.3", 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 nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

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

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

; 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4testi(i32 noundef %0) local_unnamed_addr #3 {
  %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 %"class.__gnu_cxx::__normal_iterator.10", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator.10", align 8
  %8 = alloca %"struct.std::pair.8", align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.__gnu_cxx::__normal_iterator.10", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator.10", align 8
  %15 = alloca %"struct.std::pair.8", align 4
  tail call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @t) #5
  tail call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @t, i64 48)) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  %16 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @t, i64 48), ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i32 0, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  %17 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @t, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i32 0, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  %18 = sext i32 %0 to i64
  %19 = getelementptr inbounds [40001 x %"class.std::vector"], ptr @adj, i64 0, i64 %18
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %20 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  store ptr %20, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %21 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  store ptr %21, ptr %5, align 8
  %22 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br i1 %22, label %.lr.ph23, label %._crit_edge24

.lr.ph23:                                         ; preds = %1
  %23 = getelementptr inbounds i8, ptr %8, i64 4
  %24 = getelementptr inbounds [40001 x i8], ptr @n, i64 0, i64 %18
  %25 = getelementptr inbounds i8, ptr %8, i64 8
  %26 = getelementptr inbounds i8, ptr %15, i64 4
  %27 = getelementptr inbounds i8, ptr %15, i64 8
  br label %28

._crit_edge24:                                    ; preds = %74, %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  ret void

28:                                               ; preds = %.lr.ph23, %74
  %29 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [40001 x i8], ptr @done, i64 0, i64 %31
  %33 = load i8, ptr %32, align 1, !tbaa !9, !range !11, !noundef !12
  %34 = trunc nuw i8 %33 to i1
  br i1 %34, label %74, label %35

35:                                               ; preds = %28
  call void @_Z4dfs3iiiii(i32 noundef %0, i32 noundef %30, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %36 = call ptr @_ZNSt6vectorISt4pairIcS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @todo) #5
  store ptr %36, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %37 = call ptr @_ZNSt6vectorISt4pairIcS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @todo) #5
  store ptr %37, ptr %7, align 8
  %38 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIcS1_IiiEESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  br i1 %38, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %62, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  %39 = call ptr @_ZNSt6vectorISt4pairIcS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @todo) #5
  store ptr %39, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %40 = call ptr @_ZNSt6vectorISt4pairIcS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @todo) #5
  store ptr %40, ptr %14, align 8
  %41 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIcS1_IiiEESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  br i1 %41, label %.lr.ph20, label %._crit_edge21

.lr.ph:                                           ; preds = %35, %62
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #5
  %42 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIcS1_IiiEESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %42, i64 12, i1 false)
  %43 = load i8, ptr %8, align 4, !tbaa !13
  %44 = icmp eq i8 %43, 40
  %45 = load i32, ptr %23, align 4, !tbaa !16
  %46 = load i8, ptr %24, align 1, !tbaa !17
  %47 = icmp eq i8 %46, 40
  %.neg15 = select i1 %47, i32 -1, i32 1
  %.neg16 = sub i32 %.neg15, %45
  br i1 %44, label %48, label %55

48:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #5
  store i32 %.neg16, ptr %9, align 4, !tbaa !5
  %49 = call noundef i64 @_ZNKSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @t, i64 48), ptr noundef nonnull align 4 dereferenceable(4) %9)
  %.not17 = icmp eq i64 %49, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  br i1 %.not17, label %62, label %50

50:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #5
  store i32 %.neg16, ptr %10, align 4, !tbaa !5
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds (i8, ptr @t, i64 48), ptr noundef nonnull align 4 dereferenceable(4) %10)
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %51)
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @ans, ptr noundef nonnull align 4 dereferenceable(4) %52)
  %54 = load i32, ptr %53, align 4, !tbaa !5
  store i32 %54, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  br label %62

55:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #5
  store i32 %.neg16, ptr %11, align 4, !tbaa !5
  %56 = call noundef i64 @_ZNKSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48) @t, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %.not = icmp eq i64 %56, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  br i1 %.not, label %62, label %57

57:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #5
  store i32 %.neg16, ptr %12, align 4, !tbaa !5
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @t, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %58)
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @ans, ptr noundef nonnull align 4 dereferenceable(4) %59)
  %61 = load i32, ptr %60, align 4, !tbaa !5
  store i32 %61, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  br label %62

62:                                               ; preds = %55, %57, %48, %50
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #5
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIcS1_IiiEESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %64 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIcS1_IiiEESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  br i1 %64, label %.lr.ph, label %._crit_edge

._crit_edge21:                                    ; preds = %.lr.ph20, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  call void @_ZNSt6vectorISt4pairIcS0_IiiEESaIS2_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @todo) #5
  br label %74

.lr.ph20:                                         ; preds = %._crit_edge, %.lr.ph20
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %15) #5
  %65 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIcS1_IiiEESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %15, ptr noundef nonnull align 4 dereferenceable(12) %65, i64 12, i1 false)
  %66 = load i8, ptr %15, align 4, !tbaa !13
  %67 = icmp eq i8 %66, 40
  %t. = select i1 %67, ptr @t, ptr getelementptr inbounds (i8, ptr @t, i64 48)
  %68 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %t., ptr noundef nonnull align 4 dereferenceable(4) %26)
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %68, ptr noundef nonnull align 4 dereferenceable(4) %27)
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %t., ptr noundef nonnull align 4 dereferenceable(4) %26)
  store i32 %70, ptr %71, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #5
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIcS1_IiiEESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  %73 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIcS1_IiiEESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  br i1 %73, label %.lr.ph20, label %._crit_edge21

74:                                               ; preds = %._crit_edge21, %28
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %76 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br i1 %76, label %28, label %._crit_edge24
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !7, i64 0}
!14 = !{!"_ZTSSt4pairIcS_IiiEE", !7, i64 0, !15, i64 4}
!15 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!16 = !{!14, !6, i64 4}
!17 = !{!7, !7, i64 0}


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