; LLVM IR from reyadussalahin/problem-solving :: CONTEST/random_contest/Y2019/practice_for_preli/FBullsCowsAndDigits (Solution)

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

@bull = external dso_local global i32, align 4
@cow = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z4findPii(ptr noundef %0, i32 noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca [16 x i32], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 64, ptr %6) #6
  call void @llvm.memset.p0.i64(ptr align 16 %6, i8 0, i64 64, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %16

16:                                               ; preds = %71, %2
  %17 = load i32, ptr %7, align 4, !tbaa !9
  %18 = icmp slt i32 %17, 5
  br i1 %18, label %20, label %19

19:                                               ; preds = %16
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %74

20:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %21

21:                                               ; preds = %35, %20
  %22 = load i32, ptr %10, align 4, !tbaa !9
  %23 = icmp slt i32 %22, 5
  br i1 %23, label %25, label %24

24:                                               ; preds = %21
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %38

25:                                               ; preds = %21
  %26 = load i32, ptr %10, align 4, !tbaa !9
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = icmp eq i32 %26, %27
  br i1 %28, label %29, label %30

29:                                               ; preds = %25
  br label %35

30:                                               ; preds = %25
  %31 = load i32, ptr %5, align 4, !tbaa !9
  %32 = load i32, ptr %10, align 4, !tbaa !9
  %33 = add nsw i32 %31, %32
  %34 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %33)
  br label %35

35:                                               ; preds = %30, %29
  %36 = load i32, ptr %10, align 4, !tbaa !9
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %10, align 4, !tbaa !9
  br label %21, !llvm.loop !11

38:                                               ; preds = %24
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %40 = load ptr, ptr @stdout, align 8, !tbaa !5
  %41 = call i32 @fflush(ptr noundef %40)
  %42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @bull, ptr noundef @cow)
  %43 = load i32, ptr @bull, align 4, !tbaa !9
  %44 = icmp eq i32 %43, 4
  br i1 %44, label %45, label %46

45:                                               ; preds = %38
  call void @exit(i32 noundef 0) #7
  unreachable

46:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %67, %46
  %48 = load i32, ptr %11, align 4, !tbaa !9
  %49 = icmp slt i32 %48, 5
  br i1 %49, label %51, label %50

50:                                               ; preds = %47
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %70

51:                                               ; preds = %47
  %52 = load i32, ptr %11, align 4, !tbaa !9
  %53 = load i32, ptr %7, align 4, !tbaa !9
  %54 = icmp eq i32 %52, %53
  br i1 %54, label %55, label %56

55:                                               ; preds = %51
  br label %67

56:                                               ; preds = %51
  %57 = load i32, ptr @bull, align 4, !tbaa !9
  %58 = load i32, ptr @cow, align 4, !tbaa !9
  %59 = add nsw i32 %57, %58
  %60 = load i32, ptr %5, align 4, !tbaa !9
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = add nsw i32 %60, %61
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [16 x i32], ptr %6, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !9
  %66 = add nsw i32 %65, %59
  store i32 %66, ptr %64, align 4, !tbaa !9
  br label %67

67:                                               ; preds = %56, %55
  %68 = load i32, ptr %11, align 4, !tbaa !9
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %11, align 4, !tbaa !9
  br label %47, !llvm.loop !13

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

71:                                               ; preds = %70
  %72 = load i32, ptr %7, align 4, !tbaa !9
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %7, align 4, !tbaa !9
  br label %16, !llvm.loop !14

74:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 -1, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %75

75:                                               ; preds = %87, %74
  %76 = load i32, ptr %14, align 4, !tbaa !9
  %77 = icmp slt i32 %76, 5
  br i1 %77, label %79, label %78

78:                                               ; preds = %75
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %90

79:                                               ; preds = %75
  %80 = load i32, ptr %5, align 4, !tbaa !9
  %81 = load i32, ptr %14, align 4, !tbaa !9
  %82 = add nsw i32 %80, %81
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [16 x i32], ptr %6, i64 0, i64 %83
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %84)
  %86 = load i32, ptr %85, align 4, !tbaa !9
  store i32 %86, ptr %12, align 4, !tbaa !9
  br label %87

87:                                               ; preds = %79
  %88 = load i32, ptr %14, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %14, align 4, !tbaa !9
  br label %75, !llvm.loop !15

90:                                               ; preds = %78
  %91 = load i32, ptr %12, align 4, !tbaa !9
  %92 = icmp sle i32 %91, 0
  br i1 %92, label %93, label %94

93:                                               ; preds = %90
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %123

94:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %95

95:                                               ; preds = %118, %94
  %96 = load i32, ptr %15, align 4, !tbaa !9
  %97 = icmp slt i32 %96, 5
  br i1 %97, label %99, label %98

98:                                               ; preds = %95
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %121

99:                                               ; preds = %95
  %100 = load i32, ptr %5, align 4, !tbaa !9
  %101 = load i32, ptr %15, align 4, !tbaa !9
  %102 = add nsw i32 %100, %101
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [16 x i32], ptr %6, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !9
  %106 = load i32, ptr %12, align 4, !tbaa !9
  %107 = icmp eq i32 %105, %106
  br i1 %107, label %108, label %117

108:                                              ; preds = %99
  %109 = load i32, ptr %5, align 4, !tbaa !9
  %110 = load i32, ptr %15, align 4, !tbaa !9
  %111 = add nsw i32 %109, %110
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = load i32, ptr %13, align 4, !tbaa !9
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %13, align 4, !tbaa !9
  %115 = sext i32 %113 to i64
  %116 = getelementptr inbounds i32, ptr %112, i64 %115
  store i32 %111, ptr %116, align 4, !tbaa !9
  br label %117

117:                                              ; preds = %108, %99
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %15, align 4, !tbaa !9
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %15, align 4, !tbaa !9
  br label %95, !llvm.loop !16

121:                                              ; preds = %98
  %122 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %122, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %123

123:                                              ; preds = %121, %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %6) #6
  %124 = load i32, ptr %3, align 4
  ret i32 %124
}

; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

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

declare i32 @fflush(ptr noundef) #3

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #4

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

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { noreturn 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { noreturn 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}


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

@bull = external dso_local global i32, align 4
@cow = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_Z4findPii(ptr nocapture noundef writeonly %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = alloca [16 x i32], align 16
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %3, i8 0, i64 64, i1 false)
  %5 = sext i32 %1 to i64
  %6 = add nsw i32 %1, 1
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %6)
  %8 = add nsw i32 %1, 2
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8)
  %10 = add nsw i32 %1, 3
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %10)
  %12 = add nsw i32 %1, 4
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %12)
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %15 = load ptr, ptr @stdout, align 8, !tbaa !5
  %16 = tail call i32 @fflush(ptr noundef %15)
  %17 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @bull, ptr noundef nonnull @cow)
  %18 = load i32, ptr @bull, align 4, !tbaa !9
  %19 = icmp eq i32 %18, 4
  br i1 %19, label %.loopexit49, label %20

20:                                               ; preds = %2
  %21 = load i32, ptr @cow, align 4
  %22 = add nsw i32 %21, %18
  %23 = add nsw i64 %5, 1
  %24 = getelementptr inbounds [16 x i32], ptr %3, i64 0, i64 %23
  %25 = load <4 x i32>, ptr %24, align 4, !tbaa !9
  %26 = insertelement <4 x i32> poison, i32 %22, i64 0
  %27 = shufflevector <4 x i32> %26, <4 x i32> poison, <4 x i32> zeroinitializer
  %28 = add nsw <4 x i32> %27, %25
  store <4 x i32> %28, ptr %24, align 4, !tbaa !9
  %29 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
  %30 = add nsw i32 %1, 2
  %31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %30)
  %32 = add nsw i32 %1, 3
  %33 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %32)
  %34 = add nsw i32 %1, 4
  %35 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %34)
  %36 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %37 = load ptr, ptr @stdout, align 8, !tbaa !5
  %38 = tail call i32 @fflush(ptr noundef %37)
  %39 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @bull, ptr noundef nonnull @cow)
  %40 = load i32, ptr @bull, align 4, !tbaa !9
  %41 = icmp eq i32 %40, 4
  br i1 %41, label %.loopexit49, label %.preheader34.peel.next43

.preheader34.peel.next43:                         ; preds = %20
  %42 = load i32, ptr @cow, align 4
  %43 = add nsw i32 %42, %40
  %44 = getelementptr inbounds [16 x i32], ptr %3, i64 0, i64 %5
  %45 = load i32, ptr %44, align 4, !tbaa !9
  %46 = add nsw i32 %43, %45
  store i32 %46, ptr %44, align 4, !tbaa !9
  %47 = add nsw i64 %5, 2
  %48 = getelementptr inbounds [16 x i32], ptr %3, i64 0, i64 %47
  %49 = load <2 x i32>, ptr %48, align 4, !tbaa !9
  %50 = insertelement <2 x i32> poison, i32 %43, i64 0
  %51 = shufflevector <2 x i32> %50, <2 x i32> poison, <2 x i32> zeroinitializer
  %52 = add nsw <2 x i32> %51, %49
  store <2 x i32> %52, ptr %48, align 4, !tbaa !9
  %53 = add nsw i64 %5, 4
  %54 = getelementptr inbounds [16 x i32], ptr %3, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !9
  %56 = add nsw i32 %43, %55
  store i32 %56, ptr %54, align 4, !tbaa !9
  %57 = add nsw i32 %1, 1
  %58 = add nsw i32 %1, 2
  %59 = add nsw i32 %1, 3
  %60 = add nsw i32 %1, 3
  %61 = add nsw i32 %1, 4
  %62 = getelementptr inbounds [16 x i32], ptr %3, i64 0, i64 %5
  %63 = add nsw i64 %5, 2
  %64 = getelementptr inbounds [16 x i32], ptr %3, i64 0, i64 %63
  %65 = add nsw i64 %5, 3
  %66 = getelementptr inbounds [16 x i32], ptr %3, i64 0, i64 %65
  %67 = add nsw i64 %5, 4
  %68 = getelementptr inbounds [16 x i32], ptr %3, i64 0, i64 %67
  %69 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
  %70 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %57)
  %71 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %60)
  %72 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %61)
  %73 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %74 = load ptr, ptr @stdout, align 8, !tbaa !5
  %75 = tail call i32 @fflush(ptr noundef %74)
  %76 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @bull, ptr noundef nonnull @cow)
  %77 = load i32, ptr @bull, align 4, !tbaa !9
  %78 = icmp eq i32 %77, 4
  br i1 %78, label %.loopexit49, label %.thread76.1

.loopexit49:                                      ; preds = %.preheader34.peel.next43, %.thread76.1, %99, %20, %2
  tail call void @exit(i32 noundef 0) #7
  unreachable

.thread76.1:                                      ; preds = %.preheader34.peel.next43
  %79 = load i32, ptr @cow, align 4
  %80 = add nsw i32 %79, %77
  %81 = load <2 x i32>, ptr %62, align 4, !tbaa !9
  %82 = insertelement <2 x i32> poison, i32 %80, i64 0
  %83 = shufflevector <2 x i32> %82, <2 x i32> poison, <2 x i32> zeroinitializer
  %84 = add nsw <2 x i32> %83, %81
  store <2 x i32> %84, ptr %62, align 4, !tbaa !9
  %85 = load i32, ptr %66, align 4, !tbaa !9
  %86 = add nsw i32 %80, %85
  store i32 %86, ptr %66, align 4, !tbaa !9
  %87 = load i32, ptr %68, align 4, !tbaa !9
  %88 = add nsw i32 %80, %87
  store i32 %88, ptr %68, align 4, !tbaa !9
  %89 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
  %90 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %57)
  %91 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %58)
  %92 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %61)
  %93 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %94 = load ptr, ptr @stdout, align 8, !tbaa !5
  %95 = tail call i32 @fflush(ptr noundef %94)
  %96 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @bull, ptr noundef nonnull @cow)
  %97 = load i32, ptr @bull, align 4, !tbaa !9
  %98 = icmp eq i32 %97, 4
  br i1 %98, label %.loopexit49, label %99

99:                                               ; preds = %.thread76.1
  %100 = load i32, ptr @cow, align 4
  %101 = add nsw i32 %100, %97
  %102 = load <2 x i32>, ptr %62, align 4, !tbaa !9
  %103 = insertelement <2 x i32> poison, i32 %101, i64 0
  %104 = shufflevector <2 x i32> %103, <2 x i32> poison, <2 x i32> zeroinitializer
  %105 = add nsw <2 x i32> %104, %102
  store <2 x i32> %105, ptr %62, align 4, !tbaa !9
  %106 = load i32, ptr %64, align 4, !tbaa !9
  %107 = add nsw i32 %101, %106
  store i32 %107, ptr %64, align 4, !tbaa !9
  %108 = load i32, ptr %68, align 4, !tbaa !9
  %109 = add nsw i32 %101, %108
  store i32 %109, ptr %68, align 4, !tbaa !9
  %110 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
  %111 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %57)
  %112 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %58)
  %113 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %59)
  %114 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %115 = load ptr, ptr @stdout, align 8, !tbaa !5
  %116 = tail call i32 @fflush(ptr noundef %115)
  %117 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @bull, ptr noundef nonnull @cow)
  %118 = load i32, ptr @bull, align 4, !tbaa !9
  %119 = icmp eq i32 %118, 4
  br i1 %119, label %.loopexit49, label %.loopexit50

.loopexit50:                                      ; preds = %99
  %120 = load i32, ptr @cow, align 4
  %121 = add nsw i32 %120, %118
  %122 = load <2 x i32>, ptr %62, align 4, !tbaa !9
  %123 = insertelement <2 x i32> poison, i32 %121, i64 0
  %124 = shufflevector <2 x i32> %123, <2 x i32> poison, <2 x i32> zeroinitializer
  %125 = add nsw <2 x i32> %124, %122
  store <2 x i32> %125, ptr %62, align 4, !tbaa !9
  %126 = load i32, ptr %64, align 4, !tbaa !9
  %127 = add nsw i32 %121, %126
  store i32 %127, ptr %64, align 4, !tbaa !9
  %128 = load i32, ptr %66, align 4, !tbaa !9
  %129 = add nsw i32 %121, %128
  store i32 %129, ptr %66, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  store i32 -1, ptr %4, align 4, !tbaa !9
  %130 = getelementptr inbounds [16 x i32], ptr %3, i64 0, i64 %5
  %131 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %130)
  %132 = load i32, ptr %131, align 4, !tbaa !9
  store i32 %132, ptr %4, align 4, !tbaa !9
  %133 = add nsw i64 %5, 1
  %134 = getelementptr inbounds [16 x i32], ptr %3, i64 0, i64 %133
  %135 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %134)
  %136 = load i32, ptr %135, align 4, !tbaa !9
  store i32 %136, ptr %4, align 4, !tbaa !9
  %137 = add nsw i64 %5, 2
  %138 = getelementptr inbounds [16 x i32], ptr %3, i64 0, i64 %137
  %139 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %138)
  %140 = load i32, ptr %139, align 4, !tbaa !9
  store i32 %140, ptr %4, align 4, !tbaa !9
  %141 = add nsw i64 %5, 3
  %142 = getelementptr inbounds [16 x i32], ptr %3, i64 0, i64 %141
  %143 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %142)
  %144 = load i32, ptr %143, align 4, !tbaa !9
  store i32 %144, ptr %4, align 4, !tbaa !9
  %145 = add nsw i64 %5, 4
  %146 = getelementptr inbounds [16 x i32], ptr %3, i64 0, i64 %145
  %147 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %146)
  %148 = load i32, ptr %147, align 4, !tbaa !9
  %149 = icmp slt i32 %148, 1
  br i1 %149, label %.loopexit, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.loopexit50
  %150 = load i32, ptr %130, align 4, !tbaa !9
  %151 = icmp eq i32 %150, %148
  br i1 %151, label %152, label %.preheader.1

152:                                              ; preds = %.preheader.preheader
  store i32 %1, ptr %0, align 4, !tbaa !9
  br label %.preheader.1

.preheader.1:                                     ; preds = %.preheader.preheader, %152
  %.1 = phi i32 [ 1, %152 ], [ 0, %.preheader.preheader ]
  %153 = load i32, ptr %134, align 4, !tbaa !9
  %154 = icmp eq i32 %153, %148
  br i1 %154, label %155, label %.preheader.2

155:                                              ; preds = %.preheader.1
  %156 = add nuw nsw i32 %.1, 1
  %157 = zext nneg i32 %.1 to i64
  %158 = getelementptr inbounds i32, ptr %0, i64 %157
  %159 = trunc nsw i64 %133 to i32
  store i32 %159, ptr %158, align 4, !tbaa !9
  br label %.preheader.2

.preheader.2:                                     ; preds = %155, %.preheader.1
  %.1.1 = phi i32 [ %156, %155 ], [ %.1, %.preheader.1 ]
  %160 = load i32, ptr %138, align 4, !tbaa !9
  %161 = icmp eq i32 %160, %148
  br i1 %161, label %162, label %.preheader.3

162:                                              ; preds = %.preheader.2
  %163 = add nuw nsw i32 %.1.1, 1
  %164 = zext nneg i32 %.1.1 to i64
  %165 = getelementptr inbounds i32, ptr %0, i64 %164
  %166 = trunc nsw i64 %137 to i32
  store i32 %166, ptr %165, align 4, !tbaa !9
  br label %.preheader.3

.preheader.3:                                     ; preds = %162, %.preheader.2
  %.1.2 = phi i32 [ %163, %162 ], [ %.1.1, %.preheader.2 ]
  %167 = load i32, ptr %142, align 4, !tbaa !9
  %168 = icmp eq i32 %167, %148
  br i1 %168, label %169, label %.preheader.4

169:                                              ; preds = %.preheader.3
  %170 = add nuw nsw i32 %.1.2, 1
  %171 = zext nneg i32 %.1.2 to i64
  %172 = getelementptr inbounds i32, ptr %0, i64 %171
  %173 = trunc nsw i64 %141 to i32
  store i32 %173, ptr %172, align 4, !tbaa !9
  br label %.preheader.4

.preheader.4:                                     ; preds = %169, %.preheader.3
  %.1.3 = phi i32 [ %170, %169 ], [ %.1.2, %.preheader.3 ]
  %174 = load i32, ptr %146, align 4, !tbaa !9
  %175 = icmp eq i32 %174, %148
  br i1 %175, label %176, label %.loopexit

176:                                              ; preds = %.preheader.4
  %177 = add nuw nsw i32 %.1.3, 1
  %178 = zext nneg i32 %.1.3 to i64
  %179 = getelementptr inbounds i32, ptr %0, i64 %178
  %180 = trunc nsw i64 %145 to i32
  store i32 %180, ptr %179, align 4, !tbaa !9
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader.4, %176, %.loopexit50
  %.031 = phi i32 [ 0, %.loopexit50 ], [ %177, %176 ], [ %.1.3, %.preheader.4 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #6
  ret i32 %.031
}

; 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 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #3

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #4

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

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { noreturn 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { noreturn 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}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass