; LLVM IR from tangjz/acm-icpc :: uvalive (5877)

; 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
@s = external dso_local global i32, align 4
@f = external dso_local global i32, align 4
@e = external dso_local global [1010 x [1010 x i32]], align 16
@dis = external dso_local global [1010 x i32], align 16
@que = external dso_local global [1010 x i32], align 16
@L = external dso_local global i32, align 4
@R = external dso_local global i32, align 4
@x = external dso_local global [1010 x i64], align 16
@y = external dso_local global [1010 x i64], align 16
@l1 = external dso_local global double, align 8
@l2 = external dso_local global double, align 8
@vis = external dso_local global [1010 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = 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 ptr, align 8
  store i32 0, ptr %1, align 4
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %10

10:                                               ; preds = %202, %0
  %11 = load i32, ptr @t, align 4, !tbaa !5
  %12 = add nsw i32 %11, -1
  store i32 %12, ptr @t, align 4, !tbaa !5
  %13 = icmp ne i32 %11, 0
  br i1 %13, label %14, label %203

14:                                               ; preds = %10
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @s, ptr noundef @f, ptr noundef @l1, ptr noundef @l2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %16

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

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

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

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

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

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

37:                                               ; preds = %33
  store i32 7, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %122

38:                                               ; preds = %33
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [1010 x [1010 x i32]], ptr @e, i64 0, i64 %40
  %42 = getelementptr inbounds [1010 x i32], ptr %41, i64 0, i64 0
  store i32 0, ptr %42, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %115, %38
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = load i32, ptr @n, align 4, !tbaa !5
  %46 = icmp sle i32 %44, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  store i32 10, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %118

48:                                               ; preds = %43
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = icmp ne i32 %49, %50
  br i1 %51, label %52, label %114

52:                                               ; preds = %48
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [1010 x i64], ptr @x, i64 0, i64 %54
  %56 = load i64, ptr %55, align 8, !tbaa !11
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [1010 x i64], ptr @x, i64 0, i64 %58
  %60 = load i64, ptr %59, align 8, !tbaa !11
  %61 = sub nsw i64 %56, %60
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [1010 x i64], ptr @x, i64 0, i64 %63
  %65 = load i64, ptr %64, align 8, !tbaa !11
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [1010 x i64], ptr @x, i64 0, i64 %67
  %69 = load i64, ptr %68, align 8, !tbaa !11
  %70 = sub nsw i64 %65, %69
  %71 = mul nsw i64 %61, %70
  %72 = load i32, ptr %3, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [1010 x i64], ptr @y, i64 0, i64 %73
  %75 = load i64, ptr %74, align 8, !tbaa !11
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [1010 x i64], ptr @y, i64 0, i64 %77
  %79 = load i64, ptr %78, align 8, !tbaa !11
  %80 = sub nsw i64 %75, %79
  %81 = load i32, ptr %3, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [1010 x i64], ptr @y, i64 0, i64 %82
  %84 = load i64, ptr %83, align 8, !tbaa !11
  %85 = load i32, ptr %5, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [1010 x i64], ptr @y, i64 0, i64 %86
  %88 = load i64, ptr %87, align 8, !tbaa !11
  %89 = sub nsw i64 %84, %88
  %90 = mul nsw i64 %80, %89
  %91 = add nsw i64 %71, %90
  %92 = sitofp i64 %91 to double
  %93 = load double, ptr @l1, align 8, !tbaa !13
  %94 = load double, ptr @l2, align 8, !tbaa !13
  %95 = fadd double %93, %94
  %96 = load double, ptr @l1, align 8, !tbaa !13
  %97 = load double, ptr @l2, align 8, !tbaa !13
  %98 = fadd double %96, %97
  %99 = fmul double %95, %98
  %100 = fcmp ole double %92, %99
  br i1 %100, label %101, label %114

101:                                              ; preds = %52
  %102 = load i32, ptr %5, align 4, !tbaa !5
  %103 = load i32, ptr %3, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [1010 x [1010 x i32]], ptr @e, i64 0, i64 %104
  %106 = load i32, ptr %3, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [1010 x [1010 x i32]], ptr @e, i64 0, i64 %107
  %109 = getelementptr inbounds [1010 x i32], ptr %108, i64 0, i64 0
  %110 = load i32, ptr %109, align 8, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %109, align 8, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [1010 x i32], ptr %105, i64 0, i64 %112
  store i32 %102, ptr %113, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %101, %52, %48
  br label %115

115:                                              ; preds = %114
  %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 %43, !llvm.loop !15

118:                                              ; preds = %47
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %3, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %3, align 4, !tbaa !5
  br label %33, !llvm.loop !16

122:                                              ; preds = %37
  store i32 0, ptr @R, align 4, !tbaa !5
  store i32 0, ptr @L, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 1010, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @dis, i8 63, i64 4040, i1 false)
  %123 = load i32, ptr @s, align 4, !tbaa !5
  %124 = load i32, ptr @R, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr @R, align 4, !tbaa !5
  %126 = sext i32 %124 to i64
  %127 = getelementptr inbounds [1010 x i32], ptr @que, i64 0, i64 %126
  store i32 %123, ptr %127, align 4, !tbaa !5
  %128 = load i32, ptr @s, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [1010 x i32], ptr @dis, i64 0, i64 %129
  store i32 0, ptr %130, align 4, !tbaa !5
  br label %131

131:                                              ; preds = %187, %122
  %132 = load i32, ptr @L, align 4, !tbaa !5
  %133 = load i32, ptr @R, align 4, !tbaa !5
  %134 = icmp slt i32 %132, %133
  br i1 %134, label %135, label %188

135:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %136 = load i32, ptr @L, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr @L, align 4, !tbaa !5
  %138 = sext i32 %136 to i64
  %139 = getelementptr inbounds [1010 x i32], ptr @que, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  store i32 %140, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %184, %135
  %142 = load i32, ptr %7, align 4, !tbaa !5
  %143 = load i32, ptr %6, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [1010 x [1010 x i32]], ptr @e, i64 0, i64 %144
  %146 = getelementptr inbounds [1010 x i32], ptr %145, i64 0, i64 0
  %147 = load i32, ptr %146, align 8, !tbaa !5
  %148 = icmp sle i32 %142, %147
  br i1 %148, label %150, label %149

149:                                              ; preds = %141
  store i32 15, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %187

150:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %151 = load i32, ptr %6, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [1010 x [1010 x i32]], ptr @e, i64 0, i64 %152
  %154 = load i32, ptr %7, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [1010 x i32], ptr %153, i64 0, i64 %155
  store ptr %156, ptr %8, align 8, !tbaa !17
  %157 = load ptr, ptr %8, align 8, !tbaa !17
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [1010 x i8], ptr @vis, i64 0, i64 %159
  %161 = load i8, ptr %160, align 1, !tbaa !19, !range !21, !noundef !22
  %162 = trunc i8 %161 to i1
  br i1 %162, label %183, label %163

163:                                              ; preds = %150
  %164 = load i32, ptr %6, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [1010 x i32], ptr @dis, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = add nsw i32 %167, 1
  %169 = load ptr, ptr %8, align 8, !tbaa !17
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [1010 x i32], ptr @dis, i64 0, i64 %171
  store i32 %168, ptr %172, align 4, !tbaa !5
  %173 = load ptr, ptr %8, align 8, !tbaa !17
  %174 = load i32, ptr %173, align 4, !tbaa !5
  %175 = load i32, ptr @R, align 4, !tbaa !5
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr @R, align 4, !tbaa !5
  %177 = sext i32 %175 to i64
  %178 = getelementptr inbounds [1010 x i32], ptr @que, i64 0, i64 %177
  store i32 %174, ptr %178, align 4, !tbaa !5
  %179 = load ptr, ptr %8, align 8, !tbaa !17
  %180 = load i32, ptr %179, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [1010 x i8], ptr @vis, i64 0, i64 %181
  store i8 1, ptr %182, align 1, !tbaa !19
  br label %183

183:                                              ; preds = %163, %150
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %184

184:                                              ; preds = %183
  %185 = load i32, ptr %7, align 4, !tbaa !5
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %7, align 4, !tbaa !5
  br label %141, !llvm.loop !23

187:                                              ; preds = %149
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %131, !llvm.loop !24

188:                                              ; preds = %131
  %189 = load i32, ptr @f, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [1010 x i32], ptr @dis, i64 0, i64 %190
  %192 = load i32, ptr %191, align 4, !tbaa !5
  %193 = icmp eq i32 %192, 1061109567
  br i1 %193, label %194, label %196

194:                                              ; preds = %188
  %195 = call i32 @puts(ptr noundef @.str.3)
  br label %202

196:                                              ; preds = %188
  %197 = load i32, ptr @f, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [1010 x i32], ptr @dis, i64 0, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !5
  %201 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %200)
  br label %202

202:                                              ; preds = %196, %194
  br label %10, !llvm.loop !25

203:                                              ; preds = %10
  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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

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

declare i32 @puts(ptr noundef) #1

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = !{!18, !18, i64 0}
!18 = !{!"any pointer", !7, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !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
@s = external dso_local global i32, align 4
@f = external dso_local global i32, align 4
@e = external dso_local local_unnamed_addr global [1010 x [1010 x i32]], align 16
@dis = external dso_local local_unnamed_addr global [1010 x i32], align 16
@que = external dso_local local_unnamed_addr global [1010 x i32], align 16
@L = external dso_local local_unnamed_addr global i32, align 4
@R = external dso_local local_unnamed_addr global i32, align 4
@x = external dso_local global [1010 x i64], align 16
@y = external dso_local global [1010 x i64], align 16
@l1 = external dso_local global double, align 8
@l2 = external dso_local global double, align 8
@vis = external dso_local local_unnamed_addr global [1010 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind 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 @t)
  %2 = load i32, ptr @t, align 4, !tbaa !5
  %3 = add nsw i32 %2, -1
  store i32 %3, ptr @t, align 4, !tbaa !5
  %.not64 = icmp eq i32 %2, 0
  br i1 %.not64, label %._crit_edge67, label %.lr.ph66

.lr.ph66:                                         ; preds = %0, %81
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @s, ptr noundef nonnull @f, ptr noundef nonnull @l1, ptr noundef nonnull @l2)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %.not3641 = icmp slt i32 %5, 1
  br i1 %.not3641, label %.lr.ph61.preheader, label %.lr.ph

.preheader:                                       ; preds = %.lr.ph
  %.not3746 = icmp slt i32 %14, 1
  br i1 %.not3746, label %.lr.ph61.preheader, label %.lr.ph48

.lr.ph48:                                         ; preds = %.preheader
  %6 = load double, ptr @l1, align 8
  %7 = load double, ptr @l2, align 8
  %8 = fadd double %6, %7
  %9 = fmul double %8, %8
  %10 = add nuw i32 %14, 1
  %wide.trip.count77 = zext i32 %10 to i64
  br label %.lr.ph45

.lr.ph:                                           ; preds = %.lr.ph66, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.lr.ph66 ]
  %11 = getelementptr inbounds i64, ptr @x, i64 %indvars.iv
  %12 = getelementptr inbounds i64, ptr @y, i64 %indvars.iv
  %13 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %11, ptr noundef nonnull %12)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %.not36.not = icmp slt i64 %indvars.iv, %15
  br i1 %.not36.not, label %.lr.ph, label %.preheader, !llvm.loop !9

.lr.ph61.preheader:                               ; preds = %._crit_edge, %.lr.ph66, %.preheader
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1010) @vis, i8 0, i64 1010, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4040) @dis, i8 63, i64 4040, i1 false)
  %16 = load i32, ptr @s, align 4, !tbaa !5
  store i32 1, ptr @R, align 4, !tbaa !5
  store i32 %16, ptr @que, align 16, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [1010 x i32], ptr @dis, i64 0, i64 %17
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %.lr.ph61

.lr.ph45:                                         ; preds = %.lr.ph48, %._crit_edge
  %indvars.iv74 = phi i64 [ 1, %.lr.ph48 ], [ %indvars.iv.next75, %._crit_edge ]
  %19 = getelementptr inbounds [1010 x [1010 x i32]], ptr @e, i64 0, i64 %indvars.iv74
  store i32 0, ptr %19, align 8, !tbaa !5
  %20 = getelementptr inbounds [1010 x i64], ptr @x, i64 0, i64 %indvars.iv74
  %21 = getelementptr inbounds [1010 x i64], ptr @y, i64 0, i64 %indvars.iv74
  br label %22

._crit_edge:                                      ; preds = %43
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %exitcond78.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count77
  br i1 %exitcond78.not, label %.lr.ph61.preheader, label %.lr.ph45, !llvm.loop !11

22:                                               ; preds = %.lr.ph45, %43
  %indvars.iv71 = phi i64 [ 1, %.lr.ph45 ], [ %indvars.iv.next72, %43 ]
  %.not40 = icmp eq i64 %indvars.iv74, %indvars.iv71
  br i1 %.not40, label %43, label %23

23:                                               ; preds = %22
  %24 = load i64, ptr %20, align 8, !tbaa !12
  %25 = getelementptr inbounds [1010 x i64], ptr @x, i64 0, i64 %indvars.iv71
  %26 = load i64, ptr %25, align 8, !tbaa !12
  %27 = sub nsw i64 %24, %26
  %28 = mul nsw i64 %27, %27
  %29 = load i64, ptr %21, align 8, !tbaa !12
  %30 = getelementptr inbounds [1010 x i64], ptr @y, i64 0, i64 %indvars.iv71
  %31 = load i64, ptr %30, align 8, !tbaa !12
  %32 = sub nsw i64 %29, %31
  %33 = mul nsw i64 %32, %32
  %34 = add nuw nsw i64 %33, %28
  %35 = uitofp nneg i64 %34 to double
  %36 = fcmp ult double %9, %35
  br i1 %36, label %43, label %37

37:                                               ; preds = %23
  %38 = load i32, ptr %19, align 8, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %19, align 8, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [1010 x [1010 x i32]], ptr @e, i64 0, i64 %indvars.iv74, i64 %40
  %42 = trunc nuw nsw i64 %indvars.iv71 to i32
  store i32 %42, ptr %41, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %22, %23, %37
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count77
  br i1 %exitcond.not, label %._crit_edge, label %22, !llvm.loop !14

.loopexit:                                        ; preds = %68, %.lr.ph61
  %R.promoted57 = phi i32 [ %R.promoted5859, %.lr.ph61 ], [ %R.promoted55, %68 ]
  %44 = sext i32 %R.promoted57 to i64
  %45 = icmp slt i64 %indvars.iv.next85, %44
  br i1 %45, label %.lr.ph61, label %70, !llvm.loop !15

.lr.ph61:                                         ; preds = %.lr.ph61.preheader, %.loopexit
  %indvars.iv84 = phi i64 [ 0, %.lr.ph61.preheader ], [ %indvars.iv.next85, %.loopexit ]
  %R.promoted5859 = phi i32 [ 1, %.lr.ph61.preheader ], [ %R.promoted57, %.loopexit ]
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  %46 = getelementptr inbounds [1010 x i32], ptr @que, i64 0, i64 %indvars.iv84
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [1010 x [1010 x i32]], ptr @e, i64 0, i64 %48
  %50 = load i32, ptr %49, align 8, !tbaa !5
  %.not3850 = icmp slt i32 %50, 1
  br i1 %.not3850, label %.loopexit, label %.lr.ph53

.lr.ph53:                                         ; preds = %.lr.ph61
  %51 = getelementptr inbounds [1010 x i32], ptr @dis, i64 0, i64 %48
  %52 = add nuw i32 %50, 1
  %wide.trip.count82 = zext i32 %52 to i64
  br label %53

53:                                               ; preds = %.lr.ph53, %68
  %indvars.iv79 = phi i64 [ 1, %.lr.ph53 ], [ %indvars.iv.next80, %68 ]
  %R.promoted56 = phi i32 [ %R.promoted5859, %.lr.ph53 ], [ %R.promoted55, %68 ]
  %54 = phi i32 [ %R.promoted5859, %.lr.ph53 ], [ %69, %68 ]
  %55 = getelementptr inbounds [1010 x [1010 x i32]], ptr @e, i64 0, i64 %48, i64 %indvars.iv79
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [1010 x i8], ptr @vis, i64 0, i64 %57
  %59 = load i8, ptr %58, align 1, !tbaa !16, !range !18, !noundef !19
  %60 = trunc nuw i8 %59 to i1
  br i1 %60, label %68, label %61

61:                                               ; preds = %53
  %62 = load i32, ptr %51, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  %64 = getelementptr inbounds [1010 x i32], ptr @dis, i64 0, i64 %57
  store i32 %63, ptr %64, align 4, !tbaa !5
  %65 = add nsw i32 %54, 1
  store i32 %65, ptr @R, align 4, !tbaa !5
  %66 = sext i32 %54 to i64
  %67 = getelementptr inbounds [1010 x i32], ptr @que, i64 0, i64 %66
  store i32 %56, ptr %67, align 4, !tbaa !5
  store i8 1, ptr %58, align 1, !tbaa !16
  br label %68

68:                                               ; preds = %61, %53
  %R.promoted55 = phi i32 [ %65, %61 ], [ %R.promoted56, %53 ]
  %69 = phi i32 [ %65, %61 ], [ %54, %53 ]
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %exitcond83.not = icmp eq i64 %indvars.iv.next80, %wide.trip.count82
  br i1 %exitcond83.not, label %.loopexit, label %53, !llvm.loop !20

70:                                               ; preds = %.loopexit
  %71 = trunc nsw i64 %indvars.iv.next85 to i32
  store i32 %71, ptr @L, align 4, !tbaa !5
  %72 = load i32, ptr @f, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [1010 x i32], ptr @dis, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = icmp eq i32 %75, 1061109567
  br i1 %76, label %77, label %79

77:                                               ; preds = %70
  %78 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %81

79:                                               ; preds = %70
  %80 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %75)
  br label %81

81:                                               ; preds = %79, %77
  %82 = load i32, ptr @t, align 4, !tbaa !5
  %83 = add nsw i32 %82, -1
  store i32 %83, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %82, 0
  br i1 %.not, label %._crit_edge67, label %.lr.ph66, !llvm.loop !21

._crit_edge67:                                    ; preds = %81, %0
  ret i32 0
}

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

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

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

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

attributes #0 = { mustprogress nofree norecurse 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 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = !{!17, !17, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass