; LLVM IR from tangjz/acm-icpc :: codechef/SNCKPE19/STRTF.ll (Z3dfsii)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Query = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@mx = external dso_local global i32, align 4
@low = external dso_local global i32, align 4
@a = external dso_local global [200001 x i32], align 16
@ans = external dso_local global [200001 x i32], align 16
@e = external dso_local global [513 x %"class.std::vector"], align 16
@sub = external dso_local global [513 x %"class.std::vector"], align 16
@b = external dso_local global [200001 x %struct.Query], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3dfsii(i32 noundef %0, i32 noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = load i32, ptr @mx, align 4, !tbaa !5
  %22 = icmp eq i32 %20, %21
  br i1 %22, label %23, label %88

23:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [513 x %"class.std::vector"], ptr @e, i64 0, i64 %25
  store ptr %26, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %27 = load ptr, ptr %5, align 8, !tbaa !9
  %28 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #4
  %29 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  store ptr %28, ptr %29, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %30 = load ptr, ptr %5, align 8, !tbaa !9
  %31 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #4
  %32 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %31, ptr %32, align 8
  br label %33

33:                                               ; preds = %85, %23
  %34 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  br i1 %34, label %36, label %35

35:                                               ; preds = %33
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %87

36:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %38 = load i32, ptr %37, align 4, !tbaa !5
  store i32 %38, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %39 = load i32, ptr %9, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [200001 x %struct.Query], ptr @b, i64 0, i64 %40
  %42 = getelementptr inbounds %struct.Query, ptr %41, i32 0, i32 1
  %43 = load i32, ptr %42, align 4, !tbaa !11
  store i32 %43, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %44 = load i32, ptr %9, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [200001 x %struct.Query], ptr @b, i64 0, i64 %45
  %47 = getelementptr inbounds %struct.Query, ptr %46, i32 0, i32 0
  %48 = load i32, ptr %47, align 8, !tbaa !13
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [513 x %"class.std::vector"], ptr @sub, i64 0, i64 %49
  store ptr %50, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %51 = load ptr, ptr %12, align 8, !tbaa !9
  %52 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %51) #4
  %53 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %52, ptr %53, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %54 = load ptr, ptr %12, align 8, !tbaa !9
  %55 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %54) #4
  %56 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %55, ptr %56, align 8
  br label %57

57:                                               ; preds = %78, %36
  %58 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  br i1 %58, label %60, label %59

59:                                               ; preds = %57
  store i32 4, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %80

60:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #4
  %62 = load i32, ptr %61, align 4, !tbaa !5
  store i32 %62, ptr %15, align 4, !tbaa !5
  %63 = load i32, ptr %11, align 4, !tbaa !5
  %64 = load i32, ptr %15, align 4, !tbaa !5
  %65 = add nsw i32 %63, %64
  %66 = load i32, ptr @n, align 4, !tbaa !5
  %67 = icmp sle i32 %65, %66
  br i1 %67, label %68, label %77

68:                                               ; preds = %60
  %69 = load i32, ptr %11, align 4, !tbaa !5
  %70 = load i32, ptr %15, align 4, !tbaa !5
  %71 = add nsw i32 %69, %70
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = load i32, ptr %10, align 4, !tbaa !5
  %76 = xor i32 %75, %74
  store i32 %76, ptr %10, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %68, %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %78

78:                                               ; preds = %77
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #4
  br label %57

80:                                               ; preds = %59
  %81 = load i32, ptr %10, align 4, !tbaa !5
  %82 = load i32, ptr %9, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [200001 x i32], ptr @ans, i64 0, i64 %83
  store i32 %81, ptr %84, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %85

85:                                               ; preds = %80
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  br label %33

87:                                               ; preds = %35
  br label %149

88:                                               ; preds = %2
  %89 = load i32, ptr %3, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  %91 = load i32, ptr %4, align 4, !tbaa !5
  call void @_Z3dfsii(i32 noundef %90, i32 noundef %91)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %92 = load i32, ptr %3, align 4, !tbaa !5
  %93 = shl i32 1, %92
  store i32 %93, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 1, ptr %17, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %113, %88
  %95 = load i32, ptr %17, align 4, !tbaa !5
  %96 = load i32, ptr %16, align 4, !tbaa !5
  %97 = add nsw i32 %95, %96
  %98 = load i32, ptr @n, align 4, !tbaa !5
  %99 = icmp sle i32 %97, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %94
  store i32 6, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %116

101:                                              ; preds = %94
  %102 = load i32, ptr %17, align 4, !tbaa !5
  %103 = load i32, ptr %16, align 4, !tbaa !5
  %104 = add nsw i32 %102, %103
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = load i32, ptr %17, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = xor i32 %111, %107
  store i32 %112, ptr %110, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %101
  %114 = load i32, ptr %17, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %17, align 4, !tbaa !5
  br label %94, !llvm.loop !14

116:                                              ; preds = %100
  %117 = load i32, ptr %3, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  %119 = load i32, ptr %4, align 4, !tbaa !5
  %120 = load i32, ptr %3, align 4, !tbaa !5
  %121 = load i32, ptr @low, align 4, !tbaa !5
  %122 = sub nsw i32 %120, %121
  %123 = shl i32 1, %122
  %124 = or i32 %119, %123
  call void @_Z3dfsii(i32 noundef %118, i32 noundef %124)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %125 = load i32, ptr %3, align 4, !tbaa !5
  %126 = shl i32 1, %125
  store i32 %126, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %127 = load i32, ptr @n, align 4, !tbaa !5
  %128 = load i32, ptr %18, align 4, !tbaa !5
  %129 = sub nsw i32 %127, %128
  store i32 %129, ptr %19, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %146, %116
  %131 = load i32, ptr %19, align 4, !tbaa !5
  %132 = icmp sge i32 %131, 1
  br i1 %132, label %134, label %133

133:                                              ; preds = %130
  store i32 9, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %149

134:                                              ; preds = %130
  %135 = load i32, ptr %19, align 4, !tbaa !5
  %136 = load i32, ptr %18, align 4, !tbaa !5
  %137 = add nsw i32 %135, %136
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = load i32, ptr %19, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = xor i32 %144, %140
  store i32 %145, ptr %143, align 4, !tbaa !5
  br label %146

146:                                              ; preds = %134
  %147 = load i32, ptr %19, align 4, !tbaa !5
  %148 = add nsw i32 %147, -1
  store i32 %148, ptr %19, align 4, !tbaa !5
  br label %130, !llvm.loop !16

149:                                              ; preds = %133, %87
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 4}
!12 = !{!"_ZTS5Query", !6, i64 0, !6, i64 4}
!13 = !{!12, !6, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Query = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local local_unnamed_addr global i32, align 4
@mx = external dso_local local_unnamed_addr global i32, align 4
@low = external dso_local local_unnamed_addr global i32, align 4
@a = external dso_local local_unnamed_addr global [200001 x i32], align 16
@ans = external dso_local local_unnamed_addr global [200001 x i32], align 16
@e = external dso_local global [513 x %"class.std::vector"], align 16
@sub = external dso_local global [513 x %"class.std::vector"], align 16
@b = external dso_local local_unnamed_addr global [200001 x %struct.Query], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z3dfsii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = load i32, ptr @mx, align 4, !tbaa !5
  %8 = icmp eq i32 %7, %0
  br i1 %8, label %9, label %42

9:                                                ; preds = %2
  %10 = sext i32 %1 to i64
  %11 = getelementptr inbounds [513 x %"class.std::vector"], ptr @e, i64 0, i64 %10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %12 = tail call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  store ptr %12, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %13 = tail call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  store ptr %13, ptr %4, align 8
  %14 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  br i1 %14, label %.lr.ph49, label %._crit_edge50

._crit_edge50:                                    ; preds = %._crit_edge47, %9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  br label %.loopexit

.lr.ph49:                                         ; preds = %9, %._crit_edge47
  %15 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [200001 x %struct.Query], ptr @b, i64 0, i64 %17
  %19 = getelementptr inbounds i8, ptr %18, i64 4
  %20 = load i32, ptr %19, align 4, !tbaa !9
  %21 = load i32, ptr %18, align 8, !tbaa !11
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [513 x %"class.std::vector"], ptr @sub, i64 0, i64 %22
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %24 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #4
  store ptr %24, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %25 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #4
  store ptr %25, ptr %6, align 8
  %26 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  br i1 %26, label %.lr.ph46, label %._crit_edge47

._crit_edge47:                                    ; preds = %39, %.lr.ph49
  %.034.lcssa = phi i32 [ 0, %.lr.ph49 ], [ %.1, %39 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  %27 = getelementptr inbounds [200001 x i32], ptr @ans, i64 0, i64 %17
  store i32 %.034.lcssa, ptr %27, align 4, !tbaa !5
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  %29 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  br i1 %29, label %.lr.ph49, label %._crit_edge50

.lr.ph46:                                         ; preds = %.lr.ph49, %39
  %.03444 = phi i32 [ %.1, %39 ], [ 0, %.lr.ph49 ]
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = add nsw i32 %31, %20
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %.not38 = icmp sgt i32 %32, %33
  br i1 %.not38, label %39, label %34

34:                                               ; preds = %.lr.ph46
  %35 = sext i32 %32 to i64
  %36 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = xor i32 %37, %.03444
  br label %39

39:                                               ; preds = %34, %.lr.ph46
  %.1 = phi i32 [ %38, %34 ], [ %.03444, %.lr.ph46 ]
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  %41 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  br i1 %41, label %.lr.ph46, label %._crit_edge47

42:                                               ; preds = %2
  %43 = add nsw i32 %0, 1
  tail call void @_Z3dfsii(i32 noundef %43, i32 noundef %1)
  %44 = shl nuw i32 1, %0
  %45 = load i32, ptr @n, align 4, !tbaa !5
  %.not39.not = icmp slt i32 %44, %45
  br i1 %.not39.not, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %42
  %46 = add nuw nsw i32 %44, 1
  %47 = sext i32 %44 to i64
  %48 = sext i32 %45 to i64
  %49 = add nsw i64 %47, 2
  %50 = add nsw i64 %48, 1
  %smax58 = tail call i64 @llvm.smax.i64(i64 %49, i64 %50)
  %51 = xor i64 %47, -1
  %52 = add i64 %smax58, %51
  %min.iters.check = icmp ult i64 %52, 32
  br i1 %min.iters.check, label %.lr.ph.preheader102, label %vector.scevcheck

.lr.ph.preheader102:                              ; preds = %middle.block, %vector.memcheck, %vector.scevcheck, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 1, %vector.memcheck ], [ 1, %vector.scevcheck ], [ 1, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  %.ph = phi i32 [ %46, %vector.memcheck ], [ %46, %vector.scevcheck ], [ %46, %.lr.ph.preheader ], [ %ind.end59, %middle.block ]
  br label %.lr.ph

vector.scevcheck:                                 ; preds = %.lr.ph.preheader
  %53 = add nsw i64 %47, 2
  %54 = add nsw i64 %48, 1
  %smax = tail call i64 @llvm.smax.i64(i64 %53, i64 %54)
  %55 = add i64 %smax, -2
  %56 = sub i64 %55, %47
  %57 = trunc i64 %56 to i32
  %58 = add i32 %46, %57
  %59 = icmp sle i32 %58, %44
  %60 = icmp ugt i64 %56, 4294967295
  %61 = or i1 %59, %60
  br i1 %61, label %.lr.ph.preheader102, label %vector.memcheck

vector.memcheck:                                  ; preds = %vector.scevcheck
  %62 = add nsw i64 %47, 2
  %63 = add nsw i64 %48, 1
  %smax55 = tail call i64 @llvm.smax.i64(i64 %62, i64 %63)
  %64 = shl nsw i64 %47, 2
  %65 = sub i64 %smax55, %47
  %66 = shl i64 %65, 2
  %scevgep = getelementptr i8, ptr @a, i64 %66
  %67 = sext i32 %46 to i64
  %68 = shl nsw i64 %67, 2
  %scevgep56 = getelementptr i8, ptr @a, i64 %68
  %69 = add i64 %smax55, %67
  %70 = shl nsw i64 %69, 2
  %71 = add i64 %70, -4
  %72 = sub i64 %71, %64
  %scevgep57 = getelementptr i8, ptr @a, i64 %72
  %bound0 = icmp ugt ptr %scevgep57, getelementptr inbounds (i8, ptr @a, i64 4)
  %bound1 = icmp ult ptr %scevgep56, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %.lr.ph.preheader102, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %52, -8
  %ind.end = or disjoint i64 %n.vec, 1
  %.cast = trunc i64 %n.vec to i32
  %ind.end59 = add i32 %46, %.cast
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %.cast61 = trunc i64 %index to i32
  %offset.idx62 = add i32 %46, %.cast61
  %73 = sext i32 %offset.idx62 to i64
  %74 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %73
  %75 = getelementptr inbounds i8, ptr %74, i64 16
  %wide.load = load <4 x i32>, ptr %74, align 4, !tbaa !5, !alias.scope !12
  %wide.load63 = load <4 x i32>, ptr %75, align 4, !tbaa !5, !alias.scope !12
  %76 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %offset.idx
  %77 = getelementptr inbounds i8, ptr %76, i64 16
  %wide.load64 = load <4 x i32>, ptr %76, align 4, !tbaa !5, !alias.scope !15, !noalias !12
  %wide.load65 = load <4 x i32>, ptr %77, align 4, !tbaa !5, !alias.scope !15, !noalias !12
  %78 = xor <4 x i32> %wide.load64, %wide.load
  %79 = xor <4 x i32> %wide.load65, %wide.load63
  store <4 x i32> %78, ptr %76, align 4, !tbaa !5, !alias.scope !15, !noalias !12
  store <4 x i32> %79, ptr %77, align 4, !tbaa !5, !alias.scope !15, !noalias !12
  %index.next = add nuw i64 %index, 8
  %80 = icmp eq i64 %index.next, %n.vec
  br i1 %80, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %52, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader102

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %42
  %81 = load i32, ptr @low, align 4, !tbaa !5
  %82 = sub nsw i32 %0, %81
  %83 = shl nuw i32 1, %82
  %84 = or i32 %83, %1
  tail call void @_Z3dfsii(i32 noundef %43, i32 noundef %84)
  %85 = load i32, ptr @n, align 4, !tbaa !5
  %86 = sub nsw i32 %85, %44
  %87 = icmp sgt i32 %86, 0
  br i1 %87, label %.lr.ph43.preheader, label %.loopexit

.lr.ph43.preheader:                               ; preds = %._crit_edge
  %88 = zext nneg i32 %86 to i64
  %89 = sext i32 %44 to i64
  %min.iters.check81 = icmp ult i32 %86, 36
  br i1 %min.iters.check81, label %.lr.ph43.preheader101, label %vector.scevcheck66

.lr.ph43.preheader101:                            ; preds = %middle.block79, %vector.memcheck72, %vector.scevcheck66, %.lr.ph43.preheader
  %indvars.iv52.ph = phi i64 [ %88, %vector.memcheck72 ], [ %88, %vector.scevcheck66 ], [ %88, %.lr.ph43.preheader ], [ %ind.end85, %middle.block79 ]
  br label %.lr.ph43

vector.scevcheck66:                               ; preds = %.lr.ph43.preheader
  %90 = add nsw i64 %88, -1
  %91 = shl nuw nsw i64 %88, 2
  %scevgep67 = getelementptr i8, ptr @a, i64 %91
  %mul.result.neg = mul nsw i64 %90, -4
  %92 = getelementptr i8, ptr %scevgep67, i64 %mul.result.neg
  %93 = icmp ugt ptr %92, %scevgep67
  %94 = add nsw i64 %89, %88
  %95 = shl nsw i64 %94, 2
  %scevgep68 = getelementptr i8, ptr @a, i64 %95
  %mul.result70.neg = mul nsw i64 %90, -4
  %mul.overflow71 = icmp ugt i64 %90, 4611686018427387903
  %96 = getelementptr i8, ptr %scevgep68, i64 %mul.result70.neg
  %97 = icmp ugt ptr %96, %scevgep68
  %98 = or i1 %97, %mul.overflow71
  %99 = or i1 %93, %98
  br i1 %99, label %.lr.ph43.preheader101, label %vector.memcheck72

vector.memcheck72:                                ; preds = %vector.scevcheck66
  %100 = shl nuw nsw i64 %88, 2
  %101 = getelementptr i8, ptr @a, i64 %100
  %102 = shl nsw i64 %89, 2
  %103 = getelementptr i8, ptr @a, i64 %102
  %104 = add nsw i64 %89, %88
  %105 = shl nsw i64 %104, 2
  %106 = getelementptr i8, ptr @a, i64 %105
  %bound076 = icmp ugt ptr %106, @a
  %bound177 = icmp ult ptr %103, %101
  %found.conflict78 = and i1 %bound076, %bound177
  br i1 %found.conflict78, label %.lr.ph43.preheader101, label %vector.ph82

vector.ph82:                                      ; preds = %vector.memcheck72
  %n.vec84 = and i64 %88, 2147483640
  %ind.end85 = and i64 %88, 7
  br label %vector.body87

vector.body87:                                    ; preds = %vector.body87, %vector.ph82
  %index88 = phi i64 [ 0, %vector.ph82 ], [ %index.next99, %vector.body87 ]
  %offset.idx89 = sub i64 %88, %index88
  %107 = add nuw nsw i64 %offset.idx89, %89
  %108 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %107
  %109 = getelementptr inbounds i8, ptr %108, i64 -12
  %110 = getelementptr inbounds i8, ptr %108, i64 -28
  %wide.load90 = load <4 x i32>, ptr %109, align 4, !tbaa !5, !alias.scope !21
  %wide.load91 = load <4 x i32>, ptr %110, align 4, !tbaa !5, !alias.scope !21
  %111 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %offset.idx89
  %112 = getelementptr inbounds i8, ptr %111, i64 -12
  %113 = getelementptr inbounds i8, ptr %111, i64 -28
  %wide.load93 = load <4 x i32>, ptr %112, align 4, !tbaa !5, !alias.scope !24, !noalias !21
  %wide.load95 = load <4 x i32>, ptr %113, align 4, !tbaa !5, !alias.scope !24, !noalias !21
  %114 = xor <4 x i32> %wide.load93, %wide.load90
  %115 = xor <4 x i32> %wide.load95, %wide.load91
  store <4 x i32> %114, ptr %112, align 4, !tbaa !5, !alias.scope !24, !noalias !21
  store <4 x i32> %115, ptr %113, align 4, !tbaa !5, !alias.scope !24, !noalias !21
  %index.next99 = add nuw i64 %index88, 8
  %116 = icmp eq i64 %index.next99, %n.vec84
  br i1 %116, label %middle.block79, label %vector.body87, !llvm.loop !26

middle.block79:                                   ; preds = %vector.body87
  %cmp.n100 = icmp eq i64 %n.vec84, %88
  br i1 %cmp.n100, label %.loopexit, label %.lr.ph43.preheader101

.lr.ph:                                           ; preds = %.lr.ph.preheader102, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader102 ]
  %117 = phi i32 [ %125, %.lr.ph ], [ %.ph, %.lr.ph.preheader102 ]
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %indvars.iv
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = xor i32 %122, %120
  store i32 %123, ptr %121, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %124 = add nuw nsw i64 %indvars.iv.next, %47
  %.not = icmp sgt i64 %124, %48
  %125 = trunc nsw i64 %124 to i32
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !27

.lr.ph43:                                         ; preds = %.lr.ph43.preheader101, %.lr.ph43
  %indvars.iv52 = phi i64 [ %indvars.iv.next53, %.lr.ph43 ], [ %indvars.iv52.ph, %.lr.ph43.preheader101 ]
  %126 = add nuw nsw i64 %indvars.iv52, %89
  %127 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %indvars.iv52
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = xor i32 %130, %128
  store i32 %131, ptr %129, align 4, !tbaa !5
  %indvars.iv.next53 = add nsw i64 %indvars.iv52, -1
  %132 = icmp ugt i64 %indvars.iv52, 1
  br i1 %132, label %.lr.ph43, label %.loopexit, !llvm.loop !28

.loopexit:                                        ; preds = %.lr.ph43, %middle.block79, %._crit_edge, %._crit_edge50
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #3

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 4}
!10 = !{!"_ZTS5Query", !6, i64 0, !6, i64 4}
!11 = !{!10, !6, i64 0}
!12 = !{!13}
!13 = distinct !{!13, !14}
!14 = distinct !{!14, !"LVerDomain"}
!15 = !{!16}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !18, !19, !20}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = !{!22}
!22 = distinct !{!22, !23}
!23 = distinct !{!23, !"LVerDomain"}
!24 = !{!25}
!25 = distinct !{!25, !23}
!26 = distinct !{!26, !18, !19, !20}
!27 = distinct !{!27, !18, !19}
!28 = distinct !{!28, !18, !19}


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