; LLVM IR from eyangch/competitive-programming :: Codeforces/1547 (e)

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

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@a = external dso_local global [300000 x i64], align 16
@t = external dso_local global [300000 x i64], align 16
@ac = external dso_local global [300000 x i64], align 16
@ans = external dso_local global [300000 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 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 double, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %11 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %12 = getelementptr i8, ptr %11, i64 -24
  %13 = load i64, ptr %12, align 8
  %14 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %13
  %15 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %14, ptr noundef null)
  %16 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  br label %18

18:                                               ; preds = %147, %0
  %19 = load i64, ptr @T, align 8, !tbaa !8
  %20 = add nsw i64 %19, -1
  store i64 %20, ptr @T, align 8, !tbaa !8
  %21 = icmp ne i64 %19, 0
  br i1 %21, label %22, label %149

22:                                               ; preds = %18
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %25 = load i64, ptr @N, align 8, !tbaa !8
  %26 = getelementptr inbounds i64, ptr @ac, i64 %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !11
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @ac, ptr noundef %26, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  store i64 0, ptr %3, align 8, !tbaa !8
  br label %27

27:                                               ; preds = %40, %22
  %28 = load i64, ptr %3, align 8, !tbaa !8
  %29 = load i64, ptr @K, align 8, !tbaa !8
  %30 = icmp slt i64 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %43

32:                                               ; preds = %27
  %33 = load i64, ptr %3, align 8, !tbaa !8
  %34 = getelementptr inbounds [300000 x i64], ptr @a, i64 0, i64 %33
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %34)
  %36 = load i64, ptr %3, align 8, !tbaa !8
  %37 = getelementptr inbounds [300000 x i64], ptr @a, i64 0, i64 %36
  %38 = load i64, ptr %37, align 8, !tbaa !8
  %39 = add nsw i64 %38, -1
  store i64 %39, ptr %37, align 8, !tbaa !8
  br label %40

40:                                               ; preds = %32
  %41 = load i64, ptr %3, align 8, !tbaa !8
  %42 = add nsw i64 %41, 1
  store i64 %42, ptr %3, align 8, !tbaa !8
  br label %27, !llvm.loop !13

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

44:                                               ; preds = %53, %43
  %45 = load i64, ptr %4, align 8, !tbaa !8
  %46 = load i64, ptr @K, align 8, !tbaa !8
  %47 = icmp slt i64 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %56

49:                                               ; preds = %44
  %50 = load i64, ptr %4, align 8, !tbaa !8
  %51 = getelementptr inbounds [300000 x i64], ptr @t, i64 0, i64 %50
  %52 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %51)
  br label %53

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

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

57:                                               ; preds = %70, %56
  %58 = load i64, ptr %5, align 8, !tbaa !8
  %59 = load i64, ptr @K, align 8, !tbaa !8
  %60 = icmp slt i64 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %73

62:                                               ; preds = %57
  %63 = load i64, ptr %5, align 8, !tbaa !8
  %64 = getelementptr inbounds [300000 x i64], ptr @t, i64 0, i64 %63
  %65 = load i64, ptr %64, align 8, !tbaa !8
  %66 = load i64, ptr %5, align 8, !tbaa !8
  %67 = getelementptr inbounds [300000 x i64], ptr @a, i64 0, i64 %66
  %68 = load i64, ptr %67, align 8, !tbaa !8
  %69 = getelementptr inbounds [300000 x i64], ptr @ac, i64 0, i64 %68
  store i64 %65, ptr %69, align 8, !tbaa !8
  br label %70

70:                                               ; preds = %62
  %71 = load i64, ptr %5, align 8, !tbaa !8
  %72 = add nsw i64 %71, 1
  store i64 %72, ptr %5, align 8, !tbaa !8
  br label %57, !llvm.loop !16

73:                                               ; preds = %61
  %74 = load i64, ptr @N, align 8, !tbaa !8
  %75 = getelementptr inbounds i64, ptr @ans, i64 %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store double 1.000000e+17, ptr %6, align 8, !tbaa !17
  call void @_ZSt4fillIPxdEvT_S1_RKT0_(ptr noundef @ans, ptr noundef %75, ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 100000000000000000, ptr %7, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !8
  br label %76

76:                                               ; preds = %100, %73
  %77 = load i64, ptr %8, align 8, !tbaa !8
  %78 = load i64, ptr @N, align 8, !tbaa !8
  %79 = icmp slt i64 %77, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %103

81:                                               ; preds = %76
  %82 = load i64, ptr %8, align 8, !tbaa !8
  %83 = getelementptr inbounds [300000 x i64], ptr @ac, i64 0, i64 %82
  %84 = load i64, ptr %83, align 8, !tbaa !8
  %85 = icmp sgt i64 %84, 0
  br i1 %85, label %86, label %91

86:                                               ; preds = %81
  %87 = load i64, ptr %8, align 8, !tbaa !8
  %88 = getelementptr inbounds [300000 x i64], ptr @ac, i64 0, i64 %87
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %88)
  %90 = load i64, ptr %89, align 8, !tbaa !8
  store i64 %90, ptr %7, align 8, !tbaa !8
  br label %91

91:                                               ; preds = %86, %81
  %92 = load i64, ptr %8, align 8, !tbaa !8
  %93 = getelementptr inbounds [300000 x i64], ptr @ans, i64 0, i64 %92
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %93, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %95 = load i64, ptr %94, align 8, !tbaa !8
  %96 = load i64, ptr %8, align 8, !tbaa !8
  %97 = getelementptr inbounds [300000 x i64], ptr @ans, i64 0, i64 %96
  store i64 %95, ptr %97, align 8, !tbaa !8
  %98 = load i64, ptr %7, align 8, !tbaa !8
  %99 = add nsw i64 %98, 1
  store i64 %99, ptr %7, align 8, !tbaa !8
  br label %100

100:                                              ; preds = %91
  %101 = load i64, ptr %8, align 8, !tbaa !8
  %102 = add nsw i64 %101, 1
  store i64 %102, ptr %8, align 8, !tbaa !8
  br label %76, !llvm.loop !19

103:                                              ; preds = %80
  store i64 100000000000000000, ptr %7, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %104 = load i64, ptr @N, align 8, !tbaa !8
  %105 = sub nsw i64 %104, 1
  store i64 %105, ptr %9, align 8, !tbaa !8
  br label %106

106:                                              ; preds = %129, %103
  %107 = load i64, ptr %9, align 8, !tbaa !8
  %108 = icmp sge i64 %107, 0
  br i1 %108, label %110, label %109

109:                                              ; preds = %106
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %132

110:                                              ; preds = %106
  %111 = load i64, ptr %9, align 8, !tbaa !8
  %112 = getelementptr inbounds [300000 x i64], ptr @ac, i64 0, i64 %111
  %113 = load i64, ptr %112, align 8, !tbaa !8
  %114 = icmp sgt i64 %113, 0
  br i1 %114, label %115, label %120

115:                                              ; preds = %110
  %116 = load i64, ptr %9, align 8, !tbaa !8
  %117 = getelementptr inbounds [300000 x i64], ptr @ac, i64 0, i64 %116
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %117)
  %119 = load i64, ptr %118, align 8, !tbaa !8
  store i64 %119, ptr %7, align 8, !tbaa !8
  br label %120

120:                                              ; preds = %115, %110
  %121 = load i64, ptr %9, align 8, !tbaa !8
  %122 = getelementptr inbounds [300000 x i64], ptr @ans, i64 0, i64 %121
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %122, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %124 = load i64, ptr %123, align 8, !tbaa !8
  %125 = load i64, ptr %9, align 8, !tbaa !8
  %126 = getelementptr inbounds [300000 x i64], ptr @ans, i64 0, i64 %125
  store i64 %124, ptr %126, align 8, !tbaa !8
  %127 = load i64, ptr %7, align 8, !tbaa !8
  %128 = add nsw i64 %127, 1
  store i64 %128, ptr %7, align 8, !tbaa !8
  br label %129

129:                                              ; preds = %120
  %130 = load i64, ptr %9, align 8, !tbaa !8
  %131 = add nsw i64 %130, -1
  store i64 %131, ptr %9, align 8, !tbaa !8
  br label %106, !llvm.loop !20

132:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 0, ptr %10, align 8, !tbaa !8
  br label %133

133:                                              ; preds = %144, %132
  %134 = load i64, ptr %10, align 8, !tbaa !8
  %135 = load i64, ptr @N, align 8, !tbaa !8
  %136 = icmp slt i64 %134, %135
  br i1 %136, label %138, label %137

137:                                              ; preds = %133
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %147

138:                                              ; preds = %133
  %139 = load i64, ptr %10, align 8, !tbaa !8
  %140 = getelementptr inbounds [300000 x i64], ptr @ans, i64 0, i64 %139
  %141 = load i64, ptr %140, align 8, !tbaa !8
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %141)
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %142, i8 noundef signext 32)
  br label %144

144:                                              ; preds = %138
  %145 = load i64, ptr %10, align 8, !tbaa !8
  %146 = add nsw i64 %145, 1
  store i64 %146, ptr %10, align 8, !tbaa !8
  br label %133, !llvm.loop !21

147:                                              ; preds = %137
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %18, !llvm.loop !22

149:                                              ; preds = %18
  %150 = load i32, ptr %1, align 4
  ret i32 %150
}

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

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

; 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)) #3 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxdEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #6

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #4

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

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 = { 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 #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 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 = { 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 #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #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 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = !{!18, !18, i64 0}
!18 = !{!"double", !10, i64 0}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !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" }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@a = external dso_local global [300000 x i64], align 16
@t = external dso_local global [300000 x i64], align 16
@ac = external dso_local global [300000 x i64], align 16
@ans = external dso_local global [300000 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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca double, align 8
  %3 = alloca i64, align 8
  %4 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %5 = getelementptr i8, ptr %4, i64 -24
  %6 = load i64, ptr %5, align 8
  %7 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %6
  %8 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %7, ptr noundef null)
  %9 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  %11 = load i64, ptr @T, align 8, !tbaa !8
  %12 = add nsw i64 %11, -1
  store i64 %12, ptr @T, align 8, !tbaa !8
  %.not51 = icmp eq i64 %11, 0
  br i1 %.not51, label %._crit_edge54, label %.lr.ph53

.lr.ph53:                                         ; preds = %0, %._crit_edge50
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %15 = load i64, ptr @N, align 8, !tbaa !8
  %16 = getelementptr inbounds i64, ptr @ac, i64 %15
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !11
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @ac, ptr noundef nonnull %16, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %17 = load i64, ptr @K, align 8, !tbaa !8
  %18 = icmp sgt i64 %17, 0
  br i1 %18, label %.lr.ph, label %._crit_edge

.preheader34:                                     ; preds = %.lr.ph
  %19 = icmp sgt i64 %25, 0
  br i1 %19, label %.lr.ph38, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph53, %.lr.ph
  %.03136 = phi i64 [ %24, %.lr.ph ], [ 0, %.lr.ph53 ]
  %20 = getelementptr inbounds [300000 x i64], ptr @a, i64 0, i64 %.03136
  %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) %20)
  %22 = load i64, ptr %20, align 8, !tbaa !8
  %23 = add nsw i64 %22, -1
  store i64 %23, ptr %20, align 8, !tbaa !8
  %24 = add nuw nsw i64 %.03136, 1
  %25 = load i64, ptr @K, align 8, !tbaa !8
  %26 = icmp slt i64 %24, %25
  br i1 %26, label %.lr.ph, label %.preheader34, !llvm.loop !13

.preheader33:                                     ; preds = %.lr.ph38
  %27 = icmp sgt i64 %32, 0
  br i1 %27, label %.lr.ph40.preheader, label %._crit_edge

.lr.ph40.preheader:                               ; preds = %.preheader33
  %xtraiter = and i64 %32, 3
  %28 = icmp ult i64 %32, 4
  br i1 %28, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph40.preheader.new

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

.lr.ph38:                                         ; preds = %.preheader34, %.lr.ph38
  %.03037 = phi i64 [ %31, %.lr.ph38 ], [ 0, %.preheader34 ]
  %29 = getelementptr inbounds [300000 x i64], ptr @t, i64 0, i64 %.03037
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %29)
  %31 = add nuw nsw i64 %.03037, 1
  %32 = load i64, ptr @K, align 8, !tbaa !8
  %33 = icmp slt i64 %31, %32
  br i1 %33, label %.lr.ph38, label %.preheader33, !llvm.loop !15

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

.lr.ph40.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph40.epil
  %.02939.epil = phi i64 [ %39, %.lr.ph40.epil ], [ %.02939.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph40.epil ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %34 = getelementptr inbounds [300000 x i64], ptr @t, i64 0, i64 %.02939.epil
  %35 = load i64, ptr %34, align 8, !tbaa !8
  %36 = getelementptr inbounds [300000 x i64], ptr @a, i64 0, i64 %.02939.epil
  %37 = load i64, ptr %36, align 8, !tbaa !8
  %38 = getelementptr inbounds [300000 x i64], ptr @ac, i64 0, i64 %37
  store i64 %35, ptr %38, align 8, !tbaa !8
  %39 = add nuw nsw i64 %.02939.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.lr.ph40.epil, !llvm.loop !16

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph40.epil, %.lr.ph53, %.preheader34, %.preheader33
  %40 = load i64, ptr @N, align 8, !tbaa !8
  %41 = getelementptr inbounds i64, ptr @ans, i64 %40
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  store double 1.000000e+17, ptr %2, align 8, !tbaa !18
  call void @_ZSt4fillIPxdEvT_S1_RKT0_(ptr noundef nonnull @ans, ptr noundef nonnull %41, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  store i64 100000000000000000, ptr %3, align 8, !tbaa !8
  %42 = load i64, ptr @N, align 8, !tbaa !8
  %43 = icmp sgt i64 %42, 0
  br i1 %43, label %.lr.ph43, label %._crit_edge50

.lr.ph40:                                         ; preds = %.lr.ph40, %.lr.ph40.preheader.new
  %.02939 = phi i64 [ 0, %.lr.ph40.preheader.new ], [ %67, %.lr.ph40 ]
  %niter = phi i64 [ 0, %.lr.ph40.preheader.new ], [ %niter.next.3, %.lr.ph40 ]
  %44 = getelementptr inbounds [300000 x i64], ptr @t, i64 0, i64 %.02939
  %45 = load i64, ptr %44, align 16, !tbaa !8
  %46 = getelementptr inbounds [300000 x i64], ptr @a, i64 0, i64 %.02939
  %47 = load i64, ptr %46, align 16, !tbaa !8
  %48 = getelementptr inbounds [300000 x i64], ptr @ac, i64 0, i64 %47
  store i64 %45, ptr %48, align 8, !tbaa !8
  %49 = or disjoint i64 %.02939, 1
  %50 = getelementptr inbounds [300000 x i64], ptr @t, i64 0, i64 %49
  %51 = load i64, ptr %50, align 8, !tbaa !8
  %52 = getelementptr inbounds [300000 x i64], ptr @a, i64 0, i64 %49
  %53 = load i64, ptr %52, align 8, !tbaa !8
  %54 = getelementptr inbounds [300000 x i64], ptr @ac, i64 0, i64 %53
  store i64 %51, ptr %54, align 8, !tbaa !8
  %55 = or disjoint i64 %.02939, 2
  %56 = getelementptr inbounds [300000 x i64], ptr @t, i64 0, i64 %55
  %57 = load i64, ptr %56, align 16, !tbaa !8
  %58 = getelementptr inbounds [300000 x i64], ptr @a, i64 0, i64 %55
  %59 = load i64, ptr %58, align 16, !tbaa !8
  %60 = getelementptr inbounds [300000 x i64], ptr @ac, i64 0, i64 %59
  store i64 %57, ptr %60, align 8, !tbaa !8
  %61 = or disjoint i64 %.02939, 3
  %62 = getelementptr inbounds [300000 x i64], ptr @t, i64 0, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !8
  %64 = getelementptr inbounds [300000 x i64], ptr @a, i64 0, i64 %61
  %65 = load i64, ptr %64, align 8, !tbaa !8
  %66 = getelementptr inbounds [300000 x i64], ptr @ac, i64 0, i64 %65
  store i64 %63, ptr %66, align 8, !tbaa !8
  %67 = add nuw nsw i64 %.02939, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph40, !llvm.loop !20

.preheader32:                                     ; preds = %75
  store i64 100000000000000000, ptr %3, align 8, !tbaa !8
  %68 = icmp sgt i64 %82, 0
  br i1 %68, label %.lr.ph47, label %._crit_edge50

.lr.ph43:                                         ; preds = %._crit_edge, %75
  %.02841 = phi i64 [ %81, %75 ], [ 0, %._crit_edge ]
  %69 = getelementptr inbounds [300000 x i64], ptr @ac, i64 0, i64 %.02841
  %70 = load i64, ptr %69, align 8, !tbaa !8
  %71 = icmp sgt i64 %70, 0
  br i1 %71, label %72, label %75

72:                                               ; preds = %.lr.ph43
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %69)
  %74 = load i64, ptr %73, align 8, !tbaa !8
  store i64 %74, ptr %3, align 8, !tbaa !8
  br label %75

75:                                               ; preds = %72, %.lr.ph43
  %76 = getelementptr inbounds [300000 x i64], ptr @ans, i64 0, i64 %.02841
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %78 = load i64, ptr %77, align 8, !tbaa !8
  store i64 %78, ptr %76, align 8, !tbaa !8
  %79 = load i64, ptr %3, align 8, !tbaa !8
  %80 = add nsw i64 %79, 1
  store i64 %80, ptr %3, align 8, !tbaa !8
  %81 = add nuw nsw i64 %.02841, 1
  %82 = load i64, ptr @N, align 8, !tbaa !8
  %83 = icmp slt i64 %81, %82
  br i1 %83, label %.lr.ph43, label %.preheader32, !llvm.loop !21

.preheader:                                       ; preds = %91
  %.pre = load i64, ptr @N, align 8, !tbaa !8
  %84 = icmp sgt i64 %.pre, 0
  br i1 %84, label %.lr.ph49, label %._crit_edge50

.lr.ph47:                                         ; preds = %.preheader32, %91
  %.02746.in = phi i64 [ %.02746, %91 ], [ %82, %.preheader32 ]
  %.02746 = add nsw i64 %.02746.in, -1
  %85 = getelementptr inbounds [300000 x i64], ptr @ac, i64 0, i64 %.02746
  %86 = load i64, ptr %85, align 8, !tbaa !8
  %87 = icmp sgt i64 %86, 0
  br i1 %87, label %88, label %91

88:                                               ; preds = %.lr.ph47
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %85)
  %90 = load i64, ptr %89, align 8, !tbaa !8
  store i64 %90, ptr %3, align 8, !tbaa !8
  br label %91

91:                                               ; preds = %88, %.lr.ph47
  %92 = getelementptr inbounds [300000 x i64], ptr @ans, i64 0, i64 %.02746
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %92, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %94 = load i64, ptr %93, align 8, !tbaa !8
  store i64 %94, ptr %92, align 8, !tbaa !8
  %95 = load i64, ptr %3, align 8, !tbaa !8
  %96 = add nsw i64 %95, 1
  store i64 %96, ptr %3, align 8, !tbaa !8
  %97 = icmp ugt i64 %.02746.in, 1
  br i1 %97, label %.lr.ph47, label %.preheader, !llvm.loop !22

._crit_edge50:                                    ; preds = %.lr.ph49, %._crit_edge, %.preheader32, %.preheader
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %99 = load i64, ptr @T, align 8, !tbaa !8
  %100 = add nsw i64 %99, -1
  store i64 %100, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %99, 0
  br i1 %.not, label %._crit_edge54, label %.lr.ph53, !llvm.loop !23

.lr.ph49:                                         ; preds = %.preheader, %.lr.ph49
  %.048 = phi i64 [ %105, %.lr.ph49 ], [ 0, %.preheader ]
  %101 = getelementptr inbounds [300000 x i64], ptr @ans, i64 0, i64 %.048
  %102 = load i64, ptr %101, align 8, !tbaa !8
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %102)
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %103, i8 noundef signext 32)
  %105 = add nuw nsw i64 %.048, 1
  %106 = load i64, ptr @N, align 8, !tbaa !8
  %107 = icmp slt i64 %105, %106
  br i1 %107, label %.lr.ph49, label %._crit_edge50, !llvm.loop !24

._crit_edge54:                                    ; preds = %._crit_edge50, %0
  ret i32 0
}

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

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

; 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 #3 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxdEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #4

; 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 #3 align 2

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 = { 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 #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 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 = { 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 #5 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #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 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = !{!19, !19, i64 0}
!19 = !{!"double", !10, i64 0}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !14}


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