; LLVM IR from tangjz/acm-icpc :: 51nod (1553)

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

%struct.Hash = type { [2 x i32] }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@pw = external dso_local global [100001 x %struct.Hash], align 16
@sum = external dso_local global [100001 x %struct.Hash], align 16
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z9seg_buildii(i32 noundef, i32 noundef) #0

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z7seg_updiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_Z7seg_queiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #5 {
  %1 = alloca i32, align 4
  %2 = alloca %struct.Hash, align 4
  %3 = alloca i32, align 4
  %4 = alloca %struct.Hash, align 4
  %5 = alloca %struct.Hash, align 4
  %6 = alloca %struct.Hash, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.Hash, align 4
  %12 = alloca %struct.Hash, align 4
  store i32 0, ptr %1, align 4
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m, ptr noundef @q)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %14 = getelementptr inbounds %struct.Hash, ptr %2, i32 0, i32 0
  store i32 1, ptr %14, align 4, !tbaa !5
  %15 = getelementptr inbounds i32, ptr %14, i64 1
  store i32 1, ptr %15, align 4, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 @pw, ptr align 4 %2, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %46, %0
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = icmp sle i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %49

21:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = sub nsw i32 %22, 1
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [100001 x %struct.Hash], ptr @pw, i64 0, i64 %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %26 = getelementptr inbounds %struct.Hash, ptr %5, i32 0, i32 0
  store i32 13, ptr %26, align 4, !tbaa !5
  %27 = getelementptr inbounds i32, ptr %26, i64 1
  store i32 13, ptr %27, align 4, !tbaa !5
  %28 = call i64 @_ZNK4HashmlERKS_(ptr noundef nonnull align 4 dereferenceable(8) %25, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %29 = getelementptr inbounds %struct.Hash, ptr %4, i32 0, i32 0
  store i64 %28, ptr %29, align 4
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [100001 x %struct.Hash], ptr @pw, i64 0, i64 %31
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %32, ptr align 4 %4, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = sub nsw i32 %33, 1
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100001 x %struct.Hash], ptr @sum, i64 0, i64 %35
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = sub nsw i32 %37, 1
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [100001 x %struct.Hash], ptr @pw, i64 0, i64 %39
  %41 = call i64 @_ZNK4HashplERKS_(ptr noundef nonnull align 4 dereferenceable(8) %36, ptr noundef nonnull align 4 dereferenceable(8) %40)
  %42 = getelementptr inbounds %struct.Hash, ptr %6, i32 0, i32 0
  store i64 %41, ptr %42, align 4
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100001 x %struct.Hash], ptr @sum, i64 0, i64 %44
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %45, ptr align 4 %6, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %46

46:                                               ; preds = %21
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %3, align 4, !tbaa !5
  br label %16, !llvm.loop !11

49:                                               ; preds = %20
  %50 = load i32, ptr @n, align 4, !tbaa !5
  %51 = call noundef i32 @_Z9seg_buildii(i32 noundef 1, i32 noundef %50)
  %52 = load i32, ptr @q, align 4, !tbaa !5
  %53 = load i32, ptr @m, align 4, !tbaa !5
  %54 = add nsw i32 %53, %52
  store i32 %54, ptr @m, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %108, %49
  %56 = load i32, ptr @m, align 4, !tbaa !5
  %57 = add nsw i32 %56, -1
  store i32 %57, ptr @m, align 4, !tbaa !5
  %58 = icmp ne i32 %56, 0
  br i1 %58, label %59, label %109

59:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %60 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %7, ptr noundef %8, ptr noundef %9, ptr noundef %10)
  %61 = load i32, ptr %7, align 4, !tbaa !5
  %62 = icmp eq i32 %61, 1
  br i1 %62, label %63, label %69

63:                                               ; preds = %59
  %64 = load i32, ptr @n, align 4, !tbaa !5
  %65 = load i32, ptr %8, align 4, !tbaa !5
  %66 = load i32, ptr %9, align 4, !tbaa !5
  %67 = load i32, ptr %10, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %10, align 4, !tbaa !5
  call void @_Z7seg_updiiiii(i32 noundef 1, i32 noundef %64, i32 noundef %65, i32 noundef %66, i32 noundef %68)
  br label %108

69:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %70 = load i32, ptr %8, align 4, !tbaa !5
  %71 = load i32, ptr %9, align 4, !tbaa !5
  %72 = load i32, ptr %10, align 4, !tbaa !5
  %73 = sub nsw i32 %71, %72
  %74 = icmp sle i32 %70, %73
  br i1 %74, label %75, label %83

75:                                               ; preds = %69
  %76 = load i32, ptr @n, align 4, !tbaa !5
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = load i32, ptr %9, align 4, !tbaa !5
  %79 = load i32, ptr %10, align 4, !tbaa !5
  %80 = sub nsw i32 %78, %79
  %81 = call i64 @_Z7seg_queiiii(i32 noundef 1, i32 noundef %76, i32 noundef %77, i32 noundef %80)
  %82 = getelementptr inbounds %struct.Hash, ptr %11, i32 0, i32 0
  store i64 %81, ptr %82, align 4
  br label %86

83:                                               ; preds = %69
  %84 = getelementptr inbounds %struct.Hash, ptr %11, i32 0, i32 0
  store i32 0, ptr %84, align 4, !tbaa !5
  %85 = getelementptr inbounds i32, ptr %84, i64 1
  store i32 0, ptr %85, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %83, %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = load i32, ptr %10, align 4, !tbaa !5
  %89 = add nsw i32 %87, %88
  %90 = load i32, ptr %9, align 4, !tbaa !5
  %91 = icmp sle i32 %89, %90
  br i1 %91, label %92, label %100

92:                                               ; preds = %86
  %93 = load i32, ptr @n, align 4, !tbaa !5
  %94 = load i32, ptr %8, align 4, !tbaa !5
  %95 = load i32, ptr %10, align 4, !tbaa !5
  %96 = add nsw i32 %94, %95
  %97 = load i32, ptr %9, align 4, !tbaa !5
  %98 = call i64 @_Z7seg_queiiii(i32 noundef 1, i32 noundef %93, i32 noundef %96, i32 noundef %97)
  %99 = getelementptr inbounds %struct.Hash, ptr %12, i32 0, i32 0
  store i64 %98, ptr %99, align 4
  br label %103

100:                                              ; preds = %86
  %101 = getelementptr inbounds %struct.Hash, ptr %12, i32 0, i32 0
  store i32 0, ptr %101, align 4, !tbaa !5
  %102 = getelementptr inbounds i32, ptr %101, i64 1
  store i32 0, ptr %102, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %100, %92
  %104 = call noundef zeroext i1 @_ZNK4HasheqERKS_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %12)
  %105 = zext i1 %104 to i64
  %106 = select i1 %104, ptr @.str.3, ptr @.str.4
  %107 = call i32 @puts(ptr noundef %106)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %108

108:                                              ; preds = %103, %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %55, !llvm.loop !13

109:                                              ; preds = %55
  ret i32 0
}

declare i32 @puts(ptr noundef) #2

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

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

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

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


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

%struct.Hash = type { [2 x i32] }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@pw = external dso_local global [100001 x %struct.Hash], align 16
@sum = external dso_local global [100001 x %struct.Hash], align 16
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z9seg_buildii(i32 noundef, i32 noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i64 @_ZNK4HashmlERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i64 @_ZNK4HashplERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z7seg_updiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_Z7seg_queiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %1 = alloca %struct.Hash, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %struct.Hash, align 8
  %7 = alloca %struct.Hash, align 8
  %8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @q)
  store i32 1, ptr @pw, align 16
  store i32 1, ptr getelementptr inbounds (i8, ptr @pw, i64 4), align 4, !tbaa !5
  %9 = load i32, ptr @n, align 4, !tbaa !8
  %.not17 = icmp slt i32 %9, 1
  br i1 %.not17, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0
  %10 = getelementptr inbounds i8, ptr %1, i64 4
  br label %18

._crit_edge:                                      ; preds = %18, %0
  %.lcssa = phi i32 [ %9, %0 ], [ %26, %18 ]
  %11 = call noundef i32 @_Z9seg_buildii(i32 noundef 1, i32 noundef %.lcssa)
  %12 = load i32, ptr @q, align 4, !tbaa !8
  %13 = load i32, ptr @m, align 4, !tbaa !8
  %14 = add nsw i32 %13, %12
  %15 = add nsw i32 %14, -1
  store i32 %15, ptr @m, align 4, !tbaa !8
  %.not1419 = icmp eq i32 %14, 0
  br i1 %.not1419, label %._crit_edge22, label %.lr.ph21

.lr.ph21:                                         ; preds = %._crit_edge
  %16 = getelementptr inbounds i8, ptr %6, i64 4
  %17 = getelementptr inbounds i8, ptr %7, i64 4
  br label %28

18:                                               ; preds = %.lr.ph, %18
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %18 ]
  %19 = add nsw i64 %indvars.iv, -1
  %20 = getelementptr inbounds [100001 x %struct.Hash], ptr @pw, i64 0, i64 %19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  store i32 13, ptr %1, align 4, !tbaa !8
  store i32 13, ptr %10, align 4, !tbaa !8
  %21 = call i64 @_ZNK4HashmlERKS_(ptr noundef nonnull align 4 dereferenceable(8) %20, ptr noundef nonnull align 4 dereferenceable(8) %1)
  %22 = getelementptr inbounds [100001 x %struct.Hash], ptr @pw, i64 0, i64 %indvars.iv
  store i64 %21, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  %23 = getelementptr inbounds [100001 x %struct.Hash], ptr @sum, i64 0, i64 %19
  %24 = call i64 @_ZNK4HashplERKS_(ptr noundef nonnull align 4 dereferenceable(8) %23, ptr noundef nonnull align 4 dereferenceable(8) %20)
  %25 = getelementptr inbounds [100001 x %struct.Hash], ptr @sum, i64 0, i64 %indvars.iv
  store i64 %24, ptr %25, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %26 = load i32, ptr @n, align 4, !tbaa !8
  %27 = sext i32 %26 to i64
  %.not.not = icmp slt i64 %indvars.iv, %27
  br i1 %.not.not, label %18, label %._crit_edge, !llvm.loop !10

28:                                               ; preds = %.lr.ph21, %60
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %30 = load i32, ptr %2, align 4, !tbaa !8
  %31 = icmp eq i32 %30, 1
  br i1 %31, label %32, label %38

32:                                               ; preds = %28
  %33 = load i32, ptr @n, align 4, !tbaa !8
  %34 = load i32, ptr %3, align 4, !tbaa !8
  %35 = load i32, ptr %4, align 4, !tbaa !8
  %36 = load i32, ptr %5, align 4, !tbaa !8
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %5, align 4, !tbaa !8
  call void @_Z7seg_updiiiii(i32 noundef 1, i32 noundef %33, i32 noundef %34, i32 noundef %35, i32 noundef %37)
  br label %60

38:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %39 = load i32, ptr %3, align 4, !tbaa !8
  %40 = load i32, ptr %4, align 4, !tbaa !8
  %41 = load i32, ptr %5, align 4, !tbaa !8
  %42 = sub nsw i32 %40, %41
  %.not15 = icmp sgt i32 %39, %42
  br i1 %.not15, label %46, label %43

43:                                               ; preds = %38
  %44 = load i32, ptr @n, align 4, !tbaa !8
  %45 = call i64 @_Z7seg_queiiii(i32 noundef 1, i32 noundef %44, i32 noundef %39, i32 noundef %42)
  store i64 %45, ptr %6, align 8
  %.pre = load i32, ptr %3, align 4, !tbaa !8
  %.pre25 = load i32, ptr %5, align 4, !tbaa !8
  %.pre26 = load i32, ptr %4, align 4, !tbaa !8
  br label %47

46:                                               ; preds = %38
  store i32 0, ptr %6, align 8, !tbaa !8
  store i32 0, ptr %16, align 4, !tbaa !8
  br label %47

47:                                               ; preds = %46, %43
  %48 = phi i32 [ %40, %46 ], [ %.pre26, %43 ]
  %49 = phi i32 [ %41, %46 ], [ %.pre25, %43 ]
  %50 = phi i32 [ %39, %46 ], [ %.pre, %43 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %51 = add nsw i32 %49, %50
  %.not16 = icmp sgt i32 %51, %48
  br i1 %.not16, label %55, label %52

52:                                               ; preds = %47
  %53 = load i32, ptr @n, align 4, !tbaa !8
  %54 = call i64 @_Z7seg_queiiii(i32 noundef 1, i32 noundef %53, i32 noundef %51, i32 noundef %48)
  store i64 %54, ptr %7, align 8
  br label %56

55:                                               ; preds = %47
  store i32 0, ptr %7, align 8, !tbaa !8
  store i32 0, ptr %17, align 4, !tbaa !8
  br label %56

56:                                               ; preds = %55, %52
  %57 = call noundef zeroext i1 @_ZNK4HasheqERKS_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %7)
  %58 = select i1 %57, ptr @.str.3, ptr @.str.4
  %59 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %58)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %60

60:                                               ; preds = %56, %32
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  %.pr = load i32, ptr @m, align 4, !tbaa !8
  %61 = add nsw i32 %.pr, -1
  store i32 %61, ptr @m, align 4, !tbaa !8
  %.not14 = icmp eq i32 %.pr, 0
  br i1 %.not14, label %._crit_edge22, label %28, !llvm.loop !12

._crit_edge22:                                    ; preds = %60, %._crit_edge
  ret i32 0
}

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 #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 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}


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