; LLVM IR from tangjz/acm-icpc :: TDL_training/2015-11-15 (C - CVS - dby)

; 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
@tag = external dso_local global [1000600 x i32], align 16
@dtag = external dso_local global [1000600 x i32], align 16
@fa = external dso_local global [1000600 x i32], align 16
@dfa = external dso_local global [1000600 x i32], align 16
@mem = external dso_local global i32, align 4
@dmem = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@p = external dso_local global [500300 x i32], align 16
@dp = external dso_local global [500300 x i32], align 16
@cmd = external dso_local global [30 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4readRi(ptr noundef nonnull align 4 dereferenceable(4)) #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 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
  store i32 0, ptr %1, align 4
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  store i32 0, ptr @mem, align 4, !tbaa !5
  store i32 0, ptr @tag, align 16, !tbaa !5
  %6 = load i32, ptr @mem, align 4, !tbaa !5
  %7 = add nsw i32 %6, 1
  store i32 %7, ptr @mem, align 4, !tbaa !5
  store i32 1, ptr @tot, align 4, !tbaa !5
  store i32 %6, ptr getelementptr inbounds ([500300 x i32], ptr @p, i64 0, i64 1), align 4, !tbaa !5
  %8 = load i32, ptr @tot, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds [500300 x i32], ptr @dp, i64 0, i64 %9
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  br label %11

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

15:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %179

16:                                               ; preds = %11
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @cmd)
  call void @_Z4readRi(ptr noundef nonnull align 4 dereferenceable(4) %3)
  %18 = load i8, ptr @cmd, align 16, !tbaa !9
  %19 = sext i8 %18 to i32
  %20 = icmp eq i32 %19, 108
  br i1 %20, label %21, label %45

21:                                               ; preds = %16
  %22 = load i8, ptr getelementptr inbounds ([30 x i8], ptr @cmd, i64 0, i64 1), align 1, !tbaa !9
  %23 = sext i8 %22 to i32
  %24 = icmp eq i32 %23, 101
  br i1 %24, label %25, label %45

25:                                               ; preds = %21
  call void @_Z4readRi(ptr noundef nonnull align 4 dereferenceable(4) %4)
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = load i32, ptr @mem, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [1000600 x i32], ptr @tag, i64 0, i64 %28
  store i32 %26, ptr %29, align 4, !tbaa !5
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [500300 x i32], ptr @p, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = load i32, ptr @mem, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [1000600 x i32], ptr @fa, i64 0, i64 %35
  store i32 %33, ptr %36, align 4, !tbaa !5
  %37 = load i32, ptr @mem, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr @mem, align 4, !tbaa !5
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [500300 x i32], ptr @p, i64 0, i64 %40
  store i32 %37, ptr %41, align 4, !tbaa !5
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [500300 x i32], ptr @dp, i64 0, i64 %43
  store i32 0, ptr %44, align 4, !tbaa !5
  br label %175

45:                                               ; preds = %21, %16
  %46 = load i8, ptr @cmd, align 16, !tbaa !9
  %47 = sext i8 %46 to i32
  %48 = icmp eq i32 %47, 114
  br i1 %48, label %49, label %86

49:                                               ; preds = %45
  %50 = load i8, ptr getelementptr inbounds ([30 x i8], ptr @cmd, i64 0, i64 1), align 1, !tbaa !9
  %51 = sext i8 %50 to i32
  %52 = icmp eq i32 %51, 111
  br i1 %52, label %53, label %86

53:                                               ; preds = %49
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [500300 x i32], ptr @p, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [1000600 x i32], ptr @tag, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = load i32, ptr @dmem, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [1000600 x i32], ptr @dtag, i64 0, i64 %62
  store i32 %60, ptr %63, align 4, !tbaa !5
  %64 = load i32, ptr %3, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [500300 x i32], ptr @dp, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = load i32, ptr @dmem, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [1000600 x i32], ptr @dfa, i64 0, i64 %69
  store i32 %67, ptr %70, align 4, !tbaa !5
  %71 = load i32, ptr %3, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [500300 x i32], ptr @p, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [1000600 x i32], ptr @fa, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = load i32, ptr %3, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [500300 x i32], ptr @p, i64 0, i64 %79
  store i32 %77, ptr %80, align 4, !tbaa !5
  %81 = load i32, ptr @dmem, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr @dmem, align 4, !tbaa !5
  %83 = load i32, ptr %3, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [500300 x i32], ptr @dp, i64 0, i64 %84
  store i32 %81, ptr %85, align 4, !tbaa !5
  br label %174

86:                                               ; preds = %49, %45
  %87 = load i8, ptr @cmd, align 16, !tbaa !9
  %88 = sext i8 %87 to i32
  %89 = icmp eq i32 %88, 114
  br i1 %89, label %90, label %127

90:                                               ; preds = %86
  %91 = load i8, ptr getelementptr inbounds ([30 x i8], ptr @cmd, i64 0, i64 1), align 1, !tbaa !9
  %92 = sext i8 %91 to i32
  %93 = icmp eq i32 %92, 101
  br i1 %93, label %94, label %127

94:                                               ; preds = %90
  %95 = load i32, ptr %3, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [500300 x i32], ptr @dp, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [1000600 x i32], ptr @dtag, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = load i32, ptr @mem, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [1000600 x i32], ptr @tag, i64 0, i64 %103
  store i32 %101, ptr %104, align 4, !tbaa !5
  %105 = load i32, ptr %3, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [500300 x i32], ptr @p, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = load i32, ptr @mem, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [1000600 x i32], ptr @fa, i64 0, i64 %110
  store i32 %108, ptr %111, align 4, !tbaa !5
  %112 = load i32, ptr %3, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [500300 x i32], ptr @dp, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [1000600 x i32], ptr @dfa, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = load i32, ptr %3, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [500300 x i32], ptr @dp, i64 0, i64 %120
  store i32 %118, ptr %121, align 4, !tbaa !5
  %122 = load i32, ptr @mem, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr @mem, align 4, !tbaa !5
  %124 = load i32, ptr %3, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [500300 x i32], ptr @p, i64 0, i64 %125
  store i32 %122, ptr %126, align 4, !tbaa !5
  br label %173

127:                                              ; preds = %90, %86
  %128 = load i8, ptr @cmd, align 16, !tbaa !9
  %129 = sext i8 %128 to i32
  %130 = icmp eq i32 %129, 99
  br i1 %130, label %131, label %151

131:                                              ; preds = %127
  %132 = load i8, ptr getelementptr inbounds ([30 x i8], ptr @cmd, i64 0, i64 1), align 1, !tbaa !9
  %133 = sext i8 %132 to i32
  %134 = icmp eq i32 %133, 108
  br i1 %134, label %135, label %151

135:                                              ; preds = %131
  %136 = load i32, ptr %3, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [500300 x i32], ptr @p, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = load i32, ptr @tot, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr @tot, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [500300 x i32], ptr @p, i64 0, i64 %142
  store i32 %139, ptr %143, align 4, !tbaa !5
  %144 = load i32, ptr %3, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [500300 x i32], ptr @dp, i64 0, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = load i32, ptr @tot, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [500300 x i32], ptr @dp, i64 0, i64 %149
  store i32 %147, ptr %150, align 4, !tbaa !5
  br label %172

151:                                              ; preds = %131, %127
  %152 = load i32, ptr %3, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [500300 x i32], ptr @p, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [1000600 x i32], ptr @tag, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = icmp ne i32 %158, 0
  br i1 %159, label %160, label %169

160:                                              ; preds = %151
  %161 = load i32, ptr %3, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [500300 x i32], ptr @p, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [1000600 x i32], ptr @tag, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %167)
  br label %171

169:                                              ; preds = %151
  %170 = call i32 @puts(ptr noundef @.str.3)
  br label %171

171:                                              ; preds = %169, %160
  br label %172

172:                                              ; preds = %171, %135
  br label %173

173:                                              ; preds = %172, %94
  br label %174

174:                                              ; preds = %173, %53
  br label %175

175:                                              ; preds = %174, %25
  br label %176

176:                                              ; preds = %175
  %177 = load i32, ptr %2, align 4, !tbaa !5
  %178 = add nsw i32 %177, 1
  store i32 %178, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !10

179:                                              ; preds = %15
  ret i32 0
}

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

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

declare i32 @puts(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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}


; 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
@tag = external dso_local local_unnamed_addr global [1000600 x i32], align 16
@dtag = external dso_local local_unnamed_addr global [1000600 x i32], align 16
@fa = external dso_local local_unnamed_addr global [1000600 x i32], align 16
@dfa = external dso_local local_unnamed_addr global [1000600 x i32], align 16
@mem = external dso_local local_unnamed_addr global i32, align 4
@dmem = external dso_local local_unnamed_addr global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@p = external dso_local local_unnamed_addr global [500300 x i32], align 16
@dp = external dso_local local_unnamed_addr global [500300 x i32], align 16
@cmd = external dso_local global [30 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4readRi(ptr noundef nonnull align 4 dereferenceable(4)) 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 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 @n, ptr noundef nonnull @m)
  store i32 0, ptr @tag, align 16, !tbaa !5
  store i32 1, ptr @mem, align 4, !tbaa !5
  store i32 1, ptr @tot, align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @p, i64 4), align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @dp, i64 4), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %84, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  ret i32 0

.lr.ph:                                           ; preds = %0, %84
  %.014 = phi i32 [ %85, %84 ], [ 0, %0 ]
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @cmd)
  call void @_Z4readRi(ptr noundef nonnull align 4 dereferenceable(4) %1)
  %7 = load i8, ptr @cmd, align 16, !tbaa !9
  %8 = icmp eq i8 %7, 108
  %9 = load i8, ptr getelementptr inbounds (i8, ptr @cmd, i64 1), align 1
  %10 = icmp eq i8 %9, 101
  %or.cond = select i1 %8, i1 %10, i1 false
  br i1 %or.cond, label %11, label %23

11:                                               ; preds = %.lr.ph
  call void @_Z4readRi(ptr noundef nonnull align 4 dereferenceable(4) %2)
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = load i32, ptr @mem, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [1000600 x i32], ptr @tag, i64 0, i64 %14
  store i32 %12, ptr %15, align 4, !tbaa !5
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [500300 x i32], ptr @p, i64 0, i64 %17
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = getelementptr inbounds [1000600 x i32], ptr @fa, i64 0, i64 %14
  store i32 %19, ptr %20, align 4, !tbaa !5
  %21 = add nsw i32 %13, 1
  store i32 %21, ptr @mem, align 4, !tbaa !5
  store i32 %13, ptr %18, align 4, !tbaa !5
  %22 = getelementptr inbounds [500300 x i32], ptr @dp, i64 0, i64 %17
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %84

23:                                               ; preds = %.lr.ph
  %24 = icmp eq i8 %7, 114
  %25 = icmp eq i8 %9, 111
  %or.cond5 = select i1 %24, i1 %25, i1 false
  br i1 %or.cond5, label %26, label %43

26:                                               ; preds = %23
  %27 = load i32, ptr %1, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [500300 x i32], ptr @p, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [1000600 x i32], ptr @tag, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = load i32, ptr @dmem, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [1000600 x i32], ptr @dtag, i64 0, i64 %35
  store i32 %33, ptr %36, align 4, !tbaa !5
  %37 = getelementptr inbounds [500300 x i32], ptr @dp, i64 0, i64 %28
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = getelementptr inbounds [1000600 x i32], ptr @dfa, i64 0, i64 %35
  store i32 %38, ptr %39, align 4, !tbaa !5
  %40 = getelementptr inbounds [1000600 x i32], ptr @fa, i64 0, i64 %31
  %41 = load i32, ptr %40, align 4, !tbaa !5
  store i32 %41, ptr %29, align 4, !tbaa !5
  %42 = add nsw i32 %34, 1
  store i32 %42, ptr @dmem, align 4, !tbaa !5
  store i32 %34, ptr %37, align 4, !tbaa !5
  br label %84

43:                                               ; preds = %23
  %or.cond8 = select i1 %24, i1 %10, i1 false
  br i1 %or.cond8, label %44, label %61

44:                                               ; preds = %43
  %45 = load i32, ptr %1, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [500300 x i32], ptr @dp, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [1000600 x i32], ptr @dtag, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = load i32, ptr @mem, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [1000600 x i32], ptr @tag, i64 0, i64 %53
  store i32 %51, ptr %54, align 4, !tbaa !5
  %55 = getelementptr inbounds [500300 x i32], ptr @p, i64 0, i64 %46
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = getelementptr inbounds [1000600 x i32], ptr @fa, i64 0, i64 %53
  store i32 %56, ptr %57, align 4, !tbaa !5
  %58 = getelementptr inbounds [1000600 x i32], ptr @dfa, i64 0, i64 %49
  %59 = load i32, ptr %58, align 4, !tbaa !5
  store i32 %59, ptr %47, align 4, !tbaa !5
  %60 = add nsw i32 %52, 1
  store i32 %60, ptr @mem, align 4, !tbaa !5
  store i32 %52, ptr %55, align 4, !tbaa !5
  br label %84

61:                                               ; preds = %43
  %62 = icmp eq i8 %7, 99
  %63 = icmp eq i8 %9, 108
  %or.cond11 = select i1 %62, i1 %63, i1 false
  %64 = load i32, ptr %1, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [500300 x i32], ptr @p, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  br i1 %or.cond11, label %68, label %76

68:                                               ; preds = %61
  %69 = load i32, ptr @tot, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr @tot, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [500300 x i32], ptr @p, i64 0, i64 %71
  store i32 %67, ptr %72, align 4, !tbaa !5
  %73 = getelementptr inbounds [500300 x i32], ptr @dp, i64 0, i64 %65
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = getelementptr inbounds [500300 x i32], ptr @dp, i64 0, i64 %71
  store i32 %74, ptr %75, align 4, !tbaa !5
  br label %84

76:                                               ; preds = %61
  %77 = sext i32 %67 to i64
  %78 = getelementptr inbounds [1000600 x i32], ptr @tag, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %.not = icmp eq i32 %79, 0
  br i1 %.not, label %82, label %80

80:                                               ; preds = %76
  %81 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %79)
  br label %84

82:                                               ; preds = %76
  %83 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %84

84:                                               ; preds = %11, %44, %80, %82, %68, %26
  %85 = add nuw nsw i32 %.014, 1
  %86 = load i32, ptr @n, align 4, !tbaa !5
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %.lr.ph, label %._crit_edge, !llvm.loop !10
}

; 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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass