; LLVM IR from tangjz/acm-icpc :: lydsy (1037)

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@f = external dso_local global [152 x [152 x [21 x [21 x i32]]]], align 16
@ans = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %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
  store i32 0, ptr %1, align 4
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m, ptr noundef @k)
  store i32 1, ptr @f, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %98, %0
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = icmp sle i32 %11, %12
  br i1 %13, label %15, label %14

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

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

16:                                               ; preds = %94, %15
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = load i32, ptr @m, align 4, !tbaa !5
  %19 = icmp sle i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %97

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

22:                                               ; preds = %90, %21
  %23 = load i32, ptr %5, align 4, !tbaa !5
  %24 = load i32, ptr @k, align 4, !tbaa !5
  %25 = icmp sle i32 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %93

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

28:                                               ; preds = %86, %27
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = load i32, ptr @k, align 4, !tbaa !5
  %31 = icmp sle i32 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %89

33:                                               ; preds = %28
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [152 x [152 x [21 x [21 x i32]]]], ptr @f, i64 0, i64 %35
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [152 x [21 x [21 x i32]]], ptr %36, i64 0, i64 %38
  %40 = load i32, ptr %5, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [21 x [21 x i32]], ptr %39, i64 0, i64 %41
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [21 x i32], ptr %42, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %85

48:                                               ; preds = %33
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [152 x [152 x [21 x [21 x i32]]]], ptr @f, i64 0, i64 %55
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [152 x [21 x [21 x i32]]], ptr %56, i64 0, i64 %58
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [21 x [21 x i32]], ptr %59, i64 0, i64 %61
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [21 x i32], ptr %62, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  call void @_Z3updiiiii(i32 noundef %50, i32 noundef %51, i32 noundef %52, i32 noundef %53, i32 noundef %66)
  %67 = load i32, ptr %2, align 4, !tbaa !5
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = add nsw i32 %68, 1
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = load i32, ptr %2, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [152 x [152 x [21 x [21 x i32]]]], ptr @f, i64 0, i64 %73
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [152 x [21 x [21 x i32]]], ptr %74, i64 0, i64 %76
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [21 x [21 x i32]], ptr %77, i64 0, i64 %79
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [21 x i32], ptr %80, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  call void @_Z3updiiiii(i32 noundef %67, i32 noundef %69, i32 noundef %70, i32 noundef %71, i32 noundef %84)
  br label %85

85:                                               ; preds = %48, %33
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %6, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %6, align 4, !tbaa !5
  br label %28, !llvm.loop !9

89:                                               ; preds = %32
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr %5, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %5, align 4, !tbaa !5
  br label %22, !llvm.loop !11

93:                                               ; preds = %26
  br label %94

94:                                               ; preds = %93
  %95 = load i32, ptr %4, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %4, align 4, !tbaa !5
  br label %16, !llvm.loop !12

97:                                               ; preds = %20
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %2, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %2, align 4, !tbaa !5
  br label %10, !llvm.loop !13

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

102:                                              ; preds = %131, %101
  %103 = load i32, ptr %7, align 4, !tbaa !5
  %104 = load i32, ptr @k, align 4, !tbaa !5
  %105 = icmp sle i32 %103, %104
  br i1 %105, label %107, label %106

106:                                              ; preds = %102
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %134

107:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %127, %107
  %109 = load i32, ptr %8, align 4, !tbaa !5
  %110 = load i32, ptr @k, align 4, !tbaa !5
  %111 = icmp sle i32 %109, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %108
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %130

113:                                              ; preds = %108
  %114 = load i32, ptr @n, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [152 x [152 x [21 x [21 x i32]]]], ptr @f, i64 0, i64 %115
  %117 = load i32, ptr @m, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [152 x [21 x [21 x i32]]], ptr %116, i64 0, i64 %118
  %120 = load i32, ptr %7, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [21 x [21 x i32]], ptr %119, i64 0, i64 %121
  %123 = load i32, ptr %8, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [21 x i32], ptr %122, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  call void @_Z3addRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %126)
  br label %127

127:                                              ; preds = %113
  %128 = load i32, ptr %8, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %8, align 4, !tbaa !5
  br label %108, !llvm.loop !14

130:                                              ; preds = %112
  br label %131

131:                                              ; preds = %130
  %132 = load i32, ptr %7, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %7, align 4, !tbaa !5
  br label %102, !llvm.loop !15

134:                                              ; preds = %106
  %135 = load i32, ptr @ans, align 4, !tbaa !5
  %136 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %135)
  ret i32 0
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z3updiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z3addRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #4

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

attributes #0 = { 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 #1 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint 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 #4 = { 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 #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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!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"

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@f = external dso_local local_unnamed_addr global [152 x [152 x [21 x [21 x i32]]]], align 16
@ans = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @k)
  store i32 1, ptr @f, align 16, !tbaa !5
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %.not59 = icmp slt i32 %2, 0
  %3 = load i32, ptr @m, align 4
  %4 = icmp slt i32 %3, 0
  %or.cond = select i1 %.not59, i1 true, i1 %4
  br i1 %or.cond, label %.preheader46, label %.preheader49

.preheader49:                                     ; preds = %0, %._crit_edge58
  %5 = phi i32 [ %20, %._crit_edge58 ], [ %2, %0 ]
  %6 = phi i32 [ %21, %._crit_edge58 ], [ %3, %0 ]
  %7 = phi i32 [ %22, %._crit_edge58 ], [ %3, %0 ]
  %indvars.iv80 = phi i64 [ %.pre92, %._crit_edge58 ], [ 0, %0 ]
  %.not4255 = icmp slt i32 %7, 0
  %.pre92 = add nuw nsw i64 %indvars.iv80, 1
  br i1 %.not4255, label %._crit_edge58, label %.preheader48.lr.ph

.preheader48.lr.ph:                               ; preds = %.preheader49
  %8 = load i32, ptr @k, align 4, !tbaa !5
  %9 = icmp slt i32 %8, 0
  br i1 %9, label %._crit_edge58, label %.preheader48.preheader

.preheader48.preheader:                           ; preds = %.preheader48.lr.ph
  %10 = trunc nuw i64 %.pre92 to i32
  %11 = trunc nuw nsw i64 %indvars.iv80 to i32
  br label %.preheader48

.preheader46:                                     ; preds = %._crit_edge58, %0
  %12 = load i32, ptr @k, align 4, !tbaa !5
  %.not4066 = icmp slt i32 %12, 0
  br i1 %.not4066, label %._crit_edge68, label %.preheader

.preheader48:                                     ; preds = %.preheader48.preheader, %._crit_edge54
  %13 = phi i32 [ %6, %.preheader48.preheader ], [ %27, %._crit_edge54 ]
  %14 = phi i32 [ %8, %.preheader48.preheader ], [ %28, %._crit_edge54 ]
  %15 = phi i32 [ %8, %.preheader48.preheader ], [ %29, %._crit_edge54 ]
  %16 = phi i32 [ %8, %.preheader48.preheader ], [ %30, %._crit_edge54 ]
  %indvars.iv77 = phi i64 [ 0, %.preheader48.preheader ], [ %.pre93, %._crit_edge54 ]
  %.not4352 = icmp slt i32 %16, 0
  %.pre93 = add nuw nsw i64 %indvars.iv77, 1
  br i1 %.not4352, label %._crit_edge54, label %.preheader47.lr.ph

.preheader47.lr.ph:                               ; preds = %.preheader48
  %17 = icmp slt i32 %15, 0
  br i1 %17, label %._crit_edge54, label %.preheader47.preheader

.preheader47.preheader:                           ; preds = %.preheader47.lr.ph
  %18 = trunc nuw nsw i64 %indvars.iv77 to i32
  %19 = trunc nuw i64 %.pre93 to i32
  br label %.preheader47

._crit_edge58.loopexit71:                         ; preds = %._crit_edge54
  %.pre90 = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge58

._crit_edge58:                                    ; preds = %.preheader49, %.preheader48.lr.ph, %._crit_edge58.loopexit71
  %20 = phi i32 [ %.pre90, %._crit_edge58.loopexit71 ], [ %5, %.preheader48.lr.ph ], [ %5, %.preheader49 ]
  %21 = phi i32 [ %27, %._crit_edge58.loopexit71 ], [ %6, %.preheader48.lr.ph ], [ %6, %.preheader49 ]
  %22 = phi i32 [ %27, %._crit_edge58.loopexit71 ], [ %7, %.preheader48.lr.ph ], [ %7, %.preheader49 ]
  %23 = sext i32 %20 to i64
  %.not.not = icmp slt i64 %indvars.iv80, %23
  br i1 %.not.not, label %.preheader49, label %.preheader46, !llvm.loop !9

.preheader47:                                     ; preds = %.preheader47.preheader, %._crit_edge
  %24 = phi i32 [ %14, %.preheader47.preheader ], [ %32, %._crit_edge ]
  %25 = phi i32 [ %15, %.preheader47.preheader ], [ %32, %._crit_edge ]
  %indvars.iv74 = phi i64 [ 0, %.preheader47.preheader ], [ %indvars.iv.next75, %._crit_edge ]
  %.not4450 = icmp slt i32 %25, 0
  br i1 %.not4450, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader47
  %26 = trunc nuw nsw i64 %indvars.iv74 to i32
  br label %34

._crit_edge54.loopexit70:                         ; preds = %._crit_edge
  %.pre89 = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge54

._crit_edge54:                                    ; preds = %.preheader48, %.preheader47.lr.ph, %._crit_edge54.loopexit70
  %27 = phi i32 [ %.pre89, %._crit_edge54.loopexit70 ], [ %13, %.preheader47.lr.ph ], [ %13, %.preheader48 ]
  %28 = phi i32 [ %32, %._crit_edge54.loopexit70 ], [ %14, %.preheader47.lr.ph ], [ %14, %.preheader48 ]
  %29 = phi i32 [ %32, %._crit_edge54.loopexit70 ], [ %15, %.preheader47.lr.ph ], [ %15, %.preheader48 ]
  %30 = phi i32 [ %32, %._crit_edge54.loopexit70 ], [ %15, %.preheader47.lr.ph ], [ %16, %.preheader48 ]
  %31 = sext i32 %27 to i64
  %.not42.not = icmp slt i64 %indvars.iv77, %31
  br i1 %.not42.not, label %.preheader48, label %._crit_edge58.loopexit71, !llvm.loop !12

._crit_edge:                                      ; preds = %42, %.preheader47
  %32 = phi i32 [ %24, %.preheader47 ], [ %43, %42 ]
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %33 = sext i32 %32 to i64
  %.not43.not = icmp slt i64 %indvars.iv74, %33
  br i1 %.not43.not, label %.preheader47, label %._crit_edge54.loopexit70, !llvm.loop !13

34:                                               ; preds = %.lr.ph, %42
  %35 = phi i32 [ %24, %.lr.ph ], [ %43, %42 ]
  %36 = phi i32 [ %25, %.lr.ph ], [ %44, %42 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %42 ]
  %37 = getelementptr inbounds [152 x [152 x [21 x [21 x i32]]]], ptr @f, i64 0, i64 %indvars.iv80, i64 %indvars.iv77, i64 %indvars.iv74, i64 %indvars.iv
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %.not45 = icmp eq i32 %38, 0
  br i1 %.not45, label %42, label %39

39:                                               ; preds = %34
  %40 = trunc nuw nsw i64 %indvars.iv to i32
  tail call void @_Z3updiiiii(i32 noundef %10, i32 noundef %18, i32 noundef %26, i32 noundef %40, i32 noundef %38)
  %41 = load i32, ptr %37, align 4, !tbaa !5
  tail call void @_Z3updiiiii(i32 noundef %11, i32 noundef %19, i32 noundef %26, i32 noundef %40, i32 noundef %41)
  %.pre = load i32, ptr @k, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %34, %39
  %43 = phi i32 [ %35, %34 ], [ %.pre, %39 ]
  %44 = phi i32 [ %36, %34 ], [ %.pre, %39 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %45 = sext i32 %44 to i64
  %.not44.not = icmp slt i64 %indvars.iv, %45
  br i1 %.not44.not, label %34, label %._crit_edge, !llvm.loop !14

.preheader:                                       ; preds = %.preheader46, %._crit_edge65
  %46 = phi i32 [ %49, %._crit_edge65 ], [ %12, %.preheader46 ]
  %indvars.iv86 = phi i64 [ %indvars.iv.next87, %._crit_edge65 ], [ 0, %.preheader46 ]
  %.not4162 = icmp slt i32 %46, 0
  br i1 %.not4162, label %.preheader.._crit_edge65_crit_edge, label %.lr.ph64

.preheader.._crit_edge65_crit_edge:               ; preds = %.preheader
  %.pre91 = sext i32 %46 to i64
  br label %._crit_edge65

._crit_edge68:                                    ; preds = %._crit_edge65, %.preheader46
  %47 = load i32, ptr @ans, align 4, !tbaa !5
  %48 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %47)
  ret i32 0

._crit_edge65:                                    ; preds = %.lr.ph64, %.preheader.._crit_edge65_crit_edge
  %.pre-phi = phi i64 [ %.pre91, %.preheader.._crit_edge65_crit_edge ], [ %57, %.lr.ph64 ]
  %49 = phi i32 [ %46, %.preheader.._crit_edge65_crit_edge ], [ %56, %.lr.ph64 ]
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %.not40.not = icmp slt i64 %indvars.iv86, %.pre-phi
  br i1 %.not40.not, label %.preheader, label %._crit_edge68, !llvm.loop !15

.lr.ph64:                                         ; preds = %.preheader, %.lr.ph64
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %.lr.ph64 ], [ 0, %.preheader ]
  %50 = load i32, ptr @n, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = load i32, ptr @m, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [152 x [152 x [21 x [21 x i32]]]], ptr @f, i64 0, i64 %51, i64 %53, i64 %indvars.iv86, i64 %indvars.iv83
  %55 = load i32, ptr %54, align 4, !tbaa !5
  tail call void @_Z3addRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %55)
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %56 = load i32, ptr @k, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %.not41.not = icmp slt i64 %indvars.iv83, %57
  br i1 %.not41.not, label %.lr.ph64, label %._crit_edge65, !llvm.loop !16
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z3addRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #3

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

attributes #0 = { 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 #1 = { 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 #2 = { inlinehint 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 = { 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" }

!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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = distinct !{!12, !10, !11}
!13 = distinct !{!13, !10, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !11}
!16 = distinct !{!16, !10}


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