; LLVM IR from lzyrapx/Competitive-Programming :: ACdream (1023（异或+数学）)

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

@a = external dso_local global [100005 x i32], align 16
@b = external dso_local global [100005 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.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 i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  br label %11

11:                                               ; preds = %131, %0
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  %14 = getelementptr i8, ptr %13, i64 -24
  %15 = load i64, ptr %14, align 8
  %16 = getelementptr inbounds i8, ptr %12, i64 %15
  %17 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %16)
  br i1 %17, label %18, label %132

18:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !8
  call void @llvm.memset.p0.i64(ptr align 16 @a, i8 0, i64 400020, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @b, i8 0, i64 400020, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !8
  br label %19

19:                                               ; preds = %29, %18
  %20 = load i32, ptr %4, align 4, !tbaa !8
  %21 = load i32, ptr %2, align 4, !tbaa !8
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %32

24:                                               ; preds = %19
  %25 = load i32, ptr %4, align 4, !tbaa !8
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %26
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %27)
  br label %29

29:                                               ; preds = %24
  %30 = load i32, ptr %4, align 4, !tbaa !8
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %4, align 4, !tbaa !8
  br label %19, !llvm.loop !11

32:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !8
  br label %33

33:                                               ; preds = %43, %32
  %34 = load i32, ptr %5, align 4, !tbaa !8
  %35 = load i32, ptr %2, align 4, !tbaa !8
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %46

38:                                               ; preds = %33
  %39 = load i32, ptr %5, align 4, !tbaa !8
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %40
  %42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %41)
  br label %43

43:                                               ; preds = %38
  %44 = load i32, ptr %5, align 4, !tbaa !8
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %5, align 4, !tbaa !8
  br label %33, !llvm.loop !13

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

47:                                               ; preds = %59, %46
  %48 = load i32, ptr %7, align 4, !tbaa !8
  %49 = load i32, ptr %2, align 4, !tbaa !8
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %62

52:                                               ; preds = %47
  %53 = load i32, ptr %7, align 4, !tbaa !8
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !8
  %57 = load i32, ptr %6, align 4, !tbaa !8
  %58 = xor i32 %57, %56
  store i32 %58, ptr %6, align 4, !tbaa !8
  br label %59

59:                                               ; preds = %52
  %60 = load i32, ptr %7, align 4, !tbaa !8
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %7, align 4, !tbaa !8
  br label %47, !llvm.loop !14

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

63:                                               ; preds = %75, %62
  %64 = load i32, ptr %8, align 4, !tbaa !8
  %65 = load i32, ptr %2, align 4, !tbaa !8
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %68, label %67

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

68:                                               ; preds = %63
  %69 = load i32, ptr %8, align 4, !tbaa !8
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !8
  %73 = load i32, ptr %6, align 4, !tbaa !8
  %74 = xor i32 %73, %72
  store i32 %74, ptr %6, align 4, !tbaa !8
  br label %75

75:                                               ; preds = %68
  %76 = load i32, ptr %8, align 4, !tbaa !8
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %8, align 4, !tbaa !8
  br label %63, !llvm.loop !15

78:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !8
  br label %79

79:                                               ; preds = %91, %78
  %80 = load i32, ptr %9, align 4, !tbaa !8
  %81 = load i32, ptr %2, align 4, !tbaa !8
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %94

84:                                               ; preds = %79
  %85 = load i32, ptr %6, align 4, !tbaa !8
  %86 = load i32, ptr %9, align 4, !tbaa !8
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !8
  %90 = xor i32 %89, %85
  store i32 %90, ptr %88, align 4, !tbaa !8
  br label %91

91:                                               ; preds = %84
  %92 = load i32, ptr %9, align 4, !tbaa !8
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %9, align 4, !tbaa !8
  br label %79, !llvm.loop !16

94:                                               ; preds = %83
  %95 = load i32, ptr %2, align 4, !tbaa !8
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds i32, ptr @a, i64 %96
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @a, ptr noundef %97)
  %98 = load i32, ptr %2, align 4, !tbaa !8
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds i32, ptr @b, i64 %99
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @b, ptr noundef %100)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !8
  br label %101

101:                                              ; preds = %118, %94
  %102 = load i32, ptr %10, align 4, !tbaa !8
  %103 = load i32, ptr %2, align 4, !tbaa !8
  %104 = icmp slt i32 %102, %103
  br i1 %104, label %106, label %105

105:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %121

106:                                              ; preds = %101
  %107 = load i32, ptr %10, align 4, !tbaa !8
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !8
  %111 = load i32, ptr %10, align 4, !tbaa !8
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !8
  %115 = icmp ne i32 %110, %114
  br i1 %115, label %116, label %117

116:                                              ; preds = %106
  store i32 0, ptr %3, align 4, !tbaa !8
  br label %117

117:                                              ; preds = %116, %106
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %10, align 4, !tbaa !8
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %10, align 4, !tbaa !8
  br label %101, !llvm.loop !17

121:                                              ; preds = %105
  %122 = load i32, ptr %3, align 4, !tbaa !8
  %123 = icmp ne i32 %122, 0
  br i1 %123, label %124, label %128

124:                                              ; preds = %121
  %125 = load i32, ptr %6, align 4, !tbaa !8
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %125)
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %126, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %131

128:                                              ; preds = %121
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %129, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %131

131:                                              ; preds = %128, %124
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %11, !llvm.loop !18

132:                                              ; preds = %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  ret i32 0
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264)) #3 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #5

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 @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(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_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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 nounwind willreturn memory(argmem: write) }
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 = !{!"int", !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" }

@a = external dso_local global [100005 x i32], align 16
@b = external dso_local global [100005 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.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 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  %2 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr i8, ptr %3, i64 -24
  %5 = load i64, ptr %4, align 8
  %6 = getelementptr inbounds i8, ptr %2, i64 %5
  %7 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %6)
  br i1 %7, label %.lr.ph57, label %._crit_edge58

.lr.ph57:                                         ; preds = %0, %73
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400020) @a, i8 0, i64 400020, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400020) @b, i8 0, i64 400020, i1 false)
  %8 = load i32, ptr %1, align 4, !tbaa !8
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %._crit_edge

.preheader36:                                     ; preds = %.lr.ph
  %10 = icmp sgt i32 %13, 0
  br i1 %10, label %.lr.ph39, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph57, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph57 ]
  %11 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %indvars.iv
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %11)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %13 = load i32, ptr %1, align 4, !tbaa !8
  %14 = sext i32 %13 to i64
  %15 = icmp slt i64 %indvars.iv.next, %14
  br i1 %15, label %.lr.ph, label %.preheader36, !llvm.loop !11

.preheader35:                                     ; preds = %.lr.ph39
  %16 = icmp sgt i32 %25, 0
  br i1 %16, label %.lr.ph42.preheader, label %._crit_edge

.lr.ph42.preheader:                               ; preds = %.preheader35
  %wide.trip.count = zext nneg i32 %25 to i64
  %min.iters.check139 = icmp ult i32 %25, 8
  br i1 %min.iters.check139, label %.lr.ph42.preheader158, label %vector.ph140

.lr.ph42.preheader158:                            ; preds = %middle.block137, %.lr.ph42.preheader
  %indvars.iv66.ph = phi i64 [ 0, %.lr.ph42.preheader ], [ %n.vec142, %middle.block137 ]
  %.02740.ph = phi i32 [ 0, %.lr.ph42.preheader ], [ %22, %middle.block137 ]
  br label %.lr.ph42

vector.ph140:                                     ; preds = %.lr.ph42.preheader
  %n.vec142 = and i64 %wide.trip.count, 2147483640
  br label %vector.body144

vector.body144:                                   ; preds = %vector.body144, %vector.ph140
  %index145 = phi i64 [ 0, %vector.ph140 ], [ %index.next150, %vector.body144 ]
  %vec.phi146 = phi <4 x i32> [ zeroinitializer, %vector.ph140 ], [ %19, %vector.body144 ]
  %vec.phi147 = phi <4 x i32> [ zeroinitializer, %vector.ph140 ], [ %20, %vector.body144 ]
  %17 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %index145
  %18 = getelementptr inbounds i8, ptr %17, i64 16
  %wide.load148 = load <4 x i32>, ptr %17, align 16, !tbaa !8
  %wide.load149 = load <4 x i32>, ptr %18, align 16, !tbaa !8
  %19 = xor <4 x i32> %wide.load148, %vec.phi146
  %20 = xor <4 x i32> %wide.load149, %vec.phi147
  %index.next150 = add nuw i64 %index145, 8
  %21 = icmp eq i64 %index.next150, %n.vec142
  br i1 %21, label %middle.block137, label %vector.body144, !llvm.loop !13

middle.block137:                                  ; preds = %vector.body144
  %bin.rdx151 = xor <4 x i32> %20, %19
  %22 = call i32 @llvm.vector.reduce.xor.v4i32(<4 x i32> %bin.rdx151)
  %cmp.n152 = icmp eq i64 %n.vec142, %wide.trip.count
  br i1 %cmp.n152, label %.preheader34, label %.lr.ph42.preheader158

.lr.ph39:                                         ; preds = %.preheader36, %.lr.ph39
  %indvars.iv63 = phi i64 [ %indvars.iv.next64, %.lr.ph39 ], [ 0, %.preheader36 ]
  %23 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %indvars.iv63
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %23)
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %25 = load i32, ptr %1, align 4, !tbaa !8
  %26 = sext i32 %25 to i64
  %27 = icmp slt i64 %indvars.iv.next64, %26
  br i1 %27, label %.lr.ph39, label %.preheader35, !llvm.loop !16

.preheader34:                                     ; preds = %.lr.ph42, %middle.block137
  %.lcssa101 = phi i32 [ %22, %middle.block137 ], [ %37, %.lr.ph42 ]
  br i1 %16, label %.lr.ph46.preheader, label %._crit_edge

.lr.ph46.preheader:                               ; preds = %.preheader34
  %wide.trip.count72 = zext nneg i32 %25 to i64
  %min.iters.check122 = icmp ult i32 %25, 8
  br i1 %min.iters.check122, label %.lr.ph46.preheader157, label %vector.ph123

.lr.ph46.preheader157:                            ; preds = %middle.block120, %.lr.ph46.preheader
  %indvars.iv69.ph = phi i64 [ 0, %.lr.ph46.preheader ], [ %n.vec125, %middle.block120 ]
  %.144.ph = phi i32 [ %.lcssa101, %.lr.ph46.preheader ], [ %34, %middle.block120 ]
  br label %.lr.ph46

vector.ph123:                                     ; preds = %.lr.ph46.preheader
  %n.vec125 = and i64 %wide.trip.count, 2147483640
  %28 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %.lcssa101, i64 0
  br label %vector.body127

vector.body127:                                   ; preds = %vector.body127, %vector.ph123
  %index128 = phi i64 [ 0, %vector.ph123 ], [ %index.next133, %vector.body127 ]
  %vec.phi129 = phi <4 x i32> [ %28, %vector.ph123 ], [ %31, %vector.body127 ]
  %vec.phi130 = phi <4 x i32> [ zeroinitializer, %vector.ph123 ], [ %32, %vector.body127 ]
  %29 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %index128
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  %wide.load131 = load <4 x i32>, ptr %29, align 16, !tbaa !8
  %wide.load132 = load <4 x i32>, ptr %30, align 16, !tbaa !8
  %31 = xor <4 x i32> %wide.load131, %vec.phi129
  %32 = xor <4 x i32> %wide.load132, %vec.phi130
  %index.next133 = add nuw i64 %index128, 8
  %33 = icmp eq i64 %index.next133, %n.vec125
  br i1 %33, label %middle.block120, label %vector.body127, !llvm.loop !17

middle.block120:                                  ; preds = %vector.body127
  %bin.rdx134 = xor <4 x i32> %32, %31
  %34 = call i32 @llvm.vector.reduce.xor.v4i32(<4 x i32> %bin.rdx134)
  %cmp.n135 = icmp eq i64 %n.vec125, %wide.trip.count
  br i1 %cmp.n135, label %.preheader, label %.lr.ph46.preheader157

.lr.ph42:                                         ; preds = %.lr.ph42.preheader158, %.lr.ph42
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %.lr.ph42 ], [ %indvars.iv66.ph, %.lr.ph42.preheader158 ]
  %.02740 = phi i32 [ %37, %.lr.ph42 ], [ %.02740.ph, %.lr.ph42.preheader158 ]
  %35 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %indvars.iv66
  %36 = load i32, ptr %35, align 4, !tbaa !8
  %37 = xor i32 %36, %.02740
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next67, %wide.trip.count
  br i1 %exitcond.not, label %.preheader34, label %.lr.ph42, !llvm.loop !18

.preheader:                                       ; preds = %.lr.ph46, %middle.block120
  %.lcssa102 = phi i32 [ %34, %middle.block120 ], [ %45, %.lr.ph46 ]
  br i1 %16, label %.lr.ph49.preheader, label %._crit_edge

.lr.ph49.preheader:                               ; preds = %.preheader
  %wide.trip.count77 = zext nneg i32 %25 to i64
  %min.iters.check109 = icmp ult i32 %25, 8
  br i1 %min.iters.check109, label %.lr.ph49.preheader156, label %vector.ph110

.lr.ph49.preheader156:                            ; preds = %middle.block107, %.lr.ph49.preheader
  %indvars.iv74.ph = phi i64 [ 0, %.lr.ph49.preheader ], [ %n.vec112, %middle.block107 ]
  br label %.lr.ph49

vector.ph110:                                     ; preds = %.lr.ph49.preheader
  %n.vec112 = and i64 %wide.trip.count, 2147483640
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %.lcssa102, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body114

vector.body114:                                   ; preds = %vector.body114, %vector.ph110
  %index115 = phi i64 [ 0, %vector.ph110 ], [ %index.next118, %vector.body114 ]
  %38 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %index115
  %39 = getelementptr inbounds i8, ptr %38, i64 16
  %wide.load116 = load <4 x i32>, ptr %38, align 16, !tbaa !8
  %wide.load117 = load <4 x i32>, ptr %39, align 16, !tbaa !8
  %40 = xor <4 x i32> %wide.load116, %broadcast.splat
  %41 = xor <4 x i32> %wide.load117, %broadcast.splat
  store <4 x i32> %40, ptr %38, align 16, !tbaa !8
  store <4 x i32> %41, ptr %39, align 16, !tbaa !8
  %index.next118 = add nuw i64 %index115, 8
  %42 = icmp eq i64 %index.next118, %n.vec112
  br i1 %42, label %middle.block107, label %vector.body114, !llvm.loop !19

middle.block107:                                  ; preds = %vector.body114
  %cmp.n119 = icmp eq i64 %n.vec112, %wide.trip.count
  br i1 %cmp.n119, label %._crit_edge, label %.lr.ph49.preheader156

.lr.ph46:                                         ; preds = %.lr.ph46.preheader157, %.lr.ph46
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %.lr.ph46 ], [ %indvars.iv69.ph, %.lr.ph46.preheader157 ]
  %.144 = phi i32 [ %45, %.lr.ph46 ], [ %.144.ph, %.lr.ph46.preheader157 ]
  %43 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %indvars.iv69
  %44 = load i32, ptr %43, align 4, !tbaa !8
  %45 = xor i32 %44, %.144
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %exitcond73.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count72
  br i1 %exitcond73.not, label %.preheader, label %.lr.ph46, !llvm.loop !20

._crit_edge:                                      ; preds = %.lr.ph49, %middle.block107, %.preheader35, %.lr.ph57, %.preheader36, %.preheader34, %.preheader
  %.1.lcssa94 = phi i32 [ %.lcssa102, %.preheader ], [ %.lcssa101, %.preheader34 ], [ 0, %.preheader36 ], [ 0, %.lr.ph57 ], [ 0, %.preheader35 ], [ %.lcssa102, %middle.block107 ], [ %.lcssa102, %.lr.ph49 ]
  %.lcssa858893 = phi i32 [ %25, %.preheader ], [ %25, %.preheader34 ], [ %13, %.preheader36 ], [ %8, %.lr.ph57 ], [ %25, %.preheader35 ], [ %25, %middle.block107 ], [ %25, %.lr.ph49 ]
  %46 = sext i32 %.lcssa858893 to i64
  %47 = getelementptr inbounds i32, ptr @a, i64 %46
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @a, ptr noundef nonnull %47)
  %48 = load i32, ptr %1, align 4, !tbaa !8
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds i32, ptr @b, i64 %49
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @b, ptr noundef nonnull %50)
  %51 = load i32, ptr %1, align 4, !tbaa !8
  %52 = icmp sgt i32 %51, 0
  br i1 %52, label %.lr.ph53.preheader, label %._crit_edge54.thread

.lr.ph53.preheader:                               ; preds = %._crit_edge
  %wide.trip.count82 = zext nneg i32 %51 to i64
  %min.iters.check = icmp ult i32 %51, 8
  br i1 %min.iters.check, label %.lr.ph53.preheader155, label %vector.ph

.lr.ph53.preheader155:                            ; preds = %middle.block, %.lr.ph53.preheader
  %indvars.iv79.ph = phi i64 [ 0, %.lr.ph53.preheader ], [ %n.vec, %middle.block ]
  %.03050.ph = phi i32 [ 1, %.lr.ph53.preheader ], [ %rdx.select, %middle.block ]
  br label %.lr.ph53

vector.ph:                                        ; preds = %.lr.ph53.preheader
  %n.vec = and i64 %wide.trip.count82, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i1> [ zeroinitializer, %vector.ph ], [ %59, %vector.body ]
  %vec.phi103 = phi <4 x i1> [ zeroinitializer, %vector.ph ], [ %60, %vector.body ]
  %53 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %index
  %54 = getelementptr inbounds i8, ptr %53, i64 16
  %wide.load = load <4 x i32>, ptr %53, align 16, !tbaa !8
  %wide.load104 = load <4 x i32>, ptr %54, align 16, !tbaa !8
  %55 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %index
  %56 = getelementptr inbounds i8, ptr %55, i64 16
  %wide.load105 = load <4 x i32>, ptr %55, align 16, !tbaa !8
  %wide.load106 = load <4 x i32>, ptr %56, align 16, !tbaa !8
  %57 = icmp ne <4 x i32> %wide.load, %wide.load105
  %58 = icmp ne <4 x i32> %wide.load104, %wide.load106
  %59 = or <4 x i1> %vec.phi, %57
  %60 = or <4 x i1> %vec.phi103, %58
  %index.next = add nuw i64 %index, 8
  %61 = icmp eq i64 %index.next, %n.vec
  br i1 %61, label %middle.block, label %vector.body, !llvm.loop !21

middle.block:                                     ; preds = %vector.body
  %bin.rdx = or <4 x i1> %60, %59
  %bin.rdx.fr = freeze <4 x i1> %bin.rdx
  %62 = bitcast <4 x i1> %bin.rdx.fr to i4
  %.not154 = icmp eq i4 %62, 0
  %rdx.select = zext i1 %.not154 to i32
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count82
  br i1 %cmp.n, label %._crit_edge54, label %.lr.ph53.preheader155

.lr.ph49:                                         ; preds = %.lr.ph49.preheader156, %.lr.ph49
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %.lr.ph49 ], [ %indvars.iv74.ph, %.lr.ph49.preheader156 ]
  %63 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %indvars.iv74
  %64 = load i32, ptr %63, align 4, !tbaa !8
  %65 = xor i32 %64, %.lcssa102
  store i32 %65, ptr %63, align 4, !tbaa !8
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %exitcond78.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count77
  br i1 %exitcond78.not, label %._crit_edge, label %.lr.ph49, !llvm.loop !22

._crit_edge54:                                    ; preds = %.lr.ph53, %middle.block
  %spec.select.lcssa = phi i32 [ %rdx.select, %middle.block ], [ %spec.select, %.lr.ph53 ]
  %.not = icmp eq i32 %spec.select.lcssa, 0
  br i1 %.not, label %71, label %._crit_edge54.thread

.lr.ph53:                                         ; preds = %.lr.ph53.preheader155, %.lr.ph53
  %indvars.iv79 = phi i64 [ %indvars.iv.next80, %.lr.ph53 ], [ %indvars.iv79.ph, %.lr.ph53.preheader155 ]
  %.03050 = phi i32 [ %spec.select, %.lr.ph53 ], [ %.03050.ph, %.lr.ph53.preheader155 ]
  %66 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %indvars.iv79
  %67 = load i32, ptr %66, align 4, !tbaa !8
  %68 = getelementptr inbounds [100005 x i32], ptr @b, i64 0, i64 %indvars.iv79
  %69 = load i32, ptr %68, align 4, !tbaa !8
  %.not33 = icmp eq i32 %67, %69
  %spec.select = select i1 %.not33, i32 %.03050, i32 0
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %exitcond83.not = icmp eq i64 %indvars.iv.next80, %wide.trip.count82
  br i1 %exitcond83.not, label %._crit_edge54, label %.lr.ph53, !llvm.loop !23

._crit_edge54.thread:                             ; preds = %._crit_edge, %._crit_edge54
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.1.lcssa94)
  br label %73

71:                                               ; preds = %._crit_edge54
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
  br label %73

73:                                               ; preds = %71, %._crit_edge54.thread
  %.sink = phi ptr [ %72, %71 ], [ %70, %._crit_edge54.thread ]
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %.sink, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %75 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %76 = load ptr, ptr %75, align 8, !tbaa !5
  %77 = getelementptr i8, ptr %76, i64 -24
  %78 = load i64, ptr %77, align 8
  %79 = getelementptr inbounds i8, ptr %75, i64 %78
  %80 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %79)
  br i1 %80, label %.lr.ph57, label %._crit_edge58, !llvm.loop !24

._crit_edge58:                                    ; preds = %73, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #6

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 @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.xor.v4i32(<4 x i32>) #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 nounwind willreturn memory(argmem: write) }
attributes #5 = { nofree nounwind "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 = !{!"int", !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, !14, !15}
!18 = distinct !{!18, !12, !15, !14}
!19 = distinct !{!19, !12, !14, !15}
!20 = distinct !{!20, !12, !15, !14}
!21 = distinct !{!21, !12, !14, !15}
!22 = distinct !{!22, !12, !15, !14}
!23 = distinct !{!23, !12, !15, !14}
!24 = distinct !{!24, !12}


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