; LLVM IR from gem5/gem5 :: ext/dsent/model/optical/GatedLaserSource.ll (ZN5DSENT16GatedLaserSource14constructModelEv)

; 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.LibUtil::String" = type { %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"struct.std::pair" = type { i32, i32 }

@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [4 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #0

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

declare void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5DSENT16GatedLaserSource14constructModelEv(ptr noundef nonnull align 8 dereferenceable(296) %0) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %"class.LibUtil::String", align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i1, align 1
  %8 = alloca ptr, align 8
  %9 = alloca %"class.LibUtil::String", align 8
  %10 = alloca i1, align 1
  %11 = alloca %"struct.std::pair", align 4
  %12 = alloca %"class.LibUtil::String", align 8
  %13 = alloca %"class.LibUtil::String", align 8
  %14 = alloca %"class.LibUtil::String", align 8
  %15 = alloca %"class.LibUtil::String", align 8
  %16 = alloca %"class.LibUtil::String", align 8
  %17 = alloca %"class.LibUtil::String", align 8
  %18 = alloca ptr, align 8
  %19 = alloca %"class.LibUtil::String", align 8
  %20 = alloca %"class.LibUtil::String", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %21 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  %22 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 72) #8
  store i1 true, ptr %7, align 1
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #7
  invoke void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef @.str.5)
          to label %23 unwind label %47

23:                                               ; preds = %1
  invoke void @_ZN5DSENT12AtomicResultC1ERKN7LibUtil6StringEd(ptr noundef nonnull align 8 dereferenceable(72) %22, ptr noundef nonnull align 8 dereferenceable(32) %4, double noundef 0.000000e+00)
          to label %24 unwind label %51

24:                                               ; preds = %23
  store i1 false, ptr %7, align 1
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #7
  store ptr %22, ptr %3, align 8, !tbaa !5
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN5DSENT5Model13addAreaResultEPNS_6ResultE(ptr noundef nonnull align 8 dereferenceable(131) %21, ptr noundef %25)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %26 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 72) #8
  store i1 true, ptr %10, align 1
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #7
  invoke void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef @.str.6)
          to label %27 unwind label %59

27:                                               ; preds = %24
  invoke void @_ZN5DSENT12AtomicResultC1ERKN7LibUtil6StringEd(ptr noundef nonnull align 8 dereferenceable(72) %26, ptr noundef nonnull align 8 dereferenceable(32) %9, double noundef 0.000000e+00)
          to label %28 unwind label %63

28:                                               ; preds = %27
  store i1 false, ptr %10, align 1
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #7
  store ptr %26, ptr %8, align 8, !tbaa !5
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN5DSENT5Model14addEventResultEPNS_6ResultE(ptr noundef nonnull align 8 dereferenceable(131) %21, ptr noundef %29)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #7
  call void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef @.str)
  invoke void @_ZNK5DSENT5Model12getParameterERKN7LibUtil6StringE(ptr dead_on_unwind writable sret(%"class.LibUtil::String") align 8 %12, ptr noundef nonnull align 8 dereferenceable(131) %21, ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %30 unwind label %71

30:                                               ; preds = %28
  %31 = invoke noundef i32 @_ZNK7LibUtil6StringcviEv(ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %32 unwind label %75

32:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #7
  invoke void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef @.str.1)
          to label %33 unwind label %79

33:                                               ; preds = %32
  invoke void @_ZNK5DSENT5Model12getParameterERKN7LibUtil6StringE(ptr dead_on_unwind writable sret(%"class.LibUtil::String") align 8 %14, ptr noundef nonnull align 8 dereferenceable(131) %21, ptr noundef nonnull align 8 dereferenceable(32) %15)
          to label %34 unwind label %83

34:                                               ; preds = %33
  %35 = invoke noundef i32 @_ZNK7LibUtil6StringcviEv(ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %36 unwind label %87

36:                                               ; preds = %34
  %37 = invoke i64 @_ZN5DSENT19makeWavelengthGroupEii(i32 noundef %31, i32 noundef %35)
          to label %38 unwind label %87

38:                                               ; preds = %36
  store i64 %37, ptr %11, align 4
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #7
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #7
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #7
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #7
  call void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef @.str.7)
  invoke void @_ZN5DSENT12OpticalModel23createOpticalOutputPortERKN7LibUtil6StringERKSt4pairIiiE(ptr noundef nonnull align 8 dereferenceable(296) %21, ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef nonnull align 4 dereferenceable(8) %11)
          to label %39 unwind label %95

39:                                               ; preds = %38
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #7
  call void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef @.str.6)
  invoke void @_ZN5DSENT12OpticalModel11createLaserERKN7LibUtil6StringERKSt4pairIiiE(ptr noundef nonnull align 8 dereferenceable(296) %21, ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef nonnull align 4 dereferenceable(8) %11)
          to label %40 unwind label %99

40:                                               ; preds = %39
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #7
  call void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef @.str.6)
  %41 = invoke noundef ptr @_ZN5DSENT12OpticalModel8getLaserERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(296) %21, ptr noundef nonnull align 8 dereferenceable(32) %19)
          to label %42 unwind label %103

42:                                               ; preds = %40
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #7
  store ptr %41, ptr %18, align 8, !tbaa !5
  %43 = load ptr, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #7
  call void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef @.str.7)
  %44 = invoke noundef ptr @_ZN5DSENT12OpticalModel12getWaveguideERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(296) %21, ptr noundef nonnull align 8 dereferenceable(32) %20)
          to label %45 unwind label %107

45:                                               ; preds = %42
  invoke void @_ZN5DSENT11OpticalNode17addDownstreamNodeEPS0_(ptr noundef nonnull align 8 dereferenceable(80) %43, ptr noundef %44)
          to label %46 unwind label %107

46:                                               ; preds = %45
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  ret void

47:                                               ; preds = %1
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %5, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %6, align 4
  br label %55

51:                                               ; preds = %23
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %5, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %6, align 4
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  br label %55

55:                                               ; preds = %51, %47
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #7
  %56 = load i1, ptr %7, align 1
  br i1 %56, label %57, label %58

57:                                               ; preds = %55
  call void @_ZdlPvm(ptr noundef %22, i64 noundef 72) #9
  br label %58

58:                                               ; preds = %57, %55
  br label %114

59:                                               ; preds = %24
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %5, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %6, align 4
  br label %67

63:                                               ; preds = %27
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %5, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %6, align 4
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  br label %67

67:                                               ; preds = %63, %59
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #7
  %68 = load i1, ptr %10, align 1
  br i1 %68, label %69, label %70

69:                                               ; preds = %67
  call void @_ZdlPvm(ptr noundef %26, i64 noundef 72) #9
  br label %70

70:                                               ; preds = %69, %67
  br label %113

71:                                               ; preds = %28
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %5, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %6, align 4
  br label %94

75:                                               ; preds = %30
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %5, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %6, align 4
  br label %93

79:                                               ; preds = %32
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %5, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %6, align 4
  br label %92

83:                                               ; preds = %33
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %5, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %6, align 4
  br label %91

87:                                               ; preds = %36, %34
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %5, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %6, align 4
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #7
  br label %91

91:                                               ; preds = %87, %83
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #7
  br label %92

92:                                               ; preds = %91, %79
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #7
  br label %93

93:                                               ; preds = %92, %75
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #7
  br label %94

94:                                               ; preds = %93, %71
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  br label %112

95:                                               ; preds = %38
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %5, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %6, align 4
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #7
  br label %112

99:                                               ; preds = %39
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %5, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %6, align 4
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #7
  br label %112

103:                                              ; preds = %40
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %5, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %6, align 4
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #7
  br label %111

107:                                              ; preds = %45, %42
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %5, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %6, align 4
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #7
  br label %111

111:                                              ; preds = %107, %103
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %112

112:                                              ; preds = %111, %99, %95, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %113

113:                                              ; preds = %112, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %114

114:                                              ; preds = %113, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %115

115:                                              ; preds = %114
  %116 = load ptr, ptr %5, align 8
  %117 = load i32, ptr %6, align 4
  %118 = insertvalue { ptr, i32 } poison, ptr %116, 0
  %119 = insertvalue { ptr, i32 } %118, i32 %117, 1
  resume { ptr, i32 } %119
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #5

declare void @_ZN5DSENT12AtomicResultC1ERKN7LibUtil6StringEd(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(32), double noundef) unnamed_addr #2

declare void @_ZN5DSENT5Model13addAreaResultEPNS_6ResultE(ptr noundef nonnull align 8 dereferenceable(131), ptr noundef) #2

declare void @_ZN5DSENT5Model14addEventResultEPNS_6ResultE(ptr noundef nonnull align 8 dereferenceable(131), ptr noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i64 @_ZN5DSENT19makeWavelengthGroupEii(i32 noundef, i32 noundef) #6

declare void @_ZNK5DSENT5Model12getParameterERKN7LibUtil6StringE(ptr dead_on_unwind writable sret(%"class.LibUtil::String") align 8, ptr noundef nonnull align 8 dereferenceable(131), ptr noundef nonnull align 8 dereferenceable(32)) #2

declare noundef i32 @_ZNK7LibUtil6StringcviEv(ptr noundef nonnull align 8 dereferenceable(32)) #2

declare void @_ZN5DSENT12OpticalModel23createOpticalOutputPortERKN7LibUtil6StringERKSt4pairIiiE(ptr noundef nonnull align 8 dereferenceable(296), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(8)) #2

declare void @_ZN5DSENT12OpticalModel11createLaserERKN7LibUtil6StringERKSt4pairIiiE(ptr noundef nonnull align 8 dereferenceable(296), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(8)) #2

declare noundef ptr @_ZN5DSENT12OpticalModel8getLaserERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(296), ptr noundef nonnull align 8 dereferenceable(32)) #2

declare void @_ZN5DSENT11OpticalNode17addDownstreamNodeEPS0_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef) #2

declare noundef ptr @_ZN5DSENT12OpticalModel12getWaveguideERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(296), ptr noundef nonnull align 8 dereferenceable(32)) #2

attributes #0 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #4 = { 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 #5 = { nobuiltin allocsize(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 #6 = { 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; 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.LibUtil::String" = type { %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"struct.std::pair" = type { i32, i32 }

@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [4 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #0

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

declare void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3

; 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 uwtable
define dso_local void @_ZN5DSENT16GatedLaserSource14constructModelEv(ptr noundef nonnull align 8 dereferenceable(296) %0) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.LibUtil::String", align 8
  %3 = alloca %"class.LibUtil::String", align 8
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"class.LibUtil::String", align 8
  %6 = alloca %"class.LibUtil::String", align 8
  %7 = alloca %"class.LibUtil::String", align 8
  %8 = alloca %"class.LibUtil::String", align 8
  %9 = alloca %"class.LibUtil::String", align 8
  %10 = alloca %"class.LibUtil::String", align 8
  %11 = alloca %"class.LibUtil::String", align 8
  %12 = alloca %"class.LibUtil::String", align 8
  %13 = tail call noalias noundef nonnull dereferenceable(72) ptr @_Znwm(i64 noundef 72) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #8
  invoke void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull @.str.5)
          to label %14 unwind label %35

14:                                               ; preds = %1
  invoke void @_ZN5DSENT12AtomicResultC1ERKN7LibUtil6StringEd(ptr noundef nonnull align 8 dereferenceable(72) %13, ptr noundef nonnull align 8 dereferenceable(32) %2, double noundef 0.000000e+00)
          to label %15 unwind label %37

15:                                               ; preds = %14
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #8
  call void @_ZN5DSENT5Model13addAreaResultEPNS_6ResultE(ptr noundef nonnull align 8 dereferenceable(131) %0, ptr noundef nonnull %13)
  %16 = call noalias noundef nonnull dereferenceable(72) ptr @_Znwm(i64 noundef 72) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #8
  invoke void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull @.str.6)
          to label %17 unwind label %40

17:                                               ; preds = %15
  invoke void @_ZN5DSENT12AtomicResultC1ERKN7LibUtil6StringEd(ptr noundef nonnull align 8 dereferenceable(72) %16, ptr noundef nonnull align 8 dereferenceable(32) %3, double noundef 0.000000e+00)
          to label %18 unwind label %42

18:                                               ; preds = %17
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #8
  call void @_ZN5DSENT5Model14addEventResultEPNS_6ResultE(ptr noundef nonnull align 8 dereferenceable(131) %0, ptr noundef nonnull %16)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #8
  call void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull @.str)
  invoke void @_ZNK5DSENT5Model12getParameterERKN7LibUtil6StringE(ptr dead_on_unwind nonnull writable sret(%"class.LibUtil::String") align 8 %5, ptr noundef nonnull align 8 dereferenceable(131) %0, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %19 unwind label %45

19:                                               ; preds = %18
  %20 = invoke noundef i32 @_ZNK7LibUtil6StringcviEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %21 unwind label %47

21:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #8
  invoke void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull @.str.1)
          to label %22 unwind label %49

22:                                               ; preds = %21
  invoke void @_ZNK5DSENT5Model12getParameterERKN7LibUtil6StringE(ptr dead_on_unwind nonnull writable sret(%"class.LibUtil::String") align 8 %7, ptr noundef nonnull align 8 dereferenceable(131) %0, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %23 unwind label %51

23:                                               ; preds = %22
  %24 = invoke noundef i32 @_ZNK7LibUtil6StringcviEv(ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %25 unwind label %53

25:                                               ; preds = %23
  %26 = invoke i64 @_ZN5DSENT19makeWavelengthGroupEii(i32 noundef %20, i32 noundef %24)
          to label %27 unwind label %53

27:                                               ; preds = %25
  store i64 %26, ptr %4, align 8
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #8
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #8
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #8
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #8
  call void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull @.str.7)
  invoke void @_ZN5DSENT12OpticalModel23createOpticalOutputPortERKN7LibUtil6StringERKSt4pairIiiE(ptr noundef nonnull align 8 dereferenceable(296) %0, ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 4 dereferenceable(8) %4)
          to label %28 unwind label %59

28:                                               ; preds = %27
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #8
  call void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull @.str.6)
  invoke void @_ZN5DSENT12OpticalModel11createLaserERKN7LibUtil6StringERKSt4pairIiiE(ptr noundef nonnull align 8 dereferenceable(296) %0, ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 4 dereferenceable(8) %4)
          to label %29 unwind label %61

29:                                               ; preds = %28
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #8
  call void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull @.str.6)
  %30 = invoke noundef ptr @_ZN5DSENT12OpticalModel8getLaserERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(296) %0, ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %31 unwind label %63

31:                                               ; preds = %29
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #8
  call void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull @.str.7)
  %32 = invoke noundef ptr @_ZN5DSENT12OpticalModel12getWaveguideERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(296) %0, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %33 unwind label %65

33:                                               ; preds = %31
  invoke void @_ZN5DSENT11OpticalNode17addDownstreamNodeEPS0_(ptr noundef nonnull align 8 dereferenceable(80) %30, ptr noundef %32)
          to label %34 unwind label %65

34:                                               ; preds = %33
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  ret void

35:                                               ; preds = %1
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %39

37:                                               ; preds = %14
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #8
  br label %39

39:                                               ; preds = %37, %35
  %.pn = phi { ptr, i32 } [ %38, %37 ], [ %36, %35 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #8
  call void @_ZdlPvm(ptr noundef nonnull %13, i64 noundef 72) #9
  br label %68

40:                                               ; preds = %15
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %44

42:                                               ; preds = %17
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #8
  br label %44

44:                                               ; preds = %42, %40
  %.pn18 = phi { ptr, i32 } [ %43, %42 ], [ %41, %40 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #8
  call void @_ZdlPvm(ptr noundef nonnull %16, i64 noundef 72) #9
  br label %68

45:                                               ; preds = %18
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %58

47:                                               ; preds = %19
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %57

49:                                               ; preds = %21
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %56

51:                                               ; preds = %22
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %55

53:                                               ; preds = %25, %23
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #8
  br label %55

55:                                               ; preds = %53, %51
  %.pn20 = phi { ptr, i32 } [ %54, %53 ], [ %52, %51 ]
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #8
  br label %56

56:                                               ; preds = %55, %49
  %.pn20.pn = phi { ptr, i32 } [ %.pn20, %55 ], [ %50, %49 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #8
  br label %57

57:                                               ; preds = %56, %47
  %.pn20.pn.pn = phi { ptr, i32 } [ %.pn20.pn, %56 ], [ %48, %47 ]
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #8
  br label %58

58:                                               ; preds = %57, %45
  %.pn20.pn.pn.pn = phi { ptr, i32 } [ %.pn20.pn.pn, %57 ], [ %46, %45 ]
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  br label %67

59:                                               ; preds = %27
  %60 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #8
  br label %67

61:                                               ; preds = %28
  %62 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #8
  br label %67

63:                                               ; preds = %29
  %64 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #8
  br label %67

65:                                               ; preds = %33, %31
  %66 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #8
  br label %67

67:                                               ; preds = %63, %65, %61, %59, %58
  %.pn25.pn = phi { ptr, i32 } [ %62, %61 ], [ %60, %59 ], [ %.pn20.pn.pn.pn, %58 ], [ %66, %65 ], [ %64, %63 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  br label %68

68:                                               ; preds = %67, %44, %39
  %.pn25.pn.pn.pn = phi { ptr, i32 } [ %.pn, %39 ], [ %.pn25.pn, %67 ], [ %.pn18, %44 ]
  resume { ptr, i32 } %.pn25.pn.pn.pn
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #5

declare void @_ZN5DSENT12AtomicResultC1ERKN7LibUtil6StringEd(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(32), double noundef) unnamed_addr #2

declare void @_ZN5DSENT5Model13addAreaResultEPNS_6ResultE(ptr noundef nonnull align 8 dereferenceable(131), ptr noundef) local_unnamed_addr #2

declare void @_ZN5DSENT5Model14addEventResultEPNS_6ResultE(ptr noundef nonnull align 8 dereferenceable(131), ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i64 @_ZN5DSENT19makeWavelengthGroupEii(i32 noundef, i32 noundef) local_unnamed_addr #6

declare void @_ZNK5DSENT5Model12getParameterERKN7LibUtil6StringE(ptr dead_on_unwind writable sret(%"class.LibUtil::String") align 8, ptr noundef nonnull align 8 dereferenceable(131), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

declare noundef i32 @_ZNK7LibUtil6StringcviEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

declare void @_ZN5DSENT12OpticalModel23createOpticalOutputPortERKN7LibUtil6StringERKSt4pairIiiE(ptr noundef nonnull align 8 dereferenceable(296), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2

declare void @_ZN5DSENT12OpticalModel11createLaserERKN7LibUtil6StringERKSt4pairIiiE(ptr noundef nonnull align 8 dereferenceable(296), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2

declare noundef ptr @_ZN5DSENT12OpticalModel8getLaserERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(296), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

declare void @_ZN5DSENT11OpticalNode17addDownstreamNodeEPS0_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef) local_unnamed_addr #2

declare noundef ptr @_ZN5DSENT12OpticalModel12getWaveguideERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(296), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

attributes #0 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #4 = { 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 #5 = { nobuiltin allocsize(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 #6 = { 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 #7 = { builtin allocsize(0) }
attributes #8 = { nounwind }
attributes #9 = { builtin nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass