; LLVM IR from ronan-kerviche/glip-lib :: GLIP-Lib/src/Modules/ImageBuffer.ll (ZN4Glip7Modules11ImageBufferlsERKS1_)

; 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.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::allocator" = type { i8 }
%"class.Glip::Modules::ImageBuffer" = type { %"class.Glip::CoreGL::HdlAbstractTextureFormat.base", ptr, ptr }
%"class.Glip::CoreGL::HdlAbstractTextureFormat.base" = type <{ ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }>

@.str.3 = external hidden unnamed_addr constant [94 x i8], align 1
@_ZTIN4Glip9ExceptionE = external constant ptr
@.str.6 = external hidden unnamed_addr constant [64 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: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat9getHeightEv(ptr noundef nonnull align 8 dereferenceable(52)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Glip7Modules11ImageBuffer12setMinFilterEj(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Glip7Modules11ImageBuffer12setMagFilterEj(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Glip7Modules11ImageBuffer12setSWrappingEj(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Glip7Modules11ImageBuffer12setTWrappingEj(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) #1 align 2

declare noundef zeroext i1 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat16isCompatibleWithERKS1_(ptr noundef nonnull align 8 dereferenceable(52), ptr noundef nonnull align 8 dereferenceable(52)) #3

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZN4Glip9ExceptionC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_iRKNS0_4TypeE(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZN4Glip9ExceptionD1Ev(ptr noundef nonnull align 8 dereferenceable(152)) unnamed_addr #4

declare void @__cxa_throw(ptr, ptr, ptr)

declare void @__cxa_free_exception(ptr)

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getAlignmentEv(ptr noundef nonnull align 8 dereferenceable(52)) #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getMinFilterEv(ptr noundef nonnull align 8 dereferenceable(52)) #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getMagFilterEv(ptr noundef nonnull align 8 dereferenceable(52)) #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getSWrappingEv(ptr noundef nonnull align 8 dereferenceable(52)) #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getTWrappingEv(ptr noundef nonnull align 8 dereferenceable(52)) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(72) ptr @_ZN4Glip7Modules11ImageBufferlsERKS1_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(72) %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::allocator", align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::allocator", align 1
  %11 = alloca i32, align 4
  %12 = alloca i1, align 1
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %16 = load ptr, ptr %3, align 8
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = call noundef zeroext i1 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat16isCompatibleWithERKS1_(ptr noundef nonnull align 8 dereferenceable(52) %16, ptr noundef nonnull align 8 dereferenceable(52) %17)
  br i1 %18, label %41, label %19

19:                                               ; preds = %2
  store i1 true, ptr %12, align 1
  %20 = call ptr @__cxa_allocate_exception(i64 152) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef @.str.6, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %21 unwind label %24

21:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %22 unwind label %28

22:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 2, ptr %11, align 4, !tbaa !9
  invoke void @_ZN4Glip9ExceptionC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_iRKNS0_4TypeE(ptr noundef nonnull align 8 dereferenceable(152) %20, ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef %9, i32 noundef 247, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %23 unwind label %32

23:                                               ; preds = %22
  store i1 false, ptr %12, align 1
  invoke void @__cxa_throw(ptr %20, ptr @_ZTIN4Glip9ExceptionE, ptr @_ZN4Glip9ExceptionD1Ev) #8
          to label %113 unwind label %32

24:                                               ; preds = %19
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %7, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %8, align 4
  br label %37

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

32:                                               ; preds = %23, %22
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %7, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  br label %36

36:                                               ; preds = %32, %28
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  br label %37

37:                                               ; preds = %36, %24
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #7
  %38 = load i1, ptr %12, align 1
  br i1 %38, label %39, label %40

39:                                               ; preds = %37
  call void @__cxa_free_exception(ptr %20) #7
  br label %40

40:                                               ; preds = %39, %37
  br label %108

41:                                               ; preds = %2
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getAlignmentEv(ptr noundef nonnull align 8 dereferenceable(52) %42)
  %44 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getAlignmentEv(ptr noundef nonnull align 8 dereferenceable(52) %16)
  %45 = icmp eq i32 %43, %44
  br i1 %45, label %46, label %64

46:                                               ; preds = %41
  %47 = getelementptr inbounds %"class.Glip::Modules::ImageBuffer", ptr %16, i32 0, i32 2
  %48 = load ptr, ptr %47, align 8, !tbaa !11
  %49 = load ptr, ptr %48, align 8, !tbaa !15
  %50 = getelementptr inbounds ptr, ptr %49, i64 31
  %51 = load ptr, ptr %50, align 8
  %52 = call noundef ptr %51(ptr noundef nonnull align 8 dereferenceable(32) %48)
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %"class.Glip::Modules::ImageBuffer", ptr %53, i32 0, i32 2
  %55 = load ptr, ptr %54, align 8, !tbaa !11
  %56 = load ptr, ptr %55, align 8, !tbaa !15
  %57 = getelementptr inbounds ptr, ptr %56, i64 31
  %58 = load ptr, ptr %57, align 8
  %59 = call noundef ptr %58(ptr noundef nonnull align 8 dereferenceable(32) %55)
  %60 = load ptr, ptr %16, align 8, !tbaa !15
  %61 = getelementptr inbounds ptr, ptr %60, i64 3
  %62 = load ptr, ptr %61, align 8
  %63 = call noundef i64 %62(ptr noundef nonnull align 8 dereferenceable(52) %16)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %52, ptr align 1 %59, i64 %63, i1 false)
  br label %99

64:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !17
  br label %65

65:                                               ; preds = %95, %64
  %66 = load i32, ptr %13, align 4, !tbaa !17
  %67 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat9getHeightEv(ptr noundef nonnull align 8 dereferenceable(52) %16)
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %98

70:                                               ; preds = %65
  %71 = getelementptr inbounds %"class.Glip::Modules::ImageBuffer", ptr %16, i32 0, i32 2
  %72 = load ptr, ptr %71, align 8, !tbaa !11
  %73 = load i32, ptr %13, align 4, !tbaa !17
  %74 = load ptr, ptr %72, align 8, !tbaa !15
  %75 = getelementptr inbounds ptr, ptr %74, i64 33
  %76 = load ptr, ptr %75, align 8
  %77 = call noundef ptr %76(ptr noundef nonnull align 8 dereferenceable(32) %72, i32 noundef %73)
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = getelementptr inbounds %"class.Glip::Modules::ImageBuffer", ptr %78, i32 0, i32 2
  %80 = load ptr, ptr %79, align 8, !tbaa !11
  %81 = load i32, ptr %13, align 4, !tbaa !17
  %82 = load ptr, ptr %80, align 8, !tbaa !15
  %83 = getelementptr inbounds ptr, ptr %82, i64 33
  %84 = load ptr, ptr %83, align 8
  %85 = call noundef ptr %84(ptr noundef nonnull align 8 dereferenceable(32) %80, i32 noundef %81)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %86 = getelementptr inbounds %"class.Glip::Modules::ImageBuffer", ptr %16, i32 0, i32 2
  %87 = load ptr, ptr %86, align 8, !tbaa !11
  %88 = call noundef i64 @_ZNK4Glip6CoreGL15HdlDynamicTable10getRowSizeEv(ptr noundef nonnull align 8 dereferenceable(32) %87)
  store i64 %88, ptr %14, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %"class.Glip::Modules::ImageBuffer", ptr %89, i32 0, i32 2
  %91 = load ptr, ptr %90, align 8, !tbaa !11
  %92 = call noundef i64 @_ZNK4Glip6CoreGL15HdlDynamicTable10getRowSizeEv(ptr noundef nonnull align 8 dereferenceable(32) %91)
  store i64 %92, ptr %15, align 8, !tbaa !18
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %94 = load i64, ptr %93, align 8, !tbaa !18
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %77, ptr align 1 %85, i64 %94, i1 false)
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %95

95:                                               ; preds = %70
  %96 = load i32, ptr %13, align 4, !tbaa !17
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %13, align 4, !tbaa !17
  br label %65, !llvm.loop !20

98:                                               ; preds = %69
  br label %99

99:                                               ; preds = %98, %46
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getMinFilterEv(ptr noundef nonnull align 8 dereferenceable(52) %100)
  call void @_ZN4Glip7Modules11ImageBuffer12setMinFilterEj(ptr noundef nonnull align 8 dereferenceable(72) %16, i32 noundef %101)
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getMagFilterEv(ptr noundef nonnull align 8 dereferenceable(52) %102)
  call void @_ZN4Glip7Modules11ImageBuffer12setMagFilterEj(ptr noundef nonnull align 8 dereferenceable(72) %16, i32 noundef %103)
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getSWrappingEv(ptr noundef nonnull align 8 dereferenceable(52) %104)
  call void @_ZN4Glip7Modules11ImageBuffer12setSWrappingEj(ptr noundef nonnull align 8 dereferenceable(72) %16, i32 noundef %105)
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getTWrappingEv(ptr noundef nonnull align 8 dereferenceable(52) %106)
  call void @_ZN4Glip7Modules11ImageBuffer12setTWrappingEj(ptr noundef nonnull align 8 dereferenceable(72) %16, i32 noundef %107)
  ret ptr %16

108:                                              ; preds = %40
  %109 = load ptr, ptr %7, align 8
  %110 = load i32, ptr %8, align 4
  %111 = insertvalue { ptr, i32 } poison, ptr %109, 0
  %112 = insertvalue { ptr, i32 } %111, i32 %110, 1
  resume { ptr, i32 } %112

113:                                              ; preds = %23
  unreachable
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #6

declare noundef i64 @_ZNK4Glip6CoreGL15HdlDynamicTable10getRowSizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { noreturn }

!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 = !{!"_ZTSN4Glip9Exception4TypeE", !7, i64 0}
!11 = !{!12, !6, i64 64}
!12 = !{!"_ZTSN4Glip7Modules11ImageBufferE", !13, i64 0, !6, i64 56, !6, i64 64}
!13 = !{!"_ZTSN4Glip6CoreGL24HdlAbstractTextureFormatE", !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !14, i64 44, !14, i64 48}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, i64 0}
!17 = !{!14, !14, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"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"

%"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::allocator" = type { i8 }

@.str.3 = external hidden unnamed_addr constant [94 x i8], align 1
@_ZTIN4Glip9ExceptionE = external constant ptr
@.str.6 = external hidden unnamed_addr constant [64 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 nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat9getHeightEv(ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Glip7Modules11ImageBuffer12setMinFilterEj(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Glip7Modules11ImageBuffer12setMagFilterEj(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Glip7Modules11ImageBuffer12setSWrappingEj(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Glip7Modules11ImageBuffer12setTWrappingEj(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) local_unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat16isCompatibleWithERKS1_(ptr noundef nonnull align 8 dereferenceable(52), ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #3

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZN4Glip9ExceptionC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_iRKNS0_4TypeE(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZN4Glip9ExceptionD1Ev(ptr noundef nonnull align 8 dereferenceable(152)) unnamed_addr #4

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

declare void @__cxa_free_exception(ptr) local_unnamed_addr

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getAlignmentEv(ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getMinFilterEv(ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getMagFilterEv(ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getSWrappingEv(ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #3

declare noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getTWrappingEv(ptr noundef nonnull align 8 dereferenceable(52)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(72) ptr @_ZN4Glip7Modules11ImageBufferlsERKS1_(ptr noundef nonnull returned align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(72) %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::allocator", align 1
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = tail call noundef zeroext i1 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat16isCompatibleWithERKS1_(ptr noundef nonnull align 8 dereferenceable(52) %0, ptr noundef nonnull align 8 dereferenceable(52) %1)
  br i1 %10, label %23, label %11

11:                                               ; preds = %2
  %12 = tail call ptr @__cxa_allocate_exception(i64 152) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull @.str.6, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %13 unwind label %.thread

13:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %14 unwind label %17

14:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  store i32 2, ptr %7, align 4, !tbaa !5
  invoke void @_ZN4Glip9ExceptionC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_iRKNS0_4TypeE(ptr noundef nonnull align 8 dereferenceable(152) %12, ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull %5, i32 noundef 247, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %15 unwind label %19

15:                                               ; preds = %14
  invoke void @__cxa_throw(ptr nonnull %12, ptr nonnull @_ZTIN4Glip9ExceptionE, ptr nonnull @_ZN4Glip9ExceptionD1Ev) #8
          to label %73 unwind label %19

.thread:                                          ; preds = %11
  %16 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  br label %22

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

19:                                               ; preds = %15, %14
  %.016 = phi i1 [ false, %15 ], [ true, %14 ]
  %20 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  br label %21

21:                                               ; preds = %17, %19
  %.pn = phi { ptr, i32 } [ %20, %19 ], [ %18, %17 ]
  %.1 = phi i1 [ %.016, %19 ], [ true, %17 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  br i1 %.1, label %22, label %72

22:                                               ; preds = %.thread, %21
  %.pn.pn26 = phi { ptr, i32 } [ %16, %.thread ], [ %.pn, %21 ]
  call void @__cxa_free_exception(ptr %12) #7
  br label %72

23:                                               ; preds = %2
  %24 = tail call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getAlignmentEv(ptr noundef nonnull align 8 dereferenceable(52) %1)
  %25 = tail call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getAlignmentEv(ptr noundef nonnull align 8 dereferenceable(52) %0)
  %26 = icmp eq i32 %24, %25
  br i1 %26, label %31, label %.preheader

.preheader:                                       ; preds = %23
  %27 = tail call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat9getHeightEv(ptr noundef nonnull align 8 dereferenceable(52) %0)
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader
  %29 = getelementptr inbounds i8, ptr %0, i64 64
  %30 = getelementptr inbounds i8, ptr %1, i64 64
  br label %48

31:                                               ; preds = %23
  %32 = getelementptr inbounds i8, ptr %0, i64 64
  %33 = load ptr, ptr %32, align 8, !tbaa !9
  %34 = load ptr, ptr %33, align 8, !tbaa !14
  %35 = getelementptr inbounds i8, ptr %34, i64 248
  %36 = load ptr, ptr %35, align 8
  %37 = tail call noundef ptr %36(ptr noundef nonnull align 8 dereferenceable(32) %33)
  %38 = getelementptr inbounds i8, ptr %1, i64 64
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  %40 = load ptr, ptr %39, align 8, !tbaa !14
  %41 = getelementptr inbounds i8, ptr %40, i64 248
  %42 = load ptr, ptr %41, align 8
  %43 = tail call noundef ptr %42(ptr noundef nonnull align 8 dereferenceable(32) %39)
  %44 = load ptr, ptr %0, align 8, !tbaa !14
  %45 = getelementptr inbounds i8, ptr %44, i64 24
  %46 = load ptr, ptr %45, align 8
  %47 = tail call noundef i64 %46(ptr noundef nonnull align 8 dereferenceable(52) %0)
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %37, ptr align 1 %43, i64 %47, i1 false)
  br label %.loopexit

48:                                               ; preds = %.lr.ph, %48
  %.027 = phi i32 [ 0, %.lr.ph ], [ %65, %48 ]
  %49 = load ptr, ptr %29, align 8, !tbaa !9
  %50 = load ptr, ptr %49, align 8, !tbaa !14
  %51 = getelementptr inbounds i8, ptr %50, i64 264
  %52 = load ptr, ptr %51, align 8
  %53 = call noundef ptr %52(ptr noundef nonnull align 8 dereferenceable(32) %49, i32 noundef %.027)
  %54 = load ptr, ptr %30, align 8, !tbaa !9
  %55 = load ptr, ptr %54, align 8, !tbaa !14
  %56 = getelementptr inbounds i8, ptr %55, i64 264
  %57 = load ptr, ptr %56, align 8
  %58 = call noundef ptr %57(ptr noundef nonnull align 8 dereferenceable(32) %54, i32 noundef %.027)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %59 = load ptr, ptr %29, align 8, !tbaa !9
  %60 = call noundef i64 @_ZNK4Glip6CoreGL15HdlDynamicTable10getRowSizeEv(ptr noundef nonnull align 8 dereferenceable(32) %59)
  store i64 %60, ptr %8, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %61 = load ptr, ptr %30, align 8, !tbaa !9
  %62 = call noundef i64 @_ZNK4Glip6CoreGL15HdlDynamicTable10getRowSizeEv(ptr noundef nonnull align 8 dereferenceable(32) %61)
  store i64 %62, ptr %9, align 8, !tbaa !16
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %64 = load i64, ptr %63, align 8, !tbaa !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %53, ptr align 1 %58, i64 %64, i1 false)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  %65 = add nuw nsw i32 %.027, 1
  %66 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat9getHeightEv(ptr noundef nonnull align 8 dereferenceable(52) %0)
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %48, label %.loopexit, !llvm.loop !18

.loopexit:                                        ; preds = %48, %.preheader, %31
  %68 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getMinFilterEv(ptr noundef nonnull align 8 dereferenceable(52) %1)
  call void @_ZN4Glip7Modules11ImageBuffer12setMinFilterEj(ptr noundef nonnull align 8 dereferenceable(72) %0, i32 noundef %68)
  %69 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getMagFilterEv(ptr noundef nonnull align 8 dereferenceable(52) %1)
  call void @_ZN4Glip7Modules11ImageBuffer12setMagFilterEj(ptr noundef nonnull align 8 dereferenceable(72) %0, i32 noundef %69)
  %70 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getSWrappingEv(ptr noundef nonnull align 8 dereferenceable(52) %1)
  call void @_ZN4Glip7Modules11ImageBuffer12setSWrappingEj(ptr noundef nonnull align 8 dereferenceable(72) %0, i32 noundef %70)
  %71 = call noundef i32 @_ZNK4Glip6CoreGL24HdlAbstractTextureFormat12getTWrappingEv(ptr noundef nonnull align 8 dereferenceable(52) %1)
  call void @_ZN4Glip7Modules11ImageBuffer12setTWrappingEj(ptr noundef nonnull align 8 dereferenceable(72) %0, i32 noundef %71)
  ret ptr %0

72:                                               ; preds = %21, %22
  %.pn.pn25 = phi { ptr, i32 } [ %.pn, %21 ], [ %.pn.pn26, %22 ]
  resume { ptr, i32 } %.pn.pn25

73:                                               ; preds = %15
  unreachable
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6

declare noundef i64 @_ZNK4Glip6CoreGL15HdlDynamicTable10getRowSizeEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = { 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { noreturn }

!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 = !{!"_ZTSN4Glip9Exception4TypeE", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !13, i64 64}
!10 = !{!"_ZTSN4Glip7Modules11ImageBufferE", !11, i64 0, !13, i64 56, !13, i64 64}
!11 = !{!"_ZTSN4Glip6CoreGL24HdlAbstractTextureFormatE", !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48}
!12 = !{!"int", !7, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"vtable pointer", !8, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass