; LLVM IR from tangjz/acm-icpc :: spoj (PAIRDIV2)

; 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 }

@tot = external dso_local global i32, align 4
@pr = external dso_local global [100000 x i32], align 16
@d = external dso_local global [100000 x i32], align 16
@cnt = external dso_local global i32, align 4
@p = external dso_local global [17 x i32], align 16
@e = external dso_local global [17 x i32], align 16
@ans = external dso_local global i32, align 4
@n = external dso_local global i64, align 8
@a = external dso_local global i64, align 8
@b = external dso_local global i64, align 8
@HashCounter = external dso_local global i32, align 4
@Hash = external dso_local global %"class.std::unordered_map", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = 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 uwtable
declare dso_local void @_Z3dfsix(i32 noundef, i64 noundef) #2

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::unordered_map", align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %63, %0
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = icmp slt i32 %11, 100000
  br i1 %12, label %14, label %13

13:                                               ; preds = %10
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %66

14:                                               ; preds = %10
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [100000 x i32], ptr @d, i64 0, i64 %16
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %29, label %20

20:                                               ; preds = %14
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [100000 x i32], ptr @d, i64 0, i64 %23
  store i32 %21, ptr %24, align 4, !tbaa !5
  %25 = load i32, ptr @tot, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr @tot, align 4, !tbaa !5
  %27 = sext i32 %25 to i64
  %28 = getelementptr inbounds [100000 x i32], ptr @pr, i64 0, i64 %27
  store i32 %21, ptr %28, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %20, %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  br label %30

30:                                               ; preds = %58, %29
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [100000 x i32], ptr @pr, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = mul nsw i32 %31, %35
  store i32 %36, ptr %5, align 4, !tbaa !5
  %37 = icmp slt i32 %36, 100000
  br i1 %37, label %39, label %38

38:                                               ; preds = %30
  store i32 5, ptr %3, align 4
  br label %61

39:                                               ; preds = %30
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [100000 x i32], ptr @pr, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100000 x i32], ptr @d, i64 0, i64 %45
  store i32 %43, ptr %46, align 4, !tbaa !5
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [100000 x i32], ptr @d, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100000 x i32], ptr @pr, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = icmp eq i32 %50, %54
  br i1 %55, label %56, label %57

56:                                               ; preds = %39
  store i32 5, ptr %3, align 4
  br label %61

57:                                               ; preds = %39
  br label %58

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

61:                                               ; preds = %56, %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %62

62:                                               ; preds = %61
  br label %63

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

66:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %67 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %6)
  br label %68

68:                                               ; preds = %165, %66
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = add nsw i32 %69, -1
  store i32 %70, ptr %6, align 4, !tbaa !5
  %71 = icmp ne i32 %69, 0
  br i1 %71, label %72, label %168

72:                                               ; preds = %68
  store i32 0, ptr @HashCounter, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 56, ptr %7) #7
  call void @llvm.memset.p0.i64(ptr align 8 %7, i8 0, i64 56, i1 false)
  call void @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %7) #7
  call void @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEE4swapERS8_(ptr noundef nonnull align 8 dereferenceable(56) %7, ptr noundef nonnull align 8 dereferenceable(56) @Hash) #7
  call void @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %7) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %7) #7
  %73 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @a, ptr noundef @b)
  store i32 0, ptr @cnt, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %74 = load i64, ptr @n, align 8, !tbaa !12
  store i64 %74, ptr %8, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %149, %72
  %76 = load i32, ptr %9, align 4, !tbaa !5
  %77 = load i32, ptr @tot, align 4, !tbaa !5
  %78 = icmp slt i32 %76, %77
  br i1 %78, label %79, label %93

79:                                               ; preds = %75
  %80 = load i32, ptr %9, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [100000 x i32], ptr @pr, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = load i32, ptr %9, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100000 x i32], ptr @pr, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = mul nsw i64 %84, %89
  %91 = load i64, ptr %8, align 8, !tbaa !12
  %92 = icmp sle i64 %90, %91
  br label %93

93:                                               ; preds = %79, %75
  %94 = phi i1 [ false, %75 ], [ %92, %79 ]
  br i1 %94, label %96, label %95

95:                                               ; preds = %93
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %152

96:                                               ; preds = %93
  %97 = load i64, ptr %8, align 8, !tbaa !12
  %98 = load i32, ptr %9, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [100000 x i32], ptr @pr, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = srem i64 %97, %102
  %104 = icmp eq i64 %103, 0
  br i1 %104, label %105, label %148

105:                                              ; preds = %96
  %106 = load i32, ptr @cnt, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [17 x i32], ptr @e, i64 0, i64 %107
  store i32 1, ptr %108, align 4, !tbaa !5
  %109 = load i32, ptr %9, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [100000 x i32], ptr @pr, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = load i64, ptr %8, align 8, !tbaa !12
  %115 = sdiv i64 %114, %113
  store i64 %115, ptr %8, align 8, !tbaa !12
  br label %116

116:                                              ; preds = %126, %105
  %117 = load i64, ptr %8, align 8, !tbaa !12
  %118 = load i32, ptr %9, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [100000 x i32], ptr @pr, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = srem i64 %117, %122
  %124 = icmp eq i64 %123, 0
  br i1 %124, label %125, label %139

125:                                              ; preds = %116
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr @cnt, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [17 x i32], ptr @e, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %129, align 4, !tbaa !5
  %132 = load i32, ptr %9, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [100000 x i32], ptr @pr, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = load i64, ptr %8, align 8, !tbaa !12
  %138 = sdiv i64 %137, %136
  store i64 %138, ptr %8, align 8, !tbaa !12
  br label %116, !llvm.loop !14

139:                                              ; preds = %116
  %140 = load i32, ptr %9, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [100000 x i32], ptr @pr, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !5
  %144 = load i32, ptr @cnt, align 4, !tbaa !5
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr @cnt, align 4, !tbaa !5
  %146 = sext i32 %144 to i64
  %147 = getelementptr inbounds [17 x i32], ptr @p, i64 0, i64 %146
  store i32 %143, ptr %147, align 4, !tbaa !5
  br label %148

148:                                              ; preds = %139, %96
  br label %149

149:                                              ; preds = %148
  %150 = load i32, ptr %9, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %9, align 4, !tbaa !5
  br label %75, !llvm.loop !15

152:                                              ; preds = %95
  %153 = load i64, ptr %8, align 8, !tbaa !12
  %154 = icmp sgt i64 %153, 1
  br i1 %154, label %155, label %165

155:                                              ; preds = %152
  %156 = load i32, ptr @cnt, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [17 x i32], ptr @e, i64 0, i64 %157
  store i32 1, ptr %158, align 4, !tbaa !5
  %159 = load i64, ptr %8, align 8, !tbaa !12
  %160 = trunc i64 %159 to i32
  %161 = load i32, ptr @cnt, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr @cnt, align 4, !tbaa !5
  %163 = sext i32 %161 to i64
  %164 = getelementptr inbounds [17 x i32], ptr @p, i64 0, i64 %163
  store i32 %160, ptr %164, align 4, !tbaa !5
  br label %165

165:                                              ; preds = %155, %152
  store i32 0, ptr @ans, align 4, !tbaa !5
  call void @_Z3dfsix(i32 noundef 0, i64 noundef 1)
  %166 = load i32, ptr @ans, align 4, !tbaa !5
  %167 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %166)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %68, !llvm.loop !16

168:                                              ; preds = %68
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %169 = load i32, ptr %1, align 4
  ret i32 %169
}

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

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

; 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

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

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

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

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

@tot = external dso_local local_unnamed_addr global i32, align 4
@pr = external dso_local local_unnamed_addr global [100000 x i32], align 16
@d = external dso_local local_unnamed_addr global [100000 x i32], align 16
@cnt = external dso_local local_unnamed_addr global i32, align 4
@p = external dso_local local_unnamed_addr global [17 x i32], align 16
@e = external dso_local local_unnamed_addr global [17 x i32], align 16
@ans = external dso_local local_unnamed_addr global i32, align 4
@n = external dso_local global i64, align 8
@a = external dso_local global i64, align 8
@b = external dso_local global i64, align 8
@HashCounter = external dso_local local_unnamed_addr global i32, align 4
@Hash = external dso_local global %"class.std::unordered_map", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = 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 uwtable
declare dso_local void @_Z3dfsix(i32 noundef, i64 noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::unordered_map", align 8
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  br label %7

3:                                                ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = add nsw i32 %5, -1
  store i32 %6, ptr %1, align 4, !tbaa !5
  %.not44 = icmp eq i32 %5, 0
  br i1 %.not44, label %._crit_edge47, label %.lr.ph46

7:                                                ; preds = %0, %._crit_edge
  %indvars.iv49 = phi i64 [ 2, %0 ], [ %indvars.iv.next50, %._crit_edge ]
  %8 = phi i32 [ %tot.promoted, %0 ], [ %16, %._crit_edge ]
  %9 = getelementptr inbounds [100000 x i32], ptr @d, i64 0, i64 %indvars.iv49
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %.not34 = icmp eq i32 %10, 0
  %11 = trunc nuw nsw i64 %indvars.iv49 to i32
  br i1 %.not34, label %12, label %._crit_edge56

12:                                               ; preds = %7
  store i32 %11, ptr %9, align 4, !tbaa !5
  %13 = add nsw i32 %8, 1
  store i32 %13, ptr @tot, align 4, !tbaa !5
  %14 = sext i32 %8 to i64
  %15 = getelementptr inbounds [100000 x i32], ptr @pr, i64 0, i64 %14
  store i32 %11, ptr %15, align 4, !tbaa !5
  br label %._crit_edge56

._crit_edge56:                                    ; preds = %7, %12
  %16 = phi i32 [ %13, %12 ], [ %8, %7 ]
  %17 = load i32, ptr @pr, align 16, !tbaa !5
  %18 = mul nsw i32 %17, %11
  %19 = icmp slt i32 %18, 100000
  br i1 %19, label %.lr.ph, label %._crit_edge

20:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %21 = getelementptr inbounds [100000 x i32], ptr @pr, i64 0, i64 %indvars.iv.next
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = mul nsw i32 %22, %11
  %24 = icmp slt i32 %23, 100000
  br i1 %24, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.lr.ph:                                           ; preds = %._crit_edge56, %20
  %indvars.iv = phi i64 [ %indvars.iv.next, %20 ], [ 0, %._crit_edge56 ]
  %25 = phi i32 [ %23, %20 ], [ %18, %._crit_edge56 ]
  %26 = phi i32 [ %22, %20 ], [ %17, %._crit_edge56 ]
  %27 = sext i32 %25 to i64
  %28 = getelementptr inbounds [100000 x i32], ptr @d, i64 0, i64 %27
  store i32 %26, ptr %28, align 4, !tbaa !5
  %29 = load i32, ptr %9, align 4, !tbaa !5
  %30 = icmp eq i32 %29, %26
  br i1 %30, label %._crit_edge, label %20

._crit_edge:                                      ; preds = %20, %.lr.ph, %._crit_edge56
  %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next50, 100000
  br i1 %exitcond.not, label %3, label %7, !llvm.loop !11

.lr.ph46:                                         ; preds = %3, %63
  store i32 0, ptr @HashCounter, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %2) #7
  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) #7
  call void @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEE4swapERS8_(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 8 dereferenceable(56) @Hash) #7
  call void @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %2) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %2) #7
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @a, ptr noundef nonnull @b)
  store i32 0, ptr @cnt, align 4, !tbaa !5
  %32 = load i64, ptr @n, align 8, !tbaa !12
  %33 = load i32, ptr @tot, align 4, !tbaa !5
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %.lr.ph41.preheader, label %.critedge

.lr.ph41.preheader:                               ; preds = %.lr.ph46
  %wide.trip.count = zext nneg i32 %33 to i64
  br label %.lr.ph41

.lr.ph41:                                         ; preds = %.lr.ph41.preheader, %55
  %indvars.iv52 = phi i64 [ 0, %.lr.ph41.preheader ], [ %indvars.iv.next53, %55 ]
  %.02938 = phi i64 [ %32, %.lr.ph41.preheader ], [ %.2, %55 ]
  %35 = phi i32 [ 0, %.lr.ph41.preheader ], [ %56, %55 ]
  %36 = getelementptr inbounds [100000 x i32], ptr @pr, i64 0, i64 %indvars.iv52
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = mul nsw i64 %38, %38
  %.not33 = icmp sgt i64 %39, %.02938
  br i1 %.not33, label %.critedge, label %42

.critedge:                                        ; preds = %.lr.ph41, %55, %.lr.ph46
  %40 = phi i32 [ 0, %.lr.ph46 ], [ %56, %55 ], [ %35, %.lr.ph41 ]
  %.029.lcssa = phi i64 [ %32, %.lr.ph46 ], [ %.2, %55 ], [ %.02938, %.lr.ph41 ]
  %41 = icmp sgt i64 %.029.lcssa, 1
  br i1 %41, label %57, label %63

42:                                               ; preds = %.lr.ph41
  %43 = srem i64 %.02938, %38
  %44 = icmp eq i64 %43, 0
  br i1 %44, label %45, label %55

45:                                               ; preds = %42
  %46 = sext i32 %35 to i64
  br label %47

47:                                               ; preds = %47, %45
  %storemerge = phi i32 [ 1, %45 ], [ %50, %47 ]
  %.029.pn = phi i64 [ %.02938, %45 ], [ %.1, %47 ]
  %.1 = sdiv i64 %.029.pn, %38
  %48 = srem i64 %.1, %38
  %49 = icmp eq i64 %48, 0
  %50 = add nuw nsw i32 %storemerge, 1
  br i1 %49, label %47, label %51, !llvm.loop !14

51:                                               ; preds = %47
  %52 = getelementptr inbounds [17 x i32], ptr @e, i64 0, i64 %46
  store i32 %storemerge, ptr %52, align 4, !tbaa !5
  %53 = add nsw i32 %35, 1
  store i32 %53, ptr @cnt, align 4, !tbaa !5
  %54 = getelementptr inbounds [17 x i32], ptr @p, i64 0, i64 %46
  store i32 %37, ptr %54, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %42, %51
  %56 = phi i32 [ %53, %51 ], [ %35, %42 ]
  %.2 = phi i64 [ %.1, %51 ], [ %.02938, %42 ]
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
  %exitcond55.not = icmp eq i64 %indvars.iv.next53, %wide.trip.count
  br i1 %exitcond55.not, label %.critedge, label %.lr.ph41, !llvm.loop !15

57:                                               ; preds = %.critedge
  %58 = sext i32 %40 to i64
  %59 = getelementptr inbounds [17 x i32], ptr @e, i64 0, i64 %58
  store i32 1, ptr %59, align 4, !tbaa !5
  %60 = trunc i64 %.029.lcssa to i32
  %61 = add nsw i32 %40, 1
  store i32 %61, ptr @cnt, align 4, !tbaa !5
  %62 = getelementptr inbounds [17 x i32], ptr @p, i64 0, i64 %58
  store i32 %60, ptr %62, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %57, %.critedge
  store i32 0, ptr @ans, align 4, !tbaa !5
  call void @_Z3dfsix(i32 noundef 0, i64 noundef 1)
  %64 = load i32, ptr @ans, align 4, !tbaa !5
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %64)
  %66 = load i32, ptr %1, align 4, !tbaa !5
  %67 = add nsw i32 %66, -1
  store i32 %67, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %66, 0
  br i1 %.not, label %._crit_edge47, label %.lr.ph46, !llvm.loop !16

._crit_edge47:                                    ; preds = %63, %3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

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

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

; 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5

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

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

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


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