; LLVM IR from AdarshGaur/Competitive-Programming :: Atcoder/AtCoder Beginner Contest 202 (C - Made Up)

; 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
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca [100007 x i64], align 16
  %11 = alloca i64, align 8
  %12 = alloca [100007 x i64], align 16
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %19 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %20 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %21 = getelementptr i8, ptr %20, i64 -24
  %22 = load i64, ptr %21, align 8
  %23 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %22
  %24 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %23, ptr noundef null)
  %25 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %26 = getelementptr i8, ptr %25, i64 -24
  %27 = load i64, ptr %26, align 8
  %28 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %27
  %29 = call noundef i64 @_ZNSt8ios_base9precisionEl(ptr noundef nonnull align 8 dereferenceable(216) %28, i64 noundef 20)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #8
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %31 = load i64, ptr %2, align 8, !tbaa !8
  %32 = call ptr @llvm.stacksave.p0()
  store ptr %32, ptr %3, align 8
  %33 = alloca i64, i64 %31, align 16
  store i64 %31, ptr %4, align 8
  %34 = load i64, ptr %2, align 8, !tbaa !8
  %35 = alloca i64, i64 %34, align 16
  store i64 %34, ptr %5, align 8
  %36 = load i64, ptr %2, align 8, !tbaa !8
  %37 = alloca i64, i64 %36, align 16
  store i64 %36, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  store i64 0, ptr %7, align 8, !tbaa !8
  br label %38

38:                                               ; preds = %47, %0
  %39 = load i64, ptr %7, align 8, !tbaa !8
  %40 = load i64, ptr %2, align 8, !tbaa !8
  %41 = icmp slt i64 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br label %50

43:                                               ; preds = %38
  %44 = load i64, ptr %7, align 8, !tbaa !8
  %45 = getelementptr inbounds i64, ptr %33, i64 %44
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %45)
  br label %47

47:                                               ; preds = %43
  %48 = load i64, ptr %7, align 8, !tbaa !8
  %49 = add nsw i64 %48, 1
  store i64 %49, ptr %7, align 8, !tbaa !8
  br label %38, !llvm.loop !11

50:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  store i64 0, ptr %8, align 8, !tbaa !8
  br label %51

51:                                               ; preds = %60, %50
  %52 = load i64, ptr %8, align 8, !tbaa !8
  %53 = load i64, ptr %2, align 8, !tbaa !8
  %54 = icmp slt i64 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %63

56:                                               ; preds = %51
  %57 = load i64, ptr %8, align 8, !tbaa !8
  %58 = getelementptr inbounds i64, ptr %35, i64 %57
  %59 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %58)
  br label %60

60:                                               ; preds = %56
  %61 = load i64, ptr %8, align 8, !tbaa !8
  %62 = add nsw i64 %61, 1
  store i64 %62, ptr %8, align 8, !tbaa !8
  br label %51, !llvm.loop !13

63:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  store i64 0, ptr %9, align 8, !tbaa !8
  br label %64

64:                                               ; preds = %73, %63
  %65 = load i64, ptr %9, align 8, !tbaa !8
  %66 = load i64, ptr %2, align 8, !tbaa !8
  %67 = icmp slt i64 %65, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  br label %76

69:                                               ; preds = %64
  %70 = load i64, ptr %9, align 8, !tbaa !8
  %71 = getelementptr inbounds i64, ptr %37, i64 %70
  %72 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %71)
  br label %73

73:                                               ; preds = %69
  %74 = load i64, ptr %9, align 8, !tbaa !8
  %75 = add nsw i64 %74, 1
  store i64 %75, ptr %9, align 8, !tbaa !8
  br label %64, !llvm.loop !14

76:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 800056, ptr %10) #8
  call void @llvm.memset.p0.i64(ptr align 16 %10, i8 0, i64 800056, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  store i64 0, ptr %11, align 8, !tbaa !8
  br label %77

77:                                               ; preds = %89, %76
  %78 = load i64, ptr %11, align 8, !tbaa !8
  %79 = load i64, ptr %2, align 8, !tbaa !8
  %80 = icmp slt i64 %78, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %77
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %92

82:                                               ; preds = %77
  %83 = load i64, ptr %11, align 8, !tbaa !8
  %84 = getelementptr inbounds i64, ptr %37, i64 %83
  %85 = load i64, ptr %84, align 8, !tbaa !8
  %86 = getelementptr inbounds [100007 x i64], ptr %10, i64 0, i64 %85
  %87 = load i64, ptr %86, align 8, !tbaa !8
  %88 = add nsw i64 %87, 1
  store i64 %88, ptr %86, align 8, !tbaa !8
  br label %89

89:                                               ; preds = %82
  %90 = load i64, ptr %11, align 8, !tbaa !8
  %91 = add nsw i64 %90, 1
  store i64 %91, ptr %11, align 8, !tbaa !8
  br label %77, !llvm.loop !15

92:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 800056, ptr %12) #8
  call void @llvm.memset.p0.i64(ptr align 16 %12, i8 0, i64 800056, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  store i64 0, ptr %13, align 8, !tbaa !8
  br label %93

93:                                               ; preds = %109, %92
  %94 = load i64, ptr %13, align 8, !tbaa !8
  %95 = load i64, ptr %2, align 8, !tbaa !8
  %96 = icmp slt i64 %94, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %112

98:                                               ; preds = %93
  %99 = load i64, ptr %13, align 8, !tbaa !8
  %100 = add nsw i64 %99, 1
  %101 = getelementptr inbounds [100007 x i64], ptr %10, i64 0, i64 %100
  %102 = load i64, ptr %101, align 8, !tbaa !8
  %103 = load i64, ptr %13, align 8, !tbaa !8
  %104 = getelementptr inbounds i64, ptr %35, i64 %103
  %105 = load i64, ptr %104, align 8, !tbaa !8
  %106 = getelementptr inbounds [100007 x i64], ptr %12, i64 0, i64 %105
  %107 = load i64, ptr %106, align 8, !tbaa !8
  %108 = add nsw i64 %107, %102
  store i64 %108, ptr %106, align 8, !tbaa !8
  br label %109

109:                                              ; preds = %98
  %110 = load i64, ptr %13, align 8, !tbaa !8
  %111 = add nsw i64 %110, 1
  store i64 %111, ptr %13, align 8, !tbaa !8
  br label %93, !llvm.loop !16

112:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  store i64 0, ptr %14, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  store ptr %33, ptr %15, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %113 = load ptr, ptr %15, align 8, !tbaa !17
  store ptr %113, ptr %16, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %114 = load ptr, ptr %15, align 8, !tbaa !17
  %115 = mul nuw i64 8, %31
  %116 = udiv i64 %115, 8
  %117 = getelementptr inbounds i64, ptr %114, i64 %116
  store ptr %117, ptr %17, align 8, !tbaa !17
  br label %118

118:                                              ; preds = %131, %112
  %119 = load ptr, ptr %16, align 8, !tbaa !17
  %120 = load ptr, ptr %17, align 8, !tbaa !17
  %121 = icmp ne ptr %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  br label %134

123:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %124 = load ptr, ptr %16, align 8, !tbaa !17
  %125 = load i64, ptr %124, align 8, !tbaa !8
  store i64 %125, ptr %18, align 8, !tbaa !8
  %126 = load i64, ptr %18, align 8, !tbaa !8
  %127 = getelementptr inbounds [100007 x i64], ptr %12, i64 0, i64 %126
  %128 = load i64, ptr %127, align 8, !tbaa !8
  %129 = load i64, ptr %14, align 8, !tbaa !8
  %130 = add nsw i64 %129, %128
  store i64 %130, ptr %14, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %131

131:                                              ; preds = %123
  %132 = load ptr, ptr %16, align 8, !tbaa !17
  %133 = getelementptr inbounds i64, ptr %132, i32 1
  store ptr %133, ptr %16, align 8, !tbaa !17
  br label %118

134:                                              ; preds = %122
  %135 = load i64, ptr %14, align 8, !tbaa !8
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %135)
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %136, ptr noundef @.str)
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 800056, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 800056, ptr %10) #8
  %138 = load ptr, ptr %3, align 8
  call void @llvm.stackrestore.p0(ptr %138)
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  %139 = load i32, ptr %1, align 4
  ret i32 %139
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNSt8ios_base9precisionEl(ptr noundef nonnull align 8 dereferenceable(216), i64 noundef) #2 align 2

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #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 = { 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 #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 nosync nounwind willreturn }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { 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 #8 = { 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 = !{!"long", !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 = !{!18, !18, i64 0}
!18 = !{!"any pointer", !10, i64 0}


; 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
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca [100007 x i64], align 16
  %3 = alloca [100007 x i64], align 16
  %4 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  %10 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %12
  %14 = tail call noundef i64 @_ZNSt8ios_base9precisionEl(ptr noundef nonnull align 8 dereferenceable(216) %13, i64 noundef 20)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %16 = load i64, ptr %1, align 8, !tbaa !8
  %17 = call ptr @llvm.stacksave.p0()
  %18 = alloca i64, i64 %16, align 16
  %19 = load i64, ptr %1, align 8, !tbaa !8
  %20 = alloca i64, i64 %19, align 16
  %21 = alloca i64, i64 %19, align 16
  %22 = icmp sgt i64 %19, 0
  br i1 %22, label %.lr.ph, label %._crit_edge.thread

.preheader32:                                     ; preds = %.lr.ph
  %23 = icmp sgt i64 %27, 0
  br i1 %23, label %.lr.ph35, label %._crit_edge.thread

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.033 = phi i64 [ %26, %.lr.ph ], [ 0, %0 ]
  %24 = getelementptr inbounds i64, ptr %18, i64 %.033
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %24)
  %26 = add nuw nsw i64 %.033, 1
  %27 = load i64, ptr %1, align 8, !tbaa !8
  %28 = icmp slt i64 %26, %27
  br i1 %28, label %.lr.ph, label %.preheader32, !llvm.loop !11

.preheader:                                       ; preds = %.lr.ph35
  %29 = icmp sgt i64 %33, 0
  br i1 %29, label %.lr.ph37, label %._crit_edge.thread

.lr.ph35:                                         ; preds = %.preheader32, %.lr.ph35
  %.02734 = phi i64 [ %32, %.lr.ph35 ], [ 0, %.preheader32 ]
  %30 = getelementptr inbounds i64, ptr %20, i64 %.02734
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %30)
  %32 = add nuw nsw i64 %.02734, 1
  %33 = load i64, ptr %1, align 8, !tbaa !8
  %34 = icmp slt i64 %32, %33
  br i1 %34, label %.lr.ph35, label %.preheader, !llvm.loop !13

._crit_edge.thread:                               ; preds = %.preheader, %.preheader32, %0
  call void @llvm.lifetime.start.p0(i64 800056, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 800056, ptr nonnull %3) #8
  br label %._crit_edge45.sink.split

._crit_edge:                                      ; preds = %.lr.ph37
  call void @llvm.lifetime.start.p0(i64 800056, ptr nonnull %2) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800056) %2, i8 0, i64 800056, i1 false)
  %35 = icmp sgt i64 %40, 0
  br i1 %35, label %.lr.ph40.preheader, label %._crit_edge41.thread

.lr.ph40.preheader:                               ; preds = %._crit_edge
  %xtraiter = and i64 %40, 3
  %36 = icmp ult i64 %40, 4
  br i1 %36, label %._crit_edge41.unr-lcssa, label %.lr.ph40.preheader.new

.lr.ph40.preheader.new:                           ; preds = %.lr.ph40.preheader
  %unroll_iter = and i64 %40, 9223372036854775804
  br label %.lr.ph40

._crit_edge41.thread:                             ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 800056, ptr nonnull %3) #8
  br label %._crit_edge45.sink.split

.lr.ph37:                                         ; preds = %.preheader, %.lr.ph37
  %.03136 = phi i64 [ %39, %.lr.ph37 ], [ 0, %.preheader ]
  %37 = getelementptr inbounds i64, ptr %21, i64 %.03136
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %37)
  %39 = add nuw nsw i64 %.03136, 1
  %40 = load i64, ptr %1, align 8, !tbaa !8
  %41 = icmp slt i64 %39, %40
  br i1 %41, label %.lr.ph37, label %._crit_edge, !llvm.loop !14

._crit_edge41.unr-lcssa:                          ; preds = %.lr.ph40, %.lr.ph40.preheader
  %.03038.unr = phi i64 [ 0, %.lr.ph40.preheader ], [ %72, %.lr.ph40 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge41, label %.lr.ph40.epil

.lr.ph40.epil:                                    ; preds = %._crit_edge41.unr-lcssa, %.lr.ph40.epil
  %.03038.epil = phi i64 [ %47, %.lr.ph40.epil ], [ %.03038.unr, %._crit_edge41.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph40.epil ], [ 0, %._crit_edge41.unr-lcssa ]
  %42 = getelementptr inbounds i64, ptr %21, i64 %.03038.epil
  %43 = load i64, ptr %42, align 8, !tbaa !8
  %44 = getelementptr inbounds [100007 x i64], ptr %2, i64 0, i64 %43
  %45 = load i64, ptr %44, align 8, !tbaa !8
  %46 = add nsw i64 %45, 1
  store i64 %46, ptr %44, align 8, !tbaa !8
  %47 = add nuw nsw i64 %.03038.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge41, label %.lr.ph40.epil, !llvm.loop !15

._crit_edge41:                                    ; preds = %.lr.ph40.epil, %._crit_edge41.unr-lcssa
  call void @llvm.lifetime.start.p0(i64 800056, ptr nonnull %3) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800056) %3, i8 0, i64 800056, i1 false)
  br i1 %35, label %.lr.ph44.preheader, label %._crit_edge45

.lr.ph44.preheader:                               ; preds = %._crit_edge41
  %xtraiter69 = and i64 %40, 1
  %48 = icmp eq i64 %40, 1
  br i1 %48, label %._crit_edge45.loopexit.unr-lcssa, label %.lr.ph44.preheader.new

.lr.ph44.preheader.new:                           ; preds = %.lr.ph44.preheader
  %unroll_iter72 = and i64 %40, 9223372036854775806
  br label %.lr.ph44

.lr.ph40:                                         ; preds = %.lr.ph40, %.lr.ph40.preheader.new
  %.03038 = phi i64 [ 0, %.lr.ph40.preheader.new ], [ %72, %.lr.ph40 ]
  %niter = phi i64 [ 0, %.lr.ph40.preheader.new ], [ %niter.next.3, %.lr.ph40 ]
  %49 = getelementptr inbounds i64, ptr %21, i64 %.03038
  %50 = load i64, ptr %49, align 16, !tbaa !8
  %51 = getelementptr inbounds [100007 x i64], ptr %2, i64 0, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !8
  %53 = add nsw i64 %52, 1
  store i64 %53, ptr %51, align 8, !tbaa !8
  %54 = or disjoint i64 %.03038, 1
  %55 = getelementptr inbounds i64, ptr %21, i64 %54
  %56 = load i64, ptr %55, align 8, !tbaa !8
  %57 = getelementptr inbounds [100007 x i64], ptr %2, i64 0, i64 %56
  %58 = load i64, ptr %57, align 8, !tbaa !8
  %59 = add nsw i64 %58, 1
  store i64 %59, ptr %57, align 8, !tbaa !8
  %60 = or disjoint i64 %.03038, 2
  %61 = getelementptr inbounds i64, ptr %21, i64 %60
  %62 = load i64, ptr %61, align 16, !tbaa !8
  %63 = getelementptr inbounds [100007 x i64], ptr %2, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !8
  %65 = add nsw i64 %64, 1
  store i64 %65, ptr %63, align 8, !tbaa !8
  %66 = or disjoint i64 %.03038, 3
  %67 = getelementptr inbounds i64, ptr %21, i64 %66
  %68 = load i64, ptr %67, align 8, !tbaa !8
  %69 = getelementptr inbounds [100007 x i64], ptr %2, i64 0, i64 %68
  %70 = load i64, ptr %69, align 8, !tbaa !8
  %71 = add nsw i64 %70, 1
  store i64 %71, ptr %69, align 8, !tbaa !8
  %72 = add nuw nsw i64 %.03038, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge41.unr-lcssa, label %.lr.ph40, !llvm.loop !17

._crit_edge45.sink.split:                         ; preds = %._crit_edge41.thread, %._crit_edge.thread
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800056) %3, i8 0, i64 800056, i1 false)
  br label %._crit_edge45

._crit_edge45.loopexit.unr-lcssa:                 ; preds = %.lr.ph44, %.lr.ph44.preheader
  %.02942.unr = phi i64 [ 0, %.lr.ph44.preheader ], [ %90, %.lr.ph44 ]
  %lcmp.mod71.not = icmp eq i64 %xtraiter69, 0
  br i1 %lcmp.mod71.not, label %._crit_edge45, label %.lr.ph44.epil

.lr.ph44.epil:                                    ; preds = %._crit_edge45.loopexit.unr-lcssa
  %73 = add nuw nsw i64 %.02942.unr, 1
  %74 = getelementptr inbounds [100007 x i64], ptr %2, i64 0, i64 %73
  %75 = load i64, ptr %74, align 8, !tbaa !8
  %76 = getelementptr inbounds i64, ptr %20, i64 %.02942.unr
  %77 = load i64, ptr %76, align 8, !tbaa !8
  %78 = getelementptr inbounds [100007 x i64], ptr %3, i64 0, i64 %77
  %79 = load i64, ptr %78, align 8, !tbaa !8
  %80 = add nsw i64 %79, %75
  store i64 %80, ptr %78, align 8, !tbaa !8
  br label %._crit_edge45

._crit_edge45:                                    ; preds = %.lr.ph44.epil, %._crit_edge45.loopexit.unr-lcssa, %._crit_edge45.sink.split, %._crit_edge41
  %81 = getelementptr inbounds i64, ptr %18, i64 %16
  %.not46 = icmp eq i64 %16, 0
  br i1 %.not46, label %._crit_edge51, label %.lr.ph50

.lr.ph44:                                         ; preds = %.lr.ph44, %.lr.ph44.preheader.new
  %.02942 = phi i64 [ 0, %.lr.ph44.preheader.new ], [ %90, %.lr.ph44 ]
  %niter73 = phi i64 [ 0, %.lr.ph44.preheader.new ], [ %niter73.next.1, %.lr.ph44 ]
  %82 = or disjoint i64 %.02942, 1
  %83 = getelementptr inbounds [100007 x i64], ptr %2, i64 0, i64 %82
  %84 = load i64, ptr %83, align 8, !tbaa !8
  %85 = getelementptr inbounds i64, ptr %20, i64 %.02942
  %86 = load i64, ptr %85, align 16, !tbaa !8
  %87 = getelementptr inbounds [100007 x i64], ptr %3, i64 0, i64 %86
  %88 = load i64, ptr %87, align 8, !tbaa !8
  %89 = add nsw i64 %88, %84
  store i64 %89, ptr %87, align 8, !tbaa !8
  %90 = add nuw nsw i64 %.02942, 2
  %91 = getelementptr inbounds [100007 x i64], ptr %2, i64 0, i64 %90
  %92 = load i64, ptr %91, align 16, !tbaa !8
  %93 = getelementptr inbounds i64, ptr %20, i64 %82
  %94 = load i64, ptr %93, align 8, !tbaa !8
  %95 = getelementptr inbounds [100007 x i64], ptr %3, i64 0, i64 %94
  %96 = load i64, ptr %95, align 8, !tbaa !8
  %97 = add nsw i64 %96, %92
  store i64 %97, ptr %95, align 8, !tbaa !8
  %niter73.next.1 = add i64 %niter73, 2
  %niter73.ncmp.1 = icmp eq i64 %niter73.next.1, %unroll_iter72
  br i1 %niter73.ncmp.1, label %._crit_edge45.loopexit.unr-lcssa, label %.lr.ph44, !llvm.loop !18

._crit_edge51:                                    ; preds = %.lr.ph50, %._crit_edge45
  %.028.lcssa = phi i64 [ 0, %._crit_edge45 ], [ %103, %.lr.ph50 ]
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.028.lcssa)
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %98, ptr noundef nonnull @.str)
  call void @llvm.lifetime.end.p0(i64 800056, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 800056, ptr nonnull %2) #8
  call void @llvm.stackrestore.p0(ptr %17)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  ret i32 0

.lr.ph50:                                         ; preds = %._crit_edge45, %.lr.ph50
  %.02648 = phi ptr [ %104, %.lr.ph50 ], [ %18, %._crit_edge45 ]
  %.02847 = phi i64 [ %103, %.lr.ph50 ], [ 0, %._crit_edge45 ]
  %100 = load i64, ptr %.02648, align 8, !tbaa !8
  %101 = getelementptr inbounds [100007 x i64], ptr %3, i64 0, i64 %100
  %102 = load i64, ptr %101, align 8, !tbaa !8
  %103 = add nsw i64 %102, %.02847
  %104 = getelementptr inbounds i8, ptr %.02648, i64 8
  %.not = icmp eq ptr %104, %81
  br i1 %.not, label %._crit_edge51, label %.lr.ph50
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNSt8ios_base9precisionEl(ptr noundef nonnull align 8 dereferenceable(216), i64 noundef) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

; 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 nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #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 = { 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 #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 nosync nounwind willreturn }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { 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 #8 = { 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 = !{!"long", !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, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass