; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/334 Division 2/Problem C (C)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@n = external dso_local global i32, align 4
@s = external dso_local global [100100 x i8], align 16
@l1 = external dso_local global i32, align 4
@l2 = external dso_local global i32, align 4
@m1 = external dso_local global i32, align 4
@m2 = external dso_local global i32, align 4
@c1 = external dso_local global i32, align 4
@c2 = external dso_local global i32, align 4
@cnt = 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 [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @s)
  %5 = load i8, ptr @s, align 16, !tbaa !5
  %6 = sext i8 %5 to i32
  %7 = icmp eq i32 %6, 49
  br i1 %7, label %8, label %9

8:                                                ; preds = %0
  store i32 1, ptr @l1, align 4, !tbaa !8
  br label %10

9:                                                ; preds = %0
  store i32 1, ptr @l2, align 4, !tbaa !8
  br label %10

10:                                               ; preds = %9, %8
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !8
  br label %11

11:                                               ; preds = %64, %10
  %12 = load i32, ptr %2, align 4, !tbaa !8
  %13 = load i32, ptr @n, align 4, !tbaa !8
  %14 = icmp slt i32 %12, %13
  br i1 %14, label %16, label %15

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

16:                                               ; preds = %11
  %17 = load i32, ptr %2, align 4, !tbaa !8
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [100100 x i8], ptr @s, i64 0, i64 %18
  %20 = load i8, ptr %19, align 1, !tbaa !5
  %21 = sext i8 %20 to i32
  %22 = load i32, ptr %2, align 4, !tbaa !8
  %23 = sub nsw i32 %22, 1
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [100100 x i8], ptr @s, i64 0, i64 %24
  %26 = load i8, ptr %25, align 1, !tbaa !5
  %27 = sext i8 %26 to i32
  %28 = icmp eq i32 %21, %27
  br i1 %28, label %29, label %39

29:                                               ; preds = %16
  %30 = load i32, ptr @l1, align 4, !tbaa !8
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %32, label %35

32:                                               ; preds = %29
  %33 = load i32, ptr @l1, align 4, !tbaa !8
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr @l1, align 4, !tbaa !8
  br label %38

35:                                               ; preds = %29
  %36 = load i32, ptr @l2, align 4, !tbaa !8
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr @l2, align 4, !tbaa !8
  br label %38

38:                                               ; preds = %35, %32
  br label %63

39:                                               ; preds = %16
  %40 = load i32, ptr @cnt, align 4, !tbaa !8
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr @cnt, align 4, !tbaa !8
  %42 = load i32, ptr @l1, align 4, !tbaa !8
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %44, label %53

44:                                               ; preds = %39
  %45 = load i32, ptr @l1, align 4, !tbaa !8
  %46 = icmp sgt i32 %45, 1
  br i1 %46, label %47, label %50

47:                                               ; preds = %44
  %48 = load i32, ptr @c1, align 4, !tbaa !8
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr @c1, align 4, !tbaa !8
  br label %50

50:                                               ; preds = %47, %44
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @m1, ptr noundef nonnull align 4 dereferenceable(4) @l1)
  %52 = load i32, ptr %51, align 4, !tbaa !8
  store i32 %52, ptr @m1, align 4, !tbaa !8
  store i32 0, ptr @l1, align 4, !tbaa !8
  store i32 1, ptr @l2, align 4, !tbaa !8
  br label %62

53:                                               ; preds = %39
  %54 = load i32, ptr @l2, align 4, !tbaa !8
  %55 = icmp sgt i32 %54, 1
  br i1 %55, label %56, label %59

56:                                               ; preds = %53
  %57 = load i32, ptr @c2, align 4, !tbaa !8
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr @c2, align 4, !tbaa !8
  br label %59

59:                                               ; preds = %56, %53
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @m2, ptr noundef nonnull align 4 dereferenceable(4) @l2)
  %61 = load i32, ptr %60, align 4, !tbaa !8
  store i32 %61, ptr @m2, align 4, !tbaa !8
  store i32 1, ptr @l1, align 4, !tbaa !8
  store i32 0, ptr @l2, align 4, !tbaa !8
  br label %62

62:                                               ; preds = %59, %50
  br label %63

63:                                               ; preds = %62, %38
  br label %64

64:                                               ; preds = %63
  %65 = load i32, ptr %2, align 4, !tbaa !8
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %2, align 4, !tbaa !8
  br label %11, !llvm.loop !10

67:                                               ; preds = %15
  %68 = load i32, ptr @l1, align 4, !tbaa !8
  %69 = icmp sgt i32 %68, 1
  br i1 %69, label %70, label %73

70:                                               ; preds = %67
  %71 = load i32, ptr @c1, align 4, !tbaa !8
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr @c1, align 4, !tbaa !8
  br label %73

73:                                               ; preds = %70, %67
  %74 = load i32, ptr @l2, align 4, !tbaa !8
  %75 = icmp sgt i32 %74, 1
  br i1 %75, label %76, label %79

76:                                               ; preds = %73
  %77 = load i32, ptr @c2, align 4, !tbaa !8
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr @c2, align 4, !tbaa !8
  br label %79

79:                                               ; preds = %76, %73
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @m1, ptr noundef nonnull align 4 dereferenceable(4) @l1)
  %81 = load i32, ptr %80, align 4, !tbaa !8
  store i32 %81, ptr @m1, align 4, !tbaa !8
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @m2, ptr noundef nonnull align 4 dereferenceable(4) @l2)
  %83 = load i32, ptr %82, align 4, !tbaa !8
  store i32 %83, ptr @m2, align 4, !tbaa !8
  %84 = load i32, ptr @m1, align 4, !tbaa !8
  %85 = icmp sgt i32 %84, 2
  br i1 %85, label %89, label %86

86:                                               ; preds = %79
  %87 = load i32, ptr @m2, align 4, !tbaa !8
  %88 = icmp sgt i32 %87, 2
  br i1 %88, label %89, label %92

89:                                               ; preds = %86, %79
  %90 = load i32, ptr @cnt, align 4, !tbaa !8
  %91 = add nsw i32 %90, 2
  store i32 %91, ptr @cnt, align 4, !tbaa !8
  br label %122

92:                                               ; preds = %86
  %93 = load i32, ptr @m1, align 4, !tbaa !8
  %94 = icmp sgt i32 %93, 1
  br i1 %94, label %95, label %101

95:                                               ; preds = %92
  %96 = load i32, ptr @m2, align 4, !tbaa !8
  %97 = icmp sgt i32 %96, 1
  br i1 %97, label %98, label %101

98:                                               ; preds = %95
  %99 = load i32, ptr @cnt, align 4, !tbaa !8
  %100 = add nsw i32 %99, 2
  store i32 %100, ptr @cnt, align 4, !tbaa !8
  br label %121

101:                                              ; preds = %95, %92
  %102 = load i32, ptr @c1, align 4, !tbaa !8
  %103 = icmp sgt i32 %102, 1
  br i1 %103, label %107, label %104

104:                                              ; preds = %101
  %105 = load i32, ptr @c2, align 4, !tbaa !8
  %106 = icmp sgt i32 %105, 1
  br i1 %106, label %107, label %110

107:                                              ; preds = %104, %101
  %108 = load i32, ptr @cnt, align 4, !tbaa !8
  %109 = add nsw i32 %108, 2
  store i32 %109, ptr @cnt, align 4, !tbaa !8
  br label %120

110:                                              ; preds = %104
  %111 = load i32, ptr @c1, align 4, !tbaa !8
  %112 = icmp eq i32 %111, 1
  br i1 %112, label %116, label %113

113:                                              ; preds = %110
  %114 = load i32, ptr @c2, align 4, !tbaa !8
  %115 = icmp eq i32 %114, 1
  br i1 %115, label %116, label %119

116:                                              ; preds = %113, %110
  %117 = load i32, ptr @cnt, align 4, !tbaa !8
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr @cnt, align 4, !tbaa !8
  br label %119

119:                                              ; preds = %116, %113
  br label %120

120:                                              ; preds = %119, %107
  br label %121

121:                                              ; preds = %120, %98
  br label %122

122:                                              ; preds = %121, %89
  %123 = load i32, ptr @cnt, align 4, !tbaa !8
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %123)
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %124, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0
}

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

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

; Function Attrs: 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)) #3

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { inlinehint 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 #6 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@n = external dso_local global i32, align 4
@s = external dso_local global [100100 x i8], align 16
@l1 = external dso_local global i32, align 4
@l2 = external dso_local global i32, align 4
@m1 = external dso_local global i32, align 4
@m2 = external dso_local global i32, align 4
@c1 = external dso_local local_unnamed_addr global i32, align 4
@c2 = external dso_local local_unnamed_addr global i32, align 4
@cnt = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @s)
  %3 = load i8, ptr @s, align 16, !tbaa !5
  %4 = icmp eq i8 %3, 49
  %l1.l2 = select i1 %4, ptr @l1, ptr @l2
  store i32 1, ptr %l1.l2, align 4, !tbaa !8
  %5 = load i32, ptr @n, align 4, !tbaa !8
  %6 = icmp sgt i32 %5, 1
  br i1 %6, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre = load i32, ptr @l1, align 4, !tbaa !8
  br label %._crit_edge

._crit_edge:                                      ; preds = %44, %.._crit_edge_crit_edge
  %7 = phi i32 [ %.pre, %.._crit_edge_crit_edge ], [ %45, %44 ]
  %8 = icmp sgt i32 %7, 1
  br i1 %8, label %49, label %52

.lr.ph:                                           ; preds = %0, %44
  %indvars.iv = phi i64 [ %indvars.iv.next, %44 ], [ 1, %0 ]
  %9 = getelementptr inbounds [100100 x i8], ptr @s, i64 0, i64 %indvars.iv
  %10 = load i8, ptr %9, align 1, !tbaa !5
  %11 = add nsw i64 %indvars.iv, -1
  %12 = getelementptr inbounds [100100 x i8], ptr @s, i64 0, i64 %11
  %13 = load i8, ptr %12, align 1, !tbaa !5
  %14 = icmp eq i8 %10, %13
  br i1 %14, label %15, label %23

15:                                               ; preds = %.lr.ph
  %16 = load i32, ptr @l1, align 4, !tbaa !8
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %18, label %20

18:                                               ; preds = %15
  %19 = add nuw nsw i32 %16, 1
  store i32 %19, ptr @l1, align 4, !tbaa !8
  br label %44

20:                                               ; preds = %15
  %21 = load i32, ptr @l2, align 4, !tbaa !8
  %22 = add nsw i32 %21, 1
  store i32 %22, ptr @l2, align 4, !tbaa !8
  br label %44

23:                                               ; preds = %.lr.ph
  %24 = load i32, ptr @cnt, align 4, !tbaa !8
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr @cnt, align 4, !tbaa !8
  %26 = load i32, ptr @l1, align 4, !tbaa !8
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %28, label %35

28:                                               ; preds = %23
  %.not = icmp eq i32 %26, 1
  br i1 %.not, label %32, label %29

29:                                               ; preds = %28
  %30 = load i32, ptr @c1, align 4, !tbaa !8
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr @c1, align 4, !tbaa !8
  br label %32

32:                                               ; preds = %29, %28
  %33 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @m1, ptr noundef nonnull align 4 dereferenceable(4) @l1)
  %34 = load i32, ptr %33, align 4, !tbaa !8
  store i32 %34, ptr @m1, align 4, !tbaa !8
  store i32 0, ptr @l1, align 4, !tbaa !8
  store i32 1, ptr @l2, align 4, !tbaa !8
  br label %44

35:                                               ; preds = %23
  %36 = load i32, ptr @l2, align 4, !tbaa !8
  %37 = icmp sgt i32 %36, 1
  br i1 %37, label %38, label %41

38:                                               ; preds = %35
  %39 = load i32, ptr @c2, align 4, !tbaa !8
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr @c2, align 4, !tbaa !8
  br label %41

41:                                               ; preds = %38, %35
  %42 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @m2, ptr noundef nonnull align 4 dereferenceable(4) @l2)
  %43 = load i32, ptr %42, align 4, !tbaa !8
  store i32 %43, ptr @m2, align 4, !tbaa !8
  store i32 1, ptr @l1, align 4, !tbaa !8
  store i32 0, ptr @l2, align 4, !tbaa !8
  br label %44

44:                                               ; preds = %20, %18, %41, %32
  %45 = phi i32 [ %16, %20 ], [ %19, %18 ], [ 1, %41 ], [ 0, %32 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %46 = load i32, ptr @n, align 4, !tbaa !8
  %47 = sext i32 %46 to i64
  %48 = icmp slt i64 %indvars.iv.next, %47
  br i1 %48, label %.lr.ph, label %._crit_edge, !llvm.loop !10

49:                                               ; preds = %._crit_edge
  %50 = load i32, ptr @c1, align 4, !tbaa !8
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr @c1, align 4, !tbaa !8
  br label %52

52:                                               ; preds = %49, %._crit_edge
  %53 = load i32, ptr @l2, align 4, !tbaa !8
  %54 = icmp sgt i32 %53, 1
  br i1 %54, label %55, label %58

55:                                               ; preds = %52
  %56 = load i32, ptr @c2, align 4, !tbaa !8
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr @c2, align 4, !tbaa !8
  br label %58

58:                                               ; preds = %55, %52
  %59 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @m1, ptr noundef nonnull align 4 dereferenceable(4) @l1)
  %60 = load i32, ptr %59, align 4, !tbaa !8
  store i32 %60, ptr @m1, align 4, !tbaa !8
  %61 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @m2, ptr noundef nonnull align 4 dereferenceable(4) @l2)
  %62 = load i32, ptr %61, align 4, !tbaa !8
  store i32 %62, ptr @m2, align 4, !tbaa !8
  %63 = load i32, ptr @m1, align 4, !tbaa !8
  %64 = icmp sgt i32 %63, 2
  %65 = icmp sgt i32 %62, 2
  %or.cond = select i1 %64, i1 true, i1 %65
  br i1 %or.cond, label %66, label %69

66:                                               ; preds = %58
  %67 = load i32, ptr @cnt, align 4, !tbaa !8
  %68 = add nsw i32 %67, 2
  br label %.sink.split

69:                                               ; preds = %58
  %70 = icmp sgt i32 %63, 1
  %71 = icmp sgt i32 %62, 1
  %or.cond3 = select i1 %70, i1 %71, i1 false
  br i1 %or.cond3, label %72, label %75

72:                                               ; preds = %69
  %73 = load i32, ptr @cnt, align 4, !tbaa !8
  %74 = add nsw i32 %73, 2
  br label %.sink.split

75:                                               ; preds = %69
  %76 = load i32, ptr @c1, align 4, !tbaa !8
  %77 = icmp sgt i32 %76, 1
  %78 = load i32, ptr @c2, align 4
  %79 = icmp sgt i32 %78, 1
  %or.cond5 = select i1 %77, i1 true, i1 %79
  br i1 %or.cond5, label %80, label %83

80:                                               ; preds = %75
  %81 = load i32, ptr @cnt, align 4, !tbaa !8
  %82 = add nsw i32 %81, 2
  br label %.sink.split

83:                                               ; preds = %75
  %84 = icmp eq i32 %76, 1
  %85 = icmp eq i32 %78, 1
  %or.cond7 = select i1 %84, i1 true, i1 %85
  %.pre19 = load i32, ptr @cnt, align 4, !tbaa !8
  br i1 %or.cond7, label %86, label %88

86:                                               ; preds = %83
  %87 = add nsw i32 %.pre19, 1
  br label %.sink.split

.sink.split:                                      ; preds = %66, %80, %86, %72
  %.sink = phi i32 [ %74, %72 ], [ %87, %86 ], [ %82, %80 ], [ %68, %66 ]
  store i32 %.sink, ptr @cnt, align 4, !tbaa !8
  br label %88

88:                                               ; preds = %.sink.split, %83
  %89 = phi i32 [ %.pre19, %83 ], [ %.sink, %.sink.split ]
  %90 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %89)
  %91 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %90, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0
}

; 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 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 #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { "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 = { 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 #5 = { inlinehint 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" }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass