; LLVM IR from bqi343/cp-notebook :: Contests/USACO Training/Ch 4/4.2 ditch (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"

%"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@rate = external dso_local global [201 x [201 x i32]], align 16
@prevnode = external dso_local global [201 x i32], align 16
@flow = external dso_local global [201 x i32], align 16
@visit = external dso_local global [201 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

19:                                               ; preds = %35, %0
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %38

24:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %28 = load i32, ptr %7, align 4, !tbaa !5
  %29 = load i32, ptr %5, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [201 x [201 x i32]], ptr @rate, i64 0, i64 %30
  %32 = load i32, ptr %6, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [201 x i32], ptr %31, i64 0, i64 %33
  store i32 %28, ptr %34, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %35

35:                                               ; preds = %24
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %4, align 4, !tbaa !5
  br label %19, !llvm.loop !9

38:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store i64 0, ptr %8, align 8, !tbaa !11
  br label %39

39:                                               ; preds = %194, %38
  br label %40

40:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %57, %40
  %42 = load i32, ptr %9, align 4, !tbaa !5
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  %45 = icmp slt i32 %42, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %60

47:                                               ; preds = %41
  %48 = load i32, ptr %9, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [201 x i32], ptr @prevnode, i64 0, i64 %49
  store i32 0, ptr %50, align 4, !tbaa !5
  %51 = load i32, ptr %9, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [201 x i8], ptr @visit, i64 0, i64 %52
  store i8 0, ptr %53, align 1, !tbaa !13
  %54 = load i32, ptr %9, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [201 x i32], ptr @flow, i64 0, i64 %55
  store i32 0, ptr %56, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %47
  %58 = load i32, ptr %9, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %9, align 4, !tbaa !5
  br label %41, !llvm.loop !15

60:                                               ; preds = %46
  store i32 1000000007, ptr getelementptr inbounds ([201 x i32], ptr @flow, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  br label %61

61:                                               ; preds = %144, %60
  br label %62

62:                                               ; preds = %61
  store i32 0, ptr %10, align 4, !tbaa !5
  store i32 -1, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %89, %62
  %64 = load i32, ptr %12, align 4, !tbaa !5
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  %67 = icmp slt i32 %64, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %92

69:                                               ; preds = %63
  %70 = load i32, ptr %12, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [201 x i8], ptr @visit, i64 0, i64 %71
  %73 = load i8, ptr %72, align 1, !tbaa !13, !range !16, !noundef !17
  %74 = trunc i8 %73 to i1
  br i1 %74, label %88, label %75

75:                                               ; preds = %69
  %76 = load i32, ptr %12, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [201 x i32], ptr @flow, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = load i32, ptr %10, align 4, !tbaa !5
  %81 = icmp sgt i32 %79, %80
  br i1 %81, label %82, label %88

82:                                               ; preds = %75
  %83 = load i32, ptr %12, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [201 x i32], ptr @flow, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  store i32 %86, ptr %10, align 4, !tbaa !5
  %87 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %87, ptr %11, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %82, %75, %69
  br label %89

89:                                               ; preds = %88
  %90 = load i32, ptr %12, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %12, align 4, !tbaa !5
  br label %63, !llvm.loop !18

92:                                               ; preds = %68
  %93 = load i32, ptr %11, align 4, !tbaa !5
  %94 = icmp eq i32 %93, -1
  br i1 %94, label %99, label %95

95:                                               ; preds = %92
  %96 = load i32, ptr %11, align 4, !tbaa !5
  %97 = load i32, ptr %3, align 4, !tbaa !5
  %98 = icmp eq i32 %96, %97
  br i1 %98, label %99, label %100

99:                                               ; preds = %95, %92
  br label %145

100:                                              ; preds = %95
  %101 = load i32, ptr %11, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [201 x i8], ptr @visit, i64 0, i64 %102
  store i8 1, ptr %103, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %141, %100
  %105 = load i32, ptr %13, align 4, !tbaa !5
  %106 = load i32, ptr %3, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  %108 = icmp slt i32 %105, %107
  br i1 %108, label %110, label %109

109:                                              ; preds = %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %144

110:                                              ; preds = %104
  %111 = load i32, ptr %13, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [201 x i32], ptr @flow, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = load i32, ptr %11, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [201 x [201 x i32]], ptr @rate, i64 0, i64 %116
  %118 = load i32, ptr %13, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [201 x i32], ptr %117, i64 0, i64 %119
  %121 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %120)
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = icmp slt i32 %114, %122
  br i1 %123, label %124, label %140

124:                                              ; preds = %110
  %125 = load i32, ptr %11, align 4, !tbaa !5
  %126 = load i32, ptr %13, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [201 x i32], ptr @prevnode, i64 0, i64 %127
  store i32 %125, ptr %128, align 4, !tbaa !5
  %129 = load i32, ptr %11, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [201 x [201 x i32]], ptr @rate, i64 0, i64 %130
  %132 = load i32, ptr %13, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [201 x i32], ptr %131, i64 0, i64 %133
  %135 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %134)
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = load i32, ptr %13, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [201 x i32], ptr @flow, i64 0, i64 %138
  store i32 %136, ptr %139, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %124, %110
  br label %141

141:                                              ; preds = %140
  %142 = load i32, ptr %13, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %13, align 4, !tbaa !5
  br label %104, !llvm.loop !19

144:                                              ; preds = %109
  br label %61, !llvm.loop !20

145:                                              ; preds = %99
  %146 = load i32, ptr %11, align 4, !tbaa !5
  %147 = icmp eq i32 %146, -1
  br i1 %147, label %148, label %149

148:                                              ; preds = %145
  store i32 6, ptr %14, align 4
  br label %192

149:                                              ; preds = %145
  %150 = load i64, ptr %8, align 8, !tbaa !11
  %151 = load i32, ptr %3, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [201 x i32], ptr @flow, i64 0, i64 %152
  %154 = load i32, ptr %153, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = add nsw i64 %150, %155
  store i64 %156, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %157 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %157, ptr %15, align 4, !tbaa !5
  br label %158

158:                                              ; preds = %161, %149
  %159 = load i32, ptr %15, align 4, !tbaa !5
  %160 = icmp ne i32 %159, 1
  br i1 %160, label %161, label %191

161:                                              ; preds = %158
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %162 = load i32, ptr %15, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [201 x i32], ptr @prevnode, i64 0, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !5
  store i32 %165, ptr %16, align 4, !tbaa !5
  %166 = load i32, ptr %3, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [201 x i32], ptr @flow, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = load i32, ptr %16, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [201 x [201 x i32]], ptr @rate, i64 0, i64 %171
  %173 = load i32, ptr %15, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [201 x i32], ptr %172, i64 0, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !5
  %177 = sub nsw i32 %176, %169
  store i32 %177, ptr %175, align 4, !tbaa !5
  %178 = load i32, ptr %3, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [201 x i32], ptr @flow, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = load i32, ptr %15, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [201 x [201 x i32]], ptr @rate, i64 0, i64 %183
  %185 = load i32, ptr %16, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [201 x i32], ptr %184, i64 0, i64 %186
  %188 = load i32, ptr %187, align 4, !tbaa !5
  %189 = add nsw i32 %188, %181
  store i32 %189, ptr %187, align 4, !tbaa !5
  %190 = load i32, ptr %16, align 4, !tbaa !5
  store i32 %190, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %158, !llvm.loop !21

191:                                              ; preds = %158
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  store i32 0, ptr %14, align 4
  br label %192

192:                                              ; preds = %191, %148
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %193 = load i32, ptr %14, align 4
  switch i32 %193, label %199 [
    i32 0, label %194
    i32 6, label %195
  ]

194:                                              ; preds = %192
  br label %39, !llvm.loop !22

195:                                              ; preds = %192
  %196 = load i64, ptr %8, align 8, !tbaa !11
  %197 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %196)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %198 = load i32, ptr %1, align 4
  ret i32 %198

199:                                              ; preds = %192
  unreachable
}

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

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

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

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

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

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

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

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

%"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@rate = external dso_local global [201 x [201 x i32]], align 16
@prevnode = external dso_local local_unnamed_addr global [201 x i32], align 16
@flow = external dso_local local_unnamed_addr global [201 x i32], align 16
@visit = external dso_local local_unnamed_addr global [201 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %9 = load i32, ptr %1, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %.lr.ph, %0
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  br label %23

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.055 = phi i32 [ %20, %.lr.ph ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %14 = load i32, ptr %5, align 4, !tbaa !5
  %15 = load i32, ptr %3, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [201 x [201 x i32]], ptr @rate, i64 0, i64 %16, i64 %18
  store i32 %14, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %20 = add nuw nsw i32 %.055, 1
  %21 = load i32, ptr %1, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %.lr.ph, label %.preheader, !llvm.loop !9

23:                                               ; preds = %.preheader, %._crit_edge74
  %24 = phi i32 [ %30, %._crit_edge74 ], [ %.pre, %.preheader ]
  %25 = phi i32 [ %29, %._crit_edge74 ], [ %.pre, %.preheader ]
  %.044 = phi i64 [ %88, %._crit_edge74 ], [ 0, %.preheader ]
  %.not56 = icmp slt i32 %25, 1
  br i1 %.not56, label %._crit_edge, label %.lr.ph58.preheader

.lr.ph58.preheader:                               ; preds = %23
  %26 = zext nneg i32 %25 to i64
  %27 = shl nuw nsw i64 %26, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @prevnode, i64 4), i8 0, i64 %27, i1 false), !tbaa !5
  call void @llvm.memset.p0.i64(ptr nonnull align 1 getelementptr inbounds (i8, ptr @visit, i64 1), i8 0, i64 %26, i1 false), !tbaa !11
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @flow, i64 4), i8 0, i64 %27, i1 false), !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph58.preheader, %23
  store i32 1000000007, ptr getelementptr inbounds (i8, ptr @flow, i64 4), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  %.not475999 = icmp slt i32 %25, 1
  br i1 %.not475999, label %.thread, label %.lr.ph63.preheader

.loopexit:                                        ; preds = %79, %66
  %28 = phi i32 [ %30, %66 ], [ %80, %79 ]
  store i32 0, ptr %6, align 4, !tbaa !5
  %.not4759 = icmp slt i32 %28, 1
  br i1 %.not4759, label %.thread, label %.lr.ph63.preheader, !llvm.loop !13

.lr.ph63.preheader:                               ; preds = %._crit_edge, %.loopexit
  %29 = phi i32 [ %28, %.loopexit ], [ %25, %._crit_edge ]
  %30 = phi i32 [ %28, %.loopexit ], [ %24, %._crit_edge ]
  %31 = zext nneg i32 %29 to i64
  %xtraiter = and i64 %31, 1
  %32 = icmp eq i32 %29, 1
  br i1 %32, label %._crit_edge64.unr-lcssa, label %.lr.ph63.preheader.new

.lr.ph63.preheader.new:                           ; preds = %.lr.ph63.preheader
  %unroll_iter = and i64 %31, 2147483646
  br label %.lr.ph63

._crit_edge64.unr-lcssa:                          ; preds = %64, %.lr.ph63.preheader
  %.1.lcssa.ph = phi i32 [ poison, %.lr.ph63.preheader ], [ %.1.1, %64 ]
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph63.preheader ], [ %indvars.iv.next.1, %64 ]
  %.04260.unr = phi i32 [ -1, %.lr.ph63.preheader ], [ %.1.1, %64 ]
  %.unr = phi i32 [ 0, %.lr.ph63.preheader ], [ %65, %64 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge64, label %.lr.ph63.epil

.lr.ph63.epil:                                    ; preds = %._crit_edge64.unr-lcssa
  %33 = getelementptr inbounds [201 x i8], ptr @visit, i64 0, i64 %indvars.iv.unr
  %34 = load i8, ptr %33, align 1, !tbaa !11, !range !14, !noundef !15
  %35 = trunc nuw i8 %34 to i1
  br i1 %35, label %._crit_edge64, label %36

36:                                               ; preds = %.lr.ph63.epil
  %37 = getelementptr inbounds [201 x i32], ptr @flow, i64 0, i64 %indvars.iv.unr
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = icmp sgt i32 %38, %.unr
  br i1 %39, label %40, label %._crit_edge64

40:                                               ; preds = %36
  store i32 %38, ptr %6, align 4, !tbaa !5
  %41 = trunc nuw nsw i64 %indvars.iv.unr to i32
  br label %._crit_edge64

._crit_edge64:                                    ; preds = %.lr.ph63.epil, %36, %40, %._crit_edge64.unr-lcssa
  %.1.lcssa = phi i32 [ %.1.lcssa.ph, %._crit_edge64.unr-lcssa ], [ %.04260.unr, %.lr.ph63.epil ], [ %41, %40 ], [ %.04260.unr, %36 ]
  %42 = icmp eq i32 %.1.lcssa, -1
  %43 = icmp eq i32 %.1.lcssa, %29
  %or.cond = or i1 %42, %43
  br i1 %or.cond, label %82, label %66

.lr.ph63:                                         ; preds = %64, %.lr.ph63.preheader.new
  %indvars.iv = phi i64 [ 1, %.lr.ph63.preheader.new ], [ %indvars.iv.next.1, %64 ]
  %.04260 = phi i32 [ -1, %.lr.ph63.preheader.new ], [ %.1.1, %64 ]
  %44 = phi i32 [ 0, %.lr.ph63.preheader.new ], [ %65, %64 ]
  %niter = phi i64 [ 0, %.lr.ph63.preheader.new ], [ %niter.next.1, %64 ]
  %45 = getelementptr inbounds [201 x i8], ptr @visit, i64 0, i64 %indvars.iv
  %46 = load i8, ptr %45, align 1, !tbaa !11, !range !14, !noundef !15
  %47 = trunc nuw i8 %46 to i1
  br i1 %47, label %.lr.ph63.1, label %48

48:                                               ; preds = %.lr.ph63
  %49 = getelementptr inbounds [201 x i32], ptr @flow, i64 0, i64 %indvars.iv
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = icmp sgt i32 %50, %44
  br i1 %51, label %52, label %.lr.ph63.1

52:                                               ; preds = %48
  store i32 %50, ptr %6, align 4, !tbaa !5
  %53 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.lr.ph63.1

.lr.ph63.1:                                       ; preds = %.lr.ph63, %48, %52
  %54 = phi i32 [ %44, %.lr.ph63 ], [ %50, %52 ], [ %44, %48 ]
  %.1 = phi i32 [ %.04260, %.lr.ph63 ], [ %53, %52 ], [ %.04260, %48 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %55 = getelementptr inbounds [201 x i8], ptr @visit, i64 0, i64 %indvars.iv.next
  %56 = load i8, ptr %55, align 1, !tbaa !11, !range !14, !noundef !15
  %57 = trunc nuw i8 %56 to i1
  br i1 %57, label %64, label %58

58:                                               ; preds = %.lr.ph63.1
  %59 = getelementptr inbounds [201 x i32], ptr @flow, i64 0, i64 %indvars.iv.next
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = icmp sgt i32 %60, %54
  br i1 %61, label %62, label %64

62:                                               ; preds = %58
  store i32 %60, ptr %6, align 4, !tbaa !5
  %63 = trunc nuw nsw i64 %indvars.iv.next to i32
  br label %64

64:                                               ; preds = %62, %58, %.lr.ph63.1
  %65 = phi i32 [ %54, %.lr.ph63.1 ], [ %60, %62 ], [ %54, %58 ]
  %.1.1 = phi i32 [ %.1, %.lr.ph63.1 ], [ %63, %62 ], [ %.1, %58 ]
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge64.unr-lcssa, label %.lr.ph63, !llvm.loop !16

66:                                               ; preds = %._crit_edge64
  %67 = sext i32 %.1.lcssa to i64
  %68 = getelementptr inbounds [201 x i8], ptr @visit, i64 0, i64 %67
  store i8 1, ptr %68, align 1, !tbaa !11
  %.not4866 = icmp slt i32 %30, 1
  br i1 %.not4866, label %.loopexit, label %.lr.ph69

.lr.ph69:                                         ; preds = %66, %79
  %indvars.iv78 = phi i64 [ %indvars.iv.next79, %79 ], [ 1, %66 ]
  %69 = getelementptr inbounds [201 x i32], ptr @flow, i64 0, i64 %indvars.iv78
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = getelementptr inbounds [201 x [201 x i32]], ptr @rate, i64 0, i64 %67, i64 %indvars.iv78
  %72 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %71)
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = icmp slt i32 %70, %73
  br i1 %74, label %75, label %79

75:                                               ; preds = %.lr.ph69
  %76 = getelementptr inbounds [201 x i32], ptr @prevnode, i64 0, i64 %indvars.iv78
  store i32 %.1.lcssa, ptr %76, align 4, !tbaa !5
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %71)
  %78 = load i32, ptr %77, align 4, !tbaa !5
  store i32 %78, ptr %69, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %.lr.ph69, %75
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %80 = load i32, ptr %2, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %.not48.not = icmp slt i64 %indvars.iv78, %81
  br i1 %.not48.not, label %.lr.ph69, label %.loopexit, !llvm.loop !17

82:                                               ; preds = %._crit_edge64
  br i1 %42, label %.thread, label %83

83:                                               ; preds = %82
  %84 = zext nneg i32 %29 to i64
  %85 = getelementptr inbounds [201 x i32], ptr @flow, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = add nsw i64 %.044, %87
  %.not4970 = icmp eq i32 %29, 1
  br i1 %.not4970, label %._crit_edge74, label %.lr.ph73

.lr.ph73:                                         ; preds = %83, %.lr.ph73
  %.03871 = phi i32 [ %91, %.lr.ph73 ], [ %29, %83 ]
  %89 = sext i32 %.03871 to i64
  %90 = getelementptr inbounds [201 x i32], ptr @prevnode, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [201 x [201 x i32]], ptr @rate, i64 0, i64 %92, i64 %89
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = sub nsw i32 %94, %86
  store i32 %95, ptr %93, align 4, !tbaa !5
  %96 = getelementptr inbounds [201 x [201 x i32]], ptr @rate, i64 0, i64 %89, i64 %92
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = add nsw i32 %97, %86
  store i32 %98, ptr %96, align 4, !tbaa !5
  %.not49 = icmp eq i32 %91, 1
  br i1 %.not49, label %._crit_edge74, label %.lr.ph73, !llvm.loop !18

._crit_edge74:                                    ; preds = %.lr.ph73, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  br label %23

.thread:                                          ; preds = %82, %._crit_edge, %.loopexit
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.044)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

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

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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; 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 #3

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

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

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


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