; LLVM IR from ADJA/algos :: Graphs (DijkstraSet)

; 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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<long long, int>, std::pair<long long, int>, std::_Identity<std::pair<long long, int>>, std::less<std::pair<long long, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long long, int>, std::pair<long long, int>, std::_Identity<std::pair<long long, int>>, std::less<std::pair<long long, 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<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 }
%struct.edge = type { i32, i32 }
%"struct.std::pair.8" = type <{ i64, i32, [4 x i8] }>
%"struct.std::pair.11" = type { i32, i32 }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@g = external dso_local global [105000 x %"class.std::vector"], align 16
@dist = external dso_local global [105000 x i64], align 16
@par = external dso_local global [105000 x i32], align 16
@s = external dso_local global %"class.std::set", align 8
@ans = external dso_local global %"class.std::vector.3", align 8
@e = external dso_local global %struct.edge, align 4
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@_ZL3INF = external hidden constant i64, align 8
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair.8", align 8
  %7 = alloca %"struct.std::pair.11", align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair.8", align 8
  %13 = alloca { i64, i32 }, align 8
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %17 = alloca i64, align 8
  %18 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %19 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca %"struct.std::pair.8", align 8
  %25 = alloca { i64, i32 }, align 8
  %26 = alloca %"struct.std::pair.8", align 8
  %27 = alloca { i64, i32 }, align 8
  %28 = alloca %"struct.std::pair", align 8
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %32 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %33 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %51, %0
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = load i32, ptr @m, align 4, !tbaa !5
  %38 = icmp sle i32 %36, %37
  br i1 %38, label %40, label %39

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

40:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef %3, ptr noundef %4, ptr noundef %5)
  %42 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %42, ptr @e, align 4, !tbaa !9
  %43 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %43, ptr getelementptr inbounds (%struct.edge, ptr @e, i32 0, i32 1), align 4, !tbaa !11
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [105000 x %"class.std::vector"], ptr @g, i64 0, i64 %45
  call void @_ZNSt6vectorI4edgeSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %46, ptr noundef nonnull align 4 dereferenceable(8) @e)
  %47 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %47, ptr @e, align 4, !tbaa !9
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [105000 x %"class.std::vector"], ptr @g, i64 0, i64 %49
  call void @_ZNSt6vectorI4edgeSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %50, ptr noundef nonnull align 4 dereferenceable(8) @e)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %51

51:                                               ; preds = %40
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %2, align 4, !tbaa !5
  br label %35, !llvm.loop !12

54:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 1, ptr %9, align 4, !tbaa !5
  %55 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  store i64 %55, ptr %7, align 4
  call void @_ZNSt4pairIxiEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(8) %7)
  %56 = call { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @s, ptr noundef nonnull align 8 dereferenceable(12) %6)
  %57 = getelementptr inbounds { ptr, i8 }, ptr %10, i32 0, i32 0
  %58 = extractvalue { ptr, i8 } %56, 0
  store ptr %58, ptr %57, align 8
  %59 = getelementptr inbounds { ptr, i8 }, ptr %10, i32 0, i32 1
  %60 = extractvalue { ptr, i8 } %56, 1
  store i8 %60, ptr %59, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 2, ptr %11, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %76, %54
  %62 = load i32, ptr %11, align 4, !tbaa !5
  %63 = load i32, ptr @n, align 4, !tbaa !5
  %64 = icmp sle i32 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %79

66:                                               ; preds = %61
  %67 = load i32, ptr %11, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [105000 x i64], ptr @dist, i64 0, i64 %68
  store i64 1000000000000, ptr %69, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #7
  %70 = call { i64, i32 } @_ZSt9make_pairIRKxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr noundef nonnull align 8 dereferenceable(8) @_ZL3INF, ptr noundef nonnull align 4 dereferenceable(4) %11)
  store { i64, i32 } %70, ptr %13, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %13, i64 12, i1 false)
  %71 = call { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @s, ptr noundef nonnull align 8 dereferenceable(12) %12)
  %72 = getelementptr inbounds { ptr, i8 }, ptr %14, i32 0, i32 0
  %73 = extractvalue { ptr, i8 } %71, 0
  store ptr %73, ptr %72, align 8
  %74 = getelementptr inbounds { ptr, i8 }, ptr %14, i32 0, i32 1
  %75 = extractvalue { ptr, i8 } %71, 1
  store i8 %75, ptr %74, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  br label %76

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

79:                                               ; preds = %65
  br label %80

80:                                               ; preds = %165, %79
  %81 = call noundef zeroext i1 @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) @s) #7
  %82 = xor i1 %81, true
  br i1 %82, label %83, label %166

83:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %84 = call ptr @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @s) #7
  %85 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %16, i32 0, i32 0
  store ptr %84, ptr %85, align 8
  %86 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  %87 = getelementptr inbounds %"struct.std::pair.8", ptr %86, i32 0, i32 1
  %88 = load i32, ptr %87, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  store i32 %88, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %89 = call ptr @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @s) #7
  %90 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %18, i32 0, i32 0
  store ptr %89, ptr %90, align 8
  %91 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  %92 = getelementptr inbounds %"struct.std::pair.8", ptr %91, i32 0, i32 0
  %93 = load i64, ptr %92, align 8, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  store i64 %93, ptr %17, align 8, !tbaa !14
  %94 = call ptr @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @s) #7
  %95 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %19, i32 0, i32 0
  store ptr %94, ptr %95, align 8
  %96 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %19, i32 0, i32 0
  %97 = load ptr, ptr %96, align 8
  %98 = call ptr @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS1_E(ptr noundef nonnull align 8 dereferenceable(48) @s, ptr %97)
  %99 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %20, i32 0, i32 0
  store ptr %98, ptr %99, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %162, %83
  %101 = load i32, ptr %21, align 4, !tbaa !5
  %102 = load i32, ptr %15, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [105000 x %"class.std::vector"], ptr @g, i64 0, i64 %103
  %105 = call noundef i64 @_ZNKSt6vectorI4edgeSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %104) #7
  %106 = trunc i64 %105 to i32
  %107 = icmp slt i32 %101, %106
  br i1 %107, label %109, label %108

108:                                              ; preds = %100
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %165

109:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %110 = load i32, ptr %15, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [105000 x %"class.std::vector"], ptr @g, i64 0, i64 %111
  %113 = load i32, ptr %21, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %112, i64 noundef %114) #7
  %116 = getelementptr inbounds %struct.edge, ptr %115, i32 0, i32 0
  %117 = load i32, ptr %116, align 4, !tbaa !9
  store i32 %117, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %118 = load i32, ptr %15, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [105000 x %"class.std::vector"], ptr @g, i64 0, i64 %119
  %121 = load i32, ptr %21, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %120, i64 noundef %122) #7
  %124 = getelementptr inbounds %struct.edge, ptr %123, i32 0, i32 1
  %125 = load i32, ptr %124, align 4, !tbaa !11
  store i32 %125, ptr %23, align 4, !tbaa !5
  %126 = load i64, ptr %17, align 8, !tbaa !14
  %127 = load i32, ptr %23, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = add nsw i64 %126, %128
  %130 = load i32, ptr %22, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [105000 x i64], ptr @dist, i64 0, i64 %131
  %133 = load i64, ptr %132, align 8, !tbaa !14
  %134 = icmp slt i64 %129, %133
  br i1 %134, label %135, label %161

135:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #7
  %136 = load i32, ptr %22, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [105000 x i64], ptr @dist, i64 0, i64 %137
  %139 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %138, ptr noundef nonnull align 4 dereferenceable(4) %22)
  store { i64, i32 } %139, ptr %25, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %24, ptr align 8 %25, i64 12, i1 false)
  %140 = call noundef i64 @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5eraseERKS1_(ptr noundef nonnull align 8 dereferenceable(48) @s, ptr noundef nonnull align 8 dereferenceable(12) %24)
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #7
  %141 = load i64, ptr %17, align 8, !tbaa !14
  %142 = load i32, ptr %23, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = add nsw i64 %141, %143
  %145 = load i32, ptr %22, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [105000 x i64], ptr @dist, i64 0, i64 %146
  store i64 %144, ptr %147, align 8, !tbaa !14
  %148 = load i32, ptr %15, align 4, !tbaa !5
  %149 = load i32, ptr %22, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [105000 x i32], ptr @par, i64 0, i64 %150
  store i32 %148, ptr %151, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #7
  %152 = load i32, ptr %22, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [105000 x i64], ptr @dist, i64 0, i64 %153
  %155 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %154, ptr noundef nonnull align 4 dereferenceable(4) %22)
  store { i64, i32 } %155, ptr %27, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %26, ptr align 8 %27, i64 12, i1 false)
  %156 = call { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @s, ptr noundef nonnull align 8 dereferenceable(12) %26)
  %157 = getelementptr inbounds { ptr, i8 }, ptr %28, i32 0, i32 0
  %158 = extractvalue { ptr, i8 } %156, 0
  store ptr %158, ptr %157, align 8
  %159 = getelementptr inbounds { ptr, i8 }, ptr %28, i32 0, i32 1
  %160 = extractvalue { ptr, i8 } %156, 1
  store i8 %160, ptr %159, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #7
  br label %161

161:                                              ; preds = %135, %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %162

162:                                              ; preds = %161
  %163 = load i32, ptr %21, align 4, !tbaa !5
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %21, align 4, !tbaa !5
  br label %100, !llvm.loop !20

165:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %80, !llvm.loop !21

166:                                              ; preds = %80
  %167 = load i32, ptr @n, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [105000 x i64], ptr @dist, i64 0, i64 %168
  %170 = load i64, ptr %169, align 8, !tbaa !14
  %171 = icmp eq i64 %170, 1000000000000
  br i1 %171, label %172, label %174

172:                                              ; preds = %166
  %173 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  store i32 0, ptr %1, align 4
  br label %212

174:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  %175 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %175, ptr %29, align 4, !tbaa !5
  br label %176

176:                                              ; preds = %182, %174
  %177 = load i32, ptr %29, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [105000 x i32], ptr @par, i64 0, i64 %178
  %180 = load i32, ptr %179, align 4, !tbaa !5
  %181 = icmp ne i32 %180, 0
  br i1 %181, label %182, label %187

182:                                              ; preds = %176
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @ans, ptr noundef nonnull align 4 dereferenceable(4) %29)
  %183 = load i32, ptr %29, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [105000 x i32], ptr @par, i64 0, i64 %184
  %186 = load i32, ptr %185, align 4, !tbaa !5
  store i32 %186, ptr %29, align 4, !tbaa !5
  br label %176, !llvm.loop !22

187:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  store i32 1, ptr %30, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) @ans, ptr noundef nonnull align 4 dereferenceable(4) %30)
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  %188 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @ans) #7
  %189 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %31, i32 0, i32 0
  store ptr %188, ptr %189, align 8
  %190 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @ans) #7
  %191 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %32, i32 0, i32 0
  store ptr %190, ptr %191, align 8
  %192 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %31, i32 0, i32 0
  %193 = load ptr, ptr %192, align 8
  %194 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %32, i32 0, i32 0
  %195 = load ptr, ptr %194, align 8
  call void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %193, ptr %195)
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #7
  store i32 0, ptr %33, align 4, !tbaa !5
  br label %196

196:                                              ; preds = %208, %187
  %197 = load i32, ptr %33, align 4, !tbaa !5
  %198 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @ans) #7
  %199 = trunc i64 %198 to i32
  %200 = icmp slt i32 %197, %199
  br i1 %200, label %202, label %201

201:                                              ; preds = %196
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  br label %211

202:                                              ; preds = %196
  %203 = load i32, ptr %33, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ans, i64 noundef %204) #7
  %206 = load i32, ptr %205, align 4, !tbaa !5
  %207 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %206)
  br label %208

208:                                              ; preds = %202
  %209 = load i32, ptr %33, align 4, !tbaa !5
  %210 = add nsw i32 %209, 1
  store i32 %210, ptr %33, align 4, !tbaa !5
  br label %196, !llvm.loop !23

211:                                              ; preds = %201
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  br label %212

212:                                              ; preds = %211, %172
  %213 = load i32, ptr %1, align 4
  ret i32 %213
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(12)) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIxiEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRKxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #3

; 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) #5

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr, ptr) #6

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

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

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

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

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

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

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


; 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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<long long, int>, std::pair<long long, int>, std::_Identity<std::pair<long long, int>>, std::less<std::pair<long long, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long long, int>, std::pair<long long, int>, std::_Identity<std::pair<long long, int>>, std::less<std::pair<long long, 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<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 }
%struct.edge = type { i32, i32 }
%"struct.std::pair.8" = type <{ i64, i32, [4 x i8] }>
%"struct.std::pair.11" = type { i32, i32 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@g = external dso_local global [105000 x %"class.std::vector"], align 16
@dist = external dso_local global [105000 x i64], align 16
@par = external dso_local local_unnamed_addr global [105000 x i32], align 16
@s = external dso_local global %"class.std::set", align 8
@ans = external dso_local global %"class.std::vector.3", align 8
@e = external dso_local global %struct.edge, align 4
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@_ZL3INF = external hidden constant i64, align 8
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair.8", align 8
  %5 = alloca %"struct.std::pair.11", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::pair.8", align 8
  %10 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair.8", align 8
  %14 = alloca %"struct.std::pair.8", align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %18 = load i32, ptr @m, align 4, !tbaa !5
  %.not43 = icmp slt i32 %18, 1
  br i1 %.not43, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  store i32 1, ptr %7, align 4, !tbaa !5
  %19 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  store i64 %19, ptr %5, align 8
  call void @_ZNSt4pairIxiEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %20 = call { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @s, ptr noundef nonnull align 8 dereferenceable(12) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  store i32 2, ptr %8, align 4, !tbaa !5
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %.not4045 = icmp slt i32 %21, 2
  br i1 %.not4045, label %._crit_edge49, label %.lr.ph48

.lr.ph48:                                         ; preds = %._crit_edge
  %.sroa.229.0..sroa_idx = getelementptr inbounds i8, ptr %9, i64 8
  br label %35

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.03644 = phi i32 [ %32, %.lr.ph ], [ 1, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %23 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %23, ptr @e, align 4, !tbaa !9
  %24 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %24, ptr getelementptr inbounds (i8, ptr @e, i64 4), align 4, !tbaa !11
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [105000 x %"class.std::vector"], ptr @g, i64 0, i64 %26
  call void @_ZNSt6vectorI4edgeSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 4 dereferenceable(8) @e)
  %28 = load i32, ptr %1, align 4, !tbaa !5
  store i32 %28, ptr @e, align 4, !tbaa !9
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [105000 x %"class.std::vector"], ptr @g, i64 0, i64 %30
  call void @_ZNSt6vectorI4edgeSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 4 dereferenceable(8) @e)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %32 = add nuw nsw i32 %.03644, 1
  %33 = load i32, ptr @m, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.03644, %33
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !12

._crit_edge49:                                    ; preds = %35, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  %34 = call noundef zeroext i1 @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) @s) #6
  br i1 %34, label %._crit_edge55, label %.lr.ph54

.lr.ph54:                                         ; preds = %._crit_edge49
  %.sroa.29.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %14, i64 8
  br label %44

35:                                               ; preds = %.lr.ph48, %35
  %storemerge46 = phi i32 [ 2, %.lr.ph48 ], [ %41, %35 ]
  %36 = sext i32 %storemerge46 to i64
  %37 = getelementptr inbounds [105000 x i64], ptr @dist, i64 0, i64 %36
  store i64 1000000000000, ptr %37, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #6
  %38 = call { i64, i32 } @_ZSt9make_pairIRKxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr noundef nonnull align 8 dereferenceable(8) @_ZL3INF, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %.fca.0.extract26 = extractvalue { i64, i32 } %38, 0
  %.fca.1.extract27 = extractvalue { i64, i32 } %38, 1
  store i64 %.fca.0.extract26, ptr %9, align 8
  store i32 %.fca.1.extract27, ptr %.sroa.229.0..sroa_idx, align 8
  %39 = call { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @s, ptr noundef nonnull align 8 dereferenceable(12) %9)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  %40 = load i32, ptr %8, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %8, align 4, !tbaa !5
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %.not40.not = icmp slt i32 %40, %42
  br i1 %.not40.not, label %35, label %._crit_edge49, !llvm.loop !16

.loopexit:                                        ; preds = %80, %44
  %43 = call noundef zeroext i1 @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) @s) #6
  br i1 %43, label %._crit_edge55, label %44, !llvm.loop !17

44:                                               ; preds = %.lr.ph54, %.loopexit
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %45 = call ptr @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @s) #6
  store ptr %45, ptr %10, align 8
  %46 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  %47 = getelementptr inbounds i8, ptr %46, i64 8
  %48 = load i32, ptr %47, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  %49 = call ptr @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @s) #6
  store ptr %49, ptr %11, align 8
  %50 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  %51 = load i64, ptr %50, align 8, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  %52 = call ptr @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @s) #6
  %53 = call ptr @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS1_E(ptr noundef nonnull align 8 dereferenceable(48) @s, ptr %52)
  %54 = sext i32 %48 to i64
  %55 = getelementptr inbounds [105000 x %"class.std::vector"], ptr @g, i64 0, i64 %54
  %56 = call noundef i64 @_ZNKSt6vectorI4edgeSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %55) #6
  %57 = trunc i64 %56 to i32
  %58 = icmp sgt i32 %57, 0
  br i1 %58, label %.lr.ph52, label %.loopexit

.lr.ph52:                                         ; preds = %44, %80
  %indvars.iv = phi i64 [ %indvars.iv.next, %80 ], [ 0, %44 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  %59 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %55, i64 noundef %indvars.iv) #6
  %60 = load i32, ptr %59, align 4, !tbaa !9
  store i32 %60, ptr %12, align 4, !tbaa !5
  %61 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %55, i64 noundef %indvars.iv) #6
  %62 = getelementptr inbounds i8, ptr %61, i64 4
  %63 = load i32, ptr %62, align 4, !tbaa !11
  %64 = sext i32 %63 to i64
  %65 = add nsw i64 %51, %64
  %66 = load i32, ptr %12, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [105000 x i64], ptr @dist, i64 0, i64 %67
  %69 = load i64, ptr %68, align 8, !tbaa !14
  %70 = icmp slt i64 %65, %69
  br i1 %70, label %71, label %80

71:                                               ; preds = %.lr.ph52
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #6
  %72 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %68, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %.fca.0.extract6 = extractvalue { i64, i32 } %72, 0
  %.fca.1.extract7 = extractvalue { i64, i32 } %72, 1
  store i64 %.fca.0.extract6, ptr %13, align 8
  store i32 %.fca.1.extract7, ptr %.sroa.29.0..sroa_idx, align 8
  %73 = call noundef i64 @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5eraseERKS1_(ptr noundef nonnull align 8 dereferenceable(48) @s, ptr noundef nonnull align 8 dereferenceable(12) %13)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #6
  %74 = load i32, ptr %12, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [105000 x i64], ptr @dist, i64 0, i64 %75
  store i64 %65, ptr %76, align 8, !tbaa !14
  %77 = getelementptr inbounds [105000 x i32], ptr @par, i64 0, i64 %75
  store i32 %48, ptr %77, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #6
  %78 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %.fca.0.extract = extractvalue { i64, i32 } %78, 0
  %.fca.1.extract = extractvalue { i64, i32 } %78, 1
  store i64 %.fca.0.extract, ptr %14, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  %79 = call { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @s, ptr noundef nonnull align 8 dereferenceable(12) %14)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #6
  br label %80

80:                                               ; preds = %71, %.lr.ph52
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %81 = call noundef i64 @_ZNKSt6vectorI4edgeSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %55) #6
  %sext = shl i64 %81, 32
  %82 = ashr exact i64 %sext, 32
  %83 = icmp slt i64 %indvars.iv.next, %82
  br i1 %83, label %.lr.ph52, label %.loopexit, !llvm.loop !21

._crit_edge55:                                    ; preds = %.loopexit, %._crit_edge49
  %84 = load i32, ptr @n, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [105000 x i64], ptr @dist, i64 0, i64 %85
  %87 = load i64, ptr %86, align 8, !tbaa !14
  %88 = icmp eq i64 %87, 1000000000000
  br i1 %88, label %89, label %91

89:                                               ; preds = %._crit_edge55
  %90 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  br label %111

91:                                               ; preds = %._crit_edge55
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #6
  store i32 %84, ptr %15, align 4, !tbaa !5
  %92 = getelementptr inbounds [105000 x i32], ptr @par, i64 0, i64 %85
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %.not4257 = icmp eq i32 %93, 0
  br i1 %.not4257, label %._crit_edge60, label %.lr.ph59

.lr.ph59:                                         ; preds = %91, %.lr.ph59
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @ans, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %94 = load i32, ptr %15, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [105000 x i32], ptr @par, i64 0, i64 %95
  %storemerge41 = load i32, ptr %96, align 4, !tbaa !5
  store i32 %storemerge41, ptr %15, align 4, !tbaa !5
  %97 = sext i32 %storemerge41 to i64
  %98 = getelementptr inbounds [105000 x i32], ptr @par, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %.not42 = icmp eq i32 %99, 0
  br i1 %.not42, label %._crit_edge60, label %.lr.ph59, !llvm.loop !22

._crit_edge60:                                    ; preds = %.lr.ph59, %91
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #6
  store i32 1, ptr %16, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) @ans, ptr noundef nonnull align 4 dereferenceable(4) %16)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #6
  %100 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @ans) #6
  %101 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @ans) #6
  call void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %100, ptr %101)
  %102 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @ans) #6
  %103 = trunc i64 %102 to i32
  %104 = icmp sgt i32 %103, 0
  br i1 %104, label %.lr.ph63, label %._crit_edge64

._crit_edge64:                                    ; preds = %.lr.ph63, %._crit_edge60
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #6
  br label %111

.lr.ph63:                                         ; preds = %._crit_edge60, %.lr.ph63
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %.lr.ph63 ], [ 0, %._crit_edge60 ]
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ans, i64 noundef %indvars.iv66) #6
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %106)
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %108 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @ans) #6
  %sext69 = shl i64 %108, 32
  %109 = ashr exact i64 %sext69, 32
  %110 = icmp slt i64 %indvars.iv.next67, %109
  br i1 %110, label %.lr.ph63, label %._crit_edge64, !llvm.loop !23

111:                                              ; preds = %._crit_edge64, %89
  ret i32 0
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIxiEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRKxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr, ptr) local_unnamed_addr #5

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

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

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

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

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

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

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


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