; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/235 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
@m = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1

; 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
  store i32 0, ptr %1, align 4
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = load i32, ptr @m, align 4, !tbaa !5
  %9 = add nsw i32 %8, 2
  %10 = icmp sge i32 %7, %9
  br i1 %10, label %17, label %11

11:                                               ; preds = %0
  %12 = load i32, ptr @m, align 4, !tbaa !5
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = add nsw i32 %13, 1
  %15 = mul nsw i32 2, %14
  %16 = icmp sgt i32 %12, %15
  br i1 %16, label %17, label %19

17:                                               ; preds = %11, %0
  %18 = 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 %164

19:                                               ; preds = %11
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = load i32, ptr @m, align 4, !tbaa !5
  %22 = add nsw i32 %21, 1
  %23 = icmp eq i32 %20, %22
  br i1 %23, label %24, label %45

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

25:                                               ; preds = %41, %24
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = load i32, ptr @n, align 4, !tbaa !5
  %28 = load i32, ptr @m, align 4, !tbaa !5
  %29 = add nsw i32 %27, %28
  %30 = icmp slt i32 %26, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %44

32:                                               ; preds = %25
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = and i32 %33, 1
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %38, label %36

36:                                               ; preds = %32
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  br label %40

38:                                               ; preds = %32
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
  br label %40

40:                                               ; preds = %38, %36
  br label %41

41:                                               ; preds = %40
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %2, align 4, !tbaa !5
  br label %25, !llvm.loop !9

44:                                               ; preds = %31
  store i32 0, ptr %1, align 4
  br label %164

45:                                               ; preds = %19
  %46 = load i32, ptr @n, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  %48 = load i32, ptr @m, align 4, !tbaa !5
  %49 = icmp eq i32 %47, %48
  br i1 %49, label %54, label %50

50:                                               ; preds = %45
  %51 = load i32, ptr @n, align 4, !tbaa !5
  %52 = load i32, ptr @m, align 4, !tbaa !5
  %53 = icmp eq i32 %51, %52
  br i1 %53, label %54, label %75

54:                                               ; preds = %50, %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %71, %54
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = load i32, ptr @n, align 4, !tbaa !5
  %58 = load i32, ptr @m, align 4, !tbaa !5
  %59 = add nsw i32 %57, %58
  %60 = icmp slt i32 %56, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %74

62:                                               ; preds = %55
  %63 = load i32, ptr %3, align 4, !tbaa !5
  %64 = and i32 %63, 1
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %68, label %66

66:                                               ; preds = %62
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
  br label %70

68:                                               ; preds = %62
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  br label %70

70:                                               ; preds = %68, %66
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %3, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %3, align 4, !tbaa !5
  br label %55, !llvm.loop !11

74:                                               ; preds = %61
  store i32 0, ptr %1, align 4
  br label %164

75:                                               ; preds = %50
  %76 = load i32, ptr @m, align 4, !tbaa !5
  %77 = load i32, ptr @n, align 4, !tbaa !5
  %78 = add nsw i32 %76, %77
  store i32 %78, ptr @tot, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %92, %75
  %80 = load i32, ptr @m, align 4, !tbaa !5
  %81 = icmp sgt i32 %80, 0
  br i1 %81, label %82, label %90

82:                                               ; preds = %79
  %83 = load i32, ptr @n, align 4, !tbaa !5
  %84 = icmp sgt i32 %83, 0
  br i1 %84, label %85, label %90

85:                                               ; preds = %82
  %86 = load i32, ptr @m, align 4, !tbaa !5
  %87 = load i32, ptr @n, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  %89 = icmp sgt i32 %86, %88
  br label %90

90:                                               ; preds = %85, %82, %79
  %91 = phi i1 [ false, %82 ], [ false, %79 ], [ %89, %85 ]
  br i1 %91, label %92, label %98

92:                                               ; preds = %90
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %94 = load i32, ptr @m, align 4, !tbaa !5
  %95 = sub nsw i32 %94, 2
  store i32 %95, ptr @m, align 4, !tbaa !5
  %96 = load i32, ptr @n, align 4, !tbaa !5
  %97 = add nsw i32 %96, -1
  store i32 %97, ptr @n, align 4, !tbaa !5
  br label %79, !llvm.loop !12

98:                                               ; preds = %90
  %99 = load i32, ptr @m, align 4, !tbaa !5
  %100 = icmp sgt i32 %99, 0
  br i1 %100, label %101, label %151

101:                                              ; preds = %98
  %102 = load i32, ptr @n, align 4, !tbaa !5
  %103 = icmp sgt i32 %102, 0
  br i1 %103, label %104, label %151

104:                                              ; preds = %101
  %105 = load i32, ptr @m, align 4, !tbaa !5
  %106 = load i32, ptr @n, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  %108 = icmp eq i32 %105, %107
  br i1 %108, label %109, label %130

109:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %126, %109
  %111 = load i32, ptr %4, align 4, !tbaa !5
  %112 = load i32, ptr @n, align 4, !tbaa !5
  %113 = load i32, ptr @m, align 4, !tbaa !5
  %114 = add nsw i32 %112, %113
  %115 = icmp slt i32 %111, %114
  br i1 %115, label %117, label %116

116:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %129

117:                                              ; preds = %110
  %118 = load i32, ptr %4, align 4, !tbaa !5
  %119 = and i32 %118, 1
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %123, label %121

121:                                              ; preds = %117
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 49)
  br label %125

123:                                              ; preds = %117
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 48)
  br label %125

125:                                              ; preds = %123, %121
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %4, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %4, align 4, !tbaa !5
  br label %110, !llvm.loop !13

129:                                              ; preds = %116
  store i32 0, ptr %1, align 4
  br label %164

130:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %131

131:                                              ; preds = %147, %130
  %132 = load i32, ptr %5, align 4, !tbaa !5
  %133 = load i32, ptr @n, align 4, !tbaa !5
  %134 = load i32, ptr @m, align 4, !tbaa !5
  %135 = add nsw i32 %133, %134
  %136 = icmp slt i32 %132, %135
  br i1 %136, label %138, label %137

137:                                              ; preds = %131
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %150

138:                                              ; preds = %131
  %139 = load i32, ptr %5, align 4, !tbaa !5
  %140 = and i32 %139, 1
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %144, label %142

142:                                              ; preds = %138
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 48)
  br label %146

144:                                              ; preds = %138
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 49)
  br label %146

146:                                              ; preds = %144, %142
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %5, align 4, !tbaa !5
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %5, align 4, !tbaa !5
  br label %131, !llvm.loop !14

150:                                              ; preds = %137
  store i32 0, ptr %1, align 4
  br label %164

151:                                              ; preds = %101, %98
  %152 = load i32, ptr @m, align 4, !tbaa !5
  %153 = icmp eq i32 %152, 1
  br i1 %153, label %154, label %156

154:                                              ; preds = %151
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 49)
  br label %162

156:                                              ; preds = %151
  %157 = load i32, ptr @m, align 4, !tbaa !5
  %158 = icmp eq i32 %157, 2
  br i1 %158, label %159, label %161

159:                                              ; preds = %156
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  br label %161

161:                                              ; preds = %159, %156
  br label %162

162:                                              ; preds = %161, %154
  br label %163

163:                                              ; preds = %162
  store i32 0, ptr %1, align 4
  br label %164

164:                                              ; preds = %163, %150, %129, %74, %44, %17
  %165 = load i32, ptr %1, align 4
  ret i32 %165
}

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

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

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 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 = { 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_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
@m = external dso_local global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1

; 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, ptr noundef nonnull @m)
  %2 = load i32, ptr @n, align 4
  %3 = load i32, ptr @m, align 4, !tbaa !5
  %4 = add nsw i32 %3, 2
  %.not = icmp slt i32 %2, %4
  br i1 %.not, label %5, label %9

5:                                                ; preds = %0
  %6 = add nsw i32 %2, 1
  %7 = shl nsw i32 %6, 1
  %8 = icmp sgt i32 %3, %7
  br i1 %8, label %9, label %11

9:                                                ; preds = %5, %0
  %10 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  br label %.loopexit

11:                                               ; preds = %5
  %12 = add nsw i32 %3, 1
  %13 = icmp eq i32 %2, %12
  br i1 %13, label %.preheader, label %23

.preheader:                                       ; preds = %11
  %14 = add nsw i32 %3, %2
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph51, label %.loopexit

.lr.ph51:                                         ; preds = %.preheader, %.lr.ph51
  %.01850 = phi i32 [ %18, %.lr.ph51 ], [ 0, %.preheader ]
  %16 = and i32 %.01850, 1
  %17 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %16)
  %18 = add nuw nsw i32 %.01850, 1
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = load i32, ptr @m, align 4, !tbaa !5
  %21 = add nsw i32 %20, %19
  %22 = icmp slt i32 %18, %21
  br i1 %22, label %.lr.ph51, label %.loopexit, !llvm.loop !9

23:                                               ; preds = %11
  %24 = icmp eq i32 %6, %3
  %25 = icmp eq i32 %2, %3
  %or.cond30 = or i1 %24, %25
  %26 = add nsw i32 %3, %2
  br i1 %or.cond30, label %.preheader33, label %35

.preheader33:                                     ; preds = %23
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph49, label %.loopexit

.lr.ph49:                                         ; preds = %.preheader33, %.lr.ph49
  %.01748 = phi i32 [ %30, %.lr.ph49 ], [ 0, %.preheader33 ]
  %28 = and i32 %.01748, 1
  %.68 = xor i32 %28, 1
  %29 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.68)
  %30 = add nuw nsw i32 %.01748, 1
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = load i32, ptr @m, align 4, !tbaa !5
  %33 = add nsw i32 %32, %31
  %34 = icmp slt i32 %30, %33
  br i1 %34, label %.lr.ph49, label %.loopexit, !llvm.loop !11

35:                                               ; preds = %23
  store i32 %26, ptr @tot, align 4, !tbaa !5
  %36 = icmp sgt i32 %3, 0
  %37 = icmp sgt i32 %2, 0
  %or.cond40 = and i1 %36, %37
  %38 = icmp sgt i32 %3, %6
  %or.cond3241 = and i1 %or.cond40, %38
  br i1 %or.cond3241, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %35, %.lr.ph
  %39 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
  %40 = load i32, ptr @m, align 4, !tbaa !5
  %41 = add nsw i32 %40, -2
  store i32 %41, ptr @m, align 4, !tbaa !5
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %43 = add nsw i32 %42, -1
  store i32 %43, ptr @n, align 4, !tbaa !5
  %44 = icmp sgt i32 %40, 2
  %45 = icmp sgt i32 %42, 1
  %or.cond = select i1 %44, i1 %45, i1 false
  %46 = icmp sgt i32 %41, %42
  %or.cond32 = select i1 %or.cond, i1 %46, i1 false
  br i1 %or.cond32, label %.lr.ph, label %.critedge, !llvm.loop !12

.critedge:                                        ; preds = %.lr.ph, %35
  %47 = phi i32 [ %2, %35 ], [ %43, %.lr.ph ]
  %48 = phi i32 [ %3, %35 ], [ %41, %.lr.ph ]
  %or.cond.lcssa = phi i1 [ %or.cond40, %35 ], [ %or.cond, %.lr.ph ]
  %.lcssa = phi i32 [ %6, %35 ], [ %42, %.lr.ph ]
  br i1 %or.cond.lcssa, label %49, label %67

49:                                               ; preds = %.critedge
  %50 = icmp eq i32 %48, %.lcssa
  %51 = add nsw i32 %48, %47
  %52 = icmp sgt i32 %51, 0
  br i1 %50, label %.preheader35, label %.preheader37

.preheader37:                                     ; preds = %49
  br i1 %52, label %.lr.ph45, label %.loopexit

.preheader35:                                     ; preds = %49
  br i1 %52, label %.lr.ph47, label %.loopexit

.lr.ph47:                                         ; preds = %.preheader35, %.lr.ph47
  %.01646 = phi i32 [ %55, %.lr.ph47 ], [ 0, %.preheader35 ]
  %53 = and i32 %.01646, 1
  %.not27 = icmp eq i32 %53, 0
  %.69 = select i1 %.not27, i8 49, i8 48
  %54 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %.69)
  %55 = add nuw nsw i32 %.01646, 1
  %56 = load i32, ptr @n, align 4, !tbaa !5
  %57 = load i32, ptr @m, align 4, !tbaa !5
  %58 = add nsw i32 %57, %56
  %59 = icmp slt i32 %55, %58
  br i1 %59, label %.lr.ph47, label %.loopexit, !llvm.loop !13

.lr.ph45:                                         ; preds = %.preheader37, %.lr.ph45
  %.044 = phi i32 [ %62, %.lr.ph45 ], [ 0, %.preheader37 ]
  %60 = and i32 %.044, 1
  %.not26 = icmp eq i32 %60, 0
  %.70 = select i1 %.not26, i8 48, i8 49
  %61 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %.70)
  %62 = add nuw nsw i32 %.044, 1
  %63 = load i32, ptr @n, align 4, !tbaa !5
  %64 = load i32, ptr @m, align 4, !tbaa !5
  %65 = add nsw i32 %64, %63
  %66 = icmp slt i32 %62, %65
  br i1 %66, label %.lr.ph45, label %.loopexit, !llvm.loop !14

67:                                               ; preds = %.critedge
  switch i32 %48, label %.loopexit [
    i32 1, label %68
    i32 2, label %70
  ]

68:                                               ; preds = %67
  %69 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 49)
  br label %.loopexit

70:                                               ; preds = %67
  %71 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.2)
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph45, %.lr.ph47, %.lr.ph49, %.lr.ph51, %.preheader37, %.preheader35, %.preheader33, %.preheader, %70, %68, %67, %9
  ret i32 0
}

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

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

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

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 = { "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 = !{!"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,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass