; LLVM IR from nragland37/cpp-projects :: data_structures-I/11-pal2 (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.Stack = type { ptr, i32, i32 }
%class.Queue = type <{ ptr, ptr, i32, [4 x i8] }>
%"class.std::basic_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"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 }

@.str = external hidden unnamed_addr constant [16 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.Stack, align 8
  %3 = alloca %class.Queue, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca [81 x i8], align 16
  %12 = alloca %"class.std::basic_ifstream", align 8
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr %2) #6
  call void @_ZN5StackIcEC2Ei(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef 100)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #6
  invoke void @_ZN5QueueIcEC2Ev(ptr noundef nonnull align 8 dereferenceable(20) %3)
          to label %14 unwind label %35

14:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 81, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 520, ptr %12) #6
  invoke void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256) %12, ptr noundef @.str, i32 noundef 8)
          to label %15 unwind label %39

15:                                               ; preds = %14
  br label %16

16:                                               ; preds = %117, %15
  %17 = getelementptr inbounds [81 x i8], ptr %11, i64 0, i64 0
  %18 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi7getlineEPclc(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef %17, i64 noundef 80, i8 noundef signext 35)
          to label %19 unwind label %43

19:                                               ; preds = %16
  %20 = load ptr, ptr %18, align 8, !tbaa !5
  %21 = getelementptr i8, ptr %20, i64 -24
  %22 = load i64, ptr %21, align 8
  %23 = getelementptr inbounds i8, ptr %18, i64 %22
  %24 = invoke noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %23)
          to label %25 unwind label %43

25:                                               ; preds = %19
  br i1 %24, label %26, label %118

26:                                               ; preds = %25
  %27 = getelementptr inbounds [81 x i8], ptr %11, i64 0, i64 0
  %28 = call i64 @strlen(ptr noundef %27) #7
  %29 = trunc i64 %28 to i32
  store i32 %29, ptr %9, align 4, !tbaa !8
  store i8 0, ptr %8, align 1, !tbaa !11
  store i8 0, ptr %7, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !8
  br label %30

30:                                               ; preds = %101, %26
  %31 = load i32, ptr %13, align 4, !tbaa !8
  %32 = load i32, ptr %9, align 4, !tbaa !8
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %47, label %34

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

35:                                               ; preds = %0
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %4, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %5, align 4
  br label %123

39:                                               ; preds = %14
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %4, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %5, align 4
  br label %122

43:                                               ; preds = %118, %113, %106, %104, %19, %16
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %4, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %5, align 4
  br label %121

47:                                               ; preds = %30
  %48 = load i32, ptr %13, align 4, !tbaa !8
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [81 x i8], ptr %11, i64 0, i64 %49
  %51 = load i8, ptr %50, align 1, !tbaa !13
  %52 = sext i8 %51 to i32
  %53 = call i32 @isalpha(i32 noundef %52) #7
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %55, label %80

55:                                               ; preds = %47
  %56 = load i32, ptr %13, align 4, !tbaa !8
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [81 x i8], ptr %11, i64 0, i64 %57
  %59 = load i8, ptr %58, align 1, !tbaa !13
  %60 = sext i8 %59 to i32
  %61 = call i32 @tolower(i32 noundef %60) #7
  %62 = trunc i32 %61 to i8
  %63 = load i32, ptr %13, align 4, !tbaa !8
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [81 x i8], ptr %11, i64 0, i64 %64
  store i8 %62, ptr %65, align 1, !tbaa !13
  %66 = load i32, ptr %13, align 4, !tbaa !8
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [81 x i8], ptr %11, i64 0, i64 %67
  %69 = invoke noundef zeroext i1 @_ZN5StackIcE4pushERKc(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 1 dereferenceable(1) %68)
          to label %70 unwind label %76

70:                                               ; preds = %55
  %71 = load i32, ptr %13, align 4, !tbaa !8
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [81 x i8], ptr %11, i64 0, i64 %72
  %74 = invoke noundef zeroext i1 @_ZN5QueueIcE7enqueueERKc(ptr noundef nonnull align 8 dereferenceable(20) %3, ptr noundef nonnull align 1 dereferenceable(1) %73)
          to label %75 unwind label %76

75:                                               ; preds = %70
  br label %100

76:                                               ; preds = %70, %55
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %4, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %121

80:                                               ; preds = %47
  %81 = load i32, ptr %13, align 4, !tbaa !8
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [81 x i8], ptr %11, i64 0, i64 %82
  %84 = load i8, ptr %83, align 1, !tbaa !13
  %85 = sext i8 %84 to i32
  %86 = call i32 @isspace(i32 noundef %85) #7
  %87 = icmp ne i32 %86, 0
  br i1 %87, label %88, label %89

88:                                               ; preds = %80
  store i8 1, ptr %8, align 1, !tbaa !11
  br label %99

89:                                               ; preds = %80
  %90 = load i32, ptr %13, align 4, !tbaa !8
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [81 x i8], ptr %11, i64 0, i64 %91
  %93 = load i8, ptr %92, align 1, !tbaa !13
  %94 = sext i8 %93 to i32
  %95 = call i32 @ispunct(i32 noundef %94) #7
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %98

97:                                               ; preds = %89
  store i8 1, ptr %7, align 1, !tbaa !11
  br label %98

98:                                               ; preds = %97, %89
  br label %99

99:                                               ; preds = %98, %88
  br label %100

100:                                              ; preds = %99, %75
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %13, align 4, !tbaa !8
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %13, align 4, !tbaa !8
  br label %30, !llvm.loop !14

104:                                              ; preds = %34
  %105 = invoke noundef zeroext i1 @_Z15testNdisplayPalR5StackIcER5QueueIcE(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(20) %3)
          to label %106 unwind label %43

106:                                              ; preds = %104
  %107 = zext i1 %105 to i8
  store i8 %107, ptr %6, align 1, !tbaa !11
  %108 = load i8, ptr %8, align 1, !tbaa !11, !range !16, !noundef !17
  %109 = trunc i8 %108 to i1
  %110 = load i8, ptr %7, align 1, !tbaa !11, !range !16, !noundef !17
  %111 = trunc i8 %110 to i1
  %112 = invoke noundef signext i8 @_Z10getPalTypebb(i1 noundef zeroext %109, i1 noundef zeroext %111)
          to label %113 unwind label %43

113:                                              ; preds = %106
  store i8 %112, ptr %10, align 1, !tbaa !13
  %114 = load i8, ptr %6, align 1, !tbaa !11, !range !16, !noundef !17
  %115 = trunc i8 %114 to i1
  %116 = load i8, ptr %10, align 1, !tbaa !13
  invoke void @_Z16displayPalResultbc(i1 noundef zeroext %115, i8 noundef signext %116)
          to label %117 unwind label %43

117:                                              ; preds = %113
  br label %16, !llvm.loop !18

118:                                              ; preds = %25
  invoke void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv(ptr noundef nonnull align 8 dereferenceable(256) %12)
          to label %119 unwind label %43

119:                                              ; preds = %118
  store i32 0, ptr %1, align 4
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %12) #6
  call void @llvm.lifetime.end.p0(i64 520, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 81, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  call void @_ZN5QueueIcED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @_ZN5StackIcED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %2) #6
  %120 = load i32, ptr %1, align 4
  ret i32 %120

121:                                              ; preds = %76, %43
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %12) #6
  br label %122

122:                                              ; preds = %121, %39
  call void @llvm.lifetime.end.p0(i64 520, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 81, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  call void @_ZN5QueueIcED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %3) #6
  br label %123

123:                                              ; preds = %122, %35
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @_ZN5StackIcED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %2) #6
  br label %124

124:                                              ; preds = %123
  %125 = load ptr, ptr %4, align 8
  %126 = load i32, ptr %5, align 4
  %127 = insertvalue { ptr, i32 } poison, ptr %125, 0
  %128 = insertvalue { ptr, i32 } %127, i32 %126, 1
  resume { ptr, i32 } %128
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5StackIcEC2Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) unnamed_addr #2 align 2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef, i32 noundef) unnamed_addr #2 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi7getlineEPclc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i64 noundef, i8 noundef signext) #4

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264)) #2 align 2

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #5

; Function Attrs: nounwind willreturn memory(read)
declare i32 @isalpha(i32 noundef) #5

; Function Attrs: nounwind willreturn memory(read)
declare i32 @tolower(i32 noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5StackIcE4pushERKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #3 align 2

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @isspace(i32 noundef) #5

; Function Attrs: nounwind willreturn memory(read)
declare i32 @ispunct(i32 noundef) #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef signext i8 @_Z10getPalTypebb(i1 noundef zeroext, i1 noundef zeroext) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z16displayPalResultbc(i1 noundef zeroext, i8 noundef signext) #2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv(ptr noundef nonnull align 8 dereferenceable(256)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5StackIcED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 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 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 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 #4 = { "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 = { nounwind willreturn memory(read) "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 }
attributes #7 = { nounwind willreturn memory(read) }

!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"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !10, i64 0}
!13 = !{!10, !10, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !15}


; 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.Stack = type { ptr, i32, i32 }
%class.Queue = type <{ ptr, ptr, i32, [4 x i8] }>
%"class.std::basic_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"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 }

@.str = external hidden unnamed_addr constant [16 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.Stack, align 8
  %2 = alloca %class.Queue, align 8
  %3 = alloca [81 x i8], align 16
  %4 = alloca %"class.std::basic_ifstream", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #7
  call void @_ZN5StackIcEC2Ei(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 100)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #7
  call void @_ZN5QueueIcEC2Ev(ptr noundef nonnull align 8 dereferenceable(20) %2)
  call void @llvm.lifetime.start.p0(i64 81, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 520, ptr nonnull %4) #7
  invoke void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256) %4, ptr noundef nonnull @.str, i32 noundef 8)
          to label %.preheader unwind label %18

.preheader:                                       ; preds = %0, %36
  %5 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi7getlineEPclc(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull %3, i64 noundef 80, i8 noundef signext 35)
          to label %6 unwind label %.loopexit

6:                                                ; preds = %.preheader
  %7 = load ptr, ptr %5, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr %5, i64 %9
  %11 = invoke noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %10)
          to label %12 unwind label %.loopexit

12:                                               ; preds = %6
  br i1 %11, label %13, label %38

13:                                               ; preds = %12
  %14 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #8
  %15 = trunc i64 %14 to i32
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %13
  %wide.trip.count = and i64 %14, 2147483647
  br label %.lr.ph

._crit_edge:                                      ; preds = %35, %13
  %.019.lcssa = phi i1 [ false, %13 ], [ %.120, %35 ]
  %.017.lcssa = phi i1 [ false, %13 ], [ %.118, %35 ]
  %17 = invoke noundef zeroext i1 @_Z15testNdisplayPalR5StackIcER5QueueIcE(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(20) %2)
          to label %36 unwind label %.loopexit

18:                                               ; preds = %0
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %41

.loopexit:                                        ; preds = %.preheader, %6, %._crit_edge, %36
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %40

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

.lr.ph:                                           ; preds = %.lr.ph.preheader, %35
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %35 ]
  %.01730 = phi i1 [ false, %.lr.ph.preheader ], [ %.118, %35 ]
  %.01929 = phi i1 [ false, %.lr.ph.preheader ], [ %.120, %35 ]
  %20 = getelementptr inbounds [81 x i8], ptr %3, i64 0, i64 %indvars.iv
  %21 = load i8, ptr %20, align 1, !tbaa !8
  %22 = sext i8 %21 to i32
  %23 = call i32 @isalpha(i32 noundef %22) #8
  %.not = icmp eq i32 %23, 0
  br i1 %.not, label %31, label %24

24:                                               ; preds = %.lr.ph
  %25 = call i32 @tolower(i32 noundef %22) #8
  %26 = trunc i32 %25 to i8
  store i8 %26, ptr %20, align 1, !tbaa !8
  %27 = call noundef zeroext i1 @_ZN5StackIcE4pushERKc(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 1 dereferenceable(1) %20)
  %28 = invoke noundef zeroext i1 @_ZN5QueueIcE7enqueueERKc(ptr noundef nonnull align 8 dereferenceable(20) %2, ptr noundef nonnull align 1 dereferenceable(1) %20)
          to label %35 unwind label %29

29:                                               ; preds = %24
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %40

31:                                               ; preds = %.lr.ph
  %32 = call i32 @isspace(i32 noundef %22) #8
  %.not23 = icmp eq i32 %32, 0
  br i1 %.not23, label %33, label %35

33:                                               ; preds = %31
  %34 = call i32 @ispunct(i32 noundef %22) #8
  %.not24 = icmp ne i32 %34, 0
  %spec.select = select i1 %.not24, i1 true, i1 %.01929
  br label %35

35:                                               ; preds = %33, %31, %24
  %.120 = phi i1 [ %.01929, %24 ], [ %.01929, %31 ], [ %spec.select, %33 ]
  %.118 = phi i1 [ %.01730, %24 ], [ true, %31 ], [ %.01730, %33 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !10

36:                                               ; preds = %._crit_edge
  %37 = call noundef signext i8 @_Z10getPalTypebb(i1 noundef zeroext %.017.lcssa, i1 noundef zeroext %.019.lcssa)
  invoke void @_Z16displayPalResultbc(i1 noundef zeroext %17, i8 noundef signext %37)
          to label %.preheader unwind label %.loopexit, !llvm.loop !12

38:                                               ; preds = %12
  invoke void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv(ptr noundef nonnull align 8 dereferenceable(256) %4)
          to label %39 unwind label %.loopexit.split-lp

39:                                               ; preds = %38
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %4) #7
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 81, ptr nonnull %3) #7
  call void @_ZN5QueueIcED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #7
  call void @_ZN5StackIcED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %1) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #7
  ret i32 0

40:                                               ; preds = %.loopexit, %.loopexit.split-lp, %29
  %.pn = phi { ptr, i32 } [ %30, %29 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %4) #7
  br label %41

41:                                               ; preds = %40, %18
  %.pn.pn = phi { ptr, i32 } [ %.pn, %40 ], [ %19, %18 ]
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 81, ptr nonnull %3) #7
  call void @_ZN5QueueIcED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #7
  call void @_ZN5StackIcED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %1) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn.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 uwtable
declare dso_local void @_ZN5StackIcEC2Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) unnamed_addr #2 align 2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef, i32 noundef) unnamed_addr #2 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi7getlineEPclc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i64 noundef, i8 noundef signext) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare i32 @isalpha(i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare i32 @tolower(i32 noundef) local_unnamed_addr #6

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare i32 @isspace(i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare i32 @ispunct(i32 noundef) local_unnamed_addr #6

; 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 uwtable
declare dso_local noundef zeroext i1 @_Z15testNdisplayPalR5StackIcER5QueueIcE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef signext i8 @_Z10getPalTypebb(i1 noundef zeroext, i1 noundef zeroext) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z16displayPalResultbc(i1 noundef zeroext, i8 noundef signext) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv(ptr noundef nonnull align 8 dereferenceable(256)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5StackIcED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 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 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 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 #4 = { "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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { mustprogress nofree nounwind willreturn memory(read) "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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

!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"}
!8 = !{!9, !9, i64 0}
!9 = !{!"omnipotent char", !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass