; LLVM IR from eyangch/competitive-programming :: USACOcontests/bronze/2022.02 (sleeping_in_class)

; 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
@a = external dso_local global [100000 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 i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %12 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %13 = getelementptr i8, ptr %12, i64 -24
  %14 = load i64, ptr %13, align 8
  %15 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %14
  %16 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %15, ptr noundef null)
  %17 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %18 = 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 %19

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

23:                                               ; preds = %19
  %24 = 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)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %25

25:                                               ; preds = %34, %23
  %26 = load i64, ptr %2, align 8, !tbaa !8
  %27 = load i64, ptr @N, align 8, !tbaa !8
  %28 = icmp slt i64 %26, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %37

30:                                               ; preds = %25
  %31 = load i64, ptr %2, align 8, !tbaa !8
  %32 = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %31
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %32)
  br label %34

34:                                               ; preds = %30
  %35 = load i64, ptr %2, align 8, !tbaa !8
  %36 = add nsw i64 %35, 1
  store i64 %36, ptr %2, align 8, !tbaa !8
  br label %25, !llvm.loop !11

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

38:                                               ; preds = %49, %37
  %39 = load i64, ptr %4, align 8, !tbaa !8
  %40 = load i64, ptr @N, align 8, !tbaa !8
  %41 = icmp slt i64 %39, %40
  br i1 %41, label %43, label %42

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

43:                                               ; preds = %38
  %44 = load i64, ptr %4, align 8, !tbaa !8
  %45 = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %44
  %46 = load i64, ptr %45, align 8, !tbaa !8
  %47 = load i64, ptr %3, align 8, !tbaa !8
  %48 = add nsw i64 %47, %46
  store i64 %48, ptr %3, align 8, !tbaa !8
  br label %49

49:                                               ; preds = %43
  %50 = load i64, ptr %4, align 8, !tbaa !8
  %51 = add nsw i64 %50, 1
  store i64 %51, ptr %4, align 8, !tbaa !8
  br label %38, !llvm.loop !13

52:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store i64 10000000000000000, ptr %5, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store i64 1, ptr %6, align 8, !tbaa !8
  br label %53

53:                                               ; preds = %102, %52
  %54 = load i64, ptr %6, align 8, !tbaa !8
  %55 = load i64, ptr %3, align 8, !tbaa !8
  %56 = icmp sle i64 %54, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %53
  store i32 10, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %105

58:                                               ; preds = %53
  %59 = load i64, ptr %3, align 8, !tbaa !8
  %60 = load i64, ptr %6, align 8, !tbaa !8
  %61 = srem i64 %59, %60
  %62 = icmp ne i64 %61, 0
  br i1 %62, label %63, label %64

63:                                               ; preds = %58
  br label %102

64:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 0, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 0, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store i64 0, ptr %11, align 8, !tbaa !8
  br label %65

65:                                               ; preds = %91, %64
  %66 = load i64, ptr %11, align 8, !tbaa !8
  %67 = load i64, ptr @N, align 8, !tbaa !8
  %68 = icmp slt i64 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  store i32 13, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %94

70:                                               ; preds = %65
  %71 = load i64, ptr %11, align 8, !tbaa !8
  %72 = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !8
  %74 = load i64, ptr %9, align 8, !tbaa !8
  %75 = add nsw i64 %74, %73
  store i64 %75, ptr %9, align 8, !tbaa !8
  %76 = load i64, ptr %9, align 8, !tbaa !8
  %77 = load i64, ptr %6, align 8, !tbaa !8
  %78 = icmp sgt i64 %76, %77
  br i1 %78, label %79, label %80

79:                                               ; preds = %70
  store i64 10000000000000000, ptr %10, align 8, !tbaa !8
  br label %80

80:                                               ; preds = %79, %70
  %81 = load i64, ptr %9, align 8, !tbaa !8
  %82 = load i64, ptr %6, align 8, !tbaa !8
  %83 = icmp eq i64 %81, %82
  br i1 %83, label %84, label %90

84:                                               ; preds = %80
  %85 = load i64, ptr %9, align 8, !tbaa !8
  %86 = icmp sgt i64 %85, 0
  br i1 %86, label %87, label %90

87:                                               ; preds = %84
  %88 = load i64, ptr %8, align 8, !tbaa !8
  %89 = add nsw i64 %88, 1
  store i64 %89, ptr %8, align 8, !tbaa !8
  store i64 0, ptr %9, align 8, !tbaa !8
  br label %90

90:                                               ; preds = %87, %84, %80
  br label %91

91:                                               ; preds = %90
  %92 = load i64, ptr %11, align 8, !tbaa !8
  %93 = add nsw i64 %92, 1
  store i64 %93, ptr %11, align 8, !tbaa !8
  br label %65, !llvm.loop !14

94:                                               ; preds = %69
  %95 = load i64, ptr @N, align 8, !tbaa !8
  %96 = load i64, ptr %8, align 8, !tbaa !8
  %97 = sub nsw i64 %95, %96
  %98 = load i64, ptr %10, align 8, !tbaa !8
  %99 = add nsw i64 %98, %97
  store i64 %99, ptr %10, align 8, !tbaa !8
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %101 = load i64, ptr %100, align 8, !tbaa !8
  store i64 %101, ptr %5, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %102

102:                                              ; preds = %94, %63
  %103 = load i64, ptr %6, align 8, !tbaa !8
  %104 = add nsw i64 %103, 1
  store i64 %104, ptr %6, align 8, !tbaa !8
  br label %53, !llvm.loop !15

105:                                              ; preds = %57
  %106 = load i64, ptr %5, align 8, !tbaa !8
  %107 = sitofp i64 %106 to double
  %108 = fcmp oeq double %107, 1.000000e+16
  br i1 %108, label %109, label %110

109:                                              ; preds = %105
  br label %112

110:                                              ; preds = %105
  %111 = load i64, ptr %5, align 8, !tbaa !8
  br label %112

112:                                              ; preds = %110, %109
  %113 = phi i64 [ 0, %109 ], [ %111, %110 ]
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %113)
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %114, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %19, !llvm.loop !16

116:                                              ; preds = %19
  %117 = load i32, ptr %1, align 4
  ret i32 %117
}

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

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

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

; 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@a = external dso_local global [100000 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 i64, align 8
  %2 = alloca i64, align 8
  %3 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %4 = getelementptr i8, ptr %3, i64 -24
  %5 = load i64, ptr %4, align 8
  %6 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %5
  %7 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %6, ptr noundef null)
  %8 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %9 = 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)
  %10 = load i64, ptr @T, align 8, !tbaa !8
  %11 = add nsw i64 %10, -1
  store i64 %11, ptr @T, align 8, !tbaa !8
  %.not55 = icmp eq i64 %10, 0
  br i1 %.not55, label %._crit_edge58, label %.lr.ph57

.lr.ph57:                                         ; preds = %0, %._crit_edge54
  %12 = 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)
  %13 = load i64, ptr @N, align 8, !tbaa !8
  %14 = icmp sgt i64 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge.thread

.preheader:                                       ; preds = %.lr.ph
  %15 = icmp sgt i64 %25, 0
  br i1 %15, label %.lr.ph40.preheader, label %._crit_edge.thread

.lr.ph40.preheader:                               ; preds = %.preheader
  %min.iters.check = icmp ult i64 %25, 4
  br i1 %min.iters.check, label %.lr.ph40.preheader75, label %vector.ph

.lr.ph40.preheader75:                             ; preds = %middle.block, %.lr.ph40.preheader
  %.02939.ph = phi i64 [ 0, %.lr.ph40.preheader ], [ %n.vec, %middle.block ]
  %.03038.ph = phi i64 [ 0, %.lr.ph40.preheader ], [ %21, %middle.block ]
  br label %.lr.ph40

vector.ph:                                        ; preds = %.lr.ph40.preheader
  %n.vec = and i64 %25, 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 ], [ %18, %vector.body ]
  %vec.phi72 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ]
  %16 = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %index
  %17 = getelementptr inbounds i8, ptr %16, i64 16
  %wide.load = load <2 x i64>, ptr %16, align 16, !tbaa !8
  %wide.load73 = load <2 x i64>, ptr %17, align 16, !tbaa !8
  %18 = add <2 x i64> %wide.load, %vec.phi
  %19 = add <2 x i64> %wide.load73, %vec.phi72
  %index.next = add nuw i64 %index, 4
  %20 = icmp eq i64 %index.next, %n.vec
  br i1 %20, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %19, %18
  %21 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %25, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph40.preheader75

.lr.ph:                                           ; preds = %.lr.ph57, %.lr.ph
  %.03137 = phi i64 [ %24, %.lr.ph ], [ 0, %.lr.ph57 ]
  %22 = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %.03137
  %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) %22)
  %24 = add nuw nsw i64 %.03137, 1
  %25 = load i64, ptr @N, align 8, !tbaa !8
  %26 = icmp slt i64 %24, %25
  br i1 %26, label %.lr.ph, label %.preheader, !llvm.loop !15

._crit_edge.thread:                               ; preds = %.preheader, %.lr.ph57
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  store i64 10000000000000000, ptr %1, align 8, !tbaa !8
  br label %._crit_edge54

._crit_edge:                                      ; preds = %.lr.ph40, %middle.block
  %.lcssa70 = phi i64 [ %21, %middle.block ], [ %29, %.lr.ph40 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  store i64 10000000000000000, ptr %1, align 8, !tbaa !8
  %.not3350 = icmp slt i64 %.lcssa70, 1
  br i1 %.not3350, label %._crit_edge54, label %.lr.ph53

.lr.ph40:                                         ; preds = %.lr.ph40.preheader75, %.lr.ph40
  %.02939 = phi i64 [ %30, %.lr.ph40 ], [ %.02939.ph, %.lr.ph40.preheader75 ]
  %.03038 = phi i64 [ %29, %.lr.ph40 ], [ %.03038.ph, %.lr.ph40.preheader75 ]
  %27 = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %.02939
  %28 = load i64, ptr %27, align 8, !tbaa !8
  %29 = add nsw i64 %28, %.03038
  %30 = add nuw nsw i64 %.02939, 1
  %exitcond.not = icmp eq i64 %30, %25
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph40, !llvm.loop !16

._crit_edge54:                                    ; preds = %72, %._crit_edge.thread, %._crit_edge
  %31 = phi i64 [ 10000000000000000, %._crit_edge ], [ 10000000000000000, %._crit_edge.thread ], [ %73, %72 ]
  %32 = sitofp i64 %31 to double
  %33 = fcmp oeq double %32, 1.000000e+16
  %34 = select i1 %33, i64 0, i64 %31
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %34)
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %35, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  %37 = load i64, ptr @T, align 8, !tbaa !8
  %38 = add nsw i64 %37, -1
  store i64 %38, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %37, 0
  br i1 %.not, label %._crit_edge58, label %.lr.ph57, !llvm.loop !17

.lr.ph53:                                         ; preds = %._crit_edge, %72
  %39 = phi i64 [ %73, %72 ], [ 10000000000000000, %._crit_edge ]
  %.02851 = phi i64 [ %74, %72 ], [ 1, %._crit_edge ]
  %40 = urem i64 %.lcssa70, %.02851
  %.not34 = icmp eq i64 %40, 0
  br i1 %.not34, label %41, label %72

41:                                               ; preds = %.lr.ph53
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  %42 = load i64, ptr @N, align 8, !tbaa !8
  %43 = icmp sgt i64 %42, 0
  br i1 %43, label %.lr.ph46.preheader, label %._crit_edge47

.lr.ph46.preheader:                               ; preds = %41
  %xtraiter = and i64 %42, 1
  %44 = icmp eq i64 %42, 1
  br i1 %44, label %._crit_edge47.loopexit.unr-lcssa, label %.lr.ph46.preheader.new

.lr.ph46.preheader.new:                           ; preds = %.lr.ph46.preheader
  %unroll_iter = and i64 %42, 9223372036854775806
  br label %.lr.ph46

._crit_edge47.loopexit.unr-lcssa:                 ; preds = %.lr.ph46, %.lr.ph46.preheader
  %spec.select69.lcssa.ph = phi i64 [ poison, %.lr.ph46.preheader ], [ %spec.select69.1, %.lr.ph46 ]
  %spec.select.lcssa.ph = phi i64 [ poison, %.lr.ph46.preheader ], [ %spec.select.1, %.lr.ph46 ]
  %.unr = phi i64 [ 0, %.lr.ph46.preheader ], [ %spec.select69.1, %.lr.ph46 ]
  %.044.unr = phi i64 [ 0, %.lr.ph46.preheader ], [ %71, %.lr.ph46 ]
  %.02543.unr = phi i64 [ 0, %.lr.ph46.preheader ], [ %spec.select35.1, %.lr.ph46 ]
  %.02642.unr = phi i64 [ 0, %.lr.ph46.preheader ], [ %spec.select.1, %.lr.ph46 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge47, label %.lr.ph46.epil

.lr.ph46.epil:                                    ; preds = %._crit_edge47.loopexit.unr-lcssa
  %45 = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %.044.unr
  %46 = load i64, ptr %45, align 8, !tbaa !8
  %47 = add nsw i64 %46, %.02543.unr
  %48 = icmp sgt i64 %47, %.02851
  %spec.select69.epil = select i1 %48, i64 10000000000000000, i64 %.unr
  %49 = icmp eq i64 %47, %.02851
  %50 = zext i1 %49 to i64
  %spec.select.epil = add nuw nsw i64 %.02642.unr, %50
  br label %._crit_edge47

._crit_edge47:                                    ; preds = %.lr.ph46.epil, %._crit_edge47.loopexit.unr-lcssa, %41
  %51 = phi i64 [ 0, %41 ], [ %spec.select69.lcssa.ph, %._crit_edge47.loopexit.unr-lcssa ], [ %spec.select69.epil, %.lr.ph46.epil ]
  %.026.lcssa = phi i64 [ 0, %41 ], [ %spec.select.lcssa.ph, %._crit_edge47.loopexit.unr-lcssa ], [ %spec.select.epil, %.lr.ph46.epil ]
  %52 = sub i64 %42, %.026.lcssa
  %53 = add nsw i64 %52, %51
  store i64 %53, ptr %2, align 8, !tbaa !8
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %55 = load i64, ptr %54, align 8, !tbaa !8
  store i64 %55, ptr %1, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  br label %72

.lr.ph46:                                         ; preds = %.lr.ph46, %.lr.ph46.preheader.new
  %56 = phi i64 [ 0, %.lr.ph46.preheader.new ], [ %spec.select69.1, %.lr.ph46 ]
  %.044 = phi i64 [ 0, %.lr.ph46.preheader.new ], [ %71, %.lr.ph46 ]
  %.02543 = phi i64 [ 0, %.lr.ph46.preheader.new ], [ %spec.select35.1, %.lr.ph46 ]
  %.02642 = phi i64 [ 0, %.lr.ph46.preheader.new ], [ %spec.select.1, %.lr.ph46 ]
  %niter = phi i64 [ 0, %.lr.ph46.preheader.new ], [ %niter.next.1, %.lr.ph46 ]
  %57 = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %.044
  %58 = load i64, ptr %57, align 16, !tbaa !8
  %59 = add nsw i64 %58, %.02543
  %60 = icmp sgt i64 %59, %.02851
  %61 = icmp eq i64 %59, %.02851
  %62 = zext i1 %61 to i64
  %spec.select = add nuw nsw i64 %.02642, %62
  %spec.select35 = select i1 %61, i64 0, i64 %59
  %63 = or disjoint i64 %.044, 1
  %64 = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %63
  %65 = load i64, ptr %64, align 8, !tbaa !8
  %66 = add nsw i64 %65, %spec.select35
  %67 = icmp sgt i64 %66, %.02851
  %68 = select i1 %67, i1 true, i1 %60
  %spec.select69.1 = select i1 %68, i64 10000000000000000, i64 %56
  %69 = icmp eq i64 %66, %.02851
  %70 = zext i1 %69 to i64
  %spec.select.1 = add nuw nsw i64 %spec.select, %70
  %spec.select35.1 = select i1 %69, i64 0, i64 %66
  %71 = add nuw nsw i64 %.044, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge47.loopexit.unr-lcssa, label %.lr.ph46, !llvm.loop !18

72:                                               ; preds = %.lr.ph53, %._crit_edge47
  %73 = phi i64 [ %39, %.lr.ph53 ], [ %55, %._crit_edge47 ]
  %74 = add nuw i64 %.02851, 1
  %exitcond62.not = icmp eq i64 %.02851, %.lcssa70
  br i1 %exitcond62.not, label %._crit_edge54, label %.lr.ph53, !llvm.loop !19

._crit_edge58:                                    ; preds = %._crit_edge54, %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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4

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

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

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !14, !13}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


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