; LLVM IR from Izaron/ACM-ICPC :: Timus Online Judge/Volume 12/2110. Remove or Maximize.ll (Z2dpiii)

; 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 }
%"class.std::vector.0" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { [1563 x i64] }
%"class.std::bitset<100000>::reference" = type { ptr, i64 }
%"struct.std::_Bit_reference" = type { ptr, i64 }

@n = external dso_local global i32, align 4
@vec = external dso_local global %"class.std::vector", align 8
@cur_pow = external dso_local global i32, align 4
@can = external dso_local global %"class.std::vector.0", align 8
@avail = external dso_local global %"class.std::vector.0", align 8
@calced = external dso_local global [101 x [2 x %"class.std::bitset"]], align 16
@ctimer = external dso_local global [100000 x [101 x [2 x i16]]], align 16
@t = external dso_local global i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z2dpiii(i32 noundef %0, i32 noundef %1, i32 noundef %2) #0 {
  %4 = alloca i1, align 1
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %"class.std::bitset<100000>::reference", align 8
  %10 = alloca i32, align 4
  %11 = alloca i8, align 1
  %12 = alloca %"struct.std::_Bit_reference", align 8
  %13 = alloca i8, align 1
  %14 = alloca %"struct.std::_Bit_reference", align 8
  store i32 %0, ptr %5, align 4, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !5
  %15 = load i32, ptr %5, align 4, !tbaa !5
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = icmp eq i32 %15, %16
  br i1 %17, label %18, label %26

18:                                               ; preds = %3
  %19 = load i32, ptr %6, align 4, !tbaa !5
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %21, label %25

21:                                               ; preds = %18
  %22 = load i32, ptr %7, align 4, !tbaa !5
  %23 = icmp eq i32 %22, 1
  br i1 %23, label %24, label %25

24:                                               ; preds = %21
  store i1 true, ptr %4, align 1
  br label %143

25:                                               ; preds = %21, %18
  store i1 false, ptr %4, align 1
  br label %143

26:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %27 = load i32, ptr %5, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [100000 x [101 x [2 x i16]]], ptr @ctimer, i64 0, i64 %28
  %30 = load i32, ptr %6, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [101 x [2 x i16]], ptr %29, i64 0, i64 %31
  %33 = load i32, ptr %7, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [2 x i16], ptr %32, i64 0, i64 %34
  store ptr %35, ptr %8, align 8, !tbaa !9
  %36 = load ptr, ptr %8, align 8, !tbaa !9
  %37 = load i16, ptr %36, align 2, !tbaa !11
  %38 = sext i16 %37 to i32
  %39 = load i32, ptr @t, align 4, !tbaa !5
  %40 = icmp eq i32 %38, %39
  br i1 %40, label %41, label %51

41:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #3
  %42 = load i32, ptr %6, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [101 x [2 x %"class.std::bitset"]], ptr @calced, i64 0, i64 %43
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [2 x %"class.std::bitset"], ptr %44, i64 0, i64 %46
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  call void @_ZNSt6bitsetILm100000EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<100000>::reference") align 8 %9, ptr noundef nonnull align 8 dereferenceable(12504) %47, i64 noundef %49)
  %50 = call noundef zeroext i1 @_ZNKSt6bitsetILm100000EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %9) #3
  store i1 %50, ptr %4, align 1
  call void @_ZNSt6bitsetILm100000EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #3
  store i32 1, ptr %10, align 4
  br label %142

51:                                               ; preds = %26
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [101 x [2 x %"class.std::bitset"]], ptr @calced, i64 0, i64 %53
  %55 = load i32, ptr %7, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [2 x %"class.std::bitset"], ptr %54, i64 0, i64 %56
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = call noundef nonnull align 8 dereferenceable(12504) ptr @_ZNSt6bitsetILm100000EE3setEmb(ptr noundef nonnull align 8 dereferenceable(12504) %57, i64 noundef %59, i1 noundef zeroext false)
  br label %61

61:                                               ; preds = %51
  %62 = load i32, ptr @t, align 4, !tbaa !5
  %63 = trunc i32 %62 to i16
  %64 = load ptr, ptr %8, align 8, !tbaa !9
  store i16 %63, ptr %64, align 2, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #3
  store i8 0, ptr %11, align 1, !tbaa !13
  %65 = load i32, ptr %5, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vec, i64 noundef %66) #3
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = load i32, ptr @cur_pow, align 4, !tbaa !5
  %70 = and i32 %68, %69
  %71 = load i32, ptr @cur_pow, align 4, !tbaa !5
  %72 = icmp eq i32 %70, %71
  br i1 %72, label %73, label %80

73:                                               ; preds = %61
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = call noundef zeroext i1 @_Z2dpiii(i32 noundef %75, i32 noundef %76, i32 noundef 1)
  br i1 %77, label %78, label %79

78:                                               ; preds = %73
  store i8 1, ptr %11, align 1, !tbaa !13
  br label %79

79:                                               ; preds = %78, %73
  br label %88

80:                                               ; preds = %61
  %81 = load i32, ptr %5, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = call noundef zeroext i1 @_Z2dpiii(i32 noundef %82, i32 noundef %83, i32 noundef %84)
  br i1 %85, label %86, label %87

86:                                               ; preds = %80
  store i8 1, ptr %11, align 1, !tbaa !13
  br label %87

87:                                               ; preds = %86, %80
  br label %88

88:                                               ; preds = %87, %79
  %89 = load i32, ptr %6, align 4, !tbaa !5
  %90 = icmp sgt i32 %89, 0
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #3
  br i1 %90, label %91, label %100

91:                                               ; preds = %88
  %92 = load i32, ptr %5, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) @avail, i64 noundef %93)
  %95 = getelementptr inbounds { ptr, i64 }, ptr %12, i32 0, i32 0
  %96 = extractvalue { ptr, i64 } %94, 0
  store ptr %96, ptr %95, align 8
  %97 = getelementptr inbounds { ptr, i64 }, ptr %12, i32 0, i32 1
  %98 = extractvalue { ptr, i64 } %94, 1
  store i64 %98, ptr %97, align 8
  %99 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %12) #3
  br label %100

100:                                              ; preds = %91, %88
  %101 = phi i1 [ false, %88 ], [ %99, %91 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #3
  br i1 %101, label %102, label %126

102:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #3
  %103 = load i32, ptr %5, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  %105 = load i32, ptr %6, align 4, !tbaa !5
  %106 = sub nsw i32 %105, 1
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = call noundef zeroext i1 @_Z2dpiii(i32 noundef %104, i32 noundef %106, i32 noundef %107)
  %109 = zext i1 %108 to i8
  store i8 %109, ptr %13, align 1, !tbaa !13
  %110 = load i8, ptr %13, align 1, !tbaa !13, !range !15, !noundef !16
  %111 = trunc i8 %110 to i1
  br i1 %111, label %112, label %113

112:                                              ; preds = %102
  store i8 1, ptr %11, align 1, !tbaa !13
  br label %113

113:                                              ; preds = %112, %102
  %114 = load i8, ptr %13, align 1, !tbaa !13, !range !15, !noundef !16
  %115 = trunc i8 %114 to i1
  br i1 %115, label %116, label %125

116:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #3
  %117 = load i32, ptr %5, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) @can, i64 noundef %118)
  %120 = getelementptr inbounds { ptr, i64 }, ptr %14, i32 0, i32 0
  %121 = extractvalue { ptr, i64 } %119, 0
  store ptr %121, ptr %120, align 8
  %122 = getelementptr inbounds { ptr, i64 }, ptr %14, i32 0, i32 1
  %123 = extractvalue { ptr, i64 } %119, 1
  store i64 %123, ptr %122, align 8
  %124 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %14, i1 noundef zeroext true) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #3
  br label %125

125:                                              ; preds = %116, %113
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #3
  br label %126

126:                                              ; preds = %125, %100
  %127 = load i8, ptr %11, align 1, !tbaa !13, !range !15, !noundef !16
  %128 = trunc i8 %127 to i1
  br i1 %128, label %129, label %139

129:                                              ; preds = %126
  %130 = load i32, ptr %6, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [101 x [2 x %"class.std::bitset"]], ptr @calced, i64 0, i64 %131
  %133 = load i32, ptr %7, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [2 x %"class.std::bitset"], ptr %132, i64 0, i64 %134
  %136 = load i32, ptr %5, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = call noundef nonnull align 8 dereferenceable(12504) ptr @_ZNSt6bitsetILm100000EE3setEmb(ptr noundef nonnull align 8 dereferenceable(12504) %135, i64 noundef %137, i1 noundef zeroext true)
  br label %139

139:                                              ; preds = %129, %126
  %140 = load i8, ptr %11, align 1, !tbaa !13, !range !15, !noundef !16
  %141 = trunc i8 %140 to i1
  store i1 %141, ptr %4, align 1
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #3
  br label %142

142:                                              ; preds = %139, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  br label %143

143:                                              ; preds = %142, %25, %24
  %144 = load i1, ptr %4, align 1
  ret i1 %144
}

; 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 void @_ZNSt6bitsetILm100000EEixEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset<100000>::reference") align 8, ptr noundef nonnull align 8 dereferenceable(12504), i64 noundef) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm100000EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #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 uwtable
declare dso_local noundef nonnull align 8 dereferenceable(12504) ptr @_ZNSt6bitsetILm100000EE3setEmb(ptr noundef nonnull align 8 dereferenceable(12504), i64 noundef, i1 noundef zeroext) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) #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 = { 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, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}


; 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 }
%"class.std::vector.0" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { [1563 x i64] }
%"class.std::bitset<100000>::reference" = type { ptr, i64 }
%"struct.std::_Bit_reference" = type { ptr, i64 }

@n = external dso_local local_unnamed_addr global i32, align 4
@vec = external dso_local global %"class.std::vector", align 8
@cur_pow = external dso_local local_unnamed_addr global i32, align 4
@can = external dso_local global %"class.std::vector.0", align 8
@avail = external dso_local global %"class.std::vector.0", align 8
@calced = external dso_local global [101 x [2 x %"class.std::bitset"]], align 16
@ctimer = external dso_local local_unnamed_addr global [100000 x [101 x [2 x i16]]], align 16
@t = external dso_local local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z2dpiii(i32 noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = alloca %"class.std::bitset<100000>::reference", align 8
  %5 = alloca %"struct.std::_Bit_reference", align 8
  %6 = alloca %"struct.std::_Bit_reference", align 8
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = icmp eq i32 %7, %0
  br i1 %8, label %9, label %12

9:                                                ; preds = %3
  %10 = icmp eq i32 %1, 0
  %11 = icmp eq i32 %2, 1
  %or.cond = and i1 %10, %11
  br label %55

12:                                               ; preds = %3
  %13 = sext i32 %0 to i64
  %14 = sext i32 %1 to i64
  %15 = sext i32 %2 to i64
  %16 = getelementptr inbounds [100000 x [101 x [2 x i16]]], ptr @ctimer, i64 0, i64 %13, i64 %14, i64 %15
  %17 = load i16, ptr %16, align 2, !tbaa !9
  %18 = sext i16 %17 to i32
  %19 = load i32, ptr @t, align 4, !tbaa !5
  %20 = icmp eq i32 %19, %18
  br i1 %20, label %21, label %24

21:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #3
  %22 = getelementptr inbounds [101 x [2 x %"class.std::bitset"]], ptr @calced, i64 0, i64 %14, i64 %15
  call void @_ZNSt6bitsetILm100000EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<100000>::reference") align 8 %4, ptr noundef nonnull align 8 dereferenceable(12504) %22, i64 noundef %13)
  %23 = call noundef zeroext i1 @_ZNKSt6bitsetILm100000EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  call void @_ZNSt6bitsetILm100000EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  br label %55

24:                                               ; preds = %12
  %25 = getelementptr inbounds [101 x [2 x %"class.std::bitset"]], ptr @calced, i64 0, i64 %14, i64 %15
  %26 = tail call noundef nonnull align 8 dereferenceable(12504) ptr @_ZNSt6bitsetILm100000EE3setEmb(ptr noundef nonnull align 8 dereferenceable(12504) %25, i64 noundef %13, i1 noundef zeroext false)
  %27 = load i32, ptr @t, align 4, !tbaa !5
  %28 = trunc i32 %27 to i16
  store i16 %28, ptr %16, align 2, !tbaa !9
  %29 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vec, i64 noundef %13) #3
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = load i32, ptr @cur_pow, align 4, !tbaa !5
  %32 = and i32 %31, %30
  %33 = icmp eq i32 %32, %31
  %34 = add nsw i32 %0, 1
  %. = select i1 %33, i32 1, i32 %2
  %35 = tail call noundef zeroext i1 @_Z2dpiii(i32 noundef %34, i32 noundef %1, i32 noundef %.)
  %36 = icmp sgt i32 %1, 0
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #3
  br i1 %36, label %37, label %.critedge

37:                                               ; preds = %24
  %38 = tail call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) @avail, i64 noundef %13)
  %39 = extractvalue { ptr, i64 } %38, 0
  store ptr %39, ptr %5, align 8
  %40 = getelementptr inbounds i8, ptr %5, i64 8
  %41 = extractvalue { ptr, i64 } %38, 1
  store i64 %41, ptr %40, align 8
  %42 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %5) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  br i1 %42, label %43, label %52

43:                                               ; preds = %37
  %44 = add nsw i32 %0, 1
  %45 = add nsw i32 %1, -1
  %46 = call noundef zeroext i1 @_Z2dpiii(i32 noundef %44, i32 noundef %45, i32 noundef %2)
  br i1 %46, label %.critedge41, label %52

.critedge41:                                      ; preds = %43
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  %47 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) @can, i64 noundef %13)
  %48 = extractvalue { ptr, i64 } %47, 0
  store ptr %48, ptr %6, align 8
  %49 = getelementptr inbounds i8, ptr %6, i64 8
  %50 = extractvalue { ptr, i64 } %47, 1
  store i64 %50, ptr %49, align 8
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %6, i1 noundef zeroext true) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  br label %53

.critedge:                                        ; preds = %24
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  br label %52

52:                                               ; preds = %43, %.critedge, %37
  br i1 %35, label %53, label %55

53:                                               ; preds = %.critedge41, %52
  %54 = call noundef nonnull align 8 dereferenceable(12504) ptr @_ZNSt6bitsetILm100000EE3setEmb(ptr noundef nonnull align 8 dereferenceable(12504) %25, i64 noundef %13, i1 noundef zeroext true)
  br label %55

55:                                               ; preds = %21, %53, %52, %9
  %.1 = phi i1 [ %or.cond, %9 ], [ %23, %21 ], [ true, %53 ], [ false, %52 ]
  ret i1 %.1
}

; 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 void @_ZNSt6bitsetILm100000EEixEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset<100000>::reference") align 8, ptr noundef nonnull align 8 dereferenceable(12504), i64 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm100000EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 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 uwtable
declare dso_local noundef nonnull align 8 dereferenceable(12504) ptr @_ZNSt6bitsetILm100000EE3setEmb(ptr noundef nonnull align 8 dereferenceable(12504), i64 noundef, i1 noundef zeroext) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) local_unnamed_addr #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 = { mustprogress 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 = { 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 = !{!"short", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass