; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/317 Division 1/Problem A (A)

; 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" }

@ans = external dso_local global i64, align 8
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@c = external dso_local global i32, align 4
@l = external dso_local global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @a)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(4) @b)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 4 dereferenceable(4) @c)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) @l)
  %18 = load i32, ptr @l, align 4, !tbaa !5
  %19 = add nsw i32 %18, 3
  %20 = sext i32 %19 to i64
  %21 = load i32, ptr @l, align 4, !tbaa !5
  %22 = add nsw i32 %21, 2
  %23 = sext i32 %22 to i64
  %24 = mul nsw i64 %20, %23
  %25 = load i32, ptr @l, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  %27 = sext i32 %26 to i64
  %28 = mul nsw i64 %24, %27
  %29 = sdiv i64 %28, 6
  store i64 %29, ptr @ans, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %61, %0
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = load i32, ptr @l, align 4, !tbaa !5
  %33 = icmp sle i32 %31, %32
  br i1 %33, label %35, label %34

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

35:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %36 = load i32, ptr @a, align 4, !tbaa !5
  %37 = load i32, ptr @b, align 4, !tbaa !5
  %38 = sub nsw i32 %36, %37
  %39 = load i32, ptr @c, align 4, !tbaa !5
  %40 = sub nsw i32 %38, %39
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = add nsw i32 %40, %41
  store i32 %42, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %43 = load i32, ptr @l, align 4, !tbaa !5
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = sub nsw i32 %43, %44
  store i32 %45, ptr %5, align 4, !tbaa !5
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  store i64 %48, ptr %3, align 8, !tbaa !9
  %49 = load i64, ptr %3, align 8, !tbaa !9
  %50 = icmp sge i64 %49, 0
  br i1 %50, label %51, label %60

51:                                               ; preds = %35
  %52 = load i64, ptr %3, align 8, !tbaa !9
  %53 = add nsw i64 %52, 1
  %54 = load i64, ptr %3, align 8, !tbaa !9
  %55 = add nsw i64 %54, 2
  %56 = mul nsw i64 %53, %55
  %57 = sdiv i64 %56, 2
  %58 = load i64, ptr @ans, align 8, !tbaa !9
  %59 = sub nsw i64 %58, %57
  store i64 %59, ptr @ans, align 8, !tbaa !9
  br label %60

60:                                               ; preds = %51, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %61

61:                                               ; preds = %60
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %2, align 4, !tbaa !5
  br label %30, !llvm.loop !11

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

65:                                               ; preds = %96, %64
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = load i32, ptr @l, align 4, !tbaa !5
  %68 = icmp sle i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %99

70:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %71 = load i32, ptr @b, align 4, !tbaa !5
  %72 = load i32, ptr @a, align 4, !tbaa !5
  %73 = sub nsw i32 %71, %72
  %74 = load i32, ptr @c, align 4, !tbaa !5
  %75 = sub nsw i32 %73, %74
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = add nsw i32 %75, %76
  store i32 %77, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %78 = load i32, ptr @l, align 4, !tbaa !5
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = sub nsw i32 %78, %79
  store i32 %80, ptr %9, align 4, !tbaa !5
  %81 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  store i64 %83, ptr %7, align 8, !tbaa !9
  %84 = load i64, ptr %7, align 8, !tbaa !9
  %85 = icmp sge i64 %84, 0
  br i1 %85, label %86, label %95

86:                                               ; preds = %70
  %87 = load i64, ptr %7, align 8, !tbaa !9
  %88 = add nsw i64 %87, 1
  %89 = load i64, ptr %7, align 8, !tbaa !9
  %90 = add nsw i64 %89, 2
  %91 = mul nsw i64 %88, %90
  %92 = sdiv i64 %91, 2
  %93 = load i64, ptr @ans, align 8, !tbaa !9
  %94 = sub nsw i64 %93, %92
  store i64 %94, ptr @ans, align 8, !tbaa !9
  br label %95

95:                                               ; preds = %86, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %6, align 4, !tbaa !5
  br label %65, !llvm.loop !13

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

100:                                              ; preds = %131, %99
  %101 = load i32, ptr %10, align 4, !tbaa !5
  %102 = load i32, ptr @l, align 4, !tbaa !5
  %103 = icmp sle i32 %101, %102
  br i1 %103, label %105, label %104

104:                                              ; preds = %100
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %134

105:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %106 = load i32, ptr @c, align 4, !tbaa !5
  %107 = load i32, ptr @b, align 4, !tbaa !5
  %108 = sub nsw i32 %106, %107
  %109 = load i32, ptr @a, align 4, !tbaa !5
  %110 = sub nsw i32 %108, %109
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = add nsw i32 %110, %111
  store i32 %112, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %113 = load i32, ptr @l, align 4, !tbaa !5
  %114 = load i32, ptr %10, align 4, !tbaa !5
  %115 = sub nsw i32 %113, %114
  store i32 %115, ptr %13, align 4, !tbaa !5
  %116 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  store i64 %118, ptr %11, align 8, !tbaa !9
  %119 = load i64, ptr %11, align 8, !tbaa !9
  %120 = icmp sge i64 %119, 0
  br i1 %120, label %121, label %130

121:                                              ; preds = %105
  %122 = load i64, ptr %11, align 8, !tbaa !9
  %123 = add nsw i64 %122, 1
  %124 = load i64, ptr %11, align 8, !tbaa !9
  %125 = add nsw i64 %124, 2
  %126 = mul nsw i64 %123, %125
  %127 = sdiv i64 %126, 2
  %128 = load i64, ptr @ans, align 8, !tbaa !9
  %129 = sub nsw i64 %128, %127
  store i64 %129, ptr @ans, align 8, !tbaa !9
  br label %130

130:                                              ; preds = %121, %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %131

131:                                              ; preds = %130
  %132 = load i32, ptr %10, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %10, align 4, !tbaa !5
  br label %100, !llvm.loop !14

134:                                              ; preds = %104
  %135 = load i64, ptr @ans, align 8, !tbaa !9
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %135)
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %136, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0
}

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

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

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

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

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

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

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

@ans = external dso_local local_unnamed_addr global i64, align 8
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@c = external dso_local global i32, align 4
@l = external dso_local global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = 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) @a)
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) @b)
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(4) @c)
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(4) @l)
  %11 = load i32, ptr @l, align 4, !tbaa !5
  %12 = add nsw i32 %11, 3
  %13 = sext i32 %12 to i64
  %14 = add nsw i32 %11, 2
  %15 = sext i32 %14 to i64
  %16 = mul nsw i64 %13, %15
  %17 = add nsw i32 %11, 1
  %18 = sext i32 %17 to i64
  %19 = mul nsw i64 %16, %18
  %20 = sdiv i64 %19, 6
  store i64 %20, ptr @ans, align 8, !tbaa !9
  %.not37 = icmp slt i32 %11, 0
  br i1 %.not37, label %._crit_edge, label %.lr.ph

.preheader36:                                     ; preds = %39
  %.not2639 = icmp slt i32 %41, 0
  br i1 %.not2639, label %._crit_edge, label %.lr.ph41

.lr.ph:                                           ; preds = %0, %39
  %21 = phi i32 [ %41, %39 ], [ %11, %0 ]
  %.038 = phi i32 [ %40, %39 ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %22 = load i32, ptr @a, align 4, !tbaa !5
  %23 = load i32, ptr @b, align 4, !tbaa !5
  %24 = load i32, ptr @c, align 4, !tbaa !5
  %.neg29 = add i32 %22, %.038
  %25 = add i32 %23, %24
  %26 = sub i32 %.neg29, %25
  store i32 %26, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %27 = sub nsw i32 %21, %.038
  store i32 %27, ptr %2, align 4, !tbaa !5
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %29 = load i32, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %30 = icmp sgt i32 %29, -1
  br i1 %30, label %31, label %39

31:                                               ; preds = %.lr.ph
  %32 = zext nneg i32 %29 to i64
  %33 = add nuw nsw i64 %32, 1
  %34 = add nuw nsw i64 %32, 2
  %35 = mul nuw nsw i64 %33, %34
  %36 = lshr i64 %35, 1
  %37 = load i64, ptr @ans, align 8, !tbaa !9
  %38 = sub nsw i64 %37, %36
  store i64 %38, ptr @ans, align 8, !tbaa !9
  br label %39

39:                                               ; preds = %31, %.lr.ph
  %40 = add nuw nsw i32 %.038, 1
  %41 = load i32, ptr @l, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.038, %41
  br i1 %.not.not, label %.lr.ph, label %.preheader36, !llvm.loop !11

.preheader:                                       ; preds = %60
  %.not2742 = icmp slt i32 %62, 0
  br i1 %.not2742, label %._crit_edge, label %.lr.ph44

.lr.ph41:                                         ; preds = %.preheader36, %60
  %42 = phi i32 [ %62, %60 ], [ %41, %.preheader36 ]
  %.02240 = phi i32 [ %61, %60 ], [ 0, %.preheader36 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %43 = load i32, ptr @b, align 4, !tbaa !5
  %44 = load i32, ptr @a, align 4, !tbaa !5
  %45 = load i32, ptr @c, align 4, !tbaa !5
  %.neg32 = add i32 %43, %.02240
  %46 = add i32 %44, %45
  %47 = sub i32 %.neg32, %46
  store i32 %47, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %48 = sub nsw i32 %42, %.02240
  store i32 %48, ptr %4, align 4, !tbaa !5
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %50 = load i32, ptr %49, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %51 = icmp sgt i32 %50, -1
  br i1 %51, label %52, label %60

52:                                               ; preds = %.lr.ph41
  %53 = zext nneg i32 %50 to i64
  %54 = add nuw nsw i64 %53, 1
  %55 = add nuw nsw i64 %53, 2
  %56 = mul nuw nsw i64 %54, %55
  %57 = lshr i64 %56, 1
  %58 = load i64, ptr @ans, align 8, !tbaa !9
  %59 = sub nsw i64 %58, %57
  store i64 %59, ptr @ans, align 8, !tbaa !9
  br label %60

60:                                               ; preds = %52, %.lr.ph41
  %61 = add nuw nsw i32 %.02240, 1
  %62 = load i32, ptr @l, align 4, !tbaa !5
  %.not26.not = icmp slt i32 %.02240, %62
  br i1 %.not26.not, label %.lr.ph41, label %.preheader, !llvm.loop !13

._crit_edge:                                      ; preds = %84, %0, %.preheader36, %.preheader
  %63 = load i64, ptr @ans, align 8, !tbaa !9
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %63)
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.lr.ph44:                                         ; preds = %.preheader, %84
  %66 = phi i32 [ %86, %84 ], [ %62, %.preheader ]
  %.02143 = phi i32 [ %85, %84 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %67 = load i32, ptr @c, align 4, !tbaa !5
  %68 = load i32, ptr @b, align 4, !tbaa !5
  %69 = load i32, ptr @a, align 4, !tbaa !5
  %.neg35 = add i32 %67, %.02143
  %70 = add i32 %68, %69
  %71 = sub i32 %.neg35, %70
  store i32 %71, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %72 = sub nsw i32 %66, %.02143
  store i32 %72, ptr %6, align 4, !tbaa !5
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %74 = load i32, ptr %73, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %75 = icmp sgt i32 %74, -1
  br i1 %75, label %76, label %84

76:                                               ; preds = %.lr.ph44
  %77 = zext nneg i32 %74 to i64
  %78 = add nuw nsw i64 %77, 1
  %79 = add nuw nsw i64 %77, 2
  %80 = mul nuw nsw i64 %78, %79
  %81 = lshr i64 %80, 1
  %82 = load i64, ptr @ans, align 8, !tbaa !9
  %83 = sub nsw i64 %82, %81
  store i64 %83, ptr @ans, align 8, !tbaa !9
  br label %84

84:                                               ; preds = %76, %.lr.ph44
  %85 = add nuw nsw i32 %.02143, 1
  %86 = load i32, ptr @l, align 4, !tbaa !5
  %.not27.not = icmp slt i32 %.02143, %86
  br i1 %.not27.not, label %.lr.ph44, label %._crit_edge, !llvm.loop !14
}

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

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

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

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

; 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

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


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