; LLVM IR from ritikbanger/Hacktoberfest2022-DSA :: 28. Codechef Problems/CodeChef/CCSTART2 (Codechef_XOR Equal_PALINT)

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

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %152, %0
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = load i64, ptr %2, align 8, !tbaa !9
  %25 = icmp slt i64 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %21
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %155

27:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %30 = load i64, ptr %5, align 8, !tbaa !9
  %31 = add nsw i64 %30, 1
  %32 = call ptr @llvm.stacksave.p0()
  store ptr %32, ptr %7, align 8
  %33 = alloca i64, i64 %31, align 16
  store i64 %31, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %45, %27
  %35 = load i32, ptr %9, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = load i64, ptr %5, align 8, !tbaa !9
  %38 = icmp slt i64 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %34
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %48

40:                                               ; preds = %34
  %41 = load i32, ptr %9, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i64, ptr %33, i64 %42
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %43)
  br label %45

45:                                               ; preds = %40
  %46 = load i32, ptr %9, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %9, align 4, !tbaa !5
  br label %34, !llvm.loop !11

48:                                               ; preds = %39
  %49 = load i64, ptr %5, align 8, !tbaa !9
  %50 = getelementptr inbounds i64, ptr %33, i64 %49
  store i64 99999999999, ptr %50, align 8, !tbaa !9
  %51 = load i64, ptr %5, align 8, !tbaa !9
  %52 = add nsw i64 %51, 1
  %53 = getelementptr inbounds i64, ptr %33, i64 %52
  call void @_ZSt4sortIPlEvT_S1_(ptr noundef %33, ptr noundef %53)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 1, ptr %10, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 0, ptr %11, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %54 = getelementptr inbounds i64, ptr %33, i64 0
  %55 = load i64, ptr %54, align 16, !tbaa !9
  store i64 %55, ptr %12, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store i64 1, ptr %13, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %141, %48
  %57 = load i32, ptr %14, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = load i64, ptr %5, align 8, !tbaa !9
  %60 = icmp sle i64 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %56
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %144

62:                                               ; preds = %56
  %63 = load i32, ptr %14, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds i64, ptr %33, i64 %64
  %66 = load i64, ptr %65, align 8, !tbaa !9
  %67 = load i64, ptr %12, align 8, !tbaa !13
  %68 = icmp ne i64 %66, %67
  br i1 %68, label %69, label %137

69:                                               ; preds = %62
  %70 = load i64, ptr %13, align 8, !tbaa !13
  %71 = load i64, ptr %10, align 8, !tbaa !13
  %72 = icmp sge i64 %70, %71
  br i1 %72, label %73, label %75

73:                                               ; preds = %69
  %74 = load i64, ptr %13, align 8, !tbaa !13
  store i64 %74, ptr %10, align 8, !tbaa !13
  store i64 0, ptr %11, align 8, !tbaa !13
  br label %75

75:                                               ; preds = %73, %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %76 = load i64, ptr %6, align 8, !tbaa !9
  %77 = load i64, ptr %12, align 8, !tbaa !13
  %78 = xor i64 %76, %77
  store i64 %78, ptr %15, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %79 = load i64, ptr %5, align 8, !tbaa !9
  %80 = getelementptr inbounds i64, ptr %33, i64 %79
  %81 = getelementptr inbounds i64, ptr %80, i64 1
  %82 = call noundef ptr @_ZSt11lower_boundIPlxET_S1_S1_RKT0_(ptr noundef %33, ptr noundef %81, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %83 = ptrtoint ptr %82 to i64
  %84 = ptrtoint ptr %33 to i64
  %85 = sub i64 %83, %84
  %86 = sdiv exact i64 %85, 8
  store i64 %86, ptr %16, align 8, !tbaa !13
  %87 = load i64, ptr %16, align 8, !tbaa !13
  %88 = getelementptr inbounds i64, ptr %33, i64 %87
  %89 = load i64, ptr %88, align 8, !tbaa !9
  %90 = load i64, ptr %15, align 8, !tbaa !13
  %91 = icmp eq i64 %89, %90
  br i1 %91, label %92, label %132

92:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %93 = load i64, ptr %5, align 8, !tbaa !9
  %94 = getelementptr inbounds i64, ptr %33, i64 %93
  %95 = getelementptr inbounds i64, ptr %94, i64 1
  %96 = call noundef ptr @_ZSt11upper_boundIPlxET_S1_S1_RKT0_(ptr noundef %33, ptr noundef %95, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %97 = ptrtoint ptr %96 to i64
  %98 = ptrtoint ptr %33 to i64
  %99 = sub i64 %97, %98
  %100 = sdiv exact i64 %99, 8
  store i64 %100, ptr %17, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %101 = load i64, ptr %17, align 8, !tbaa !13
  %102 = load i64, ptr %16, align 8, !tbaa !13
  %103 = sub nsw i64 %101, %102
  store i64 %103, ptr %18, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %104 = load i64, ptr %18, align 8, !tbaa !13
  store i64 %104, ptr %19, align 8, !tbaa !13
  %105 = load i64, ptr %15, align 8, !tbaa !13
  %106 = load i64, ptr %12, align 8, !tbaa !13
  %107 = icmp ne i64 %105, %106
  br i1 %107, label %108, label %112

108:                                              ; preds = %92
  %109 = load i64, ptr %13, align 8, !tbaa !13
  %110 = load i64, ptr %19, align 8, !tbaa !13
  %111 = add nsw i64 %110, %109
  store i64 %111, ptr %19, align 8, !tbaa !13
  br label %112

112:                                              ; preds = %108, %92
  %113 = load i64, ptr %19, align 8, !tbaa !13
  %114 = load i64, ptr %10, align 8, !tbaa !13
  %115 = icmp sgt i64 %113, %114
  br i1 %115, label %116, label %119

116:                                              ; preds = %112
  %117 = load i64, ptr %19, align 8, !tbaa !13
  store i64 %117, ptr %10, align 8, !tbaa !13
  %118 = load i64, ptr %18, align 8, !tbaa !13
  store i64 %118, ptr %11, align 8, !tbaa !13
  br label %131

119:                                              ; preds = %112
  %120 = load i64, ptr %19, align 8, !tbaa !13
  %121 = load i64, ptr %10, align 8, !tbaa !13
  %122 = icmp eq i64 %120, %121
  br i1 %122, label %123, label %130

123:                                              ; preds = %119
  %124 = load i64, ptr %18, align 8, !tbaa !13
  %125 = load i64, ptr %11, align 8, !tbaa !13
  %126 = icmp slt i64 %124, %125
  br i1 %126, label %127, label %129

127:                                              ; preds = %123
  %128 = load i64, ptr %18, align 8, !tbaa !13
  store i64 %128, ptr %11, align 8, !tbaa !13
  br label %129

129:                                              ; preds = %127, %123
  br label %130

130:                                              ; preds = %129, %119
  br label %131

131:                                              ; preds = %130, %116
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %132

132:                                              ; preds = %131, %75
  store i64 1, ptr %13, align 8, !tbaa !13
  %133 = load i32, ptr %14, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds i64, ptr %33, i64 %134
  %136 = load i64, ptr %135, align 8, !tbaa !9
  store i64 %136, ptr %12, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %140

137:                                              ; preds = %62
  %138 = load i64, ptr %13, align 8, !tbaa !13
  %139 = add nsw i64 %138, 1
  store i64 %139, ptr %13, align 8, !tbaa !13
  br label %140

140:                                              ; preds = %137, %132
  br label %141

141:                                              ; preds = %140
  %142 = load i32, ptr %14, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %14, align 4, !tbaa !5
  br label %56, !llvm.loop !15

144:                                              ; preds = %61
  %145 = load i64, ptr %10, align 8, !tbaa !13
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %145)
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %146, ptr noundef @.str)
  %148 = load i64, ptr %11, align 8, !tbaa !13
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %147, i64 noundef %148)
  %150 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %149, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %151 = load ptr, ptr %7, align 8
  call void @llvm.stackrestore.p0(ptr %151)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %152

152:                                              ; preds = %144
  %153 = load i32, ptr %3, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %3, align 4, !tbaa !5
  br label %21, !llvm.loop !16

155:                                              ; preds = %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %156 = load i32, ptr %1, align 4
  ret i32 %156
}

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

; 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 @_ZSt4sortIPlEvT_S1_(ptr noundef, ptr noundef) #4

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2 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)) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

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 = { 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 #3 = { nocallback nofree nosync nounwind willreturn }
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 = { 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 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !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" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %5 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %6 = load i64, ptr %1, align 8, !tbaa !5
  %7 = icmp sgt i64 %6, 0
  br i1 %7, label %.lr.ph73, label %._crit_edge74

._crit_edge74:                                    ; preds = %._crit_edge68, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0

.lr.ph73:                                         ; preds = %0, %._crit_edge68
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %._crit_edge68 ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %10 = load i64, ptr %2, align 8, !tbaa !5
  %11 = add nsw i64 %10, 1
  %12 = call ptr @llvm.stacksave.p0()
  %13 = alloca i64, i64 %11, align 16
  %14 = load i64, ptr %2, align 8, !tbaa !5
  %15 = icmp sgt i64 %14, 0
  br i1 %15, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph73
  %.lcssa = phi i64 [ %14, %.lr.ph73 ], [ %23, %.lr.ph ]
  %16 = getelementptr inbounds i64, ptr %13, i64 %.lcssa
  store i64 99999999999, ptr %16, align 8, !tbaa !5
  %17 = getelementptr i8, ptr %16, i64 8
  call void @_ZSt4sortIPlEvT_S1_(ptr noundef nonnull %13, ptr noundef %17)
  %invariant.gep = getelementptr i8, ptr %13, i64 8
  %18 = load i64, ptr %2, align 8, !tbaa !5
  %.not60 = icmp slt i64 %18, 1
  br i1 %.not60, label %._crit_edge68, label %.lr.ph67

.lr.ph67:                                         ; preds = %._crit_edge
  %19 = load i64, ptr %13, align 16, !tbaa !5
  %20 = ptrtoint ptr %13 to i64
  br label %31

.lr.ph:                                           ; preds = %.lr.ph73, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph73 ]
  %21 = getelementptr inbounds i64, ptr %13, i64 %indvars.iv
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %21)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %23 = load i64, ptr %2, align 8, !tbaa !5
  %24 = icmp sgt i64 %23, %indvars.iv.next
  br i1 %24, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge68:                                    ; preds = %63, %._crit_edge
  %.042.lcssa = phi i64 [ 1, %._crit_edge ], [ %.446, %63 ]
  %.040.lcssa = phi i64 [ 0, %._crit_edge ], [ %.4, %63 ]
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.042.lcssa)
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull @.str)
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %26, i64 noundef %.040.lcssa)
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.stackrestore.p0(ptr %12)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %29 = load i64, ptr %1, align 8, !tbaa !5
  %30 = icmp sgt i64 %29, %indvars.iv.next81
  br i1 %30, label %.lr.ph73, label %._crit_edge74, !llvm.loop !11

31:                                               ; preds = %.lr.ph67, %63
  %32 = phi i64 [ %18, %.lr.ph67 ], [ %64, %63 ]
  %indvars.iv77 = phi i64 [ 1, %.lr.ph67 ], [ %indvars.iv.next78, %63 ]
  %.03764 = phi i64 [ 1, %.lr.ph67 ], [ %.1, %63 ]
  %.03863 = phi i64 [ %19, %.lr.ph67 ], [ %.139, %63 ]
  %.04062 = phi i64 [ 0, %.lr.ph67 ], [ %.4, %63 ]
  %.04261 = phi i64 [ 1, %.lr.ph67 ], [ %.446, %63 ]
  %33 = getelementptr inbounds i64, ptr %13, i64 %indvars.iv77
  %34 = load i64, ptr %33, align 8, !tbaa !5
  %.not51 = icmp eq i64 %34, %.03863
  br i1 %.not51, label %61, label %35

35:                                               ; preds = %31
  %.not52 = icmp slt i64 %.03764, %.04261
  %spec.select = call i64 @llvm.smax.i64(i64 %.03764, i64 %.04261)
  %spec.select54 = select i1 %.not52, i64 %.04062, i64 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %36 = load i64, ptr %3, align 8, !tbaa !5
  %37 = xor i64 %36, %.03863
  store i64 %37, ptr %4, align 8, !tbaa !12
  %gep = getelementptr i64, ptr %invariant.gep, i64 %32
  %38 = call noundef ptr @_ZSt11lower_boundIPlxET_S1_S1_RKT0_(ptr noundef nonnull %13, ptr noundef nonnull %gep, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %39 = ptrtoint ptr %38 to i64
  %40 = sub i64 %39, %20
  %41 = getelementptr inbounds i8, ptr %13, i64 %40
  %42 = load i64, ptr %41, align 8, !tbaa !5
  %43 = load i64, ptr %4, align 8, !tbaa !12
  %44 = icmp eq i64 %42, %43
  br i1 %44, label %45, label %59

45:                                               ; preds = %35
  %46 = ashr exact i64 %40, 3
  %47 = load i64, ptr %2, align 8, !tbaa !5
  %gep59 = getelementptr i64, ptr %invariant.gep, i64 %47
  %48 = call noundef ptr @_ZSt11upper_boundIPlxET_S1_S1_RKT0_(ptr noundef nonnull %13, ptr noundef nonnull %gep59, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %49 = ptrtoint ptr %48 to i64
  %50 = sub i64 %49, %20
  %51 = ashr exact i64 %50, 3
  %52 = sub nsw i64 %51, %46
  %53 = load i64, ptr %4, align 8, !tbaa !12
  %.not53 = icmp eq i64 %53, %.03863
  %54 = select i1 %.not53, i64 0, i64 %.03764
  %spec.select55 = add nsw i64 %52, %54
  %55 = icmp sgt i64 %spec.select55, %spec.select
  br i1 %55, label %59, label %56

56:                                               ; preds = %45
  %57 = icmp eq i64 %spec.select55, %spec.select
  %58 = call i64 @llvm.smin.i64(i64 %52, i64 %spec.select54)
  %spec.select56 = select i1 %57, i64 %58, i64 %spec.select54
  br label %59

59:                                               ; preds = %56, %45, %35
  %.345 = phi i64 [ %spec.select, %35 ], [ %spec.select55, %45 ], [ %spec.select, %56 ]
  %.3 = phi i64 [ %spec.select54, %35 ], [ %52, %45 ], [ %spec.select56, %56 ]
  %60 = load i64, ptr %33, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %.pre = load i64, ptr %2, align 8, !tbaa !5
  br label %63

61:                                               ; preds = %31
  %62 = add nsw i64 %.03764, 1
  br label %63

63:                                               ; preds = %59, %61
  %64 = phi i64 [ %.pre, %59 ], [ %32, %61 ]
  %.446 = phi i64 [ %.345, %59 ], [ %.04261, %61 ]
  %.4 = phi i64 [ %.3, %59 ], [ %.04062, %61 ]
  %.139 = phi i64 [ %60, %59 ], [ %.03863, %61 ]
  %.1 = phi i64 [ 1, %59 ], [ %62, %61 ]
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %.not.not = icmp sgt i64 %64, %indvars.iv77
  br i1 %.not.not, label %31, label %._crit_edge68, !llvm.loop !14
}

; 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 uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

; 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 @_ZSt4sortIPlEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

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

; 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 #2 align 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 #2 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)) #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
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 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}


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