; LLVM IR from eyangch/competitive-programming :: Codeforces/479 (e)

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

@N = external dso_local global i64, align 8
@A = external dso_local global i64, align 8
@B = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@ways = external dso_local global [5000 x i64], align 16
@pfx = external dso_local global [5000 x i64], align 16
@MOD = external dso_local global i64, align 8
@_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 i32, align 4
  store i32 0, ptr %1, align 4
  %9 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %10 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %12
  %14 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) @A)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) @B)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %19 = load i64, ptr @A, align 8, !tbaa !8
  %20 = add nsw i64 %19, -1
  store i64 %20, ptr @A, align 8, !tbaa !8
  %21 = load i64, ptr @B, align 8, !tbaa !8
  %22 = add nsw i64 %21, -1
  store i64 %22, ptr @B, align 8, !tbaa !8
  %23 = load i64, ptr @A, align 8, !tbaa !8
  %24 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %23
  store i64 1, ptr %24, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %25 = load i64, ptr @A, align 8, !tbaa !8
  %26 = trunc i64 %25 to i32
  store i32 %26, ptr %2, align 4, !tbaa !11
  br label %27

27:                                               ; preds = %39, %0
  %28 = load i32, ptr %2, align 4, !tbaa !11
  %29 = sext i32 %28 to i64
  %30 = load i64, ptr @N, align 8, !tbaa !8
  %31 = icmp slt i64 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %42

33:                                               ; preds = %27
  %34 = load i32, ptr %2, align 4, !tbaa !11
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %35
  %37 = load i64, ptr %36, align 8, !tbaa !8
  %38 = add nsw i64 %37, 1
  store i64 %38, ptr %36, align 8, !tbaa !8
  br label %39

39:                                               ; preds = %33
  %40 = load i32, ptr %2, align 4, !tbaa !11
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %2, align 4, !tbaa !11
  br label %27, !llvm.loop !13

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

43:                                               ; preds = %162, %42
  %44 = load i32, ptr %3, align 4, !tbaa !11
  %45 = sext i32 %44 to i64
  %46 = load i64, ptr @K, align 8, !tbaa !8
  %47 = icmp slt i64 %45, %46
  br i1 %47, label %49, label %48

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

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

50:                                               ; preds = %75, %49
  %51 = load i32, ptr %5, align 4, !tbaa !11
  %52 = sext i32 %51 to i64
  %53 = load i64, ptr @B, align 8, !tbaa !8
  %54 = icmp slt i64 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %50
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %78

56:                                               ; preds = %50
  %57 = load i32, ptr %5, align 4, !tbaa !11
  %58 = sext i32 %57 to i64
  %59 = load i64, ptr @B, align 8, !tbaa !8
  %60 = add nsw i64 %58, %59
  %61 = sub nsw i64 %60, 1
  %62 = sdiv i64 %61, 2
  %63 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !8
  %65 = load i32, ptr %5, align 4, !tbaa !11
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %66
  %68 = load i64, ptr %67, align 8, !tbaa !8
  %69 = sub nsw i64 %64, %68
  %70 = load i64, ptr @MOD, align 8, !tbaa !8
  %71 = srem i64 %69, %70
  %72 = load i32, ptr %5, align 4, !tbaa !11
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %73
  store i64 %71, ptr %74, align 8, !tbaa !8
  br label %75

75:                                               ; preds = %56
  %76 = load i32, ptr %5, align 4, !tbaa !11
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %5, align 4, !tbaa !11
  br label %50, !llvm.loop !15

78:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %79 = load i64, ptr @B, align 8, !tbaa !8
  %80 = add nsw i64 %79, 1
  %81 = trunc i64 %80 to i32
  store i32 %81, ptr %6, align 4, !tbaa !11
  br label %82

82:                                               ; preds = %133, %78
  %83 = load i32, ptr %6, align 4, !tbaa !11
  %84 = sext i32 %83 to i64
  %85 = load i64, ptr @N, align 8, !tbaa !8
  %86 = icmp slt i64 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %82
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %136

88:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %89 = load i32, ptr %6, align 4, !tbaa !11
  %90 = sext i32 %89 to i64
  %91 = load i64, ptr @B, align 8, !tbaa !8
  %92 = add nsw i64 %90, %91
  %93 = sdiv i64 %92, 2
  %94 = trunc i64 %93 to i32
  store i32 %94, ptr %7, align 4, !tbaa !11
  %95 = load i32, ptr %7, align 4, !tbaa !11
  %96 = icmp slt i32 %95, 0
  br i1 %96, label %97, label %112

97:                                               ; preds = %88
  %98 = load i64, ptr @N, align 8, !tbaa !8
  %99 = sub nsw i64 %98, 1
  %100 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %99
  %101 = load i64, ptr %100, align 8, !tbaa !8
  %102 = load i32, ptr %6, align 4, !tbaa !11
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %103
  %105 = load i64, ptr %104, align 8, !tbaa !8
  %106 = sub nsw i64 %101, %105
  %107 = load i64, ptr @MOD, align 8, !tbaa !8
  %108 = srem i64 %106, %107
  %109 = load i32, ptr %6, align 4, !tbaa !11
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %110
  store i64 %108, ptr %111, align 8, !tbaa !8
  br label %132

112:                                              ; preds = %88
  %113 = load i64, ptr @N, align 8, !tbaa !8
  %114 = sub nsw i64 %113, 1
  %115 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %114
  %116 = load i64, ptr %115, align 8, !tbaa !8
  %117 = load i32, ptr %7, align 4, !tbaa !11
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %118
  %120 = load i64, ptr %119, align 8, !tbaa !8
  %121 = sub nsw i64 %116, %120
  %122 = load i32, ptr %6, align 4, !tbaa !11
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %123
  %125 = load i64, ptr %124, align 8, !tbaa !8
  %126 = sub nsw i64 %121, %125
  %127 = load i64, ptr @MOD, align 8, !tbaa !8
  %128 = srem i64 %126, %127
  %129 = load i32, ptr %6, align 4, !tbaa !11
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %130
  store i64 %128, ptr %131, align 8, !tbaa !8
  br label %132

132:                                              ; preds = %112, %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %133

133:                                              ; preds = %132
  %134 = load i32, ptr %6, align 4, !tbaa !11
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %6, align 4, !tbaa !11
  br label %82, !llvm.loop !16

136:                                              ; preds = %87
  %137 = load i64, ptr @ways, align 16, !tbaa !8
  store i64 %137, ptr @pfx, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !11
  br label %138

138:                                              ; preds = %158, %136
  %139 = load i32, ptr %8, align 4, !tbaa !11
  %140 = sext i32 %139 to i64
  %141 = load i64, ptr @N, align 8, !tbaa !8
  %142 = icmp slt i64 %140, %141
  br i1 %142, label %144, label %143

143:                                              ; preds = %138
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %161

144:                                              ; preds = %138
  %145 = load i32, ptr %8, align 4, !tbaa !11
  %146 = sub nsw i32 %145, 1
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %147
  %149 = load i64, ptr %148, align 8, !tbaa !8
  %150 = load i32, ptr %8, align 4, !tbaa !11
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %151
  %153 = load i64, ptr %152, align 8, !tbaa !8
  %154 = add nsw i64 %149, %153
  %155 = load i32, ptr %8, align 4, !tbaa !11
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %156
  store i64 %154, ptr %157, align 8, !tbaa !8
  br label %158

158:                                              ; preds = %144
  %159 = load i32, ptr %8, align 4, !tbaa !11
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %8, align 4, !tbaa !11
  br label %138, !llvm.loop !17

161:                                              ; preds = %143
  br label %162

162:                                              ; preds = %161
  %163 = load i32, ptr %3, align 4, !tbaa !11
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %3, align 4, !tbaa !11
  br label %43, !llvm.loop !18

165:                                              ; preds = %48
  %166 = load i64, ptr @N, align 8, !tbaa !8
  %167 = sub nsw i64 %166, 1
  %168 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %167
  %169 = load i64, ptr %168, align 8, !tbaa !8
  %170 = load i64, ptr @MOD, align 8, !tbaa !8
  %171 = srem i64 %169, %170
  %172 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %171)
  %173 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %172, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

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

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

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

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

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

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

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

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


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

@N = external dso_local global i64, align 8
@A = external dso_local global i64, align 8
@B = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@ways = external dso_local local_unnamed_addr global [5000 x i64], align 16
@pfx = external dso_local local_unnamed_addr global [5000 x i64], align 16
@MOD = external dso_local local_unnamed_addr global i64, align 8
@_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 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %2 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %3 = getelementptr i8, ptr %2, i64 -24
  %4 = load i64, ptr %3, align 8
  %5 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %4
  %6 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %5, ptr noundef null)
  %7 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) @A)
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(8) @B)
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %11 = load i64, ptr @A, align 8, !tbaa !8
  %12 = add nsw i64 %11, -1
  store i64 %12, ptr @A, align 8, !tbaa !8
  %13 = load i64, ptr @B, align 8, !tbaa !8
  %14 = add i64 %13, -1
  store i64 %14, ptr @B, align 8, !tbaa !8
  %15 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %12
  store i64 1, ptr %15, align 8, !tbaa !8
  %16 = load i64, ptr @N, align 8, !tbaa !8
  %sext = shl i64 %12, 32
  %17 = ashr exact i64 %sext, 32
  %18 = icmp sgt i64 %16, %17
  br i1 %18, label %.lr.ph.preheader, label %.preheader37

.lr.ph.preheader:                                 ; preds = %0
  %19 = sub i64 %16, %17
  %min.iters.check = icmp ult i64 %19, 4
  br i1 %min.iters.check, label %.lr.ph.preheader125, label %vector.ph

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

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %19, -4
  %ind.end = add i64 %17, %n.vec
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %17, %index
  %20 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %offset.idx
  %21 = getelementptr inbounds i8, ptr %20, i64 16
  %wide.load = load <2 x i64>, ptr %20, align 8, !tbaa !8
  %wide.load121 = load <2 x i64>, ptr %21, align 8, !tbaa !8
  %22 = add nsw <2 x i64> %wide.load, <i64 1, i64 1>
  %23 = add nsw <2 x i64> %wide.load121, <i64 1, i64 1>
  store <2 x i64> %22, ptr %20, align 8, !tbaa !8
  store <2 x i64> %23, ptr %21, align 8, !tbaa !8
  %index.next = add nuw i64 %index, 4
  %24 = icmp eq i64 %index.next, %n.vec
  br i1 %24, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %19, %n.vec
  br i1 %cmp.n, label %.preheader37, label %.lr.ph.preheader125

.preheader37:                                     ; preds = %.lr.ph, %middle.block, %0
  %25 = load i64, ptr @K, align 8, !tbaa !8
  %26 = icmp sgt i64 %25, 0
  %.pre = load i64, ptr @MOD, align 8
  br i1 %26, label %.preheader.lr.ph, label %.preheader37.._crit_edge51_crit_edge

.preheader37.._crit_edge51_crit_edge:             ; preds = %.preheader37
  %.pre112 = add nsw i64 %16, -1
  br label %._crit_edge51

.preheader.lr.ph:                                 ; preds = %.preheader37
  %27 = icmp sgt i64 %13, 1
  %28 = add i64 %13, -2
  %29 = trunc i64 %14 to i32
  %.02541 = add i32 %29, 1
  %30 = sext i32 %.02541 to i64
  %31 = icmp sgt i64 %16, %30
  %32 = add nsw i64 %16, -1
  %33 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %32
  %34 = icmp sgt i64 %16, 1
  br i1 %31, label %.preheader.us.preheader, label %.preheader.lr.ph.split

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %35 = add i64 %16, -1
  %36 = add i64 %16, -2
  %xtraiter145 = and i64 %14, 1
  %37 = icmp eq i64 %28, 0
  %unroll_iter148 = and i64 %14, -2
  %lcmp.mod147.not = icmp eq i64 %xtraiter145, 0
  %xtraiter150 = and i64 %35, 3
  %38 = icmp ult i64 %36, 3
  %unroll_iter154 = and i64 %35, -4
  %lcmp.mod153.not = icmp eq i64 %xtraiter150, 0
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge49.us
  %indvars.iv108 = phi i64 [ %indvars.iv.next109, %._crit_edge49.us ], [ 0, %.preheader.us.preheader ]
  br i1 %27, label %.lr.ph40.us.preheader, label %.lr.ph44.us.preheader

.lr.ph40.us.preheader:                            ; preds = %.preheader.us
  br i1 %37, label %.lr.ph44.us.preheader.loopexit.unr-lcssa, label %.lr.ph40.us

.lr.ph44.us.preheader.loopexit.unr-lcssa:         ; preds = %.lr.ph40.us, %.lr.ph40.us.preheader
  %indvars.iv100.unr = phi i64 [ 0, %.lr.ph40.us.preheader ], [ %indvars.iv.next101.1, %.lr.ph40.us ]
  br i1 %lcmp.mod147.not, label %.lr.ph44.us.preheader, label %.lr.ph40.us.epil

.lr.ph40.us.epil:                                 ; preds = %.lr.ph44.us.preheader.loopexit.unr-lcssa
  %39 = add i64 %28, %indvars.iv100.unr
  %40 = lshr i64 %39, 1
  %41 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %40
  %42 = load i64, ptr %41, align 8, !tbaa !8
  %43 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv100.unr
  %44 = load i64, ptr %43, align 8, !tbaa !8
  %45 = sub nsw i64 %42, %44
  %46 = srem i64 %45, %.pre
  store i64 %46, ptr %43, align 8, !tbaa !8
  br label %.lr.ph44.us.preheader

.lr.ph44.us.preheader:                            ; preds = %.lr.ph40.us.epil, %.lr.ph44.us.preheader.loopexit.unr-lcssa, %.preheader.us
  %47 = load i64, ptr %33, align 8, !tbaa !8
  br label %.lr.ph44.us

._crit_edge49.us.loopexit.unr-lcssa:              ; preds = %.lr.ph48.us, %.lr.ph48.us.preheader
  %.unr152 = phi i64 [ %105, %.lr.ph48.us.preheader ], [ %68, %.lr.ph48.us ]
  %indvars.iv104.unr = phi i64 [ 1, %.lr.ph48.us.preheader ], [ %indvars.iv.next105.3, %.lr.ph48.us ]
  br i1 %lcmp.mod153.not, label %._crit_edge49.us, label %.lr.ph48.us.epil

.lr.ph48.us.epil:                                 ; preds = %._crit_edge49.us.loopexit.unr-lcssa, %.lr.ph48.us.epil
  %48 = phi i64 [ %51, %.lr.ph48.us.epil ], [ %.unr152, %._crit_edge49.us.loopexit.unr-lcssa ]
  %indvars.iv104.epil = phi i64 [ %indvars.iv.next105.epil, %.lr.ph48.us.epil ], [ %indvars.iv104.unr, %._crit_edge49.us.loopexit.unr-lcssa ]
  %epil.iter151 = phi i64 [ %epil.iter151.next, %.lr.ph48.us.epil ], [ 0, %._crit_edge49.us.loopexit.unr-lcssa ]
  %49 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv104.epil
  %50 = load i64, ptr %49, align 8, !tbaa !8
  %51 = add nsw i64 %50, %48
  %52 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %indvars.iv104.epil
  store i64 %51, ptr %52, align 8, !tbaa !8
  %indvars.iv.next105.epil = add nuw nsw i64 %indvars.iv104.epil, 1
  %epil.iter151.next = add i64 %epil.iter151, 1
  %epil.iter151.cmp.not = icmp eq i64 %epil.iter151.next, %xtraiter150
  br i1 %epil.iter151.cmp.not, label %._crit_edge49.us, label %.lr.ph48.us.epil, !llvm.loop !15

._crit_edge49.us:                                 ; preds = %._crit_edge49.us.loopexit.unr-lcssa, %.lr.ph48.us.epil, %._crit_edge45.us
  %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
  %exitcond111.not = icmp eq i64 %indvars.iv.next109, %25
  br i1 %exitcond111.not, label %._crit_edge51, label %.preheader.us, !llvm.loop !17

.lr.ph48.us:                                      ; preds = %.lr.ph48.us.preheader, %.lr.ph48.us
  %53 = phi i64 [ %68, %.lr.ph48.us ], [ %105, %.lr.ph48.us.preheader ]
  %indvars.iv104 = phi i64 [ %indvars.iv.next105.3, %.lr.ph48.us ], [ 1, %.lr.ph48.us.preheader ]
  %niter155 = phi i64 [ %niter155.next.3, %.lr.ph48.us ], [ 0, %.lr.ph48.us.preheader ]
  %54 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv104
  %55 = load i64, ptr %54, align 8, !tbaa !8
  %56 = add nsw i64 %55, %53
  %57 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %indvars.iv104
  store i64 %56, ptr %57, align 8, !tbaa !8
  %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
  %58 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv.next105
  %59 = load i64, ptr %58, align 8, !tbaa !8
  %60 = add nsw i64 %59, %56
  %61 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %indvars.iv.next105
  store i64 %60, ptr %61, align 8, !tbaa !8
  %indvars.iv.next105.1 = add nuw nsw i64 %indvars.iv104, 2
  %62 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv.next105.1
  %63 = load i64, ptr %62, align 8, !tbaa !8
  %64 = add nsw i64 %63, %60
  %65 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %indvars.iv.next105.1
  store i64 %64, ptr %65, align 8, !tbaa !8
  %indvars.iv.next105.2 = add nuw nsw i64 %indvars.iv104, 3
  %66 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv.next105.2
  %67 = load i64, ptr %66, align 8, !tbaa !8
  %68 = add nsw i64 %67, %64
  %69 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %indvars.iv.next105.2
  store i64 %68, ptr %69, align 8, !tbaa !8
  %indvars.iv.next105.3 = add nuw nsw i64 %indvars.iv104, 4
  %niter155.next.3 = add i64 %niter155, 4
  %niter155.ncmp.3 = icmp eq i64 %niter155.next.3, %unroll_iter154
  br i1 %niter155.ncmp.3, label %._crit_edge49.us.loopexit.unr-lcssa, label %.lr.ph48.us, !llvm.loop !18

.lr.ph44.us:                                      ; preds = %.lr.ph44.us.preheader, %84
  %70 = phi i64 [ %87, %84 ], [ %30, %.lr.ph44.us.preheader ]
  %.02542.us = phi i32 [ %.025.us, %84 ], [ %.02541, %.lr.ph44.us.preheader ]
  %71 = add nsw i64 %70, %14
  %72 = sdiv i64 %71, 2
  %73 = and i64 %72, 2147483648
  %.not.us = icmp eq i64 %73, 0
  br i1 %.not.us, label %77, label %74

74:                                               ; preds = %.lr.ph44.us
  %75 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %70
  %76 = load i64, ptr %75, align 8, !tbaa !8
  br label %84

77:                                               ; preds = %.lr.ph44.us
  %78 = and i64 %72, 2147483647
  %79 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !8
  %81 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %70
  %82 = load i64, ptr %81, align 8, !tbaa !8
  %83 = add i64 %80, %82
  br label %84

84:                                               ; preds = %77, %74
  %.sink = phi i64 [ %83, %77 ], [ %76, %74 ]
  %.sink116 = phi ptr [ %81, %77 ], [ %75, %74 ]
  %85 = sub i64 %47, %.sink
  %86 = srem i64 %85, %.pre
  store i64 %86, ptr %.sink116, align 8, !tbaa !8
  %.025.us = add i32 %.02542.us, 1
  %87 = sext i32 %.025.us to i64
  %88 = icmp sgt i64 %16, %87
  br i1 %88, label %.lr.ph44.us, label %._crit_edge45.us, !llvm.loop !19

.lr.ph40.us:                                      ; preds = %.lr.ph40.us.preheader, %.lr.ph40.us
  %indvars.iv100 = phi i64 [ %indvars.iv.next101.1, %.lr.ph40.us ], [ 0, %.lr.ph40.us.preheader ]
  %niter149 = phi i64 [ %niter149.next.1, %.lr.ph40.us ], [ 0, %.lr.ph40.us.preheader ]
  %89 = add i64 %28, %indvars.iv100
  %90 = lshr i64 %89, 1
  %91 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %90
  %92 = load i64, ptr %91, align 8, !tbaa !8
  %93 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv100
  %94 = load i64, ptr %93, align 16, !tbaa !8
  %95 = sub nsw i64 %92, %94
  %96 = srem i64 %95, %.pre
  store i64 %96, ptr %93, align 16, !tbaa !8
  %indvars.iv.next101 = or disjoint i64 %indvars.iv100, 1
  %97 = add i64 %28, %indvars.iv.next101
  %98 = lshr i64 %97, 1
  %99 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %98
  %100 = load i64, ptr %99, align 8, !tbaa !8
  %101 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv.next101
  %102 = load i64, ptr %101, align 8, !tbaa !8
  %103 = sub nsw i64 %100, %102
  %104 = srem i64 %103, %.pre
  store i64 %104, ptr %101, align 8, !tbaa !8
  %indvars.iv.next101.1 = add nuw nsw i64 %indvars.iv100, 2
  %niter149.next.1 = add i64 %niter149, 2
  %niter149.ncmp.1 = icmp eq i64 %niter149.next.1, %unroll_iter148
  br i1 %niter149.ncmp.1, label %.lr.ph44.us.preheader.loopexit.unr-lcssa, label %.lr.ph40.us, !llvm.loop !20

._crit_edge45.us:                                 ; preds = %84
  %105 = load i64, ptr @ways, align 16, !tbaa !8
  store i64 %105, ptr @pfx, align 16, !tbaa !8
  br i1 %34, label %.lr.ph48.us.preheader, label %._crit_edge49.us

.lr.ph48.us.preheader:                            ; preds = %._crit_edge45.us
  br i1 %38, label %._crit_edge49.us.loopexit.unr-lcssa, label %.lr.ph48.us

.preheader.lr.ph.split:                           ; preds = %.preheader.lr.ph
  br i1 %27, label %.preheader.lr.ph.split.split.us, label %.preheader.lr.ph.split.split

.preheader.lr.ph.split.split.us:                  ; preds = %.preheader.lr.ph.split
  br i1 %34, label %.preheader.us52.us.preheader, label %.preheader.us52.preheader

.preheader.us52.preheader:                        ; preds = %.preheader.lr.ph.split.split.us
  %xtraiter127 = and i64 %14, 1
  %106 = icmp eq i64 %13, 2
  %unroll_iter130 = and i64 %14, -2
  %lcmp.mod129.not = icmp eq i64 %xtraiter127, 0
  br label %.preheader.us52

.preheader.us52.us.preheader:                     ; preds = %.preheader.lr.ph.split.split.us
  %107 = add nsw i64 %16, -1
  %108 = add nsw i64 %16, -2
  %xtraiter133 = and i64 %14, 1
  %109 = icmp eq i64 %28, 0
  %unroll_iter136 = and i64 %14, -2
  %lcmp.mod135.not = icmp eq i64 %xtraiter133, 0
  %xtraiter139 = and i64 %107, 3
  %110 = icmp ult i64 %108, 3
  %unroll_iter143 = and i64 %107, -4
  %lcmp.mod142.not = icmp eq i64 %xtraiter139, 0
  br label %.preheader.us52.us

.preheader.us52.us:                               ; preds = %.preheader.us52.us.preheader, %._crit_edge49.us59.us
  %indvars.iv96 = phi i64 [ %indvars.iv.next97, %._crit_edge49.us59.us ], [ 0, %.preheader.us52.us.preheader ]
  br i1 %109, label %._crit_edge.us57.us.unr-lcssa, label %.preheader.us52.us.new

._crit_edge.us57.us.new:                          ; preds = %._crit_edge.us57.us, %._crit_edge.us57.us.new
  %111 = phi i64 [ %126, %._crit_edge.us57.us.new ], [ %152, %._crit_edge.us57.us ]
  %indvars.iv92 = phi i64 [ %indvars.iv.next93.3, %._crit_edge.us57.us.new ], [ 1, %._crit_edge.us57.us ]
  %niter144 = phi i64 [ %niter144.next.3, %._crit_edge.us57.us.new ], [ 0, %._crit_edge.us57.us ]
  %112 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv92
  %113 = load i64, ptr %112, align 8, !tbaa !8
  %114 = add nsw i64 %113, %111
  %115 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %indvars.iv92
  store i64 %114, ptr %115, align 8, !tbaa !8
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %116 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv.next93
  %117 = load i64, ptr %116, align 8, !tbaa !8
  %118 = add nsw i64 %117, %114
  %119 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %indvars.iv.next93
  store i64 %118, ptr %119, align 8, !tbaa !8
  %indvars.iv.next93.1 = add nuw nsw i64 %indvars.iv92, 2
  %120 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv.next93.1
  %121 = load i64, ptr %120, align 8, !tbaa !8
  %122 = add nsw i64 %121, %118
  %123 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %indvars.iv.next93.1
  store i64 %122, ptr %123, align 8, !tbaa !8
  %indvars.iv.next93.2 = add nuw nsw i64 %indvars.iv92, 3
  %124 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv.next93.2
  %125 = load i64, ptr %124, align 8, !tbaa !8
  %126 = add nsw i64 %125, %122
  %127 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %indvars.iv.next93.2
  store i64 %126, ptr %127, align 8, !tbaa !8
  %indvars.iv.next93.3 = add nuw nsw i64 %indvars.iv92, 4
  %niter144.next.3 = add i64 %niter144, 4
  %niter144.ncmp.3 = icmp eq i64 %niter144.next.3, %unroll_iter143
  br i1 %niter144.ncmp.3, label %._crit_edge49.us59.us.unr-lcssa, label %._crit_edge.us57.us.new, !llvm.loop !18

.preheader.us52.us.new:                           ; preds = %.preheader.us52.us, %.preheader.us52.us.new
  %indvars.iv88 = phi i64 [ %indvars.iv.next89.1, %.preheader.us52.us.new ], [ 0, %.preheader.us52.us ]
  %niter137 = phi i64 [ %niter137.next.1, %.preheader.us52.us.new ], [ 0, %.preheader.us52.us ]
  %128 = add i64 %28, %indvars.iv88
  %129 = lshr i64 %128, 1
  %130 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %129
  %131 = load i64, ptr %130, align 8, !tbaa !8
  %132 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv88
  %133 = load i64, ptr %132, align 16, !tbaa !8
  %134 = sub nsw i64 %131, %133
  %135 = srem i64 %134, %.pre
  store i64 %135, ptr %132, align 16, !tbaa !8
  %indvars.iv.next89 = or disjoint i64 %indvars.iv88, 1
  %136 = add i64 %28, %indvars.iv.next89
  %137 = lshr i64 %136, 1
  %138 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %137
  %139 = load i64, ptr %138, align 8, !tbaa !8
  %140 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv.next89
  %141 = load i64, ptr %140, align 8, !tbaa !8
  %142 = sub nsw i64 %139, %141
  %143 = srem i64 %142, %.pre
  store i64 %143, ptr %140, align 8, !tbaa !8
  %indvars.iv.next89.1 = add nuw nsw i64 %indvars.iv88, 2
  %niter137.next.1 = add i64 %niter137, 2
  %niter137.ncmp.1 = icmp eq i64 %niter137.next.1, %unroll_iter136
  br i1 %niter137.ncmp.1, label %._crit_edge.us57.us.unr-lcssa, label %.preheader.us52.us.new, !llvm.loop !20

._crit_edge.us57.us.unr-lcssa:                    ; preds = %.preheader.us52.us.new, %.preheader.us52.us
  %indvars.iv88.unr = phi i64 [ 0, %.preheader.us52.us ], [ %indvars.iv.next89.1, %.preheader.us52.us.new ]
  br i1 %lcmp.mod135.not, label %._crit_edge.us57.us, label %._crit_edge.us57.us.epilog-lcssa

._crit_edge.us57.us.epilog-lcssa:                 ; preds = %._crit_edge.us57.us.unr-lcssa
  %144 = add i64 %28, %indvars.iv88.unr
  %145 = lshr i64 %144, 1
  %146 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %145
  %147 = load i64, ptr %146, align 8, !tbaa !8
  %148 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv88.unr
  %149 = load i64, ptr %148, align 8, !tbaa !8
  %150 = sub nsw i64 %147, %149
  %151 = srem i64 %150, %.pre
  store i64 %151, ptr %148, align 8, !tbaa !8
  br label %._crit_edge.us57.us

._crit_edge.us57.us:                              ; preds = %._crit_edge.us57.us.unr-lcssa, %._crit_edge.us57.us.epilog-lcssa
  %152 = load i64, ptr @ways, align 16, !tbaa !8
  store i64 %152, ptr @pfx, align 16, !tbaa !8
  br i1 %110, label %._crit_edge49.us59.us.unr-lcssa, label %._crit_edge.us57.us.new

._crit_edge49.us59.us.unr-lcssa:                  ; preds = %._crit_edge.us57.us.new, %._crit_edge.us57.us
  %.unr141 = phi i64 [ %152, %._crit_edge.us57.us ], [ %126, %._crit_edge.us57.us.new ]
  %indvars.iv92.unr = phi i64 [ 1, %._crit_edge.us57.us ], [ %indvars.iv.next93.3, %._crit_edge.us57.us.new ]
  br i1 %lcmp.mod142.not, label %._crit_edge49.us59.us, label %.epil.preheader138

.epil.preheader138:                               ; preds = %._crit_edge49.us59.us.unr-lcssa, %.epil.preheader138
  %153 = phi i64 [ %156, %.epil.preheader138 ], [ %.unr141, %._crit_edge49.us59.us.unr-lcssa ]
  %indvars.iv92.epil = phi i64 [ %indvars.iv.next93.epil, %.epil.preheader138 ], [ %indvars.iv92.unr, %._crit_edge49.us59.us.unr-lcssa ]
  %epil.iter140 = phi i64 [ %epil.iter140.next, %.epil.preheader138 ], [ 0, %._crit_edge49.us59.us.unr-lcssa ]
  %154 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv92.epil
  %155 = load i64, ptr %154, align 8, !tbaa !8
  %156 = add nsw i64 %155, %153
  %157 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %indvars.iv92.epil
  store i64 %156, ptr %157, align 8, !tbaa !8
  %indvars.iv.next93.epil = add nuw nsw i64 %indvars.iv92.epil, 1
  %epil.iter140.next = add i64 %epil.iter140, 1
  %epil.iter140.cmp.not = icmp eq i64 %epil.iter140.next, %xtraiter139
  br i1 %epil.iter140.cmp.not, label %._crit_edge49.us59.us, label %.epil.preheader138, !llvm.loop !21

._crit_edge49.us59.us:                            ; preds = %.epil.preheader138, %._crit_edge49.us59.us.unr-lcssa
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %exitcond99.not = icmp eq i64 %indvars.iv.next97, %25
  br i1 %exitcond99.not, label %._crit_edge51, label %.preheader.us52.us, !llvm.loop !17

.preheader.us52:                                  ; preds = %.preheader.us52.preheader, %._crit_edge.us57
  %indvars.iv84 = phi i64 [ %indvars.iv.next85, %._crit_edge.us57 ], [ 0, %.preheader.us52.preheader ]
  br i1 %106, label %._crit_edge.us57.unr-lcssa, label %.preheader.us52.new

.preheader.us52.new:                              ; preds = %.preheader.us52, %.preheader.us52.new
  %indvars.iv80 = phi i64 [ %indvars.iv.next81.1, %.preheader.us52.new ], [ 0, %.preheader.us52 ]
  %niter131 = phi i64 [ %niter131.next.1, %.preheader.us52.new ], [ 0, %.preheader.us52 ]
  %158 = add i64 %28, %indvars.iv80
  %159 = lshr i64 %158, 1
  %160 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %159
  %161 = load i64, ptr %160, align 8, !tbaa !8
  %162 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv80
  %163 = load i64, ptr %162, align 16, !tbaa !8
  %164 = sub nsw i64 %161, %163
  %165 = srem i64 %164, %.pre
  store i64 %165, ptr %162, align 16, !tbaa !8
  %indvars.iv.next81 = or disjoint i64 %indvars.iv80, 1
  %166 = add i64 %28, %indvars.iv.next81
  %167 = lshr i64 %166, 1
  %168 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %167
  %169 = load i64, ptr %168, align 8, !tbaa !8
  %170 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv.next81
  %171 = load i64, ptr %170, align 8, !tbaa !8
  %172 = sub nsw i64 %169, %171
  %173 = srem i64 %172, %.pre
  store i64 %173, ptr %170, align 8, !tbaa !8
  %indvars.iv.next81.1 = add nuw nsw i64 %indvars.iv80, 2
  %niter131.next.1 = add i64 %niter131, 2
  %niter131.ncmp.1 = icmp eq i64 %niter131.next.1, %unroll_iter130
  br i1 %niter131.ncmp.1, label %._crit_edge.us57.unr-lcssa, label %.preheader.us52.new, !llvm.loop !20

._crit_edge.us57.unr-lcssa:                       ; preds = %.preheader.us52.new, %.preheader.us52
  %indvars.iv80.unr = phi i64 [ 0, %.preheader.us52 ], [ %indvars.iv.next81.1, %.preheader.us52.new ]
  br i1 %lcmp.mod129.not, label %._crit_edge.us57, label %._crit_edge.us57.epilog-lcssa

._crit_edge.us57.epilog-lcssa:                    ; preds = %._crit_edge.us57.unr-lcssa
  %174 = add i64 %28, %indvars.iv80.unr
  %175 = lshr i64 %174, 1
  %176 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %175
  %177 = load i64, ptr %176, align 8, !tbaa !8
  %178 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv80.unr
  %179 = load i64, ptr %178, align 8, !tbaa !8
  %180 = sub nsw i64 %177, %179
  %181 = srem i64 %180, %.pre
  store i64 %181, ptr %178, align 8, !tbaa !8
  br label %._crit_edge.us57

._crit_edge.us57:                                 ; preds = %._crit_edge.us57.unr-lcssa, %._crit_edge.us57.epilog-lcssa
  %182 = load i64, ptr @ways, align 16, !tbaa !8
  store i64 %182, ptr @pfx, align 16, !tbaa !8
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  %exitcond87.not = icmp eq i64 %indvars.iv.next85, %25
  br i1 %exitcond87.not, label %._crit_edge51, label %.preheader.us52, !llvm.loop !17

.preheader.lr.ph.split.split:                     ; preds = %.preheader.lr.ph.split
  %183 = load i64, ptr @ways, align 16, !tbaa !8
  store i64 %183, ptr @pfx, align 16, !tbaa !8
  br i1 %34, label %.preheader.us60.preheader, label %._crit_edge51

.preheader.us60.preheader:                        ; preds = %.preheader.lr.ph.split.split
  %184 = add nsw i64 %16, -1
  %185 = add nsw i64 %16, -2
  %xtraiter = and i64 %184, 3
  %186 = icmp ult i64 %185, 3
  %unroll_iter = and i64 %184, -4
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader.us60

.preheader.us60:                                  ; preds = %.preheader.us60.preheader, %._crit_edge49.us64
  %indvars.iv76 = phi i64 [ %indvars.iv.next77, %._crit_edge49.us64 ], [ 0, %.preheader.us60.preheader ]
  br i1 %186, label %._crit_edge49.us64.unr-lcssa, label %.preheader.us60.new

.preheader.us60.new:                              ; preds = %.preheader.us60, %.preheader.us60.new
  %187 = phi i64 [ %202, %.preheader.us60.new ], [ %183, %.preheader.us60 ]
  %indvars.iv73 = phi i64 [ %indvars.iv.next74.3, %.preheader.us60.new ], [ 1, %.preheader.us60 ]
  %niter = phi i64 [ %niter.next.3, %.preheader.us60.new ], [ 0, %.preheader.us60 ]
  %188 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv73
  %189 = load i64, ptr %188, align 8, !tbaa !8
  %190 = add nsw i64 %189, %187
  %191 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %indvars.iv73
  store i64 %190, ptr %191, align 8, !tbaa !8
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %192 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv.next74
  %193 = load i64, ptr %192, align 8, !tbaa !8
  %194 = add nsw i64 %193, %190
  %195 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %indvars.iv.next74
  store i64 %194, ptr %195, align 8, !tbaa !8
  %indvars.iv.next74.1 = add nuw nsw i64 %indvars.iv73, 2
  %196 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv.next74.1
  %197 = load i64, ptr %196, align 8, !tbaa !8
  %198 = add nsw i64 %197, %194
  %199 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %indvars.iv.next74.1
  store i64 %198, ptr %199, align 8, !tbaa !8
  %indvars.iv.next74.2 = add nuw nsw i64 %indvars.iv73, 3
  %200 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv.next74.2
  %201 = load i64, ptr %200, align 8, !tbaa !8
  %202 = add nsw i64 %201, %198
  %203 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %indvars.iv.next74.2
  store i64 %202, ptr %203, align 8, !tbaa !8
  %indvars.iv.next74.3 = add nuw nsw i64 %indvars.iv73, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge49.us64.unr-lcssa, label %.preheader.us60.new, !llvm.loop !18

._crit_edge49.us64.unr-lcssa:                     ; preds = %.preheader.us60.new, %.preheader.us60
  %.unr = phi i64 [ %183, %.preheader.us60 ], [ %202, %.preheader.us60.new ]
  %indvars.iv73.unr = phi i64 [ 1, %.preheader.us60 ], [ %indvars.iv.next74.3, %.preheader.us60.new ]
  br i1 %lcmp.mod.not, label %._crit_edge49.us64, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge49.us64.unr-lcssa, %.epil.preheader
  %204 = phi i64 [ %207, %.epil.preheader ], [ %.unr, %._crit_edge49.us64.unr-lcssa ]
  %indvars.iv73.epil = phi i64 [ %indvars.iv.next74.epil, %.epil.preheader ], [ %indvars.iv73.unr, %._crit_edge49.us64.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge49.us64.unr-lcssa ]
  %205 = getelementptr inbounds [5000 x i64], ptr @ways, i64 0, i64 %indvars.iv73.epil
  %206 = load i64, ptr %205, align 8, !tbaa !8
  %207 = add nsw i64 %206, %204
  %208 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %indvars.iv73.epil
  store i64 %207, ptr %208, align 8, !tbaa !8
  %indvars.iv.next74.epil = add nuw nsw i64 %indvars.iv73.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge49.us64, label %.epil.preheader, !llvm.loop !22

._crit_edge49.us64:                               ; preds = %.epil.preheader, %._crit_edge49.us64.unr-lcssa
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next77, %25
  br i1 %exitcond79.not, label %._crit_edge51, label %.preheader.us60, !llvm.loop !17

.lr.ph:                                           ; preds = %.lr.ph.preheader125, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader125 ]
  %209 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %indvars.iv
  %210 = load i64, ptr %209, align 8, !tbaa !8
  %211 = add nsw i64 %210, 1
  store i64 %211, ptr %209, align 8, !tbaa !8
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %212 = icmp sgt i64 %16, %indvars.iv.next
  br i1 %212, label %.lr.ph, label %.preheader37, !llvm.loop !23

._crit_edge51:                                    ; preds = %._crit_edge49.us64, %._crit_edge.us57, %._crit_edge49.us59.us, %._crit_edge49.us, %.preheader.lr.ph.split.split, %.preheader37.._crit_edge51_crit_edge
  %.pre-phi = phi i64 [ %.pre112, %.preheader37.._crit_edge51_crit_edge ], [ %32, %.preheader.lr.ph.split.split ], [ %32, %._crit_edge49.us ], [ %32, %._crit_edge49.us59.us ], [ %32, %._crit_edge.us57 ], [ %32, %._crit_edge49.us64 ]
  %213 = getelementptr inbounds [5000 x i64], ptr @pfx, i64 0, i64 %.pre-phi
  %214 = load i64, ptr %213, align 8, !tbaa !8
  %215 = srem i64 %214, %.pre
  %216 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %215)
  %217 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %216, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !16}
!22 = distinct !{!22, !16}
!23 = distinct !{!23, !12, !14, !13}


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