; LLVM IR from TLE-MEC/Hack-CP-DSA :: Codechef/Remove One Element (solution)

; 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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z6binaryPxxx(ptr noundef, i64 noundef, i64 noundef) #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, 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 i64, align 8
  %15 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  br label %17

17:                                               ; preds = %191, %188, %0
  %18 = load i64, ptr %2, align 8, !tbaa !5
  %19 = add nsw i64 %18, -1
  store i64 %19, ptr %2, align 8, !tbaa !5
  %20 = icmp ne i64 %18, 0
  br i1 %20, label %21, label %192

21:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %23 = load i64, ptr %3, align 8, !tbaa !5
  %24 = call ptr @llvm.stacksave.p0()
  store ptr %24, ptr %4, align 8
  %25 = alloca i64, i64 %23, align 16
  store i64 %23, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 0, ptr %6, align 8, !tbaa !5
  br label %26

26:                                               ; preds = %35, %21
  %27 = load i64, ptr %6, align 8, !tbaa !5
  %28 = load i64, ptr %3, align 8, !tbaa !5
  %29 = icmp slt i64 %27, %28
  br i1 %29, label %31, label %30

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

31:                                               ; preds = %26
  %32 = load i64, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds i64, ptr %25, i64 %32
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %33)
  br label %35

35:                                               ; preds = %31
  %36 = load i64, ptr %6, align 8, !tbaa !5
  %37 = add nsw i64 %36, 1
  store i64 %37, ptr %6, align 8, !tbaa !5
  br label %26, !llvm.loop !9

38:                                               ; preds = %30
  %39 = load i64, ptr %3, align 8, !tbaa !5
  %40 = sub nsw i64 %39, 1
  %41 = alloca i64, i64 %40, align 16
  store i64 %40, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !5
  br label %42

42:                                               ; preds = %52, %38
  %43 = load i64, ptr %8, align 8, !tbaa !5
  %44 = load i64, ptr %3, align 8, !tbaa !5
  %45 = sub nsw i64 %44, 1
  %46 = icmp slt i64 %43, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %55

48:                                               ; preds = %42
  %49 = load i64, ptr %8, align 8, !tbaa !5
  %50 = getelementptr inbounds i64, ptr %41, i64 %49
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %50)
  br label %52

52:                                               ; preds = %48
  %53 = load i64, ptr %8, align 8, !tbaa !5
  %54 = add nsw i64 %53, 1
  store i64 %54, ptr %8, align 8, !tbaa !5
  br label %42, !llvm.loop !11

55:                                               ; preds = %47
  %56 = load i64, ptr %3, align 8, !tbaa !5
  %57 = getelementptr inbounds i64, ptr %25, i64 %56
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef %25, ptr noundef %57)
  %58 = load i64, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds i64, ptr %41, i64 %58
  %60 = getelementptr inbounds i64, ptr %59, i64 -1
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef %41, ptr noundef %60)
  %61 = load i64, ptr %3, align 8, !tbaa !5
  %62 = icmp eq i64 %61, 2
  br i1 %62, label %63, label %99

63:                                               ; preds = %55
  %64 = load i64, ptr %3, align 8, !tbaa !5
  %65 = sub nsw i64 %64, 2
  %66 = getelementptr inbounds i64, ptr %41, i64 %65
  %67 = load i64, ptr %66, align 8, !tbaa !5
  %68 = load i64, ptr %3, align 8, !tbaa !5
  %69 = sub nsw i64 %68, 1
  %70 = getelementptr inbounds i64, ptr %25, i64 %69
  %71 = load i64, ptr %70, align 8, !tbaa !5
  %72 = sub nsw i64 %67, %71
  %73 = icmp sgt i64 %72, 0
  br i1 %73, label %74, label %86

74:                                               ; preds = %63
  %75 = load i64, ptr %3, align 8, !tbaa !5
  %76 = sub nsw i64 %75, 2
  %77 = getelementptr inbounds i64, ptr %41, i64 %76
  %78 = load i64, ptr %77, align 8, !tbaa !5
  %79 = load i64, ptr %3, align 8, !tbaa !5
  %80 = sub nsw i64 %79, 1
  %81 = getelementptr inbounds i64, ptr %25, i64 %80
  %82 = load i64, ptr %81, align 8, !tbaa !5
  %83 = sub nsw i64 %78, %82
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %83)
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %84, i8 noundef signext 10)
  br label %98

86:                                               ; preds = %63
  %87 = load i64, ptr %3, align 8, !tbaa !5
  %88 = sub nsw i64 %87, 2
  %89 = getelementptr inbounds i64, ptr %41, i64 %88
  %90 = load i64, ptr %89, align 8, !tbaa !5
  %91 = load i64, ptr %3, align 8, !tbaa !5
  %92 = sub nsw i64 %91, 2
  %93 = getelementptr inbounds i64, ptr %25, i64 %92
  %94 = load i64, ptr %93, align 8, !tbaa !5
  %95 = sub nsw i64 %90, %94
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %95)
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %96, i8 noundef signext 10)
  br label %98

98:                                               ; preds = %86, %74
  store i32 2, ptr %9, align 4
  br label %188, !llvm.loop !12

99:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %100 = load i64, ptr %3, align 8, !tbaa !5
  %101 = sub nsw i64 %100, 2
  %102 = getelementptr inbounds i64, ptr %41, i64 %101
  %103 = load i64, ptr %102, align 8, !tbaa !5
  %104 = load i64, ptr %3, align 8, !tbaa !5
  %105 = sub nsw i64 %104, 1
  %106 = getelementptr inbounds i64, ptr %25, i64 %105
  %107 = load i64, ptr %106, align 8, !tbaa !5
  %108 = sub nsw i64 %103, %107
  store i64 %108, ptr %10, align 8, !tbaa !5
  %109 = load i64, ptr %10, align 8, !tbaa !5
  %110 = icmp sle i64 %109, 0
  br i1 %110, label %111, label %123

111:                                              ; preds = %99
  %112 = load i64, ptr %3, align 8, !tbaa !5
  %113 = sub nsw i64 %112, 2
  %114 = getelementptr inbounds i64, ptr %41, i64 %113
  %115 = load i64, ptr %114, align 8, !tbaa !5
  %116 = load i64, ptr %3, align 8, !tbaa !5
  %117 = sub nsw i64 %116, 2
  %118 = getelementptr inbounds i64, ptr %25, i64 %117
  %119 = load i64, ptr %118, align 8, !tbaa !5
  %120 = sub nsw i64 %115, %119
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %120)
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %121, i8 noundef signext 10)
  store i32 2, ptr %9, align 4
  br label %187, !llvm.loop !12

123:                                              ; preds = %99
  %124 = load i64, ptr %3, align 8, !tbaa !5
  %125 = sub nsw i64 %124, 1
  %126 = alloca i64, i64 %125, align 16
  store i64 %125, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 0, ptr %12, align 8, !tbaa !5
  br label %127

127:                                              ; preds = %141, %123
  %128 = load i64, ptr %12, align 8, !tbaa !5
  %129 = load i64, ptr %3, align 8, !tbaa !5
  %130 = sub nsw i64 %129, 1
  %131 = icmp slt i64 %128, %130
  br i1 %131, label %133, label %132

132:                                              ; preds = %127
  store i32 10, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %144

133:                                              ; preds = %127
  %134 = load i64, ptr %12, align 8, !tbaa !5
  %135 = getelementptr inbounds i64, ptr %41, i64 %134
  %136 = load i64, ptr %135, align 8, !tbaa !5
  %137 = load i64, ptr %10, align 8, !tbaa !5
  %138 = sub nsw i64 %136, %137
  %139 = load i64, ptr %12, align 8, !tbaa !5
  %140 = getelementptr inbounds i64, ptr %126, i64 %139
  store i64 %138, ptr %140, align 8, !tbaa !5
  br label %141

141:                                              ; preds = %133
  %142 = load i64, ptr %12, align 8, !tbaa !5
  %143 = add nsw i64 %142, 1
  store i64 %143, ptr %12, align 8, !tbaa !5
  br label %127, !llvm.loop !13

144:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store i64 1, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store i64 0, ptr %14, align 8, !tbaa !5
  br label %145

145:                                              ; preds = %175, %144
  %146 = load i64, ptr %14, align 8, !tbaa !5
  %147 = load i64, ptr %3, align 8, !tbaa !5
  %148 = sub nsw i64 %147, 1
  %149 = icmp slt i64 %146, %148
  br i1 %149, label %151, label %150

150:                                              ; preds = %145
  store i32 13, ptr %9, align 4
  br label %178

151:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %152 = load i64, ptr %3, align 8, !tbaa !5
  %153 = load i64, ptr %14, align 8, !tbaa !5
  %154 = getelementptr inbounds i64, ptr %126, i64 %153
  %155 = load i64, ptr %154, align 8, !tbaa !5
  %156 = call noundef i64 @_Z6binaryPxxx(ptr noundef %25, i64 noundef %152, i64 noundef %155)
  store i64 %156, ptr %15, align 8, !tbaa !5
  %157 = load i64, ptr %15, align 8, !tbaa !5
  %158 = icmp eq i64 %157, -1
  br i1 %158, label %159, label %171

159:                                              ; preds = %151
  store i64 0, ptr %13, align 8, !tbaa !5
  %160 = load i64, ptr %3, align 8, !tbaa !5
  %161 = sub nsw i64 %160, 2
  %162 = getelementptr inbounds i64, ptr %41, i64 %161
  %163 = load i64, ptr %162, align 8, !tbaa !5
  %164 = load i64, ptr %3, align 8, !tbaa !5
  %165 = sub nsw i64 %164, 2
  %166 = getelementptr inbounds i64, ptr %25, i64 %165
  %167 = load i64, ptr %166, align 8, !tbaa !5
  %168 = sub nsw i64 %163, %167
  %169 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %168)
  %170 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %169, i8 noundef signext 10)
  store i32 13, ptr %9, align 4
  br label %172

171:                                              ; preds = %151
  store i32 0, ptr %9, align 4
  br label %172

172:                                              ; preds = %171, %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  %173 = load i32, ptr %9, align 4
  switch i32 %173, label %178 [
    i32 0, label %174
  ]

174:                                              ; preds = %172
  br label %175

175:                                              ; preds = %174
  %176 = load i64, ptr %14, align 8, !tbaa !5
  %177 = add nsw i64 %176, 1
  store i64 %177, ptr %14, align 8, !tbaa !5
  br label %145, !llvm.loop !14

178:                                              ; preds = %172, %150
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %179

179:                                              ; preds = %178
  %180 = load i64, ptr %13, align 8, !tbaa !5
  %181 = icmp ne i64 %180, 0
  br i1 %181, label %182, label %186

182:                                              ; preds = %179
  %183 = load i64, ptr %10, align 8, !tbaa !5
  %184 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %183)
  %185 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %184, i8 noundef signext 10)
  br label %186

186:                                              ; preds = %182, %179
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  store i32 0, ptr %9, align 4
  br label %187

187:                                              ; preds = %186, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %188

188:                                              ; preds = %187, %98
  %189 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %189)
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  %190 = load i32, ptr %9, align 4
  switch i32 %190, label %194 [
    i32 0, label %191
    i32 2, label %17
  ]

191:                                              ; preds = %188
  br label %17, !llvm.loop !12

192:                                              ; preds = %17
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %193 = load i32, ptr %1, align 4
  ret i32 %193

194:                                              ; preds = %188
  unreachable
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

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

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

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


; 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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z6binaryPxxx(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %3 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %4 = load i64, ptr %1, align 8, !tbaa !5
  %5 = add nsw i64 %4, -1
  store i64 %5, ptr %1, align 8, !tbaa !5
  %.not48 = icmp eq i64 %4, 0
  br i1 %.not48, label %._crit_edge51, label %.lr.ph50

.lr.ph50:                                         ; preds = %0, %._crit_edge47
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %6 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %7 = load i64, ptr %2, align 8, !tbaa !5
  %8 = call ptr @llvm.stacksave.p0()
  %9 = alloca i64, i64 %7, align 16
  %10 = load i64, ptr %2, align 8, !tbaa !5
  %11 = icmp sgt i64 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %.lr.ph50
  %12 = add nsw i64 %10, -1
  %13 = alloca i64, i64 %12, align 16
  br label %._crit_edge40

._crit_edge:                                      ; preds = %.lr.ph
  %14 = add nsw i64 %20, -1
  %15 = alloca i64, i64 %14, align 16
  %16 = icmp sgt i64 %20, 1
  br i1 %16, label %.lr.ph39, label %._crit_edge40

.lr.ph:                                           ; preds = %.lr.ph50, %.lr.ph
  %.036 = phi i64 [ %19, %.lr.ph ], [ 0, %.lr.ph50 ]
  %17 = getelementptr inbounds i64, ptr %9, i64 %.036
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %19 = add nuw nsw i64 %.036, 1
  %20 = load i64, ptr %2, align 8, !tbaa !5
  %21 = icmp slt i64 %19, %20
  br i1 %21, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge40:                                    ; preds = %.lr.ph39, %._crit_edge.thread, %._crit_edge
  %22 = phi ptr [ %15, %._crit_edge ], [ %13, %._crit_edge.thread ], [ %15, %.lr.ph39 ]
  %.lcssa35 = phi i64 [ %20, %._crit_edge ], [ %10, %._crit_edge.thread ], [ %32, %.lr.ph39 ]
  %23 = getelementptr inbounds i64, ptr %9, i64 %.lcssa35
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef nonnull %9, ptr noundef nonnull %23)
  %24 = load i64, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds i64, ptr %22, i64 %24
  %26 = getelementptr inbounds i8, ptr %25, i64 -8
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef nonnull %22, ptr noundef nonnull %26)
  %27 = load i64, ptr %2, align 8, !tbaa !5
  %28 = icmp eq i64 %27, 2
  br i1 %28, label %35, label %45

.lr.ph39:                                         ; preds = %._crit_edge, %.lr.ph39
  %.02337 = phi i64 [ %31, %.lr.ph39 ], [ 0, %._crit_edge ]
  %29 = getelementptr inbounds i64, ptr %15, i64 %.02337
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %29)
  %31 = add nuw nsw i64 %.02337, 1
  %32 = load i64, ptr %2, align 8, !tbaa !5
  %33 = add nsw i64 %32, -1
  %34 = icmp slt i64 %31, %33
  br i1 %34, label %.lr.ph39, label %._crit_edge40, !llvm.loop !11

35:                                               ; preds = %._crit_edge40
  %36 = load i64, ptr %22, align 16, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %9, i64 8
  %38 = load i64, ptr %37, align 8, !tbaa !5
  %39 = icmp sgt i64 %36, %38
  br i1 %39, label %40, label %42

40:                                               ; preds = %35
  %41 = sub nsw i64 %36, %38
  br label %._crit_edge47, !llvm.loop !12

42:                                               ; preds = %35
  %43 = load i64, ptr %9, align 16, !tbaa !5
  %44 = sub nsw i64 %36, %43
  br label %._crit_edge47, !llvm.loop !12

45:                                               ; preds = %._crit_edge40
  %46 = add nsw i64 %27, -2
  %47 = getelementptr inbounds i64, ptr %22, i64 %46
  %48 = load i64, ptr %47, align 8, !tbaa !5
  %49 = add nsw i64 %27, -1
  %50 = getelementptr inbounds i64, ptr %9, i64 %49
  %51 = load i64, ptr %50, align 8, !tbaa !5
  %52 = sub nsw i64 %48, %51
  %53 = icmp slt i64 %52, 1
  br i1 %53, label %54, label %58

54:                                               ; preds = %45
  %55 = getelementptr inbounds i64, ptr %9, i64 %46
  %56 = load i64, ptr %55, align 8, !tbaa !5
  %57 = sub nsw i64 %48, %56
  br label %._crit_edge47, !llvm.loop !12

58:                                               ; preds = %45
  %59 = alloca i64, i64 %49, align 16
  %60 = icmp sgt i64 %27, 1
  br i1 %60, label %.lr.ph44.preheader, label %._crit_edge47

.lr.ph44.preheader:                               ; preds = %58
  %min.iters.check = icmp ult i64 %27, 5
  br i1 %min.iters.check, label %.lr.ph44.preheader58, label %vector.ph

.lr.ph44.preheader58:                             ; preds = %middle.block, %.lr.ph44.preheader
  %.02242.ph = phi i64 [ 0, %.lr.ph44.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph44

vector.ph:                                        ; preds = %.lr.ph44.preheader
  %n.vec = and i64 %49, -4
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %52, i64 0
  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %61 = getelementptr inbounds i64, ptr %22, i64 %index
  %62 = getelementptr inbounds i8, ptr %61, i64 16
  %wide.load = load <2 x i64>, ptr %61, align 16, !tbaa !5
  %wide.load57 = load <2 x i64>, ptr %62, align 16, !tbaa !5
  %63 = sub nsw <2 x i64> %wide.load, %broadcast.splat
  %64 = sub nsw <2 x i64> %wide.load57, %broadcast.splat
  %65 = getelementptr inbounds i64, ptr %59, i64 %index
  %66 = getelementptr inbounds i8, ptr %65, i64 16
  store <2 x i64> %63, ptr %65, align 16, !tbaa !5
  store <2 x i64> %64, ptr %66, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %67 = icmp eq i64 %index.next, %n.vec
  br i1 %67, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %49, %n.vec
  br i1 %cmp.n, label %.preheader, label %.lr.ph44.preheader58

.preheader:                                       ; preds = %.lr.ph44, %middle.block
  br i1 %60, label %.lr.ph46, label %._crit_edge47

.lr.ph44:                                         ; preds = %.lr.ph44.preheader58, %.lr.ph44
  %.02242 = phi i64 [ %72, %.lr.ph44 ], [ %.02242.ph, %.lr.ph44.preheader58 ]
  %68 = getelementptr inbounds i64, ptr %22, i64 %.02242
  %69 = load i64, ptr %68, align 8, !tbaa !5
  %70 = sub nsw i64 %69, %52
  %71 = getelementptr inbounds i64, ptr %59, i64 %.02242
  store i64 %70, ptr %71, align 8, !tbaa !5
  %72 = add nuw nsw i64 %.02242, 1
  %exitcond.not = icmp eq i64 %72, %49
  br i1 %exitcond.not, label %.preheader, label %.lr.ph44, !llvm.loop !16

73:                                               ; preds = %.lr.ph46
  %74 = add nuw nsw i64 %.02045, 1
  %75 = load i64, ptr %2, align 8, !tbaa !5
  %76 = add nsw i64 %75, -1
  %77 = icmp slt i64 %74, %76
  br i1 %77, label %.lr.ph46, label %._crit_edge47, !llvm.loop !17

.lr.ph46:                                         ; preds = %.preheader, %73
  %78 = phi i64 [ %75, %73 ], [ %27, %.preheader ]
  %.02045 = phi i64 [ %74, %73 ], [ 0, %.preheader ]
  %79 = getelementptr inbounds i64, ptr %59, i64 %.02045
  %80 = load i64, ptr %79, align 8, !tbaa !5
  %81 = call noundef i64 @_Z6binaryPxxx(ptr noundef nonnull %9, i64 noundef %78, i64 noundef %80)
  %.not29 = icmp eq i64 %81, -1
  br i1 %.not29, label %.thread32, label %73

.thread32:                                        ; preds = %.lr.ph46
  %82 = load i64, ptr %2, align 8, !tbaa !5
  %83 = add nsw i64 %82, -2
  %84 = getelementptr inbounds i64, ptr %22, i64 %83
  %85 = load i64, ptr %84, align 8, !tbaa !5
  %86 = getelementptr inbounds i64, ptr %9, i64 %83
  %87 = load i64, ptr %86, align 8, !tbaa !5
  %88 = sub nsw i64 %85, %87
  br label %._crit_edge47

._crit_edge47:                                    ; preds = %73, %.preheader, %58, %.thread32, %54, %40, %42
  %.sink55 = phi i64 [ %88, %.thread32 ], [ %57, %54 ], [ %41, %40 ], [ %44, %42 ], [ %52, %58 ], [ %52, %.preheader ], [ %52, %73 ]
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.sink55)
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %89, i8 noundef signext 10)
  call void @llvm.stackrestore.p0(ptr %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %91 = load i64, ptr %1, align 8, !tbaa !5
  %92 = add nsw i64 %91, -1
  store i64 %92, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %91, 0
  br i1 %.not, label %._crit_edge51, label %.lr.ph50

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #5

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

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

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 = { 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 #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 nosync nounwind willreturn }
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 = !{!"long 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 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !15, !14}
!17 = distinct !{!17, !10}


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