; LLVM IR from abeaumont/competitive-programming :: cses (2181)

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

@dp = external dso_local global [1024 x [1024 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

15:                                               ; preds = %136, %0
  %16 = load i32, ptr %4, align 4, !tbaa !9
  %17 = load i32, ptr %3, align 4, !tbaa !9
  %18 = icmp sle i32 %16, %17
  br i1 %18, label %20, label %19

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

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

21:                                               ; preds = %132, %20
  %22 = load i32, ptr %6, align 4, !tbaa !9
  %23 = load i32, ptr %2, align 4, !tbaa !9
  %24 = shl i32 1, %23
  %25 = icmp slt i32 %22, %24
  br i1 %25, label %27, label %26

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

27:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %28 = load i32, ptr %2, align 4, !tbaa !9
  %29 = shl i32 1, %28
  %30 = sub nsw i32 %29, 1
  %31 = load i32, ptr %6, align 4, !tbaa !9
  %32 = xor i32 %30, %31
  store i32 %32, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %124, %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %34 = load i32, ptr %6, align 4, !tbaa !9
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = xor i32 %34, %35
  store i32 %36, ptr %11, align 4, !tbaa !9
  %37 = load i32, ptr %2, align 4, !tbaa !9
  %38 = load i32, ptr %11, align 4, !tbaa !9
  %39 = call i32 @llvm.ctpop.i32(i32 %38)
  %40 = sub nsw i32 %37, %39
  %41 = srem i32 %40, 2
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %33
  store i32 9, ptr %5, align 4
  br label %121

44:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %45

45:                                               ; preds = %73, %44
  %46 = load i32, ptr %12, align 4, !tbaa !9
  %47 = load i32, ptr %2, align 4, !tbaa !9
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  store i32 10, ptr %5, align 4
  br label %76

50:                                               ; preds = %45
  %51 = load i32, ptr %6, align 4, !tbaa !9
  %52 = load i32, ptr %12, align 4, !tbaa !9
  %53 = shl i32 1, %52
  %54 = and i32 %51, %53
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %65, label %56

56:                                               ; preds = %50
  %57 = load i32, ptr %8, align 4, !tbaa !9
  %58 = load i32, ptr %12, align 4, !tbaa !9
  %59 = shl i32 1, %58
  %60 = and i32 %57, %59
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %65, label %62

62:                                               ; preds = %56
  %63 = load i32, ptr %9, align 4, !tbaa !9
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %9, align 4, !tbaa !9
  br label %72

65:                                               ; preds = %56, %50
  %66 = load i32, ptr %9, align 4, !tbaa !9
  %67 = srem i32 %66, 2
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %70

69:                                               ; preds = %65
  store i32 0, ptr %10, align 4, !tbaa !9
  store i32 10, ptr %5, align 4
  br label %76

70:                                               ; preds = %65
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %71

71:                                               ; preds = %70
  br label %72

72:                                               ; preds = %71, %62
  br label %73

73:                                               ; preds = %72
  %74 = load i32, ptr %12, align 4, !tbaa !9
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %12, align 4, !tbaa !9
  br label %45, !llvm.loop !11

76:                                               ; preds = %69, %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %9, align 4, !tbaa !9
  %79 = srem i32 %78, 2
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %81, label %82

81:                                               ; preds = %77
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %82

82:                                               ; preds = %81, %77
  %83 = load i32, ptr %10, align 4, !tbaa !9
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %120

85:                                               ; preds = %82
  %86 = load i32, ptr %4, align 4, !tbaa !9
  %87 = sub nsw i32 %86, 1
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [1024 x [1024 x i64]], ptr @dp, i64 0, i64 %88
  %90 = load i32, ptr %8, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [1024 x i64], ptr %89, i64 0, i64 %91
  %93 = load i64, ptr %92, align 8, !tbaa !5
  %94 = load i32, ptr %4, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [1024 x [1024 x i64]], ptr @dp, i64 0, i64 %95
  %97 = load i32, ptr %6, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [1024 x i64], ptr %96, i64 0, i64 %98
  %100 = load i64, ptr %99, align 8, !tbaa !5
  %101 = add nsw i64 %100, %93
  store i64 %101, ptr %99, align 8, !tbaa !5
  %102 = load i32, ptr %4, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [1024 x [1024 x i64]], ptr @dp, i64 0, i64 %103
  %105 = load i32, ptr %6, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [1024 x i64], ptr %104, i64 0, i64 %106
  %108 = load i64, ptr %107, align 8, !tbaa !5
  %109 = icmp sge i64 %108, 1000000007
  br i1 %109, label %110, label %119

110:                                              ; preds = %85
  %111 = load i32, ptr %4, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [1024 x [1024 x i64]], ptr @dp, i64 0, i64 %112
  %114 = load i32, ptr %6, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [1024 x i64], ptr %113, i64 0, i64 %115
  %117 = load i64, ptr %116, align 8, !tbaa !5
  %118 = sub nsw i64 %117, 1000000007
  store i64 %118, ptr %116, align 8, !tbaa !5
  br label %119

119:                                              ; preds = %110, %85
  br label %120

120:                                              ; preds = %119, %82
  store i32 0, ptr %5, align 4
  br label %121

121:                                              ; preds = %120, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  %122 = load i32, ptr %5, align 4
  switch i32 %122, label %148 [
    i32 0, label %123
    i32 9, label %124
  ]

123:                                              ; preds = %121
  br label %124

124:                                              ; preds = %123, %121
  %125 = load i32, ptr %8, align 4, !tbaa !9
  %126 = load i32, ptr %7, align 4, !tbaa !9
  %127 = sub nsw i32 %125, %126
  %128 = load i32, ptr %7, align 4, !tbaa !9
  %129 = and i32 %127, %128
  store i32 %129, ptr %8, align 4, !tbaa !9
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %33, label %131, !llvm.loop !13

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

132:                                              ; preds = %131
  %133 = load i32, ptr %6, align 4, !tbaa !9
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %6, align 4, !tbaa !9
  br label %21, !llvm.loop !14

135:                                              ; preds = %26
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %4, align 4, !tbaa !9
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %4, align 4, !tbaa !9
  br label %15, !llvm.loop !15

139:                                              ; preds = %19
  %140 = load i32, ptr %3, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [1024 x [1024 x i64]], ptr @dp, i64 0, i64 %141
  %143 = getelementptr inbounds [1024 x i64], ptr %142, i64 0, i64 0
  %144 = load i64, ptr %143, align 16, !tbaa !5
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %144)
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %145, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %147 = load i32, ptr %1, align 4
  ret i32 %147

148:                                              ; preds = %121
  unreachable
}

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.ctpop.i32(i32) #3

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

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

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

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


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

@dp = external dso_local local_unnamed_addr global [1024 x [1024 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %3 = 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)
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 1, ptr @dp, align 16, !tbaa !5
  %5 = load i32, ptr %2, align 4, !tbaa !9
  %.not59 = icmp slt i32 %5, 1
  br i1 %.not59, label %._crit_edge61, label %.preheader48.lr.ph

.preheader48.lr.ph:                               ; preds = %0
  %6 = load i32, ptr %1, align 4, !tbaa !9
  %.fr67 = freeze i32 %6
  %7 = shl nuw i32 1, %.fr67
  %.not66 = icmp eq i32 %.fr67, 31
  %8 = add nsw i32 %7, -1
  br i1 %.not66, label %._crit_edge61, label %.preheader48.lr.ph.split.us

.preheader48.lr.ph.split.us:                      ; preds = %.preheader48.lr.ph
  %9 = icmp sgt i32 %.fr67, 0
  %smax80 = call i32 @llvm.smax.i32(i32 %7, i32 1)
  %10 = add nuw i32 %5, 1
  %wide.trip.count86 = zext i32 %10 to i64
  %wide.trip.count81 = zext nneg i32 %smax80 to i64
  br i1 %9, label %.preheader48.us.us, label %.preheader48.us

.preheader48.us.us:                               ; preds = %.preheader48.lr.ph.split.us, %._crit_edge.split.us.us.us
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %._crit_edge.split.us.us.us ], [ 1, %.preheader48.lr.ph.split.us ]
  %11 = add nsw i64 %indvars.iv83, -1
  br label %.split.us.us.us.us

.split.us.us.us.us:                               ; preds = %.split57.us.us.us.us, %.preheader48.us.us
  %indvars.iv77 = phi i64 [ %indvars.iv.next78, %.split57.us.us.us.us ], [ 0, %.preheader48.us.us ]
  %12 = trunc nuw nsw i64 %indvars.iv77 to i32
  %13 = xor i32 %8, %12
  %14 = getelementptr inbounds [1024 x [1024 x i64]], ptr @dp, i64 0, i64 %indvars.iv83, i64 %indvars.iv77
  br label %15

15:                                               ; preds = %36, %.split.us.us.us.us
  %.034.us.us.us.us = phi i32 [ 0, %.split.us.us.us.us ], [ %38, %36 ]
  %16 = xor i32 %.034.us.us.us.us, %12
  %17 = call range(i32 0, 33) i32 @llvm.ctpop.i32(i32 %16)
  %18 = sub nsw i32 %.fr67, %17
  %19 = and i32 %18, 1
  %.not40.us.us.us.us = icmp eq i32 %19, 0
  br i1 %.not40.us.us.us.us, label %.preheader.us.us.us.us, label %36

20:                                               ; preds = %.preheader.us.us.us.us, %41
  %21 = phi i1 [ true, %.preheader.us.us.us.us ], [ %43, %41 ]
  %.051.us.us.us.us = phi i32 [ 0, %.preheader.us.us.us.us ], [ %42, %41 ]
  %.03250.us.us.us.us = phi i32 [ 0, %.preheader.us.us.us.us ], [ %.133.us.us.us.us, %41 ]
  %22 = shl nuw i32 1, %.051.us.us.us.us
  %23 = and i32 %22, %44
  %or.cond.us.us.us.us = icmp eq i32 %23, 0
  br i1 %or.cond.us.us.us.us, label %39, label %24

24:                                               ; preds = %20
  %25 = and i32 %.03250.us.us.us.us, 1
  %.not43.us.us.us.us = icmp eq i32 %25, 0
  br i1 %.not43.us.us.us.us, label %41, label %._crit_edge.us.us.us.us

._crit_edge.us.us.us.us:                          ; preds = %41, %24
  %.032.lcssa.us.us.us.us = phi i32 [ %.03250.us.us.us.us, %24 ], [ %.133.us.us.us.us, %41 ]
  %.lcssa.us.us.us.us = phi i1 [ %21, %24 ], [ %43, %41 ]
  %26 = and i32 %.032.lcssa.us.us.us.us, 1
  %.not44.us.us.us.us = icmp ne i32 %26, 0
  %.not45.us.us.us.us = or i1 %.not44.us.us.us.us, %.lcssa.us.us.us.us
  br i1 %.not45.us.us.us.us, label %36, label %27

27:                                               ; preds = %._crit_edge.us.us.us.us
  %28 = sext i32 %.034.us.us.us.us to i64
  %29 = getelementptr inbounds [1024 x [1024 x i64]], ptr @dp, i64 0, i64 %11, i64 %28
  %30 = load i64, ptr %29, align 8, !tbaa !5
  %31 = load i64, ptr %14, align 8, !tbaa !5
  %32 = add nsw i64 %31, %30
  store i64 %32, ptr %14, align 8, !tbaa !5
  %33 = icmp sgt i64 %32, 1000000006
  br i1 %33, label %34, label %36

34:                                               ; preds = %27
  %35 = add nsw i64 %32, -1000000007
  store i64 %35, ptr %14, align 8, !tbaa !5
  br label %36

36:                                               ; preds = %34, %27, %._crit_edge.us.us.us.us, %15
  %37 = sub nsw i32 %.034.us.us.us.us, %13
  %38 = and i32 %37, %13
  %.not46.us.us.us.us = icmp eq i32 %38, 0
  br i1 %.not46.us.us.us.us, label %.split57.us.us.us.us, label %15, !llvm.loop !11

39:                                               ; preds = %20
  %40 = add nsw i32 %.03250.us.us.us.us, 1
  br label %41

41:                                               ; preds = %39, %24
  %.133.us.us.us.us = phi i32 [ %40, %39 ], [ 0, %24 ]
  %42 = add nuw nsw i32 %.051.us.us.us.us, 1
  %43 = icmp slt i32 %42, %.fr67
  %exitcond76.not = icmp eq i32 %42, %.fr67
  br i1 %exitcond76.not, label %._crit_edge.us.us.us.us, label %20, !llvm.loop !13

.preheader.us.us.us.us:                           ; preds = %15
  %44 = or i32 %.034.us.us.us.us, %12
  br label %20

.split57.us.us.us.us:                             ; preds = %36
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %exitcond82.not = icmp eq i64 %indvars.iv.next78, %wide.trip.count81
  br i1 %exitcond82.not, label %._crit_edge.split.us.us.us, label %.split.us.us.us.us, !llvm.loop !14

._crit_edge.split.us.us.us:                       ; preds = %.split57.us.us.us.us
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %exitcond87.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count86
  br i1 %exitcond87.not, label %._crit_edge61, label %.preheader48.us.us, !llvm.loop !15

.preheader48.us:                                  ; preds = %.preheader48.lr.ph.split.us, %._crit_edge.split.us63
  %indvars.iv71 = phi i64 [ %indvars.iv.next72, %._crit_edge.split.us63 ], [ 1, %.preheader48.lr.ph.split.us ]
  %45 = add nsw i64 %indvars.iv71, -1
  br label %.split.us

.split.us:                                        ; preds = %.preheader48.us, %.split57.us
  %indvars.iv = phi i64 [ 0, %.preheader48.us ], [ %indvars.iv.next, %.split57.us ]
  %46 = trunc nuw nsw i64 %indvars.iv to i32
  %47 = xor i32 %8, %46
  %48 = getelementptr inbounds [1024 x [1024 x i64]], ptr @dp, i64 0, i64 %indvars.iv71, i64 %indvars.iv
  br label %49

49:                                               ; preds = %56, %.split.us
  %.034.us = phi i32 [ 0, %.split.us ], [ %58, %56 ]
  %50 = xor i32 %.034.us, %46
  %51 = call range(i32 0, 33) i32 @llvm.ctpop.i32(i32 %50)
  %52 = sub nsw i32 %.fr67, %51
  %53 = and i32 %52, 1
  %.not40.us = icmp eq i32 %53, 0
  br i1 %.not40.us, label %.preheader.us, label %56

54:                                               ; preds = %.preheader.us
  %55 = add nsw i64 %63, -1000000007
  store i64 %55, ptr %48, align 8, !tbaa !5
  br label %56

56:                                               ; preds = %.preheader.us, %54, %49
  %57 = sub nsw i32 %.034.us, %47
  %58 = and i32 %57, %47
  %.not46.us = icmp eq i32 %58, 0
  br i1 %.not46.us, label %.split57.us, label %49, !llvm.loop !11

.split57.us:                                      ; preds = %56
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count81
  br i1 %exitcond.not, label %._crit_edge.split.us63, label %.split.us, !llvm.loop !14

.preheader.us:                                    ; preds = %49
  %59 = sext i32 %.034.us to i64
  %60 = getelementptr inbounds [1024 x [1024 x i64]], ptr @dp, i64 0, i64 %45, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !5
  %62 = load i64, ptr %48, align 8, !tbaa !5
  %63 = add nsw i64 %62, %61
  store i64 %63, ptr %48, align 8, !tbaa !5
  %64 = icmp sgt i64 %63, 1000000006
  br i1 %64, label %54, label %56

._crit_edge.split.us63:                           ; preds = %.split57.us
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %exitcond75.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count86
  br i1 %exitcond75.not, label %._crit_edge61, label %.preheader48.us, !llvm.loop !15

._crit_edge61:                                    ; preds = %._crit_edge.split.us63, %._crit_edge.split.us.us.us, %.preheader48.lr.ph, %0
  %65 = sext i32 %5 to i64
  %66 = getelementptr inbounds [1024 x [1024 x i64]], ptr @dp, i64 0, i64 %65
  %67 = load i64, ptr %66, align 16, !tbaa !5
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %67)
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %68, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) 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 i32 @llvm.smax.i32(i32, i32) #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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) }
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 = !{!"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}


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