; LLVM IR from tangjz/acm-icpc :: uvalive/7338.ll (Z3updi)

; 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"

%struct.Edge = type { i32, i32, i32 }

@dep = external dso_local global [10010 x i32], align 16
@idx = external dso_local global [10010 x i32], align 16
@fa = external dso_local global [15 x [10010 x i32]], align 16
@st = external dso_local global [15 x [10010 x i32]], align 16
@dsu = external dso_local global [10010 x i32], align 16
@A = external dso_local global [100010 x i32], align 16
@B = external dso_local global [100010 x i32], align 16
@e = external dso_local global [100010 x %struct.Edge], align 16

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z8dsu_findi(i32 noundef) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3updi(i32 noundef %0) #1 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = getelementptr inbounds [100010 x %struct.Edge], ptr @e, i64 0, i64 %11
  %13 = getelementptr inbounds %struct.Edge, ptr %12, i32 0, i32 0
  %14 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %14, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [100010 x %struct.Edge], ptr @e, i64 0, i64 %16
  %18 = getelementptr inbounds %struct.Edge, ptr %17, i32 0, i32 1
  %19 = load i32, ptr %18, align 4, !tbaa !11
  store i32 %19, ptr %6, align 4, !tbaa !5
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [10010 x i32], ptr @dep, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = load i32, ptr %6, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [10010 x i32], ptr @dep, i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = icmp sgt i32 %23, %27
  br i1 %28, label %29, label %30

29:                                               ; preds = %1
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6) #4
  br label %30

30:                                               ; preds = %29, %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %31 = load i32, ptr %6, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [10010 x i32], ptr @dep, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = load i32, ptr %5, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [10010 x i32], ptr @dep, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = sub nsw i32 %34, %38
  store i32 %39, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %64, %30
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %44, label %43

43:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %69

44:                                               ; preds = %40
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = and i32 %45, 1
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %63

48:                                               ; preds = %44
  %49 = load i32, ptr %8, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [15 x [10010 x i32]], ptr @st, i64 0, i64 %50
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [10010 x i32], ptr %51, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef %55)
  %56 = load i32, ptr %8, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [15 x [10010 x i32]], ptr @fa, i64 0, i64 %57
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [10010 x i32], ptr %58, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  store i32 %62, ptr %6, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %48, %44
  br label %64

64:                                               ; preds = %63
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = ashr i32 %65, 1
  store i32 %66, ptr %7, align 4, !tbaa !5
  %67 = load i32, ptr %8, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %8, align 4, !tbaa !5
  br label %40, !llvm.loop !12

69:                                               ; preds = %43
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = icmp eq i32 %70, %71
  br i1 %72, label %73, label %75

73:                                               ; preds = %69
  %74 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %74, ptr %4, align 4, !tbaa !5
  br label %142

75:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 14, ptr %9, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %126, %75
  %77 = load i32, ptr %9, align 4, !tbaa !5
  %78 = icmp sge i32 %77, 0
  br i1 %78, label %80, label %79

79:                                               ; preds = %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %129

80:                                               ; preds = %76
  %81 = load i32, ptr %9, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [15 x [10010 x i32]], ptr @fa, i64 0, i64 %82
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [10010 x i32], ptr %83, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = load i32, ptr %9, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [15 x [10010 x i32]], ptr @fa, i64 0, i64 %89
  %91 = load i32, ptr %6, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [10010 x i32], ptr %90, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = icmp ne i32 %87, %94
  br i1 %95, label %96, label %125

96:                                               ; preds = %80
  %97 = load i32, ptr %9, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [15 x [10010 x i32]], ptr @st, i64 0, i64 %98
  %100 = load i32, ptr %5, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [10010 x i32], ptr %99, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef %103)
  %104 = load i32, ptr %9, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [15 x [10010 x i32]], ptr @fa, i64 0, i64 %105
  %107 = load i32, ptr %5, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [10010 x i32], ptr %106, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  store i32 %110, ptr %5, align 4, !tbaa !5
  %111 = load i32, ptr %9, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [15 x [10010 x i32]], ptr @st, i64 0, i64 %112
  %114 = load i32, ptr %6, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [10010 x i32], ptr %113, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef %117)
  %118 = load i32, ptr %9, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [15 x [10010 x i32]], ptr @fa, i64 0, i64 %119
  %121 = load i32, ptr %6, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [10010 x i32], ptr %120, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !5
  store i32 %124, ptr %6, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %96, %80
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %9, align 4, !tbaa !5
  %128 = add nsw i32 %127, -1
  store i32 %128, ptr %9, align 4, !tbaa !5
  br label %76, !llvm.loop !14

129:                                              ; preds = %79
  %130 = load i32, ptr %5, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [10010 x i32], ptr @st, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef %133)
  %134 = load i32, ptr %6, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [10010 x i32], ptr @st, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef %137)
  %138 = load i32, ptr %5, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [10010 x i32], ptr @fa, i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  store i32 %141, ptr %4, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %129, %73
  %143 = load i32, ptr %2, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [100010 x %struct.Edge], ptr @e, i64 0, i64 %144
  %146 = getelementptr inbounds %struct.Edge, ptr %145, i32 0, i32 2
  %147 = load i32, ptr %146, align 4, !tbaa !15
  %148 = load i32, ptr %3, align 4, !tbaa !5
  %149 = sub nsw i32 %147, %148
  %150 = load i32, ptr %2, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [100010 x i32], ptr @B, i64 0, i64 %151
  store i32 %149, ptr %152, align 4, !tbaa !5
  %153 = load i32, ptr %2, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [100010 x %struct.Edge], ptr @e, i64 0, i64 %154
  %156 = getelementptr inbounds %struct.Edge, ptr %155, i32 0, i32 0
  %157 = load i32, ptr %156, align 4, !tbaa !9
  %158 = call noundef i32 @_Z8dsu_findi(i32 noundef %157)
  store i32 %158, ptr %5, align 4, !tbaa !5
  br label %159

159:                                              ; preds = %198, %142
  %160 = load i32, ptr %5, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [10010 x i32], ptr @dep, i64 0, i64 %161
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %164 = load i32, ptr %4, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [10010 x i32], ptr @dep, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = icmp sgt i32 %163, %167
  br i1 %168, label %169, label %201

169:                                              ; preds = %159
  %170 = load i32, ptr %2, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [100010 x %struct.Edge], ptr @e, i64 0, i64 %171
  %173 = getelementptr inbounds %struct.Edge, ptr %172, i32 0, i32 2
  %174 = load i32, ptr %173, align 4, !tbaa !15
  %175 = load i32, ptr %5, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [10010 x i32], ptr @idx, i64 0, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [100010 x %struct.Edge], ptr @e, i64 0, i64 %179
  %181 = getelementptr inbounds %struct.Edge, ptr %180, i32 0, i32 2
  %182 = load i32, ptr %181, align 4, !tbaa !15
  %183 = sub nsw i32 %174, %182
  %184 = load i32, ptr %5, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [10010 x i32], ptr @idx, i64 0, i64 %185
  %187 = load i32, ptr %186, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [100010 x i32], ptr @A, i64 0, i64 %188
  store i32 %183, ptr %189, align 4, !tbaa !5
  %190 = load i32, ptr %5, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [10010 x i32], ptr @fa, i64 0, i64 %191
  %193 = load i32, ptr %192, align 4, !tbaa !5
  %194 = call noundef i32 @_Z8dsu_findi(i32 noundef %193)
  %195 = load i32, ptr %5, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [10010 x i32], ptr @dsu, i64 0, i64 %196
  store i32 %194, ptr %197, align 4, !tbaa !5
  br label %198

198:                                              ; preds = %169
  %199 = load i32, ptr %5, align 4, !tbaa !5
  %200 = call noundef i32 @_Z8dsu_findi(i32 noundef %199)
  store i32 %200, ptr %5, align 4, !tbaa !5
  br label %159, !llvm.loop !16

201:                                              ; preds = %159
  %202 = load i32, ptr %2, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [100010 x %struct.Edge], ptr @e, i64 0, i64 %203
  %205 = getelementptr inbounds %struct.Edge, ptr %204, i32 0, i32 1
  %206 = load i32, ptr %205, align 4, !tbaa !11
  %207 = call noundef i32 @_Z8dsu_findi(i32 noundef %206)
  store i32 %207, ptr %5, align 4, !tbaa !5
  br label %208

208:                                              ; preds = %247, %201
  %209 = load i32, ptr %5, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [10010 x i32], ptr @dep, i64 0, i64 %210
  %212 = load i32, ptr %211, align 4, !tbaa !5
  %213 = load i32, ptr %4, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [10010 x i32], ptr @dep, i64 0, i64 %214
  %216 = load i32, ptr %215, align 4, !tbaa !5
  %217 = icmp sgt i32 %212, %216
  br i1 %217, label %218, label %250

218:                                              ; preds = %208
  %219 = load i32, ptr %2, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [100010 x %struct.Edge], ptr @e, i64 0, i64 %220
  %222 = getelementptr inbounds %struct.Edge, ptr %221, i32 0, i32 2
  %223 = load i32, ptr %222, align 4, !tbaa !15
  %224 = load i32, ptr %5, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [10010 x i32], ptr @idx, i64 0, i64 %225
  %227 = load i32, ptr %226, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [100010 x %struct.Edge], ptr @e, i64 0, i64 %228
  %230 = getelementptr inbounds %struct.Edge, ptr %229, i32 0, i32 2
  %231 = load i32, ptr %230, align 4, !tbaa !15
  %232 = sub nsw i32 %223, %231
  %233 = load i32, ptr %5, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [10010 x i32], ptr @idx, i64 0, i64 %234
  %236 = load i32, ptr %235, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [100010 x i32], ptr @A, i64 0, i64 %237
  store i32 %232, ptr %238, align 4, !tbaa !5
  %239 = load i32, ptr %5, align 4, !tbaa !5
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds [10010 x i32], ptr @fa, i64 0, i64 %240
  %242 = load i32, ptr %241, align 4, !tbaa !5
  %243 = call noundef i32 @_Z8dsu_findi(i32 noundef %242)
  %244 = load i32, ptr %5, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [10010 x i32], ptr @dsu, i64 0, i64 %245
  store i32 %243, ptr %246, align 4, !tbaa !5
  br label %247

247:                                              ; preds = %218
  %248 = load i32, ptr %5, align 4, !tbaa !5
  %249 = call noundef i32 @_Z8dsu_findi(i32 noundef %248)
  store i32 %249, ptr %5, align 4, !tbaa !5
  br label %208, !llvm.loop !17

250:                                              ; preds = %208
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  ret void
}

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = !{!10, !6, i64 4}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!10, !6, i64 8}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !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"

%struct.Edge = type { i32, i32, i32 }

@dep = external dso_local local_unnamed_addr global [10010 x i32], align 16
@idx = external dso_local local_unnamed_addr global [10010 x i32], align 16
@fa = external dso_local local_unnamed_addr global [15 x [10010 x i32]], align 16
@st = external dso_local local_unnamed_addr global [15 x [10010 x i32]], align 16
@dsu = external dso_local local_unnamed_addr global [10010 x i32], align 16
@A = external dso_local local_unnamed_addr global [100010 x i32], align 16
@B = external dso_local local_unnamed_addr global [100010 x i32], align 16
@e = external dso_local local_unnamed_addr global [100010 x %struct.Edge], align 16

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z8dsu_findi(i32 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3updi(i32 noundef %0) local_unnamed_addr #1 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %5 = sext i32 %0 to i64
  %6 = getelementptr inbounds [100010 x %struct.Edge], ptr @e, i64 0, i64 %5
  %7 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %7, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %8 = getelementptr inbounds i8, ptr %6, i64 4
  %9 = load i32, ptr %8, align 4, !tbaa !11
  store i32 %9, ptr %4, align 4, !tbaa !5
  %10 = sext i32 %7 to i64
  %11 = getelementptr inbounds [10010 x i32], ptr @dep, i64 0, i64 %10
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = sext i32 %9 to i64
  %14 = getelementptr inbounds [10010 x i32], ptr @dep, i64 0, i64 %13
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %16 = icmp sgt i32 %12, %15
  br i1 %16, label %17, label %18

17:                                               ; preds = %1
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #4
  %.pre = load i32, ptr %4, align 4, !tbaa !5
  %.phi.trans.insert = sext i32 %.pre to i64
  %.phi.trans.insert46 = getelementptr inbounds [10010 x i32], ptr @dep, i64 0, i64 %.phi.trans.insert
  %.pre47 = load i32, ptr %.phi.trans.insert46, align 4, !tbaa !5
  %.pre48 = load i32, ptr %3, align 4, !tbaa !5
  %.phi.trans.insert49 = sext i32 %.pre48 to i64
  %.phi.trans.insert50 = getelementptr inbounds [10010 x i32], ptr @dep, i64 0, i64 %.phi.trans.insert49
  %.pre51 = load i32, ptr %.phi.trans.insert50, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %17, %1
  %19 = phi i32 [ %.pre51, %17 ], [ %12, %1 ]
  %20 = phi i32 [ %.pre48, %17 ], [ %7, %1 ]
  %21 = phi i32 [ %.pre47, %17 ], [ %15, %1 ]
  %22 = phi i32 [ %.pre, %17 ], [ %9, %1 ]
  %23 = sub nsw i32 %21, %19
  %.not31 = icmp eq i32 %23, 0
  br i1 %.not31, label %._crit_edge, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %37
  %.pre52 = load i32, ptr %3, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %18
  %24 = phi i32 [ %38, %._crit_edge.loopexit ], [ %22, %18 ]
  %25 = phi i32 [ %.pre52, %._crit_edge.loopexit ], [ %20, %18 ]
  %26 = icmp eq i32 %25, %24
  br i1 %26, label %78, label %.preheader

.lr.ph:                                           ; preds = %18, %37
  %27 = phi i32 [ %38, %37 ], [ %22, %18 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %37 ], [ 0, %18 ]
  %.02532 = phi i32 [ %39, %37 ], [ %23, %18 ]
  %28 = and i32 %.02532, 1
  %.not30 = icmp eq i32 %28, 0
  br i1 %.not30, label %37, label %29

29:                                               ; preds = %.lr.ph
  %30 = sext i32 %27 to i64
  %31 = getelementptr inbounds [15 x [10010 x i32]], ptr @st, i64 0, i64 %indvars.iv, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !5
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %2, i32 noundef %32)
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [15 x [10010 x i32]], ptr @fa, i64 0, i64 %indvars.iv, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  store i32 %36, ptr %4, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %.lr.ph, %29
  %38 = phi i32 [ %27, %.lr.ph ], [ %36, %29 ]
  %39 = ashr i32 %.02532, 1
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.not = icmp ult i32 %.02532, 2
  br i1 %.not, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !12

40:                                               ; preds = %76
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [10010 x i32], ptr @st, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %2, i32 noundef %44)
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [10010 x i32], ptr @st, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %2, i32 noundef %48)
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [10010 x i32], ptr @fa, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  br label %78

.preheader:                                       ; preds = %._crit_edge, %76
  %53 = phi i32 [ %77, %76 ], [ %24, %._crit_edge ]
  %indvars.iv43 = phi i64 [ %indvars.iv.next44, %76 ], [ 14, %._crit_edge ]
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [15 x [10010 x i32]], ptr @fa, i64 0, i64 %indvars.iv43, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = sext i32 %53 to i64
  %59 = getelementptr inbounds [15 x [10010 x i32]], ptr @fa, i64 0, i64 %indvars.iv43, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %.not28 = icmp eq i32 %57, %60
  br i1 %.not28, label %76, label %61

61:                                               ; preds = %.preheader
  %62 = getelementptr inbounds [15 x [10010 x i32]], ptr @st, i64 0, i64 %indvars.iv43, i64 %55
  %63 = load i32, ptr %62, align 4, !tbaa !5
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %2, i32 noundef %63)
  %64 = load i32, ptr %3, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [15 x [10010 x i32]], ptr @fa, i64 0, i64 %indvars.iv43, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  store i32 %67, ptr %3, align 4, !tbaa !5
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [15 x [10010 x i32]], ptr @st, i64 0, i64 %indvars.iv43, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %2, i32 noundef %71)
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [15 x [10010 x i32]], ptr @fa, i64 0, i64 %indvars.iv43, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  store i32 %75, ptr %4, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %.preheader, %61
  %77 = phi i32 [ %53, %.preheader ], [ %75, %61 ]
  %indvars.iv.next44 = add nsw i64 %indvars.iv43, -1
  %.not54 = icmp eq i64 %indvars.iv43, 0
  br i1 %.not54, label %40, label %.preheader, !llvm.loop !14

78:                                               ; preds = %._crit_edge, %40
  %.026 = phi i32 [ %52, %40 ], [ %24, %._crit_edge ]
  %79 = getelementptr inbounds i8, ptr %6, i64 8
  %80 = load i32, ptr %79, align 4, !tbaa !15
  %81 = load i32, ptr %2, align 4, !tbaa !5
  %82 = sub nsw i32 %80, %81
  %83 = getelementptr inbounds [100010 x i32], ptr @B, i64 0, i64 %5
  store i32 %82, ptr %83, align 4, !tbaa !5
  %84 = load i32, ptr %6, align 4, !tbaa !9
  %85 = call noundef i32 @_Z8dsu_findi(i32 noundef %84)
  %86 = sext i32 %.026 to i64
  %87 = getelementptr inbounds [10010 x i32], ptr @dep, i64 0, i64 %86
  store i32 %85, ptr %3, align 4, !tbaa !5
  %88 = sext i32 %85 to i64
  %89 = getelementptr inbounds [10010 x i32], ptr @dep, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = load i32, ptr %87, align 4, !tbaa !5
  %92 = icmp sgt i32 %90, %91
  br i1 %92, label %.lr.ph37, label %._crit_edge38

.lr.ph37:                                         ; preds = %78, %.lr.ph37
  %93 = phi i64 [ %109, %.lr.ph37 ], [ %88, %78 ]
  %94 = load i32, ptr %79, align 4, !tbaa !15
  %95 = getelementptr inbounds [10010 x i32], ptr @idx, i64 0, i64 %93
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [100010 x %struct.Edge], ptr @e, i64 0, i64 %97, i32 2
  %99 = load i32, ptr %98, align 4, !tbaa !15
  %100 = sub nsw i32 %94, %99
  %101 = getelementptr inbounds [100010 x i32], ptr @A, i64 0, i64 %97
  store i32 %100, ptr %101, align 4, !tbaa !5
  %102 = getelementptr inbounds [10010 x i32], ptr @fa, i64 0, i64 %93
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = call noundef i32 @_Z8dsu_findi(i32 noundef %103)
  %105 = load i32, ptr %3, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [10010 x i32], ptr @dsu, i64 0, i64 %106
  store i32 %104, ptr %107, align 4, !tbaa !5
  %108 = call noundef i32 @_Z8dsu_findi(i32 noundef %105)
  store i32 %108, ptr %3, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [10010 x i32], ptr @dep, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = load i32, ptr %87, align 4, !tbaa !5
  %113 = icmp sgt i32 %111, %112
  br i1 %113, label %.lr.ph37, label %._crit_edge38, !llvm.loop !16

._crit_edge38:                                    ; preds = %.lr.ph37, %78
  %114 = load i32, ptr %8, align 4, !tbaa !11
  %115 = call noundef i32 @_Z8dsu_findi(i32 noundef %114)
  store i32 %115, ptr %3, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [10010 x i32], ptr @dep, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = load i32, ptr %87, align 4, !tbaa !5
  %120 = icmp sgt i32 %118, %119
  br i1 %120, label %.lr.ph40, label %._crit_edge41

.lr.ph40:                                         ; preds = %._crit_edge38, %.lr.ph40
  %121 = phi i64 [ %137, %.lr.ph40 ], [ %116, %._crit_edge38 ]
  %122 = load i32, ptr %79, align 4, !tbaa !15
  %123 = getelementptr inbounds [10010 x i32], ptr @idx, i64 0, i64 %121
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [100010 x %struct.Edge], ptr @e, i64 0, i64 %125, i32 2
  %127 = load i32, ptr %126, align 4, !tbaa !15
  %128 = sub nsw i32 %122, %127
  %129 = getelementptr inbounds [100010 x i32], ptr @A, i64 0, i64 %125
  store i32 %128, ptr %129, align 4, !tbaa !5
  %130 = getelementptr inbounds [10010 x i32], ptr @fa, i64 0, i64 %121
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = call noundef i32 @_Z8dsu_findi(i32 noundef %131)
  %133 = load i32, ptr %3, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [10010 x i32], ptr @dsu, i64 0, i64 %134
  store i32 %132, ptr %135, align 4, !tbaa !5
  %136 = call noundef i32 @_Z8dsu_findi(i32 noundef %133)
  store i32 %136, ptr %3, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [10010 x i32], ptr @dep, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = load i32, ptr %87, align 4, !tbaa !5
  %141 = icmp sgt i32 %139, %140
  br i1 %141, label %.lr.ph40, label %._crit_edge41, !llvm.loop !17

._crit_edge41:                                    ; preds = %.lr.ph40, %._crit_edge38
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  ret void
}

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

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


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