; LLVM IR from ThePhysicsGuys/Physics3D :: graphics/legacy/shaderParser.ll (ZN3P3D8Graphics12parseVersionERNS0_10TokenStackE)

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

%"struct.P3D::Graphics::Token" = type { %"struct.P3D::Graphics::TokenType", %"class.std::__cxx11::basic_string" }
%"struct.P3D::Graphics::TokenType" = type <{ i8, [7 x i8], %"class.std::__cxx11::basic_regex", i8, i8, [6 x i8] }>
%"class.std::__cxx11::basic_regex" = type { i32, %"class.std::locale", %"class.std::shared_ptr" }
%"class.std::locale" = type { ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"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] }
%"struct.P3D::Graphics::ShaderVersion" = type { i32, i8 }

@.str.17 = external hidden unnamed_addr constant [5 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #1

declare void @_ZN3P3D8Graphics10TokenStack3popEv(ptr dead_on_unwind writable sret(%"struct.P3D::Graphics::Token") align 8, ptr noundef nonnull align 8 dereferenceable(40)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3P3D8Graphics9TokenTypeeqENS1_4TypeE(ptr noundef nonnull align 8 dereferenceable(42), i8 noundef signext) #3 align 2

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

declare void @_ZNK3P3D8Graphics10TokenStack4peekEm(ptr dead_on_unwind writable sret(%"struct.P3D::Graphics::Token") align 8, ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #2

declare void @_ZN3P3D8Graphics10TokenStack7discardEv(ptr noundef nonnull align 8 dereferenceable(40)) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNSt7__cxx114stoiERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local i64 @_ZN3P3D8Graphics12parseVersionERNS0_10TokenStackE(ptr noundef nonnull align 8 dereferenceable(40) %0) #5 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"struct.P3D::Graphics::ShaderVersion", align 4
  %3 = alloca ptr, align 8
  %4 = alloca %"struct.P3D::Graphics::Token", align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"struct.P3D::Graphics::Token", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.P3D::Graphics::Token", align 8
  %11 = alloca %"struct.P3D::Graphics::Token", align 8
  %12 = alloca i1, align 1
  %13 = alloca i1, align 1
  %14 = alloca %"struct.P3D::Graphics::Token", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN3P3D8Graphics10TokenStack7discardEv(ptr noundef nonnull align 8 dereferenceable(40) %15)
  call void @llvm.lifetime.start.p0(i64 80, ptr %4) #6
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZNK3P3D8Graphics10TokenStack4peekEm(ptr dead_on_unwind writable sret(%"struct.P3D::Graphics::Token") align 8 %4, ptr noundef nonnull align 8 dereferenceable(40) %16, i64 noundef 0)
  %17 = getelementptr inbounds %"struct.P3D::Graphics::Token", ptr %4, i32 0, i32 0
  %18 = invoke noundef zeroext i1 @_ZNK3P3D8Graphics9TokenTypeeqENS1_4TypeE(ptr noundef nonnull align 8 dereferenceable(42) %17, i8 noundef signext 6)
          to label %19 unwind label %51

19:                                               ; preds = %1
  call void @_ZN3P3D8Graphics5TokenD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %4) #6
  br i1 %18, label %20, label %80

20:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 80, ptr %7) #6
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN3P3D8Graphics10TokenStack3popEv(ptr dead_on_unwind writable sret(%"struct.P3D::Graphics::Token") align 8 %7, ptr noundef nonnull align 8 dereferenceable(40) %21)
  %22 = getelementptr inbounds %"struct.P3D::Graphics::Token", ptr %7, i32 0, i32 1
  %23 = invoke noundef i32 @_ZNSt7__cxx114stoiERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32) %22, ptr noundef null, i32 noundef 10)
          to label %24 unwind label %55

24:                                               ; preds = %20
  %25 = getelementptr inbounds %"struct.P3D::Graphics::ShaderVersion", ptr %2, i32 0, i32 0
  store i32 %23, ptr %25, align 4, !tbaa !9
  call void @_ZN3P3D8Graphics5TokenD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %7) #6
  %26 = getelementptr inbounds %"struct.P3D::Graphics::ShaderVersion", ptr %2, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 300, ptr %8, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 450, ptr %9, align 4, !tbaa !13
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt5clampIiERKT_S2_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %26, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %28 = load i32, ptr %27, align 4, !tbaa !13
  %29 = getelementptr inbounds %"struct.P3D::Graphics::ShaderVersion", ptr %2, i32 0, i32 0
  store i32 %28, ptr %29, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 80, ptr %10) #6
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZNK3P3D8Graphics10TokenStack4peekEm(ptr dead_on_unwind writable sret(%"struct.P3D::Graphics::Token") align 8 %10, ptr noundef nonnull align 8 dereferenceable(40) %30, i64 noundef 0)
  %31 = getelementptr inbounds %"struct.P3D::Graphics::Token", ptr %10, i32 0, i32 0
  store i1 false, ptr %12, align 1
  store i1 false, ptr %13, align 1
  %32 = invoke noundef zeroext i1 @_ZNK3P3D8Graphics9TokenTypeeqENS1_4TypeE(ptr noundef nonnull align 8 dereferenceable(42) %31, i8 noundef signext 1)
          to label %33 unwind label %59

33:                                               ; preds = %24
  br i1 %32, label %34, label %40

34:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 80, ptr %11) #6
  store i1 true, ptr %12, align 1
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  invoke void @_ZNK3P3D8Graphics10TokenStack4peekEm(ptr dead_on_unwind writable sret(%"struct.P3D::Graphics::Token") align 8 %11, ptr noundef nonnull align 8 dereferenceable(40) %35, i64 noundef 0)
          to label %36 unwind label %63

36:                                               ; preds = %34
  store i1 true, ptr %13, align 1
  %37 = getelementptr inbounds %"struct.P3D::Graphics::Token", ptr %11, i32 0, i32 1
  %38 = invoke noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %37, ptr noundef @.str.17)
          to label %39 unwind label %67

39:                                               ; preds = %36
  br label %40

40:                                               ; preds = %39, %33
  %41 = phi i1 [ false, %33 ], [ %38, %39 ]
  %42 = load i1, ptr %13, align 1
  br i1 %42, label %43, label %44

43:                                               ; preds = %40
  call void @_ZN3P3D8Graphics5TokenD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %11) #6
  br label %44

44:                                               ; preds = %43, %40
  %45 = load i1, ptr %12, align 1
  br i1 %45, label %46, label %47

46:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 80, ptr %11) #6
  br label %47

47:                                               ; preds = %46, %44
  call void @_ZN3P3D8Graphics5TokenD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %10) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %10) #6
  br i1 %41, label %48, label %79

48:                                               ; preds = %47
  %49 = getelementptr inbounds %"struct.P3D::Graphics::ShaderVersion", ptr %2, i32 0, i32 1
  store i8 1, ptr %49, align 4, !tbaa !14
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN3P3D8Graphics10TokenStack3popEv(ptr dead_on_unwind writable sret(%"struct.P3D::Graphics::Token") align 8 %14, ptr noundef nonnull align 8 dereferenceable(40) %50)
  call void @_ZN3P3D8Graphics5TokenD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %14) #6
  br label %79

51:                                               ; preds = %1
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %5, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %6, align 4
  call void @_ZN3P3D8Graphics5TokenD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %4) #6
  br label %82

55:                                               ; preds = %20
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %5, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %6, align 4
  call void @_ZN3P3D8Graphics5TokenD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %7) #6
  br label %82

59:                                               ; preds = %24
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %5, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %6, align 4
  br label %78

63:                                               ; preds = %34
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %5, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %6, align 4
  br label %74

67:                                               ; preds = %36
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %5, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %6, align 4
  %71 = load i1, ptr %13, align 1
  br i1 %71, label %72, label %73

72:                                               ; preds = %67
  call void @_ZN3P3D8Graphics5TokenD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %11) #6
  br label %73

73:                                               ; preds = %72, %67
  br label %74

74:                                               ; preds = %73, %63
  %75 = load i1, ptr %12, align 1
  br i1 %75, label %76, label %77

76:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 80, ptr %11) #6
  br label %77

77:                                               ; preds = %76, %74
  br label %78

78:                                               ; preds = %77, %59
  call void @_ZN3P3D8Graphics5TokenD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %10) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %10) #6
  br label %82

79:                                               ; preds = %48, %47
  br label %80

80:                                               ; preds = %79, %19
  %81 = load i64, ptr %2, align 4
  ret i64 %81

82:                                               ; preds = %78, %55, %51
  %83 = load ptr, ptr %5, align 8
  %84 = load i32, ptr %6, align 4
  %85 = insertvalue { ptr, i32 } poison, ptr %83, 0
  %86 = insertvalue { ptr, i32 } %85, i32 %84, 1
  resume { ptr, i32 } %86
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt5clampIiERKT_S2_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 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 = { 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 #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, !11, i64 0}
!10 = !{!"_ZTSN3P3D8Graphics13ShaderVersionE", !11, i64 0, !12, i64 4}
!11 = !{!"int", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !12, i64 4}


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

%"struct.P3D::Graphics::Token" = type { %"struct.P3D::Graphics::TokenType", %"class.std::__cxx11::basic_string" }
%"struct.P3D::Graphics::TokenType" = type <{ i8, [7 x i8], %"class.std::__cxx11::basic_regex", i8, i8, [6 x i8] }>
%"class.std::__cxx11::basic_regex" = type { i32, %"class.std::locale", %"class.std::shared_ptr" }
%"class.std::locale" = type { ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"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] }
%"struct.P3D::Graphics::ShaderVersion" = type { i32, i8 }

@.str.17 = external hidden unnamed_addr constant [5 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #1

declare void @_ZN3P3D8Graphics10TokenStack3popEv(ptr dead_on_unwind writable sret(%"struct.P3D::Graphics::Token") align 8, ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3P3D8Graphics9TokenTypeeqENS1_4TypeE(ptr noundef nonnull align 8 dereferenceable(42), i8 noundef signext) local_unnamed_addr #3 align 2

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

declare void @_ZNK3P3D8Graphics10TokenStack4peekEm(ptr dead_on_unwind writable sret(%"struct.P3D::Graphics::Token") align 8, ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #2

declare void @_ZN3P3D8Graphics10TokenStack7discardEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNSt7__cxx114stoiERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local i64 @_ZN3P3D8Graphics12parseVersionERNS0_10TokenStackE(ptr noundef nonnull align 8 dereferenceable(40) %0) local_unnamed_addr #5 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"struct.P3D::Graphics::ShaderVersion", align 8
  %3 = alloca %"struct.P3D::Graphics::Token", align 8
  %4 = alloca %"struct.P3D::Graphics::Token", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"struct.P3D::Graphics::Token", align 8
  %8 = alloca %"struct.P3D::Graphics::Token", align 8
  %9 = alloca %"struct.P3D::Graphics::Token", align 8
  tail call void @_ZN3P3D8Graphics10TokenStack7discardEv(ptr noundef nonnull align 8 dereferenceable(40) %0)
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #6
  call void @_ZNK3P3D8Graphics10TokenStack4peekEm(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Graphics::Token") align 8 %3, ptr noundef nonnull align 8 dereferenceable(40) %0, i64 noundef 0)
  %10 = call noundef zeroext i1 @_ZNK3P3D8Graphics9TokenTypeeqENS1_4TypeE(ptr noundef nonnull align 8 dereferenceable(42) %3, i8 noundef signext 6)
  call void @_ZN3P3D8Graphics5TokenD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #6
  br i1 %10, label %11, label %27

11:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %4) #6
  call void @_ZN3P3D8Graphics10TokenStack3popEv(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Graphics::Token") align 8 %4, ptr noundef nonnull align 8 dereferenceable(40) %0)
  %12 = getelementptr inbounds i8, ptr %4, i64 48
  %13 = invoke noundef i32 @_ZNSt7__cxx114stoiERKNS_12basic_stringIcSt11char_traitsIcESaIcEEEPmi(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef null, i32 noundef 10)
          to label %14 unwind label %23

14:                                               ; preds = %11
  store i32 %13, ptr %2, align 8, !tbaa !5
  call void @_ZN3P3D8Graphics5TokenD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  store i32 300, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  store i32 450, ptr %6, align 4, !tbaa !11
  %15 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt5clampIiERKT_S2_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %16 = load i32, ptr %15, align 4, !tbaa !11
  store i32 %16, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %7) #6
  call void @_ZNK3P3D8Graphics10TokenStack4peekEm(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Graphics::Token") align 8 %7, ptr noundef nonnull align 8 dereferenceable(40) %0, i64 noundef 0)
  %17 = call noundef zeroext i1 @_ZNK3P3D8Graphics9TokenTypeeqENS1_4TypeE(ptr noundef nonnull align 8 dereferenceable(42) %7, i8 noundef signext 1)
  br i1 %17, label %18, label %.critedge.thread

.critedge.thread:                                 ; preds = %14
  call void @_ZN3P3D8Graphics5TokenD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #6
  br label %27

18:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %8) #6
  invoke void @_ZNK3P3D8Graphics10TokenStack4peekEm(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Graphics::Token") align 8 %8, ptr noundef nonnull align 8 dereferenceable(40) %0, i64 noundef 0)
          to label %.critedge unwind label %25

.critedge:                                        ; preds = %18
  %19 = getelementptr inbounds i8, ptr %8, i64 48
  %20 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef nonnull @.str.17)
  call void @_ZN3P3D8Graphics5TokenD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %8) #6
  call void @_ZN3P3D8Graphics5TokenD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #6
  br i1 %20, label %21, label %27

21:                                               ; preds = %.critedge
  %22 = getelementptr inbounds i8, ptr %2, i64 4
  store i8 1, ptr %22, align 4, !tbaa !12
  call void @_ZN3P3D8Graphics10TokenStack3popEv(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Graphics::Token") align 8 %9, ptr noundef nonnull align 8 dereferenceable(40) %0)
  call void @_ZN3P3D8Graphics5TokenD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %9) #6
  br label %27

23:                                               ; preds = %11
  %24 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3P3D8Graphics5TokenD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #6
  br label %29

25:                                               ; preds = %18
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %8) #6
  call void @_ZN3P3D8Graphics5TokenD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #6
  br label %29

27:                                               ; preds = %.critedge.thread, %.critedge, %21, %1
  %28 = load i64, ptr %2, align 8
  ret i64 %28

29:                                               ; preds = %25, %23
  %.pn = phi { ptr, i32 } [ %26, %25 ], [ %24, %23 ]
  resume { ptr, i32 } %.pn
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 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 = { 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 #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, !7, i64 0}
!6 = !{!"_ZTSN3P3D8Graphics13ShaderVersionE", !7, i64 0, !10, i64 4}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!6, !10, i64 4}


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