; LLVM IR from goldest-star/seawave-animation :: src/vcl/shape/mesh/mesh_primitive (mesh_primitive)

; 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.vcl::mat" = type { float, float, float, float, float, float, float, float, float }
%"struct.vcl::mesh" = type { %"struct.vcl::buffer", %"struct.vcl::buffer", %"struct.vcl::buffer.5", %"struct.vcl::buffer.11", %"struct.vcl::buffer.17" }
%"struct.vcl::buffer" = type { %"class.std::vector.0" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<vcl::buffer_stack<float, 3>, std::allocator<vcl::buffer_stack<float, 3>>>::_Vector_impl" }
%"struct.std::_Vector_base<vcl::buffer_stack<float, 3>, std::allocator<vcl::buffer_stack<float, 3>>>::_Vector_impl" = type { %"struct.std::_Vector_base<vcl::buffer_stack<float, 3>, std::allocator<vcl::buffer_stack<float, 3>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vcl::buffer_stack<float, 3>, std::allocator<vcl::buffer_stack<float, 3>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.vcl::buffer.5" = type { %"class.std::vector.6" }
%"class.std::vector.6" = type { %"struct.std::_Vector_base.7" }
%"struct.std::_Vector_base.7" = type { %"struct.std::_Vector_base<vcl::buffer_stack<float, 4>, std::allocator<vcl::buffer_stack<float, 4>>>::_Vector_impl" }
%"struct.std::_Vector_base<vcl::buffer_stack<float, 4>, std::allocator<vcl::buffer_stack<float, 4>>>::_Vector_impl" = type { %"struct.std::_Vector_base<vcl::buffer_stack<float, 4>, std::allocator<vcl::buffer_stack<float, 4>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vcl::buffer_stack<float, 4>, std::allocator<vcl::buffer_stack<float, 4>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.vcl::buffer.11" = type { %"class.std::vector.12" }
%"class.std::vector.12" = type { %"struct.std::_Vector_base.13" }
%"struct.std::_Vector_base.13" = type { %"struct.std::_Vector_base<vcl::buffer_stack<float, 2>, std::allocator<vcl::buffer_stack<float, 2>>>::_Vector_impl" }
%"struct.std::_Vector_base<vcl::buffer_stack<float, 2>, std::allocator<vcl::buffer_stack<float, 2>>>::_Vector_impl" = type { %"struct.std::_Vector_base<vcl::buffer_stack<float, 2>, std::allocator<vcl::buffer_stack<float, 2>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vcl::buffer_stack<float, 2>, std::allocator<vcl::buffer_stack<float, 2>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.vcl::buffer.17" = type { %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::array<unsigned int, 3>, std::allocator<std::array<unsigned int, 3>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::array<unsigned int, 3>, std::allocator<std::array<unsigned int, 3>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::array<unsigned int, 3>, std::allocator<std::array<unsigned int, 3>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::array<unsigned int, 3>, std::allocator<std::array<unsigned int, 3>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.vcl::buffer_stack" = type { float, float, float }
%"struct.std::array" = type { [3 x i32] }

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3sinf(float noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3cosf(float noundef) #2

declare void @_ZN3vcl12buffer_stackIfLm3EEC1Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #3

; 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) #4

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

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN3vclplIfLm3EEENS_12buffer_stackIT_XT0_EEERKS3_S5_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #5

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

declare void @_ZN3vcl28rotation_between_vector_mat3ERKNS_12buffer_stackIfLm3EEES3_(ptr dead_on_unwind writable sret(%"struct.vcl::mat") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #3

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN3vclmlILm3ELm3EEENS_12buffer_stackIfXT_EEERKNS_3matIXT_EXT0_EEERKNS1_IfXT0_EEE(ptr noundef nonnull align 4 dereferenceable(36), ptr noundef nonnull align 4 dereferenceable(12)) #5

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vcl19mesh_primitive_discEfRKNS_12buffer_stackIfLm3EEES3_m(ptr dead_on_unwind noalias writable sret(%"struct.vcl::mesh") align 8 %0, float noundef %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %3, i64 noundef %4) #6 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca float, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i1, align 1
  %12 = alloca %"struct.vcl::mat", align 4
  %13 = alloca %"struct.vcl::buffer_stack", align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca %"struct.vcl::buffer_stack", align 4
  %20 = alloca %"struct.vcl::buffer_stack", align 4
  %21 = alloca { <2 x float>, float }, align 8
  %22 = alloca %"struct.vcl::buffer_stack", align 4
  %23 = alloca { <2 x float>, float }, align 8
  %24 = alloca %"struct.std::array", align 4
  store ptr %0, ptr %6, align 8
  store float %1, ptr %7, align 4, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !9
  store i64 %4, ptr %10, align 8, !tbaa !11
  store i1 false, ptr %11, align 1
  call void @_ZN3vcl4meshC2Ev(ptr noundef nonnull align 8 dereferenceable(120) %0)
  call void @llvm.lifetime.start.p0(i64 36, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #7
  invoke void @_ZN3vcl12buffer_stackIfLm3EEC1Efff(ptr noundef nonnull align 4 dereferenceable(12) %13, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
          to label %25 unwind label %33

25:                                               ; preds = %5
  %26 = load ptr, ptr %9, align 8, !tbaa !9
  invoke void @_ZN3vcl28rotation_between_vector_mat3ERKNS_12buffer_stackIfLm3EEES3_(ptr dead_on_unwind writable sret(%"struct.vcl::mat") align 4 %12, ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) %26)
          to label %27 unwind label %33

27:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store i64 0, ptr %16, align 8, !tbaa !11
  br label %28

28:                                               ; preds = %81, %27
  %29 = load i64, ptr %16, align 8, !tbaa !11
  %30 = load i64, ptr %10, align 8, !tbaa !11
  %31 = icmp ult i64 %29, %30
  br i1 %31, label %37, label %32

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

33:                                               ; preds = %25, %5
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %14, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #7
  br label %113

37:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %38 = load i64, ptr %16, align 8, !tbaa !11
  %39 = uitofp i64 %38 to float
  %40 = load i64, ptr %10, align 8, !tbaa !11
  %41 = uitofp i64 %40 to float
  %42 = fsub float %41, 1.000000e+00
  %43 = fdiv float %39, %42
  store float %43, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %44 = load float, ptr %17, align 4, !tbaa !5
  %45 = fmul float 0x401921FA00000000, %44
  store float %45, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %20) #7
  %46 = load float, ptr %7, align 4, !tbaa !5
  %47 = load float, ptr %18, align 4, !tbaa !5
  %48 = invoke noundef float @_ZSt3cosf(float noundef %47)
          to label %49 unwind label %84

49:                                               ; preds = %37
  %50 = fmul float %46, %48
  %51 = load float, ptr %7, align 4, !tbaa !5
  %52 = load float, ptr %18, align 4, !tbaa !5
  %53 = invoke noundef float @_ZSt3sinf(float noundef %52)
          to label %54 unwind label %84

54:                                               ; preds = %49
  %55 = fmul float %51, %53
  invoke void @_ZN3vcl12buffer_stackIfLm3EEC1Efff(ptr noundef nonnull align 4 dereferenceable(12) %20, float noundef %50, float noundef %55, float noundef 0.000000e+00)
          to label %56 unwind label %84

56:                                               ; preds = %54
  %57 = invoke { <2 x float>, float } @_ZN3vclmlILm3ELm3EEENS_12buffer_stackIfXT_EEERKNS_3matIXT_EXT0_EEERKNS1_IfXT0_EEE(ptr noundef nonnull align 4 dereferenceable(36) %12, ptr noundef nonnull align 4 dereferenceable(12) %20)
          to label %58 unwind label %84

58:                                               ; preds = %56
  store { <2 x float>, float } %57, ptr %21, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 8 %21, i64 12, i1 false)
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #7
  %59 = getelementptr inbounds %"struct.vcl::mesh", ptr %0, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 12, ptr %22) #7
  %60 = load ptr, ptr %8, align 8, !tbaa !9
  %61 = invoke { <2 x float>, float } @_ZN3vclplIfLm3EEENS_12buffer_stackIT_XT0_EEERKS3_S5_(ptr noundef nonnull align 4 dereferenceable(12) %60, ptr noundef nonnull align 4 dereferenceable(12) %19)
          to label %62 unwind label %88

62:                                               ; preds = %58
  store { <2 x float>, float } %61, ptr %23, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 8 %23, i64 12, i1 false)
  invoke void @_ZN3vcl6bufferINS_12buffer_stackIfLm3EEEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %59, ptr noundef nonnull align 4 dereferenceable(12) %22)
          to label %63 unwind label %88

63:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #7
  %64 = getelementptr inbounds %"struct.vcl::mesh", ptr %0, i32 0, i32 1
  %65 = load ptr, ptr %9, align 8, !tbaa !9
  invoke void @_ZN3vcl6bufferINS_12buffer_stackIfLm3EEEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %64, ptr noundef nonnull align 4 dereferenceable(12) %65)
          to label %66 unwind label %92

66:                                               ; preds = %63
  %67 = getelementptr inbounds %"struct.vcl::mesh", ptr %0, i32 0, i32 4
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #7
  %68 = getelementptr inbounds %"struct.std::array", ptr %24, i32 0, i32 0
  %69 = load i64, ptr %16, align 8, !tbaa !11
  %70 = trunc i64 %69 to i32
  store i32 %70, ptr %68, align 4, !tbaa !13
  %71 = getelementptr inbounds i32, ptr %68, i64 1
  %72 = load i64, ptr %16, align 8, !tbaa !11
  %73 = add i64 %72, 1
  %74 = load i64, ptr %10, align 8, !tbaa !11
  %75 = urem i64 %73, %74
  %76 = trunc i64 %75 to i32
  store i32 %76, ptr %71, align 4, !tbaa !13
  %77 = getelementptr inbounds i32, ptr %68, i64 2
  %78 = load i64, ptr %10, align 8, !tbaa !11
  %79 = trunc i64 %78 to i32
  store i32 %79, ptr %77, align 4, !tbaa !13
  invoke void @_ZN3vcl6bufferISt5arrayIjLm3EEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %67, ptr noundef nonnull align 4 dereferenceable(12) %24)
          to label %80 unwind label %96

80:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %81

81:                                               ; preds = %80
  %82 = load i64, ptr %16, align 8, !tbaa !11
  %83 = add i64 %82, 1
  store i64 %83, ptr %16, align 8, !tbaa !11
  br label %28, !llvm.loop !15

84:                                               ; preds = %56, %54, %49, %37
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %14, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #7
  br label %100

88:                                               ; preds = %62, %58
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %14, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #7
  br label %100

92:                                               ; preds = %63
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %14, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %15, align 4
  br label %100

96:                                               ; preds = %66
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %14, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #7
  br label %100

100:                                              ; preds = %96, %92, %88, %84
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %113

101:                                              ; preds = %32
  %102 = getelementptr inbounds %"struct.vcl::mesh", ptr %0, i32 0, i32 0
  %103 = load ptr, ptr %8, align 8, !tbaa !9
  invoke void @_ZN3vcl6bufferINS_12buffer_stackIfLm3EEEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %102, ptr noundef nonnull align 4 dereferenceable(12) %103)
          to label %104 unwind label %109

104:                                              ; preds = %101
  %105 = getelementptr inbounds %"struct.vcl::mesh", ptr %0, i32 0, i32 1
  %106 = load ptr, ptr %9, align 8, !tbaa !9
  invoke void @_ZN3vcl6bufferINS_12buffer_stackIfLm3EEEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %105, ptr noundef nonnull align 4 dereferenceable(12) %106)
          to label %107 unwind label %109

107:                                              ; preds = %104
  store i1 true, ptr %11, align 1
  call void @llvm.lifetime.end.p0(i64 36, ptr %12) #7
  %108 = load i1, ptr %11, align 1
  br i1 %108, label %115, label %114

109:                                              ; preds = %104, %101
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %14, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %15, align 4
  br label %113

113:                                              ; preds = %109, %100, %33
  call void @llvm.lifetime.end.p0(i64 36, ptr %12) #7
  call void @_ZN3vcl4meshD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %0) #7
  br label %116

114:                                              ; preds = %107
  call void @_ZN3vcl4meshD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %0) #7
  br label %115

115:                                              ; preds = %114, %107
  ret void

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

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

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


; 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.vcl::mat" = type { float, float, float, float, float, float, float, float, float }
%"struct.vcl::mesh" = type { %"struct.vcl::buffer", %"struct.vcl::buffer", %"struct.vcl::buffer.5", %"struct.vcl::buffer.11", %"struct.vcl::buffer.17" }
%"struct.vcl::buffer" = type { %"class.std::vector.0" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<vcl::buffer_stack<float, 3>, std::allocator<vcl::buffer_stack<float, 3>>>::_Vector_impl" }
%"struct.std::_Vector_base<vcl::buffer_stack<float, 3>, std::allocator<vcl::buffer_stack<float, 3>>>::_Vector_impl" = type { %"struct.std::_Vector_base<vcl::buffer_stack<float, 3>, std::allocator<vcl::buffer_stack<float, 3>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vcl::buffer_stack<float, 3>, std::allocator<vcl::buffer_stack<float, 3>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.vcl::buffer.5" = type { %"class.std::vector.6" }
%"class.std::vector.6" = type { %"struct.std::_Vector_base.7" }
%"struct.std::_Vector_base.7" = type { %"struct.std::_Vector_base<vcl::buffer_stack<float, 4>, std::allocator<vcl::buffer_stack<float, 4>>>::_Vector_impl" }
%"struct.std::_Vector_base<vcl::buffer_stack<float, 4>, std::allocator<vcl::buffer_stack<float, 4>>>::_Vector_impl" = type { %"struct.std::_Vector_base<vcl::buffer_stack<float, 4>, std::allocator<vcl::buffer_stack<float, 4>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vcl::buffer_stack<float, 4>, std::allocator<vcl::buffer_stack<float, 4>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.vcl::buffer.11" = type { %"class.std::vector.12" }
%"class.std::vector.12" = type { %"struct.std::_Vector_base.13" }
%"struct.std::_Vector_base.13" = type { %"struct.std::_Vector_base<vcl::buffer_stack<float, 2>, std::allocator<vcl::buffer_stack<float, 2>>>::_Vector_impl" }
%"struct.std::_Vector_base<vcl::buffer_stack<float, 2>, std::allocator<vcl::buffer_stack<float, 2>>>::_Vector_impl" = type { %"struct.std::_Vector_base<vcl::buffer_stack<float, 2>, std::allocator<vcl::buffer_stack<float, 2>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vcl::buffer_stack<float, 2>, std::allocator<vcl::buffer_stack<float, 2>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.vcl::buffer.17" = type { %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::array<unsigned int, 3>, std::allocator<std::array<unsigned int, 3>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::array<unsigned int, 3>, std::allocator<std::array<unsigned int, 3>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::array<unsigned int, 3>, std::allocator<std::array<unsigned int, 3>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::array<unsigned int, 3>, std::allocator<std::array<unsigned int, 3>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.vcl::buffer_stack" = type { float, float, float }
%"struct.std::array" = type { [3 x i32] }

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3sinf(float noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3cosf(float noundef) local_unnamed_addr #2

declare void @_ZN3vcl12buffer_stackIfLm3EEC1Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN3vclplIfLm3EEENS_12buffer_stackIT_XT0_EEERKS3_S5_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4

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

declare void @_ZN3vcl28rotation_between_vector_mat3ERKNS_12buffer_stackIfLm3EEES3_(ptr dead_on_unwind writable sret(%"struct.vcl::mat") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN3vclmlILm3ELm3EEENS_12buffer_stackIfXT_EEERKNS_3matIXT_EXT0_EEERKNS1_IfXT0_EEE(ptr noundef nonnull align 4 dereferenceable(36), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vcl19mesh_primitive_discEfRKNS_12buffer_stackIfLm3EEES3_m(ptr dead_on_unwind noalias nonnull writable sret(%"struct.vcl::mesh") align 8 %0, float noundef %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %3, i64 noundef %4) local_unnamed_addr #5 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"struct.vcl::mat", align 4
  %7 = alloca %"struct.vcl::buffer_stack", align 4
  %8 = alloca %"struct.vcl::buffer_stack", align 8
  %9 = alloca %"struct.vcl::buffer_stack", align 4
  %10 = alloca %"struct.vcl::buffer_stack", align 8
  %11 = alloca %"struct.std::array", align 4
  tail call void @_ZN3vcl4meshC2Ev(ptr noundef nonnull align 8 dereferenceable(120) %0)
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #6
  invoke void @_ZN3vcl12buffer_stackIfLm3EEC1Efff(ptr noundef nonnull align 4 dereferenceable(12) %7, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
          to label %12 unwind label %21

12:                                               ; preds = %5
  invoke void @_ZN3vcl28rotation_between_vector_mat3ERKNS_12buffer_stackIfLm3EEES3_(ptr dead_on_unwind nonnull writable sret(%"struct.vcl::mat") align 4 %6, ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %3)
          to label %13 unwind label %21

13:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #6
  %.not = icmp eq i64 %4, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %13
  %14 = uitofp i64 %4 to float
  %15 = fadd float %14, -1.000000e+00
  %.sroa.24.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %10, i64 8
  %16 = getelementptr inbounds i8, ptr %0, i64 24
  %17 = getelementptr inbounds i8, ptr %0, i64 96
  %18 = getelementptr inbounds i8, ptr %11, i64 4
  %19 = getelementptr inbounds i8, ptr %11, i64 8
  %20 = trunc i64 %4 to i32
  br label %23

._crit_edge:                                      ; preds = %43, %13
  invoke void @_ZN3vcl6bufferINS_12buffer_stackIfLm3EEEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(12) %2)
          to label %53 unwind label %56

21:                                               ; preds = %12, %5
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #6
  br label %58

23:                                               ; preds = %.lr.ph, %43
  %.02731 = phi i64 [ 0, %.lr.ph ], [ %39, %43 ]
  %24 = uitofp i64 %.02731 to float
  %25 = fdiv float %24, %15
  %26 = fmul float %25, 0x401921FA00000000
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #6
  %27 = call noundef float @_ZSt3cosf(float noundef %26)
  %28 = fmul float %27, %1
  %29 = call noundef float @_ZSt3sinf(float noundef %26)
  %30 = fmul float %29, %1
  invoke void @_ZN3vcl12buffer_stackIfLm3EEC1Efff(ptr noundef nonnull align 4 dereferenceable(12) %9, float noundef %28, float noundef %30, float noundef 0.000000e+00)
          to label %31 unwind label %44

31:                                               ; preds = %23
  %32 = invoke { <2 x float>, float } @_ZN3vclmlILm3ELm3EEENS_12buffer_stackIfXT_EEERKNS_3matIXT_EXT0_EEERKNS1_IfXT0_EEE(ptr noundef nonnull align 4 dereferenceable(36) %6, ptr noundef nonnull align 4 dereferenceable(12) %9)
          to label %33 unwind label %44

33:                                               ; preds = %31
  %.fca.0.extract1 = extractvalue { <2 x float>, float } %32, 0
  %.fca.1.extract2 = extractvalue { <2 x float>, float } %32, 1
  store <2 x float> %.fca.0.extract1, ptr %8, align 8
  store float %.fca.1.extract2, ptr %.sroa.24.0..sroa_idx, align 8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #6
  %34 = invoke { <2 x float>, float } @_ZN3vclplIfLm3EEENS_12buffer_stackIT_XT0_EEERKS3_S5_(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %8)
          to label %35 unwind label %46

35:                                               ; preds = %33
  %.fca.0.extract = extractvalue { <2 x float>, float } %34, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %34, 1
  store <2 x float> %.fca.0.extract, ptr %10, align 8
  store float %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  invoke void @_ZN3vcl6bufferINS_12buffer_stackIfLm3EEEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %36 unwind label %46

36:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #6
  invoke void @_ZN3vcl6bufferINS_12buffer_stackIfLm3EEEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 4 dereferenceable(12) %3)
          to label %37 unwind label %48

37:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #6
  %38 = trunc i64 %.02731 to i32
  store i32 %38, ptr %11, align 4, !tbaa !5
  %39 = add nuw i64 %.02731, 1
  %40 = icmp eq i64 %39, %4
  %41 = trunc i64 %39 to i32
  %42 = select i1 %40, i32 0, i32 %41
  store i32 %42, ptr %18, align 4, !tbaa !5
  store i32 %20, ptr %19, align 4, !tbaa !5
  invoke void @_ZN3vcl6bufferISt5arrayIjLm3EEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 4 dereferenceable(12) %11)
          to label %43 unwind label %50

43:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #6
  %exitcond.not = icmp eq i64 %39, %4
  br i1 %exitcond.not, label %._crit_edge, label %23, !llvm.loop !9

44:                                               ; preds = %31, %23
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #6
  br label %52

46:                                               ; preds = %35, %33
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #6
  br label %52

48:                                               ; preds = %36
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %52

50:                                               ; preds = %37
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #6
  br label %52

52:                                               ; preds = %50, %48, %46, %44
  %.pn = phi { ptr, i32 } [ %51, %50 ], [ %49, %48 ], [ %47, %46 ], [ %45, %44 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #6
  br label %58

53:                                               ; preds = %._crit_edge
  %54 = getelementptr inbounds i8, ptr %0, i64 24
  invoke void @_ZN3vcl6bufferINS_12buffer_stackIfLm3EEEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %54, ptr noundef nonnull align 4 dereferenceable(12) %3)
          to label %55 unwind label %56

55:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %6) #6
  ret void

56:                                               ; preds = %53, %._crit_edge
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %58

58:                                               ; preds = %56, %52, %21
  %.pn.pn = phi { ptr, i32 } [ %.pn, %52 ], [ %57, %56 ], [ %22, %21 ]
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %6) #6
  call void @_ZN3vcl4meshD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %0) #6
  resume { ptr, i32 } %.pn.pn
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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"="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 = { 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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass