; LLVM IR from chrxh/alien :: source/Gui/LocationHelper.ll (ZN14LocationHelper12findLocationER20SimulationParametersi)

; 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::variant" = type { %"struct.std::__detail::__variant::_Variant_base.base", [7 x i8] }
%"struct.std::__detail::__variant::_Variant_base.base" = type { %"struct.std::__detail::__variant::_Move_assign_base.base" }
%"struct.std::__detail::__variant::_Move_assign_base.base" = type { %"struct.std::__detail::__variant::_Copy_assign_base.base" }
%"struct.std::__detail::__variant::_Copy_assign_base.base" = type { %"struct.std::__detail::__variant::_Move_ctor_base.base" }
%"struct.std::__detail::__variant::_Move_ctor_base.base" = type { %"struct.std::__detail::__variant::_Copy_ctor_base.base" }
%"struct.std::__detail::__variant::_Copy_ctor_base.base" = type { %"struct.std::__detail::__variant::_Variant_storage.base" }
%"struct.std::__detail::__variant::_Variant_storage.base" = type <{ %"union.std::__detail::__variant::_Variadic_union", i8 }>
%"union.std::__detail::__variant::_Variadic_union" = type { %"struct.std::__detail::__variant::_Uninitialized" }
%"struct.std::__detail::__variant::_Uninitialized" = type { ptr }
%struct.SimulationParameters = type <{ [64 x i8], %struct.Features, [2 x i8], i32, [40 x %struct.RadiationSource], i8, [3 x i8], float, [7 x float], [7 x float], [7 x float], i8, [3 x i8], float, i32, [20 x %struct.SimulationParametersZone], i32, i8, i8, i8, i8, i32, i32, float, float, i32, float, i8, i8, [2 x i8], float, i8, [3 x i8], %struct.SimulationParametersZoneValues, float, i32, %union.MotionData, float, float, [7 x float], [7 x float], float, float, i32, [7 x float], [7 x float], [7 x float], [7 x i32], float, float, float, [7 x i32], [7 x float], [7 x float], [7 x float], [7 x float], i32, [7 x i32], i8, i8, [2 x i8], [7 x i32], i8, [3 x i8], i32, i8, i8, i8, i8, i32, [7 x float], [7 x float], [7 x float], i8, [7 x [7 x i8]], i8, i8, float, float, float, float, float, float, i32, [7 x float], [7 x [7 x i32]], float, [7 x float], [7 x float], [7 x float], [7 x float], [7 x float], [7 x [7 x float]], [7 x float], float, i8, [3 x i8], [7 x float], [7 x float], i8, [3 x i8], [7 x float], [7 x float], [7 x float], [7 x float], [7 x float], [7 x float], float, i8, [3 x i8], [7 x float], [7 x float], float, [7 x float], float, [7 x float], [7 x float], float, i8, [3 x i8] }>
%struct.Features = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
%struct.RadiationSource = type { [64 x i8], i32, float, i8, float, float, float, float, i8, float, i32, %union.RadiationSourceShapeData }
%union.RadiationSourceShapeData = type { %struct.RectangularRadiationSource }
%struct.RectangularRadiationSource = type { float, float }
%struct.SimulationParametersZone = type { [64 x i8], i32, i32, float, float, float, float, float, i32, %union.SpotShapeData, i32, %union.FlowData, %struct.SimulationParametersZoneValues, %struct.SimulationParametersZoneActivatedValues }
%union.SpotShapeData = type { %struct.RectangularSpot }
%struct.RectangularSpot = type { float, float }
%union.FlowData = type { %struct.RadialFlow }
%struct.RadialFlow = type { i32, float, float }
%struct.SimulationParametersZoneActivatedValues = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
%struct.SimulationParametersZoneValues = type { float, float, [7 x float], [7 x float], [7 x float], [7 x float], i8, [7 x float], [7 x float], [7 x float], float, float, [7 x float], [7 x i32], [7 x i32], [7 x float], [7 x [7 x float]], [7 x float], [7 x float], [7 x [7 x float]], [7 x [7 x float]], [7 x float], [7 x float], [7 x float], [7 x float], [7 x float], [7 x float], [7 x float], [7 x float], [7 x float], [7 x float], [7 x float], [7 x float] }
%union.MotionData = type { %struct.FluidMotion }
%struct.FluidMotion = type { float, float, float }

@.str = external hidden unnamed_addr constant [16 x i8], align 1
@_ZTISt13runtime_error = external constant ptr

; Function Attrs: mustprogress uwtable
define dso_local { ptr, i8 } @_ZN14LocationHelper12findLocationER20SimulationParametersi(ptr noundef nonnull align 4 dereferenceable(36809) %0, i32 noundef %1) #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::variant", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %13

13:                                               ; preds = %37, %2
  %14 = load i32, ptr %6, align 4, !tbaa !9
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.SimulationParameters, ptr %15, i32 0, i32 14
  %17 = load i32, ptr %16, align 4, !tbaa !11
  %18 = icmp slt i32 %14, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %13
  store i32 2, ptr %7, align 4
  br label %40

20:                                               ; preds = %13
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.SimulationParameters, ptr %21, i32 0, i32 15
  %23 = load i32, ptr %6, align 4, !tbaa !9
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [20 x %struct.SimulationParametersZone], ptr %22, i64 0, i64 %24
  %26 = getelementptr inbounds %struct.SimulationParametersZone, ptr %25, i32 0, i32 1
  %27 = load i32, ptr %26, align 4, !tbaa !17
  %28 = load i32, ptr %5, align 4, !tbaa !9
  %29 = icmp eq i32 %27, %28
  br i1 %29, label %30, label %36

30:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.SimulationParameters, ptr %31, i32 0, i32 15
  %33 = load i32, ptr %6, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [20 x %struct.SimulationParametersZone], ptr %32, i64 0, i64 %34
  store ptr %35, ptr %8, align 8, !tbaa !5
  call void @_ZNSt7variantIJP24SimulationParametersZoneP15RadiationSourceEEC2IS1_vvS1_vEEOT_(ptr noundef nonnull align 8 dereferenceable(9) %3, ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  store i32 1, ptr %7, align 4
  br label %40

36:                                               ; preds = %20
  br label %37

37:                                               ; preds = %36
  %38 = load i32, ptr %6, align 4, !tbaa !9
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %6, align 4, !tbaa !9
  br label %13, !llvm.loop !20

40:                                               ; preds = %30, %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %41 = load i32, ptr %7, align 4
  switch i32 %41, label %86 [
    i32 2, label %42
    i32 1, label %79
  ]

42:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %43

43:                                               ; preds = %67, %42
  %44 = load i32, ptr %9, align 4, !tbaa !9
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.SimulationParameters, ptr %45, i32 0, i32 3
  %47 = load i32, ptr %46, align 4, !tbaa !22
  %48 = icmp slt i32 %44, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %43
  store i32 5, ptr %7, align 4
  br label %70

50:                                               ; preds = %43
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.SimulationParameters, ptr %51, i32 0, i32 4
  %53 = load i32, ptr %9, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [40 x %struct.RadiationSource], ptr %52, i64 0, i64 %54
  %56 = getelementptr inbounds %struct.RadiationSource, ptr %55, i32 0, i32 1
  %57 = load i32, ptr %56, align 4, !tbaa !23
  %58 = load i32, ptr %5, align 4, !tbaa !9
  %59 = icmp eq i32 %57, %58
  br i1 %59, label %60, label %66

60:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.SimulationParameters, ptr %61, i32 0, i32 4
  %63 = load i32, ptr %9, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [40 x %struct.RadiationSource], ptr %62, i64 0, i64 %64
  store ptr %65, ptr %10, align 8, !tbaa !5
  call void @_ZNSt7variantIJP24SimulationParametersZoneP15RadiationSourceEEC2IS3_vvS3_vEEOT_(ptr noundef nonnull align 8 dereferenceable(9) %3, ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  store i32 1, ptr %7, align 4
  br label %70

66:                                               ; preds = %50
  br label %67

67:                                               ; preds = %66
  %68 = load i32, ptr %9, align 4, !tbaa !9
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %9, align 4, !tbaa !9
  br label %43, !llvm.loop !25

70:                                               ; preds = %60, %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  %71 = load i32, ptr %7, align 4
  switch i32 %71, label %86 [
    i32 5, label %72
    i32 1, label %79
  ]

72:                                               ; preds = %70
  %73 = call ptr @__cxa_allocate_exception(i64 16) #5
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %73, ptr noundef @.str)
          to label %74 unwind label %75

74:                                               ; preds = %72
  call void @__cxa_throw(ptr %73, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #6
  unreachable

75:                                               ; preds = %72
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %11, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %12, align 4
  call void @__cxa_free_exception(ptr %73) #5
  br label %81

79:                                               ; preds = %70, %40
  %80 = load { ptr, i8 }, ptr %3, align 8
  ret { ptr, i8 } %80

81:                                               ; preds = %75
  %82 = load ptr, ptr %11, align 8
  %83 = load i32, ptr %12, align 4
  %84 = insertvalue { ptr, i32 } poison, ptr %82, 0
  %85 = insertvalue { ptr, i32 } %84, i32 %83, 1
  resume { ptr, i32 } %85

86:                                               ; preds = %70, %40
  unreachable
}

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

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

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

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

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr)

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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 #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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 4660}
!12 = !{!"_ZTS20SimulationParameters", !7, i64 0, !13, i64 64, !10, i64 76, !7, i64 80, !14, i64 4560, !15, i64 4564, !7, i64 4568, !7, i64 4596, !7, i64 4624, !14, i64 4652, !15, i64 4656, !10, i64 4660, !7, i64 4664, !10, i64 33864, !14, i64 33868, !14, i64 33869, !14, i64 33870, !10, i64 33872, !10, i64 33876, !15, i64 33880, !15, i64 33884, !10, i64 33888, !15, i64 33892, !14, i64 33896, !14, i64 33897, !15, i64 33900, !14, i64 33904, !16, i64 33908, !15, i64 35216, !10, i64 35220, !7, i64 35224, !15, i64 35236, !15, i64 35240, !7, i64 35244, !7, i64 35272, !15, i64 35300, !15, i64 35304, !10, i64 35308, !7, i64 35312, !7, i64 35340, !7, i64 35368, !7, i64 35396, !15, i64 35424, !15, i64 35428, !15, i64 35432, !7, i64 35436, !7, i64 35464, !7, i64 35492, !7, i64 35520, !7, i64 35548, !10, i64 35576, !7, i64 35580, !14, i64 35608, !14, i64 35609, !7, i64 35612, !14, i64 35640, !10, i64 35644, !14, i64 35648, !14, i64 35649, !14, i64 35650, !10, i64 35652, !7, i64 35656, !7, i64 35684, !7, i64 35712, !14, i64 35740, !7, i64 35741, !14, i64 35790, !14, i64 35791, !15, i64 35792, !15, i64 35796, !15, i64 35800, !15, i64 35804, !15, i64 35808, !15, i64 35812, !10, i64 35816, !7, i64 35820, !7, i64 35848, !15, i64 36044, !7, i64 36048, !7, i64 36076, !7, i64 36104, !7, i64 36132, !7, i64 36160, !7, i64 36188, !7, i64 36384, !15, i64 36412, !14, i64 36416, !7, i64 36420, !7, i64 36448, !14, i64 36476, !7, i64 36480, !7, i64 36508, !7, i64 36536, !7, i64 36564, !7, i64 36592, !7, i64 36620, !15, i64 36648, !14, i64 36652, !7, i64 36656, !7, i64 36684, !15, i64 36712, !7, i64 36716, !15, i64 36744, !7, i64 36748, !7, i64 36776, !15, i64 36804, !14, i64 36808}
!13 = !{!"_ZTS8Features", !14, i64 0, !14, i64 1, !14, i64 2, !14, i64 3, !14, i64 4, !14, i64 5, !14, i64 6, !14, i64 7, !14, i64 8, !14, i64 9}
!14 = !{!"bool", !7, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!"_ZTS30SimulationParametersZoneValues", !15, i64 0, !15, i64 4, !7, i64 8, !7, i64 36, !7, i64 64, !7, i64 92, !14, i64 120, !7, i64 124, !7, i64 152, !7, i64 180, !15, i64 208, !15, i64 212, !7, i64 216, !7, i64 244, !7, i64 272, !7, i64 300, !7, i64 328, !7, i64 524, !7, i64 552, !7, i64 580, !7, i64 776, !7, i64 972, !7, i64 1000, !7, i64 1028, !7, i64 1056, !7, i64 1084, !7, i64 1112, !7, i64 1140, !7, i64 1168, !7, i64 1196, !7, i64 1224, !7, i64 1252, !7, i64 1280}
!17 = !{!18, !10, i64 64}
!18 = !{!"_ZTS24SimulationParametersZone", !7, i64 0, !10, i64 64, !10, i64 68, !15, i64 72, !15, i64 76, !15, i64 80, !15, i64 84, !15, i64 88, !10, i64 92, !7, i64 96, !10, i64 104, !7, i64 108, !16, i64 120, !19, i64 1428}
!19 = !{!"_ZTS39SimulationParametersZoneActivatedValues", !14, i64 0, !14, i64 1, !14, i64 2, !14, i64 3, !14, i64 4, !14, i64 5, !14, i64 6, !14, i64 7, !14, i64 8, !14, i64 9, !14, i64 10, !14, i64 11, !14, i64 12, !14, i64 13, !14, i64 14, !14, i64 15, !14, i64 16, !14, i64 17, !14, i64 18, !14, i64 19, !14, i64 20, !14, i64 21, !14, i64 22, !14, i64 23, !14, i64 24, !14, i64 25, !14, i64 26, !14, i64 27, !14, i64 28, !14, i64 29, !14, i64 30, !14, i64 31}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!12, !10, i64 76}
!23 = !{!24, !10, i64 64}
!24 = !{!"_ZTS15RadiationSource", !7, i64 0, !10, i64 64, !15, i64 68, !14, i64 72, !15, i64 76, !15, i64 80, !15, i64 84, !15, i64 88, !14, i64 92, !15, i64 96, !10, i64 100, !7, i64 104}
!25 = distinct !{!25, !21}


; 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::variant" = type { %"struct.std::__detail::__variant::_Variant_base.base", [7 x i8] }
%"struct.std::__detail::__variant::_Variant_base.base" = type { %"struct.std::__detail::__variant::_Move_assign_base.base" }
%"struct.std::__detail::__variant::_Move_assign_base.base" = type { %"struct.std::__detail::__variant::_Copy_assign_base.base" }
%"struct.std::__detail::__variant::_Copy_assign_base.base" = type { %"struct.std::__detail::__variant::_Move_ctor_base.base" }
%"struct.std::__detail::__variant::_Move_ctor_base.base" = type { %"struct.std::__detail::__variant::_Copy_ctor_base.base" }
%"struct.std::__detail::__variant::_Copy_ctor_base.base" = type { %"struct.std::__detail::__variant::_Variant_storage.base" }
%"struct.std::__detail::__variant::_Variant_storage.base" = type <{ %"union.std::__detail::__variant::_Variadic_union", i8 }>
%"union.std::__detail::__variant::_Variadic_union" = type { %"struct.std::__detail::__variant::_Uninitialized" }
%"struct.std::__detail::__variant::_Uninitialized" = type { ptr }
%struct.SimulationParametersZone = type { [64 x i8], i32, i32, float, float, float, float, float, i32, %union.SpotShapeData, i32, %union.FlowData, %struct.SimulationParametersZoneValues, %struct.SimulationParametersZoneActivatedValues }
%union.SpotShapeData = type { %struct.RectangularSpot }
%struct.RectangularSpot = type { float, float }
%union.FlowData = type { %struct.RadialFlow }
%struct.RadialFlow = type { i32, float, float }
%struct.SimulationParametersZoneValues = type { float, float, [7 x float], [7 x float], [7 x float], [7 x float], i8, [7 x float], [7 x float], [7 x float], float, float, [7 x float], [7 x i32], [7 x i32], [7 x float], [7 x [7 x float]], [7 x float], [7 x float], [7 x [7 x float]], [7 x [7 x float]], [7 x float], [7 x float], [7 x float], [7 x float], [7 x float], [7 x float], [7 x float], [7 x float], [7 x float], [7 x float], [7 x float], [7 x float] }
%struct.SimulationParametersZoneActivatedValues = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
%struct.RadiationSource = type { [64 x i8], i32, float, i8, float, float, float, float, i8, float, i32, %union.RadiationSourceShapeData }
%union.RadiationSourceShapeData = type { %struct.RectangularRadiationSource }
%struct.RectangularRadiationSource = type { float, float }

@.str = external hidden unnamed_addr constant [16 x i8], align 1
@_ZTISt13runtime_error = external constant ptr

; Function Attrs: mustprogress uwtable
define dso_local { ptr, i8 } @_ZN14LocationHelper12findLocationER20SimulationParametersi(ptr noundef nonnull align 4 dereferenceable(36809) %0, i32 noundef %1) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::variant", align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 4660
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %.preheader

.lr.ph:                                           ; preds = %2
  %9 = getelementptr inbounds i8, ptr %0, i64 4664
  %wide.trip.count = zext nneg i32 %7 to i64
  br label %15

10:                                               ; preds = %15
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %15, !llvm.loop !14

.preheader:                                       ; preds = %10, %2
  %11 = getelementptr inbounds i8, ptr %0, i64 76
  %12 = load i32, ptr %11, align 4, !tbaa !16
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph33, label %._crit_edge

.lr.ph33:                                         ; preds = %.preheader
  %14 = getelementptr inbounds i8, ptr %0, i64 80
  %wide.trip.count41 = zext nneg i32 %12 to i64
  br label %21

15:                                               ; preds = %.lr.ph, %10
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %10 ]
  %16 = getelementptr inbounds [20 x %struct.SimulationParametersZone], ptr %9, i64 0, i64 %indvars.iv
  %17 = getelementptr inbounds i8, ptr %16, i64 64
  %18 = load i32, ptr %17, align 4, !tbaa !17
  %19 = icmp eq i32 %18, %1
  br i1 %19, label %.thread, label %10

.thread:                                          ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  store ptr %16, ptr %4, align 8, !tbaa !20
  call void @_ZNSt7variantIJP24SimulationParametersZoneP15RadiationSourceEEC2IS1_vvS1_vEEOT_(ptr noundef nonnull align 8 dereferenceable(9) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %31

20:                                               ; preds = %21
  %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1
  %exitcond42.not = icmp eq i64 %indvars.iv.next39, %wide.trip.count41
  br i1 %exitcond42.not, label %._crit_edge, label %21, !llvm.loop !22

21:                                               ; preds = %.lr.ph33, %20
  %indvars.iv38 = phi i64 [ 0, %.lr.ph33 ], [ %indvars.iv.next39, %20 ]
  %22 = getelementptr inbounds [40 x %struct.RadiationSource], ptr %14, i64 0, i64 %indvars.iv38
  %23 = getelementptr inbounds i8, ptr %22, i64 64
  %24 = load i32, ptr %23, align 4, !tbaa !23
  %25 = icmp eq i32 %24, %1
  br i1 %25, label %26, label %20

26:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  store ptr %22, ptr %5, align 8, !tbaa !20
  call void @_ZNSt7variantIJP24SimulationParametersZoneP15RadiationSourceEEC2IS3_vvS3_vEEOT_(ptr noundef nonnull align 8 dereferenceable(9) %3, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %31

._crit_edge:                                      ; preds = %20, %.preheader
  %27 = tail call ptr @__cxa_allocate_exception(i64 16) #5
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull @.str)
          to label %28 unwind label %29

28:                                               ; preds = %._crit_edge
  tail call void @__cxa_throw(ptr nonnull %27, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #6
  unreachable

29:                                               ; preds = %._crit_edge
  %30 = landingpad { ptr, i32 }
          cleanup
  tail call void @__cxa_free_exception(ptr %27) #5
  resume { ptr, i32 } %30

31:                                               ; preds = %26, %.thread
  %.fca.0.load = load ptr, ptr %3, align 8
  %.fca.0.insert = insertvalue { ptr, i8 } poison, ptr %.fca.0.load, 0
  %.fca.1.gep = getelementptr inbounds i8, ptr %3, i64 8
  %.fca.1.load = load i8, ptr %.fca.1.gep, align 8
  %.fca.1.insert = insertvalue { ptr, i8 } %.fca.0.insert, i8 %.fca.1.load, 1
  ret { ptr, i8 } %.fca.1.insert
}

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

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

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

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

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr) local_unnamed_addr

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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 #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, !11, i64 4660}
!6 = !{!"_ZTS20SimulationParameters", !7, i64 0, !9, i64 64, !11, i64 76, !7, i64 80, !10, i64 4560, !12, i64 4564, !7, i64 4568, !7, i64 4596, !7, i64 4624, !10, i64 4652, !12, i64 4656, !11, i64 4660, !7, i64 4664, !11, i64 33864, !10, i64 33868, !10, i64 33869, !10, i64 33870, !11, i64 33872, !11, i64 33876, !12, i64 33880, !12, i64 33884, !11, i64 33888, !12, i64 33892, !10, i64 33896, !10, i64 33897, !12, i64 33900, !10, i64 33904, !13, i64 33908, !12, i64 35216, !11, i64 35220, !7, i64 35224, !12, i64 35236, !12, i64 35240, !7, i64 35244, !7, i64 35272, !12, i64 35300, !12, i64 35304, !11, i64 35308, !7, i64 35312, !7, i64 35340, !7, i64 35368, !7, i64 35396, !12, i64 35424, !12, i64 35428, !12, i64 35432, !7, i64 35436, !7, i64 35464, !7, i64 35492, !7, i64 35520, !7, i64 35548, !11, i64 35576, !7, i64 35580, !10, i64 35608, !10, i64 35609, !7, i64 35612, !10, i64 35640, !11, i64 35644, !10, i64 35648, !10, i64 35649, !10, i64 35650, !11, i64 35652, !7, i64 35656, !7, i64 35684, !7, i64 35712, !10, i64 35740, !7, i64 35741, !10, i64 35790, !10, i64 35791, !12, i64 35792, !12, i64 35796, !12, i64 35800, !12, i64 35804, !12, i64 35808, !12, i64 35812, !11, i64 35816, !7, i64 35820, !7, i64 35848, !12, i64 36044, !7, i64 36048, !7, i64 36076, !7, i64 36104, !7, i64 36132, !7, i64 36160, !7, i64 36188, !7, i64 36384, !12, i64 36412, !10, i64 36416, !7, i64 36420, !7, i64 36448, !10, i64 36476, !7, i64 36480, !7, i64 36508, !7, i64 36536, !7, i64 36564, !7, i64 36592, !7, i64 36620, !12, i64 36648, !10, i64 36652, !7, i64 36656, !7, i64 36684, !12, i64 36712, !7, i64 36716, !12, i64 36744, !7, i64 36748, !7, i64 36776, !12, i64 36804, !10, i64 36808}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"_ZTS8Features", !10, i64 0, !10, i64 1, !10, i64 2, !10, i64 3, !10, i64 4, !10, i64 5, !10, i64 6, !10, i64 7, !10, i64 8, !10, i64 9}
!10 = !{!"bool", !7, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!"_ZTS30SimulationParametersZoneValues", !12, i64 0, !12, i64 4, !7, i64 8, !7, i64 36, !7, i64 64, !7, i64 92, !10, i64 120, !7, i64 124, !7, i64 152, !7, i64 180, !12, i64 208, !12, i64 212, !7, i64 216, !7, i64 244, !7, i64 272, !7, i64 300, !7, i64 328, !7, i64 524, !7, i64 552, !7, i64 580, !7, i64 776, !7, i64 972, !7, i64 1000, !7, i64 1028, !7, i64 1056, !7, i64 1084, !7, i64 1112, !7, i64 1140, !7, i64 1168, !7, i64 1196, !7, i64 1224, !7, i64 1252, !7, i64 1280}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!6, !11, i64 76}
!17 = !{!18, !11, i64 64}
!18 = !{!"_ZTS24SimulationParametersZone", !7, i64 0, !11, i64 64, !11, i64 68, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !12, i64 88, !11, i64 92, !7, i64 96, !11, i64 104, !7, i64 108, !13, i64 120, !19, i64 1428}
!19 = !{!"_ZTS39SimulationParametersZoneActivatedValues", !10, i64 0, !10, i64 1, !10, i64 2, !10, i64 3, !10, i64 4, !10, i64 5, !10, i64 6, !10, i64 7, !10, i64 8, !10, i64 9, !10, i64 10, !10, i64 11, !10, i64 12, !10, i64 13, !10, i64 14, !10, i64 15, !10, i64 16, !10, i64 17, !10, i64 18, !10, i64 19, !10, i64 20, !10, i64 21, !10, i64 22, !10, i64 23, !10, i64 24, !10, i64 25, !10, i64 26, !10, i64 27, !10, i64 28, !10, i64 29, !10, i64 30, !10, i64 31}
!20 = !{!21, !21, i64 0}
!21 = !{!"any pointer", !7, i64 0}
!22 = distinct !{!22, !15}
!23 = !{!24, !11, i64 64}
!24 = !{!"_ZTS15RadiationSource", !7, i64 0, !11, i64 64, !12, i64 68, !10, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !12, i64 88, !10, i64 92, !12, i64 96, !11, i64 100, !7, i64 104}


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