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

; 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::TQualifier" = type <{ ptr, i64, i8, [3 x i8], i32, i32, i64, i64, i8, i8, i8, i8, i8, [3 x i8], i32, i8, [3 x i8], i32, ptr }>

@.str.2 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.516 = external hidden unnamed_addr constant [52 x i8], align 1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN7glslang25GetStorageQualifierStringENS_17TStorageQualifierE(i32 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7glslang13TParseContext20paramCheckFixStorageERKNS_10TSourceLocERKNS_17TStorageQualifierERNS_5TTypeE(ptr noundef nonnull align 8 dereferenceable(24912) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 8 dereferenceable(144) %3) #1 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  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
  store ptr %3, ptr %8, align 8, !tbaa !5
  %9 = load ptr, ptr %5, align 8
  %10 = load ptr, ptr %7, align 8, !tbaa !5
  %11 = load i32, ptr %10, align 4, !tbaa !9
  switch i32 %11, label %46 [
    i32 2, label %12
    i32 17, label %12
    i32 14, label %22
    i32 15, label %22
    i32 16, label %22
    i32 1, label %36
    i32 0, label %36
  ]

12:                                               ; preds = %4, %4
  %13 = load ptr, ptr %8, align 8, !tbaa !5
  %14 = load ptr, ptr %13, align 8, !tbaa !11
  %15 = getelementptr inbounds ptr, ptr %14, i64 10
  %16 = load ptr, ptr %15, align 8
  %17 = call noundef nonnull align 8 dereferenceable(72) ptr %16(ptr noundef nonnull align 8 dereferenceable(144) %13)
  %18 = getelementptr inbounds %"class.glslang::TQualifier", ptr %17, i32 0, i32 1
  %19 = load i64, ptr %18, align 8
  %20 = and i64 %19, -64
  %21 = or i64 %20, 17
  store i64 %21, ptr %18, align 8
  br label %63

22:                                               ; preds = %4, %4, %4
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = load i32, ptr %23, align 4, !tbaa !9
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = load ptr, ptr %25, align 8, !tbaa !11
  %27 = getelementptr inbounds ptr, ptr %26, i64 10
  %28 = load ptr, ptr %27, align 8
  %29 = call noundef nonnull align 8 dereferenceable(72) ptr %28(ptr noundef nonnull align 8 dereferenceable(144) %25)
  %30 = getelementptr inbounds %"class.glslang::TQualifier", ptr %29, i32 0, i32 1
  %31 = zext i32 %24 to i64
  %32 = load i64, ptr %30, align 8
  %33 = and i64 %31, 63
  %34 = and i64 %32, -64
  %35 = or i64 %34, %33
  store i64 %35, ptr %30, align 8
  br label %63

36:                                               ; preds = %4, %4
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = load ptr, ptr %37, align 8, !tbaa !11
  %39 = getelementptr inbounds ptr, ptr %38, i64 10
  %40 = load ptr, ptr %39, align 8
  %41 = call noundef nonnull align 8 dereferenceable(72) ptr %40(ptr noundef nonnull align 8 dereferenceable(144) %37)
  %42 = getelementptr inbounds %"class.glslang::TQualifier", ptr %41, i32 0, i32 1
  %43 = load i64, ptr %42, align 8
  %44 = and i64 %43, -64
  %45 = or i64 %44, 14
  store i64 %45, ptr %42, align 8
  br label %63

46:                                               ; preds = %4
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = load ptr, ptr %47, align 8, !tbaa !11
  %49 = getelementptr inbounds ptr, ptr %48, i64 10
  %50 = load ptr, ptr %49, align 8
  %51 = call noundef nonnull align 8 dereferenceable(72) ptr %50(ptr noundef nonnull align 8 dereferenceable(144) %47)
  %52 = getelementptr inbounds %"class.glslang::TQualifier", ptr %51, i32 0, i32 1
  %53 = load i64, ptr %52, align 8
  %54 = and i64 %53, -64
  %55 = or i64 %54, 14
  store i64 %55, ptr %52, align 8
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = load i32, ptr %57, align 4, !tbaa !9
  %59 = call noundef ptr @_ZN7glslang25GetStorageQualifierStringENS_17TStorageQualifierE(i32 noundef %58)
  %60 = load ptr, ptr %9, align 8, !tbaa !11
  %61 = getelementptr inbounds ptr, ptr %60, i64 42
  %62 = load ptr, ptr %61, align 8
  call void (ptr, ptr, ptr, ptr, ptr, ...) %62(ptr noundef nonnull align 8 dereferenceable(1176) %9, ptr noundef nonnull align 8 dereferenceable(24) %56, ptr noundef @.str.516, ptr noundef %59, ptr noundef @.str.2)
  br label %63

63:                                               ; preds = %46, %36, %22, %12
  ret void
}

attributes #0 = { 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 #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" }

!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 = !{!"_ZTSN7glslang17TStorageQualifierE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"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"

@.str.2 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.516 = external hidden unnamed_addr constant [52 x i8], align 1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN7glslang25GetStorageQualifierStringENS_17TStorageQualifierE(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7glslang13TParseContext20paramCheckFixStorageERKNS_10TSourceLocERKNS_17TStorageQualifierERNS_5TTypeE(ptr noundef nonnull align 8 dereferenceable(24912) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr nocapture noundef nonnull readonly align 4 dereferenceable(4) %2, ptr noundef nonnull align 8 dereferenceable(144) %3) local_unnamed_addr #1 align 2 {
  %5 = load i32, ptr %2, align 4, !tbaa !5
  switch i32 %5, label %34 [
    i32 2, label %6
    i32 17, label %6
    i32 14, label %15
    i32 15, label %15
    i32 16, label %15
    i32 1, label %25
    i32 0, label %25
  ]

6:                                                ; preds = %4, %4
  %7 = load ptr, ptr %3, align 8, !tbaa !9
  %8 = getelementptr inbounds i8, ptr %7, i64 80
  %9 = load ptr, ptr %8, align 8
  %10 = tail call noundef nonnull align 8 dereferenceable(72) ptr %9(ptr noundef nonnull align 8 dereferenceable(144) %3)
  %11 = getelementptr inbounds i8, ptr %10, i64 8
  %12 = load i64, ptr %11, align 8
  %13 = and i64 %12, -64
  %14 = or disjoint i64 %13, 17
  store i64 %14, ptr %11, align 8
  br label %48

15:                                               ; preds = %4, %4, %4
  %16 = load ptr, ptr %3, align 8, !tbaa !9
  %17 = getelementptr inbounds i8, ptr %16, i64 80
  %18 = load ptr, ptr %17, align 8
  %19 = tail call noundef nonnull align 8 dereferenceable(72) ptr %18(ptr noundef nonnull align 8 dereferenceable(144) %3)
  %20 = getelementptr inbounds i8, ptr %19, i64 8
  %21 = load i64, ptr %20, align 8
  %22 = zext nneg i32 %5 to i64
  %23 = and i64 %21, -64
  %24 = or disjoint i64 %23, %22
  store i64 %24, ptr %20, align 8
  br label %48

25:                                               ; preds = %4, %4
  %26 = load ptr, ptr %3, align 8, !tbaa !9
  %27 = getelementptr inbounds i8, ptr %26, i64 80
  %28 = load ptr, ptr %27, align 8
  %29 = tail call noundef nonnull align 8 dereferenceable(72) ptr %28(ptr noundef nonnull align 8 dereferenceable(144) %3)
  %30 = getelementptr inbounds i8, ptr %29, i64 8
  %31 = load i64, ptr %30, align 8
  %32 = and i64 %31, -64
  %33 = or disjoint i64 %32, 14
  store i64 %33, ptr %30, align 8
  br label %48

34:                                               ; preds = %4
  %35 = load ptr, ptr %3, align 8, !tbaa !9
  %36 = getelementptr inbounds i8, ptr %35, i64 80
  %37 = load ptr, ptr %36, align 8
  %38 = tail call noundef nonnull align 8 dereferenceable(72) ptr %37(ptr noundef nonnull align 8 dereferenceable(144) %3)
  %39 = getelementptr inbounds i8, ptr %38, i64 8
  %40 = load i64, ptr %39, align 8
  %41 = and i64 %40, -64
  %42 = or disjoint i64 %41, 14
  store i64 %42, ptr %39, align 8
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = tail call noundef ptr @_ZN7glslang25GetStorageQualifierStringENS_17TStorageQualifierE(i32 noundef %43)
  %45 = load ptr, ptr %0, align 8, !tbaa !9
  %46 = getelementptr inbounds i8, ptr %45, i64 336
  %47 = load ptr, ptr %46, align 8
  tail call void (ptr, ptr, ptr, ptr, ptr, ...) %47(ptr noundef nonnull align 8 dereferenceable(1176) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull @.str.516, ptr noundef %44, ptr noundef nonnull @.str.2)
  br label %48

48:                                               ; preds = %34, %25, %15, %6
  ret void
}

attributes #0 = { 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 #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" }

!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 = !{!"_ZTSN7glslang17TStorageQualifierE", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,TailCallElimPass