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

; 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::AbstractFilterLayout" = type <{ ptr, [6 x ptr], ptr, i8, i8, i8, i8, i32, i32, i32, i32, [4 x i8], %"class.Glip::CorePipeline::AbstractComponentLayout", %"class.Glip::CoreGL::HdlAbstractTextureFormat.base", [4 x i8] }>
%"class.Glip::CorePipeline::AbstractComponentLayout" = type { ptr, %"class.std::__cxx11::basic_string", %"class.std::vector", %"class.std::vector" }
%"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.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::CoreGL::HdlAbstractTextureFormat.base" = type <{ ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }>

@_ZTVN4Glip12CorePipeline20AbstractFilterLayoutE = external dso_local unnamed_addr constant { [6 x ptr], [7 x ptr], [11 x ptr] }, align 8

; 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
define dso_local void @_ZN4Glip12CorePipeline20AbstractFilterLayoutC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_6CoreGL24HdlAbstractTextureFormatE(ptr noundef nonnull align 8 dereferenceable(84) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(52) %2) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %10 = load ptr, ptr %4, align 8
  %11 = getelementptr inbounds i8, ptr %10, i64 88
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN4Glip12CorePipeline23AbstractComponentLayoutC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(88) %11, ptr noundef nonnull align 8 dereferenceable(32) %12)
  %13 = getelementptr inbounds i8, ptr %10, i64 176
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN4Glip6CoreGL24HdlAbstractTextureFormatC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(52) %13, ptr noundef nonnull align 8 dereferenceable(52) %14)
          to label %15 unwind label %31

15:                                               ; preds = %3
  store ptr getelementptr inbounds inrange(-32, 16) ({ [6 x ptr], [7 x ptr], [11 x ptr] }, ptr @_ZTVN4Glip12CorePipeline20AbstractFilterLayoutE, i32 0, i32 0, i32 4), ptr %10, align 8, !tbaa !9
  %16 = getelementptr inbounds i8, ptr %10, i64 88
  store ptr getelementptr inbounds inrange(-32, 24) ({ [6 x ptr], [7 x ptr], [11 x ptr] }, ptr @_ZTVN4Glip12CorePipeline20AbstractFilterLayoutE, i32 0, i32 1, i32 4), ptr %16, align 8, !tbaa !9
  %17 = getelementptr inbounds i8, ptr %10, i64 176
  store ptr getelementptr inbounds inrange(-48, 40) ({ [6 x ptr], [7 x ptr], [11 x ptr] }, ptr @_ZTVN4Glip12CorePipeline20AbstractFilterLayoutE, i32 0, i32 2, i32 6), ptr %17, align 8, !tbaa !9
  %18 = getelementptr inbounds %"class.Glip::CorePipeline::AbstractFilterLayout", ptr %10, i32 0, i32 2
  store ptr null, ptr %18, align 8, !tbaa !11
  %19 = getelementptr inbounds %"class.Glip::CorePipeline::AbstractFilterLayout", ptr %10, i32 0, i32 3
  store i8 1, ptr %19, align 8, !tbaa !15
  %20 = getelementptr inbounds %"class.Glip::CorePipeline::AbstractFilterLayout", ptr %10, i32 0, i32 4
  store i8 0, ptr %20, align 1, !tbaa !16
  %21 = getelementptr inbounds %"class.Glip::CorePipeline::AbstractFilterLayout", ptr %10, i32 0, i32 5
  store i8 0, ptr %21, align 2, !tbaa !17
  %22 = getelementptr inbounds %"class.Glip::CorePipeline::AbstractFilterLayout", ptr %10, i32 0, i32 6
  store i8 1, ptr %22, align 1, !tbaa !18
  %23 = getelementptr inbounds %"class.Glip::CorePipeline::AbstractFilterLayout", ptr %10, i32 0, i32 7
  store i32 1, ptr %23, align 4, !tbaa !19
  %24 = getelementptr inbounds %"class.Glip::CorePipeline::AbstractFilterLayout", ptr %10, i32 0, i32 8
  store i32 1, ptr %24, align 8, !tbaa !20
  %25 = getelementptr inbounds %"class.Glip::CorePipeline::AbstractFilterLayout", ptr %10, i32 0, i32 9
  store i32 32774, ptr %25, align 4, !tbaa !21
  %26 = getelementptr inbounds %"class.Glip::CorePipeline::AbstractFilterLayout", ptr %10, i32 0, i32 10
  store i32 513, ptr %26, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !23
  br label %27

27:                                               ; preds = %41, %15
  %28 = load i32, ptr %9, align 4, !tbaa !23
  %29 = icmp ult i32 %28, 6
  br i1 %29, label %36, label %30

30:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %44

31:                                               ; preds = %3
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %7, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %8, align 4
  %35 = getelementptr inbounds i8, ptr %10, i64 88
  call void @_ZN4Glip12CorePipeline23AbstractComponentLayoutD2Ev(ptr noundef nonnull align 8 dereferenceable(88) %35) #4
  br label %45

36:                                               ; preds = %27
  %37 = getelementptr inbounds %"class.Glip::CorePipeline::AbstractFilterLayout", ptr %10, i32 0, i32 1
  %38 = load i32, ptr %9, align 4, !tbaa !23
  %39 = zext i32 %38 to i64
  %40 = getelementptr inbounds [6 x ptr], ptr %37, i64 0, i64 %39
  store ptr null, ptr %40, align 8, !tbaa !5
  br label %41

41:                                               ; preds = %36
  %42 = load i32, ptr %9, align 4, !tbaa !23
  %43 = add i32 %42, 1
  store i32 %43, ptr %9, align 4, !tbaa !23
  br label %27, !llvm.loop !24

44:                                               ; preds = %30
  ret void

45:                                               ; preds = %31
  %46 = load ptr, ptr %7, align 8
  %47 = load i32, ptr %8, align 4
  %48 = insertvalue { ptr, i32 } poison, ptr %46, 0
  %49 = insertvalue { ptr, i32 } %48, i32 %47, 1
  resume { ptr, i32 } %49
}

declare void @_ZN4Glip12CorePipeline23AbstractComponentLayoutC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2

declare void @_ZN4Glip6CoreGL24HdlAbstractTextureFormatC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(52), ptr noundef nonnull align 8 dereferenceable(52)) unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

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

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 = { "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 "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 }

!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 = !{!"_ZTSN4Glip12CorePipeline20AbstractFilterLayoutE", !7, i64 8, !6, i64 56, !13, i64 64, !13, i64 65, !13, i64 66, !13, i64 67, !14, i64 68, !14, i64 72, !14, i64 76, !14, i64 80}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!12, !13, i64 64}
!16 = !{!12, !13, i64 65}
!17 = !{!12, !13, i64 66}
!18 = !{!12, !13, i64 67}
!19 = !{!12, !14, i64 68}
!20 = !{!12, !14, i64 72}
!21 = !{!12, !14, i64 76}
!22 = !{!12, !14, i64 80}
!23 = !{!14, !14, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"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"

@_ZTVN4Glip12CorePipeline20AbstractFilterLayoutE = external dso_local unnamed_addr constant { [6 x ptr], [7 x ptr], [11 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Glip12CorePipeline20AbstractFilterLayoutC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_6CoreGL24HdlAbstractTextureFormatE(ptr noundef nonnull align 8 dereferenceable(84) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(52) %2) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 88
  tail call void @_ZN4Glip12CorePipeline23AbstractComponentLayoutC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(88) %4, ptr noundef nonnull align 8 dereferenceable(32) %1)
  %5 = getelementptr inbounds i8, ptr %0, i64 176
  invoke void @_ZN4Glip6CoreGL24HdlAbstractTextureFormatC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(52) %5, ptr noundef nonnull align 8 dereferenceable(52) %2)
          to label %6 unwind label %11

6:                                                ; preds = %3
  store ptr getelementptr inbounds inrange(-32, 16) (i8, ptr @_ZTVN4Glip12CorePipeline20AbstractFilterLayoutE, i64 32), ptr %0, align 8, !tbaa !5
  store ptr getelementptr inbounds inrange(-32, 24) (i8, ptr @_ZTVN4Glip12CorePipeline20AbstractFilterLayoutE, i64 80), ptr %4, align 8, !tbaa !5
  store ptr getelementptr inbounds inrange(-48, 40) (i8, ptr @_ZTVN4Glip12CorePipeline20AbstractFilterLayoutE, i64 152), ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 56
  store ptr null, ptr %7, align 8, !tbaa !8
  %8 = getelementptr inbounds i8, ptr %0, i64 64
  store <4 x i8> <i8 1, i8 0, i8 0, i8 1>, ptr %8, align 8, !tbaa !14
  %9 = getelementptr inbounds i8, ptr %0, i64 68
  store <4 x i32> <i32 1, i32 1, i32 32774, i32 513>, ptr %9, align 4, !tbaa !15
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %10, i8 0, i64 48, i1 false), !tbaa !16
  ret void

11:                                               ; preds = %3
  %12 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN4Glip12CorePipeline23AbstractComponentLayoutD2Ev(ptr noundef nonnull align 8 dereferenceable(88) %4) #4
  resume { ptr, i32 } %12
}

declare void @_ZN4Glip12CorePipeline23AbstractComponentLayoutC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1

declare void @_ZN4Glip6CoreGL24HdlAbstractTextureFormatC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(52), ptr noundef nonnull align 8 dereferenceable(52)) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 = !{!"_ZTSN4Glip12CorePipeline20AbstractFilterLayoutE", !10, i64 8, !11, i64 56, !12, i64 64, !12, i64 65, !12, i64 66, !12, i64 67, !13, i64 68, !13, i64 72, !13, i64 76, !13, i64 80}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!"any pointer", !10, i64 0}
!12 = !{!"bool", !10, i64 0}
!13 = !{!"int", !10, i64 0}
!14 = !{!12, !12, i64 0}
!15 = !{!13, !13, i64 0}
!16 = !{!11, !11, i64 0}


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