; LLVM IR from Izaron/ACM-ICPC :: Timus Online Judge/Volume 1/1009. K-based Numbers (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" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca [20 x [20 x i64]], align 16
  %5 = alloca i64, align 8
  %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 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
  %12 = 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)
  %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) %3)
  call void @llvm.lifetime.start.p0(i64 3200, ptr %4) #5
  %14 = getelementptr inbounds [20 x [20 x i64]], ptr %4, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %14, i8 0, i64 3200, i1 false)
  %15 = getelementptr inbounds [20 x [20 x i64]], ptr %4, i64 0, i64 0
  %16 = getelementptr inbounds [20 x i64], ptr %15, i64 0, i64 0
  store i64 1, ptr %16, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store i64 0, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !9
  br label %17

17:                                               ; preds = %83, %0
  %18 = load i32, ptr %6, align 4, !tbaa !9
  %19 = load i32, ptr %2, align 4, !tbaa !9
  %20 = icmp sle i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %86

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

23:                                               ; preds = %43, %22
  %24 = load i32, ptr %8, align 4, !tbaa !9
  %25 = load i32, ptr %3, align 4, !tbaa !9
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %28, label %27

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

28:                                               ; preds = %23
  %29 = load i32, ptr %6, align 4, !tbaa !9
  %30 = sub nsw i32 %29, 1
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [20 x [20 x i64]], ptr %4, i64 0, i64 %31
  %33 = load i32, ptr %8, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [20 x i64], ptr %32, i64 0, i64 %34
  %36 = load i64, ptr %35, align 8, !tbaa !5
  %37 = load i32, ptr %6, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [20 x [20 x i64]], ptr %4, i64 0, i64 %38
  %40 = getelementptr inbounds [20 x i64], ptr %39, i64 0, i64 0
  %41 = load i64, ptr %40, align 16, !tbaa !5
  %42 = add nsw i64 %41, %36
  store i64 %42, ptr %40, align 16, !tbaa !5
  br label %43

43:                                               ; preds = %28
  %44 = load i32, ptr %8, align 4, !tbaa !9
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %8, align 4, !tbaa !9
  br label %23, !llvm.loop !11

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

47:                                               ; preds = %79, %46
  %48 = load i32, ptr %9, align 4, !tbaa !9
  %49 = load i32, ptr %3, align 4, !tbaa !9
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %52, label %51

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

52:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %75, %52
  %54 = load i32, ptr %10, align 4, !tbaa !9
  %55 = load i32, ptr %3, align 4, !tbaa !9
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %53
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %78

58:                                               ; preds = %53
  %59 = load i32, ptr %6, align 4, !tbaa !9
  %60 = sub nsw i32 %59, 1
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [20 x [20 x i64]], ptr %4, i64 0, i64 %61
  %63 = load i32, ptr %10, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [20 x i64], ptr %62, i64 0, i64 %64
  %66 = load i64, ptr %65, align 8, !tbaa !5
  %67 = load i32, ptr %6, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [20 x [20 x i64]], ptr %4, i64 0, i64 %68
  %70 = load i32, ptr %9, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [20 x i64], ptr %69, i64 0, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !5
  %74 = add nsw i64 %73, %66
  store i64 %74, ptr %72, align 8, !tbaa !5
  br label %75

75:                                               ; preds = %58
  %76 = load i32, ptr %10, align 4, !tbaa !9
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %10, align 4, !tbaa !9
  br label %53, !llvm.loop !13

78:                                               ; preds = %57
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %9, align 4, !tbaa !9
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %9, align 4, !tbaa !9
  br label %47, !llvm.loop !14

82:                                               ; preds = %51
  br label %83

83:                                               ; preds = %82
  %84 = load i32, ptr %6, align 4, !tbaa !9
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %6, align 4, !tbaa !9
  br label %17, !llvm.loop !15

86:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %87

87:                                               ; preds = %102, %86
  %88 = load i32, ptr %11, align 4, !tbaa !9
  %89 = load i32, ptr %3, align 4, !tbaa !9
  %90 = icmp slt i32 %88, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %87
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %105

92:                                               ; preds = %87
  %93 = load i32, ptr %2, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [20 x [20 x i64]], ptr %4, i64 0, i64 %94
  %96 = load i32, ptr %11, align 4, !tbaa !9
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [20 x i64], ptr %95, i64 0, i64 %97
  %99 = load i64, ptr %98, align 8, !tbaa !5
  %100 = load i64, ptr %5, align 8, !tbaa !5
  %101 = add nsw i64 %100, %99
  store i64 %101, ptr %5, align 8, !tbaa !5
  br label %102

102:                                              ; preds = %92
  %103 = load i32, ptr %11, align 4, !tbaa !9
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %11, align 4, !tbaa !9
  br label %87, !llvm.loop !16

105:                                              ; preds = %91
  %106 = load i64, ptr %5, align 8, !tbaa !5
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %106)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 3200, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %108 = load i32, ptr %1, align 4
  ret i32 %108
}

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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


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

%"class.std::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" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca [20 x [20 x i64]], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %4 = 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)
  %5 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 3200, ptr nonnull %3) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(3200) %3, i8 0, i64 3200, i1 false)
  store i64 1, ptr %3, align 16, !tbaa !5
  %6 = load i32, ptr %1, align 4, !tbaa !9
  %.not36 = icmp sgt i32 %6, 0
  %.pre = load i32, ptr %2, align 4, !tbaa !9
  %7 = icmp sgt i32 %.pre, 1
  %or.cond = select i1 %.not36, i1 %7, i1 false
  br i1 %or.cond, label %.preheader28.us.us.preheader, label %.preheader

.preheader28.us.us.preheader:                     ; preds = %0
  %8 = add nuw i32 %6, 1
  %wide.trip.count67 = zext i32 %8 to i64
  %wide.trip.count = zext nneg i32 %.pre to i64
  %9 = add nsw i64 %wide.trip.count, -1
  %10 = add nsw i64 %wide.trip.count, -2
  %xtraiter = and i64 %9, 3
  %11 = icmp ult i64 %10, 3
  %unroll_iter = and i64 %9, -4
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  %xtraiter79 = and i64 %wide.trip.count, 3
  %12 = icmp ult i32 %.pre, 4
  %unroll_iter83 = and i64 %wide.trip.count, 2147483644
  %lcmp.mod82.not = icmp eq i64 %xtraiter79, 0
  br label %.preheader28.us.us

.preheader28.us.us:                               ; preds = %.preheader28.us.us.preheader, %._crit_edge35.split.us.us.us
  %indvars.iv64 = phi i64 [ 1, %.preheader28.us.us.preheader ], [ %indvars.iv.next65, %._crit_edge35.split.us.us.us ]
  %13 = add nsw i64 %indvars.iv64, -1
  %14 = getelementptr inbounds [20 x [20 x i64]], ptr %3, i64 0, i64 %indvars.iv64
  %.promoted.us.us = load i64, ptr %14, align 16, !tbaa !5
  br i1 %11, label %.preheader26.us.us.us.preheader.unr-lcssa, label %.preheader28.us.us.new

.preheader28.us.us.new:                           ; preds = %.preheader28.us.us, %.preheader28.us.us.new
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.preheader28.us.us.new ], [ 1, %.preheader28.us.us ]
  %15 = phi i64 [ %27, %.preheader28.us.us.new ], [ %.promoted.us.us, %.preheader28.us.us ]
  %niter = phi i64 [ %niter.next.3, %.preheader28.us.us.new ], [ 0, %.preheader28.us.us ]
  %16 = getelementptr inbounds [20 x [20 x i64]], ptr %3, i64 0, i64 %13, i64 %indvars.iv
  %17 = load i64, ptr %16, align 8, !tbaa !5
  %18 = add nsw i64 %15, %17
  store i64 %18, ptr %14, align 16, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %19 = getelementptr inbounds [20 x [20 x i64]], ptr %3, i64 0, i64 %13, i64 %indvars.iv.next
  %20 = load i64, ptr %19, align 8, !tbaa !5
  %21 = add nsw i64 %18, %20
  store i64 %21, ptr %14, align 16, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %22 = getelementptr inbounds [20 x [20 x i64]], ptr %3, i64 0, i64 %13, i64 %indvars.iv.next.1
  %23 = load i64, ptr %22, align 8, !tbaa !5
  %24 = add nsw i64 %21, %23
  store i64 %24, ptr %14, align 16, !tbaa !5
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %25 = getelementptr inbounds [20 x [20 x i64]], ptr %3, i64 0, i64 %13, i64 %indvars.iv.next.2
  %26 = load i64, ptr %25, align 8, !tbaa !5
  %27 = add nsw i64 %24, %26
  store i64 %27, ptr %14, align 16, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 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 %.preheader26.us.us.us.preheader.unr-lcssa, label %.preheader28.us.us.new, !llvm.loop !11

.preheader26.us.us.us.preheader.unr-lcssa:        ; preds = %.preheader28.us.us.new, %.preheader28.us.us
  %indvars.iv.unr = phi i64 [ 1, %.preheader28.us.us ], [ %indvars.iv.next.3, %.preheader28.us.us.new ]
  %.unr = phi i64 [ %.promoted.us.us, %.preheader28.us.us ], [ %27, %.preheader28.us.us.new ]
  br i1 %lcmp.mod.not, label %.preheader26.us.us.us.preheader, label %.epil.preheader

.epil.preheader:                                  ; preds = %.preheader26.us.us.us.preheader.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %.preheader26.us.us.us.preheader.unr-lcssa ]
  %28 = phi i64 [ %31, %.epil.preheader ], [ %.unr, %.preheader26.us.us.us.preheader.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %.preheader26.us.us.us.preheader.unr-lcssa ]
  %29 = getelementptr inbounds [20 x [20 x i64]], ptr %3, i64 0, i64 %13, i64 %indvars.iv.epil
  %30 = load i64, ptr %29, align 8, !tbaa !5
  %31 = add nsw i64 %28, %30
  store i64 %31, ptr %14, align 16, !tbaa !5
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.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 %.preheader26.us.us.us.preheader, label %.epil.preheader, !llvm.loop !13

.preheader26.us.us.us.preheader:                  ; preds = %.epil.preheader, %.preheader26.us.us.us.preheader.unr-lcssa
  br label %.preheader26.us.us.us

.preheader26.us.us.us:                            ; preds = %.preheader26.us.us.us.preheader, %._crit_edge.us.us.us
  %indvars.iv59 = phi i64 [ %indvars.iv.next60, %._crit_edge.us.us.us ], [ 1, %.preheader26.us.us.us.preheader ]
  %32 = getelementptr inbounds [20 x [20 x i64]], ptr %3, i64 0, i64 %indvars.iv64, i64 %indvars.iv59
  %.promoted33.us.us.us = load i64, ptr %32, align 8, !tbaa !5
  br i1 %12, label %._crit_edge.us.us.us.unr-lcssa, label %.preheader26.us.us.us.new

.preheader26.us.us.us.new:                        ; preds = %.preheader26.us.us.us, %.preheader26.us.us.us.new
  %indvars.iv54 = phi i64 [ %indvars.iv.next55.3, %.preheader26.us.us.us.new ], [ 0, %.preheader26.us.us.us ]
  %33 = phi i64 [ %45, %.preheader26.us.us.us.new ], [ %.promoted33.us.us.us, %.preheader26.us.us.us ]
  %niter84 = phi i64 [ %niter84.next.3, %.preheader26.us.us.us.new ], [ 0, %.preheader26.us.us.us ]
  %34 = getelementptr inbounds [20 x [20 x i64]], ptr %3, i64 0, i64 %13, i64 %indvars.iv54
  %35 = load i64, ptr %34, align 16, !tbaa !5
  %36 = add nsw i64 %33, %35
  store i64 %36, ptr %32, align 8, !tbaa !5
  %indvars.iv.next55 = or disjoint i64 %indvars.iv54, 1
  %37 = getelementptr inbounds [20 x [20 x i64]], ptr %3, i64 0, i64 %13, i64 %indvars.iv.next55
  %38 = load i64, ptr %37, align 8, !tbaa !5
  %39 = add nsw i64 %36, %38
  store i64 %39, ptr %32, align 8, !tbaa !5
  %indvars.iv.next55.1 = or disjoint i64 %indvars.iv54, 2
  %40 = getelementptr inbounds [20 x [20 x i64]], ptr %3, i64 0, i64 %13, i64 %indvars.iv.next55.1
  %41 = load i64, ptr %40, align 16, !tbaa !5
  %42 = add nsw i64 %39, %41
  store i64 %42, ptr %32, align 8, !tbaa !5
  %indvars.iv.next55.2 = or disjoint i64 %indvars.iv54, 3
  %43 = getelementptr inbounds [20 x [20 x i64]], ptr %3, i64 0, i64 %13, i64 %indvars.iv.next55.2
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %45 = add nsw i64 %42, %44
  store i64 %45, ptr %32, align 8, !tbaa !5
  %indvars.iv.next55.3 = add nuw nsw i64 %indvars.iv54, 4
  %niter84.next.3 = add i64 %niter84, 4
  %niter84.ncmp.3 = icmp eq i64 %niter84.next.3, %unroll_iter83
  br i1 %niter84.ncmp.3, label %._crit_edge.us.us.us.unr-lcssa, label %.preheader26.us.us.us.new, !llvm.loop !15

._crit_edge.us.us.us.unr-lcssa:                   ; preds = %.preheader26.us.us.us.new, %.preheader26.us.us.us
  %indvars.iv54.unr = phi i64 [ 0, %.preheader26.us.us.us ], [ %indvars.iv.next55.3, %.preheader26.us.us.us.new ]
  %.unr81 = phi i64 [ %.promoted33.us.us.us, %.preheader26.us.us.us ], [ %45, %.preheader26.us.us.us.new ]
  br i1 %lcmp.mod82.not, label %._crit_edge.us.us.us, label %.epil.preheader78

.epil.preheader78:                                ; preds = %._crit_edge.us.us.us.unr-lcssa, %.epil.preheader78
  %indvars.iv54.epil = phi i64 [ %indvars.iv.next55.epil, %.epil.preheader78 ], [ %indvars.iv54.unr, %._crit_edge.us.us.us.unr-lcssa ]
  %46 = phi i64 [ %49, %.epil.preheader78 ], [ %.unr81, %._crit_edge.us.us.us.unr-lcssa ]
  %epil.iter80 = phi i64 [ %epil.iter80.next, %.epil.preheader78 ], [ 0, %._crit_edge.us.us.us.unr-lcssa ]
  %47 = getelementptr inbounds [20 x [20 x i64]], ptr %3, i64 0, i64 %13, i64 %indvars.iv54.epil
  %48 = load i64, ptr %47, align 8, !tbaa !5
  %49 = add nsw i64 %46, %48
  store i64 %49, ptr %32, align 8, !tbaa !5
  %indvars.iv.next55.epil = add nuw nsw i64 %indvars.iv54.epil, 1
  %epil.iter80.next = add i64 %epil.iter80, 1
  %epil.iter80.cmp.not = icmp eq i64 %epil.iter80.next, %xtraiter79
  br i1 %epil.iter80.cmp.not, label %._crit_edge.us.us.us, label %.epil.preheader78, !llvm.loop !16

._crit_edge.us.us.us:                             ; preds = %.epil.preheader78, %._crit_edge.us.us.us.unr-lcssa
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %exitcond63.not = icmp eq i64 %indvars.iv.next60, %wide.trip.count
  br i1 %exitcond63.not, label %._crit_edge35.split.us.us.us, label %.preheader26.us.us.us, !llvm.loop !17

._crit_edge35.split.us.us.us:                     ; preds = %._crit_edge.us.us.us
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %exitcond68.not = icmp eq i64 %indvars.iv.next65, %wide.trip.count67
  br i1 %exitcond68.not, label %.preheader, label %.preheader28.us.us, !llvm.loop !18

.preheader:                                       ; preds = %._crit_edge35.split.us.us.us, %0
  %50 = icmp sgt i32 %.pre, 0
  br i1 %50, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %51 = sext i32 %6 to i64
  %wide.trip.count72 = zext nneg i32 %.pre to i64
  %min.iters.check = icmp ult i32 %.pre, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv69.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  %.02549.ph = phi i64 [ 0, %.lr.ph ], [ %57, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %wide.trip.count72, 2147483644
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %54, %vector.body ]
  %vec.phi74 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %55, %vector.body ]
  %52 = getelementptr inbounds [20 x [20 x i64]], ptr %3, i64 0, i64 %51, i64 %index
  %53 = getelementptr inbounds i8, ptr %52, i64 16
  %wide.load = load <2 x i64>, ptr %52, align 16, !tbaa !5
  %wide.load75 = load <2 x i64>, ptr %53, align 16, !tbaa !5
  %54 = add <2 x i64> %wide.load, %vec.phi
  %55 = add <2 x i64> %wide.load75, %vec.phi74
  %index.next = add nuw i64 %index, 4
  %56 = icmp eq i64 %index.next, %n.vec
  br i1 %56, label %middle.block, label %vector.body, !llvm.loop !19

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %55, %54
  %57 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count72
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %.preheader
  %.025.lcssa = phi i64 [ 0, %.preheader ], [ %57, %middle.block ], [ %61, %scalar.ph ]
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.025.lcssa)
  call void @llvm.lifetime.end.p0(i64 3200, ptr nonnull %3) #6
  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

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %scalar.ph ], [ %indvars.iv69.ph, %scalar.ph.preheader ]
  %.02549 = phi i64 [ %61, %scalar.ph ], [ %.02549.ph, %scalar.ph.preheader ]
  %59 = getelementptr inbounds [20 x [20 x i64]], ptr %3, i64 0, i64 %51, i64 %indvars.iv69
  %60 = load i64, ptr %59, align 8, !tbaa !5
  %61 = add nsw i64 %60, %.02549
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %exitcond73.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count72
  br i1 %exitcond73.not, label %._crit_edge, label %scalar.ph, !llvm.loop !22
}

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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 nosync nounwind speculatable willreturn memory(none) }
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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12, !20, !21}
!20 = !{!"llvm.loop.isvectorized", i32 1}
!21 = !{!"llvm.loop.unroll.runtime.disable"}
!22 = distinct !{!22, !12, !21, !20}


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