; LLVM IR from the-hyp0cr1t3/CC :: CSES/Dynamic Programming (Counting Tilings)

; 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" }
%"struct.std::array" = type { [1024 x i32] }
%"struct.std::array.0" = type { [1024 x %struct.Modint] }
%struct.Modint = type { i32 }

@_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 %"struct.std::array", align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::array.0", align 4
  %11 = alloca %struct.Modint, align 4
  %12 = alloca %"struct.std::array.0", align 4
  store i32 0, ptr %1, align 4
  %13 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %14 = getelementptr i8, ptr %13, i64 -24
  %15 = load i64, ptr %14, align 8
  %16 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %15
  %17 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %16, ptr noundef null)
  %18 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.start.p0(i64 4096, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 1, ptr %8, align 4, !tbaa !8
  call void @_ZNSt5arrayIiLm1024EE4fillERKi(ptr noundef nonnull align 4 dereferenceable(4096) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  store i32 0, ptr %5, align 4, !tbaa !8
  br label %21

21:                                               ; preds = %67, %0
  %22 = load i32, ptr %5, align 4, !tbaa !8
  %23 = load i32, ptr %3, align 4, !tbaa !8
  %24 = shl i32 1, %23
  %25 = icmp slt i32 %22, %24
  br i1 %25, label %26, label %70

26:                                               ; preds = %21
  %27 = load i32, ptr %5, align 4, !tbaa !8
  store i32 %27, ptr %2, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !8
  br label %28

28:                                               ; preds = %63, %26
  %29 = load i32, ptr %2, align 4, !tbaa !8
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %66

31:                                               ; preds = %28
  br label %32

32:                                               ; preds = %42, %31
  %33 = load i32, ptr %2, align 4, !tbaa !8
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %40

35:                                               ; preds = %32
  %36 = load i32, ptr %2, align 4, !tbaa !8
  %37 = xor i32 %36, -1
  %38 = and i32 %37, 1
  %39 = icmp ne i32 %38, 0
  br label %40

40:                                               ; preds = %35, %32
  %41 = phi i1 [ false, %32 ], [ %39, %35 ]
  br i1 %41, label %42, label %45

42:                                               ; preds = %40
  %43 = load i32, ptr %2, align 4, !tbaa !8
  %44 = ashr i32 %43, 1
  store i32 %44, ptr %2, align 4, !tbaa !8
  br label %32, !llvm.loop !11

45:                                               ; preds = %40
  br label %46

46:                                               ; preds = %50, %45
  %47 = load i32, ptr %2, align 4, !tbaa !8
  %48 = and i32 %47, 1
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %55

50:                                               ; preds = %46
  %51 = load i32, ptr %2, align 4, !tbaa !8
  %52 = ashr i32 %51, 1
  store i32 %52, ptr %2, align 4, !tbaa !8
  %53 = load i32, ptr %9, align 4, !tbaa !8
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %9, align 4, !tbaa !8
  br label %46, !llvm.loop !13

55:                                               ; preds = %46
  %56 = load i32, ptr %9, align 4, !tbaa !8
  %57 = and i32 %56, 1
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %63

59:                                               ; preds = %55
  %60 = load i32, ptr %5, align 4, !tbaa !8
  %61 = sext i32 %60 to i64
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm1024EEixEm(ptr noundef nonnull align 4 dereferenceable(4096) %7, i64 noundef %61) #7
  store i32 0, ptr %62, align 4, !tbaa !8
  br label %63

63:                                               ; preds = %59, %55
  %64 = load i32, ptr %2, align 4, !tbaa !8
  %65 = ashr i32 %64, 1
  store i32 %65, ptr %2, align 4, !tbaa !8
  store i32 0, ptr %9, align 4, !tbaa !8
  br label %28, !llvm.loop !14

66:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %67

67:                                               ; preds = %66
  %68 = load i32, ptr %5, align 4, !tbaa !8
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %5, align 4, !tbaa !8
  br label %21, !llvm.loop !15

70:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4096, ptr %10) #7
  call void @llvm.memset.p0.i64(ptr align 4 %10, i8 0, i64 4096, i1 false)
  %71 = getelementptr inbounds %"struct.std::array.0", ptr %10, i32 0, i32 0
  %72 = getelementptr inbounds %struct.Modint, ptr %71, i64 1024
  br label %73

73:                                               ; preds = %73, %70
  %74 = phi ptr [ %71, %70 ], [ %75, %73 ]
  call void @_ZN6ModintIL_ZL3MODEEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %74)
  %75 = getelementptr inbounds %struct.Modint, ptr %74, i64 1
  %76 = icmp eq ptr %75, %72
  br i1 %76, label %77, label %73

77:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  call void @_ZN6ModintIL_ZL3MODEEC2IivEET_(ptr noundef nonnull align 4 dereferenceable(4) %11, i32 noundef 1)
  %78 = load i32, ptr %3, align 4, !tbaa !8
  %79 = shl i32 1, %78
  %80 = sub nsw i32 %79, 1
  %81 = sext i32 %80 to i64
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI6ModintIL_ZL3MODEELm1024EEixEm(ptr noundef nonnull align 4 dereferenceable(4096) %10, i64 noundef %81) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %82, ptr align 4 %11, i64 4, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  store i32 0, ptr %2, align 4, !tbaa !8
  br label %83

83:                                               ; preds = %137, %77
  %84 = load i32, ptr %2, align 4, !tbaa !8
  %85 = load i32, ptr %4, align 4, !tbaa !8
  %86 = icmp slt i32 %84, %85
  br i1 %86, label %87, label %140

87:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4096, ptr %12) #7
  call void @llvm.memset.p0.i64(ptr align 4 %12, i8 0, i64 4096, i1 false)
  %88 = getelementptr inbounds %"struct.std::array.0", ptr %12, i32 0, i32 0
  %89 = getelementptr inbounds %struct.Modint, ptr %88, i64 1024
  br label %90

90:                                               ; preds = %90, %87
  %91 = phi ptr [ %88, %87 ], [ %92, %90 ]
  call void @_ZN6ModintIL_ZL3MODEEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %91)
  %92 = getelementptr inbounds %struct.Modint, ptr %91, i64 1
  %93 = icmp eq ptr %92, %89
  br i1 %93, label %94, label %90

94:                                               ; preds = %90
  store i32 0, ptr %5, align 4, !tbaa !8
  br label %95

95:                                               ; preds = %133, %94
  %96 = load i32, ptr %5, align 4, !tbaa !8
  %97 = load i32, ptr %3, align 4, !tbaa !8
  %98 = shl i32 1, %97
  %99 = icmp slt i32 %96, %98
  br i1 %99, label %100, label %136

100:                                              ; preds = %95
  %101 = load i32, ptr %5, align 4, !tbaa !8
  store i32 %101, ptr %6, align 4, !tbaa !8
  br label %102

102:                                              ; preds = %127, %100
  %103 = load i32, ptr %6, align 4, !tbaa !8
  %104 = sext i32 %103 to i64
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm1024EEixEm(ptr noundef nonnull align 4 dereferenceable(4096) %7, i64 noundef %104) #7
  %106 = load i32, ptr %105, align 4, !tbaa !8
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %108, label %122

108:                                              ; preds = %102
  %109 = load i32, ptr %5, align 4, !tbaa !8
  %110 = sext i32 %109 to i64
  %111 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI6ModintIL_ZL3MODEELm1024EEixEm(ptr noundef nonnull align 4 dereferenceable(4096) %10, i64 noundef %110) #7
  %112 = load i32, ptr %6, align 4, !tbaa !8
  %113 = load i32, ptr %3, align 4, !tbaa !8
  %114 = shl i32 1, %113
  %115 = sub nsw i32 %114, 1
  %116 = load i32, ptr %5, align 4, !tbaa !8
  %117 = xor i32 %115, %116
  %118 = or i32 %112, %117
  %119 = sext i32 %118 to i64
  %120 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI6ModintIL_ZL3MODEELm1024EEixEm(ptr noundef nonnull align 4 dereferenceable(4096) %12, i64 noundef %119) #7
  %121 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6ModintIL_ZL3MODEEpLERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %120, ptr noundef nonnull align 4 dereferenceable(4) %111)
  br label %122

122:                                              ; preds = %108, %102
  %123 = load i32, ptr %6, align 4, !tbaa !8
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %126, label %125

125:                                              ; preds = %122
  br label %132

126:                                              ; preds = %122
  br label %127

127:                                              ; preds = %126
  %128 = load i32, ptr %6, align 4, !tbaa !8
  %129 = sub nsw i32 %128, 1
  %130 = load i32, ptr %5, align 4, !tbaa !8
  %131 = and i32 %129, %130
  store i32 %131, ptr %6, align 4, !tbaa !8
  br label %102, !llvm.loop !17

132:                                              ; preds = %125
  br label %133

133:                                              ; preds = %132
  %134 = load i32, ptr %5, align 4, !tbaa !8
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %5, align 4, !tbaa !8
  br label %95, !llvm.loop !18

136:                                              ; preds = %95
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %12, i64 4096, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 4096, ptr %12) #7
  br label %137

137:                                              ; preds = %136
  %138 = load i32, ptr %2, align 4, !tbaa !8
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %2, align 4, !tbaa !8
  br label %83, !llvm.loop !21

140:                                              ; preds = %83
  %141 = load i32, ptr %3, align 4, !tbaa !8
  %142 = shl i32 1, %141
  %143 = sub nsw i32 %142, 1
  %144 = sext i32 %143 to i64
  %145 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI6ModintIL_ZL3MODEELm1024EEixEm(ptr noundef nonnull align 4 dereferenceable(4096) %10, i64 noundef %144) #7
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZlsRSoRK6ModintIL_ZL3MODEE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 4 dereferenceable(4) %145)
  call void @llvm.lifetime.end.p0(i64 4096, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4096, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %147 = load i32, ptr %1, align 4
  ret i32 %147
}

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

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

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

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: mustprogress uwtable
declare dso_local void @_ZNSt5arrayIiLm1024EE4fillERKi(ptr noundef nonnull align 4 dereferenceable(4096), ptr noundef nonnull align 4 dereferenceable(4)) #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm1024EEixEm(ptr noundef nonnull align 4 dereferenceable(4096), i64 noundef) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN6ModintIL_ZL3MODEEC2Ev(ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN6ModintIL_ZL3MODEEC2IivEET_(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI6ModintIL_ZL3MODEELm1024EEixEm(ptr noundef nonnull align 4 dereferenceable(4096), i64 noundef) #1 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef nonnull align 4 dereferenceable(4) ptr @_ZN6ModintIL_ZL3MODEEpLERKS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef nonnull align 8 dereferenceable(8) ptr @_ZlsRSoRK6ModintIL_ZL3MODEE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #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 = { 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 #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 willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = !{i64 0, i64 4, !8}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = !{i64 0, i64 4096, !20}
!20 = !{!10, !10, i64 0}
!21 = distinct !{!21, !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" }
%"struct.std::array" = type { [1024 x i32] }
%"struct.std::array.0" = type { [1024 x %struct.Modint] }
%struct.Modint = type { i32 }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::array", align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::array.0", align 4
  %6 = alloca %struct.Modint, align 4
  %7 = alloca %"struct.std::array.0", align 4
  %8 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %9 = getelementptr i8, ptr %8, i64 -24
  %10 = load i64, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %10
  %12 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %11, ptr noundef null)
  %13 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %14 = 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)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 1, ptr %4, align 4, !tbaa !8
  call void @_ZNSt5arrayIiLm1024EE4fillERKi(ptr noundef nonnull align 4 dereferenceable(4096) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %16 = load i32, ptr %1, align 4, !tbaa !8
  %.not61 = icmp eq i32 %16, 31
  br i1 %.not61, label %._crit_edge54, label %.preheader45

.preheader45:                                     ; preds = %0, %._crit_edge52
  %17 = phi i32 [ %30, %._crit_edge52 ], [ %16, %0 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %._crit_edge52 ], [ 0, %0 ]
  %.not3950 = icmp eq i64 %indvars.iv, 0
  br i1 %.not3950, label %._crit_edge52, label %.preheader44.lr.ph

.preheader44.lr.ph:                               ; preds = %.preheader45
  %18 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.preheader44

.preheader44:                                     ; preds = %.preheader44.backedge, %.preheader44.lr.ph
  %.130 = phi i32 [ %18, %.preheader44.lr.ph ], [ %.130.be, %.preheader44.backedge ]
  %19 = and i32 %.130, 1
  %20 = icmp eq i32 %19, 0
  %21 = ashr exact i32 %.130, 1
  br i1 %20, label %.preheader44.backedge, label %.lr.ph

.preheader44.backedge:                            ; preds = %.preheader44, %28
  %.130.be = phi i32 [ %21, %.preheader44 ], [ %29, %28 ]
  br label %.preheader44, !llvm.loop !11

.lr.ph:                                           ; preds = %.preheader44, %.lr.ph
  %.148 = phi i32 [ %23, %.lr.ph ], [ 0, %.preheader44 ]
  %.247 = phi i32 [ %22, %.lr.ph ], [ %.130, %.preheader44 ]
  %22 = ashr i32 %.247, 1
  %23 = add nuw nsw i32 %.148, 1
  %24 = and i32 %.247, 2
  %.not40 = icmp eq i32 %24, 0
  br i1 %.not40, label %._crit_edge, label %.lr.ph, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph
  %25 = and i32 %.148, 1
  %.not41.not = icmp eq i32 %25, 0
  br i1 %.not41.not, label %26, label %28

26:                                               ; preds = %._crit_edge
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm1024EEixEm(ptr noundef nonnull align 4 dereferenceable(4096) %3, i64 noundef %indvars.iv) #7
  store i32 0, ptr %27, align 4, !tbaa !8
  br label %28

28:                                               ; preds = %26, %._crit_edge
  %29 = ashr i32 %.247, 2
  %.not39 = icmp ult i32 %.247, 2
  br i1 %.not39, label %._crit_edge52.loopexit, label %.preheader44.backedge

._crit_edge52.loopexit:                           ; preds = %28
  %.pre = load i32, ptr %1, align 4, !tbaa !8
  br label %._crit_edge52

._crit_edge52:                                    ; preds = %._crit_edge52.loopexit, %.preheader45
  %30 = phi i32 [ %.pre, %._crit_edge52.loopexit ], [ %17, %.preheader45 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %31 = shl nuw i32 1, %30
  %32 = sext i32 %31 to i64
  %33 = icmp slt i64 %indvars.iv.next, %32
  br i1 %33, label %.preheader45, label %._crit_edge54, !llvm.loop !14

._crit_edge54:                                    ; preds = %._crit_edge52, %0
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %5) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(4096) %5, i8 0, i64 4096, i1 false)
  br label %34

34:                                               ; preds = %34, %._crit_edge54
  %.idx = phi i64 [ 0, %._crit_edge54 ], [ %.add, %34 ]
  %.ptr = getelementptr inbounds i8, ptr %5, i64 %.idx
  call void @_ZN6ModintIL_ZL3MODEEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %.ptr)
  %.add = add nuw nsw i64 %.idx, 4
  %35 = icmp eq i64 %.add, 4096
  br i1 %35, label %36, label %34

36:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  call void @_ZN6ModintIL_ZL3MODEEC2IivEET_(ptr noundef nonnull align 4 dereferenceable(4) %6, i32 noundef 1)
  %37 = load i32, ptr %1, align 4, !tbaa !8
  %notmask = shl nsw i32 -1, %37
  %38 = xor i32 %notmask, -1
  %39 = zext nneg i32 %38 to i64
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI6ModintIL_ZL3MODEELm1024EEixEm(ptr noundef nonnull align 4 dereferenceable(4096) %5, i64 noundef %39) #7
  %41 = load i32, ptr %6, align 4, !tbaa !8
  store i32 %41, ptr %40, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  %42 = load i32, ptr %2, align 4, !tbaa !8
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %.lr.ph59, label %.._crit_edge60_crit_edge

.._crit_edge60_crit_edge:                         ; preds = %36
  %.pre68 = load i32, ptr %1, align 4, !tbaa !8
  br label %._crit_edge60

.lr.ph59:                                         ; preds = %36, %._crit_edge56
  %.357 = phi i32 [ %71, %._crit_edge56 ], [ 0, %36 ]
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %7) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(4096) %7, i8 0, i64 4096, i1 false)
  br label %44

44:                                               ; preds = %44, %.lr.ph59
  %.idx33 = phi i64 [ 0, %.lr.ph59 ], [ %.add34, %44 ]
  %.ptr35 = getelementptr inbounds i8, ptr %7, i64 %.idx33
  call void @_ZN6ModintIL_ZL3MODEEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %.ptr35)
  %.add34 = add nuw nsw i64 %.idx33, 4
  %45 = icmp eq i64 %.add34, 4096
  br i1 %45, label %.preheader42, label %44

.preheader42:                                     ; preds = %44
  %46 = load i32, ptr %1, align 4, !tbaa !8
  %.not62 = icmp eq i32 %46, 31
  br i1 %.not62, label %._crit_edge56, label %.preheader

.preheader:                                       ; preds = %.preheader42, %65
  %indvars.iv65 = phi i64 [ %indvars.iv.next66, %65 ], [ 0, %.preheader42 ]
  %47 = trunc nuw nsw i64 %indvars.iv65 to i32
  br label %48

48:                                               ; preds = %.preheader, %62
  %.026 = phi i32 [ %64, %62 ], [ %47, %.preheader ]
  %49 = sext i32 %.026 to i64
  %50 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm1024EEixEm(ptr noundef nonnull align 4 dereferenceable(4096) %3, i64 noundef %49) #7
  %51 = load i32, ptr %50, align 4, !tbaa !8
  %.not = icmp eq i32 %51, 0
  br i1 %.not, label %61, label %52

52:                                               ; preds = %48
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI6ModintIL_ZL3MODEELm1024EEixEm(ptr noundef nonnull align 4 dereferenceable(4096) %5, i64 noundef %indvars.iv65) #7
  %54 = load i32, ptr %1, align 4, !tbaa !8
  %notmask37 = shl nsw i32 -1, %54
  %55 = xor i32 %notmask37, %47
  %56 = xor i32 %55, -1
  %57 = or i32 %.026, %56
  %58 = sext i32 %57 to i64
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI6ModintIL_ZL3MODEELm1024EEixEm(ptr noundef nonnull align 4 dereferenceable(4096) %7, i64 noundef %58) #7
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6ModintIL_ZL3MODEEpLERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %59, ptr noundef nonnull align 4 dereferenceable(4) %53)
  br label %61

61:                                               ; preds = %52, %48
  %.not38 = icmp eq i32 %.026, 0
  br i1 %.not38, label %65, label %62

62:                                               ; preds = %61
  %63 = add nuw i32 %.026, 2147483647
  %64 = and i32 %63, %47
  br label %48, !llvm.loop !15

65:                                               ; preds = %61
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %66 = load i32, ptr %1, align 4, !tbaa !8
  %67 = shl nuw i32 1, %66
  %68 = sext i32 %67 to i64
  %69 = icmp slt i64 %indvars.iv.next66, %68
  br i1 %69, label %.preheader, label %._crit_edge56, !llvm.loop !16

._crit_edge56:                                    ; preds = %65, %.preheader42
  %70 = phi i32 [ 31, %.preheader42 ], [ %66, %65 ]
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(4096) %5, ptr noundef nonnull align 4 dereferenceable(4096) %7, i64 4096, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %7) #7
  %71 = add nuw nsw i32 %.357, 1
  %72 = load i32, ptr %2, align 4, !tbaa !8
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %.lr.ph59, label %._crit_edge60, !llvm.loop !19

._crit_edge60:                                    ; preds = %._crit_edge56, %.._crit_edge60_crit_edge
  %74 = phi i32 [ %.pre68, %.._crit_edge60_crit_edge ], [ %70, %._crit_edge56 ]
  %notmask32 = shl nsw i32 -1, %74
  %75 = xor i32 %notmask32, -1
  %76 = zext nneg i32 %75 to i64
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI6ModintIL_ZL3MODEELm1024EEixEm(ptr noundef nonnull align 4 dereferenceable(4096) %5, i64 noundef %76) #7
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZlsRSoRK6ModintIL_ZL3MODEE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 4 dereferenceable(4) %77)
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %3) #7
  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 nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #1 align 2

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

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

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 uwtable
declare dso_local void @_ZNSt5arrayIiLm1024EE4fillERKi(ptr noundef nonnull align 4 dereferenceable(4096), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm1024EEixEm(ptr noundef nonnull align 4 dereferenceable(4096), i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN6ModintIL_ZL3MODEEC2Ev(ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN6ModintIL_ZL3MODEEC2IivEET_(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayI6ModintIL_ZL3MODEELm1024EEixEm(ptr noundef nonnull align 4 dereferenceable(4096), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef nonnull align 4 dereferenceable(4) ptr @_ZN6ModintIL_ZL3MODEEpLERKS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef nonnull align 8 dereferenceable(8) ptr @_ZlsRSoRK6ModintIL_ZL3MODEE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #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 = { 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 #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 willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !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 = !{i64 0, i64 4096, !18}
!18 = !{!10, !10, i64 0}
!19 = distinct !{!19, !12}


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