; LLVM IR from santa01/graphene :: src/ImageTexture.ll (ZN8Graphene12ImageTextureC2ERKNS_5ImageE)

; 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.Graphene::Texture" = type { ptr, i32, i32, i32, i32 }

@_ZTVN8Graphene12ImageTextureE = external dso_local unnamed_addr constant { [4 x ptr] }, align 8
@_ZN8Graphene15glTexParameteriE = external global ptr, align 8
@.str = external hidden unnamed_addr constant [34 x i8], align 1
@_ZN8Graphene13glGetIntegervE = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [78 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8Graphene12ImageTextureC2ERKNS_5ImageE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca i1, align 1
  %10 = alloca %"class.std::allocator", align 1
  %11 = alloca i1, align 1
  %12 = alloca i1, align 1
  %13 = alloca i1, align 1
  %14 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %15 = load ptr, ptr %3, align 8
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = call noundef i32 @_ZNK8Graphene5Image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(32) %16)
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = call noundef i32 @_ZNK8Graphene5Image9getHeightEv(ptr noundef nonnull align 8 dereferenceable(32) %18)
  call void @_ZN8Graphene17Texture2DTemplateILj35907ELi4EEC2Eii(ptr noundef nonnull align 8 dereferenceable(24) %15, i32 noundef %17, i32 noundef %19)
  store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTVN8Graphene12ImageTextureE, i32 0, i32 0, i32 2), ptr %15, align 8, !tbaa !9
  %20 = load ptr, ptr @_ZN8Graphene15glTexParameteriE, align 8, !tbaa !5
  %21 = getelementptr inbounds %"class.Graphene::Texture", ptr %15, i32 0, i32 3
  %22 = load i32, ptr %21, align 8, !tbaa !11
  invoke void %20(i32 noundef %22, i32 noundef 10241, i32 noundef 9987)
          to label %23 unwind label %62

23:                                               ; preds = %2
  %24 = load ptr, ptr @_ZN8Graphene15glTexParameteriE, align 8, !tbaa !5
  %25 = getelementptr inbounds %"class.Graphene::Texture", ptr %15, i32 0, i32 3
  %26 = load i32, ptr %25, align 8, !tbaa !11
  invoke void %24(i32 noundef %26, i32 noundef 10240, i32 noundef 9729)
          to label %27 unwind label %62

27:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %28 = invoke noundef nonnull align 8 dereferenceable(64) ptr @_ZN8Graphene12EngineConfig11getInstanceEv()
          to label %29 unwind label %66

29:                                               ; preds = %27
  %30 = invoke noundef i32 @_ZNK8Graphene12EngineConfig13getAnisotropyEv(ptr noundef nonnull align 8 dereferenceable(64) %28)
          to label %31 unwind label %66

31:                                               ; preds = %29
  store i32 %30, ptr %7, align 4, !tbaa !14
  %32 = load i32, ptr %7, align 4, !tbaa !14
  %33 = icmp sgt i32 %32, 0
  store i1 false, ptr %9, align 1
  store i1 false, ptr %11, align 1
  store i1 false, ptr %12, align 1
  store i1 false, ptr %13, align 1
  br i1 %33, label %34, label %38

34:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #6
  store i1 true, ptr %9, align 1
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #6
  store i1 true, ptr %11, align 1
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  store i1 true, ptr %12, align 1
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef @.str, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %35 unwind label %70

35:                                               ; preds = %34
  store i1 true, ptr %13, align 1
  %36 = invoke noundef zeroext i1 @_ZN8Graphene6OpenGL20isExtensionSupportedERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %37 unwind label %74

37:                                               ; preds = %35
  br label %38

38:                                               ; preds = %37, %31
  %39 = phi i1 [ false, %31 ], [ %36, %37 ]
  %40 = load i1, ptr %13, align 1
  br i1 %40, label %41, label %42

41:                                               ; preds = %38
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  br label %42

42:                                               ; preds = %41, %38
  %43 = load i1, ptr %12, align 1
  br i1 %43, label %44, label %45

44:                                               ; preds = %42
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  br label %45

45:                                               ; preds = %44, %42
  %46 = load i1, ptr %11, align 1
  br i1 %46, label %47, label %48

47:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  br label %48

48:                                               ; preds = %47, %45
  %49 = load i1, ptr %9, align 1
  br i1 %49, label %50, label %51

50:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #6
  br label %51

51:                                               ; preds = %50, %48
  br i1 %39, label %52, label %95

52:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %53 = load ptr, ptr @_ZN8Graphene13glGetIntegervE, align 8, !tbaa !5
  invoke void %53(i32 noundef 34047, ptr noundef %14)
          to label %54 unwind label %91

54:                                               ; preds = %52
  %55 = load ptr, ptr @_ZN8Graphene15glTexParameteriE, align 8, !tbaa !5
  %56 = getelementptr inbounds %"class.Graphene::Texture", ptr %15, i32 0, i32 3
  %57 = load i32, ptr %56, align 8, !tbaa !11
  %58 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %59 unwind label %91

59:                                               ; preds = %54
  %60 = load i32, ptr %58, align 4, !tbaa !14
  invoke void %55(i32 noundef %57, i32 noundef 34046, i32 noundef %60)
          to label %61 unwind label %91

61:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %99

62:                                               ; preds = %23, %2
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %5, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %6, align 4
  br label %103

66:                                               ; preds = %99, %97, %95, %29, %27
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %5, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %6, align 4
  br label %102

70:                                               ; preds = %34
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %5, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %6, align 4
  br label %81

74:                                               ; preds = %35
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %5, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %6, align 4
  %78 = load i1, ptr %13, align 1
  br i1 %78, label %79, label %80

79:                                               ; preds = %74
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  br label %80

80:                                               ; preds = %79, %74
  br label %81

81:                                               ; preds = %80, %70
  %82 = load i1, ptr %12, align 1
  br i1 %82, label %83, label %84

83:                                               ; preds = %81
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  br label %84

84:                                               ; preds = %83, %81
  %85 = load i1, ptr %11, align 1
  br i1 %85, label %86, label %87

86:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  br label %87

87:                                               ; preds = %86, %84
  %88 = load i1, ptr %9, align 1
  br i1 %88, label %89, label %90

89:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #6
  br label %90

90:                                               ; preds = %89, %87
  br label %102

91:                                               ; preds = %59, %54, %52
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %5, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %102

95:                                               ; preds = %51
  %96 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Graphene6Logger11getInstanceEv()
          to label %97 unwind label %66

97:                                               ; preds = %95
  invoke void (ptr, i32, ptr, i32, ptr, ...) @_ZN8Graphene6Logger7logLineENS_8LogLevelEPKciS3_z(ptr noundef nonnull align 4 dereferenceable(4) %96, i32 noundef 1, ptr noundef @.str.1, i32 noundef 42, ptr noundef @.str.2)
          to label %98 unwind label %66

98:                                               ; preds = %97
  br label %99

99:                                               ; preds = %98, %61
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN8Graphene12ImageTexture6updateERKNS_5ImageE(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(32) %100)
          to label %101 unwind label %66

101:                                              ; preds = %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  ret void

102:                                              ; preds = %91, %90, %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %103

103:                                              ; preds = %102, %62
  call void @_ZN8Graphene7TextureD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #6
  br label %104

104:                                              ; preds = %103
  %105 = load ptr, ptr %5, align 8
  %106 = load i32, ptr %6, align 4
  %107 = insertvalue { ptr, i32 } poison, ptr %105, 0
  %108 = insertvalue { ptr, i32 } %107, i32 %106, 1
  resume { ptr, i32 } %108
}

declare noundef i32 @_ZNK8Graphene5Image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(32)) #1

declare noundef i32 @_ZNK8Graphene5Image9getHeightEv(ptr noundef nonnull align 8 dereferenceable(32)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8Graphene17Texture2DTemplateILj35907ELi4EEC2Eii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

declare noundef nonnull align 8 dereferenceable(64) ptr @_ZN8Graphene12EngineConfig11getInstanceEv() #1

declare noundef i32 @_ZNK8Graphene12EngineConfig13getAnisotropyEv(ptr noundef nonnull align 8 dereferenceable(64)) #1

declare noundef zeroext i1 @_ZN8Graphene6OpenGL20isExtensionSupportedERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32)) #1

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 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 #0 align 2

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

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

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

declare noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Graphene6Logger11getInstanceEv() #1

declare void @_ZN8Graphene6Logger7logLineENS_8LogLevelEPKciS3_z(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8Graphene12ImageTexture6updateERKNS_5ImageE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

; Function Attrs: nounwind
declare void @_ZN8Graphene7TextureD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #5 = { 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 #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 = !{!"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, !13, i64 16}
!12 = !{!"_ZTSN8Graphene7TextureE", !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}


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

@_ZTVN8Graphene12ImageTextureE = external dso_local unnamed_addr constant { [4 x ptr] }, align 8
@_ZN8Graphene15glTexParameteriE = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [34 x i8], align 1
@_ZN8Graphene13glGetIntegervE = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [78 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8Graphene12ImageTextureC2ERKNS_5ImageE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca i32, align 4
  %7 = tail call noundef i32 @_ZNK8Graphene5Image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %8 = tail call noundef i32 @_ZNK8Graphene5Image9getHeightEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  tail call void @_ZN8Graphene17Texture2DTemplateILj35907ELi4EEC2Eii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %7, i32 noundef %8)
  store ptr getelementptr inbounds inrange(-16, 16) (i8, ptr @_ZTVN8Graphene12ImageTextureE, i64 16), ptr %0, align 8, !tbaa !5
  %9 = load ptr, ptr @_ZN8Graphene15glTexParameteriE, align 8, !tbaa !8
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = load i32, ptr %10, align 8, !tbaa !11
  invoke void %9(i32 noundef %11, i32 noundef 10241, i32 noundef 9987)
          to label %12 unwind label %32

12:                                               ; preds = %2
  %13 = load ptr, ptr @_ZN8Graphene15glTexParameteriE, align 8, !tbaa !8
  %14 = load i32, ptr %10, align 8, !tbaa !11
  invoke void %13(i32 noundef %14, i32 noundef 10240, i32 noundef 9729)
          to label %15 unwind label %32

15:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %16 = invoke noundef nonnull align 8 dereferenceable(64) ptr @_ZN8Graphene12EngineConfig11getInstanceEv()
          to label %17 unwind label %34

17:                                               ; preds = %15
  %18 = invoke noundef i32 @_ZNK8Graphene12EngineConfig13getAnisotropyEv(ptr noundef nonnull align 8 dereferenceable(64) %16)
          to label %19 unwind label %34

19:                                               ; preds = %17
  store i32 %18, ptr %3, align 4, !tbaa !14
  %20 = icmp sgt i32 %18, 0
  br i1 %20, label %21, label %.critedge25.thread

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

22:                                               ; preds = %21
  %23 = invoke noundef zeroext i1 @_ZN8Graphene6OpenGL20isExtensionSupportedERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %.critedge25 unwind label %38

.critedge25:                                      ; preds = %22
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  br i1 %23, label %24, label %.critedge25.thread

24:                                               ; preds = %.critedge25
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %25 = load ptr, ptr @_ZN8Graphene13glGetIntegervE, align 8, !tbaa !8
  invoke void %25(i32 noundef 34047, ptr noundef nonnull %6)
          to label %26 unwind label %41

26:                                               ; preds = %24
  %27 = load ptr, ptr @_ZN8Graphene15glTexParameteriE, align 8, !tbaa !8
  %28 = load i32, ptr %10, align 8, !tbaa !11
  %29 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %30 = load i32, ptr %29, align 4, !tbaa !14
  invoke void %27(i32 noundef %28, i32 noundef 34046, i32 noundef %30)
          to label %31 unwind label %41

31:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  br label %45

32:                                               ; preds = %12, %2
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %48

34:                                               ; preds = %45, %44, %.critedge25.thread, %17, %15
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %47

36:                                               ; preds = %21
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %40

38:                                               ; preds = %22
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  br label %40

40:                                               ; preds = %36, %38
  %.pn = phi { ptr, i32 } [ %39, %38 ], [ %37, %36 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  br label %47

41:                                               ; preds = %26, %24
  %42 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  br label %47

.critedge25.thread:                               ; preds = %19, %.critedge25
  %43 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Graphene6Logger11getInstanceEv()
          to label %44 unwind label %34

44:                                               ; preds = %.critedge25.thread
  invoke void (ptr, i32, ptr, i32, ptr, ...) @_ZN8Graphene6Logger7logLineENS_8LogLevelEPKciS3_z(ptr noundef nonnull align 4 dereferenceable(4) %43, i32 noundef 1, ptr noundef nonnull @.str.1, i32 noundef 42, ptr noundef nonnull @.str.2)
          to label %45 unwind label %34

45:                                               ; preds = %44, %31
  invoke void @_ZN8Graphene12ImageTexture6updateERKNS_5ImageE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %46 unwind label %34

46:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  ret void

47:                                               ; preds = %40, %41, %34
  %.pn21 = phi { ptr, i32 } [ %35, %34 ], [ %42, %41 ], [ %.pn, %40 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  br label %48

48:                                               ; preds = %47, %32
  %.pn21.pn = phi { ptr, i32 } [ %.pn21, %47 ], [ %33, %32 ]
  call void @_ZN8Graphene7TextureD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  resume { ptr, i32 } %.pn21.pn
}

declare noundef i32 @_ZNK8Graphene5Image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

declare noundef i32 @_ZNK8Graphene5Image9getHeightEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8Graphene17Texture2DTemplateILj35907ELi4EEC2Eii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

declare noundef nonnull align 8 dereferenceable(64) ptr @_ZN8Graphene12EngineConfig11getInstanceEv() local_unnamed_addr #1

declare noundef i32 @_ZNK8Graphene12EngineConfig13getAnisotropyEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #1

declare noundef zeroext i1 @_ZN8Graphene6OpenGL20isExtensionSupportedERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 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 #0 align 2

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

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

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

declare noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Graphene6Logger11getInstanceEv() local_unnamed_addr #1

declare void @_ZN8Graphene6Logger7logLineENS_8LogLevelEPKciS3_z(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8Graphene12ImageTexture6updateERKNS_5ImageE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: nounwind
declare void @_ZN8Graphene7TextureD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #5 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !13, i64 16}
!12 = !{!"_ZTSN8Graphene7TextureE", !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!13 = !{!"int", !10, i64 0}
!14 = !{!13, !13, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass