; LLVM IR from MinhasKamal/AlgorithmImplementations :: dataStructures/string (StringLongestIncreasingSubSecuence)

; 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.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca [31 x i32], align 16
  %3 = alloca i32, align 4
  %4 = alloca [31 x i32], align 16
  %5 = alloca [31 x i32], align 16
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::stack", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 124, ptr %2) #8
  %15 = getelementptr inbounds [31 x i32], ptr %2, i64 0, i64 0
  store i32 0, ptr %15, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %32, %0
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = icmp slt i32 %17, 31
  br i1 %18, label %20, label %19

19:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %35

20:                                               ; preds = %16
  %21 = call i32 @rand() #8
  %22 = srem i32 %21, 100
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [31 x i32], ptr %2, i64 0, i64 %24
  store i32 %22, ptr %25, align 4, !tbaa !5
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [31 x i32], ptr %2, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %29)
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %32

32:                                               ; preds = %20
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %3, align 4, !tbaa !5
  br label %16, !llvm.loop !9

35:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 124, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 124, ptr %5) #8
  %36 = getelementptr inbounds [31 x i32], ptr %4, i64 0, i64 0
  store i32 0, ptr %36, align 16, !tbaa !5
  %37 = getelementptr inbounds [31 x i32], ptr %5, i64 0, i64 0
  store i32 0, ptr %37, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %97, %35
  %39 = load i32, ptr %6, align 4, !tbaa !5
  %40 = icmp slt i32 %39, 31
  br i1 %40, label %42, label %41

41:                                               ; preds = %38
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %100

42:                                               ; preds = %38
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [31 x i32], ptr %4, i64 0, i64 %44
  store i32 0, ptr %45, align 4, !tbaa !5
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [31 x i32], ptr %5, i64 0, i64 %47
  store i32 0, ptr %48, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %49

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

53:                                               ; preds = %49
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %91

54:                                               ; preds = %49
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [31 x i32], ptr %2, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = load i32, ptr %8, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [31 x i32], ptr %2, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = icmp sge i32 %58, %62
  br i1 %63, label %64, label %87

64:                                               ; preds = %54
  %65 = load i32, ptr %8, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [31 x i32], ptr %5, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [31 x i32], ptr %5, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = icmp sgt i32 %68, %72
  br i1 %73, label %74, label %86

74:                                               ; preds = %64
  %75 = load i32, ptr %8, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [31 x i32], ptr %5, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [31 x i32], ptr %5, i64 0, i64 %80
  store i32 %78, ptr %81, align 4, !tbaa !5
  %82 = load i32, ptr %8, align 4, !tbaa !5
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [31 x i32], ptr %4, i64 0, i64 %84
  store i32 %82, ptr %85, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %74, %64
  br label %87

87:                                               ; preds = %86, %54
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %8, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %8, align 4, !tbaa !5
  br label %49, !llvm.loop !11

91:                                               ; preds = %53
  %92 = load i32, ptr %6, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [31 x i32], ptr %5, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %94, align 4, !tbaa !5
  br label %97

97:                                               ; preds = %91
  %98 = load i32, ptr %6, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %6, align 4, !tbaa !5
  br label %38, !llvm.loop !12

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

101:                                              ; preds = %119, %100
  %102 = load i32, ptr %11, align 4, !tbaa !5
  %103 = icmp slt i32 %102, 31
  br i1 %103, label %105, label %104

104:                                              ; preds = %101
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %122

105:                                              ; preds = %101
  %106 = load i32, ptr %11, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [31 x i32], ptr %5, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = load i32, ptr %9, align 4, !tbaa !5
  %111 = icmp sgt i32 %109, %110
  br i1 %111, label %112, label %118

112:                                              ; preds = %105
  %113 = load i32, ptr %11, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [31 x i32], ptr %5, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  store i32 %116, ptr %9, align 4, !tbaa !5
  %117 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %117, ptr %10, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %112, %105
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %11, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %11, align 4, !tbaa !5
  br label %101, !llvm.loop !13

122:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 80, ptr %12) #8
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %12)
  br label %123

123:                                              ; preds = %133, %122
  %124 = load i32, ptr %10, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [31 x i32], ptr %4, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = icmp ne i32 %127, 0
  br i1 %128, label %129, label %142

129:                                              ; preds = %123
  %130 = load i32, ptr %10, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [31 x i32], ptr %2, i64 0, i64 %131
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %12, ptr noundef nonnull align 4 dereferenceable(4) %132)
          to label %133 unwind label %138

133:                                              ; preds = %129
  %134 = load i32, ptr %10, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [31 x i32], ptr %4, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  store i32 %137, ptr %10, align 4, !tbaa !5
  br label %123, !llvm.loop !14

138:                                              ; preds = %158, %156, %153, %151, %147, %142, %129
  %139 = landingpad { ptr, i32 }
          cleanup
  %140 = extractvalue { ptr, i32 } %139, 0
  store ptr %140, ptr %13, align 8
  %141 = extractvalue { ptr, i32 } %139, 1
  store i32 %141, ptr %14, align 4
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %12) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 124, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 124, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 124, ptr %2) #8
  br label %162

142:                                              ; preds = %123
  %143 = load i32, ptr %10, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [31 x i32], ptr %2, i64 0, i64 %144
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %12, ptr noundef nonnull align 4 dereferenceable(4) %145)
          to label %146 unwind label %138

146:                                              ; preds = %142
  br label %147

147:                                              ; preds = %159, %146
  %148 = invoke noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %12)
          to label %149 unwind label %138

149:                                              ; preds = %147
  %150 = xor i1 %148, true
  br i1 %150, label %151, label %160

151:                                              ; preds = %149
  %152 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %12)
          to label %153 unwind label %138

153:                                              ; preds = %151
  %154 = load i32, ptr %152, align 4, !tbaa !5
  %155 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %154)
          to label %156 unwind label %138

156:                                              ; preds = %153
  %157 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %155, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %158 unwind label %138

158:                                              ; preds = %156
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %12)
          to label %159 unwind label %138

159:                                              ; preds = %158
  br label %147, !llvm.loop !15

160:                                              ; preds = %149
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %12) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 124, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 124, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 124, ptr %2) #8
  %161 = load i32, ptr %1, align 4
  ret i32 %161

162:                                              ; preds = %138
  %163 = load ptr, ptr %13, align 8
  %164 = load i32, ptr %14, align 4
  %165 = insertvalue { ptr, i32 } poison, ptr %163, 0
  %166 = insertvalue { ptr, i32 } %165, i32 %164, 1
  resume { ptr, i32 } %166
}

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

; Function Attrs: nounwind
declare i32 @rand() #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 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)) #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 void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) #4 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80)) #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #7 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 = { nounwind "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 = { "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 = { 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 = { 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 #6 = { 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 #7 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


; 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.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca [31 x i32], align 16
  %2 = alloca [31 x i32], align 16
  %3 = alloca [31 x i32], align 16
  %4 = alloca %"class.std::stack", align 8
  call void @llvm.lifetime.start.p0(i64 124, ptr nonnull %1) #9
  store i32 0, ptr %1, align 16, !tbaa !5
  br label %6

5:                                                ; preds = %6
  call void @llvm.lifetime.start.p0(i64 124, ptr nonnull %2) #9
  call void @llvm.lifetime.start.p0(i64 124, ptr nonnull %3) #9
  store i32 0, ptr %2, align 16, !tbaa !5
  br label %12

6:                                                ; preds = %0, %6
  %indvars.iv = phi i64 [ 1, %0 ], [ %indvars.iv.next, %6 ]
  %7 = tail call i32 @rand() #9
  %8 = srem i32 %7, 100
  %9 = getelementptr inbounds [31 x i32], ptr %1, i64 0, i64 %indvars.iv
  store i32 %8, ptr %9, align 4, !tbaa !5
  %10 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %8)
  %11 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 31
  br i1 %exitcond.not, label %5, label %6, !llvm.loop !9

12:                                               ; preds = %5, %._crit_edge
  %indvar = phi i64 [ 0, %5 ], [ %indvar.next, %._crit_edge ]
  %indvars.iv61 = phi i64 [ 1, %5 ], [ %indvars.iv.next62, %._crit_edge ]
  %13 = getelementptr inbounds [31 x i32], ptr %2, i64 0, i64 %indvars.iv61
  store i32 0, ptr %13, align 4, !tbaa !5
  %14 = getelementptr inbounds [31 x i32], ptr %3, i64 0, i64 %indvars.iv61
  store i32 0, ptr %14, align 4, !tbaa !5
  %15 = icmp ugt i64 %indvars.iv61, 1
  br i1 %15, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %12
  %16 = getelementptr inbounds [31 x i32], ptr %1, i64 0, i64 %indvars.iv61
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %xtraiter = and i64 %indvar, 1
  %18 = icmp eq i64 %indvar, 1
  br i1 %18, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %indvar, -2
  br label %119

._crit_edge.loopexit.unr-lcssa:                   ; preds = %139, %.lr.ph
  %.lcssa74.ph = phi i32 [ poison, %.lr.ph ], [ %140, %139 ]
  %.unr = phi i32 [ 0, %.lr.ph ], [ %140, %139 ]
  %indvars.iv57.unr = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next58.1, %139 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.loopexit.unr-lcssa
  %19 = getelementptr inbounds [31 x i32], ptr %1, i64 0, i64 %indvars.iv57.unr
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %.not40.epil = icmp slt i32 %17, %20
  br i1 %.not40.epil, label %._crit_edge, label %21

21:                                               ; preds = %.epil.preheader
  %22 = getelementptr inbounds [31 x i32], ptr %3, i64 0, i64 %indvars.iv57.unr
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = icmp sgt i32 %23, %.unr
  br i1 %24, label %25, label %._crit_edge

25:                                               ; preds = %21
  store i32 %23, ptr %14, align 4, !tbaa !5
  %26 = trunc nuw nsw i64 %indvars.iv57.unr to i32
  store i32 %26, ptr %13, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %25, %21, %.epil.preheader, %12
  %27 = phi i32 [ 0, %12 ], [ %.lcssa74.ph, %._crit_edge.loopexit.unr-lcssa ], [ %.unr, %.epil.preheader ], [ %23, %25 ], [ %.unr, %21 ]
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %14, align 4, !tbaa !5
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %exitcond64.not = icmp eq i64 %indvars.iv.next62, 31
  %indvar.next = add i64 %indvar, 1
  br i1 %exitcond64.not, label %.preheader45.preheader, label %12, !llvm.loop !11

.preheader45.preheader:                           ; preds = %._crit_edge
  %29 = getelementptr inbounds i8, ptr %3, i64 4
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = icmp sgt i32 %30, 0
  %spec.select.1 = tail call i32 @llvm.smax.i32(i32 %30, i32 0)
  %spec.select41.1 = zext i1 %31 to i32
  %32 = getelementptr inbounds i8, ptr %3, i64 8
  %33 = load i32, ptr %32, align 8, !tbaa !5
  %34 = icmp sgt i32 %33, %spec.select.1
  %spec.select.2 = tail call i32 @llvm.smax.i32(i32 %33, i32 %spec.select.1)
  %spec.select41.2 = select i1 %34, i32 2, i32 %spec.select41.1
  %35 = getelementptr inbounds i8, ptr %3, i64 12
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = icmp sgt i32 %36, %spec.select.2
  %spec.select.3 = tail call i32 @llvm.smax.i32(i32 %36, i32 %spec.select.2)
  %spec.select41.3 = select i1 %37, i32 3, i32 %spec.select41.2
  %38 = getelementptr inbounds i8, ptr %3, i64 16
  %39 = load i32, ptr %38, align 16, !tbaa !5
  %40 = icmp sgt i32 %39, %spec.select.3
  %spec.select.4 = tail call i32 @llvm.smax.i32(i32 %39, i32 %spec.select.3)
  %spec.select41.4 = select i1 %40, i32 4, i32 %spec.select41.3
  %41 = getelementptr inbounds i8, ptr %3, i64 20
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = icmp sgt i32 %42, %spec.select.4
  %spec.select.5 = tail call i32 @llvm.smax.i32(i32 %42, i32 %spec.select.4)
  %spec.select41.5 = select i1 %43, i32 5, i32 %spec.select41.4
  %44 = getelementptr inbounds i8, ptr %3, i64 24
  %45 = load i32, ptr %44, align 8, !tbaa !5
  %46 = icmp sgt i32 %45, %spec.select.5
  %spec.select.6 = tail call i32 @llvm.smax.i32(i32 %45, i32 %spec.select.5)
  %spec.select41.6 = select i1 %46, i32 6, i32 %spec.select41.5
  %47 = getelementptr inbounds i8, ptr %3, i64 28
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = icmp sgt i32 %48, %spec.select.6
  %spec.select.7 = tail call i32 @llvm.smax.i32(i32 %48, i32 %spec.select.6)
  %spec.select41.7 = select i1 %49, i32 7, i32 %spec.select41.6
  %50 = getelementptr inbounds i8, ptr %3, i64 32
  %51 = load i32, ptr %50, align 16, !tbaa !5
  %52 = icmp sgt i32 %51, %spec.select.7
  %spec.select.8 = tail call i32 @llvm.smax.i32(i32 %51, i32 %spec.select.7)
  %spec.select41.8 = select i1 %52, i32 8, i32 %spec.select41.7
  %53 = getelementptr inbounds i8, ptr %3, i64 36
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = icmp sgt i32 %54, %spec.select.8
  %spec.select.9 = tail call i32 @llvm.smax.i32(i32 %54, i32 %spec.select.8)
  %spec.select41.9 = select i1 %55, i32 9, i32 %spec.select41.8
  %56 = getelementptr inbounds i8, ptr %3, i64 40
  %57 = load i32, ptr %56, align 8, !tbaa !5
  %58 = icmp sgt i32 %57, %spec.select.9
  %spec.select.10 = tail call i32 @llvm.smax.i32(i32 %57, i32 %spec.select.9)
  %spec.select41.10 = select i1 %58, i32 10, i32 %spec.select41.9
  %59 = getelementptr inbounds i8, ptr %3, i64 44
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = icmp sgt i32 %60, %spec.select.10
  %spec.select.11 = tail call i32 @llvm.smax.i32(i32 %60, i32 %spec.select.10)
  %spec.select41.11 = select i1 %61, i32 11, i32 %spec.select41.10
  %62 = getelementptr inbounds i8, ptr %3, i64 48
  %63 = load i32, ptr %62, align 16, !tbaa !5
  %64 = icmp sgt i32 %63, %spec.select.11
  %spec.select.12 = tail call i32 @llvm.smax.i32(i32 %63, i32 %spec.select.11)
  %spec.select41.12 = select i1 %64, i32 12, i32 %spec.select41.11
  %65 = getelementptr inbounds i8, ptr %3, i64 52
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = icmp sgt i32 %66, %spec.select.12
  %spec.select.13 = tail call i32 @llvm.smax.i32(i32 %66, i32 %spec.select.12)
  %spec.select41.13 = select i1 %67, i32 13, i32 %spec.select41.12
  %68 = getelementptr inbounds i8, ptr %3, i64 56
  %69 = load i32, ptr %68, align 8, !tbaa !5
  %70 = icmp sgt i32 %69, %spec.select.13
  %spec.select.14 = tail call i32 @llvm.smax.i32(i32 %69, i32 %spec.select.13)
  %spec.select41.14 = select i1 %70, i32 14, i32 %spec.select41.13
  %71 = getelementptr inbounds i8, ptr %3, i64 60
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = icmp sgt i32 %72, %spec.select.14
  %spec.select.15 = tail call i32 @llvm.smax.i32(i32 %72, i32 %spec.select.14)
  %spec.select41.15 = select i1 %73, i32 15, i32 %spec.select41.14
  %74 = getelementptr inbounds i8, ptr %3, i64 64
  %75 = load i32, ptr %74, align 16, !tbaa !5
  %76 = icmp sgt i32 %75, %spec.select.15
  %spec.select.16 = tail call i32 @llvm.smax.i32(i32 %75, i32 %spec.select.15)
  %spec.select41.16 = select i1 %76, i32 16, i32 %spec.select41.15
  %77 = getelementptr inbounds i8, ptr %3, i64 68
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = icmp sgt i32 %78, %spec.select.16
  %spec.select.17 = tail call i32 @llvm.smax.i32(i32 %78, i32 %spec.select.16)
  %spec.select41.17 = select i1 %79, i32 17, i32 %spec.select41.16
  %80 = getelementptr inbounds i8, ptr %3, i64 72
  %81 = load i32, ptr %80, align 8, !tbaa !5
  %82 = icmp sgt i32 %81, %spec.select.17
  %spec.select.18 = tail call i32 @llvm.smax.i32(i32 %81, i32 %spec.select.17)
  %spec.select41.18 = select i1 %82, i32 18, i32 %spec.select41.17
  %83 = getelementptr inbounds i8, ptr %3, i64 76
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = icmp sgt i32 %84, %spec.select.18
  %spec.select.19 = tail call i32 @llvm.smax.i32(i32 %84, i32 %spec.select.18)
  %spec.select41.19 = select i1 %85, i32 19, i32 %spec.select41.18
  %86 = getelementptr inbounds i8, ptr %3, i64 80
  %87 = load i32, ptr %86, align 16, !tbaa !5
  %88 = icmp sgt i32 %87, %spec.select.19
  %spec.select.20 = tail call i32 @llvm.smax.i32(i32 %87, i32 %spec.select.19)
  %spec.select41.20 = select i1 %88, i32 20, i32 %spec.select41.19
  %89 = getelementptr inbounds i8, ptr %3, i64 84
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = icmp sgt i32 %90, %spec.select.20
  %spec.select.21 = tail call i32 @llvm.smax.i32(i32 %90, i32 %spec.select.20)
  %spec.select41.21 = select i1 %91, i32 21, i32 %spec.select41.20
  %92 = getelementptr inbounds i8, ptr %3, i64 88
  %93 = load i32, ptr %92, align 8, !tbaa !5
  %94 = icmp sgt i32 %93, %spec.select.21
  %spec.select.22 = tail call i32 @llvm.smax.i32(i32 %93, i32 %spec.select.21)
  %spec.select41.22 = select i1 %94, i32 22, i32 %spec.select41.21
  %95 = getelementptr inbounds i8, ptr %3, i64 92
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = icmp sgt i32 %96, %spec.select.22
  %spec.select.23 = tail call i32 @llvm.smax.i32(i32 %96, i32 %spec.select.22)
  %spec.select41.23 = select i1 %97, i32 23, i32 %spec.select41.22
  %98 = getelementptr inbounds i8, ptr %3, i64 96
  %99 = load i32, ptr %98, align 16, !tbaa !5
  %100 = icmp sgt i32 %99, %spec.select.23
  %spec.select.24 = tail call i32 @llvm.smax.i32(i32 %99, i32 %spec.select.23)
  %spec.select41.24 = select i1 %100, i32 24, i32 %spec.select41.23
  %101 = getelementptr inbounds i8, ptr %3, i64 100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = icmp sgt i32 %102, %spec.select.24
  %spec.select.25 = tail call i32 @llvm.smax.i32(i32 %102, i32 %spec.select.24)
  %spec.select41.25 = select i1 %103, i32 25, i32 %spec.select41.24
  %104 = getelementptr inbounds i8, ptr %3, i64 104
  %105 = load i32, ptr %104, align 8, !tbaa !5
  %106 = icmp sgt i32 %105, %spec.select.25
  %spec.select.26 = tail call i32 @llvm.smax.i32(i32 %105, i32 %spec.select.25)
  %spec.select41.26 = select i1 %106, i32 26, i32 %spec.select41.25
  %107 = getelementptr inbounds i8, ptr %3, i64 108
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = icmp sgt i32 %108, %spec.select.26
  %spec.select.27 = tail call i32 @llvm.smax.i32(i32 %108, i32 %spec.select.26)
  %spec.select41.27 = select i1 %109, i32 27, i32 %spec.select41.26
  %110 = getelementptr inbounds i8, ptr %3, i64 112
  %111 = load i32, ptr %110, align 16, !tbaa !5
  %112 = icmp sgt i32 %111, %spec.select.27
  %spec.select.28 = tail call i32 @llvm.smax.i32(i32 %111, i32 %spec.select.27)
  %spec.select41.28 = select i1 %112, i32 28, i32 %spec.select41.27
  %113 = getelementptr inbounds i8, ptr %3, i64 116
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = icmp sgt i32 %114, %spec.select.28
  %spec.select.29 = tail call i32 @llvm.smax.i32(i32 %114, i32 %spec.select.28)
  %spec.select41.29 = select i1 %115, i32 29, i32 %spec.select41.28
  %116 = getelementptr inbounds i8, ptr %3, i64 120
  %117 = load i32, ptr %116, align 8, !tbaa !5
  %118 = icmp sgt i32 %117, %spec.select.29
  %spec.select41.30 = select i1 %118, i32 30, i32 %spec.select41.29
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %4) #9
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br label %141

119:                                              ; preds = %139, %.lr.ph.new
  %120 = phi i32 [ 0, %.lr.ph.new ], [ %140, %139 ]
  %indvars.iv57 = phi i64 [ 1, %.lr.ph.new ], [ %indvars.iv.next58.1, %139 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %139 ]
  %121 = getelementptr inbounds [31 x i32], ptr %1, i64 0, i64 %indvars.iv57
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %.not40 = icmp slt i32 %17, %122
  br i1 %.not40, label %129, label %123

123:                                              ; preds = %119
  %124 = getelementptr inbounds [31 x i32], ptr %3, i64 0, i64 %indvars.iv57
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = icmp sgt i32 %125, %120
  br i1 %126, label %127, label %129

127:                                              ; preds = %123
  store i32 %125, ptr %14, align 4, !tbaa !5
  %128 = trunc nuw nsw i64 %indvars.iv57 to i32
  store i32 %128, ptr %13, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %119, %127, %123
  %130 = phi i32 [ %120, %119 ], [ %125, %127 ], [ %120, %123 ]
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %131 = getelementptr inbounds [31 x i32], ptr %1, i64 0, i64 %indvars.iv.next58
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %.not40.1 = icmp slt i32 %17, %132
  br i1 %.not40.1, label %139, label %133

133:                                              ; preds = %129
  %134 = getelementptr inbounds [31 x i32], ptr %3, i64 0, i64 %indvars.iv.next58
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = icmp sgt i32 %135, %130
  br i1 %136, label %137, label %139

137:                                              ; preds = %133
  store i32 %135, ptr %14, align 4, !tbaa !5
  %138 = trunc nuw nsw i64 %indvars.iv.next58 to i32
  store i32 %138, ptr %13, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %137, %133, %129
  %140 = phi i32 [ %130, %129 ], [ %135, %137 ], [ %130, %133 ]
  %indvars.iv.next58.1 = add nuw nsw i64 %indvars.iv57, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %119, !llvm.loop !12

141:                                              ; preds = %146, %.preheader45.preheader
  %.2 = phi i32 [ %spec.select41.30, %.preheader45.preheader ], [ %144, %146 ]
  %142 = sext i32 %.2 to i64
  %143 = getelementptr inbounds [31 x i32], ptr %2, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %.not = icmp eq i32 %144, 0
  %145 = getelementptr inbounds [31 x i32], ptr %1, i64 0, i64 %142
  br i1 %.not, label %147, label %146

146:                                              ; preds = %141
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 4 dereferenceable(4) %145)
          to label %141 unwind label %.loopexit.split-lp.loopexit, !llvm.loop !13

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

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

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

.loopexit.split-lp:                               ; preds = %.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit42, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp43, %.loopexit.split-lp.loopexit.split-lp ]
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #9
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 124, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 124, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 124, ptr nonnull %1) #9
  resume { ptr, i32 } %lpad.phi

147:                                              ; preds = %141
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 4 dereferenceable(4) %145)
          to label %.preheader unwind label %.loopexit.split-lp.loopexit.split-lp

.preheader:                                       ; preds = %147
  %148 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br i1 %148, label %._crit_edge54, label %.lr.ph53

.lr.ph53:                                         ; preds = %.preheader, %154
  %149 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %150)
          to label %152 unwind label %.loopexit

152:                                              ; preds = %.lr.ph53
  %153 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %151, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %154 unwind label %.loopexit

154:                                              ; preds = %152
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  %155 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br i1 %155, label %._crit_edge54, label %.lr.ph53, !llvm.loop !14

._crit_edge54:                                    ; preds = %154, %.preheader
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #9
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 124, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 124, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 124, ptr nonnull %1) #9
  ret i32 0
}

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

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3

; 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 #4 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)) #5

; 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 void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #7 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #8

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 = { nounwind "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 = { "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 = { 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 = { 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 #6 = { 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 #7 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass