; LLVM IR from zeux/meshoptimizer :: tools (vcachetuner)

; 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.Mesh = type { ptr, i64, %"class.std::vector", [2 x float] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_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<State, std::allocator<State>>::_Vector_impl" }
%"struct.std::_Vector_base<State, std::allocator<State>>::_Vector_impl" = type { %"struct.std::_Vector_base<State, std::allocator<State>>::_Vector_impl_data" }
%"struct.std::_Vector_base<State, std::allocator<State>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { %struct.State, float }
%struct.State = type { [16 x float], [8 x float], float }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<Mesh, std::allocator<Mesh>>::_Vector_impl" }
%"struct.std::_Vector_base<Mesh, std::allocator<Mesh>>::_Vector_impl" = type { %"struct.std::_Vector_base<Mesh, std::allocator<Mesh>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Mesh, std::allocator<Mesh>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.21" = type { ptr }

@.str.11 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [25 x i8], align 1

; 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 uwtable
declare dso_local void @_Z8gridmeshj(ptr dead_on_unwind noalias writable sret(%struct.Mesh) align 8, i32 noundef) #1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z7objmeshPKc(ptr dead_on_unwind noalias writable sret(%struct.Mesh) align 8, ptr noundef) #1

declare i32 @printf(ptr noundef, ...) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z14compute_metricPK5StateRK4MeshPf(ptr noundef, ptr noundef nonnull align 8 dereferenceable(48), ptr noundef) #4

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4gen0mRKSt6vectorI4MeshSaIS0_EE(ptr dead_on_unwind noalias writable sret(%"class.std::vector.15") align 8, i64 noundef, ptr noundef nonnull align 8 dereferenceable(24)) #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4genNRSt6vectorI5StateSaIS0_EERKS_I4MeshSaIS4_EEff(ptr dead_on_unwind noalias writable sret(%"struct.std::pair") align 4, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), float noundef, float noundef) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z10load_statePKcRSt6vectorI5StateSaIS2_EE(ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z10save_statePKcRKSt6vectorI5StateSaIS2_EE(ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10dump_stateRK5State(ptr noundef nonnull align 4 dereferenceable(100)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10dump_statsRK5StateRKSt6vectorI4MeshSaIS3_EE(ptr noundef nonnull align 4 dereferenceable(100), ptr noundef nonnull align 8 dereferenceable(24)) #1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #6 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %"class.std::vector.10", align 8
  %7 = alloca %struct.Mesh, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.Mesh, align 8
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator.21", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator.21", align 8
  %16 = alloca ptr, align 8
  %17 = alloca %"class.std::vector.15", align 8
  %18 = alloca i64, align 8
  %19 = alloca %"class.std::vector.15", align 8
  %20 = alloca %"struct.std::pair", align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @meshopt_encodeIndexVersion(i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #8
  call void @_ZNSt6vectorI4MeshSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  call void @llvm.lifetime.start.p0(i64 48, ptr %7) #8
  invoke void @_Z8gridmeshj(ptr dead_on_unwind writable sret(%struct.Mesh) align 8 %7, i32 noundef 50)
          to label %21 unwind label %28

21:                                               ; preds = %2
  invoke void @_ZNSt6vectorI4MeshSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(48) %7)
          to label %22 unwind label %32

22:                                               ; preds = %21
  call void @_ZN4MeshD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %45, %22
  %24 = load i32, ptr %10, align 4, !tbaa !5
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %37, label %27

27:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %57

28:                                               ; preds = %2
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %8, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %9, align 4
  br label %36

32:                                               ; preds = %21
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %8, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %9, align 4
  call void @_ZN4MeshD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #8
  br label %36

36:                                               ; preds = %32, %28
  call void @llvm.lifetime.end.p0(i64 48, ptr %7) #8
  br label %157

37:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 48, ptr %11) #8
  %38 = load ptr, ptr %5, align 8, !tbaa !9
  %39 = load i32, ptr %10, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds ptr, ptr %38, i64 %40
  %42 = load ptr, ptr %41, align 8, !tbaa !9
  invoke void @_Z7objmeshPKc(ptr dead_on_unwind writable sret(%struct.Mesh) align 8 %11, ptr noundef %42)
          to label %43 unwind label %48

43:                                               ; preds = %37
  invoke void @_ZNSt6vectorI4MeshSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(48) %11)
          to label %44 unwind label %52

44:                                               ; preds = %43
  call void @_ZN4MeshD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #8
  br label %45

45:                                               ; preds = %44
  %46 = load i32, ptr %10, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %10, align 4, !tbaa !5
  br label %23, !llvm.loop !11

48:                                               ; preds = %37
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %8, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %9, align 4
  br label %56

52:                                               ; preds = %43
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %8, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %9, align 4
  call void @_ZN4MeshD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #8
  br label %56

56:                                               ; preds = %52, %48
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %157

57:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  store i64 0, ptr %12, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  store ptr %6, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %58 = load ptr, ptr %13, align 8, !tbaa !9
  %59 = call ptr @_ZNSt6vectorI4MeshSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %58) #8
  %60 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.21", ptr %14, i32 0, i32 0
  store ptr %59, ptr %60, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %61 = load ptr, ptr %13, align 8, !tbaa !9
  %62 = call ptr @_ZNSt6vectorI4MeshSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %61) #8
  %63 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.21", ptr %15, i32 0, i32 0
  store ptr %62, ptr %63, align 8
  br label %64

64:                                               ; preds = %80, %57
  %65 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4MeshSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #8
  br i1 %65, label %67, label %66

66:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %86

67:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %68 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4MeshSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  store ptr %68, ptr %16, align 8, !tbaa !9
  %69 = load ptr, ptr %16, align 8, !tbaa !9
  %70 = load ptr, ptr %16, align 8, !tbaa !9
  %71 = getelementptr inbounds %struct.Mesh, ptr %70, i32 0, i32 3
  %72 = getelementptr inbounds [2 x float], ptr %71, i64 0, i64 0
  invoke void @_Z14compute_metricPK5StateRK4MeshPf(ptr noundef null, ptr noundef nonnull align 8 dereferenceable(48) %69, ptr noundef %72)
          to label %73 unwind label %82

73:                                               ; preds = %67
  %74 = load ptr, ptr %16, align 8, !tbaa !9
  %75 = getelementptr inbounds %struct.Mesh, ptr %74, i32 0, i32 2
  %76 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %75) #8
  %77 = udiv i64 %76, 3
  %78 = load i64, ptr %12, align 8, !tbaa !13
  %79 = add i64 %78, %77
  store i64 %79, ptr %12, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br label %80

80:                                               ; preds = %73
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4MeshSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  br label %64

82:                                               ; preds = %67
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %8, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %156

86:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #8
  call void @_ZNSt6vectorI5StateSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  store i64 0, ptr %18, align 8, !tbaa !13
  %87 = invoke noundef zeroext i1 @_Z10load_statePKcRSt6vectorI5StateSaIS2_EE(ptr noundef @.str.11, ptr noundef nonnull align 8 dereferenceable(24) %17)
          to label %88 unwind label %94

88:                                               ; preds = %86
  br i1 %87, label %89, label %98

89:                                               ; preds = %88
  %90 = call noundef i64 @_ZNKSt6vectorI5StateSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  %91 = trunc i64 %90 to i32
  %92 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.12, i32 noundef %91)
          to label %93 unwind label %94

93:                                               ; preds = %89
  br label %105

94:                                               ; preds = %105, %89, %86
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %8, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %9, align 4
  br label %155

98:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #8
  invoke void @_Z4gen0mRKSt6vectorI4MeshSaIS0_EE(ptr dead_on_unwind writable sret(%"class.std::vector.15") align 8 %19, i64 noundef 95, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %99 unwind label %101

99:                                               ; preds = %98
  %100 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI5StateSaIS0_EEaSEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(24) %19) #8
  call void @_ZNSt6vectorI5StateSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #8
  br label %105

101:                                              ; preds = %98
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %8, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #8
  br label %155

105:                                              ; preds = %99, %93
  %106 = call noundef i64 @_ZNKSt6vectorI4MeshSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  %107 = trunc i64 %106 to i32
  %108 = load i64, ptr %12, align 8, !tbaa !13
  %109 = uitofp i64 %108 to double
  %110 = fdiv double %109, 1.000000e+06
  %111 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.13, i32 noundef %107, double noundef %110)
          to label %112 unwind label %94

112:                                              ; preds = %105
  br label %113

113:                                              ; preds = %154, %112
  call void @llvm.lifetime.start.p0(i64 104, ptr %20) #8
  invoke void @_Z4genNRSt6vectorI5StateSaIS0_EERKS_I4MeshSaIS4_EEff(ptr dead_on_unwind writable sret(%"struct.std::pair") align 4 %20, ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(24) %6, float noundef 0x3FEC2B6AE0000000, float noundef 0x3FDE305540000000)
          to label %114 unwind label %130

114:                                              ; preds = %113
  %115 = load i64, ptr %18, align 8, !tbaa !13
  %116 = add i64 %115, 1
  store i64 %116, ptr %18, align 8, !tbaa !13
  %117 = load i64, ptr %18, align 8, !tbaa !13
  %118 = urem i64 %117, 10
  %119 = icmp eq i64 %118, 0
  br i1 %119, label %120, label %134

120:                                              ; preds = %114
  %121 = load i64, ptr %18, align 8, !tbaa !13
  %122 = trunc i64 %121 to i32
  %123 = getelementptr inbounds %"struct.std::pair", ptr %20, i32 0, i32 1
  %124 = load float, ptr %123, align 4, !tbaa !15
  %125 = fpext float %124 to double
  %126 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.14, i32 noundef %122, double noundef %125)
          to label %127 unwind label %130

127:                                              ; preds = %120
  %128 = getelementptr inbounds %"struct.std::pair", ptr %20, i32 0, i32 0
  invoke void @_Z10dump_statsRK5StateRKSt6vectorI4MeshSaIS3_EE(ptr noundef nonnull align 4 dereferenceable(100) %128, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %129 unwind label %130

129:                                              ; preds = %127
  br label %142

130:                                              ; preds = %151, %144, %142, %134, %127, %120, %113
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %8, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 104, ptr %20) #8
  br label %155

134:                                              ; preds = %114
  %135 = load i64, ptr %18, align 8, !tbaa !13
  %136 = trunc i64 %135 to i32
  %137 = getelementptr inbounds %"struct.std::pair", ptr %20, i32 0, i32 1
  %138 = load float, ptr %137, align 4, !tbaa !15
  %139 = fpext float %138 to double
  %140 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef %136, double noundef %139)
          to label %141 unwind label %130

141:                                              ; preds = %134
  br label %142

142:                                              ; preds = %141, %129
  %143 = getelementptr inbounds %"struct.std::pair", ptr %20, i32 0, i32 0
  invoke void @_Z10dump_stateRK5State(ptr noundef nonnull align 4 dereferenceable(100) %143)
          to label %144 unwind label %130

144:                                              ; preds = %142
  %145 = invoke noundef zeroext i1 @_Z10save_statePKcRKSt6vectorI5StateSaIS2_EE(ptr noundef @.str.16, ptr noundef nonnull align 8 dereferenceable(24) %17)
          to label %146 unwind label %130

146:                                              ; preds = %144
  br i1 %145, label %147, label %151

147:                                              ; preds = %146
  %148 = call i32 @rename(ptr noundef @.str.16, ptr noundef @.str.11) #8
  %149 = icmp eq i32 %148, 0
  br i1 %149, label %150, label %151

150:                                              ; preds = %147
  br label %154

151:                                              ; preds = %147, %146
  %152 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.17)
          to label %153 unwind label %130

153:                                              ; preds = %151
  br label %154

154:                                              ; preds = %153, %150
  call void @llvm.lifetime.end.p0(i64 104, ptr %20) #8
  br label %113, !llvm.loop !19

155:                                              ; preds = %130, %101, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @_ZNSt6vectorI5StateSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #8
  br label %156

156:                                              ; preds = %155, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %157

157:                                              ; preds = %156, %56, %36
  call void @_ZNSt6vectorI4MeshSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #8
  br label %158

158:                                              ; preds = %157
  %159 = load ptr, ptr %8, align 8
  %160 = load i32, ptr %9, align 4
  %161 = insertvalue { ptr, i32 } poison, ptr %159, 0
  %162 = insertvalue { ptr, i32 } %161, i32 %160, 1
  resume { ptr, i32 } %162
}

declare void @meshopt_encodeIndexVersion(i32 noundef) #3

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

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

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

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

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

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

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

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

; Function Attrs: nounwind
declare i32 @rename(ptr noundef, ptr noundef) #7

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = { 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 #5 = { 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 #6 = { mustprogress norecurse 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 "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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !18, i64 100}
!16 = !{!"_ZTSSt4pairI5StatefE", !17, i64 0, !18, i64 100}
!17 = !{!"_ZTS5State", !7, i64 0, !7, i64 64, !18, i64 96}
!18 = !{!"float", !7, i64 0}
!19 = distinct !{!19, !12}


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

%struct.Mesh = type { ptr, i64, %"class.std::vector", [2 x float] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_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<State, std::allocator<State>>::_Vector_impl" }
%"struct.std::_Vector_base<State, std::allocator<State>>::_Vector_impl" = type { %"struct.std::_Vector_base<State, std::allocator<State>>::_Vector_impl_data" }
%"struct.std::_Vector_base<State, std::allocator<State>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { %struct.State, float }
%struct.State = type { [16 x float], [8 x float], float }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<Mesh, std::allocator<Mesh>>::_Vector_impl" }
%"struct.std::_Vector_base<Mesh, std::allocator<Mesh>>::_Vector_impl" = type { %"struct.std::_Vector_base<Mesh, std::allocator<Mesh>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Mesh, std::allocator<Mesh>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.21" = type { ptr }

@.str.11 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [25 x i8], align 1

; 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 uwtable
declare dso_local void @_Z8gridmeshj(ptr dead_on_unwind noalias writable sret(%struct.Mesh) align 8, i32 noundef) local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z7objmeshPKc(ptr dead_on_unwind noalias writable sret(%struct.Mesh) align 8, ptr noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z14compute_metricPK5StateRK4MeshPf(ptr noundef, ptr noundef nonnull align 8 dereferenceable(48), ptr noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4gen0mRKSt6vectorI4MeshSaIS0_EE(ptr dead_on_unwind noalias writable sret(%"class.std::vector.15") align 8, i64 noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4genNRSt6vectorI5StateSaIS0_EERKS_I4MeshSaIS4_EEff(ptr dead_on_unwind noalias writable sret(%"struct.std::pair") align 4, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), float noundef, float noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z10load_statePKcRSt6vectorI5StateSaIS2_EE(ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z10save_statePKcRKSt6vectorI5StateSaIS2_EE(ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10dump_stateRK5State(ptr noundef nonnull align 4 dereferenceable(100)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10dump_statsRK5StateRKSt6vectorI4MeshSaIS3_EE(ptr noundef nonnull align 4 dereferenceable(100), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

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

; Function Attrs: mustprogress norecurse noreturn uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #6 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::vector.10", align 8
  %4 = alloca %struct.Mesh, align 8
  %5 = alloca %struct.Mesh, align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.21", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator.21", align 8
  %8 = alloca %"class.std::vector.15", align 8
  %9 = alloca %"class.std::vector.15", align 8
  %10 = alloca %"struct.std::pair", align 4
  tail call void @meshopt_encodeIndexVersion(i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #8
  call void @_ZNSt6vectorI4MeshSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #8
  invoke void @_Z8gridmeshj(ptr dead_on_unwind nonnull writable sret(%struct.Mesh) align 8 %4, i32 noundef 50)
          to label %11 unwind label %17

11:                                               ; preds = %2
  invoke void @_ZNSt6vectorI4MeshSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(48) %4)
          to label %12 unwind label %19

12:                                               ; preds = %11
  call void @_ZN4MeshD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #8
  %13 = icmp sgt i32 %0, 1
  br i1 %13, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %12
  %wide.trip.count = zext nneg i32 %0 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %25, %12
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %14 = call ptr @_ZNSt6vectorI4MeshSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  store ptr %14, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  %15 = call ptr @_ZNSt6vectorI4MeshSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  store ptr %15, ptr %7, align 8
  %16 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4MeshSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  br i1 %16, label %.lr.ph37, label %._crit_edge38

17:                                               ; preds = %2
  %18 = landingpad { ptr, i32 }
          cleanup
  br label %21

19:                                               ; preds = %11
  %20 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4MeshD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #8
  br label %21

21:                                               ; preds = %19, %17
  %.pn = phi { ptr, i32 } [ %20, %19 ], [ %18, %17 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #8
  br label %87

.lr.ph:                                           ; preds = %.lr.ph.preheader, %25
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %25 ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #8
  %22 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv
  %23 = load ptr, ptr %22, align 8, !tbaa !5
  invoke void @_Z7objmeshPKc(ptr dead_on_unwind nonnull writable sret(%struct.Mesh) align 8 %5, ptr noundef %23)
          to label %24 unwind label %26

24:                                               ; preds = %.lr.ph
  invoke void @_ZNSt6vectorI4MeshSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(48) %5)
          to label %25 unwind label %28

25:                                               ; preds = %24
  call void @_ZN4MeshD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

26:                                               ; preds = %.lr.ph
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %30

28:                                               ; preds = %24
  %29 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4MeshD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #8
  br label %30

30:                                               ; preds = %28, %26
  %.pn30 = phi { ptr, i32 } [ %29, %28 ], [ %27, %26 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #8
  br label %87

._crit_edge38.loopexit:                           ; preds = %35
  %31 = uitofp i64 %39 to double
  br label %._crit_edge38

._crit_edge38:                                    ; preds = %._crit_edge38.loopexit, %._crit_edge
  %.023.lcssa = phi double [ 0.000000e+00, %._crit_edge ], [ %31, %._crit_edge38.loopexit ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #8
  call void @_ZNSt6vectorI5StateSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #8
  %32 = invoke noundef zeroext i1 @_Z10load_statePKcRSt6vectorI5StateSaIS2_EE(ptr noundef nonnull @.str.11, ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %44 unwind label %49

.lr.ph37:                                         ; preds = %._crit_edge, %35
  %.02335 = phi i64 [ %39, %35 ], [ 0, %._crit_edge ]
  %33 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4MeshSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  %34 = getelementptr inbounds i8, ptr %33, i64 40
  invoke void @_Z14compute_metricPK5StateRK4MeshPf(ptr noundef null, ptr noundef nonnull align 8 dereferenceable(48) %33, ptr noundef nonnull %34)
          to label %35 unwind label %42

35:                                               ; preds = %.lr.ph37
  %36 = getelementptr inbounds i8, ptr %33, i64 16
  %37 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #8
  %38 = udiv i64 %37, 3
  %39 = add i64 %38, %.02335
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4MeshSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  %41 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4MeshSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  br i1 %41, label %.lr.ph37, label %._crit_edge38.loopexit

42:                                               ; preds = %.lr.ph37
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  br label %87

44:                                               ; preds = %._crit_edge38
  br i1 %32, label %45, label %51

45:                                               ; preds = %44
  %46 = call noundef i64 @_ZNKSt6vectorI5StateSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #8
  %47 = trunc i64 %46 to i32
  %48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, i32 noundef %47)
  br label %56

49:                                               ; preds = %._crit_edge38
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %86

51:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #8
  invoke void @_Z4gen0mRKSt6vectorI4MeshSaIS0_EE(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.15") align 8 %9, i64 noundef 95, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %52 unwind label %54

52:                                               ; preds = %51
  %53 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI5StateSaIS0_EEaSEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %9) #8
  call void @_ZNSt6vectorI5StateSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #8
  br label %56

54:                                               ; preds = %51
  %55 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #8
  br label %86

56:                                               ; preds = %52, %45
  %57 = call noundef i64 @_ZNKSt6vectorI4MeshSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  %58 = trunc i64 %57 to i32
  %59 = fdiv double %.023.lcssa, 1.000000e+06
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13, i32 noundef %58, double noundef %59)
  %61 = getelementptr inbounds i8, ptr %10, i64 100
  br label %62

62:                                               ; preds = %85, %56
  %.0 = phi i64 [ 0, %56 ], [ %64, %85 ]
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %10) #8
  invoke void @_Z4genNRSt6vectorI5StateSaIS0_EERKS_I4MeshSaIS4_EEff(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair") align 4 %10, ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %3, float noundef 0x3FEC2B6AE0000000, float noundef 0x3FDE305540000000)
          to label %63 unwind label %72

63:                                               ; preds = %62
  %64 = add i64 %.0, 1
  %65 = urem i64 %64, 10
  %66 = icmp eq i64 %65, 0
  %67 = trunc i64 %64 to i32
  %68 = load float, ptr %61, align 4, !tbaa !11
  %69 = fpext float %68 to double
  br i1 %66, label %70, label %74

70:                                               ; preds = %63
  %71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, i32 noundef %67, double noundef %69)
  invoke void @_Z10dump_statsRK5StateRKSt6vectorI4MeshSaIS3_EE(ptr noundef nonnull align 4 dereferenceable(100) %10, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %76 unwind label %72

72:                                               ; preds = %77, %76, %70, %62
  %73 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %10) #8
  br label %86

74:                                               ; preds = %63
  %75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef %67, double noundef %69)
  br label %76

76:                                               ; preds = %70, %74
  invoke void @_Z10dump_stateRK5State(ptr noundef nonnull align 4 dereferenceable(100) %10)
          to label %77 unwind label %72

77:                                               ; preds = %76
  %78 = invoke noundef zeroext i1 @_Z10save_statePKcRKSt6vectorI5StateSaIS2_EE(ptr noundef nonnull @.str.16, ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %79 unwind label %72

79:                                               ; preds = %77
  br i1 %78, label %80, label %83

80:                                               ; preds = %79
  %81 = call i32 @rename(ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.11) #8
  %82 = icmp eq i32 %81, 0
  br i1 %82, label %85, label %83

83:                                               ; preds = %80, %79
  %84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17)
  br label %85

85:                                               ; preds = %80, %83
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %10) #8
  br label %62, !llvm.loop !15

86:                                               ; preds = %72, %54, %49
  %.pn26 = phi { ptr, i32 } [ %73, %72 ], [ %55, %54 ], [ %50, %49 ]
  call void @_ZNSt6vectorI5StateSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #8
  br label %87

87:                                               ; preds = %42, %86, %30, %21
  %.pn30.pn = phi { ptr, i32 } [ %.pn30, %30 ], [ %.pn, %21 ], [ %43, %42 ], [ %.pn26, %86 ]
  call void @_ZNSt6vectorI4MeshSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #8
  resume { ptr, i32 } %.pn30.pn
}

declare void @meshopt_encodeIndexVersion(i32 noundef) local_unnamed_addr #7

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

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

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

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

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

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @rename(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #3

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="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 #5 = { 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 #6 = { mustprogress norecurse noreturn 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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !14, i64 100}
!12 = !{!"_ZTSSt4pairI5StatefE", !13, i64 0, !14, i64 100}
!13 = !{!"_ZTS5State", !7, i64 0, !7, i64 64, !14, i64 96}
!14 = !{!"float", !7, i64 0}
!15 = distinct !{!15, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass