; LLVM IR from ronan-kerviche/glip-lib :: GLIP-Lib/src/Core/Filter.ll (ZN4Glip12CorePipeline6FilterD2Ev)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.Glip::CorePipeline::Filter" = type { ptr, [6 x ptr], ptr, ptr, i8, i8, %"class.std::vector.39", %"class.Glip::CorePipeline::Component.base", %"class.Glip::CorePipeline::AbstractComponentLayout", %"class.Glip::CorePipeline::AbstractFilterLayout.base", [4 x i8], %"class.Glip::CoreGL::HdlAbstractTextureFormat.base" }
%"class.std::vector.39" = type { %"struct.std::_Vector_base.40" }
%"struct.std::_Vector_base.40" = type { %"struct.std::_Vector_base<Glip::CoreGL::HdlTexture *, std::allocator<Glip::CoreGL::HdlTexture *>>::_Vector_impl" }
%"struct.std::_Vector_base<Glip::CoreGL::HdlTexture *, std::allocator<Glip::CoreGL::HdlTexture *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Glip::CoreGL::HdlTexture *, std::allocator<Glip::CoreGL::HdlTexture *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Glip::CoreGL::HdlTexture *, std::allocator<Glip::CoreGL::HdlTexture *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Glip::CorePipeline::Component.base" = type { ptr, %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.Glip::CorePipeline::AbstractComponentLayout" = type { ptr, %"class.std::__cxx11::basic_string", %"class.std::vector", %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Glip::CorePipeline::AbstractFilterLayout.base" = type <{ ptr, [6 x ptr], ptr, i8, i8, i8, i8, i32, i32, i32, i32 }>
%"class.Glip::CoreGL::HdlAbstractTextureFormat.base" = type <{ ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }>

; 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: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #1

; Function Attrs: nounwind
declare void @_ZN4Glip6CoreGL9HdlShaderD1Ev(ptr noundef nonnull align 8 dereferenceable(280)) unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN4Glip6CoreGL10HdlProgramD1Ev(ptr noundef nonnull align 8 dereferenceable(88)) unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4Glip12CorePipeline6FilterD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef %1) unnamed_addr #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %6 = load ptr, ptr %3, align 8
  %7 = load ptr, ptr %4, align 8
  %8 = load ptr, ptr %7, align 8
  store ptr %8, ptr %6, align 8, !tbaa !9
  %9 = getelementptr inbounds ptr, ptr %7, i64 1
  %10 = load ptr, ptr %9, align 8
  %11 = load ptr, ptr %6, align 8, !tbaa !9
  %12 = getelementptr i8, ptr %11, i64 -24
  %13 = load i64, ptr %12, align 8
  %14 = getelementptr inbounds i8, ptr %6, i64 %13
  store ptr %10, ptr %14, align 8, !tbaa !9
  %15 = getelementptr inbounds ptr, ptr %7, i64 2
  %16 = load ptr, ptr %15, align 8
  %17 = load ptr, ptr %6, align 8, !tbaa !9
  %18 = getelementptr i8, ptr %17, i64 -32
  %19 = load i64, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr %6, i64 %19
  store ptr %16, ptr %20, align 8, !tbaa !9
  %21 = getelementptr inbounds ptr, ptr %7, i64 3
  %22 = load ptr, ptr %21, align 8
  %23 = load ptr, ptr %6, align 8, !tbaa !9
  %24 = getelementptr i8, ptr %23, i64 -40
  %25 = load i64, ptr %24, align 8
  %26 = getelementptr inbounds i8, ptr %6, i64 %25
  store ptr %22, ptr %26, align 8, !tbaa !9
  %27 = getelementptr inbounds ptr, ptr %7, i64 4
  %28 = load ptr, ptr %27, align 8
  %29 = load ptr, ptr %6, align 8, !tbaa !9
  %30 = getelementptr i8, ptr %29, i64 -48
  %31 = load i64, ptr %30, align 8
  %32 = getelementptr inbounds i8, ptr %6, i64 %31
  store ptr %28, ptr %32, align 8, !tbaa !9
  %33 = getelementptr inbounds %"class.Glip::CorePipeline::Filter", ptr %6, i32 0, i32 2
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = icmp eq ptr %34, null
  br i1 %35, label %37, label %36

36:                                               ; preds = %2
  call void @_ZN4Glip6CoreGL10HdlProgramD1Ev(ptr noundef nonnull align 8 dereferenceable(88) %34) #4
  call void @_ZdlPvm(ptr noundef %34, i64 noundef 88) #5
  br label %37

37:                                               ; preds = %36, %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !18
  br label %38

38:                                               ; preds = %51, %37
  %39 = load i32, ptr %5, align 4, !tbaa !18
  %40 = icmp ult i32 %39, 6
  br i1 %40, label %42, label %41

41:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %54

42:                                               ; preds = %38
  %43 = getelementptr inbounds %"class.Glip::CorePipeline::Filter", ptr %6, i32 0, i32 1
  %44 = load i32, ptr %5, align 4, !tbaa !18
  %45 = zext i32 %44 to i64
  %46 = getelementptr inbounds [6 x ptr], ptr %43, i64 0, i64 %45
  %47 = load ptr, ptr %46, align 8, !tbaa !5
  %48 = icmp eq ptr %47, null
  br i1 %48, label %50, label %49

49:                                               ; preds = %42
  call void @_ZN4Glip6CoreGL9HdlShaderD1Ev(ptr noundef nonnull align 8 dereferenceable(280) %47) #4
  call void @_ZdlPvm(ptr noundef %47, i64 noundef 280) #5
  br label %50

50:                                               ; preds = %49, %42
  br label %51

51:                                               ; preds = %50
  %52 = load i32, ptr %5, align 4, !tbaa !18
  %53 = add i32 %52, 1
  store i32 %53, ptr %5, align 4, !tbaa !18
  br label %38, !llvm.loop !20

54:                                               ; preds = %41
  %55 = getelementptr inbounds %"class.Glip::CorePipeline::Filter", ptr %6, i32 0, i32 3
  %56 = load ptr, ptr %55, align 8, !tbaa !22
  %57 = icmp eq ptr %56, null
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  call void @_ZN4Glip12CorePipeline16GeometryInstanceD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %56) #4
  call void @_ZdlPvm(ptr noundef %56, i64 noundef 4) #5
  br label %59

59:                                               ; preds = %58, %54
  %60 = getelementptr inbounds %"class.Glip::CorePipeline::Filter", ptr %6, i32 0, i32 6
  call void @_ZNSt6vectorIPN4Glip6CoreGL10HdlTextureESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %60) #4
  ret void
}

; Function Attrs: nounwind
declare void @_ZN4Glip12CorePipeline16GeometryInstanceD1Ev(ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { nounwind }
attributes #5 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !6, i64 56}
!12 = !{!"_ZTSN4Glip12CorePipeline6FilterE", !7, i64 8, !6, i64 56, !6, i64 64, !13, i64 72, !13, i64 73, !14, i64 80}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTSSt6vectorIPN4Glip6CoreGL10HdlTextureESaIS3_EE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIPN4Glip6CoreGL10HdlTextureESaIS3_EE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIPN4Glip6CoreGL10HdlTextureESaIS3_EE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIPN4Glip6CoreGL10HdlTextureESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!19, !19, i64 0}
!19 = !{!"int", !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!12, !6, i64 64}


; 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: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind
declare void @_ZN4Glip6CoreGL9HdlShaderD1Ev(ptr noundef nonnull align 8 dereferenceable(280)) unnamed_addr #1

; Function Attrs: nounwind
declare void @_ZN4Glip6CoreGL10HdlProgramD1Ev(ptr noundef nonnull align 8 dereferenceable(88)) unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4Glip12CorePipeline6FilterD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr nocapture noundef readonly %1) unnamed_addr #2 align 2 {
  %3 = load ptr, ptr %1, align 8
  store ptr %3, ptr %0, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %1, i64 8
  %5 = load ptr, ptr %4, align 8
  %6 = getelementptr i8, ptr %3, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr %0, i64 %7
  store ptr %5, ptr %8, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %1, i64 16
  %10 = load ptr, ptr %9, align 8
  %11 = load ptr, ptr %0, align 8, !tbaa !5
  %12 = getelementptr i8, ptr %11, i64 -32
  %13 = load i64, ptr %12, align 8
  %14 = getelementptr inbounds i8, ptr %0, i64 %13
  store ptr %10, ptr %14, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %1, i64 24
  %16 = load ptr, ptr %15, align 8
  %17 = load ptr, ptr %0, align 8, !tbaa !5
  %18 = getelementptr i8, ptr %17, i64 -40
  %19 = load i64, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr %0, i64 %19
  store ptr %16, ptr %20, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %1, i64 32
  %22 = load ptr, ptr %21, align 8
  %23 = load ptr, ptr %0, align 8, !tbaa !5
  %24 = getelementptr i8, ptr %23, i64 -48
  %25 = load i64, ptr %24, align 8
  %26 = getelementptr inbounds i8, ptr %0, i64 %25
  store ptr %22, ptr %26, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %0, i64 56
  %28 = load ptr, ptr %27, align 8, !tbaa !8
  %29 = icmp eq ptr %28, null
  br i1 %29, label %31, label %30

30:                                               ; preds = %2
  tail call void @_ZN4Glip6CoreGL10HdlProgramD1Ev(ptr noundef nonnull align 8 dereferenceable(88) %28) #3
  tail call void @_ZdlPvm(ptr noundef nonnull %28, i64 noundef 88) #4
  br label %31

31:                                               ; preds = %30, %2
  %32 = getelementptr inbounds i8, ptr %0, i64 8
  %33 = load ptr, ptr %32, align 8, !tbaa !17
  %34 = icmp eq ptr %33, null
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  tail call void @_ZN4Glip6CoreGL9HdlShaderD1Ev(ptr noundef nonnull align 8 dereferenceable(280) %33) #3
  tail call void @_ZdlPvm(ptr noundef nonnull %33, i64 noundef 280) #4
  br label %36

36:                                               ; preds = %31, %35
  %37 = getelementptr inbounds i8, ptr %0, i64 16
  %38 = load ptr, ptr %37, align 8, !tbaa !17
  %39 = icmp eq ptr %38, null
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  tail call void @_ZN4Glip6CoreGL9HdlShaderD1Ev(ptr noundef nonnull align 8 dereferenceable(280) %38) #3
  tail call void @_ZdlPvm(ptr noundef nonnull %38, i64 noundef 280) #4
  br label %41

41:                                               ; preds = %40, %36
  %42 = getelementptr inbounds i8, ptr %0, i64 24
  %43 = load ptr, ptr %42, align 8, !tbaa !17
  %44 = icmp eq ptr %43, null
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  tail call void @_ZN4Glip6CoreGL9HdlShaderD1Ev(ptr noundef nonnull align 8 dereferenceable(280) %43) #3
  tail call void @_ZdlPvm(ptr noundef nonnull %43, i64 noundef 280) #4
  br label %46

46:                                               ; preds = %45, %41
  %47 = getelementptr inbounds i8, ptr %0, i64 32
  %48 = load ptr, ptr %47, align 8, !tbaa !17
  %49 = icmp eq ptr %48, null
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  tail call void @_ZN4Glip6CoreGL9HdlShaderD1Ev(ptr noundef nonnull align 8 dereferenceable(280) %48) #3
  tail call void @_ZdlPvm(ptr noundef nonnull %48, i64 noundef 280) #4
  br label %51

51:                                               ; preds = %50, %46
  %52 = getelementptr inbounds i8, ptr %0, i64 40
  %53 = load ptr, ptr %52, align 8, !tbaa !17
  %54 = icmp eq ptr %53, null
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  tail call void @_ZN4Glip6CoreGL9HdlShaderD1Ev(ptr noundef nonnull align 8 dereferenceable(280) %53) #3
  tail call void @_ZdlPvm(ptr noundef nonnull %53, i64 noundef 280) #4
  br label %56

56:                                               ; preds = %55, %51
  %57 = getelementptr inbounds i8, ptr %0, i64 48
  %58 = load ptr, ptr %57, align 8, !tbaa !17
  %59 = icmp eq ptr %58, null
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  tail call void @_ZN4Glip6CoreGL9HdlShaderD1Ev(ptr noundef nonnull align 8 dereferenceable(280) %58) #3
  tail call void @_ZdlPvm(ptr noundef nonnull %58, i64 noundef 280) #4
  br label %61

61:                                               ; preds = %60, %56
  %62 = getelementptr inbounds i8, ptr %0, i64 64
  %63 = load ptr, ptr %62, align 8, !tbaa !18
  %64 = icmp eq ptr %63, null
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  tail call void @_ZN4Glip12CorePipeline16GeometryInstanceD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %63) #3
  tail call void @_ZdlPvm(ptr noundef nonnull %63, i64 noundef 4) #4
  br label %66

66:                                               ; preds = %65, %61
  %67 = getelementptr inbounds i8, ptr %0, i64 80
  tail call void @_ZNSt6vectorIPN4Glip6CoreGL10HdlTextureESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %67) #3
  ret void
}

; Function Attrs: nounwind
declare void @_ZN4Glip12CorePipeline16GeometryInstanceD1Ev(ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #1

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
attributes #4 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !11, i64 56}
!9 = !{!"_ZTSN4Glip12CorePipeline6FilterE", !10, i64 8, !11, i64 56, !11, i64 64, !12, i64 72, !12, i64 73, !13, i64 80}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!"any pointer", !10, i64 0}
!12 = !{!"bool", !10, i64 0}
!13 = !{!"_ZTSSt6vectorIPN4Glip6CoreGL10HdlTextureESaIS3_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIPN4Glip6CoreGL10HdlTextureESaIS3_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIPN4Glip6CoreGL10HdlTextureESaIS3_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIPN4Glip6CoreGL10HdlTextureESaIS3_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!17 = !{!11, !11, i64 0}
!18 = !{!9, !11, i64 64}


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