; LLVM IR from tangjz/acm-icpc :: leetcode/extra (tusimple_003-相似单词)

; 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_map" = 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.2" = type { i8 }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }
%"struct.std::pair" = type <{ %"class.std::__cxx11::basic_string", i32, [4 x i8] }>

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZZ4mainE3buf = external hidden global [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ4mainE1f = external hidden global [2 x [2001 x i32]], align 16
@_ZZ4mainE1g = external hidden global [2001 x i32], align 16
@_ZZ4mainE3cur = external hidden global i32, align 4
@_ZZ4mainE3pre = external hidden global i32, align 4
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::unordered_map", align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::allocator.2", align 1
  %9 = alloca ptr, align 8
  %10 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %11 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #10
  call void @llvm.lifetime.start.p0(i64 56, ptr %4) #10
  call void @_ZNSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_iEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #10
  %19 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
          to label %20 unwind label %36

20:                                               ; preds = %0
  br label %21

21:                                               ; preds = %33, %20
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = add nsw i32 %22, -1
  store i32 %23, ptr %2, align 4, !tbaa !5
  %24 = icmp ne i32 %22, 0
  br i1 %24, label %25, label %49

25:                                               ; preds = %21
  %26 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @_ZZ4mainE3buf)
          to label %27 unwind label %36

27:                                               ; preds = %25
  %28 = call i64 @strlen(ptr noundef @_ZZ4mainE3buf) #11
  %29 = getelementptr inbounds i8, ptr @_ZZ4mainE3buf, i64 %28
  invoke void @_ZSt4sortIPcEvT_S1_(ptr noundef @_ZZ4mainE3buf, ptr noundef %29)
          to label %30 unwind label %36

30:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #10
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #10
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #10
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef @_ZZ4mainE3buf, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %31 unwind label %40

31:                                               ; preds = %30
  %32 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_iEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(56) %4, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %33 unwind label %44

33:                                               ; preds = %31
  %34 = load i32, ptr %32, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %32, align 4, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #10
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #10
  br label %21, !llvm.loop !9

36:                                               ; preds = %199, %27, %25, %0
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %5, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %6, align 4
  br label %210

40:                                               ; preds = %30
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %5, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %6, align 4
  br label %48

44:                                               ; preds = %31
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %5, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %6, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #10
  br label %48

48:                                               ; preds = %44, %40
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #10
  br label %210

49:                                               ; preds = %21
  %50 = load i32, ptr @_ZZ4mainE3cur, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [2 x [2001 x i32]], ptr @_ZZ4mainE1f, i64 0, i64 %51
  %53 = getelementptr inbounds [2001 x i32], ptr %52, i64 0, i64 0
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  %56 = sext i32 %55 to i64
  %57 = mul i64 %56, 4
  call void @llvm.memset.p0.i64(ptr align 4 %53, i8 0, i64 %57, i1 false)
  %58 = load i32, ptr @_ZZ4mainE3cur, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [2 x [2001 x i32]], ptr @_ZZ4mainE1f, i64 0, i64 %59
  %61 = getelementptr inbounds [2001 x i32], ptr %60, i64 0, i64 0
  store i32 1, ptr %61, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #10
  store ptr %4, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #10
  %62 = load ptr, ptr %9, align 8, !tbaa !11
  %63 = call ptr @_ZNSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_iEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %62) #10
  %64 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %10, i32 0, i32 0
  %65 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %64, i32 0, i32 0
  store ptr %63, ptr %65, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #10
  %66 = load ptr, ptr %9, align 8, !tbaa !11
  %67 = call ptr @_ZNSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_iEEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %66) #10
  %68 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %11, i32 0, i32 0
  %69 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %68, i32 0, i32 0
  store ptr %67, ptr %69, align 8
  br label %70

70:                                               ; preds = %197, %49
  %71 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiELb1EEESC_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #10
  br i1 %71, label %73, label %72

72:                                               ; preds = %70
  store i32 4, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #10
  br label %199

73:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #10
  %74 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiELb0ELb1EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #10
  store ptr %74, ptr %13, align 8, !tbaa !11
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) @_ZZ4mainE3cur, ptr noundef nonnull align 4 dereferenceable(4) @_ZZ4mainE3pre) #10
  %75 = load i32, ptr @_ZZ4mainE3cur, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [2 x [2001 x i32]], ptr @_ZZ4mainE1f, i64 0, i64 %76
  %78 = getelementptr inbounds [2001 x i32], ptr %77, i64 0, i64 0
  %79 = load i32, ptr @_ZZ4mainE3pre, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [2 x [2001 x i32]], ptr @_ZZ4mainE1f, i64 0, i64 %80
  %82 = getelementptr inbounds [2001 x i32], ptr %81, i64 0, i64 0
  %83 = load i32, ptr %3, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  %85 = sext i32 %84 to i64
  %86 = mul i64 %85, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %78, ptr align 4 %82, i64 %86, i1 false)
  store i32 1, ptr @_ZZ4mainE1g, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #10
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %129, %73
  %88 = load i32, ptr %14, align 4, !tbaa !5
  %89 = load ptr, ptr %13, align 8, !tbaa !11
  %90 = getelementptr inbounds %"struct.std::pair", ptr %89, i32 0, i32 1
  %91 = load i32, ptr %90, align 8, !tbaa !13
  %92 = icmp sle i32 %88, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %87
  store i32 6, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #10
  br label %132

94:                                               ; preds = %87
  %95 = load i32, ptr %14, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [2001 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %96
  store i32 1, ptr %97, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #10
  %98 = load i32, ptr %14, align 4, !tbaa !5
  %99 = sub nsw i32 %98, 1
  store i32 %99, ptr %15, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %125, %94
  %101 = load i32, ptr %15, align 4, !tbaa !5
  %102 = icmp sgt i32 %101, 0
  br i1 %102, label %104, label %103

103:                                              ; preds = %100
  store i32 9, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #10
  br label %128

104:                                              ; preds = %100
  %105 = load i32, ptr %15, align 4, !tbaa !5
  %106 = sub nsw i32 %105, 1
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [2001 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = load i32, ptr %15, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [2001 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = add nsw i32 %113, %109
  store i32 %114, ptr %112, align 4, !tbaa !5
  %115 = icmp sge i32 %114, 1000000007
  br i1 %115, label %116, label %123

116:                                              ; preds = %104
  %117 = load i32, ptr %15, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [2001 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = sub nsw i32 %120, 1000000007
  store i32 %121, ptr %119, align 4, !tbaa !5
  %122 = icmp ne i32 %121, 0
  br label %123

123:                                              ; preds = %116, %104
  %124 = phi i1 [ false, %104 ], [ %122, %116 ]
  br label %125

125:                                              ; preds = %123
  %126 = load i32, ptr %15, align 4, !tbaa !5
  %127 = add nsw i32 %126, -1
  store i32 %127, ptr %15, align 4, !tbaa !5
  br label %100, !llvm.loop !18

128:                                              ; preds = %103
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %14, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %14, align 4, !tbaa !5
  br label %87, !llvm.loop !19

132:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #10
  store i32 1, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #10
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %191, %132
  %134 = load i32, ptr %16, align 4, !tbaa !5
  %135 = load ptr, ptr %13, align 8, !tbaa !11
  %136 = getelementptr inbounds %"struct.std::pair", ptr %135, i32 0, i32 1
  %137 = load i32, ptr %136, align 8, !tbaa !13
  %138 = icmp sle i32 %134, %137
  br i1 %138, label %139, label %143

139:                                              ; preds = %133
  %140 = load i32, ptr %17, align 4, !tbaa !5
  %141 = load i32, ptr %3, align 4, !tbaa !5
  %142 = icmp sle i32 %140, %141
  br label %143

143:                                              ; preds = %139, %133
  %144 = phi i1 [ false, %133 ], [ %142, %139 ]
  br i1 %144, label %146, label %145

145:                                              ; preds = %143
  store i32 12, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #10
  br label %196

146:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #10
  %147 = load i32, ptr %17, align 4, !tbaa !5
  store i32 %147, ptr %18, align 4, !tbaa !5
  br label %148

148:                                              ; preds = %187, %146
  %149 = load i32, ptr %18, align 4, !tbaa !5
  %150 = load i32, ptr %3, align 4, !tbaa !5
  %151 = icmp sle i32 %149, %150
  br i1 %151, label %153, label %152

152:                                              ; preds = %148
  store i32 15, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #10
  br label %190

153:                                              ; preds = %148
  %154 = load i32, ptr @_ZZ4mainE3cur, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [2 x [2001 x i32]], ptr @_ZZ4mainE1f, i64 0, i64 %155
  %157 = load i32, ptr %18, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [2001 x i32], ptr %156, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = load i32, ptr %16, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [2001 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = load i32, ptr @_ZZ4mainE3pre, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [2 x [2001 x i32]], ptr @_ZZ4mainE1f, i64 0, i64 %168
  %170 = load i32, ptr %18, align 4, !tbaa !5
  %171 = load i32, ptr %17, align 4, !tbaa !5
  %172 = sub nsw i32 %170, %171
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [2001 x i32], ptr %169, i64 0, i64 %173
  %175 = load i32, ptr %174, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = mul nsw i64 %166, %176
  %178 = add nsw i64 %161, %177
  %179 = srem i64 %178, 1000000007
  %180 = trunc i64 %179 to i32
  %181 = load i32, ptr @_ZZ4mainE3cur, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [2 x [2001 x i32]], ptr @_ZZ4mainE1f, i64 0, i64 %182
  %184 = load i32, ptr %18, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [2001 x i32], ptr %183, i64 0, i64 %185
  store i32 %180, ptr %186, align 4, !tbaa !5
  br label %187

187:                                              ; preds = %153
  %188 = load i32, ptr %18, align 4, !tbaa !5
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %18, align 4, !tbaa !5
  br label %148, !llvm.loop !20

190:                                              ; preds = %152
  br label %191

191:                                              ; preds = %190
  %192 = load i32, ptr %16, align 4, !tbaa !5
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %16, align 4, !tbaa !5
  %194 = load i32, ptr %17, align 4, !tbaa !5
  %195 = add nsw i32 %194, %192
  store i32 %195, ptr %17, align 4, !tbaa !5
  br label %133, !llvm.loop !21

196:                                              ; preds = %145
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #10
  br label %197

197:                                              ; preds = %196
  %198 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiELb0ELb1EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #10
  br label %70

199:                                              ; preds = %72
  %200 = load i32, ptr @_ZZ4mainE3cur, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [2 x [2001 x i32]], ptr @_ZZ4mainE1f, i64 0, i64 %201
  %203 = load i32, ptr %3, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [2001 x i32], ptr %202, i64 0, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !5
  %207 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %206)
          to label %208 unwind label %36

208:                                              ; preds = %199
  store i32 0, ptr %1, align 4
  store i32 1, ptr %12, align 4
  call void @_ZNSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_iEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #10
  call void @llvm.lifetime.end.p0(i64 56, ptr %4) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #10
  %209 = load i32, ptr %1, align 4
  ret i32 %209

210:                                              ; preds = %48, %36
  call void @_ZNSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_iEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #10
  call void @llvm.lifetime.end.p0(i64 56, ptr %4) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #10
  br label %211

211:                                              ; preds = %210
  %212 = load ptr, ptr %5, align 8
  %213 = load i32, ptr %6, align 4
  %214 = insertvalue { ptr, i32 } poison, ptr %212, 0
  %215 = insertvalue { ptr, i32 } %214, i32 %213, 1
  resume { ptr, i32 } %215
}

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPcEvT_S1_(ptr noundef, ptr noundef) #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #6 align 2

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(36) ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiELb0ELb1EEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #8

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

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

declare i32 @printf(ptr noundef, ...) #3

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

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

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

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::unordered_map" = 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.2" = type { i8 }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZZ4mainE3buf = external hidden global [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ4mainE1f = external hidden local_unnamed_addr global [2 x [2001 x i32]], align 16
@_ZZ4mainE1g = external hidden local_unnamed_addr global [2001 x i32], align 16
@_ZZ4mainE3cur = external hidden global i32, align 4
@_ZZ4mainE3pre = external hidden global i32, align 4
@.str.2 = 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 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::unordered_map", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::allocator.2", align 1
  %6 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %7 = alloca %"struct.std::__detail::_Node_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #10
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %3) #10
  call void @_ZNSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_iEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #10
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %9 = load i32, ptr %1, align 4, !tbaa !5
  %10 = add nsw i32 %9, -1
  store i32 %10, ptr %1, align 4, !tbaa !5
  %.not40 = icmp eq i32 %9, 0
  br i1 %.not40, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %17
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @_ZZ4mainE3buf)
  %12 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @_ZZ4mainE3buf) #11
  %13 = getelementptr inbounds i8, ptr @_ZZ4mainE3buf, i64 %12
  invoke void @_ZSt4sortIPcEvT_S1_(ptr noundef nonnull @_ZZ4mainE3buf, ptr noundef nonnull %13)
          to label %14 unwind label %22

14:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #10
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #10
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #10
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull @_ZZ4mainE3buf, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %15 unwind label %24

15:                                               ; preds = %14
  %16 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_iEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(56) %3, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %17 unwind label %26

17:                                               ; preds = %15
  %18 = load i32, ptr %16, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr %16, align 4, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #10
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #10
  %20 = load i32, ptr %1, align 4, !tbaa !5
  %21 = add nsw i32 %20, -1
  store i32 %21, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %20, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

22:                                               ; preds = %.lr.ph
  %23 = landingpad { ptr, i32 }
          cleanup
  br label %141

24:                                               ; preds = %14
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %28

26:                                               ; preds = %15
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #10
  br label %28

28:                                               ; preds = %26, %24
  %.pn = phi { ptr, i32 } [ %27, %26 ], [ %25, %24 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #10
  br label %141

._crit_edge:                                      ; preds = %17, %0
  %29 = load i32, ptr @_ZZ4mainE3cur, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [2 x [2001 x i32]], ptr @_ZZ4mainE1f, i64 0, i64 %30
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  %34 = sext i32 %33 to i64
  %35 = shl nsw i64 %34, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %31, i8 0, i64 %35, i1 false)
  store i32 1, ptr %31, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #10
  %36 = call ptr @_ZNSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_iEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %3) #10
  store ptr %36, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #10
  %37 = call ptr @_ZNSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_iEEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %3) #10
  store ptr %37, ptr %7, align 8
  %38 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiELb1EEESC_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #10
  br i1 %38, label %.lr.ph54, label %._crit_edge55

._crit_edge55:                                    ; preds = %._crit_edge52, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #10
  %39 = load i32, ptr @_ZZ4mainE3cur, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [2 x [2001 x i32]], ptr @_ZZ4mainE1f, i64 0, i64 %40, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %44)
  call void @_ZNSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_iEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #10
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #10
  ret i32 0

.lr.ph54:                                         ; preds = %._crit_edge, %._crit_edge52
  %46 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiELb0ELb1EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #10
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) @_ZZ4mainE3cur, ptr noundef nonnull align 4 dereferenceable(4) @_ZZ4mainE3pre) #10
  %47 = load i32, ptr @_ZZ4mainE3cur, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [2 x [2001 x i32]], ptr @_ZZ4mainE1f, i64 0, i64 %48
  %50 = load i32, ptr @_ZZ4mainE3pre, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [2 x [2001 x i32]], ptr @_ZZ4mainE1f, i64 0, i64 %51
  %53 = load i32, ptr %2, align 4
  %54 = add nsw i32 %53, 1
  %55 = sext i32 %54 to i64
  %56 = shl nsw i64 %55, 2
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %49, ptr nonnull align 4 %52, i64 %56, i1 false)
  store i32 1, ptr @_ZZ4mainE1g, align 16, !tbaa !5
  %57 = getelementptr inbounds i8, ptr %46, i64 32
  %58 = load i32, ptr %57, align 8, !tbaa !11
  %.not3545 = icmp slt i32 %58, 1
  br i1 %.not3545, label %._crit_edge52, label %.lr.ph48

.preheader39:                                     ; preds = %._crit_edge44
  %59 = icmp sgt i32 %102, 0
  %60 = icmp sgt i32 %53, -1
  %61 = select i1 %59, i1 %60, i1 false
  br i1 %61, label %.preheader.preheader, label %._crit_edge52

.preheader.preheader:                             ; preds = %.preheader39
  %62 = zext nneg i32 %53 to i64
  br label %.preheader

.lr.ph48:                                         ; preds = %.lr.ph54, %._crit_edge44
  %indvar = phi i64 [ %indvar.next, %._crit_edge44 ], [ 0, %.lr.ph54 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %._crit_edge44 ], [ 1, %.lr.ph54 ]
  %63 = shl nuw nsw i64 %indvar, 2
  %gep = getelementptr i8, ptr getelementptr (i8, ptr @_ZZ4mainE1g, i64 4), i64 %63
  %64 = shl i64 %indvar, 2
  %65 = sub i64 4, %64
  %scevgep80 = getelementptr i8, ptr @_ZZ4mainE1g, i64 %65
  %66 = shl i64 %indvar, 2
  %67 = add i64 %66, 17179869180
  %68 = and i64 %67, 17179869180
  %scevgep81 = getelementptr i8, ptr %scevgep80, i64 %68
  %scevgep82 = getelementptr i8, ptr getelementptr inbounds (i8, ptr @_ZZ4mainE1g, i64 4), i64 %68
  %69 = add i64 %indvar, -1
  %70 = shl nuw nsw i64 %indvar, 2
  %scevgep = getelementptr i8, ptr @_ZZ4mainE1g, i64 %70
  %71 = shl i64 %69, 2
  %72 = and i64 %71, 17179869180
  %scevgep75 = getelementptr i8, ptr @_ZZ4mainE1g, i64 %72
  %73 = getelementptr inbounds [2001 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv
  store i32 1, ptr %73, align 4, !tbaa !5
  %74 = icmp ugt i64 %indvars.iv, 1
  br i1 %74, label %.lr.ph43.preheader, label %._crit_edge44

.lr.ph43.preheader:                               ; preds = %.lr.ph48
  %min.iters.check = icmp ult i64 %indvar, 24
  br i1 %min.iters.check, label %.lr.ph43.preheader91, label %vector.scevcheck

.lr.ph43.preheader91:                             ; preds = %middle.block, %vector.memcheck, %vector.scevcheck, %.lr.ph43.preheader
  %indvars.iv56.ph = phi i64 [ %indvars.iv, %vector.memcheck ], [ %indvars.iv, %vector.scevcheck ], [ %indvars.iv, %.lr.ph43.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph43

vector.scevcheck:                                 ; preds = %.lr.ph43.preheader
  %75 = and i64 %indvar, 4294967295
  %76 = icmp eq i64 %75, 0
  %77 = icmp ugt i64 %69, 4294967295
  %78 = or i1 %76, %77
  %mul.result73.neg = mul i64 %69, -4
  %79 = getelementptr i8, ptr %scevgep, i64 %mul.result73.neg
  %80 = icmp ugt ptr %79, %scevgep
  %mul.result77.neg = mul i64 %69, -4
  %81 = getelementptr i8, ptr %scevgep75, i64 %mul.result77.neg
  %82 = icmp ugt ptr %81, %scevgep75
  %83 = or i1 %80, %78
  %84 = or i1 %82, %83
  br i1 %84, label %.lr.ph43.preheader91, label %vector.memcheck

vector.memcheck:                                  ; preds = %vector.scevcheck
  %bound0 = icmp ugt ptr %scevgep82, getelementptr inbounds (i8, ptr @_ZZ4mainE1g, i64 4)
  %bound1 = icmp ult ptr %scevgep81, %gep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %.lr.ph43.preheader91, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %indvar, 8589934584
  %ind.end = sub nsw i64 %indvars.iv, %n.vec
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = sub i64 %indvars.iv, %index
  %85 = add i64 %offset.idx, 4294967295
  %86 = add i64 %offset.idx, 4294967294
  %87 = and i64 %86, 4294967295
  %88 = getelementptr inbounds [2001 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %87
  %89 = getelementptr inbounds i8, ptr %88, i64 -12
  %90 = getelementptr inbounds i8, ptr %88, i64 -28
  %wide.load = load <4 x i32>, ptr %89, align 4, !tbaa !5, !alias.scope !17
  %wide.load83 = load <4 x i32>, ptr %90, align 4, !tbaa !5, !alias.scope !17
  %91 = and i64 %85, 4294967295
  %92 = getelementptr inbounds [2001 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %91
  %93 = getelementptr inbounds i8, ptr %92, i64 -12
  %94 = getelementptr inbounds i8, ptr %92, i64 -28
  %wide.load85 = load <4 x i32>, ptr %93, align 4, !tbaa !5, !alias.scope !20, !noalias !17
  %wide.load87 = load <4 x i32>, ptr %94, align 4, !tbaa !5, !alias.scope !20, !noalias !17
  %95 = add nsw <4 x i32> %wide.load85, %wide.load
  %96 = add nsw <4 x i32> %wide.load87, %wide.load83
  %97 = icmp sgt <4 x i32> %95, <i32 1000000006, i32 1000000006, i32 1000000006, i32 1000000006>
  %98 = add nsw <4 x i32> %95, <i32 -1000000007, i32 -1000000007, i32 -1000000007, i32 -1000000007>
  %reverse89 = select <4 x i1> %97, <4 x i32> %98, <4 x i32> %95
  store <4 x i32> %reverse89, ptr %93, align 4, !tbaa !5, !alias.scope !20, !noalias !17
  %99 = icmp sgt <4 x i32> %96, <i32 1000000006, i32 1000000006, i32 1000000006, i32 1000000006>
  %100 = add nsw <4 x i32> %96, <i32 -1000000007, i32 -1000000007, i32 -1000000007, i32 -1000000007>
  %reverse90 = select <4 x i1> %99, <4 x i32> %100, <4 x i32> %96
  store <4 x i32> %reverse90, ptr %94, align 4, !tbaa !5, !alias.scope !20, !noalias !17
  %index.next = add nuw i64 %index, 8
  %101 = icmp eq i64 %index.next, %n.vec
  br i1 %101, label %middle.block, label %vector.body, !llvm.loop !22

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %indvar, %n.vec
  br i1 %cmp.n, label %._crit_edge44, label %.lr.ph43.preheader91

._crit_edge44:                                    ; preds = %.lr.ph43, %middle.block, %.lr.ph48
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %102 = load i32, ptr %57, align 8, !tbaa !11
  %103 = sext i32 %102 to i64
  %.not35.not = icmp slt i64 %indvars.iv, %103
  %indvar.next = add i64 %indvar, 1
  br i1 %.not35.not, label %.lr.ph48, label %.preheader39, !llvm.loop !25

.lr.ph43:                                         ; preds = %.lr.ph43.preheader91, %.lr.ph43
  %indvars.iv56 = phi i64 [ %indvars.iv.next57, %.lr.ph43 ], [ %indvars.iv56.ph, %.lr.ph43.preheader91 ]
  %indvars.iv.next57 = add nsw i64 %indvars.iv56, -1
  %104 = add i64 %indvars.iv56, 4294967294
  %105 = and i64 %104, 4294967295
  %106 = getelementptr inbounds [2001 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = and i64 %indvars.iv.next57, 4294967295
  %109 = getelementptr inbounds [2001 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = add nsw i32 %110, %107
  %112 = icmp sgt i32 %111, 1000000006
  %113 = add nsw i32 %111, -1000000007
  %spec.select = select i1 %112, i32 %113, i32 %111
  store i32 %spec.select, ptr %109, align 4, !tbaa !5
  %114 = icmp sgt i64 %indvars.iv56, 2
  br i1 %114, label %.lr.ph43, label %._crit_edge44, !llvm.loop !26

.preheader:                                       ; preds = %.preheader.preheader, %121
  %indvars.iv65 = phi i64 [ 1, %.preheader.preheader ], [ %indvars.iv.next66, %121 ]
  %.02751 = phi i32 [ 0, %.preheader.preheader ], [ %123, %121 ]
  %115 = sext i32 %.02751 to i64
  %116 = getelementptr inbounds [2001 x i32], ptr @_ZZ4mainE1g, i64 0, i64 %indvars.iv65
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  br label %129

._crit_edge52:                                    ; preds = %121, %.lr.ph54, %.preheader39
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiELb0ELb1EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #10
  %120 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiELb1EEESC_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #10
  br i1 %120, label %.lr.ph54, label %._crit_edge55

121:                                              ; preds = %129
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %122 = trunc nuw nsw i64 %indvars.iv65 to i32
  %123 = add nuw nsw i32 %.02751, %122
  %124 = load i32, ptr %57, align 8, !tbaa !11
  %125 = sext i32 %124 to i64
  %126 = icmp slt i64 %indvars.iv65, %125
  %127 = icmp sle i32 %123, %53
  %128 = select i1 %126, i1 %127, i1 false
  br i1 %128, label %.preheader, label %._crit_edge52, !llvm.loop !27

129:                                              ; preds = %.preheader, %129
  %indvars.iv61 = phi i64 [ %115, %.preheader ], [ %indvars.iv.next62, %129 ]
  %130 = getelementptr inbounds [2 x [2001 x i32]], ptr @_ZZ4mainE1f, i64 0, i64 %48, i64 %indvars.iv61
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = sub nuw nsw i64 %indvars.iv61, %115
  %134 = getelementptr inbounds [2 x [2001 x i32]], ptr @_ZZ4mainE1f, i64 0, i64 %51, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = mul nsw i64 %136, %118
  %138 = add nsw i64 %137, %132
  %139 = srem i64 %138, 1000000007
  %140 = trunc nsw i64 %139 to i32
  store i32 %140, ptr %130, align 4, !tbaa !5
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %.not36.not = icmp slt i64 %indvars.iv61, %62
  br i1 %.not36.not, label %129, label %121, !llvm.loop !28

141:                                              ; preds = %28, %22
  %.pn.pn = phi { ptr, i32 } [ %.pn, %28 ], [ %23, %22 ]
  call void @_ZNSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_iEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #10
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #10
  resume { ptr, i32 } %.pn.pn
}

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPcEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #6 align 2

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(36) ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiELb0ELb1EEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #8

; Function Attrs: mustprogress 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) #9

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 32}
!12 = !{!"_ZTSSt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiE", !13, i64 0, !6, i64 32}
!13 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !14, i64 0, !16, i64 8, !7, i64 16}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!18}
!18 = distinct !{!18, !19}
!19 = distinct !{!19, !"LVerDomain"}
!20 = !{!21}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !10, !23, !24}
!23 = !{!"llvm.loop.isvectorized", i32 1}
!24 = !{!"llvm.loop.unroll.runtime.disable"}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10, !23}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10}


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