; LLVM IR from bqi343/cp-notebook :: Contests/Other Solutions/UCF HSPT/2017 (UCF HSPT 17 - elemental)

; 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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::_Identity<std::__cxx11::basic_string<char>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::_Identity<std::__cxx11::basic_string<char>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::bitset<1001>::reference" = type { ptr, i64 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@_Z1mB5cxx11 = external dso_local global %"class.std::set", align 8
@ok = external dso_local global { [16 x i64] }, align 8

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z4testNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %0) #1 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::bitset<1001>::reference", align 8
  %5 = alloca %"class.std::bitset<1001>::reference", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::bitset<1001>::reference", align 8
  %10 = alloca i1, align 1
  %11 = alloca i1, align 1
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca i1, align 1
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i1, align 1
  %17 = alloca %"class.std::bitset<1001>::reference", align 8
  %18 = alloca %"class.std::bitset<1001>::reference", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %30, %1
  %20 = load i32, ptr %3, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  %23 = add i64 %22, 1
  %24 = icmp ult i64 %21, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  br label %33

26:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #3
  %27 = load i32, ptr %3, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  call void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<1001>::reference") align 8 %4, ptr noundef nonnull align 8 dereferenceable(128) @ok, i64 noundef %28)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm1001EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %4, i1 noundef zeroext false) #3
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #3
  br label %30

30:                                               ; preds = %26
  %31 = load i32, ptr %3, align 4, !tbaa !9
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %3, align 4, !tbaa !9
  br label %19, !llvm.loop !11

33:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #3
  call void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<1001>::reference") align 8 %5, ptr noundef nonnull align 8 dereferenceable(128) @ok, i64 noundef 0)
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm1001EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %5, i1 noundef zeroext true) #3
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 1, ptr %6, align 4, !tbaa !9
  br label %35

35:                                               ; preds = %112, %33
  %36 = load i32, ptr %6, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  %39 = add i64 %38, 1
  %40 = icmp ult i64 %37, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %35
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %115

42:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 1, ptr %8, align 4, !tbaa !9
  br label %43

43:                                               ; preds = %108, %42
  %44 = load i32, ptr %8, align 4, !tbaa !9
  %45 = icmp slt i32 %44, 4
  br i1 %45, label %47, label %46

46:                                               ; preds = %43
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %111

47:                                               ; preds = %43
  %48 = load i32, ptr %8, align 4, !tbaa !9
  %49 = load i32, ptr %6, align 4, !tbaa !9
  %50 = icmp sle i32 %48, %49
  store i1 false, ptr %10, align 1
  store i1 false, ptr %11, align 1
  store i1 false, ptr %13, align 1
  store i1 false, ptr %16, align 1
  br i1 %50, label %51, label %68

51:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #3
  store i1 true, ptr %10, align 1
  %52 = load i32, ptr %6, align 4, !tbaa !9
  %53 = load i32, ptr %8, align 4, !tbaa !9
  %54 = sub nsw i32 %52, %53
  %55 = sext i32 %54 to i64
  call void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<1001>::reference") align 8 %9, ptr noundef nonnull align 8 dereferenceable(128) @ok, i64 noundef %55)
  store i1 true, ptr %11, align 1
  %56 = call noundef zeroext i1 @_ZNKSt6bitsetILm1001EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %9) #3
  br i1 %56, label %57, label %68

57:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #3
  store i1 true, ptr %13, align 1
  %58 = load i32, ptr %6, align 4, !tbaa !9
  %59 = load i32, ptr %8, align 4, !tbaa !9
  %60 = sub nsw i32 %58, %59
  %61 = sext i32 %60 to i64
  %62 = load i32, ptr %8, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  invoke void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %12, ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %61, i64 noundef %63)
          to label %64 unwind label %86

64:                                               ; preds = %57
  store i1 true, ptr %16, align 1
  %65 = invoke noundef i64 @_ZNKSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE5countERKS5_(ptr noundef nonnull align 8 dereferenceable(48) @_Z1mB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %66 unwind label %90

66:                                               ; preds = %64
  %67 = icmp ne i64 %65, 0
  br label %68

68:                                               ; preds = %66, %51, %47
  %69 = phi i1 [ false, %51 ], [ false, %47 ], [ %67, %66 ]
  %70 = load i1, ptr %16, align 1
  br i1 %70, label %71, label %72

71:                                               ; preds = %68
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #3
  br label %72

72:                                               ; preds = %71, %68
  %73 = load i1, ptr %13, align 1
  br i1 %73, label %74, label %75

74:                                               ; preds = %72
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #3
  br label %75

75:                                               ; preds = %74, %72
  %76 = load i1, ptr %11, align 1
  br i1 %76, label %77, label %78

77:                                               ; preds = %75
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #3
  br label %78

78:                                               ; preds = %77, %75
  %79 = load i1, ptr %10, align 1
  br i1 %79, label %80, label %81

80:                                               ; preds = %78
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #3
  br label %81

81:                                               ; preds = %80, %78
  br i1 %69, label %82, label %107

82:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #3
  %83 = load i32, ptr %6, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  call void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<1001>::reference") align 8 %17, ptr noundef nonnull align 8 dereferenceable(128) @ok, i64 noundef %84)
  %85 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm1001EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %17, i1 noundef zeroext true) #3
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #3
  br label %107

86:                                               ; preds = %57
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %14, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %15, align 4
  br label %97

90:                                               ; preds = %64
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %14, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %15, align 4
  %94 = load i1, ptr %16, align 1
  br i1 %94, label %95, label %96

95:                                               ; preds = %90
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #3
  br label %96

96:                                               ; preds = %95, %90
  br label %97

97:                                               ; preds = %96, %86
  %98 = load i1, ptr %13, align 1
  br i1 %98, label %99, label %100

99:                                               ; preds = %97
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #3
  br label %100

100:                                              ; preds = %99, %97
  %101 = load i1, ptr %11, align 1
  br i1 %101, label %102, label %103

102:                                              ; preds = %100
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #3
  br label %103

103:                                              ; preds = %102, %100
  %104 = load i1, ptr %10, align 1
  br i1 %104, label %105, label %106

105:                                              ; preds = %103
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #3
  br label %106

106:                                              ; preds = %105, %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %118

107:                                              ; preds = %82, %81
  br label %108

108:                                              ; preds = %107
  %109 = load i32, ptr %8, align 4, !tbaa !9
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %8, align 4, !tbaa !9
  br label %43, !llvm.loop !13

111:                                              ; preds = %46
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %6, align 4, !tbaa !9
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %6, align 4, !tbaa !9
  br label %35, !llvm.loop !14

115:                                              ; preds = %41
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #3
  %116 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  call void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<1001>::reference") align 8 %18, ptr noundef nonnull align 8 dereferenceable(128) @ok, i64 noundef %116)
  %117 = call noundef zeroext i1 @_ZNKSt6bitsetILm1001EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %18) #3
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %18) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #3
  ret i1 %117

118:                                              ; preds = %106
  %119 = load ptr, ptr %14, align 8
  %120 = load i32, ptr %15, align 4
  %121 = insertvalue { ptr, i32 } poison, ptr %119, 0
  %122 = insertvalue { ptr, i32 } %121, i32 %120, 1
  resume { ptr, i32 } %122
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset<1001>::reference") align 8, ptr noundef nonnull align 8 dereferenceable(128), i64 noundef) #0 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE5countERKS5_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, i64 noundef) #1 align 2

declare i32 @__gxx_personality_v0(...)

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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::_Identity<std::__cxx11::basic_string<char>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::_Identity<std::__cxx11::basic_string<char>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::bitset<1001>::reference" = type { ptr, i64 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@_Z1mB5cxx11 = external dso_local global %"class.std::set", align 8
@ok = external dso_local global { [16 x i64] }, align 8

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z4testNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull %0) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::bitset<1001>::reference", align 8
  %3 = alloca %"class.std::bitset<1001>::reference", align 8
  %4 = alloca %"class.std::bitset<1001>::reference", align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::bitset<1001>::reference", align 8
  %7 = alloca %"class.std::bitset<1001>::reference", align 8
  %8 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  %.not44 = icmp eq i64 %8, -1
  br i1 %.not44, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #3
  call void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<1001>::reference") align 8 %3, ptr noundef nonnull align 8 dereferenceable(128) @ok, i64 noundef 0)
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm1001EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %3, i1 noundef zeroext true) #3
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #3
  %10 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  %11 = add i64 %10, -1
  %12 = icmp ult i64 %11, -2
  br i1 %12, label %.preheader.preheader, label %._crit_edge43

.preheader.preheader:                             ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #3
  call void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<1001>::reference") align 8 %4, ptr noundef nonnull align 8 dereferenceable(128) @ok, i64 noundef 0)
  %13 = call noundef zeroext i1 @_ZNKSt6bitsetILm1001EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  br i1 %13, label %14, label %.critedge36.thread39.peel

.critedge36.thread39.peel:                        ; preds = %.preheader.preheader
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  br label %.critedge36.thread.2.peel

14:                                               ; preds = %.preheader.preheader
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #3
  invoke void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %5, ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef 0, i64 noundef 1)
          to label %15 unwind label %.loopexit.split-lp

15:                                               ; preds = %14
  %16 = invoke noundef i64 @_ZNKSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE5countERKS5_(ptr noundef nonnull align 8 dereferenceable(48) @_Z1mB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %.critedge36.peel unwind label %.loopexit.split-lp54

.critedge36.peel:                                 ; preds = %15
  %.not.peel = icmp eq i64 %16, 0
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  br i1 %.not.peel, label %.critedge36.thread.2.peel, label %17

17:                                               ; preds = %.critedge36.peel
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  call void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<1001>::reference") align 8 %6, ptr noundef nonnull align 8 dereferenceable(128) @ok, i64 noundef 1)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm1001EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %6, i1 noundef zeroext true) #3
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  br label %.critedge36.thread.2.peel

.critedge36.thread.2.peel:                        ; preds = %17, %.critedge36.peel, %.critedge36.thread39.peel
  %19 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  %20 = add i64 %19, -2
  %21 = icmp ult i64 %20, -3
  br i1 %21, label %.preheader.peel.next.peel, label %._crit_edge43

.preheader.peel.next.peel:                        ; preds = %.critedge36.thread.2.peel
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #3
  call void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<1001>::reference") align 8 %4, ptr noundef nonnull align 8 dereferenceable(128) @ok, i64 noundef 1)
  %22 = call noundef zeroext i1 @_ZNKSt6bitsetILm1001EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  br i1 %22, label %23, label %.critedge36.thread39.peel58

.critedge36.thread39.peel58:                      ; preds = %.preheader.peel.next.peel
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  br label %.critedge36.thread.peel

23:                                               ; preds = %.preheader.peel.next.peel
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #3
  invoke void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %5, ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef 1, i64 noundef 1)
          to label %24 unwind label %.loopexit.loopexit.split-lp

24:                                               ; preds = %23
  %25 = invoke noundef i64 @_ZNKSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE5countERKS5_(ptr noundef nonnull align 8 dereferenceable(48) @_Z1mB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %.critedge36.peel59 unwind label %.loopexit53.loopexit.split-lp

.critedge36.peel59:                               ; preds = %24
  %.not.peel60 = icmp eq i64 %25, 0
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  br i1 %.not.peel60, label %.critedge36.thread.peel, label %26

26:                                               ; preds = %.critedge36.peel59
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  call void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<1001>::reference") align 8 %6, ptr noundef nonnull align 8 dereferenceable(128) @ok, i64 noundef 2)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm1001EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %6, i1 noundef zeroext true) #3
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  br label %.critedge36.thread.peel

.critedge36.thread.peel:                          ; preds = %26, %.critedge36.peel59, %.critedge36.thread39.peel58
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #3
  call void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<1001>::reference") align 8 %4, ptr noundef nonnull align 8 dereferenceable(128) @ok, i64 noundef 0)
  %28 = call noundef zeroext i1 @_ZNKSt6bitsetILm1001EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  br i1 %28, label %29, label %.critedge36.thread39.1.peel

.critedge36.thread39.1.peel:                      ; preds = %.critedge36.thread.peel
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  br label %.critedge36.thread.2.peel61

29:                                               ; preds = %.critedge36.thread.peel
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #3
  invoke void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %5, ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef 0, i64 noundef 2)
          to label %30 unwind label %.loopexit.loopexit.split-lp

30:                                               ; preds = %29
  %31 = invoke noundef i64 @_ZNKSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE5countERKS5_(ptr noundef nonnull align 8 dereferenceable(48) @_Z1mB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %.critedge36.1.peel unwind label %.loopexit53.loopexit.split-lp

.critedge36.1.peel:                               ; preds = %30
  %.not.1.peel = icmp eq i64 %31, 0
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  br i1 %.not.1.peel, label %.critedge36.thread.2.peel61, label %32

32:                                               ; preds = %.critedge36.1.peel
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  call void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<1001>::reference") align 8 %6, ptr noundef nonnull align 8 dereferenceable(128) @ok, i64 noundef 2)
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm1001EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %6, i1 noundef zeroext true) #3
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  br label %.critedge36.thread.2.peel61

.critedge36.thread.2.peel61:                      ; preds = %.critedge36.thread39.1.peel, %.critedge36.1.peel, %32
  %34 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  %35 = add i64 %34, -3
  %36 = icmp ult i64 %35, -4
  br i1 %36, label %.preheader.peel.next, label %._crit_edge43

.lr.ph:                                           ; preds = %1, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %1 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #3
  call void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<1001>::reference") align 8 %2, ptr noundef nonnull align 8 dereferenceable(128) @ok, i64 noundef %indvars.iv)
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm1001EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %2, i1 noundef zeroext false) #3
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #3
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %38 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  %39 = add i64 %38, 1
  %40 = icmp ugt i64 %39, %indvars.iv.next
  br i1 %40, label %.lr.ph, label %._crit_edge, !llvm.loop !5

._crit_edge43:                                    ; preds = %.critedge36.thread.2.peel61, %.critedge36.thread.2, %.critedge36.thread.2.peel, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  %41 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  call void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<1001>::reference") align 8 %7, ptr noundef nonnull align 8 dereferenceable(128) @ok, i64 noundef %41)
  %42 = call noundef zeroext i1 @_ZNKSt6bitsetILm1001EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %7) #3
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  ret i1 %42

.preheader.peel.next:                             ; preds = %.critedge36.thread.2.peel61, %.critedge36.thread.2
  %indvars.iv49 = phi i64 [ %indvars.iv.next50, %.critedge36.thread.2 ], [ 3, %.critedge36.thread.2.peel61 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #3
  %43 = add nsw i64 %indvars.iv49, -1
  call void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<1001>::reference") align 8 %4, ptr noundef nonnull align 8 dereferenceable(128) @ok, i64 noundef %43)
  %44 = call noundef zeroext i1 @_ZNKSt6bitsetILm1001EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  br i1 %44, label %45, label %.critedge36.thread39

.critedge36.thread39:                             ; preds = %.preheader.peel.next
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  br label %.critedge36.thread

45:                                               ; preds = %.preheader.peel.next
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #3
  invoke void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %5, ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %43, i64 noundef 1)
          to label %46 unwind label %.loopexit.loopexit

46:                                               ; preds = %45
  %47 = invoke noundef i64 @_ZNKSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE5countERKS5_(ptr noundef nonnull align 8 dereferenceable(48) @_Z1mB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %.critedge36 unwind label %.loopexit53.loopexit

.critedge36:                                      ; preds = %46
  %.not = icmp eq i64 %47, 0
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  br i1 %.not, label %.critedge36.thread, label %48

48:                                               ; preds = %.critedge36
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  call void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<1001>::reference") align 8 %6, ptr noundef nonnull align 8 dereferenceable(128) @ok, i64 noundef %indvars.iv49)
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm1001EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %6, i1 noundef zeroext true) #3
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  br label %.critedge36.thread

.loopexit.loopexit:                               ; preds = %59, %52, %45
  %lpad.loopexit63 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.loopexit.loopexit.split-lp:                      ; preds = %23, %29
  %lpad.loopexit.split-lp64 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.loopexit.split-lp:                               ; preds = %14
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.loopexit53.loopexit:                             ; preds = %60, %53, %46
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit53

.loopexit53.loopexit.split-lp:                    ; preds = %24, %30
  %lpad.loopexit.split-lp65 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit53

.loopexit.split-lp54:                             ; preds = %15
  %lpad.loopexit.split-lp56 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit53

.loopexit53:                                      ; preds = %.loopexit53.loopexit, %.loopexit53.loopexit.split-lp, %.loopexit.split-lp54
  %lpad.phi57 = phi { ptr, i32 } [ %lpad.loopexit.split-lp56, %.loopexit.split-lp54 ], [ %lpad.loopexit, %.loopexit53.loopexit ], [ %lpad.loopexit.split-lp65, %.loopexit53.loopexit.split-lp ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.loopexit.loopexit.split-lp, %.loopexit.split-lp, %.loopexit53
  %.pn = phi { ptr, i32 } [ %lpad.phi57, %.loopexit53 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ], [ %lpad.loopexit63, %.loopexit.loopexit ], [ %lpad.loopexit.split-lp64, %.loopexit.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  resume { ptr, i32 } %.pn

.critedge36.thread:                               ; preds = %48, %.critedge36, %.critedge36.thread39
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #3
  %50 = add nsw i64 %indvars.iv49, -2
  call void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<1001>::reference") align 8 %4, ptr noundef nonnull align 8 dereferenceable(128) @ok, i64 noundef %50)
  %51 = call noundef zeroext i1 @_ZNKSt6bitsetILm1001EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  br i1 %51, label %52, label %.critedge36.thread39.1

.critedge36.thread39.1:                           ; preds = %.critedge36.thread
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  br label %.critedge36.thread.1

52:                                               ; preds = %.critedge36.thread
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #3
  invoke void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %5, ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %50, i64 noundef 2)
          to label %53 unwind label %.loopexit.loopexit

53:                                               ; preds = %52
  %54 = invoke noundef i64 @_ZNKSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE5countERKS5_(ptr noundef nonnull align 8 dereferenceable(48) @_Z1mB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %.critedge36.1 unwind label %.loopexit53.loopexit

.critedge36.1:                                    ; preds = %53
  %.not.1 = icmp eq i64 %54, 0
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  br i1 %.not.1, label %.critedge36.thread.1, label %55

55:                                               ; preds = %.critedge36.1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  call void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<1001>::reference") align 8 %6, ptr noundef nonnull align 8 dereferenceable(128) @ok, i64 noundef %indvars.iv49)
  %56 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm1001EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %6, i1 noundef zeroext true) #3
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  br label %.critedge36.thread.1

.critedge36.thread.1:                             ; preds = %.critedge36.thread39.1, %.critedge36.1, %55
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #3
  %57 = add nsw i64 %indvars.iv49, -3
  call void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<1001>::reference") align 8 %4, ptr noundef nonnull align 8 dereferenceable(128) @ok, i64 noundef %57)
  %58 = call noundef zeroext i1 @_ZNKSt6bitsetILm1001EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  br i1 %58, label %59, label %.critedge36.thread39.2

.critedge36.thread39.2:                           ; preds = %.critedge36.thread.1
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  br label %.critedge36.thread.2

59:                                               ; preds = %.critedge36.thread.1
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #3
  invoke void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %5, ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %57, i64 noundef 3)
          to label %60 unwind label %.loopexit.loopexit

60:                                               ; preds = %59
  %61 = invoke noundef i64 @_ZNKSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE5countERKS5_(ptr noundef nonnull align 8 dereferenceable(48) @_Z1mB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %.critedge36.2 unwind label %.loopexit53.loopexit

.critedge36.2:                                    ; preds = %60
  %.not.2 = icmp eq i64 %61, 0
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  br i1 %.not.2, label %.critedge36.thread.2, label %62

62:                                               ; preds = %.critedge36.2
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  call void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<1001>::reference") align 8 %6, ptr noundef nonnull align 8 dereferenceable(128) @ok, i64 noundef %indvars.iv49)
  %63 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm1001EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %6, i1 noundef zeroext true) #3
  call void @_ZNSt6bitsetILm1001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  br label %.critedge36.thread.2

.critedge36.thread.2:                             ; preds = %62, %.critedge36.2, %.critedge36.thread39.2
  %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
  %64 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  %65 = add i64 %64, 1
  %66 = icmp ugt i64 %65, %indvars.iv.next50
  br i1 %66, label %.preheader.peel.next, label %._crit_edge43, !llvm.loop !7
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm1001EEixEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset<1001>::reference") align 8, ptr noundef nonnull align 8 dereferenceable(128), i64 noundef) local_unnamed_addr #0 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE5countERKS5_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, i64 noundef) local_unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6, !8}
!8 = !{!"llvm.loop.peeled.count", i32 2}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass