; LLVM IR from thepowersgang/mrustc :: src/mir/mir_builder.ll (ZNK8VarStateeqERKS_)

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

%"struct.VarState::Data_MovedOut" = type <{ %"class.std::unique_ptr.31", i32, [4 x i8] }>
%"class.std::unique_ptr.31" = type { %"struct.std::__uniq_ptr_data.32" }
%"struct.std::__uniq_ptr_data.32" = type { %"class.std::__uniq_ptr_impl.33" }
%"class.std::__uniq_ptr_impl.33" = type { %"class.std::tuple.34" }
%"class.std::tuple.34" = type { %"struct.std::_Tuple_impl.35" }
%"struct.std::_Tuple_impl.35" = type { %"struct.std::_Head_base.38" }
%"struct.std::_Head_base.38" = type { ptr }
%"struct.VarState::Data_Partial" = type <{ %"class.std::vector.26", i32, [4 x i8] }>
%"class.std::vector.26" = type { %"struct.std::_Vector_base.27" }
%"struct.std::_Vector_base.27" = type { %"struct.std::_Vector_base<VarState, std::allocator<VarState>>::_Vector_impl" }
%"struct.std::_Vector_base<VarState, std::allocator<VarState>>::_Vector_impl" = type { %"struct.std::_Vector_base<VarState, std::allocator<VarState>>::_Vector_impl_data" }
%"struct.std::_Vector_base<VarState, std::allocator<VarState>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str.6 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.76 = external hidden unnamed_addr constant [1 x i8], align 1
@_ZTIPKc = external constant ptr
@__PRETTY_FUNCTION__._ZNK8VarStateeqERKS_ = external hidden unnamed_addr constant [50 x i8], align 1

; 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

declare ptr @__cxa_allocate_exception(i64)

declare void @__cxa_throw(ptr, ptr, ptr)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK8VarStateneERKS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) #3 align 2

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK8VarStateeqERKS_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(40) %1) #3 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %18 = load ptr, ptr %4, align 8
  %19 = call noundef i32 @_ZNK8VarState3tagEv(ptr noundef nonnull align 8 dereferenceable(40) %18)
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = call noundef i32 @_ZNK8VarState3tagEv(ptr noundef nonnull align 8 dereferenceable(40) %20)
  %22 = icmp ne i32 %19, %21
  br i1 %22, label %23, label %24

23:                                               ; preds = %2
  store i1 false, ptr %3, align 1
  br label %124

24:                                               ; preds = %2
  %25 = call noundef i32 @_ZNK8VarState3tagEv(ptr noundef nonnull align 8 dereferenceable(40) %18)
  switch i32 %25, label %122 [
    i32 0, label %26
    i32 1, label %27
    i32 5, label %38
    i32 4, label %44
    i32 3, label %55
    i32 2, label %78
  ]

26:                                               ; preds = %24
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.7, i32 noundef 2389, ptr noundef @__PRETTY_FUNCTION__._ZNK8VarStateeqERKS_) #4
  unreachable

27:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK8VarState10as_InvalidEv(ptr noundef nonnull align 8 dereferenceable(40) %18)
  store ptr %28, ptr %6, align 8, !tbaa !5
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK8VarState10as_InvalidEv(ptr noundef nonnull align 8 dereferenceable(40) %30)
  store ptr %31, ptr %7, align 8, !tbaa !5
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = load i32, ptr %33, align 4, !tbaa !9
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = load i32, ptr %35, align 4, !tbaa !9
  %37 = icmp eq i32 %34, %36
  store i1 %37, ptr %3, align 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %124

38:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %39 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK8VarState8as_ValidEv(ptr noundef nonnull align 8 dereferenceable(40) %18)
  store ptr %39, ptr %8, align 8, !tbaa !5
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK8VarState8as_ValidEv(ptr noundef nonnull align 8 dereferenceable(40) %41)
  store ptr %42, ptr %9, align 8, !tbaa !5
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  store i1 true, ptr %3, align 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %124

44:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK8VarState11as_OptionalEv(ptr noundef nonnull align 8 dereferenceable(40) %18)
  store ptr %45, ptr %10, align 8, !tbaa !5
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK8VarState11as_OptionalEv(ptr noundef nonnull align 8 dereferenceable(40) %47)
  store ptr %48, ptr %11, align 8, !tbaa !5
  %49 = load ptr, ptr %11, align 8, !tbaa !5
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = load i32, ptr %50, align 4, !tbaa !11
  %52 = load ptr, ptr %11, align 8, !tbaa !5
  %53 = load i32, ptr %52, align 4, !tbaa !11
  %54 = icmp eq i32 %51, %53
  store i1 %54, ptr %3, align 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %124

55:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %56 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNK8VarState11as_MovedOutEv(ptr noundef nonnull align 8 dereferenceable(40) %18)
  store ptr %56, ptr %12, align 8, !tbaa !5
  %57 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNK8VarState11as_MovedOutEv(ptr noundef nonnull align 8 dereferenceable(40) %58)
  store ptr %59, ptr %13, align 8, !tbaa !5
  %60 = load ptr, ptr %13, align 8, !tbaa !5
  %61 = load ptr, ptr %12, align 8, !tbaa !5
  %62 = getelementptr inbounds %"struct.VarState::Data_MovedOut", ptr %61, i32 0, i32 1
  %63 = load i32, ptr %62, align 8, !tbaa !13
  %64 = load ptr, ptr %13, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.VarState::Data_MovedOut", ptr %64, i32 0, i32 1
  %66 = load i32, ptr %65, align 8, !tbaa !13
  %67 = icmp ne i32 %63, %66
  br i1 %67, label %68, label %69

68:                                               ; preds = %55
  store i1 false, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %77

69:                                               ; preds = %55
  %70 = load ptr, ptr %12, align 8, !tbaa !5
  %71 = getelementptr inbounds %"struct.VarState::Data_MovedOut", ptr %70, i32 0, i32 0
  %72 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNKSt10unique_ptrI8VarStateSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %71) #5
  %73 = load ptr, ptr %13, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.VarState::Data_MovedOut", ptr %73, i32 0, i32 0
  %75 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNKSt10unique_ptrI8VarStateSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %74) #5
  %76 = call noundef zeroext i1 @_ZNK8VarStateeqERKS_(ptr noundef nonnull align 8 dereferenceable(40) %72, ptr noundef nonnull align 8 dereferenceable(40) %75)
  store i1 %76, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %77

77:                                               ; preds = %69, %68
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %124

78:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %79 = call noundef nonnull align 8 dereferenceable(28) ptr @_ZNK8VarState10as_PartialEv(ptr noundef nonnull align 8 dereferenceable(40) %18)
  store ptr %79, ptr %15, align 8, !tbaa !5
  %80 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = call noundef nonnull align 8 dereferenceable(28) ptr @_ZNK8VarState10as_PartialEv(ptr noundef nonnull align 8 dereferenceable(40) %81)
  store ptr %82, ptr %16, align 8, !tbaa !5
  %83 = load ptr, ptr %16, align 8, !tbaa !5
  %84 = load ptr, ptr %15, align 8, !tbaa !5
  %85 = getelementptr inbounds %"struct.VarState::Data_Partial", ptr %84, i32 0, i32 0
  %86 = call noundef i64 @_ZNKSt6vectorI8VarStateSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %85) #5
  %87 = load ptr, ptr %16, align 8, !tbaa !5
  %88 = getelementptr inbounds %"struct.VarState::Data_Partial", ptr %87, i32 0, i32 0
  %89 = call noundef i64 @_ZNKSt6vectorI8VarStateSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %88) #5
  %90 = icmp ne i64 %86, %89
  br i1 %90, label %91, label %92

91:                                               ; preds = %78
  store i1 false, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %121

92:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !11
  br label %93

93:                                               ; preds = %115, %92
  %94 = load i32, ptr %17, align 4, !tbaa !11
  %95 = zext i32 %94 to i64
  %96 = load ptr, ptr %15, align 8, !tbaa !5
  %97 = getelementptr inbounds %"struct.VarState::Data_Partial", ptr %96, i32 0, i32 0
  %98 = call noundef i64 @_ZNKSt6vectorI8VarStateSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %97) #5
  %99 = icmp ult i64 %95, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %93
  store i32 3, ptr %14, align 4
  br label %118

101:                                              ; preds = %93
  %102 = load ptr, ptr %15, align 8, !tbaa !5
  %103 = getelementptr inbounds %"struct.VarState::Data_Partial", ptr %102, i32 0, i32 0
  %104 = load i32, ptr %17, align 4, !tbaa !11
  %105 = zext i32 %104 to i64
  %106 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNKSt6vectorI8VarStateSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %103, i64 noundef %105) #5
  %107 = load ptr, ptr %16, align 8, !tbaa !5
  %108 = getelementptr inbounds %"struct.VarState::Data_Partial", ptr %107, i32 0, i32 0
  %109 = load i32, ptr %17, align 4, !tbaa !11
  %110 = zext i32 %109 to i64
  %111 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNKSt6vectorI8VarStateSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %108, i64 noundef %110) #5
  %112 = call noundef zeroext i1 @_ZNK8VarStateneERKS_(ptr noundef nonnull align 8 dereferenceable(40) %106, ptr noundef nonnull align 8 dereferenceable(40) %111)
  br i1 %112, label %113, label %114

113:                                              ; preds = %101
  store i1 false, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %118

114:                                              ; preds = %101
  br label %115

115:                                              ; preds = %114
  %116 = load i32, ptr %17, align 4, !tbaa !11
  %117 = add i32 %116, 1
  store i32 %117, ptr %17, align 4, !tbaa !11
  br label %93, !llvm.loop !21

118:                                              ; preds = %113, %100
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  %119 = load i32, ptr %14, align 4
  switch i32 %119, label %121 [
    i32 3, label %120
  ]

120:                                              ; preds = %118
  store i1 true, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %121

121:                                              ; preds = %120, %118, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %124

122:                                              ; preds = %24
  %123 = call ptr @__cxa_allocate_exception(i64 8) #5
  store ptr @.str.76, ptr %123, align 16, !tbaa !5
  call void @__cxa_throw(ptr %123, ptr @_ZTIPKc, ptr null) #6
  unreachable

124:                                              ; preds = %121, %77, %44, %38, %27, %23
  %125 = load i1, ptr %3, align 1
  ret i1 %125
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "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 = { 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 = { noreturn nounwind }
attributes #5 = { nounwind }
attributes #6 = { noreturn }

!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 = !{!"_ZTS11InvalidType", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 8}
!14 = !{!"_ZTSN8VarState13Data_MovedOutE", !15, i64 0, !12, i64 8}
!15 = !{!"_ZTSSt10unique_ptrI8VarStateSt14default_deleteIS0_EE", !16, i64 0}
!16 = !{!"_ZTSSt15__uniq_ptr_dataI8VarStateSt14default_deleteIS0_ELb1ELb1EE", !17, i64 0}
!17 = !{!"_ZTSSt15__uniq_ptr_implI8VarStateSt14default_deleteIS0_EE", !18, i64 0}
!18 = !{!"_ZTSSt5tupleIJP8VarStateSt14default_deleteIS0_EEE", !19, i64 0}
!19 = !{!"_ZTSSt11_Tuple_implILm0EJP8VarStateSt14default_deleteIS0_EEE", !20, i64 0}
!20 = !{!"_ZTSSt10_Head_baseILm0EP8VarStateLb0EE", !6, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"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"

@.str.6 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.76 = external hidden unnamed_addr constant [1 x i8], align 1
@_ZTIPKc = external constant ptr
@__PRETTY_FUNCTION__._ZNK8VarStateeqERKS_ = external hidden unnamed_addr constant [50 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK8VarStateneERKS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #2 align 2

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK8VarStateeqERKS_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(40) %1) local_unnamed_addr #2 align 2 {
  %3 = tail call noundef i32 @_ZNK8VarState3tagEv(ptr noundef nonnull align 8 dereferenceable(40) %0)
  %4 = tail call noundef i32 @_ZNK8VarState3tagEv(ptr noundef nonnull align 8 dereferenceable(40) %1)
  %.not55 = icmp eq i32 %3, %4
  br i1 %.not55, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %2, %tailrecurse
  %.tr4157 = phi ptr [ %30, %tailrecurse ], [ %1, %2 ]
  %.tr56 = phi ptr [ %29, %tailrecurse ], [ %0, %2 ]
  %5 = tail call noundef i32 @_ZNK8VarState3tagEv(ptr noundef nonnull align 8 dereferenceable(40) %.tr56)
  switch i32 %5, label %47 [
    i32 0, label %6
    i32 1, label %7
    i32 5, label %13
    i32 4, label %16
    i32 3, label %22
    i32 2, label %33
  ]

6:                                                ; preds = %.lr.ph
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.7, i32 noundef 2389, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK8VarStateeqERKS_) #3
  unreachable

7:                                                ; preds = %.lr.ph
  %8 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK8VarState10as_InvalidEv(ptr noundef nonnull align 8 dereferenceable(40) %.tr56)
  %9 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK8VarState10as_InvalidEv(ptr noundef nonnull align 8 dereferenceable(40) %.tr4157)
  %10 = load i32, ptr %8, align 4, !tbaa !5
  %11 = load i32, ptr %9, align 4, !tbaa !5
  %12 = icmp eq i32 %10, %11
  br label %.loopexit

13:                                               ; preds = %.lr.ph
  %14 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK8VarState8as_ValidEv(ptr noundef nonnull align 8 dereferenceable(40) %.tr56)
  %15 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK8VarState8as_ValidEv(ptr noundef nonnull align 8 dereferenceable(40) %.tr4157)
  br label %.loopexit

16:                                               ; preds = %.lr.ph
  %17 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK8VarState11as_OptionalEv(ptr noundef nonnull align 8 dereferenceable(40) %.tr56)
  %18 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK8VarState11as_OptionalEv(ptr noundef nonnull align 8 dereferenceable(40) %.tr4157)
  %19 = load i32, ptr %17, align 4, !tbaa !9
  %20 = load i32, ptr %18, align 4, !tbaa !9
  %21 = icmp eq i32 %19, %20
  br label %.loopexit

22:                                               ; preds = %.lr.ph
  %23 = tail call noundef nonnull align 8 dereferenceable(12) ptr @_ZNK8VarState11as_MovedOutEv(ptr noundef nonnull align 8 dereferenceable(40) %.tr56)
  %24 = tail call noundef nonnull align 8 dereferenceable(12) ptr @_ZNK8VarState11as_MovedOutEv(ptr noundef nonnull align 8 dereferenceable(40) %.tr4157)
  %25 = getelementptr inbounds i8, ptr %23, i64 8
  %26 = load i32, ptr %25, align 8, !tbaa !11
  %27 = getelementptr inbounds i8, ptr %24, i64 8
  %28 = load i32, ptr %27, align 8, !tbaa !11
  %.not40 = icmp eq i32 %26, %28
  br i1 %.not40, label %tailrecurse, label %.loopexit

tailrecurse:                                      ; preds = %22
  %29 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNKSt10unique_ptrI8VarStateSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #4
  %30 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNKSt10unique_ptrI8VarStateSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #4
  %31 = tail call noundef i32 @_ZNK8VarState3tagEv(ptr noundef nonnull align 8 dereferenceable(40) %29)
  %32 = tail call noundef i32 @_ZNK8VarState3tagEv(ptr noundef nonnull align 8 dereferenceable(40) %30)
  %.not = icmp eq i32 %31, %32
  br i1 %.not, label %.lr.ph, label %.loopexit

33:                                               ; preds = %.lr.ph
  %34 = tail call noundef nonnull align 8 dereferenceable(28) ptr @_ZNK8VarState10as_PartialEv(ptr noundef nonnull align 8 dereferenceable(40) %.tr56)
  %35 = tail call noundef nonnull align 8 dereferenceable(28) ptr @_ZNK8VarState10as_PartialEv(ptr noundef nonnull align 8 dereferenceable(40) %.tr4157)
  %36 = tail call noundef i64 @_ZNKSt6vectorI8VarStateSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %34) #4
  %37 = tail call noundef i64 @_ZNKSt6vectorI8VarStateSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #4
  %.not38 = icmp eq i64 %36, %37
  br i1 %.not38, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %33
  %38 = tail call noundef i64 @_ZNKSt6vectorI8VarStateSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %34) #4
  %.not3958 = icmp eq i64 %38, 0
  br i1 %.not3958, label %.loopexit, label %.lr.ph60

39:                                               ; preds = %.lr.ph60
  %40 = add i32 %.059, 1
  %41 = zext i32 %40 to i64
  %42 = tail call noundef i64 @_ZNKSt6vectorI8VarStateSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %34) #4
  %.not39.not = icmp ugt i64 %42, %41
  br i1 %.not39.not, label %.lr.ph60, label %.loopexit.loopexit, !llvm.loop !20

.lr.ph60:                                         ; preds = %.preheader, %39
  %43 = phi i64 [ %41, %39 ], [ 0, %.preheader ]
  %.059 = phi i32 [ %40, %39 ], [ 0, %.preheader ]
  %44 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNKSt6vectorI8VarStateSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef %43) #4
  %45 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNKSt6vectorI8VarStateSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef %43) #4
  %46 = tail call noundef zeroext i1 @_ZNK8VarStateneERKS_(ptr noundef nonnull align 8 dereferenceable(40) %44, ptr noundef nonnull align 8 dereferenceable(40) %45)
  br i1 %46, label %.loopexit.loopexit, label %39

47:                                               ; preds = %.lr.ph
  %48 = tail call ptr @__cxa_allocate_exception(i64 8) #4
  store ptr @.str.76, ptr %48, align 16, !tbaa !22
  tail call void @__cxa_throw(ptr nonnull %48, ptr nonnull @_ZTIPKc, ptr null) #5
  unreachable

.loopexit.loopexit:                               ; preds = %39, %.lr.ph60
  %.3.ph = xor i1 %46, true
  br label %.loopexit

.loopexit:                                        ; preds = %tailrecurse, %22, %.loopexit.loopexit, %2, %.preheader, %33, %16, %13, %7
  %.3 = phi i1 [ %21, %16 ], [ true, %13 ], [ %12, %7 ], [ false, %33 ], [ true, %.preheader ], [ false, %2 ], [ %.3.ph, %.loopexit.loopexit ], [ false, %22 ], [ false, %tailrecurse ]
  ret i1 %.3
}

attributes #0 = { noreturn nounwind "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 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 #2 = { 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 #3 = { noreturn nounwind }
attributes #4 = { nounwind }
attributes #5 = { noreturn }

!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 = !{!"_ZTS11InvalidType", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"_ZTSN8VarState13Data_MovedOutE", !13, i64 0, !10, i64 8}
!13 = !{!"_ZTSSt10unique_ptrI8VarStateSt14default_deleteIS0_EE", !14, i64 0}
!14 = !{!"_ZTSSt15__uniq_ptr_dataI8VarStateSt14default_deleteIS0_ELb1ELb1EE", !15, i64 0}
!15 = !{!"_ZTSSt15__uniq_ptr_implI8VarStateSt14default_deleteIS0_EE", !16, i64 0}
!16 = !{!"_ZTSSt5tupleIJP8VarStateSt14default_deleteIS0_EEE", !17, i64 0}
!17 = !{!"_ZTSSt11_Tuple_implILm0EJP8VarStateSt14default_deleteIS0_EEE", !18, i64 0}
!18 = !{!"_ZTSSt10_Head_baseILm0EP8VarStateLb0EE", !19, i64 0}
!19 = !{!"any pointer", !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!19, !19, i64 0}


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