; LLVM IR from tangjz/acm-icpc :: buaa/oj3rd (1267)

; 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.Edge = type { i32, i32 }

@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@pre = external dso_local global [100010 x i32], align 16
@dep = external dso_local global [100010 x i32], align 16
@seed1 = external dso_local global i32, align 4
@seed2 = external dso_local global i32, align 4
@pw1 = external dso_local global [100010 x i32], align 16
@pw2 = external dso_local global [100010 x i32], align 16
@h1 = external dso_local global [100010 x i32], align 16
@h2 = external dso_local global [100010 x i32], align 16
@str = external dso_local global [100010 x i8], align 16
@e = external dso_local global [200020 x %struct.Edge], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

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

; 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 noundef i32 @_Z4Hashii(i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %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 %struct.Edge, align 4
  %7 = alloca %struct.Edge, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef getelementptr inbounds (i8, ptr @str, i64 1))
  store i32 1, ptr @pw2, align 16, !tbaa !5
  store i32 1, ptr @pw1, align 16, !tbaa !5
  store i32 29, ptr @seed1, align 4, !tbaa !5
  %11 = load i32, ptr @seed1, align 4, !tbaa !5
  %12 = call noundef i32 @_Z3invi(i32 noundef %11)
  store i32 %12, ptr @seed2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %47, %0
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = icmp sle i32 %14, %15
  br i1 %16, label %18, label %17

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

18:                                               ; preds = %13
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sub nsw i32 %19, 1
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [100010 x i32], ptr @pw1, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = load i32, ptr @seed1, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = mul nsw i64 %24, %26
  %28 = srem i64 %27, 1000000007
  %29 = trunc i64 %28 to i32
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [100010 x i32], ptr @pw1, i64 0, i64 %31
  store i32 %29, ptr %32, align 4, !tbaa !5
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sub nsw i32 %33, 1
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100010 x i32], ptr @pw2, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = load i32, ptr @seed2, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = mul nsw i64 %38, %40
  %42 = srem i64 %41, 1000000007
  %43 = trunc i64 %42 to i32
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100010 x i32], ptr @pw2, i64 0, i64 %45
  store i32 %43, ptr %46, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %18
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %2, align 4, !tbaa !5
  br label %13, !llvm.loop !9

50:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %88, %50
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %56, label %55

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

56:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %57 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %4, ptr noundef %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %58 = getelementptr inbounds %struct.Edge, ptr %6, i32 0, i32 0
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [100010 x i32], ptr @pre, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  store i32 %62, ptr %58, align 4, !tbaa !11
  %63 = getelementptr inbounds %struct.Edge, ptr %6, i32 0, i32 1
  %64 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %64, ptr %63, align 4, !tbaa !13
  %65 = load i32, ptr @tot, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr @tot, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [200020 x %struct.Edge], ptr @e, i64 0, i64 %67
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %68, ptr align 4 %6, i64 8, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %69 = load i32, ptr @tot, align 4, !tbaa !5
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [100010 x i32], ptr @pre, i64 0, i64 %71
  store i32 %69, ptr %72, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %73 = getelementptr inbounds %struct.Edge, ptr %7, i32 0, i32 0
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [100010 x i32], ptr @pre, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  store i32 %77, ptr %73, align 4, !tbaa !11
  %78 = getelementptr inbounds %struct.Edge, ptr %7, i32 0, i32 1
  %79 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %79, ptr %78, align 4, !tbaa !13
  %80 = load i32, ptr @tot, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr @tot, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [200020 x %struct.Edge], ptr @e, i64 0, i64 %82
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %83, ptr align 4 %7, i64 8, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  %84 = load i32, ptr @tot, align 4, !tbaa !5
  %85 = load i32, ptr %5, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100010 x i32], ptr @pre, i64 0, i64 %86
  store i32 %84, ptr %87, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %88

88:                                               ; preds = %56
  %89 = load i32, ptr %3, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %3, align 4, !tbaa !5
  br label %51, !llvm.loop !15

91:                                               ; preds = %55
  store i32 1, ptr getelementptr inbounds ([100010 x i32], ptr @dep, i64 0, i64 1), align 4, !tbaa !5
  %92 = load i8, ptr getelementptr inbounds ([100010 x i8], ptr @str, i64 0, i64 1), align 1, !tbaa !16
  %93 = sext i8 %92 to i32
  %94 = sub nsw i32 %93, 97
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr getelementptr inbounds ([100010 x i32], ptr @h2, i64 0, i64 1), align 4, !tbaa !5
  store i32 %95, ptr getelementptr inbounds ([100010 x i32], ptr @h1, i64 0, i64 1), align 4, !tbaa !5
  call void @_Z3dfsi(i32 noundef 1)
  %96 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @q)
  br label %97

97:                                               ; preds = %101, %91
  %98 = load i32, ptr @q, align 4, !tbaa !5
  %99 = add nsw i32 %98, -1
  store i32 %99, ptr @q, align 4, !tbaa !5
  %100 = icmp ne i32 %98, 0
  br i1 %100, label %101, label %113

101:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %102 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %8, ptr noundef %9)
  %103 = load i32, ptr %8, align 4, !tbaa !5
  %104 = load i32, ptr %9, align 4, !tbaa !5
  %105 = call noundef i32 @_Z4Hashii(i32 noundef %103, i32 noundef %104)
  %106 = load i32, ptr %9, align 4, !tbaa !5
  %107 = load i32, ptr %8, align 4, !tbaa !5
  %108 = call noundef i32 @_Z4Hashii(i32 noundef %106, i32 noundef %107)
  %109 = icmp eq i32 %105, %108
  %110 = zext i1 %109 to i64
  %111 = select i1 %109, ptr @.str.3, ptr @.str.4
  %112 = call i32 @puts(ptr noundef %111)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %97, !llvm.loop !17

113:                                              ; preds = %97
  ret i32 0
}

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

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

declare i32 @puts(ptr noundef) #4

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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { "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 nounwind willreturn memory(argmem: readwrite) }
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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4}
!13 = !{!12, !6, i64 4}
!14 = !{i64 0, i64 4, !5, i64 4, i64 4, !5}
!15 = distinct !{!15, !10}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !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"

%struct.Edge = type { i32, i32 }

@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@pre = external dso_local local_unnamed_addr global [100010 x i32], align 16
@dep = external dso_local local_unnamed_addr global [100010 x i32], align 16
@seed1 = external dso_local local_unnamed_addr global i32, align 4
@seed2 = external dso_local local_unnamed_addr global i32, align 4
@pw1 = external dso_local local_unnamed_addr global [100010 x i32], align 16
@pw2 = external dso_local local_unnamed_addr global [100010 x i32], align 16
@h1 = external dso_local local_unnamed_addr global [100010 x i32], align 16
@h2 = external dso_local local_unnamed_addr global [100010 x i32], align 16
@str = external dso_local global [100010 x i8], align 16
@e = external dso_local local_unnamed_addr global [200020 x %struct.Edge], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsi(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: 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 noundef i32 @_Z4Hashii(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull getelementptr inbounds (i8, ptr @str, i64 1))
  store i32 1, ptr @pw2, align 16, !tbaa !5
  store i32 1, ptr @pw1, align 16, !tbaa !5
  store i32 29, ptr @seed1, align 4, !tbaa !5
  %6 = tail call noundef i32 @_Z3invi(i32 noundef 29)
  store i32 %6, ptr @seed2, align 4, !tbaa !5
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %.not12 = icmp slt i32 %7, 1
  br i1 %.not12, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0
  %8 = load i32, ptr @seed1, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %10 = sext i32 %6 to i64
  %11 = add nuw i32 %7, 1
  %wide.trip.count = zext i32 %11 to i64
  %.pre = load i32, ptr @pw1, align 16, !tbaa !5
  %.pre21 = load i32, ptr @pw2, align 16, !tbaa !5
  br label %12

.preheader:                                       ; preds = %12
  %.not = icmp eq i32 %7, 1
  br i1 %.not, label %._crit_edge, label %.lr.ph15

12:                                               ; preds = %.lr.ph, %12
  %13 = phi i32 [ %.pre21, %.lr.ph ], [ %23, %12 ]
  %14 = phi i32 [ %.pre, %.lr.ph ], [ %18, %12 ]
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %12 ]
  %15 = sext i32 %14 to i64
  %16 = mul nsw i64 %9, %15
  %17 = srem i64 %16, 1000000007
  %18 = trunc nsw i64 %17 to i32
  %19 = getelementptr inbounds [100010 x i32], ptr @pw1, i64 0, i64 %indvars.iv
  store i32 %18, ptr %19, align 4, !tbaa !5
  %20 = sext i32 %13 to i64
  %21 = mul nsw i64 %20, %10
  %22 = srem i64 %21, 1000000007
  %23 = trunc nsw i64 %22 to i32
  %24 = getelementptr inbounds [100010 x i32], ptr @pw2, i64 0, i64 %indvars.iv
  store i32 %23, ptr %24, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %12, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph15, %0, %.preheader
  store i32 1, ptr getelementptr inbounds (i8, ptr @dep, i64 4), align 4, !tbaa !5
  %25 = load i8, ptr getelementptr inbounds (i8, ptr @str, i64 1), align 1, !tbaa !11
  %26 = sext i8 %25 to i32
  %27 = add nsw i32 %26, -96
  store i32 %27, ptr getelementptr inbounds (i8, ptr @h2, i64 4), align 4, !tbaa !5
  store i32 %27, ptr getelementptr inbounds (i8, ptr @h1, i64 4), align 4, !tbaa !5
  call void @_Z3dfsi(i32 noundef 1)
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @q)
  %29 = load i32, ptr @q, align 4, !tbaa !5
  %30 = add nsw i32 %29, -1
  store i32 %30, ptr @q, align 4, !tbaa !5
  %.not1116 = icmp eq i32 %29, 0
  br i1 %.not1116, label %._crit_edge19, label %.lr.ph18

.lr.ph15:                                         ; preds = %.preheader, %.lr.ph15
  %.01014 = phi i32 [ %47, %.lr.ph15 ], [ 1, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %32 = load i32, ptr %1, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [100010 x i32], ptr @pre, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = load i32, ptr @tot, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [200020 x %struct.Edge], ptr @e, i64 0, i64 %39
  store i32 %35, ptr %40, align 8, !tbaa !5
  %.sroa.42.0..sroa_idx = getelementptr inbounds i8, ptr %40, i64 4
  store i32 %36, ptr %.sroa.42.0..sroa_idx, align 4, !tbaa !5
  store i32 %38, ptr %34, align 4, !tbaa !5
  %41 = sext i32 %36 to i64
  %42 = getelementptr inbounds [100010 x i32], ptr @pre, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = add nsw i32 %37, 2
  store i32 %44, ptr @tot, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [200020 x %struct.Edge], ptr @e, i64 0, i64 %45
  store i32 %43, ptr %46, align 8, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %46, i64 4
  store i32 %32, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  store i32 %44, ptr %42, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %47 = add nuw nsw i32 %.01014, 1
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %.lr.ph15, label %._crit_edge, !llvm.loop !12

.lr.ph18:                                         ; preds = %._crit_edge, %.lr.ph18
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %50 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = call noundef i32 @_Z4Hashii(i32 noundef %51, i32 noundef %52)
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = call noundef i32 @_Z4Hashii(i32 noundef %54, i32 noundef %55)
  %57 = icmp eq i32 %53, %56
  %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 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  %60 = load i32, ptr @q, align 4, !tbaa !5
  %61 = add nsw i32 %60, -1
  store i32 %61, ptr @q, align 4, !tbaa !5
  %.not11 = icmp eq i32 %60, 0
  br i1 %.not11, label %._crit_edge19, label %.lr.ph18, !llvm.loop !13

._crit_edge19:                                    ; preds = %.lr.ph18, %._crit_edge
  ret i32 0
}

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

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

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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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 = { 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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


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