; LLVM IR from kazunetakahashi/atcoder :: 2018/0128_ARC090 (C)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@N = external dso_local global i32, align 4
@A = external dso_local global [2 x [110 x i32]], align 16
@sum = external dso_local global [2 x [110 x i32]], 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
  store i32 0, ptr %1, align 4
  %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) @N)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %35, %0
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = icmp slt i32 %14, 2
  br i1 %15, label %17, label %16

16:                                               ; preds = %13
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %38

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

18:                                               ; preds = %31, %17
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = load i32, ptr @N, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %23, label %22

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

23:                                               ; preds = %18
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [2 x [110 x i32]], ptr @A, i64 0, i64 %25
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [110 x i32], ptr %26, i64 0, i64 %28
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %29)
  br label %31

31:                                               ; preds = %23
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %4, align 4, !tbaa !5
  br label %18, !llvm.loop !9

34:                                               ; preds = %22
  br label %35

35:                                               ; preds = %34
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %2, align 4, !tbaa !5
  br label %13, !llvm.loop !11

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

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

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

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

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

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

49:                                               ; preds = %44
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [2 x [110 x i32]], ptr @A, i64 0, i64 %51
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [110 x i32], ptr %52, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [2 x [110 x i32]], ptr @sum, i64 0, i64 %58
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [110 x i32], ptr %59, i64 0, i64 %61
  store i32 %56, ptr %62, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %49
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %6, align 4, !tbaa !5
  br label %44, !llvm.loop !12

66:                                               ; preds = %48
  br label %67

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

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

71:                                               ; preds = %88, %70
  %72 = load i32, ptr %7, align 4, !tbaa !5
  %73 = load i32, ptr @N, align 4, !tbaa !5
  %74 = sub nsw i32 %73, 1
  %75 = icmp slt i32 %72, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %71
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %91

77:                                               ; preds = %71
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [110 x i32], ptr @sum, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = load i32, ptr %7, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [110 x i32], ptr @sum, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = add nsw i32 %86, %81
  store i32 %87, ptr %85, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %77
  %89 = load i32, ptr %7, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %7, align 4, !tbaa !5
  br label %71, !llvm.loop !14

91:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %114, %91
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = load i32, ptr @N, align 4, !tbaa !5
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %117

97:                                               ; preds = %92
  %98 = load i32, ptr @N, align 4, !tbaa !5
  %99 = sub nsw i32 %98, 1
  %100 = load i32, ptr %8, align 4, !tbaa !5
  %101 = sub nsw i32 %99, %100
  %102 = add nsw i32 %101, 1
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [110 x i32], ptr getelementptr inbounds ([2 x [110 x i32]], ptr @sum, i64 0, i64 1), i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = load i32, ptr @N, align 4, !tbaa !5
  %107 = sub nsw i32 %106, 1
  %108 = load i32, ptr %8, align 4, !tbaa !5
  %109 = sub nsw i32 %107, %108
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [110 x i32], ptr getelementptr inbounds ([2 x [110 x i32]], ptr @sum, i64 0, i64 1), i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = add nsw i32 %112, %105
  store i32 %113, ptr %111, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %97
  %115 = load i32, ptr %8, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %8, align 4, !tbaa !5
  br label %92, !llvm.loop !15

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

118:                                              ; preds = %135, %117
  %119 = load i32, ptr %10, align 4, !tbaa !5
  %120 = load i32, ptr @N, align 4, !tbaa !5
  %121 = icmp slt i32 %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %138

123:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %124 = load i32, ptr %10, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [110 x i32], ptr @sum, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = load i32, ptr %10, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [110 x i32], ptr getelementptr inbounds ([2 x [110 x i32]], ptr @sum, i64 0, i64 1), i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = add nsw i32 %127, %131
  store i32 %132, ptr %11, align 4, !tbaa !5
  %133 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %134 = load i32, ptr %133, align 4, !tbaa !5
  store i32 %134, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %135

135:                                              ; preds = %123
  %136 = load i32, ptr %10, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %10, align 4, !tbaa !5
  br label %118, !llvm.loop !16

138:                                              ; preds = %122
  %139 = load i32, ptr %9, align 4, !tbaa !5
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %139)
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %140, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  %142 = load i32, ptr %1, align 4
  ret i32 %142
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1

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

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

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

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

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


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@N = external dso_local global i32, align 4
@A = external dso_local global [2 x [110 x i32]], align 16
@sum = external dso_local local_unnamed_addr global [2 x [110 x i32]], 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
  %3 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %4 = load i32, ptr @N, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %._crit_edge49.thread78

.preheader36:                                     ; preds = %.lr.ph.1
  %6 = icmp sgt i32 %10, 0
  br i1 %6, label %.preheader34, label %._crit_edge49.thread78

._crit_edge:                                      ; preds = %.lr.ph
  %7 = icmp sgt i32 %15, 0
  br i1 %7, label %.lr.ph.1, label %._crit_edge49.thread78

.lr.ph.1:                                         ; preds = %._crit_edge, %.lr.ph.1
  %indvars.iv.1 = phi i64 [ %indvars.iv.next.1, %.lr.ph.1 ], [ 0, %._crit_edge ]
  %8 = getelementptr inbounds [2 x [110 x i32]], ptr @A, i64 0, i64 1, i64 %indvars.iv.1
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
  %10 = load i32, ptr @N, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = icmp slt i64 %indvars.iv.next.1, %11
  br i1 %12, label %.lr.ph.1, label %.preheader36, !llvm.loop !9

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %13 = getelementptr inbounds [2 x [110 x i32]], ptr @A, i64 0, i64 0, i64 %indvars.iv
  %14 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %15 = load i32, ptr @N, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = icmp slt i64 %indvars.iv.next, %16
  br i1 %17, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge49.thread78:                           ; preds = %0, %._crit_edge, %.preheader36
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %._crit_edge53

.preheader34:                                     ; preds = %.preheader36
  %18 = zext nneg i32 %10 to i64
  %19 = shl nuw nsw i64 %18, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @sum, ptr nonnull align 16 @A, i64 %19, i1 false), !tbaa !5
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @sum, i64 440), ptr nonnull align 8 getelementptr inbounds (i8, ptr @A, i64 440), i64 %19, i1 false), !tbaa !5
  %.not = icmp eq i32 %10, 1
  br i1 %.not, label %._crit_edge49.thread, label %.lr.ph46.preheader

._crit_edge49.thread:                             ; preds = %.preheader34
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %.lr.ph52.preheader

.lr.ph46.preheader:                               ; preds = %.preheader34
  %20 = add nsw i32 %10, -1
  %wide.trip.count = zext nneg i32 %20 to i64
  %.pre = load i32, ptr @sum, align 16, !tbaa !5
  %21 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %wide.trip.count, 3
  %22 = icmp ult i64 %21, 3
  br i1 %22, label %.preheader.unr-lcssa, label %.lr.ph46.preheader.new

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

.preheader.unr-lcssa:                             ; preds = %.lr.ph46, %.lr.ph46.preheader
  %.unr = phi i32 [ %.pre, %.lr.ph46.preheader ], [ %43, %.lr.ph46 ]
  %indvars.iv65.unr = phi i64 [ 0, %.lr.ph46.preheader ], [ %indvars.iv.next66.3, %.lr.ph46 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.lr.ph46.epil

.lr.ph46.epil:                                    ; preds = %.preheader.unr-lcssa, %.lr.ph46.epil
  %23 = phi i32 [ %26, %.lr.ph46.epil ], [ %.unr, %.preheader.unr-lcssa ]
  %indvars.iv65.epil = phi i64 [ %indvars.iv.next66.epil, %.lr.ph46.epil ], [ %indvars.iv65.unr, %.preheader.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph46.epil ], [ 0, %.preheader.unr-lcssa ]
  %indvars.iv.next66.epil = add nuw nsw i64 %indvars.iv65.epil, 1
  %24 = getelementptr inbounds [110 x i32], ptr @sum, i64 0, i64 %indvars.iv.next66.epil
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = add nsw i32 %25, %23
  store i32 %26, ptr %24, align 4, !tbaa !5
  %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 %.preheader, label %.lr.ph46.epil, !llvm.loop !11

.preheader:                                       ; preds = %.lr.ph46.epil, %.preheader.unr-lcssa
  br i1 %.not, label %._crit_edge49, label %.lr.ph48.preheader

.lr.ph48.preheader:                               ; preds = %.preheader
  %27 = zext nneg i32 %10 to i64
  %wide.trip.count71 = zext nneg i32 %10 to i64
  %28 = shl nuw nsw i64 %wide.trip.count71, 2
  %scevgep = getelementptr i8, ptr getelementptr inbounds (i8, ptr @sum, i64 436), i64 %28
  %load_initial = load i32, ptr %scevgep, align 4
  %29 = add nsw i64 %wide.trip.count71, -1
  %xtraiter85 = and i64 %29, 1
  %30 = icmp eq i32 %10, 2
  br i1 %30, label %._crit_edge49.loopexit.unr-lcssa, label %.lr.ph48.preheader.new

.lr.ph48.preheader.new:                           ; preds = %.lr.ph48.preheader
  %unroll_iter88 = and i64 %29, -2
  br label %.lr.ph48

.lr.ph46:                                         ; preds = %.lr.ph46, %.lr.ph46.preheader.new
  %31 = phi i32 [ %.pre, %.lr.ph46.preheader.new ], [ %43, %.lr.ph46 ]
  %indvars.iv65 = phi i64 [ 0, %.lr.ph46.preheader.new ], [ %indvars.iv.next66.3, %.lr.ph46 ]
  %niter = phi i64 [ 0, %.lr.ph46.preheader.new ], [ %niter.next.3, %.lr.ph46 ]
  %indvars.iv.next66 = or disjoint i64 %indvars.iv65, 1
  %32 = getelementptr inbounds [110 x i32], ptr @sum, i64 0, i64 %indvars.iv.next66
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = add nsw i32 %33, %31
  store i32 %34, ptr %32, align 4, !tbaa !5
  %indvars.iv.next66.1 = or disjoint i64 %indvars.iv65, 2
  %35 = getelementptr inbounds [110 x i32], ptr @sum, i64 0, i64 %indvars.iv.next66.1
  %36 = load i32, ptr %35, align 8, !tbaa !5
  %37 = add nsw i32 %36, %34
  store i32 %37, ptr %35, align 8, !tbaa !5
  %indvars.iv.next66.2 = or disjoint i64 %indvars.iv65, 3
  %38 = getelementptr inbounds [110 x i32], ptr @sum, i64 0, i64 %indvars.iv.next66.2
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = add nsw i32 %39, %37
  store i32 %40, ptr %38, align 4, !tbaa !5
  %indvars.iv.next66.3 = add nuw nsw i64 %indvars.iv65, 4
  %41 = getelementptr inbounds [110 x i32], ptr @sum, i64 0, i64 %indvars.iv.next66.3
  %42 = load i32, ptr %41, align 16, !tbaa !5
  %43 = add nsw i32 %42, %40
  store i32 %43, ptr %41, align 16, !tbaa !5
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader.unr-lcssa, label %.lr.ph46, !llvm.loop !13

._crit_edge49.loopexit.unr-lcssa.loopexit:        ; preds = %.lr.ph48
  %44 = sub nuw i64 -3, %indvars.iv68
  br label %._crit_edge49.loopexit.unr-lcssa

._crit_edge49.loopexit.unr-lcssa:                 ; preds = %._crit_edge49.loopexit.unr-lcssa.loopexit, %.lr.ph48.preheader
  %store_forwarded.unr = phi i32 [ %load_initial, %.lr.ph48.preheader ], [ %57, %._crit_edge49.loopexit.unr-lcssa.loopexit ]
  %indvars.iv68.unr = phi i64 [ -2, %.lr.ph48.preheader ], [ %44, %._crit_edge49.loopexit.unr-lcssa.loopexit ]
  %lcmp.mod87.not = icmp eq i64 %xtraiter85, 0
  br i1 %lcmp.mod87.not, label %._crit_edge49, label %.lr.ph48.epil

.lr.ph48.epil:                                    ; preds = %._crit_edge49.loopexit.unr-lcssa
  %45 = add nsw i64 %indvars.iv68.unr, %27
  %46 = getelementptr inbounds [110 x i32], ptr getelementptr inbounds (i8, ptr @sum, i64 440), i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = add nsw i32 %47, %store_forwarded.unr
  store i32 %48, ptr %46, align 4, !tbaa !5
  br label %._crit_edge49

._crit_edge49:                                    ; preds = %.lr.ph48.epil, %._crit_edge49.loopexit.unr-lcssa, %.preheader
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !5
  br i1 %6, label %.lr.ph52.preheader, label %._crit_edge53

.lr.ph52.preheader:                               ; preds = %._crit_edge49.thread, %._crit_edge49
  br label %.lr.ph52

.lr.ph48:                                         ; preds = %.lr.ph48, %.lr.ph48.preheader.new
  %store_forwarded = phi i32 [ %load_initial, %.lr.ph48.preheader.new ], [ %57, %.lr.ph48 ]
  %indvars.iv68 = phi i64 [ 1, %.lr.ph48.preheader.new ], [ %indvars.iv.next69.1, %.lr.ph48 ]
  %niter89 = phi i64 [ 0, %.lr.ph48.preheader.new ], [ %niter89.next.1, %.lr.ph48 ]
  %49 = xor i64 %indvars.iv68, -1
  %50 = add nsw i64 %27, %49
  %51 = getelementptr inbounds [110 x i32], ptr getelementptr inbounds (i8, ptr @sum, i64 440), i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = add nsw i32 %52, %store_forwarded
  store i32 %53, ptr %51, align 4, !tbaa !5
  %reass.sub = sub nsw i64 %27, %indvars.iv68
  %54 = add i64 %reass.sub, -2
  %55 = getelementptr inbounds [110 x i32], ptr getelementptr inbounds (i8, ptr @sum, i64 440), i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = add nsw i32 %56, %53
  store i32 %57, ptr %55, align 4, !tbaa !5
  %indvars.iv.next69.1 = add nuw nsw i64 %indvars.iv68, 2
  %niter89.next.1 = add i64 %niter89, 2
  %niter89.ncmp.1 = icmp eq i64 %niter89.next.1, %unroll_iter88
  br i1 %niter89.ncmp.1, label %._crit_edge49.loopexit.unr-lcssa.loopexit, label %.lr.ph48, !llvm.loop !14

._crit_edge53:                                    ; preds = %.lr.ph52, %._crit_edge49.thread78, %._crit_edge49
  %58 = phi i32 [ 0, %._crit_edge49 ], [ 0, %._crit_edge49.thread78 ], [ %67, %.lr.ph52 ]
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %58)
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

.lr.ph52:                                         ; preds = %.lr.ph52.preheader, %.lr.ph52
  %indvars.iv73 = phi i64 [ %indvars.iv.next74, %.lr.ph52 ], [ 0, %.lr.ph52.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %61 = getelementptr inbounds [110 x i32], ptr @sum, i64 0, i64 %indvars.iv73
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = getelementptr inbounds [110 x i32], ptr getelementptr inbounds (i8, ptr @sum, i64 440), i64 0, i64 %indvars.iv73
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = add nsw i32 %64, %62
  store i32 %65, ptr %2, align 4, !tbaa !5
  %66 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %67 = load i32, ptr %66, align 4, !tbaa !5
  store i32 %67, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %68 = load i32, ptr @N, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = icmp slt i64 %indvars.iv.next74, %69
  br i1 %70, label %.lr.ph52, label %._crit_edge53, !llvm.loop !15
}

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 #1

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1

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

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

; 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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint 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 #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 = { 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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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