; LLVM IR from eyangch/competitive-programming :: USACOcontests/bronze/2022.12 (feeding_the_cows)

; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"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
@ans = external dso_local global [100000 x i64], align 16
@_Z1SB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_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 i64, 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 = %157, %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 %159

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 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11)
  %26 = load i64, ptr @N, align 8, !tbaa !8
  %27 = getelementptr inbounds i64, ptr @ans, i64 %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !11
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @ans, ptr noundef %27, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  store i64 -1000000000000000, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 -1000000000000000, ptr %4, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i64 0, ptr %5, align 8, !tbaa !8
  br label %28

28:                                               ; preds = %102, %22
  %29 = load i64, ptr %5, align 8, !tbaa !8
  %30 = load i64, ptr @N, align 8, !tbaa !8
  %31 = icmp slt i64 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %105

33:                                               ; preds = %28
  %34 = load i64, ptr %5, align 8, !tbaa !8
  %35 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11, i64 noundef %34)
  %36 = load i8, ptr %35, align 1, !tbaa !13
  %37 = sext i8 %36 to i32
  %38 = icmp eq i32 %37, 71
  br i1 %38, label %39, label %70

39:                                               ; preds = %33
  %40 = load i64, ptr %5, align 8, !tbaa !8
  %41 = load i64, ptr %3, align 8, !tbaa !8
  %42 = sub nsw i64 %40, %41
  %43 = load i64, ptr @K, align 8, !tbaa !8
  %44 = icmp sgt i64 %42, %43
  br i1 %44, label %45, label %69

45:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %46 = load i64, ptr %5, align 8, !tbaa !8
  %47 = load i64, ptr @K, align 8, !tbaa !8
  %48 = add nsw i64 %46, %47
  store i64 %48, ptr %6, align 8, !tbaa !8
  %49 = load i64, ptr %6, align 8, !tbaa !8
  %50 = load i64, ptr @N, align 8, !tbaa !8
  %51 = sub nsw i64 %50, 1
  %52 = icmp sge i64 %49, %51
  br i1 %52, label %53, label %65

53:                                               ; preds = %45
  %54 = load i64, ptr @N, align 8, !tbaa !8
  %55 = sub nsw i64 %54, 1
  store i64 %55, ptr %6, align 8, !tbaa !8
  %56 = load i64, ptr @N, align 8, !tbaa !8
  %57 = sub nsw i64 %56, 1
  %58 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %57
  %59 = load i64, ptr %58, align 8, !tbaa !8
  %60 = icmp ne i64 %59, 0
  br i1 %60, label %61, label %64

61:                                               ; preds = %53
  %62 = load i64, ptr @N, align 8, !tbaa !8
  %63 = sub nsw i64 %62, 2
  store i64 %63, ptr %6, align 8, !tbaa !8
  br label %64

64:                                               ; preds = %61, %53
  br label %65

65:                                               ; preds = %64, %45
  %66 = load i64, ptr %6, align 8, !tbaa !8
  %67 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %66
  store i64 1, ptr %67, align 8, !tbaa !8
  %68 = load i64, ptr %6, align 8, !tbaa !8
  store i64 %68, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %69

69:                                               ; preds = %65, %39
  br label %101

70:                                               ; preds = %33
  %71 = load i64, ptr %5, align 8, !tbaa !8
  %72 = load i64, ptr %4, align 8, !tbaa !8
  %73 = sub nsw i64 %71, %72
  %74 = load i64, ptr @K, align 8, !tbaa !8
  %75 = icmp sgt i64 %73, %74
  br i1 %75, label %76, label %100

76:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %77 = load i64, ptr %5, align 8, !tbaa !8
  %78 = load i64, ptr @K, align 8, !tbaa !8
  %79 = add nsw i64 %77, %78
  store i64 %79, ptr %7, align 8, !tbaa !8
  %80 = load i64, ptr %7, align 8, !tbaa !8
  %81 = load i64, ptr @N, align 8, !tbaa !8
  %82 = sub nsw i64 %81, 1
  %83 = icmp sge i64 %80, %82
  br i1 %83, label %84, label %96

84:                                               ; preds = %76
  %85 = load i64, ptr @N, align 8, !tbaa !8
  %86 = sub nsw i64 %85, 1
  store i64 %86, ptr %7, align 8, !tbaa !8
  %87 = load i64, ptr @N, align 8, !tbaa !8
  %88 = sub nsw i64 %87, 1
  %89 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %88
  %90 = load i64, ptr %89, align 8, !tbaa !8
  %91 = icmp ne i64 %90, 0
  br i1 %91, label %92, label %95

92:                                               ; preds = %84
  %93 = load i64, ptr @N, align 8, !tbaa !8
  %94 = sub nsw i64 %93, 2
  store i64 %94, ptr %7, align 8, !tbaa !8
  br label %95

95:                                               ; preds = %92, %84
  br label %96

96:                                               ; preds = %95, %76
  %97 = load i64, ptr %7, align 8, !tbaa !8
  %98 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %97
  store i64 2, ptr %98, align 8, !tbaa !8
  %99 = load i64, ptr %7, align 8, !tbaa !8
  store i64 %99, ptr %4, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %100

100:                                              ; preds = %96, %70
  br label %101

101:                                              ; preds = %100, %69
  br label %102

102:                                              ; preds = %101
  %103 = load i64, ptr %5, align 8, !tbaa !8
  %104 = add nsw i64 %103, 1
  store i64 %104, ptr %5, align 8, !tbaa !8
  br label %28, !llvm.loop !14

105:                                              ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !8
  br label %106

106:                                              ; preds = %120, %105
  %107 = load i64, ptr %9, align 8, !tbaa !8
  %108 = load i64, ptr @N, align 8, !tbaa !8
  %109 = icmp slt i64 %107, %108
  br i1 %109, label %111, label %110

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

111:                                              ; preds = %106
  %112 = load i64, ptr %9, align 8, !tbaa !8
  %113 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %112
  %114 = load i64, ptr %113, align 8, !tbaa !8
  %115 = icmp ne i64 %114, 0
  br i1 %115, label %116, label %119

116:                                              ; preds = %111
  %117 = load i64, ptr %8, align 8, !tbaa !8
  %118 = add nsw i64 %117, 1
  store i64 %118, ptr %8, align 8, !tbaa !8
  br label %119

119:                                              ; preds = %116, %111
  br label %120

120:                                              ; preds = %119
  %121 = load i64, ptr %9, align 8, !tbaa !8
  %122 = add nsw i64 %121, 1
  store i64 %122, ptr %9, align 8, !tbaa !8
  br label %106, !llvm.loop !16

123:                                              ; preds = %110
  %124 = load i64, ptr %8, align 8, !tbaa !8
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %124)
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %125, i8 noundef signext 10)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 0, ptr %10, align 8, !tbaa !8
  br label %127

127:                                              ; preds = %154, %123
  %128 = load i64, ptr %10, align 8, !tbaa !8
  %129 = load i64, ptr @N, align 8, !tbaa !8
  %130 = icmp slt i64 %128, %129
  br i1 %130, label %132, label %131

131:                                              ; preds = %127
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %157

132:                                              ; preds = %127
  %133 = load i64, ptr %10, align 8, !tbaa !8
  %134 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %133
  %135 = load i64, ptr %134, align 8, !tbaa !8
  %136 = icmp eq i64 %135, 0
  br i1 %136, label %137, label %139

137:                                              ; preds = %132
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 46)
  br label %139

139:                                              ; preds = %137, %132
  %140 = load i64, ptr %10, align 8, !tbaa !8
  %141 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %140
  %142 = load i64, ptr %141, align 8, !tbaa !8
  %143 = icmp eq i64 %142, 1
  br i1 %143, label %144, label %146

144:                                              ; preds = %139
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 71)
  br label %146

146:                                              ; preds = %144, %139
  %147 = load i64, ptr %10, align 8, !tbaa !8
  %148 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %147
  %149 = load i64, ptr %148, align 8, !tbaa !8
  %150 = icmp eq i64 %149, 2
  br i1 %150, label %151, label %153

151:                                              ; preds = %146
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 72)
  br label %153

153:                                              ; preds = %151, %146
  br label %154

154:                                              ; preds = %153
  %155 = load i64, ptr %10, align 8, !tbaa !8
  %156 = add nsw i64 %155, 1
  store i64 %156, ptr %10, align 8, !tbaa !8
  br label %127, !llvm.loop !17

157:                                              ; preds = %131
  %158 = 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 %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %18, !llvm.loop !18

159:                                              ; preds = %18
  %160 = load i32, ptr %1, align 4
  ret i32 %160
}

; 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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #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: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #1 align 2

; 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 = { 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 = !{!10, !10, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}


; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"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
@ans = external dso_local global [100000 x i64], align 16
@_Z1SB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_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 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %3 = getelementptr i8, ptr %2, i64 -24
  %4 = load i64, ptr %3, align 8
  %5 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %4
  %6 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %5, ptr noundef null)
  %7 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %8 = 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)
  %9 = load i64, ptr @T, align 8, !tbaa !8
  %10 = add nsw i64 %9, -1
  store i64 %10, ptr @T, align 8, !tbaa !8
  %.not59 = icmp eq i64 %9, 0
  br i1 %.not59, label %._crit_edge62, label %.lr.ph61

.lr.ph61:                                         ; preds = %0, %._crit_edge58
  %11 = 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)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11)
  %14 = load i64, ptr @N, align 8, !tbaa !8
  %15 = getelementptr inbounds i64, ptr @ans, i64 %14
  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 @ans, ptr noundef nonnull %15, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %16 = load i64, ptr @N, align 8, !tbaa !8
  %17 = icmp sgt i64 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

.preheader:                                       ; preds = %54
  %18 = icmp sgt i64 %.pre, 0
  br i1 %18, label %.lr.ph53.preheader, label %._crit_edge

.lr.ph53.preheader:                               ; preds = %.preheader
  %min.iters.check = icmp ult i64 %.pre, 4
  br i1 %min.iters.check, label %.lr.ph53.preheader71, label %vector.ph

.lr.ph53.preheader71:                             ; preds = %middle.block, %.lr.ph53.preheader
  %.02652.ph = phi i64 [ 0, %.lr.ph53.preheader ], [ %n.vec, %middle.block ]
  %.02751.ph = phi i64 [ 0, %.lr.ph53.preheader ], [ %28, %middle.block ]
  br label %.lr.ph53

vector.ph:                                        ; preds = %.lr.ph53.preheader
  %n.vec = and i64 %.pre, 9223372036854775804
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %25, %vector.body ]
  %vec.phi68 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %26, %vector.body ]
  %19 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %index
  %20 = getelementptr inbounds i8, ptr %19, i64 16
  %wide.load = load <2 x i64>, ptr %19, align 16, !tbaa !8
  %wide.load69 = load <2 x i64>, ptr %20, align 16, !tbaa !8
  %21 = icmp ne <2 x i64> %wide.load, zeroinitializer
  %22 = icmp ne <2 x i64> %wide.load69, zeroinitializer
  %23 = zext <2 x i1> %21 to <2 x i64>
  %24 = zext <2 x i1> %22 to <2 x i64>
  %25 = add <2 x i64> %vec.phi, %23
  %26 = add <2 x i64> %vec.phi68, %24
  %index.next = add nuw i64 %index, 4
  %27 = icmp eq i64 %index.next, %n.vec
  br i1 %27, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %26, %25
  %28 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %.pre, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph53.preheader71

.lr.ph:                                           ; preds = %.lr.ph61, %54
  %.03050 = phi i64 [ %55, %54 ], [ 0, %.lr.ph61 ]
  %.03149 = phi i64 [ %.132, %54 ], [ -1000000000000000, %.lr.ph61 ]
  %.03348 = phi i64 [ %.134, %54 ], [ -1000000000000000, %.lr.ph61 ]
  %29 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11, i64 noundef %.03050)
  %30 = load i8, ptr %29, align 1, !tbaa !17
  %31 = icmp eq i8 %30, 71
  %32 = load i64, ptr @K, align 8, !tbaa !8
  %.pre = load i64, ptr @N, align 8, !tbaa !8
  br i1 %31, label %33, label %43

33:                                               ; preds = %.lr.ph
  %34 = sub nsw i64 %.03050, %.03348
  %35 = icmp sgt i64 %34, %32
  br i1 %35, label %36, label %54

36:                                               ; preds = %33
  %37 = add nsw i64 %32, %.03050
  %38 = add nsw i64 %.pre, -1
  %.not44 = icmp slt i64 %37, %38
  br i1 %.not44, label %.sink.split, label %39

39:                                               ; preds = %36
  %40 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %38
  %41 = load i64, ptr %40, align 8, !tbaa !8
  %.not45 = icmp eq i64 %41, 0
  %42 = add nsw i64 %.pre, -2
  %spec.select = select i1 %.not45, i64 %38, i64 %42
  br label %.sink.split

43:                                               ; preds = %.lr.ph
  %44 = sub nsw i64 %.03050, %.03149
  %45 = icmp sgt i64 %44, %32
  br i1 %45, label %46, label %54

46:                                               ; preds = %43
  %47 = add nsw i64 %32, %.03050
  %48 = add nsw i64 %.pre, -1
  %.not42 = icmp slt i64 %47, %48
  br i1 %.not42, label %.sink.split, label %49

49:                                               ; preds = %46
  %50 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %48
  %51 = load i64, ptr %50, align 8, !tbaa !8
  %.not43 = icmp eq i64 %51, 0
  %52 = add nsw i64 %.pre, -2
  %spec.select46 = select i1 %.not43, i64 %48, i64 %52
  br label %.sink.split

.sink.split:                                      ; preds = %46, %49, %36, %39
  %.029.sink = phi i64 [ %37, %36 ], [ %spec.select, %39 ], [ %47, %46 ], [ %spec.select46, %49 ]
  %.sink = phi i64 [ 1, %36 ], [ 1, %39 ], [ 2, %46 ], [ 2, %49 ]
  %.134.ph = phi i64 [ %37, %36 ], [ %spec.select, %39 ], [ %.03348, %46 ], [ %.03348, %49 ]
  %.132.ph = phi i64 [ %.03149, %36 ], [ %.03149, %39 ], [ %47, %46 ], [ %spec.select46, %49 ]
  %53 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %.029.sink
  store i64 %.sink, ptr %53, align 8, !tbaa !8
  br label %54

54:                                               ; preds = %.sink.split, %33, %43
  %.134 = phi i64 [ %.03348, %33 ], [ %.03348, %43 ], [ %.134.ph, %.sink.split ]
  %.132 = phi i64 [ %.03149, %33 ], [ %.03149, %43 ], [ %.132.ph, %.sink.split ]
  %55 = add nuw nsw i64 %.03050, 1
  %56 = icmp slt i64 %55, %.pre
  br i1 %56, label %.lr.ph, label %.preheader, !llvm.loop !18

._crit_edge:                                      ; preds = %.lr.ph53, %middle.block, %.lr.ph61, %.preheader
  %.027.lcssa = phi i64 [ 0, %.preheader ], [ 0, %.lr.ph61 ], [ %28, %middle.block ], [ %spec.select47, %.lr.ph53 ]
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.027.lcssa)
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %57, i8 noundef signext 10)
  %59 = load i64, ptr @N, align 8, !tbaa !8
  %60 = icmp sgt i64 %59, 0
  br i1 %60, label %.lr.ph57, label %._crit_edge58

.lr.ph53:                                         ; preds = %.lr.ph53.preheader71, %.lr.ph53
  %.02652 = phi i64 [ %64, %.lr.ph53 ], [ %.02652.ph, %.lr.ph53.preheader71 ]
  %.02751 = phi i64 [ %spec.select47, %.lr.ph53 ], [ %.02751.ph, %.lr.ph53.preheader71 ]
  %61 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %.02652
  %62 = load i64, ptr %61, align 8, !tbaa !8
  %.not41 = icmp ne i64 %62, 0
  %63 = zext i1 %.not41 to i64
  %spec.select47 = add nuw nsw i64 %.02751, %63
  %64 = add nuw nsw i64 %.02652, 1
  %exitcond.not = icmp eq i64 %64, %.pre
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph53, !llvm.loop !19

._crit_edge58:                                    ; preds = %83, %._crit_edge
  %65 = 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)
  %66 = load i64, ptr @T, align 8, !tbaa !8
  %67 = add nsw i64 %66, -1
  store i64 %67, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %66, 0
  br i1 %.not, label %._crit_edge62, label %.lr.ph61, !llvm.loop !20

.lr.ph57:                                         ; preds = %._crit_edge, %83
  %.055 = phi i64 [ %84, %83 ], [ 0, %._crit_edge ]
  %68 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %.055
  %69 = load i64, ptr %68, align 8, !tbaa !8
  %70 = icmp eq i64 %69, 0
  br i1 %70, label %71, label %73

71:                                               ; preds = %.lr.ph57
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 46)
  %.pr = load i64, ptr %68, align 8, !tbaa !8
  br label %73

73:                                               ; preds = %71, %.lr.ph57
  %74 = phi i64 [ %.pr, %71 ], [ %69, %.lr.ph57 ]
  %75 = icmp eq i64 %74, 1
  br i1 %75, label %76, label %78

76:                                               ; preds = %73
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 71)
  %.pre65 = load i64, ptr %68, align 8, !tbaa !8
  br label %78

78:                                               ; preds = %76, %73
  %79 = phi i64 [ %.pre65, %76 ], [ %74, %73 ]
  %80 = icmp eq i64 %79, 2
  br i1 %80, label %81, label %83

81:                                               ; preds = %78
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 72)
  br label %83

83:                                               ; preds = %78, %81
  %84 = add nuw nsw i64 %.055, 1
  %85 = load i64, ptr @N, align 8, !tbaa !8
  %86 = icmp slt i64 %84, %85
  br i1 %86, label %.lr.ph57, label %._crit_edge58, !llvm.loop !21

._crit_edge62:                                    ; preds = %._crit_edge58, %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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #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: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #1 align 2

; 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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #6

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !15, !16}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = !{!10, !10, i64 0}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14, !16, !15}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}


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