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

; 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
declare dso_local noundef ptr @_ZNK7glslang5TType9getStructEv(ptr noundef nonnull align 8 dereferenceable(144)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK7glslang20TIntermConstantUnion13getConstArrayEv(ptr noundef nonnull align 8 dereferenceable(193)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(12) ptr @_ZNK7glslang16TConstUnionArrayixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7glslang11TConstUnion9getIConstEv(ptr noundef nonnull align 8 dereferenceable(12)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK7glslang12TIntermTyped11isReferenceEv(ptr noundef nonnull align 8 dereferenceable(176)) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7glslang15TIntermOperator5getOpEv(ptr noundef nonnull align 8 dereferenceable(184)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK7glslang13TParseContext15isRuntimeLengthERKNS_12TIntermTypedE(ptr noundef nonnull align 8 dereferenceable(24912) %0, ptr noundef nonnull align 8 dereferenceable(176) %1) #1 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %10 = load ptr, ptr %4, align 8
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = getelementptr inbounds ptr, ptr %12, i64 30
  %14 = load ptr, ptr %13, align 8
  %15 = call noundef nonnull align 8 dereferenceable(144) ptr %14(ptr noundef nonnull align 8 dereferenceable(176) %11)
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = getelementptr inbounds ptr, ptr %16, i64 11
  %18 = load ptr, ptr %17, align 8
  %19 = call noundef nonnull align 8 dereferenceable(72) ptr %18(ptr noundef nonnull align 8 dereferenceable(144) %15)
  %20 = getelementptr inbounds %"class.glslang::TQualifier", ptr %19, i32 0, i32 1
  %21 = load i64, ptr %20, align 8
  %22 = and i64 %21, 63
  %23 = trunc i64 %22 to i32
  %24 = icmp eq i32 %23, 6
  br i1 %24, label %25, label %84

25:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = getelementptr inbounds ptr, ptr %27, i64 20
  %29 = load ptr, ptr %28, align 8
  %30 = call noundef ptr %29(ptr noundef nonnull align 8 dereferenceable(32) %26)
  store ptr %30, ptr %6, align 8, !tbaa !5
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %33, label %80

33:                                               ; preds = %25
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = call noundef i32 @_ZNK7glslang15TIntermOperator5getOpEv(ptr noundef nonnull align 8 dereferenceable(184) %34)
  %36 = icmp eq i32 %35, 182
  br i1 %36, label %37, label %80

37:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  %40 = getelementptr inbounds ptr, ptr %39, i64 51
  %41 = load ptr, ptr %40, align 8
  %42 = call noundef ptr %41(ptr noundef nonnull align 8 dereferenceable(200) %38)
  %43 = load ptr, ptr %42, align 8, !tbaa !9
  %44 = getelementptr inbounds ptr, ptr %43, i64 5
  %45 = load ptr, ptr %44, align 8
  %46 = call noundef ptr %45(ptr noundef nonnull align 8 dereferenceable(32) %42)
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK7glslang20TIntermConstantUnion13getConstArrayEv(ptr noundef nonnull align 8 dereferenceable(193) %46)
  %48 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNK7glslang16TConstUnionArrayixEm(ptr noundef nonnull align 8 dereferenceable(16) %47, i64 noundef 0)
  %49 = call noundef i32 @_ZNK7glslang11TConstUnion9getIConstEv(ptr noundef nonnull align 8 dereferenceable(12) %48)
  store i32 %49, ptr %7, align 4, !tbaa !11
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = load ptr, ptr %50, align 8, !tbaa !9
  %52 = getelementptr inbounds ptr, ptr %51, i64 50
  %53 = load ptr, ptr %52, align 8
  %54 = call noundef ptr %53(ptr noundef nonnull align 8 dereferenceable(200) %50)
  %55 = call noundef zeroext i1 @_ZNK7glslang12TIntermTyped11isReferenceEv(ptr noundef nonnull align 8 dereferenceable(176) %54)
  br i1 %55, label %56, label %57

56:                                               ; preds = %37
  store i1 false, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %77

57:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = load ptr, ptr %58, align 8, !tbaa !9
  %60 = getelementptr inbounds ptr, ptr %59, i64 50
  %61 = load ptr, ptr %60, align 8
  %62 = call noundef ptr %61(ptr noundef nonnull align 8 dereferenceable(200) %58)
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  %64 = getelementptr inbounds ptr, ptr %63, i64 30
  %65 = load ptr, ptr %64, align 8
  %66 = call noundef nonnull align 8 dereferenceable(144) ptr %65(ptr noundef nonnull align 8 dereferenceable(176) %62)
  %67 = call noundef ptr @_ZNK7glslang5TType9getStructEv(ptr noundef nonnull align 8 dereferenceable(144) %66)
  %68 = call noundef i64 @_ZNKSt6vectorIN7glslang8TTypeLocENS0_14pool_allocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %67) #3
  %69 = trunc i64 %68 to i32
  store i32 %69, ptr %9, align 4, !tbaa !11
  %70 = load i32, ptr %7, align 4, !tbaa !11
  %71 = load i32, ptr %9, align 4, !tbaa !11
  %72 = sub nsw i32 %71, 1
  %73 = icmp eq i32 %70, %72
  br i1 %73, label %74, label %75

74:                                               ; preds = %57
  store i1 true, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %76

75:                                               ; preds = %57
  store i32 0, ptr %8, align 4
  br label %76

76:                                               ; preds = %75, %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %77

77:                                               ; preds = %76, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  %78 = load i32, ptr %8, align 4
  switch i32 %78, label %81 [
    i32 0, label %79
  ]

79:                                               ; preds = %77
  br label %80

80:                                               ; preds = %79, %33, %25
  store i32 0, ptr %8, align 4
  br label %81

81:                                               ; preds = %80, %77
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %82 = load i32, ptr %8, align 4
  switch i32 %82, label %87 [
    i32 0, label %83
    i32 1, label %85
  ]

83:                                               ; preds = %81
  br label %84

84:                                               ; preds = %83, %2
  store i1 false, ptr %3, align 1
  br label %85

85:                                               ; preds = %84, %81
  %86 = load i1, ptr %3, align 1
  ret i1 %86

87:                                               ; preds = %81
  unreachable
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK7glslang20TIntermConstantUnion13getConstArrayEv(ptr noundef nonnull align 8 dereferenceable(193)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7glslang11TConstUnion9getIConstEv(ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK7glslang12TIntermTyped11isReferenceEv(ptr noundef nonnull align 8 dereferenceable(176)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7glslang15TIntermOperator5getOpEv(ptr noundef nonnull align 8 dereferenceable(184)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK7glslang13TParseContext15isRuntimeLengthERKNS_12TIntermTypedE(ptr nocapture noundef nonnull readnone align 8 dereferenceable(24912) %0, ptr noundef nonnull align 8 dereferenceable(176) %1) local_unnamed_addr #0 align 2 {
  %3 = load ptr, ptr %1, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 240
  %5 = load ptr, ptr %4, align 8
  %6 = tail call noundef nonnull align 8 dereferenceable(144) ptr %5(ptr noundef nonnull align 8 dereferenceable(176) %1)
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %7, i64 88
  %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) %6)
  %11 = getelementptr inbounds i8, ptr %10, i64 8
  %12 = load i64, ptr %11, align 8
  %13 = and i64 %12, 63
  %14 = icmp eq i64 %13, 6
  br i1 %14, label %15, label %.thread

15:                                               ; preds = %2
  %16 = load ptr, ptr %1, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %16, i64 160
  %18 = load ptr, ptr %17, align 8
  %19 = tail call noundef ptr %18(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %.not = icmp eq ptr %19, null
  br i1 %.not, label %.thread19, label %20

20:                                               ; preds = %15
  %21 = tail call noundef i32 @_ZNK7glslang15TIntermOperator5getOpEv(ptr noundef nonnull align 8 dereferenceable(184) %19)
  %22 = icmp eq i32 %21, 182
  br i1 %22, label %23, label %.thread19

23:                                               ; preds = %20
  %24 = load ptr, ptr %19, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %24, i64 408
  %26 = load ptr, ptr %25, align 8
  %27 = tail call noundef ptr %26(ptr noundef nonnull align 8 dereferenceable(200) %19)
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %28, i64 40
  %30 = load ptr, ptr %29, align 8
  %31 = tail call noundef ptr %30(ptr noundef nonnull align 8 dereferenceable(32) %27)
  %32 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK7glslang20TIntermConstantUnion13getConstArrayEv(ptr noundef nonnull align 8 dereferenceable(193) %31)
  %33 = tail call noundef nonnull align 8 dereferenceable(12) ptr @_ZNK7glslang16TConstUnionArrayixEm(ptr noundef nonnull align 8 dereferenceable(16) %32, i64 noundef 0)
  %34 = tail call noundef i32 @_ZNK7glslang11TConstUnion9getIConstEv(ptr noundef nonnull align 8 dereferenceable(12) %33)
  %35 = load ptr, ptr %19, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %35, i64 400
  %37 = load ptr, ptr %36, align 8
  %38 = tail call noundef ptr %37(ptr noundef nonnull align 8 dereferenceable(200) %19)
  %39 = tail call noundef zeroext i1 @_ZNK7glslang12TIntermTyped11isReferenceEv(ptr noundef nonnull align 8 dereferenceable(176) %38)
  br i1 %39, label %.thread, label %40

40:                                               ; preds = %23
  %41 = load ptr, ptr %19, align 8, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %41, i64 400
  %43 = load ptr, ptr %42, align 8
  %44 = tail call noundef ptr %43(ptr noundef nonnull align 8 dereferenceable(200) %19)
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %45, i64 240
  %47 = load ptr, ptr %46, align 8
  %48 = tail call noundef nonnull align 8 dereferenceable(144) ptr %47(ptr noundef nonnull align 8 dereferenceable(176) %44)
  %49 = tail call noundef ptr @_ZNK7glslang5TType9getStructEv(ptr noundef nonnull align 8 dereferenceable(144) %48)
  %50 = tail call noundef i64 @_ZNKSt6vectorIN7glslang8TTypeLocENS0_14pool_allocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %49) #2
  %51 = trunc i64 %50 to i32
  %52 = add i32 %51, -1
  %.not23 = icmp eq i32 %34, %52
  br i1 %.not23, label %.thread, label %.thread19

.thread19:                                        ; preds = %20, %15, %40
  br label %.thread

.thread:                                          ; preds = %23, %2, %.thread19, %40
  %.4 = phi i1 [ true, %40 ], [ false, %.thread19 ], [ false, %2 ], [ false, %23 ]
  ret i1 %.4
}

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: CorrelatedValuePropagationPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass