; LLVM IR from upupming/algorithm :: BasicLevel_C++/1018. 锤子剪刀布 (20) (main)

; 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
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@__const.main.str = external hidden unnamed_addr constant [4 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 [3 x i32], align 4
  %6 = alloca [3 x i32], align 4
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca [4 x i8], align 1
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  %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) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %5) #7
  call void @llvm.memset.p0.i64(ptr align 4 %5, i8 0, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #7
  call void @llvm.memset.p0.i64(ptr align 4 %6, i8 0, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %111, %0
  %15 = load i32, ptr %7, align 4, !tbaa !5
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = icmp slt i32 %15, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %114

19:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #7
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %8)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 1 dereferenceable(1) %9)
  %22 = load i8, ptr %8, align 1, !tbaa !9
  %23 = sext i8 %22 to i32
  %24 = icmp eq i32 %23, 66
  br i1 %24, label %25, label %35

25:                                               ; preds = %19
  %26 = load i8, ptr %9, align 1, !tbaa !9
  %27 = sext i8 %26 to i32
  %28 = icmp eq i32 %27, 67
  br i1 %28, label %29, label %35

29:                                               ; preds = %25
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %3, align 4, !tbaa !5
  %32 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 0
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %32, align 4, !tbaa !5
  br label %110

35:                                               ; preds = %25, %19
  %36 = load i8, ptr %8, align 1, !tbaa !9
  %37 = sext i8 %36 to i32
  %38 = icmp eq i32 %37, 66
  br i1 %38, label %39, label %49

39:                                               ; preds = %35
  %40 = load i8, ptr %9, align 1, !tbaa !9
  %41 = sext i8 %40 to i32
  %42 = icmp eq i32 %41, 74
  br i1 %42, label %43, label %49

43:                                               ; preds = %39
  %44 = load i32, ptr %4, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %4, align 4, !tbaa !5
  %46 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 2
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %46, align 4, !tbaa !5
  br label %109

49:                                               ; preds = %39, %35
  %50 = load i8, ptr %8, align 1, !tbaa !9
  %51 = sext i8 %50 to i32
  %52 = icmp eq i32 %51, 67
  br i1 %52, label %53, label %63

53:                                               ; preds = %49
  %54 = load i8, ptr %9, align 1, !tbaa !9
  %55 = sext i8 %54 to i32
  %56 = icmp eq i32 %55, 66
  br i1 %56, label %57, label %63

57:                                               ; preds = %53
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %4, align 4, !tbaa !5
  %60 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 0
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %60, align 4, !tbaa !5
  br label %108

63:                                               ; preds = %53, %49
  %64 = load i8, ptr %8, align 1, !tbaa !9
  %65 = sext i8 %64 to i32
  %66 = icmp eq i32 %65, 67
  br i1 %66, label %67, label %77

67:                                               ; preds = %63
  %68 = load i8, ptr %9, align 1, !tbaa !9
  %69 = sext i8 %68 to i32
  %70 = icmp eq i32 %69, 74
  br i1 %70, label %71, label %77

71:                                               ; preds = %67
  %72 = load i32, ptr %3, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %3, align 4, !tbaa !5
  %74 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 1
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %74, align 4, !tbaa !5
  br label %107

77:                                               ; preds = %67, %63
  %78 = load i8, ptr %8, align 1, !tbaa !9
  %79 = sext i8 %78 to i32
  %80 = icmp eq i32 %79, 74
  br i1 %80, label %81, label %91

81:                                               ; preds = %77
  %82 = load i8, ptr %9, align 1, !tbaa !9
  %83 = sext i8 %82 to i32
  %84 = icmp eq i32 %83, 66
  br i1 %84, label %85, label %91

85:                                               ; preds = %81
  %86 = load i32, ptr %3, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %3, align 4, !tbaa !5
  %88 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 2
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %88, align 4, !tbaa !5
  br label %106

91:                                               ; preds = %81, %77
  %92 = load i8, ptr %8, align 1, !tbaa !9
  %93 = sext i8 %92 to i32
  %94 = icmp eq i32 %93, 74
  br i1 %94, label %95, label %105

95:                                               ; preds = %91
  %96 = load i8, ptr %9, align 1, !tbaa !9
  %97 = sext i8 %96 to i32
  %98 = icmp eq i32 %97, 67
  br i1 %98, label %99, label %105

99:                                               ; preds = %95
  %100 = load i32, ptr %4, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %4, align 4, !tbaa !5
  %102 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 1
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %102, align 4, !tbaa !5
  br label %105

105:                                              ; preds = %99, %95, %91
  br label %106

106:                                              ; preds = %105, %85
  br label %107

107:                                              ; preds = %106, %71
  br label %108

108:                                              ; preds = %107, %57
  br label %109

109:                                              ; preds = %108, %43
  br label %110

110:                                              ; preds = %109, %29
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #7
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %7, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %7, align 4, !tbaa !5
  br label %14, !llvm.loop !10

114:                                              ; preds = %18
  %115 = load i32, ptr %3, align 4, !tbaa !5
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %115)
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %116, ptr noundef @.str)
  %118 = load i32, ptr %2, align 4, !tbaa !5
  %119 = load i32, ptr %3, align 4, !tbaa !5
  %120 = sub nsw i32 %118, %119
  %121 = load i32, ptr %4, align 4, !tbaa !5
  %122 = sub nsw i32 %120, %121
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %117, i32 noundef %122)
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %123, ptr noundef @.str)
  %125 = load i32, ptr %4, align 4, !tbaa !5
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %124, i32 noundef %125)
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %126, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %128 = load i32, ptr %4, align 4, !tbaa !5
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %127, i32 noundef %128)
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %129, ptr noundef @.str)
  %131 = load i32, ptr %2, align 4, !tbaa !5
  %132 = load i32, ptr %3, align 4, !tbaa !5
  %133 = sub nsw i32 %131, %132
  %134 = load i32, ptr %4, align 4, !tbaa !5
  %135 = sub nsw i32 %133, %134
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %130, i32 noundef %135)
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %136, ptr noundef @.str)
  %138 = load i32, ptr %3, align 4, !tbaa !5
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %137, i32 noundef %138)
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %139, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %141 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 0
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 1
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = icmp sge i32 %142, %144
  %146 = zext i1 %145 to i64
  %147 = select i1 %145, i32 0, i32 1
  store i32 %147, ptr %10, align 4, !tbaa !5
  %148 = load i32, ptr %10, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 2
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = icmp sge i32 %151, %153
  br i1 %154, label %155, label %157

155:                                              ; preds = %114
  %156 = load i32, ptr %10, align 4, !tbaa !5
  br label %158

157:                                              ; preds = %114
  br label %158

158:                                              ; preds = %157, %155
  %159 = phi i32 [ %156, %155 ], [ 2, %157 ]
  store i32 %159, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %160 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 0
  %161 = load i32, ptr %160, align 4, !tbaa !5
  %162 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 1
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %164 = icmp sge i32 %161, %163
  %165 = zext i1 %164 to i64
  %166 = select i1 %164, i32 0, i32 1
  store i32 %166, ptr %11, align 4, !tbaa !5
  %167 = load i32, ptr %11, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 2
  %172 = load i32, ptr %171, align 4, !tbaa !5
  %173 = icmp sge i32 %170, %172
  br i1 %173, label %174, label %176

174:                                              ; preds = %158
  %175 = load i32, ptr %11, align 4, !tbaa !5
  br label %177

176:                                              ; preds = %158
  br label %177

177:                                              ; preds = %176, %174
  %178 = phi i32 [ %175, %174 ], [ 2, %176 ]
  store i32 %178, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %12, ptr align 1 @__const.main.str, i64 4, i1 false)
  %179 = load i32, ptr %10, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [4 x i8], ptr %12, i64 0, i64 %180
  %182 = load i8, ptr %181, align 1, !tbaa !9
  %183 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %182)
  %184 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %183, ptr noundef @.str)
  %185 = load i32, ptr %11, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [4 x i8], ptr %12, i64 0, i64 %186
  %188 = load i8, ptr %187, align 1, !tbaa !9
  %189 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %184, i8 noundef signext %188)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #2

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

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

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) #5 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

; 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

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


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

%"class.std::basic_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
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@__const.main.str = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca [3 x i32], align 4
  %3 = alloca [3 x i32], align 4
  %4 = alloca i8, align 1
  %5 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %6 = 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)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #5
  %7 = getelementptr inbounds i8, ptr %2, i64 4
  store i64 0, ptr %7, align 4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #5
  %8 = getelementptr inbounds i8, ptr %3, i64 4
  store i64 0, ptr %8, align 4
  %9 = load i32, ptr %1, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %13

.lr.ph:                                           ; preds = %0
  %11 = getelementptr inbounds i8, ptr %3, i64 4
  %12 = getelementptr inbounds i8, ptr %2, i64 4
  br label %50

._crit_edge:                                      ; preds = %90
  store i32 %94, ptr %11, align 4, !tbaa !5
  store i32 %92, ptr %12, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %._crit_edge, %0
  %14 = phi i32 [ %91, %._crit_edge ], [ 0, %0 ]
  %15 = phi i32 [ %94, %._crit_edge ], [ 0, %0 ]
  %16 = phi i32 [ %93, %._crit_edge ], [ 0, %0 ]
  %17 = phi i32 [ %92, %._crit_edge ], [ 0, %0 ]
  %.lcssa46 = phi i32 [ %95, %._crit_edge ], [ 0, %0 ]
  %.lcssa = phi i32 [ %96, %._crit_edge ], [ 0, %0 ]
  %.039.lcssa = phi i32 [ %.140, %._crit_edge ], [ 0, %0 ]
  %.0.lcssa = phi i32 [ %.1, %._crit_edge ], [ 0, %0 ]
  store i32 %.lcssa, ptr %3, align 4, !tbaa !5
  store i32 %.lcssa46, ptr %2, align 4, !tbaa !5
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.0.lcssa)
  %19 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull @.str)
  %20 = load i32, ptr %1, align 4, !tbaa !5
  %21 = add i32 %.0.lcssa, %.039.lcssa
  %22 = sub i32 %20, %21
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %19, i32 noundef %22)
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull @.str)
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %24, i32 noundef %.039.lcssa)
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %26, i32 noundef %.039.lcssa)
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull @.str)
  %29 = load i32, ptr %1, align 4, !tbaa !5
  %30 = sub i32 %29, %21
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %28, i32 noundef %30)
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull @.str)
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %32, i32 noundef %.0.lcssa)
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %.not = icmp slt i32 %.lcssa46, %17
  %35 = zext i1 %.not to i64
  %36 = getelementptr inbounds [3 x i32], ptr %2, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %.not42 = icmp slt i32 %37, %16
  %38 = select i1 %.not42, i64 2, i64 %35
  %.not43 = icmp slt i32 %.lcssa, %15
  %39 = zext i1 %.not43 to i64
  %40 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %.not44 = icmp slt i32 %41, %14
  %42 = select i1 %.not44, i64 2, i64 %39
  %43 = getelementptr inbounds [4 x i8], ptr @__const.main.str, i64 0, i64 %38
  %44 = load i8, ptr %43, align 1, !tbaa !9
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %44)
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %45, ptr noundef nonnull @.str)
  %47 = getelementptr inbounds [4 x i8], ptr @__const.main.str, i64 0, i64 %42
  %48 = load i8, ptr %47, align 1, !tbaa !9
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %46, i8 noundef signext %48)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0

50:                                               ; preds = %.lr.ph, %90
  %51 = phi i32 [ 0, %.lr.ph ], [ %91, %90 ]
  %52 = phi i32 [ 0, %.lr.ph ], [ %92, %90 ]
  %53 = phi i32 [ 0, %.lr.ph ], [ %93, %90 ]
  %54 = phi i32 [ 0, %.lr.ph ], [ %94, %90 ]
  %.049 = phi i32 [ 0, %.lr.ph ], [ %.1, %90 ]
  %.03948 = phi i32 [ 0, %.lr.ph ], [ %.140, %90 ]
  %.04147 = phi i32 [ 0, %.lr.ph ], [ %97, %90 ]
  %55 = phi i32 [ 0, %.lr.ph ], [ %96, %90 ]
  %56 = phi i32 [ 0, %.lr.ph ], [ %95, %90 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #5
  %57 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %4)
  %58 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) %57, ptr noundef nonnull align 1 dereferenceable(1) %5)
  %59 = load i8, ptr %4, align 1, !tbaa !9
  %60 = icmp eq i8 %59, 66
  %61 = load i8, ptr %5, align 1
  %62 = icmp eq i8 %61, 67
  %or.cond = select i1 %60, i1 %62, i1 false
  br i1 %or.cond, label %63, label %66

63:                                               ; preds = %50
  %64 = add nsw i32 %.049, 1
  %65 = add nsw i32 %56, 1
  br label %90

66:                                               ; preds = %50
  %67 = icmp eq i8 %61, 74
  %or.cond5 = select i1 %60, i1 %67, i1 false
  br i1 %or.cond5, label %68, label %71

68:                                               ; preds = %66
  %69 = add nsw i32 %.03948, 1
  %70 = add nsw i32 %51, 1
  br label %90

71:                                               ; preds = %66
  %72 = icmp eq i8 %59, 67
  %73 = icmp eq i8 %61, 66
  %or.cond8 = select i1 %72, i1 %73, i1 false
  br i1 %or.cond8, label %74, label %77

74:                                               ; preds = %71
  %75 = add nsw i32 %.03948, 1
  %76 = add nsw i32 %55, 1
  br label %90

77:                                               ; preds = %71
  %or.cond11 = select i1 %72, i1 %67, i1 false
  br i1 %or.cond11, label %78, label %81

78:                                               ; preds = %77
  %79 = add nsw i32 %.049, 1
  %80 = add nsw i32 %52, 1
  br label %90

81:                                               ; preds = %77
  %82 = icmp eq i8 %59, 74
  %or.cond14 = select i1 %82, i1 %73, i1 false
  br i1 %or.cond14, label %83, label %86

83:                                               ; preds = %81
  %84 = add nsw i32 %.049, 1
  %85 = add nsw i32 %53, 1
  br label %90

86:                                               ; preds = %81
  %or.cond17 = select i1 %82, i1 %62, i1 false
  br i1 %or.cond17, label %87, label %90

87:                                               ; preds = %86
  %88 = add nsw i32 %.03948, 1
  %89 = add nsw i32 %54, 1
  br label %90

90:                                               ; preds = %68, %78, %86, %87, %83, %74, %63
  %91 = phi i32 [ %51, %63 ], [ %70, %68 ], [ %51, %74 ], [ %51, %78 ], [ %51, %83 ], [ %51, %87 ], [ %51, %86 ]
  %92 = phi i32 [ %52, %63 ], [ %52, %68 ], [ %52, %74 ], [ %80, %78 ], [ %52, %83 ], [ %52, %87 ], [ %52, %86 ]
  %93 = phi i32 [ %53, %63 ], [ %53, %68 ], [ %53, %74 ], [ %53, %78 ], [ %85, %83 ], [ %53, %87 ], [ %53, %86 ]
  %94 = phi i32 [ %54, %63 ], [ %54, %68 ], [ %54, %74 ], [ %54, %78 ], [ %54, %83 ], [ %89, %87 ], [ %54, %86 ]
  %95 = phi i32 [ %65, %63 ], [ %56, %68 ], [ %56, %74 ], [ %56, %78 ], [ %56, %83 ], [ %56, %87 ], [ %56, %86 ]
  %96 = phi i32 [ %55, %63 ], [ %55, %68 ], [ %76, %74 ], [ %55, %78 ], [ %55, %83 ], [ %55, %87 ], [ %55, %86 ]
  %.140 = phi i32 [ %.03948, %63 ], [ %69, %68 ], [ %75, %74 ], [ %.03948, %78 ], [ %.03948, %83 ], [ %88, %87 ], [ %.03948, %86 ]
  %.1 = phi i32 [ %64, %63 ], [ %.049, %68 ], [ %.049, %74 ], [ %79, %78 ], [ %84, %83 ], [ %.049, %87 ], [ %.049, %86 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  %97 = add nuw nsw i32 %.04147, 1
  %98 = load i32, ptr %1, align 4, !tbaa !5
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %50, label %._crit_edge, !llvm.loop !10
}

; 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(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2

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

; 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

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 #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #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 = { 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 = { 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 = { 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: BDCEPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopRotatePass,LoopUnrollPass,SROAPass,SimplifyCFGPass