; LLVM IR from artvns/SimpleFvm :: simplefvm/src/MeshLoader/MeshContainer (MeshContainerBuilder)

; 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::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.14" }
%"struct.std::_Head_base.14" = type { ptr }
%"class.meshloader::MeshContainerBuilder" = type { ptr, ptr, ptr, i64, i64 }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10meshloader20MeshContainerBuilder8fillMeshEv(ptr noundef nonnull align 8 dereferenceable(40) %0) #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::unique_ptr", align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::unique_ptr", align 8
  %12 = alloca %"class.std::unique_ptr", align 8
  %13 = alloca %"class.std::unique_ptr", align 8
  %14 = alloca %"class.std::unique_ptr", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %15 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  store i64 0, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 0, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EEC2IS3_vEEDn(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr null) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 0, ptr %6, align 8, !tbaa !9
  br label %16

16:                                               ; preds = %114, %1
  %17 = load i64, ptr %6, align 8, !tbaa !9
  %18 = getelementptr inbounds %"class.meshloader::MeshContainerBuilder", ptr %15, i32 0, i32 3
  %19 = load i64, ptr %18, align 8, !tbaa !11
  %20 = icmp ult i64 %17, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %16
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %117

22:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !9
  br label %23

23:                                               ; preds = %109, %22
  %24 = load i64, ptr %8, align 8, !tbaa !9
  %25 = getelementptr inbounds %"class.meshloader::MeshContainerBuilder", ptr %15, i32 0, i32 4
  %26 = load i64, ptr %25, align 8, !tbaa !13
  %27 = icmp ult i64 %24, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %23
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %113

29:                                               ; preds = %23
  %30 = getelementptr inbounds %"class.meshloader::MeshContainerBuilder", ptr %15, i32 0, i32 2
  %31 = load ptr, ptr %30, align 8, !tbaa !14
  %32 = load i64, ptr %6, align 8, !tbaa !9
  %33 = load i64, ptr %8, align 8, !tbaa !9
  %34 = invoke noundef i64 @_ZNK10meshloader10NumsMatrix8getValueEmm(ptr noundef nonnull align 8 dereferenceable(40) %31, i64 noundef %32, i64 noundef %33)
          to label %35 unwind label %59

35:                                               ; preds = %29
  store i64 %34, ptr %3, align 8, !tbaa !9
  %36 = getelementptr inbounds %"class.meshloader::MeshContainerBuilder", ptr %15, i32 0, i32 1
  %37 = load ptr, ptr %36, align 8, !tbaa !15
  %38 = load i64, ptr %6, align 8, !tbaa !9
  %39 = load i64, ptr %8, align 8, !tbaa !9
  %40 = invoke noundef i64 @_ZNK10meshloader10NumsMatrix8getValueEmm(ptr noundef nonnull align 8 dereferenceable(40) %37, i64 noundef %38, i64 noundef %39)
          to label %41 unwind label %59

41:                                               ; preds = %35
  store i64 %40, ptr %4, align 8, !tbaa !9
  %42 = load i64, ptr %3, align 8, !tbaa !9
  %43 = icmp ne i64 0, %42
  br i1 %43, label %44, label %76

44:                                               ; preds = %41
  %45 = load i64, ptr %4, align 8, !tbaa !9
  %46 = icmp ne i64 0, %45
  br i1 %46, label %47, label %76

47:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %48 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 176) #7
          to label %49 unwind label %63

49:                                               ; preds = %47
  %50 = load i64, ptr %3, align 8, !tbaa !9
  %51 = load i64, ptr %4, align 8, !tbaa !9
  invoke void @_ZN10meshloader9MacroCellC1Emm(ptr noundef nonnull align 8 dereferenceable(169) %48, i64 noundef %50, i64 noundef %51)
          to label %52 unwind label %67

52:                                               ; preds = %49
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EEC2IS3_vEEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef %48) #6
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  %54 = call noundef ptr @_ZNKSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  invoke void @_ZN10meshloader9MacroCell18defineInteriorTypeEv(ptr noundef nonnull align 8 dereferenceable(169) %54)
          to label %55 unwind label %59

55:                                               ; preds = %52
  %56 = getelementptr inbounds %"class.meshloader::MeshContainerBuilder", ptr %15, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !16
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EEC2EOS4_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  invoke void @_ZN10meshloader4Mesh7addCellESt10unique_ptrINS_9MacroCellESt14default_deleteIS2_EE(ptr noundef nonnull align 8 dereferenceable(49) %57, ptr noundef %12)
          to label %58 unwind label %72

58:                                               ; preds = %55
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  br label %108

59:                                               ; preds = %87, %52, %35, %29
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %9, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %10, align 4
  br label %112

63:                                               ; preds = %47
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %9, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %10, align 4
  br label %71

67:                                               ; preds = %49
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %9, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %10, align 4
  call void @_ZdlPvm(ptr noundef %48, i64 noundef 176) #8
  br label %71

71:                                               ; preds = %67, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %112

72:                                               ; preds = %55
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %9, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %10, align 4
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  br label %112

76:                                               ; preds = %44, %41
  %77 = load i64, ptr %3, align 8, !tbaa !9
  %78 = icmp ne i64 0, %77
  br i1 %78, label %79, label %107

79:                                               ; preds = %76
  %80 = load i64, ptr %4, align 8, !tbaa !9
  %81 = icmp eq i64 0, %80
  br i1 %81, label %82, label %107

82:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %83 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 176) #7
          to label %84 unwind label %94

84:                                               ; preds = %82
  %85 = load i64, ptr %3, align 8, !tbaa !9
  %86 = load i64, ptr %4, align 8, !tbaa !9
  invoke void @_ZN10meshloader9MacroCellC1Emm(ptr noundef nonnull align 8 dereferenceable(169) %83, i64 noundef %85, i64 noundef %86)
          to label %87 unwind label %98

87:                                               ; preds = %84
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EEC2IS3_vEEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef %83) #6
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  %89 = call noundef ptr @_ZNKSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  invoke void @_ZN10meshloader9MacroCell15defineGhostTypeEv(ptr noundef nonnull align 8 dereferenceable(169) %89)
          to label %90 unwind label %59

90:                                               ; preds = %87
  %91 = getelementptr inbounds %"class.meshloader::MeshContainerBuilder", ptr %15, i32 0, i32 0
  %92 = load ptr, ptr %91, align 8, !tbaa !16
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EEC2EOS4_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  invoke void @_ZN10meshloader4Mesh7addCellESt10unique_ptrINS_9MacroCellESt14default_deleteIS2_EE(ptr noundef nonnull align 8 dereferenceable(49) %92, ptr noundef %14)
          to label %93 unwind label %103

93:                                               ; preds = %90
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #6
  br label %107

94:                                               ; preds = %82
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %9, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %10, align 4
  br label %102

98:                                               ; preds = %84
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %9, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %10, align 4
  call void @_ZdlPvm(ptr noundef %83, i64 noundef 176) #8
  br label %102

102:                                              ; preds = %98, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %112

103:                                              ; preds = %90
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %9, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %10, align 4
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #6
  br label %112

107:                                              ; preds = %93, %79, %76
  br label %108

108:                                              ; preds = %107, %58
  br label %109

109:                                              ; preds = %108
  %110 = load i64, ptr %8, align 8, !tbaa !9
  %111 = add i64 %110, 1
  store i64 %111, ptr %8, align 8, !tbaa !9
  br label %23, !llvm.loop !17

112:                                              ; preds = %103, %102, %72, %71, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %125

113:                                              ; preds = %28
  br label %114

114:                                              ; preds = %113
  %115 = load i64, ptr %6, align 8, !tbaa !9
  %116 = add i64 %115, 1
  store i64 %116, ptr %6, align 8, !tbaa !9
  br label %16, !llvm.loop !19

117:                                              ; preds = %21
  %118 = getelementptr inbounds %"class.meshloader::MeshContainerBuilder", ptr %15, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !16
  invoke void @_ZN10meshloader4Mesh32placeCellNumIndexByGlobalCellNumEv(ptr noundef nonnull align 8 dereferenceable(49) %119)
          to label %120 unwind label %121

120:                                              ; preds = %117
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  ret void

121:                                              ; preds = %117
  %122 = landingpad { ptr, i32 }
          cleanup
  %123 = extractvalue { ptr, i32 } %122, 0
  store ptr %123, ptr %9, align 8
  %124 = extractvalue { ptr, i32 } %122, 1
  store i32 %124, ptr %10, align 4
  br label %125

125:                                              ; preds = %121, %112
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %126

126:                                              ; preds = %125
  %127 = load ptr, ptr %9, align 8
  %128 = load i32, ptr %10, align 4
  %129 = insertvalue { ptr, i32 } poison, ptr %127, 0
  %130 = insertvalue { ptr, i32 } %129, i32 %128, 1
  resume { ptr, i32 } %130
}

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

declare i32 @__gxx_personality_v0(...)

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

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

declare noundef i64 @_ZNK10meshloader10NumsMatrix8getValueEmm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef, i64 noundef) #3

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

declare void @_ZN10meshloader9MacroCellC1Emm(ptr noundef nonnull align 8 dereferenceable(169), i64 noundef, i64 noundef) unnamed_addr #3

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

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

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

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

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

declare void @_ZN10meshloader9MacroCell18defineInteriorTypeEv(ptr noundef nonnull align 8 dereferenceable(169)) #3

declare void @_ZN10meshloader4Mesh7addCellESt10unique_ptrINS_9MacroCellESt14default_deleteIS2_EE(ptr noundef nonnull align 8 dereferenceable(49), ptr noundef) #3

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

declare void @_ZN10meshloader9MacroCell15defineGhostTypeEv(ptr noundef nonnull align 8 dereferenceable(169)) #3

declare void @_ZN10meshloader4Mesh32placeCellNumIndexByGlobalCellNumEv(ptr noundef nonnull align 8 dereferenceable(49)) #3

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


; 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::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.14" }
%"struct.std::_Head_base.14" = type { ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10meshloader20MeshContainerBuilder8fillMeshEv(ptr nocapture noundef nonnull readonly align 8 dereferenceable(40) %0) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::unique_ptr", align 8
  %3 = alloca %"class.std::unique_ptr", align 8
  %4 = alloca %"class.std::unique_ptr", align 8
  %5 = alloca %"class.std::unique_ptr", align 8
  %6 = alloca %"class.std::unique_ptr", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EEC2IS3_vEEDn(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr null) #6
  %7 = getelementptr inbounds i8, ptr %0, i64 24
  %8 = load i64, ptr %7, align 8, !tbaa !5
  %.not = icmp eq i64 %8, 0
  br i1 %.not, label %._crit_edge42, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %1
  %9 = getelementptr inbounds i8, ptr %0, i64 32
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  %12 = load i64, ptr %9, align 8, !tbaa !11
  %.not43 = icmp eq i64 %12, 0
  br i1 %.not43, label %._crit_edge42, label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %13 = phi i64 [ %16, %._crit_edge ], [ %8, %.preheader.lr.ph ]
  %14 = phi i64 [ %17, %._crit_edge ], [ 1, %.preheader.lr.ph ]
  %.02641 = phi i64 [ %18, %._crit_edge ], [ 0, %.preheader.lr.ph ]
  %.not44 = icmp eq i64 %14, 0
  br i1 %.not44, label %._crit_edge, label %.lr.ph

._crit_edge42:                                    ; preds = %._crit_edge, %.preheader.lr.ph, %1
  %15 = load ptr, ptr %0, align 8, !tbaa !12
  invoke void @_ZN10meshloader4Mesh32placeCellNumIndexByGlobalCellNumEv(ptr noundef nonnull align 8 dereferenceable(49) %15)
          to label %66 unwind label %67

._crit_edge.loopexit:                             ; preds = %62
  %.pre = load i64, ptr %7, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %16 = phi i64 [ %.pre, %._crit_edge.loopexit ], [ %13, %.preheader ]
  %17 = phi i64 [ %64, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %18 = add nuw i64 %.02641, 1
  %19 = icmp ult i64 %18, %16
  br i1 %19, label %.preheader, label %._crit_edge42, !llvm.loop !13

.lr.ph:                                           ; preds = %.preheader, %62
  %.02540 = phi i64 [ %63, %62 ], [ 0, %.preheader ]
  %20 = load ptr, ptr %10, align 8, !tbaa !16
  %21 = invoke noundef i64 @_ZNK10meshloader10NumsMatrix8getValueEmm(ptr noundef nonnull align 8 dereferenceable(40) %20, i64 noundef %.02641, i64 noundef %.02540)
          to label %22 unwind label %36

22:                                               ; preds = %.lr.ph
  %23 = load ptr, ptr %11, align 8, !tbaa !17
  %24 = invoke noundef i64 @_ZNK10meshloader10NumsMatrix8getValueEmm(ptr noundef nonnull align 8 dereferenceable(40) %23, i64 noundef %.02641, i64 noundef %.02540)
          to label %25 unwind label %36

25:                                               ; preds = %22
  %26 = icmp ne i64 %21, 0
  %27 = icmp ne i64 %24, 0
  %or.cond = and i1 %26, %27
  br i1 %or.cond, label %28, label %45

28:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %29 = invoke noalias noundef nonnull dereferenceable(176) ptr @_Znwm(i64 noundef 176) #7
          to label %30 unwind label %38

30:                                               ; preds = %28
  invoke void @_ZN10meshloader9MacroCellC1Emm(ptr noundef nonnull align 8 dereferenceable(169) %29, i64 noundef %21, i64 noundef %24)
          to label %31 unwind label %40

31:                                               ; preds = %30
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EEC2IS3_vEEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull %29) #6
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  %33 = call noundef ptr @_ZNKSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  invoke void @_ZN10meshloader9MacroCell18defineInteriorTypeEv(ptr noundef nonnull align 8 dereferenceable(169) %33)
          to label %34 unwind label %36

34:                                               ; preds = %31
  %35 = load ptr, ptr %0, align 8, !tbaa !12
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EEC2EOS4_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  invoke void @_ZN10meshloader4Mesh7addCellESt10unique_ptrINS_9MacroCellESt14default_deleteIS2_EE(ptr noundef nonnull align 8 dereferenceable(49) %35, ptr noundef nonnull %4)
          to label %.sink.split unwind label %43

36:                                               ; preds = %50, %31, %22, %.lr.ph
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %69

38:                                               ; preds = %28
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %42

40:                                               ; preds = %30
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %29, i64 noundef 176) #8
  br label %42

42:                                               ; preds = %40, %38
  %.pn32 = phi { ptr, i32 } [ %41, %40 ], [ %39, %38 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br label %69

43:                                               ; preds = %34
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  br label %69

45:                                               ; preds = %25
  %46 = icmp eq i64 %24, 0
  %or.cond3 = and i1 %26, %46
  br i1 %or.cond3, label %47, label %62

47:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %48 = invoke noalias noundef nonnull dereferenceable(176) ptr @_Znwm(i64 noundef 176) #7
          to label %49 unwind label %55

49:                                               ; preds = %47
  invoke void @_ZN10meshloader9MacroCellC1Emm(ptr noundef nonnull align 8 dereferenceable(169) %48, i64 noundef %21, i64 noundef 0)
          to label %50 unwind label %57

50:                                               ; preds = %49
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EEC2IS3_vEEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %48) #6
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %52 = call noundef ptr @_ZNKSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  invoke void @_ZN10meshloader9MacroCell15defineGhostTypeEv(ptr noundef nonnull align 8 dereferenceable(169) %52)
          to label %53 unwind label %36

53:                                               ; preds = %50
  %54 = load ptr, ptr %0, align 8, !tbaa !12
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EEC2EOS4_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  invoke void @_ZN10meshloader4Mesh7addCellESt10unique_ptrINS_9MacroCellESt14default_deleteIS2_EE(ptr noundef nonnull align 8 dereferenceable(49) %54, ptr noundef nonnull %6)
          to label %.sink.split unwind label %60

55:                                               ; preds = %47
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %59

57:                                               ; preds = %49
  %58 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %48, i64 noundef 176) #8
  br label %59

59:                                               ; preds = %57, %55
  %.pn = phi { ptr, i32 } [ %58, %57 ], [ %56, %55 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %69

60:                                               ; preds = %53
  %61 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  br label %69

.sink.split:                                      ; preds = %53, %34
  %.sink = phi ptr [ %4, %34 ], [ %6, %53 ]
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %.sink) #6
  br label %62

62:                                               ; preds = %.sink.split, %45
  %63 = add nuw i64 %.02540, 1
  %64 = load i64, ptr %9, align 8, !tbaa !11
  %65 = icmp ult i64 %63, %64
  br i1 %65, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !18

66:                                               ; preds = %._crit_edge42
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  ret void

67:                                               ; preds = %._crit_edge42
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %69

69:                                               ; preds = %36, %42, %43, %59, %60, %67
  %.pn34.pn = phi { ptr, i32 } [ %68, %67 ], [ %44, %43 ], [ %37, %36 ], [ %.pn32, %42 ], [ %61, %60 ], [ %.pn, %59 ]
  call void @_ZNSt10unique_ptrIN10meshloader9MacroCellESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  resume { ptr, i32 } %.pn34.pn
}

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

declare i32 @__gxx_personality_v0(...)

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

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

declare noundef i64 @_ZNK10meshloader10NumsMatrix8getValueEmm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef, i64 noundef) local_unnamed_addr #3

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

declare void @_ZN10meshloader9MacroCellC1Emm(ptr noundef nonnull align 8 dereferenceable(169), i64 noundef, i64 noundef) unnamed_addr #3

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

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

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

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

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

declare void @_ZN10meshloader9MacroCell18defineInteriorTypeEv(ptr noundef nonnull align 8 dereferenceable(169)) local_unnamed_addr #3

declare void @_ZN10meshloader4Mesh7addCellESt10unique_ptrINS_9MacroCellESt14default_deleteIS2_EE(ptr noundef nonnull align 8 dereferenceable(49), ptr noundef) local_unnamed_addr #3

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

declare void @_ZN10meshloader9MacroCell15defineGhostTypeEv(ptr noundef nonnull align 8 dereferenceable(169)) local_unnamed_addr #3

declare void @_ZN10meshloader4Mesh32placeCellNumIndexByGlobalCellNumEv(ptr noundef nonnull align 8 dereferenceable(49)) local_unnamed_addr #3

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { 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, !10, i64 24}
!6 = !{!"_ZTSN10meshloader20MeshContainerBuilderE", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!6, !10, i64 32}
!12 = !{!6, !7, i64 0}
!13 = distinct !{!13, !14, !15}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
!16 = !{!6, !7, i64 16}
!17 = !{!6, !7, i64 8}
!18 = distinct !{!18, !14}


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