; LLVM IR from quantumlib/Stim :: src/stim/gates/gates.ll (ZN4stim11GateDataMapC2Ev)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_string_view" = type { i64, ptr }
%"struct.stim::GateDataMap" = type { %"struct.std::array", %"struct.std::array.0" }
%"struct.std::array" = type { [512 x %"struct.stim::GateDataMapHashEntry"] }
%"struct.stim::GateDataMapHashEntry" = type { i8, %"class.std::basic_string_view" }
%"struct.std::array.0" = 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.4", ptr }
%"class.stim::FixedCapVector" = type { %"struct.std::array.1", i64 }
%"struct.std::array.1" = type { [4 x %"class.stim::FixedCapVector.2"] }
%"class.stim::FixedCapVector.2" = type { %"struct.std::array.3", i64 }
%"struct.std::array.3" = type { [4 x %"class.std::complex"] }
%"class.std::complex" = type { { float, float } }
%"class.stim::FixedCapVector.4" = type { %"struct.std::array.5", i64 }
%"struct.std::array.5" = type { [10 x ptr] }

@.str = external hidden unnamed_addr constant [11 x i8], align 1
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [32 x i8], align 1
@_ZTISt12out_of_range = external constant ptr

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4stim11GateDataMapC2Ev(ptr noundef nonnull align 8 dereferenceable(38528) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i8, align 1
  %4 = alloca %"class.std::basic_string_view", align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %8 = load ptr, ptr %2, align 8
  %9 = getelementptr inbounds %"struct.stim::GateDataMap", ptr %8, i32 0, i32 0
  call void @_ZNSt5arrayIN4stim20GateDataMapHashEntryELm512EEC2Ev(ptr noundef nonnull align 8 dereferenceable(12288) %9) #8
  %10 = getelementptr inbounds %"struct.stim::GateDataMap", ptr %8, i32 0, i32 1
  call void @_ZNSt5arrayIN4stim4GateELm82EEC2Ev(ptr noundef nonnull align 8 dereferenceable(26240) %10)
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #8
  store i8 0, ptr %3, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #8
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef @.str) #8
  %11 = getelementptr inbounds %"struct.stim::GateDataMap", ptr %8, i32 0, i32 1
  %12 = call noundef nonnull align 8 dereferenceable(320) ptr @_ZNSt5arrayIN4stim4GateELm82EEixEm(ptr noundef nonnull align 8 dereferenceable(26240) %11, i64 noundef 0) #8
  %13 = getelementptr inbounds %"struct.stim::Gate", ptr %12, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %4, i64 16, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #8
  call void @_ZN4stim11GateDataMap25add_gate_data_annotationsERb(ptr noundef nonnull align 8 dereferenceable(38528) %8, ptr noundef nonnull align 1 dereferenceable(1) %3)
  call void @_ZN4stim11GateDataMap20add_gate_data_blocksERb(ptr noundef nonnull align 8 dereferenceable(38528) %8, ptr noundef nonnull align 1 dereferenceable(1) %3)
  call void @_ZN4stim11GateDataMap24add_gate_data_collapsingERb(ptr noundef nonnull align 8 dereferenceable(38528) %8, ptr noundef nonnull align 1 dereferenceable(1) %3)
  call void @_ZN4stim11GateDataMap24add_gate_data_controlledERb(ptr noundef nonnull align 8 dereferenceable(38528) %8, ptr noundef nonnull align 1 dereferenceable(1) %3)
  call void @_ZN4stim11GateDataMap18add_gate_data_hadaERb(ptr noundef nonnull align 8 dereferenceable(38528) %8, ptr noundef nonnull align 1 dereferenceable(1) %3)
  call void @_ZN4stim11GateDataMap22add_gate_data_heraldedERb(ptr noundef nonnull align 8 dereferenceable(38528) %8, ptr noundef nonnull align 1 dereferenceable(1) %3)
  call void @_ZN4stim11GateDataMap19add_gate_data_noisyERb(ptr noundef nonnull align 8 dereferenceable(38528) %8, ptr noundef nonnull align 1 dereferenceable(1) %3)
  call void @_ZN4stim11GateDataMap19add_gate_data_pauliERb(ptr noundef nonnull align 8 dereferenceable(38528) %8, ptr noundef nonnull align 1 dereferenceable(1) %3)
  call void @_ZN4stim11GateDataMap22add_gate_data_period_3ERb(ptr noundef nonnull align 8 dereferenceable(38528) %8, ptr noundef nonnull align 1 dereferenceable(1) %3)
  call void @_ZN4stim11GateDataMap22add_gate_data_period_4ERb(ptr noundef nonnull align 8 dereferenceable(38528) %8, ptr noundef nonnull align 1 dereferenceable(1) %3)
  call void @_ZN4stim11GateDataMap16add_gate_data_ppERb(ptr noundef nonnull align 8 dereferenceable(38528) %8, ptr noundef nonnull align 1 dereferenceable(1) %3)
  call void @_ZN4stim11GateDataMap19add_gate_data_swapsERb(ptr noundef nonnull align 8 dereferenceable(38528) %8, ptr noundef nonnull align 1 dereferenceable(1) %3)
  call void @_ZN4stim11GateDataMap26add_gate_data_pair_measureERb(ptr noundef nonnull align 8 dereferenceable(38528) %8, ptr noundef nonnull align 1 dereferenceable(1) %3)
  call void @_ZN4stim11GateDataMap27add_gate_data_pauli_productERb(ptr noundef nonnull align 8 dereferenceable(38528) %8, ptr noundef nonnull align 1 dereferenceable(1) %3)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  store i64 1, ptr %5, align 8, !tbaa !12
  br label %14

14:                                               ; preds = %30, %1
  %15 = load i64, ptr %5, align 8, !tbaa !12
  %16 = icmp ult i64 %15, 82
  br i1 %16, label %18, label %17

17:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  br label %33

18:                                               ; preds = %14
  %19 = getelementptr inbounds %"struct.stim::GateDataMap", ptr %8, i32 0, i32 1
  %20 = load i64, ptr %5, align 8, !tbaa !12
  %21 = call noundef nonnull align 8 dereferenceable(320) ptr @_ZNSt5arrayIN4stim4GateELm82EEixEm(ptr noundef nonnull align 8 dereferenceable(26240) %19, i64 noundef %20) #8
  %22 = getelementptr inbounds %"struct.stim::Gate", ptr %21, i32 0, i32 0
  %23 = call noundef zeroext i1 @_ZNKSt17basic_string_viewIcSt11char_traitsIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(16) %22) #8
  br i1 %23, label %24, label %29

24:                                               ; preds = %18
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.1)
  %26 = load i64, ptr %5, align 8, !tbaa !12
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %25, i64 noundef %26)
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef @.str.2)
  store i8 1, ptr %3, align 1, !tbaa !9
  br label %29

29:                                               ; preds = %24, %18
  br label %30

30:                                               ; preds = %29
  %31 = load i64, ptr %5, align 8, !tbaa !12
  %32 = add i64 %31, 1
  store i64 %32, ptr %5, align 8, !tbaa !12
  br label %14, !llvm.loop !14

33:                                               ; preds = %17
  %34 = load i8, ptr %3, align 1, !tbaa !9, !range !16, !noundef !17
  %35 = trunc i8 %34 to i1
  br i1 %35, label %36, label %43

36:                                               ; preds = %33
  %37 = call ptr @__cxa_allocate_exception(i64 16) #8
  invoke void @_ZNSt12out_of_rangeC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %37, ptr noundef @.str.3)
          to label %38 unwind label %39

38:                                               ; preds = %36
  call void @__cxa_throw(ptr %37, ptr @_ZTISt12out_of_range, ptr @_ZNSt12out_of_rangeD1Ev) #9
  unreachable

39:                                               ; preds = %36
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %6, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %7, align 4
  call void @__cxa_free_exception(ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #8
  br label %44

43:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #8
  ret void

44:                                               ; preds = %39
  %45 = load ptr, ptr %6, align 8
  %46 = load i32, ptr %7, align 4
  %47 = insertvalue { ptr, i32 } poison, ptr %45, 0
  %48 = insertvalue { ptr, i32 } %47, i32 %46, 1
  resume { ptr, i32 } %48
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5arrayIN4stim20GateDataMapHashEntryELm512EEC2Ev(ptr noundef nonnull align 8 dereferenceable(12288)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNSt5arrayIN4stim4GateELm82EEC2Ev(ptr noundef nonnull align 8 dereferenceable(26240)) unnamed_addr #2 align 2

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

declare void @_ZN4stim11GateDataMap25add_gate_data_annotationsERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) #6

declare void @_ZN4stim11GateDataMap20add_gate_data_blocksERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) #6

declare void @_ZN4stim11GateDataMap24add_gate_data_collapsingERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) #6

declare void @_ZN4stim11GateDataMap24add_gate_data_controlledERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) #6

declare void @_ZN4stim11GateDataMap18add_gate_data_hadaERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) #6

declare void @_ZN4stim11GateDataMap22add_gate_data_heraldedERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) #6

declare void @_ZN4stim11GateDataMap19add_gate_data_noisyERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) #6

declare void @_ZN4stim11GateDataMap19add_gate_data_pauliERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) #6

declare void @_ZN4stim11GateDataMap22add_gate_data_period_3ERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) #6

declare void @_ZN4stim11GateDataMap22add_gate_data_period_4ERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) #6

declare void @_ZN4stim11GateDataMap16add_gate_data_ppERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) #6

declare void @_ZN4stim11GateDataMap19add_gate_data_swapsERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) #6

declare void @_ZN4stim11GateDataMap26add_gate_data_pair_measureERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) #6

declare void @_ZN4stim11GateDataMap27add_gate_data_pauli_productERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2

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

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZNSt12out_of_rangeC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #6

declare i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr)

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

declare void @__cxa_throw(ptr, ptr, ptr)

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 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { "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 "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 #8 = { nounwind }
attributes #9 = { 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 = !{!"bool", !7, i64 0}
!11 = !{i64 0, i64 8, !12, i64 8, i64 8, !5}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{i8 0, i8 2}
!17 = !{}


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_string_view" = type { i64, ptr }

@.str = external hidden unnamed_addr constant [11 x i8], align 1
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [32 x i8], align 1
@_ZTISt12out_of_range = external constant ptr

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4stim11GateDataMapC2Ev(ptr noundef nonnull align 8 dereferenceable(38528) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i8, align 1
  %3 = alloca %"class.std::basic_string_view", align 8
  tail call void @_ZNSt5arrayIN4stim20GateDataMapHashEntryELm512EEC2Ev(ptr noundef nonnull align 8 dereferenceable(12288) %0) #8
  %4 = getelementptr inbounds i8, ptr %0, i64 12288
  tail call void @_ZNSt5arrayIN4stim4GateELm82EEC2Ev(ptr noundef nonnull align 8 dereferenceable(26240) %4)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #8
  store i8 0, ptr %2, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #8
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef @.str) #8
  %5 = call noundef nonnull align 8 dereferenceable(320) ptr @_ZNSt5arrayIN4stim4GateELm82EEixEm(ptr noundef nonnull align 8 dereferenceable(26240) %4, i64 noundef 0) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %3, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #8
  call void @_ZN4stim11GateDataMap25add_gate_data_annotationsERb(ptr noundef nonnull align 8 dereferenceable(38528) %0, ptr noundef nonnull align 1 dereferenceable(1) %2)
  call void @_ZN4stim11GateDataMap20add_gate_data_blocksERb(ptr noundef nonnull align 8 dereferenceable(38528) %0, ptr noundef nonnull align 1 dereferenceable(1) %2)
  call void @_ZN4stim11GateDataMap24add_gate_data_collapsingERb(ptr noundef nonnull align 8 dereferenceable(38528) %0, ptr noundef nonnull align 1 dereferenceable(1) %2)
  call void @_ZN4stim11GateDataMap24add_gate_data_controlledERb(ptr noundef nonnull align 8 dereferenceable(38528) %0, ptr noundef nonnull align 1 dereferenceable(1) %2)
  call void @_ZN4stim11GateDataMap18add_gate_data_hadaERb(ptr noundef nonnull align 8 dereferenceable(38528) %0, ptr noundef nonnull align 1 dereferenceable(1) %2)
  call void @_ZN4stim11GateDataMap22add_gate_data_heraldedERb(ptr noundef nonnull align 8 dereferenceable(38528) %0, ptr noundef nonnull align 1 dereferenceable(1) %2)
  call void @_ZN4stim11GateDataMap19add_gate_data_noisyERb(ptr noundef nonnull align 8 dereferenceable(38528) %0, ptr noundef nonnull align 1 dereferenceable(1) %2)
  call void @_ZN4stim11GateDataMap19add_gate_data_pauliERb(ptr noundef nonnull align 8 dereferenceable(38528) %0, ptr noundef nonnull align 1 dereferenceable(1) %2)
  call void @_ZN4stim11GateDataMap22add_gate_data_period_3ERb(ptr noundef nonnull align 8 dereferenceable(38528) %0, ptr noundef nonnull align 1 dereferenceable(1) %2)
  call void @_ZN4stim11GateDataMap22add_gate_data_period_4ERb(ptr noundef nonnull align 8 dereferenceable(38528) %0, ptr noundef nonnull align 1 dereferenceable(1) %2)
  call void @_ZN4stim11GateDataMap16add_gate_data_ppERb(ptr noundef nonnull align 8 dereferenceable(38528) %0, ptr noundef nonnull align 1 dereferenceable(1) %2)
  call void @_ZN4stim11GateDataMap19add_gate_data_swapsERb(ptr noundef nonnull align 8 dereferenceable(38528) %0, ptr noundef nonnull align 1 dereferenceable(1) %2)
  call void @_ZN4stim11GateDataMap26add_gate_data_pair_measureERb(ptr noundef nonnull align 8 dereferenceable(38528) %0, ptr noundef nonnull align 1 dereferenceable(1) %2)
  call void @_ZN4stim11GateDataMap27add_gate_data_pauli_productERb(ptr noundef nonnull align 8 dereferenceable(38528) %0, ptr noundef nonnull align 1 dereferenceable(1) %2)
  br label %9

6:                                                ; preds = %16
  %7 = load i8, ptr %2, align 1, !tbaa !5, !range !14, !noundef !15
  %8 = trunc nuw i8 %7 to i1
  br i1 %8, label %18, label %23

9:                                                ; preds = %1, %16
  %.06 = phi i64 [ 1, %1 ], [ %17, %16 ]
  %10 = call noundef nonnull align 8 dereferenceable(320) ptr @_ZNSt5arrayIN4stim4GateELm82EEixEm(ptr noundef nonnull align 8 dereferenceable(26240) %4, i64 noundef %.06) #8
  %11 = call noundef zeroext i1 @_ZNKSt17basic_string_viewIcSt11char_traitsIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(16) %10) #8
  br i1 %11, label %12, label %16

12:                                               ; preds = %9
  %13 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.1)
  %14 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %13, i64 noundef %.06)
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull @.str.2)
  store i8 1, ptr %2, align 1, !tbaa !5
  br label %16

16:                                               ; preds = %9, %12
  %17 = add nuw nsw i64 %.06, 1
  %exitcond.not = icmp eq i64 %17, 82
  br i1 %exitcond.not, label %6, label %9, !llvm.loop !16

18:                                               ; preds = %6
  %19 = call ptr @__cxa_allocate_exception(i64 16) #8
  invoke void @_ZNSt12out_of_rangeC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull @.str.3)
          to label %20 unwind label %21

20:                                               ; preds = %18
  call void @__cxa_throw(ptr nonnull %19, ptr nonnull @_ZTISt12out_of_range, ptr nonnull @_ZNSt12out_of_rangeD1Ev) #9
  unreachable

21:                                               ; preds = %18
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #8
  resume { ptr, i32 } %22

23:                                               ; preds = %6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #8
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5arrayIN4stim20GateDataMapHashEntryELm512EEC2Ev(ptr noundef nonnull align 8 dereferenceable(12288)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNSt5arrayIN4stim4GateELm82EEC2Ev(ptr noundef nonnull align 8 dereferenceable(26240)) unnamed_addr #2 align 2

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

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

declare void @_ZN4stim11GateDataMap25add_gate_data_annotationsERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6

declare void @_ZN4stim11GateDataMap20add_gate_data_blocksERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6

declare void @_ZN4stim11GateDataMap24add_gate_data_collapsingERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6

declare void @_ZN4stim11GateDataMap24add_gate_data_controlledERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6

declare void @_ZN4stim11GateDataMap18add_gate_data_hadaERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6

declare void @_ZN4stim11GateDataMap22add_gate_data_heraldedERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6

declare void @_ZN4stim11GateDataMap19add_gate_data_noisyERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6

declare void @_ZN4stim11GateDataMap19add_gate_data_pauliERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6

declare void @_ZN4stim11GateDataMap22add_gate_data_period_3ERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6

declare void @_ZN4stim11GateDataMap22add_gate_data_period_4ERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6

declare void @_ZN4stim11GateDataMap16add_gate_data_ppERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6

declare void @_ZN4stim11GateDataMap19add_gate_data_swapsERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6

declare void @_ZN4stim11GateDataMap26add_gate_data_pair_measureERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6

declare void @_ZN4stim11GateDataMap27add_gate_data_pauli_productERb(ptr noundef nonnull align 8 dereferenceable(38528), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2

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

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZNSt12out_of_rangeC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #6

declare i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr) local_unnamed_addr

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

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

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


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