; LLVM IR from nragland37/cpp-projects :: data_structures-I/08-Queue (main)

; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%class.Queue = type <{ ptr, ptr, i32, [4 x i8] }>

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %class.Queue, align 8
  %3 = alloca i16, align 2
  %4 = alloca i8, align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr %2) #6
  call void @_ZN5QueueIsEC2Ev(ptr noundef nonnull align 8 dereferenceable(20) %2)
  call void @llvm.lifetime.start.p0(i64 2, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #6
  invoke void @_Z10checkStateR5QueueIsE(ptr noundef nonnull align 8 dereferenceable(20) %2)
          to label %9 unwind label %14

9:                                                ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %44, %9
  %11 = load i32, ptr %7, align 4, !tbaa !5
  %12 = icmp slt i32 %11, 10
  br i1 %12, label %18, label %13

13:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %47

14:                                               ; preds = %47, %0
  %15 = landingpad { ptr, i32 }
          cleanup
  %16 = extractvalue { ptr, i32 } %15, 0
  store ptr %16, ptr %5, align 8
  %17 = extractvalue { ptr, i32 } %15, 1
  store i32 %17, ptr %6, align 4
  br label %81

18:                                               ; preds = %10
  %19 = load i32, ptr %7, align 4, !tbaa !5
  %20 = add nsw i32 %19, 1
  %21 = mul nsw i32 10, %20
  %22 = trunc i32 %21 to i16
  store i16 %22, ptr %3, align 2, !tbaa !9
  %23 = invoke noundef zeroext i1 @_ZN5QueueIsE7enqueueERKs(ptr noundef nonnull align 8 dereferenceable(20) %2, ptr noundef nonnull align 2 dereferenceable(2) %3)
          to label %24 unwind label %36

24:                                               ; preds = %18
  %25 = zext i1 %23 to i8
  store i8 %25, ptr %4, align 1, !tbaa !11
  %26 = load i8, ptr %4, align 1, !tbaa !11, !range !13, !noundef !14
  %27 = trunc i8 %26 to i1
  br i1 %27, label %28, label %40

28:                                               ; preds = %24
  %29 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %30 unwind label %36

30:                                               ; preds = %28
  %31 = load i16, ptr %3, align 2, !tbaa !9
  %32 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %29, i16 noundef signext %31)
          to label %33 unwind label %36

33:                                               ; preds = %30
  %34 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %35 unwind label %36

35:                                               ; preds = %33
  br label %40

36:                                               ; preds = %40, %33, %30, %28, %18
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %5, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %81

40:                                               ; preds = %35, %24
  %41 = load i8, ptr %4, align 1, !tbaa !11, !range !13, !noundef !14
  %42 = trunc i8 %41 to i1
  invoke void @_Z12displayQueuebR5QueueIsE(i1 noundef zeroext %42, ptr noundef nonnull align 8 dereferenceable(20) %2)
          to label %43 unwind label %36

43:                                               ; preds = %40
  br label %44

44:                                               ; preds = %43
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %7, align 4, !tbaa !5
  br label %10, !llvm.loop !15

47:                                               ; preds = %13
  %48 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %49 unwind label %14

49:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %76, %49
  %51 = load i32, ptr %8, align 4, !tbaa !5
  %52 = icmp slt i32 %51, 10
  br i1 %52, label %54, label %53

53:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %79

54:                                               ; preds = %50
  %55 = invoke noundef zeroext i1 @_ZN5QueueIsE7dequeueERs(ptr noundef nonnull align 8 dereferenceable(20) %2, ptr noundef nonnull align 2 dereferenceable(2) %3)
          to label %56 unwind label %68

56:                                               ; preds = %54
  %57 = zext i1 %55 to i8
  store i8 %57, ptr %4, align 1, !tbaa !11
  %58 = load i8, ptr %4, align 1, !tbaa !11, !range !13, !noundef !14
  %59 = trunc i8 %58 to i1
  br i1 %59, label %60, label %72

60:                                               ; preds = %56
  %61 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
          to label %62 unwind label %68

62:                                               ; preds = %60
  %63 = load i16, ptr %3, align 2, !tbaa !9
  %64 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %61, i16 noundef signext %63)
          to label %65 unwind label %68

65:                                               ; preds = %62
  %66 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %67 unwind label %68

67:                                               ; preds = %65
  br label %72

68:                                               ; preds = %72, %65, %62, %60, %54
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %5, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %81

72:                                               ; preds = %67, %56
  %73 = load i8, ptr %4, align 1, !tbaa !11, !range !13, !noundef !14
  %74 = trunc i8 %73 to i1
  invoke void @_Z12displayQueuebR5QueueIsE(i1 noundef zeroext %74, ptr noundef nonnull align 8 dereferenceable(20) %2)
          to label %75 unwind label %68

75:                                               ; preds = %72
  br label %76

76:                                               ; preds = %75
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %8, align 4, !tbaa !5
  br label %50, !llvm.loop !17

79:                                               ; preds = %53
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %3) #6
  call void @_ZN5QueueIsED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #6
  %80 = load i32, ptr %1, align 4
  ret i32 %80

81:                                               ; preds = %68, %36, %14
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %3) #6
  call void @_ZN5QueueIsED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #6
  br label %82

82:                                               ; preds = %81
  %83 = load ptr, ptr %5, align 8
  %84 = load i32, ptr %6, align 4
  %85 = insertvalue { ptr, i32 } poison, ptr %83, 0
  %86 = insertvalue { ptr, i32 } %85, i32 %84, 1
  resume { ptr, i32 } %86
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10checkStateR5QueueIsE(ptr noundef nonnull align 8 dereferenceable(20)) #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN5QueueIsE7enqueueERKs(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef nonnull align 2 dereferenceable(2)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8), i16 noundef signext) #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12displayQueuebR5QueueIsE(i1 noundef zeroext, ptr noundef nonnull align 8 dereferenceable(20)) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5QueueIsE7dequeueERs(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef nonnull align 2 dereferenceable(2)) #2 align 2

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

attributes #0 = { mustprogress norecurse 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { inlinehint 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 #5 = { "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 #6 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%class.Queue = type <{ ptr, ptr, i32, [4 x i8] }>

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %class.Queue, align 8
  %2 = alloca i16, align 2
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #6
  call void @_ZN5QueueIsEC2Ev(ptr noundef nonnull align 8 dereferenceable(20) %1)
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %2) #6
  invoke void @_Z10checkStateR5QueueIsE(ptr noundef nonnull align 8 dereferenceable(20) %1)
          to label %.preheader15 unwind label %6

.preheader15:                                     ; preds = %0, %23
  %.011 = phi i32 [ %9, %23 ], [ 0, %0 ]
  %exitcond.not = icmp eq i32 %.011, 10
  br i1 %exitcond.not, label %3, label %8

3:                                                ; preds = %.preheader15
  %4 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %.preheader.preheader unwind label %6

.preheader.preheader:                             ; preds = %3
  %5 = call noundef zeroext i1 @_ZN5QueueIsE7dequeueERs(ptr noundef nonnull align 8 dereferenceable(20) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
  br i1 %5, label %24, label %33

6:                                                ; preds = %3, %0
  %7 = landingpad { ptr, i32 }
          cleanup
  br label %116

8:                                                ; preds = %.preheader15
  %9 = add nuw nsw i32 %.011, 1
  %10 = trunc nuw i32 %9 to i16
  %11 = mul nuw nsw i16 %10, 10
  store i16 %11, ptr %2, align 2, !tbaa !5
  %12 = invoke noundef zeroext i1 @_ZN5QueueIsE7enqueueERKs(ptr noundef nonnull align 8 dereferenceable(20) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
          to label %13 unwind label %21

13:                                               ; preds = %8
  br i1 %12, label %14, label %23

14:                                               ; preds = %13
  %15 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
          to label %16 unwind label %21

16:                                               ; preds = %14
  %17 = load i16, ptr %2, align 2, !tbaa !5
  %18 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %15, i16 noundef signext %17)
          to label %19 unwind label %21

19:                                               ; preds = %16
  %20 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %23 unwind label %21

21:                                               ; preds = %23, %19, %16, %14, %8
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %116

23:                                               ; preds = %19, %13
  invoke void @_Z12displayQueuebR5QueueIsE(i1 noundef zeroext %12, ptr noundef nonnull align 8 dereferenceable(20) %1)
          to label %.preheader15 unwind label %21, !llvm.loop !9

24:                                               ; preds = %.preheader.preheader
  %25 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %26 unwind label %31

26:                                               ; preds = %24
  %27 = load i16, ptr %2, align 2, !tbaa !5
  %28 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %25, i16 noundef signext %27)
          to label %29 unwind label %31

29:                                               ; preds = %26
  %30 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %33 unwind label %31

31:                                               ; preds = %114, %112, %109, %107, %105, %103, %100, %98, %96, %94, %91, %89, %87, %85, %82, %80, %78, %76, %73, %71, %69, %67, %64, %62, %60, %58, %55, %53, %51, %49, %46, %44, %42, %40, %37, %35, %33, %29, %26, %24
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %116

33:                                               ; preds = %29, %.preheader.preheader
  invoke void @_Z12displayQueuebR5QueueIsE(i1 noundef zeroext %5, ptr noundef nonnull align 8 dereferenceable(20) %1)
          to label %.preheader.1 unwind label %31

.preheader.1:                                     ; preds = %33
  %34 = call noundef zeroext i1 @_ZN5QueueIsE7dequeueERs(ptr noundef nonnull align 8 dereferenceable(20) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
  br i1 %34, label %35, label %42

35:                                               ; preds = %.preheader.1
  %36 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %37 unwind label %31

37:                                               ; preds = %35
  %38 = load i16, ptr %2, align 2, !tbaa !5
  %39 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %36, i16 noundef signext %38)
          to label %40 unwind label %31

40:                                               ; preds = %37
  %41 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %42 unwind label %31

42:                                               ; preds = %40, %.preheader.1
  invoke void @_Z12displayQueuebR5QueueIsE(i1 noundef zeroext %34, ptr noundef nonnull align 8 dereferenceable(20) %1)
          to label %.preheader.2 unwind label %31

.preheader.2:                                     ; preds = %42
  %43 = call noundef zeroext i1 @_ZN5QueueIsE7dequeueERs(ptr noundef nonnull align 8 dereferenceable(20) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
  br i1 %43, label %44, label %51

44:                                               ; preds = %.preheader.2
  %45 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %46 unwind label %31

46:                                               ; preds = %44
  %47 = load i16, ptr %2, align 2, !tbaa !5
  %48 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %45, i16 noundef signext %47)
          to label %49 unwind label %31

49:                                               ; preds = %46
  %50 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %51 unwind label %31

51:                                               ; preds = %49, %.preheader.2
  invoke void @_Z12displayQueuebR5QueueIsE(i1 noundef zeroext %43, ptr noundef nonnull align 8 dereferenceable(20) %1)
          to label %.preheader.3 unwind label %31

.preheader.3:                                     ; preds = %51
  %52 = call noundef zeroext i1 @_ZN5QueueIsE7dequeueERs(ptr noundef nonnull align 8 dereferenceable(20) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
  br i1 %52, label %53, label %60

53:                                               ; preds = %.preheader.3
  %54 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %55 unwind label %31

55:                                               ; preds = %53
  %56 = load i16, ptr %2, align 2, !tbaa !5
  %57 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %54, i16 noundef signext %56)
          to label %58 unwind label %31

58:                                               ; preds = %55
  %59 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %60 unwind label %31

60:                                               ; preds = %58, %.preheader.3
  invoke void @_Z12displayQueuebR5QueueIsE(i1 noundef zeroext %52, ptr noundef nonnull align 8 dereferenceable(20) %1)
          to label %.preheader.4 unwind label %31

.preheader.4:                                     ; preds = %60
  %61 = call noundef zeroext i1 @_ZN5QueueIsE7dequeueERs(ptr noundef nonnull align 8 dereferenceable(20) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
  br i1 %61, label %62, label %69

62:                                               ; preds = %.preheader.4
  %63 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %64 unwind label %31

64:                                               ; preds = %62
  %65 = load i16, ptr %2, align 2, !tbaa !5
  %66 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %63, i16 noundef signext %65)
          to label %67 unwind label %31

67:                                               ; preds = %64
  %68 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %66, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %69 unwind label %31

69:                                               ; preds = %67, %.preheader.4
  invoke void @_Z12displayQueuebR5QueueIsE(i1 noundef zeroext %61, ptr noundef nonnull align 8 dereferenceable(20) %1)
          to label %.preheader.5 unwind label %31

.preheader.5:                                     ; preds = %69
  %70 = call noundef zeroext i1 @_ZN5QueueIsE7dequeueERs(ptr noundef nonnull align 8 dereferenceable(20) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
  br i1 %70, label %71, label %78

71:                                               ; preds = %.preheader.5
  %72 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %73 unwind label %31

73:                                               ; preds = %71
  %74 = load i16, ptr %2, align 2, !tbaa !5
  %75 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %72, i16 noundef signext %74)
          to label %76 unwind label %31

76:                                               ; preds = %73
  %77 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %75, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %78 unwind label %31

78:                                               ; preds = %76, %.preheader.5
  invoke void @_Z12displayQueuebR5QueueIsE(i1 noundef zeroext %70, ptr noundef nonnull align 8 dereferenceable(20) %1)
          to label %.preheader.6 unwind label %31

.preheader.6:                                     ; preds = %78
  %79 = call noundef zeroext i1 @_ZN5QueueIsE7dequeueERs(ptr noundef nonnull align 8 dereferenceable(20) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
  br i1 %79, label %80, label %87

80:                                               ; preds = %.preheader.6
  %81 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %82 unwind label %31

82:                                               ; preds = %80
  %83 = load i16, ptr %2, align 2, !tbaa !5
  %84 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %81, i16 noundef signext %83)
          to label %85 unwind label %31

85:                                               ; preds = %82
  %86 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %84, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %87 unwind label %31

87:                                               ; preds = %85, %.preheader.6
  invoke void @_Z12displayQueuebR5QueueIsE(i1 noundef zeroext %79, ptr noundef nonnull align 8 dereferenceable(20) %1)
          to label %.preheader.7 unwind label %31

.preheader.7:                                     ; preds = %87
  %88 = call noundef zeroext i1 @_ZN5QueueIsE7dequeueERs(ptr noundef nonnull align 8 dereferenceable(20) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
  br i1 %88, label %89, label %96

89:                                               ; preds = %.preheader.7
  %90 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %91 unwind label %31

91:                                               ; preds = %89
  %92 = load i16, ptr %2, align 2, !tbaa !5
  %93 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %90, i16 noundef signext %92)
          to label %94 unwind label %31

94:                                               ; preds = %91
  %95 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %93, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %96 unwind label %31

96:                                               ; preds = %94, %.preheader.7
  invoke void @_Z12displayQueuebR5QueueIsE(i1 noundef zeroext %88, ptr noundef nonnull align 8 dereferenceable(20) %1)
          to label %.preheader.8 unwind label %31

.preheader.8:                                     ; preds = %96
  %97 = call noundef zeroext i1 @_ZN5QueueIsE7dequeueERs(ptr noundef nonnull align 8 dereferenceable(20) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
  br i1 %97, label %98, label %105

98:                                               ; preds = %.preheader.8
  %99 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %100 unwind label %31

100:                                              ; preds = %98
  %101 = load i16, ptr %2, align 2, !tbaa !5
  %102 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %99, i16 noundef signext %101)
          to label %103 unwind label %31

103:                                              ; preds = %100
  %104 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %102, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %105 unwind label %31

105:                                              ; preds = %103, %.preheader.8
  invoke void @_Z12displayQueuebR5QueueIsE(i1 noundef zeroext %97, ptr noundef nonnull align 8 dereferenceable(20) %1)
          to label %.preheader.9 unwind label %31

.preheader.9:                                     ; preds = %105
  %106 = call noundef zeroext i1 @_ZN5QueueIsE7dequeueERs(ptr noundef nonnull align 8 dereferenceable(20) %1, ptr noundef nonnull align 2 dereferenceable(2) %2)
  br i1 %106, label %107, label %114

107:                                              ; preds = %.preheader.9
  %108 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %109 unwind label %31

109:                                              ; preds = %107
  %110 = load i16, ptr %2, align 2, !tbaa !5
  %111 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8) %108, i16 noundef signext %110)
          to label %112 unwind label %31

112:                                              ; preds = %109
  %113 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %111, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %114 unwind label %31

114:                                              ; preds = %112, %.preheader.9
  invoke void @_Z12displayQueuebR5QueueIsE(i1 noundef zeroext %106, ptr noundef nonnull align 8 dereferenceable(20) %1)
          to label %115 unwind label %31

115:                                              ; preds = %114
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %2) #6
  call void @_ZN5QueueIsED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  ret i32 0

116:                                              ; preds = %31, %21, %6
  %.pn = phi { ptr, i32 } [ %22, %21 ], [ %32, %31 ], [ %7, %6 ]
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %2) #6
  call void @_ZN5QueueIsED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10checkStateR5QueueIsE(ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN5QueueIsE7enqueueERKs(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef nonnull align 2 dereferenceable(2)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEs(ptr noundef nonnull align 8 dereferenceable(8), i16 noundef signext) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12displayQueuebR5QueueIsE(i1 noundef zeroext, ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5QueueIsE7dequeueERs(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef nonnull align 2 dereferenceable(2)) local_unnamed_addr #2 align 2

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

attributes #0 = { mustprogress norecurse 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { inlinehint 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 #5 = { "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 #6 = { 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 = !{!"short", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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