; LLVM IR from tangjz/acm-icpc :: hdu (5709)

; 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
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@col = external dso_local global [100001 x i32], align 16
@fa = external dso_local global [100001 x i32], align 16
@dep = external dso_local global [100001 x i32], align 16
@rtC = external dso_local global [100001 x i32], align 16
@rtD = external dso_local global [100001 x i32], 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 [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z7seg_updRiiiii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef, i32 noundef, 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 @_Z7seg_mixRiiii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef, i32 noundef, i32 noundef) #0

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

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

; 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
  %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 = %144, %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 %145

15:                                               ; preds = %11
  store i32 0, ptr @tot, 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) #4
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %17

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

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

22:                                               ; preds = %17
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds i32, ptr @col, i64 %24
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %25)
  br label %27

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

30:                                               ; preds = %21
  store i32 1, ptr getelementptr inbounds ([100001 x i32], ptr @dep, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 2, ptr %3, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %52, %30
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %34 = icmp sle i32 %32, %33
  br i1 %34, label %36, label %35

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

36:                                               ; preds = %31
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds i32, ptr @fa, i64 %38
  %40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %39)
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [100001 x i32], ptr @fa, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100001 x i32], ptr @dep, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [100001 x i32], ptr @dep, i64 0, i64 %50
  store i32 %48, ptr %51, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %36
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %3, align 4, !tbaa !5
  br label %31, !llvm.loop !11

55:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %82, %55
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = load i32, ptr @n, align 4, !tbaa !5
  %59 = icmp sle i32 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %85

61:                                               ; preds = %56
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [100001 x i32], ptr @rtC, i64 0, i64 %63
  store i32 0, ptr %64, align 4, !tbaa !5
  %65 = load i32, ptr @n, align 4, !tbaa !5
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [100001 x i32], ptr @dep, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  call void @_Z7seg_updRiiiii(ptr noundef nonnull align 4 dereferenceable(4) %64, i32 noundef 1, i32 noundef %65, i32 noundef %69, i32 noundef 1)
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [100001 x i32], ptr @rtD, i64 0, i64 %71
  store i32 0, ptr %72, align 4, !tbaa !5
  %73 = load i32, ptr @n, align 4, !tbaa !5
  %74 = load i32, ptr %4, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [100001 x i32], ptr @col, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = load i32, ptr %4, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [100001 x i32], ptr @dep, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  call void @_Z7seg_updRiiiii(ptr noundef nonnull align 4 dereferenceable(4) %72, i32 noundef 1, i32 noundef %73, i32 noundef %77, i32 noundef %81)
  br label %82

82:                                               ; preds = %61
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %4, align 4, !tbaa !5
  br label %56, !llvm.loop !12

85:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %86 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %86, ptr %5, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %115, %85
  %88 = load i32, ptr %5, align 4, !tbaa !5
  %89 = icmp sgt i32 %88, 1
  br i1 %89, label %91, label %90

90:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %118

91:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %92 = load i32, ptr %5, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [100001 x i32], ptr @fa, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  store i32 %95, ptr %6, align 4, !tbaa !5
  %96 = load i32, ptr %6, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [100001 x i32], ptr @rtC, i64 0, i64 %97
  %99 = load i32, ptr %5, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [100001 x i32], ptr @rtC, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z7seg_mixRiiii(ptr noundef nonnull align 4 dereferenceable(4) %98, i32 noundef %102, i32 noundef 1, i32 noundef %103)
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [100001 x i32], ptr @rtC, i64 0, i64 %105
  %107 = load i32, ptr %6, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [100001 x i32], ptr @rtD, i64 0, i64 %108
  %110 = load i32, ptr %5, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [100001 x i32], ptr @rtD, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z7col_mixRiS_iii(ptr noundef nonnull align 4 dereferenceable(4) %106, ptr noundef nonnull align 4 dereferenceable(4) %109, i32 noundef %113, i32 noundef 1, i32 noundef %114)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %115

115:                                              ; preds = %91
  %116 = load i32, ptr %5, align 4, !tbaa !5
  %117 = add nsw i32 %116, -1
  store i32 %117, ptr %5, align 4, !tbaa !5
  br label %87, !llvm.loop !13

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

119:                                              ; preds = %123, %118
  %120 = load i32, ptr @m, align 4, !tbaa !5
  %121 = add nsw i32 %120, -1
  store i32 %121, ptr @m, align 4, !tbaa !5
  %122 = icmp ne i32 %120, 0
  br i1 %122, label %123, label %144

123:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %124 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %8, ptr noundef %9)
  %125 = load i32, ptr %7, align 4, !tbaa !5
  %126 = load i32, ptr %8, align 4, !tbaa !5
  %127 = xor i32 %126, %125
  store i32 %127, ptr %8, align 4, !tbaa !5
  %128 = load i32, ptr %7, align 4, !tbaa !5
  %129 = load i32, ptr %9, align 4, !tbaa !5
  %130 = xor i32 %129, %128
  store i32 %130, ptr %9, align 4, !tbaa !5
  %131 = load i32, ptr %8, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [100001 x i32], ptr @rtC, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = load i32, ptr @n, align 4, !tbaa !5
  %136 = load i32, ptr %8, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [100001 x i32], ptr @dep, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = load i32, ptr %9, align 4, !tbaa !5
  %141 = add nsw i32 %139, %140
  %142 = call noundef i32 @_Z7seg_queiiii(i32 noundef %134, i32 noundef 1, i32 noundef %135, i32 noundef %141)
  store i32 %142, ptr %7, align 4, !tbaa !5
  %143 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %142)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %119, !llvm.loop !14

144:                                              ; preds = %119
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %11, !llvm.loop !15

145:                                              ; preds = %11
  ret i32 0
}

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

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

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 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 = { "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 = { 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"

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@col = external dso_local global [100001 x i32], align 16
@fa = external dso_local global [100001 x i32], align 16
@dep = external dso_local local_unnamed_addr global [100001 x i32], align 16
@rtC = external dso_local global [100001 x i32], align 16
@rtD = external dso_local global [100001 x i32], 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 [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z7seg_updRiiiii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef, i32 noundef, 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 @_Z7seg_mixRiiii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z7col_mixRiS_iii(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %4 = load i32, ptr @t, align 4, !tbaa !5
  %5 = add nsw i32 %4, -1
  store i32 %5, ptr @t, align 4, !tbaa !5
  %.not50 = icmp eq i32 %4, 0
  br i1 %.not50, label %._crit_edge53, label %.lr.ph52

.loopexit:                                        ; preds = %.lr.ph49, %.preheader
  %6 = load i32, ptr @t, align 4, !tbaa !5
  %7 = add nsw i32 %6, -1
  store i32 %7, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %._crit_edge53, label %.lr.ph52, !llvm.loop !9

.lr.ph52:                                         ; preds = %0, %.loopexit
  store i32 0, ptr @tot, align 4, !tbaa !5
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %.not3036 = icmp slt i32 %9, 1
  br i1 %.not3036, label %.preheader35.thread, label %.lr.ph

.preheader35.thread:                              ; preds = %.lr.ph52
  store i32 1, ptr getelementptr inbounds (i8, ptr @dep, i64 4), align 4, !tbaa !5
  br label %.preheader

._crit_edge:                                      ; preds = %.lr.ph
  store i32 1, ptr getelementptr inbounds (i8, ptr @dep, i64 4), align 4, !tbaa !5
  %.not3138 = icmp slt i32 %12, 2
  br i1 %.not3138, label %.preheader35, label %.lr.ph41

.lr.ph:                                           ; preds = %.lr.ph52, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.lr.ph52 ]
  %10 = getelementptr inbounds i32, ptr @col, i64 %indvars.iv
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %10)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %.not30.not = icmp slt i64 %indvars.iv, %13
  br i1 %.not30.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.preheader35:                                     ; preds = %.lr.ph41, %._crit_edge
  %14 = phi i32 [ %12, %._crit_edge ], [ %23, %.lr.ph41 ]
  %.not3242 = icmp slt i32 %14, 1
  br i1 %.not3242, label %.preheader, label %.lr.ph44

.lr.ph41:                                         ; preds = %._crit_edge, %.lr.ph41
  %indvars.iv56 = phi i64 [ %indvars.iv.next57, %.lr.ph41 ], [ 2, %._crit_edge ]
  %15 = getelementptr inbounds i32, ptr @fa, i64 %indvars.iv56
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %15)
  %17 = load i32, ptr %15, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [100001 x i32], ptr @dep, i64 0, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = add nsw i32 %20, 1
  %22 = getelementptr inbounds [100001 x i32], ptr @dep, i64 0, i64 %indvars.iv56
  store i32 %21, ptr %22, align 4, !tbaa !5
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %.not31.not = icmp slt i64 %indvars.iv56, %24
  br i1 %.not31.not, label %.lr.ph41, label %.preheader35, !llvm.loop !12

.preheader34:                                     ; preds = %.lr.ph44
  %25 = icmp sgt i32 %36, 1
  br i1 %25, label %.lr.ph46.preheader, label %.preheader

.lr.ph46.preheader:                               ; preds = %.preheader34
  %26 = zext nneg i32 %36 to i64
  br label %.lr.ph46

.lr.ph44:                                         ; preds = %.preheader35, %.lr.ph44
  %indvars.iv59 = phi i64 [ %indvars.iv.next60, %.lr.ph44 ], [ 1, %.preheader35 ]
  %27 = phi i32 [ %36, %.lr.ph44 ], [ %14, %.preheader35 ]
  %28 = getelementptr inbounds [100001 x i32], ptr @rtC, i64 0, i64 %indvars.iv59
  store i32 0, ptr %28, align 4, !tbaa !5
  %29 = getelementptr inbounds [100001 x i32], ptr @dep, i64 0, i64 %indvars.iv59
  %30 = load i32, ptr %29, align 4, !tbaa !5
  call void @_Z7seg_updRiiiii(ptr noundef nonnull align 4 dereferenceable(4) %28, i32 noundef 1, i32 noundef %27, i32 noundef %30, i32 noundef 1)
  %31 = getelementptr inbounds [100001 x i32], ptr @rtD, i64 0, i64 %indvars.iv59
  store i32 0, ptr %31, align 4, !tbaa !5
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = getelementptr inbounds [100001 x i32], ptr @col, i64 0, i64 %indvars.iv59
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = load i32, ptr %29, align 4, !tbaa !5
  call void @_Z7seg_updRiiiii(ptr noundef nonnull align 4 dereferenceable(4) %31, i32 noundef 1, i32 noundef %32, i32 noundef %34, i32 noundef %35)
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %.not32.not = icmp slt i64 %indvars.iv59, %37
  br i1 %.not32.not, label %.lr.ph44, label %.preheader34, !llvm.loop !13

.preheader:                                       ; preds = %.lr.ph46, %.preheader35.thread, %.preheader35, %.preheader34
  %38 = load i32, ptr @m, align 4, !tbaa !5
  %39 = add nsw i32 %38, -1
  store i32 %39, ptr @m, align 4, !tbaa !5
  %.not3347 = icmp eq i32 %38, 0
  br i1 %.not3347, label %.loopexit, label %.lr.ph49

.lr.ph46:                                         ; preds = %.lr.ph46.preheader, %.lr.ph46
  %indvars.iv62 = phi i64 [ %26, %.lr.ph46.preheader ], [ %indvars.iv.next63, %.lr.ph46 ]
  %40 = getelementptr inbounds [100001 x i32], ptr @fa, i64 0, i64 %indvars.iv62
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [100001 x i32], ptr @rtC, i64 0, i64 %42
  %44 = getelementptr inbounds [100001 x i32], ptr @rtC, i64 0, i64 %indvars.iv62
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z7seg_mixRiiii(ptr noundef nonnull align 4 dereferenceable(4) %43, i32 noundef %45, i32 noundef 1, i32 noundef %46)
  %47 = getelementptr inbounds [100001 x i32], ptr @rtD, i64 0, i64 %42
  %48 = getelementptr inbounds [100001 x i32], ptr @rtD, i64 0, i64 %indvars.iv62
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z7col_mixRiS_iii(ptr noundef nonnull align 4 dereferenceable(4) %43, ptr noundef nonnull align 4 dereferenceable(4) %47, i32 noundef %49, i32 noundef 1, i32 noundef %50)
  %indvars.iv.next63 = add nsw i64 %indvars.iv62, -1
  %51 = icmp ugt i64 %indvars.iv62, 2
  br i1 %51, label %.lr.ph46, label %.preheader, !llvm.loop !14

.lr.ph49:                                         ; preds = %.preheader, %.lr.ph49
  %.048 = phi i32 [ %64, %.lr.ph49 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %52 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %53 = load i32, ptr %1, align 4, !tbaa !5
  %54 = xor i32 %53, %.048
  store i32 %54, ptr %1, align 4, !tbaa !5
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = xor i32 %55, %.048
  store i32 %56, ptr %2, align 4, !tbaa !5
  %57 = sext i32 %54 to i64
  %58 = getelementptr inbounds [100001 x i32], ptr @rtC, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = load i32, ptr @n, align 4, !tbaa !5
  %61 = getelementptr inbounds [100001 x i32], ptr @dep, i64 0, i64 %57
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = add nsw i32 %62, %56
  %64 = call noundef i32 @_Z7seg_queiiii(i32 noundef %59, i32 noundef 1, i32 noundef %60, i32 noundef %63)
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %64)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  %66 = load i32, ptr @m, align 4, !tbaa !5
  %67 = add nsw i32 %66, -1
  store i32 %67, ptr @m, align 4, !tbaa !5
  %.not33 = icmp eq i32 %66, 0
  br i1 %.not33, label %.loopexit, label %.lr.ph49, !llvm.loop !15

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

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

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

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 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 = { 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 #4 = { 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}


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