; LLVM IR from eyangch/competitive-programming :: Codeforces/1334 (d)

; 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 i32, align 4
  %3 = alloca i64, 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
  store i32 0, ptr %1, align 4
  %9 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %10 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %12
  %14 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  %15 = 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)
  br label %16

16:                                               ; preds = %129, %0
  %17 = load i32, ptr %2, align 4, !tbaa !8
  %18 = add nsw i32 %17, -1
  store i32 %18, ptr %2, align 4, !tbaa !8
  %19 = icmp ne i32 %17, 0
  br i1 %19, label %20, label %131

20:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %24 = load i64, ptr %3, align 8, !tbaa !11
  %25 = mul nsw i64 2, %24
  %26 = sub nsw i64 %25, 1
  %27 = sitofp i64 %26 to x86_fp80
  %28 = load i64, ptr %3, align 8, !tbaa !11
  %29 = mul nsw i64 -2, %28
  %30 = add nsw i64 %29, 1
  %31 = sitofp i64 %30 to x86_fp80
  %32 = call x86_fp80 @powl(x86_fp80 noundef %31, x86_fp80 noundef 0xK40008000000000000000) #8
  %33 = load i64, ptr %4, align 8, !tbaa !11
  %34 = mul nsw i64 4, %33
  %35 = sitofp i64 %34 to x86_fp80
  %36 = fsub x86_fp80 %32, %35
  %37 = call x86_fp80 @sqrtl(x86_fp80 noundef %36) #8
  %38 = fsub x86_fp80 %27, %37
  %39 = fdiv x86_fp80 %38, 0xK40008000000000000000
  %40 = call noundef x86_fp80 @_ZSt4ceile(x86_fp80 noundef %39)
  %41 = fptosi x86_fp80 %40 to i64
  store i64 %41, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %42 = load i64, ptr %6, align 8, !tbaa !11
  %43 = mul nsw i64 2, %42
  %44 = load i64, ptr %3, align 8, !tbaa !11
  %45 = sub nsw i64 %44, 1
  %46 = mul nsw i64 %43, %45
  %47 = load i64, ptr %6, align 8, !tbaa !11
  %48 = load i64, ptr %6, align 8, !tbaa !11
  %49 = sub nsw i64 %48, 1
  %50 = mul nsw i64 %47, %49
  %51 = sub nsw i64 %46, %50
  store i64 %51, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %52 = load i64, ptr %6, align 8, !tbaa !11
  %53 = add nsw i64 %52, 1
  %54 = load i64, ptr %4, align 8, !tbaa !11
  %55 = load i64, ptr %7, align 8, !tbaa !11
  %56 = load i64, ptr %3, align 8, !tbaa !11
  %57 = load i64, ptr %6, align 8, !tbaa !11
  %58 = sub nsw i64 %56, %57
  %59 = mul nsw i64 2, %58
  %60 = sub nsw i64 %55, %59
  %61 = sub nsw i64 %54, %60
  %62 = sub nsw i64 %61, 1
  %63 = sdiv i64 %62, 2
  %64 = add nsw i64 %53, %63
  store i64 %64, ptr %8, align 8, !tbaa !11
  br label %65

65:                                               ; preds = %114, %20
  %66 = load i64, ptr %4, align 8, !tbaa !11
  %67 = load i64, ptr %5, align 8, !tbaa !11
  %68 = icmp sle i64 %66, %67
  br i1 %68, label %69, label %129

69:                                               ; preds = %65
  br label %70

70:                                               ; preds = %94, %69
  %71 = load i64, ptr %4, align 8, !tbaa !11
  %72 = load i64, ptr %7, align 8, !tbaa !11
  %73 = icmp sle i64 %71, %72
  br i1 %73, label %74, label %78

74:                                               ; preds = %70
  %75 = load i64, ptr %4, align 8, !tbaa !11
  %76 = load i64, ptr %5, align 8, !tbaa !11
  %77 = icmp sle i64 %75, %76
  br label %78

78:                                               ; preds = %74, %70
  %79 = phi i1 [ false, %70 ], [ %77, %74 ]
  br i1 %79, label %80, label %97

80:                                               ; preds = %78
  %81 = load i64, ptr %4, align 8, !tbaa !11
  %82 = srem i64 %81, 2
  %83 = icmp eq i64 %82, 1
  br i1 %83, label %84, label %88

84:                                               ; preds = %80
  %85 = load i64, ptr %6, align 8, !tbaa !11
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %85)
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %86, ptr noundef @.str)
  br label %93

88:                                               ; preds = %80
  %89 = load i64, ptr %8, align 8, !tbaa !11
  %90 = add nsw i64 %89, 1
  store i64 %90, ptr %8, align 8, !tbaa !11
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %89)
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %91, ptr noundef @.str)
  br label %93

93:                                               ; preds = %88, %84
  br label %94

94:                                               ; preds = %93
  %95 = load i64, ptr %4, align 8, !tbaa !11
  %96 = add nsw i64 %95, 1
  store i64 %96, ptr %4, align 8, !tbaa !11
  br label %70, !llvm.loop !13

97:                                               ; preds = %78
  %98 = load i64, ptr %4, align 8, !tbaa !11
  %99 = load i64, ptr %5, align 8, !tbaa !11
  %100 = icmp eq i64 %98, %99
  br i1 %100, label %101, label %114

101:                                              ; preds = %97
  %102 = load i64, ptr %4, align 8, !tbaa !11
  %103 = load i64, ptr %3, align 8, !tbaa !11
  %104 = load i64, ptr %3, align 8, !tbaa !11
  %105 = sub nsw i64 %104, 1
  %106 = mul nsw i64 %103, %105
  %107 = add nsw i64 %106, 1
  %108 = icmp eq i64 %102, %107
  br i1 %108, label %109, label %114

109:                                              ; preds = %101
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %110, ptr noundef @.str)
  %112 = load i64, ptr %4, align 8, !tbaa !11
  %113 = add nsw i64 %112, 1
  store i64 %113, ptr %4, align 8, !tbaa !11
  br label %114

114:                                              ; preds = %109, %101, %97
  %115 = load i64, ptr %6, align 8, !tbaa !11
  %116 = add nsw i64 %115, 1
  store i64 %116, ptr %6, align 8, !tbaa !11
  %117 = load i64, ptr %6, align 8, !tbaa !11
  %118 = add nsw i64 %117, 1
  store i64 %118, ptr %8, align 8, !tbaa !11
  %119 = load i64, ptr %6, align 8, !tbaa !11
  %120 = mul nsw i64 2, %119
  %121 = load i64, ptr %3, align 8, !tbaa !11
  %122 = sub nsw i64 %121, 1
  %123 = mul nsw i64 %120, %122
  %124 = load i64, ptr %6, align 8, !tbaa !11
  %125 = load i64, ptr %6, align 8, !tbaa !11
  %126 = sub nsw i64 %125, 1
  %127 = mul nsw i64 %124, %126
  %128 = sub nsw i64 %123, %127
  store i64 %128, ptr %7, align 8, !tbaa !11
  br label %65, !llvm.loop !15

129:                                              ; preds = %65
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  br label %16, !llvm.loop !16

131:                                              ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  ret i32 0
}

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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

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: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef x86_fp80 @_ZSt4ceile(x86_fp80 noundef) #5

; Function Attrs: nounwind
declare x86_fp80 @sqrtl(x86_fp80 noundef) #6

; Function Attrs: nounwind
declare x86_fp80 @powl(x86_fp80 noundef, x86_fp80 noundef) #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 @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #4 align 2

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

; 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)) #7

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

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 = { 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 #6 = { nounwind "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 #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 = !{!"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}


; 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 i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %6 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %8
  %10 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  %11 = 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)
  %12 = load i32, ptr %1, align 4, !tbaa !8
  %13 = add nsw i32 %12, -1
  store i32 %13, ptr %1, align 4, !tbaa !8
  %.not28 = icmp eq i32 %12, 0
  br i1 %.not28, label %._crit_edge31, label %.lr.ph30

.lr.ph30:                                         ; preds = %0, %._crit_edge27
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %17 = load i64, ptr %2, align 8, !tbaa !11
  %18 = shl nsw i64 %17, 1
  %19 = add nsw i64 %18, -1
  %20 = sitofp i64 %19 to x86_fp80
  %21 = mul nsw i64 %17, -2
  %22 = or disjoint i64 %21, 1
  %23 = sitofp i64 %22 to x86_fp80
  %square = fmul x86_fp80 %23, %23
  %24 = load i64, ptr %3, align 8, !tbaa !11
  %25 = shl nsw i64 %24, 2
  %26 = sitofp i64 %25 to x86_fp80
  %27 = fsub x86_fp80 %square, %26
  %28 = call x86_fp80 @sqrtl(x86_fp80 noundef %27) #8
  %29 = fsub x86_fp80 %20, %28
  %30 = fmul x86_fp80 %29, 0xK3FFE8000000000000000
  %31 = call noundef x86_fp80 @_ZSt4ceile(x86_fp80 noundef %30)
  %32 = load i64, ptr %3, align 8
  %33 = load i64, ptr %4, align 8
  %.not1923 = icmp sgt i64 %32, %33
  br i1 %.not1923, label %._crit_edge27, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.lr.ph30
  %34 = fptosi x86_fp80 %31 to i64
  %35 = add nsw i64 %34, 1
  %36 = shl nsw i64 %34, 1
  %37 = load i64, ptr %2, align 8, !tbaa !11
  %38 = add nsw i64 %37, -1
  %39 = mul nsw i64 %36, %38
  %40 = add nsw i64 %34, -1
  %41 = mul nsw i64 %40, %34
  %42 = sub nsw i64 %39, %41
  %.neg = sub i64 %34, %37
  %.neg18 = shl i64 %.neg, 1
  %43 = add i64 %42, %.neg18
  %44 = xor i64 %43, -1
  %45 = add i64 %32, %44
  %46 = sdiv i64 %45, 2
  %47 = add nsw i64 %35, %46
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %78
  %.pre3436 = phi i64 [ %.pre3437, %78 ], [ %37, %.preheader.preheader ]
  %48 = phi i64 [ %79, %78 ], [ %33, %.preheader.preheader ]
  %49 = phi i64 [ %80, %78 ], [ %32, %.preheader.preheader ]
  %.026 = phi i64 [ %82, %78 ], [ %47, %.preheader.preheader ]
  %.01425 = phi i64 [ %87, %78 ], [ %42, %.preheader.preheader ]
  %.01524 = phi i64 [ %81, %78 ], [ %34, %.preheader.preheader ]
  %50 = icmp sle i64 %49, %.01425
  %51 = icmp sle i64 %49, %48
  %52 = and i1 %50, %51
  br i1 %52, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %53 = phi i64 [ %60, %.lr.ph ], [ %49, %.preheader ]
  %.121 = phi i64 [ %.2, %.lr.ph ], [ %.026, %.preheader ]
  %54 = and i64 %53, -9223372036854775807
  %55 = icmp ne i64 %54, 1
  %.01524.sink = select i1 %55, i64 %.121, i64 %.01524
  %56 = zext i1 %55 to i64
  %.2 = add nsw i64 %.121, %56
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.01524.sink)
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef nonnull @.str)
  %59 = load i64, ptr %3, align 8, !tbaa !11
  %60 = add nsw i64 %59, 1
  store i64 %60, ptr %3, align 8, !tbaa !11
  %61 = icmp slt i64 %59, %.01425
  %62 = load i64, ptr %4, align 8
  %63 = icmp slt i64 %59, %62
  %64 = select i1 %61, i1 %63, i1 false
  br i1 %64, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !13

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre34.pre = load i64, ptr %2, align 8, !tbaa !11
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %.pre34 = phi i64 [ %.pre3436, %.preheader ], [ %.pre34.pre, %._crit_edge.loopexit ]
  %65 = phi i64 [ %48, %.preheader ], [ %62, %._crit_edge.loopexit ]
  %66 = phi i64 [ %49, %.preheader ], [ %60, %._crit_edge.loopexit ]
  %67 = icmp eq i64 %66, %65
  br i1 %67, label %68, label %78

68:                                               ; preds = %._crit_edge
  %69 = add nsw i64 %.pre34, -1
  %70 = mul nsw i64 %69, %.pre34
  %71 = add nsw i64 %70, 1
  %72 = icmp eq i64 %65, %71
  br i1 %72, label %73, label %78

73:                                               ; preds = %68
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %74, ptr noundef nonnull @.str)
  %76 = load i64, ptr %3, align 8, !tbaa !11
  %77 = add nsw i64 %76, 1
  store i64 %77, ptr %3, align 8, !tbaa !11
  %.pre = load i64, ptr %2, align 8, !tbaa !11
  %.pre35 = load i64, ptr %4, align 8
  br label %78

78:                                               ; preds = %73, %68, %._crit_edge
  %.pre3437 = phi i64 [ %.pre, %73 ], [ %.pre34, %68 ], [ %.pre34, %._crit_edge ]
  %79 = phi i64 [ %.pre35, %73 ], [ %65, %68 ], [ %65, %._crit_edge ]
  %80 = phi i64 [ %77, %73 ], [ %65, %68 ], [ %66, %._crit_edge ]
  %81 = add nsw i64 %.01524, 1
  %82 = add nsw i64 %.01524, 2
  %83 = shl nsw i64 %81, 1
  %84 = add nsw i64 %.pre3437, -1
  %85 = mul nsw i64 %83, %84
  %86 = mul nsw i64 %81, %.01524
  %87 = sub nsw i64 %85, %86
  %.not19 = icmp sgt i64 %80, %79
  br i1 %.not19, label %._crit_edge27, label %.preheader, !llvm.loop !15

._crit_edge27:                                    ; preds = %78, %.lr.ph30
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  %89 = load i32, ptr %1, align 4, !tbaa !8
  %90 = add nsw i32 %89, -1
  store i32 %90, ptr %1, align 4, !tbaa !8
  %.not = icmp eq i32 %89, 0
  br i1 %.not, label %._crit_edge31, label %.lr.ph30, !llvm.loop !16

._crit_edge31:                                    ; preds = %._crit_edge27, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0
}

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef x86_fp80 @_ZSt4ceile(x86_fp80 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare x86_fp80 @sqrtl(x86_fp80 noundef) local_unnamed_addr #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 @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #4 align 2

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

; 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)) #7

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

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 = { 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 #6 = { mustprogress nofree nounwind willreturn memory(write) "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 #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 = !{!"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}


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