; LLVM IR from eyangch/competitive-programming :: Codeforces/1731 (c)

; 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 [200000 x i64], align 16
@P = external dso_local global [200000 x i64], align 16
@cnt = external dso_local global [300000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca 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 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 = %120, %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 %124

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 [200000 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
  %36 = load i64, ptr @A, align 16, !tbaa !8
  store i64 %36, ptr @P, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  store i64 1, ptr %3, align 8, !tbaa !8
  br label %37

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

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

42:                                               ; preds = %37
  %43 = load i64, ptr %3, align 8, !tbaa !8
  %44 = sub nsw i64 %43, 1
  %45 = getelementptr inbounds [200000 x i64], ptr @P, i64 0, i64 %44
  %46 = load i64, ptr %45, align 8, !tbaa !8
  %47 = load i64, ptr %3, align 8, !tbaa !8
  %48 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %47
  %49 = load i64, ptr %48, align 8, !tbaa !8
  %50 = xor i64 %46, %49
  %51 = load i64, ptr %3, align 8, !tbaa !8
  %52 = getelementptr inbounds [200000 x i64], ptr @P, i64 0, i64 %51
  store i64 %50, ptr %52, align 8, !tbaa !8
  br label %53

53:                                               ; preds = %42
  %54 = load i64, ptr %3, align 8, !tbaa !8
  %55 = add nsw i64 %54, 1
  store i64 %55, ptr %3, align 8, !tbaa !8
  br label %37, !llvm.loop !13

56:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 1, ptr %4, align 8, !tbaa !8
  br label %57

57:                                               ; preds = %61, %56
  %58 = load i64, ptr %4, align 8, !tbaa !8
  %59 = load i64, ptr @N, align 8, !tbaa !8
  %60 = icmp sle i64 %58, %59
  br i1 %60, label %61, label %64

61:                                               ; preds = %57
  %62 = load i64, ptr %4, align 8, !tbaa !8
  %63 = mul nsw i64 %62, 2
  store i64 %63, ptr %4, align 8, !tbaa !8
  br label %57, !llvm.loop !14

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

65:                                               ; preds = %73, %64
  %66 = load i64, ptr %5, align 8, !tbaa !8
  %67 = load i64, ptr %4, align 8, !tbaa !8
  %68 = icmp slt i64 %66, %67
  br i1 %68, label %70, label %69

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

70:                                               ; preds = %65
  %71 = load i64, ptr %5, align 8, !tbaa !8
  %72 = getelementptr inbounds [300000 x i64], ptr @cnt, i64 0, i64 %71
  store i64 0, ptr %72, align 8, !tbaa !8
  br label %73

73:                                               ; preds = %70
  %74 = load i64, ptr %5, align 8, !tbaa !8
  %75 = add nsw i64 %74, 1
  store i64 %75, ptr %5, align 8, !tbaa !8
  br label %65, !llvm.loop !15

76:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %77 = load i64, ptr @N, align 8, !tbaa !8
  %78 = load i64, ptr @N, align 8, !tbaa !8
  %79 = add nsw i64 %78, 1
  %80 = mul nsw i64 %77, %79
  %81 = sdiv i64 %80, 2
  store i64 %81, ptr %6, align 8, !tbaa !8
  store i64 1, ptr @cnt, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !8
  br label %82

82:                                               ; preds = %117, %76
  %83 = load i64, ptr %7, align 8, !tbaa !8
  %84 = load i64, ptr @N, align 8, !tbaa !8
  %85 = icmp slt i64 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  store i32 15, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %120

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

88:                                               ; preds = %107, %87
  %89 = load i64, ptr %9, align 8, !tbaa !8
  %90 = load i64, ptr %9, align 8, !tbaa !8
  %91 = mul nsw i64 %89, %90
  %92 = load i64, ptr %4, align 8, !tbaa !8
  %93 = icmp slt i64 %91, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %88
  store i32 18, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %110

95:                                               ; preds = %88
  %96 = load i64, ptr %7, align 8, !tbaa !8
  %97 = getelementptr inbounds [200000 x i64], ptr @P, i64 0, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !8
  %99 = load i64, ptr %9, align 8, !tbaa !8
  %100 = load i64, ptr %9, align 8, !tbaa !8
  %101 = mul nsw i64 %99, %100
  %102 = xor i64 %98, %101
  %103 = getelementptr inbounds [300000 x i64], ptr @cnt, i64 0, i64 %102
  %104 = load i64, ptr %103, align 8, !tbaa !8
  %105 = load i64, ptr %6, align 8, !tbaa !8
  %106 = sub nsw i64 %105, %104
  store i64 %106, ptr %6, align 8, !tbaa !8
  br label %107

107:                                              ; preds = %95
  %108 = load i64, ptr %9, align 8, !tbaa !8
  %109 = add nsw i64 %108, 1
  store i64 %109, ptr %9, align 8, !tbaa !8
  br label %88, !llvm.loop !16

110:                                              ; preds = %94
  %111 = load i64, ptr %7, align 8, !tbaa !8
  %112 = getelementptr inbounds [200000 x i64], ptr @P, i64 0, i64 %111
  %113 = load i64, ptr %112, align 8, !tbaa !8
  %114 = getelementptr inbounds [300000 x i64], ptr @cnt, i64 0, i64 %113
  %115 = load i64, ptr %114, align 8, !tbaa !8
  %116 = add nsw i64 %115, 1
  store i64 %116, ptr %114, align 8, !tbaa !8
  br label %117

117:                                              ; preds = %110
  %118 = load i64, ptr %7, align 8, !tbaa !8
  %119 = add nsw i64 %118, 1
  store i64 %119, ptr %7, align 8, !tbaa !8
  br label %82, !llvm.loop !17

120:                                              ; preds = %86
  %121 = load i64, ptr %6, align 8, !tbaa !8
  %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 %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %17, !llvm.loop !18

124:                                              ; preds = %17
  %125 = load i32, ptr %1, align 4
  ret i32 %125
}

; 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: 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 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 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !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 [200000 x i64], align 16
@P = external dso_local local_unnamed_addr global [200000 x i64], align 16
@cnt = external dso_local local_unnamed_addr global [300000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = 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
  %.not48 = icmp eq i64 %8, 0
  br i1 %.not48, label %._crit_edge51, label %.lr.ph50

.lr.ph50:                                         ; preds = %0, %._crit_edge46
  %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_edge.thread

._crit_edge.thread:                               ; preds = %.lr.ph50
  %13 = load i64, ptr @A, align 16, !tbaa !8
  store i64 %13, ptr @P, align 16, !tbaa !8
  br label %.preheader36

._crit_edge:                                      ; preds = %.lr.ph
  %14 = load i64, ptr @A, align 16, !tbaa !8
  store i64 %14, ptr @P, align 16, !tbaa !8
  %15 = icmp sgt i64 %22, 1
  br i1 %15, label %.lr.ph40.preheader, label %.preheader36

.lr.ph40.preheader:                               ; preds = %._crit_edge
  %16 = add nsw i64 %22, -1
  %17 = add nsw i64 %22, -2
  %xtraiter = and i64 %16, 3
  %18 = icmp ult i64 %17, 3
  br i1 %18, label %.preheader36.loopexit.unr-lcssa, label %.lr.ph40.preheader.new

.lr.ph40.preheader.new:                           ; preds = %.lr.ph40.preheader
  %unroll_iter = and i64 %16, -4
  br label %.lr.ph40

.lr.ph:                                           ; preds = %.lr.ph50, %.lr.ph
  %.03237 = phi i64 [ %21, %.lr.ph ], [ 0, %.lr.ph50 ]
  %19 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %.03237
  %20 = 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) %19)
  %21 = add nuw nsw i64 %.03237, 1
  %22 = load i64, ptr @N, align 8, !tbaa !8
  %23 = icmp slt i64 %21, %22
  br i1 %23, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.preheader36.loopexit.unr-lcssa:                  ; preds = %.lr.ph40, %.lr.ph40.preheader
  %.unr = phi i64 [ %14, %.lr.ph40.preheader ], [ %48, %.lr.ph40 ]
  %.03138.unr = phi i64 [ 1, %.lr.ph40.preheader ], [ %50, %.lr.ph40 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader36, label %.lr.ph40.epil

.lr.ph40.epil:                                    ; preds = %.preheader36.loopexit.unr-lcssa, %.lr.ph40.epil
  %24 = phi i64 [ %27, %.lr.ph40.epil ], [ %.unr, %.preheader36.loopexit.unr-lcssa ]
  %.03138.epil = phi i64 [ %29, %.lr.ph40.epil ], [ %.03138.unr, %.preheader36.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph40.epil ], [ 0, %.preheader36.loopexit.unr-lcssa ]
  %25 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %.03138.epil
  %26 = load i64, ptr %25, align 8, !tbaa !8
  %27 = xor i64 %26, %24
  %28 = getelementptr inbounds [200000 x i64], ptr @P, i64 0, i64 %.03138.epil
  store i64 %27, ptr %28, align 8, !tbaa !8
  %29 = add nuw nsw i64 %.03138.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader36, label %.lr.ph40.epil, !llvm.loop !13

.preheader36:                                     ; preds = %.preheader36.loopexit.unr-lcssa, %.lr.ph40.epil, %._crit_edge.thread, %._crit_edge
  %.lcssa56 = phi i64 [ %11, %._crit_edge.thread ], [ %22, %._crit_edge ], [ %22, %.lr.ph40.epil ], [ %22, %.preheader36.loopexit.unr-lcssa ]
  br label %51

.lr.ph40:                                         ; preds = %.lr.ph40, %.lr.ph40.preheader.new
  %30 = phi i64 [ %14, %.lr.ph40.preheader.new ], [ %48, %.lr.ph40 ]
  %.03138 = phi i64 [ 1, %.lr.ph40.preheader.new ], [ %50, %.lr.ph40 ]
  %niter = phi i64 [ 0, %.lr.ph40.preheader.new ], [ %niter.next.3, %.lr.ph40 ]
  %31 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %.03138
  %32 = load i64, ptr %31, align 8, !tbaa !8
  %33 = xor i64 %32, %30
  %34 = getelementptr inbounds [200000 x i64], ptr @P, i64 0, i64 %.03138
  store i64 %33, ptr %34, align 8, !tbaa !8
  %35 = add nuw nsw i64 %.03138, 1
  %36 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %35
  %37 = load i64, ptr %36, align 8, !tbaa !8
  %38 = xor i64 %37, %33
  %39 = getelementptr inbounds [200000 x i64], ptr @P, i64 0, i64 %35
  store i64 %38, ptr %39, align 8, !tbaa !8
  %40 = add nuw nsw i64 %.03138, 2
  %41 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %40
  %42 = load i64, ptr %41, align 8, !tbaa !8
  %43 = xor i64 %42, %38
  %44 = getelementptr inbounds [200000 x i64], ptr @P, i64 0, i64 %40
  store i64 %43, ptr %44, align 8, !tbaa !8
  %45 = add nuw nsw i64 %.03138, 3
  %46 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !8
  %48 = xor i64 %47, %43
  %49 = getelementptr inbounds [200000 x i64], ptr @P, i64 0, i64 %45
  store i64 %48, ptr %49, align 8, !tbaa !8
  %50 = add nuw nsw i64 %.03138, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader36.loopexit.unr-lcssa, label %.lr.ph40, !llvm.loop !15

51:                                               ; preds = %51, %.preheader36
  %.030 = phi i64 [ %52, %51 ], [ 1, %.preheader36 ]
  %.not34 = icmp sgt i64 %.030, %.lcssa56
  %52 = shl nsw i64 %.030, 1
  br i1 %.not34, label %.preheader35, label %51, !llvm.loop !16

.preheader35:                                     ; preds = %51
  %umax = tail call i64 @llvm.umax.i64(i64 %.030, i64 1)
  %53 = shl nuw i64 %umax, 3
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @cnt, i8 0, i64 %53, i1 false), !tbaa !8
  %54 = add nsw i64 %.lcssa56, 1
  %55 = mul nsw i64 %54, %.lcssa56
  %56 = sdiv i64 %55, 2
  store i64 1, ptr @cnt, align 16, !tbaa !8
  %57 = icmp sgt i64 %.lcssa56, 0
  br i1 %57, label %.preheader, label %._crit_edge46

.preheader:                                       ; preds = %.preheader35, %64
  %.02745 = phi i64 [ %68, %64 ], [ 0, %.preheader35 ]
  %.02844 = phi i64 [ %74, %64 ], [ %56, %.preheader35 ]
  %58 = getelementptr inbounds [200000 x i64], ptr @P, i64 0, i64 %.02745
  %59 = load i64, ptr %58, align 8, !tbaa !8
  br label %69

._crit_edge46:                                    ; preds = %64, %.preheader35
  %.028.lcssa = phi i64 [ %56, %.preheader35 ], [ %74, %64 ]
  %60 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.028.lcssa)
  %61 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %60, i8 noundef signext 10)
  %62 = load i64, ptr @T, align 8, !tbaa !8
  %63 = add nsw i64 %62, -1
  store i64 %63, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %62, 0
  br i1 %.not, label %._crit_edge51, label %.lr.ph50, !llvm.loop !17

64:                                               ; preds = %69
  %65 = getelementptr inbounds [300000 x i64], ptr @cnt, i64 0, i64 %59
  %66 = load i64, ptr %65, align 8, !tbaa !8
  %67 = add nsw i64 %66, 1
  store i64 %67, ptr %65, align 8, !tbaa !8
  %68 = add nuw nsw i64 %.02745, 1
  %exitcond54.not = icmp eq i64 %68, %.lcssa56
  br i1 %exitcond54.not, label %._crit_edge46, label %.preheader, !llvm.loop !18

69:                                               ; preds = %.preheader, %69
  %70 = phi i64 [ 0, %.preheader ], [ %76, %69 ]
  %.043 = phi i64 [ 0, %.preheader ], [ %75, %69 ]
  %.142 = phi i64 [ %.02844, %.preheader ], [ %74, %69 ]
  %71 = xor i64 %59, %70
  %72 = getelementptr inbounds [300000 x i64], ptr @cnt, i64 0, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !8
  %74 = sub nsw i64 %.142, %73
  %75 = add nuw nsw i64 %.043, 1
  %76 = mul nuw nsw i64 %75, %75
  %77 = icmp ult i64 %76, %.030
  br i1 %77, label %69, label %64, !llvm.loop !19

._crit_edge51:                                    ; preds = %._crit_edge46, %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: 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.umax.i64(i64, i64) #5

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }

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


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