; LLVM IR from eyangch/competitive-programming :: Codeforces/1690 (b)

; 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 [50000 x i64], align 16
@b = external dso_local global [50000 x i64], align 16
@d = external dso_local global [50000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

21:                                               ; preds = %17
  %22 = 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) #6
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %23

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

27:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %35

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

32:                                               ; preds = %28
  %33 = load i64, ptr %2, align 8, !tbaa !8
  %34 = add nsw i64 %33, 1
  store i64 %34, ptr %2, align 8, !tbaa !8
  br label %23, !llvm.loop !11

35:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  store i64 0, ptr %3, align 8, !tbaa !8
  br label %36

36:                                               ; preds = %45, %35
  %37 = load i64, ptr %3, align 8, !tbaa !8
  %38 = load i64, ptr @N, align 8, !tbaa !8
  %39 = icmp slt i64 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %48

41:                                               ; preds = %36
  %42 = load i64, ptr %3, align 8, !tbaa !8
  %43 = getelementptr inbounds [50000 x i64], ptr @b, i64 0, i64 %42
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %43)
  br label %45

45:                                               ; preds = %41
  %46 = load i64, ptr %3, align 8, !tbaa !8
  %47 = add nsw i64 %46, 1
  store i64 %47, ptr %3, align 8, !tbaa !8
  br label %36, !llvm.loop !13

48:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 0, ptr %4, align 8, !tbaa !8
  br label %49

49:                                               ; preds = %64, %48
  %50 = load i64, ptr %4, align 8, !tbaa !8
  %51 = load i64, ptr @N, align 8, !tbaa !8
  %52 = icmp slt i64 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %67

54:                                               ; preds = %49
  %55 = load i64, ptr %4, align 8, !tbaa !8
  %56 = getelementptr inbounds [50000 x i64], ptr @a, i64 0, i64 %55
  %57 = load i64, ptr %56, align 8, !tbaa !8
  %58 = load i64, ptr %4, align 8, !tbaa !8
  %59 = getelementptr inbounds [50000 x i64], ptr @b, i64 0, i64 %58
  %60 = load i64, ptr %59, align 8, !tbaa !8
  %61 = sub nsw i64 %57, %60
  %62 = load i64, ptr %4, align 8, !tbaa !8
  %63 = getelementptr inbounds [50000 x i64], ptr @d, i64 0, i64 %62
  store i64 %61, ptr %63, align 8, !tbaa !8
  br label %64

64:                                               ; preds = %54
  %65 = load i64, ptr %4, align 8, !tbaa !8
  %66 = add nsw i64 %65, 1
  store i64 %66, ptr %4, align 8, !tbaa !8
  br label %49, !llvm.loop !14

67:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #6
  store i8 1, ptr %5, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 2000000000, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !8
  br label %68

68:                                               ; preds = %101, %67
  %69 = load i64, ptr %7, align 8, !tbaa !8
  %70 = load i64, ptr @N, align 8, !tbaa !8
  %71 = icmp slt i64 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  store i32 13, ptr %8, align 4
  br label %104

73:                                               ; preds = %68
  %74 = load i64, ptr %7, align 8, !tbaa !8
  %75 = getelementptr inbounds [50000 x i64], ptr @d, i64 0, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !8
  %77 = icmp slt i64 %76, 0
  br i1 %77, label %78, label %79

78:                                               ; preds = %73
  store i8 0, ptr %5, align 1, !tbaa !15
  store i32 13, ptr %8, align 4
  br label %104

79:                                               ; preds = %73
  %80 = load i64, ptr %7, align 8, !tbaa !8
  %81 = getelementptr inbounds [50000 x i64], ptr @b, i64 0, i64 %80
  %82 = load i64, ptr %81, align 8, !tbaa !8
  %83 = icmp eq i64 %82, 0
  br i1 %83, label %84, label %85

84:                                               ; preds = %79
  br label %101

85:                                               ; preds = %79
  %86 = load i64, ptr %6, align 8, !tbaa !8
  %87 = sitofp i64 %86 to double
  %88 = fcmp oeq double %87, 2.000000e+09
  br i1 %88, label %89, label %93

89:                                               ; preds = %85
  %90 = load i64, ptr %7, align 8, !tbaa !8
  %91 = getelementptr inbounds [50000 x i64], ptr @d, i64 0, i64 %90
  %92 = load i64, ptr %91, align 8, !tbaa !8
  store i64 %92, ptr %6, align 8, !tbaa !8
  br label %93

93:                                               ; preds = %89, %85
  %94 = load i64, ptr %6, align 8, !tbaa !8
  %95 = load i64, ptr %7, align 8, !tbaa !8
  %96 = getelementptr inbounds [50000 x i64], ptr @d, i64 0, i64 %95
  %97 = load i64, ptr %96, align 8, !tbaa !8
  %98 = icmp ne i64 %94, %97
  br i1 %98, label %99, label %100

99:                                               ; preds = %93
  store i8 0, ptr %5, align 1, !tbaa !15
  store i32 13, ptr %8, align 4
  br label %104

100:                                              ; preds = %93
  br label %101

101:                                              ; preds = %100, %84
  %102 = load i64, ptr %7, align 8, !tbaa !8
  %103 = add nsw i64 %102, 1
  store i64 %103, ptr %7, align 8, !tbaa !8
  br label %68, !llvm.loop !17

104:                                              ; preds = %99, %78, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %105

105:                                              ; preds = %104
  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 = %125, %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
  store i32 16, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %128

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

116:                                              ; preds = %111
  %117 = load i64, ptr %9, align 8, !tbaa !8
  %118 = getelementptr inbounds [50000 x i64], ptr @d, i64 0, i64 %117
  %119 = load i64, ptr %118, align 8, !tbaa !8
  %120 = load i64, ptr %6, align 8, !tbaa !8
  %121 = icmp sgt i64 %119, %120
  br i1 %121, label %122, label %123

122:                                              ; preds = %116
  store i8 0, ptr %5, align 1, !tbaa !15
  br label %123

123:                                              ; preds = %122, %116
  br label %124

124:                                              ; preds = %123, %111
  br label %125

125:                                              ; preds = %124
  %126 = load i64, ptr %9, align 8, !tbaa !8
  %127 = add nsw i64 %126, 1
  store i64 %127, ptr %9, align 8, !tbaa !8
  br label %106, !llvm.loop !18

128:                                              ; preds = %110
  %129 = load i8, ptr %5, align 1, !tbaa !15, !range !19, !noundef !20
  %130 = trunc i8 %129 to i1
  %131 = zext i1 %130 to i64
  %132 = select i1 %130, ptr @.str, ptr @.str.1
  %133 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef %132)
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %133, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  br label %17, !llvm.loop !21

135:                                              ; preds = %17
  %136 = load i32, ptr %1, align 4
  ret i32 %136
}

; 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 uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!16, !16, i64 0}
!16 = !{!"bool", !10, i64 0}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = distinct !{!21, !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 [50000 x i64], align 16
@b = external dso_local global [50000 x i64], align 16
@d = external dso_local local_unnamed_addr global [50000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %2 = getelementptr i8, ptr %1, i64 -24
  %3 = load i64, ptr %2, align 8
  %4 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %3
  %5 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %4, ptr noundef null)
  %6 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %7 = 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)
  %8 = load i64, ptr @T, align 8, !tbaa !8
  %9 = add nsw i64 %8, -1
  store i64 %9, ptr @T, align 8, !tbaa !8
  %.not61 = icmp eq i64 %8, 0
  br i1 %.not61, label %._crit_edge64, label %.lr.ph63

.lr.ph63:                                         ; preds = %0, %60
  %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) @N)
  %11 = load i64, ptr @N, align 8, !tbaa !8
  %12 = icmp sgt i64 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge59.thread

.preheader38:                                     ; preds = %.lr.ph
  %13 = icmp sgt i64 %17, 0
  br i1 %13, label %.lr.ph41, label %._crit_edge59.thread

.lr.ph:                                           ; preds = %.lr.ph63, %.lr.ph
  %.03339 = phi i64 [ %16, %.lr.ph ], [ 0, %.lr.ph63 ]
  %14 = getelementptr inbounds [50000 x i64], ptr @a, i64 0, i64 %.03339
  %15 = 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) %14)
  %16 = add nuw nsw i64 %.03339, 1
  %17 = load i64, ptr @N, align 8, !tbaa !8
  %18 = icmp slt i64 %16, %17
  br i1 %18, label %.lr.ph, label %.preheader38, !llvm.loop !11

.preheader37:                                     ; preds = %.lr.ph41
  %19 = icmp sgt i64 %32, 0
  br i1 %19, label %.lr.ph43.preheader, label %._crit_edge59.thread

.lr.ph43.preheader:                               ; preds = %.preheader37
  %min.iters.check = icmp ult i64 %32, 4
  br i1 %min.iters.check, label %.lr.ph43.preheader84, label %vector.ph

.lr.ph43.preheader84:                             ; preds = %middle.block, %.lr.ph43.preheader
  %.03142.ph = phi i64 [ 0, %.lr.ph43.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph43

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

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %20 = getelementptr inbounds [50000 x i64], ptr @a, i64 0, i64 %index
  %21 = getelementptr inbounds i8, ptr %20, i64 16
  %wide.load = load <2 x i64>, ptr %20, align 16, !tbaa !8
  %wide.load80 = load <2 x i64>, ptr %21, align 16, !tbaa !8
  %22 = getelementptr inbounds [50000 x i64], ptr @b, i64 0, i64 %index
  %23 = getelementptr inbounds i8, ptr %22, i64 16
  %wide.load81 = load <2 x i64>, ptr %22, align 16, !tbaa !8
  %wide.load82 = load <2 x i64>, ptr %23, align 16, !tbaa !8
  %24 = sub nsw <2 x i64> %wide.load, %wide.load81
  %25 = sub nsw <2 x i64> %wide.load80, %wide.load82
  %26 = getelementptr inbounds [50000 x i64], ptr @d, i64 0, i64 %index
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  store <2 x i64> %24, ptr %26, align 16, !tbaa !8
  store <2 x i64> %25, ptr %27, align 16, !tbaa !8
  %index.next = add nuw i64 %index, 4
  %28 = icmp eq i64 %index.next, %n.vec
  br i1 %28, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %32, %n.vec
  br i1 %cmp.n, label %.preheader, label %.lr.ph43.preheader84

.lr.ph41:                                         ; preds = %.preheader38, %.lr.ph41
  %.03240 = phi i64 [ %31, %.lr.ph41 ], [ 0, %.preheader38 ]
  %29 = getelementptr inbounds [50000 x i64], ptr @b, i64 0, i64 %.03240
  %30 = 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) %29)
  %31 = add nuw nsw i64 %.03240, 1
  %32 = load i64, ptr @N, align 8, !tbaa !8
  %33 = icmp slt i64 %31, %32
  br i1 %33, label %.lr.ph41, label %.preheader37, !llvm.loop !16

.preheader:                                       ; preds = %.lr.ph43, %middle.block
  br i1 %19, label %.lr.ph46, label %._crit_edge59.thread

.lr.ph43:                                         ; preds = %.lr.ph43.preheader84, %.lr.ph43
  %.03142 = phi i64 [ %40, %.lr.ph43 ], [ %.03142.ph, %.lr.ph43.preheader84 ]
  %34 = getelementptr inbounds [50000 x i64], ptr @a, i64 0, i64 %.03142
  %35 = load i64, ptr %34, align 8, !tbaa !8
  %36 = getelementptr inbounds [50000 x i64], ptr @b, i64 0, i64 %.03142
  %37 = load i64, ptr %36, align 8, !tbaa !8
  %38 = sub nsw i64 %35, %37
  %39 = getelementptr inbounds [50000 x i64], ptr @d, i64 0, i64 %.03142
  store i64 %38, ptr %39, align 8, !tbaa !8
  %40 = add nuw nsw i64 %.03142, 1
  %exitcond.not = icmp eq i64 %40, %32
  br i1 %exitcond.not, label %.preheader, label %.lr.ph43, !llvm.loop !17

.lr.ph46:                                         ; preds = %.preheader, %50
  %.02645 = phi i64 [ %51, %50 ], [ 0, %.preheader ]
  %.02744 = phi i64 [ %.2, %50 ], [ 2000000000, %.preheader ]
  %41 = getelementptr inbounds [50000 x i64], ptr @d, i64 0, i64 %.02645
  %42 = load i64, ptr %41, align 8, !tbaa !8
  %43 = icmp slt i64 %42, 0
  br i1 %43, label %._crit_edge, label %44

44:                                               ; preds = %.lr.ph46
  %45 = getelementptr inbounds [50000 x i64], ptr @b, i64 0, i64 %.02645
  %46 = load i64, ptr %45, align 8, !tbaa !8
  %47 = icmp eq i64 %46, 0
  br i1 %47, label %50, label %48

48:                                               ; preds = %44
  %49 = icmp eq i64 %.02744, 2000000000
  %spec.select = select i1 %49, i64 %42, i64 %.02744
  %.not35 = icmp eq i64 %spec.select, %42
  br i1 %.not35, label %50, label %._crit_edge

50:                                               ; preds = %48, %44
  %.2 = phi i64 [ %.02744, %44 ], [ %42, %48 ]
  %51 = add nuw nsw i64 %.02645, 1
  %exitcond66.not = icmp eq i64 %51, %32
  br i1 %exitcond66.not, label %._crit_edge, label %.lr.ph46, !llvm.loop !18

._crit_edge:                                      ; preds = %50, %.lr.ph46, %48
  %.028 = phi i1 [ true, %50 ], [ false, %.lr.ph46 ], [ false, %48 ]
  %.3 = phi i64 [ %.2, %50 ], [ %.02744, %.lr.ph46 ], [ %spec.select, %48 ]
  br i1 %19, label %.lr.ph58.preheader, label %._crit_edge59

.lr.ph58.preheader:                               ; preds = %._crit_edge
  %xtraiter = and i64 %32, 1
  %52 = icmp eq i64 %32, 1
  br i1 %52, label %._crit_edge59.loopexit.unr-lcssa, label %.lr.ph58.preheader.new

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

._crit_edge59.loopexit.unr-lcssa:                 ; preds = %81, %.lr.ph58.preheader
  %.230.lcssa.ph = phi i1 [ poison, %.lr.ph58.preheader ], [ %.230.1, %81 ]
  %.056.unr = phi i64 [ 0, %.lr.ph58.preheader ], [ %82, %81 ]
  %.12955.unr = phi i1 [ %.028, %.lr.ph58.preheader ], [ %.230.1, %81 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge59, label %.lr.ph58.epil

.lr.ph58.epil:                                    ; preds = %._crit_edge59.loopexit.unr-lcssa
  %53 = getelementptr inbounds [50000 x i64], ptr @b, i64 0, i64 %.056.unr
  %54 = load i64, ptr %53, align 8, !tbaa !8
  %55 = icmp eq i64 %54, 0
  br i1 %55, label %56, label %._crit_edge59

56:                                               ; preds = %.lr.ph58.epil
  %57 = getelementptr inbounds [50000 x i64], ptr @d, i64 0, i64 %.056.unr
  %58 = load i64, ptr %57, align 8, !tbaa !8
  %59 = icmp sle i64 %58, %.3
  %spec.select36.epil = select i1 %59, i1 %.12955.unr, i1 false
  br label %._crit_edge59

._crit_edge59:                                    ; preds = %._crit_edge59.loopexit.unr-lcssa, %56, %.lr.ph58.epil, %._crit_edge
  %.129.lcssa = phi i1 [ %.028, %._crit_edge ], [ %.230.lcssa.ph, %._crit_edge59.loopexit.unr-lcssa ], [ %.12955.unr, %.lr.ph58.epil ], [ %spec.select36.epil, %56 ]
  %cond.fr = freeze i1 %.129.lcssa
  br i1 %cond.fr, label %._crit_edge59.thread, label %60

._crit_edge59.thread:                             ; preds = %.preheader, %.preheader38, %.lr.ph63, %.preheader37, %._crit_edge59
  br label %60

60:                                               ; preds = %._crit_edge59, %._crit_edge59.thread
  %61 = phi ptr [ @.str, %._crit_edge59.thread ], [ @.str.1, %._crit_edge59 ]
  %62 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %61)
  %63 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %62, i8 noundef signext 10)
  %64 = load i64, ptr @T, align 8, !tbaa !8
  %65 = add nsw i64 %64, -1
  store i64 %65, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %64, 0
  br i1 %.not, label %._crit_edge64, label %.lr.ph63, !llvm.loop !19

.lr.ph58:                                         ; preds = %81, %.lr.ph58.preheader.new
  %.056 = phi i64 [ 0, %.lr.ph58.preheader.new ], [ %82, %81 ]
  %.12955 = phi i1 [ %.028, %.lr.ph58.preheader.new ], [ %.230.1, %81 ]
  %niter = phi i64 [ 0, %.lr.ph58.preheader.new ], [ %niter.next.1, %81 ]
  %66 = getelementptr inbounds [50000 x i64], ptr @b, i64 0, i64 %.056
  %67 = load i64, ptr %66, align 16, !tbaa !8
  %68 = icmp eq i64 %67, 0
  br i1 %68, label %69, label %.lr.ph58.1

69:                                               ; preds = %.lr.ph58
  %70 = getelementptr inbounds [50000 x i64], ptr @d, i64 0, i64 %.056
  %71 = load i64, ptr %70, align 16, !tbaa !8
  %72 = icmp sle i64 %71, %.3
  %spec.select36 = select i1 %72, i1 %.12955, i1 false
  br label %.lr.ph58.1

.lr.ph58.1:                                       ; preds = %69, %.lr.ph58
  %.230 = phi i1 [ %.12955, %.lr.ph58 ], [ %spec.select36, %69 ]
  %73 = or disjoint i64 %.056, 1
  %74 = getelementptr inbounds [50000 x i64], ptr @b, i64 0, i64 %73
  %75 = load i64, ptr %74, align 8, !tbaa !8
  %76 = icmp eq i64 %75, 0
  br i1 %76, label %77, label %81

77:                                               ; preds = %.lr.ph58.1
  %78 = getelementptr inbounds [50000 x i64], ptr @d, i64 0, i64 %73
  %79 = load i64, ptr %78, align 8, !tbaa !8
  %80 = icmp sle i64 %79, %.3
  %spec.select36.1 = select i1 %80, i1 %.230, i1 false
  br label %81

81:                                               ; preds = %77, %.lr.ph58.1
  %.230.1 = phi i1 [ %.230, %.lr.ph58.1 ], [ %spec.select36.1, %77 ]
  %82 = add nuw nsw i64 %.056, 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_edge59.loopexit.unr-lcssa, label %.lr.ph58, !llvm.loop !20

._crit_edge64:                                    ; preds = %60, %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 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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4

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

!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, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12, !15, !14}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}


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