; LLVM IR from upupming/algorithm :: acwing/算法竞赛进阶指南/0x18-总结与练习/159. 奶牛矩阵 (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" }

@str = external dso_local global [10010 x [100 x i8]], align 16
@r = external dso_local global i32, align 4
@c = external dso_local global i32, align 4
@Next = external dso_local global [10010 x i32], align 16
@st = external dso_local global [100 x i8], align 16
@_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 i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @r)
  %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) @c)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %101, %0
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = load i32, ptr @r, align 4, !tbaa !5
  %19 = icmp sle i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %104

21:                                               ; preds = %16
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [10010 x [100 x i8]], ptr @str, i64 0, i64 %23
  %25 = getelementptr inbounds [100 x i8], ptr %24, i64 0, i64 0
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %25)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %97, %21
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = load i32, ptr @c, align 4, !tbaa !5
  %30 = icmp sle i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %100

32:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #6
  store i8 1, ptr %5, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %33 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %33, ptr %6, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %84, %32
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = load i32, ptr @c, align 4, !tbaa !5
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %39, label %38

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

39:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %75, %39
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %44, label %50

44:                                               ; preds = %40
  %45 = load i32, ptr %6, align 4, !tbaa !5
  %46 = load i32, ptr %7, align 4, !tbaa !5
  %47 = add nsw i32 %45, %46
  %48 = load i32, ptr @c, align 4, !tbaa !5
  %49 = icmp slt i32 %47, %48
  br label %50

50:                                               ; preds = %44, %40
  %51 = phi i1 [ false, %40 ], [ %49, %44 ]
  br i1 %51, label %53, label %52

52:                                               ; preds = %50
  store i32 11, ptr %3, align 4
  br label %78

53:                                               ; preds = %50
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [10010 x [100 x i8]], ptr @str, i64 0, i64 %55
  %57 = load i32, ptr %7, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [100 x i8], ptr %56, i64 0, i64 %58
  %60 = load i8, ptr %59, align 1, !tbaa !11
  %61 = sext i8 %60 to i32
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [10010 x [100 x i8]], ptr @str, i64 0, i64 %63
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = add nsw i32 %65, %66
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [100 x i8], ptr %64, i64 0, i64 %68
  %70 = load i8, ptr %69, align 1, !tbaa !11
  %71 = sext i8 %70 to i32
  %72 = icmp ne i32 %61, %71
  br i1 %72, label %73, label %74

73:                                               ; preds = %53
  store i8 0, ptr %5, align 1, !tbaa !9
  store i32 11, ptr %3, align 4
  br label %78

74:                                               ; preds = %53
  br label %75

75:                                               ; preds = %74
  %76 = load i32, ptr %7, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %7, align 4, !tbaa !5
  br label %40, !llvm.loop !12

78:                                               ; preds = %73, %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %79

79:                                               ; preds = %78
  %80 = load i8, ptr %5, align 1, !tbaa !9, !range !14, !noundef !15
  %81 = trunc i8 %80 to i1
  br i1 %81, label %83, label %82

82:                                               ; preds = %79
  store i32 8, ptr %3, align 4
  br label %88

83:                                               ; preds = %79
  br label %84

84:                                               ; preds = %83
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = add nsw i32 %86, %85
  store i32 %87, ptr %6, align 4, !tbaa !5
  br label %34, !llvm.loop !16

88:                                               ; preds = %82, %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %89

89:                                               ; preds = %88
  %90 = load i8, ptr %5, align 1, !tbaa !9, !range !14, !noundef !15
  %91 = trunc i8 %90 to i1
  br i1 %91, label %96, label %92

92:                                               ; preds = %89
  %93 = load i32, ptr %4, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [100 x i8], ptr @st, i64 0, i64 %94
  store i8 1, ptr %95, align 1, !tbaa !9
  br label %96

96:                                               ; preds = %92, %89
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %4, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %4, align 4, !tbaa !5
  br label %27, !llvm.loop !17

100:                                              ; preds = %31
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %2, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %2, align 4, !tbaa !5
  br label %16, !llvm.loop !18

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

105:                                              ; preds = %119, %104
  %106 = load i32, ptr %9, align 4, !tbaa !5
  %107 = load i32, ptr @c, align 4, !tbaa !5
  %108 = icmp sle i32 %106, %107
  br i1 %108, label %110, label %109

109:                                              ; preds = %105
  store i32 14, ptr %3, align 4
  br label %122

110:                                              ; preds = %105
  %111 = load i32, ptr %9, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [100 x i8], ptr @st, i64 0, i64 %112
  %114 = load i8, ptr %113, align 1, !tbaa !9, !range !14, !noundef !15
  %115 = trunc i8 %114 to i1
  br i1 %115, label %118, label %116

116:                                              ; preds = %110
  %117 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %117, ptr %8, align 4, !tbaa !5
  store i32 14, ptr %3, align 4
  br label %122

118:                                              ; preds = %110
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %9, align 4, !tbaa !5
  br label %105, !llvm.loop !19

122:                                              ; preds = %116, %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %123

123:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %124

124:                                              ; preds = %136, %123
  %125 = load i32, ptr %10, align 4, !tbaa !5
  %126 = load i32, ptr @r, align 4, !tbaa !5
  %127 = icmp sle i32 %125, %126
  br i1 %127, label %129, label %128

128:                                              ; preds = %124
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %139

129:                                              ; preds = %124
  %130 = load i32, ptr %10, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [10010 x [100 x i8]], ptr @str, i64 0, i64 %131
  %133 = load i32, ptr %8, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [100 x i8], ptr %132, i64 0, i64 %134
  store i8 0, ptr %135, align 1, !tbaa !11
  br label %136

136:                                              ; preds = %129
  %137 = load i32, ptr %10, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %10, align 4, !tbaa !5
  br label %124, !llvm.loop !20

139:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 2, ptr %12, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %188, %139
  %141 = load i32, ptr %12, align 4, !tbaa !5
  %142 = load i32, ptr @r, align 4, !tbaa !5
  %143 = icmp sle i32 %141, %142
  br i1 %143, label %145, label %144

144:                                              ; preds = %140
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %191

145:                                              ; preds = %140
  br label %146

146:                                              ; preds = %163, %145
  %147 = load i32, ptr %11, align 4, !tbaa !5
  %148 = icmp sgt i32 %147, 0
  br i1 %148, label %149, label %161

149:                                              ; preds = %146
  %150 = load i32, ptr %11, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [10010 x [100 x i8]], ptr @str, i64 0, i64 %152
  %154 = getelementptr inbounds [100 x i8], ptr %153, i64 0, i64 0
  %155 = load i32, ptr %12, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [10010 x [100 x i8]], ptr @str, i64 0, i64 %156
  %158 = getelementptr inbounds [100 x i8], ptr %157, i64 0, i64 0
  %159 = call i32 @strcmp(ptr noundef %154, ptr noundef %158) #7
  %160 = icmp ne i32 %159, 0
  br label %161

161:                                              ; preds = %149, %146
  %162 = phi i1 [ false, %146 ], [ %160, %149 ]
  br i1 %162, label %163, label %168

163:                                              ; preds = %161
  %164 = load i32, ptr %11, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [10010 x i32], ptr @Next, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !5
  store i32 %167, ptr %11, align 4, !tbaa !5
  br label %146, !llvm.loop !21

168:                                              ; preds = %161
  %169 = load i32, ptr %11, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [10010 x [100 x i8]], ptr @str, i64 0, i64 %171
  %173 = getelementptr inbounds [100 x i8], ptr %172, i64 0, i64 0
  %174 = load i32, ptr %12, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [10010 x [100 x i8]], ptr @str, i64 0, i64 %175
  %177 = getelementptr inbounds [100 x i8], ptr %176, i64 0, i64 0
  %178 = call i32 @strcmp(ptr noundef %173, ptr noundef %177) #7
  %179 = icmp ne i32 %178, 0
  br i1 %179, label %183, label %180

180:                                              ; preds = %168
  %181 = load i32, ptr %11, align 4, !tbaa !5
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %11, align 4, !tbaa !5
  br label %183

183:                                              ; preds = %180, %168
  %184 = load i32, ptr %11, align 4, !tbaa !5
  %185 = load i32, ptr %12, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [10010 x i32], ptr @Next, i64 0, i64 %186
  store i32 %184, ptr %187, align 4, !tbaa !5
  br label %188

188:                                              ; preds = %183
  %189 = load i32, ptr %12, align 4, !tbaa !5
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %12, align 4, !tbaa !5
  br label %140, !llvm.loop !22

191:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %192 = load i32, ptr @r, align 4, !tbaa !5
  %193 = load i32, ptr @r, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [10010 x i32], ptr @Next, i64 0, i64 %194
  %196 = load i32, ptr %195, align 4, !tbaa !5
  %197 = sub nsw i32 %192, %196
  store i32 %197, ptr %13, align 4, !tbaa !5
  %198 = load i32, ptr %8, align 4, !tbaa !5
  %199 = load i32, ptr %13, align 4, !tbaa !5
  %200 = mul nsw i32 %198, %199
  %201 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %200)
  %202 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %201, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %203 = load i32, ptr %1, align 4
  ret i32 %203
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull) #3

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #4

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #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)) #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 willreturn memory(read) "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 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }

!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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !13}
!21 = distinct !{!21, !13}
!22 = distinct !{!22, !13}


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

@str = external dso_local global [10010 x [100 x i8]], align 16
@r = external dso_local global i32, align 4
@c = external dso_local global i32, align 4
@Next = external dso_local local_unnamed_addr global [10010 x i32], align 16
@st = external dso_local local_unnamed_addr global [100 x i8], align 16
@_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 = 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) @r)
  %2 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(4) @c)
  %3 = load i32, ptr @r, align 4, !tbaa !5
  %.not77 = icmp slt i32 %3, 1
  br i1 %.not77, label %..preheader69_crit_edge, label %.lr.ph

..preheader69_crit_edge:                          ; preds = %0
  %.pre = load i32, ptr @c, align 4, !tbaa !5
  br label %.preheader69

.preheader69:                                     ; preds = %._crit_edge, %..preheader69_crit_edge
  %4 = phi i32 [ %.pre, %..preheader69_crit_edge ], [ %8, %._crit_edge ]
  %.lcssa = phi i32 [ %3, %..preheader69_crit_edge ], [ %12, %._crit_edge ]
  %.not5980 = icmp slt i32 %4, 1
  br i1 %.not5980, label %._crit_edge83, label %.lr.ph82.preheader

.lr.ph82.preheader:                               ; preds = %.preheader69
  %5 = add nuw i32 %4, 1
  %wide.trip.count = zext i32 %5 to i64
  br label %.lr.ph82

.lr.ph:                                           ; preds = %0, %._crit_edge
  %indvars.iv110 = phi i64 [ %indvars.iv.next111, %._crit_edge ], [ 1, %0 ]
  %6 = getelementptr inbounds [10010 x [100 x i8]], ptr @str, i64 0, i64 %indvars.iv110
  %7 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %6)
  %8 = load i32, ptr @c, align 4, !tbaa !5
  %.not6474 = icmp slt i32 %8, 1
  br i1 %.not6474, label %._crit_edge, label %.preheader71.preheader

.preheader71.preheader:                           ; preds = %.lr.ph
  %9 = zext nneg i32 %8 to i64
  %10 = add nuw i32 %8, 1
  %wide.trip.count108 = zext i32 %10 to i64
  br label %.preheader71

.preheader71:                                     ; preds = %.preheader71.preheader, %.loopexit
  %indvars.iv102 = phi i64 [ 1, %.preheader71.preheader ], [ %indvars.iv.next103, %.loopexit ]
  %11 = icmp ult i64 %indvars.iv102, %9
  br i1 %11, label %.preheader70, label %.loopexit

._crit_edge:                                      ; preds = %.loopexit, %.lr.ph
  %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
  %12 = load i32, ptr @r, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %.not.not = icmp slt i64 %indvars.iv110, %13
  br i1 %.not.not, label %.lr.ph, label %.preheader69, !llvm.loop !9

.preheader70:                                     ; preds = %.preheader71, %.critedge
  %indvars.iv104 = phi i64 [ %indvars.iv.next105, %.critedge ], [ %indvars.iv102, %.preheader71 ]
  br label %15

14:                                               ; preds = %18
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv102
  br i1 %exitcond.not, label %.critedge, label %15, !llvm.loop !11

15:                                               ; preds = %.preheader70, %14
  %indvars.iv = phi i64 [ 0, %.preheader70 ], [ %indvars.iv.next, %14 ]
  %16 = add nuw nsw i64 %indvars.iv, %indvars.iv104
  %17 = icmp ult i64 %16, %9
  br i1 %17, label %18, label %.critedge

18:                                               ; preds = %15
  %19 = getelementptr inbounds [10010 x [100 x i8]], ptr @str, i64 0, i64 %indvars.iv110, i64 %indvars.iv
  %20 = load i8, ptr %19, align 1, !tbaa !12
  %21 = getelementptr inbounds [10010 x [100 x i8]], ptr @str, i64 0, i64 %indvars.iv110, i64 %16
  %22 = load i8, ptr %21, align 1, !tbaa !12
  %.not65 = icmp eq i8 %20, %22
  br i1 %.not65, label %14, label %.thread

.critedge:                                        ; preds = %14, %15
  %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, %indvars.iv102
  %23 = trunc nuw i64 %indvars.iv.next105 to i32
  %24 = icmp sgt i32 %8, %23
  br i1 %24, label %.preheader70, label %.loopexit, !llvm.loop !13

.thread:                                          ; preds = %18
  %25 = getelementptr inbounds [100 x i8], ptr @st, i64 0, i64 %indvars.iv102
  store i8 1, ptr %25, align 1, !tbaa !14
  br label %.loopexit

.loopexit:                                        ; preds = %.critedge, %.preheader71, %.thread
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %exitcond109.not = icmp eq i64 %indvars.iv.next103, %wide.trip.count108
  br i1 %exitcond109.not, label %._crit_edge, label %.preheader71, !llvm.loop !16

.lr.ph82:                                         ; preds = %.lr.ph82.preheader, %29
  %indvars.iv113 = phi i64 [ 1, %.lr.ph82.preheader ], [ %indvars.iv.next114, %29 ]
  %26 = getelementptr inbounds [100 x i8], ptr @st, i64 0, i64 %indvars.iv113
  %27 = load i8, ptr %26, align 1, !tbaa !14, !range !17, !noundef !18
  %28 = trunc nuw i8 %27 to i1
  br i1 %28, label %29, label %._crit_edge83.loopexit.split.loop.exit

29:                                               ; preds = %.lr.ph82
  %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
  %exitcond116.not = icmp eq i64 %indvars.iv.next114, %wide.trip.count
  br i1 %exitcond116.not, label %._crit_edge83, label %.lr.ph82, !llvm.loop !19

._crit_edge83.loopexit.split.loop.exit:           ; preds = %.lr.ph82
  %30 = trunc nuw nsw i64 %indvars.iv113 to i32
  br label %._crit_edge83

._crit_edge83:                                    ; preds = %29, %._crit_edge83.loopexit.split.loop.exit, %.preheader69
  %.048.lcssa = phi i32 [ 1, %.preheader69 ], [ %30, %._crit_edge83.loopexit.split.loop.exit ], [ %5, %29 ]
  %.not6087 = icmp slt i32 %.lcssa, 1
  br i1 %.not6087, label %._crit_edge99, label %.lr.ph90

.lr.ph90:                                         ; preds = %._crit_edge83
  %31 = zext nneg i32 %.048.lcssa to i64
  %32 = zext nneg i32 %.lcssa to i64
  %xtraiter = and i64 %32, 3
  %33 = icmp ult i32 %.lcssa, 4
  br i1 %33, label %.preheader68.unr-lcssa, label %.lr.ph90.new

.lr.ph90.new:                                     ; preds = %.lr.ph90
  %unroll_iter = and i64 %32, 2147483644
  br label %36

.preheader68.unr-lcssa:                           ; preds = %36, %.lr.ph90
  %indvars.iv117.unr = phi i64 [ 1, %.lr.ph90 ], [ %indvars.iv.next118.3, %36 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader68, label %.epil.preheader

.epil.preheader:                                  ; preds = %.preheader68.unr-lcssa, %.epil.preheader
  %indvars.iv117.epil = phi i64 [ %indvars.iv.next118.epil, %.epil.preheader ], [ %indvars.iv117.unr, %.preheader68.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %.preheader68.unr-lcssa ]
  %34 = getelementptr inbounds [10010 x [100 x i8]], ptr @str, i64 0, i64 %indvars.iv117.epil, i64 %31
  store i8 0, ptr %34, align 1, !tbaa !12
  %indvars.iv.next118.epil = add nuw nsw i64 %indvars.iv117.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader68, label %.epil.preheader, !llvm.loop !20

.preheader68:                                     ; preds = %.epil.preheader, %.preheader68.unr-lcssa
  %.not6196 = icmp eq i32 %.lcssa, 1
  br i1 %.not6196, label %._crit_edge99, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader68
  %35 = add nuw i32 %.lcssa, 1
  %wide.trip.count125 = zext i32 %35 to i64
  br label %.preheader

36:                                               ; preds = %36, %.lr.ph90.new
  %indvars.iv117 = phi i64 [ 1, %.lr.ph90.new ], [ %indvars.iv.next118.3, %36 ]
  %niter = phi i64 [ 0, %.lr.ph90.new ], [ %niter.next.3, %36 ]
  %37 = getelementptr inbounds [10010 x [100 x i8]], ptr @str, i64 0, i64 %indvars.iv117, i64 %31
  store i8 0, ptr %37, align 1, !tbaa !12
  %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
  %38 = getelementptr inbounds [10010 x [100 x i8]], ptr @str, i64 0, i64 %indvars.iv.next118, i64 %31
  store i8 0, ptr %38, align 1, !tbaa !12
  %indvars.iv.next118.1 = add nuw nsw i64 %indvars.iv117, 2
  %39 = getelementptr inbounds [10010 x [100 x i8]], ptr @str, i64 0, i64 %indvars.iv.next118.1, i64 %31
  store i8 0, ptr %39, align 1, !tbaa !12
  %indvars.iv.next118.2 = add nuw nsw i64 %indvars.iv117, 3
  %40 = getelementptr inbounds [10010 x [100 x i8]], ptr @str, i64 0, i64 %indvars.iv.next118.2, i64 %31
  store i8 0, ptr %40, align 1, !tbaa !12
  %indvars.iv.next118.3 = add nuw nsw i64 %indvars.iv117, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader68.unr-lcssa, label %36, !llvm.loop !22

.preheader:                                       ; preds = %.preheader.preheader, %.critedge2
  %indvars.iv122 = phi i64 [ 2, %.preheader.preheader ], [ %indvars.iv.next123, %.critedge2 ]
  %.04697 = phi i32 [ 0, %.preheader.preheader ], [ %spec.select, %.critedge2 ]
  %41 = icmp sgt i32 %.04697, 0
  br i1 %41, label %.lr.ph92, label %.critedge2

.lr.ph92:                                         ; preds = %.preheader
  %42 = getelementptr inbounds [10010 x [100 x i8]], ptr @str, i64 0, i64 %indvars.iv122
  br label %50

._crit_edge99:                                    ; preds = %.critedge2, %._crit_edge83, %.preheader68
  %43 = sext i32 %.lcssa to i64
  %44 = getelementptr inbounds [10010 x i32], ptr @Next, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = sub nsw i32 %.lcssa, %45
  %47 = mul nsw i32 %46, %.048.lcssa
  %48 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %47)
  %49 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

50:                                               ; preds = %.lr.ph92, %55
  %.191 = phi i32 [ %.04697, %.lr.ph92 ], [ %58, %55 ]
  %51 = add nuw nsw i32 %.191, 1
  %52 = zext nneg i32 %51 to i64
  %53 = getelementptr inbounds [10010 x [100 x i8]], ptr @str, i64 0, i64 %52
  %54 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %53, ptr noundef nonnull dereferenceable(1) %42) #5
  %.not62 = icmp eq i32 %54, 0
  br i1 %.not62, label %.critedge2, label %55

55:                                               ; preds = %50
  %56 = zext nneg i32 %.191 to i64
  %57 = getelementptr inbounds [10010 x i32], ptr @Next, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = icmp sgt i32 %58, 0
  br i1 %59, label %50, label %.critedge2, !llvm.loop !23

.critedge2:                                       ; preds = %50, %55, %.preheader
  %.1.lcssa = phi i32 [ %.04697, %.preheader ], [ %58, %55 ], [ %.191, %50 ]
  %60 = add nsw i32 %.1.lcssa, 1
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [10010 x [100 x i8]], ptr @str, i64 0, i64 %61
  %63 = getelementptr inbounds [10010 x [100 x i8]], ptr @str, i64 0, i64 %indvars.iv122
  %64 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %62, ptr noundef nonnull dereferenceable(1) %63) #5
  %.not63 = icmp eq i32 %64, 0
  %spec.select = select i1 %.not63, i32 %60, i32 %.1.lcssa
  %65 = getelementptr inbounds [10010 x i32], ptr @Next, i64 0, i64 %indvars.iv122
  store i32 %spec.select, ptr %65, align 4, !tbaa !5
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %exitcond126.not = icmp eq i64 %indvars.iv.next123, %wide.trip.count125
  br i1 %exitcond126.not, label %._crit_edge99, label %.preheader, !llvm.loop !24
}

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 #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture 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 #1

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

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 = { 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 #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 willreturn memory(read) }

!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 = !{!7, !7, i64 0}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = distinct !{!16, !10}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}


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