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

; 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::TSymbolTable" = type { %"class.std::vector.13", i64, i8, i8, i32 }
%"class.std::vector.13" = type { %"struct.std::_Vector_base.14" }
%"struct.std::_Vector_base.14" = type { %"struct.std::_Vector_base<glslang::TSymbolTableLevel *, std::allocator<glslang::TSymbolTableLevel *>>::_Vector_impl" }
%"struct.std::_Vector_base<glslang::TSymbolTableLevel *, std::allocator<glslang::TSymbolTableLevel *>>::_Vector_impl" = type { %"struct.std::_Vector_base<glslang::TSymbolTableLevel *, std::allocator<glslang::TSymbolTableLevel *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<glslang::TSymbolTableLevel *, std::allocator<glslang::TSymbolTableLevel *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str.50 = external hidden unnamed_addr constant [113 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [38 x i8], align 1
@__PRETTY_FUNCTION__._ZN7glslang12TSymbolTable9copyTableERKS0_ = external hidden unnamed_addr constant [60 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPN7glslang17TSymbolTableLevelESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7glslang17TSymbolTableLevel5cloneEv(ptr noundef nonnull align 8 dereferenceable(101)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7glslang12TSymbolTable9copyTableERKS0_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(40) %1) #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %7 = load ptr, ptr %3, align 8
  %8 = getelementptr inbounds %"class.glslang::TSymbolTable", ptr %7, i32 0, i32 4
  %9 = load i32, ptr %8, align 4, !tbaa !9
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = getelementptr inbounds %"class.glslang::TSymbolTable", ptr %10, i32 0, i32 4
  %12 = load i32, ptr %11, align 4, !tbaa !9
  %13 = icmp eq i32 %9, %12
  br i1 %13, label %14, label %15

14:                                               ; preds = %2
  br label %17

15:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.52, ptr noundef @.str.50, i32 noundef 468, ptr noundef @__PRETTY_FUNCTION__._ZN7glslang12TSymbolTable9copyTableERKS0_) #4
  unreachable

16:                                               ; No predecessors!
  br label %17

17:                                               ; preds = %16, %14
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %"class.glslang::TSymbolTable", ptr %18, i32 0, i32 1
  %20 = load i64, ptr %19, align 8, !tbaa !18
  %21 = getelementptr inbounds %"class.glslang::TSymbolTable", ptr %7, i32 0, i32 1
  store i64 %20, ptr %21, align 8, !tbaa !18
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %"class.glslang::TSymbolTable", ptr %22, i32 0, i32 2
  %24 = load i8, ptr %23, align 8, !tbaa !19, !range !20, !noundef !21
  %25 = trunc i8 %24 to i1
  %26 = getelementptr inbounds %"class.glslang::TSymbolTable", ptr %7, i32 0, i32 2
  %27 = zext i1 %25 to i8
  store i8 %27, ptr %26, align 8, !tbaa !19
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %"class.glslang::TSymbolTable", ptr %28, i32 0, i32 3
  %30 = load i8, ptr %29, align 1, !tbaa !22, !range !20, !noundef !21
  %31 = trunc i8 %30 to i1
  %32 = getelementptr inbounds %"class.glslang::TSymbolTable", ptr %7, i32 0, i32 3
  %33 = zext i1 %31 to i8
  store i8 %33, ptr %32, align 1, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %"class.glslang::TSymbolTable", ptr %34, i32 0, i32 4
  %36 = load i32, ptr %35, align 4, !tbaa !9
  store i32 %36, ptr %5, align 4, !tbaa !23
  br label %37

37:                                               ; preds = %54, %17
  %38 = load i32, ptr %5, align 4, !tbaa !23
  %39 = zext i32 %38 to i64
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %"class.glslang::TSymbolTable", ptr %40, i32 0, i32 0
  %42 = call noundef i64 @_ZNKSt6vectorIPN7glslang17TSymbolTableLevelESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #5
  %43 = icmp ult i64 %39, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %57

45:                                               ; preds = %37
  %46 = getelementptr inbounds %"class.glslang::TSymbolTable", ptr %7, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %"class.glslang::TSymbolTable", ptr %47, i32 0, i32 0
  %49 = load i32, ptr %5, align 4, !tbaa !23
  %50 = zext i32 %49 to i64
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPN7glslang17TSymbolTableLevelESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %48, i64 noundef %50) #5
  %52 = load ptr, ptr %51, align 8, !tbaa !5
  %53 = call noundef ptr @_ZNK7glslang17TSymbolTableLevel5cloneEv(ptr noundef nonnull align 8 dereferenceable(101) %52)
  store ptr %53, ptr %6, align 8, !tbaa !5
  call void @_ZNSt6vectorIPN7glslang17TSymbolTableLevelESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %46, ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %54

54:                                               ; preds = %45
  %55 = load i32, ptr %5, align 4, !tbaa !23
  %56 = add i32 %55, 1
  store i32 %56, ptr %5, align 4, !tbaa !23
  br label %37, !llvm.loop !24

57:                                               ; preds = %44
  ret void
}

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

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

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 = { 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 #3 = { 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 #4 = { noreturn nounwind }
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 36}
!10 = !{!"_ZTSN7glslang12TSymbolTableE", !11, i64 0, !15, i64 24, !16, i64 32, !16, i64 33, !17, i64 36}
!11 = !{!"_ZTSSt6vectorIPN7glslang17TSymbolTableLevelESaIS2_EE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIPN7glslang17TSymbolTableLevelESaIS2_EE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIPN7glslang17TSymbolTableLevelESaIS2_EE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIPN7glslang17TSymbolTableLevelESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!"long long", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!10, !15, i64 24}
!19 = !{!10, !16, i64 32}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!10, !16, i64 33}
!23 = !{!17, !17, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


; 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.50 = external hidden unnamed_addr constant [113 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [38 x i8], align 1
@__PRETTY_FUNCTION__._ZN7glslang12TSymbolTable9copyTableERKS0_ = external hidden unnamed_addr constant [60 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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7glslang17TSymbolTableLevel5cloneEv(ptr noundef nonnull align 8 dereferenceable(101)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7glslang12TSymbolTable9copyTableERKS0_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(40) %1) local_unnamed_addr #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 36
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %1, i64 36
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = icmp eq i32 %5, %7
  br i1 %8, label %10, label %9

9:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.52, ptr noundef nonnull @.str.50, i32 noundef 468, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7glslang12TSymbolTable9copyTableERKS0_) #4
  unreachable

10:                                               ; preds = %2
  %11 = getelementptr inbounds i8, ptr %1, i64 24
  %12 = load i64, ptr %11, align 8, !tbaa !17
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  store i64 %12, ptr %13, align 8, !tbaa !17
  %14 = getelementptr inbounds i8, ptr %1, i64 32
  %15 = load i8, ptr %14, align 8, !tbaa !18, !range !19, !noundef !20
  %16 = getelementptr inbounds i8, ptr %0, i64 32
  store i8 %15, ptr %16, align 8, !tbaa !18
  %17 = getelementptr inbounds i8, ptr %1, i64 33
  %18 = load i8, ptr %17, align 1, !tbaa !21, !range !19, !noundef !20
  %19 = getelementptr inbounds i8, ptr %0, i64 33
  store i8 %18, ptr %19, align 1, !tbaa !21
  %20 = zext i32 %5 to i64
  %21 = tail call noundef i64 @_ZNKSt6vectorIPN7glslang17TSymbolTableLevelESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  %22 = icmp ugt i64 %21, %20
  br i1 %22, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %10
  ret void

.lr.ph:                                           ; preds = %10, %.lr.ph
  %23 = phi i64 [ %28, %.lr.ph ], [ %20, %10 ]
  %.011 = phi i32 [ %27, %.lr.ph ], [ %5, %10 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPN7glslang17TSymbolTableLevelESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %23) #5
  %25 = load ptr, ptr %24, align 8, !tbaa !22
  %26 = call noundef ptr @_ZNK7glslang17TSymbolTableLevel5cloneEv(ptr noundef nonnull align 8 dereferenceable(101) %25)
  store ptr %26, ptr %3, align 8, !tbaa !22
  call void @_ZNSt6vectorIPN7glslang17TSymbolTableLevelESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  %27 = add i32 %.011, 1
  %28 = zext i32 %27 to i64
  %29 = call noundef i64 @_ZNKSt6vectorIPN7glslang17TSymbolTableLevelESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  %30 = icmp ugt i64 %29, %28
  br i1 %30, label %.lr.ph, label %._crit_edge, !llvm.loop !23
}

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

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

attributes #0 = { mustprogress 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 = { 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 #3 = { 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 #4 = { noreturn nounwind }
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, !16, i64 36}
!6 = !{!"_ZTSN7glslang12TSymbolTableE", !7, i64 0, !14, i64 24, !15, i64 32, !15, i64 33, !16, i64 36}
!7 = !{!"_ZTSSt6vectorIPN7glslang17TSymbolTableLevelESaIS2_EE", !8, i64 0}
!8 = !{!"_ZTSSt12_Vector_baseIPN7glslang17TSymbolTableLevelESaIS2_EE", !9, i64 0}
!9 = !{!"_ZTSNSt12_Vector_baseIPN7glslang17TSymbolTableLevelESaIS2_EE12_Vector_implE", !10, i64 0}
!10 = !{!"_ZTSNSt12_Vector_baseIPN7glslang17TSymbolTableLevelESaIS2_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"long long", !12, i64 0}
!15 = !{!"bool", !12, i64 0}
!16 = !{!"int", !12, i64 0}
!17 = !{!6, !14, i64 24}
!18 = !{!6, !15, i64 32}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!6, !15, i64 33}
!22 = !{!11, !11, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass