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

; 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::TBuiltInParseables" = type { ptr, %"class.std::__cxx11::basic_string", [14 x %"class.std::__cxx11::basic_string"] }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char, std::char_traits<char>, glslang::pool_allocator<char>>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char, std::char_traits<char>, glslang::pool_allocator<char>>::_Alloc_hider" = type { %"class.glslang::pool_allocator", ptr }
%"class.glslang::pool_allocator" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@_ZTVN7glslang18TBuiltInParseablesE = external dso_local unnamed_addr constant { [10 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7glslang18TBuiltInParseablesC2Ev(ptr noundef nonnull align 8 dereferenceable(608) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  store ptr getelementptr inbounds inrange(-16, 64) ({ [10 x ptr] }, ptr @_ZTVN7glslang18TBuiltInParseablesE, i32 0, i32 0, i32 2), ptr %5, align 8, !tbaa !9
  %6 = getelementptr inbounds %"class.glslang::TBuiltInParseables", ptr %5, i32 0, i32 1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN7glslang14pool_allocatorIcEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6)
  %7 = getelementptr inbounds %"class.glslang::TBuiltInParseables", ptr %5, i32 0, i32 2
  %8 = getelementptr inbounds [14 x %"class.std::__cxx11::basic_string"], ptr %7, i32 0, i32 0
  %9 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %8, i64 14
  br label %10

10:                                               ; preds = %12, %1
  %11 = phi ptr [ %8, %1 ], [ %13, %12 ]
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN7glslang14pool_allocatorIcEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %11)
          to label %12 unwind label %16

12:                                               ; preds = %10
  %13 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %11, i64 1
  %14 = icmp eq ptr %13, %9
  br i1 %14, label %15, label %10

15:                                               ; preds = %12
  ret void

16:                                               ; preds = %10
  %17 = landingpad { ptr, i32 }
          cleanup
  %18 = extractvalue { ptr, i32 } %17, 0
  store ptr %18, ptr %3, align 8
  %19 = extractvalue { ptr, i32 } %17, 1
  store i32 %19, ptr %4, align 4
  %20 = icmp eq ptr %8, %11
  br i1 %20, label %25, label %21

21:                                               ; preds = %21, %16
  %22 = phi ptr [ %11, %16 ], [ %23, %21 ]
  %23 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %22, i64 -1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN7glslang14pool_allocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %23) #2
  %24 = icmp eq ptr %23, %8
  br i1 %24, label %25, label %21

25:                                               ; preds = %21, %16
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN7glslang14pool_allocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #2
  br label %26

26:                                               ; preds = %25
  %27 = load ptr, ptr %3, align 8
  %28 = load i32, ptr %4, align 4
  %29 = insertvalue { ptr, i32 } poison, ptr %27, 0
  %30 = insertvalue { ptr, i32 } %29, i32 %28, 1
  resume { ptr, i32 } %30
}

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

declare i32 @__gxx_personality_v0(...)

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

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 = { 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 = !{!"vtable pointer", !8, 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"

@_ZTVN7glslang18TBuiltInParseablesE = external dso_local unnamed_addr constant { [10 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7glslang18TBuiltInParseablesC2Ev(ptr noundef nonnull align 8 dereferenceable(608) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  store ptr getelementptr inbounds inrange(-16, 64) (i8, ptr @_ZTVN7glslang18TBuiltInParseablesE, i64 16), ptr %0, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN7glslang14pool_allocatorIcEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %2)
  %.ptr.ptr = getelementptr inbounds i8, ptr %0, i64 48
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN7glslang14pool_allocatorIcEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %.ptr.ptr)
          to label %3 unwind label %17

3:                                                ; preds = %1
  %.ptr.ptr.1 = getelementptr inbounds i8, ptr %0, i64 88
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN7glslang14pool_allocatorIcEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %.ptr.ptr.1)
          to label %4 unwind label %.preheader.preheader

4:                                                ; preds = %3
  %.ptr.ptr.2 = getelementptr inbounds i8, ptr %0, i64 128
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN7glslang14pool_allocatorIcEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %.ptr.ptr.2)
          to label %5 unwind label %.preheader.preheader

5:                                                ; preds = %4
  %.ptr.ptr.3 = getelementptr inbounds i8, ptr %0, i64 168
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN7glslang14pool_allocatorIcEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %.ptr.ptr.3)
          to label %6 unwind label %.preheader.preheader

6:                                                ; preds = %5
  %.ptr.ptr.4 = getelementptr inbounds i8, ptr %0, i64 208
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN7glslang14pool_allocatorIcEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %.ptr.ptr.4)
          to label %7 unwind label %.preheader.preheader

7:                                                ; preds = %6
  %.ptr.ptr.5 = getelementptr inbounds i8, ptr %0, i64 248
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN7glslang14pool_allocatorIcEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %.ptr.ptr.5)
          to label %8 unwind label %.preheader.preheader

8:                                                ; preds = %7
  %.ptr.ptr.6 = getelementptr inbounds i8, ptr %0, i64 288
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN7glslang14pool_allocatorIcEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %.ptr.ptr.6)
          to label %9 unwind label %.preheader.preheader

9:                                                ; preds = %8
  %.ptr.ptr.7 = getelementptr inbounds i8, ptr %0, i64 328
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN7glslang14pool_allocatorIcEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %.ptr.ptr.7)
          to label %10 unwind label %.preheader.preheader

10:                                               ; preds = %9
  %.ptr.ptr.8 = getelementptr inbounds i8, ptr %0, i64 368
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN7glslang14pool_allocatorIcEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %.ptr.ptr.8)
          to label %11 unwind label %.preheader.preheader

11:                                               ; preds = %10
  %.ptr.ptr.9 = getelementptr inbounds i8, ptr %0, i64 408
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN7glslang14pool_allocatorIcEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %.ptr.ptr.9)
          to label %12 unwind label %.preheader.preheader

12:                                               ; preds = %11
  %.ptr.ptr.10 = getelementptr inbounds i8, ptr %0, i64 448
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN7glslang14pool_allocatorIcEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %.ptr.ptr.10)
          to label %13 unwind label %.preheader.preheader

13:                                               ; preds = %12
  %.ptr.ptr.11 = getelementptr inbounds i8, ptr %0, i64 488
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN7glslang14pool_allocatorIcEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %.ptr.ptr.11)
          to label %14 unwind label %.preheader.preheader

14:                                               ; preds = %13
  %.ptr.ptr.12 = getelementptr inbounds i8, ptr %0, i64 528
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN7glslang14pool_allocatorIcEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %.ptr.ptr.12)
          to label %15 unwind label %.preheader.preheader

15:                                               ; preds = %14
  %.ptr.ptr.13 = getelementptr inbounds i8, ptr %0, i64 568
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN7glslang14pool_allocatorIcEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %.ptr.ptr.13)
          to label %16 unwind label %.preheader.preheader

16:                                               ; preds = %15
  ret void

17:                                               ; preds = %1
  %lpad.thr_comm.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.preheader.preheader:                             ; preds = %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14, %15
  %.idx.lcssa.ph = phi i64 [ 568, %15 ], [ 528, %14 ], [ 488, %13 ], [ 448, %12 ], [ 408, %11 ], [ 368, %10 ], [ 328, %9 ], [ 288, %8 ], [ 248, %7 ], [ 208, %6 ], [ 168, %5 ], [ 128, %4 ], [ 88, %3 ]
  %lpad.thr_comm = landingpad { ptr, i32 }
          cleanup
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %.idx5 = phi i64 [ %.add6, %.preheader ], [ %.idx.lcssa.ph, %.preheader.preheader ]
  %.add6 = add nsw i64 %.idx5, -40
  %.ptr8 = getelementptr inbounds i8, ptr %0, i64 %.add6
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN7glslang14pool_allocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %.ptr8) #2
  %18 = icmp eq i64 %.add6, 48
  br i1 %18, label %.loopexit, label %.preheader

.loopexit:                                        ; preds = %.preheader, %17
  %lpad.phi15 = phi { ptr, i32 } [ %lpad.thr_comm.split-lp, %17 ], [ %lpad.thr_comm, %.preheader ]
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN7glslang14pool_allocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %2) #2
  resume { ptr, i32 } %lpad.phi15
}

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

declare i32 @__gxx_personality_v0(...)

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

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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GVNPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass