; LLVM IR from kazunetakahashi/atcoder :: 201510_201609/1024_KUPC2015 (C)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_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" }

@infty = external dso_local global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca [40 x [40 x i32]], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %14

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

18:                                               ; preds = %14
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %181

19:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %20 = 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)
  call void @llvm.lifetime.start.p0(i64 6400, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %61, %19
  %22 = load i32, ptr %7, align 4, !tbaa !5
  %23 = load i32, ptr %5, align 4, !tbaa !5
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %64

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

27:                                               ; preds = %57, %26
  %28 = load i32, ptr %8, align 4, !tbaa !5
  %29 = load i32, ptr %5, align 4, !tbaa !5
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %32, label %31

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

32:                                               ; preds = %27
  %33 = load i32, ptr %7, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [40 x [40 x i32]], ptr %6, i64 0, i64 %34
  %36 = load i32, ptr %8, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [40 x i32], ptr %35, i64 0, i64 %37
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %38)
  %40 = load i32, ptr %7, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [40 x [40 x i32]], ptr %6, i64 0, i64 %41
  %43 = load i32, ptr %8, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [40 x i32], ptr %42, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = icmp eq i32 %46, -1
  br i1 %47, label %48, label %56

48:                                               ; preds = %32
  %49 = load i32, ptr @infty, align 4, !tbaa !5
  %50 = load i32, ptr %7, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [40 x [40 x i32]], ptr %6, i64 0, i64 %51
  %53 = load i32, ptr %8, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [40 x i32], ptr %52, i64 0, i64 %54
  store i32 %49, ptr %55, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %48, %32
  br label %57

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

60:                                               ; preds = %31
  br label %61

61:                                               ; preds = %60
  %62 = load i32, ptr %7, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %7, align 4, !tbaa !5
  br label %21, !llvm.loop !11

64:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  store i8 1, ptr %9, align 1, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %165, %64
  %66 = load i32, ptr %10, align 4, !tbaa !5
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  store i32 11, ptr %4, align 4
  br label %168

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

71:                                               ; preds = %159, %70
  %72 = load i32, ptr %11, align 4, !tbaa !5
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = icmp slt i32 %72, %73
  br i1 %74, label %76, label %75

75:                                               ; preds = %71
  store i32 14, ptr %4, align 4
  br label %162

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

77:                                               ; preds = %153, %76
  %78 = load i32, ptr %12, align 4, !tbaa !5
  %79 = load i32, ptr %5, align 4, !tbaa !5
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %77
  store i32 17, ptr %4, align 4
  br label %156

82:                                               ; preds = %77
  %83 = load i32, ptr %11, align 4, !tbaa !5
  %84 = load i32, ptr %12, align 4, !tbaa !5
  %85 = icmp eq i32 %83, %84
  br i1 %85, label %86, label %97

86:                                               ; preds = %82
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [40 x [40 x i32]], ptr %6, i64 0, i64 %88
  %90 = load i32, ptr %11, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [40 x i32], ptr %89, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %96

95:                                               ; preds = %86
  store i8 0, ptr %9, align 1, !tbaa !12
  store i32 20, ptr %4, align 4
  br label %156

96:                                               ; preds = %86
  br label %152

97:                                               ; preds = %82
  %98 = load i32, ptr %10, align 4, !tbaa !5
  %99 = load i32, ptr %11, align 4, !tbaa !5
  %100 = icmp ne i32 %98, %99
  br i1 %100, label %101, label %151

101:                                              ; preds = %97
  %102 = load i32, ptr %10, align 4, !tbaa !5
  %103 = load i32, ptr %12, align 4, !tbaa !5
  %104 = icmp ne i32 %102, %103
  br i1 %104, label %105, label %151

105:                                              ; preds = %101
  %106 = load i32, ptr %11, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [40 x [40 x i32]], ptr %6, i64 0, i64 %107
  %109 = load i32, ptr %10, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [40 x i32], ptr %108, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = load i32, ptr @infty, align 4, !tbaa !5
  %114 = icmp slt i32 %112, %113
  br i1 %114, label %115, label %150

115:                                              ; preds = %105
  %116 = load i32, ptr %10, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [40 x [40 x i32]], ptr %6, i64 0, i64 %117
  %119 = load i32, ptr %12, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [40 x i32], ptr %118, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = load i32, ptr @infty, align 4, !tbaa !5
  %124 = icmp slt i32 %122, %123
  br i1 %124, label %125, label %150

125:                                              ; preds = %115
  %126 = load i32, ptr %11, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [40 x [40 x i32]], ptr %6, i64 0, i64 %127
  %129 = load i32, ptr %12, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [40 x i32], ptr %128, i64 0, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = load i32, ptr %11, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [40 x [40 x i32]], ptr %6, i64 0, i64 %134
  %136 = load i32, ptr %10, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [40 x i32], ptr %135, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = load i32, ptr %10, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [40 x [40 x i32]], ptr %6, i64 0, i64 %141
  %143 = load i32, ptr %12, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [40 x i32], ptr %142, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = add nsw i32 %139, %146
  %148 = icmp sgt i32 %132, %147
  br i1 %148, label %149, label %150

149:                                              ; preds = %125
  store i8 0, ptr %9, align 1, !tbaa !12
  store i32 20, ptr %4, align 4
  br label %156

150:                                              ; preds = %125, %115, %105
  br label %151

151:                                              ; preds = %150, %101, %97
  br label %152

152:                                              ; preds = %151, %96
  br label %153

153:                                              ; preds = %152
  %154 = load i32, ptr %12, align 4, !tbaa !5
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %12, align 4, !tbaa !5
  br label %77, !llvm.loop !14

156:                                              ; preds = %149, %95, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %157 = load i32, ptr %4, align 4
  switch i32 %157, label %162 [
    i32 17, label %158
  ]

158:                                              ; preds = %156
  br label %159

159:                                              ; preds = %158
  %160 = load i32, ptr %11, align 4, !tbaa !5
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %11, align 4, !tbaa !5
  br label %71, !llvm.loop !15

162:                                              ; preds = %156, %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  %163 = load i32, ptr %4, align 4
  switch i32 %163, label %168 [
    i32 14, label %164
  ]

164:                                              ; preds = %162
  br label %165

165:                                              ; preds = %164
  %166 = load i32, ptr %10, align 4, !tbaa !5
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %10, align 4, !tbaa !5
  br label %65, !llvm.loop !16

168:                                              ; preds = %162, %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %169 = load i32, ptr %4, align 4
  switch i32 %169, label %183 [
    i32 11, label %170
    i32 20, label %171
  ]

170:                                              ; preds = %168
  br label %171

171:                                              ; preds = %170, %168
  %172 = load i8, ptr %9, align 1, !tbaa !12, !range !17, !noundef !18
  %173 = trunc i8 %172 to i1
  %174 = zext i1 %173 to i64
  %175 = select i1 %173, ptr @.str, ptr @.str.1
  %176 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef %175)
  %177 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %176, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 6400, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %178

178:                                              ; preds = %171
  %179 = load i32, ptr %3, align 4, !tbaa !5
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %3, align 4, !tbaa !5
  br label %14, !llvm.loop !19

181:                                              ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %182 = load i32, ptr %1, align 4
  ret i32 %182

183:                                              ; preds = %168
  unreachable
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = distinct !{!19, !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" }

@infty = external dso_local local_unnamed_addr global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1

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

._crit_edge96:                                    ; preds = %._crit_edge82.split.us, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0

.lr.ph95:                                         ; preds = %0, %._crit_edge82.split.us
  %.04893 = phi i32 [ %53, %._crit_edge82.split.us ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 6400, ptr nonnull %3) #5
  %8 = load i32, ptr %2, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.preheader61, label %._crit_edge82.split.us

.preheader62:                                     ; preds = %._crit_edge
  %10 = icmp sgt i32 %39, 0
  br i1 %10, label %.preheader60.lr.ph, label %._crit_edge82.split.us

.preheader60.lr.ph:                               ; preds = %.preheader62
  %11 = load i32, ptr @infty, align 4
  %wide.trip.count118 = zext nneg i32 %39 to i64
  br label %.preheader60.us

.preheader60.us:                                  ; preds = %..thread57.loopexit_crit_edge.split.us.us, %.preheader60.lr.ph
  %indvars.iv115 = phi i64 [ %indvars.iv.next116, %..thread57.loopexit_crit_edge.split.us.us ], [ 0, %.preheader60.lr.ph ]
  br label %.preheader.us.us

.preheader.us.us:                                 ; preds = %._crit_edge68.us.us, %.preheader60.us
  %indvars.iv110 = phi i64 [ %indvars.iv.next111, %._crit_edge68.us.us ], [ 0, %.preheader60.us ]
  %.not.us.us = icmp eq i64 %indvars.iv115, %indvars.iv110
  %12 = getelementptr inbounds [40 x [40 x i32]], ptr %3, i64 0, i64 %indvars.iv110, i64 %indvars.iv115
  %13 = getelementptr inbounds [40 x [40 x i32]], ptr %3, i64 0, i64 %indvars.iv110, i64 %indvars.iv110
  %.not.fr.us.us = freeze i1 %.not.us.us
  br i1 %.not.fr.us.us, label %.lr.ph67.split.us.us.us, label %.lr.ph67.split.us76.us

.lr.ph67.split.us76.us:                           ; preds = %.preheader.us.us, %30
  %indvars.iv106 = phi i64 [ %indvars.iv.next107, %30 ], [ 0, %.preheader.us.us ]
  %14 = icmp eq i64 %indvars.iv110, %indvars.iv106
  br i1 %14, label %28, label %15

15:                                               ; preds = %.lr.ph67.split.us76.us
  %.not52.us.us = icmp eq i64 %indvars.iv115, %indvars.iv106
  br i1 %.not52.us.us, label %30, label %16

16:                                               ; preds = %15
  %17 = load i32, ptr %12, align 4, !tbaa !5
  %18 = icmp slt i32 %17, %11
  br i1 %18, label %19, label %30

19:                                               ; preds = %16
  %20 = getelementptr inbounds [40 x [40 x i32]], ptr %3, i64 0, i64 %indvars.iv115, i64 %indvars.iv106
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = icmp slt i32 %21, %11
  br i1 %22, label %23, label %30

23:                                               ; preds = %19
  %24 = getelementptr inbounds [40 x [40 x i32]], ptr %3, i64 0, i64 %indvars.iv110, i64 %indvars.iv106
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = add nsw i32 %21, %17
  %27 = icmp sgt i32 %25, %26
  br i1 %27, label %._crit_edge82.split.us, label %30

28:                                               ; preds = %.lr.ph67.split.us76.us
  %29 = load i32, ptr %13, align 4, !tbaa !5
  %.not53.us73.us = icmp eq i32 %29, 0
  br i1 %.not53.us73.us, label %30, label %._crit_edge82.split.us

30:                                               ; preds = %28, %23, %19, %16, %15
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next107, %wide.trip.count118
  br i1 %exitcond.not, label %._crit_edge68.us.us, label %.lr.ph67.split.us76.us, !llvm.loop !9

._crit_edge68.us.us:                              ; preds = %30, %35
  %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
  %exitcond114.not = icmp eq i64 %indvars.iv.next111, %wide.trip.count118
  br i1 %exitcond114.not, label %..thread57.loopexit_crit_edge.split.us.us, label %.preheader.us.us, !llvm.loop !11

.lr.ph67.split.us.us.us:                          ; preds = %.preheader.us.us, %35
  %.066.us.us.us = phi i32 [ %36, %35 ], [ 0, %.preheader.us.us ]
  %31 = zext nneg i32 %.066.us.us.us to i64
  %32 = icmp eq i64 %indvars.iv110, %31
  br i1 %32, label %33, label %35

33:                                               ; preds = %.lr.ph67.split.us.us.us
  %34 = load i32, ptr %13, align 4, !tbaa !5
  %.not53.us.us.us = icmp eq i32 %34, 0
  br i1 %.not53.us.us.us, label %35, label %._crit_edge82.split.us

35:                                               ; preds = %.lr.ph67.split.us.us.us, %33
  %36 = add nuw nsw i32 %.066.us.us.us, 1
  %exitcond109.not = icmp eq i32 %36, %39
  br i1 %exitcond109.not, label %._crit_edge68.us.us, label %.lr.ph67.split.us.us.us, !llvm.loop !9

..thread57.loopexit_crit_edge.split.us.us:        ; preds = %._crit_edge68.us.us
  %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
  %exitcond119.not = icmp eq i64 %indvars.iv.next116, %wide.trip.count118
  br i1 %exitcond119.not, label %._crit_edge82.split.us, label %.preheader60.us, !llvm.loop !12

.preheader61:                                     ; preds = %.lr.ph95, %._crit_edge
  %37 = phi i32 [ %39, %._crit_edge ], [ %8, %.lr.ph95 ]
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %._crit_edge ], [ 0, %.lr.ph95 ]
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %.lr.ph, label %.preheader61.._crit_edge_crit_edge

.preheader61.._crit_edge_crit_edge:               ; preds = %.preheader61
  %.pre = sext i32 %37 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %47, %.preheader61.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader61.._crit_edge_crit_edge ], [ %49, %47 ]
  %39 = phi i32 [ %37, %.preheader61.._crit_edge_crit_edge ], [ %48, %47 ]
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %40 = icmp slt i64 %indvars.iv.next104, %.pre-phi
  br i1 %40, label %.preheader61, label %.preheader62, !llvm.loop !13

.lr.ph:                                           ; preds = %.preheader61, %47
  %indvars.iv = phi i64 [ %indvars.iv.next, %47 ], [ 0, %.preheader61 ]
  %41 = getelementptr inbounds [40 x [40 x i32]], ptr %3, i64 0, i64 %indvars.iv103, i64 %indvars.iv
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %41)
  %43 = load i32, ptr %41, align 4, !tbaa !5
  %44 = icmp eq i32 %43, -1
  br i1 %44, label %45, label %47

45:                                               ; preds = %.lr.ph
  %46 = load i32, ptr @infty, align 4, !tbaa !5
  store i32 %46, ptr %41, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %.lr.ph, %45
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = icmp slt i64 %indvars.iv.next, %49
  br i1 %50, label %.lr.ph, label %._crit_edge, !llvm.loop !15

._crit_edge82.split.us:                           ; preds = %..thread57.loopexit_crit_edge.split.us.us, %28, %23, %33, %.lr.ph95, %.preheader62
  %.4 = phi ptr [ @.str, %.preheader62 ], [ @.str, %.lr.ph95 ], [ @.str.1, %33 ], [ @.str.1, %23 ], [ @.str.1, %28 ], [ @.str, %..thread57.loopexit_crit_edge.split.us.us ]
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %.4)
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %51, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 6400, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  %53 = add nuw nsw i32 %.04893, 1
  %54 = load i32, ptr %1, align 4, !tbaa !5
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %.lr.ph95, label %._crit_edge96, !llvm.loop !16
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14}
!14 = !{!"llvm.loop.unswitch.partial.disable"}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


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