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

; 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.8 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [26 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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)) #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5DSENT16GatedLaserSource11updateModelEv(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 double, align 8
  %4 = alloca %"class.LibUtil::String", align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  %8 = alloca %"class.LibUtil::String", align 8
  %9 = alloca double, align 8
  %10 = alloca %"class.LibUtil::String", align 8
  %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 i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca %"class.LibUtil::String", align 8
  %19 = alloca %"class.LibUtil::String", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %20 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %21 = call noundef ptr @_ZNK5DSENT5Model12getTechModelEv(ptr noundef nonnull align 8 dereferenceable(131) %20)
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #5
  call void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef @.str.8)
  %22 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNK5DSENT9TechModel3getERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(72) %21, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %23 unwind label %67

23:                                               ; preds = %1
  %24 = invoke noundef double @_ZNK7LibUtil6StringcvdEv(ptr noundef nonnull align 8 dereferenceable(32) %22)
          to label %25 unwind label %67

25:                                               ; preds = %23
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #5
  store double %24, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %26 = call noundef ptr @_ZNK5DSENT5Model12getTechModelEv(ptr noundef nonnull align 8 dereferenceable(131) %20)
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #5
  call void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef @.str.9)
  %27 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNK5DSENT9TechModel3getERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(72) %26, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %28 unwind label %71

28:                                               ; preds = %25
  %29 = invoke noundef double @_ZNK7LibUtil6StringcvdEv(ptr noundef nonnull align 8 dereferenceable(32) %27)
          to label %30 unwind label %71

30:                                               ; preds = %28
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #5
  store double %29, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %31 = call noundef ptr @_ZNK5DSENT5Model12getTechModelEv(ptr noundef nonnull align 8 dereferenceable(131) %20)
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #5
  call void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef @.str.10)
  %32 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNK5DSENT9TechModel3getERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(72) %31, ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %33 unwind label %75

33:                                               ; preds = %30
  %34 = invoke noundef double @_ZNK7LibUtil6StringcvdEv(ptr noundef nonnull align 8 dereferenceable(32) %32)
          to label %35 unwind label %75

35:                                               ; preds = %33
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #5
  store double %34, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #5
  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) %20, ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %36 unwind label %79

36:                                               ; preds = %35
  %37 = invoke noundef i32 @_ZNK7LibUtil6StringcviEv(ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %38 unwind label %83

38:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #5
  invoke void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef @.str.1)
          to label %39 unwind label %87

39:                                               ; preds = %38
  invoke void @_ZNK5DSENT5Model12getParameterERKN7LibUtil6StringE(ptr dead_on_unwind writable sret(%"class.LibUtil::String") align 8 %14, ptr noundef nonnull align 8 dereferenceable(131) %20, ptr noundef nonnull align 8 dereferenceable(32) %15)
          to label %40 unwind label %91

40:                                               ; preds = %39
  %41 = invoke noundef i32 @_ZNK7LibUtil6StringcviEv(ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %42 unwind label %95

42:                                               ; preds = %40
  %43 = invoke i64 @_ZN5DSENT19makeWavelengthGroupEii(i32 noundef %37, i32 noundef %41)
          to label %44 unwind label %95

44:                                               ; preds = %42
  store i64 %43, ptr %11, align 4
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #5
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #5
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %45 = getelementptr inbounds %"struct.std::pair", ptr %11, i32 0, i32 1
  %46 = load i32, ptr %45, align 4, !tbaa !11
  %47 = getelementptr inbounds %"struct.std::pair", ptr %11, i32 0, i32 0
  %48 = load i32, ptr %47, align 4, !tbaa !14
  %49 = sub nsw i32 %46, %48
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %16, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #5
  call void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef @.str.6)
  %51 = invoke noundef ptr @_ZN5DSENT12OpticalModel8getLaserERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(296) %20, ptr noundef nonnull align 8 dereferenceable(32) %18)
          to label %52 unwind label %103

52:                                               ; preds = %44
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #5
  store ptr %51, ptr %17, align 8, !tbaa !5
  %53 = load ptr, ptr %17, align 8, !tbaa !5
  %54 = load double, ptr %9, align 8, !tbaa !9
  call void @_ZN5DSENT11OpticalNode7setLossEd(ptr noundef nonnull align 8 dereferenceable(80) %53, double noundef %54)
  %55 = load ptr, ptr %17, align 8, !tbaa !5
  %56 = load double, ptr %3, align 8, !tbaa !9
  call void @_ZN5DSENT12OpticalLaser13setEfficiencyEd(ptr noundef nonnull align 8 dereferenceable(88) %55, double noundef %56)
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #5
  call void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef @.str.5)
  %57 = invoke noundef ptr @_ZN5DSENT5Model13getAreaResultERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(131) %20, ptr noundef nonnull align 8 dereferenceable(32) %19)
          to label %58 unwind label %107

58:                                               ; preds = %52
  %59 = load double, ptr %7, align 8, !tbaa !9
  %60 = load i32, ptr %16, align 4, !tbaa !15
  %61 = uitofp i32 %60 to double
  %62 = fmul double %59, %61
  %63 = load ptr, ptr %57, align 8, !tbaa !16
  %64 = getelementptr inbounds ptr, ptr %63, i64 2
  %65 = load ptr, ptr %64, align 8
  invoke void %65(ptr noundef nonnull align 8 dereferenceable(64) %57, double noundef %62)
          to label %66 unwind label %107

66:                                               ; preds = %58
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  ret void

67:                                               ; preds = %23, %1
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %5, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %6, align 4
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #5
  br label %115

71:                                               ; preds = %28, %25
  %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
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #5
  br label %114

75:                                               ; preds = %33, %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
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #5
  br label %113

79:                                               ; preds = %35
  %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 %102

83:                                               ; preds = %36
  %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 %101

87:                                               ; preds = %38
  %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
  br label %100

91:                                               ; preds = %39
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %5, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %6, align 4
  br label %99

95:                                               ; preds = %42, %40
  %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) %14) #5
  br label %99

99:                                               ; preds = %95, %91
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #5
  br label %100

100:                                              ; preds = %99, %87
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #5
  br label %101

101:                                              ; preds = %100, %83
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  br label %102

102:                                              ; preds = %101, %79
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #5
  br label %112

103:                                              ; preds = %44
  %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) %18) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #5
  br label %111

107:                                              ; preds = %58, %52
  %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) %19) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #5
  br label %111

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

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

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

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

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

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

declare noundef ptr @_ZNK5DSENT5Model12getTechModelEv(ptr noundef nonnull align 8 dereferenceable(131)) #1

declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNK5DSENT9TechModel3getERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(32)) #1

declare noundef double @_ZNK7LibUtil6StringcvdEv(ptr noundef nonnull align 8 dereferenceable(32)) #1

declare void @_ZN5DSENT11OpticalNode7setLossEd(ptr noundef nonnull align 8 dereferenceable(80), double noundef) #1

declare void @_ZN5DSENT12OpticalLaser13setEfficiencyEd(ptr noundef nonnull align 8 dereferenceable(88), double noundef) #1

declare noundef ptr @_ZN5DSENT5Model13getAreaResultERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(131), ptr noundef nonnull align 8 dereferenceable(32)) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #3 = { 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 #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 = { 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"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !13, i64 4}
!12 = !{!"_ZTSSt4pairIiiE", !13, i64 0, !13, i64 4}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !13, i64 0}
!15 = !{!13, !13, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"vtable pointer", !8, i64 0}


; 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] }

@.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.8 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [26 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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 #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5DSENT16GatedLaserSource11updateModelEv(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 %"class.LibUtil::String", 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 = tail call noundef ptr @_ZNK5DSENT5Model12getTechModelEv(ptr noundef nonnull align 8 dereferenceable(131) %0)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #5
  call void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull @.str.8)
  %12 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNK5DSENT9TechModel3getERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(72) %11, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %13 unwind label %46

13:                                               ; preds = %1
  %14 = invoke noundef double @_ZNK7LibUtil6StringcvdEv(ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %15 unwind label %46

15:                                               ; preds = %13
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #5
  %16 = call noundef ptr @_ZNK5DSENT5Model12getTechModelEv(ptr noundef nonnull align 8 dereferenceable(131) %0)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  call void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull @.str.9)
  %17 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNK5DSENT9TechModel3getERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(72) %16, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %18 unwind label %48

18:                                               ; preds = %15
  %19 = invoke noundef double @_ZNK7LibUtil6StringcvdEv(ptr noundef nonnull align 8 dereferenceable(32) %17)
          to label %20 unwind label %48

20:                                               ; preds = %18
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  %21 = call noundef ptr @_ZNK5DSENT5Model12getTechModelEv(ptr noundef nonnull align 8 dereferenceable(131) %0)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  call void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull @.str.10)
  %22 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNK5DSENT9TechModel3getERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(72) %21, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %23 unwind label %50

23:                                               ; preds = %20
  %24 = invoke noundef double @_ZNK7LibUtil6StringcvdEv(ptr noundef nonnull align 8 dereferenceable(32) %22)
          to label %25 unwind label %50

25:                                               ; preds = %23
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #5
  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 %26 unwind label %52

26:                                               ; preds = %25
  %27 = invoke noundef i32 @_ZNK7LibUtil6StringcviEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %28 unwind label %54

28:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #5
  invoke void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull @.str.1)
          to label %29 unwind label %56

29:                                               ; preds = %28
  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 %30 unwind label %58

30:                                               ; preds = %29
  %31 = invoke noundef i32 @_ZNK7LibUtil6StringcviEv(ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %32 unwind label %60

32:                                               ; preds = %30
  %33 = invoke i64 @_ZN5DSENT19makeWavelengthGroupEii(i32 noundef %27, i32 noundef %31)
          to label %34 unwind label %60

34:                                               ; preds = %32
  %.sroa.0.0.extract.trunc = trunc i64 %33 to i32
  %.sroa.5.0.extract.shift = lshr i64 %33, 32
  %.sroa.5.0.extract.trunc = trunc nuw i64 %.sroa.5.0.extract.shift to i32
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  %reass.sub = sub i32 %.sroa.5.0.extract.trunc, %.sroa.0.0.extract.trunc
  %35 = add i32 %reass.sub, 1
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #5
  call void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull @.str.6)
  %36 = invoke noundef ptr @_ZN5DSENT12OpticalModel8getLaserERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(296) %0, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %37 unwind label %66

37:                                               ; preds = %34
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #5
  call void @_ZN5DSENT11OpticalNode7setLossEd(ptr noundef nonnull align 8 dereferenceable(80) %36, double noundef %24)
  call void @_ZN5DSENT12OpticalLaser13setEfficiencyEd(ptr noundef nonnull align 8 dereferenceable(88) %36, double noundef %14)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #5
  call void @_ZN7LibUtil6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull @.str.5)
  %38 = invoke noundef ptr @_ZN5DSENT5Model13getAreaResultERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(131) %0, ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %39 unwind label %68

39:                                               ; preds = %37
  %40 = uitofp i32 %35 to double
  %41 = fmul double %19, %40
  %42 = load ptr, ptr %38, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  %44 = load ptr, ptr %43, align 8
  invoke void %44(ptr noundef nonnull align 8 dereferenceable(64) %38, double noundef %41)
          to label %45 unwind label %68

45:                                               ; preds = %39
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  ret void

46:                                               ; preds = %13, %1
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #5
  br label %70

48:                                               ; preds = %18, %15
  %49 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  br label %70

50:                                               ; preds = %23, %20
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  br label %70

52:                                               ; preds = %25
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %65

54:                                               ; preds = %26
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %64

56:                                               ; preds = %28
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %63

58:                                               ; preds = %29
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %62

60:                                               ; preds = %32, %30
  %61 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  br label %62

62:                                               ; preds = %60, %58
  %.pn = phi { ptr, i32 } [ %61, %60 ], [ %59, %58 ]
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  br label %63

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

64:                                               ; preds = %63, %54
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %63 ], [ %55, %54 ]
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  br label %65

65:                                               ; preds = %64, %52
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %64 ], [ %53, %52 ]
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  br label %70

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

68:                                               ; preds = %39, %37
  %69 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7LibUtil6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  br label %70

70:                                               ; preds = %48, %65, %68, %66, %50, %46
  %.pn21.pn.pn.pn.pn = phi { ptr, i32 } [ %47, %46 ], [ %49, %48 ], [ %51, %50 ], [ %.pn.pn.pn.pn, %65 ], [ %69, %68 ], [ %67, %66 ]
  resume { ptr, i32 } %.pn21.pn.pn.pn.pn
}

declare noundef ptr @_ZNK5DSENT5Model12getTechModelEv(ptr noundef nonnull align 8 dereferenceable(131)) local_unnamed_addr #1

declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNK5DSENT9TechModel3getERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

declare noundef double @_ZNK7LibUtil6StringcvdEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

declare void @_ZN5DSENT11OpticalNode7setLossEd(ptr noundef nonnull align 8 dereferenceable(80), double noundef) local_unnamed_addr #1

declare void @_ZN5DSENT12OpticalLaser13setEfficiencyEd(ptr noundef nonnull align 8 dereferenceable(88), double noundef) local_unnamed_addr #1

declare noundef ptr @_ZN5DSENT5Model13getAreaResultERKN7LibUtil6StringE(ptr noundef nonnull align 8 dereferenceable(131), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #3 = { 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 #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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


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