; LLVM IR from ShahjalalShohag/code-library :: Miscellaneous (Bitset Custom)

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

%struct.Bitset = type { [3126 x i64] }
%"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" }

@ans = external dso_local global [200009 x i32], align 16
@bs = external dso_local global [101 x %struct.Bitset], align 16
@nw = external dso_local global %struct.Bitset, align 8
@t = external dso_local global %struct.Bitset, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4initv() #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 i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.Bitset, align 8
  %12 = alloca %struct.Bitset, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %16 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %17 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %18 = getelementptr i8, ptr %17, i64 -24
  %19 = load i64, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %19
  %21 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %20, ptr noundef null)
  call void @_Z4initv()
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !8
  br label %23

23:                                               ; preds = %34, %0
  %24 = load i32, ptr %3, align 4, !tbaa !8
  %25 = load i32, ptr %2, align 4, !tbaa !8
  %26 = icmp sle i32 %24, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %37

28:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %30 = load i32, ptr %4, align 4, !tbaa !8
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [101 x %struct.Bitset], ptr @bs, i64 0, i64 %31
  %33 = load i32, ptr %3, align 4, !tbaa !8
  call void @_ZN6BitsetILi200009EE3setEi(ptr noundef nonnull align 8 dereferenceable(25008) %32, i32 noundef %33)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %34

34:                                               ; preds = %28
  %35 = load i32, ptr %3, align 4, !tbaa !8
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %3, align 4, !tbaa !8
  br label %23, !llvm.loop !11

37:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
  br label %39

39:                                               ; preds = %71, %69, %37
  %40 = load i32, ptr %5, align 4, !tbaa !8
  %41 = add nsw i32 %40, -1
  store i32 %41, ptr %5, align 4, !tbaa !8
  %42 = icmp ne i32 %40, 0
  br i1 %42, label %43, label %72

43:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %44, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %45, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %46, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %48 = load i32, ptr %8, align 4, !tbaa !8
  %49 = load i32, ptr %9, align 4, !tbaa !8
  %50 = icmp eq i32 %48, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %43
  store i32 5, ptr %10, align 4
  br label %69, !llvm.loop !13

52:                                               ; preds = %43
  call void @_ZN6BitsetILi200009EE5resetEv(ptr noundef nonnull align 8 dereferenceable(25008) @nw)
  %53 = load i32, ptr %6, align 4, !tbaa !8
  %54 = load i32, ptr %7, align 4, !tbaa !8
  call void @_ZN6BitsetILi200009EE3setEii(ptr noundef nonnull align 8 dereferenceable(25008) @nw, i32 noundef %53, i32 noundef %54)
  call void @llvm.lifetime.start.p0(i64 25008, ptr %11) #6
  %55 = load i32, ptr %8, align 4, !tbaa !8
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [101 x %struct.Bitset], ptr @bs, i64 0, i64 %56
  call void @_ZNK6BitsetILi200009EEanERKS0_(ptr dead_on_unwind writable sret(%struct.Bitset) align 8 %11, ptr noundef nonnull align 8 dereferenceable(25008) %57, ptr noundef nonnull align 8 dereferenceable(25008) @nw)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @t, ptr align 8 %11, i64 25008, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 25008, ptr %11) #6
  %58 = load i32, ptr %8, align 4, !tbaa !8
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [101 x %struct.Bitset], ptr @bs, i64 0, i64 %59
  %61 = load i32, ptr %6, align 4, !tbaa !8
  %62 = load i32, ptr %7, align 4, !tbaa !8
  call void @_ZN6BitsetILi200009EE5resetEii(ptr noundef nonnull align 8 dereferenceable(25008) %60, i32 noundef %61, i32 noundef %62)
  call void @llvm.lifetime.start.p0(i64 25008, ptr %12) #6
  %63 = load i32, ptr %9, align 4, !tbaa !8
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [101 x %struct.Bitset], ptr @bs, i64 0, i64 %64
  call void @_ZNK6BitsetILi200009EEorERKS0_(ptr dead_on_unwind writable sret(%struct.Bitset) align 8 %12, ptr noundef nonnull align 8 dereferenceable(25008) %65, ptr noundef nonnull align 8 dereferenceable(25008) @t)
  %66 = load i32, ptr %9, align 4, !tbaa !8
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [101 x %struct.Bitset], ptr @bs, i64 0, i64 %67
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %68, ptr align 8 %12, i64 25008, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 25008, ptr %12) #6
  store i32 0, ptr %10, align 4
  br label %69

69:                                               ; preds = %52, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %70 = load i32, ptr %10, align 4
  switch i32 %70, label %123 [
    i32 0, label %71
    i32 5, label %39
  ]

71:                                               ; preds = %69
  br label %39, !llvm.loop !13

72:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 1, ptr %13, align 4, !tbaa !8
  br label %73

73:                                               ; preds = %96, %72
  %74 = load i32, ptr %13, align 4, !tbaa !8
  %75 = icmp sle i32 %74, 100
  br i1 %75, label %77, label %76

76:                                               ; preds = %73
  store i32 7, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %99

77:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %78 = load i32, ptr %13, align 4, !tbaa !8
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [101 x %struct.Bitset], ptr @bs, i64 0, i64 %79
  %81 = call noundef i32 @_ZN6BitsetILi200009EE11_Find_firstEv(ptr noundef nonnull align 8 dereferenceable(25008) %80)
  store i32 %81, ptr %14, align 4, !tbaa !8
  br label %82

82:                                               ; preds = %85, %77
  %83 = load i32, ptr %14, align 4, !tbaa !8
  %84 = icmp slt i32 %83, 200009
  br i1 %84, label %85, label %95

85:                                               ; preds = %82
  %86 = load i32, ptr %13, align 4, !tbaa !8
  %87 = load i32, ptr %14, align 4, !tbaa !8
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [200009 x i32], ptr @ans, i64 0, i64 %88
  store i32 %86, ptr %89, align 4, !tbaa !8
  %90 = load i32, ptr %13, align 4, !tbaa !8
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [101 x %struct.Bitset], ptr @bs, i64 0, i64 %91
  %93 = load i32, ptr %14, align 4, !tbaa !8
  %94 = call noundef i32 @_ZN6BitsetILi200009EE10_Find_nextEi(ptr noundef nonnull align 8 dereferenceable(25008) %92, i32 noundef %93)
  store i32 %94, ptr %14, align 4, !tbaa !8
  br label %82, !llvm.loop !16

95:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %13, align 4, !tbaa !8
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %13, align 4, !tbaa !8
  br label %73, !llvm.loop !17

99:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 1, ptr %15, align 4, !tbaa !8
  br label %100

100:                                              ; preds = %118, %99
  %101 = load i32, ptr %15, align 4, !tbaa !8
  %102 = load i32, ptr %2, align 4, !tbaa !8
  %103 = icmp sle i32 %101, %102
  br i1 %103, label %105, label %104

104:                                              ; preds = %100
  store i32 12, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %121

105:                                              ; preds = %100
  %106 = load i32, ptr %15, align 4, !tbaa !8
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [200009 x i32], ptr @ans, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !8
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %109)
  %111 = load i32, ptr %15, align 4, !tbaa !8
  %112 = load i32, ptr %2, align 4, !tbaa !8
  %113 = icmp eq i32 %111, %112
  %114 = zext i1 %113 to i64
  %115 = getelementptr inbounds [3 x i8], ptr @.str, i64 0, i64 %114
  %116 = load i8, ptr %115, align 1, !tbaa !15
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %110, i8 noundef signext %116)
  br label %118

118:                                              ; preds = %105
  %119 = load i32, ptr %15, align 4, !tbaa !8
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %15, align 4, !tbaa !8
  br label %100, !llvm.loop !18

121:                                              ; preds = %104
  store i32 0, ptr %1, align 4
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %122 = load i32, ptr %1, align 4
  ret i32 %122

123:                                              ; preds = %69
  unreachable
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6BitsetILi200009EE3setEi(ptr noundef nonnull align 8 dereferenceable(25008), i32 noundef) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6BitsetILi200009EE3setEii(ptr noundef nonnull align 8 dereferenceable(25008), i32 noundef, i32 noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK6BitsetILi200009EEanERKS0_(ptr dead_on_unwind noalias writable sret(%struct.Bitset) align 8, ptr noundef nonnull align 8 dereferenceable(25008), ptr noundef nonnull align 8 dereferenceable(25008)) #4 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6BitsetILi200009EE5resetEii(ptr noundef nonnull align 8 dereferenceable(25008), i32 noundef, i32 noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK6BitsetILi200009EEorERKS0_(ptr dead_on_unwind noalias writable sret(%struct.Bitset) align 8, ptr noundef nonnull align 8 dereferenceable(25008), ptr noundef nonnull align 8 dereferenceable(25008)) #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6BitsetILi200009EE10_Find_nextEi(ptr noundef nonnull align 8 dereferenceable(25008), i32 noundef) #0 align 2

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { "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 = { 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 nounwind willreturn memory(argmem: readwrite) }
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 = !{i64 0, i64 25008, !15}
!15 = !{!10, !10, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !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"

%struct.Bitset = type { [3126 x i64] }
%"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" }

@ans = external dso_local local_unnamed_addr global [200009 x i32], align 16
@bs = external dso_local global [101 x %struct.Bitset], align 16
@nw = external dso_local global %struct.Bitset, align 8
@t = external dso_local global %struct.Bitset, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4initv() 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 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
  %7 = alloca i32, align 4
  %8 = alloca %struct.Bitset, align 8
  %9 = alloca %struct.Bitset, align 8
  %10 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %11 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %12 = getelementptr i8, ptr %11, i64 -24
  %13 = load i64, ptr %12, align 8
  %14 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %13
  %15 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %14, ptr noundef null)
  tail call void @_Z4initv()
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %17 = load i32, ptr %1, align 4, !tbaa !8
  %.not22 = icmp slt i32 %17, 1
  br i1 %.not22, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %19 = load i32, ptr %3, align 4, !tbaa !8
  %20 = add nsw i32 %19, -1
  store i32 %20, ptr %3, align 4, !tbaa !8
  %.not1924 = icmp eq i32 %19, 0
  br i1 %.not1924, label %.preheader21.preheader, label %.lr.ph26

.preheader21.preheader:                           ; preds = %51, %._crit_edge
  br label %.preheader21

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.01823 = phi i32 [ %25, %.lr.ph ], [ 1, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %22 = load i32, ptr %2, align 4, !tbaa !8
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [101 x %struct.Bitset], ptr @bs, i64 0, i64 %23
  call void @_ZN6BitsetILi200009EE3setEi(ptr noundef nonnull align 8 dereferenceable(25008) %24, i32 noundef %.01823)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %25 = add nuw nsw i32 %.01823, 1
  %26 = load i32, ptr %1, align 4, !tbaa !8
  %.not.not = icmp slt i32 %.01823, %26
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.lr.ph26:                                         ; preds = %._crit_edge, %51
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %31 = load i32, ptr %6, align 4, !tbaa !8
  %32 = load i32, ptr %7, align 4, !tbaa !8
  %33 = icmp eq i32 %31, %32
  br i1 %33, label %51, label %34, !llvm.loop !13

34:                                               ; preds = %.lr.ph26
  call void @_ZN6BitsetILi200009EE5resetEv(ptr noundef nonnull align 8 dereferenceable(25008) @nw)
  %35 = load i32, ptr %4, align 4, !tbaa !8
  %36 = load i32, ptr %5, align 4, !tbaa !8
  call void @_ZN6BitsetILi200009EE3setEii(ptr noundef nonnull align 8 dereferenceable(25008) @nw, i32 noundef %35, i32 noundef %36)
  call void @llvm.lifetime.start.p0(i64 25008, ptr nonnull %8) #6
  %37 = load i32, ptr %6, align 4, !tbaa !8
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [101 x %struct.Bitset], ptr @bs, i64 0, i64 %38
  call void @_ZNK6BitsetILi200009EEanERKS0_(ptr dead_on_unwind nonnull writable sret(%struct.Bitset) align 8 %8, ptr noundef nonnull align 8 dereferenceable(25008) %39, ptr noundef nonnull align 8 dereferenceable(25008) @nw)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(25008) @t, ptr noundef nonnull align 8 dereferenceable(25008) %8, i64 25008, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 25008, ptr nonnull %8) #6
  %40 = load i32, ptr %6, align 4, !tbaa !8
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [101 x %struct.Bitset], ptr @bs, i64 0, i64 %41
  %43 = load i32, ptr %4, align 4, !tbaa !8
  %44 = load i32, ptr %5, align 4, !tbaa !8
  call void @_ZN6BitsetILi200009EE5resetEii(ptr noundef nonnull align 8 dereferenceable(25008) %42, i32 noundef %43, i32 noundef %44)
  call void @llvm.lifetime.start.p0(i64 25008, ptr nonnull %9) #6
  %45 = load i32, ptr %7, align 4, !tbaa !8
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [101 x %struct.Bitset], ptr @bs, i64 0, i64 %46
  call void @_ZNK6BitsetILi200009EEorERKS0_(ptr dead_on_unwind nonnull writable sret(%struct.Bitset) align 8 %9, ptr noundef nonnull align 8 dereferenceable(25008) %47, ptr noundef nonnull align 8 dereferenceable(25008) @t)
  %48 = load i32, ptr %7, align 4, !tbaa !8
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [101 x %struct.Bitset], ptr @bs, i64 0, i64 %49
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(25008) %50, ptr noundef nonnull align 8 dereferenceable(25008) %9, i64 25008, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 25008, ptr nonnull %9) #6
  br label %51

51:                                               ; preds = %.lr.ph26, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %52 = load i32, ptr %3, align 4, !tbaa !8
  %53 = add nsw i32 %52, -1
  store i32 %53, ptr %3, align 4, !tbaa !8
  %.not19 = icmp eq i32 %52, 0
  br i1 %.not19, label %.preheader21.preheader, label %.lr.ph26

.preheader:                                       ; preds = %._crit_edge30
  %54 = load i32, ptr %1, align 4, !tbaa !8
  %.not2032 = icmp slt i32 %54, 1
  br i1 %.not2032, label %._crit_edge35, label %.lr.ph34

.preheader21:                                     ; preds = %.preheader21.preheader, %._crit_edge30
  %indvars.iv = phi i64 [ %indvars.iv.next, %._crit_edge30 ], [ 1, %.preheader21.preheader ]
  %55 = getelementptr inbounds [101 x %struct.Bitset], ptr @bs, i64 0, i64 %indvars.iv
  %56 = call noundef i32 @_ZN6BitsetILi200009EE11_Find_firstEv(ptr noundef nonnull align 8 dereferenceable(25008) %55)
  %57 = icmp slt i32 %56, 200009
  br i1 %57, label %.lr.ph29.preheader, label %._crit_edge30

.lr.ph29.preheader:                               ; preds = %.preheader21
  %58 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.lr.ph29

.lr.ph29:                                         ; preds = %.lr.ph29.preheader, %.lr.ph29
  %.01627 = phi i32 [ %61, %.lr.ph29 ], [ %56, %.lr.ph29.preheader ]
  %59 = sext i32 %.01627 to i64
  %60 = getelementptr inbounds [200009 x i32], ptr @ans, i64 0, i64 %59
  store i32 %58, ptr %60, align 4, !tbaa !8
  %61 = call noundef i32 @_ZN6BitsetILi200009EE10_Find_nextEi(ptr noundef nonnull align 8 dereferenceable(25008) %55, i32 noundef %.01627)
  %62 = icmp slt i32 %61, 200009
  br i1 %62, label %.lr.ph29, label %._crit_edge30, !llvm.loop !16

._crit_edge30:                                    ; preds = %.lr.ph29, %.preheader21
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 101
  br i1 %exitcond.not, label %.preheader, label %.preheader21, !llvm.loop !17

._crit_edge35:                                    ; preds = %.lr.ph34, %.preheader
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

.lr.ph34:                                         ; preds = %.preheader, %.lr.ph34
  %indvars.iv37 = phi i64 [ %indvars.iv.next38, %.lr.ph34 ], [ 1, %.preheader ]
  %63 = getelementptr inbounds [200009 x i32], ptr @ans, i64 0, i64 %indvars.iv37
  %64 = load i32, ptr %63, align 4, !tbaa !8
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %64)
  %66 = load i32, ptr %1, align 4, !tbaa !8
  %67 = zext i32 %66 to i64
  %68 = icmp eq i64 %indvars.iv37, %67
  %69 = zext i1 %68 to i64
  %70 = getelementptr inbounds [3 x i8], ptr @.str, i64 0, i64 %69
  %71 = load i8, ptr %70, align 1, !tbaa !15
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %65, i8 noundef signext %71)
  %indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
  %73 = load i32, ptr %1, align 4, !tbaa !8
  %74 = sext i32 %73 to i64
  %.not20.not = icmp slt i64 %indvars.iv37, %74
  br i1 %.not20.not, label %.lr.ph34, label %._crit_edge35, !llvm.loop !18
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #0 align 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 #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6BitsetILi200009EE3setEi(ptr noundef nonnull align 8 dereferenceable(25008), i32 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6BitsetILi200009EE3setEii(ptr noundef nonnull align 8 dereferenceable(25008), i32 noundef, i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK6BitsetILi200009EEanERKS0_(ptr dead_on_unwind noalias writable sret(%struct.Bitset) align 8, ptr noundef nonnull align 8 dereferenceable(25008), ptr noundef nonnull align 8 dereferenceable(25008)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6BitsetILi200009EE5resetEii(ptr noundef nonnull align 8 dereferenceable(25008), i32 noundef, i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK6BitsetILi200009EEorERKS0_(ptr dead_on_unwind noalias writable sret(%struct.Bitset) align 8, ptr noundef nonnull align 8 dereferenceable(25008), ptr noundef nonnull align 8 dereferenceable(25008)) local_unnamed_addr #4 align 2

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

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

; 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 #4

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

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


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