; LLVM IR from upupming/algorithm :: kick-start/2021/RoundA/D. Checksum (main)

; 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.P = type { i32, i32, i32 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@t = external dso_local global i32, align 4
@a = external dso_local global [1020 x [1020 x i32]], align 16
@b = external dso_local global [1020 x [1020 x i32]], align 16
@r = external dso_local global [1020 x i32], align 16
@c = external dso_local global [1020 x i32], align 16
@n = external dso_local global i32, align 4
@sum = external dso_local global i32, align 4
@fa = external dso_local global [1020 x i32], align 16
@m = external dso_local global i32, align 4
@edge = external dso_local global [1040400 x %struct.P], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z5solvev() #0

; 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 norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %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 i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.P, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @t)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %161, %0
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr @t, align 4, !tbaa !5
  %18 = icmp sle i32 %16, %17
  br i1 %18, label %20, label %19

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

20:                                               ; preds = %15
  store i32 0, ptr @sum, align 4, !tbaa !5
  store i32 0, ptr @m, align 4, !tbaa !5
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %33, %20
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = load i32, ptr @n, align 4, !tbaa !5
  %25 = mul nsw i32 2, %24
  %26 = icmp sle i32 %23, %25
  br i1 %26, label %28, label %27

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

28:                                               ; preds = %22
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [1020 x i32], ptr @fa, i64 0, i64 %31
  store i32 %29, ptr %32, align 4, !tbaa !5
  br label %33

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

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

37:                                               ; preds = %60, %36
  %38 = load i32, ptr %5, align 4, !tbaa !5
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %63

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

43:                                               ; preds = %56, %42
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = load i32, ptr @n, align 4, !tbaa !5
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %48, label %47

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

48:                                               ; preds = %43
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [1020 x [1020 x i32]], ptr @a, i64 0, i64 %50
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [1020 x i32], ptr %51, i64 0, i64 %53
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %54)
  br label %56

56:                                               ; preds = %48
  %57 = load i32, ptr %6, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %6, align 4, !tbaa !5
  br label %43, !llvm.loop !11

59:                                               ; preds = %47
  br label %60

60:                                               ; preds = %59
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %5, align 4, !tbaa !5
  br label %37, !llvm.loop !12

63:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %126, %63
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = load i32, ptr @n, align 4, !tbaa !5
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %64
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %129

69:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %122, %69
  %71 = load i32, ptr %8, align 4, !tbaa !5
  %72 = load i32, ptr @n, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %125

75:                                               ; preds = %70
  %76 = load i32, ptr %7, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [1020 x [1020 x i32]], ptr @b, i64 0, i64 %77
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [1020 x i32], ptr %78, i64 0, i64 %80
  %82 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %81)
  %83 = load i32, ptr %7, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [1020 x [1020 x i32]], ptr @a, i64 0, i64 %84
  %86 = load i32, ptr %8, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [1020 x i32], ptr %85, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = icmp eq i32 %89, -1
  br i1 %90, label %91, label %121

91:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %92 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %92, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = load i32, ptr @n, align 4, !tbaa !5
  %95 = add nsw i32 %93, %94
  store i32 %95, ptr %10, align 4, !tbaa !5
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [1020 x [1020 x i32]], ptr @b, i64 0, i64 %97
  %99 = load i32, ptr %8, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [1020 x i32], ptr %98, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = load i32, ptr @sum, align 4, !tbaa !5
  %104 = add nsw i32 %103, %102
  store i32 %104, ptr @sum, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #5
  %105 = getelementptr inbounds %struct.P, ptr %11, i32 0, i32 0
  %106 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %106, ptr %105, align 4, !tbaa !13
  %107 = getelementptr inbounds %struct.P, ptr %11, i32 0, i32 1
  %108 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %108, ptr %107, align 4, !tbaa !15
  %109 = getelementptr inbounds %struct.P, ptr %11, i32 0, i32 2
  %110 = load i32, ptr %7, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [1020 x [1020 x i32]], ptr @b, i64 0, i64 %111
  %113 = load i32, ptr %8, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [1020 x i32], ptr %112, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  store i32 %116, ptr %109, align 4, !tbaa !16
  %117 = load i32, ptr @m, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr @m, align 4, !tbaa !5
  %119 = sext i32 %117 to i64
  %120 = getelementptr inbounds [1040400 x %struct.P], ptr @edge, i64 0, i64 %119
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %120, ptr align 4 %11, i64 12, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %121

121:                                              ; preds = %91, %75
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %8, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %8, align 4, !tbaa !5
  br label %70, !llvm.loop !18

125:                                              ; preds = %74
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %7, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %7, align 4, !tbaa !5
  br label %64, !llvm.loop !19

129:                                              ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %140, %129
  %131 = load i32, ptr %12, align 4, !tbaa !5
  %132 = load i32, ptr @n, align 4, !tbaa !5
  %133 = icmp slt i32 %131, %132
  br i1 %133, label %135, label %134

134:                                              ; preds = %130
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %143

135:                                              ; preds = %130
  %136 = load i32, ptr %12, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [1020 x i32], ptr @r, i64 0, i64 %137
  %139 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %138)
  br label %140

140:                                              ; preds = %135
  %141 = load i32, ptr %12, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %12, align 4, !tbaa !5
  br label %130, !llvm.loop !20

143:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %154, %143
  %145 = load i32, ptr %13, align 4, !tbaa !5
  %146 = load i32, ptr @n, align 4, !tbaa !5
  %147 = icmp slt i32 %145, %146
  br i1 %147, label %149, label %148

148:                                              ; preds = %144
  store i32 23, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %157

149:                                              ; preds = %144
  %150 = load i32, ptr %13, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [1020 x i32], ptr @c, i64 0, i64 %151
  %153 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %152)
  br label %154

154:                                              ; preds = %149
  %155 = load i32, ptr %13, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %13, align 4, !tbaa !5
  br label %144, !llvm.loop !21

157:                                              ; preds = %148
  %158 = load i32, ptr %2, align 4, !tbaa !5
  %159 = call noundef i32 @_Z5solvev()
  %160 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %158, i32 noundef %159)
  br label %161

161:                                              ; preds = %157
  %162 = load i32, ptr %2, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %2, align 4, !tbaa !5
  br label %15, !llvm.loop !22

164:                                              ; preds = %19
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), 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) #4

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

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 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }

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

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


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

%struct.P = type { i32, i32, i32 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@t = external dso_local global i32, align 4
@a = external dso_local global [1020 x [1020 x i32]], align 16
@b = external dso_local global [1020 x [1020 x i32]], align 16
@r = external dso_local global [1020 x i32], align 16
@c = external dso_local global [1020 x i32], align 16
@n = external dso_local global i32, align 4
@sum = external dso_local local_unnamed_addr global i32, align 4
@fa = external dso_local local_unnamed_addr global [1020 x i32], align 16
@m = external dso_local local_unnamed_addr global i32, align 4
@edge = external dso_local local_unnamed_addr global [1040400 x %struct.P], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z5solvev() local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @t)
  %2 = load i32, ptr @t, align 4, !tbaa !5
  %.not62 = icmp slt i32 %2, 1
  br i1 %.not62, label %._crit_edge66, label %.lr.ph65

._crit_edge66:                                    ; preds = %._crit_edge61, %0
  ret i32 0

.lr.ph65:                                         ; preds = %0, %._crit_edge61
  %.03663 = phi i32 [ %55, %._crit_edge61 ], [ 1, %0 ]
  store i32 0, ptr @sum, align 4, !tbaa !5
  store i32 0, ptr @m, align 4, !tbaa !5
  %3 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %.not4248 = icmp slt i32 %4, 0
  br i1 %.not4248, label %._crit_edge61, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.lr.ph65
  %5 = shl nuw i32 %4, 1
  %smax = tail call i32 @llvm.smax.i32(i32 %5, i32 0)
  %6 = or disjoint i32 %smax, 1
  %wide.trip.count = zext nneg i32 %6 to i64
  %min.iters.check = icmp slt i32 %5, 8
  br i1 %min.iters.check, label %.lr.ph.preheader103, label %vector.ph

.lr.ph.preheader103:                              ; preds = %vector.body, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %vector.body ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %7 = getelementptr inbounds [1020 x i32], ptr @fa, i64 0, i64 %index
  %8 = getelementptr inbounds i8, ptr %7, i64 16
  store <4 x i32> %vec.ind, ptr %7, align 16, !tbaa !5
  store <4 x i32> %step.add, ptr %8, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %9 = icmp eq i64 %index.next, %n.vec
  br i1 %9, label %.lr.ph.preheader103, label %vector.body, !llvm.loop !9

.preheader47:                                     ; preds = %.lr.ph
  %.not = icmp eq i32 %4, 0
  br i1 %.not, label %._crit_edge61, label %.preheader43

.lr.ph:                                           ; preds = %.lr.ph.preheader103, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader103 ]
  %10 = getelementptr inbounds [1020 x i32], ptr @fa, i64 0, i64 %indvars.iv
  %11 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %11, ptr %10, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader47, label %.lr.ph, !llvm.loop !13

.preheader46:                                     ; preds = %._crit_edge
  %12 = icmp sgt i32 %15, 0
  br i1 %12, label %.preheader, label %._crit_edge61

.preheader43:                                     ; preds = %.preheader47, %._crit_edge
  %13 = phi i32 [ %15, %._crit_edge ], [ %4, %.preheader47 ]
  %indvars.iv73 = phi i64 [ %indvars.iv.next74, %._crit_edge ], [ 0, %.preheader47 ]
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph51, label %.preheader43.._crit_edge_crit_edge

.preheader43.._crit_edge_crit_edge:               ; preds = %.preheader43
  %.pre88 = sext i32 %13 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph51, %.preheader43.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre88, %.preheader43.._crit_edge_crit_edge ], [ %20, %.lr.ph51 ]
  %15 = phi i32 [ %13, %.preheader43.._crit_edge_crit_edge ], [ %19, %.lr.ph51 ]
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %16 = icmp slt i64 %indvars.iv.next74, %.pre-phi
  br i1 %16, label %.preheader43, label %.preheader46, !llvm.loop !14

.lr.ph51:                                         ; preds = %.preheader43, %.lr.ph51
  %indvars.iv70 = phi i64 [ %indvars.iv.next71, %.lr.ph51 ], [ 0, %.preheader43 ]
  %17 = getelementptr inbounds [1020 x [1020 x i32]], ptr @a, i64 0, i64 %indvars.iv73, i64 %indvars.iv70
  %18 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = icmp slt i64 %indvars.iv.next71, %20
  br i1 %21, label %.lr.ph51, label %._crit_edge, !llvm.loop !16

.preheader45:                                     ; preds = %._crit_edge55
  %22 = icmp sgt i32 %26, 0
  br i1 %22, label %.lr.ph58, label %._crit_edge61

.preheader:                                       ; preds = %.preheader46, %._crit_edge55
  %23 = phi i32 [ %26, %._crit_edge55 ], [ %15, %.preheader46 ]
  %indvars.iv79 = phi i64 [ %indvars.iv.next80, %._crit_edge55 ], [ 0, %.preheader46 ]
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph54, label %.preheader.._crit_edge55_crit_edge

.preheader.._crit_edge55_crit_edge:               ; preds = %.preheader
  %.pre89 = sext i32 %23 to i64
  br label %._crit_edge55

.lr.ph54:                                         ; preds = %.preheader
  %25 = trunc nuw nsw i64 %indvars.iv79 to i32
  br label %28

._crit_edge55:                                    ; preds = %44, %.preheader.._crit_edge55_crit_edge
  %.pre-phi90 = phi i64 [ %.pre89, %.preheader.._crit_edge55_crit_edge ], [ %45, %44 ]
  %26 = phi i32 [ %23, %.preheader.._crit_edge55_crit_edge ], [ %.pre, %44 ]
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %27 = icmp slt i64 %indvars.iv.next80, %.pre-phi90
  br i1 %27, label %.preheader, label %.preheader45, !llvm.loop !17

28:                                               ; preds = %.lr.ph54, %44
  %indvars.iv76 = phi i64 [ 0, %.lr.ph54 ], [ %indvars.iv.next77, %44 ]
  %29 = getelementptr inbounds [1020 x [1020 x i32]], ptr @b, i64 0, i64 %indvars.iv79, i64 %indvars.iv76
  %30 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %29)
  %31 = getelementptr inbounds [1020 x [1020 x i32]], ptr @a, i64 0, i64 %indvars.iv79, i64 %indvars.iv76
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = icmp eq i32 %32, -1
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br i1 %33, label %34, label %44

34:                                               ; preds = %28
  %35 = trunc nuw nsw i64 %indvars.iv76 to i32
  %36 = add nsw i32 %.pre, %35
  %37 = load i32, ptr %29, align 4, !tbaa !5
  %38 = load i32, ptr @sum, align 4, !tbaa !5
  %39 = add nsw i32 %38, %37
  store i32 %39, ptr @sum, align 4, !tbaa !5
  %40 = load i32, ptr @m, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr @m, align 4, !tbaa !5
  %42 = sext i32 %40 to i64
  %43 = getelementptr inbounds [1040400 x %struct.P], ptr @edge, i64 0, i64 %42
  store i32 %25, ptr %43, align 4, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %43, i64 4
  store i32 %36, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %43, i64 8
  store i32 %37, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %28, %34
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %45 = sext i32 %.pre to i64
  %46 = icmp slt i64 %indvars.iv.next77, %45
  br i1 %46, label %28, label %._crit_edge55, !llvm.loop !18

.preheader44:                                     ; preds = %.lr.ph58
  %47 = icmp sgt i32 %50, 0
  br i1 %47, label %.lr.ph60, label %._crit_edge61

.lr.ph58:                                         ; preds = %.preheader45, %.lr.ph58
  %indvars.iv82 = phi i64 [ %indvars.iv.next83, %.lr.ph58 ], [ 0, %.preheader45 ]
  %48 = getelementptr inbounds [1020 x i32], ptr @r, i64 0, i64 %indvars.iv82
  %49 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %48)
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %50 = load i32, ptr @n, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = icmp slt i64 %indvars.iv.next83, %51
  br i1 %52, label %.lr.ph58, label %.preheader44, !llvm.loop !19

._crit_edge61:                                    ; preds = %.lr.ph60, %.lr.ph65, %.preheader47, %.preheader46, %.preheader45, %.preheader44
  %53 = tail call noundef i32 @_Z5solvev()
  %54 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.03663, i32 noundef %53)
  %55 = add nuw nsw i32 %.03663, 1
  %56 = load i32, ptr @t, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.03663, %56
  br i1 %.not.not, label %.lr.ph65, label %._crit_edge66, !llvm.loop !20

.lr.ph60:                                         ; preds = %.preheader44, %.lr.ph60
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %.lr.ph60 ], [ 0, %.preheader44 ]
  %57 = getelementptr inbounds [1020 x i32], ptr @c, i64 0, i64 %indvars.iv85
  %58 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %57)
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %59 = load i32, ptr @n, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = icmp slt i64 %indvars.iv.next86, %60
  br i1 %61, label %.lr.ph60, label %._crit_edge61, !llvm.loop !21
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #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 = { 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 #2 = { "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 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass