; LLVM IR from eyangch/competitive-programming :: Codeforces/1496 (b)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@T = external dso_local global i32, align 4
@N = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@a = external dso_local global [100000 x i32], align 16
@_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 i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %7 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %9
  %11 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  %12 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @T)
  br label %14

14:                                               ; preds = %101, %0
  %15 = load i32, ptr @T, align 4, !tbaa !8
  %16 = add nsw i32 %15, -1
  store i32 %16, ptr @T, align 4, !tbaa !8
  %17 = icmp ne i32 %15, 0
  br i1 %17, label %18, label %102

18:                                               ; preds = %14
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(4) @K)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !8
  br label %21

21:                                               ; preds = %31, %18
  %22 = load i32, ptr %2, align 4, !tbaa !8
  %23 = load i32, ptr @N, align 4, !tbaa !8
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %34

26:                                               ; preds = %21
  %27 = load i32, ptr %2, align 4, !tbaa !8
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %28
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %29)
  br label %31

31:                                               ; preds = %26
  %32 = load i32, ptr %2, align 4, !tbaa !8
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %2, align 4, !tbaa !8
  br label %21, !llvm.loop !11

34:                                               ; preds = %25
  %35 = load i32, ptr @N, align 4, !tbaa !8
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds i32, ptr @a, i64 %36
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @a, ptr noundef %37)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !8
  br label %38

38:                                               ; preds = %54, %34
  %39 = load i32, ptr %4, align 4, !tbaa !8
  %40 = load i32, ptr @N, align 4, !tbaa !8
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %57

43:                                               ; preds = %38
  %44 = load i32, ptr %4, align 4, !tbaa !8
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !8
  %48 = load i32, ptr %3, align 4, !tbaa !8
  %49 = icmp eq i32 %47, %48
  br i1 %49, label %50, label %53

50:                                               ; preds = %43
  %51 = load i32, ptr %3, align 4, !tbaa !8
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %3, align 4, !tbaa !8
  br label %53

53:                                               ; preds = %50, %43
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %4, align 4, !tbaa !8
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %4, align 4, !tbaa !8
  br label %38, !llvm.loop !13

57:                                               ; preds = %42
  %58 = load i32, ptr %3, align 4, !tbaa !8
  %59 = load i32, ptr @N, align 4, !tbaa !8
  %60 = sub nsw i32 %59, 1
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !8
  %64 = icmp sgt i32 %58, %63
  br i1 %64, label %65, label %71

65:                                               ; preds = %57
  %66 = load i32, ptr @N, align 4, !tbaa !8
  %67 = load i32, ptr @K, align 4, !tbaa !8
  %68 = add nsw i32 %66, %67
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %68)
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %69, ptr noundef @.str)
  br label %101

71:                                               ; preds = %57
  %72 = load i32, ptr @K, align 4, !tbaa !8
  %73 = icmp sgt i32 %72, 0
  br i1 %73, label %74, label %96

74:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %75 = load i32, ptr @N, align 4, !tbaa !8
  store i32 %75, ptr %5, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %76 = load i32, ptr %3, align 4, !tbaa !8
  %77 = load i32, ptr @N, align 4, !tbaa !8
  %78 = sub nsw i32 %77, 1
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !8
  %82 = add nsw i32 %76, %81
  %83 = add nsw i32 %82, 1
  %84 = sdiv i32 %83, 2
  store i32 %84, ptr %6, align 4, !tbaa !8
  %85 = load i32, ptr @N, align 4, !tbaa !8
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds i32, ptr @a, i64 %86
  %88 = call noundef zeroext i1 @_ZSt13binary_searchIPiiEbT_S1_RKT0_(ptr noundef @a, ptr noundef %87, ptr noundef nonnull align 4 dereferenceable(4) %6)
  br i1 %88, label %92, label %89

89:                                               ; preds = %74
  %90 = load i32, ptr %5, align 4, !tbaa !8
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %5, align 4, !tbaa !8
  br label %92

92:                                               ; preds = %89, %74
  %93 = load i32, ptr %5, align 4, !tbaa !8
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %93)
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %94, ptr noundef @.str)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %100

96:                                               ; preds = %71
  %97 = load i32, ptr @N, align 4, !tbaa !8
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %97)
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %98, ptr noundef @.str)
  br label %100

100:                                              ; preds = %96, %92
  br label %101

101:                                              ; preds = %100, %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %14, !llvm.loop !14

102:                                              ; preds = %14
  %103 = load i32, ptr %1, align 4
  ret i32 %103
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZSt13binary_searchIPiiEbT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@T = external dso_local global i32, align 4
@N = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@a = external dso_local global [100000 x i32], align 16
@_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 i32, align 4
  %2 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %3 = getelementptr i8, ptr %2, i64 -24
  %4 = load i64, ptr %3, align 8
  %5 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %4
  %6 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %5, ptr noundef null)
  %7 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @T)
  %9 = load i32, ptr @T, align 4, !tbaa !8
  %10 = add nsw i32 %9, -1
  store i32 %10, ptr @T, align 4, !tbaa !8
  %.not28 = icmp eq i32 %9, 0
  br i1 %.not28, label %._crit_edge31, label %.lr.ph30

.lr.ph30:                                         ; preds = %0, %69
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(4) @K)
  %13 = load i32, ptr @N, align 4, !tbaa !8
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph, label %.lr.ph30.._crit_edge_crit_edge

.lr.ph30.._crit_edge_crit_edge:                   ; preds = %.lr.ph30
  %.pre = sext i32 %13 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph30.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.lr.ph30.._crit_edge_crit_edge ], [ %22, %.lr.ph ]
  %15 = getelementptr inbounds i32, ptr @a, i64 %.pre-phi
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @a, ptr noundef nonnull %15)
  %16 = load i32, ptr @N, align 4, !tbaa !8
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph24.preheader, label %._crit_edge25

.lr.ph24.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %16 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %18 = icmp ult i32 %16, 4
  br i1 %18, label %._crit_edge25.loopexit.unr-lcssa, label %.lr.ph24.preheader.new

.lr.ph24.preheader.new:                           ; preds = %.lr.ph24.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %.lr.ph24

.lr.ph:                                           ; preds = %.lr.ph30, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph30 ]
  %19 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %19)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %21 = load i32, ptr @N, align 4, !tbaa !8
  %22 = sext i32 %21 to i64
  %23 = icmp slt i64 %indvars.iv.next, %22
  br i1 %23, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge25.loopexit.unr-lcssa:                 ; preds = %.lr.ph24, %.lr.ph24.preheader
  %spec.select.lcssa.ph = phi i32 [ poison, %.lr.ph24.preheader ], [ %spec.select.3, %.lr.ph24 ]
  %indvars.iv34.unr = phi i64 [ 0, %.lr.ph24.preheader ], [ %indvars.iv.next35.3, %.lr.ph24 ]
  %.01421.unr = phi i32 [ 0, %.lr.ph24.preheader ], [ %spec.select.3, %.lr.ph24 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge25, label %.lr.ph24.epil

.lr.ph24.epil:                                    ; preds = %._crit_edge25.loopexit.unr-lcssa, %.lr.ph24.epil
  %indvars.iv34.epil = phi i64 [ %indvars.iv.next35.epil, %.lr.ph24.epil ], [ %indvars.iv34.unr, %._crit_edge25.loopexit.unr-lcssa ]
  %.01421.epil = phi i32 [ %spec.select.epil, %.lr.ph24.epil ], [ %.01421.unr, %._crit_edge25.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph24.epil ], [ 0, %._crit_edge25.loopexit.unr-lcssa ]
  %24 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv34.epil
  %25 = load i32, ptr %24, align 4, !tbaa !8
  %26 = icmp eq i32 %25, %.01421.epil
  %27 = zext i1 %26 to i32
  %spec.select.epil = add nuw nsw i32 %.01421.epil, %27
  %indvars.iv.next35.epil = add nuw nsw i64 %indvars.iv34.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge25, label %.lr.ph24.epil, !llvm.loop !13

._crit_edge25:                                    ; preds = %._crit_edge25.loopexit.unr-lcssa, %.lr.ph24.epil, %._crit_edge
  %.014.lcssa = phi i32 [ 0, %._crit_edge ], [ %spec.select.lcssa.ph, %._crit_edge25.loopexit.unr-lcssa ], [ %spec.select.epil, %.lr.ph24.epil ]
  %28 = add nsw i32 %16, -1
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !8
  %32 = icmp sgt i32 %.014.lcssa, %31
  %33 = load i32, ptr @K, align 4, !tbaa !8
  br i1 %32, label %50, label %54

.lr.ph24:                                         ; preds = %.lr.ph24, %.lr.ph24.preheader.new
  %indvars.iv34 = phi i64 [ 0, %.lr.ph24.preheader.new ], [ %indvars.iv.next35.3, %.lr.ph24 ]
  %.01421 = phi i32 [ 0, %.lr.ph24.preheader.new ], [ %spec.select.3, %.lr.ph24 ]
  %niter = phi i64 [ 0, %.lr.ph24.preheader.new ], [ %niter.next.3, %.lr.ph24 ]
  %34 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv34
  %35 = load i32, ptr %34, align 16, !tbaa !8
  %36 = icmp eq i32 %35, %.01421
  %37 = zext i1 %36 to i32
  %spec.select = add nuw nsw i32 %.01421, %37
  %indvars.iv.next35 = or disjoint i64 %indvars.iv34, 1
  %38 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv.next35
  %39 = load i32, ptr %38, align 4, !tbaa !8
  %40 = icmp eq i32 %39, %spec.select
  %41 = zext i1 %40 to i32
  %spec.select.1 = add nuw nsw i32 %spec.select, %41
  %indvars.iv.next35.1 = or disjoint i64 %indvars.iv34, 2
  %42 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv.next35.1
  %43 = load i32, ptr %42, align 8, !tbaa !8
  %44 = icmp eq i32 %43, %spec.select.1
  %45 = zext i1 %44 to i32
  %spec.select.2 = add nuw nsw i32 %spec.select.1, %45
  %indvars.iv.next35.2 = or disjoint i64 %indvars.iv34, 3
  %46 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv.next35.2
  %47 = load i32, ptr %46, align 4, !tbaa !8
  %48 = icmp eq i32 %47, %spec.select.2
  %49 = zext i1 %48 to i32
  %spec.select.3 = add nuw nsw i32 %spec.select.2, %49
  %indvars.iv.next35.3 = add nuw nsw i64 %indvars.iv34, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge25.loopexit.unr-lcssa, label %.lr.ph24, !llvm.loop !15

50:                                               ; preds = %._crit_edge25
  %51 = add nsw i32 %33, %16
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %51)
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef nonnull @.str)
  br label %69

54:                                               ; preds = %._crit_edge25
  %55 = icmp sgt i32 %33, 0
  br i1 %55, label %56, label %66

56:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %57 = add i32 %.014.lcssa, 1
  %58 = add i32 %57, %31
  %59 = sdiv i32 %58, 2
  store i32 %59, ptr %1, align 4, !tbaa !8
  %60 = sext i32 %16 to i64
  %61 = getelementptr inbounds i32, ptr @a, i64 %60
  %62 = call noundef zeroext i1 @_ZSt13binary_searchIPiiEbT_S1_RKT0_(ptr noundef nonnull @a, ptr noundef nonnull %61, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %not. = xor i1 %62, true
  %63 = zext i1 %not. to i32
  %spec.select18 = add nsw i32 %16, %63
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %spec.select18)
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef nonnull @.str)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  br label %69

66:                                               ; preds = %54
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %16)
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %67, ptr noundef nonnull @.str)
  br label %69

69:                                               ; preds = %56, %66, %50
  %70 = load i32, ptr @T, align 4, !tbaa !8
  %71 = add nsw i32 %70, -1
  store i32 %71, ptr @T, align 4, !tbaa !8
  %.not = icmp eq i32 %70, 0
  br i1 %.not, label %._crit_edge31, label %.lr.ph30, !llvm.loop !16

._crit_edge31:                                    ; preds = %69, %0
  ret i32 0
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) 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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZSt13binary_searchIPiiEbT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


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