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

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

@line = external dso_local global [45150 x %struct.Line], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@fa = external dso_local global [301 x i32], align 16
@ans = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmpRK4LineS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4findi(i32 noundef) #1

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

12:                                               ; preds = %36, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %16, label %39

16:                                               ; preds = %12
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [45150 x %struct.Line], ptr @line, i64 0, i64 %18
  %20 = getelementptr inbounds %struct.Line, ptr %19, i32 0, i32 2
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %20)
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = add nsw i32 %22, 1
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [45150 x %struct.Line], ptr @line, i64 0, i64 %25
  %27 = getelementptr inbounds %struct.Line, ptr %26, i32 0, i32 0
  store i32 %23, ptr %27, align 4, !tbaa !9
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [45150 x %struct.Line], ptr @line, i64 0, i64 %29
  %31 = getelementptr inbounds %struct.Line, ptr %30, i32 0, i32 1
  store i32 0, ptr %31, align 4, !tbaa !11
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [301 x i32], ptr @fa, i64 0, i64 %34
  store i32 %32, ptr %35, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %16
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !12

39:                                               ; preds = %12
  %40 = load i32, ptr @n, align 4, !tbaa !5
  %41 = load i32, ptr @n, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [301 x i32], ptr @fa, i64 0, i64 %42
  store i32 %40, ptr %43, align 4, !tbaa !5
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %87, %39
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = load i32, ptr @m, align 4, !tbaa !5
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %48, label %90

48:                                               ; preds = %44
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %55, %48
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = icmp sle i32 %50, %51
  br i1 %52, label %53, label %58

53:                                               ; preds = %49
  %54 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %5)
  br label %55

55:                                               ; preds = %53
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %4, align 4, !tbaa !5
  br label %49, !llvm.loop !14

58:                                               ; preds = %49
  %59 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %59, ptr %4, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %81, %58
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = load i32, ptr @n, align 4, !tbaa !5
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %64, label %86

64:                                               ; preds = %60
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [45150 x %struct.Line], ptr @line, i64 0, i64 %66
  %68 = getelementptr inbounds %struct.Line, ptr %67, i32 0, i32 2
  %69 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %68)
  %70 = load i32, ptr %3, align 4, !tbaa !5
  %71 = load i32, ptr %2, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [45150 x %struct.Line], ptr @line, i64 0, i64 %72
  %74 = getelementptr inbounds %struct.Line, ptr %73, i32 0, i32 0
  store i32 %70, ptr %74, align 4, !tbaa !9
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  %77 = load i32, ptr %2, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [45150 x %struct.Line], ptr @line, i64 0, i64 %78
  %80 = getelementptr inbounds %struct.Line, ptr %79, i32 0, i32 1
  store i32 %76, ptr %80, align 4, !tbaa !11
  br label %81

81:                                               ; preds = %64
  %82 = load i32, ptr %4, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %4, align 4, !tbaa !5
  %84 = load i32, ptr %2, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %2, align 4, !tbaa !5
  br label %60, !llvm.loop !15

86:                                               ; preds = %60
  br label %87

87:                                               ; preds = %86
  %88 = load i32, ptr %3, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %3, align 4, !tbaa !5
  br label %44, !llvm.loop !16

90:                                               ; preds = %44
  %91 = load i32, ptr @m, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds %struct.Line, ptr @line, i64 %92
  call void @_ZSt4sortIP4LinePFbRKS0_S3_EEvT_S6_T0_(ptr noundef @line, ptr noundef %93, ptr noundef @_Z3cmpRK4LineS1_)
  store i32 0, ptr %2, align 4, !tbaa !5
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %135, %90
  %95 = load i32, ptr %2, align 4, !tbaa !5
  %96 = load i32, ptr @m, align 4, !tbaa !5
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %98, label %102

98:                                               ; preds = %94
  %99 = load i32, ptr %5, align 4, !tbaa !5
  %100 = load i32, ptr @n, align 4, !tbaa !5
  %101 = icmp slt i32 %99, %100
  br label %102

102:                                              ; preds = %98, %94
  %103 = phi i1 [ false, %94 ], [ %101, %98 ]
  br i1 %103, label %104, label %138

104:                                              ; preds = %102
  %105 = load i32, ptr %2, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [45150 x %struct.Line], ptr @line, i64 0, i64 %106
  %108 = getelementptr inbounds %struct.Line, ptr %107, i32 0, i32 0
  %109 = load i32, ptr %108, align 4, !tbaa !9
  %110 = call noundef i32 @_Z4findi(i32 noundef %109)
  store i32 %110, ptr %3, align 4, !tbaa !5
  %111 = load i32, ptr %2, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [45150 x %struct.Line], ptr @line, i64 0, i64 %112
  %114 = getelementptr inbounds %struct.Line, ptr %113, i32 0, i32 1
  %115 = load i32, ptr %114, align 4, !tbaa !11
  %116 = call noundef i32 @_Z4findi(i32 noundef %115)
  store i32 %116, ptr %4, align 4, !tbaa !5
  %117 = load i32, ptr %3, align 4, !tbaa !5
  %118 = load i32, ptr %4, align 4, !tbaa !5
  %119 = icmp ne i32 %117, %118
  br i1 %119, label %120, label %134

120:                                              ; preds = %104
  %121 = load i32, ptr %4, align 4, !tbaa !5
  %122 = load i32, ptr %3, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [301 x i32], ptr @fa, i64 0, i64 %123
  store i32 %121, ptr %124, align 4, !tbaa !5
  %125 = load i32, ptr %2, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [45150 x %struct.Line], ptr @line, i64 0, i64 %126
  %128 = getelementptr inbounds %struct.Line, ptr %127, i32 0, i32 2
  %129 = load i32, ptr %128, align 4, !tbaa !17
  %130 = load i32, ptr @ans, align 4, !tbaa !5
  %131 = add nsw i32 %130, %129
  store i32 %131, ptr @ans, align 4, !tbaa !5
  %132 = load i32, ptr %5, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %5, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %120, %104
  br label %135

135:                                              ; preds = %134
  %136 = load i32, ptr %2, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %2, align 4, !tbaa !5
  br label %94, !llvm.loop !18

138:                                              ; preds = %102
  %139 = load i32, ptr @ans, align 4, !tbaa !5
  %140 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %139)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  ret i32 0
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP4LinePFbRKS0_S3_EEvT_S6_T0_(ptr noundef, ptr noundef, ptr noundef) #5

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

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

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


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

@line = external dso_local global [45150 x %struct.Line], align 16
@n = external dso_local global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@fa = external dso_local local_unnamed_addr global [301 x i32], align 16
@ans = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmpRK4LineS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4findi(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %3 = load i32, ptr @n, align 4, !tbaa !5
  %4 = add nsw i32 %3, 1
  %5 = mul nsw i32 %4, %3
  %6 = sdiv i32 %5, 2
  store i32 %6, ptr @m, align 4, !tbaa !5
  %7 = icmp sgt i32 %3, 0
  br i1 %7, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre71 = sext i32 %3 to i64
  br label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %8 = getelementptr inbounds [45150 x %struct.Line], ptr @line, i64 0, i64 %indvars.iv
  %9 = getelementptr inbounds i8, ptr %8, i64 8
  %10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %9)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %11 = trunc nuw nsw i64 %indvars.iv.next to i32
  store i32 %11, ptr %8, align 4, !tbaa !9
  %12 = getelementptr inbounds i8, ptr %8, i64 4
  store i32 0, ptr %12, align 4, !tbaa !11
  %13 = getelementptr inbounds [301 x i32], ptr @fa, i64 0, i64 %indvars.iv
  %14 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %14, ptr %13, align 4, !tbaa !5
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = icmp slt i64 %indvars.iv.next, %16
  br i1 %17, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !12

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.._crit_edge_crit_edge, %._crit_edge.loopexit
  %.pre-phi = phi i64 [ %.pre71, %.._crit_edge_crit_edge ], [ %16, %._crit_edge.loopexit ]
  %18 = phi i32 [ %6, %.._crit_edge_crit_edge ], [ %.pre, %._crit_edge.loopexit ]
  %.032.lcssa = phi i32 [ 0, %.._crit_edge_crit_edge ], [ %11, %._crit_edge.loopexit ]
  %.lcssa40 = phi i32 [ %3, %.._crit_edge_crit_edge ], [ %15, %._crit_edge.loopexit ]
  %19 = getelementptr inbounds [301 x i32], ptr @fa, i64 0, i64 %.pre-phi
  store i32 %.lcssa40, ptr %19, align 4, !tbaa !5
  %20 = icmp slt i32 %.032.lcssa, %18
  br i1 %20, label %.preheader39, label %._crit_edge51

.preheader39:                                     ; preds = %._crit_edge, %._crit_edge47
  %indvars.iv62 = phi i32 [ %indvars.iv.next63, %._crit_edge47 ], [ 2, %._crit_edge ]
  %.03150 = phi i32 [ %35, %._crit_edge47 ], [ 1, %._crit_edge ]
  %.13349 = phi i32 [ %.2.lcssa, %._crit_edge47 ], [ %.032.lcssa, %._crit_edge ]
  br label %24

.preheader:                                       ; preds = %24
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %22 = icmp slt i32 %.03150, %21
  br i1 %22, label %.lr.ph46.preheader, label %._crit_edge47

.lr.ph46.preheader:                               ; preds = %.preheader
  %23 = sext i32 %.13349 to i64
  br label %.lr.ph46

24:                                               ; preds = %.preheader39, %24
  %.043 = phi i32 [ 1, %.preheader39 ], [ %26, %24 ]
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %26 = add nuw i32 %.043, 1
  %exitcond.not = icmp eq i32 %26, %indvars.iv62
  br i1 %exitcond.not, label %.preheader, label %24, !llvm.loop !14

.lr.ph46:                                         ; preds = %.lr.ph46.preheader, %.lr.ph46
  %indvars.iv64 = phi i64 [ %23, %.lr.ph46.preheader ], [ %indvars.iv.next65, %.lr.ph46 ]
  %.145 = phi i32 [ %.03150, %.lr.ph46.preheader ], [ %30, %.lr.ph46 ]
  %27 = getelementptr inbounds [45150 x %struct.Line], ptr @line, i64 0, i64 %indvars.iv64
  %28 = getelementptr inbounds i8, ptr %27, i64 8
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %28)
  store i32 %.03150, ptr %27, align 4, !tbaa !9
  %30 = add nuw nsw i32 %.145, 1
  %31 = getelementptr inbounds i8, ptr %27, i64 4
  store i32 %30, ptr %31, align 4, !tbaa !11
  %indvars.iv.next65 = add nsw i64 %indvars.iv64, 1
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = icmp slt i32 %30, %32
  br i1 %33, label %.lr.ph46, label %._crit_edge47.loopexit, !llvm.loop !15

._crit_edge47.loopexit:                           ; preds = %.lr.ph46
  %34 = trunc nsw i64 %indvars.iv.next65 to i32
  br label %._crit_edge47

._crit_edge47:                                    ; preds = %._crit_edge47.loopexit, %.preheader
  %.2.lcssa = phi i32 [ %.13349, %.preheader ], [ %34, %._crit_edge47.loopexit ]
  %35 = add nuw nsw i32 %.03150, 1
  %36 = load i32, ptr @m, align 4, !tbaa !5
  %37 = icmp slt i32 %.2.lcssa, %36
  %indvars.iv.next63 = add nuw i32 %indvars.iv62, 1
  br i1 %37, label %.preheader39, label %._crit_edge51, !llvm.loop !16

._crit_edge51:                                    ; preds = %._crit_edge47, %._crit_edge
  %.lcssa = phi i32 [ %18, %._crit_edge ], [ %36, %._crit_edge47 ]
  %38 = sext i32 %.lcssa to i64
  %39 = getelementptr inbounds %struct.Line, ptr @line, i64 %38
  call void @_ZSt4sortIP4LinePFbRKS0_S3_EEvT_S6_T0_(ptr noundef nonnull @line, ptr noundef nonnull %39, ptr noundef nonnull @_Z3cmpRK4LineS1_)
  store i32 0, ptr %1, align 4, !tbaa !5
  %40 = load i32, ptr @m, align 4, !tbaa !5
  %41 = icmp sgt i32 %40, 0
  %42 = load i32, ptr @n, align 4
  %43 = icmp sgt i32 %42, 0
  %44 = select i1 %41, i1 %43, i1 false
  br i1 %44, label %.lr.ph55, label %._crit_edge56

.lr.ph55:                                         ; preds = %._crit_edge51, %59
  %indvars.iv67 = phi i64 [ %indvars.iv.next68, %59 ], [ 0, %._crit_edge51 ]
  %45 = getelementptr inbounds [45150 x %struct.Line], ptr @line, i64 0, i64 %indvars.iv67
  %46 = load i32, ptr %45, align 4, !tbaa !9
  %47 = call noundef i32 @_Z4findi(i32 noundef %46)
  %48 = getelementptr inbounds i8, ptr %45, i64 4
  %49 = load i32, ptr %48, align 4, !tbaa !11
  %50 = call noundef i32 @_Z4findi(i32 noundef %49)
  %.not = icmp eq i32 %47, %50
  %.pre70 = load i32, ptr %1, align 4
  br i1 %.not, label %59, label %51

51:                                               ; preds = %.lr.ph55
  %52 = sext i32 %47 to i64
  %53 = getelementptr inbounds [301 x i32], ptr @fa, i64 0, i64 %52
  store i32 %50, ptr %53, align 4, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %45, i64 8
  %55 = load i32, ptr %54, align 4, !tbaa !17
  %56 = load i32, ptr @ans, align 4, !tbaa !5
  %57 = add nsw i32 %56, %55
  store i32 %57, ptr @ans, align 4, !tbaa !5
  %58 = add nsw i32 %.pre70, 1
  store i32 %58, ptr %1, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %.lr.ph55, %51
  %60 = phi i32 [ %.pre70, %.lr.ph55 ], [ %58, %51 ]
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %61 = load i32, ptr @m, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = icmp slt i64 %indvars.iv.next68, %62
  %64 = load i32, ptr @n, align 4
  %65 = icmp slt i32 %60, %64
  %66 = select i1 %63, i1 %65, i1 false
  br i1 %66, label %.lr.ph55, label %._crit_edge56, !llvm.loop !18

._crit_edge56:                                    ; preds = %59, %._crit_edge51
  %67 = load i32, ptr @ans, align 4, !tbaa !5
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %67)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP4LinePFbRKS0_S3_EEvT_S6_T0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

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

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

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


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