; LLVM IR from ADJA/algos :: Graphs/MinCostFB.ll (Z7minCosti)

; 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 }
%struct.edge = type { i32, i32, i32, i32, i64 }

@e = external dso_local global %"class.std::vector", align 8
@dist = external dso_local global [1050 x i64], align 16
@par = external dso_local global [1050 x i32], align 16
@edge_num = external dso_local global i32, align 4
@s = external dso_local global i32, align 4
@t = external dso_local global i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z7minCosti(i32 noundef %0) #0 {
  %2 = alloca i64, align 8
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %struct.edge, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %struct.edge, align 8
  %17 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store i64 0, ptr %4, align 8, !tbaa !9
  br label %18

18:                                               ; preds = %210, %1
  br label %19

19:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %20 = load i32, ptr @s, align 4, !tbaa !5
  store i32 %20, ptr %5, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %30, %19
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %23 = load i32, ptr @t, align 4, !tbaa !5
  %24 = icmp sle i32 %22, %23
  br i1 %24, label %26, label %25

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

26:                                               ; preds = %21
  %27 = load i32, ptr %5, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %28
  store i64 1000000000000000, ptr %29, align 8, !tbaa !9
  br label %30

30:                                               ; preds = %26
  %31 = load i32, ptr %5, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %5, align 4, !tbaa !5
  br label %21, !llvm.loop !11

33:                                               ; preds = %25
  %34 = load i32, ptr @s, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %35
  store i64 0, ptr %36, align 8, !tbaa !9
  br label %37

37:                                               ; preds = %122, %33
  br label %38

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

39:                                               ; preds = %112, %38
  %40 = load i32, ptr %7, align 4, !tbaa !5
  %41 = load i32, ptr @edge_num, align 4, !tbaa !5
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %44, label %43

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

44:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %46) #5
  %48 = getelementptr inbounds %struct.edge, ptr %47, i32 0, i32 0
  %49 = load i32, ptr %48, align 8, !tbaa !15
  store i32 %49, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %50 = load i32, ptr %7, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %51) #5
  %53 = getelementptr inbounds %struct.edge, ptr %52, i32 0, i32 1
  %54 = load i32, ptr %53, align 4, !tbaa !17
  store i32 %54, ptr %10, align 4, !tbaa !5
  %55 = load i32, ptr %7, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %56) #5
  %58 = getelementptr inbounds %struct.edge, ptr %57, i32 0, i32 2
  %59 = load i32, ptr %58, align 8, !tbaa !18
  %60 = load i32, ptr %7, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %61) #5
  %63 = getelementptr inbounds %struct.edge, ptr %62, i32 0, i32 3
  %64 = load i32, ptr %63, align 4, !tbaa !19
  %65 = icmp eq i32 %59, %64
  br i1 %65, label %66, label %67

66:                                               ; preds = %44
  store i32 11, ptr %8, align 4
  br label %109

67:                                               ; preds = %44
  %68 = load i32, ptr %9, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %69
  %71 = load i64, ptr %70, align 8, !tbaa !9
  %72 = icmp eq i64 %71, 1000000000000000
  br i1 %72, label %73, label %74

73:                                               ; preds = %67
  store i32 11, ptr %8, align 4
  br label %109

74:                                               ; preds = %67
  %75 = load i32, ptr %10, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %76
  %78 = load i64, ptr %77, align 8, !tbaa !9
  %79 = load i32, ptr %9, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %80
  %82 = load i64, ptr %81, align 8, !tbaa !9
  %83 = load i32, ptr %7, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %84) #5
  %86 = getelementptr inbounds %struct.edge, ptr %85, i32 0, i32 4
  %87 = load i64, ptr %86, align 8, !tbaa !20
  %88 = add nsw i64 %82, %87
  %89 = icmp sgt i64 %78, %88
  br i1 %89, label %90, label %108

90:                                               ; preds = %74
  %91 = load i32, ptr %9, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %92
  %94 = load i64, ptr %93, align 8, !tbaa !9
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %96) #5
  %98 = getelementptr inbounds %struct.edge, ptr %97, i32 0, i32 4
  %99 = load i64, ptr %98, align 8, !tbaa !20
  %100 = add nsw i64 %94, %99
  %101 = load i32, ptr %10, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %102
  store i64 %100, ptr %103, align 8, !tbaa !9
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = load i32, ptr %10, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [1050 x i32], ptr @par, i64 0, i64 %106
  store i32 %104, ptr %107, align 4, !tbaa !5
  store i8 1, ptr %6, align 1, !tbaa !13
  br label %108

108:                                              ; preds = %90, %74
  store i32 0, ptr %8, align 4
  br label %109

109:                                              ; preds = %108, %73, %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  %110 = load i32, ptr %8, align 4
  switch i32 %110, label %215 [
    i32 0, label %111
    i32 11, label %112
  ]

111:                                              ; preds = %109
  br label %112

112:                                              ; preds = %111, %109
  %113 = load i32, ptr %7, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %7, align 4, !tbaa !5
  br label %39, !llvm.loop !21

115:                                              ; preds = %43
  %116 = load i8, ptr %6, align 1, !tbaa !13, !range !22, !noundef !23
  %117 = trunc i8 %116 to i1
  br i1 %117, label %119, label %118

118:                                              ; preds = %115
  store i32 8, ptr %8, align 4
  br label %120

119:                                              ; preds = %115
  store i32 0, ptr %8, align 4
  br label %120

120:                                              ; preds = %119, %118
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  %121 = load i32, ptr %8, align 4
  switch i32 %121, label %215 [
    i32 0, label %122
    i32 8, label %123
  ]

122:                                              ; preds = %120
  br label %37, !llvm.loop !24

123:                                              ; preds = %120
  %124 = load i32, ptr @t, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %125
  %127 = load i64, ptr %126, align 8, !tbaa !9
  %128 = icmp eq i64 %127, 1000000000000000
  br i1 %128, label %129, label %131

129:                                              ; preds = %123
  %130 = load i64, ptr %4, align 8, !tbaa !9
  store i64 %130, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %213

131:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %132 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %132, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %133 = load i32, ptr @t, align 4, !tbaa !5
  store i32 %133, ptr %12, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %138, %131
  %135 = load i32, ptr %12, align 4, !tbaa !5
  %136 = load i32, ptr @s, align 4, !tbaa !5
  %137 = icmp ne i32 %135, %136
  br i1 %137, label %138, label %155

138:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #5
  %139 = load i32, ptr %12, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [1050 x i32], ptr @par, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %143) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %144, i64 24, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %145 = getelementptr inbounds %struct.edge, ptr %13, i32 0, i32 0
  %146 = load i32, ptr %145, align 8, !tbaa !15
  store i32 %146, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %147 = getelementptr inbounds %struct.edge, ptr %13, i32 0, i32 3
  %148 = load i32, ptr %147, align 4, !tbaa !19
  %149 = getelementptr inbounds %struct.edge, ptr %13, i32 0, i32 2
  %150 = load i32, ptr %149, align 8, !tbaa !18
  %151 = sub nsw i32 %148, %150
  store i32 %151, ptr %15, align 4, !tbaa !5
  %152 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %153 = load i32, ptr %152, align 4, !tbaa !5
  store i32 %153, ptr %11, align 4, !tbaa !5
  %154 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %154, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  br label %134, !llvm.loop !26

155:                                              ; preds = %134
  %156 = load i32, ptr %11, align 4, !tbaa !5
  %157 = load i32, ptr %3, align 4, !tbaa !5
  %158 = sub nsw i32 %157, %156
  store i32 %158, ptr %3, align 4, !tbaa !5
  %159 = load i32, ptr @t, align 4, !tbaa !5
  store i32 %159, ptr %12, align 4, !tbaa !5
  br label %160

160:                                              ; preds = %164, %155
  %161 = load i32, ptr %12, align 4, !tbaa !5
  %162 = load i32, ptr @s, align 4, !tbaa !5
  %163 = icmp ne i32 %161, %162
  br i1 %163, label %164, label %203

164:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #5
  %165 = load i32, ptr %12, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [1050 x i32], ptr @par, i64 0, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %169) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %170, i64 24, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %171 = getelementptr inbounds %struct.edge, ptr %16, i32 0, i32 0
  %172 = load i32, ptr %171, align 8, !tbaa !15
  store i32 %172, ptr %17, align 4, !tbaa !5
  %173 = load i32, ptr %11, align 4, !tbaa !5
  %174 = load i32, ptr %12, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [1050 x i32], ptr @par, i64 0, i64 %175
  %177 = load i32, ptr %176, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %178) #5
  %180 = getelementptr inbounds %struct.edge, ptr %179, i32 0, i32 2
  %181 = load i32, ptr %180, align 8, !tbaa !18
  %182 = add nsw i32 %181, %173
  store i32 %182, ptr %180, align 8, !tbaa !18
  %183 = load i32, ptr %11, align 4, !tbaa !5
  %184 = load i32, ptr %12, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [1050 x i32], ptr @par, i64 0, i64 %185
  %187 = load i32, ptr %186, align 4, !tbaa !5
  %188 = xor i32 %187, 1
  %189 = sext i32 %188 to i64
  %190 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %189) #5
  %191 = getelementptr inbounds %struct.edge, ptr %190, i32 0, i32 2
  %192 = load i32, ptr %191, align 8, !tbaa !18
  %193 = sub nsw i32 %192, %183
  store i32 %193, ptr %191, align 8, !tbaa !18
  %194 = load i32, ptr %11, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = mul nsw i64 1, %195
  %197 = getelementptr inbounds %struct.edge, ptr %16, i32 0, i32 4
  %198 = load i64, ptr %197, align 8, !tbaa !20
  %199 = mul nsw i64 %196, %198
  %200 = load i64, ptr %4, align 8, !tbaa !9
  %201 = add nsw i64 %200, %199
  store i64 %201, ptr %4, align 8, !tbaa !9
  %202 = load i32, ptr %17, align 4, !tbaa !5
  store i32 %202, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  br label %160, !llvm.loop !27

203:                                              ; preds = %160
  %204 = load i32, ptr %3, align 4, !tbaa !5
  %205 = icmp eq i32 %204, 0
  br i1 %205, label %206, label %207

206:                                              ; preds = %203
  store i32 3, ptr %8, align 4
  br label %208

207:                                              ; preds = %203
  store i32 0, ptr %8, align 4
  br label %208

208:                                              ; preds = %207, %206
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  %209 = load i32, ptr %8, align 4
  switch i32 %209, label %215 [
    i32 0, label %210
    i32 3, label %211
  ]

210:                                              ; preds = %208
  br label %18, !llvm.loop !28

211:                                              ; preds = %208
  %212 = load i64, ptr %4, align 8, !tbaa !9
  store i64 %212, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %213

213:                                              ; preds = %211, %129
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  %214 = load i64, ptr %2, align 8
  ret i64 %214

215:                                              ; preds = %208, %120, %109
  unreachable
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 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) #3

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!16, !6, i64 0}
!16 = !{!"_ZTS4edge", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !10, i64 16}
!17 = !{!16, !6, i64 4}
!18 = !{!16, !6, i64 8}
!19 = !{!16, !6, i64 12}
!20 = !{!16, !10, i64 16}
!21 = distinct !{!21, !12}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = distinct !{!24, !12}
!25 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5, i64 12, i64 4, !5, i64 16, i64 8, !9}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !12}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<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 }

@e = external dso_local global %"class.std::vector", align 8
@dist = external dso_local local_unnamed_addr global [1050 x i64], align 16
@par = external dso_local local_unnamed_addr global [1050 x i32], align 16
@edge_num = external dso_local local_unnamed_addr global i32, align 4
@s = external dso_local local_unnamed_addr global i32, align 4
@t = external dso_local local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i64 @_Z7minCosti(i32 noundef %0) local_unnamed_addr #0 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %.pre = load i32, ptr @s, align 4, !tbaa !5
  br label %4

4:                                                ; preds = %._crit_edge73, %1
  %5 = phi i32 [ %.pre, %1 ], [ %100, %._crit_edge73 ]
  %.041 = phi i64 [ 0, %1 ], [ %.1.lcssa, %._crit_edge73 ]
  %.040 = phi i32 [ %0, %1 ], [ %74, %._crit_edge73 ]
  %6 = load i32, ptr @t, align 4, !tbaa !5
  %.not54 = icmp sgt i32 %5, %6
  %.pre80 = sext i32 %5 to i64
  br i1 %.not54, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %4
  %7 = add i32 %6, 1
  %8 = sub i32 %6, %5
  %9 = zext i32 %8 to i64
  %10 = add nuw nsw i64 %9, 1
  %min.iters.check = icmp ult i32 %8, 3
  br i1 %min.iters.check, label %.lr.ph.preheader89, label %vector.ph

.lr.ph.preheader89:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ %.pre80, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %10, 8589934588
  %ind.end = add nsw i64 %n.vec, %.pre80
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %index, %.pre80
  %11 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %offset.idx
  %12 = getelementptr inbounds i8, ptr %11, i64 16
  store <2 x i64> <i64 1000000000000000, i64 1000000000000000>, ptr %11, align 8, !tbaa !9
  store <2 x i64> <i64 1000000000000000, i64 1000000000000000>, ptr %12, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %13 = icmp eq i64 %index.next, %n.vec
  br i1 %13, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %10, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader89

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %4
  %14 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %.pre80
  store i64 0, ptr %14, align 8, !tbaa !9
  %15 = load i32, ptr @edge_num, align 4, !tbaa !5
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.split, label %.split62.us

.lr.ph:                                           ; preds = %.lr.ph.preheader89, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader89 ]
  %17 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %indvars.iv
  store i64 1000000000000000, ptr %17, align 8, !tbaa !9
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond.not = icmp eq i32 %7, %lftr.wideiv
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !15

.split:                                           ; preds = %._crit_edge, %._crit_edge60
  %18 = phi i32 [ %55, %._crit_edge60 ], [ %15, %._crit_edge ]
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph59, label %.split62.us.loopexit

._crit_edge60:                                    ; preds = %54
  br i1 %.2, label %.split, label %.split62.us.loopexit, !llvm.loop !16

.lr.ph59:                                         ; preds = %.split, %54
  %indvars.iv76 = phi i64 [ %indvars.iv.next77, %54 ], [ 0, %.split ]
  %.04357 = phi i1 [ %.2, %54 ], [ false, %.split ]
  %20 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %indvars.iv76) #3
  %21 = load i32, ptr %20, align 8, !tbaa !18
  %22 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %indvars.iv76) #3
  %23 = getelementptr inbounds i8, ptr %22, i64 4
  %24 = load i32, ptr %23, align 4, !tbaa !20
  %25 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %indvars.iv76) #3
  %26 = getelementptr inbounds i8, ptr %25, i64 8
  %27 = load i32, ptr %26, align 8, !tbaa !21
  %28 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %indvars.iv76) #3
  %29 = getelementptr inbounds i8, ptr %28, i64 12
  %30 = load i32, ptr %29, align 4, !tbaa !22
  %31 = icmp eq i32 %27, %30
  br i1 %31, label %54, label %32

32:                                               ; preds = %.lr.ph59
  %33 = sext i32 %21 to i64
  %34 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %33
  %35 = load i64, ptr %34, align 8, !tbaa !9
  %36 = icmp eq i64 %35, 1000000000000000
  br i1 %36, label %54, label %37

37:                                               ; preds = %32
  %38 = sext i32 %24 to i64
  %39 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %38
  %40 = load i64, ptr %39, align 8, !tbaa !9
  %41 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %indvars.iv76) #3
  %42 = getelementptr inbounds i8, ptr %41, i64 16
  %43 = load i64, ptr %42, align 8, !tbaa !23
  %44 = add nsw i64 %43, %35
  %45 = icmp sgt i64 %40, %44
  br i1 %45, label %46, label %54

46:                                               ; preds = %37
  %47 = load i64, ptr %34, align 8, !tbaa !9
  %48 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %indvars.iv76) #3
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  %50 = load i64, ptr %49, align 8, !tbaa !23
  %51 = add nsw i64 %50, %47
  store i64 %51, ptr %39, align 8, !tbaa !9
  %52 = getelementptr inbounds [1050 x i32], ptr @par, i64 0, i64 %38
  %53 = trunc nuw nsw i64 %indvars.iv76 to i32
  store i32 %53, ptr %52, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %37, %46, %32, %.lr.ph59
  %.2 = phi i1 [ %.04357, %.lr.ph59 ], [ %.04357, %32 ], [ true, %46 ], [ %.04357, %37 ]
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %55 = load i32, ptr @edge_num, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = icmp slt i64 %indvars.iv.next77, %56
  br i1 %57, label %.lr.ph59, label %._crit_edge60, !llvm.loop !24

.split62.us.loopexit:                             ; preds = %.split, %._crit_edge60
  %.pre78 = load i32, ptr @t, align 4, !tbaa !5
  br label %.split62.us

.split62.us:                                      ; preds = %.split62.us.loopexit, %._crit_edge
  %58 = phi i32 [ %.pre78, %.split62.us.loopexit ], [ %6, %._crit_edge ]
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !9
  %62 = icmp eq i64 %61, 1000000000000000
  br i1 %62, label %.loopexit, label %63

63:                                               ; preds = %.split62.us
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #3
  store i32 %.040, ptr %2, align 4, !tbaa !5
  %64 = load i32, ptr @s, align 4, !tbaa !5
  %.not5163 = icmp eq i32 %58, %64
  br i1 %.not5163, label %._crit_edge73.thread, label %.lr.ph66

._crit_edge73.thread:                             ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #3
  br label %.loopexit

.lr.ph66:                                         ; preds = %63, %.lr.ph66
  %.04864 = phi i32 [ %.sroa.03.0.copyload, %.lr.ph66 ], [ %58, %63 ]
  %65 = sext i32 %.04864 to i64
  %66 = getelementptr inbounds [1050 x i32], ptr @par, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %68) #3
  %.sroa.03.0.copyload = load i32, ptr %69, align 8, !tbaa !5
  %.sroa.45.0..sroa_idx = getelementptr inbounds i8, ptr %69, i64 8
  %.sroa.45.0.copyload = load i32, ptr %.sroa.45.0..sroa_idx, align 8, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %69, i64 12
  %.sroa.5.0.copyload = load i32, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  %70 = sub nsw i32 %.sroa.5.0.copyload, %.sroa.45.0.copyload
  store i32 %70, ptr %3, align 4, !tbaa !5
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %72 = load i32, ptr %71, align 4, !tbaa !5
  store i32 %72, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  %73 = load i32, ptr @s, align 4, !tbaa !5
  %.not51 = icmp eq i32 %.sroa.03.0.copyload, %73
  br i1 %.not51, label %._crit_edge67, label %.lr.ph66, !llvm.loop !25

._crit_edge67:                                    ; preds = %.lr.ph66
  %.pre79 = load i32, ptr @t, align 4, !tbaa !5
  %74 = sub nsw i32 %.040, %72
  %.not5268 = icmp eq i32 %.pre79, %.sroa.03.0.copyload
  br i1 %.not5268, label %._crit_edge73, label %.lr.ph72

.lr.ph72:                                         ; preds = %._crit_edge67, %.lr.ph72
  %.170 = phi i64 [ %98, %.lr.ph72 ], [ %.041, %._crit_edge67 ]
  %.14969 = phi i32 [ %.sroa.0.0.copyload, %.lr.ph72 ], [ %.pre79, %._crit_edge67 ]
  %75 = sext i32 %.14969 to i64
  %76 = getelementptr inbounds [1050 x i32], ptr @par, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %78) #3
  %.sroa.0.0.copyload = load i32, ptr %79, align 8, !tbaa !5
  %.sroa.41.0..sroa_idx = getelementptr inbounds i8, ptr %79, i64 16
  %.sroa.41.0.copyload = load i64, ptr %.sroa.41.0..sroa_idx, align 8, !tbaa !9
  %80 = load i32, ptr %2, align 4, !tbaa !5
  %81 = load i32, ptr %76, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %82) #3
  %84 = getelementptr inbounds i8, ptr %83, i64 8
  %85 = load i32, ptr %84, align 8, !tbaa !21
  %86 = add nsw i32 %85, %80
  store i32 %86, ptr %84, align 8, !tbaa !21
  %87 = load i32, ptr %2, align 4, !tbaa !5
  %88 = load i32, ptr %76, align 4, !tbaa !5
  %89 = xor i32 %88, 1
  %90 = sext i32 %89 to i64
  %91 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %90) #3
  %92 = getelementptr inbounds i8, ptr %91, i64 8
  %93 = load i32, ptr %92, align 8, !tbaa !21
  %94 = sub nsw i32 %93, %87
  store i32 %94, ptr %92, align 8, !tbaa !21
  %95 = load i32, ptr %2, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = mul nsw i64 %.sroa.41.0.copyload, %96
  %98 = add nsw i64 %97, %.170
  %99 = load i32, ptr @s, align 4, !tbaa !5
  %.not52 = icmp eq i32 %.sroa.0.0.copyload, %99
  br i1 %.not52, label %._crit_edge73, label %.lr.ph72, !llvm.loop !26

._crit_edge73:                                    ; preds = %.lr.ph72, %._crit_edge67
  %100 = phi i32 [ %.sroa.03.0.copyload, %._crit_edge67 ], [ %.sroa.0.0.copyload, %.lr.ph72 ]
  %.1.lcssa = phi i64 [ %.041, %._crit_edge67 ], [ %98, %.lr.ph72 ]
  %101 = icmp eq i32 %74, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #3
  br i1 %101, label %.loopexit, label %4

.loopexit:                                        ; preds = %._crit_edge73, %.split62.us, %._crit_edge73.thread
  %.0 = phi i64 [ %.041, %._crit_edge73.thread ], [ %.1.lcssa, %._crit_edge73 ], [ %.041, %.split62.us ]
  ret i64 %.0
}

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

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

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12, !14, !13}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unswitch.partial.disable"}
!18 = !{!19, !6, i64 0}
!19 = !{!"_ZTS4edge", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !10, i64 16}
!20 = !{!19, !6, i64 4}
!21 = !{!19, !6, i64 8}
!22 = !{!19, !6, i64 12}
!23 = !{!19, !10, i64 16}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}


; Effective O3 passes: AggressiveInstCombinePass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass