; LLVM IR from upupming/algorithm :: acwing/算法竞赛进阶指南/0x29-总结与练习/189. 乳草的入侵 (main)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"struct.std::pair.0" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<P, std::allocator<P>>::_Deque_impl" }
%"struct.std::_Deque_base<P, std::allocator<P>>::_Deque_impl" = type { %"struct.std::_Deque_base<P, std::allocator<P>>::_Deque_impl_data" }
%"struct.std::_Deque_base<P, std::allocator<P>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%struct.P = type { i32, i32, i32 }

@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@mx = external dso_local global i32, align 4
@my = external dso_local global i32, align 4
@g = external dso_local global [110 x [110 x i8]], align 16
@s = external dso_local global %"class.std::set", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5validii(i32 noundef, i32 noundef) #1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair.0", align 8
  %7 = alloca %"class.std::queue", align 8
  %8 = alloca %struct.P, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %struct.P, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %struct.P, align 4
  store i32 0, ptr %1, align 4
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @x)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 4 dereferenceable(4) @y)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 4 dereferenceable(4) @mx)
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(4) @my)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %61, %0
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = load i32, ptr @y, align 4, !tbaa !5
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %64

26:                                               ; preds = %21
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %28
  %30 = getelementptr inbounds [110 x i8], ptr %29, i64 0, i64 0
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %30)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %57, %26
  %33 = load i32, ptr %5, align 4, !tbaa !5
  %34 = load i32, ptr @x, align 4, !tbaa !5
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %32
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %60

37:                                               ; preds = %32
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %39
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [110 x i8], ptr %40, i64 0, i64 %42
  %44 = load i8, ptr %43, align 1, !tbaa !9
  %45 = sext i8 %44 to i32
  %46 = icmp eq i32 %45, 46
  br i1 %46, label %47, label %53

47:                                               ; preds = %37
  %48 = call { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE7emplaceIJRiS7_EEES0_ISt23_Rb_tree_const_iteratorIS1_EbEDpOT_(ptr noundef nonnull align 8 dereferenceable(48) @s, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %49 = getelementptr inbounds { ptr, i8 }, ptr %6, i32 0, i32 0
  %50 = extractvalue { ptr, i8 } %48, 0
  store ptr %50, ptr %49, align 8
  %51 = getelementptr inbounds { ptr, i8 }, ptr %6, i32 0, i32 1
  %52 = extractvalue { ptr, i8 } %48, 1
  store i8 %52, ptr %51, align 8
  br label %56

53:                                               ; preds = %37
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %2, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %53, %47
  br label %57

57:                                               ; preds = %56
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %5, align 4, !tbaa !5
  br label %32, !llvm.loop !10

60:                                               ; preds = %36
  br label %61

61:                                               ; preds = %60
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %3, align 4, !tbaa !5
  br label %21, !llvm.loop !12

64:                                               ; preds = %25
  %65 = load i32, ptr @mx, align 4, !tbaa !5
  %66 = sub nsw i32 %65, 1
  store i32 %66, ptr @mx, align 4, !tbaa !5
  %67 = load i32, ptr @y, align 4, !tbaa !5
  %68 = load i32, ptr @my, align 4, !tbaa !5
  %69 = sub nsw i32 %67, %68
  store i32 %69, ptr @my, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %7) #8
  call void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  call void @llvm.lifetime.start.p0(i64 12, ptr %8) #8
  %70 = getelementptr inbounds %struct.P, ptr %8, i32 0, i32 0
  %71 = load i32, ptr @mx, align 4, !tbaa !5
  store i32 %71, ptr %70, align 4, !tbaa !13
  %72 = getelementptr inbounds %struct.P, ptr %8, i32 0, i32 1
  %73 = load i32, ptr @my, align 4, !tbaa !5
  store i32 %73, ptr %72, align 4, !tbaa !15
  %74 = getelementptr inbounds %struct.P, ptr %8, i32 0, i32 2
  store i32 0, ptr %74, align 4, !tbaa !16
  invoke void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 4 dereferenceable(12) %8)
          to label %75 unwind label %88

75:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #8
  br label %76

76:                                               ; preds = %197, %75
  %77 = invoke noundef i64 @_ZNKSt5queueI1PSt5dequeIS0_SaIS0_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %78 unwind label %92

78:                                               ; preds = %76
  %79 = icmp ne i64 %77, 0
  br i1 %79, label %80, label %199

80:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #8
  %81 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %82 unwind label %96

82:                                               ; preds = %80
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %81, i64 12, i1 false), !tbaa.struct !17
  invoke void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %83 unwind label %96

83:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 -1, ptr %12, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %189, %83
  %85 = load i32, ptr %12, align 4, !tbaa !5
  %86 = icmp sle i32 %85, 1
  br i1 %86, label %100, label %87

87:                                               ; preds = %84
  store i32 10, ptr %4, align 4
  br label %192

88:                                               ; preds = %64
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %9, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #8
  br label %202

92:                                               ; preds = %76
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %9, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %10, align 4
  br label %202

96:                                               ; preds = %82, %80
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %9, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %10, align 4
  br label %198

100:                                              ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 -1, ptr %13, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %178, %100
  %102 = load i32, ptr %13, align 4, !tbaa !5
  %103 = icmp sle i32 %102, 1
  br i1 %103, label %105, label %104

104:                                              ; preds = %101
  store i32 13, ptr %4, align 4
  br label %186

105:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %106 = getelementptr inbounds %struct.P, ptr %11, i32 0, i32 0
  %107 = load i32, ptr %106, align 4, !tbaa !13
  %108 = load i32, ptr %12, align 4, !tbaa !5
  %109 = add nsw i32 %107, %108
  store i32 %109, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %110 = getelementptr inbounds %struct.P, ptr %11, i32 0, i32 1
  %111 = load i32, ptr %110, align 4, !tbaa !15
  %112 = load i32, ptr %13, align 4, !tbaa !5
  %113 = add nsw i32 %111, %112
  store i32 %113, ptr %15, align 4, !tbaa !5
  %114 = load i32, ptr %14, align 4, !tbaa !5
  %115 = load i32, ptr %15, align 4, !tbaa !5
  %116 = call noundef zeroext i1 @_Z5validii(i32 noundef %114, i32 noundef %115)
  br i1 %116, label %118, label %117

117:                                              ; preds = %105
  store i32 15, ptr %4, align 4
  br label %175

118:                                              ; preds = %105
  %119 = load i32, ptr %15, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %120
  %122 = load i32, ptr %14, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [110 x i8], ptr %121, i64 0, i64 %123
  %125 = load i8, ptr %124, align 1, !tbaa !9
  %126 = sext i8 %125 to i32
  %127 = icmp eq i32 %126, 42
  br i1 %127, label %138, label %128

128:                                              ; preds = %118
  %129 = load i32, ptr %15, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %130
  %132 = load i32, ptr %14, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [110 x i8], ptr %131, i64 0, i64 %133
  %135 = load i8, ptr %134, align 1, !tbaa !9
  %136 = sext i8 %135 to i32
  %137 = icmp eq i32 %136, 77
  br i1 %137, label %138, label %139

138:                                              ; preds = %128, %118
  store i32 15, ptr %4, align 4
  br label %175

139:                                              ; preds = %128
  %140 = load i32, ptr %15, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %141
  %143 = load i32, ptr %14, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [110 x i8], ptr %142, i64 0, i64 %144
  store i8 77, ptr %145, align 1, !tbaa !9
  %146 = load i32, ptr %2, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %2, align 4, !tbaa !5
  %148 = load i32, ptr %2, align 4, !tbaa !5
  %149 = load i32, ptr @x, align 4, !tbaa !5
  %150 = load i32, ptr @y, align 4, !tbaa !5
  %151 = mul nsw i32 %149, %150
  %152 = icmp eq i32 %148, %151
  br i1 %152, label %153, label %165

153:                                              ; preds = %139
  %154 = getelementptr inbounds %struct.P, ptr %11, i32 0, i32 2
  %155 = load i32, ptr %154, align 4, !tbaa !16
  %156 = add nsw i32 %155, 1
  %157 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %156)
          to label %158 unwind label %161

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

160:                                              ; preds = %158
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %175

161:                                              ; preds = %158, %153
  %162 = landingpad { ptr, i32 }
          cleanup
  %163 = extractvalue { ptr, i32 } %162, 0
  store ptr %163, ptr %9, align 8
  %164 = extractvalue { ptr, i32 } %162, 1
  store i32 %164, ptr %10, align 4
  br label %185

165:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #8
  %166 = getelementptr inbounds %struct.P, ptr %16, i32 0, i32 0
  %167 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %167, ptr %166, align 4, !tbaa !13
  %168 = getelementptr inbounds %struct.P, ptr %16, i32 0, i32 1
  %169 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %169, ptr %168, align 4, !tbaa !15
  %170 = getelementptr inbounds %struct.P, ptr %16, i32 0, i32 2
  %171 = getelementptr inbounds %struct.P, ptr %11, i32 0, i32 2
  %172 = load i32, ptr %171, align 4, !tbaa !16
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %170, align 4, !tbaa !16
  invoke void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 4 dereferenceable(12) %16)
          to label %174 unwind label %181

174:                                              ; preds = %165
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #8
  store i32 0, ptr %4, align 4
  br label %175

175:                                              ; preds = %174, %160, %138, %117
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  %176 = load i32, ptr %4, align 4
  switch i32 %176, label %186 [
    i32 0, label %177
    i32 15, label %178
  ]

177:                                              ; preds = %175
  br label %178

178:                                              ; preds = %177, %175
  %179 = load i32, ptr %13, align 4, !tbaa !5
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %13, align 4, !tbaa !5
  br label %101, !llvm.loop !18

181:                                              ; preds = %165
  %182 = landingpad { ptr, i32 }
          cleanup
  %183 = extractvalue { ptr, i32 } %182, 0
  store ptr %183, ptr %9, align 8
  %184 = extractvalue { ptr, i32 } %182, 1
  store i32 %184, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #8
  br label %185

185:                                              ; preds = %181, %161
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %198

186:                                              ; preds = %175, %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  %187 = load i32, ptr %4, align 4
  switch i32 %187, label %192 [
    i32 13, label %188
  ]

188:                                              ; preds = %186
  br label %189

189:                                              ; preds = %188
  %190 = load i32, ptr %12, align 4, !tbaa !5
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %12, align 4, !tbaa !5
  br label %84, !llvm.loop !19

192:                                              ; preds = %186, %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  %193 = load i32, ptr %4, align 4
  switch i32 %193, label %195 [
    i32 10, label %194
  ]

194:                                              ; preds = %192
  store i32 0, ptr %4, align 4
  br label %195

195:                                              ; preds = %194, %192
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #8
  %196 = load i32, ptr %4, align 4
  switch i32 %196, label %200 [
    i32 0, label %197
  ]

197:                                              ; preds = %195
  br label %76, !llvm.loop !20

198:                                              ; preds = %185, %96
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #8
  br label %202

199:                                              ; preds = %78
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %200

200:                                              ; preds = %199, %195
  call void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  %201 = load i32, ptr %1, align 4
  ret i32 %201

202:                                              ; preds = %198, %92, %88
  call void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %203

203:                                              ; preds = %202
  %204 = load ptr, ptr %9, align 8
  %205 = load i32, ptr %10, align 4
  %206 = insertvalue { ptr, i32 } poison, ptr %204, 0
  %207 = insertvalue { ptr, i32 } %206, i32 %205, 1
  resume { ptr, i32 } %207
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull) #3

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE7emplaceIJRiS7_EEES0_ISt23_Rb_tree_const_iteratorIS1_EbEDpOT_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt5queueI1PSt5dequeIS0_SaIS0_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80)) #1 align 2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { 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 #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS1P", !6, i64 0, !6, i64 4, !6, i64 8}
!15 = !{!14, !6, i64 4}
!16 = !{!14, !6, i64 8}
!17 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5}
!18 = distinct !{!18, !11}
!19 = distinct !{!19, !11}
!20 = distinct !{!20, !11}


; 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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<P, std::allocator<P>>::_Deque_impl" }
%"struct.std::_Deque_base<P, std::allocator<P>>::_Deque_impl" = type { %"struct.std::_Deque_base<P, std::allocator<P>>::_Deque_impl_data" }
%"struct.std::_Deque_base<P, std::allocator<P>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%struct.P = type { i32, i32, i32 }

@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@mx = external dso_local global i32, align 4
@my = external dso_local global i32, align 4
@g = external dso_local global [110 x [110 x i8]], align 16
@s = external dso_local global %"class.std::set", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5validii(i32 noundef, i32 noundef) local_unnamed_addr #1

; 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 #2 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)) #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::queue", align 8
  %4 = alloca %struct.P, align 4
  %5 = alloca %struct.P, align 4
  %6 = 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) @x)
  %7 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 4 dereferenceable(4) @y)
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) @mx)
  %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) @my)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !5
  %10 = load i32, ptr @y, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph75, label %._crit_edge76

._crit_edge76:                                    ; preds = %._crit_edge, %0
  %.029.lcssa = phi i32 [ 0, %0 ], [ %.130.lcssa, %._crit_edge ]
  %.lcssa = phi i32 [ %10, %0 ], [ %27, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %12 = load i32, ptr @mx, align 4, !tbaa !5
  %13 = add nsw i32 %12, -1
  store i32 %13, ptr @mx, align 4, !tbaa !5
  %14 = load i32, ptr @my, align 4, !tbaa !5
  %15 = sub nsw i32 %.lcssa, %14
  store i32 %15, ptr @my, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #7
  call void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #7
  %16 = load i32, ptr @mx, align 4, !tbaa !5
  store i32 %16, ptr %4, align 4, !tbaa !9
  %17 = getelementptr inbounds i8, ptr %4, i64 4
  %18 = load i32, ptr @my, align 4, !tbaa !5
  store i32 %18, ptr %17, align 4, !tbaa !11
  %19 = getelementptr inbounds i8, ptr %4, i64 8
  store i32 0, ptr %19, align 4, !tbaa !12
  invoke void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(12) %4)
          to label %45 unwind label %58

.lr.ph75:                                         ; preds = %0, %._crit_edge
  %.02973 = phi i32 [ %.130.lcssa, %._crit_edge ], [ 0, %0 ]
  %storemerge72 = phi i32 [ %26, %._crit_edge ], [ 0, %0 ]
  %20 = sext i32 %storemerge72 to i64
  %21 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %20
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %21)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  %23 = load i32, ptr @x, align 4, !tbaa !5
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %40, %.lr.ph75
  %.130.lcssa = phi i32 [ %.02973, %.lr.ph75 ], [ %.231, %40 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %1, align 4, !tbaa !5
  %27 = load i32, ptr @y, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %.lr.ph75, label %._crit_edge76, !llvm.loop !13

.lr.ph:                                           ; preds = %.lr.ph75, %40
  %29 = phi i32 [ %41, %40 ], [ %23, %.lr.ph75 ]
  %.13071 = phi i32 [ %.231, %40 ], [ %.02973, %.lr.ph75 ]
  %storemerge5370 = phi i32 [ %43, %40 ], [ 0, %.lr.ph75 ]
  %30 = load i32, ptr %1, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = sext i32 %storemerge5370 to i64
  %33 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %31, i64 %32
  %34 = load i8, ptr %33, align 1, !tbaa !15
  %35 = icmp eq i8 %34, 46
  br i1 %35, label %36, label %38

36:                                               ; preds = %.lr.ph
  %37 = call { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE7emplaceIJRiS7_EEES0_ISt23_Rb_tree_const_iteratorIS1_EbEDpOT_(ptr noundef nonnull align 8 dereferenceable(48) @s, ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  %.pre94 = load i32, ptr @x, align 4, !tbaa !5
  br label %40

38:                                               ; preds = %.lr.ph
  %39 = add nsw i32 %.13071, 1
  br label %40

40:                                               ; preds = %36, %38
  %41 = phi i32 [ %.pre94, %36 ], [ %29, %38 ]
  %42 = phi i32 [ %.pre, %36 ], [ %storemerge5370, %38 ]
  %.231 = phi i32 [ %.13071, %36 ], [ %39, %38 ]
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %2, align 4, !tbaa !5
  %44 = icmp slt i32 %43, %41
  br i1 %44, label %.lr.ph, label %._crit_edge, !llvm.loop !16

45:                                               ; preds = %._crit_edge76
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #7
  %46 = call noundef i64 @_ZNKSt5queueI1PSt5dequeIS0_SaIS0_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %.not83 = icmp eq i64 %46, 0
  br i1 %.not83, label %.thread62, label %.lr.ph86

.lr.ph86:                                         ; preds = %45
  %47 = getelementptr inbounds i8, ptr %5, i64 4
  %48 = getelementptr inbounds i8, ptr %5, i64 8
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph86, %.loopexit
  %.33284 = phi i32 [ %.029.lcssa, %.lr.ph86 ], [ %.635.ph.2.2, %.loopexit ]
  %49 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %.sroa.0.0.copyload = load i32, ptr %49, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %49, i64 4
  %.sroa.5.0.copyload = load i32, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !5
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %49, i64 8
  %.sroa.6.0.copyload = load i32, ptr %.sroa.6.0..sroa_idx, align 4, !tbaa !5
  call void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %50 = add nsw i32 %.sroa.6.0.copyload, 1
  %51 = sext i32 %.sroa.5.0.copyload to i64
  %52 = sext i32 %.sroa.0.0.copyload to i64
  %53 = add nsw i64 %52, -1
  %54 = add nsw i64 %51, -1
  %55 = trunc nsw i64 %54 to i32
  %56 = trunc nsw i64 %53 to i32
  %57 = call noundef zeroext i1 @_Z5validii(i32 noundef %56, i32 noundef %55)
  br i1 %57, label %60, label %77

58:                                               ; preds = %._crit_edge76
  %59 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #7
  br label %186

60:                                               ; preds = %.preheader
  %61 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %54, i64 %53
  %62 = load i8, ptr %61, align 1, !tbaa !15
  switch i8 %62, label %63 [
    i8 42, label %77
    i8 77, label %77
  ]

63:                                               ; preds = %60
  store i8 77, ptr %61, align 1, !tbaa !15
  %64 = add nsw i32 %.33284, 1
  %65 = load i32, ptr @x, align 4, !tbaa !5
  %66 = load i32, ptr @y, align 4, !tbaa !5
  %67 = mul nsw i32 %66, %65
  %68 = icmp eq i32 %64, %67
  br i1 %68, label %69, label %75

69:                                               ; preds = %175, %162, %149, %135, %122, %109, %97, %82, %63
  %70 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %50)
          to label %71 unwind label %73

71:                                               ; preds = %69
  %72 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %.thread62 unwind label %73

73:                                               ; preds = %71, %69
  %74 = landingpad { ptr, i32 }
          cleanup
  br label %186

75:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #7
  store i32 %56, ptr %5, align 4, !tbaa !9
  store i32 %55, ptr %47, align 4, !tbaa !11
  store i32 %50, ptr %48, align 4, !tbaa !12
  invoke void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %76 unwind label %184

76:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  br label %77

77:                                               ; preds = %76, %.preheader, %60, %60
  %.635.ph = phi i32 [ %.33284, %60 ], [ %.33284, %60 ], [ %.33284, %.preheader ], [ %64, %76 ]
  %78 = call noundef zeroext i1 @_Z5validii(i32 noundef %56, i32 noundef %.sroa.5.0.copyload)
  br i1 %78, label %79, label %90

79:                                               ; preds = %77
  %80 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %51, i64 %53
  %81 = load i8, ptr %80, align 1, !tbaa !15
  switch i8 %81, label %82 [
    i8 42, label %90
    i8 77, label %90
  ]

82:                                               ; preds = %79
  store i8 77, ptr %80, align 1, !tbaa !15
  %83 = add nsw i32 %.635.ph, 1
  %84 = load i32, ptr @x, align 4, !tbaa !5
  %85 = load i32, ptr @y, align 4, !tbaa !5
  %86 = mul nsw i32 %85, %84
  %87 = icmp eq i32 %83, %86
  br i1 %87, label %69, label %88

88:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #7
  store i32 %56, ptr %5, align 4, !tbaa !9
  store i32 %.sroa.5.0.copyload, ptr %47, align 4, !tbaa !11
  store i32 %50, ptr %48, align 4, !tbaa !12
  invoke void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %89 unwind label %184

89:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  br label %90

90:                                               ; preds = %89, %79, %79, %77
  %.635.ph.1 = phi i32 [ %.635.ph, %79 ], [ %.635.ph, %79 ], [ %.635.ph, %77 ], [ %83, %89 ]
  %91 = add nsw i64 %51, 1
  %92 = trunc nsw i64 %91 to i32
  %93 = call noundef zeroext i1 @_Z5validii(i32 noundef %56, i32 noundef %92)
  br i1 %93, label %94, label %.preheader.1

94:                                               ; preds = %90
  %95 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %91, i64 %53
  %96 = load i8, ptr %95, align 1, !tbaa !15
  switch i8 %96, label %97 [
    i8 42, label %.preheader.1
    i8 77, label %.preheader.1
  ]

97:                                               ; preds = %94
  store i8 77, ptr %95, align 1, !tbaa !15
  %98 = add nsw i32 %.635.ph.1, 1
  %99 = load i32, ptr @x, align 4, !tbaa !5
  %100 = load i32, ptr @y, align 4, !tbaa !5
  %101 = mul nsw i32 %100, %99
  %102 = icmp eq i32 %98, %101
  br i1 %102, label %69, label %103

103:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #7
  store i32 %56, ptr %5, align 4, !tbaa !9
  store i32 %92, ptr %47, align 4, !tbaa !11
  store i32 %50, ptr %48, align 4, !tbaa !12
  invoke void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %104 unwind label %184

104:                                              ; preds = %103
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  br label %.preheader.1

.preheader.1:                                     ; preds = %104, %94, %94, %90
  %.635.ph.2 = phi i32 [ %.635.ph.1, %94 ], [ %.635.ph.1, %94 ], [ %.635.ph.1, %90 ], [ %98, %104 ]
  %105 = call noundef zeroext i1 @_Z5validii(i32 noundef %.sroa.0.0.copyload, i32 noundef %55)
  br i1 %105, label %106, label %117

106:                                              ; preds = %.preheader.1
  %107 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %54, i64 %52
  %108 = load i8, ptr %107, align 1, !tbaa !15
  switch i8 %108, label %109 [
    i8 42, label %117
    i8 77, label %117
  ]

109:                                              ; preds = %106
  store i8 77, ptr %107, align 1, !tbaa !15
  %110 = add nsw i32 %.635.ph.2, 1
  %111 = load i32, ptr @x, align 4, !tbaa !5
  %112 = load i32, ptr @y, align 4, !tbaa !5
  %113 = mul nsw i32 %112, %111
  %114 = icmp eq i32 %110, %113
  br i1 %114, label %69, label %115

115:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #7
  store i32 %.sroa.0.0.copyload, ptr %5, align 4, !tbaa !9
  store i32 %55, ptr %47, align 4, !tbaa !11
  store i32 %50, ptr %48, align 4, !tbaa !12
  invoke void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %116 unwind label %184

116:                                              ; preds = %115
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  br label %117

117:                                              ; preds = %116, %106, %106, %.preheader.1
  %.635.ph.192 = phi i32 [ %.635.ph.2, %106 ], [ %.635.ph.2, %106 ], [ %.635.ph.2, %.preheader.1 ], [ %110, %116 ]
  %118 = call noundef zeroext i1 @_Z5validii(i32 noundef %.sroa.0.0.copyload, i32 noundef %.sroa.5.0.copyload)
  br i1 %118, label %119, label %130

119:                                              ; preds = %117
  %120 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %51, i64 %52
  %121 = load i8, ptr %120, align 1, !tbaa !15
  switch i8 %121, label %122 [
    i8 42, label %130
    i8 77, label %130
  ]

122:                                              ; preds = %119
  store i8 77, ptr %120, align 1, !tbaa !15
  %123 = add nsw i32 %.635.ph.192, 1
  %124 = load i32, ptr @x, align 4, !tbaa !5
  %125 = load i32, ptr @y, align 4, !tbaa !5
  %126 = mul nsw i32 %125, %124
  %127 = icmp eq i32 %123, %126
  br i1 %127, label %69, label %128

128:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #7
  store i32 %.sroa.0.0.copyload, ptr %5, align 4, !tbaa !9
  store i32 %.sroa.5.0.copyload, ptr %47, align 4, !tbaa !11
  store i32 %50, ptr %48, align 4, !tbaa !12
  invoke void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %129 unwind label %184

129:                                              ; preds = %128
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  br label %130

130:                                              ; preds = %129, %119, %119, %117
  %.635.ph.1.1 = phi i32 [ %.635.ph.192, %119 ], [ %.635.ph.192, %119 ], [ %.635.ph.192, %117 ], [ %123, %129 ]
  %131 = call noundef zeroext i1 @_Z5validii(i32 noundef %.sroa.0.0.copyload, i32 noundef %92)
  br i1 %131, label %132, label %.preheader.2

132:                                              ; preds = %130
  %133 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %91, i64 %52
  %134 = load i8, ptr %133, align 1, !tbaa !15
  switch i8 %134, label %135 [
    i8 42, label %.preheader.2
    i8 77, label %.preheader.2
  ]

135:                                              ; preds = %132
  store i8 77, ptr %133, align 1, !tbaa !15
  %136 = add nsw i32 %.635.ph.1.1, 1
  %137 = load i32, ptr @x, align 4, !tbaa !5
  %138 = load i32, ptr @y, align 4, !tbaa !5
  %139 = mul nsw i32 %138, %137
  %140 = icmp eq i32 %136, %139
  br i1 %140, label %69, label %141

141:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #7
  store i32 %.sroa.0.0.copyload, ptr %5, align 4, !tbaa !9
  store i32 %92, ptr %47, align 4, !tbaa !11
  store i32 %50, ptr %48, align 4, !tbaa !12
  invoke void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %142 unwind label %184

142:                                              ; preds = %141
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  br label %.preheader.2

.preheader.2:                                     ; preds = %142, %132, %132, %130
  %.635.ph.2.1 = phi i32 [ %.635.ph.1.1, %132 ], [ %.635.ph.1.1, %132 ], [ %.635.ph.1.1, %130 ], [ %136, %142 ]
  %143 = add nsw i64 %52, 1
  %144 = trunc nsw i64 %143 to i32
  %145 = call noundef zeroext i1 @_Z5validii(i32 noundef %144, i32 noundef %55)
  br i1 %145, label %146, label %157

146:                                              ; preds = %.preheader.2
  %147 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %54, i64 %143
  %148 = load i8, ptr %147, align 1, !tbaa !15
  switch i8 %148, label %149 [
    i8 42, label %157
    i8 77, label %157
  ]

149:                                              ; preds = %146
  store i8 77, ptr %147, align 1, !tbaa !15
  %150 = add nsw i32 %.635.ph.2.1, 1
  %151 = load i32, ptr @x, align 4, !tbaa !5
  %152 = load i32, ptr @y, align 4, !tbaa !5
  %153 = mul nsw i32 %152, %151
  %154 = icmp eq i32 %150, %153
  br i1 %154, label %69, label %155

155:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #7
  store i32 %144, ptr %5, align 4, !tbaa !9
  store i32 %55, ptr %47, align 4, !tbaa !11
  store i32 %50, ptr %48, align 4, !tbaa !12
  invoke void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %156 unwind label %184

156:                                              ; preds = %155
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  br label %157

157:                                              ; preds = %156, %146, %146, %.preheader.2
  %.635.ph.293 = phi i32 [ %.635.ph.2.1, %146 ], [ %.635.ph.2.1, %146 ], [ %.635.ph.2.1, %.preheader.2 ], [ %150, %156 ]
  %158 = call noundef zeroext i1 @_Z5validii(i32 noundef %144, i32 noundef %.sroa.5.0.copyload)
  br i1 %158, label %159, label %170

159:                                              ; preds = %157
  %160 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %51, i64 %143
  %161 = load i8, ptr %160, align 1, !tbaa !15
  switch i8 %161, label %162 [
    i8 42, label %170
    i8 77, label %170
  ]

162:                                              ; preds = %159
  store i8 77, ptr %160, align 1, !tbaa !15
  %163 = add nsw i32 %.635.ph.293, 1
  %164 = load i32, ptr @x, align 4, !tbaa !5
  %165 = load i32, ptr @y, align 4, !tbaa !5
  %166 = mul nsw i32 %165, %164
  %167 = icmp eq i32 %163, %166
  br i1 %167, label %69, label %168

168:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #7
  store i32 %144, ptr %5, align 4, !tbaa !9
  store i32 %.sroa.5.0.copyload, ptr %47, align 4, !tbaa !11
  store i32 %50, ptr %48, align 4, !tbaa !12
  invoke void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %169 unwind label %184

169:                                              ; preds = %168
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  br label %170

170:                                              ; preds = %169, %159, %159, %157
  %.635.ph.1.2 = phi i32 [ %.635.ph.293, %159 ], [ %.635.ph.293, %159 ], [ %.635.ph.293, %157 ], [ %163, %169 ]
  %171 = call noundef zeroext i1 @_Z5validii(i32 noundef %144, i32 noundef %92)
  br i1 %171, label %172, label %.loopexit

172:                                              ; preds = %170
  %173 = getelementptr inbounds [110 x [110 x i8]], ptr @g, i64 0, i64 %91, i64 %143
  %174 = load i8, ptr %173, align 1, !tbaa !15
  switch i8 %174, label %175 [
    i8 42, label %.loopexit
    i8 77, label %.loopexit
  ]

175:                                              ; preds = %172
  store i8 77, ptr %173, align 1, !tbaa !15
  %176 = add nsw i32 %.635.ph.1.2, 1
  %177 = load i32, ptr @x, align 4, !tbaa !5
  %178 = load i32, ptr @y, align 4, !tbaa !5
  %179 = mul nsw i32 %178, %177
  %180 = icmp eq i32 %176, %179
  br i1 %180, label %69, label %181

181:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #7
  store i32 %144, ptr %5, align 4, !tbaa !9
  store i32 %92, ptr %47, align 4, !tbaa !11
  store i32 %50, ptr %48, align 4, !tbaa !12
  invoke void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %182 unwind label %184

182:                                              ; preds = %181
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  br label %.loopexit

.loopexit:                                        ; preds = %182, %172, %172, %170
  %.635.ph.2.2 = phi i32 [ %.635.ph.1.2, %172 ], [ %.635.ph.1.2, %172 ], [ %.635.ph.1.2, %170 ], [ %176, %182 ]
  %183 = call noundef i64 @_ZNKSt5queueI1PSt5dequeIS0_SaIS0_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %.not = icmp eq i64 %183, 0
  br i1 %.not, label %.thread62, label %.preheader

184:                                              ; preds = %181, %168, %155, %141, %128, %115, %103, %88, %75
  %185 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  br label %186

.thread62:                                        ; preds = %.loopexit, %45, %71
  call void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #7
  ret i32 0

186:                                              ; preds = %73, %184, %58
  %.pn.pn = phi { ptr, i32 } [ %59, %58 ], [ %74, %73 ], [ %185, %184 ]
  call void @_ZNSt5queueI1PSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn.pn
}

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 #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE7emplaceIJRiS7_EEES0_ISt23_Rb_tree_const_iteratorIS1_EbEDpOT_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt5queueI1PSt5dequeIS0_SaIS0_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #1 align 2

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

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

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

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

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


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