; LLVM IR from Tunghohin/Competitive_Coding :: Luogu (p5836)

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

@cow = external dso_local global [100010 x i8], align 16
@is_satisfy = external dso_local global [100010 x i8], align 16
@depth = external dso_local global [100010 x i32], align 16
@prefix = external dso_local global [100010 x i32], align 16
@f = external dso_local global [100010 x [20 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3bfsi(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
declare dso_local noundef i32 @_Z3lcaii(i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %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 [2 x i8], align 1
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %17 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %18 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %19 = getelementptr i8, ptr %18, i64 -24
  %20 = load i64, ptr %19, align 8
  %21 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %20
  %22 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %21, ptr noundef null)
  %23 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %24 = getelementptr i8, ptr %23, i64 -24
  %25 = load i64, ptr %24, align 8
  %26 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %25
  %27 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %26, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %28 = 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)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !8
  br label %30

30:                                               ; preds = %40, %0
  %31 = load i32, ptr %4, align 4, !tbaa !8
  %32 = load i32, ptr %2, align 4, !tbaa !8
  %33 = icmp sle i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %43

35:                                               ; preds = %30
  %36 = load i32, ptr %4, align 4, !tbaa !8
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [100010 x i8], ptr @cow, i64 0, i64 %37
  %39 = 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) %38)
  br label %40

40:                                               ; preds = %35
  %41 = load i32, ptr %4, align 4, !tbaa !8
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %4, align 4, !tbaa !8
  br label %30, !llvm.loop !11

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

44:                                               ; preds = %56, %43
  %45 = load i32, ptr %5, align 4, !tbaa !8
  %46 = load i32, ptr %2, align 4, !tbaa !8
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %59

49:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %50 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %50, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %52 = load i32, ptr %6, align 4, !tbaa !8
  %53 = load i32, ptr %7, align 4, !tbaa !8
  call void @_Z8add_edgeii(i32 noundef %52, i32 noundef %53)
  %54 = load i32, ptr %7, align 4, !tbaa !8
  %55 = load i32, ptr %6, align 4, !tbaa !8
  call void @_Z8add_edgeii(i32 noundef %54, i32 noundef %55)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %56

56:                                               ; preds = %49
  %57 = load i32, ptr %5, align 4, !tbaa !8
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %5, align 4, !tbaa !8
  br label %44, !llvm.loop !13

59:                                               ; preds = %48
  call void @_Z3bfsi(i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !8
  br label %60

60:                                               ; preds = %174, %59
  %61 = load i32, ptr %8, align 4, !tbaa !8
  %62 = load i32, ptr %3, align 4, !tbaa !8
  %63 = icmp sle i32 %61, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %177

65:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 2, ptr %11) #6
  %66 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %67 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %66, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %68 = getelementptr inbounds [2 x i8], ptr %11, i64 0, i64 0
  %69 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) %67, ptr noundef %68)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %70 = load i32, ptr %9, align 4, !tbaa !8
  %71 = load i32, ptr %10, align 4, !tbaa !8
  %72 = call noundef i32 @_Z3lcaii(i32 noundef %70, i32 noundef %71)
  store i32 %72, ptr %12, align 4, !tbaa !8
  %73 = getelementptr inbounds [2 x i8], ptr %11, i64 0, i64 0
  %74 = load i8, ptr %73, align 1, !tbaa !14
  %75 = sext i8 %74 to i32
  %76 = icmp eq i32 %75, 72
  br i1 %76, label %77, label %113

77:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %78 = load i32, ptr %9, align 4, !tbaa !8
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !8
  %82 = load i32, ptr %10, align 4, !tbaa !8
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !8
  %86 = add nsw i32 %81, %85
  %87 = load i32, ptr %12, align 4, !tbaa !8
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !8
  %91 = sub nsw i32 %86, %90
  %92 = load i32, ptr %12, align 4, !tbaa !8
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %93
  %95 = getelementptr inbounds [20 x i32], ptr %94, i64 0, i64 0
  %96 = load i32, ptr %95, align 16, !tbaa !8
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !8
  %100 = sub nsw i32 %91, %99
  store i32 %100, ptr %13, align 4, !tbaa !8
  %101 = load i32, ptr %13, align 4, !tbaa !8
  %102 = icmp eq i32 %101, 0
  br i1 %102, label %103, label %107

103:                                              ; preds = %77
  %104 = load i32, ptr %8, align 4, !tbaa !8
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [100010 x i8], ptr @is_satisfy, i64 0, i64 %105
  store i8 48, ptr %106, align 1, !tbaa !14
  br label %111

107:                                              ; preds = %77
  %108 = load i32, ptr %8, align 4, !tbaa !8
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [100010 x i8], ptr @is_satisfy, i64 0, i64 %109
  store i8 49, ptr %110, align 1, !tbaa !14
  br label %111

111:                                              ; preds = %107, %103
  %112 = phi ptr [ %106, %103 ], [ %110, %107 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %173

113:                                              ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %114 = load i32, ptr %9, align 4, !tbaa !8
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [100010 x i32], ptr @depth, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !8
  %118 = load i32, ptr %10, align 4, !tbaa !8
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [100010 x i32], ptr @depth, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !8
  %122 = add nsw i32 %117, %121
  %123 = load i32, ptr %12, align 4, !tbaa !8
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [100010 x i32], ptr @depth, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !8
  %127 = sub nsw i32 %122, %126
  %128 = load i32, ptr %12, align 4, !tbaa !8
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %129
  %131 = getelementptr inbounds [20 x i32], ptr %130, i64 0, i64 0
  %132 = load i32, ptr %131, align 16, !tbaa !8
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [100010 x i32], ptr @depth, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !8
  %136 = sub nsw i32 %127, %135
  store i32 %136, ptr %14, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %137 = load i32, ptr %9, align 4, !tbaa !8
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !8
  %141 = load i32, ptr %10, align 4, !tbaa !8
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !8
  %145 = add nsw i32 %140, %144
  %146 = load i32, ptr %12, align 4, !tbaa !8
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !8
  %150 = sub nsw i32 %145, %149
  %151 = load i32, ptr %12, align 4, !tbaa !8
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %152
  %154 = getelementptr inbounds [20 x i32], ptr %153, i64 0, i64 0
  %155 = load i32, ptr %154, align 16, !tbaa !8
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !8
  %159 = sub nsw i32 %150, %158
  store i32 %159, ptr %15, align 4, !tbaa !8
  %160 = load i32, ptr %15, align 4, !tbaa !8
  %161 = load i32, ptr %14, align 4, !tbaa !8
  %162 = icmp slt i32 %160, %161
  br i1 %162, label %163, label %167

163:                                              ; preds = %113
  %164 = load i32, ptr %8, align 4, !tbaa !8
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [100010 x i8], ptr @is_satisfy, i64 0, i64 %165
  store i8 49, ptr %166, align 1, !tbaa !14
  br label %171

167:                                              ; preds = %113
  %168 = load i32, ptr %8, align 4, !tbaa !8
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [100010 x i8], ptr @is_satisfy, i64 0, i64 %169
  store i8 48, ptr %170, align 1, !tbaa !14
  br label %171

171:                                              ; preds = %167, %163
  %172 = phi ptr [ %166, %163 ], [ %170, %167 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %173

173:                                              ; preds = %171, %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %174

174:                                              ; preds = %173
  %175 = load i32, ptr %8, align 4, !tbaa !8
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %8, align 4, !tbaa !8
  br label %60, !llvm.loop !15

177:                                              ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 1, ptr %16, align 4, !tbaa !8
  br label %178

178:                                              ; preds = %189, %177
  %179 = load i32, ptr %16, align 4, !tbaa !8
  %180 = load i32, ptr %3, align 4, !tbaa !8
  %181 = icmp sle i32 %179, %180
  br i1 %181, label %183, label %182

182:                                              ; preds = %178
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %192

183:                                              ; preds = %178
  %184 = load i32, ptr %16, align 4, !tbaa !8
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [100010 x i8], ptr @is_satisfy, i64 0, i64 %185
  %187 = load i8, ptr %186, align 1, !tbaa !14
  %188 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %187)
  br label %189

189:                                              ; preds = %183
  %190 = load i32, ptr %16, align 4, !tbaa !8
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %16, align 4, !tbaa !8
  br label %178, !llvm.loop !16

192:                                              ; preds = %182
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %193 = load i32, ptr %1, align 4
  ret i32 %193
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #4

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #0 align 2

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

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

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

; 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) #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 = { 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 #4 = { "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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!10, !10, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


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

@cow = external dso_local global [100010 x i8], align 16
@is_satisfy = external dso_local local_unnamed_addr global [100010 x i8], align 16
@depth = external dso_local local_unnamed_addr global [100010 x i32], align 16
@prefix = external dso_local local_unnamed_addr global [100010 x i32], align 16
@f = external dso_local local_unnamed_addr global [100010 x [20 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; 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 void @_Z3bfsi(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
declare dso_local noundef i32 @_Z3lcaii(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %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 [2 x i8], align 1
  %8 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %9 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %10 = getelementptr i8, ptr %9, i64 -24
  %11 = load i64, ptr %10, align 8
  %12 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %11
  %13 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %12, ptr noundef null)
  %14 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %15 = getelementptr i8, ptr %14, i64 -24
  %16 = load i64, ptr %15, align 8
  %17 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %16
  %18 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %17, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %19 = 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)
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %21 = load i32, ptr %1, align 4, !tbaa !8
  %.not35 = icmp slt i32 %21, 1
  br i1 %.not35, label %._crit_edge, label %.lr.ph

.preheader34:                                     ; preds = %.lr.ph
  %22 = icmp sgt i32 %25, 1
  br i1 %22, label %.lr.ph38, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %23 = getelementptr inbounds [100010 x i8], ptr @cow, i64 0, i64 %indvars.iv
  %24 = 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) %23)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %25 = load i32, ptr %1, align 4, !tbaa !8
  %26 = sext i32 %25 to i64
  %.not.not = icmp slt i64 %indvars.iv, %26
  br i1 %.not.not, label %.lr.ph, label %.preheader34, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph38, %0, %.preheader34
  call void @_Z3bfsi(i32 noundef 1)
  %27 = load i32, ptr %2, align 4, !tbaa !8
  %.not2739 = icmp slt i32 %27, 1
  br i1 %.not2739, label %._crit_edge46, label %.lr.ph42

.lr.ph38:                                         ; preds = %.preheader34, %.lr.ph38
  %.02537 = phi i32 [ %34, %.lr.ph38 ], [ 1, %.preheader34 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %30 = load i32, ptr %3, align 4, !tbaa !8
  %31 = load i32, ptr %4, align 4, !tbaa !8
  call void @_Z8add_edgeii(i32 noundef %30, i32 noundef %31)
  %32 = load i32, ptr %4, align 4, !tbaa !8
  %33 = load i32, ptr %3, align 4, !tbaa !8
  call void @_Z8add_edgeii(i32 noundef %32, i32 noundef %33)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %34 = add nuw nsw i32 %.02537, 1
  %35 = load i32, ptr %1, align 4, !tbaa !8
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %.lr.ph38, label %._crit_edge, !llvm.loop !13

.preheader:                                       ; preds = %98
  %37 = icmp slt i32 %99, 1
  br i1 %37, label %._crit_edge46, label %.lr.ph45

.lr.ph42:                                         ; preds = %._crit_edge, %98
  %indvars.iv48 = phi i64 [ %indvars.iv.next49, %98 ], [ 1, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %7) #6
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) %39, ptr noundef %7)
  %41 = load i32, ptr %5, align 4, !tbaa !8
  %42 = load i32, ptr %6, align 4, !tbaa !8
  %43 = call noundef i32 @_Z3lcaii(i32 noundef %41, i32 noundef %42)
  %44 = load i8, ptr %7, align 1, !tbaa !14
  %45 = icmp eq i8 %44, 72
  %46 = load i32, ptr %5, align 4, !tbaa !8
  %47 = sext i32 %46 to i64
  %48 = load i32, ptr %6, align 4, !tbaa !8
  %49 = sext i32 %48 to i64
  br i1 %45, label %50, label %69

50:                                               ; preds = %.lr.ph42
  %51 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %47
  %52 = load i32, ptr %51, align 4, !tbaa !8
  %53 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %49
  %54 = load i32, ptr %53, align 4, !tbaa !8
  %55 = add nsw i32 %54, %52
  %56 = sext i32 %43 to i64
  %57 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !8
  %59 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %56
  %60 = load i32, ptr %59, align 16, !tbaa !8
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !8
  %64 = add i32 %63, %58
  %65 = icmp eq i32 %55, %64
  %66 = getelementptr inbounds [100010 x i8], ptr @is_satisfy, i64 0, i64 %indvars.iv48
  br i1 %65, label %67, label %68

67:                                               ; preds = %50
  store i8 48, ptr %66, align 1, !tbaa !14
  br label %98

68:                                               ; preds = %50
  store i8 49, ptr %66, align 1, !tbaa !14
  br label %98

69:                                               ; preds = %.lr.ph42
  %70 = getelementptr inbounds [100010 x i32], ptr @depth, i64 0, i64 %47
  %71 = load i32, ptr %70, align 4, !tbaa !8
  %72 = getelementptr inbounds [100010 x i32], ptr @depth, i64 0, i64 %49
  %73 = load i32, ptr %72, align 4, !tbaa !8
  %74 = sext i32 %43 to i64
  %75 = getelementptr inbounds [100010 x i32], ptr @depth, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !8
  %77 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %74
  %78 = load i32, ptr %77, align 16, !tbaa !8
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [100010 x i32], ptr @depth, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !8
  %.neg30 = add i32 %73, %71
  %82 = add i32 %76, %81
  %83 = sub i32 %.neg30, %82
  %84 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %47
  %85 = load i32, ptr %84, align 4, !tbaa !8
  %86 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %49
  %87 = load i32, ptr %86, align 4, !tbaa !8
  %88 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %74
  %89 = load i32, ptr %88, align 4, !tbaa !8
  %90 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %79
  %91 = load i32, ptr %90, align 4, !tbaa !8
  %.neg33 = add i32 %87, %85
  %92 = add i32 %89, %91
  %93 = sub i32 %.neg33, %92
  %94 = icmp slt i32 %93, %83
  %95 = getelementptr inbounds [100010 x i8], ptr @is_satisfy, i64 0, i64 %indvars.iv48
  br i1 %94, label %96, label %97

96:                                               ; preds = %69
  store i8 49, ptr %95, align 1, !tbaa !14
  br label %98

97:                                               ; preds = %69
  store i8 48, ptr %95, align 1, !tbaa !14
  br label %98

98:                                               ; preds = %96, %97, %67, %68
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %99 = load i32, ptr %2, align 4, !tbaa !8
  %100 = sext i32 %99 to i64
  %.not27.not = icmp slt i64 %indvars.iv48, %100
  br i1 %.not27.not, label %.lr.ph42, label %.preheader, !llvm.loop !15

._crit_edge46:                                    ; preds = %.lr.ph45, %._crit_edge, %.preheader
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

.lr.ph45:                                         ; preds = %.preheader, %.lr.ph45
  %indvars.iv51 = phi i64 [ %indvars.iv.next52, %.lr.ph45 ], [ 1, %.preheader ]
  %101 = getelementptr inbounds [100010 x i8], ptr @is_satisfy, i64 0, i64 %indvars.iv51
  %102 = load i8, ptr %101, align 1, !tbaa !14
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %102)
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
  %104 = load i32, ptr %2, align 4, !tbaa !8
  %105 = sext i32 %104 to i64
  %.not28.not = icmp slt i64 %indvars.iv51, %105
  br i1 %.not28.not, label %.lr.ph45, label %._crit_edge46, !llvm.loop !16
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #0 align 2

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

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

; 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 #5

; 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 #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 = { 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 #4 = { "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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!10, !10, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


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