; LLVM IR from Izaron/ACM-ICPC :: Timus Online Judge/Volume 9/1869. New Year Cruise (main)

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

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

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

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

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

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

17:                                               ; preds = %40, %0
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %22, label %21

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

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

23:                                               ; preds = %36, %22
  %24 = load i32, ptr %6, align 4, !tbaa !5
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %28, label %27

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

28:                                               ; preds = %23
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [100 x [100 x i32]], ptr %3, i64 0, i64 %30
  %32 = load i32, ptr %6, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [100 x i32], ptr %31, i64 0, i64 %33
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %34)
  br label %36

36:                                               ; preds = %28
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %6, align 4, !tbaa !5
  br label %23, !llvm.loop !9

39:                                               ; preds = %27
  br label %40

40:                                               ; preds = %39
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %4, align 4, !tbaa !5
  br label %17, !llvm.loop !11

43:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 420, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 420, ptr %8) #5
  %44 = getelementptr inbounds [105 x i32], ptr %7, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %44, i8 0, i64 420, i1 false)
  %45 = getelementptr inbounds [105 x i32], ptr %8, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %45, i8 0, i64 420, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %109, %43
  %47 = load i32, ptr %9, align 4, !tbaa !5
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %51, label %50

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

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

52:                                               ; preds = %105, %51
  %53 = load i32, ptr %10, align 4, !tbaa !5
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %57, label %56

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

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %58 = load i32, ptr %9, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [100 x [100 x i32]], ptr %3, i64 0, i64 %59
  %61 = load i32, ptr %10, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100 x i32], ptr %60, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  store i32 %64, ptr %11, align 4, !tbaa !5
  %65 = load i32, ptr %9, align 4, !tbaa !5
  %66 = load i32, ptr %10, align 4, !tbaa !5
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %68, label %86

68:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %69 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %69, ptr %12, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %82, %68
  %71 = load i32, ptr %12, align 4, !tbaa !5
  %72 = load i32, ptr %10, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %85

75:                                               ; preds = %70
  %76 = load i32, ptr %11, align 4, !tbaa !5
  %77 = load i32, ptr %12, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [105 x i32], ptr %8, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = add nsw i32 %80, %76
  store i32 %81, ptr %79, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %75
  %83 = load i32, ptr %12, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %12, align 4, !tbaa !5
  br label %70, !llvm.loop !12

85:                                               ; preds = %74
  br label %104

86:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %87 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %87, ptr %13, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %100, %86
  %89 = load i32, ptr %13, align 4, !tbaa !5
  %90 = load i32, ptr %9, align 4, !tbaa !5
  %91 = icmp slt i32 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  store i32 17, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %103

93:                                               ; preds = %88
  %94 = load i32, ptr %11, align 4, !tbaa !5
  %95 = load i32, ptr %13, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [105 x i32], ptr %7, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = add nsw i32 %98, %94
  store i32 %99, ptr %97, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %93
  %101 = load i32, ptr %13, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %13, align 4, !tbaa !5
  br label %88, !llvm.loop !13

103:                                              ; preds = %92
  br label %104

104:                                              ; preds = %103, %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %10, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %10, align 4, !tbaa !5
  br label %52, !llvm.loop !14

108:                                              ; preds = %56
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %9, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %9, align 4, !tbaa !5
  br label %46, !llvm.loop !15

112:                                              ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %127, %112
  %114 = load i32, ptr %15, align 4, !tbaa !5
  %115 = icmp slt i32 %114, 105
  br i1 %115, label %117, label %116

116:                                              ; preds = %113
  store i32 20, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %130

117:                                              ; preds = %113
  %118 = load i32, ptr %15, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [105 x i32], ptr %7, i64 0, i64 %119
  %121 = load i32, ptr %15, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [105 x i32], ptr %8, i64 0, i64 %122
  %124 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %120, ptr noundef nonnull align 4 dereferenceable(4) %123)
  %125 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %124)
  %126 = load i32, ptr %125, align 4, !tbaa !5
  store i32 %126, ptr %14, align 4, !tbaa !5
  br label %127

127:                                              ; preds = %117
  %128 = load i32, ptr %15, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %15, align 4, !tbaa !5
  br label %113, !llvm.loop !16

130:                                              ; preds = %116
  %131 = load i32, ptr %14, align 4, !tbaa !5
  %132 = srem i32 %131, 36
  %133 = icmp eq i32 %132, 0
  br i1 %133, label %134, label %138

134:                                              ; preds = %130
  %135 = load i32, ptr %14, align 4, !tbaa !5
  %136 = sdiv i32 %135, 36
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %136)
  br label %143

138:                                              ; preds = %130
  %139 = load i32, ptr %14, align 4, !tbaa !5
  %140 = sdiv i32 %139, 36
  %141 = add nsw i32 %140, 1
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %141)
  br label %143

143:                                              ; preds = %138, %134
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 420, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 420, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 40000, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %144 = load i32, ptr %1, align 4
  ret i32 %144
}

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

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

; Function Attrs: 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)) #4

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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" }

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca [100 x [100 x i32]], align 16
  %3 = alloca [105 x i32], align 16
  %4 = alloca [105 x i32], align 16
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %2) #5
  %6 = 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)
  %7 = load i32, ptr %1, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.preheader40, label %._crit_edge43.thread

._crit_edge43.thread:                             ; preds = %0
  call void @llvm.lifetime.start.p0(i64 420, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 420, ptr nonnull %4) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(420) %3, i8 0, i64 420, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(420) %4, i8 0, i64 420, i1 false)
  br label %._crit_edge52

.preheader40:                                     ; preds = %0, %._crit_edge
  %9 = phi i32 [ %37, %._crit_edge ], [ %7, %0 ]
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %._crit_edge ], [ 0, %0 ]
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %.preheader40.._crit_edge_crit_edge

.preheader40.._crit_edge_crit_edge:               ; preds = %.preheader40
  %.pre = sext i32 %9 to i64
  br label %._crit_edge

._crit_edge43:                                    ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 420, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 420, ptr nonnull %4) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(420) %3, i8 0, i64 420, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(420) %4, i8 0, i64 420, i1 false)
  %11 = icmp sgt i32 %37, 0
  br i1 %11, label %.preheader39.us.preheader, label %._crit_edge52

.preheader39.us.preheader:                        ; preds = %._crit_edge43
  %wide.trip.count73 = zext nneg i32 %37 to i64
  br label %.preheader39.us

.preheader39.us:                                  ; preds = %.preheader39.us.preheader, %._crit_edge50.us
  %indvars.iv66 = phi i64 [ 0, %.preheader39.us.preheader ], [ %indvars.iv.next67, %._crit_edge50.us ]
  br label %12

12:                                               ; preds = %.preheader39.us, %.loopexit.us
  %indvars.iv61 = phi i64 [ 0, %.preheader39.us ], [ %indvars.iv.next62, %.loopexit.us ]
  %13 = sub nsw i64 %indvars.iv66, %indvars.iv61
  %14 = sub nsw i64 %indvars.iv61, %indvars.iv66
  %15 = getelementptr inbounds [100 x [100 x i32]], ptr %2, i64 0, i64 %indvars.iv66, i64 %indvars.iv61
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = icmp ult i64 %indvars.iv66, %indvars.iv61
  br i1 %17, label %.preheader.us.preheader, label %.preheader37.us

.preheader.us.preheader:                          ; preds = %12
  %min.iters.check = icmp ult i64 %14, 8
  br i1 %min.iters.check, label %.preheader.us.preheader106, label %vector.ph

.preheader.us.preheader106:                       ; preds = %middle.block, %.preheader.us.preheader
  %indvars.iv68.ph = phi i64 [ %indvars.iv66, %.preheader.us.preheader ], [ %ind.end, %middle.block ]
  br label %.preheader.us

vector.ph:                                        ; preds = %.preheader.us.preheader
  %n.vec = and i64 %14, -8
  %ind.end = add i64 %indvars.iv66, %n.vec
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %16, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %indvars.iv66, %index
  %18 = getelementptr inbounds [105 x i32], ptr %4, i64 0, i64 %offset.idx
  %19 = getelementptr inbounds i8, ptr %18, i64 16
  %wide.load = load <4 x i32>, ptr %18, align 4, !tbaa !5
  %wide.load88 = load <4 x i32>, ptr %19, align 4, !tbaa !5
  %20 = add nsw <4 x i32> %wide.load, %broadcast.splat
  %21 = add nsw <4 x i32> %wide.load88, %broadcast.splat
  store <4 x i32> %20, ptr %18, align 4, !tbaa !5
  store <4 x i32> %21, ptr %19, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %22 = icmp eq i64 %index.next, %n.vec
  br i1 %22, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %14, %n.vec
  br i1 %cmp.n, label %.loopexit.us, label %.preheader.us.preheader106

.lr.ph45.us:                                      ; preds = %.lr.ph45.us.preheader107, %.lr.ph45.us
  %indvars.iv63 = phi i64 [ %indvars.iv.next64, %.lr.ph45.us ], [ %indvars.iv63.ph, %.lr.ph45.us.preheader107 ]
  %23 = getelementptr inbounds [105 x i32], ptr %3, i64 0, i64 %indvars.iv63
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = add nsw i32 %24, %16
  store i32 %25, ptr %23, align 4, !tbaa !5
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %26 = icmp ult i64 %indvars.iv.next64, %indvars.iv66
  br i1 %26, label %.lr.ph45.us, label %.loopexit.us, !llvm.loop !13

.loopexit.us:                                     ; preds = %.lr.ph45.us, %.preheader.us, %middle.block89, %middle.block, %.preheader37.us
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next62, %wide.trip.count73
  br i1 %exitcond.not, label %._crit_edge50.us, label %12, !llvm.loop !14

.preheader.us:                                    ; preds = %.preheader.us.preheader106, %.preheader.us
  %indvars.iv68 = phi i64 [ %indvars.iv.next69, %.preheader.us ], [ %indvars.iv68.ph, %.preheader.us.preheader106 ]
  %27 = getelementptr inbounds [105 x i32], ptr %4, i64 0, i64 %indvars.iv68
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = add nsw i32 %28, %16
  store i32 %29, ptr %27, align 4, !tbaa !5
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %30 = icmp ult i64 %indvars.iv.next69, %indvars.iv61
  br i1 %30, label %.preheader.us, label %.loopexit.us, !llvm.loop !15

.preheader37.us:                                  ; preds = %12
  %31 = icmp ult i64 %indvars.iv61, %indvars.iv66
  br i1 %31, label %.lr.ph45.us.preheader, label %.loopexit.us

.lr.ph45.us.preheader:                            ; preds = %.preheader37.us
  %min.iters.check91 = icmp ult i64 %13, 8
  br i1 %min.iters.check91, label %.lr.ph45.us.preheader107, label %vector.ph92

.lr.ph45.us.preheader107:                         ; preds = %middle.block89, %.lr.ph45.us.preheader
  %indvars.iv63.ph = phi i64 [ %indvars.iv61, %.lr.ph45.us.preheader ], [ %ind.end95, %middle.block89 ]
  br label %.lr.ph45.us

vector.ph92:                                      ; preds = %.lr.ph45.us.preheader
  %n.vec94 = and i64 %13, -8
  %ind.end95 = add i64 %indvars.iv61, %n.vec94
  %broadcast.splatinsert102 = insertelement <4 x i32> poison, i32 %16, i64 0
  %broadcast.splat103 = shufflevector <4 x i32> %broadcast.splatinsert102, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body97

vector.body97:                                    ; preds = %vector.body97, %vector.ph92
  %index98 = phi i64 [ 0, %vector.ph92 ], [ %index.next104, %vector.body97 ]
  %offset.idx99 = add i64 %indvars.iv61, %index98
  %32 = getelementptr inbounds [105 x i32], ptr %3, i64 0, i64 %offset.idx99
  %33 = getelementptr inbounds i8, ptr %32, i64 16
  %wide.load100 = load <4 x i32>, ptr %32, align 4, !tbaa !5
  %wide.load101 = load <4 x i32>, ptr %33, align 4, !tbaa !5
  %34 = add nsw <4 x i32> %wide.load100, %broadcast.splat103
  %35 = add nsw <4 x i32> %wide.load101, %broadcast.splat103
  store <4 x i32> %34, ptr %32, align 4, !tbaa !5
  store <4 x i32> %35, ptr %33, align 4, !tbaa !5
  %index.next104 = add nuw i64 %index98, 8
  %36 = icmp eq i64 %index.next104, %n.vec94
  br i1 %36, label %middle.block89, label %vector.body97, !llvm.loop !16

middle.block89:                                   ; preds = %vector.body97
  %cmp.n105 = icmp eq i64 %13, %n.vec94
  br i1 %cmp.n105, label %.loopexit.us, label %.lr.ph45.us.preheader107

._crit_edge50.us:                                 ; preds = %.loopexit.us
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %exitcond74.not = icmp eq i64 %indvars.iv.next67, %wide.trip.count73
  br i1 %exitcond74.not, label %._crit_edge52, label %.preheader39.us, !llvm.loop !17

._crit_edge:                                      ; preds = %.lr.ph, %.preheader40.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader40.._crit_edge_crit_edge ], [ %42, %.lr.ph ]
  %37 = phi i32 [ %9, %.preheader40.._crit_edge_crit_edge ], [ %41, %.lr.ph ]
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %38 = icmp slt i64 %indvars.iv.next59, %.pre-phi
  br i1 %38, label %.preheader40, label %._crit_edge43, !llvm.loop !18

.lr.ph:                                           ; preds = %.preheader40, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader40 ]
  %39 = getelementptr inbounds [100 x [100 x i32]], ptr %2, i64 0, i64 %indvars.iv58, i64 %indvars.iv
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %39)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %41 = load i32, ptr %1, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = icmp slt i64 %indvars.iv.next, %42
  br i1 %43, label %.lr.ph, label %._crit_edge, !llvm.loop !20

._crit_edge52:                                    ; preds = %._crit_edge50.us, %._crit_edge43.thread, %._crit_edge43
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %50

44:                                               ; preds = %50
  %45 = srem i32 %55, 36
  %46 = icmp ne i32 %45, 0
  %47 = sdiv i32 %55, 36
  %48 = zext i1 %46 to i32
  %.sink = add nsw i32 %47, %48
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.sink)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 420, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 420, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0

50:                                               ; preds = %._crit_edge52, %50
  %indvars.iv75 = phi i64 [ 0, %._crit_edge52 ], [ %indvars.iv.next76, %50 ]
  %51 = getelementptr inbounds [105 x i32], ptr %3, i64 0, i64 %indvars.iv75
  %52 = getelementptr inbounds [105 x i32], ptr %4, i64 0, i64 %indvars.iv75
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %51, ptr noundef nonnull align 4 dereferenceable(4) %52)
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %53)
  %55 = load i32, ptr %54, align 4, !tbaa !5
  store i32 %55, ptr %5, align 4, !tbaa !5
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %exitcond78.not = icmp eq i64 %indvars.iv.next76, 105
  br i1 %exitcond78.not, label %44, label %50, !llvm.loop !21
}

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

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

; Function Attrs: 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 #4

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

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

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

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


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