; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Company Contests/Walmart Algo 2016/Problem B (B)

; 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 [200100 x i32], align 16
@dp = external dso_local global [200100 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #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 i64, align 8
  %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
  store i32 0, ptr %1, align 4
  %11 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %12 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %13 = getelementptr i8, ptr %12, i64 -24
  %14 = load i64, ptr %13, align 8
  %15 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %14
  %16 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %15, ptr noundef null)
  %17 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %18 = getelementptr i8, ptr %17, i64 -24
  %19 = load i64, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %19
  %21 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %20, ptr noundef null)
  %22 = 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 !8
  br label %23

23:                                               ; preds = %33, %0
  %24 = load i32, ptr %2, align 4, !tbaa !8
  %25 = load i32, ptr @n, align 4, !tbaa !8
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %36

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

33:                                               ; preds = %28
  %34 = load i32, ptr %2, align 4, !tbaa !8
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %2, align 4, !tbaa !8
  br label %23, !llvm.loop !11

36:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %37 = load i32, ptr @n, align 4, !tbaa !8
  %38 = add nsw i32 %37, 1
  %39 = sext i32 %38 to i64
  store i64 %39, ptr %3, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !8
  br label %40

40:                                               ; preds = %106, %36
  %41 = load i32, ptr %4, align 4, !tbaa !8
  %42 = icmp sle i32 %41, 100
  br i1 %42, label %44, label %43

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

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

45:                                               ; preds = %53, %44
  %46 = load i32, ptr %6, align 4, !tbaa !8
  %47 = icmp sle i32 %46, 100
  br i1 %47, label %49, label %48

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

49:                                               ; preds = %45
  %50 = load i32, ptr %6, align 4, !tbaa !8
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [200100 x i64], ptr @dp, i64 0, i64 %51
  store i64 0, ptr %52, align 8, !tbaa !13
  br label %53

53:                                               ; preds = %49
  %54 = load i32, ptr %6, align 4, !tbaa !8
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %6, align 4, !tbaa !8
  br label %45, !llvm.loop !15

56:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !8
  br label %57

57:                                               ; preds = %102, %56
  %58 = load i32, ptr %7, align 4, !tbaa !8
  %59 = load i32, ptr @n, align 4, !tbaa !8
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %105

62:                                               ; preds = %57
  %63 = load i32, ptr %7, align 4, !tbaa !8
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !8
  %67 = load i32, ptr %4, align 4, !tbaa !8
  %68 = sub nsw i32 %66, %67
  %69 = icmp sgt i32 %68, 0
  br i1 %69, label %70, label %95

70:                                               ; preds = %62
  %71 = load i32, ptr %7, align 4, !tbaa !8
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !8
  %75 = load i32, ptr %4, align 4, !tbaa !8
  %76 = sub nsw i32 %74, %75
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [200100 x i64], ptr @dp, i64 0, i64 %77
  %79 = load i64, ptr %78, align 8, !tbaa !13
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %79)
  %80 = load i32, ptr %7, align 4, !tbaa !8
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !8
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [200100 x i64], ptr @dp, i64 0, i64 %84
  %86 = load i32, ptr %7, align 4, !tbaa !8
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !8
  %90 = load i32, ptr %4, align 4, !tbaa !8
  %91 = sub nsw i32 %89, %90
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [200100 x i64], ptr @dp, i64 0, i64 %92
  %94 = load i64, ptr %93, align 8, !tbaa !13
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %85, i64 noundef %94)
  br label %95

95:                                               ; preds = %70, %62
  %96 = load i32, ptr %7, align 4, !tbaa !8
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !8
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [200100 x i64], ptr @dp, i64 0, i64 %100
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %101, i64 noundef 1)
  br label %102

102:                                              ; preds = %95
  %103 = load i32, ptr %7, align 4, !tbaa !8
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %7, align 4, !tbaa !8
  br label %57, !llvm.loop !16

105:                                              ; preds = %61
  br label %106

106:                                              ; preds = %105
  %107 = load i32, ptr %4, align 4, !tbaa !8
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %4, align 4, !tbaa !8
  br label %40, !llvm.loop !17

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

110:                                              ; preds = %176, %109
  %111 = load i32, ptr %8, align 4, !tbaa !8
  %112 = icmp sle i32 %111, 100
  br i1 %112, label %114, label %113

113:                                              ; preds = %110
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %179

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

115:                                              ; preds = %123, %114
  %116 = load i32, ptr %9, align 4, !tbaa !8
  %117 = icmp sle i32 %116, 100
  br i1 %117, label %119, label %118

118:                                              ; preds = %115
  store i32 17, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %126

119:                                              ; preds = %115
  %120 = load i32, ptr %9, align 4, !tbaa !8
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [200100 x i64], ptr @dp, i64 0, i64 %121
  store i64 0, ptr %122, align 8, !tbaa !13
  br label %123

123:                                              ; preds = %119
  %124 = load i32, ptr %9, align 4, !tbaa !8
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %9, align 4, !tbaa !8
  br label %115, !llvm.loop !18

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

127:                                              ; preds = %172, %126
  %128 = load i32, ptr %10, align 4, !tbaa !8
  %129 = load i32, ptr @n, align 4, !tbaa !8
  %130 = icmp slt i32 %128, %129
  br i1 %130, label %132, label %131

131:                                              ; preds = %127
  store i32 20, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %175

132:                                              ; preds = %127
  %133 = load i32, ptr %10, align 4, !tbaa !8
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !8
  %137 = load i32, ptr %8, align 4, !tbaa !8
  %138 = add nsw i32 %136, %137
  %139 = icmp sle i32 %138, 100
  br i1 %139, label %140, label %165

140:                                              ; preds = %132
  %141 = load i32, ptr %10, align 4, !tbaa !8
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !8
  %145 = load i32, ptr %8, align 4, !tbaa !8
  %146 = add nsw i32 %144, %145
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [200100 x i64], ptr @dp, i64 0, i64 %147
  %149 = load i64, ptr %148, align 8, !tbaa !13
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %149)
  %150 = load i32, ptr %10, align 4, !tbaa !8
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !8
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [200100 x i64], ptr @dp, i64 0, i64 %154
  %156 = load i32, ptr %10, align 4, !tbaa !8
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !8
  %160 = load i32, ptr %8, align 4, !tbaa !8
  %161 = add nsw i32 %159, %160
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [200100 x i64], ptr @dp, i64 0, i64 %162
  %164 = load i64, ptr %163, align 8, !tbaa !13
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %155, i64 noundef %164)
  br label %165

165:                                              ; preds = %140, %132
  %166 = load i32, ptr %10, align 4, !tbaa !8
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !8
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [200100 x i64], ptr @dp, i64 0, i64 %170
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %171, i64 noundef 1)
  br label %172

172:                                              ; preds = %165
  %173 = load i32, ptr %10, align 4, !tbaa !8
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %10, align 4, !tbaa !8
  br label %127, !llvm.loop !19

175:                                              ; preds = %131
  br label %176

176:                                              ; preds = %175
  %177 = load i32, ptr %8, align 4, !tbaa !8
  %178 = add nsw i32 %177, 1
  store i32 %178, ptr %8, align 4, !tbaa !8
  br label %110, !llvm.loop !20

179:                                              ; preds = %113
  %180 = load i64, ptr %3, align 8, !tbaa !13
  %181 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %180)
  %182 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %181, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  %183 = load i32, ptr %1, align 4
  ret i32 %183
}

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

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

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

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

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

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

; 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 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 #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 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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !10, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}


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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i64, align 8
  %2 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %3 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %4 = getelementptr i8, ptr %3, i64 -24
  %5 = load i64, ptr %4, align 8
  %6 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %5
  %7 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %6, ptr noundef null)
  %8 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %9 = getelementptr i8, ptr %8, i64 -24
  %10 = load i64, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %10
  %12 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %11, ptr noundef null)
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %14 = load i32, ptr @n, align 4, !tbaa !8
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa = phi i32 [ %14, %0 ], [ %20, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  %16 = add nsw i32 %.lcssa, 1
  %17 = sext i32 %16 to i64
  store i64 %17, ptr %1, align 8, !tbaa !11
  br label %.preheader45

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %18 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %indvars.iv
  %19 = 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) %18)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = load i32, ptr @n, align 4, !tbaa !8
  %21 = sext i32 %20 to i64
  %22 = icmp slt i64 %indvars.iv.next, %21
  br i1 %22, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.preheader45:                                     ; preds = %._crit_edge, %._crit_edge50
  %23 = phi i32 [ %.lcssa, %._crit_edge ], [ %25, %._crit_edge50 ]
  %.03851 = phi i32 [ 0, %._crit_edge ], [ %26, %._crit_edge50 ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(808) @dp, i8 0, i64 808, i1 false), !tbaa !11
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph49, label %._crit_edge50

._crit_edge50:                                    ; preds = %42, %.preheader45
  %25 = phi i32 [ %23, %.preheader45 ], [ %46, %42 ]
  %26 = add nuw nsw i32 %.03851, 1
  %exitcond.not = icmp eq i32 %26, 101
  br i1 %exitcond.not, label %.preheader42, label %.preheader45, !llvm.loop !15

.lr.ph49:                                         ; preds = %.preheader45, %42
  %indvars.iv62 = phi i64 [ %indvars.iv.next63, %42 ], [ 0, %.preheader45 ]
  %27 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %indvars.iv62
  %28 = load i32, ptr %27, align 4, !tbaa !8
  %29 = sub nsw i32 %28, %.03851
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %31, label %42

31:                                               ; preds = %.lr.ph49
  %32 = zext nneg i32 %29 to i64
  %33 = getelementptr inbounds [200100 x i64], ptr @dp, i64 0, i64 %32
  %34 = load i64, ptr %33, align 8, !tbaa !11
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %1, i64 noundef %34)
  %35 = load i32, ptr %27, align 4, !tbaa !8
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [200100 x i64], ptr @dp, i64 0, i64 %36
  %38 = sub nsw i32 %35, %.03851
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [200100 x i64], ptr @dp, i64 0, i64 %39
  %41 = load i64, ptr %40, align 8, !tbaa !11
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %37, i64 noundef %41)
  %.pre = load i32, ptr %27, align 4, !tbaa !8
  br label %42

42:                                               ; preds = %31, %.lr.ph49
  %43 = phi i32 [ %.pre, %31 ], [ %28, %.lr.ph49 ]
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [200100 x i64], ptr @dp, i64 0, i64 %44
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %45, i64 noundef 1)
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %46 = load i32, ptr @n, align 4, !tbaa !8
  %47 = sext i32 %46 to i64
  %48 = icmp slt i64 %indvars.iv.next63, %47
  br i1 %48, label %.lr.ph49, label %._crit_edge50, !llvm.loop !16

.preheader42:                                     ; preds = %._crit_edge50, %._crit_edge55
  %49 = phi i32 [ %55, %._crit_edge55 ], [ %25, %._crit_edge50 ]
  %.03556 = phi i32 [ %56, %._crit_edge55 ], [ 1, %._crit_edge50 ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(808) @dp, i8 0, i64 808, i1 false), !tbaa !11
  %50 = icmp sgt i32 %49, 0
  br i1 %50, label %.lr.ph54, label %._crit_edge55

51:                                               ; preds = %._crit_edge55
  %52 = load i64, ptr %1, align 8, !tbaa !11
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %52)
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %53, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0

._crit_edge55:                                    ; preds = %72, %.preheader42
  %55 = phi i32 [ %49, %.preheader42 ], [ %76, %72 ]
  %56 = add nuw nsw i32 %.03556, 1
  %exitcond71.not = icmp eq i32 %56, 101
  br i1 %exitcond71.not, label %51, label %.preheader42, !llvm.loop !17

.lr.ph54:                                         ; preds = %.preheader42, %72
  %indvars.iv68 = phi i64 [ %indvars.iv.next69, %72 ], [ 0, %.preheader42 ]
  %57 = getelementptr inbounds [200100 x i32], ptr @a, i64 0, i64 %indvars.iv68
  %58 = load i32, ptr %57, align 4, !tbaa !8
  %59 = add nsw i32 %58, %.03556
  %60 = icmp slt i32 %59, 101
  br i1 %60, label %61, label %72

61:                                               ; preds = %.lr.ph54
  %62 = sext i32 %59 to i64
  %63 = getelementptr inbounds [200100 x i64], ptr @dp, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !11
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %1, i64 noundef %64)
  %65 = load i32, ptr %57, align 4, !tbaa !8
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [200100 x i64], ptr @dp, i64 0, i64 %66
  %68 = add nsw i32 %65, %.03556
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [200100 x i64], ptr @dp, i64 0, i64 %69
  %71 = load i64, ptr %70, align 8, !tbaa !11
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %67, i64 noundef %71)
  %.pre72 = load i32, ptr %57, align 4, !tbaa !8
  br label %72

72:                                               ; preds = %61, %.lr.ph54
  %73 = phi i32 [ %.pre72, %61 ], [ %58, %.lr.ph54 ]
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [200100 x i64], ptr @dp, i64 0, i64 %74
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %75, i64 noundef 1)
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %76 = load i32, ptr @n, align 4, !tbaa !8
  %77 = sext i32 %76 to i64
  %78 = icmp slt i64 %indvars.iv.next69, %77
  br i1 %78, label %.lr.ph54, label %._crit_edge55, !llvm.loop !18
}

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

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

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

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

; 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 uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #4 align 2

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

attributes #0 = { 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 #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 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 = { 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: write) }
attributes #7 = { nounwind }

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

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


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