; LLVM IR from kazunetakahashi/atcoder :: 2018/0407_maximum-cup-2018 (B)

; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<state, std::allocator<state>>::_Deque_impl" }
%"struct.std::_Deque_base<state, std::allocator<state>>::_Deque_impl" = type { %"struct.std::_Deque_base<state, std::allocator<state>>::_Deque_impl_data" }
%"struct.std::_Deque_base<state, std::allocator<state>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::chrono::time_point" = type { %"class.std::chrono::duration" }
%"class.std::chrono::duration" = type { i64 }
%struct.state = type { i32, i32, i32, i32, i32 }
%"class.std::chrono::duration.3" = type { i64 }

@A = external dso_local global i32, align 4
@B = external dso_local global i32, align 4
@h = external dso_local global i32, align 4
@w = external dso_local global i32, align 4
@_Z1cB5cxx11 = external dso_local global [100 x %"class.std::__cxx11::basic_string"], align 16
@S = external dso_local global %"class.std::stack", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZL2dx = external hidden constant [4 x i32], align 16
@_ZL2dy = external hidden constant [4 x i32], align 16

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::chrono::time_point", align 8
  %3 = alloca i32, align 4
  %4 = alloca %struct.state, align 4
  %5 = alloca %"class.std::chrono::time_point", align 8
  %6 = alloca double, align 8
  %7 = alloca %"class.std::chrono::duration.3", align 8
  %8 = alloca %"class.std::chrono::duration", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca [3 x i32], align 4
  %16 = alloca [3 x i32], align 4
  %17 = alloca [3 x i32], align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca %struct.state, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  %22 = call i64 @_ZNSt6chrono3_V212system_clock3nowEv() #7
  %23 = getelementptr inbounds %"class.std::chrono::time_point", ptr %2, i32 0, i32 0
  %24 = getelementptr inbounds %"class.std::chrono::duration", ptr %23, i32 0, i32 0
  store i64 %22, ptr %24, align 8
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @A)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 4 dereferenceable(4) @B)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 4 dereferenceable(4) @h)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 4 dereferenceable(4) @w)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %39, %0
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = load i32, ptr @h, align 4, !tbaa !5
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %42

34:                                               ; preds = %29
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [100 x %"class.std::__cxx11::basic_string"], ptr @_Z1cB5cxx11, i64 0, i64 %36
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %37)
  br label %39

39:                                               ; preds = %34
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %3, align 4, !tbaa !5
  br label %29, !llvm.loop !9

42:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 20, ptr %4) #7
  %43 = getelementptr inbounds %struct.state, ptr %4, i32 0, i32 0
  store i32 1, ptr %43, align 4, !tbaa !11
  %44 = getelementptr inbounds %struct.state, ptr %4, i32 0, i32 1
  store i32 1, ptr %44, align 4, !tbaa !13
  %45 = getelementptr inbounds %struct.state, ptr %4, i32 0, i32 2
  store i32 0, ptr %45, align 4, !tbaa !14
  %46 = getelementptr inbounds %struct.state, ptr %4, i32 0, i32 3
  store i32 0, ptr %46, align 4, !tbaa !15
  %47 = getelementptr inbounds %struct.state, ptr %4, i32 0, i32 4
  store i32 0, ptr %47, align 4, !tbaa !16
  call void @_ZNSt5stackI5stateSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) @S, ptr noundef nonnull align 4 dereferenceable(20) %4)
  call void @llvm.lifetime.end.p0(i64 20, ptr %4) #7
  br label %48

48:                                               ; preds = %191, %42
  %49 = call noundef zeroext i1 @_ZNKSt5stackI5stateSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @S)
  %50 = xor i1 %49, true
  br i1 %50, label %51, label %192

51:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %52 = call i64 @_ZNSt6chrono3_V212system_clock3nowEv() #7
  %53 = getelementptr inbounds %"class.std::chrono::time_point", ptr %5, i32 0, i32 0
  %54 = getelementptr inbounds %"class.std::chrono::duration", ptr %53, i32 0, i32 0
  store i64 %52, ptr %54, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %55 = call i64 @_ZNSt6chronomiINS_3_V212system_clockENS_8durationIlSt5ratioILl1ELl1000000000EEEES6_EENSt11common_typeIJT0_T1_EE4typeERKNS_10time_pointIT_S8_EERKNSC_ISD_S9_EE(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %56 = getelementptr inbounds %"class.std::chrono::duration", ptr %8, i32 0, i32 0
  store i64 %55, ptr %56, align 8
  %57 = call i64 @_ZNSt6chrono13duration_castINS_8durationIlSt5ratioILl1ELl1000EEEElS2_ILl1ELl1000000000EEEENSt9enable_ifIXsr13__is_durationIT_EE5valueES7_E4typeERKNS1_IT0_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %8)
  %58 = getelementptr inbounds %"class.std::chrono::duration.3", ptr %7, i32 0, i32 0
  store i64 %57, ptr %58, align 8
  %59 = call noundef i64 @_ZNKSt6chrono8durationIlSt5ratioILl1ELl1000EEE5countEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %60 = sitofp i64 %59 to double
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  store double %60, ptr %6, align 8, !tbaa !17
  %61 = load double, ptr %6, align 8, !tbaa !17
  %62 = fcmp ogt double %61, 2.950000e+03
  br i1 %62, label %63, label %70

63:                                               ; preds = %51
  %64 = load i32, ptr @B, align 4, !tbaa !5
  %65 = icmp eq i32 %64, 15
  %66 = zext i1 %65 to i64
  %67 = select i1 %65, ptr @.str, ptr @.str.3
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef %67)
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %68, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  br label %189

70:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %71 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNSt5stackI5stateSt5dequeIS0_SaIS0_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) @S)
  %72 = getelementptr inbounds %struct.state, ptr %71, i32 0, i32 0
  %73 = load i32, ptr %72, align 4, !tbaa !11
  store i32 %73, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %74 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNSt5stackI5stateSt5dequeIS0_SaIS0_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) @S)
  %75 = getelementptr inbounds %struct.state, ptr %74, i32 0, i32 1
  %76 = load i32, ptr %75, align 4, !tbaa !13
  store i32 %76, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %77 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNSt5stackI5stateSt5dequeIS0_SaIS0_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) @S)
  %78 = getelementptr inbounds %struct.state, ptr %77, i32 0, i32 2
  %79 = load i32, ptr %78, align 4, !tbaa !14
  store i32 %79, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %80 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNSt5stackI5stateSt5dequeIS0_SaIS0_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) @S)
  %81 = getelementptr inbounds %struct.state, ptr %80, i32 0, i32 3
  %82 = load i32, ptr %81, align 4, !tbaa !15
  store i32 %82, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %83 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNSt5stackI5stateSt5dequeIS0_SaIS0_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) @S)
  %84 = getelementptr inbounds %struct.state, ptr %83, i32 0, i32 4
  %85 = load i32, ptr %84, align 4, !tbaa !16
  store i32 %85, ptr %14, align 4, !tbaa !5
  call void @_ZNSt5stackI5stateSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @S)
  %86 = load i32, ptr %10, align 4, !tbaa !5
  %87 = load i32, ptr @h, align 4, !tbaa !5
  %88 = sub nsw i32 %87, 2
  %89 = icmp eq i32 %86, %88
  br i1 %89, label %90, label %106

90:                                               ; preds = %70
  %91 = load i32, ptr %11, align 4, !tbaa !5
  %92 = load i32, ptr @w, align 4, !tbaa !5
  %93 = sub nsw i32 %92, 2
  %94 = icmp eq i32 %91, %93
  br i1 %94, label %95, label %106

95:                                               ; preds = %90
  %96 = load i32, ptr %13, align 4, !tbaa !5
  %97 = load i32, ptr @A, align 4, !tbaa !5
  %98 = icmp eq i32 %96, %97
  br i1 %98, label %99, label %106

99:                                               ; preds = %95
  %100 = load i32, ptr %14, align 4, !tbaa !5
  %101 = load i32, ptr @B, align 4, !tbaa !5
  %102 = icmp eq i32 %100, %101
  br i1 %102, label %103, label %106

103:                                              ; preds = %99
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %104, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  br label %188

106:                                              ; preds = %99, %95, %90, %70
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #7
  %107 = load i32, ptr %12, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  %109 = srem i32 %108, 4
  store i32 %109, ptr %15, align 4, !tbaa !5
  %110 = getelementptr inbounds i32, ptr %15, i64 1
  %111 = load i32, ptr %12, align 4, !tbaa !5
  %112 = add nsw i32 %111, 3
  %113 = srem i32 %112, 4
  store i32 %113, ptr %110, align 4, !tbaa !5
  %114 = getelementptr inbounds i32, ptr %15, i64 2
  %115 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %115, ptr %114, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #7
  %116 = load i32, ptr %13, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %16, align 4, !tbaa !5
  %118 = getelementptr inbounds i32, ptr %16, i64 1
  %119 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %119, ptr %118, align 4, !tbaa !5
  %120 = getelementptr inbounds i32, ptr %16, i64 2
  %121 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %121, ptr %120, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #7
  %122 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %122, ptr %17, align 4, !tbaa !5
  %123 = getelementptr inbounds i32, ptr %17, i64 1
  %124 = load i32, ptr %14, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %123, align 4, !tbaa !5
  %126 = getelementptr inbounds i32, ptr %17, i64 2
  %127 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %127, ptr %126, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %183, %106
  %129 = load i32, ptr %18, align 4, !tbaa !5
  %130 = icmp slt i32 %129, 3
  br i1 %130, label %132, label %131

131:                                              ; preds = %128
  store i32 7, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %186

132:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %133 = load i32, ptr %10, align 4, !tbaa !5
  %134 = load i32, ptr %18, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [3 x i32], ptr %15, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [4 x i32], ptr @_ZL2dx, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = add nsw i32 %133, %140
  store i32 %141, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %142 = load i32, ptr %11, align 4, !tbaa !5
  %143 = load i32, ptr %18, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [3 x i32], ptr %15, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [4 x i32], ptr @_ZL2dy, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = add nsw i32 %142, %149
  store i32 %150, ptr %20, align 4, !tbaa !5
  %151 = load i32, ptr %19, align 4, !tbaa !5
  %152 = load i32, ptr %20, align 4, !tbaa !5
  %153 = load i32, ptr %18, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [3 x i32], ptr %16, i64 0, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = load i32, ptr %18, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [3 x i32], ptr %17, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = call noundef zeroext i1 @_Z5validiiii(i32 noundef %151, i32 noundef %152, i32 noundef %156, i32 noundef %160)
  br i1 %161, label %162, label %182

162:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 20, ptr %21) #7
  %163 = getelementptr inbounds %struct.state, ptr %21, i32 0, i32 0
  %164 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %164, ptr %163, align 4, !tbaa !11
  %165 = getelementptr inbounds %struct.state, ptr %21, i32 0, i32 1
  %166 = load i32, ptr %20, align 4, !tbaa !5
  store i32 %166, ptr %165, align 4, !tbaa !13
  %167 = getelementptr inbounds %struct.state, ptr %21, i32 0, i32 2
  %168 = load i32, ptr %18, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [3 x i32], ptr %15, i64 0, i64 %169
  %171 = load i32, ptr %170, align 4, !tbaa !5
  store i32 %171, ptr %167, align 4, !tbaa !14
  %172 = getelementptr inbounds %struct.state, ptr %21, i32 0, i32 3
  %173 = load i32, ptr %18, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [3 x i32], ptr %16, i64 0, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !5
  store i32 %176, ptr %172, align 4, !tbaa !15
  %177 = getelementptr inbounds %struct.state, ptr %21, i32 0, i32 4
  %178 = load i32, ptr %18, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [3 x i32], ptr %17, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !5
  store i32 %181, ptr %177, align 4, !tbaa !16
  call void @_ZNSt5stackI5stateSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) @S, ptr noundef nonnull align 4 dereferenceable(20) %21)
  call void @llvm.lifetime.end.p0(i64 20, ptr %21) #7
  br label %182

182:                                              ; preds = %162, %132
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %183

183:                                              ; preds = %182
  %184 = load i32, ptr %18, align 4, !tbaa !5
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %18, align 4, !tbaa !5
  br label %128, !llvm.loop !19

186:                                              ; preds = %131
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #7
  br label %187

187:                                              ; preds = %186
  store i32 0, ptr %9, align 4
  br label %188

188:                                              ; preds = %187, %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %189

189:                                              ; preds = %188, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  %190 = load i32, ptr %9, align 4
  switch i32 %190, label %195 [
    i32 0, label %191
  ]

191:                                              ; preds = %189
  br label %48, !llvm.loop !20

192:                                              ; preds = %48
  %193 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  %194 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %193, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %9, align 4
  br label %195

195:                                              ; preds = %192, %189
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  %196 = load i32, ptr %9, align 4
  switch i32 %196, label %199 [
    i32 0, label %197
    i32 1, label %197
  ]

197:                                              ; preds = %195, %195
  %198 = load i32, ptr %1, align 4
  ret i32 %198

199:                                              ; preds = %195
  unreachable
}

; 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 i64 @_ZNSt6chrono3_V212system_clock3nowEv() #2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #3

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #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 uwtable
declare dso_local void @_ZNSt5stackI5stateSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(20)) #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZNSt6chrono13duration_castINS_8durationIlSt5ratioILl1ELl1000EEEElS2_ILl1ELl1000000000EEEENSt9enable_ifIXsr13__is_durationIT_EE5valueES7_E4typeERKNS1_IT0_T1_EE(ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZNSt6chronomiINS_3_V212system_clockENS_8durationIlSt5ratioILl1ELl1000000000EEEES6_EENSt11common_typeIJT0_T1_EE4typeERKNS_10time_pointIT_S8_EERKNSC_ISD_S9_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6chrono8durationIlSt5ratioILl1ELl1000EEE5countEv(ptr noundef nonnull align 8 dereferenceable(8)) #5 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) #6

; 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)) #6

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5validiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #6

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 = { 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 #6 = { 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 #7 = { 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 = !{!12, !6, i64 0}
!12 = !{!"_ZTS5state", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16}
!13 = !{!12, !6, i64 4}
!14 = !{!12, !6, i64 8}
!15 = !{!12, !6, i64 12}
!16 = !{!12, !6, i64 16}
!17 = !{!18, !18, i64 0}
!18 = !{!"double", !7, i64 0}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<state, std::allocator<state>>::_Deque_impl" }
%"struct.std::_Deque_base<state, std::allocator<state>>::_Deque_impl" = type { %"struct.std::_Deque_base<state, std::allocator<state>>::_Deque_impl_data" }
%"struct.std::_Deque_base<state, std::allocator<state>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::chrono::time_point" = type { %"class.std::chrono::duration" }
%"class.std::chrono::duration" = type { i64 }
%struct.state = type { i32, i32, i32, i32, i32 }
%"class.std::chrono::duration.3" = type { i64 }

@A = external dso_local global i32, align 4
@B = external dso_local global i32, align 4
@h = external dso_local global i32, align 4
@w = external dso_local global i32, align 4
@_Z1cB5cxx11 = external dso_local global [100 x %"class.std::__cxx11::basic_string"], align 16
@S = external dso_local global %"class.std::stack", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZL2dx = external hidden local_unnamed_addr constant [4 x i32], align 16
@_ZL2dy = external hidden local_unnamed_addr constant [4 x i32], align 16

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %"class.std::chrono::time_point", align 8
  %2 = alloca %struct.state, align 16
  %3 = alloca %"class.std::chrono::time_point", align 8
  %4 = alloca %"class.std::chrono::duration.3", align 8
  %5 = alloca %"class.std::chrono::duration", align 8
  %6 = alloca %struct.state, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  %7 = tail call i64 @_ZNSt6chrono3_V212system_clock3nowEv() #7
  store i64 %7, ptr %1, align 8
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @A)
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(4) @B)
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(4) @h)
  %11 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) @w)
  %12 = load i32, ptr @h, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %2) #7
  store <4 x i32> <i32 1, i32 1, i32 0, i32 0>, ptr %2, align 16, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %2, i64 16
  store i32 0, ptr %14, align 16, !tbaa !9
  call void @_ZNSt5stackI5stateSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) @S, ptr noundef nonnull align 4 dereferenceable(20) %2)
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %2) #7
  %15 = call noundef zeroext i1 @_ZNKSt5stackI5stateSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @S)
  br i1 %15, label %._crit_edge46, label %.lr.ph45

.lr.ph45:                                         ; preds = %._crit_edge
  %16 = getelementptr inbounds i8, ptr %6, i64 4
  %17 = getelementptr inbounds i8, ptr %6, i64 8
  %18 = getelementptr inbounds i8, ptr %6, i64 12
  %19 = getelementptr inbounds i8, ptr %6, i64 16
  br label %25

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %20 = getelementptr inbounds [100 x %"class.std::__cxx11::basic_string"], ptr @_Z1cB5cxx11, i64 0, i64 %indvars.iv
  %21 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %20)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %22 = load i32, ptr @h, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = icmp slt i64 %indvars.iv.next, %23
  br i1 %24, label %.lr.ph, label %._crit_edge, !llvm.loop !11

25:                                               ; preds = %.lr.ph45, %97
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %26 = call i64 @_ZNSt6chrono3_V212system_clock3nowEv() #7
  store i64 %26, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %27 = call i64 @_ZNSt6chronomiINS_3_V212system_clockENS_8durationIlSt5ratioILl1ELl1000000000EEEES6_EENSt11common_typeIJT0_T1_EE4typeERKNS_10time_pointIT_S8_EERKNSC_ISD_S9_EE(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %1)
  store i64 %27, ptr %5, align 8
  %28 = call i64 @_ZNSt6chrono13duration_castINS_8durationIlSt5ratioILl1ELl1000EEEElS2_ILl1ELl1000000000EEEENSt9enable_ifIXsr13__is_durationIT_EE5valueES7_E4typeERKNS1_IT0_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %5)
  store i64 %28, ptr %4, align 8
  %29 = call noundef i64 @_ZNKSt6chrono8durationIlSt5ratioILl1ELl1000EEE5countEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  %30 = icmp sgt i64 %29, 2950
  br i1 %30, label %31, label %35

31:                                               ; preds = %25
  %32 = load i32, ptr @B, align 4, !tbaa !5
  %33 = icmp eq i32 %32, 15
  %34 = select i1 %33, ptr @.str, ptr @.str.3
  br label %.thread

35:                                               ; preds = %25
  %36 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNSt5stackI5stateSt5dequeIS0_SaIS0_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) @S)
  %37 = load i32, ptr %36, align 4, !tbaa !13
  %38 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNSt5stackI5stateSt5dequeIS0_SaIS0_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) @S)
  %39 = getelementptr inbounds i8, ptr %38, i64 4
  %40 = load i32, ptr %39, align 4, !tbaa !14
  %41 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNSt5stackI5stateSt5dequeIS0_SaIS0_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) @S)
  %42 = getelementptr inbounds i8, ptr %41, i64 8
  %43 = load i32, ptr %42, align 4, !tbaa !15
  %44 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNSt5stackI5stateSt5dequeIS0_SaIS0_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) @S)
  %45 = getelementptr inbounds i8, ptr %44, i64 12
  %46 = load i32, ptr %45, align 4, !tbaa !16
  %47 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNSt5stackI5stateSt5dequeIS0_SaIS0_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) @S)
  %48 = getelementptr inbounds i8, ptr %47, i64 16
  %49 = load i32, ptr %48, align 4, !tbaa !9
  call void @_ZNSt5stackI5stateSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @S)
  %50 = load i32, ptr @h, align 4, !tbaa !5
  %51 = add nsw i32 %50, -2
  %52 = icmp eq i32 %37, %51
  br i1 %52, label %53, label %61

53:                                               ; preds = %35
  %54 = load i32, ptr @w, align 4, !tbaa !5
  %55 = add nsw i32 %54, -2
  %56 = icmp eq i32 %40, %55
  %57 = load i32, ptr @A, align 4
  %58 = icmp eq i32 %46, %57
  %or.cond = select i1 %56, i1 %58, i1 false
  %59 = load i32, ptr @B, align 4
  %60 = icmp eq i32 %49, %59
  %or.cond39 = select i1 %or.cond, i1 %60, i1 false
  br i1 %or.cond39, label %.thread, label %61

61:                                               ; preds = %53, %35
  %62 = add nsw i32 %43, 1
  %63 = srem i32 %62, 4
  %64 = add nsw i32 %43, 3
  %65 = srem i32 %64, 4
  %66 = add nsw i32 %46, 1
  %67 = add nsw i32 %49, 1
  %68 = sext i32 %63 to i64
  %69 = getelementptr inbounds [4 x i32], ptr @_ZL2dx, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = add nsw i32 %70, %37
  %72 = getelementptr inbounds [4 x i32], ptr @_ZL2dy, i64 0, i64 %68
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = add nsw i32 %73, %40
  %75 = call noundef zeroext i1 @_Z5validiiii(i32 noundef %71, i32 noundef %74, i32 noundef %66, i32 noundef %49)
  br i1 %75, label %76, label %77

76:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %6) #7
  store i32 %71, ptr %6, align 4, !tbaa !13
  store i32 %74, ptr %16, align 4, !tbaa !14
  store i32 %63, ptr %17, align 4, !tbaa !15
  store i32 %66, ptr %18, align 4, !tbaa !16
  store i32 %49, ptr %19, align 4, !tbaa !9
  call void @_ZNSt5stackI5stateSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) @S, ptr noundef nonnull align 4 dereferenceable(20) %6)
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %6) #7
  br label %77

77:                                               ; preds = %76, %61
  %78 = sext i32 %65 to i64
  %79 = getelementptr inbounds [4 x i32], ptr @_ZL2dx, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = add nsw i32 %80, %37
  %82 = getelementptr inbounds [4 x i32], ptr @_ZL2dy, i64 0, i64 %78
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = add nsw i32 %83, %40
  %85 = call noundef zeroext i1 @_Z5validiiii(i32 noundef %81, i32 noundef %84, i32 noundef %46, i32 noundef %67)
  br i1 %85, label %86, label %87

86:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %6) #7
  store i32 %81, ptr %6, align 4, !tbaa !13
  store i32 %84, ptr %16, align 4, !tbaa !14
  store i32 %65, ptr %17, align 4, !tbaa !15
  store i32 %46, ptr %18, align 4, !tbaa !16
  store i32 %67, ptr %19, align 4, !tbaa !9
  call void @_ZNSt5stackI5stateSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) @S, ptr noundef nonnull align 4 dereferenceable(20) %6)
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %6) #7
  br label %87

87:                                               ; preds = %86, %77
  %88 = sext i32 %43 to i64
  %89 = getelementptr inbounds [4 x i32], ptr @_ZL2dx, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = add nsw i32 %90, %37
  %92 = getelementptr inbounds [4 x i32], ptr @_ZL2dy, i64 0, i64 %88
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = add nsw i32 %93, %40
  %95 = call noundef zeroext i1 @_Z5validiiii(i32 noundef %91, i32 noundef %94, i32 noundef %46, i32 noundef %49)
  br i1 %95, label %96, label %97

96:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %6) #7
  store i32 %91, ptr %6, align 4, !tbaa !13
  store i32 %94, ptr %16, align 4, !tbaa !14
  store i32 %43, ptr %17, align 4, !tbaa !15
  store i32 %46, ptr %18, align 4, !tbaa !16
  store i32 %49, ptr %19, align 4, !tbaa !9
  call void @_ZNSt5stackI5stateSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) @S, ptr noundef nonnull align 4 dereferenceable(20) %6)
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %6) #7
  br label %97

97:                                               ; preds = %96, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %98 = call noundef zeroext i1 @_ZNKSt5stackI5stateSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @S)
  br i1 %98, label %._crit_edge46, label %25, !llvm.loop !17

.thread:                                          ; preds = %53, %31
  %.sink57 = phi ptr [ %34, %31 ], [ @.str, %53 ]
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %.sink57)
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %99, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %103

._crit_edge46:                                    ; preds = %97, %._crit_edge
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.3)
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %101, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %103

103:                                              ; preds = %.thread, %._crit_edge46
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  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 i64 @_ZNSt6chrono3_V212system_clock3nowEv() local_unnamed_addr #2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) 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 uwtable
declare dso_local void @_ZNSt5stackI5stateSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(20)) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZNSt6chrono13duration_castINS_8durationIlSt5ratioILl1ELl1000EEEElS2_ILl1ELl1000000000EEEENSt9enable_ifIXsr13__is_durationIT_EE5valueES7_E4typeERKNS1_IT0_T1_EE(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6chrono8durationIlSt5ratioILl1ELl1000EEE5countEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5 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 #6

; 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)) #6

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5validiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #6

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 = { 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 #6 = { 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 #7 = { 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, !6, i64 16}
!10 = !{!"_ZTS5state", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!10, !6, i64 0}
!14 = !{!10, !6, i64 4}
!15 = !{!10, !6, i64 8}
!16 = !{!10, !6, i64 12}
!17 = distinct !{!17, !12}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass