; LLVM IR from filipwasil/fillwave :: src/flc/buffers/IBuffer.ll (ZNK3flw3flc7IBuffer8bindBaseEj)

; 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::__cxx11::basic_stringstream" = type { %"class.std::basic_iostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_iostream.base" = type { %"class.std::basic_istream.base", %"class.std::basic_ostream.base" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.flw::flc::IBuffer" = type <{ ptr, i32, [10 x i32], i8, [3 x i8], i32, i32, i32, [4 x i8], ptr, i64, i32, [4 x i8] }>

@_ZL5_tag_B5cxx11 = external hidden global %"class.std::__cxx11::basic_string", align 8
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [20 x i8], align 1
@glad_glBindBufferBase = external global ptr, align 8
@.str.16 = external hidden unnamed_addr constant [31 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

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 uwtable
declare void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2

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

declare noundef i32 @_Z10getGlErrorv() #4

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #5

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL14fLogWithStreamINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEJPKciS7_PcEEvRNS0_18basic_stringstreamIcS3_S4_EERKT_DpT0_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef, ptr noundef, ptr noundef) #1

declare noundef i32 @_Z20getFramebufferStatusv() #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL14fLogWithStreamINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEJPKciS7_S7_EEvRNS0_18basic_stringstreamIcS3_S4_EERKT_DpT0_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef, ptr noundef, ptr noundef) #1

; Function Attrs: noreturn nounwind
declare void @abort() #6

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3flw3flc7IBuffer8bindBaseEj(ptr noundef nonnull align 8 dereferenceable(92) %0, i32 noundef %1) #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca [256 x i8], align 16
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::__cxx11::basic_stringstream", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::__cxx11::basic_stringstream", align 8
  %13 = alloca %"class.std::__cxx11::basic_stringstream", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %14 = load ptr, ptr %3, align 8
  %15 = load ptr, ptr @glad_glBindBufferBase, align 8, !tbaa !5
  %16 = getelementptr inbounds %"class.flw::flc::IBuffer", ptr %14, i32 0, i32 5
  %17 = load i32, ptr %16, align 8, !tbaa !11
  %18 = getelementptr inbounds %"class.flw::flc::IBuffer", ptr %14, i32 0, i32 7
  %19 = load i32, ptr %18, align 8, !tbaa !15
  %20 = getelementptr inbounds %"class.flw::flc::IBuffer", ptr %14, i32 0, i32 2
  %21 = load i32, ptr %4, align 4, !tbaa !9
  %22 = zext i32 %21 to i64
  %23 = getelementptr inbounds [10 x i32], ptr %20, i64 0, i64 %22
  %24 = load i32, ptr %23, align 4, !tbaa !9
  call void %15(i32 noundef %17, i32 noundef %19, i32 noundef %24)
  br label %25

25:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %26 = call noundef i32 @_Z10getGlErrorv()
  store i32 %26, ptr %5, align 4, !tbaa !9
  %27 = load i32, ptr %5, align 4, !tbaa !9
  %28 = icmp ne i32 0, %27
  br i1 %28, label %29, label %85

29:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 256, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %30 = getelementptr inbounds [256 x i8], ptr %6, i64 0, i64 0
  %31 = load i32, ptr %5, align 4, !tbaa !9
  %32 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %30, ptr noundef @.str.7, ptr noundef @.str.8, i32 noundef %31) #7
  store i32 %32, ptr %7, align 4, !tbaa !9
  %33 = load i32, ptr %7, align 4, !tbaa !9
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %35, label %48

35:                                               ; preds = %29
  br label %36

36:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 392, ptr %8) #7
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128) %8)
  %37 = getelementptr inbounds i8, ptr %8, i64 16
  %38 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef @.str.9)
          to label %39 unwind label %44

39:                                               ; preds = %36
  %40 = getelementptr inbounds [256 x i8], ptr %6, i64 0, i64 0
  invoke void @_ZL14fLogWithStreamINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEJPKciS7_PcEEvRNS0_18basic_stringstreamIcS3_S4_EERKT_DpT0_(ptr noundef nonnull align 8 dereferenceable(128) %8, ptr noundef nonnull align 8 dereferenceable(32) @_ZL5_tag_B5cxx11, ptr noundef @.str.3, i32 noundef 173, ptr noundef @.str.4, ptr noundef %40)
          to label %41 unwind label %44

41:                                               ; preds = %39
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %8) #7
  call void @llvm.lifetime.end.p0(i64 392, ptr %8) #7
  br label %42

42:                                               ; preds = %41
  br label %43

43:                                               ; preds = %42
  br label %48

44:                                               ; preds = %39, %36
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %9, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %10, align 4
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %8) #7
  call void @llvm.lifetime.end.p0(i64 392, ptr %8) #7
  br label %84

48:                                               ; preds = %43, %29
  %49 = load i32, ptr %5, align 4, !tbaa !9
  %50 = icmp eq i32 %49, 1286
  br i1 %50, label %51, label %72

51:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %52 = call noundef i32 @_Z20getFramebufferStatusv()
  store i32 %52, ptr %11, align 4, !tbaa !9
  %53 = getelementptr inbounds [256 x i8], ptr %6, i64 0, i64 0
  %54 = load i32, ptr %11, align 4, !tbaa !9
  %55 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %53, ptr noundef @.str.7, ptr noundef @.str.10, i32 noundef %54) #7
  store i32 %55, ptr %7, align 4, !tbaa !9
  %56 = load i32, ptr %7, align 4, !tbaa !9
  %57 = icmp sgt i32 %56, 0
  br i1 %57, label %58, label %71

58:                                               ; preds = %51
  br label %59

59:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 392, ptr %12) #7
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128) %12)
  %60 = getelementptr inbounds i8, ptr %12, i64 16
  %61 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef @.str.9)
          to label %62 unwind label %67

62:                                               ; preds = %59
  %63 = getelementptr inbounds [256 x i8], ptr %6, i64 0, i64 0
  invoke void @_ZL14fLogWithStreamINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEJPKciS7_PcEEvRNS0_18basic_stringstreamIcS3_S4_EERKT_DpT0_(ptr noundef nonnull align 8 dereferenceable(128) %12, ptr noundef nonnull align 8 dereferenceable(32) @_ZL5_tag_B5cxx11, ptr noundef @.str.3, i32 noundef 173, ptr noundef @.str.4, ptr noundef %63)
          to label %64 unwind label %67

64:                                               ; preds = %62
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %12) #7
  call void @llvm.lifetime.end.p0(i64 392, ptr %12) #7
  br label %65

65:                                               ; preds = %64
  br label %66

66:                                               ; preds = %65
  br label %71

67:                                               ; preds = %62, %59
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %9, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %10, align 4
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %12) #7
  call void @llvm.lifetime.end.p0(i64 392, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %84

71:                                               ; preds = %66, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %72

72:                                               ; preds = %71, %48
  br label %73

73:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 392, ptr %13) #7
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128) %13)
  %74 = getelementptr inbounds i8, ptr %13, i64 16
  %75 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %74, ptr noundef @.str.9)
          to label %76 unwind label %80

76:                                               ; preds = %73
  invoke void @_ZL14fLogWithStreamINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEJPKciS7_S7_EEvRNS0_18basic_stringstreamIcS3_S4_EERKT_DpT0_(ptr noundef nonnull align 8 dereferenceable(128) %13, ptr noundef nonnull align 8 dereferenceable(32) @_ZL5_tag_B5cxx11, ptr noundef @.str.3, i32 noundef 173, ptr noundef @.str.4, ptr noundef @.str.16)
          to label %77 unwind label %80

77:                                               ; preds = %76
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %13) #7
  call void @llvm.lifetime.end.p0(i64 392, ptr %13) #7
  br label %78

78:                                               ; preds = %77
  br label %79

79:                                               ; preds = %78
  call void @abort() #8
  unreachable

80:                                               ; preds = %76, %73
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %9, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %10, align 4
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %13) #7
  call void @llvm.lifetime.end.p0(i64 392, ptr %13) #7
  br label %84

84:                                               ; preds = %80, %67, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 256, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %87

85:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %86

86:                                               ; preds = %85
  ret void

87:                                               ; preds = %84
  %88 = load ptr, ptr %9, align 8
  %89 = load i32, ptr %10, align 4
  %90 = insertvalue { ptr, i32 } poison, ptr %88, 0
  %91 = insertvalue { ptr, i32 } %90, i32 %89, 1
  resume { ptr, i32 } %91
}

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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { "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 = { noreturn 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 #7 = { nounwind }
attributes #8 = { noreturn 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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 56}
!12 = !{!"_ZTSN3flw3flc7IBufferE", !10, i64 8, !7, i64 12, !13, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !6, i64 72, !14, i64 80, !10, i64 88}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!12, !10, 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"

%"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::__cxx11::basic_stringstream" = type { %"class.std::basic_iostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_iostream.base" = type { %"class.std::basic_istream.base", %"class.std::basic_ostream.base" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }

@_ZL5_tag_B5cxx11 = external hidden global %"class.std::__cxx11::basic_string", align 8
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [20 x i8], align 1
@glad_glBindBufferBase = external local_unnamed_addr global ptr, align 8
@.str.16 = external hidden unnamed_addr constant [31 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

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 uwtable
declare void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2

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

declare noundef i32 @_Z10getGlErrorv() local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL14fLogWithStreamINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEJPKciS7_PcEEvRNS0_18basic_stringstreamIcS3_S4_EERKT_DpT0_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare noundef i32 @_Z20getFramebufferStatusv() local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL14fLogWithStreamINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEJPKciS7_S7_EEvRNS0_18basic_stringstreamIcS3_S4_EERKT_DpT0_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3flw3flc7IBuffer8bindBaseEj(ptr nocapture noundef nonnull readonly align 8 dereferenceable(92) %0, i32 noundef %1) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca [256 x i8], align 16
  %4 = alloca %"class.std::__cxx11::basic_stringstream", align 8
  %5 = alloca %"class.std::__cxx11::basic_stringstream", align 8
  %6 = alloca %"class.std::__cxx11::basic_stringstream", align 8
  %7 = load ptr, ptr @glad_glBindBufferBase, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 56
  %9 = load i32, ptr %8, align 8, !tbaa !9
  %10 = getelementptr inbounds i8, ptr %0, i64 64
  %11 = load i32, ptr %10, align 8, !tbaa !14
  %12 = getelementptr inbounds i8, ptr %0, i64 12
  %13 = zext i32 %1 to i64
  %14 = getelementptr inbounds [10 x i32], ptr %12, i64 0, i64 %13
  %15 = load i32, ptr %14, align 4, !tbaa !15
  tail call void %7(i32 noundef %9, i32 noundef %11, i32 noundef %15)
  %16 = tail call noundef i32 @_Z10getGlErrorv()
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %48, label %17

17:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %3) #7
  %18 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef nonnull @.str.8, i32 noundef %16) #7
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %20, label %27

20:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 392, ptr nonnull %4) #7
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128) %4)
  %21 = getelementptr inbounds i8, ptr %4, i64 16
  %22 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull @.str.9)
          to label %23 unwind label %25

23:                                               ; preds = %20
  invoke void @_ZL14fLogWithStreamINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEJPKciS7_PcEEvRNS0_18basic_stringstreamIcS3_S4_EERKT_DpT0_(ptr noundef nonnull align 8 dereferenceable(128) %4, ptr noundef nonnull align 8 dereferenceable(32) @_ZL5_tag_B5cxx11, ptr noundef nonnull @.str.3, i32 noundef 173, ptr noundef nonnull @.str.4, ptr noundef nonnull %3)
          to label %24 unwind label %25

24:                                               ; preds = %23
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %4) #7
  call void @llvm.lifetime.end.p0(i64 392, ptr nonnull %4) #7
  br label %27

25:                                               ; preds = %23, %20
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %4) #7
  call void @llvm.lifetime.end.p0(i64 392, ptr nonnull %4) #7
  br label %47

27:                                               ; preds = %24, %17
  %28 = icmp eq i32 %16, 1286
  br i1 %28, label %29, label %40

29:                                               ; preds = %27
  %30 = call noundef i32 @_Z20getFramebufferStatusv()
  %31 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef nonnull @.str.10, i32 noundef %30) #7
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %33, label %40

33:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 392, ptr nonnull %5) #7
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128) %5)
  %34 = getelementptr inbounds i8, ptr %5, i64 16
  %35 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull @.str.9)
          to label %36 unwind label %38

36:                                               ; preds = %33
  invoke void @_ZL14fLogWithStreamINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEJPKciS7_PcEEvRNS0_18basic_stringstreamIcS3_S4_EERKT_DpT0_(ptr noundef nonnull align 8 dereferenceable(128) %5, ptr noundef nonnull align 8 dereferenceable(32) @_ZL5_tag_B5cxx11, ptr noundef nonnull @.str.3, i32 noundef 173, ptr noundef nonnull @.str.4, ptr noundef nonnull %3)
          to label %37 unwind label %38

37:                                               ; preds = %36
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %5) #7
  call void @llvm.lifetime.end.p0(i64 392, ptr nonnull %5) #7
  br label %40

38:                                               ; preds = %36, %33
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %5) #7
  call void @llvm.lifetime.end.p0(i64 392, ptr nonnull %5) #7
  br label %47

40:                                               ; preds = %29, %37, %27
  call void @llvm.lifetime.start.p0(i64 392, ptr nonnull %6) #7
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128) %6)
  %41 = getelementptr inbounds i8, ptr %6, i64 16
  %42 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %41, ptr noundef nonnull @.str.9)
          to label %43 unwind label %45

43:                                               ; preds = %40
  invoke void @_ZL14fLogWithStreamINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEJPKciS7_S7_EEvRNS0_18basic_stringstreamIcS3_S4_EERKT_DpT0_(ptr noundef nonnull align 8 dereferenceable(128) %6, ptr noundef nonnull align 8 dereferenceable(32) @_ZL5_tag_B5cxx11, ptr noundef nonnull @.str.3, i32 noundef 173, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.16)
          to label %44 unwind label %45

44:                                               ; preds = %43
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %6) #7
  call void @llvm.lifetime.end.p0(i64 392, ptr nonnull %6) #7
  call void @abort() #8
  unreachable

45:                                               ; preds = %43, %40
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %6) #7
  call void @llvm.lifetime.end.p0(i64 392, ptr nonnull %6) #7
  br label %47

47:                                               ; preds = %45, %38, %25
  %.pn = phi { ptr, i32 } [ %46, %45 ], [ %39, %38 ], [ %26, %25 ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn

48:                                               ; preds = %2
  ret void
}

attributes #0 = { mustprogress 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { "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 = { nofree 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 = { noreturn 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 #7 = { nounwind }
attributes #8 = { noreturn 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, !11, i64 56}
!10 = !{!"_ZTSN3flw3flc7IBufferE", !11, i64 8, !7, i64 12, !12, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !6, i64 72, !13, i64 80, !11, i64 88}
!11 = !{!"int", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!10, !11, i64 64}
!15 = !{!11, !11, i64 0}


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