; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/ASC/1/Problem H (H)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@p = external dso_local global %"class.std::vector", align 8
@ok = external dso_local global [33333 x i32], align 16
@a = external dso_local global [101 x [101 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5gaussii(i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %11 = load ptr, ptr @stdin, align 8, !tbaa !5
  %12 = call ptr @freopen(ptr noundef @.str.3, ptr noundef @.str.4, ptr noundef %11)
  %13 = load ptr, ptr @stdout, align 8, !tbaa !5
  %14 = call ptr @freopen(ptr noundef @.str.5, ptr noundef @.str.6, ptr noundef %13)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 2, ptr %2, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %23, %0
  %16 = load i32, ptr %2, align 4, !tbaa !9
  %17 = icmp slt i32 %16, 33333
  br i1 %17, label %19, label %18

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

19:                                               ; preds = %15
  %20 = load i32, ptr %2, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [33333 x i32], ptr @ok, i64 0, i64 %21
  store i32 1, ptr %22, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %19
  %24 = load i32, ptr %2, align 4, !tbaa !9
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %2, align 4, !tbaa !9
  br label %15, !llvm.loop !11

26:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 2, ptr %3, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %55, %26
  %28 = load i32, ptr %3, align 4, !tbaa !9
  %29 = icmp slt i32 %28, 33333
  br i1 %29, label %31, label %30

30:                                               ; preds = %27
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %58

31:                                               ; preds = %27
  %32 = load i32, ptr %3, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [33333 x i32], ptr @ok, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !9
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %38, label %37

37:                                               ; preds = %31
  br label %55

38:                                               ; preds = %31
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @p, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %39 = load i32, ptr %3, align 4, !tbaa !9
  %40 = load i32, ptr %3, align 4, !tbaa !9
  %41 = mul nsw i32 %39, %40
  store i32 %41, ptr %5, align 4, !tbaa !9
  br label %42

42:                                               ; preds = %50, %38
  %43 = load i32, ptr %5, align 4, !tbaa !9
  %44 = icmp slt i32 %43, 33333
  br i1 %44, label %46, label %45

45:                                               ; preds = %42
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %54

46:                                               ; preds = %42
  %47 = load i32, ptr %5, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [33333 x i32], ptr @ok, i64 0, i64 %48
  store i32 0, ptr %49, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %46
  %51 = load i32, ptr %3, align 4, !tbaa !9
  %52 = load i32, ptr %5, align 4, !tbaa !9
  %53 = add nsw i32 %52, %51
  store i32 %53, ptr %5, align 4, !tbaa !9
  br label %42, !llvm.loop !13

54:                                               ; preds = %45
  br label %55

55:                                               ; preds = %54, %37
  %56 = load i32, ptr %3, align 4, !tbaa !9
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %3, align 4, !tbaa !9
  br label %27, !llvm.loop !14

58:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %59 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.7, ptr noundef %6, ptr noundef %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %60

60:                                               ; preds = %101, %58
  %61 = load i32, ptr %8, align 4, !tbaa !9
  %62 = load i32, ptr %7, align 4, !tbaa !9
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %104

65:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %66 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %9)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %67

67:                                               ; preds = %97, %65
  %68 = load i32, ptr %10, align 4, !tbaa !9
  %69 = load i32, ptr %6, align 4, !tbaa !9
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %67
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %100

72:                                               ; preds = %67
  br label %73

73:                                               ; preds = %81, %72
  %74 = load i32, ptr %9, align 4, !tbaa !9
  %75 = load i32, ptr %10, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @p, i64 noundef %76) #5
  %78 = load i32, ptr %77, align 4, !tbaa !9
  %79 = srem i32 %74, %78
  %80 = icmp eq i32 %79, 0
  br i1 %80, label %81, label %96

81:                                               ; preds = %73
  %82 = load i32, ptr %10, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @p, i64 noundef %83) #5
  %85 = load i32, ptr %84, align 4, !tbaa !9
  %86 = load i32, ptr %9, align 4, !tbaa !9
  %87 = sdiv i32 %86, %85
  store i32 %87, ptr %9, align 4, !tbaa !9
  %88 = load i32, ptr %10, align 4, !tbaa !9
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %89
  %91 = load i32, ptr %8, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [101 x i32], ptr %90, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !9
  %95 = xor i32 %94, 1
  store i32 %95, ptr %93, align 4, !tbaa !9
  br label %73, !llvm.loop !15

96:                                               ; preds = %73
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %10, align 4, !tbaa !9
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %10, align 4, !tbaa !9
  br label %67, !llvm.loop !16

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

101:                                              ; preds = %100
  %102 = load i32, ptr %8, align 4, !tbaa !9
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %8, align 4, !tbaa !9
  br label %60, !llvm.loop !17

104:                                              ; preds = %64
  %105 = load i32, ptr %6, align 4, !tbaa !9
  %106 = load i32, ptr %7, align 4, !tbaa !9
  call void @_Z5gaussii(i32 noundef %105, i32 noundef %106)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %107 = load i32, ptr %1, align 4
  ret i32 %107
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #4

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { "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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@p = external dso_local global %"class.std::vector", align 8
@ok = external dso_local local_unnamed_addr global [33333 x i32], align 16
@a = external dso_local local_unnamed_addr global [101 x [101 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5gaussii(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
vector.ph:
  %0 = alloca i32, align 4
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = load ptr, ptr @stdin, align 8, !tbaa !5
  %5 = tail call ptr @freopen(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, ptr noundef %4)
  %6 = load ptr, ptr @stdout, align 8, !tbaa !5
  %7 = tail call ptr @freopen(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, ptr noundef %6)
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next.1, %vector.body ]
  %offset.idx = or disjoint i64 %index, 2
  %8 = getelementptr inbounds [33333 x i32], ptr @ok, i64 0, i64 %offset.idx
  %9 = getelementptr inbounds i8, ptr %8, i64 16
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %8, align 8, !tbaa !9
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %9, align 8, !tbaa !9
  %offset.idx.1 = or disjoint i64 %index, 10
  %10 = getelementptr inbounds [33333 x i32], ptr @ok, i64 0, i64 %offset.idx.1
  %11 = getelementptr inbounds i8, ptr %10, i64 16
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %10, align 8, !tbaa !9
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %11, align 8, !tbaa !9
  %index.next.1 = add nuw nsw i64 %index, 16
  %12 = icmp eq i64 %index.next.1, 33328
  br i1 %12, label %scalar.ph, label %vector.body, !llvm.loop !11

scalar.ph:                                        ; preds = %vector.body
  store i32 1, ptr getelementptr inbounds (i8, ptr @ok, i64 133320), align 8, !tbaa !9
  store i32 1, ptr getelementptr inbounds (i8, ptr @ok, i64 133324), align 4, !tbaa !9
  store i32 1, ptr getelementptr inbounds (i8, ptr @ok, i64 133328), align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %0) #7
  store i32 2, ptr %0, align 4, !tbaa !9
  br label %17

13:                                               ; preds = %.loopexit
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %0) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %15 = load i32, ptr %2, align 4, !tbaa !9
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph28, label %.._crit_edge29_crit_edge

.._crit_edge29_crit_edge:                         ; preds = %13
  %.pre = load i32, ptr %1, align 4, !tbaa !9
  br label %._crit_edge29

17:                                               ; preds = %scalar.ph, %.loopexit
  %storemerge22 = phi i32 [ 2, %scalar.ph ], [ %40, %.loopexit ]
  %18 = sext i32 %storemerge22 to i64
  %19 = getelementptr inbounds [33333 x i32], ptr @ok, i64 0, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !9
  %.not = icmp eq i32 %20, 0
  br i1 %.not, label %.loopexit, label %21

21:                                               ; preds = %17
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @p, ptr noundef nonnull align 4 dereferenceable(4) %0)
  %22 = load i32, ptr %0, align 4, !tbaa !9
  %23 = mul nsw i32 %22, %22
  %24 = icmp ult i32 %23, 33333
  br i1 %24, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %21
  %25 = zext nneg i32 %23 to i64
  %26 = sext i32 %22 to i64
  %27 = add nsw i64 %26, %25
  %smax = call i64 @llvm.smax.i64(i64 %27, i64 33333)
  %28 = icmp slt i64 %27, 33333
  %umin.neg = sext i1 %28 to i64
  %29 = select i1 %28, i64 2, i64 1
  %30 = add i64 %smax, %umin.neg
  %31 = sub i64 %30, %27
  %32 = udiv i64 %31, %26
  %33 = add i64 %29, %32
  %min.iters.check = icmp ugt i64 %33, 7
  %ident.check.not = icmp eq i32 %22, 1
  %or.cond = and i1 %min.iters.check, %ident.check.not
  br i1 %or.cond, label %vector.ph49, label %.lr.ph.preheader59

vector.ph49:                                      ; preds = %.lr.ph.preheader
  %n.vec = and i64 %33, -8
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body51

vector.body51:                                    ; preds = %vector.body51, %vector.ph49
  %index52 = phi i64 [ 0, %vector.ph49 ], [ %index.next54, %vector.body51 ]
  %offset.idx53 = or disjoint i64 %index52, 1
  %34 = getelementptr inbounds [33333 x i32], ptr @ok, i64 0, i64 %offset.idx53
  %35 = getelementptr inbounds i8, ptr %34, i64 16
  store <4 x i32> zeroinitializer, ptr %34, align 4, !tbaa !9
  store <4 x i32> zeroinitializer, ptr %35, align 4, !tbaa !9
  %index.next54 = add nuw i64 %index52, 8
  %36 = icmp eq i64 %index.next54, %n.vec
  br i1 %36, label %middle.block47, label %vector.body51, !llvm.loop !15

middle.block47:                                   ; preds = %vector.body51
  %cmp.n = icmp eq i64 %33, %n.vec
  br i1 %cmp.n, label %.loopexit, label %.lr.ph.preheader59

.lr.ph.preheader59:                               ; preds = %middle.block47, %.lr.ph.preheader
  %indvars.iv32.ph = phi i64 [ %25, %.lr.ph.preheader ], [ %ind.end, %middle.block47 ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader59, %.lr.ph
  %indvars.iv32 = phi i64 [ %indvars.iv.next33, %.lr.ph ], [ %indvars.iv32.ph, %.lr.ph.preheader59 ]
  %37 = getelementptr inbounds [33333 x i32], ptr @ok, i64 0, i64 %indvars.iv32
  store i32 0, ptr %37, align 4, !tbaa !9
  %indvars.iv.next33 = add nsw i64 %indvars.iv32, %26
  %38 = icmp slt i64 %indvars.iv.next33, 33333
  br i1 %38, label %.lr.ph, label %.loopexit, !llvm.loop !16

.loopexit:                                        ; preds = %.lr.ph, %middle.block47, %21, %17
  %39 = phi i32 [ %22, %21 ], [ %storemerge22, %17 ], [ %22, %middle.block47 ], [ %22, %.lr.ph ]
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %0, align 4, !tbaa !9
  %41 = icmp slt i32 %39, 33332
  br i1 %41, label %17, label %13, !llvm.loop !17

._crit_edge29:                                    ; preds = %._crit_edge25, %.._crit_edge29_crit_edge
  %42 = phi i32 [ %.pre, %.._crit_edge29_crit_edge ], [ %52, %._crit_edge25 ]
  %.lcssa = phi i32 [ %15, %.._crit_edge29_crit_edge ], [ %53, %._crit_edge25 ]
  call void @_Z5gaussii(i32 noundef %42, i32 noundef %.lcssa)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

.lr.ph28:                                         ; preds = %13, %._crit_edge25
  %indvars.iv38 = phi i64 [ %indvars.iv.next39, %._crit_edge25 ], [ 0, %13 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %3)
  %44 = load i32, ptr %1, align 4, !tbaa !9
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %.preheader, label %._crit_edge25

.preheader:                                       ; preds = %.lr.ph28, %._crit_edge
  %indvars.iv35 = phi i64 [ %indvars.iv.next36, %._crit_edge ], [ 0, %.lr.ph28 ]
  %46 = load i32, ptr %3, align 4, !tbaa !9
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @p, i64 noundef %indvars.iv35) #7
  %48 = load i32, ptr %47, align 4, !tbaa !9
  %49 = srem i32 %46, %48
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %.lr.ph23, label %._crit_edge

.lr.ph23:                                         ; preds = %.preheader
  %51 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %indvars.iv35, i64 %indvars.iv38
  br label %56

._crit_edge25:                                    ; preds = %._crit_edge, %.lr.ph28
  %52 = phi i32 [ %44, %.lr.ph28 ], [ %67, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1
  %53 = load i32, ptr %2, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = icmp slt i64 %indvars.iv.next39, %54
  br i1 %55, label %.lr.ph28, label %._crit_edge29, !llvm.loop !18

56:                                               ; preds = %.lr.ph23, %56
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @p, i64 noundef %indvars.iv35) #7
  %58 = load i32, ptr %57, align 4, !tbaa !9
  %59 = load i32, ptr %3, align 4, !tbaa !9
  %60 = sdiv i32 %59, %58
  store i32 %60, ptr %3, align 4, !tbaa !9
  %61 = load i32, ptr %51, align 4, !tbaa !9
  %62 = xor i32 %61, 1
  store i32 %62, ptr %51, align 4, !tbaa !9
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @p, i64 noundef %indvars.iv35) #7
  %64 = load i32, ptr %63, align 4, !tbaa !9
  %65 = srem i32 %60, %64
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %56, label %._crit_edge, !llvm.loop !19

._crit_edge:                                      ; preds = %56, %.preheader
  %indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1
  %67 = load i32, ptr %1, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = icmp slt i64 %indvars.iv.next36, %68
  br i1 %69, label %.preheader, label %._crit_edge25, !llvm.loop !20
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { "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 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12, !13, !14}
!16 = distinct !{!16, !12, !13}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}


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