; LLVM IR from sunkafei/xcpc-algorithm-templates :: 算法/人工智能/对抗搜索（Alpha-Beta剪枝）.ll (Z6searchR5stateiii)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<state, std::allocator<state>>::_Vector_impl" }
%"struct.std::_Vector_base<state, std::allocator<state>>::_Vector_impl" = type { %"struct.std::_Vector_base<state, std::allocator<state>>::_Vector_impl_data" }
%"struct.std::_Vector_base<state, std::allocator<state>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%struct.state = type { i8 }

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z6searchR5stateiii(ptr noundef nonnull align 1 dereferenceable(1) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.std::vector", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca i32, align 4
  %17 = alloca %struct.state, align 1
  %18 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !9
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = call noundef zeroext i1 @_ZN5state7inFinalEv(ptr noundef nonnull align 1 dereferenceable(1) %19)
  br i1 %20, label %21, label %24

21:                                               ; preds = %4
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = call noundef i32 @_ZN5state5scoreEv(ptr noundef nonnull align 1 dereferenceable(1) %22)
  store i32 %23, ptr %5, align 4
  br label %88

24:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #5
  call void @_ZNSt6vectorI5stateSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = load i32, ptr %7, align 4, !tbaa !9
  invoke void @_ZN5state6expandEiRSt6vectorIS_SaIS_EE(ptr noundef nonnull align 1 dereferenceable(1) %25, i32 noundef %26, ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %27 unwind label %37

27:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store ptr %10, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %28 = load ptr, ptr %13, align 8, !tbaa !5
  %29 = call ptr @_ZNSt6vectorI5stateSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #5
  %30 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %29, ptr %30, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %31 = load ptr, ptr %13, align 8, !tbaa !5
  %32 = call ptr @_ZNSt6vectorI5stateSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #5
  %33 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %32, ptr %33, align 8
  br label %34

34:                                               ; preds = %75, %27
  %35 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP5stateSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  br i1 %35, label %41, label %36

36:                                               ; preds = %34
  store i32 2, ptr %16, align 4
  br label %77

37:                                               ; preds = %24
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %11, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %12, align 4
  br label %87

41:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #5
  %42 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP5stateSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %43 = load i32, ptr %7, align 4, !tbaa !9
  %44 = xor i32 %43, 1
  %45 = load i32, ptr %8, align 4, !tbaa !9
  %46 = load i32, ptr %9, align 4, !tbaa !9
  %47 = invoke noundef i32 @_Z6searchR5stateiii(ptr noundef nonnull align 1 dereferenceable(1) %17, i32 noundef %44, i32 noundef %45, i32 noundef %46)
          to label %48 unwind label %55

48:                                               ; preds = %41
  store i32 %47, ptr %18, align 4, !tbaa !9
  %49 = load i32, ptr %7, align 4, !tbaa !9
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %59, label %51

51:                                               ; preds = %48
  %52 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %53 unwind label %55

53:                                               ; preds = %51
  %54 = load i32, ptr %52, align 4, !tbaa !9
  store i32 %54, ptr %8, align 4, !tbaa !9
  br label %63

55:                                               ; preds = %59, %51, %41
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %11, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %87

59:                                               ; preds = %48
  %60 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %61 unwind label %55

61:                                               ; preds = %59
  %62 = load i32, ptr %60, align 4, !tbaa !9
  store i32 %62, ptr %9, align 4, !tbaa !9
  br label %63

63:                                               ; preds = %61, %53
  %64 = load i32, ptr %9, align 4, !tbaa !9
  %65 = load i32, ptr %8, align 4, !tbaa !9
  %66 = icmp sle i32 %64, %65
  br i1 %66, label %67, label %68

67:                                               ; preds = %63
  store i32 2, ptr %16, align 4
  br label %69

68:                                               ; preds = %63
  store i32 0, ptr %16, align 4
  br label %69

69:                                               ; preds = %68, %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  %70 = load i32, ptr %16, align 4
  switch i32 %70, label %72 [
    i32 0, label %71
  ]

71:                                               ; preds = %69
  store i32 0, ptr %16, align 4
  br label %72

72:                                               ; preds = %71, %69
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  %73 = load i32, ptr %16, align 4
  switch i32 %73, label %77 [
    i32 0, label %74
  ]

74:                                               ; preds = %72
  br label %75

75:                                               ; preds = %74
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP5stateSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  br label %34

77:                                               ; preds = %72, %36
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %78

78:                                               ; preds = %77
  %79 = load i32, ptr %7, align 4, !tbaa !9
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %83, label %81

81:                                               ; preds = %78
  %82 = load i32, ptr %8, align 4, !tbaa !9
  br label %85

83:                                               ; preds = %78
  %84 = load i32, ptr %9, align 4, !tbaa !9
  br label %85

85:                                               ; preds = %83, %81
  %86 = phi i32 [ %82, %81 ], [ %84, %83 ]
  store i32 %86, ptr %5, align 4
  store i32 1, ptr %16, align 4
  call void @_ZNSt6vectorI5stateSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  br label %88

87:                                               ; preds = %55, %37
  call void @_ZNSt6vectorI5stateSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  br label %90

88:                                               ; preds = %85, %21
  %89 = load i32, ptr %5, align 4
  ret i32 %89

90:                                               ; preds = %87
  %91 = load ptr, ptr %11, align 8
  %92 = load i32, ptr %12, align 4
  %93 = insertvalue { ptr, i32 } poison, ptr %91, 0
  %94 = insertvalue { ptr, i32 } %93, i32 %92, 1
  resume { ptr, i32 } %94
}

declare noundef zeroext i1 @_ZN5state7inFinalEv(ptr noundef nonnull align 1 dereferenceable(1)) #1

declare noundef i32 @_ZN5state5scoreEv(ptr noundef nonnull align 1 dereferenceable(1)) #1

; 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 dso_local void @_ZNSt6vectorI5stateSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

declare void @_ZN5state6expandEiRSt6vectorIS_SaIS_EE(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef, ptr noundef nonnull align 8 dereferenceable(24)) #1

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; 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 nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP5stateSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 = { 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 #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 = !{!"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}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<state, std::allocator<state>>::_Vector_impl" }
%"struct.std::_Vector_base<state, std::allocator<state>>::_Vector_impl" = type { %"struct.std::_Vector_base<state, std::allocator<state>>::_Vector_impl_data" }
%"struct.std::_Vector_base<state, std::allocator<state>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%struct.state = type { i8 }

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z6searchR5stateiii(ptr noundef nonnull align 1 dereferenceable(1) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %struct.state, align 1
  %11 = alloca i32, align 4
  store i32 %2, ptr %5, align 4, !tbaa !5
  store i32 %3, ptr %6, align 4, !tbaa !5
  %12 = tail call noundef zeroext i1 @_ZN5state7inFinalEv(ptr noundef nonnull align 1 dereferenceable(1) %0)
  br i1 %12, label %13, label %15

13:                                               ; preds = %4
  %14 = tail call noundef i32 @_ZN5state5scoreEv(ptr noundef nonnull align 1 dereferenceable(1) %0)
  br label %48

15:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  call void @_ZNSt6vectorI5stateSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  invoke void @_ZN5state6expandEiRSt6vectorIS_SaIS_EE(ptr noundef nonnull align 1 dereferenceable(1) %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %16 unwind label %31

16:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %17 = call ptr @_ZNSt6vectorI5stateSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  store ptr %17, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %18 = call ptr @_ZNSt6vectorI5stateSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  store ptr %18, ptr %9, align 8
  %19 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP5stateSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  br i1 %19, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %16
  %20 = xor i32 %1, 1
  %.not = icmp eq i32 %1, 0
  br i1 %.not, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %27
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #5
  %21 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP5stateSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #5
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %23 = invoke noundef i32 @_Z6searchR5stateiii(ptr noundef nonnull align 1 dereferenceable(1) %10, i32 noundef %20, i32 noundef %22, i32 noundef %3)
          to label %24 unwind label %.split.us

24:                                               ; preds = %.lr.ph.split.us
  store i32 %23, ptr %11, align 4, !tbaa !5
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %26 = load i32, ptr %25, align 4, !tbaa !5
  store i32 %26, ptr %5, align 4, !tbaa !5
  %.not18.us = icmp slt i32 %26, %3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #5
  br i1 %.not18.us, label %27, label %._crit_edge

27:                                               ; preds = %24
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP5stateSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %29 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP5stateSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  br i1 %29, label %.lr.ph.split.us, label %.._crit_edge.loopexit_crit_edge

.._crit_edge.loopexit_crit_edge:                  ; preds = %27
  %.pre.pre = load i32, ptr %5, align 4
  br label %._crit_edge

.split.us:                                        ; preds = %.lr.ph.split.us
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %40

31:                                               ; preds = %15
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %47

.lr.ph.split:                                     ; preds = %.lr.ph, %41
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #5
  %33 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP5stateSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #5
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = invoke noundef i32 @_Z6searchR5stateiii(ptr noundef nonnull align 1 dereferenceable(1) %10, i32 noundef %20, i32 noundef %2, i32 noundef %34)
          to label %36 unwind label %.split

36:                                               ; preds = %.lr.ph.split
  store i32 %35, ptr %11, align 4, !tbaa !5
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %38 = load i32, ptr %37, align 4, !tbaa !5
  store i32 %38, ptr %6, align 4, !tbaa !5
  %.not18 = icmp sgt i32 %38, %2
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #5
  br i1 %.not18, label %41, label %._crit_edge

.split:                                           ; preds = %.lr.ph.split
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %40

40:                                               ; preds = %.split.us, %.split
  %.us-phi = phi { ptr, i32 } [ %39, %.split ], [ %30, %.split.us ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  br label %47

41:                                               ; preds = %36
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP5stateSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %43 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP5stateSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  br i1 %43, label %.lr.ph.split, label %.._crit_edge.loopexit21_crit_edge

.._crit_edge.loopexit21_crit_edge:                ; preds = %41
  %.pre22.pre = load i32, ptr %6, align 4
  br label %._crit_edge

._crit_edge:                                      ; preds = %36, %24, %.._crit_edge.loopexit21_crit_edge, %.._crit_edge.loopexit_crit_edge, %16
  %44 = phi i32 [ %3, %16 ], [ %3, %.._crit_edge.loopexit_crit_edge ], [ %.pre22.pre, %.._crit_edge.loopexit21_crit_edge ], [ %3, %24 ], [ %38, %36 ]
  %45 = phi i32 [ %2, %16 ], [ %.pre.pre, %.._crit_edge.loopexit_crit_edge ], [ %2, %.._crit_edge.loopexit21_crit_edge ], [ %26, %24 ], [ %2, %36 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  %.not19 = icmp eq i32 %1, 0
  %46 = select i1 %.not19, i32 %45, i32 %44
  call void @_ZNSt6vectorI5stateSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  br label %48

47:                                               ; preds = %40, %31
  %.pn = phi { ptr, i32 } [ %.us-phi, %40 ], [ %32, %31 ]
  call void @_ZNSt6vectorI5stateSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  resume { ptr, i32 } %.pn

48:                                               ; preds = %._crit_edge, %13
  %.014 = phi i32 [ %14, %13 ], [ %46, %._crit_edge ]
  ret i32 %.014
}

declare noundef zeroext i1 @_ZN5state7inFinalEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1

declare noundef i32 @_ZN5state5scoreEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1

; 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 dso_local void @_ZNSt6vectorI5stateSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

declare void @_ZN5state6expandEiRSt6vectorIS_SaIS_EE(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; 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 nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP5stateSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 = { 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 #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"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass