; LLVM IR from ravireddy07/cpp-book :: src/Code-Forces/#696_what-is-it.ll (Z5harryv)

; 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
@p = external dso_local global [100100 x i32], align 16
@ans = external dso_local global [100100 x [2 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z3sqrx(i64 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5harryv() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  store i32 0, ptr @m, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  store i32 1, ptr %1, align 4, !tbaa !5
  br label %9

9:                                                ; preds = %19, %0
  %10 = load i32, ptr %1, align 4, !tbaa !5
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = icmp sle i32 %10, %11
  br i1 %12, label %14, label %13

13:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  br label %22

14:                                               ; preds = %9
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %17
  store i32 %15, ptr %18, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %14
  %20 = load i32, ptr %1, align 4, !tbaa !5
  %21 = add nsw i32 %20, 1
  store i32 %21, ptr %1, align 4, !tbaa !5
  br label %9, !llvm.loop !9

22:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  store i64 0, ptr %2, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = sub nsw i32 %23, 1
  store i32 %24, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %84, %22
  %26 = load i32, ptr @m, align 4, !tbaa !5
  %27 = load i32, ptr @n, align 4, !tbaa !5
  %28 = sub nsw i32 %27, 1
  %29 = icmp slt i32 %26, %28
  br i1 %29, label %30, label %87

30:                                               ; preds = %25
  %31 = load i32, ptr %5, align 4, !tbaa !5
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %61

33:                                               ; preds = %30
  %34 = load i32, ptr @n, align 4, !tbaa !5
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = sub nsw i32 %34, %35
  %37 = sext i32 %36 to i64
  %38 = call noundef i64 @_Z3sqrx(i64 noundef %37)
  %39 = load i64, ptr %2, align 8, !tbaa !11
  %40 = add nsw i64 %39, %38
  store i64 %40, ptr %2, align 8, !tbaa !11
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = load i32, ptr @m, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [100100 x [2 x i32]], ptr @ans, i64 0, i64 %43
  %45 = getelementptr inbounds [2 x i32], ptr %44, i64 0, i64 0
  store i32 %41, ptr %45, align 8, !tbaa !5
  %46 = load i32, ptr @n, align 4, !tbaa !5
  %47 = load i32, ptr @m, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [100100 x [2 x i32]], ptr @ans, i64 0, i64 %48
  %50 = getelementptr inbounds [2 x i32], ptr %49, i64 0, i64 1
  store i32 %46, ptr %50, align 4, !tbaa !5
  %51 = load i32, ptr @m, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr @m, align 4, !tbaa !5
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %54
  %56 = load i32, ptr @n, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %57
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %55, ptr noundef nonnull align 4 dereferenceable(4) %58) #5
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %3, align 4, !tbaa !5
  br label %84

61:                                               ; preds = %30
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = sub nsw i32 %62, 1
  %64 = sext i32 %63 to i64
  %65 = call noundef i64 @_Z3sqrx(i64 noundef %64)
  %66 = load i64, ptr %2, align 8, !tbaa !11
  %67 = add nsw i64 %66, %65
  store i64 %67, ptr %2, align 8, !tbaa !11
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = load i32, ptr @m, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100100 x [2 x i32]], ptr @ans, i64 0, i64 %70
  %72 = getelementptr inbounds [2 x i32], ptr %71, i64 0, i64 0
  store i32 %68, ptr %72, align 8, !tbaa !5
  %73 = load i32, ptr @m, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [100100 x [2 x i32]], ptr @ans, i64 0, i64 %74
  %76 = getelementptr inbounds [2 x i32], ptr %75, i64 0, i64 1
  store i32 1, ptr %76, align 4, !tbaa !5
  %77 = load i32, ptr @m, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr @m, align 4, !tbaa !5
  %79 = load i32, ptr %4, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %80
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %81, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds ([100100 x i32], ptr @p, i64 0, i64 1)) #5
  %82 = load i32, ptr %4, align 4, !tbaa !5
  %83 = add nsw i32 %82, -1
  store i32 %83, ptr %4, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %61, %33
  %85 = load i32, ptr %5, align 4, !tbaa !5
  %86 = xor i32 %85, 1
  store i32 %86, ptr %5, align 4, !tbaa !5
  br label %25, !llvm.loop !13

87:                                               ; preds = %25
  %88 = load i64, ptr %2, align 8, !tbaa !11
  %89 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %88)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %101, %87
  %91 = load i32, ptr %6, align 4, !tbaa !5
  %92 = load i32, ptr @n, align 4, !tbaa !5
  %93 = icmp sle i32 %91, %92
  br i1 %93, label %95, label %94

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

95:                                               ; preds = %90
  %96 = load i32, ptr %6, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %99)
  br label %101

101:                                              ; preds = %95
  %102 = load i32, ptr %6, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %6, align 4, !tbaa !5
  br label %90, !llvm.loop !14

104:                                              ; preds = %94
  %105 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  %106 = load i32, ptr @m, align 4, !tbaa !5
  %107 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %106)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %108 = load i32, ptr @m, align 4, !tbaa !5
  %109 = sub nsw i32 %108, 1
  store i32 %109, ptr %7, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %126, %104
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = icmp sge i32 %111, 0
  br i1 %112, label %114, label %113

113:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %129

114:                                              ; preds = %110
  %115 = load i32, ptr %7, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [100100 x [2 x i32]], ptr @ans, i64 0, i64 %116
  %118 = getelementptr inbounds [2 x i32], ptr %117, i64 0, i64 0
  %119 = load i32, ptr %118, align 8, !tbaa !5
  %120 = load i32, ptr %7, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [100100 x [2 x i32]], ptr @ans, i64 0, i64 %121
  %123 = getelementptr inbounds [2 x i32], ptr %122, i64 0, i64 1
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %119, i32 noundef %124)
  br label %126

126:                                              ; preds = %114
  %127 = load i32, ptr %7, align 4, !tbaa !5
  %128 = add nsw i32 %127, -1
  store i32 %128, ptr %7, align 4, !tbaa !5
  br label %110, !llvm.loop !15

129:                                              ; preds = %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  ret void
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = 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"

@n = external dso_local global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@p = external dso_local global [100100 x i32], align 16
@ans = external dso_local local_unnamed_addr global [100100 x [2 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z3sqrx(i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z5harryv() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  store i32 0, ptr @m, align 4, !tbaa !5
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %.not34 = icmp slt i32 %2, 1
  br i1 %.not34, label %._crit_edge42, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %3 = add nuw i32 %2, 1
  %wide.trip.count = zext i32 %3 to i64
  %4 = zext nneg i32 %2 to i64
  %min.iters.check = icmp ult i32 %2, 8
  br i1 %min.iters.check, label %.lr.ph.preheader61, label %vector.ph

.lr.ph.preheader61:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %4, 2147483640
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %offset.idx = or disjoint i64 %index, 1
  %5 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %offset.idx
  %6 = getelementptr inbounds i8, ptr %5, i64 16
  store <4 x i32> %vec.ind, ptr %5, align 4, !tbaa !5
  store <4 x i32> %step.add, ptr %6, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %7 = icmp eq i64 %index.next, %n.vec
  br i1 %7, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %4
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader61

._crit_edge:                                      ; preds = %.lr.ph, %middle.block
  %.not = icmp eq i32 %2, 1
  br i1 %.not, label %._crit_edge42, label %.lr.ph41.preheader

.lr.ph41.preheader:                               ; preds = %._crit_edge
  %8 = add nsw i32 %2, -1
  br label %.lr.ph41

.lr.ph:                                           ; preds = %.lr.ph.preheader61, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader61 ]
  %9 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %indvars.iv
  %10 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %10, ptr %9, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !13

.lr.ph41:                                         ; preds = %.lr.ph41.preheader, %39
  %11 = phi i32 [ %42, %39 ], [ %2, %.lr.ph41.preheader ]
  %.02539 = phi i32 [ %40, %39 ], [ 0, %.lr.ph41.preheader ]
  %.02638 = phi i32 [ %.1, %39 ], [ %8, %.lr.ph41.preheader ]
  %.02737 = phi i32 [ %.128, %39 ], [ 1, %.lr.ph41.preheader ]
  %.02936 = phi i64 [ %.130, %39 ], [ 0, %.lr.ph41.preheader ]
  %12 = icmp eq i32 %.02539, 0
  br i1 %12, label %13, label %28

13:                                               ; preds = %.lr.ph41
  %14 = sub nsw i32 %11, %.02737
  %15 = sext i32 %14 to i64
  %16 = tail call noundef i64 @_Z3sqrx(i64 noundef %15)
  %17 = load i32, ptr @m, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [100100 x [2 x i32]], ptr @ans, i64 0, i64 %18
  store i32 %.02737, ptr %19, align 8, !tbaa !5
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = getelementptr inbounds [100100 x [2 x i32]], ptr @ans, i64 0, i64 %18, i64 1
  store i32 %20, ptr %21, align 4, !tbaa !5
  %22 = add nsw i32 %17, 1
  store i32 %22, ptr @m, align 4, !tbaa !5
  %23 = sext i32 %.02737 to i64
  %24 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %23
  %25 = sext i32 %20 to i64
  %26 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %25
  tail call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %24, ptr noundef nonnull align 4 dereferenceable(4) %26) #3
  %27 = add nsw i32 %.02737, 1
  br label %39

28:                                               ; preds = %.lr.ph41
  %29 = add nsw i32 %.02638, -1
  %30 = sext i32 %29 to i64
  %31 = tail call noundef i64 @_Z3sqrx(i64 noundef %30)
  %32 = load i32, ptr @m, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [100100 x [2 x i32]], ptr @ans, i64 0, i64 %33
  store i32 %.02638, ptr %34, align 8, !tbaa !5
  %35 = getelementptr inbounds [100100 x [2 x i32]], ptr @ans, i64 0, i64 %33, i64 1
  store i32 1, ptr %35, align 4, !tbaa !5
  %36 = add nsw i32 %32, 1
  store i32 %36, ptr @m, align 4, !tbaa !5
  %37 = sext i32 %.02638 to i64
  %38 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %37
  tail call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %38, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @p, i64 4)) #3
  br label %39

39:                                               ; preds = %28, %13
  %.pn = phi i64 [ %16, %13 ], [ %31, %28 ]
  %.128 = phi i32 [ %27, %13 ], [ %.02737, %28 ]
  %.1 = phi i32 [ %.02638, %13 ], [ %29, %28 ]
  %.130 = add nsw i64 %.pn, %.02936
  %40 = xor i32 %.02539, 1
  %41 = load i32, ptr @m, align 4, !tbaa !5
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %43 = add nsw i32 %42, -1
  %44 = icmp slt i32 %41, %43
  br i1 %44, label %.lr.ph41, label %._crit_edge42, !llvm.loop !14

._crit_edge42:                                    ; preds = %39, %0, %._crit_edge
  %.029.lcssa = phi i64 [ 0, %._crit_edge ], [ 0, %0 ], [ %.130, %39 ]
  %45 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.029.lcssa)
  %46 = load i32, ptr @n, align 4, !tbaa !5
  %.not3344 = icmp slt i32 %46, 1
  br i1 %.not3344, label %._crit_edge48, label %.lr.ph47

._crit_edge48:                                    ; preds = %.lr.ph47, %._crit_edge42
  %47 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %48 = load i32, ptr @m, align 4, !tbaa !5
  %49 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %48)
  %50 = load i32, ptr @m, align 4, !tbaa !5
  %51 = icmp sgt i32 %50, 0
  br i1 %51, label %.lr.ph51.preheader, label %._crit_edge52

.lr.ph51.preheader:                               ; preds = %._crit_edge48
  %52 = zext nneg i32 %50 to i64
  br label %.lr.ph51

.lr.ph47:                                         ; preds = %._crit_edge42, %.lr.ph47
  %indvars.iv54 = phi i64 [ %indvars.iv.next55, %.lr.ph47 ], [ 1, %._crit_edge42 ]
  %53 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %indvars.iv54
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %54)
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %56 = load i32, ptr @n, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %.not33.not = icmp slt i64 %indvars.iv54, %57
  br i1 %.not33.not, label %.lr.ph47, label %._crit_edge48, !llvm.loop !15

._crit_edge52:                                    ; preds = %.lr.ph51, %._crit_edge48
  ret void

.lr.ph51:                                         ; preds = %.lr.ph51.preheader, %.lr.ph51
  %indvars.iv57 = phi i64 [ %52, %.lr.ph51.preheader ], [ %indvars.iv.next58, %.lr.ph51 ]
  %indvars.iv.next58 = add nsw i64 %indvars.iv57, -1
  %58 = getelementptr inbounds [100100 x [2 x i32]], ptr @ans, i64 0, i64 %indvars.iv.next58
  %59 = load i32, ptr %58, align 8, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %58, i64 4
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %59, i32 noundef %61)
  %63 = icmp ugt i64 %indvars.iv57, 1
  br i1 %63, label %.lr.ph51, label %._crit_edge52, !llvm.loop !16
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


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