; LLVM IR from thekyria/elabtsaot2 :: gui/powersystem_editor/powersystem_model (pwsschematicmodel)

; 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::auto_ptr.80" = type { ptr }
%"class.elabtsaot::PwsModelElement" = type { ptr, i32, i32 }
%"class.elabtsaot::PwsModel" = type { ptr, ptr, %"class.boost::ptr_vector", %"class.boost::ptr_vector", %"class.boost::ptr_vector", %"class.boost::ptr_vector" }
%"class.boost::ptr_vector" = type { %"class.boost::ptr_sequence_adapter" }
%"class.boost::ptr_sequence_adapter" = type { %"class.boost::ptr_container_detail::reversible_ptr_container" }
%"class.boost::ptr_container_detail::reversible_ptr_container" = type { %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<void *, std::allocator<void *>>::_Vector_impl" }
%"struct.std::_Vector_base<void *, std::allocator<void *>>::_Vector_impl" = type { %"struct.std::_Vector_base<void *, std::allocator<void *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<void *, std::allocator<void *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK5boost20ptr_container_detail24reversible_ptr_containerINS0_15sequence_configIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS6_EEEENS_20heap_clone_allocatorEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN5boost20ptr_sequence_adapterIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS4_EENS_20heap_clone_allocatorEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN9elabtsaot17PwsSchematicModel10addElementEijbPi(ptr noundef nonnull align 8 dereferenceable(112) %0, i32 noundef %1, i32 noundef %2, i1 noundef zeroext %3, ptr noundef %4) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca ptr, align 8
  %12 = alloca %"class.std::auto_ptr.80", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.std::auto_ptr.80", align 8
  %18 = alloca %"class.std::auto_ptr.80", align 8
  %19 = alloca %"class.std::auto_ptr.80", align 8
  %20 = alloca %"class.std::auto_ptr.80", align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !9
  %21 = zext i1 %3 to i8
  store i8 %21, ptr %10, align 1, !tbaa !11
  store ptr %4, ptr %11, align 8, !tbaa !5
  %22 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %23 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 32) #8
  %24 = load i32, ptr %8, align 4, !tbaa !9
  %25 = load i32, ptr %9, align 4, !tbaa !9
  invoke void @_ZN9elabtsaot24PwsSchematicModelElementC1Eii(ptr noundef nonnull align 8 dereferenceable(32) %23, i32 noundef %24, i32 noundef %25)
          to label %26 unwind label %44

26:                                               ; preds = %5
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef %23) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %27 = call noundef ptr @_ZNKSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %28 = getelementptr inbounds %"class.elabtsaot::PwsModelElement", ptr %27, i32 0, i32 1
  %29 = load i32, ptr %28, align 8, !tbaa !13
  %30 = call noundef ptr @_ZNKSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %31 = getelementptr inbounds %"class.elabtsaot::PwsModelElement", ptr %30, i32 0, i32 2
  %32 = load i32, ptr %31, align 4, !tbaa !15
  %33 = invoke noundef i32 @_ZNK9elabtsaot8PwsModel16getElement_mdlIdEij(ptr noundef nonnull align 8 dereferenceable(112) %22, i32 noundef %29, i32 noundef %32)
          to label %34 unwind label %48

34:                                               ; preds = %26
  store i32 %33, ptr %15, align 4, !tbaa !9
  %35 = load i32, ptr %15, align 4, !tbaa !9
  %36 = icmp sgt i32 %35, -1
  br i1 %36, label %37, label %94

37:                                               ; preds = %34
  %38 = load i8, ptr %10, align 1, !tbaa !11, !range !16, !noundef !17
  %39 = trunc i8 %38 to i1
  br i1 %39, label %40, label %92

40:                                               ; preds = %37
  %41 = call noundef ptr @_ZNKSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %42 = getelementptr inbounds %"class.elabtsaot::PwsModelElement", ptr %41, i32 0, i32 1
  %43 = load i32, ptr %42, align 8, !tbaa !13
  switch i32 %43, label %84 [
    i32 0, label %52
    i32 1, label %60
    i32 2, label %68
    i32 3, label %76
  ]

44:                                               ; preds = %5
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %13, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %14, align 4
  call void @_ZdlPvm(ptr noundef %23, i64 noundef 32) #9
  br label %164

48:                                               ; preds = %136, %124, %112, %100, %76, %68, %60, %52, %26
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %13, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %14, align 4
  br label %163

52:                                               ; preds = %40
  %53 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %54 = getelementptr inbounds %"class.elabtsaot::PwsModel", ptr %22, i32 0, i32 2
  %55 = load i32, ptr %15, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN5boost20ptr_sequence_adapterIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS4_EENS_20heap_clone_allocatorEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %54, i64 noundef %56)
          to label %58 unwind label %48

58:                                               ; preds = %52
  %59 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN9elabtsaot15PwsModelElementaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %57, ptr noundef nonnull align 8 dereferenceable(16) %53) #7
  br label %91

60:                                               ; preds = %40
  %61 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %62 = getelementptr inbounds %"class.elabtsaot::PwsModel", ptr %22, i32 0, i32 3
  %63 = load i32, ptr %15, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN5boost20ptr_sequence_adapterIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS4_EENS_20heap_clone_allocatorEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %62, i64 noundef %64)
          to label %66 unwind label %48

66:                                               ; preds = %60
  %67 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN9elabtsaot15PwsModelElementaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %65, ptr noundef nonnull align 8 dereferenceable(16) %61) #7
  br label %91

68:                                               ; preds = %40
  %69 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %70 = getelementptr inbounds %"class.elabtsaot::PwsModel", ptr %22, i32 0, i32 4
  %71 = load i32, ptr %15, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN5boost20ptr_sequence_adapterIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS4_EENS_20heap_clone_allocatorEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %70, i64 noundef %72)
          to label %74 unwind label %48

74:                                               ; preds = %68
  %75 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN9elabtsaot15PwsModelElementaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %73, ptr noundef nonnull align 8 dereferenceable(16) %69) #7
  br label %91

76:                                               ; preds = %40
  %77 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %78 = getelementptr inbounds %"class.elabtsaot::PwsModel", ptr %22, i32 0, i32 5
  %79 = load i32, ptr %15, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN5boost20ptr_sequence_adapterIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS4_EENS_20heap_clone_allocatorEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %78, i64 noundef %80)
          to label %82 unwind label %48

82:                                               ; preds = %76
  %83 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN9elabtsaot15PwsModelElementaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %81, ptr noundef nonnull align 8 dereferenceable(16) %77) #7
  br label %91

84:                                               ; preds = %40
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = icmp ne ptr %85, null
  br i1 %86, label %87, label %90

87:                                               ; preds = %84
  %88 = load i32, ptr %15, align 4, !tbaa !9
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 %88, ptr %89, align 4, !tbaa !9
  br label %90

90:                                               ; preds = %87, %84
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %16, align 4
  br label %161

91:                                               ; preds = %82, %74, %66, %58
  br label %93

92:                                               ; preds = %37
  store i32 1, ptr %6, align 4
  store i32 1, ptr %16, align 4
  br label %161

93:                                               ; preds = %91
  br label %154

94:                                               ; preds = %34
  %95 = call noundef ptr @_ZNKSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %96 = getelementptr inbounds %"class.elabtsaot::PwsModelElement", ptr %95, i32 0, i32 1
  %97 = load i32, ptr %96, align 8, !tbaa !13
  switch i32 %97, label %146 [
    i32 0, label %98
    i32 1, label %110
    i32 2, label %122
    i32 3, label %134
  ]

98:                                               ; preds = %94
  %99 = getelementptr inbounds %"class.elabtsaot::PwsModel", ptr %22, i32 0, i32 2
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEC2ERS2_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  invoke void @_ZN5boost20ptr_sequence_adapterIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS4_EENS_20heap_clone_allocatorEE9push_backINS1_24PwsSchematicModelElementEEEvSt8auto_ptrIT_E(ptr noundef nonnull align 8 dereferenceable(24) %99, ptr noundef %17)
          to label %100 unwind label %106

100:                                              ; preds = %98
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  %101 = getelementptr inbounds %"class.elabtsaot::PwsModel", ptr %22, i32 0, i32 2
  %102 = invoke noundef i64 @_ZNK5boost20ptr_container_detail24reversible_ptr_containerINS0_15sequence_configIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS6_EEEENS_20heap_clone_allocatorEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %101)
          to label %103 unwind label %48

103:                                              ; preds = %100
  %104 = sub i64 %102, 1
  %105 = trunc i64 %104 to i32
  store i32 %105, ptr %15, align 4, !tbaa !9
  br label %153

106:                                              ; preds = %98
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %13, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %14, align 4
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  br label %163

110:                                              ; preds = %94
  %111 = getelementptr inbounds %"class.elabtsaot::PwsModel", ptr %22, i32 0, i32 3
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEC2ERS2_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  invoke void @_ZN5boost20ptr_sequence_adapterIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS4_EENS_20heap_clone_allocatorEE9push_backINS1_24PwsSchematicModelElementEEEvSt8auto_ptrIT_E(ptr noundef nonnull align 8 dereferenceable(24) %111, ptr noundef %18)
          to label %112 unwind label %118

112:                                              ; preds = %110
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  %113 = getelementptr inbounds %"class.elabtsaot::PwsModel", ptr %22, i32 0, i32 3
  %114 = invoke noundef i64 @_ZNK5boost20ptr_container_detail24reversible_ptr_containerINS0_15sequence_configIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS6_EEEENS_20heap_clone_allocatorEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %113)
          to label %115 unwind label %48

115:                                              ; preds = %112
  %116 = sub i64 %114, 1
  %117 = trunc i64 %116 to i32
  store i32 %117, ptr %15, align 4, !tbaa !9
  br label %153

118:                                              ; preds = %110
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %13, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %14, align 4
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  br label %163

122:                                              ; preds = %94
  %123 = getelementptr inbounds %"class.elabtsaot::PwsModel", ptr %22, i32 0, i32 4
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEC2ERS2_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  invoke void @_ZN5boost20ptr_sequence_adapterIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS4_EENS_20heap_clone_allocatorEE9push_backINS1_24PwsSchematicModelElementEEEvSt8auto_ptrIT_E(ptr noundef nonnull align 8 dereferenceable(24) %123, ptr noundef %19)
          to label %124 unwind label %130

124:                                              ; preds = %122
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  %125 = getelementptr inbounds %"class.elabtsaot::PwsModel", ptr %22, i32 0, i32 4
  %126 = invoke noundef i64 @_ZNK5boost20ptr_container_detail24reversible_ptr_containerINS0_15sequence_configIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS6_EEEENS_20heap_clone_allocatorEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %125)
          to label %127 unwind label %48

127:                                              ; preds = %124
  %128 = sub i64 %126, 1
  %129 = trunc i64 %128 to i32
  store i32 %129, ptr %15, align 4, !tbaa !9
  br label %153

130:                                              ; preds = %122
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %13, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %14, align 4
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  br label %163

134:                                              ; preds = %94
  %135 = getelementptr inbounds %"class.elabtsaot::PwsModel", ptr %22, i32 0, i32 5
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEC2ERS2_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  invoke void @_ZN5boost20ptr_sequence_adapterIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS4_EENS_20heap_clone_allocatorEE9push_backINS1_24PwsSchematicModelElementEEEvSt8auto_ptrIT_E(ptr noundef nonnull align 8 dereferenceable(24) %135, ptr noundef %20)
          to label %136 unwind label %142

136:                                              ; preds = %134
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %137 = getelementptr inbounds %"class.elabtsaot::PwsModel", ptr %22, i32 0, i32 5
  %138 = invoke noundef i64 @_ZNK5boost20ptr_container_detail24reversible_ptr_containerINS0_15sequence_configIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS6_EEEENS_20heap_clone_allocatorEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %137)
          to label %139 unwind label %48

139:                                              ; preds = %136
  %140 = sub i64 %138, 1
  %141 = trunc i64 %140 to i32
  store i32 %141, ptr %15, align 4, !tbaa !9
  br label %153

142:                                              ; preds = %134
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %13, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %14, align 4
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  br label %163

146:                                              ; preds = %94
  store i32 -1, ptr %15, align 4, !tbaa !9
  %147 = load ptr, ptr %11, align 8, !tbaa !5
  %148 = icmp ne ptr %147, null
  br i1 %148, label %149, label %152

149:                                              ; preds = %146
  %150 = load i32, ptr %15, align 4, !tbaa !9
  %151 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 %150, ptr %151, align 4, !tbaa !9
  br label %152

152:                                              ; preds = %149, %146
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %16, align 4
  br label %161

153:                                              ; preds = %139, %127, %115, %103
  br label %154

154:                                              ; preds = %153, %93
  %155 = load ptr, ptr %11, align 8, !tbaa !5
  %156 = icmp ne ptr %155, null
  br i1 %156, label %157, label %160

157:                                              ; preds = %154
  %158 = load i32, ptr %15, align 4, !tbaa !9
  %159 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 %158, ptr %159, align 4, !tbaa !9
  br label %160

160:                                              ; preds = %157, %154
  store i32 0, ptr %6, align 4
  store i32 1, ptr %16, align 4
  br label %161

161:                                              ; preds = %160, %152, %92, %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  %162 = load i32, ptr %6, align 4
  ret i32 %162

163:                                              ; preds = %142, %130, %118, %106, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  br label %164

164:                                              ; preds = %163, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %165

165:                                              ; preds = %164
  %166 = load ptr, ptr %13, align 8
  %167 = load i32, ptr %14, align 4
  %168 = insertvalue { ptr, i32 } poison, ptr %166, 0
  %169 = insertvalue { ptr, i32 } %168, i32 %167, 1
  resume { ptr, i32 } %169
}

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

declare void @_ZN9elabtsaot24PwsSchematicModelElementC1Eii(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) unnamed_addr #4

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

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

declare noundef i32 @_ZNK9elabtsaot8PwsModel16getElement_mdlIdEij(ptr noundef nonnull align 8 dereferenceable(112), i32 noundef, i32 noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN9elabtsaot15PwsModelElementaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5boost20ptr_sequence_adapterIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS4_EENS_20heap_clone_allocatorEE9push_backINS1_24PwsSchematicModelElementEEEvSt8auto_ptrIT_E(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) #2 align 2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { "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 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 #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !10, i64 8}
!14 = !{!"_ZTSN9elabtsaot15PwsModelElementE", !10, i64 8, !10, i64 12}
!15 = !{!14, !10, i64 12}
!16 = !{i8 0, i8 2}
!17 = !{}


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

%"class.std::auto_ptr.80" = type { ptr }

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK5boost20ptr_container_detail24reversible_ptr_containerINS0_15sequence_configIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS6_EEEENS_20heap_clone_allocatorEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN5boost20ptr_sequence_adapterIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS4_EENS_20heap_clone_allocatorEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 -1, 2) i32 @_ZN9elabtsaot17PwsSchematicModel10addElementEijbPi(ptr noundef nonnull align 8 dereferenceable(112) %0, i32 noundef %1, i32 noundef %2, i1 noundef zeroext %3, ptr noundef writeonly %4) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.std::auto_ptr.80", align 8
  %7 = alloca %"class.std::auto_ptr.80", align 8
  %8 = alloca %"class.std::auto_ptr.80", align 8
  %9 = alloca %"class.std::auto_ptr.80", align 8
  %10 = alloca %"class.std::auto_ptr.80", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %11 = tail call noalias noundef nonnull dereferenceable(32) ptr @_Znwm(i64 noundef 32) #8
  invoke void @_ZN9elabtsaot24PwsSchematicModelElementC1Eii(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %1, i32 noundef %2)
          to label %12 unwind label %27

12:                                               ; preds = %5
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull %11) #7
  %13 = call noundef ptr @_ZNKSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %14 = getelementptr inbounds i8, ptr %13, i64 8
  %15 = load i32, ptr %14, align 8, !tbaa !5
  %16 = call noundef ptr @_ZNKSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %17 = getelementptr inbounds i8, ptr %16, i64 12
  %18 = load i32, ptr %17, align 4, !tbaa !10
  %19 = invoke noundef i32 @_ZNK9elabtsaot8PwsModel16getElement_mdlIdEij(ptr noundef nonnull align 8 dereferenceable(112) %0, i32 noundef %15, i32 noundef %18)
          to label %20 unwind label %29

20:                                               ; preds = %12
  %21 = icmp sgt i32 %19, -1
  br i1 %21, label %22, label %60

22:                                               ; preds = %20
  br i1 %3, label %23, label %98

23:                                               ; preds = %22
  %24 = call noundef ptr @_ZNKSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %25 = getelementptr inbounds i8, ptr %24, i64 8
  %26 = load i32, ptr %25, align 8, !tbaa !5
  switch i32 %26, label %59 [
    i32 0, label %31
    i32 1, label %38
    i32 2, label %45
    i32 3, label %52
  ]

27:                                               ; preds = %5
  %28 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %11, i64 noundef 32) #9
  br label %100

29:                                               ; preds = %52, %45, %38, %31, %12
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %99

31:                                               ; preds = %23
  %32 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %33 = getelementptr inbounds i8, ptr %0, i64 16
  %34 = zext nneg i32 %19 to i64
  %35 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN5boost20ptr_sequence_adapterIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS4_EENS_20heap_clone_allocatorEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %34)
          to label %36 unwind label %29

36:                                               ; preds = %31
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN9elabtsaot15PwsModelElementaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 8 dereferenceable(16) %32) #7
  br label %97

38:                                               ; preds = %23
  %39 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %40 = getelementptr inbounds i8, ptr %0, i64 40
  %41 = zext nneg i32 %19 to i64
  %42 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN5boost20ptr_sequence_adapterIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS4_EENS_20heap_clone_allocatorEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %40, i64 noundef %41)
          to label %43 unwind label %29

43:                                               ; preds = %38
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN9elabtsaot15PwsModelElementaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %42, ptr noundef nonnull align 8 dereferenceable(16) %39) #7
  br label %97

45:                                               ; preds = %23
  %46 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %47 = getelementptr inbounds i8, ptr %0, i64 64
  %48 = zext nneg i32 %19 to i64
  %49 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN5boost20ptr_sequence_adapterIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS4_EENS_20heap_clone_allocatorEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %47, i64 noundef %48)
          to label %50 unwind label %29

50:                                               ; preds = %45
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN9elabtsaot15PwsModelElementaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %49, ptr noundef nonnull align 8 dereferenceable(16) %46) #7
  br label %97

52:                                               ; preds = %23
  %53 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %54 = getelementptr inbounds i8, ptr %0, i64 88
  %55 = zext nneg i32 %19 to i64
  %56 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN5boost20ptr_sequence_adapterIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS4_EENS_20heap_clone_allocatorEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %54, i64 noundef %55)
          to label %57 unwind label %29

57:                                               ; preds = %52
  %58 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN9elabtsaot15PwsModelElementaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %56, ptr noundef nonnull align 8 dereferenceable(16) %53) #7
  br label %97

59:                                               ; preds = %23
  %.not30 = icmp eq ptr %4, null
  br i1 %.not30, label %98, label %.sink.split

60:                                               ; preds = %20
  %61 = call noundef ptr @_ZNKSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %62 = getelementptr inbounds i8, ptr %61, i64 8
  %63 = load i32, ptr %62, align 8, !tbaa !5
  switch i32 %63, label %96 [
    i32 0, label %64
    i32 1, label %72
    i32 2, label %80
    i32 3, label %88
  ]

64:                                               ; preds = %60
  %65 = getelementptr inbounds i8, ptr %0, i64 16
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEC2ERS2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  invoke void @_ZN5boost20ptr_sequence_adapterIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS4_EENS_20heap_clone_allocatorEE9push_backINS1_24PwsSchematicModelElementEEEvSt8auto_ptrIT_E(ptr noundef nonnull align 8 dereferenceable(24) %65, ptr noundef nonnull %7)
          to label %66 unwind label %70

66:                                               ; preds = %64
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %67 = call noundef i64 @_ZNK5boost20ptr_container_detail24reversible_ptr_containerINS0_15sequence_configIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS6_EEEENS_20heap_clone_allocatorEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %65)
  %68 = trunc i64 %67 to i32
  %69 = add i32 %68, -1
  br label %97

70:                                               ; preds = %64
  %71 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  br label %99

72:                                               ; preds = %60
  %73 = getelementptr inbounds i8, ptr %0, i64 40
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEC2ERS2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  invoke void @_ZN5boost20ptr_sequence_adapterIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS4_EENS_20heap_clone_allocatorEE9push_backINS1_24PwsSchematicModelElementEEEvSt8auto_ptrIT_E(ptr noundef nonnull align 8 dereferenceable(24) %73, ptr noundef nonnull %8)
          to label %74 unwind label %78

74:                                               ; preds = %72
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %75 = call noundef i64 @_ZNK5boost20ptr_container_detail24reversible_ptr_containerINS0_15sequence_configIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS6_EEEENS_20heap_clone_allocatorEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %73)
  %76 = trunc i64 %75 to i32
  %77 = add i32 %76, -1
  br label %97

78:                                               ; preds = %72
  %79 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br label %99

80:                                               ; preds = %60
  %81 = getelementptr inbounds i8, ptr %0, i64 64
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEC2ERS2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  invoke void @_ZN5boost20ptr_sequence_adapterIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS4_EENS_20heap_clone_allocatorEE9push_backINS1_24PwsSchematicModelElementEEEvSt8auto_ptrIT_E(ptr noundef nonnull align 8 dereferenceable(24) %81, ptr noundef nonnull %9)
          to label %82 unwind label %86

82:                                               ; preds = %80
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %83 = call noundef i64 @_ZNK5boost20ptr_container_detail24reversible_ptr_containerINS0_15sequence_configIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS6_EEEENS_20heap_clone_allocatorEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %81)
  %84 = trunc i64 %83 to i32
  %85 = add i32 %84, -1
  br label %97

86:                                               ; preds = %80
  %87 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  br label %99

88:                                               ; preds = %60
  %89 = getelementptr inbounds i8, ptr %0, i64 88
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEC2ERS2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  invoke void @_ZN5boost20ptr_sequence_adapterIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS4_EENS_20heap_clone_allocatorEE9push_backINS1_24PwsSchematicModelElementEEEvSt8auto_ptrIT_E(ptr noundef nonnull align 8 dereferenceable(24) %89, ptr noundef nonnull %10)
          to label %90 unwind label %94

90:                                               ; preds = %88
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %91 = call noundef i64 @_ZNK5boost20ptr_container_detail24reversible_ptr_containerINS0_15sequence_configIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS6_EEEENS_20heap_clone_allocatorEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %89)
  %92 = trunc i64 %91 to i32
  %93 = add i32 %92, -1
  br label %97

94:                                               ; preds = %88
  %95 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br label %99

96:                                               ; preds = %60
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %98, label %.sink.split

97:                                               ; preds = %66, %74, %82, %90, %57, %50, %43, %36
  %.0 = phi i32 [ %19, %57 ], [ %19, %50 ], [ %19, %43 ], [ %19, %36 ], [ %93, %90 ], [ %85, %82 ], [ %77, %74 ], [ %69, %66 ]
  %.not29 = icmp eq ptr %4, null
  br i1 %.not29, label %98, label %.sink.split

.sink.split:                                      ; preds = %97, %96, %59
  %.0.sink = phi i32 [ %19, %59 ], [ -1, %96 ], [ %.0, %97 ]
  %.023.ph = phi i32 [ -1, %59 ], [ -1, %96 ], [ 0, %97 ]
  store i32 %.0.sink, ptr %4, align 4, !tbaa !11
  br label %98

98:                                               ; preds = %.sink.split, %97, %96, %22, %59
  %.023 = phi i32 [ -1, %59 ], [ 1, %22 ], [ -1, %96 ], [ 0, %97 ], [ %.023.ph, %.sink.split ]
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  ret i32 %.023

99:                                               ; preds = %94, %86, %78, %70, %29
  %.pn = phi { ptr, i32 } [ %30, %29 ], [ %95, %94 ], [ %87, %86 ], [ %79, %78 ], [ %71, %70 ]
  call void @_ZNSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  br label %100

100:                                              ; preds = %99, %27
  %.pn.pn = phi { ptr, i32 } [ %.pn, %99 ], [ %28, %27 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  resume { ptr, i32 } %.pn.pn
}

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

declare void @_ZN9elabtsaot24PwsSchematicModelElementC1Eii(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) unnamed_addr #4

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

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

declare noundef i32 @_ZNK9elabtsaot8PwsModel16getElement_mdlIdEij(ptr noundef nonnull align 8 dereferenceable(112), i32 noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt8auto_ptrIN9elabtsaot24PwsSchematicModelElementEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN9elabtsaot15PwsModelElementaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5boost20ptr_sequence_adapterIN9elabtsaot15PwsModelElementESt6vectorIPvSaIS4_EENS_20heap_clone_allocatorEE9push_backINS1_24PwsSchematicModelElementEEEvSt8auto_ptrIT_E(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) local_unnamed_addr #2 align 2

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { "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 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 #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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, !7, i64 8}
!6 = !{!"_ZTSN9elabtsaot15PwsModelElementE", !7, i64 8, !7, i64 12}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 12}
!11 = !{!7, !7, i64 0}


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