; LLVM IR from AdaptiveCpp/AdaptiveCpp :: tests/pcuda/pcuda_test_suite.ll (ZN5boost9unit_test9framework13clear_contextEi)

; 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.__gnu_cxx::__normal_iterator.187" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.186" = type { ptr }
%"struct.boost::unit_test::framework::frame_with_id" = type { i32 }
%"class.boost::unit_test::framework::state" = type { ptr, %"class.std::vector.100", i64, %"class.std::map.105", i64, i64, i8, %"class.std::set", %"class.std::vector.115", i32, %"class.std::set.120", %"class.boost::execution_monitor", %"class.std::map.126", %"class.boost::unit_test::runtime_config::stream_holder" }
%"class.std::vector.100" = type { %"struct.std::_Vector_base.101" }
%"struct.std::_Vector_base.101" = type { %"struct.std::_Vector_base<boost::unit_test::test_suite *, std::allocator<boost::unit_test::test_suite *>>::_Vector_impl" }
%"struct.std::_Vector_base<boost::unit_test::test_suite *, std::allocator<boost::unit_test::test_suite *>>::_Vector_impl" = type { %"struct.std::_Vector_base<boost::unit_test::test_suite *, std::allocator<boost::unit_test::test_suite *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<boost::unit_test::test_suite *, std::allocator<boost::unit_test::test_suite *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::map.105" = type { %"class.std::_Rb_tree.106" }
%"class.std::_Rb_tree.106" = type { %"struct.std::_Rb_tree<unsigned long, std::pair<const unsigned long, boost::unit_test::test_unit *>, std::_Select1st<std::pair<const unsigned long, boost::unit_test::test_unit *>>, std::less<unsigned long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned long, std::pair<const unsigned long, boost::unit_test::test_unit *>, std::_Select1st<std::pair<const unsigned long, boost::unit_test::test_unit *>>, std::less<unsigned long>>::_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::set" = type { %"class.std::_Rb_tree.110" }
%"class.std::_Rb_tree.110" = type { %"struct.std::_Rb_tree<boost::unit_test::test_observer *, boost::unit_test::test_observer *, std::_Identity<boost::unit_test::test_observer *>, boost::unit_test::framework::state::priority_order>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<boost::unit_test::test_observer *, boost::unit_test::test_observer *, std::_Identity<boost::unit_test::test_observer *>, boost::unit_test::framework::state::priority_order>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::vector.115" = type { %"struct.std::_Vector_base.116" }
%"struct.std::_Vector_base.116" = type { %"struct.std::_Vector_base<boost::unit_test::framework::state::context_frame, std::allocator<boost::unit_test::framework::state::context_frame>>::_Vector_impl" }
%"struct.std::_Vector_base<boost::unit_test::framework::state::context_frame, std::allocator<boost::unit_test::framework::state::context_frame>>::_Vector_impl" = type { %"struct.std::_Vector_base<boost::unit_test::framework::state::context_frame, std::allocator<boost::unit_test::framework::state::context_frame>>::_Vector_impl_data" }
%"struct.std::_Vector_base<boost::unit_test::framework::state::context_frame, std::allocator<boost::unit_test::framework::state::context_frame>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::set.120" = type { %"class.std::_Rb_tree.121" }
%"class.std::_Rb_tree.121" = type { %"struct.std::_Rb_tree<boost::unit_test::global_fixture *, boost::unit_test::global_fixture *, std::_Identity<boost::unit_test::global_fixture *>, std::less<boost::unit_test::global_fixture *>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<boost::unit_test::global_fixture *, boost::unit_test::global_fixture *, std::_Identity<boost::unit_test::global_fixture *>, std::less<boost::unit_test::global_fixture *>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.boost::execution_monitor" = type { %"class.boost::unit_test::readwrite_property.97", %"class.boost::unit_test::readwrite_property.97", %"class.boost::unit_test::readwrite_property.22", %"class.boost::unit_test::readwrite_property.97", %"class.boost::unit_test::readwrite_property.20", %"class.boost::shared_ptr.99", %"class.boost::scoped_array" }
%"class.boost::unit_test::readwrite_property.22" = type { %"class.boost::unit_test::class_property" }
%"class.boost::unit_test::class_property" = type { i64 }
%"class.boost::unit_test::readwrite_property.97" = type { %"class.boost::unit_test::class_property.98" }
%"class.boost::unit_test::class_property.98" = type { i8 }
%"class.boost::unit_test::readwrite_property.20" = type { %"class.boost::unit_test::class_property.21" }
%"class.boost::unit_test::class_property.21" = type { i32 }
%"class.boost::shared_ptr.99" = type { ptr, %"class.boost::detail::shared_count" }
%"class.boost::detail::shared_count" = type { ptr }
%"class.boost::scoped_array" = type { ptr }
%"class.std::map.126" = type { %"class.std::_Rb_tree.127" }
%"class.std::_Rb_tree.127" = type { %"struct.std::_Rb_tree<boost::unit_test::output_format, std::pair<const boost::unit_test::output_format, boost::unit_test::runtime_config::stream_holder>, std::_Select1st<std::pair<const boost::unit_test::output_format, boost::unit_test::runtime_config::stream_holder>>, std::less<boost::unit_test::output_format>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<boost::unit_test::output_format, std::pair<const boost::unit_test::output_format, boost::unit_test::runtime_config::stream_holder>, std::_Select1st<std::pair<const boost::unit_test::output_format, boost::unit_test::runtime_config::stream_holder>>, std::less<boost::unit_test::output_format>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.boost::unit_test::runtime_config::stream_holder" = type { %"class.boost::shared_ptr.132", ptr }
%"class.boost::shared_ptr.132" = type { ptr, %"class.boost::detail::shared_count" }
%"struct.boost::unit_test::framework::state::context_frame" = type <{ %"class.std::__cxx11::basic_string", i32, i8, [3 x i8] }>
%"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] }

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

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

; Function Attrs: mustprogress uwtable
declare hidden noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv() #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5boost9unit_test9framework13clear_contextEi(i32 noundef %0) #1 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.__gnu_cxx::__normal_iterator.187", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.186", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.186", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator.186", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.186", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.186", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.186", align 8
  %11 = alloca %"struct.boost::unit_test::framework::frame_with_id", align 4
  %12 = alloca %"class.__gnu_cxx::__normal_iterator.186", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator.187", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator.186", align 8
  store i32 %0, ptr %2, align 4, !tbaa !5
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = icmp eq i32 %15, -1
  br i1 %16, label %17, label %56

17:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %18 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %19 = getelementptr inbounds %"class.boost::unit_test::framework::state", ptr %18, i32 0, i32 8
  %20 = call noundef i64 @_ZNKSt6vectorIN5boost9unit_test9framework5state13context_frameESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  %21 = trunc i64 %20 to i32
  %22 = sub nsw i32 %21, 1
  store i32 %22, ptr %3, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %52, %17
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = icmp sge i32 %24, 0
  br i1 %25, label %27, label %26

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

27:                                               ; preds = %23
  %28 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %29 = getelementptr inbounds %"class.boost::unit_test::framework::state", ptr %28, i32 0, i32 8
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = call noundef nonnull align 8 dereferenceable(37) ptr @_ZNSt6vectorIN5boost9unit_test9framework5state13context_frameESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %31) #5
  %33 = getelementptr inbounds %"struct.boost::unit_test::framework::state::context_frame", ptr %32, i32 0, i32 2
  %34 = load i8, ptr %33, align 4, !tbaa !9, !range !16, !noundef !17
  %35 = trunc i8 %34 to i1
  br i1 %35, label %51, label %36

36:                                               ; preds = %27
  %37 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %38 = getelementptr inbounds %"class.boost::unit_test::framework::state", ptr %37, i32 0, i32 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %39 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %40 = getelementptr inbounds %"class.boost::unit_test::framework::state", ptr %39, i32 0, i32 8
  %41 = call ptr @_ZNSt6vectorIN5boost9unit_test9framework5state13context_frameESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #5
  %42 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.186", ptr %6, i32 0, i32 0
  store ptr %41, ptr %42, align 8
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN5boost9unit_test9framework5state13context_frameESt6vectorIS5_SaIS5_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %6, i64 noundef %44) #5
  %46 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.186", ptr %5, i32 0, i32 0
  store ptr %45, ptr %46, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKN5boost9unit_test9framework5state13context_frameESt6vectorIS5_SaIS5_EEEC2IPS5_vEERKNS0_IT_SA_EE(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %47 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.187", ptr %4, i32 0, i32 0
  %48 = load ptr, ptr %47, align 8
  %49 = call ptr @_ZNSt6vectorIN5boost9unit_test9framework5state13context_frameESaIS4_EE5eraseEN9__gnu_cxx17__normal_iteratorIPKS4_S6_EE(ptr noundef nonnull align 8 dereferenceable(24) %38, ptr %48)
  %50 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.186", ptr %7, i32 0, i32 0
  store ptr %49, ptr %50, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %51

51:                                               ; preds = %36, %27
  br label %52

52:                                               ; preds = %51
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = add nsw i32 %53, -1
  store i32 %54, ptr %3, align 4, !tbaa !5
  br label %23, !llvm.loop !18

55:                                               ; preds = %26
  br label %87

56:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %57 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %58 = getelementptr inbounds %"class.boost::unit_test::framework::state", ptr %57, i32 0, i32 8
  %59 = call ptr @_ZNSt6vectorIN5boost9unit_test9framework5state13context_frameESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %58) #5
  %60 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.186", ptr %9, i32 0, i32 0
  store ptr %59, ptr %60, align 8
  %61 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %62 = getelementptr inbounds %"class.boost::unit_test::framework::state", ptr %61, i32 0, i32 8
  %63 = call ptr @_ZNSt6vectorIN5boost9unit_test9framework5state13context_frameESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %62) #5
  %64 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.186", ptr %10, i32 0, i32 0
  store ptr %63, ptr %64, align 8
  %65 = load i32, ptr %2, align 4, !tbaa !5
  call void @_ZN5boost9unit_test9framework13frame_with_idC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %11, i32 noundef %65)
  %66 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.186", ptr %9, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8
  %68 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.186", ptr %10, i32 0, i32 0
  %69 = load ptr, ptr %68, align 8
  %70 = getelementptr inbounds %"struct.boost::unit_test::framework::frame_with_id", ptr %11, i32 0, i32 0
  %71 = load i32, ptr %70, align 4
  %72 = call ptr @_ZSt7find_ifIN9__gnu_cxx17__normal_iteratorIPN5boost9unit_test9framework5state13context_frameESt6vectorIS6_SaIS6_EEEENS4_13frame_with_idEET_SD_SD_T0_(ptr %67, ptr %69, i32 %71)
  %73 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.186", ptr %8, i32 0, i32 0
  store ptr %72, ptr %73, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %74 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %75 = getelementptr inbounds %"class.boost::unit_test::framework::state", ptr %74, i32 0, i32 8
  %76 = call ptr @_ZNSt6vectorIN5boost9unit_test9framework5state13context_frameESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %75) #5
  %77 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.186", ptr %12, i32 0, i32 0
  store ptr %76, ptr %77, align 8
  %78 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN5boost9unit_test9framework5state13context_frameESt6vectorIS5_SaIS5_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br i1 %78, label %79, label %86

79:                                               ; preds = %56
  %80 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %81 = getelementptr inbounds %"class.boost::unit_test::framework::state", ptr %80, i32 0, i32 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKN5boost9unit_test9framework5state13context_frameESt6vectorIS5_SaIS5_EEEC2IPS5_vEERKNS0_IT_SA_EE(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %82 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.187", ptr %13, i32 0, i32 0
  %83 = load ptr, ptr %82, align 8
  %84 = call ptr @_ZNSt6vectorIN5boost9unit_test9framework5state13context_frameESaIS4_EE5eraseEN9__gnu_cxx17__normal_iteratorIPKS4_S6_EE(ptr noundef nonnull align 8 dereferenceable(24) %81, ptr %83)
  %85 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.186", ptr %14, i32 0, i32 0
  store ptr %84, ptr %85, align 8
  br label %86

86:                                               ; preds = %79, %56
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %87

87:                                               ; preds = %86, %55
  ret void
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt6vectorIN5boost9unit_test9framework5state13context_frameESaIS4_EE5eraseEN9__gnu_cxx17__normal_iteratorIPKS4_S6_EE(ptr noundef nonnull align 8 dereferenceable(24), ptr) #1 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt7find_ifIN9__gnu_cxx17__normal_iteratorIPN5boost9unit_test9framework5state13context_frameESt6vectorIS6_SaIS6_EEEENS4_13frame_with_idEET_SD_SD_T0_(ptr, ptr, i32) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5boost9unit_test9framework13frame_with_idC2Ei(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPN5boost9unit_test9framework5state13context_frameESt6vectorIS5_SaIS5_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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 #4 = { inlinehint 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 #5 = { 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, !15, i64 36}
!10 = !{!"_ZTSN5boost9unit_test9framework5state13context_frameE", !11, i64 0, !6, i64 32, !15, i64 36}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !12, i64 0, !14, i64 8, !7, i64 16}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


; 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.__gnu_cxx::__normal_iterator.187" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.186" = type { ptr }
%"struct.boost::unit_test::framework::frame_with_id" = type { i32 }

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

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

; Function Attrs: mustprogress uwtable
declare hidden noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv() local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5boost9unit_test9framework13clear_contextEi(i32 noundef %0) local_unnamed_addr #1 {
  %2 = alloca %"class.__gnu_cxx::__normal_iterator.187", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator.186", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator.186", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.186", align 8
  %6 = alloca %"struct.boost::unit_test::framework::frame_with_id", align 4
  %7 = alloca %"class.__gnu_cxx::__normal_iterator.186", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.187", align 8
  %9 = icmp eq i32 %0, -1
  br i1 %9, label %10, label %34

10:                                               ; preds = %1
  %11 = tail call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %12 = getelementptr inbounds i8, ptr %11, i64 160
  %13 = tail call noundef i64 @_ZNKSt6vectorIN5boost9unit_test9framework5state13context_frameESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  %14 = trunc i64 %13 to i32
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %10
  %16 = and i64 %13, 2147483647
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %32
  %indvars.iv = phi i64 [ %16, %.lr.ph.preheader ], [ %indvars.iv.next, %32 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %17 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %18 = getelementptr inbounds i8, ptr %17, i64 160
  %19 = call noundef nonnull align 8 dereferenceable(37) ptr @_ZNSt6vectorIN5boost9unit_test9framework5state13context_frameESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %indvars.iv.next) #5
  %20 = getelementptr inbounds i8, ptr %19, i64 36
  %21 = load i8, ptr %20, align 4, !tbaa !5, !range !15, !noundef !16
  %22 = trunc nuw i8 %21 to i1
  br i1 %22, label %32, label %23

23:                                               ; preds = %.lr.ph
  %24 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %25 = getelementptr inbounds i8, ptr %24, i64 160
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %26 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %27 = getelementptr inbounds i8, ptr %26, i64 160
  %28 = call ptr @_ZNSt6vectorIN5boost9unit_test9framework5state13context_frameESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #5
  store ptr %28, ptr %4, align 8
  %29 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN5boost9unit_test9framework5state13context_frameESt6vectorIS5_SaIS5_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef %indvars.iv.next) #5
  store ptr %29, ptr %3, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKN5boost9unit_test9framework5state13context_frameESt6vectorIS5_SaIS5_EEEC2IPS5_vEERKNS0_IT_SA_EE(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %30 = load ptr, ptr %2, align 8
  %31 = call ptr @_ZNSt6vectorIN5boost9unit_test9framework5state13context_frameESaIS4_EE5eraseEN9__gnu_cxx17__normal_iteratorIPKS4_S6_EE(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr %30)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  br label %32

32:                                               ; preds = %.lr.ph, %23
  %33 = icmp ugt i64 %indvars.iv, 1
  br i1 %33, label %.lr.ph, label %.loopexit, !llvm.loop !17

34:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %35 = tail call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %36 = getelementptr inbounds i8, ptr %35, i64 160
  %37 = tail call ptr @_ZNSt6vectorIN5boost9unit_test9framework5state13context_frameESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #5
  %38 = tail call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %39 = getelementptr inbounds i8, ptr %38, i64 160
  %40 = tail call ptr @_ZNSt6vectorIN5boost9unit_test9framework5state13context_frameESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %39) #5
  call void @_ZN5boost9unit_test9framework13frame_with_idC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %6, i32 noundef %0)
  %41 = load i32, ptr %6, align 4
  %42 = call ptr @_ZSt7find_ifIN9__gnu_cxx17__normal_iteratorIPN5boost9unit_test9framework5state13context_frameESt6vectorIS6_SaIS6_EEEENS4_13frame_with_idEET_SD_SD_T0_(ptr %37, ptr %40, i32 %41)
  store ptr %42, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %43 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %44 = getelementptr inbounds i8, ptr %43, i64 160
  %45 = call ptr @_ZNSt6vectorIN5boost9unit_test9framework5state13context_frameESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %44) #5
  store ptr %45, ptr %7, align 8
  %46 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN5boost9unit_test9framework5state13context_frameESt6vectorIS5_SaIS5_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br i1 %46, label %47, label %52

47:                                               ; preds = %34
  %48 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN5boost9unit_test9framework4impl12_GLOBAL__N_111s_frk_stateEv()
  %49 = getelementptr inbounds i8, ptr %48, i64 160
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKN5boost9unit_test9framework5state13context_frameESt6vectorIS5_SaIS5_EEEC2IPS5_vEERKNS0_IT_SA_EE(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %50 = load ptr, ptr %8, align 8
  %51 = call ptr @_ZNSt6vectorIN5boost9unit_test9framework5state13context_frameESaIS4_EE5eraseEN9__gnu_cxx17__normal_iteratorIPKS4_S6_EE(ptr noundef nonnull align 8 dereferenceable(24) %49, ptr %50)
  br label %52

52:                                               ; preds = %47, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %.loopexit

.loopexit:                                        ; preds = %32, %10, %52
  ret void
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt6vectorIN5boost9unit_test9framework5state13context_frameESaIS4_EE5eraseEN9__gnu_cxx17__normal_iteratorIPKS4_S6_EE(ptr noundef nonnull align 8 dereferenceable(24), ptr) local_unnamed_addr #1 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt7find_ifIN9__gnu_cxx17__normal_iteratorIPN5boost9unit_test9framework5state13context_frameESt6vectorIS6_SaIS6_EEEENS4_13frame_with_idEET_SD_SD_T0_(ptr, ptr, i32) local_unnamed_addr #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5boost9unit_test9framework13frame_with_idC2Ei(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPN5boost9unit_test9framework5state13context_frameESt6vectorIS5_SaIS5_EEEEbRKNS_17__normal_iteratorIT_T0_EESF_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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 #4 = { inlinehint 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 #5 = { 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, !14, i64 36}
!6 = !{!"_ZTSN5boost9unit_test9framework5state13context_frameE", !7, i64 0, !13, i64 32, !14, i64 36}
!7 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !8, i64 0, !12, i64 8, !10, i64 16}
!8 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"long", !10, i64 0}
!13 = !{!"int", !10, i64 0}
!14 = !{!"bool", !10, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


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