; LLVM IR from eyangch/competitive-programming :: Codeforces/1450 (f)

; 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
@E = external dso_local global [100000 x i64], align 16
@O = 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 i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %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 = %124, %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 %125

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 = load i64, ptr @N, align 8, !tbaa !8
  %25 = getelementptr inbounds i64, ptr @O, i64 %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !11
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @O, ptr noundef %25, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  store i64 0, ptr %3, align 8, !tbaa !8
  br label %26

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

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

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

42:                                               ; preds = %31
  %43 = load i64, ptr %3, align 8, !tbaa !8
  %44 = add nsw i64 %43, 1
  store i64 %44, ptr %3, align 8, !tbaa !8
  br label %26, !llvm.loop !13

45:                                               ; preds = %30
  %46 = load i64, ptr @N, align 8, !tbaa !8
  %47 = getelementptr inbounds i64, ptr @E, i64 %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !11
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @E, ptr noundef %47, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  %48 = load i64, ptr @A, align 16, !tbaa !8
  %49 = getelementptr inbounds [100000 x i64], ptr @E, i64 0, i64 %48
  %50 = load i64, ptr %49, align 8, !tbaa !8
  %51 = add nsw i64 %50, 1
  store i64 %51, ptr %49, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store i64 0, ptr %5, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store i64 0, ptr %6, align 8, !tbaa !8
  br label %52

52:                                               ; preds = %84, %45
  %53 = load i64, ptr %6, align 8, !tbaa !8
  %54 = load i64, ptr @N, align 8, !tbaa !8
  %55 = sub nsw i64 %54, 1
  %56 = icmp slt i64 %53, %55
  br i1 %56, label %58, label %57

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

58:                                               ; preds = %52
  %59 = load i64, ptr %6, align 8, !tbaa !8
  %60 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !8
  %62 = load i64, ptr %6, align 8, !tbaa !8
  %63 = add nsw i64 %62, 1
  %64 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %63
  %65 = load i64, ptr %64, align 8, !tbaa !8
  %66 = icmp eq i64 %61, %65
  br i1 %66, label %67, label %83

67:                                               ; preds = %58
  %68 = load i64, ptr %6, align 8, !tbaa !8
  %69 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %68
  %70 = load i64, ptr %69, align 8, !tbaa !8
  %71 = getelementptr inbounds [100000 x i64], ptr @E, i64 0, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !8
  %73 = add nsw i64 %72, 1
  store i64 %73, ptr %71, align 8, !tbaa !8
  %74 = load i64, ptr %6, align 8, !tbaa !8
  %75 = add nsw i64 %74, 1
  %76 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %75
  %77 = load i64, ptr %76, align 8, !tbaa !8
  %78 = getelementptr inbounds [100000 x i64], ptr @E, i64 0, i64 %77
  %79 = load i64, ptr %78, align 8, !tbaa !8
  %80 = add nsw i64 %79, 1
  store i64 %80, ptr %78, align 8, !tbaa !8
  %81 = load i64, ptr %5, align 8, !tbaa !8
  %82 = add nsw i64 %81, 1
  store i64 %82, ptr %5, align 8, !tbaa !8
  br label %83

83:                                               ; preds = %67, %58
  br label %84

84:                                               ; preds = %83
  %85 = load i64, ptr %6, align 8, !tbaa !8
  %86 = add nsw i64 %85, 1
  store i64 %86, ptr %6, align 8, !tbaa !8
  br label %52, !llvm.loop !15

87:                                               ; preds = %57
  %88 = load i64, ptr @N, align 8, !tbaa !8
  %89 = sub nsw i64 %88, 1
  %90 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !8
  %92 = getelementptr inbounds [100000 x i64], ptr @E, i64 0, i64 %91
  %93 = load i64, ptr %92, align 8, !tbaa !8
  %94 = add nsw i64 %93, 1
  store i64 %94, ptr %92, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %95 = load i64, ptr @N, align 8, !tbaa !8
  %96 = getelementptr inbounds i64, ptr @E, i64 %95
  %97 = call noundef ptr @_ZSt11max_elementIPxET_S1_S1_(ptr noundef @E, ptr noundef %96)
  %98 = load i64, ptr %97, align 8, !tbaa !8
  store i64 %98, ptr %7, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %99 = load i64, ptr @N, align 8, !tbaa !8
  %100 = getelementptr inbounds i64, ptr @O, i64 %99
  %101 = call noundef ptr @_ZSt11max_elementIPxET_S1_S1_(ptr noundef @O, ptr noundef %100)
  %102 = load i64, ptr %101, align 8, !tbaa !8
  store i64 %102, ptr %8, align 8, !tbaa !8
  %103 = load i64, ptr %8, align 8, !tbaa !8
  %104 = load i64, ptr @N, align 8, !tbaa !8
  %105 = sdiv i64 %104, 2
  %106 = load i64, ptr @N, align 8, !tbaa !8
  %107 = srem i64 %106, 2
  %108 = add nsw i64 %105, %107
  %109 = icmp sgt i64 %103, %108
  br i1 %109, label %110, label %113

110:                                              ; preds = %87
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %111, i8 noundef signext 10)
  br label %124

113:                                              ; preds = %87
  %114 = load i64, ptr %5, 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
  %115 = load i64, ptr %7, align 8, !tbaa !8
  %116 = load i64, ptr %5, align 8, !tbaa !8
  %117 = sub nsw i64 %115, %116
  %118 = sub nsw i64 %117, 2
  store i64 %118, ptr %10, align 8, !tbaa !8
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %120 = load i64, ptr %119, align 8, !tbaa !8
  %121 = add nsw i64 %114, %120
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %121)
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %122, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %124

124:                                              ; preds = %113, %110
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %18, !llvm.loop !16

125:                                              ; preds = %18
  %126 = load i32, ptr %1, align 4
  ret i32 %126
}

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt11max_elementIPxET_S1_S1_(ptr noundef, ptr noundef) #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) #4

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

; 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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


; 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
@E = external dso_local global [100000 x i64], align 16
@O = 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 i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  %10 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %11 = 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)
  %12 = load i64, ptr @T, align 8, !tbaa !8
  %13 = add nsw i64 %12, -1
  store i64 %13, ptr @T, align 8, !tbaa !8
  %.not32 = icmp eq i64 %12, 0
  br i1 %.not32, label %._crit_edge35, label %.lr.ph34

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

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph34
  %.lcssa = phi i64 [ %17, %.lr.ph34 ], [ %36, %.lr.ph ]
  %19 = getelementptr inbounds i64, ptr @E, i64 %.lcssa
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr %2, align 4, !tbaa !11
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @E, ptr noundef nonnull %19, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %20 = load i64, ptr @A, align 16, !tbaa !8
  %21 = getelementptr inbounds [100000 x i64], ptr @E, i64 0, i64 %20
  %22 = load i64, ptr %21, align 8, !tbaa !8
  %23 = add nsw i64 %22, 1
  store i64 %23, ptr %21, align 8, !tbaa !8
  %24 = load i64, ptr @N, align 8, !tbaa !8
  %25 = add i64 %24, -1
  %26 = icmp sgt i64 %24, 1
  br i1 %26, label %.lr.ph27.preheader, label %._crit_edge28

.lr.ph27.preheader:                               ; preds = %._crit_edge
  %xtraiter = and i64 %25, 1
  %27 = icmp eq i64 %24, 2
  br i1 %27, label %._crit_edge28.loopexit.unr-lcssa, label %.lr.ph27.preheader.new

.lr.ph27.preheader.new:                           ; preds = %.lr.ph27.preheader
  %unroll_iter = and i64 %25, -2
  br label %.lr.ph27

.lr.ph:                                           ; preds = %.lr.ph34, %.lr.ph
  %.023 = phi i64 [ %35, %.lr.ph ], [ 0, %.lr.ph34 ]
  %28 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %.023
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %28)
  %30 = load i64, ptr %28, align 8, !tbaa !8
  %31 = add nsw i64 %30, -1
  store i64 %31, ptr %28, align 8, !tbaa !8
  %32 = getelementptr inbounds [100000 x i64], ptr @O, i64 0, i64 %31
  %33 = load i64, ptr %32, align 8, !tbaa !8
  %34 = add nsw i64 %33, 1
  store i64 %34, ptr %32, align 8, !tbaa !8
  %35 = add nuw nsw i64 %.023, 1
  %36 = load i64, ptr @N, align 8, !tbaa !8
  %37 = icmp slt i64 %35, %36
  br i1 %37, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge28.loopexit.unr-lcssa:                 ; preds = %83, %.lr.ph27.preheader
  %.1.lcssa.ph = phi i64 [ poison, %.lr.ph27.preheader ], [ %.1.1, %83 ]
  %.unr = phi i64 [ %20, %.lr.ph27.preheader ], [ %76, %83 ]
  %.01625.unr = phi i64 [ 0, %.lr.ph27.preheader ], [ %.1.1, %83 ]
  %.01724.unr = phi i64 [ 0, %.lr.ph27.preheader ], [ %74, %83 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge28, label %.lr.ph27.epil

.lr.ph27.epil:                                    ; preds = %._crit_edge28.loopexit.unr-lcssa
  %38 = add nuw nsw i64 %.01724.unr, 1
  %39 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %38
  %40 = load i64, ptr %39, align 8, !tbaa !8
  %41 = icmp eq i64 %.unr, %40
  br i1 %41, label %42, label %._crit_edge28

42:                                               ; preds = %.lr.ph27.epil
  %43 = getelementptr inbounds [100000 x i64], ptr @E, i64 0, i64 %.unr
  %44 = load i64, ptr %43, align 8, !tbaa !8
  %45 = add nsw i64 %44, 2
  store i64 %45, ptr %43, align 8, !tbaa !8
  %46 = add nsw i64 %.01625.unr, 1
  br label %._crit_edge28

._crit_edge28:                                    ; preds = %._crit_edge28.loopexit.unr-lcssa, %42, %.lr.ph27.epil, %._crit_edge
  %.016.lcssa = phi i64 [ 0, %._crit_edge ], [ %.1.lcssa.ph, %._crit_edge28.loopexit.unr-lcssa ], [ %46, %42 ], [ %.01625.unr, %.lr.ph27.epil ]
  %47 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %25
  %48 = load i64, ptr %47, align 8, !tbaa !8
  %49 = getelementptr inbounds [100000 x i64], ptr @E, i64 0, i64 %48
  %50 = load i64, ptr %49, align 8, !tbaa !8
  %51 = add nsw i64 %50, 1
  store i64 %51, ptr %49, align 8, !tbaa !8
  %52 = getelementptr inbounds i64, ptr @E, i64 %24
  %53 = call noundef ptr @_ZSt11max_elementIPxET_S1_S1_(ptr noundef nonnull @E, ptr noundef nonnull %52)
  %54 = load i64, ptr %53, align 8, !tbaa !8
  %55 = load i64, ptr @N, align 8, !tbaa !8
  %56 = getelementptr inbounds i64, ptr @O, i64 %55
  %57 = call noundef ptr @_ZSt11max_elementIPxET_S1_S1_(ptr noundef nonnull @O, ptr noundef nonnull %56)
  %58 = load i64, ptr %57, align 8, !tbaa !8
  %59 = load i64, ptr @N, align 8, !tbaa !8
  %60 = sdiv i64 %59, 2
  %61 = srem i64 %59, 2
  %62 = add nsw i64 %60, %61
  %63 = icmp sgt i64 %58, %62
  br i1 %63, label %84, label %87

.lr.ph27:                                         ; preds = %83, %.lr.ph27.preheader.new
  %64 = phi i64 [ %20, %.lr.ph27.preheader.new ], [ %76, %83 ]
  %.01625 = phi i64 [ 0, %.lr.ph27.preheader.new ], [ %.1.1, %83 ]
  %.01724 = phi i64 [ 0, %.lr.ph27.preheader.new ], [ %74, %83 ]
  %niter = phi i64 [ 0, %.lr.ph27.preheader.new ], [ %niter.next.1, %83 ]
  %65 = or disjoint i64 %.01724, 1
  %66 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %65
  %67 = load i64, ptr %66, align 8, !tbaa !8
  %68 = icmp eq i64 %64, %67
  br i1 %68, label %69, label %.lr.ph27.1

69:                                               ; preds = %.lr.ph27
  %70 = getelementptr inbounds [100000 x i64], ptr @E, i64 0, i64 %64
  %71 = load i64, ptr %70, align 8, !tbaa !8
  %72 = add nsw i64 %71, 2
  store i64 %72, ptr %70, align 8, !tbaa !8
  %73 = add nsw i64 %.01625, 1
  br label %.lr.ph27.1

.lr.ph27.1:                                       ; preds = %.lr.ph27, %69
  %.1 = phi i64 [ %73, %69 ], [ %.01625, %.lr.ph27 ]
  %74 = add nuw nsw i64 %.01724, 2
  %75 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %74
  %76 = load i64, ptr %75, align 16, !tbaa !8
  %77 = icmp eq i64 %67, %76
  br i1 %77, label %78, label %83

78:                                               ; preds = %.lr.ph27.1
  %79 = getelementptr inbounds [100000 x i64], ptr @E, i64 0, i64 %67
  %80 = load i64, ptr %79, align 8, !tbaa !8
  %81 = add nsw i64 %80, 2
  store i64 %81, ptr %79, align 8, !tbaa !8
  %82 = add nsw i64 %.1, 1
  br label %83

83:                                               ; preds = %78, %.lr.ph27.1
  %.1.1 = phi i64 [ %82, %78 ], [ %.1, %.lr.ph27.1 ]
  %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_edge28.loopexit.unr-lcssa, label %.lr.ph27, !llvm.loop !15

84:                                               ; preds = %._crit_edge28
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %85, i8 noundef signext 10)
  br label %94

87:                                               ; preds = %._crit_edge28
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  store i64 0, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %reass.sub = sub i64 %54, %.016.lcssa
  %88 = add i64 %reass.sub, -2
  store i64 %88, ptr %4, align 8, !tbaa !8
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %90 = load i64, ptr %89, align 8, !tbaa !8
  %91 = add nsw i64 %90, %.016.lcssa
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %91)
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %92, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %94

94:                                               ; preds = %87, %84
  %95 = load i64, ptr @T, align 8, !tbaa !8
  %96 = add nsw i64 %95, -1
  store i64 %96, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %95, 0
  br i1 %.not, label %._crit_edge35, label %.lr.ph34, !llvm.loop !16

._crit_edge35:                                    ; preds = %94, %0
  ret i32 0
}

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt11max_elementIPxET_S1_S1_(ptr noundef, ptr noundef) local_unnamed_addr #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) local_unnamed_addr #4

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

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


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