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

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

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

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

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

; 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 zeroext i1 @_ZN7glslang13TInputScanner14consumeCommentEv(ptr noundef nonnull align 8 dereferenceable(90) %0) #2 align 2 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %6 = load ptr, ptr %3, align 8
  %7 = call noundef i32 @_ZN7glslang13TInputScanner4peekEv(ptr noundef nonnull align 8 dereferenceable(90) %6)
  %8 = icmp ne i32 %7, 47
  br i1 %8, label %9, label %10

9:                                                ; preds = %1
  store i1 false, ptr %2, align 1
  br label %106

10:                                               ; preds = %1
  %11 = call noundef i32 @_ZN7glslang13TInputScanner3getEv(ptr noundef nonnull align 8 dereferenceable(90) %6)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %12 = call noundef i32 @_ZN7glslang13TInputScanner4peekEv(ptr noundef nonnull align 8 dereferenceable(90) %6)
  store i32 %12, ptr %4, align 4, !tbaa !9
  %13 = load i32, ptr %4, align 4, !tbaa !9
  %14 = icmp eq i32 %13, 47
  br i1 %14, label %15, label %74

15:                                               ; preds = %10
  %16 = call noundef i32 @_ZN7glslang13TInputScanner3getEv(ptr noundef nonnull align 8 dereferenceable(90) %6)
  %17 = call noundef i32 @_ZN7glslang13TInputScanner3getEv(ptr noundef nonnull align 8 dereferenceable(90) %6)
  store i32 %17, ptr %4, align 4, !tbaa !9
  br label %18

18:                                               ; preds = %68, %15
  br label %19

19:                                               ; preds = %33, %18
  %20 = load i32, ptr %4, align 4, !tbaa !9
  %21 = icmp ne i32 %20, -1
  br i1 %21, label %22, label %31

22:                                               ; preds = %19
  %23 = load i32, ptr %4, align 4, !tbaa !9
  %24 = icmp ne i32 %23, 92
  br i1 %24, label %25, label %31

25:                                               ; preds = %22
  %26 = load i32, ptr %4, align 4, !tbaa !9
  %27 = icmp ne i32 %26, 13
  br i1 %27, label %28, label %31

28:                                               ; preds = %25
  %29 = load i32, ptr %4, align 4, !tbaa !9
  %30 = icmp ne i32 %29, 10
  br label %31

31:                                               ; preds = %28, %25, %22, %19
  %32 = phi i1 [ false, %25 ], [ false, %22 ], [ false, %19 ], [ %30, %28 ]
  br i1 %32, label %33, label %35

33:                                               ; preds = %31
  %34 = call noundef i32 @_ZN7glslang13TInputScanner3getEv(ptr noundef nonnull align 8 dereferenceable(90) %6)
  store i32 %34, ptr %4, align 4, !tbaa !9
  br label %19, !llvm.loop !11

35:                                               ; preds = %31
  %36 = load i32, ptr %4, align 4, !tbaa !9
  %37 = icmp eq i32 %36, -1
  br i1 %37, label %44, label %38

38:                                               ; preds = %35
  %39 = load i32, ptr %4, align 4, !tbaa !9
  %40 = icmp eq i32 %39, 13
  br i1 %40, label %44, label %41

41:                                               ; preds = %38
  %42 = load i32, ptr %4, align 4, !tbaa !9
  %43 = icmp eq i32 %42, 10
  br i1 %43, label %44, label %56

44:                                               ; preds = %41, %38, %35
  br label %45

45:                                               ; preds = %53, %44
  %46 = load i32, ptr %4, align 4, !tbaa !9
  %47 = icmp eq i32 %46, 13
  br i1 %47, label %51, label %48

48:                                               ; preds = %45
  %49 = load i32, ptr %4, align 4, !tbaa !9
  %50 = icmp eq i32 %49, 10
  br label %51

51:                                               ; preds = %48, %45
  %52 = phi i1 [ true, %45 ], [ %50, %48 ]
  br i1 %52, label %53, label %55

53:                                               ; preds = %51
  %54 = call noundef i32 @_ZN7glslang13TInputScanner3getEv(ptr noundef nonnull align 8 dereferenceable(90) %6)
  store i32 %54, ptr %4, align 4, !tbaa !9
  br label %45, !llvm.loop !13

55:                                               ; preds = %51
  br label %69

56:                                               ; preds = %41
  %57 = call noundef i32 @_ZN7glslang13TInputScanner3getEv(ptr noundef nonnull align 8 dereferenceable(90) %6)
  store i32 %57, ptr %4, align 4, !tbaa !9
  %58 = load i32, ptr %4, align 4, !tbaa !9
  %59 = icmp eq i32 %58, 13
  br i1 %59, label %60, label %65

60:                                               ; preds = %56
  %61 = call noundef i32 @_ZN7glslang13TInputScanner4peekEv(ptr noundef nonnull align 8 dereferenceable(90) %6)
  %62 = icmp eq i32 %61, 10
  br i1 %62, label %63, label %65

63:                                               ; preds = %60
  %64 = call noundef i32 @_ZN7glslang13TInputScanner3getEv(ptr noundef nonnull align 8 dereferenceable(90) %6)
  br label %65

65:                                               ; preds = %63, %60, %56
  %66 = call noundef i32 @_ZN7glslang13TInputScanner3getEv(ptr noundef nonnull align 8 dereferenceable(90) %6)
  store i32 %66, ptr %4, align 4, !tbaa !9
  br label %67

67:                                               ; preds = %65
  br label %68

68:                                               ; preds = %67
  br i1 true, label %18, label %69, !llvm.loop !14

69:                                               ; preds = %68, %55
  %70 = load i32, ptr %4, align 4, !tbaa !9
  %71 = icmp ne i32 %70, -1
  br i1 %71, label %72, label %73

72:                                               ; preds = %69
  call void @_ZN7glslang13TInputScanner5ungetEv(ptr noundef nonnull align 8 dereferenceable(90) %6)
  br label %73

73:                                               ; preds = %72, %69
  store i1 true, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %105

74:                                               ; preds = %10
  %75 = load i32, ptr %4, align 4, !tbaa !9
  %76 = icmp eq i32 %75, 42
  br i1 %76, label %77, label %104

77:                                               ; preds = %74
  %78 = call noundef i32 @_ZN7glslang13TInputScanner3getEv(ptr noundef nonnull align 8 dereferenceable(90) %6)
  %79 = call noundef i32 @_ZN7glslang13TInputScanner3getEv(ptr noundef nonnull align 8 dereferenceable(90) %6)
  store i32 %79, ptr %4, align 4, !tbaa !9
  br label %80

80:                                               ; preds = %102, %77
  br label %81

81:                                               ; preds = %89, %80
  %82 = load i32, ptr %4, align 4, !tbaa !9
  %83 = icmp ne i32 %82, -1
  br i1 %83, label %84, label %87

84:                                               ; preds = %81
  %85 = load i32, ptr %4, align 4, !tbaa !9
  %86 = icmp ne i32 %85, 42
  br label %87

87:                                               ; preds = %84, %81
  %88 = phi i1 [ false, %81 ], [ %86, %84 ]
  br i1 %88, label %89, label %91

89:                                               ; preds = %87
  %90 = call noundef i32 @_ZN7glslang13TInputScanner3getEv(ptr noundef nonnull align 8 dereferenceable(90) %6)
  store i32 %90, ptr %4, align 4, !tbaa !9
  br label %81, !llvm.loop !15

91:                                               ; preds = %87
  %92 = load i32, ptr %4, align 4, !tbaa !9
  %93 = icmp eq i32 %92, 42
  br i1 %93, label %94, label %100

94:                                               ; preds = %91
  %95 = call noundef i32 @_ZN7glslang13TInputScanner3getEv(ptr noundef nonnull align 8 dereferenceable(90) %6)
  store i32 %95, ptr %4, align 4, !tbaa !9
  %96 = load i32, ptr %4, align 4, !tbaa !9
  %97 = icmp eq i32 %96, 47
  br i1 %97, label %98, label %99

98:                                               ; preds = %94
  br label %103

99:                                               ; preds = %94
  br label %101

100:                                              ; preds = %91
  br label %103

101:                                              ; preds = %99
  br label %102

102:                                              ; preds = %101
  br i1 true, label %80, label %103, !llvm.loop !16

103:                                              ; preds = %102, %100, %98
  store i1 true, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %105

104:                                              ; preds = %74
  call void @_ZN7glslang13TInputScanner5ungetEv(ptr noundef nonnull align 8 dereferenceable(90) %6)
  store i1 false, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %105

105:                                              ; preds = %104, %103, %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %106

106:                                              ; preds = %105, %9
  %107 = load i1, ptr %2, align 1
  ret i1 %107
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7glslang13TInputScanner5ungetEv(ptr noundef nonnull align 8 dereferenceable(90)) #1 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 = { 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 #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 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


; 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 nounwind uwtable
declare dso_local noundef i32 @_ZN7glslang13TInputScanner4peekEv(ptr noundef nonnull align 8 dereferenceable(90)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7glslang13TInputScanner14consumeCommentEv(ptr noundef nonnull align 8 dereferenceable(90) %0) local_unnamed_addr #1 align 2 {
  %2 = tail call noundef i32 @_ZN7glslang13TInputScanner4peekEv(ptr noundef nonnull align 8 dereferenceable(90) %0)
  %.not = icmp eq i32 %2, 47
  br i1 %.not, label %3, label %.loopexit

3:                                                ; preds = %1
  %4 = tail call noundef i32 @_ZN7glslang13TInputScanner3getEv(ptr noundef nonnull align 8 dereferenceable(90) %0)
  %5 = tail call noundef i32 @_ZN7glslang13TInputScanner4peekEv(ptr noundef nonnull align 8 dereferenceable(90) %0)
  switch i32 %5, label %.loopexit.sink.split [
    i32 47, label %.sink.split44
    i32 42, label %17
  ]

.sink.split44:                                    ; preds = %14, %3
  %6 = tail call noundef i32 @_ZN7glslang13TInputScanner3getEv(ptr noundef nonnull align 8 dereferenceable(90) %0)
  br label %7

7:                                                ; preds = %.backedge, %.sink.split44
  %8 = tail call noundef i32 @_ZN7glslang13TInputScanner3getEv(ptr noundef nonnull align 8 dereferenceable(90) %0)
  switch i32 %8, label %.backedge [
    i32 -1, label %.preheader.preheader
    i32 13, label %.preheader.preheader
    i32 10, label %.preheader.preheader
    i32 92, label %11
  ]

.backedge:                                        ; preds = %7, %14, %11
  br label %7, !llvm.loop !5

.preheader.preheader:                             ; preds = %7, %7, %7
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %9
  %.2 = phi i32 [ %10, %9 ], [ %8, %.preheader.preheader ]
  switch i32 %.2, label %.loopexit.sink.split [
    i32 13, label %9
    i32 10, label %9
    i32 -1, label %.loopexit
  ]

9:                                                ; preds = %.preheader, %.preheader
  %10 = tail call noundef i32 @_ZN7glslang13TInputScanner3getEv(ptr noundef nonnull align 8 dereferenceable(90) %0)
  br label %.preheader, !llvm.loop !7

11:                                               ; preds = %7
  %12 = tail call noundef i32 @_ZN7glslang13TInputScanner3getEv(ptr noundef nonnull align 8 dereferenceable(90) %0)
  %13 = icmp eq i32 %12, 13
  br i1 %13, label %14, label %.backedge

14:                                               ; preds = %11
  %15 = tail call noundef i32 @_ZN7glslang13TInputScanner4peekEv(ptr noundef nonnull align 8 dereferenceable(90) %0)
  %16 = icmp eq i32 %15, 10
  br i1 %16, label %.sink.split44, label %.backedge, !llvm.loop !5

17:                                               ; preds = %3
  %18 = tail call noundef i32 @_ZN7glslang13TInputScanner3getEv(ptr noundef nonnull align 8 dereferenceable(90) %0)
  br label %.sink.split

.sink.split:                                      ; preds = %20, %17
  %19 = tail call noundef i32 @_ZN7glslang13TInputScanner3getEv(ptr noundef nonnull align 8 dereferenceable(90) %0)
  br label %20

20:                                               ; preds = %.sink.split, %21
  %.4 = phi i32 [ %22, %21 ], [ %19, %.sink.split ]
  switch i32 %.4, label %.sink.split [
    i32 42, label %21
    i32 -1, label %.loopexit
  ], !llvm.loop !8

21:                                               ; preds = %20
  %22 = tail call noundef i32 @_ZN7glslang13TInputScanner3getEv(ptr noundef nonnull align 8 dereferenceable(90) %0)
  %23 = icmp eq i32 %22, 47
  br i1 %23, label %.loopexit, label %20, !llvm.loop !9

.loopexit.sink.split:                             ; preds = %.preheader, %3
  %.128.ph = phi i1 [ false, %3 ], [ true, %.preheader ]
  tail call void @_ZN7glslang13TInputScanner5ungetEv(ptr noundef nonnull align 8 dereferenceable(90) %0)
  br label %.loopexit

.loopexit:                                        ; preds = %21, %20, %.preheader, %.loopexit.sink.split, %1
  %.128 = phi i1 [ false, %1 ], [ %.128.ph, %.loopexit.sink.split ], [ true, %.preheader ], [ true, %20 ], [ true, %21 ]
  ret i1 %.128
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7glslang13TInputScanner5ungetEv(ptr noundef nonnull align 8 dereferenceable(90)) local_unnamed_addr #0 align 2

attributes #0 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6}
!9 = distinct !{!9, !6}


; Effective O3 passes: GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass