; LLVM IR from lzyrapx/Competitive-Programming :: 百度之星/2016 Astar Contest - Round 2A (1003-Snacks)

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

@T = external dso_local global i32, align 4
@p = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@pos = external dso_local global [100005 x i32], align 16
@sz = external dso_local global i32, align 4
@ql = external dso_local global i32, align 4
@qr = external dso_local global i32, align 4
@dfn = external dso_local global i32, align 4
@in = external dso_local global [100005 x i32], align 16
@out = external dso_local global [100005 x i32], align 16
@q = external dso_local global i32, align 4
@a = external dso_local global [100005 x i32], align 16
@top = external dso_local global i32, align 4
@vis = external dso_local global [100005 x i32], align 16
@ans = external dso_local global i64, align 8
@s = external dso_local global [100005 x i64], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4initii(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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3dfsv() #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5buildiii(i32 noundef, 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 i32, align 4
  %7 = alloca i32, 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 @T)
  br label %11

11:                                               ; preds = %92, %0
  %12 = load i32, ptr @T, align 4, !tbaa !5
  %13 = add nsw i32 %12, -1
  store i32 %13, ptr @T, align 4, !tbaa !5
  %14 = icmp ne i32 %12, 0
  br i1 %14, label %15, label %93

15:                                               ; preds = %11
  call void @llvm.memset.p0.i64(ptr align 16 @pos, i8 0, i64 400020, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 400020, i1 false)
  store i32 0, ptr @dfn, align 4, !tbaa !5
  store i32 0, ptr @sz, align 4, !tbaa !5
  store i32 1, ptr @top, align 4, !tbaa !5
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %29, %15
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = sub nsw i32 %19, 1
  %21 = icmp sle i32 %18, %20
  br i1 %21, label %23, label %22

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

23:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %3, ptr noundef %4)
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = load i32, ptr %4, align 4, !tbaa !5
  call void @_Z4initii(i32 noundef %25, i32 noundef %26)
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z4initii(i32 noundef %27, i32 noundef %28)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %29

29:                                               ; preds = %23
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %2, align 4, !tbaa !5
  br label %17, !llvm.loop !9

32:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %44, %32
  %34 = load i32, ptr %5, align 4, !tbaa !5
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %36 = sub nsw i32 %35, 1
  %37 = icmp sle i32 %34, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %47

39:                                               ; preds = %33
  %40 = load i32, ptr %5, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %41
  %43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %42)
  br label %44

44:                                               ; preds = %39
  %45 = load i32, ptr %5, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %5, align 4, !tbaa !5
  br label %33, !llvm.loop !11

47:                                               ; preds = %38
  %48 = load i32, ptr @a, align 16, !tbaa !5
  %49 = sext i32 %48 to i64
  store i64 %49, ptr @s, align 16, !tbaa !12
  call void @_Z3dfsv()
  %50 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z5buildiii(i32 noundef 1, i32 noundef 1, i32 noundef %50)
  %51 = load i32, ptr @p, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr @p, align 4, !tbaa !5
  %53 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %52)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %89, %47
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = load i32, ptr @m, align 4, !tbaa !5
  %57 = icmp sle i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %92

59:                                               ; preds = %54
  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
  %60 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %7, ptr noundef %8)
  %61 = load i32, ptr %8, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100005 x i32], ptr @in, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  store i32 %64, ptr @ql, align 4, !tbaa !5
  %65 = load i32, ptr %8, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [100005 x i32], ptr @out, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  store i32 %68, ptr @qr, align 4, !tbaa !5
  %69 = load i32, ptr %7, align 4, !tbaa !5
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %84, label %71

71:                                               ; preds = %59
  %72 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %9)
  %73 = load i32, ptr %9, align 4, !tbaa !5
  %74 = load i32, ptr %8, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = sub nsw i32 %73, %77
  store i32 %78, ptr @q, align 4, !tbaa !5
  %79 = load i32, ptr %9, align 4, !tbaa !5
  %80 = load i32, ptr %8, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %81
  store i32 %79, ptr %82, align 4, !tbaa !5
  %83 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z3addiii(i32 noundef 1, i32 noundef 1, i32 noundef %83)
  br label %88

84:                                               ; preds = %59
  store i64 -1152921504606846976, ptr @ans, align 8, !tbaa !12
  %85 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z3qryiii(i32 noundef 1, i32 noundef 1, i32 noundef %85)
  %86 = load i64, ptr @ans, align 8, !tbaa !12
  %87 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %86)
  br label %88

88:                                               ; preds = %84, %71
  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 %89

89:                                               ; preds = %88
  %90 = load i32, ptr %6, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %6, align 4, !tbaa !5
  br label %54, !llvm.loop !14

92:                                               ; preds = %58
  br label %11, !llvm.loop !15

93:                                               ; preds = %11
  ret i32 0
}

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

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

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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: write) }
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 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !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"

@T = external dso_local global i32, align 4
@p = external dso_local local_unnamed_addr global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@pos = external dso_local local_unnamed_addr global [100005 x i32], align 16
@sz = external dso_local local_unnamed_addr global i32, align 4
@ql = external dso_local local_unnamed_addr global i32, align 4
@qr = external dso_local local_unnamed_addr global i32, align 4
@dfn = external dso_local local_unnamed_addr global i32, align 4
@in = external dso_local local_unnamed_addr global [100005 x i32], align 16
@out = external dso_local local_unnamed_addr global [100005 x i32], align 16
@q = external dso_local local_unnamed_addr global i32, align 4
@a = external dso_local global [100005 x i32], align 16
@top = external dso_local local_unnamed_addr global i32, align 4
@vis = external dso_local local_unnamed_addr global [100005 x i32], align 16
@ans = external dso_local local_unnamed_addr global i64, align 8
@s = external dso_local local_unnamed_addr global [100005 x i64], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4initii(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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3dfsv() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5buildiii(i32 noundef, 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 = alloca i32, align 4
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @T)
  %7 = load i32, ptr @T, align 4, !tbaa !5
  %8 = add nsw i32 %7, -1
  store i32 %8, ptr @T, align 4, !tbaa !5
  %.not22 = icmp eq i32 %7, 0
  br i1 %.not22, label %._crit_edge25, label %.lr.ph24

.loopexit:                                        ; preds = %53, %._crit_edge
  %9 = load i32, ptr @T, align 4, !tbaa !5
  %10 = add nsw i32 %9, -1
  store i32 %10, ptr @T, align 4, !tbaa !5
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %._crit_edge25, label %.lr.ph24, !llvm.loop !9

.lr.ph24:                                         ; preds = %0, %.loopexit
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400020) @pos, i8 0, i64 400020, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400020) @vis, i8 0, i64 400020, i1 false)
  store i32 0, ptr @dfn, align 4, !tbaa !5
  store i32 0, ptr @sz, align 4, !tbaa !5
  store i32 1, ptr @top, align 4, !tbaa !5
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %.not9.not13 = icmp sgt i32 %12, 1
  br i1 %.not9.not13, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %.lr.ph, %.lr.ph24
  %13 = phi i32 [ %12, %.lr.ph24 ], [ %20, %.lr.ph ]
  %.not10.not15 = icmp sgt i32 %13, 0
  br i1 %.not10.not15, label %.lr.ph17, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph24, %.lr.ph
  %.0814 = phi i32 [ %19, %.lr.ph ], [ 1, %.lr.ph24 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = load i32, ptr %2, align 4, !tbaa !5
  call void @_Z4initii(i32 noundef %15, i32 noundef %16)
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = load i32, ptr %1, align 4, !tbaa !5
  call void @_Z4initii(i32 noundef %17, i32 noundef %18)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %19 = add nuw nsw i32 %.0814, 1
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %.not9.not = icmp slt i32 %19, %20
  br i1 %.not9.not, label %.lr.ph, label %.preheader, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph17, %.preheader
  %21 = load i32, ptr @a, align 16, !tbaa !5
  %22 = sext i32 %21 to i64
  store i64 %22, ptr @s, align 16, !tbaa !12
  call void @_Z3dfsv()
  %23 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z5buildiii(i32 noundef 1, i32 noundef 1, i32 noundef %23)
  %24 = load i32, ptr @p, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr @p, align 4, !tbaa !5
  %26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %25)
  %27 = load i32, ptr @m, align 4, !tbaa !5
  %.not1118 = icmp slt i32 %27, 1
  br i1 %.not1118, label %.loopexit, label %.lr.ph21

.lr.ph17:                                         ; preds = %.preheader, %.lr.ph17
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph17 ], [ 0, %.preheader ]
  %28 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %indvars.iv
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %28)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %.not10.not = icmp slt i64 %indvars.iv.next, %31
  br i1 %.not10.not, label %.lr.ph17, label %._crit_edge, !llvm.loop !14

.lr.ph21:                                         ; preds = %._crit_edge, %53
  %.019 = phi i32 [ %54, %53 ], [ 1, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [100005 x i32], ptr @in, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  store i32 %36, ptr @ql, align 4, !tbaa !5
  %37 = getelementptr inbounds [100005 x i32], ptr @out, i64 0, i64 %34
  %38 = load i32, ptr %37, align 4, !tbaa !5
  store i32 %38, ptr @qr, align 4, !tbaa !5
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %.not12 = icmp eq i32 %39, 0
  br i1 %.not12, label %40, label %49

40:                                               ; preds = %.lr.ph21
  %41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %5)
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = sub nsw i32 %42, %46
  store i32 %47, ptr @q, align 4, !tbaa !5
  store i32 %42, ptr %45, align 4, !tbaa !5
  %48 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z3addiii(i32 noundef 1, i32 noundef 1, i32 noundef %48)
  br label %53

49:                                               ; preds = %.lr.ph21
  store i64 -1152921504606846976, ptr @ans, align 8, !tbaa !12
  %50 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z3qryiii(i32 noundef 1, i32 noundef 1, i32 noundef %50)
  %51 = load i64, ptr @ans, align 8, !tbaa !12
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %51)
  br label %53

53:                                               ; preds = %49, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %54 = add nuw nsw i32 %.019, 1
  %55 = load i32, ptr @m, align 4, !tbaa !5
  %.not11.not = icmp slt i32 %.019, %55
  br i1 %.not11.not, label %.lr.ph21, label %.loopexit, !llvm.loop !15

._crit_edge25:                                    ; preds = %.loopexit, %0
  ret i32 0
}

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

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

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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