; LLVM IR from Tunghohin/Competitive_Coding :: Nowcoder/34649_B.ll (Z5solvev)

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

@is_stu = external dso_local global [210 x i8], align 16
@go_home = external dso_local global [210 x i8], align 16
@mp = external dso_local global [210 x [210 x i8]], align 16
@head = external dso_local global [1010 x i32], align 16
@tot = external dso_local global i32, align 4
@vis = external dso_local global [1010 x i8], align 16
@matched = external dso_local global [1010 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z8add_edgeii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z2KMi(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: mustprogress uwtable
define dso_local void @_Z5solvev() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %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
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  %12 = 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.memset.p0.i64(ptr align 16 @matched, i8 0, i64 4040, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @head, i8 0, i64 4040, i1 false)
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %23, %0
  %14 = load i32, ptr %3, align 4, !tbaa !5
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = icmp sle i32 %14, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %26

18:                                               ; preds = %13
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [210 x i8], ptr @is_stu, i64 0, i64 %20
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERb(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %21)
  br label %23

23:                                               ; preds = %18
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %3, align 4, !tbaa !5
  br label %13, !llvm.loop !9

26:                                               ; preds = %17
  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 = %62, %26
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = load i32, ptr %1, align 4, !tbaa !5
  %30 = icmp sle i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %65

32:                                               ; preds = %27
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [210 x i8], ptr @go_home, i64 0, i64 %34
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERb(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %35)
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [210 x i8], ptr @is_stu, i64 0, i64 %38
  %40 = load i8, ptr %39, align 1, !tbaa !11, !range !13, !noundef !14
  %41 = trunc i8 %40 to i1
  br i1 %41, label %42, label %51

42:                                               ; preds = %32
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [210 x i8], ptr @go_home, i64 0, i64 %44
  %46 = load i8, ptr %45, align 1, !tbaa !11, !range !13, !noundef !14
  %47 = trunc i8 %46 to i1
  br i1 %47, label %51, label %48

48:                                               ; preds = %42
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %2, align 4, !tbaa !5
  br label %61

51:                                               ; preds = %42, %32
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [210 x i8], ptr @is_stu, i64 0, i64 %53
  %55 = load i8, ptr %54, align 1, !tbaa !11, !range !13, !noundef !14
  %56 = trunc i8 %55 to i1
  br i1 %56, label %60, label %57

57:                                               ; preds = %51
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %2, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %57, %51
  br label %61

61:                                               ; preds = %60, %48
  br label %62

62:                                               ; preds = %61
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %4, align 4, !tbaa !5
  br label %27, !llvm.loop !15

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

66:                                               ; preds = %115, %65
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = load i32, ptr %1, align 4, !tbaa !5
  %69 = icmp sle i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %118

71:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %98, %71
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = load i32, ptr %1, align 4, !tbaa !5
  %75 = icmp sle i32 %73, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %72
  store i32 11, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %101

77:                                               ; preds = %72
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [210 x [210 x i8]], ptr @mp, i64 0, i64 %79
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [210 x i8], ptr %80, i64 0, i64 %82
  %84 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERb(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %83)
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [210 x i8], ptr @is_stu, i64 0, i64 %86
  %88 = load i8, ptr %87, align 1, !tbaa !11, !range !13, !noundef !14
  %89 = trunc i8 %88 to i1
  br i1 %89, label %97, label %90

90:                                               ; preds = %77
  %91 = load i32, ptr %5, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [210 x [210 x i8]], ptr @mp, i64 0, i64 %92
  %94 = load i32, ptr %7, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [210 x i8], ptr %93, i64 0, i64 %95
  store i8 0, ptr %96, align 1, !tbaa !11
  br label %97

97:                                               ; preds = %90, %77
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %7, align 4, !tbaa !5
  br label %72, !llvm.loop !16

101:                                              ; preds = %76
  %102 = load i32, ptr %5, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [210 x i8], ptr @is_stu, i64 0, i64 %103
  %105 = load i8, ptr %104, align 1, !tbaa !11, !range !13, !noundef !14
  %106 = trunc i8 %105 to i1
  br i1 %106, label %107, label %114

107:                                              ; preds = %101
  %108 = load i32, ptr %5, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [210 x [210 x i8]], ptr @mp, i64 0, i64 %109
  %111 = load i32, ptr %5, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [210 x i8], ptr %110, i64 0, i64 %112
  store i8 1, ptr %113, align 1, !tbaa !11
  br label %114

114:                                              ; preds = %107, %101
  br label %115

115:                                              ; preds = %114
  %116 = load i32, ptr %5, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %5, align 4, !tbaa !5
  br label %66, !llvm.loop !17

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

119:                                              ; preds = %149, %118
  %120 = load i32, ptr %8, align 4, !tbaa !5
  %121 = load i32, ptr %1, align 4, !tbaa !5
  %122 = icmp sle i32 %120, %121
  br i1 %122, label %124, label %123

123:                                              ; preds = %119
  store i32 14, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %152

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

125:                                              ; preds = %145, %124
  %126 = load i32, ptr %9, align 4, !tbaa !5
  %127 = load i32, ptr %1, align 4, !tbaa !5
  %128 = icmp sle i32 %126, %127
  br i1 %128, label %130, label %129

129:                                              ; preds = %125
  store i32 17, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %148

130:                                              ; preds = %125
  %131 = load i32, ptr %8, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [210 x [210 x i8]], ptr @mp, i64 0, i64 %132
  %134 = load i32, ptr %9, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [210 x i8], ptr %133, i64 0, i64 %135
  %137 = load i8, ptr %136, align 1, !tbaa !11, !range !13, !noundef !14
  %138 = trunc i8 %137 to i1
  br i1 %138, label %139, label %144

139:                                              ; preds = %130
  %140 = load i32, ptr %8, align 4, !tbaa !5
  %141 = load i32, ptr %9, align 4, !tbaa !5
  %142 = load i32, ptr %1, align 4, !tbaa !5
  %143 = add nsw i32 %141, %142
  call void @_Z8add_edgeii(i32 noundef %140, i32 noundef %143)
  br label %144

144:                                              ; preds = %139, %130
  br label %145

145:                                              ; preds = %144
  %146 = load i32, ptr %9, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %9, align 4, !tbaa !5
  br label %125, !llvm.loop !18

148:                                              ; preds = %129
  br label %149

149:                                              ; preds = %148
  %150 = load i32, ptr %8, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %8, align 4, !tbaa !5
  br label %119, !llvm.loop !19

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

153:                                              ; preds = %178, %152
  %154 = load i32, ptr %11, align 4, !tbaa !5
  %155 = load i32, ptr %1, align 4, !tbaa !5
  %156 = icmp sle i32 %154, %155
  br i1 %156, label %158, label %157

157:                                              ; preds = %153
  store i32 20, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %181

158:                                              ; preds = %153
  %159 = load i32, ptr %11, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [210 x i8], ptr @is_stu, i64 0, i64 %160
  %162 = load i8, ptr %161, align 1, !tbaa !11, !range !13, !noundef !14
  %163 = trunc i8 %162 to i1
  br i1 %163, label %164, label %171

164:                                              ; preds = %158
  %165 = load i32, ptr %11, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [210 x i8], ptr @go_home, i64 0, i64 %166
  %168 = load i8, ptr %167, align 1, !tbaa !11, !range !13, !noundef !14
  %169 = trunc i8 %168 to i1
  br i1 %169, label %170, label %171

170:                                              ; preds = %164
  br label %178

171:                                              ; preds = %164, %158
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 1010, i1 false)
  %172 = load i32, ptr %11, align 4, !tbaa !5
  %173 = call noundef zeroext i1 @_Z2KMi(i32 noundef %172)
  br i1 %173, label %174, label %177

174:                                              ; preds = %171
  %175 = load i32, ptr %10, align 4, !tbaa !5
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %10, align 4, !tbaa !5
  br label %177

177:                                              ; preds = %174, %171
  br label %178

178:                                              ; preds = %177, %170
  %179 = load i32, ptr %11, align 4, !tbaa !5
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %11, align 4, !tbaa !5
  br label %153, !llvm.loop !20

181:                                              ; preds = %157
  %182 = load i32, ptr %10, align 4, !tbaa !5
  %183 = load i32, ptr %2, align 4, !tbaa !5
  %184 = icmp sge i32 %182, %183
  br i1 %184, label %185, label %187

185:                                              ; preds = %181
  %186 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  br label %189

187:                                              ; preds = %181
  %188 = 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)
  br label %189

189:                                              ; preds = %187, %185
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  ret void
}

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERb(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #1 align 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) #5

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 #6 = { 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 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@is_stu = external dso_local global [210 x i8], align 16
@go_home = external dso_local global [210 x i8], align 16
@mp = external dso_local global [210 x [210 x i8]], align 16
@head = external dso_local local_unnamed_addr global [1010 x i32], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@vis = external dso_local local_unnamed_addr global [1010 x i8], align 16
@matched = external dso_local local_unnamed_addr global [1010 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z8add_edgeii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z2KMi(i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %2 = 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.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4040) @matched, i8 0, i64 4040, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4040) @head, i8 0, i64 4040, i1 false)
  store i32 0, ptr @tot, align 4, !tbaa !5
  %3 = load i32, ptr %1, align 4, !tbaa !5
  %.not62 = icmp slt i32 %3, 1
  br i1 %.not62, label %._crit_edge83.thread, label %.lr.ph

.preheader61:                                     ; preds = %.lr.ph
  %.not4964 = icmp slt i32 %6, 1
  br i1 %.not4964, label %._crit_edge83.thread, label %.lr.ph67

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %4 = getelementptr inbounds [210 x i8], ptr @is_stu, i64 0, i64 %indvars.iv
  %5 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERb(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %4)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %6 = load i32, ptr %1, align 4, !tbaa !5
  %7 = sext i32 %6 to i64
  %.not.not = icmp slt i64 %indvars.iv, %7
  br i1 %.not.not, label %.lr.ph, label %.preheader61, !llvm.loop !9

.preheader60:                                     ; preds = %18
  %.not5071 = icmp slt i32 %19, 1
  br i1 %.not5071, label %._crit_edge83, label %.preheader59

.lr.ph67:                                         ; preds = %.preheader61, %18
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %18 ], [ 1, %.preheader61 ]
  %.04665 = phi i32 [ %spec.select, %18 ], [ 0, %.preheader61 ]
  %8 = getelementptr inbounds [210 x i8], ptr @go_home, i64 0, i64 %indvars.iv88
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERb(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %8)
  %10 = getelementptr inbounds [210 x i8], ptr @is_stu, i64 0, i64 %indvars.iv88
  %11 = load i8, ptr %10, align 1, !tbaa !11, !range !13, !noundef !14
  %12 = trunc nuw i8 %11 to i1
  br i1 %12, label %13, label %16

13:                                               ; preds = %.lr.ph67
  %14 = load i8, ptr %8, align 1, !tbaa !11, !range !13, !noundef !14
  %15 = trunc nuw i8 %14 to i1
  br i1 %15, label %16, label %18

16:                                               ; preds = %13, %.lr.ph67
  %not. = xor i1 %12, true
  %17 = zext i1 %not. to i32
  br label %18

18:                                               ; preds = %13, %16
  %.sink = phi i32 [ %17, %16 ], [ 1, %13 ]
  %spec.select = add nuw nsw i32 %.04665, %.sink
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %19 = load i32, ptr %1, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %.not49.not = icmp slt i64 %indvars.iv88, %20
  br i1 %.not49.not, label %.lr.ph67, label %.preheader60, !llvm.loop !15

.preheader59:                                     ; preds = %.preheader60, %37
  %21 = phi i32 [ %22, %37 ], [ %19, %.preheader60 ]
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %37 ], [ 1, %.preheader60 ]
  %.not5568 = icmp slt i32 %21, 1
  br i1 %.not5568, label %._crit_edge, label %.lr.ph70

.preheader58:                                     ; preds = %37
  %.not5177 = icmp slt i32 %22, 1
  br i1 %.not5177, label %._crit_edge83, label %.preheader57

._crit_edge:                                      ; preds = %32, %.preheader59
  %22 = phi i32 [ %21, %.preheader59 ], [ %33, %32 ]
  %23 = getelementptr inbounds [210 x i8], ptr @is_stu, i64 0, i64 %indvars.iv94
  %24 = load i8, ptr %23, align 1, !tbaa !11, !range !13, !noundef !14
  %25 = trunc nuw i8 %24 to i1
  br i1 %25, label %35, label %37

.lr.ph70:                                         ; preds = %.preheader59, %32
  %indvars.iv91 = phi i64 [ %indvars.iv.next92, %32 ], [ 1, %.preheader59 ]
  %26 = getelementptr inbounds [210 x [210 x i8]], ptr @mp, i64 0, i64 %indvars.iv94, i64 %indvars.iv91
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERb(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %26)
  %28 = getelementptr inbounds [210 x i8], ptr @is_stu, i64 0, i64 %indvars.iv91
  %29 = load i8, ptr %28, align 1, !tbaa !11, !range !13, !noundef !14
  %30 = trunc nuw i8 %29 to i1
  br i1 %30, label %32, label %31

31:                                               ; preds = %.lr.ph70
  store i8 0, ptr %26, align 1, !tbaa !11
  br label %32

32:                                               ; preds = %.lr.ph70, %31
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %33 = load i32, ptr %1, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %.not55.not = icmp slt i64 %indvars.iv91, %34
  br i1 %.not55.not, label %.lr.ph70, label %._crit_edge, !llvm.loop !16

35:                                               ; preds = %._crit_edge
  %36 = getelementptr inbounds [210 x [210 x i8]], ptr @mp, i64 0, i64 %indvars.iv94, i64 %indvars.iv94
  store i8 1, ptr %36, align 1, !tbaa !11
  br label %37

37:                                               ; preds = %._crit_edge, %35
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %38 = sext i32 %22 to i64
  %.not50.not = icmp slt i64 %indvars.iv94, %38
  br i1 %.not50.not, label %.preheader59, label %.preheader58, !llvm.loop !17

.preheader57:                                     ; preds = %.preheader58, %._crit_edge76
  %39 = phi i32 [ %41, %._crit_edge76 ], [ %22, %.preheader58 ]
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %._crit_edge76 ], [ 1, %.preheader58 ]
  %.not5473 = icmp slt i32 %39, 1
  br i1 %.not5473, label %._crit_edge76, label %.lr.ph75

.lr.ph75:                                         ; preds = %.preheader57
  %40 = trunc nuw nsw i64 %indvars.iv103 to i32
  br label %43

.preheader:                                       ; preds = %._crit_edge76
  %.not5279 = icmp slt i32 %41, 1
  br i1 %.not5279, label %._crit_edge83, label %.lr.ph82

._crit_edge76:                                    ; preds = %52, %.preheader57
  %41 = phi i32 [ %39, %.preheader57 ], [ %53, %52 ]
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %42 = sext i32 %41 to i64
  %.not51.not = icmp slt i64 %indvars.iv103, %42
  br i1 %.not51.not, label %.preheader57, label %.preheader, !llvm.loop !19

43:                                               ; preds = %.lr.ph75, %52
  %44 = phi i32 [ %39, %.lr.ph75 ], [ %53, %52 ]
  %45 = phi i32 [ %39, %.lr.ph75 ], [ %54, %52 ]
  %indvars.iv100 = phi i64 [ 1, %.lr.ph75 ], [ %indvars.iv.next101, %52 ]
  %46 = getelementptr inbounds [210 x [210 x i8]], ptr @mp, i64 0, i64 %indvars.iv103, i64 %indvars.iv100
  %47 = load i8, ptr %46, align 1, !tbaa !11, !range !13, !noundef !14
  %48 = trunc nuw i8 %47 to i1
  br i1 %48, label %49, label %52

49:                                               ; preds = %43
  %50 = trunc nuw nsw i64 %indvars.iv100 to i32
  %51 = add nsw i32 %45, %50
  call void @_Z8add_edgeii(i32 noundef %40, i32 noundef %51)
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %43, %49
  %53 = phi i32 [ %44, %43 ], [ %.pre, %49 ]
  %54 = phi i32 [ %45, %43 ], [ %.pre, %49 ]
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %55 = sext i32 %54 to i64
  %.not54.not = icmp slt i64 %indvars.iv100, %55
  br i1 %.not54.not, label %43, label %._crit_edge76, !llvm.loop !20

._crit_edge83:                                    ; preds = %68, %.preheader60, %.preheader58, %.preheader
  %.039.lcssa = phi i32 [ 0, %.preheader ], [ 0, %.preheader58 ], [ 0, %.preheader60 ], [ %.1, %68 ]
  %.not53 = icmp slt i32 %.039.lcssa, %spec.select
  %spec.select130 = select i1 %.not53, ptr @.str.1, ptr @.str
  br label %._crit_edge83.thread

.lr.ph82:                                         ; preds = %.preheader, %68
  %56 = phi i32 [ %69, %68 ], [ %41, %.preheader ]
  %indvars.iv106 = phi i64 [ %indvars.iv.next107, %68 ], [ 1, %.preheader ]
  %.03980 = phi i32 [ %.1, %68 ], [ 0, %.preheader ]
  %57 = getelementptr inbounds [210 x i8], ptr @is_stu, i64 0, i64 %indvars.iv106
  %58 = load i8, ptr %57, align 1, !tbaa !11, !range !13, !noundef !14
  %59 = trunc nuw i8 %58 to i1
  br i1 %59, label %60, label %64

60:                                               ; preds = %.lr.ph82
  %61 = getelementptr inbounds [210 x i8], ptr @go_home, i64 0, i64 %indvars.iv106
  %62 = load i8, ptr %61, align 1, !tbaa !11, !range !13, !noundef !14
  %63 = trunc nuw i8 %62 to i1
  br i1 %63, label %68, label %64

64:                                               ; preds = %60, %.lr.ph82
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1010) @vis, i8 0, i64 1010, i1 false)
  %65 = trunc nuw nsw i64 %indvars.iv106 to i32
  %66 = call noundef zeroext i1 @_Z2KMi(i32 noundef %65)
  %67 = zext i1 %66 to i32
  %spec.select56 = add nsw i32 %.03980, %67
  %.pre109 = load i32, ptr %1, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %64, %60
  %69 = phi i32 [ %56, %60 ], [ %.pre109, %64 ]
  %.1 = phi i32 [ %.03980, %60 ], [ %spec.select56, %64 ]
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  %70 = sext i32 %69 to i64
  %.not52.not = icmp slt i64 %indvars.iv106, %70
  br i1 %.not52.not, label %.lr.ph82, label %._crit_edge83, !llvm.loop !21

._crit_edge83.thread:                             ; preds = %._crit_edge83, %.preheader61, %0
  %.str.1.sink = phi ptr [ @.str, %0 ], [ @.str, %.preheader61 ], [ %spec.select130, %._crit_edge83 ]
  %71 = 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.sink)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret void
}

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERb(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1 align 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 #5

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 #6 = { 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 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !18}
!18 = !{!"llvm.loop.unswitch.partial.disable"}
!19 = distinct !{!19, !10, !18}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}


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