; LLVM IR from plskz/competitive-programming :: Junior Training Sheet/A (83)

; 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_istream" = type { ptr, i64, %"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@r1 = external dso_local global i32, align 4
@r2 = external dso_local global i32, align 4
@c1 = external dso_local global i32, align 4
@c2 = external dso_local global i32, align 4
@d1 = external dso_local global i32, align 4
@d2 = external dso_local global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5checkiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %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
  store i32 0, ptr %1, align 4
  %7 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %8 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %9 = getelementptr i8, ptr %8, i64 -24
  %10 = load i64, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %10
  %12 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %11, ptr noundef null)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @r1)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) @r2)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(4) @c1)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 4 dereferenceable(4) @c2)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) @d1)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 4 dereferenceable(4) @d2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !8
  br label %19

19:                                               ; preds = %102, %0
  %20 = load i32, ptr %2, align 4, !tbaa !8
  %21 = icmp slt i32 %20, 10
  br i1 %21, label %23, label %22

22:                                               ; preds = %19
  store i32 2, ptr %3, align 4
  br label %105

23:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !8
  br label %24

24:                                               ; preds = %96, %23
  %25 = load i32, ptr %4, align 4, !tbaa !8
  %26 = icmp slt i32 %25, 10
  br i1 %26, label %28, label %27

27:                                               ; preds = %24
  store i32 5, ptr %3, align 4
  br label %99

28:                                               ; preds = %24
  %29 = load i32, ptr %4, align 4, !tbaa !8
  %30 = load i32, ptr %2, align 4, !tbaa !8
  %31 = icmp eq i32 %29, %30
  br i1 %31, label %32, label %33

32:                                               ; preds = %28
  br label %96

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 1, ptr %5, align 4, !tbaa !8
  br label %34

34:                                               ; preds = %90, %33
  %35 = load i32, ptr %5, align 4, !tbaa !8
  %36 = icmp slt i32 %35, 10
  br i1 %36, label %38, label %37

37:                                               ; preds = %34
  store i32 8, ptr %3, align 4
  br label %93

38:                                               ; preds = %34
  %39 = load i32, ptr %5, align 4, !tbaa !8
  %40 = load i32, ptr %2, align 4, !tbaa !8
  %41 = icmp eq i32 %39, %40
  br i1 %41, label %46, label %42

42:                                               ; preds = %38
  %43 = load i32, ptr %5, align 4, !tbaa !8
  %44 = load i32, ptr %4, align 4, !tbaa !8
  %45 = icmp eq i32 %43, %44
  br i1 %45, label %46, label %47

46:                                               ; preds = %42, %38
  br label %90

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !8
  br label %48

48:                                               ; preds = %84, %47
  %49 = load i32, ptr %6, align 4, !tbaa !8
  %50 = icmp slt i32 %49, 10
  br i1 %50, label %52, label %51

51:                                               ; preds = %48
  store i32 11, ptr %3, align 4
  br label %87

52:                                               ; preds = %48
  %53 = load i32, ptr %6, align 4, !tbaa !8
  %54 = load i32, ptr %2, align 4, !tbaa !8
  %55 = icmp eq i32 %53, %54
  br i1 %55, label %64, label %56

56:                                               ; preds = %52
  %57 = load i32, ptr %6, align 4, !tbaa !8
  %58 = load i32, ptr %4, align 4, !tbaa !8
  %59 = icmp eq i32 %57, %58
  br i1 %59, label %64, label %60

60:                                               ; preds = %56
  %61 = load i32, ptr %6, align 4, !tbaa !8
  %62 = load i32, ptr %5, align 4, !tbaa !8
  %63 = icmp eq i32 %61, %62
  br i1 %63, label %64, label %65

64:                                               ; preds = %60, %56, %52
  br label %84

65:                                               ; preds = %60
  %66 = load i32, ptr %2, align 4, !tbaa !8
  %67 = load i32, ptr %4, align 4, !tbaa !8
  %68 = load i32, ptr %5, align 4, !tbaa !8
  %69 = load i32, ptr %6, align 4, !tbaa !8
  %70 = call noundef zeroext i1 @_Z5checkiiii(i32 noundef %66, i32 noundef %67, i32 noundef %68, i32 noundef %69)
  br i1 %70, label %71, label %83

71:                                               ; preds = %65
  %72 = load i32, ptr %2, align 4, !tbaa !8
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %72)
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %73, i8 noundef signext 32)
  %75 = load i32, ptr %4, align 4, !tbaa !8
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %74, i32 noundef %75)
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %76, i8 noundef signext 10)
  %78 = load i32, ptr %5, align 4, !tbaa !8
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %77, i32 noundef %78)
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %79, i8 noundef signext 32)
  %81 = load i32, ptr %6, align 4, !tbaa !8
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %80, i32 noundef %81)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %87

83:                                               ; preds = %65
  br label %84

84:                                               ; preds = %83, %64
  %85 = load i32, ptr %6, align 4, !tbaa !8
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %6, align 4, !tbaa !8
  br label %48, !llvm.loop !11

87:                                               ; preds = %71, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %88 = load i32, ptr %3, align 4
  switch i32 %88, label %93 [
    i32 11, label %89
  ]

89:                                               ; preds = %87
  br label %90

90:                                               ; preds = %89, %46
  %91 = load i32, ptr %5, align 4, !tbaa !8
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %5, align 4, !tbaa !8
  br label %34, !llvm.loop !13

93:                                               ; preds = %87, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  %94 = load i32, ptr %3, align 4
  switch i32 %94, label %99 [
    i32 8, label %95
  ]

95:                                               ; preds = %93
  br label %96

96:                                               ; preds = %95, %32
  %97 = load i32, ptr %4, align 4, !tbaa !8
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %4, align 4, !tbaa !8
  br label %24, !llvm.loop !14

99:                                               ; preds = %93, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  %100 = load i32, ptr %3, align 4
  switch i32 %100, label %105 [
    i32 5, label %101
  ]

101:                                              ; preds = %99
  br label %102

102:                                              ; preds = %101
  %103 = load i32, ptr %2, align 4, !tbaa !8
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %2, align 4, !tbaa !8
  br label %19, !llvm.loop !15

105:                                              ; preds = %99, %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %106 = load i32, ptr %3, align 4
  switch i32 %106, label %111 [
    i32 2, label %107
    i32 1, label %109
  ]

107:                                              ; preds = %105
  %108 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  store i32 0, ptr %1, align 4
  br label %109

109:                                              ; preds = %107, %105
  %110 = load i32, ptr %1, align 4
  ret i32 %110

111:                                              ; preds = %105
  unreachable
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #0 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #4

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

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

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 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 #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 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !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::basic_istream" = type { ptr, i64, %"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@r1 = external dso_local global i32, align 4
@r2 = external dso_local global i32, align 4
@c1 = external dso_local global i32, align 4
@c2 = external dso_local global i32, align 4
@d1 = external dso_local global i32, align 4
@d2 = external dso_local global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5checkiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %2 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %3 = getelementptr i8, ptr %2, i64 -24
  %4 = load i64, ptr %3, align 8
  %5 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %4
  %6 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %5, ptr noundef null)
  %7 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @r1)
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) @r2)
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(4) @c1)
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(4) @c2)
  %11 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) @d1)
  %12 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(4) @d2)
  br label %.preheader57

.preheader57:                                     ; preds = %0, %129
  %.03865 = phi i32 [ 1, %0 ], [ %130, %129 ]
  %13 = icmp eq i32 %.03865, 1
  %14 = icmp eq i32 %.03865, 2
  %15 = icmp eq i32 %.03865, 3
  %16 = icmp eq i32 %.03865, 4
  %17 = icmp eq i32 %.03865, 5
  %18 = icmp eq i32 %.03865, 6
  %19 = icmp eq i32 %.03865, 7
  %20 = icmp eq i32 %.03865, 8
  %21 = icmp eq i32 %.03865, 9
  %22 = icmp eq i32 %.03865, 2
  %23 = icmp eq i32 %.03865, 3
  %24 = icmp eq i32 %.03865, 4
  %25 = icmp eq i32 %.03865, 5
  %26 = icmp eq i32 %.03865, 6
  %27 = icmp eq i32 %.03865, 7
  %28 = icmp eq i32 %.03865, 8
  %29 = icmp eq i32 %.03865, 9
  %30 = icmp eq i32 %.03865, 2
  %31 = icmp eq i32 %.03865, 3
  br label %32

32:                                               ; preds = %.preheader57, %.thread46
  %.03664 = phi i32 [ 1, %.preheader57 ], [ %128, %.thread46 ]
  %33 = icmp eq i32 %.03664, %.03865
  br i1 %33, label %.thread46, label %.preheader56.preheader

.preheader56.preheader:                           ; preds = %32
  %34 = icmp eq i32 %.03664, 1
  %or.cond.peel = or i1 %13, %34
  br i1 %or.cond.peel, label %.preheader56.peel.next, label %.preheader.1.peel

.preheader.1.peel:                                ; preds = %.preheader56.preheader
  %35 = icmp eq i32 %.03664, 2
  %or.cond43.1.peel = or i1 %14, %35
  br i1 %or.cond43.1.peel, label %.preheader.2.peel, label %36

36:                                               ; preds = %.preheader.1.peel
  %37 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 1, i32 noundef 2)
  br i1 %37, label %.loopexit, label %.preheader.2.peel

.preheader.2.peel:                                ; preds = %36, %.preheader.1.peel
  %38 = icmp eq i32 %.03664, 3
  %or.cond43.2.peel = or i1 %15, %38
  br i1 %or.cond43.2.peel, label %.preheader.3.peel, label %39

39:                                               ; preds = %.preheader.2.peel
  %40 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 1, i32 noundef 3)
  br i1 %40, label %.loopexit, label %.preheader.3.peel

.preheader.3.peel:                                ; preds = %39, %.preheader.2.peel
  %41 = icmp eq i32 %.03664, 4
  %or.cond43.3.peel = or i1 %16, %41
  br i1 %or.cond43.3.peel, label %.preheader.4.peel, label %42

42:                                               ; preds = %.preheader.3.peel
  %43 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 1, i32 noundef 4)
  br i1 %43, label %.loopexit, label %.preheader.4.peel

.preheader.4.peel:                                ; preds = %42, %.preheader.3.peel
  %44 = icmp eq i32 %.03664, 5
  %or.cond43.4.peel = or i1 %17, %44
  br i1 %or.cond43.4.peel, label %.preheader.5.peel, label %45

45:                                               ; preds = %.preheader.4.peel
  %46 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 1, i32 noundef 5)
  br i1 %46, label %.loopexit, label %.preheader.5.peel

.preheader.5.peel:                                ; preds = %45, %.preheader.4.peel
  %47 = icmp eq i32 %.03664, 6
  %or.cond43.5.peel = or i1 %18, %47
  br i1 %or.cond43.5.peel, label %.preheader.6.peel, label %48

48:                                               ; preds = %.preheader.5.peel
  %49 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 1, i32 noundef 6)
  br i1 %49, label %.loopexit, label %.preheader.6.peel

.preheader.6.peel:                                ; preds = %48, %.preheader.5.peel
  %50 = icmp eq i32 %.03664, 7
  %or.cond43.6.peel = or i1 %19, %50
  br i1 %or.cond43.6.peel, label %.preheader.7.peel, label %51

51:                                               ; preds = %.preheader.6.peel
  %52 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 1, i32 noundef 7)
  br i1 %52, label %.loopexit, label %.preheader.7.peel

.preheader.7.peel:                                ; preds = %51, %.preheader.6.peel
  %53 = icmp eq i32 %.03664, 8
  %or.cond43.7.peel = or i1 %20, %53
  br i1 %or.cond43.7.peel, label %.preheader.8.peel, label %54

54:                                               ; preds = %.preheader.7.peel
  %55 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 1, i32 noundef 8)
  br i1 %55, label %.loopexit, label %.preheader.8.peel

.preheader.8.peel:                                ; preds = %54, %.preheader.7.peel
  %56 = icmp eq i32 %.03664, 9
  %or.cond43.8.peel = or i1 %21, %56
  br i1 %or.cond43.8.peel, label %.preheader56.peel.next, label %57

57:                                               ; preds = %.preheader.8.peel
  %58 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 1, i32 noundef 9)
  br i1 %58, label %.loopexit, label %.preheader56.peel.next

.preheader56.peel.next:                           ; preds = %.preheader56.preheader, %57, %.preheader.8.peel
  %59 = icmp eq i32 %.03664, 2
  %or.cond43.1 = or i1 %22, %59
  %60 = icmp eq i32 %.03664, 3
  %or.cond43.2 = or i1 %23, %60
  %61 = icmp eq i32 %.03664, 4
  %or.cond43.3 = or i1 %24, %61
  %62 = icmp eq i32 %.03664, 5
  %or.cond43.4 = or i1 %25, %62
  %63 = icmp eq i32 %.03664, 6
  %or.cond43.5 = or i1 %26, %63
  %64 = icmp eq i32 %.03664, 7
  %or.cond43.6 = or i1 %27, %64
  %65 = icmp eq i32 %.03664, 8
  %or.cond43.7 = or i1 %28, %65
  %66 = icmp eq i32 %.03664, 9
  %or.cond43.8 = or i1 %29, %66
  %67 = icmp eq i32 %.03664, 2
  %or.cond.peel109 = or i1 %30, %67
  br i1 %or.cond.peel109, label %.preheader56.peel119, label %.preheader.preheader.peel

.preheader.preheader.peel:                        ; preds = %.preheader56.peel.next
  br i1 %or.cond.peel, label %.preheader.2.peel111, label %68

68:                                               ; preds = %.preheader.preheader.peel
  %69 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 2, i32 noundef 1)
  br i1 %69, label %.loopexit, label %.preheader.2.peel111

.preheader.2.peel111:                             ; preds = %.preheader.preheader.peel, %68
  br i1 %or.cond43.2, label %.preheader.3.peel112, label %70

70:                                               ; preds = %.preheader.2.peel111
  %71 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 2, i32 noundef 3)
  br i1 %71, label %.loopexit, label %.preheader.3.peel112

.preheader.3.peel112:                             ; preds = %70, %.preheader.2.peel111
  br i1 %or.cond43.3, label %.preheader.4.peel113, label %72

72:                                               ; preds = %.preheader.3.peel112
  %73 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 2, i32 noundef 4)
  br i1 %73, label %.loopexit, label %.preheader.4.peel113

.preheader.4.peel113:                             ; preds = %72, %.preheader.3.peel112
  br i1 %or.cond43.4, label %.preheader.5.peel114, label %74

74:                                               ; preds = %.preheader.4.peel113
  %75 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 2, i32 noundef 5)
  br i1 %75, label %.loopexit, label %.preheader.5.peel114

.preheader.5.peel114:                             ; preds = %74, %.preheader.4.peel113
  br i1 %or.cond43.5, label %.preheader.6.peel115, label %76

76:                                               ; preds = %.preheader.5.peel114
  %77 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 2, i32 noundef 6)
  br i1 %77, label %.loopexit, label %.preheader.6.peel115

.preheader.6.peel115:                             ; preds = %76, %.preheader.5.peel114
  br i1 %or.cond43.6, label %.preheader.7.peel116, label %78

78:                                               ; preds = %.preheader.6.peel115
  %79 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 2, i32 noundef 7)
  br i1 %79, label %.loopexit, label %.preheader.7.peel116

.preheader.7.peel116:                             ; preds = %78, %.preheader.6.peel115
  br i1 %or.cond43.7, label %.preheader.8.peel117, label %80

80:                                               ; preds = %.preheader.7.peel116
  %81 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 2, i32 noundef 8)
  br i1 %81, label %.loopexit, label %.preheader.8.peel117

.preheader.8.peel117:                             ; preds = %80, %.preheader.7.peel116
  br i1 %or.cond43.8, label %.preheader56.peel119, label %82

82:                                               ; preds = %.preheader.8.peel117
  %83 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 2, i32 noundef 9)
  br i1 %83, label %.loopexit, label %.preheader56.peel119

.preheader56.peel119:                             ; preds = %82, %.preheader.8.peel117, %.preheader56.peel.next
  %84 = icmp eq i32 %.03664, 3
  %or.cond.peel120 = or i1 %31, %84
  br i1 %or.cond.peel120, label %.preheader56.peel.next.peel.newph, label %.preheader.preheader.peel121

.preheader.preheader.peel121:                     ; preds = %.preheader56.peel119
  br i1 %or.cond.peel, label %.preheader.1.peel122, label %85

85:                                               ; preds = %.preheader.preheader.peel121
  %86 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 3, i32 noundef 1)
  br i1 %86, label %.loopexit, label %.preheader.1.peel122

.preheader.1.peel122:                             ; preds = %85, %.preheader.preheader.peel121
  br i1 %or.cond43.1, label %.preheader.3.peel126, label %87

87:                                               ; preds = %.preheader.1.peel122
  %88 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 3, i32 noundef 2)
  br i1 %88, label %.loopexit, label %.preheader.3.peel126

.preheader.3.peel126:                             ; preds = %.preheader.1.peel122, %87
  br i1 %or.cond43.3, label %.preheader.4.peel128, label %89

89:                                               ; preds = %.preheader.3.peel126
  %90 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 3, i32 noundef 4)
  br i1 %90, label %.loopexit, label %.preheader.4.peel128

.preheader.4.peel128:                             ; preds = %89, %.preheader.3.peel126
  br i1 %or.cond43.4, label %.preheader.5.peel130, label %91

91:                                               ; preds = %.preheader.4.peel128
  %92 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 3, i32 noundef 5)
  br i1 %92, label %.loopexit, label %.preheader.5.peel130

.preheader.5.peel130:                             ; preds = %91, %.preheader.4.peel128
  br i1 %or.cond43.5, label %.preheader.6.peel132, label %93

93:                                               ; preds = %.preheader.5.peel130
  %94 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 3, i32 noundef 6)
  br i1 %94, label %.loopexit, label %.preheader.6.peel132

.preheader.6.peel132:                             ; preds = %93, %.preheader.5.peel130
  br i1 %or.cond43.6, label %.preheader.7.peel134, label %95

95:                                               ; preds = %.preheader.6.peel132
  %96 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 3, i32 noundef 7)
  br i1 %96, label %.loopexit, label %.preheader.7.peel134

.preheader.7.peel134:                             ; preds = %95, %.preheader.6.peel132
  br i1 %or.cond43.7, label %.preheader.8.peel136, label %97

97:                                               ; preds = %.preheader.7.peel134
  %98 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 3, i32 noundef 8)
  br i1 %98, label %.loopexit, label %.preheader.8.peel136

.preheader.8.peel136:                             ; preds = %97, %.preheader.7.peel134
  br i1 %or.cond43.8, label %.preheader56.peel.next.peel.newph, label %99

99:                                               ; preds = %.preheader.8.peel136
  %100 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef 3, i32 noundef 9)
  br i1 %100, label %.loopexit, label %.preheader56.peel.next.peel.newph

.preheader56.peel.next.peel.newph:                ; preds = %.preheader56.peel119, %.preheader.8.peel136, %99
  br label %.preheader56

.preheader56:                                     ; preds = %.preheader56.peel.next.peel.newph, %.thread
  %.03563 = phi i32 [ %127, %.thread ], [ 4, %.preheader56.peel.next.peel.newph ]
  %101 = icmp eq i32 %.03563, %.03865
  %102 = icmp eq i32 %.03563, %.03664
  %or.cond = or i1 %101, %102
  br i1 %or.cond, label %.thread, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader56
  br i1 %or.cond.peel, label %.preheader.1, label %103

103:                                              ; preds = %.preheader.preheader
  %104 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef %.03563, i32 noundef 1)
  br i1 %104, label %.loopexit, label %.preheader.1

.preheader.1:                                     ; preds = %103, %.preheader.preheader
  br i1 %or.cond43.1, label %.preheader.2, label %105

105:                                              ; preds = %.preheader.1
  %106 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef %.03563, i32 noundef 2)
  br i1 %106, label %.loopexit, label %.preheader.2

.preheader.2:                                     ; preds = %105, %.preheader.1
  br i1 %or.cond43.2, label %.preheader.3, label %107

107:                                              ; preds = %.preheader.2
  %108 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef %.03563, i32 noundef 3)
  br i1 %108, label %.loopexit, label %.preheader.3

.preheader.3:                                     ; preds = %107, %.preheader.2
  %109 = icmp eq i32 %.03563, 4
  %or.cond44.3 = or i1 %109, %or.cond43.3
  br i1 %or.cond44.3, label %.preheader.4, label %110

110:                                              ; preds = %.preheader.3
  %111 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef %.03563, i32 noundef 4)
  br i1 %111, label %.loopexit, label %.preheader.4

.preheader.4:                                     ; preds = %110, %.preheader.3
  %112 = icmp eq i32 %.03563, 5
  %or.cond44.4 = or i1 %112, %or.cond43.4
  br i1 %or.cond44.4, label %.preheader.5, label %113

113:                                              ; preds = %.preheader.4
  %114 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef %.03563, i32 noundef 5)
  br i1 %114, label %.loopexit, label %.preheader.5

.preheader.5:                                     ; preds = %113, %.preheader.4
  %115 = icmp eq i32 %.03563, 6
  %or.cond44.5 = or i1 %115, %or.cond43.5
  br i1 %or.cond44.5, label %.preheader.6, label %116

116:                                              ; preds = %.preheader.5
  %117 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef %.03563, i32 noundef 6)
  br i1 %117, label %.loopexit, label %.preheader.6

.preheader.6:                                     ; preds = %116, %.preheader.5
  %118 = icmp eq i32 %.03563, 7
  %or.cond44.6 = or i1 %118, %or.cond43.6
  br i1 %or.cond44.6, label %.preheader.7, label %119

119:                                              ; preds = %.preheader.6
  %120 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef %.03563, i32 noundef 7)
  br i1 %120, label %.loopexit, label %.preheader.7

.preheader.7:                                     ; preds = %119, %.preheader.6
  %121 = icmp eq i32 %.03563, 8
  %or.cond44.7 = or i1 %121, %or.cond43.7
  br i1 %or.cond44.7, label %.preheader.8, label %122

122:                                              ; preds = %.preheader.7
  %123 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef %.03563, i32 noundef 8)
  br i1 %123, label %.loopexit, label %.preheader.8

.preheader.8:                                     ; preds = %122, %.preheader.7
  %124 = icmp eq i32 %.03563, 9
  %or.cond44.8 = or i1 %124, %or.cond43.8
  br i1 %or.cond44.8, label %.thread, label %125

125:                                              ; preds = %.preheader.8
  %126 = tail call noundef zeroext i1 @_Z5checkiiii(i32 noundef %.03865, i32 noundef %.03664, i32 noundef %.03563, i32 noundef 9)
  br i1 %126, label %.loopexit, label %.thread

.thread:                                          ; preds = %.preheader.8, %125, %.preheader56
  %127 = add nuw nsw i32 %.03563, 1
  %exitcond.not = icmp eq i32 %127, 10
  br i1 %exitcond.not, label %.thread46, label %.preheader56, !llvm.loop !8

.thread46:                                        ; preds = %.thread, %32
  %128 = add nuw nsw i32 %.03664, 1
  %exitcond76.not = icmp eq i32 %128, 10
  br i1 %exitcond76.not, label %129, label %32, !llvm.loop !11

129:                                              ; preds = %.thread46
  %130 = add nuw nsw i32 %.03865, 1
  %exitcond77.not = icmp eq i32 %130, 10
  br i1 %exitcond77.not, label %138, label %.preheader57, !llvm.loop !12

.loopexit:                                        ; preds = %57, %54, %51, %48, %45, %42, %39, %36, %125, %122, %119, %116, %113, %110, %107, %105, %103, %68, %70, %72, %74, %76, %78, %80, %82, %85, %87, %89, %91, %93, %95, %97, %99
  %.03563.lcssa = phi i32 [ %.03563, %125 ], [ %.03563, %122 ], [ %.03563, %119 ], [ %.03563, %116 ], [ %.03563, %113 ], [ %.03563, %110 ], [ %.03563, %107 ], [ %.03563, %105 ], [ %.03563, %103 ], [ 3, %99 ], [ 3, %97 ], [ 3, %95 ], [ 3, %93 ], [ 3, %91 ], [ 3, %89 ], [ 3, %87 ], [ 3, %85 ], [ 2, %82 ], [ 2, %80 ], [ 2, %78 ], [ 2, %76 ], [ 2, %74 ], [ 2, %72 ], [ 2, %70 ], [ 2, %68 ], [ 1, %36 ], [ 1, %39 ], [ 1, %42 ], [ 1, %45 ], [ 1, %48 ], [ 1, %51 ], [ 1, %54 ], [ 1, %57 ]
  %.062.lcssa = phi i32 [ 1, %103 ], [ 2, %105 ], [ 3, %107 ], [ 4, %110 ], [ 5, %113 ], [ 6, %116 ], [ 7, %119 ], [ 8, %122 ], [ 9, %125 ], [ 9, %99 ], [ 8, %97 ], [ 7, %95 ], [ 6, %93 ], [ 5, %91 ], [ 4, %89 ], [ 2, %87 ], [ 1, %85 ], [ 9, %82 ], [ 8, %80 ], [ 7, %78 ], [ 6, %76 ], [ 5, %74 ], [ 4, %72 ], [ 3, %70 ], [ 1, %68 ], [ 9, %57 ], [ 8, %54 ], [ 7, %51 ], [ 6, %48 ], [ 5, %45 ], [ 4, %42 ], [ 3, %39 ], [ 2, %36 ]
  %131 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.03865)
  %132 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %131, i8 noundef signext 32)
  %133 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %132, i32 noundef %.03664)
  %134 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %133, i8 noundef signext 10)
  %135 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %134, i32 noundef %.03563.lcssa)
  %136 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %135, i8 noundef signext 32)
  %137 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %136, i32 noundef %.062.lcssa)
  br label %140

138:                                              ; preds = %129
  %139 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  br label %140

140:                                              ; preds = %.loopexit, %138
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #0 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #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 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 #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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9, !10}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.peeled.count", i32 3}
!11 = distinct !{!11, !9}
!12 = distinct !{!12, !9}


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