; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/291 Division 2/Problem C (C)

; 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::unordered_set" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"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" }
%"struct.std::pair" = type <{ %"struct.std::__detail::_Node_iterator", i8, [7 x i8] }>
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@l = external dso_local global i32, align 4
@flag = external dso_local global i32, align 4
@c = external dso_local global i8, align 1
@x = external dso_local global %"class.std::unordered_set", align 8
@h = external dso_local global i64, align 8
@MOD = external dso_local global i64, align 8
@p = external dso_local global i64, align 8
@temp = external dso_local global [7000000 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %10 = alloca i64, align 8
  %11 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %12 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %13 = alloca i64, align 8
  %14 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %15 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %16 = alloca i64, align 8
  %17 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %18 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %19 = alloca i64, align 8
  %20 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %21 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %22 = alloca i64, align 8
  %23 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %24 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %25 = alloca i64, align 8
  %26 = alloca %"struct.std::__detail::_Node_iterator", align 8
  store i32 0, ptr %1, align 4
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %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) @m)
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @c)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %63, %0
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %35, label %34

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

35:                                               ; preds = %30
  store i64 0, ptr @h, align 8, !tbaa !9
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @temp)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %44, %35
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [7000000 x i8], ptr @temp, i64 0, i64 %39
  %41 = load i8, ptr %40, align 1, !tbaa !11
  %42 = sext i8 %41 to i32
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %57

44:                                               ; preds = %37
  %45 = load i64, ptr @h, align 8, !tbaa !9
  %46 = mul nsw i64 %45, 11
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [7000000 x i8], ptr @temp, i64 0, i64 %48
  %50 = load i8, ptr %49, align 1, !tbaa !11
  %51 = sext i8 %50 to i64
  %52 = add nsw i64 %46, %51
  %53 = load i64, ptr @MOD, align 8, !tbaa !9
  %54 = srem i64 %52, %53
  store i64 %54, ptr @h, align 8, !tbaa !9
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %3, align 4, !tbaa !5
  br label %37, !llvm.loop !12

57:                                               ; preds = %37
  %58 = call { ptr, i8 } @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(56) @x, ptr noundef nonnull align 8 dereferenceable(8) @h)
  %59 = getelementptr inbounds { ptr, i8 }, ptr %4, i32 0, i32 0
  %60 = extractvalue { ptr, i8 } %58, 0
  store ptr %60, ptr %59, align 8
  %61 = getelementptr inbounds { ptr, i8 }, ptr %4, i32 0, i32 1
  %62 = extractvalue { ptr, i8 } %58, 1
  store i8 %62, ptr %61, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %63

63:                                               ; preds = %57
  %64 = load i32, ptr %2, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %2, align 4, !tbaa !5
  br label %30, !llvm.loop !14

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

67:                                               ; preds = %242, %66
  %68 = load i32, ptr %5, align 4, !tbaa !5
  %69 = load i32, ptr @m, align 4, !tbaa !5
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %72, label %71

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

72:                                               ; preds = %67
  store i64 0, ptr @h, align 8, !tbaa !9
  %73 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @temp)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  store i32 0, ptr @l, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %81, %72
  %75 = load i32, ptr %7, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [7000000 x i8], ptr @temp, i64 0, i64 %76
  %78 = load i8, ptr %77, align 1, !tbaa !11
  %79 = sext i8 %78 to i32
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %81, label %96

81:                                               ; preds = %74
  %82 = load i64, ptr @h, align 8, !tbaa !9
  %83 = mul nsw i64 %82, 11
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [7000000 x i8], ptr @temp, i64 0, i64 %85
  %87 = load i8, ptr %86, align 1, !tbaa !11
  %88 = sext i8 %87 to i64
  %89 = add nsw i64 %83, %88
  %90 = load i64, ptr @MOD, align 8, !tbaa !9
  %91 = srem i64 %89, %90
  store i64 %91, ptr @h, align 8, !tbaa !9
  %92 = load i32, ptr %7, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %7, align 4, !tbaa !5
  %94 = load i32, ptr @l, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr @l, align 4, !tbaa !5
  br label %74, !llvm.loop !15

96:                                               ; preds = %74
  store i64 1, ptr @p, align 8, !tbaa !9
  store i32 0, ptr @flag, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %97 = load i32, ptr @l, align 4, !tbaa !5
  %98 = sub nsw i32 %97, 1
  store i32 %98, ptr %8, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %233, %96
  %100 = load i32, ptr %8, align 4, !tbaa !5
  %101 = icmp sge i32 %100, 0
  br i1 %101, label %103, label %102

102:                                              ; preds = %99
  store i32 12, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %236

103:                                              ; preds = %99
  %104 = load i32, ptr %8, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [7000000 x i8], ptr @temp, i64 0, i64 %105
  %107 = load i8, ptr %106, align 1, !tbaa !11
  %108 = sext i8 %107 to i32
  %109 = icmp eq i32 %108, 97
  br i1 %109, label %110, label %144

110:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %111 = load i64, ptr @h, align 8, !tbaa !9
  %112 = load i64, ptr @p, align 8, !tbaa !9
  %113 = add nsw i64 %111, %112
  %114 = load i64, ptr @MOD, align 8, !tbaa !9
  %115 = srem i64 %113, %114
  store i64 %115, ptr %10, align 8, !tbaa !9
  %116 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE4findERKx(ptr noundef nonnull align 8 dereferenceable(56) @x, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %117 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %9, i32 0, i32 0
  %118 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %117, i32 0, i32 0
  store ptr %116, ptr %118, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %119 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) @x) #6
  %120 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %11, i32 0, i32 0
  %121 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %120, i32 0, i32 0
  store ptr %119, ptr %121, align 8
  %122 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIxLb0EEES3_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br i1 %122, label %123, label %125

123:                                              ; preds = %110
  %124 = 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)
  store i32 1, ptr @flag, align 4, !tbaa !5
  store i32 -1, ptr %8, align 4, !tbaa !5
  br label %143

125:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %126 = load i64, ptr @h, align 8, !tbaa !9
  %127 = load i64, ptr @p, align 8, !tbaa !9
  %128 = add nsw i64 %126, %127
  %129 = load i64, ptr @p, align 8, !tbaa !9
  %130 = add nsw i64 %128, %129
  %131 = load i64, ptr @MOD, align 8, !tbaa !9
  %132 = srem i64 %130, %131
  store i64 %132, ptr %13, align 8, !tbaa !9
  %133 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE4findERKx(ptr noundef nonnull align 8 dereferenceable(56) @x, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %134 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %12, i32 0, i32 0
  %135 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %134, i32 0, i32 0
  store ptr %133, ptr %135, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %136 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) @x) #6
  %137 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %14, i32 0, i32 0
  %138 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %137, i32 0, i32 0
  store ptr %136, ptr %138, align 8
  %139 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIxLb0EEES3_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br i1 %139, label %140, label %142

140:                                              ; preds = %125
  %141 = 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)
  store i32 1, ptr @flag, align 4, !tbaa !5
  store i32 -1, ptr %8, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %140, %125
  br label %143

143:                                              ; preds = %142, %123
  br label %228

144:                                              ; preds = %103
  %145 = load i32, ptr %8, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [7000000 x i8], ptr @temp, i64 0, i64 %146
  %148 = load i8, ptr %147, align 1, !tbaa !11
  %149 = sext i8 %148 to i32
  %150 = icmp eq i32 %149, 98
  br i1 %150, label %151, label %187

151:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %152 = load i64, ptr @h, align 8, !tbaa !9
  %153 = load i64, ptr @p, align 8, !tbaa !9
  %154 = sub nsw i64 %152, %153
  %155 = load i64, ptr @MOD, align 8, !tbaa !9
  %156 = add nsw i64 %154, %155
  %157 = load i64, ptr @MOD, align 8, !tbaa !9
  %158 = srem i64 %156, %157
  store i64 %158, ptr %16, align 8, !tbaa !9
  %159 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE4findERKx(ptr noundef nonnull align 8 dereferenceable(56) @x, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %160 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %15, i32 0, i32 0
  %161 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %160, i32 0, i32 0
  store ptr %159, ptr %161, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %162 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) @x) #6
  %163 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %17, i32 0, i32 0
  %164 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %163, i32 0, i32 0
  store ptr %162, ptr %164, align 8
  %165 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIxLb0EEES3_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br i1 %165, label %166, label %168

166:                                              ; preds = %151
  %167 = 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)
  store i32 1, ptr @flag, align 4, !tbaa !5
  store i32 -1, ptr %8, align 4, !tbaa !5
  br label %186

168:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %169 = load i64, ptr @h, align 8, !tbaa !9
  %170 = load i64, ptr @p, align 8, !tbaa !9
  %171 = add nsw i64 %169, %170
  %172 = load i64, ptr @MOD, align 8, !tbaa !9
  %173 = add nsw i64 %171, %172
  %174 = load i64, ptr @MOD, align 8, !tbaa !9
  %175 = srem i64 %173, %174
  store i64 %175, ptr %19, align 8, !tbaa !9
  %176 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE4findERKx(ptr noundef nonnull align 8 dereferenceable(56) @x, ptr noundef nonnull align 8 dereferenceable(8) %19)
  %177 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %18, i32 0, i32 0
  %178 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %177, i32 0, i32 0
  store ptr %176, ptr %178, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %179 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) @x) #6
  %180 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %20, i32 0, i32 0
  %181 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %180, i32 0, i32 0
  store ptr %179, ptr %181, align 8
  %182 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIxLb0EEES3_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br i1 %182, label %183, label %185

183:                                              ; preds = %168
  %184 = 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)
  store i32 1, ptr @flag, align 4, !tbaa !5
  store i32 -1, ptr %8, align 4, !tbaa !5
  br label %185

185:                                              ; preds = %183, %168
  br label %186

186:                                              ; preds = %185, %166
  br label %227

187:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %188 = load i64, ptr @h, align 8, !tbaa !9
  %189 = load i64, ptr @p, align 8, !tbaa !9
  %190 = sub nsw i64 %188, %189
  %191 = load i64, ptr @MOD, align 8, !tbaa !9
  %192 = add nsw i64 %190, %191
  %193 = load i64, ptr @MOD, align 8, !tbaa !9
  %194 = srem i64 %192, %193
  store i64 %194, ptr %22, align 8, !tbaa !9
  %195 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE4findERKx(ptr noundef nonnull align 8 dereferenceable(56) @x, ptr noundef nonnull align 8 dereferenceable(8) %22)
  %196 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %21, i32 0, i32 0
  %197 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %196, i32 0, i32 0
  store ptr %195, ptr %197, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %198 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) @x) #6
  %199 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %23, i32 0, i32 0
  %200 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %199, i32 0, i32 0
  store ptr %198, ptr %200, align 8
  %201 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIxLb0EEES3_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br i1 %201, label %202, label %204

202:                                              ; preds = %187
  %203 = 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)
  store i32 1, ptr @flag, align 4, !tbaa !5
  store i32 -1, ptr %8, align 4, !tbaa !5
  br label %226

204:                                              ; preds = %187
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %205 = load i64, ptr @h, align 8, !tbaa !9
  %206 = load i64, ptr @p, align 8, !tbaa !9
  %207 = sub nsw i64 %205, %206
  %208 = load i64, ptr @p, align 8, !tbaa !9
  %209 = sub nsw i64 %207, %208
  %210 = load i64, ptr @MOD, align 8, !tbaa !9
  %211 = add nsw i64 %209, %210
  %212 = load i64, ptr @MOD, align 8, !tbaa !9
  %213 = add nsw i64 %211, %212
  %214 = load i64, ptr @MOD, align 8, !tbaa !9
  %215 = srem i64 %213, %214
  store i64 %215, ptr %25, align 8, !tbaa !9
  %216 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE4findERKx(ptr noundef nonnull align 8 dereferenceable(56) @x, ptr noundef nonnull align 8 dereferenceable(8) %25)
  %217 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %24, i32 0, i32 0
  %218 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %217, i32 0, i32 0
  store ptr %216, ptr %218, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %219 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) @x) #6
  %220 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %26, i32 0, i32 0
  %221 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %220, i32 0, i32 0
  store ptr %219, ptr %221, align 8
  %222 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIxLb0EEES3_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br i1 %222, label %223, label %225

223:                                              ; preds = %204
  %224 = 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)
  store i32 1, ptr @flag, align 4, !tbaa !5
  store i32 -1, ptr %8, align 4, !tbaa !5
  br label %225

225:                                              ; preds = %223, %204
  br label %226

226:                                              ; preds = %225, %202
  br label %227

227:                                              ; preds = %226, %186
  br label %228

228:                                              ; preds = %227, %143
  %229 = load i64, ptr @p, align 8, !tbaa !9
  %230 = mul nsw i64 %229, 11
  %231 = load i64, ptr @MOD, align 8, !tbaa !9
  %232 = srem i64 %230, %231
  store i64 %232, ptr @p, align 8, !tbaa !9
  br label %233

233:                                              ; preds = %228
  %234 = load i32, ptr %8, align 4, !tbaa !5
  %235 = add nsw i32 %234, -1
  store i32 %235, ptr %8, align 4, !tbaa !5
  br label %99, !llvm.loop !16

236:                                              ; preds = %102
  %237 = load i32, ptr @flag, align 4, !tbaa !5
  %238 = icmp eq i32 %237, 0
  br i1 %238, label %239, label %241

239:                                              ; preds = %236
  %240 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.4)
  br label %241

241:                                              ; preds = %239, %236
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %242

242:                                              ; preds = %241
  %243 = load i32, ptr %5, align 4, !tbaa !5
  %244 = add nsw i32 %243, 1
  store i32 %244, ptr %5, align 4, !tbaa !5
  br label %67, !llvm.loop !17

245:                                              ; preds = %71
  ret i32 0
}

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

declare i32 @__isoc99_scanf(ptr noundef, ...) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

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

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

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

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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}


; 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::unordered_set" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"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" }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@l = external dso_local local_unnamed_addr global i32, align 4
@flag = external dso_local local_unnamed_addr global i32, align 4
@c = external dso_local global i8, align 1
@x = external dso_local global %"class.std::unordered_set", align 8
@h = external dso_local global i64, align 8
@MOD = external dso_local local_unnamed_addr global i64, align 8
@p = external dso_local local_unnamed_addr global i64, align 8
@temp = external dso_local global [7000000 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %2 = alloca i64, align 8
  %3 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %4 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %5 = alloca i64, align 8
  %6 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %7 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %8 = alloca i64, align 8
  %9 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %10 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %11 = alloca i64, align 8
  %12 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %13 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %14 = alloca i64, align 8
  %15 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %16 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %17 = alloca i64, align 8
  %18 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %19 = 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) @n)
  %20 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %21 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @c)
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph27, label %.preheader

.preheader:                                       ; preds = %38, %0
  %24 = load i32, ptr @m, align 4, !tbaa !5
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.lr.ph44, label %._crit_edge45

.lr.ph27:                                         ; preds = %0, %38
  %.01625 = phi i32 [ %40, %38 ], [ 0, %0 ]
  store i64 0, ptr @h, align 8, !tbaa !9
  %26 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @temp)
  %27 = load i8, ptr @temp, align 16, !tbaa !11
  %.not2023 = icmp eq i8 %27, 0
  br i1 %.not2023, label %38, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph27
  %h.promoted = load i64, ptr @h, align 8, !tbaa !9
  %28 = load i64, ptr @MOD, align 8, !tbaa !9
  br label %29

29:                                               ; preds = %.lr.ph, %29
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %29 ]
  %30 = phi i8 [ %27, %.lr.ph ], [ %37, %29 ]
  %31 = phi i64 [ %h.promoted, %.lr.ph ], [ %35, %29 ]
  %32 = mul nsw i64 %31, 11
  %33 = sext i8 %30 to i64
  %34 = add nsw i64 %32, %33
  %35 = srem i64 %34, %28
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %36 = getelementptr inbounds [7000000 x i8], ptr @temp, i64 0, i64 %indvars.iv.next
  %37 = load i8, ptr %36, align 1, !tbaa !11
  %.not20 = icmp eq i8 %37, 0
  br i1 %.not20, label %._crit_edge, label %29, !llvm.loop !12

._crit_edge:                                      ; preds = %29
  store i64 %35, ptr @h, align 8, !tbaa !9
  br label %38

38:                                               ; preds = %._crit_edge, %.lr.ph27
  %39 = tail call { ptr, i8 } @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(56) @x, ptr noundef nonnull align 8 dereferenceable(8) @h)
  %40 = add nuw nsw i32 %.01625, 1
  %41 = load i32, ptr @n, align 4, !tbaa !5
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %.lr.ph27, label %.preheader, !llvm.loop !14

._crit_edge45:                                    ; preds = %130, %.preheader
  ret i32 0

.lr.ph44:                                         ; preds = %.preheader, %130
  %.01543 = phi i32 [ %131, %130 ], [ 0, %.preheader ]
  store i64 0, ptr @h, align 8, !tbaa !9
  %43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @temp)
  %44 = load i8, ptr @temp, align 16, !tbaa !11
  %.not30 = icmp eq i8 %44, 0
  br i1 %.not30, label %._crit_edge42.thread, label %.lr.ph34

.lr.ph34:                                         ; preds = %.lr.ph44
  %h.promoted29 = load i64, ptr @h, align 8, !tbaa !9
  %45 = load i64, ptr @MOD, align 8, !tbaa !9
  br label %46

46:                                               ; preds = %.lr.ph34, %46
  %indvars.iv48 = phi i64 [ 0, %.lr.ph34 ], [ %indvars.iv.next49, %46 ]
  %47 = phi i8 [ %44, %.lr.ph34 ], [ %55, %46 ]
  %.01432 = phi i32 [ 0, %.lr.ph34 ], [ %53, %46 ]
  %48 = phi i64 [ %h.promoted29, %.lr.ph34 ], [ %52, %46 ]
  %49 = mul nsw i64 %48, 11
  %50 = sext i8 %47 to i64
  %51 = add nsw i64 %49, %50
  %52 = srem i64 %51, %45
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %53 = add nuw nsw i32 %.01432, 1
  %54 = getelementptr inbounds [7000000 x i8], ptr @temp, i64 0, i64 %indvars.iv.next49
  %55 = load i8, ptr %54, align 1, !tbaa !11
  %.not = icmp eq i8 %55, 0
  br i1 %.not, label %.lr.ph41.preheader, label %46, !llvm.loop !15

._crit_edge42.thread:                             ; preds = %.lr.ph44
  store i32 0, ptr @l, align 4, !tbaa !5
  store i64 1, ptr @p, align 8, !tbaa !9
  store i32 0, ptr @flag, align 4, !tbaa !5
  br label %128

.lr.ph41.preheader:                               ; preds = %46
  store i64 %52, ptr @h, align 8, !tbaa !9
  store i32 %53, ptr @l, align 4, !tbaa !5
  store i64 1, ptr @p, align 8, !tbaa !9
  store i32 0, ptr @flag, align 4, !tbaa !5
  br label %.lr.ph41

._crit_edge42:                                    ; preds = %122, %.thread52
  %.pre = load i32, ptr @flag, align 4, !tbaa !5
  %56 = icmp eq i32 %.pre, 0
  br i1 %56, label %128, label %130

.lr.ph41:                                         ; preds = %.lr.ph41.preheader, %122
  %57 = phi i64 [ %126, %122 ], [ 1, %.lr.ph41.preheader ]
  %.039.in = phi i32 [ %.039, %122 ], [ %53, %.lr.ph41.preheader ]
  %.039 = add nsw i32 %.039.in, -1
  %58 = zext nneg i32 %.039 to i64
  %59 = getelementptr inbounds [7000000 x i8], ptr @temp, i64 0, i64 %58
  %60 = load i8, ptr %59, align 1, !tbaa !11
  switch i8 %60, label %97 [
    i8 97, label %61
    i8 98, label %78
  ]

61:                                               ; preds = %.lr.ph41
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %62 = load i64, ptr @h, align 8, !tbaa !9
  %63 = add nsw i64 %57, %62
  %64 = load i64, ptr @MOD, align 8, !tbaa !9
  %65 = srem i64 %63, %64
  store i64 %65, ptr %2, align 8, !tbaa !9
  %66 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE4findERKx(ptr noundef nonnull align 8 dereferenceable(56) @x, ptr noundef nonnull align 8 dereferenceable(8) %2)
  store ptr %66, ptr %1, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %67 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) @x) #7
  store ptr %67, ptr %3, align 8
  %68 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIxLb0EEES3_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  br i1 %68, label %.thread52, label %69

69:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %70 = load i64, ptr @h, align 8, !tbaa !9
  %71 = load i64, ptr @p, align 8, !tbaa !9
  %reass.add19 = shl i64 %71, 1
  %72 = add i64 %reass.add19, %70
  %73 = load i64, ptr @MOD, align 8, !tbaa !9
  %74 = srem i64 %72, %73
  store i64 %74, ptr %5, align 8, !tbaa !9
  %75 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE4findERKx(ptr noundef nonnull align 8 dereferenceable(56) @x, ptr noundef nonnull align 8 dereferenceable(8) %5)
  store ptr %75, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %76 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) @x) #7
  store ptr %76, ptr %6, align 8
  %77 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIxLb0EEES3_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br i1 %77, label %.thread52, label %122

78:                                               ; preds = %.lr.ph41
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %79 = load i64, ptr @h, align 8, !tbaa !9
  %80 = sub i64 %79, %57
  %81 = load i64, ptr @MOD, align 8, !tbaa !9
  %82 = add nsw i64 %80, %81
  %83 = srem i64 %82, %81
  store i64 %83, ptr %8, align 8, !tbaa !9
  %84 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE4findERKx(ptr noundef nonnull align 8 dereferenceable(56) @x, ptr noundef nonnull align 8 dereferenceable(8) %8)
  store ptr %84, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %85 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) @x) #7
  store ptr %85, ptr %9, align 8
  %86 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIxLb0EEES3_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br i1 %86, label %.thread52, label %87

87:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %88 = load i64, ptr @h, align 8, !tbaa !9
  %89 = load i64, ptr @p, align 8, !tbaa !9
  %90 = add nsw i64 %89, %88
  %91 = load i64, ptr @MOD, align 8, !tbaa !9
  %92 = add nsw i64 %90, %91
  %93 = srem i64 %92, %91
  store i64 %93, ptr %11, align 8, !tbaa !9
  %94 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE4findERKx(ptr noundef nonnull align 8 dereferenceable(56) @x, ptr noundef nonnull align 8 dereferenceable(8) %11)
  store ptr %94, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  %95 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) @x) #7
  store ptr %95, ptr %12, align 8
  %96 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIxLb0EEES3_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  br i1 %96, label %.thread52, label %122

97:                                               ; preds = %.lr.ph41
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #7
  %98 = load i64, ptr @h, align 8, !tbaa !9
  %99 = sub i64 %98, %57
  %100 = load i64, ptr @MOD, align 8, !tbaa !9
  %101 = add nsw i64 %99, %100
  %102 = srem i64 %101, %100
  store i64 %102, ptr %14, align 8, !tbaa !9
  %103 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE4findERKx(ptr noundef nonnull align 8 dereferenceable(56) @x, ptr noundef nonnull align 8 dereferenceable(8) %14)
  store ptr %103, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #7
  %104 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) @x) #7
  store ptr %104, ptr %15, align 8
  %105 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIxLb0EEES3_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  br i1 %105, label %.thread52, label %106

106:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #7
  %107 = load i64, ptr @h, align 8, !tbaa !9
  %108 = load i64, ptr @p, align 8, !tbaa !9
  %109 = shl i64 %108, 1
  %110 = sub i64 %107, %109
  %111 = load i64, ptr @MOD, align 8, !tbaa !9
  %reass.add = shl i64 %111, 1
  %112 = add i64 %110, %reass.add
  %113 = srem i64 %112, %111
  store i64 %113, ptr %17, align 8, !tbaa !9
  %114 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE4findERKx(ptr noundef nonnull align 8 dereferenceable(56) @x, ptr noundef nonnull align 8 dereferenceable(8) %17)
  store ptr %114, ptr %16, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #7
  %115 = call ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) @x) #7
  store ptr %115, ptr %18, align 8
  %116 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIxLb0EEES3_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #7
  br i1 %116, label %.thread52, label %122

.thread52:                                        ; preds = %106, %97, %87, %78, %69, %61
  %117 = 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)
  store i32 1, ptr @flag, align 4, !tbaa !5
  %118 = load i64, ptr @p, align 8, !tbaa !9
  %119 = mul nsw i64 %118, 11
  %120 = load i64, ptr @MOD, align 8, !tbaa !9
  %121 = srem i64 %119, %120
  store i64 %121, ptr @p, align 8, !tbaa !9
  br label %._crit_edge42

122:                                              ; preds = %87, %106, %69
  %123 = load i64, ptr @p, align 8, !tbaa !9
  %124 = mul nsw i64 %123, 11
  %125 = load i64, ptr @MOD, align 8, !tbaa !9
  %126 = srem i64 %124, %125
  store i64 %126, ptr @p, align 8, !tbaa !9
  %127 = icmp sgt i32 %.039.in, 1
  br i1 %127, label %.lr.ph41, label %._crit_edge42, !llvm.loop !16

128:                                              ; preds = %._crit_edge42.thread, %._crit_edge42
  %129 = 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.4)
  br label %130

130:                                              ; preds = %128, %._crit_edge42
  %131 = add nuw nsw i32 %.01543, 1
  %132 = load i32, ptr @m, align 4, !tbaa !5
  %133 = icmp slt i32 %131, %132
  br i1 %133, label %.lr.ph44, label %._crit_edge45, !llvm.loop !17
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt13unordered_setIxSt4hashIxESt8equal_toIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(56)) 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

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 = { "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 = { nofree 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}


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