; LLVM IR from hbatagelo/abcg :: abcg/external/glslang/glslang/MachineIndependent/preprocessor (PpTokens)

; 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.glslang::TPpContext::TokenStream" = type { %"class.glslang::TVector", i64 }
%"class.glslang::TVector" = type { %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<glslang::TPpContext::TokenStream::Token, glslang::pool_allocator<glslang::TPpContext::TokenStream::Token>>::_Vector_impl" }
%"struct.std::_Vector_base<glslang::TPpContext::TokenStream::Token, glslang::pool_allocator<glslang::TPpContext::TokenStream::Token>>::_Vector_impl" = type { %"class.glslang::pool_allocator.1", %"struct.std::_Vector_base<glslang::TPpContext::TokenStream::Token, glslang::pool_allocator<glslang::TPpContext::TokenStream::Token>>::_Vector_impl_data" }
%"class.glslang::pool_allocator.1" = type { ptr }
%"struct.std::_Vector_base<glslang::TPpContext::TokenStream::Token, glslang::pool_allocator<glslang::TPpContext::TokenStream::Token>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.glslang::TPpToken" = type <{ %"struct.glslang::TSourceLoc", i8, [7 x i8], %union.anon.0, [1025 x i8], [7 x i8] }>
%"struct.glslang::TSourceLoc" = type { ptr, i32, i32, i32 }
%union.anon.0 = type { double }

@.str = external hidden unnamed_addr constant [19 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7glslang10TPpContext11TokenStream8getTokenERNS_17TParseContextBaseEPNS_8TPpTokenE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(1176) %1, ptr noundef %2) #1 align 2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %9 = load ptr, ptr %5, align 8
  %10 = call noundef zeroext i1 @_ZN7glslang10TPpContext11TokenStream5atEndEv(ptr noundef nonnull align 8 dereferenceable(40) %9)
  br i1 %10, label %11, label %12

11:                                               ; preds = %3
  store i32 -1, ptr %4, align 4
  br label %41

12:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %13 = getelementptr inbounds %"class.glslang::TPpContext::TokenStream", ptr %9, i32 0, i32 0
  %14 = getelementptr inbounds %"class.glslang::TPpContext::TokenStream", ptr %9, i32 0, i32 1
  %15 = load i64, ptr %14, align 8, !tbaa !9
  %16 = add i64 %15, 1
  store i64 %16, ptr %14, align 8, !tbaa !9
  %17 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorIN7glslang10TPpContext11TokenStream5TokenENS0_14pool_allocatorIS3_EEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %13, i64 noundef %15) #5
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = call noundef i32 @_ZN7glslang10TPpContext11TokenStream5Token3getERNS_8TPpTokenE(ptr noundef nonnull align 8 dereferenceable(56) %17, ptr noundef nonnull align 8 dereferenceable(1065) %18)
  store i32 %19, ptr %8, align 4, !tbaa !18
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7glslang14TParseVersions13getCurrentLocEv(ptr noundef nonnull align 8 dereferenceable(192) %20)
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = getelementptr inbounds %"class.glslang::TPpToken", ptr %22, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %23, ptr align 8 %21, i64 24, i1 false), !tbaa.struct !20
  %24 = load i32, ptr %8, align 4, !tbaa !18
  %25 = icmp eq i32 %24, 35
  br i1 %25, label %26, label %39

26:                                               ; preds = %12
  %27 = call noundef zeroext i1 @_ZN7glslang10TPpContext11TokenStream9peekTokenEi(ptr noundef nonnull align 8 dereferenceable(40) %9, i32 noundef 35)
  br i1 %27, label %28, label %38

28:                                               ; preds = %26
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = getelementptr inbounds %"class.glslang::TPpToken", ptr %30, i32 0, i32 0
  call void @_ZN7glslang14TParseVersions14requireProfileERKNS_10TSourceLocEiPKc(ptr noundef nonnull align 8 dereferenceable(192) %29, ptr noundef nonnull align 8 dereferenceable(24) %31, i32 noundef -9, ptr noundef @.str)
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds %"class.glslang::TPpToken", ptr %33, i32 0, i32 0
  call void @_ZN7glslang14TParseVersions15profileRequiresERKNS_10TSourceLocEiiPKcS5_(ptr noundef nonnull align 8 dereferenceable(192) %32, ptr noundef nonnull align 8 dereferenceable(24) %34, i32 noundef -9, i32 noundef 130, ptr noundef null, ptr noundef @.str)
  %35 = getelementptr inbounds %"class.glslang::TPpContext::TokenStream", ptr %9, i32 0, i32 1
  %36 = load i64, ptr %35, align 8, !tbaa !9
  %37 = add i64 %36, 1
  store i64 %37, ptr %35, align 8, !tbaa !9
  store i32 151, ptr %8, align 4, !tbaa !18
  br label %38

38:                                               ; preds = %28, %26
  br label %39

39:                                               ; preds = %38, %12
  %40 = load i32, ptr %8, align 4, !tbaa !18
  store i32 %40, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %41

41:                                               ; preds = %39, %11
  %42 = load i32, ptr %4, align 4
  ret i32 %42
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7glslang10TPpContext11TokenStream5atEndEv(ptr noundef nonnull align 8 dereferenceable(40)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7glslang10TPpContext11TokenStream5Token3getERNS_8TPpTokenE(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(1065)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7glslang14TParseVersions13getCurrentLocEv(ptr noundef nonnull align 8 dereferenceable(192)) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7glslang10TPpContext11TokenStream9peekTokenEi(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) #1 align 2

declare void @_ZN7glslang14TParseVersions14requireProfileERKNS_10TSourceLocEiPKc(ptr noundef nonnull align 8 dereferenceable(192), ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef) #4

declare void @_ZN7glslang14TParseVersions15profileRequiresERKNS_10TSourceLocEiiPKcS5_(ptr noundef nonnull align 8 dereferenceable(192), ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef, ptr noundef, ptr noundef) #4

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 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 }

!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, !17, i64 32}
!10 = !{!"_ZTSN7glslang10TPpContext11TokenStreamE", !11, i64 0, !17, i64 32}
!11 = !{!"_ZTSN7glslang7TVectorINS_10TPpContext11TokenStream5TokenEEE", !12, i64 0}
!12 = !{!"_ZTSSt6vectorIN7glslang10TPpContext11TokenStream5TokenENS0_14pool_allocatorIS3_EEE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIN7glslang10TPpContext11TokenStream5TokenENS0_14pool_allocatorIS3_EEE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIN7glslang10TPpContext11TokenStream5TokenENS0_14pool_allocatorIS3_EEE12_Vector_implE", !15, i64 0, !16, i64 8}
!15 = !{!"_ZTSN7glslang14pool_allocatorINS_10TPpContext11TokenStream5TokenEEE", !6, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIN7glslang10TPpContext11TokenStream5TokenENS0_14pool_allocatorIS3_EEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"long", !7, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"int", !7, i64 0}
!20 = !{i64 0, i64 8, !5, i64 8, i64 4, !18, i64 12, i64 4, !18, i64 16, i64 4, !18}


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

@.str = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7glslang10TPpContext11TokenStream8getTokenERNS_17TParseContextBaseEPNS_8TPpTokenE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(1176) %1, ptr noundef %2) local_unnamed_addr #0 align 2 {
  %4 = tail call noundef zeroext i1 @_ZN7glslang10TPpContext11TokenStream5atEndEv(ptr noundef nonnull align 8 dereferenceable(40) %0)
  br i1 %4, label %18, label %5

5:                                                ; preds = %3
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  %7 = load i64, ptr %6, align 8, !tbaa !5
  %8 = add i64 %7, 1
  store i64 %8, ptr %6, align 8, !tbaa !5
  %9 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorIN7glslang10TPpContext11TokenStream5TokenENS0_14pool_allocatorIS3_EEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %7) #4
  %10 = tail call noundef i32 @_ZN7glslang10TPpContext11TokenStream5Token3getERNS_8TPpTokenE(ptr noundef nonnull align 8 dereferenceable(56) %9, ptr noundef nonnull align 8 dereferenceable(1065) %2)
  %11 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7glslang14TParseVersions13getCurrentLocEv(ptr noundef nonnull align 8 dereferenceable(192) %1)
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %11, i64 24, i1 false), !tbaa.struct !17
  %12 = icmp eq i32 %10, 35
  br i1 %12, label %13, label %18

13:                                               ; preds = %5
  %14 = tail call noundef zeroext i1 @_ZN7glslang10TPpContext11TokenStream9peekTokenEi(ptr noundef nonnull align 8 dereferenceable(40) %0, i32 noundef 35)
  br i1 %14, label %15, label %18

15:                                               ; preds = %13
  tail call void @_ZN7glslang14TParseVersions14requireProfileERKNS_10TSourceLocEiPKc(ptr noundef nonnull align 8 dereferenceable(192) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef -9, ptr noundef nonnull @.str)
  tail call void @_ZN7glslang14TParseVersions15profileRequiresERKNS_10TSourceLocEiiPKcS5_(ptr noundef nonnull align 8 dereferenceable(192) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef -9, i32 noundef 130, ptr noundef null, ptr noundef nonnull @.str)
  %16 = load i64, ptr %6, align 8, !tbaa !5
  %17 = add i64 %16, 1
  store i64 %17, ptr %6, align 8, !tbaa !5
  br label %18

18:                                               ; preds = %5, %15, %13, %3
  %.010 = phi i32 [ -1, %3 ], [ 151, %15 ], [ 35, %13 ], [ %10, %5 ]
  ret i32 %.010
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7glslang10TPpContext11TokenStream5atEndEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7glslang10TPpContext11TokenStream5Token3getERNS_8TPpTokenE(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(1065)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7glslang14TParseVersions13getCurrentLocEv(ptr noundef nonnull align 8 dereferenceable(192)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7glslang10TPpContext11TokenStream9peekTokenEi(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) local_unnamed_addr #0 align 2

declare void @_ZN7glslang14TParseVersions14requireProfileERKNS_10TSourceLocEiPKc(ptr noundef nonnull align 8 dereferenceable(192), ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef) local_unnamed_addr #3

declare void @_ZN7glslang14TParseVersions15profileRequiresERKNS_10TSourceLocEiiPKcS5_(ptr noundef nonnull align 8 dereferenceable(192), ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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 = { 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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!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, !16, i64 32}
!6 = !{!"_ZTSN7glslang10TPpContext11TokenStreamE", !7, i64 0, !16, i64 32}
!7 = !{!"_ZTSN7glslang7TVectorINS_10TPpContext11TokenStream5TokenEEE", !8, i64 0}
!8 = !{!"_ZTSSt6vectorIN7glslang10TPpContext11TokenStream5TokenENS0_14pool_allocatorIS3_EEE", !9, i64 0}
!9 = !{!"_ZTSSt12_Vector_baseIN7glslang10TPpContext11TokenStream5TokenENS0_14pool_allocatorIS3_EEE", !10, i64 0}
!10 = !{!"_ZTSNSt12_Vector_baseIN7glslang10TPpContext11TokenStream5TokenENS0_14pool_allocatorIS3_EEE12_Vector_implE", !11, i64 0, !15, i64 8}
!11 = !{!"_ZTSN7glslang14pool_allocatorINS_10TPpContext11TokenStream5TokenEEE", !12, i64 0}
!12 = !{!"any pointer", !13, i64 0}
!13 = !{!"omnipotent char", !14, i64 0}
!14 = !{!"Simple C++ TBAA"}
!15 = !{!"_ZTSNSt12_Vector_baseIN7glslang10TPpContext11TokenStream5TokenENS0_14pool_allocatorIS3_EEE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!16 = !{!"long", !13, i64 0}
!17 = !{i64 0, i64 8, !18, i64 8, i64 4, !19, i64 12, i64 4, !19, i64 16, i64 4, !19}
!18 = !{!12, !12, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"int", !13, i64 0}


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