; LLVM IR from Xingyu-Lin/softgym :: PyFlex/extensions (flexExtCloth)

; 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"

%struct.NvFlexExtAsset = type { ptr, i32, i32, ptr, ptr, ptr, i32, ptr, i32, ptr, ptr, ptr, i32, ptr, ptr, ptr, i32, i8, float, float, float }
%struct.FlexExtTearingClothAsset = type { %struct.NvFlexExtAsset, ptr }
%class.ClothMesh = type <{ %"class.std::vector.0", %"class.std::vector.5", %"class.std::vector.5", %"class.std::vector.10", %"class.std::vector.15", i32, float, float, i8, [3 x i8] }>
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<ClothMesh::Edge, std::allocator<ClothMesh::Edge>>::_Vector_impl" }
%"struct.std::_Vector_base<ClothMesh::Edge, std::allocator<ClothMesh::Edge>>::_Vector_impl" = type { %"struct.std::_Vector_base<ClothMesh::Edge, std::allocator<ClothMesh::Edge>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ClothMesh::Edge, std::allocator<ClothMesh::Edge>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.15" = type { %"struct.std::_Vector_base.16" }
%"struct.std::_Vector_base.16" = type { %"struct.std::_Vector_base<ClothMesh::Triangle, std::allocator<ClothMesh::Triangle>>::_Vector_impl" }
%"struct.std::_Vector_base<ClothMesh::Triangle, std::allocator<ClothMesh::Triangle>>::_Vector_impl" = type { %"struct.std::_Vector_base<ClothMesh::Triangle, std::allocator<ClothMesh::Triangle>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ClothMesh::Triangle, std::allocator<ClothMesh::Triangle>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

; 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #4

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9ClothMeshC2EPK8XVector4IfEiPKiiffb(ptr noundef nonnull align 8 dereferenceable(133), ptr noundef, i32 noundef, ptr noundef, i32 noundef, float noundef, float noundef, i1 noundef zeroext) unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #6 align 2

declare void @NvFlexExtDestroyAsset(ptr noundef) #7

; Function Attrs: mustprogress uwtable
define dso_local ptr @NvFlexExtCreateTearingClothFromMesh(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4, float noundef %5, float noundef %6, float noundef %7) #8 personality ptr @__gxx_personality_v0 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store i32 %1, ptr %11, align 4, !tbaa !9
  store i32 %2, ptr %12, align 4, !tbaa !9
  store ptr %3, ptr %13, align 8, !tbaa !5
  store i32 %4, ptr %14, align 4, !tbaa !9
  store float %5, ptr %15, align 4, !tbaa !11
  store float %6, ptr %16, align 4, !tbaa !11
  store float %7, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #10
  %24 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 152) #11
  call void @llvm.memset.p0.i64(ptr align 16 %24, i8 0, i64 152, i1 false)
  store ptr %24, ptr %18, align 8, !tbaa !5
  %25 = load ptr, ptr %18, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %25, i8 0, i64 152, i1 false)
  %26 = load i32, ptr %12, align 4, !tbaa !9
  %27 = mul nsw i32 %26, 4
  %28 = sext i32 %27 to i64
  %29 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %28, i64 4)
  %30 = extractvalue { i64, i1 } %29, 1
  %31 = extractvalue { i64, i1 } %29, 0
  %32 = select i1 %30, i64 -1, i64 %31
  %33 = call noalias noundef nonnull ptr @_Znam(i64 noundef %32) #11
  %34 = load ptr, ptr %18, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.NvFlexExtAsset, ptr %34, i32 0, i32 0
  store ptr %33, ptr %35, align 8, !tbaa !13
  %36 = load ptr, ptr %18, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.NvFlexExtAsset, ptr %36, i32 0, i32 0
  %38 = load ptr, ptr %37, align 8, !tbaa !13
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = load i32, ptr %11, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = mul i64 %41, 4
  %43 = mul i64 %42, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %38, ptr align 4 %39, i64 %43, i1 false)
  %44 = load i32, ptr %14, align 4, !tbaa !9
  %45 = mul nsw i32 %44, 3
  %46 = sext i32 %45 to i64
  %47 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %46, i64 4)
  %48 = extractvalue { i64, i1 } %47, 1
  %49 = extractvalue { i64, i1 } %47, 0
  %50 = select i1 %48, i64 -1, i64 %49
  %51 = call noalias noundef nonnull ptr @_Znam(i64 noundef %50) #11
  %52 = load ptr, ptr %18, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.NvFlexExtAsset, ptr %52, i32 0, i32 15
  store ptr %51, ptr %53, align 8, !tbaa !16
  %54 = load ptr, ptr %18, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.NvFlexExtAsset, ptr %54, i32 0, i32 15
  %56 = load ptr, ptr %55, align 8, !tbaa !16
  %57 = load ptr, ptr %13, align 8, !tbaa !5
  %58 = load i32, ptr %14, align 4, !tbaa !9
  %59 = mul nsw i32 %58, 3
  %60 = sext i32 %59 to i64
  %61 = mul i64 %60, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %56, ptr align 4 %57, i64 %61, i1 false)
  %62 = load i32, ptr %11, align 4, !tbaa !9
  %63 = load ptr, ptr %18, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.NvFlexExtAsset, ptr %63, i32 0, i32 1
  store i32 %62, ptr %64, align 8, !tbaa !17
  %65 = load i32, ptr %12, align 4, !tbaa !9
  %66 = load ptr, ptr %18, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.NvFlexExtAsset, ptr %66, i32 0, i32 2
  store i32 %65, ptr %67, align 4, !tbaa !18
  %68 = load i32, ptr %14, align 4, !tbaa !9
  %69 = load ptr, ptr %18, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.NvFlexExtAsset, ptr %69, i32 0, i32 16
  store i32 %68, ptr %70, align 8, !tbaa !19
  %71 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 136) #11
  %72 = load ptr, ptr %10, align 8, !tbaa !5
  %73 = load i32, ptr %11, align 4, !tbaa !9
  %74 = load ptr, ptr %13, align 8, !tbaa !5
  %75 = load i32, ptr %14, align 4, !tbaa !9
  %76 = mul nsw i32 %75, 3
  %77 = load float, ptr %15, align 4, !tbaa !11
  %78 = load float, ptr %16, align 4, !tbaa !11
  invoke void @_ZN9ClothMeshC2EPK8XVector4IfEiPKiiffb(ptr noundef nonnull align 8 dereferenceable(133) %71, ptr noundef %72, i32 noundef %73, ptr noundef %74, i32 noundef %76, float noundef %77, float noundef %78, i1 noundef zeroext true)
          to label %79 unwind label %130

79:                                               ; preds = %8
  %80 = load ptr, ptr %18, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.FlexExtTearingClothAsset, ptr %80, i32 0, i32 1
  store ptr %71, ptr %81, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #10
  %82 = load ptr, ptr %18, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.FlexExtTearingClothAsset, ptr %82, i32 0, i32 1
  %84 = load ptr, ptr %83, align 8, !tbaa !20
  store ptr %84, ptr %21, align 8, !tbaa !5
  %85 = load ptr, ptr %21, align 8, !tbaa !5
  %86 = getelementptr inbounds %class.ClothMesh, ptr %85, i32 0, i32 8
  %87 = load i8, ptr %86, align 4, !tbaa !22, !range !40, !noundef !41
  %88 = trunc i8 %87 to i1
  br i1 %88, label %89, label %135

89:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #10
  %90 = load ptr, ptr %21, align 8, !tbaa !5
  %91 = getelementptr inbounds %class.ClothMesh, ptr %90, i32 0, i32 1
  %92 = call noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %91) #10
  %93 = trunc i64 %92 to i32
  store i32 %93, ptr %22, align 4, !tbaa !9
  %94 = load ptr, ptr %21, align 8, !tbaa !5
  %95 = getelementptr inbounds %class.ClothMesh, ptr %94, i32 0, i32 0
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %95, i64 noundef 0) #10
  %97 = load ptr, ptr %18, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.NvFlexExtAsset, ptr %97, i32 0, i32 3
  store ptr %96, ptr %98, align 8, !tbaa !42
  %99 = load ptr, ptr %21, align 8, !tbaa !5
  %100 = getelementptr inbounds %class.ClothMesh, ptr %99, i32 0, i32 1
  %101 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %100, i64 noundef 0) #10
  %102 = load ptr, ptr %18, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.NvFlexExtAsset, ptr %102, i32 0, i32 4
  store ptr %101, ptr %103, align 8, !tbaa !43
  %104 = load ptr, ptr %21, align 8, !tbaa !5
  %105 = getelementptr inbounds %class.ClothMesh, ptr %104, i32 0, i32 2
  %106 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %105, i64 noundef 0) #10
  %107 = load ptr, ptr %18, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.NvFlexExtAsset, ptr %107, i32 0, i32 5
  store ptr %106, ptr %108, align 8, !tbaa !44
  %109 = load i32, ptr %22, align 4, !tbaa !9
  %110 = load ptr, ptr %18, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.NvFlexExtAsset, ptr %110, i32 0, i32 6
  store i32 %109, ptr %111, align 8, !tbaa !45
  %112 = load float, ptr %17, align 4, !tbaa !11
  %113 = fcmp ogt float %112, 0.000000e+00
  br i1 %113, label %114, label %134

114:                                              ; preds = %89
  %115 = load ptr, ptr %18, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.NvFlexExtAsset, ptr %115, i32 0, i32 17
  store i8 1, ptr %116, align 4, !tbaa !46
  %117 = load ptr, ptr %21, align 8, !tbaa !5
  %118 = getelementptr inbounds %class.ClothMesh, ptr %117, i32 0, i32 6
  %119 = load float, ptr %118, align 4, !tbaa !47
  %120 = load ptr, ptr %18, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.NvFlexExtAsset, ptr %120, i32 0, i32 18
  store float %119, ptr %121, align 8, !tbaa !48
  %122 = load ptr, ptr %21, align 8, !tbaa !5
  %123 = getelementptr inbounds %class.ClothMesh, ptr %122, i32 0, i32 7
  %124 = load float, ptr %123, align 8, !tbaa !49
  %125 = load ptr, ptr %18, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.NvFlexExtAsset, ptr %125, i32 0, i32 20
  store float %124, ptr %126, align 8, !tbaa !50
  %127 = load float, ptr %17, align 4, !tbaa !11
  %128 = load ptr, ptr %18, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.NvFlexExtAsset, ptr %128, i32 0, i32 19
  store float %127, ptr %129, align 4, !tbaa !51
  br label %134

130:                                              ; preds = %8
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %19, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %20, align 4
  call void @_ZdlPvm(ptr noundef %71, i64 noundef 136) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #10
  br label %141

134:                                              ; preds = %114, %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #10
  br label %137

135:                                              ; preds = %79
  %136 = load ptr, ptr %18, align 8, !tbaa !5
  call void @NvFlexExtDestroyAsset(ptr noundef %136)
  store ptr null, ptr %9, align 8
  store i32 1, ptr %23, align 4
  br label %139

137:                                              ; preds = %134
  %138 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %138, ptr %9, align 8
  store i32 1, ptr %23, align 4
  br label %139

139:                                              ; preds = %137, %135
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #10
  %140 = load ptr, ptr %9, align 8
  ret ptr %140

141:                                              ; preds = %130
  %142 = load ptr, ptr %19, align 8
  %143 = load i32, ptr %20, align 4
  %144 = insertvalue { ptr, i32 } poison, ptr %142, 0
  %145 = insertvalue { ptr, i32 } %144, i32 %143, 1
  resume { ptr, i32 } %145
}

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

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = { 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 = { "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 #8 = { 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 #9 = { 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 #10 = { nounwind }
attributes #11 = { builtin allocsize(0) }
attributes #12 = { 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 = !{!"float", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS14NvFlexExtAsset", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40, !6, i64 48, !10, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !10, i64 120, !15, i64 124, !12, i64 128, !12, i64 132, !12, i64 136}
!15 = !{!"bool", !7, i64 0}
!16 = !{!14, !6, i64 112}
!17 = !{!14, !10, i64 8}
!18 = !{!14, !10, i64 12}
!19 = !{!14, !10, i64 120}
!20 = !{!21, !6, i64 144}
!21 = !{!"_ZTS24FlexExtTearingClothAsset", !14, i64 0, !6, i64 144}
!22 = !{!23, !15, i64 132}
!23 = !{!"_ZTS9ClothMesh", !24, i64 0, !28, i64 24, !28, i64 48, !32, i64 72, !36, i64 96, !10, i64 120, !12, i64 124, !12, i64 128, !15, i64 132}
!24 = !{!"_ZTSSt6vectorIiSaIiEE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!28 = !{!"_ZTSSt6vectorIfSaIfEE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!32 = !{!"_ZTSSt6vectorIN9ClothMesh4EdgeESaIS1_EE", !33, i64 0}
!33 = !{!"_ZTSSt12_Vector_baseIN9ClothMesh4EdgeESaIS1_EE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIN9ClothMesh4EdgeESaIS1_EE12_Vector_implE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseIN9ClothMesh4EdgeESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!36 = !{!"_ZTSSt6vectorIN9ClothMesh8TriangleESaIS1_EE", !37, i64 0}
!37 = !{!"_ZTSSt12_Vector_baseIN9ClothMesh8TriangleESaIS1_EE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseIN9ClothMesh8TriangleESaIS1_EE12_Vector_implE", !39, i64 0}
!39 = !{!"_ZTSNSt12_Vector_baseIN9ClothMesh8TriangleESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!40 = !{i8 0, i8 2}
!41 = !{}
!42 = !{!14, !6, i64 16}
!43 = !{!14, !6, i64 24}
!44 = !{!14, !6, i64 32}
!45 = !{!14, !10, i64 40}
!46 = !{!14, !15, i64 124}
!47 = !{!23, !12, i64 124}
!48 = !{!14, !12, i64 128}
!49 = !{!23, !12, i64 128}
!50 = !{!14, !12, i64 136}
!51 = !{!14, !12, i64 132}


; 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"

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9ClothMeshC2EPK8XVector4IfEiPKiiffb(ptr noundef nonnull align 8 dereferenceable(133), ptr noundef, i32 noundef, ptr noundef, i32 noundef, float noundef, float noundef, i1 noundef zeroext) unnamed_addr #3 align 2

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

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

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

declare void @NvFlexExtDestroyAsset(ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @NvFlexExtCreateTearingClothFromMesh(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4, float noundef %5, float noundef %6, float noundef %7) local_unnamed_addr #6 personality ptr @__gxx_personality_v0 {
  %9 = tail call noalias noundef nonnull dereferenceable(152) ptr @_Znwm(i64 noundef 152) #8
  %10 = shl nsw i32 %2, 2
  %11 = sext i32 %10 to i64
  %12 = icmp slt i32 %2, 0
  %13 = shl nsw i64 %11, 2
  %14 = select i1 %12, i64 -1, i64 %13
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(152) %9, i8 0, i64 152, i1 false)
  %15 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %14) #8
  store ptr %15, ptr %9, align 8, !tbaa !5
  %16 = sext i32 %1 to i64
  %17 = shl nsw i64 %16, 4
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %15, ptr align 4 %0, i64 %17, i1 false)
  %18 = mul nsw i32 %4, 3
  %19 = sext i32 %18 to i64
  %20 = icmp slt i32 %4, 0
  %21 = shl nsw i64 %19, 2
  %22 = select i1 %20, i64 -1, i64 %21
  %23 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %22) #8
  %24 = getelementptr inbounds i8, ptr %9, i64 112
  store ptr %23, ptr %24, align 8, !tbaa !13
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %23, ptr align 4 %3, i64 %21, i1 false)
  %25 = getelementptr inbounds i8, ptr %9, i64 8
  store i32 %1, ptr %25, align 8, !tbaa !14
  %26 = getelementptr inbounds i8, ptr %9, i64 12
  store i32 %2, ptr %26, align 4, !tbaa !15
  %27 = getelementptr inbounds i8, ptr %9, i64 120
  store i32 %4, ptr %27, align 8, !tbaa !16
  %28 = tail call noalias noundef nonnull dereferenceable(136) ptr @_Znwm(i64 noundef 136) #8
  invoke void @_ZN9ClothMeshC2EPK8XVector4IfEiPKiiffb(ptr noundef nonnull align 8 dereferenceable(133) %28, ptr noundef %0, i32 noundef %1, ptr noundef %3, i32 noundef %18, float noundef %5, float noundef %6, i1 noundef zeroext true)
          to label %29 unwind label %56

29:                                               ; preds = %8
  %30 = getelementptr inbounds i8, ptr %9, i64 144
  store ptr %28, ptr %30, align 8, !tbaa !17
  %31 = getelementptr inbounds i8, ptr %28, i64 132
  %32 = load i8, ptr %31, align 4, !tbaa !19, !range !37, !noundef !38
  %33 = trunc nuw i8 %32 to i1
  br i1 %33, label %34, label %58

34:                                               ; preds = %29
  %35 = getelementptr inbounds i8, ptr %28, i64 24
  %36 = tail call noundef i64 @_ZNKSt6vectorIfSaIfEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #9
  %37 = trunc i64 %36 to i32
  %38 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %28, i64 noundef 0) #9
  %39 = getelementptr inbounds i8, ptr %9, i64 16
  store ptr %38, ptr %39, align 8, !tbaa !39
  %40 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef 0) #9
  %41 = getelementptr inbounds i8, ptr %9, i64 24
  store ptr %40, ptr %41, align 8, !tbaa !40
  %42 = getelementptr inbounds i8, ptr %28, i64 48
  %43 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %42, i64 noundef 0) #9
  %44 = getelementptr inbounds i8, ptr %9, i64 32
  store ptr %43, ptr %44, align 8, !tbaa !41
  %45 = getelementptr inbounds i8, ptr %9, i64 40
  store i32 %37, ptr %45, align 8, !tbaa !42
  %46 = fcmp ogt float %7, 0.000000e+00
  br i1 %46, label %47, label %59

47:                                               ; preds = %34
  %48 = getelementptr inbounds i8, ptr %9, i64 124
  store i8 1, ptr %48, align 4, !tbaa !43
  %49 = getelementptr inbounds i8, ptr %28, i64 124
  %50 = load float, ptr %49, align 4, !tbaa !44
  %51 = getelementptr inbounds i8, ptr %9, i64 128
  store float %50, ptr %51, align 8, !tbaa !45
  %52 = getelementptr inbounds i8, ptr %28, i64 128
  %53 = load float, ptr %52, align 8, !tbaa !46
  %54 = getelementptr inbounds i8, ptr %9, i64 136
  store float %53, ptr %54, align 8, !tbaa !47
  %55 = getelementptr inbounds i8, ptr %9, i64 132
  store float %7, ptr %55, align 4, !tbaa !48
  br label %59

56:                                               ; preds = %8
  %57 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %28, i64 noundef 136) #10
  resume { ptr, i32 } %57

58:                                               ; preds = %29
  tail call void @NvFlexExtDestroyAsset(ptr noundef nonnull %9)
  br label %59

59:                                               ; preds = %34, %47, %58
  %.0 = phi ptr [ null, %58 ], [ %9, %47 ], [ %9, %34 ]
  ret ptr %.0
}

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

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress uwtable "min-legal-vector-width"="64" "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 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 #5 = { "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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { builtin allocsize(0) }
attributes #9 = { nounwind }
attributes #10 = { 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 0}
!6 = !{!"_ZTS14NvFlexExtAsset", !7, i64 0, !10, i64 8, !10, i64 12, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !7, i64 48, !10, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !10, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !10, i64 120, !11, i64 124, !12, i64 128, !12, i64 132, !12, i64 136}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"float", !8, i64 0}
!13 = !{!6, !7, i64 112}
!14 = !{!6, !10, i64 8}
!15 = !{!6, !10, i64 12}
!16 = !{!6, !10, i64 120}
!17 = !{!18, !7, i64 144}
!18 = !{!"_ZTS24FlexExtTearingClothAsset", !6, i64 0, !7, i64 144}
!19 = !{!20, !11, i64 132}
!20 = !{!"_ZTS9ClothMesh", !21, i64 0, !25, i64 24, !25, i64 48, !29, i64 72, !33, i64 96, !10, i64 120, !12, i64 124, !12, i64 128, !11, i64 132}
!21 = !{!"_ZTSSt6vectorIiSaIiEE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!25 = !{!"_ZTSSt6vectorIfSaIfEE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!29 = !{!"_ZTSSt6vectorIN9ClothMesh4EdgeESaIS1_EE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseIN9ClothMesh4EdgeESaIS1_EE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIN9ClothMesh4EdgeESaIS1_EE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIN9ClothMesh4EdgeESaIS1_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!33 = !{!"_ZTSSt6vectorIN9ClothMesh8TriangleESaIS1_EE", !34, i64 0}
!34 = !{!"_ZTSSt12_Vector_baseIN9ClothMesh8TriangleESaIS1_EE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseIN9ClothMesh8TriangleESaIS1_EE12_Vector_implE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseIN9ClothMesh8TriangleESaIS1_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!37 = !{i8 0, i8 2}
!38 = !{}
!39 = !{!6, !7, i64 16}
!40 = !{!6, !7, i64 24}
!41 = !{!6, !7, i64 32}
!42 = !{!6, !10, i64 40}
!43 = !{!6, !11, i64 124}
!44 = !{!20, !12, i64 124}
!45 = !{!6, !12, i64 128}
!46 = !{!20, !12, i64 128}
!47 = !{!6, !12, i64 136}
!48 = !{!6, !12, i64 132}


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