; LLVM IR from Shah-Shishir/Codeforces-Solutions :: 932B. Recursive Queries (main)

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

@ans = external dso_local global [10 x [1000005 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z5retIti(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 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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %8

8:                                                ; preds = %21, %0
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = icmp slt i32 %9, 1000005
  br i1 %10, label %11, label %24

11:                                               ; preds = %8
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = call noundef i32 @_Z5retIti(i32 noundef %12)
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 %14
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [1000005 x i32], ptr %15, i64 0, i64 %17
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = add nsw i32 %19, 1
  store i32 %20, ptr %18, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %11
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %2, align 4, !tbaa !5
  br label %8, !llvm.loop !9

24:                                               ; preds = %8
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %53, %24
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = icmp slt i32 %26, 10
  br i1 %27, label %28, label %56

28:                                               ; preds = %25
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %49, %28
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = icmp slt i32 %30, 1000005
  br i1 %31, label %32, label %52

32:                                               ; preds = %29
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 %34
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = sub nsw i32 %36, 1
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [1000005 x i32], ptr %35, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 %42
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [1000005 x i32], ptr %43, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = add nsw i32 %47, %40
  store i32 %48, ptr %46, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %32
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %3, align 4, !tbaa !5
  br label %29, !llvm.loop !11

52:                                               ; preds = %29
  br label %53

53:                                               ; preds = %52
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %2, align 4, !tbaa !5
  br label %25, !llvm.loop !12

56:                                               ; preds = %25
  %57 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %4)
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %81, %56
  %59 = load i32, ptr %2, align 4, !tbaa !5
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %61 = icmp sle i32 %59, %60
  br i1 %61, label %62, label %84

62:                                               ; preds = %58
  %63 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %5, ptr noundef %6, ptr noundef %7)
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 %65
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [1000005 x i32], ptr %66, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 %72
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = sub nsw i32 %74, 1
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [1000005 x i32], ptr %73, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = sub nsw i32 %70, %78
  %80 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %79)
  br label %81

81:                                               ; preds = %62
  %82 = load i32, ptr %2, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %2, align 4, !tbaa !5
  br label %58, !llvm.loop !13

84:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  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
  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}


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

@ans = external dso_local local_unnamed_addr global [10 x [1000005 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z5retIti(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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  br label %5

5:                                                ; preds = %0, %5
  %indvars.iv = phi i64 [ 1, %0 ], [ %indvars.iv.next, %5 ]
  %6 = trunc nuw nsw i64 %indvars.iv to i32
  %7 = tail call noundef i32 @_Z5retIti(i32 noundef %6)
  %8 = sext i32 %7 to i64
  %9 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 %8, i64 %indvars.iv
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %11 = add nsw i32 %10, 1
  store i32 %11, ptr %9, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 1000005
  br i1 %exitcond.not, label %.preheader.preheader, label %5, !llvm.loop !9

.preheader.preheader:                             ; preds = %5
  %.pre = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 4000020), align 4, !tbaa !5
  br label %12

12:                                               ; preds = %12, %.preheader.preheader
  %13 = phi i32 [ %.pre, %.preheader.preheader ], [ %25, %12 ]
  %indvars.iv22 = phi i64 [ 1, %.preheader.preheader ], [ %indvars.iv.next23.343, %12 ]
  %14 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 1, i64 %indvars.iv22
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %16 = add nsw i32 %15, %13
  store i32 %16, ptr %14, align 4, !tbaa !5
  %indvars.iv.next23 = add nuw nsw i64 %indvars.iv22, 1
  %17 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 1, i64 %indvars.iv.next23
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = add nsw i32 %18, %16
  store i32 %19, ptr %17, align 4, !tbaa !5
  %indvars.iv.next23.139 = add nuw nsw i64 %indvars.iv22, 2
  %20 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 1, i64 %indvars.iv.next23.139
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = add nsw i32 %21, %19
  store i32 %22, ptr %20, align 4, !tbaa !5
  %indvars.iv.next23.241 = add nuw nsw i64 %indvars.iv22, 3
  %23 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 1, i64 %indvars.iv.next23.241
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = add nsw i32 %24, %22
  store i32 %25, ptr %23, align 4, !tbaa !5
  %indvars.iv.next23.343 = add nuw nsw i64 %indvars.iv22, 4
  %exitcond25.not.3 = icmp eq i64 %indvars.iv.next23.343, 1000005
  br i1 %exitcond25.not.3, label %.preheader.1, label %12, !llvm.loop !11

.preheader.1:                                     ; preds = %12
  %.pre30 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 8000040), align 8, !tbaa !5
  br label %26

26:                                               ; preds = %26, %.preheader.1
  %27 = phi i32 [ %.pre30, %.preheader.1 ], [ %39, %26 ]
  %indvars.iv22.1 = phi i64 [ 1, %.preheader.1 ], [ %indvars.iv.next23.1.3, %26 ]
  %28 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 2, i64 %indvars.iv22.1
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = add nsw i32 %29, %27
  store i32 %30, ptr %28, align 4, !tbaa !5
  %indvars.iv.next23.1 = add nuw nsw i64 %indvars.iv22.1, 1
  %31 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 2, i64 %indvars.iv.next23.1
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = add nsw i32 %32, %30
  store i32 %33, ptr %31, align 4, !tbaa !5
  %indvars.iv.next23.1.1 = add nuw nsw i64 %indvars.iv22.1, 2
  %34 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 2, i64 %indvars.iv.next23.1.1
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = add nsw i32 %35, %33
  store i32 %36, ptr %34, align 4, !tbaa !5
  %indvars.iv.next23.1.2 = add nuw nsw i64 %indvars.iv22.1, 3
  %37 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 2, i64 %indvars.iv.next23.1.2
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = add nsw i32 %38, %36
  store i32 %39, ptr %37, align 4, !tbaa !5
  %indvars.iv.next23.1.3 = add nuw nsw i64 %indvars.iv22.1, 4
  %exitcond25.1.not.3 = icmp eq i64 %indvars.iv.next23.1.3, 1000005
  br i1 %exitcond25.1.not.3, label %.preheader.2, label %26, !llvm.loop !11

.preheader.2:                                     ; preds = %26
  %.pre31 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 12000060), align 4, !tbaa !5
  br label %40

40:                                               ; preds = %40, %.preheader.2
  %41 = phi i32 [ %.pre31, %.preheader.2 ], [ %53, %40 ]
  %indvars.iv22.2 = phi i64 [ 1, %.preheader.2 ], [ %indvars.iv.next23.2.3, %40 ]
  %42 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 3, i64 %indvars.iv22.2
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = add nsw i32 %43, %41
  store i32 %44, ptr %42, align 4, !tbaa !5
  %indvars.iv.next23.2 = add nuw nsw i64 %indvars.iv22.2, 1
  %45 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 3, i64 %indvars.iv.next23.2
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = add nsw i32 %46, %44
  store i32 %47, ptr %45, align 4, !tbaa !5
  %indvars.iv.next23.2.1 = add nuw nsw i64 %indvars.iv22.2, 2
  %48 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 3, i64 %indvars.iv.next23.2.1
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = add nsw i32 %49, %47
  store i32 %50, ptr %48, align 4, !tbaa !5
  %indvars.iv.next23.2.2 = add nuw nsw i64 %indvars.iv22.2, 3
  %51 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 3, i64 %indvars.iv.next23.2.2
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = add nsw i32 %52, %50
  store i32 %53, ptr %51, align 4, !tbaa !5
  %indvars.iv.next23.2.3 = add nuw nsw i64 %indvars.iv22.2, 4
  %exitcond25.2.not.3 = icmp eq i64 %indvars.iv.next23.2.3, 1000005
  br i1 %exitcond25.2.not.3, label %.preheader.3, label %40, !llvm.loop !11

.preheader.3:                                     ; preds = %40
  %.pre32 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 16000080), align 16, !tbaa !5
  br label %54

54:                                               ; preds = %54, %.preheader.3
  %55 = phi i32 [ %.pre32, %.preheader.3 ], [ %67, %54 ]
  %indvars.iv22.3 = phi i64 [ 1, %.preheader.3 ], [ %indvars.iv.next23.3.3, %54 ]
  %56 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 4, i64 %indvars.iv22.3
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = add nsw i32 %57, %55
  store i32 %58, ptr %56, align 4, !tbaa !5
  %indvars.iv.next23.3 = add nuw nsw i64 %indvars.iv22.3, 1
  %59 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 4, i64 %indvars.iv.next23.3
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = add nsw i32 %60, %58
  store i32 %61, ptr %59, align 4, !tbaa !5
  %indvars.iv.next23.3.1 = add nuw nsw i64 %indvars.iv22.3, 2
  %62 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 4, i64 %indvars.iv.next23.3.1
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = add nsw i32 %63, %61
  store i32 %64, ptr %62, align 4, !tbaa !5
  %indvars.iv.next23.3.2 = add nuw nsw i64 %indvars.iv22.3, 3
  %65 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 4, i64 %indvars.iv.next23.3.2
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = add nsw i32 %66, %64
  store i32 %67, ptr %65, align 4, !tbaa !5
  %indvars.iv.next23.3.3 = add nuw nsw i64 %indvars.iv22.3, 4
  %exitcond25.3.not.3 = icmp eq i64 %indvars.iv.next23.3.3, 1000005
  br i1 %exitcond25.3.not.3, label %.preheader.4, label %54, !llvm.loop !11

.preheader.4:                                     ; preds = %54
  %.pre33 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 20000100), align 4, !tbaa !5
  br label %68

68:                                               ; preds = %68, %.preheader.4
  %69 = phi i32 [ %.pre33, %.preheader.4 ], [ %81, %68 ]
  %indvars.iv22.4 = phi i64 [ 1, %.preheader.4 ], [ %indvars.iv.next23.4.3, %68 ]
  %70 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 5, i64 %indvars.iv22.4
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = add nsw i32 %71, %69
  store i32 %72, ptr %70, align 4, !tbaa !5
  %indvars.iv.next23.4 = add nuw nsw i64 %indvars.iv22.4, 1
  %73 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 5, i64 %indvars.iv.next23.4
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = add nsw i32 %74, %72
  store i32 %75, ptr %73, align 4, !tbaa !5
  %indvars.iv.next23.4.1 = add nuw nsw i64 %indvars.iv22.4, 2
  %76 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 5, i64 %indvars.iv.next23.4.1
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = add nsw i32 %77, %75
  store i32 %78, ptr %76, align 4, !tbaa !5
  %indvars.iv.next23.4.2 = add nuw nsw i64 %indvars.iv22.4, 3
  %79 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 5, i64 %indvars.iv.next23.4.2
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = add nsw i32 %80, %78
  store i32 %81, ptr %79, align 4, !tbaa !5
  %indvars.iv.next23.4.3 = add nuw nsw i64 %indvars.iv22.4, 4
  %exitcond25.4.not.3 = icmp eq i64 %indvars.iv.next23.4.3, 1000005
  br i1 %exitcond25.4.not.3, label %.preheader.5, label %68, !llvm.loop !11

.preheader.5:                                     ; preds = %68
  %.pre34 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 24000120), align 8, !tbaa !5
  br label %82

82:                                               ; preds = %82, %.preheader.5
  %83 = phi i32 [ %.pre34, %.preheader.5 ], [ %95, %82 ]
  %indvars.iv22.5 = phi i64 [ 1, %.preheader.5 ], [ %indvars.iv.next23.5.3, %82 ]
  %84 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 6, i64 %indvars.iv22.5
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = add nsw i32 %85, %83
  store i32 %86, ptr %84, align 4, !tbaa !5
  %indvars.iv.next23.5 = add nuw nsw i64 %indvars.iv22.5, 1
  %87 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 6, i64 %indvars.iv.next23.5
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = add nsw i32 %88, %86
  store i32 %89, ptr %87, align 4, !tbaa !5
  %indvars.iv.next23.5.1 = add nuw nsw i64 %indvars.iv22.5, 2
  %90 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 6, i64 %indvars.iv.next23.5.1
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = add nsw i32 %91, %89
  store i32 %92, ptr %90, align 4, !tbaa !5
  %indvars.iv.next23.5.2 = add nuw nsw i64 %indvars.iv22.5, 3
  %93 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 6, i64 %indvars.iv.next23.5.2
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = add nsw i32 %94, %92
  store i32 %95, ptr %93, align 4, !tbaa !5
  %indvars.iv.next23.5.3 = add nuw nsw i64 %indvars.iv22.5, 4
  %exitcond25.5.not.3 = icmp eq i64 %indvars.iv.next23.5.3, 1000005
  br i1 %exitcond25.5.not.3, label %.preheader.6, label %82, !llvm.loop !11

.preheader.6:                                     ; preds = %82
  %.pre35 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 28000140), align 4, !tbaa !5
  br label %96

96:                                               ; preds = %96, %.preheader.6
  %97 = phi i32 [ %.pre35, %.preheader.6 ], [ %109, %96 ]
  %indvars.iv22.6 = phi i64 [ 1, %.preheader.6 ], [ %indvars.iv.next23.6.3, %96 ]
  %98 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 7, i64 %indvars.iv22.6
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = add nsw i32 %99, %97
  store i32 %100, ptr %98, align 4, !tbaa !5
  %indvars.iv.next23.6 = add nuw nsw i64 %indvars.iv22.6, 1
  %101 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 7, i64 %indvars.iv.next23.6
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = add nsw i32 %102, %100
  store i32 %103, ptr %101, align 4, !tbaa !5
  %indvars.iv.next23.6.1 = add nuw nsw i64 %indvars.iv22.6, 2
  %104 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 7, i64 %indvars.iv.next23.6.1
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = add nsw i32 %105, %103
  store i32 %106, ptr %104, align 4, !tbaa !5
  %indvars.iv.next23.6.2 = add nuw nsw i64 %indvars.iv22.6, 3
  %107 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 7, i64 %indvars.iv.next23.6.2
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = add nsw i32 %108, %106
  store i32 %109, ptr %107, align 4, !tbaa !5
  %indvars.iv.next23.6.3 = add nuw nsw i64 %indvars.iv22.6, 4
  %exitcond25.6.not.3 = icmp eq i64 %indvars.iv.next23.6.3, 1000005
  br i1 %exitcond25.6.not.3, label %.preheader.7, label %96, !llvm.loop !11

.preheader.7:                                     ; preds = %96
  %.pre36 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 32000160), align 16, !tbaa !5
  br label %110

110:                                              ; preds = %110, %.preheader.7
  %111 = phi i32 [ %.pre36, %.preheader.7 ], [ %123, %110 ]
  %indvars.iv22.7 = phi i64 [ 1, %.preheader.7 ], [ %indvars.iv.next23.7.3, %110 ]
  %112 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 8, i64 %indvars.iv22.7
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = add nsw i32 %113, %111
  store i32 %114, ptr %112, align 4, !tbaa !5
  %indvars.iv.next23.7 = add nuw nsw i64 %indvars.iv22.7, 1
  %115 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 8, i64 %indvars.iv.next23.7
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = add nsw i32 %116, %114
  store i32 %117, ptr %115, align 4, !tbaa !5
  %indvars.iv.next23.7.1 = add nuw nsw i64 %indvars.iv22.7, 2
  %118 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 8, i64 %indvars.iv.next23.7.1
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = add nsw i32 %119, %117
  store i32 %120, ptr %118, align 4, !tbaa !5
  %indvars.iv.next23.7.2 = add nuw nsw i64 %indvars.iv22.7, 3
  %121 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 8, i64 %indvars.iv.next23.7.2
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = add nsw i32 %122, %120
  store i32 %123, ptr %121, align 4, !tbaa !5
  %indvars.iv.next23.7.3 = add nuw nsw i64 %indvars.iv22.7, 4
  %exitcond25.7.not.3 = icmp eq i64 %indvars.iv.next23.7.3, 1000005
  br i1 %exitcond25.7.not.3, label %.preheader.8, label %110, !llvm.loop !11

.preheader.8:                                     ; preds = %110
  %.pre37 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 36000180), align 4, !tbaa !5
  br label %124

124:                                              ; preds = %124, %.preheader.8
  %125 = phi i32 [ %.pre37, %.preheader.8 ], [ %137, %124 ]
  %indvars.iv22.8 = phi i64 [ 1, %.preheader.8 ], [ %indvars.iv.next23.8.3, %124 ]
  %126 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 9, i64 %indvars.iv22.8
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = add nsw i32 %127, %125
  store i32 %128, ptr %126, align 4, !tbaa !5
  %indvars.iv.next23.8 = add nuw nsw i64 %indvars.iv22.8, 1
  %129 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 9, i64 %indvars.iv.next23.8
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = add nsw i32 %130, %128
  store i32 %131, ptr %129, align 4, !tbaa !5
  %indvars.iv.next23.8.1 = add nuw nsw i64 %indvars.iv22.8, 2
  %132 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 9, i64 %indvars.iv.next23.8.1
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = add nsw i32 %133, %131
  store i32 %134, ptr %132, align 4, !tbaa !5
  %indvars.iv.next23.8.2 = add nuw nsw i64 %indvars.iv22.8, 3
  %135 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 9, i64 %indvars.iv.next23.8.2
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = add nsw i32 %136, %134
  store i32 %137, ptr %135, align 4, !tbaa !5
  %indvars.iv.next23.8.3 = add nuw nsw i64 %indvars.iv22.8, 4
  %exitcond25.8.not.3 = icmp eq i64 %indvars.iv.next23.8.3, 1000005
  br i1 %exitcond25.8.not.3, label %138, label %124, !llvm.loop !11

138:                                              ; preds = %124
  %139 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %140 = load i32, ptr %1, align 4, !tbaa !5
  %.not19 = icmp slt i32 %140, 1
  br i1 %.not19, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %138, %.lr.ph
  %.220 = phi i32 [ %155, %.lr.ph ], [ 1, %138 ]
  %141 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %142 = load i32, ptr %4, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = load i32, ptr %3, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 %143, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = load i32, ptr %2, align 4, !tbaa !5
  %149 = add nsw i32 %148, -1
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [10 x [1000005 x i32]], ptr @ans, i64 0, i64 %143, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = sub nsw i32 %147, %152
  %154 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %153)
  %155 = add nuw nsw i32 %.220, 1
  %156 = load i32, ptr %1, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.220, %156
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !12

._crit_edge:                                      ; preds = %.lr.ph, %138
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  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
}

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


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass