; LLVM IR from tangjz/acm-icpc :: codeforces/gym (101385D)

; 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 }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }
%"struct.std::pair" = type <{ i64, i32, [4 x i8] }>

@alen = external dso_local global i32, align 4
@blen = external dso_local global i32, align 4
@amsk = external dso_local global [2 x i64], align 16
@bmsk = external dso_local global [2 x i64], align 16
@a = external dso_local global [51 x i8], align 16
@b = external dso_local global [51 x i8], align 16
@f = external dso_local global %"class.std::unordered_map", align 8
@g = external dso_local global %"class.std::unordered_map", align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::unordered_map", align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %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 i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %16 = load ptr, ptr @stdin, align 8, !tbaa !5
  %17 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.2, ptr noundef %16)
  %18 = load ptr, ptr @stdout, align 8, !tbaa !5
  %19 = call ptr @freopen(ptr noundef @.str.3, ptr noundef @.str.4, ptr noundef %18)
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.5, ptr noundef getelementptr inbounds (i8, ptr @a, i64 1), ptr noundef getelementptr inbounds (i8, ptr @b, i64 1))
  %21 = call i64 @strlen(ptr noundef getelementptr inbounds (i8, ptr @a, i64 1)) #8
  %22 = trunc i64 %21 to i32
  store i32 %22, ptr @alen, align 4, !tbaa !9
  %23 = call i64 @strlen(ptr noundef getelementptr inbounds (i8, ptr @b, i64 1)) #8
  %24 = trunc i64 %23 to i32
  store i32 %24, ptr @blen, align 4, !tbaa !9
  %25 = load i32, ptr @blen, align 4, !tbaa !9
  %26 = load i32, ptr @alen, align 4, !tbaa !9
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %28, label %29

28:                                               ; preds = %0
  call void @_ZSt4swapIcLm51EENSt9enable_ifIXsr14__is_swappableIT_EE5valueEvE4typeERAT0__S1_S5_(ptr noundef nonnull align 1 dereferenceable(51) @a, ptr noundef nonnull align 1 dereferenceable(51) @b) #9
  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) @alen, ptr noundef nonnull align 4 dereferenceable(4) @blen) #9
  br label %29

29:                                               ; preds = %28, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #9
  store i32 1, ptr %2, align 4, !tbaa !9
  br label %30

30:                                               ; preds = %49, %29
  %31 = load i32, ptr %2, align 4, !tbaa !9
  %32 = load i32, ptr @alen, align 4, !tbaa !9
  %33 = icmp sle i32 %31, %32
  br i1 %33, label %35, label %34

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

35:                                               ; preds = %30
  %36 = load i32, ptr %2, align 4, !tbaa !9
  %37 = zext i32 %36 to i64
  %38 = shl i64 1, %37
  %39 = load i32, ptr %2, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [51 x i8], ptr @a, i64 0, i64 %40
  %42 = load i8, ptr %41, align 1, !tbaa !11
  %43 = sext i8 %42 to i32
  %44 = icmp eq i32 %43, 49
  %45 = zext i1 %44 to i64
  %46 = getelementptr inbounds [2 x i64], ptr @amsk, i64 0, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !12
  %48 = or i64 %47, %38
  store i64 %48, ptr %46, align 8, !tbaa !12
  br label %49

49:                                               ; preds = %35
  %50 = load i32, ptr %2, align 4, !tbaa !9
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %2, align 4, !tbaa !9
  br label %30, !llvm.loop !14

52:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #9
  store i64 1, ptr %3, align 8, !tbaa !12
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEEixEOx(ptr noundef nonnull align 8 dereferenceable(56) @f, ptr noundef nonnull align 8 dereferenceable(8) %3)
  store i32 1, ptr %53, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #9
  store i32 1, ptr %4, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %152, %52
  %55 = load i32, ptr %4, align 4, !tbaa !9
  %56 = load i32, ptr @alen, align 4, !tbaa !9
  %57 = load i32, ptr @blen, align 4, !tbaa !9
  %58 = add nsw i32 %56, %57
  %59 = icmp sle i32 %55, %58
  br i1 %59, label %61, label %60

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

61:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 56, ptr %6) #9
  call void @llvm.memset.p0.i64(ptr align 8 %6, i8 0, i64 56, i1 false)
  call void @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %6) #9
  call void @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEE4swapERS8_(ptr noundef nonnull align 8 dereferenceable(56) %6, ptr noundef nonnull align 8 dereferenceable(56) @g) #9
  call void @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %6) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr %6) #9
  store i64 0, ptr getelementptr inbounds ([2 x i64], ptr @bmsk, i64 0, i64 1), align 8, !tbaa !12
  store i64 0, ptr @bmsk, align 16, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  %62 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %62, ptr %8, align 4, !tbaa !9
  br label %63

63:                                               ; preds = %92, %61
  %64 = load i32, ptr %7, align 4, !tbaa !9
  %65 = load i32, ptr @alen, align 4, !tbaa !9
  %66 = icmp sle i32 %64, %65
  br i1 %66, label %67, label %70

67:                                               ; preds = %63
  %68 = load i32, ptr %8, align 4, !tbaa !9
  %69 = icmp ne i32 %68, 0
  br label %70

70:                                               ; preds = %67, %63
  %71 = phi i1 [ false, %63 ], [ %69, %67 ]
  br i1 %71, label %73, label %72

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

73:                                               ; preds = %70
  %74 = load i32, ptr %8, align 4, !tbaa !9
  %75 = load i32, ptr @blen, align 4, !tbaa !9
  %76 = icmp sle i32 %74, %75
  br i1 %76, label %77, label %91

77:                                               ; preds = %73
  %78 = load i32, ptr %7, align 4, !tbaa !9
  %79 = zext i32 %78 to i64
  %80 = shl i64 1, %79
  %81 = load i32, ptr %8, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [51 x i8], ptr @b, i64 0, i64 %82
  %84 = load i8, ptr %83, align 1, !tbaa !11
  %85 = sext i8 %84 to i32
  %86 = icmp eq i32 %85, 49
  %87 = zext i1 %86 to i64
  %88 = getelementptr inbounds [2 x i64], ptr @bmsk, i64 0, i64 %87
  %89 = load i64, ptr %88, align 8, !tbaa !12
  %90 = or i64 %89, %80
  store i64 %90, ptr %88, align 8, !tbaa !12
  br label %91

91:                                               ; preds = %77, %73
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %7, align 4, !tbaa !9
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %7, align 4, !tbaa !9
  %95 = load i32, ptr %8, align 4, !tbaa !9
  %96 = add nsw i32 %95, -1
  store i32 %96, ptr %8, align 4, !tbaa !9
  br label %63, !llvm.loop !16

97:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  %98 = call ptr @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) @f) #9
  %99 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %9, i32 0, i32 0
  %100 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %99, i32 0, i32 0
  store ptr %98, ptr %100, align 8
  br label %101

101:                                              ; preds = %149, %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  %102 = call ptr @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) @f) #9
  %103 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %10, i32 0, i32 0
  %104 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %103, i32 0, i32 0
  store ptr %102, ptr %104, align 8
  %105 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKxiELb0EEES6_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  br i1 %105, label %107, label %106

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

107:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %108 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKxiELb0ELb0EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #9
  %109 = getelementptr inbounds %"struct.std::pair", ptr %108, i32 0, i32 0
  %110 = load i64, ptr %109, align 8, !tbaa !17
  store i64 %110, ptr %11, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  %111 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKxiELb0ELb0EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #9
  %112 = getelementptr inbounds %"struct.std::pair", ptr %111, i32 0, i32 1
  %113 = load i32, ptr %112, align 8, !tbaa !19
  store i32 %113, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %114

114:                                              ; preds = %145, %107
  %115 = load i32, ptr %13, align 4, !tbaa !9
  %116 = icmp slt i32 %115, 2
  br i1 %116, label %118, label %117

117:                                              ; preds = %114
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  br label %148

118:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #9
  %119 = load i64, ptr %11, align 8, !tbaa !12
  %120 = shl i64 %119, 1
  %121 = load i32, ptr %13, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [2 x i64], ptr @amsk, i64 0, i64 %122
  %124 = load i64, ptr %123, align 8, !tbaa !12
  %125 = and i64 %120, %124
  %126 = load i64, ptr %11, align 8, !tbaa !12
  %127 = load i32, ptr %13, align 4, !tbaa !9
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [2 x i64], ptr @bmsk, i64 0, i64 %128
  %130 = load i64, ptr %129, align 8, !tbaa !12
  %131 = and i64 %126, %130
  %132 = or i64 %125, %131
  store i64 %132, ptr %14, align 8, !tbaa !12
  %133 = load i32, ptr %12, align 4, !tbaa !9
  %134 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @g, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %135 = load i32, ptr %134, align 4, !tbaa !9
  %136 = add nsw i32 %135, %133
  store i32 %136, ptr %134, align 4, !tbaa !9
  %137 = icmp sge i32 %136, 1000000007
  br i1 %137, label %138, label %143

138:                                              ; preds = %118
  %139 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @g, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %140 = load i32, ptr %139, align 4, !tbaa !9
  %141 = sub nsw i32 %140, 1000000007
  store i32 %141, ptr %139, align 4, !tbaa !9
  %142 = icmp ne i32 %141, 0
  br label %143

143:                                              ; preds = %138, %118
  %144 = phi i1 [ false, %118 ], [ %142, %138 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  br label %145

145:                                              ; preds = %143
  %146 = load i32, ptr %13, align 4, !tbaa !9
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %13, align 4, !tbaa !9
  br label %114, !llvm.loop !20

148:                                              ; preds = %117
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  br label %149

149:                                              ; preds = %148
  %150 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKxiELb0ELb0EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #9
  br label %101, !llvm.loop !21

151:                                              ; preds = %106
  call void @_ZSt4swapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEEvRSt13unordered_mapIT_T0_T1_T2_T3_ESF_(ptr noundef nonnull align 8 dereferenceable(56) @f, ptr noundef nonnull align 8 dereferenceable(56) @g) #9
  br label %152

152:                                              ; preds = %151
  %153 = load i32, ptr %4, align 4, !tbaa !9
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %4, align 4, !tbaa !9
  br label %54, !llvm.loop !22

155:                                              ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  %156 = load i32, ptr @alen, align 4, !tbaa !9
  %157 = zext i32 %156 to i64
  %158 = shl i64 1, %157
  store i64 %158, ptr %15, align 8, !tbaa !12
  %159 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEEixEOx(ptr noundef nonnull align 8 dereferenceable(56) @f, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %160 = load i32, ptr %159, align 4, !tbaa !9
  %161 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %160)
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  ret i32 0
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #3

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIcLm51EENSt9enable_ifIXsr14__is_swappableIT_EE5valueEvE4typeERAT0__S1_S5_(ptr noundef nonnull align 1 dereferenceable(51), ptr noundef nonnull align 1 dereferenceable(51)) #1

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

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

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

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

; 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 void @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEE4swapERS8_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) #0 align 2

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

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

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

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

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

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

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

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

attributes #0 = { 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 #1 = { 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 #2 = { 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 #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 = { 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 #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nounwind willreturn memory(read) }
attributes #9 = { nounwind }

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

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


; 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 }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }

@alen = external dso_local global i32, align 4
@blen = external dso_local global i32, align 4
@amsk = external dso_local local_unnamed_addr global [2 x i64], align 16
@bmsk = external dso_local local_unnamed_addr global [2 x i64], align 16
@a = external dso_local global [51 x i8], align 16
@b = external dso_local global [51 x i8], align 16
@f = external dso_local global %"class.std::unordered_map", align 8
@g = external dso_local global %"class.std::unordered_map", align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i64, align 8
  %2 = alloca %"class.std::unordered_map", 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 i64, align 8
  %7 = load ptr, ptr @stdin, align 8, !tbaa !5
  %8 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.2, ptr noundef %7)
  %9 = load ptr, ptr @stdout, align 8, !tbaa !5
  %10 = tail call ptr @freopen(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, ptr noundef %9)
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull getelementptr inbounds (i8, ptr @a, i64 1), ptr noundef nonnull getelementptr inbounds (i8, ptr @b, i64 1))
  %12 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @a, i64 1)) #10
  %13 = trunc i64 %12 to i32
  store i32 %13, ptr @alen, align 4, !tbaa !9
  %14 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @b, i64 1)) #10
  %15 = trunc i64 %14 to i32
  store i32 %15, ptr @blen, align 4, !tbaa !9
  %16 = icmp slt i32 %15, %13
  br i1 %16, label %17, label %18

17:                                               ; preds = %0
  tail call void @_ZSt4swapIcLm51EENSt9enable_ifIXsr14__is_swappableIT_EE5valueEvE4typeERAT0__S1_S5_(ptr noundef nonnull align 1 dereferenceable(51) @a, ptr noundef nonnull align 1 dereferenceable(51) @b) #11
  tail 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) @alen, ptr noundef nonnull align 4 dereferenceable(4) @blen) #11
  %.pre = load i32, ptr @alen, align 4, !tbaa !9
  br label %18

18:                                               ; preds = %17, %0
  %19 = phi i32 [ %.pre, %17 ], [ %13, %0 ]
  %.not27 = icmp slt i32 %19, 1
  br i1 %.not27, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %18
  %20 = zext nneg i32 %19 to i64
  %xtraiter = and i64 %20, 1
  %21 = icmp eq i32 %19, 1
  br i1 %21, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %20, 2147483646
  br label %.lr.ph

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

.lr.ph.epil:                                      ; preds = %._crit_edge.loopexit.unr-lcssa
  %22 = shl nuw i64 1, %indvars.iv.unr
  %23 = getelementptr inbounds [51 x i8], ptr @a, i64 0, i64 %indvars.iv.unr
  %24 = load i8, ptr %23, align 1, !tbaa !11
  %25 = icmp eq i8 %24, 49
  %26 = zext i1 %25 to i64
  %27 = getelementptr inbounds [2 x i64], ptr @amsk, i64 0, i64 %26
  %28 = load i64, ptr %27, align 8, !tbaa !12
  %29 = or i64 %28, %22
  store i64 %29, ptr %27, align 8, !tbaa !12
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.epil, %._crit_edge.loopexit.unr-lcssa, %18
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #11
  store i64 1, ptr %1, align 8, !tbaa !12
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEEixEOx(ptr noundef nonnull align 8 dereferenceable(56) @f, ptr noundef nonnull align 8 dereferenceable(8) %1)
  store i32 1, ptr %30, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #11
  %31 = load i32, ptr @alen, align 4, !tbaa !9
  %32 = load i32, ptr @blen, align 4, !tbaa !9
  %33 = add nsw i32 %32, %31
  %.not2538 = icmp slt i32 %33, 1
  br i1 %.not2538, label %._crit_edge42, label %.lr.ph41

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %34 = shl nuw i64 1, %indvars.iv
  %35 = getelementptr inbounds [51 x i8], ptr @a, i64 0, i64 %indvars.iv
  %36 = load i8, ptr %35, align 1, !tbaa !11
  %37 = icmp eq i8 %36, 49
  %38 = zext i1 %37 to i64
  %39 = getelementptr inbounds [2 x i64], ptr @amsk, i64 0, i64 %38
  %40 = load i64, ptr %39, align 8, !tbaa !12
  %41 = or i64 %40, %34
  store i64 %41, ptr %39, align 8, !tbaa !12
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %42 = shl nuw i64 2, %indvars.iv
  %43 = getelementptr inbounds [51 x i8], ptr @a, i64 0, i64 %indvars.iv.next
  %44 = load i8, ptr %43, align 1, !tbaa !11
  %45 = icmp eq i8 %44, 49
  %46 = zext i1 %45 to i64
  %47 = getelementptr inbounds [2 x i64], ptr @amsk, i64 0, i64 %46
  %48 = load i64, ptr %47, align 8, !tbaa !12
  %49 = or i64 %48, %42
  store i64 %49, ptr %47, align 8, !tbaa !12
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !14

._crit_edge42:                                    ; preds = %._crit_edge37, %._crit_edge
  %.lcssa = phi i32 [ %31, %._crit_edge ], [ %95, %._crit_edge37 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #11
  %50 = zext nneg i32 %.lcssa to i64
  %51 = shl nuw i64 1, %50
  store i64 %51, ptr %6, align 8, !tbaa !12
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEEixEOx(ptr noundef nonnull align 8 dereferenceable(56) @f, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %53 = load i32, ptr %52, align 4, !tbaa !9
  %54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %53)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #11
  ret i32 0

.lr.ph41:                                         ; preds = %._crit_edge, %._crit_edge37
  %indvar = phi i64 [ %indvar.next, %._crit_edge37 ], [ 0, %._crit_edge ]
  %indvars.iv54 = phi i32 [ %indvars.iv.next55, %._crit_edge37 ], [ 0, %._crit_edge ]
  %indvars.iv45 = phi i64 [ %indvars.iv.next46, %._crit_edge37 ], [ 1, %._crit_edge ]
  %indvars61 = trunc i64 %indvars.iv45 to i32
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %2) #11
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(56) %2, i8 0, i64 56, i1 false)
  call void @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %2) #11
  call void @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEE4swapERS8_(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 8 dereferenceable(56) @g) #11
  call void @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %2) #11
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %2) #11
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) @bmsk, i8 0, i64 16, i1 false)
  %55 = load i32, ptr @alen, align 4, !tbaa !9
  %56 = icmp sgt i32 %55, -1
  br i1 %56, label %.lr.ph32, label %._crit_edge33

.lr.ph32:                                         ; preds = %.lr.ph41
  %57 = load i32, ptr @blen, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %umin = call i32 @llvm.umin.i32(i32 %55, i32 %indvars.iv54)
  %59 = add nuw i32 %umin, 1
  %wide.trip.count56 = zext i32 %59 to i64
  %60 = zext nneg i32 %55 to i64
  %umin65 = call i64 @llvm.umin.i64(i64 %indvar, i64 %60)
  %xtraiter66 = and i64 %wide.trip.count56, 1
  %61 = icmp eq i64 %umin65, 0
  br i1 %61, label %._crit_edge33.loopexit.unr-lcssa, label %.lr.ph32.new

.lr.ph32.new:                                     ; preds = %.lr.ph32
  %unroll_iter68 = and i64 %wide.trip.count56, 4294967294
  br label %74

._crit_edge33.loopexit.unr-lcssa:                 ; preds = %94, %.lr.ph32
  %indvars.iv49.unr = phi i64 [ 0, %.lr.ph32 ], [ %indvars.iv.next50.1, %94 ]
  %indvars.iv47.unr = phi i64 [ %indvars.iv45, %.lr.ph32 ], [ %indvars.iv.next48.1, %94 ]
  %lcmp.mod67.not = icmp eq i64 %xtraiter66, 0
  %.not26.epil = icmp sgt i64 %indvars.iv47.unr, %58
  %or.cond = select i1 %lcmp.mod67.not, i1 true, i1 %.not26.epil
  br i1 %or.cond, label %._crit_edge33, label %62

62:                                               ; preds = %._crit_edge33.loopexit.unr-lcssa
  %63 = shl nuw i64 1, %indvars.iv49.unr
  %64 = getelementptr inbounds [51 x i8], ptr @b, i64 0, i64 %indvars.iv47.unr
  %65 = load i8, ptr %64, align 1, !tbaa !11
  %66 = icmp eq i8 %65, 49
  %67 = zext i1 %66 to i64
  %68 = getelementptr inbounds [2 x i64], ptr @bmsk, i64 0, i64 %67
  %69 = load i64, ptr %68, align 8, !tbaa !12
  %70 = or i64 %69, %63
  store i64 %70, ptr %68, align 8, !tbaa !12
  br label %._crit_edge33

._crit_edge33:                                    ; preds = %._crit_edge33.loopexit.unr-lcssa, %62, %.lr.ph41
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #11
  %71 = call ptr @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) @f) #11
  store ptr %71, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #11
  %72 = call ptr @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) @f) #11
  store ptr %72, ptr %4, align 8
  %73 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKxiELb0EEES6_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #11
  br i1 %73, label %.lr.ph36, label %._crit_edge37

74:                                               ; preds = %94, %.lr.ph32.new
  %indvars.iv49 = phi i64 [ 0, %.lr.ph32.new ], [ %indvars.iv.next50.1, %94 ]
  %indvars.iv47 = phi i64 [ %indvars.iv45, %.lr.ph32.new ], [ %indvars.iv.next48.1, %94 ]
  %niter69 = phi i64 [ 0, %.lr.ph32.new ], [ %niter69.next.1, %94 ]
  %.not26 = icmp sgt i64 %indvars.iv47, %58
  br i1 %.not26, label %84, label %75

75:                                               ; preds = %74
  %76 = shl nuw i64 1, %indvars.iv49
  %77 = getelementptr inbounds [51 x i8], ptr @b, i64 0, i64 %indvars.iv47
  %78 = load i8, ptr %77, align 1, !tbaa !11
  %79 = icmp eq i8 %78, 49
  %80 = zext i1 %79 to i64
  %81 = getelementptr inbounds [2 x i64], ptr @bmsk, i64 0, i64 %80
  %82 = load i64, ptr %81, align 8, !tbaa !12
  %83 = or i64 %82, %76
  store i64 %83, ptr %81, align 8, !tbaa !12
  br label %84

84:                                               ; preds = %74, %75
  %indvars.iv.next48 = add nsw i64 %indvars.iv47, -1
  %.not26.1 = icmp sgt i64 %indvars.iv.next48, %58
  br i1 %.not26.1, label %94, label %85

85:                                               ; preds = %84
  %86 = shl nuw i64 2, %indvars.iv49
  %87 = getelementptr inbounds [51 x i8], ptr @b, i64 0, i64 %indvars.iv.next48
  %88 = load i8, ptr %87, align 1, !tbaa !11
  %89 = icmp eq i8 %88, 49
  %90 = zext i1 %89 to i64
  %91 = getelementptr inbounds [2 x i64], ptr @bmsk, i64 0, i64 %90
  %92 = load i64, ptr %91, align 8, !tbaa !12
  %93 = or i64 %92, %86
  store i64 %93, ptr %91, align 8, !tbaa !12
  br label %94

94:                                               ; preds = %85, %84
  %indvars.iv.next50.1 = add nuw nsw i64 %indvars.iv49, 2
  %indvars.iv.next48.1 = add nsw i64 %indvars.iv47, -2
  %niter69.next.1 = add i64 %niter69, 2
  %niter69.ncmp.1 = icmp eq i64 %niter69.next.1, %unroll_iter68
  br i1 %niter69.ncmp.1, label %._crit_edge33.loopexit.unr-lcssa, label %74, !llvm.loop !16

._crit_edge37:                                    ; preds = %131, %._crit_edge33
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #11
  call void @_ZSt4swapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEEvRSt13unordered_mapIT_T0_T1_T2_T3_ESF_(ptr noundef nonnull align 8 dereferenceable(56) @f, ptr noundef nonnull align 8 dereferenceable(56) @g) #11
  %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
  %95 = load i32, ptr @alen, align 4, !tbaa !9
  %96 = load i32, ptr @blen, align 4, !tbaa !9
  %97 = add nsw i32 %96, %95
  %.not25.not = icmp sgt i32 %97, %indvars61
  %indvars.iv.next55 = add nuw nsw i32 %indvars.iv54, 1
  %indvar.next = add i64 %indvar, 1
  br i1 %.not25.not, label %.lr.ph41, label %._crit_edge42, !llvm.loop !17

.lr.ph36:                                         ; preds = %._crit_edge33, %131
  %98 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKxiELb0ELb0EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #11
  %99 = load i64, ptr %98, align 8, !tbaa !18
  %100 = call noundef ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKxiELb0ELb0EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #11
  %101 = getelementptr inbounds i8, ptr %100, i64 8
  %102 = load i32, ptr %101, align 8, !tbaa !20
  %103 = shl i64 %99, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #11
  %104 = load i64, ptr @amsk, align 16, !tbaa !12
  %105 = and i64 %104, %103
  %106 = load i64, ptr @bmsk, align 16, !tbaa !12
  %107 = and i64 %106, %99
  %108 = or i64 %107, %105
  store i64 %108, ptr %5, align 8, !tbaa !12
  %109 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @g, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %110 = load i32, ptr %109, align 4, !tbaa !9
  %111 = add nsw i32 %110, %102
  store i32 %111, ptr %109, align 4, !tbaa !9
  %112 = icmp sgt i32 %111, 1000000006
  br i1 %112, label %113, label %117

113:                                              ; preds = %.lr.ph36
  %114 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @g, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %115 = load i32, ptr %114, align 4, !tbaa !9
  %116 = add nsw i32 %115, -1000000007
  store i32 %116, ptr %114, align 4, !tbaa !9
  br label %117

117:                                              ; preds = %113, %.lr.ph36
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #11
  %118 = load i64, ptr getelementptr inbounds (i8, ptr @amsk, i64 8), align 8, !tbaa !12
  %119 = and i64 %118, %103
  %120 = load i64, ptr getelementptr inbounds (i8, ptr @bmsk, i64 8), align 8, !tbaa !12
  %121 = and i64 %120, %99
  %122 = or i64 %121, %119
  store i64 %122, ptr %5, align 8, !tbaa !12
  %123 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @g, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %124 = load i32, ptr %123, align 4, !tbaa !9
  %125 = add nsw i32 %124, %102
  store i32 %125, ptr %123, align 4, !tbaa !9
  %126 = icmp sgt i32 %125, 1000000006
  br i1 %126, label %127, label %131

127:                                              ; preds = %117
  %128 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @g, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %129 = load i32, ptr %128, align 4, !tbaa !9
  %130 = add nsw i32 %129, -1000000007
  store i32 %130, ptr %128, align 4, !tbaa !9
  br label %131

131:                                              ; preds = %127, %117
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #11
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKxiELb0ELb0EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #11
  %133 = call ptr @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) @f) #11
  store ptr %133, ptr %4, align 8
  %134 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKxiELb0EEES6_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #11
  br i1 %134, label %.lr.ph36, label %._crit_edge37, !llvm.loop !21
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIcLm51EENSt9enable_ifIXsr14__is_swappableIT_EE5valueEvE4typeERAT0__S1_S5_(ptr noundef nonnull align 1 dereferenceable(51), ptr noundef nonnull align 1 dereferenceable(51)) local_unnamed_addr #1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #9

attributes #0 = { 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 #1 = { 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 #2 = { 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 #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 = { 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 #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 #8 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = !{!19, !13, i64 0}
!19 = !{!"_ZTSSt4pairIKxiE", !13, i64 0, !10, i64 8}
!20 = !{!19, !10, i64 8}
!21 = distinct !{!21, !15}


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