; LLVM IR from chirag-singhal/Coding-Interview-101 :: Miscellaneous/Codechef/feblong (5)

; 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: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7findDayiii(i32 noundef, i32 noundef, i32 noundef) #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z10getLastDayii(i32 noundef, i32 noundef) #0

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

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

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

23:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(8) %7)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !9
  %28 = load i32, ptr %5, align 4, !tbaa !5
  %29 = icmp slt i32 %28, 2
  br i1 %29, label %30, label %33

30:                                               ; preds = %23
  store i32 2, ptr %5, align 4, !tbaa !5
  %31 = load i64, ptr %7, align 8, !tbaa !11
  %32 = add nsw i64 %31, -1
  store i64 %32, ptr %7, align 8, !tbaa !11
  br label %34

33:                                               ; preds = %23
  store i32 2, ptr %5, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %33, %30
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = icmp sgt i32 %35, 2
  br i1 %36, label %37, label %40

37:                                               ; preds = %34
  store i32 2, ptr %4, align 4, !tbaa !5
  %38 = load i64, ptr %6, align 8, !tbaa !11
  %39 = add nsw i64 %38, 1
  store i64 %39, ptr %6, align 8, !tbaa !11
  br label %41

40:                                               ; preds = %34
  store i32 2, ptr %4, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %40, %37
  br label %42

42:                                               ; preds = %94, %41
  %43 = load i64, ptr %6, align 8, !tbaa !11
  %44 = srem i64 %43, 2800
  %45 = icmp ne i64 %44, 0
  br i1 %45, label %46, label %97

46:                                               ; preds = %42
  %47 = load i64, ptr %6, align 8, !tbaa !11
  %48 = load i64, ptr %7, align 8, !tbaa !11
  %49 = add nsw i64 %48, 1
  %50 = icmp eq i64 %47, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %46
  br label %97

52:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = load i64, ptr %6, align 8, !tbaa !11
  %55 = trunc i64 %54 to i32
  %56 = call noundef i32 @_Z7findDayiii(i32 noundef 1, i32 noundef %53, i32 noundef %55)
  store i32 %56, ptr %9, align 4, !tbaa !5
  %57 = load i32, ptr %9, align 4, !tbaa !5
  %58 = sub nsw i32 7, %57
  store i32 %58, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = load i64, ptr %6, align 8, !tbaa !11
  %61 = trunc i64 %60 to i32
  %62 = call noundef i32 @_Z10getLastDayii(i32 noundef %59, i32 noundef %61)
  store i32 %62, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %63 = load i32, ptr %10, align 4, !tbaa !5
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = load i64, ptr %6, align 8, !tbaa !11
  %66 = trunc i64 %65 to i32
  %67 = call noundef i32 @_Z7findDayiii(i32 noundef %63, i32 noundef %64, i32 noundef %66)
  store i32 %67, ptr %11, align 4, !tbaa !5
  %68 = load i32, ptr %11, align 4, !tbaa !5
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %70, label %73

70:                                               ; preds = %52
  %71 = load i32, ptr %10, align 4, !tbaa !5
  %72 = sub nsw i32 %71, 13
  store i32 %72, ptr %10, align 4, !tbaa !5
  br label %86

73:                                               ; preds = %52
  %74 = load i32, ptr %9, align 4, !tbaa !5
  %75 = icmp eq i32 %74, 1
  br i1 %75, label %76, label %79

76:                                               ; preds = %73
  %77 = load i32, ptr %10, align 4, !tbaa !5
  %78 = sub nsw i32 %77, 7
  store i32 %78, ptr %10, align 4, !tbaa !5
  br label %85

79:                                               ; preds = %73
  %80 = load i32, ptr %11, align 4, !tbaa !5
  %81 = sub nsw i32 %80, 1
  %82 = add nsw i32 %81, 7
  %83 = load i32, ptr %10, align 4, !tbaa !5
  %84 = sub nsw i32 %83, %82
  store i32 %84, ptr %10, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %79, %76
  br label %86

86:                                               ; preds = %85, %70
  %87 = load i32, ptr %9, align 4, !tbaa !5
  %88 = add nsw i32 %87, 10
  %89 = load i32, ptr %10, align 4, !tbaa !5
  %90 = icmp sgt i32 %88, %89
  br i1 %90, label %91, label %94

91:                                               ; preds = %86
  %92 = load i64, ptr %8, align 8, !tbaa !9
  %93 = add nsw i64 %92, 1
  store i64 %93, ptr %8, align 8, !tbaa !9
  br label %94

94:                                               ; preds = %91, %86
  %95 = load i64, ptr %6, align 8, !tbaa !11
  %96 = add nsw i64 %95, 1
  store i64 %96, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %42, !llvm.loop !13

97:                                               ; preds = %51, %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %98 = load i64, ptr %7, align 8, !tbaa !11
  %99 = load i64, ptr %6, align 8, !tbaa !11
  %100 = sub nsw i64 %98, %99
  %101 = sdiv i64 %100, 2800
  %102 = trunc i64 %101 to i32
  store i32 %102, ptr %12, align 4, !tbaa !5
  %103 = load i32, ptr %12, align 4, !tbaa !5
  %104 = icmp sgt i32 %103, 0
  br i1 %104, label %105, label %119

105:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store i64 616, ptr %13, align 8, !tbaa !9
  %106 = load i64, ptr %13, align 8, !tbaa !9
  %107 = load i32, ptr %12, align 4, !tbaa !5
  %108 = sub nsw i32 %107, 1
  %109 = sext i32 %108 to i64
  %110 = mul nsw i64 %106, %109
  %111 = load i64, ptr %8, align 8, !tbaa !9
  %112 = add nsw i64 %111, %110
  store i64 %112, ptr %8, align 8, !tbaa !9
  %113 = load i32, ptr %12, align 4, !tbaa !5
  %114 = sub nsw i32 %113, 1
  %115 = mul nsw i32 %114, 2800
  %116 = sext i32 %115 to i64
  %117 = load i64, ptr %6, align 8, !tbaa !11
  %118 = add nsw i64 %117, %116
  store i64 %118, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %119

119:                                              ; preds = %105, %97
  br label %120

120:                                              ; preds = %167, %119
  %121 = load i64, ptr %6, align 8, !tbaa !11
  %122 = load i64, ptr %7, align 8, !tbaa !11
  %123 = add nsw i64 %122, 1
  %124 = icmp slt i64 %121, %123
  br i1 %124, label %125, label %170

125:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %126 = load i32, ptr %4, align 4, !tbaa !5
  %127 = load i64, ptr %6, align 8, !tbaa !11
  %128 = trunc i64 %127 to i32
  %129 = call noundef i32 @_Z7findDayiii(i32 noundef 1, i32 noundef %126, i32 noundef %128)
  store i32 %129, ptr %14, align 4, !tbaa !5
  %130 = load i32, ptr %14, align 4, !tbaa !5
  %131 = sub nsw i32 7, %130
  store i32 %131, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %132 = load i32, ptr %4, align 4, !tbaa !5
  %133 = load i64, ptr %6, align 8, !tbaa !11
  %134 = trunc i64 %133 to i32
  %135 = call noundef i32 @_Z10getLastDayii(i32 noundef %132, i32 noundef %134)
  store i32 %135, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %136 = load i32, ptr %15, align 4, !tbaa !5
  %137 = load i32, ptr %4, align 4, !tbaa !5
  %138 = load i64, ptr %6, align 8, !tbaa !11
  %139 = trunc i64 %138 to i32
  %140 = call noundef i32 @_Z7findDayiii(i32 noundef %136, i32 noundef %137, i32 noundef %139)
  store i32 %140, ptr %16, align 4, !tbaa !5
  %141 = load i32, ptr %16, align 4, !tbaa !5
  %142 = icmp eq i32 %141, 0
  br i1 %142, label %143, label %146

143:                                              ; preds = %125
  %144 = load i32, ptr %15, align 4, !tbaa !5
  %145 = sub nsw i32 %144, 13
  store i32 %145, ptr %15, align 4, !tbaa !5
  br label %159

146:                                              ; preds = %125
  %147 = load i32, ptr %14, align 4, !tbaa !5
  %148 = icmp eq i32 %147, 1
  br i1 %148, label %149, label %152

149:                                              ; preds = %146
  %150 = load i32, ptr %15, align 4, !tbaa !5
  %151 = sub nsw i32 %150, 7
  store i32 %151, ptr %15, align 4, !tbaa !5
  br label %158

152:                                              ; preds = %146
  %153 = load i32, ptr %16, align 4, !tbaa !5
  %154 = sub nsw i32 %153, 1
  %155 = add nsw i32 %154, 7
  %156 = load i32, ptr %15, align 4, !tbaa !5
  %157 = sub nsw i32 %156, %155
  store i32 %157, ptr %15, align 4, !tbaa !5
  br label %158

158:                                              ; preds = %152, %149
  br label %159

159:                                              ; preds = %158, %143
  %160 = load i32, ptr %14, align 4, !tbaa !5
  %161 = add nsw i32 %160, 10
  %162 = load i32, ptr %15, align 4, !tbaa !5
  %163 = icmp sgt i32 %161, %162
  br i1 %163, label %164, label %167

164:                                              ; preds = %159
  %165 = load i64, ptr %8, align 8, !tbaa !9
  %166 = add nsw i64 %165, 1
  store i64 %166, ptr %8, align 8, !tbaa !9
  br label %167

167:                                              ; preds = %164, %159
  %168 = load i64, ptr %6, align 8, !tbaa !11
  %169 = add nsw i64 %168, 1
  store i64 %169, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %120, !llvm.loop !15

170:                                              ; preds = %120
  %171 = load i64, ptr %8, align 8, !tbaa !9
  %172 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %171)
  %173 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %172, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %174

174:                                              ; preds = %170
  %175 = load i32, ptr %3, align 4, !tbaa !5
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %3, align 4, !tbaa !5
  br label %18, !llvm.loop !16

177:                                              ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  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)) #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: 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


; 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 nounwind uwtable
declare dso_local noundef i32 @_Z7findDayiii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z10getLastDayii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %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 %.lr.ph57, label %._crit_edge58

._crit_edge58:                                    ; preds = %._crit_edge53, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

.lr.ph57:                                         ; preds = %0, %._crit_edge53
  %.055 = phi i32 [ %104, %._crit_edge53 ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %9 = 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)
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %13 = load i32, ptr %3, align 4, !tbaa !5
  %14 = icmp slt i32 %13, 2
  br i1 %14, label %15, label %18

15:                                               ; preds = %.lr.ph57
  %16 = load i64, ptr %5, align 8, !tbaa !9
  %17 = add nsw i64 %16, -1
  store i64 %17, ptr %5, align 8, !tbaa !9
  br label %18

18:                                               ; preds = %.lr.ph57, %15
  store i32 2, ptr %3, align 4
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = icmp sgt i32 %19, 2
  %21 = load i64, ptr %4, align 8, !tbaa !9
  br i1 %20, label %22, label %24

22:                                               ; preds = %18
  %23 = add nsw i64 %21, 1
  store i64 %23, ptr %4, align 8, !tbaa !9
  br label %24

24:                                               ; preds = %18, %22
  %25 = phi i64 [ %23, %22 ], [ %21, %18 ]
  store i32 2, ptr %2, align 4
  %26 = srem i64 %25, 2800
  %.not43 = icmp eq i64 %26, 0
  br i1 %.not43, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %24, %52
  %27 = phi i64 [ %57, %52 ], [ %25, %24 ]
  %.03144 = phi i64 [ %spec.select, %52 ], [ 0, %24 ]
  %28 = load i64, ptr %5, align 8, !tbaa !9
  %29 = add nsw i64 %28, 1
  %30 = icmp eq i64 %27, %29
  br i1 %30, label %._crit_edge, label %31

31:                                               ; preds = %.lr.ph
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = trunc i64 %27 to i32
  %34 = call noundef i32 @_Z7findDayiii(i32 noundef 1, i32 noundef %32, i32 noundef %33)
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = load i64, ptr %4, align 8, !tbaa !9
  %37 = trunc i64 %36 to i32
  %38 = call noundef i32 @_Z10getLastDayii(i32 noundef %35, i32 noundef %37)
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = load i64, ptr %4, align 8, !tbaa !9
  %41 = trunc i64 %40 to i32
  %42 = call noundef i32 @_Z7findDayiii(i32 noundef %38, i32 noundef %39, i32 noundef %41)
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %44, label %46

44:                                               ; preds = %31
  %45 = add nsw i32 %38, -13
  br label %52

46:                                               ; preds = %31
  %47 = icmp eq i32 %34, 6
  br i1 %47, label %48, label %50

48:                                               ; preds = %46
  %49 = add nsw i32 %38, -7
  br label %52

50:                                               ; preds = %46
  %.neg40 = add i32 %38, -6
  %51 = sub i32 %.neg40, %42
  br label %52

52:                                               ; preds = %48, %50, %44
  %.032 = phi i32 [ %45, %44 ], [ %49, %48 ], [ %51, %50 ]
  %53 = sub i32 17, %34
  %54 = icmp sgt i32 %53, %.032
  %55 = zext i1 %54 to i64
  %spec.select = add nuw nsw i64 %.03144, %55
  %56 = load i64, ptr %4, align 8, !tbaa !9
  %57 = add nsw i64 %56, 1
  store i64 %57, ptr %4, align 8, !tbaa !9
  %58 = srem i64 %57, 2800
  %.not = icmp eq i64 %58, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %52, %.lr.ph, %24
  %.031.lcssa = phi i64 [ 0, %24 ], [ %.03144, %.lr.ph ], [ %spec.select, %52 ]
  %.lcssa = phi i64 [ %25, %24 ], [ %27, %.lr.ph ], [ %57, %52 ]
  %59 = load i64, ptr %5, align 8, !tbaa !9
  %60 = sub nsw i64 %59, %.lcssa
  %61 = sdiv i64 %60, 2800
  %62 = trunc i64 %61 to i32
  %63 = icmp sgt i32 %62, 0
  br i1 %63, label %64, label %72

64:                                               ; preds = %._crit_edge
  %65 = add nsw i32 %62, -1
  %66 = zext nneg i32 %65 to i64
  %67 = mul nuw nsw i64 %66, 616
  %68 = add nuw nsw i64 %67, %.031.lcssa
  %69 = mul nsw i32 %65, 2800
  %70 = zext nneg i32 %69 to i64
  %71 = add nsw i64 %.lcssa, %70
  store i64 %71, ptr %4, align 8, !tbaa !9
  br label %72

72:                                               ; preds = %64, %._crit_edge
  %73 = phi i64 [ %71, %64 ], [ %.lcssa, %._crit_edge ]
  %.2 = phi i64 [ %68, %64 ], [ %.031.lcssa, %._crit_edge ]
  %.not3849 = icmp sgt i64 %73, %59
  br i1 %.not3849, label %._crit_edge53, label %.lr.ph52

.lr.ph52:                                         ; preds = %72, %95
  %74 = phi i64 [ %100, %95 ], [ %73, %72 ]
  %.350 = phi i64 [ %spec.select39, %95 ], [ %.2, %72 ]
  %75 = load i32, ptr %2, align 4, !tbaa !5
  %76 = trunc i64 %74 to i32
  %77 = call noundef i32 @_Z7findDayiii(i32 noundef 1, i32 noundef %75, i32 noundef %76)
  %78 = load i32, ptr %2, align 4, !tbaa !5
  %79 = load i64, ptr %4, align 8, !tbaa !9
  %80 = trunc i64 %79 to i32
  %81 = call noundef i32 @_Z10getLastDayii(i32 noundef %78, i32 noundef %80)
  %82 = load i32, ptr %2, align 4, !tbaa !5
  %83 = load i64, ptr %4, align 8, !tbaa !9
  %84 = trunc i64 %83 to i32
  %85 = call noundef i32 @_Z7findDayiii(i32 noundef %81, i32 noundef %82, i32 noundef %84)
  %86 = icmp eq i32 %85, 0
  br i1 %86, label %87, label %89

87:                                               ; preds = %.lr.ph52
  %88 = add nsw i32 %81, -13
  br label %95

89:                                               ; preds = %.lr.ph52
  %90 = icmp eq i32 %77, 6
  br i1 %90, label %91, label %93

91:                                               ; preds = %89
  %92 = add nsw i32 %81, -7
  br label %95

93:                                               ; preds = %89
  %.neg42 = add i32 %81, -6
  %94 = sub i32 %.neg42, %85
  br label %95

95:                                               ; preds = %91, %93, %87
  %.030 = phi i32 [ %88, %87 ], [ %92, %91 ], [ %94, %93 ]
  %96 = sub i32 17, %77
  %97 = icmp sgt i32 %96, %.030
  %98 = zext i1 %97 to i64
  %spec.select39 = add nsw i64 %.350, %98
  %99 = load i64, ptr %4, align 8, !tbaa !9
  %100 = add nsw i64 %99, 1
  store i64 %100, ptr %4, align 8, !tbaa !9
  %101 = load i64, ptr %5, align 8, !tbaa !9
  %.not38.not = icmp slt i64 %99, %101
  br i1 %.not38.not, label %.lr.ph52, label %._crit_edge53, !llvm.loop !13

._crit_edge53:                                    ; preds = %95, %72
  %.3.lcssa = phi i64 [ %.2, %72 ], [ %spec.select39, %95 ]
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.3.lcssa)
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %102, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %104 = add nuw nsw i32 %.055, 1
  %105 = load i32, ptr %1, align 4, !tbaa !5
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %.lr.ph57, label %._crit_edge58, !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 #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 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 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}


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