; LLVM IR from paroj/gltut :: glsdk/glmesh/source/StreamBuffer.ll (ZN6glmesh12StreamBuffer3MapC2ERS0_mb)

; 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.glmesh::StreamBuffer::Map" = type { ptr, ptr, i64 }
%"class.glmesh::StreamBuffer" = type { i32, i64, i64, i8, i32 }

@_ZN2gl10BindBufferE = external global ptr, align 8
@_ZTIN6glmesh27StoreAlreadyMappedExceptionE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN6glmesh31NotEnoughStorageForMapExceptionE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN6glmesh40NotEnoughRemainingStorageForMapExceptionE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZN2gl14MapBufferRangeE = external global ptr, align 8

; 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 nounwind uwtable
declare dso_local noundef i64 @_ZNK6glmesh12StreamBuffer17GetSpaceRemainingEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

declare ptr @__cxa_allocate_exception(i64)

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

declare void @__cxa_free_exception(ptr)

declare void @__cxa_throw(ptr, ptr, ptr)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6glmesh12StreamBuffer3MapC2ERS0_mb(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %2, i1 noundef zeroext %3) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i64 %2, ptr %7, align 8, !tbaa !9
  %12 = zext i1 %3 to i8
  store i8 %12, ptr %8, align 1, !tbaa !11
  %13 = load ptr, ptr %5, align 8
  %14 = getelementptr inbounds %"class.glmesh::StreamBuffer::Map", ptr %13, i32 0, i32 0
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %15, ptr %14, align 8, !tbaa !13
  %16 = getelementptr inbounds %"class.glmesh::StreamBuffer::Map", ptr %13, i32 0, i32 1
  store ptr null, ptr %16, align 8, !tbaa !15
  %17 = getelementptr inbounds %"class.glmesh::StreamBuffer::Map", ptr %13, i32 0, i32 2
  %18 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %18, ptr %17, align 8, !tbaa !16
  %19 = getelementptr inbounds %"class.glmesh::StreamBuffer::Map", ptr %13, i32 0, i32 0
  %20 = load ptr, ptr %19, align 8, !tbaa !13
  %21 = getelementptr inbounds %"class.glmesh::StreamBuffer", ptr %20, i32 0, i32 3
  %22 = load i8, ptr %21, align 8, !tbaa !17, !range !20, !noundef !21
  %23 = trunc i8 %22 to i1
  br i1 %23, label %24, label %31

24:                                               ; preds = %4
  %25 = call ptr @__cxa_allocate_exception(i64 40) #3
  invoke void @_ZN6glmesh27StoreAlreadyMappedExceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %25)
          to label %26 unwind label %27

26:                                               ; preds = %24
  call void @__cxa_throw(ptr %25, ptr @_ZTIN6glmesh27StoreAlreadyMappedExceptionE, ptr @_ZN6glmesh21StreamBufferExceptionD2Ev) #4
  unreachable

27:                                               ; preds = %24
  %28 = landingpad { ptr, i32 }
          cleanup
  %29 = extractvalue { ptr, i32 } %28, 0
  store ptr %29, ptr %9, align 8
  %30 = extractvalue { ptr, i32 } %28, 1
  store i32 %30, ptr %10, align 4
  call void @__cxa_free_exception(ptr %25) #3
  br label %104

31:                                               ; preds = %4
  %32 = load i64, ptr %7, align 8, !tbaa !9
  %33 = getelementptr inbounds %"class.glmesh::StreamBuffer::Map", ptr %13, i32 0, i32 0
  %34 = load ptr, ptr %33, align 8, !tbaa !13
  %35 = call noundef i64 @_ZNK6glmesh12StreamBuffer18GetTotalBufferSizeEv(ptr noundef nonnull align 8 dereferenceable(32) %34)
  %36 = icmp ugt i64 %32, %35
  br i1 %36, label %37, label %50

37:                                               ; preds = %31
  %38 = call ptr @__cxa_allocate_exception(i64 40) #3
  %39 = getelementptr inbounds %"class.glmesh::StreamBuffer::Map", ptr %13, i32 0, i32 2
  %40 = load i64, ptr %39, align 8, !tbaa !16
  %41 = getelementptr inbounds %"class.glmesh::StreamBuffer::Map", ptr %13, i32 0, i32 0
  %42 = load ptr, ptr %41, align 8, !tbaa !13
  %43 = invoke noundef i64 @_ZNK6glmesh12StreamBuffer18GetTotalBufferSizeEv(ptr noundef nonnull align 8 dereferenceable(32) %42)
          to label %44 unwind label %46

44:                                               ; preds = %37
  invoke void @_ZN6glmesh31NotEnoughStorageForMapExceptionC1Emm(ptr noundef nonnull align 8 dereferenceable(40) %38, i64 noundef %40, i64 noundef %43)
          to label %45 unwind label %46

45:                                               ; preds = %44
  call void @__cxa_throw(ptr %38, ptr @_ZTIN6glmesh31NotEnoughStorageForMapExceptionE, ptr @_ZN6glmesh21StreamBufferExceptionD2Ev) #4
  unreachable

46:                                               ; preds = %44, %37
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %9, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %10, align 4
  call void @__cxa_free_exception(ptr %38) #3
  br label %104

50:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 34, ptr %11, align 4, !tbaa !22
  %51 = load i64, ptr %7, align 8, !tbaa !9
  %52 = getelementptr inbounds %"class.glmesh::StreamBuffer::Map", ptr %13, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8, !tbaa !13
  %54 = call noundef i64 @_ZNK6glmesh12StreamBuffer17GetSpaceRemainingEv(ptr noundef nonnull align 8 dereferenceable(32) %53)
  %55 = icmp ugt i64 %51, %54
  br i1 %55, label %56, label %84

56:                                               ; preds = %50
  %57 = load i8, ptr %8, align 1, !tbaa !11, !range !20, !noundef !21
  %58 = trunc i8 %57 to i1
  br i1 %58, label %76, label %59

59:                                               ; preds = %56
  %60 = call ptr @__cxa_allocate_exception(i64 40) #3
  %61 = getelementptr inbounds %"class.glmesh::StreamBuffer::Map", ptr %13, i32 0, i32 0
  %62 = load ptr, ptr %61, align 8, !tbaa !13
  %63 = getelementptr inbounds %"class.glmesh::StreamBuffer", ptr %62, i32 0, i32 2
  %64 = load i64, ptr %63, align 8, !tbaa !23
  %65 = getelementptr inbounds %"class.glmesh::StreamBuffer::Map", ptr %13, i32 0, i32 2
  %66 = load i64, ptr %65, align 8, !tbaa !16
  %67 = getelementptr inbounds %"class.glmesh::StreamBuffer::Map", ptr %13, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8, !tbaa !13
  %69 = invoke noundef i64 @_ZNK6glmesh12StreamBuffer18GetTotalBufferSizeEv(ptr noundef nonnull align 8 dereferenceable(32) %68)
          to label %70 unwind label %72

70:                                               ; preds = %59
  invoke void @_ZN6glmesh40NotEnoughRemainingStorageForMapExceptionC1Emmm(ptr noundef nonnull align 8 dereferenceable(40) %60, i64 noundef %64, i64 noundef %66, i64 noundef %69)
          to label %71 unwind label %72

71:                                               ; preds = %70
  call void @__cxa_throw(ptr %60, ptr @_ZTIN6glmesh40NotEnoughRemainingStorageForMapExceptionE, ptr @_ZN6glmesh21StreamBufferExceptionD2Ev) #4
  unreachable

72:                                               ; preds = %70, %59
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %9, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %10, align 4
  call void @__cxa_free_exception(ptr %60) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %104

76:                                               ; preds = %56
  %77 = load i32, ptr %11, align 4, !tbaa !22
  %78 = sext i32 %77 to i64
  %79 = or i64 %78, 8
  %80 = trunc i64 %79 to i32
  store i32 %80, ptr %11, align 4, !tbaa !22
  %81 = getelementptr inbounds %"class.glmesh::StreamBuffer::Map", ptr %13, i32 0, i32 0
  %82 = load ptr, ptr %81, align 8, !tbaa !13
  %83 = getelementptr inbounds %"class.glmesh::StreamBuffer", ptr %82, i32 0, i32 2
  store i64 0, ptr %83, align 8, !tbaa !23
  br label %84

84:                                               ; preds = %76, %50
  %85 = load ptr, ptr @_ZN2gl10BindBufferE, align 8, !tbaa !5
  %86 = getelementptr inbounds %"class.glmesh::StreamBuffer::Map", ptr %13, i32 0, i32 0
  %87 = load ptr, ptr %86, align 8, !tbaa !13
  %88 = getelementptr inbounds %"class.glmesh::StreamBuffer", ptr %87, i32 0, i32 0
  %89 = load i32, ptr %88, align 8, !tbaa !24
  call void %85(i32 noundef 34962, i32 noundef %89)
  %90 = load ptr, ptr @_ZN2gl14MapBufferRangeE, align 8, !tbaa !5
  %91 = getelementptr inbounds %"class.glmesh::StreamBuffer::Map", ptr %13, i32 0, i32 0
  %92 = load ptr, ptr %91, align 8, !tbaa !13
  %93 = getelementptr inbounds %"class.glmesh::StreamBuffer", ptr %92, i32 0, i32 2
  %94 = load i64, ptr %93, align 8, !tbaa !23
  %95 = getelementptr inbounds %"class.glmesh::StreamBuffer::Map", ptr %13, i32 0, i32 2
  %96 = load i64, ptr %95, align 8, !tbaa !16
  %97 = load i32, ptr %11, align 4, !tbaa !22
  %98 = call noundef ptr %90(i32 noundef 34962, i64 noundef %94, i64 noundef %96, i32 noundef %97)
  %99 = getelementptr inbounds %"class.glmesh::StreamBuffer::Map", ptr %13, i32 0, i32 1
  store ptr %98, ptr %99, align 8, !tbaa !15
  %100 = load ptr, ptr @_ZN2gl10BindBufferE, align 8, !tbaa !5
  call void %100(i32 noundef 34962, i32 noundef 0)
  %101 = getelementptr inbounds %"class.glmesh::StreamBuffer::Map", ptr %13, i32 0, i32 0
  %102 = load ptr, ptr %101, align 8, !tbaa !13
  %103 = getelementptr inbounds %"class.glmesh::StreamBuffer", ptr %102, i32 0, i32 3
  store i8 1, ptr %103, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  ret void

104:                                              ; preds = %72, %46, %27
  %105 = load ptr, ptr %9, align 8
  %106 = load i32, ptr %10, align 4
  %107 = insertvalue { ptr, i32 } poison, ptr %105, 0
  %108 = insertvalue { ptr, i32 } %107, i32 %106, 1
  resume { ptr, i32 } %108
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK6glmesh12StreamBuffer18GetTotalBufferSizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

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

declare void @_ZN6glmesh31NotEnoughStorageForMapExceptionC1Emm(ptr, i64, i64)

declare void @_ZN6glmesh40NotEnoughRemainingStorageForMapExceptionC1Emmm(ptr, i64, i64, i64)

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 = { nounwind }
attributes #4 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSN6glmesh12StreamBuffer3MapE", !6, i64 0, !6, i64 8, !10, i64 16}
!15 = !{!14, !6, i64 8}
!16 = !{!14, !10, i64 16}
!17 = !{!18, !12, i64 24}
!18 = !{!"_ZTSN6glmesh12StreamBufferE", !19, i64 0, !10, i64 8, !10, i64 16, !12, i64 24, !19, i64 28}
!19 = !{!"int", !7, i64 0}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!19, !19, i64 0}
!23 = !{!18, !10, i64 16}
!24 = !{!18, !19, 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"

@_ZN2gl10BindBufferE = external local_unnamed_addr global ptr, align 8
@_ZTIN6glmesh27StoreAlreadyMappedExceptionE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN6glmesh31NotEnoughStorageForMapExceptionE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN6glmesh40NotEnoughRemainingStorageForMapExceptionE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZN2gl14MapBufferRangeE = external local_unnamed_addr global ptr, align 8

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK6glmesh12StreamBuffer17GetSpaceRemainingEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

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

declare void @__cxa_free_exception(ptr) local_unnamed_addr

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6glmesh12StreamBuffer3MapC2ERS0_mb(ptr nocapture noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %2, i1 noundef zeroext %3) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  store ptr %1, ptr %0, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr null, ptr %5, align 8, !tbaa !11
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  store i64 %2, ptr %6, align 8, !tbaa !12
  %7 = getelementptr inbounds i8, ptr %1, i64 24
  %8 = load i8, ptr %7, align 8, !tbaa !13, !range !17, !noundef !18
  %9 = trunc nuw i8 %8 to i1
  br i1 %9, label %10, label %15

10:                                               ; preds = %4
  %11 = tail call ptr @__cxa_allocate_exception(i64 40) #2
  invoke void @_ZN6glmesh27StoreAlreadyMappedExceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %11)
          to label %12 unwind label %13

12:                                               ; preds = %10
  tail call void @__cxa_throw(ptr nonnull %11, ptr nonnull @_ZTIN6glmesh27StoreAlreadyMappedExceptionE, ptr nonnull @_ZN6glmesh21StreamBufferExceptionD2Ev) #3
  unreachable

13:                                               ; preds = %10
  %14 = landingpad { ptr, i32 }
          cleanup
  br label %57

15:                                               ; preds = %4
  %16 = tail call noundef i64 @_ZNK6glmesh12StreamBuffer18GetTotalBufferSizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %17 = icmp ult i64 %16, %2
  br i1 %17, label %18, label %26

18:                                               ; preds = %15
  %19 = tail call ptr @__cxa_allocate_exception(i64 40) #2
  %20 = load i64, ptr %6, align 8, !tbaa !12
  %21 = load ptr, ptr %0, align 8, !tbaa !5
  %22 = tail call noundef i64 @_ZNK6glmesh12StreamBuffer18GetTotalBufferSizeEv(ptr noundef nonnull align 8 dereferenceable(32) %21)
  invoke void @_ZN6glmesh31NotEnoughStorageForMapExceptionC1Emm(ptr noundef nonnull align 8 dereferenceable(40) %19, i64 noundef %20, i64 noundef %22)
          to label %23 unwind label %24

23:                                               ; preds = %18
  tail call void @__cxa_throw(ptr %19, ptr nonnull @_ZTIN6glmesh31NotEnoughStorageForMapExceptionE, ptr nonnull @_ZN6glmesh21StreamBufferExceptionD2Ev) #3
  unreachable

24:                                               ; preds = %18
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %57

26:                                               ; preds = %15
  %27 = load ptr, ptr %0, align 8, !tbaa !5
  %28 = tail call noundef i64 @_ZNK6glmesh12StreamBuffer17GetSpaceRemainingEv(ptr noundef nonnull align 8 dereferenceable(32) %27)
  %29 = icmp ult i64 %28, %2
  br i1 %29, label %30, label %._crit_edge

._crit_edge:                                      ; preds = %26
  %.pre = load ptr, ptr %0, align 8, !tbaa !5
  br label %44

30:                                               ; preds = %26
  br i1 %3, label %41, label %31

31:                                               ; preds = %30
  %32 = tail call ptr @__cxa_allocate_exception(i64 40) #2
  %33 = load ptr, ptr %0, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %33, i64 16
  %35 = load i64, ptr %34, align 8, !tbaa !19
  %36 = load i64, ptr %6, align 8, !tbaa !12
  %37 = tail call noundef i64 @_ZNK6glmesh12StreamBuffer18GetTotalBufferSizeEv(ptr noundef nonnull align 8 dereferenceable(32) %33)
  invoke void @_ZN6glmesh40NotEnoughRemainingStorageForMapExceptionC1Emmm(ptr noundef nonnull align 8 dereferenceable(40) %32, i64 noundef %35, i64 noundef %36, i64 noundef %37)
          to label %38 unwind label %39

38:                                               ; preds = %31
  tail call void @__cxa_throw(ptr %32, ptr nonnull @_ZTIN6glmesh40NotEnoughRemainingStorageForMapExceptionE, ptr nonnull @_ZN6glmesh21StreamBufferExceptionD2Ev) #3
  unreachable

39:                                               ; preds = %31
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %57

41:                                               ; preds = %30
  %42 = load ptr, ptr %0, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  store i64 0, ptr %43, align 8, !tbaa !19
  br label %44

44:                                               ; preds = %._crit_edge, %41
  %45 = phi ptr [ %42, %41 ], [ %.pre, %._crit_edge ]
  %.0 = phi i32 [ 42, %41 ], [ 34, %._crit_edge ]
  %46 = load ptr, ptr @_ZN2gl10BindBufferE, align 8, !tbaa !20
  %47 = load i32, ptr %45, align 8, !tbaa !21
  tail call void %46(i32 noundef 34962, i32 noundef %47)
  %48 = load ptr, ptr @_ZN2gl14MapBufferRangeE, align 8, !tbaa !20
  %49 = load ptr, ptr %0, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %49, i64 16
  %51 = load i64, ptr %50, align 8, !tbaa !19
  %52 = load i64, ptr %6, align 8, !tbaa !12
  %53 = tail call noundef ptr %48(i32 noundef 34962, i64 noundef %51, i64 noundef %52, i32 noundef %.0)
  store ptr %53, ptr %5, align 8, !tbaa !11
  %54 = load ptr, ptr @_ZN2gl10BindBufferE, align 8, !tbaa !20
  tail call void %54(i32 noundef 34962, i32 noundef 0)
  %55 = load ptr, ptr %0, align 8, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %55, i64 24
  store i8 1, ptr %56, align 8, !tbaa !13
  ret void

57:                                               ; preds = %39, %24, %13
  %.sink = phi ptr [ %32, %39 ], [ %19, %24 ], [ %11, %13 ]
  %.pn = phi { ptr, i32 } [ %40, %39 ], [ %25, %24 ], [ %14, %13 ]
  tail call void @__cxa_free_exception(ptr %.sink) #2
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK6glmesh12StreamBuffer18GetTotalBufferSizeEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

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

declare void @_ZN6glmesh31NotEnoughStorageForMapExceptionC1Emm(ptr, i64, i64) local_unnamed_addr

declare void @_ZN6glmesh40NotEnoughRemainingStorageForMapExceptionC1Emmm(ptr, i64, i64, i64) local_unnamed_addr

attributes #0 = { 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 #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 = { nounwind }
attributes #3 = { 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, !7, i64 0}
!6 = !{!"_ZTSN6glmesh12StreamBuffer3MapE", !7, i64 0, !7, i64 8, !10, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!6, !7, i64 8}
!12 = !{!6, !10, i64 16}
!13 = !{!14, !16, i64 24}
!14 = !{!"_ZTSN6glmesh12StreamBufferE", !15, i64 0, !10, i64 8, !10, i64 16, !16, i64 24, !15, i64 28}
!15 = !{!"int", !8, i64 0}
!16 = !{!"bool", !8, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!14, !10, i64 16}
!20 = !{!7, !7, i64 0}
!21 = !{!14, !15, i64 0}


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