; LLVM IR from quantumlib/Stim :: src/stim/util_top/mbqc_decomposition.ll (ZN4stim18mbqc_decompositionENS_8GateTypeE)

; 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.stim::GateDataMap" = type { %"struct.std::array", %"struct.std::array.1" }
%"struct.std::array" = type { [512 x %"struct.stim::GateDataMapHashEntry"] }
%"struct.stim::GateDataMapHashEntry" = type { i8, %"class.std::basic_string_view" }
%"class.std::basic_string_view" = type { i64, ptr }
%"struct.std::array.1" = type { [82 x %"struct.stim::Gate"] }
%"struct.stim::Gate" = type { %"class.std::basic_string_view", i8, i8, i8, i16, %"class.std::basic_string_view", %"class.std::basic_string_view", %"class.stim::FixedCapVector", %"class.stim::FixedCapVector.5", ptr }
%"class.stim::FixedCapVector" = type { %"struct.std::array.2", i64 }
%"struct.std::array.2" = type { [4 x %"class.stim::FixedCapVector.3"] }
%"class.stim::FixedCapVector.3" = type { %"struct.std::array.4", i64 }
%"struct.std::array.4" = type { [4 x %"class.std::complex"] }
%"class.std::complex" = type { { float, float } }
%"class.stim::FixedCapVector.5" = type { %"struct.std::array.6", i64 }
%"struct.std::array.6" = type { [10 x ptr] }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon.0 }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon.0 = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [19 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [273 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [191 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [191 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [298 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [211 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [191 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [273 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [152 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [156 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [104 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [104 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [156 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [156 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [373 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [373 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [346 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [342 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [373 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [373 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [209 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [412 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [167 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [167 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [311 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [412 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [227 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [1252 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [1240 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [556 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [21 x i8], align 1
@_ZN4stim9GATE_DATAE = external global %"struct.stim::GateDataMap", align 8
@_ZTISt16invalid_argument = external constant ptr

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN4stim18mbqc_decompositionENS_8GateTypeE(i8 noundef zeroext %0) #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i8, align 1
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::allocator", align 1
  %9 = alloca i1, align 1
  store i8 %0, ptr %3, align 1, !tbaa !5
  %10 = load i8, ptr %3, align 1, !tbaa !5
  switch i8 %10, label %73 [
    i8 0, label %11
    i8 1, label %11
    i8 2, label %11
    i8 3, label %11
    i8 4, label %11
    i8 5, label %11
    i8 6, label %11
    i8 7, label %11
    i8 32, label %11
    i8 33, label %11
    i8 34, label %11
    i8 35, label %11
    i8 36, label %11
    i8 37, label %11
    i8 38, label %11
    i8 39, label %11
    i8 40, label %11
    i8 41, label %11
    i8 42, label %11
    i8 43, label %11
    i8 44, label %11
    i8 8, label %12
    i8 9, label %13
    i8 10, label %14
    i8 11, label %15
    i8 12, label %16
    i8 13, label %17
    i8 14, label %18
    i8 15, label %19
    i8 16, label %20
    i8 17, label %21
    i8 18, label %22
    i8 19, label %23
    i8 20, label %24
    i8 21, label %25
    i8 22, label %26
    i8 23, label %27
    i8 24, label %28
    i8 25, label %29
    i8 26, label %30
    i8 27, label %31
    i8 28, label %32
    i8 29, label %33
    i8 30, label %34
    i8 31, label %35
    i8 45, label %36
    i8 46, label %37
    i8 47, label %38
    i8 48, label %39
    i8 49, label %40
    i8 50, label %41
    i8 51, label %42
    i8 52, label %43
    i8 53, label %44
    i8 54, label %45
    i8 55, label %46
    i8 56, label %47
    i8 57, label %48
    i8 58, label %49
    i8 59, label %50
    i8 60, label %51
    i8 61, label %52
    i8 62, label %53
    i8 63, label %54
    i8 64, label %55
    i8 65, label %56
    i8 66, label %57
    i8 67, label %58
    i8 68, label %59
    i8 69, label %60
    i8 73, label %61
    i8 74, label %62
    i8 75, label %63
    i8 76, label %64
    i8 77, label %65
    i8 78, label %66
    i8 79, label %67
    i8 80, label %68
    i8 81, label %69
    i8 71, label %70
    i8 72, label %71
    i8 70, label %72
  ]

11:                                               ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
  store ptr null, ptr %2, align 8
  br label %104

12:                                               ; preds = %1
  store ptr @.str, ptr %2, align 8
  br label %104

13:                                               ; preds = %1
  store ptr @.str.1, ptr %2, align 8
  br label %104

14:                                               ; preds = %1
  store ptr @.str.2, ptr %2, align 8
  br label %104

15:                                               ; preds = %1
  store ptr @.str.3, ptr %2, align 8
  br label %104

16:                                               ; preds = %1
  store ptr @.str.4, ptr %2, align 8
  br label %104

17:                                               ; preds = %1
  store ptr @.str.5, ptr %2, align 8
  br label %104

18:                                               ; preds = %1
  store ptr @.str.3, ptr %2, align 8
  br label %104

19:                                               ; preds = %1
  store ptr @.str.4, ptr %2, align 8
  br label %104

20:                                               ; preds = %1
  store ptr @.str.5, ptr %2, align 8
  br label %104

21:                                               ; preds = %1
  store ptr @.str.6, ptr %2, align 8
  br label %104

22:                                               ; preds = %1
  store ptr @.str.7, ptr %2, align 8
  br label %104

23:                                               ; preds = %1
  store ptr @.str.8, ptr %2, align 8
  br label %104

24:                                               ; preds = %1
  store ptr @.str.9, ptr %2, align 8
  br label %104

25:                                               ; preds = %1
  store ptr @.str.10, ptr %2, align 8
  br label %104

26:                                               ; preds = %1
  store ptr @.str.11, ptr %2, align 8
  br label %104

27:                                               ; preds = %1
  store ptr @.str.12, ptr %2, align 8
  br label %104

28:                                               ; preds = %1
  store ptr @.str.13, ptr %2, align 8
  br label %104

29:                                               ; preds = %1
  store ptr @.str.14, ptr %2, align 8
  br label %104

30:                                               ; preds = %1
  store ptr @.str.15, ptr %2, align 8
  br label %104

31:                                               ; preds = %1
  store ptr @.str.16, ptr %2, align 8
  br label %104

32:                                               ; preds = %1
  store ptr @.str.17, ptr %2, align 8
  br label %104

33:                                               ; preds = %1
  store ptr @.str.18, ptr %2, align 8
  br label %104

34:                                               ; preds = %1
  store ptr @.str.19, ptr %2, align 8
  br label %104

35:                                               ; preds = %1
  store ptr @.str.20, ptr %2, align 8
  br label %104

36:                                               ; preds = %1
  store ptr @.str.21, ptr %2, align 8
  br label %104

37:                                               ; preds = %1
  store ptr @.str.22, ptr %2, align 8
  br label %104

38:                                               ; preds = %1
  store ptr @.str.23, ptr %2, align 8
  br label %104

39:                                               ; preds = %1
  store ptr @.str.24, ptr %2, align 8
  br label %104

40:                                               ; preds = %1
  store ptr @.str.25, ptr %2, align 8
  br label %104

41:                                               ; preds = %1
  store ptr @.str.26, ptr %2, align 8
  br label %104

42:                                               ; preds = %1
  store ptr @.str.27, ptr %2, align 8
  br label %104

43:                                               ; preds = %1
  store ptr @.str.28, ptr %2, align 8
  br label %104

44:                                               ; preds = %1
  store ptr @.str.29, ptr %2, align 8
  br label %104

45:                                               ; preds = %1
  store ptr @.str.30, ptr %2, align 8
  br label %104

46:                                               ; preds = %1
  store ptr @.str.31, ptr %2, align 8
  br label %104

47:                                               ; preds = %1
  store ptr @.str.32, ptr %2, align 8
  br label %104

48:                                               ; preds = %1
  store ptr @.str.33, ptr %2, align 8
  br label %104

49:                                               ; preds = %1
  store ptr @.str.34, ptr %2, align 8
  br label %104

50:                                               ; preds = %1
  store ptr @.str.35, ptr %2, align 8
  br label %104

51:                                               ; preds = %1
  store ptr @.str.36, ptr %2, align 8
  br label %104

52:                                               ; preds = %1
  store ptr @.str.37, ptr %2, align 8
  br label %104

53:                                               ; preds = %1
  store ptr @.str.38, ptr %2, align 8
  br label %104

54:                                               ; preds = %1
  store ptr @.str.39, ptr %2, align 8
  br label %104

55:                                               ; preds = %1
  store ptr @.str.40, ptr %2, align 8
  br label %104

56:                                               ; preds = %1
  store ptr @.str.41, ptr %2, align 8
  br label %104

57:                                               ; preds = %1
  store ptr @.str.42, ptr %2, align 8
  br label %104

58:                                               ; preds = %1
  store ptr @.str.43, ptr %2, align 8
  br label %104

59:                                               ; preds = %1
  store ptr @.str.44, ptr %2, align 8
  br label %104

60:                                               ; preds = %1
  store ptr @.str.45, ptr %2, align 8
  br label %104

61:                                               ; preds = %1
  store ptr @.str.46, ptr %2, align 8
  br label %104

62:                                               ; preds = %1
  store ptr @.str.47, ptr %2, align 8
  br label %104

63:                                               ; preds = %1
  store ptr @.str.48, ptr %2, align 8
  br label %104

64:                                               ; preds = %1
  store ptr @.str.49, ptr %2, align 8
  br label %104

65:                                               ; preds = %1
  store ptr @.str.50, ptr %2, align 8
  br label %104

66:                                               ; preds = %1
  store ptr @.str.51, ptr %2, align 8
  br label %104

67:                                               ; preds = %1
  store ptr @.str.52, ptr %2, align 8
  br label %104

68:                                               ; preds = %1
  store ptr @.str.53, ptr %2, align 8
  br label %104

69:                                               ; preds = %1
  store ptr @.str.54, ptr %2, align 8
  br label %104

70:                                               ; preds = %1
  store ptr @.str.55, ptr %2, align 8
  br label %104

71:                                               ; preds = %1
  store ptr @.str.56, ptr %2, align 8
  br label %104

72:                                               ; preds = %1
  store ptr @.str.57, ptr %2, align 8
  br label %104

73:                                               ; preds = %1
  store i1 true, ptr %9, align 1
  %74 = call ptr @__cxa_allocate_exception(i64 16) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #7
  %75 = load i8, ptr %3, align 1, !tbaa !5
  %76 = invoke noundef nonnull align 8 dereferenceable(320) ptr @_ZNK4stim11GateDataMapixENS_8GateTypeE(ptr noundef nonnull align 8 dereferenceable(38528) @_ZN4stim9GATE_DATAE, i8 noundef zeroext %75)
          to label %77 unwind label %82

77:                                               ; preds = %73
  %78 = getelementptr inbounds %"struct.stim::Gate", ptr %76, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ISt17basic_string_viewIcS2_EvEERKT_RKS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(16) %78, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %79 unwind label %86

79:                                               ; preds = %77
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %4, ptr noundef @.str.58, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %80 unwind label %90

80:                                               ; preds = %79
  invoke void @_ZNSt16invalid_argumentC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %74, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %81 unwind label %94

81:                                               ; preds = %80
  store i1 false, ptr %9, align 1
  invoke void @__cxa_throw(ptr %74, ptr @_ZTISt16invalid_argument, ptr @_ZNSt16invalid_argumentD1Ev) #8
          to label %111 unwind label %94

82:                                               ; preds = %73
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %6, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %7, align 4
  br label %100

86:                                               ; preds = %77
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %6, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %7, align 4
  br label %99

90:                                               ; preds = %79
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %6, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %7, align 4
  br label %98

94:                                               ; preds = %81, %80
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %6, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  br label %98

98:                                               ; preds = %94, %90
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  br label %99

99:                                               ; preds = %98, %86
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #7
  br label %100

100:                                              ; preds = %99, %82
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #7
  %101 = load i1, ptr %9, align 1
  br i1 %101, label %102, label %103

102:                                              ; preds = %100
  call void @__cxa_free_exception(ptr %74) #7
  br label %103

103:                                              ; preds = %102, %100
  br label %106

104:                                              ; preds = %72, %71, %70, %69, %68, %67, %66, %65, %64, %63, %62, %61, %60, %59, %58, %57, %56, %55, %54, %53, %52, %51, %50, %49, %48, %47, %46, %45, %44, %43, %42, %41, %40, %39, %38, %37, %36, %35, %34, %33, %32, %31, %30, %29, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11
  %105 = load ptr, ptr %2, align 8
  ret ptr %105

106:                                              ; preds = %103
  %107 = load ptr, ptr %6, align 8
  %108 = load i32, ptr %7, align 4
  %109 = insertvalue { ptr, i32 } poison, ptr %107, 0
  %110 = insertvalue { ptr, i32 } %109, i32 %108, 1
  resume { ptr, i32 } %110

111:                                              ; preds = %81
  unreachable
}

declare ptr @__cxa_allocate_exception(i64)

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(320) ptr @_ZNK4stim11GateDataMapixENS_8GateTypeE(ptr noundef nonnull align 8 dereferenceable(38528), i8 noundef zeroext) #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ISt17basic_string_viewIcS2_EvEERKT_RKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare void @_ZNSt16invalid_argumentC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #5

; Function Attrs: nounwind
declare void @_ZNSt16invalid_argumentD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #6

declare void @__cxa_throw(ptr, ptr, ptr)

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

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

declare void @__cxa_free_exception(ptr)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { 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 = { "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 #6 = { 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 #7 = { nounwind }
attributes #8 = { 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 = !{!"_ZTSN4stim8GateTypeE", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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

%"struct.stim::GateDataMap" = type { %"struct.std::array", %"struct.std::array.1" }
%"struct.std::array" = type { [512 x %"struct.stim::GateDataMapHashEntry"] }
%"struct.stim::GateDataMapHashEntry" = type { i8, %"class.std::basic_string_view" }
%"class.std::basic_string_view" = type { i64, ptr }
%"struct.std::array.1" = type { [82 x %"struct.stim::Gate"] }
%"struct.stim::Gate" = type { %"class.std::basic_string_view", i8, i8, i8, i16, %"class.std::basic_string_view", %"class.std::basic_string_view", %"class.stim::FixedCapVector", %"class.stim::FixedCapVector.5", ptr }
%"class.stim::FixedCapVector" = type { %"struct.std::array.2", i64 }
%"struct.std::array.2" = type { [4 x %"class.stim::FixedCapVector.3"] }
%"class.stim::FixedCapVector.3" = type { %"struct.std::array.4", i64 }
%"struct.std::array.4" = type { [4 x %"class.std::complex"] }
%"class.std::complex" = type { { float, float } }
%"class.stim::FixedCapVector.5" = type { %"struct.std::array.6", i64 }
%"struct.std::array.6" = type { [10 x ptr] }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon.0 }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon.0 = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [19 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [273 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [191 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [191 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [298 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [211 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [191 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [273 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [152 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [156 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [104 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [104 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [156 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [156 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [373 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [373 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [346 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [342 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [373 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [373 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [209 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [412 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [167 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [167 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [311 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [412 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [227 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [1252 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [1240 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [556 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [21 x i8], align 1
@_ZN4stim9GATE_DATAE = external global %"struct.stim::GateDataMap", align 8
@_ZTISt16invalid_argument = external constant ptr
@switch.table._ZN4stim18mbqc_decompositionENS_8GateTypeE = private unnamed_addr constant [82 x ptr] [ptr null, ptr null, ptr null, ptr null, ptr null, ptr null, ptr null, ptr null, ptr @.str, ptr @.str.1, ptr @.str.2, ptr @.str.3, ptr @.str.4, ptr @.str.5, ptr @.str.3, ptr @.str.4, ptr @.str.5, ptr @.str.6, ptr @.str.7, ptr @.str.8, ptr @.str.9, ptr @.str.10, ptr @.str.11, ptr @.str.12, ptr @.str.13, ptr @.str.14, ptr @.str.15, ptr @.str.16, ptr @.str.17, ptr @.str.18, ptr @.str.19, ptr @.str.20, ptr null, ptr null, ptr null, ptr null, ptr null, ptr null, ptr null, ptr null, ptr null, ptr null, ptr null, ptr null, ptr null, ptr @.str.21, ptr @.str.22, ptr @.str.23, ptr @.str.24, ptr @.str.25, ptr @.str.26, ptr @.str.27, ptr @.str.28, ptr @.str.29, ptr @.str.30, ptr @.str.31, ptr @.str.32, ptr @.str.33, ptr @.str.34, ptr @.str.35, ptr @.str.36, ptr @.str.37, ptr @.str.38, ptr @.str.39, ptr @.str.40, ptr @.str.41, ptr @.str.42, ptr @.str.43, ptr @.str.44, ptr @.str.45, ptr @.str.57, ptr @.str.55, ptr @.str.56, ptr @.str.46, ptr @.str.47, ptr @.str.48, ptr @.str.49, ptr @.str.50, ptr @.str.51, ptr @.str.52, ptr @.str.53, ptr @.str.54], align 8

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN4stim18mbqc_decompositionENS_8GateTypeE(i8 noundef zeroext %0) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = icmp ult i8 %0, 82
  br i1 %5, label %switch.lookup, label %6

6:                                                ; preds = %1
  %7 = tail call ptr @__cxa_allocate_exception(i64 16) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #7
  %8 = tail call noundef nonnull align 8 dereferenceable(320) ptr @_ZNK4stim11GateDataMapixENS_8GateTypeE(ptr noundef nonnull align 8 dereferenceable(38528) @_ZN4stim9GATE_DATAE, i8 noundef zeroext %0)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ISt17basic_string_viewIcS2_EvEERKT_RKS3_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %9 unwind label %.thread

9:                                                ; preds = %6
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %2, ptr noundef nonnull @.str.58, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %10 unwind label %13

10:                                               ; preds = %9
  invoke void @_ZNSt16invalid_argumentC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %11 unwind label %15

11:                                               ; preds = %10
  invoke void @__cxa_throw(ptr nonnull %7, ptr nonnull @_ZTISt16invalid_argument, ptr nonnull @_ZNSt16invalid_argumentD1Ev) #8
          to label %21 unwind label %15

.thread:                                          ; preds = %6
  %12 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #7
  br label %18

13:                                               ; preds = %9
  %14 = landingpad { ptr, i32 }
          cleanup
  br label %17

15:                                               ; preds = %11, %10
  %.0 = phi i1 [ false, %11 ], [ true, %10 ]
  %16 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  br label %17

17:                                               ; preds = %13, %15
  %.pn = phi { ptr, i32 } [ %16, %15 ], [ %14, %13 ]
  %.1 = phi i1 [ %.0, %15 ], [ true, %13 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #7
  br i1 %.1, label %18, label %20

18:                                               ; preds = %.thread, %17
  %.pn.pn15 = phi { ptr, i32 } [ %12, %.thread ], [ %.pn, %17 ]
  call void @__cxa_free_exception(ptr %7) #7
  br label %20

switch.lookup:                                    ; preds = %1
  %19 = zext nneg i8 %0 to i64
  %switch.gep = getelementptr inbounds [82 x ptr], ptr @switch.table._ZN4stim18mbqc_decompositionENS_8GateTypeE, i64 0, i64 %19
  %switch.load = load ptr, ptr %switch.gep, align 8
  ret ptr %switch.load

20:                                               ; preds = %17, %18
  %.pn.pn14 = phi { ptr, i32 } [ %.pn, %17 ], [ %.pn.pn15, %18 ]
  resume { ptr, i32 } %.pn.pn14

21:                                               ; preds = %11
  unreachable
}

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(320) ptr @_ZNK4stim11GateDataMapixENS_8GateTypeE(ptr noundef nonnull align 8 dereferenceable(38528), i8 noundef zeroext) local_unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ISt17basic_string_viewIcS2_EvEERKT_RKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare void @_ZNSt16invalid_argumentC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #5

; Function Attrs: nounwind
declare void @_ZNSt16invalid_argumentD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #6

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

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

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

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { 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 = { "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 #6 = { 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 #7 = { nounwind }
attributes #8 = { 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)"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass