; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/CodeCraft 2015/Problem G (G)

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

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@dp = external dso_local global [32768 x [15 x i64]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; 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
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %12

12:                                               ; preds = %126, %0
  %13 = load i32, ptr @t, align 4, !tbaa !5
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr @t, align 4, !tbaa !5
  %15 = icmp ne i32 %13, 0
  br i1 %15, label %16, label %130

16:                                               ; preds = %12
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @K)
  call void @llvm.memset.p0.i64(ptr align 16 @dp, i8 0, i64 3932160, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = shl i32 1, %18
  store i32 %19, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %33, %16
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %36

25:                                               ; preds = %20
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = shl i32 1, %26
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [32768 x [15 x i64]], ptr @dp, i64 0, i64 %28
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [15 x i64], ptr %29, i64 0, i64 %31
  store i64 1, ptr %32, align 8, !tbaa !9
  br label %33

33:                                               ; preds = %25
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %3, align 4, !tbaa !5
  br label %20, !llvm.loop !11

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

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

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

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

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

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

48:                                               ; preds = %43
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = load i32, ptr %6, align 4, !tbaa !5
  %51 = shl i32 1, %50
  %52 = and i32 %49, %51
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %54, label %98

54:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = load i32, ptr %6, align 4, !tbaa !5
  %57 = shl i32 1, %56
  %58 = or i32 %55, %57
  store i32 %58, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %94, %54
  %60 = load i32, ptr %8, align 4, !tbaa !5
  %61 = load i32, ptr @n, align 4, !tbaa !5
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %64, label %63

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

64:                                               ; preds = %59
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = load i32, ptr %8, align 4, !tbaa !5
  %67 = shl i32 1, %66
  %68 = and i32 %65, %67
  %69 = icmp sgt i32 %68, 0
  br i1 %69, label %70, label %93

70:                                               ; preds = %64
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = load i32, ptr %8, align 4, !tbaa !5
  %73 = sub nsw i32 %71, %72
  %74 = call i32 @llvm.abs.i32(i32 %73, i1 true)
  %75 = load i32, ptr @K, align 4, !tbaa !5
  %76 = icmp sle i32 %74, %75
  br i1 %76, label %77, label %93

77:                                               ; preds = %70
  %78 = load i32, ptr %4, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [32768 x [15 x i64]], ptr @dp, i64 0, i64 %79
  %81 = load i32, ptr %8, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [15 x i64], ptr %80, i64 0, i64 %82
  %84 = load i64, ptr %83, align 8, !tbaa !9
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [32768 x [15 x i64]], ptr @dp, i64 0, i64 %86
  %88 = load i32, ptr %6, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [15 x i64], ptr %87, i64 0, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !9
  %92 = add nsw i64 %91, %84
  store i64 %92, ptr %90, align 8, !tbaa !9
  br label %93

93:                                               ; preds = %77, %70, %64
  br label %94

94:                                               ; preds = %93
  %95 = load i32, ptr %8, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %8, align 4, !tbaa !5
  br label %59, !llvm.loop !13

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

98:                                               ; preds = %97, %48
  br label %99

99:                                               ; preds = %98
  %100 = load i32, ptr %6, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %6, align 4, !tbaa !5
  br label %43, !llvm.loop !14

102:                                              ; preds = %47
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %4, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %4, align 4, !tbaa !5
  br label %37, !llvm.loop !15

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

107:                                              ; preds = %123, %106
  %108 = load i32, ptr %10, align 4, !tbaa !5
  %109 = load i32, ptr @n, align 4, !tbaa !5
  %110 = icmp slt i32 %108, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %107
  store i32 16, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %126

112:                                              ; preds = %107
  %113 = load i32, ptr %2, align 4, !tbaa !5
  %114 = sub nsw i32 %113, 1
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [32768 x [15 x i64]], ptr @dp, i64 0, i64 %115
  %117 = load i32, ptr %10, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [15 x i64], ptr %116, i64 0, i64 %118
  %120 = load i64, ptr %119, align 8, !tbaa !9
  %121 = load i64, ptr %9, align 8, !tbaa !9
  %122 = add nsw i64 %121, %120
  store i64 %122, ptr %9, align 8, !tbaa !9
  br label %123

123:                                              ; preds = %112
  %124 = load i32, ptr %10, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %10, align 4, !tbaa !5
  br label %107, !llvm.loop !16

126:                                              ; preds = %111
  %127 = load i64, ptr %9, align 8, !tbaa !9
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %127)
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %128, ptr noundef @.str.2)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %12, !llvm.loop !17

130:                                              ; preds = %12
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #1

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #6 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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !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}
!17 = distinct !{!17, !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_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@dp = external dso_local local_unnamed_addr global [32768 x [15 x i64]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %2 = load i32, ptr @t, align 4, !tbaa !5
  %3 = add nsw i32 %2, -1
  store i32 %3, ptr @t, align 4, !tbaa !5
  %.not49 = icmp eq i32 %2, 0
  br i1 %.not49, label %._crit_edge52, label %.lr.ph51

.lr.ph51:                                         ; preds = %0, %._crit_edge
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @K)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(3932160) @dp, i8 0, i64 3932160, i1 false)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = shl nuw i32 1, %5
  %7 = icmp sgt i32 %5, 0
  br i1 %7, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.lr.ph51
  %wide.trip.count = zext nneg i32 %5 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %8 = icmp ult i32 %5, 4
  br i1 %8, label %.preheader38.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %.lr.ph

.preheader38.unr-lcssa:                           ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.3, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader38, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader38.unr-lcssa, %.lr.ph.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph.epil ], [ %indvars.iv.unr, %.preheader38.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.preheader38.unr-lcssa ]
  %9 = trunc nuw nsw i64 %indvars.iv.epil to i32
  %10 = shl nuw i32 1, %9
  %11 = sext i32 %10 to i64
  %12 = getelementptr inbounds [32768 x [15 x i64]], ptr @dp, i64 0, i64 %11, i64 %indvars.iv.epil
  store i64 1, ptr %12, align 8, !tbaa !9
  %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 %.preheader38, label %.lr.ph.epil, !llvm.loop !11

.preheader38:                                     ; preds = %.lr.ph.epil, %.preheader38.unr-lcssa
  %13 = icmp sgt i32 %6, 1
  br i1 %13, label %.preheader.lr.ph, label %.preheader37

.preheader.lr.ph:                                 ; preds = %.preheader38
  %14 = load i32, ptr @K, align 4
  br i1 %7, label %.preheader.us.preheader, label %._crit_edge

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %wide.trip.count68 = zext nneg i32 %6 to i64
  %wide.trip.count63 = zext nneg i32 %5 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge.split.us.us
  %indvars.iv65 = phi i64 [ 1, %.preheader.us.preheader ], [ %indvars.iv.next66, %._crit_edge.split.us.us ]
  %15 = trunc nuw nsw i64 %indvars.iv65 to i32
  br label %16

16:                                               ; preds = %..loopexit_crit_edge.us.us, %.preheader.us
  %indvars.iv60 = phi i64 [ %indvars.iv.next61, %..loopexit_crit_edge.us.us ], [ 0, %.preheader.us ]
  %17 = trunc nuw nsw i64 %indvars.iv60 to i32
  %18 = shl nuw i32 1, %17
  %19 = and i32 %18, %15
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %.lr.ph41.us.us, label %..loopexit_crit_edge.us.us

.lr.ph41.us.us:                                   ; preds = %16
  %21 = or i32 %18, %15
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [32768 x [15 x i64]], ptr @dp, i64 0, i64 %22, i64 %indvars.iv60
  br label %24

..loopexit_crit_edge.us.us:                       ; preds = %37, %16
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %exitcond64.not = icmp eq i64 %indvars.iv.next61, %wide.trip.count63
  br i1 %exitcond64.not, label %._crit_edge.split.us.us, label %16, !llvm.loop !13

24:                                               ; preds = %37, %.lr.ph41.us.us
  %indvars.iv55 = phi i64 [ %indvars.iv.next56, %37 ], [ 0, %.lr.ph41.us.us ]
  %25 = trunc nuw nsw i64 %indvars.iv55 to i32
  %26 = shl nuw i32 1, %25
  %27 = and i32 %26, %15
  %.not35.us.us = icmp eq i32 %27, 0
  br i1 %.not35.us.us, label %37, label %28

28:                                               ; preds = %24
  %29 = sub nsw i64 %indvars.iv60, %indvars.iv55
  %30 = trunc nsw i64 %29 to i32
  %31 = tail call i32 @llvm.abs.i32(i32 %30, i1 true)
  %.not36.us.us = icmp sgt i32 %31, %14
  br i1 %.not36.us.us, label %37, label %32

32:                                               ; preds = %28
  %33 = getelementptr inbounds [32768 x [15 x i64]], ptr @dp, i64 0, i64 %indvars.iv65, i64 %indvars.iv55
  %34 = load i64, ptr %33, align 8, !tbaa !9
  %35 = load i64, ptr %23, align 8, !tbaa !9
  %36 = add nsw i64 %35, %34
  store i64 %36, ptr %23, align 8, !tbaa !9
  br label %37

37:                                               ; preds = %32, %28, %24
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %exitcond59.not = icmp eq i64 %indvars.iv.next56, %wide.trip.count63
  br i1 %exitcond59.not, label %..loopexit_crit_edge.us.us, label %24, !llvm.loop !15

._crit_edge.split.us.us:                          ; preds = %..loopexit_crit_edge.us.us
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %exitcond69.not = icmp eq i64 %indvars.iv.next66, %wide.trip.count68
  br i1 %exitcond69.not, label %.preheader37, label %.preheader.us, !llvm.loop !16

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.3, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %38 = trunc nuw nsw i64 %indvars.iv to i32
  %39 = shl nuw i32 1, %38
  %40 = zext nneg i32 %39 to i64
  %41 = getelementptr inbounds [32768 x [15 x i64]], ptr @dp, i64 0, i64 %40, i64 %indvars.iv
  store i64 1, ptr %41, align 8, !tbaa !9
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %42 = trunc nuw nsw i64 %indvars.iv.next to i32
  %43 = shl nuw i32 1, %42
  %44 = zext nneg i32 %43 to i64
  %45 = getelementptr inbounds [32768 x [15 x i64]], ptr @dp, i64 0, i64 %44, i64 %indvars.iv.next
  store i64 1, ptr %45, align 8, !tbaa !9
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %46 = trunc nuw nsw i64 %indvars.iv.next.1 to i32
  %47 = shl nuw i32 1, %46
  %48 = zext nneg i32 %47 to i64
  %49 = getelementptr inbounds [32768 x [15 x i64]], ptr @dp, i64 0, i64 %48, i64 %indvars.iv.next.1
  store i64 1, ptr %49, align 16, !tbaa !9
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %50 = trunc nuw nsw i64 %indvars.iv.next.2 to i32
  %51 = shl nuw i32 1, %50
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [32768 x [15 x i64]], ptr @dp, i64 0, i64 %52, i64 %indvars.iv.next.2
  store i64 1, ptr %53, align 8, !tbaa !9
  %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 %.preheader38.unr-lcssa, label %.lr.ph, !llvm.loop !17

.preheader37:                                     ; preds = %._crit_edge.split.us.us, %.preheader38
  br i1 %7, label %.lr.ph48, label %._crit_edge

.lr.ph48:                                         ; preds = %.preheader37
  %54 = add nsw i32 %6, -1
  %55 = sext i32 %54 to i64
  %wide.trip.count73 = zext nneg i32 %5 to i64
  %min.iters.check = icmp ult i32 %5, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph48
  %indvars.iv70.ph = phi i64 [ 0, %.lr.ph48 ], [ %n.vec, %middle.block ]
  %.02946.ph = phi i64 [ 0, %.lr.ph48 ], [ %61, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph48
  %n.vec = and i64 %wide.trip.count, 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 ], [ %58, %vector.body ]
  %vec.phi75 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %59, %vector.body ]
  %56 = getelementptr inbounds [32768 x [15 x i64]], ptr @dp, i64 0, i64 %55, i64 %index
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  %wide.load = load <2 x i64>, ptr %56, align 8, !tbaa !9
  %wide.load76 = load <2 x i64>, ptr %57, align 8, !tbaa !9
  %58 = add <2 x i64> %wide.load, %vec.phi
  %59 = add <2 x i64> %wide.load76, %vec.phi75
  %index.next = add nuw i64 %index, 4
  %60 = icmp eq i64 %index.next, %n.vec
  br i1 %60, label %middle.block, label %vector.body, !llvm.loop !18

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

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %.lr.ph51, %.preheader.lr.ph, %.preheader37
  %.029.lcssa = phi i64 [ 0, %.preheader37 ], [ 0, %.preheader.lr.ph ], [ 0, %.lr.ph51 ], [ %61, %middle.block ], [ %68, %scalar.ph ]
  %62 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.029.lcssa)
  %63 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef nonnull @.str.2)
  %64 = load i32, ptr @t, align 4, !tbaa !5
  %65 = add nsw i32 %64, -1
  store i32 %65, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %64, 0
  br i1 %.not, label %._crit_edge52, label %.lr.ph51, !llvm.loop !21

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv70 = phi i64 [ %indvars.iv.next71, %scalar.ph ], [ %indvars.iv70.ph, %scalar.ph.preheader ]
  %.02946 = phi i64 [ %68, %scalar.ph ], [ %.02946.ph, %scalar.ph.preheader ]
  %66 = getelementptr inbounds [32768 x [15 x i64]], ptr @dp, i64 0, i64 %55, i64 %indvars.iv70
  %67 = load i64, ptr %66, align 8, !tbaa !9
  %68 = add nsw i64 %67, %.02946
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %exitcond74.not = icmp eq i64 %indvars.iv.next71, %wide.trip.count73
  br i1 %exitcond74.not, label %._crit_edge, label %scalar.ph, !llvm.loop !22

._crit_edge52:                                    ; preds = %._crit_edge, %0
  ret i32 0
}

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #6

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

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

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


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