; LLVM IR from imteekay/algorithms :: competitive-programming/uri (queen)

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

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_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
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(4) %5)
  br label %13

13:                                               ; preds = %151, %0
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = load i32, ptr %3, align 4, !tbaa !5
  %16 = add nsw i32 %14, %15
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = add nsw i32 %16, %17
  %19 = load i32, ptr %5, align 4, !tbaa !5
  %20 = add nsw i32 %18, %19
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %22, label %156

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

25:                                               ; preds = %42, %22
  %26 = load i32, ptr %7, align 4, !tbaa !5
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %31

28:                                               ; preds = %25
  %29 = load i32, ptr %8, align 4, !tbaa !5
  %30 = icmp ne i32 %29, 0
  br label %31

31:                                               ; preds = %28, %25
  %32 = phi i1 [ false, %25 ], [ %30, %28 ]
  br i1 %32, label %33, label %47

33:                                               ; preds = %31
  %34 = load i32, ptr %7, align 4, !tbaa !5
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = icmp eq i32 %34, %35
  br i1 %36, label %37, label %42

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

41:                                               ; preds = %37
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %41, %37, %33
  %43 = load i32, ptr %7, align 4, !tbaa !5
  %44 = add nsw i32 %43, -1
  store i32 %44, ptr %7, align 4, !tbaa !5
  %45 = load i32, ptr %8, align 4, !tbaa !5
  %46 = add nsw i32 %45, -1
  store i32 %46, ptr %8, align 4, !tbaa !5
  br label %25, !llvm.loop !9

47:                                               ; preds = %31
  %48 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %48, ptr %7, align 4, !tbaa !5
  %49 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %49, ptr %8, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %67, %47
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = icmp ne i32 %51, 9
  br i1 %52, label %53, label %56

53:                                               ; preds = %50
  %54 = load i32, ptr %8, align 4, !tbaa !5
  %55 = icmp ne i32 %54, 0
  br label %56

56:                                               ; preds = %53, %50
  %57 = phi i1 [ false, %50 ], [ %55, %53 ]
  br i1 %57, label %58, label %72

58:                                               ; preds = %56
  %59 = load i32, ptr %7, align 4, !tbaa !5
  %60 = load i32, ptr %3, align 4, !tbaa !5
  %61 = icmp eq i32 %59, %60
  br i1 %61, label %62, label %67

62:                                               ; preds = %58
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = icmp eq i32 %63, %64
  br i1 %65, label %66, label %67

66:                                               ; preds = %62
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %66, %62, %58
  %68 = load i32, ptr %7, align 4, !tbaa !5
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %7, align 4, !tbaa !5
  %70 = load i32, ptr %8, align 4, !tbaa !5
  %71 = add nsw i32 %70, -1
  store i32 %71, ptr %8, align 4, !tbaa !5
  br label %50, !llvm.loop !11

72:                                               ; preds = %56
  %73 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %73, ptr %7, align 4, !tbaa !5
  %74 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %74, ptr %8, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %92, %72
  %76 = load i32, ptr %7, align 4, !tbaa !5
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %81

78:                                               ; preds = %75
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = icmp ne i32 %79, 9
  br label %81

81:                                               ; preds = %78, %75
  %82 = phi i1 [ false, %75 ], [ %80, %78 ]
  br i1 %82, label %83, label %97

83:                                               ; preds = %81
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = load i32, ptr %3, align 4, !tbaa !5
  %86 = icmp eq i32 %84, %85
  br i1 %86, label %87, label %92

87:                                               ; preds = %83
  %88 = load i32, ptr %8, align 4, !tbaa !5
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = icmp eq i32 %88, %89
  br i1 %90, label %91, label %92

91:                                               ; preds = %87
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %91, %87, %83
  %93 = load i32, ptr %7, align 4, !tbaa !5
  %94 = add nsw i32 %93, -1
  store i32 %94, ptr %7, align 4, !tbaa !5
  %95 = load i32, ptr %8, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %8, align 4, !tbaa !5
  br label %75, !llvm.loop !12

97:                                               ; preds = %81
  %98 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %98, ptr %7, align 4, !tbaa !5
  %99 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %99, ptr %8, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %117, %97
  %101 = load i32, ptr %7, align 4, !tbaa !5
  %102 = icmp ne i32 %101, 9
  br i1 %102, label %103, label %106

103:                                              ; preds = %100
  %104 = load i32, ptr %8, align 4, !tbaa !5
  %105 = icmp ne i32 %104, 9
  br label %106

106:                                              ; preds = %103, %100
  %107 = phi i1 [ false, %100 ], [ %105, %103 ]
  br i1 %107, label %108, label %122

108:                                              ; preds = %106
  %109 = load i32, ptr %7, align 4, !tbaa !5
  %110 = load i32, ptr %3, align 4, !tbaa !5
  %111 = icmp eq i32 %109, %110
  br i1 %111, label %112, label %117

112:                                              ; preds = %108
  %113 = load i32, ptr %8, align 4, !tbaa !5
  %114 = load i32, ptr %5, align 4, !tbaa !5
  %115 = icmp eq i32 %113, %114
  br i1 %115, label %116, label %117

116:                                              ; preds = %112
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %116, %112, %108
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %7, align 4, !tbaa !5
  %120 = load i32, ptr %8, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %8, align 4, !tbaa !5
  br label %100, !llvm.loop !13

122:                                              ; preds = %106
  %123 = load i32, ptr %2, align 4, !tbaa !5
  %124 = load i32, ptr %3, align 4, !tbaa !5
  %125 = icmp eq i32 %123, %124
  br i1 %125, label %126, label %133

126:                                              ; preds = %122
  %127 = load i32, ptr %4, align 4, !tbaa !5
  %128 = load i32, ptr %5, align 4, !tbaa !5
  %129 = icmp eq i32 %127, %128
  br i1 %129, label %130, label %133

130:                                              ; preds = %126
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %131, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %151

133:                                              ; preds = %126, %122
  %134 = load i32, ptr %2, align 4, !tbaa !5
  %135 = load i32, ptr %3, align 4, !tbaa !5
  %136 = icmp eq i32 %134, %135
  br i1 %136, label %144, label %137

137:                                              ; preds = %133
  %138 = load i32, ptr %4, align 4, !tbaa !5
  %139 = load i32, ptr %5, align 4, !tbaa !5
  %140 = icmp eq i32 %138, %139
  br i1 %140, label %144, label %141

141:                                              ; preds = %137
  %142 = load i32, ptr %6, align 4, !tbaa !5
  %143 = icmp ne i32 %142, 0
  br i1 %143, label %144, label %147

144:                                              ; preds = %141, %137, %133
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %145, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %150

147:                                              ; preds = %141
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 2)
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %148, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %150

150:                                              ; preds = %147, %144
  br label %151

151:                                              ; preds = %150, %130
  %152 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %153 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %152, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %154 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %153, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %155 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %154, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %13, !llvm.loop !14

156:                                              ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  ret i32 0
}

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 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)) #4

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"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" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_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 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %5 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %6 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %9 = load i32, ptr %1, align 4, !tbaa !5
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = add nsw i32 %10, %9
  %12 = load i32, ptr %3, align 4, !tbaa !5
  %13 = add nsw i32 %11, %12
  %14 = load i32, ptr %4, align 4
  %15 = sub i32 0, %14
  %.not63 = icmp eq i32 %13, %15
  br i1 %.not63, label %._crit_edge64, label %.preheader44

.preheader44:                                     ; preds = %0, %61
  %16 = phi i32 [ %73, %61 ], [ %14, %0 ]
  %17 = phi i32 [ %71, %61 ], [ %12, %0 ]
  %18 = phi i32 [ %69, %61 ], [ %10, %0 ]
  %19 = phi i32 [ %68, %61 ], [ %9, %0 ]
  %20 = icmp ne i32 %19, 0
  %21 = icmp ne i32 %17, 0
  %22 = and i1 %20, %21
  br i1 %22, label %.lr.ph, label %.preheader43

.preheader43:                                     ; preds = %.lr.ph, %.preheader44
  %.131.lcssa = phi i32 [ 0, %.preheader44 ], [ %.232, %.lr.ph ]
  %23 = icmp ne i32 %19, 9
  %24 = and i1 %23, %21
  br i1 %24, label %.lr.ph51, label %.preheader42

.lr.ph:                                           ; preds = %.preheader44, %.lr.ph
  %.047 = phi i32 [ %28, %.lr.ph ], [ %17, %.preheader44 ]
  %.02646 = phi i32 [ %27, %.lr.ph ], [ %19, %.preheader44 ]
  %.13145 = phi i32 [ %.232, %.lr.ph ], [ 0, %.preheader44 ]
  %25 = icmp eq i32 %.02646, %18
  %26 = icmp eq i32 %.047, %16
  %or.cond35 = select i1 %25, i1 %26, i1 false
  %.232 = select i1 %or.cond35, i32 1, i32 %.13145
  %27 = add nsw i32 %.02646, -1
  %28 = add nsw i32 %.047, -1
  %29 = icmp ne i32 %27, 0
  %30 = icmp ne i32 %28, 0
  %31 = select i1 %29, i1 %30, i1 false
  br i1 %31, label %.lr.ph, label %.preheader43, !llvm.loop !9

.preheader42:                                     ; preds = %.lr.ph51, %.preheader43
  %.333.lcssa = phi i32 [ %.131.lcssa, %.preheader43 ], [ %.4, %.lr.ph51 ]
  %32 = icmp ne i32 %17, 9
  %33 = and i1 %20, %32
  br i1 %33, label %.lr.ph56, label %.preheader

.lr.ph51:                                         ; preds = %.preheader43, %.lr.ph51
  %.150 = phi i32 [ %37, %.lr.ph51 ], [ %17, %.preheader43 ]
  %.12749 = phi i32 [ %36, %.lr.ph51 ], [ %19, %.preheader43 ]
  %.33348 = phi i32 [ %.4, %.lr.ph51 ], [ %.131.lcssa, %.preheader43 ]
  %34 = icmp eq i32 %.12749, %18
  %35 = icmp eq i32 %.150, %16
  %or.cond37 = select i1 %34, i1 %35, i1 false
  %.4 = select i1 %or.cond37, i32 1, i32 %.33348
  %36 = add nsw i32 %.12749, 1
  %37 = add nsw i32 %.150, -1
  %38 = icmp ne i32 %36, 9
  %39 = icmp ne i32 %37, 0
  %40 = select i1 %38, i1 %39, i1 false
  br i1 %40, label %.lr.ph51, label %.preheader42, !llvm.loop !11

.preheader:                                       ; preds = %.lr.ph56, %.preheader42
  %.5.lcssa = phi i32 [ %.333.lcssa, %.preheader42 ], [ %.6, %.lr.ph56 ]
  %41 = and i1 %23, %32
  br i1 %41, label %.lr.ph61, label %._crit_edge

.lr.ph56:                                         ; preds = %.preheader42, %.lr.ph56
  %.255 = phi i32 [ %45, %.lr.ph56 ], [ %17, %.preheader42 ]
  %.22854 = phi i32 [ %44, %.lr.ph56 ], [ %19, %.preheader42 ]
  %.553 = phi i32 [ %.6, %.lr.ph56 ], [ %.333.lcssa, %.preheader42 ]
  %42 = icmp eq i32 %.22854, %18
  %43 = icmp eq i32 %.255, %16
  %or.cond39 = select i1 %42, i1 %43, i1 false
  %.6 = select i1 %or.cond39, i32 1, i32 %.553
  %44 = add nsw i32 %.22854, -1
  %45 = add nsw i32 %.255, 1
  %46 = icmp ne i32 %44, 0
  %47 = icmp ne i32 %45, 9
  %48 = select i1 %46, i1 %47, i1 false
  br i1 %48, label %.lr.ph56, label %.preheader, !llvm.loop !12

.lr.ph61:                                         ; preds = %.preheader, %.lr.ph61
  %.360 = phi i32 [ %52, %.lr.ph61 ], [ %17, %.preheader ]
  %.32959 = phi i32 [ %51, %.lr.ph61 ], [ %19, %.preheader ]
  %.758 = phi i32 [ %.8, %.lr.ph61 ], [ %.5.lcssa, %.preheader ]
  %49 = icmp eq i32 %.32959, %18
  %50 = icmp eq i32 %.360, %16
  %or.cond41 = select i1 %49, i1 %50, i1 false
  %.8 = select i1 %or.cond41, i32 1, i32 %.758
  %51 = add nsw i32 %.32959, 1
  %52 = add nsw i32 %.360, 1
  %53 = icmp ne i32 %51, 9
  %54 = icmp ne i32 %52, 9
  %55 = select i1 %53, i1 %54, i1 false
  br i1 %55, label %.lr.ph61, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph61, %.preheader
  %.7.lcssa = phi i32 [ %.5.lcssa, %.preheader ], [ %.8, %.lr.ph61 ]
  %56 = icmp eq i32 %19, %18
  %57 = icmp eq i32 %17, %16
  br i1 %56, label %58, label %59

58:                                               ; preds = %._crit_edge
  br i1 %57, label %61, label %.thread

59:                                               ; preds = %._crit_edge
  %60 = icmp ne i32 %.7.lcssa, 0
  %or.cond = select i1 %57, i1 true, i1 %60
  br i1 %or.cond, label %.thread, label %61

.thread:                                          ; preds = %58, %59
  br label %61

61:                                               ; preds = %59, %58, %.thread
  %.sink65 = phi i32 [ 1, %.thread ], [ 0, %58 ], [ 2, %59 ]
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.sink65)
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %64 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %65 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %64, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %66 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %65, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %67 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %66, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %68 = load i32, ptr %1, align 4, !tbaa !5
  %69 = load i32, ptr %2, align 4, !tbaa !5
  %70 = add nsw i32 %69, %68
  %71 = load i32, ptr %3, align 4, !tbaa !5
  %72 = add nsw i32 %70, %71
  %73 = load i32, ptr %4, align 4
  %74 = sub i32 0, %73
  %.not = icmp eq i32 %72, %74
  br i1 %.not, label %._crit_edge64, label %.preheader44, !llvm.loop !14

._crit_edge64:                                    ; preds = %61, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0
}

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

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

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

; 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 #3 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)) #4

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

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


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