; LLVM IR from kazunetakahashi/atcoder :: 2017/1021_ARC083 (D)

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

@N = external dso_local global i32, align 4
@A = external dso_local global [310 x [310 x i64]], align 16
@habuku = external dso_local global [310 x [310 x i8]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %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) @N)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %36, %0
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = load i32, ptr @N, align 4, !tbaa !5
  %16 = icmp slt i32 %14, %15
  br i1 %16, label %18, label %17

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

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

19:                                               ; preds = %32, %18
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = load i32, ptr @N, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %35

24:                                               ; preds = %19
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [310 x [310 x i64]], ptr @A, i64 0, i64 %26
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [310 x i64], ptr %27, i64 0, i64 %29
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %30)
  br label %32

32:                                               ; preds = %24
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %4, align 4, !tbaa !5
  br label %19, !llvm.loop !9

35:                                               ; preds = %23
  br label %36

36:                                               ; preds = %35
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %2, align 4, !tbaa !5
  br label %13, !llvm.loop !11

39:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #5
  store i8 0, ptr %5, align 1, !tbaa !12
  call void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef @habuku, ptr noundef getelementptr inbounds (i8, ptr @habuku, i64 96100), ptr noundef nonnull align 1 dereferenceable(1) %5)
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %141, %39
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = load i32, ptr @N, align 4, !tbaa !5
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  store i32 8, ptr %3, align 4
  br label %144

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

46:                                               ; preds = %135, %45
  %47 = load i32, ptr %7, align 4, !tbaa !5
  %48 = load i32, ptr @N, align 4, !tbaa !5
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %51, label %50

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

51:                                               ; preds = %46
  %52 = load i32, ptr %7, align 4, !tbaa !5
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = icmp eq i32 %52, %53
  br i1 %54, label %55, label %56

55:                                               ; preds = %51
  br label %135

56:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %57 = load i32, ptr %7, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %8, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %129, %56
  %60 = load i32, ptr %8, align 4, !tbaa !5
  %61 = load i32, ptr @N, align 4, !tbaa !5
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  store i32 14, ptr %3, align 4
  br label %132

64:                                               ; preds = %59
  %65 = load i32, ptr %8, align 4, !tbaa !5
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = icmp eq i32 %65, %66
  br i1 %67, label %68, label %69

68:                                               ; preds = %64
  br label %129

69:                                               ; preds = %64
  %70 = load i32, ptr %7, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [310 x [310 x i64]], ptr @A, i64 0, i64 %71
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [310 x i64], ptr %72, i64 0, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !14
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [310 x [310 x i64]], ptr @A, i64 0, i64 %78
  %80 = load i32, ptr %8, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [310 x i64], ptr %79, i64 0, i64 %81
  %83 = load i64, ptr %82, align 8, !tbaa !14
  %84 = add nsw i64 %76, %83
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [310 x [310 x i64]], ptr @A, i64 0, i64 %86
  %88 = load i32, ptr %8, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [310 x i64], ptr %87, i64 0, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !14
  %92 = icmp slt i64 %84, %91
  br i1 %92, label %93, label %96

93:                                               ; preds = %69
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %94, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %132

96:                                               ; preds = %69
  %97 = load i32, ptr %7, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [310 x [310 x i64]], ptr @A, i64 0, i64 %98
  %100 = load i32, ptr %6, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [310 x i64], ptr %99, i64 0, i64 %101
  %103 = load i64, ptr %102, align 8, !tbaa !14
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [310 x [310 x i64]], ptr @A, i64 0, i64 %105
  %107 = load i32, ptr %8, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [310 x i64], ptr %106, i64 0, i64 %108
  %110 = load i64, ptr %109, align 8, !tbaa !14
  %111 = add nsw i64 %103, %110
  %112 = load i32, ptr %7, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [310 x [310 x i64]], ptr @A, i64 0, i64 %113
  %115 = load i32, ptr %8, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [310 x i64], ptr %114, i64 0, i64 %116
  %118 = load i64, ptr %117, align 8, !tbaa !14
  %119 = icmp eq i64 %111, %118
  br i1 %119, label %120, label %127

120:                                              ; preds = %96
  %121 = load i32, ptr %7, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [310 x [310 x i8]], ptr @habuku, i64 0, i64 %122
  %124 = load i32, ptr %8, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [310 x i8], ptr %123, i64 0, i64 %125
  store i8 1, ptr %126, align 1, !tbaa !12
  br label %127

127:                                              ; preds = %120, %96
  br label %128

128:                                              ; preds = %127
  br label %129

129:                                              ; preds = %128, %68
  %130 = load i32, ptr %8, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %8, align 4, !tbaa !5
  br label %59, !llvm.loop !16

132:                                              ; preds = %93, %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %133 = load i32, ptr %3, align 4
  switch i32 %133, label %138 [
    i32 14, label %134
  ]

134:                                              ; preds = %132
  br label %135

135:                                              ; preds = %134, %55
  %136 = load i32, ptr %7, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %7, align 4, !tbaa !5
  br label %46, !llvm.loop !17

138:                                              ; preds = %132, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  %139 = load i32, ptr %3, align 4
  switch i32 %139, label %144 [
    i32 11, label %140
  ]

140:                                              ; preds = %138
  br label %141

141:                                              ; preds = %140
  %142 = load i32, ptr %6, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %6, align 4, !tbaa !5
  br label %40, !llvm.loop !18

144:                                              ; preds = %138, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %145 = load i32, ptr %3, align 4
  switch i32 %145, label %193 [
    i32 8, label %146
    i32 1, label %191
  ]

146:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 0, ptr %9, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %147

147:                                              ; preds = %184, %146
  %148 = load i32, ptr %10, align 4, !tbaa !5
  %149 = load i32, ptr @N, align 4, !tbaa !5
  %150 = icmp slt i32 %148, %149
  br i1 %150, label %152, label %151

151:                                              ; preds = %147
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %187

152:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %153 = load i32, ptr %10, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %11, align 4, !tbaa !5
  br label %155

155:                                              ; preds = %180, %152
  %156 = load i32, ptr %11, align 4, !tbaa !5
  %157 = load i32, ptr @N, align 4, !tbaa !5
  %158 = icmp slt i32 %156, %157
  br i1 %158, label %160, label %159

159:                                              ; preds = %155
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %183

160:                                              ; preds = %155
  %161 = load i32, ptr %10, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [310 x [310 x i8]], ptr @habuku, i64 0, i64 %162
  %164 = load i32, ptr %11, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [310 x i8], ptr %163, i64 0, i64 %165
  %167 = load i8, ptr %166, align 1, !tbaa !12, !range !19, !noundef !20
  %168 = trunc i8 %167 to i1
  br i1 %168, label %179, label %169

169:                                              ; preds = %160
  %170 = load i32, ptr %10, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [310 x [310 x i64]], ptr @A, i64 0, i64 %171
  %173 = load i32, ptr %11, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [310 x i64], ptr %172, i64 0, i64 %174
  %176 = load i64, ptr %175, align 8, !tbaa !14
  %177 = load i64, ptr %9, align 8, !tbaa !14
  %178 = add nsw i64 %177, %176
  store i64 %178, ptr %9, align 8, !tbaa !14
  br label %179

179:                                              ; preds = %169, %160
  br label %180

180:                                              ; preds = %179
  %181 = load i32, ptr %11, align 4, !tbaa !5
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %11, align 4, !tbaa !5
  br label %155, !llvm.loop !21

183:                                              ; preds = %159
  br label %184

184:                                              ; preds = %183
  %185 = load i32, ptr %10, align 4, !tbaa !5
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %10, align 4, !tbaa !5
  br label %147, !llvm.loop !22

187:                                              ; preds = %151
  %188 = load i64, ptr %9, align 8, !tbaa !14
  %189 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %188)
  %190 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %189, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %191

191:                                              ; preds = %187, %144
  %192 = load i32, ptr %1, align 4
  ret i32 %192

193:                                              ; preds = %144
  unreachable
}

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) #4

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3 align 2

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

@N = external dso_local global i32, align 4
@A = external dso_local global [310 x [310 x i64]], align 16
@habuku = external dso_local global [310 x [310 x i8]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i8, align 1
  %2 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %3 = load i32, ptr @N, align 4, !tbaa !5
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.preheader73, label %._crit_edge76

.preheader73:                                     ; preds = %0, %._crit_edge
  %5 = phi i32 [ %28, %._crit_edge ], [ %3, %0 ]
  %indvars.iv98 = phi i64 [ %indvars.iv.next99, %._crit_edge ], [ 0, %0 ]
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %.preheader73.._crit_edge_crit_edge

.preheader73.._crit_edge_crit_edge:               ; preds = %.preheader73
  %.pre = sext i32 %5 to i64
  br label %._crit_edge

._crit_edge76:                                    ; preds = %._crit_edge, %0
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %1) #5
  store i8 0, ptr %1, align 1, !tbaa !9
  call void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef nonnull @habuku, ptr noundef nonnull getelementptr inbounds (i8, ptr @habuku, i64 96100), ptr noundef nonnull align 1 dereferenceable(1) %1)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %1) #5
  %7 = load i32, ptr @N, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.preheader72.us.preheader, label %._crit_edge93

.preheader72.us.preheader:                        ; preds = %._crit_edge76
  %9 = zext nneg i32 %7 to i64
  %wide.trip.count115 = zext nneg i32 %7 to i64
  br label %.preheader72.us

.preheader72.us:                                  ; preds = %.preheader72.us.preheader, %._crit_edge84.us
  %indvars.iv112 = phi i64 [ 0, %.preheader72.us.preheader ], [ %indvars.iv.next113, %._crit_edge84.us ]
  br label %10

10:                                               ; preds = %.preheader72.us, %.loopexit71.us
  %indvars.iv106 = phi i64 [ 0, %.preheader72.us ], [ %.pre129, %.loopexit71.us ]
  %indvars.iv101 = phi i64 [ 1, %.preheader72.us ], [ %indvars.iv.next102, %.loopexit71.us ]
  %11 = icmp ne i64 %indvars.iv106, %indvars.iv112
  %.pre129 = add nuw nsw i64 %indvars.iv106, 1
  %.not78.us = icmp ult i64 %.pre129, %9
  %or.cond = select i1 %11, i1 %.not78.us, i1 false
  br i1 %or.cond, label %.lr.ph80.us, label %.loopexit71.us

12:                                               ; preds = %.lr.ph80.us, %26
  %indvars.iv103 = phi i64 [ %indvars.iv101, %.lr.ph80.us ], [ %indvars.iv.next104, %26 ]
  %13 = icmp eq i64 %indvars.iv103, %indvars.iv112
  br i1 %13, label %26, label %14

14:                                               ; preds = %12
  %15 = load i64, ptr %27, align 8, !tbaa !11
  %16 = getelementptr inbounds [310 x [310 x i64]], ptr @A, i64 0, i64 %indvars.iv112, i64 %indvars.iv103
  %17 = load i64, ptr %16, align 8, !tbaa !11
  %18 = add nsw i64 %17, %15
  %19 = getelementptr inbounds [310 x [310 x i64]], ptr @A, i64 0, i64 %indvars.iv106, i64 %indvars.iv103
  %20 = load i64, ptr %19, align 8, !tbaa !11
  %21 = icmp slt i64 %18, %20
  br i1 %21, label %.thread66, label %22

22:                                               ; preds = %14
  %23 = icmp eq i64 %18, %20
  br i1 %23, label %24, label %26

24:                                               ; preds = %22
  %25 = getelementptr inbounds [310 x [310 x i8]], ptr @habuku, i64 0, i64 %indvars.iv106, i64 %indvars.iv103
  store i8 1, ptr %25, align 1, !tbaa !9
  br label %26

26:                                               ; preds = %24, %22, %12
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next104, %wide.trip.count115
  br i1 %exitcond.not, label %.loopexit71.us, label %12, !llvm.loop !13

.loopexit71.us:                                   ; preds = %26, %10
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %exitcond111.not = icmp eq i64 %.pre129, %wide.trip.count115
  br i1 %exitcond111.not, label %._crit_edge84.us, label %10, !llvm.loop !15

.lr.ph80.us:                                      ; preds = %10
  %27 = getelementptr inbounds [310 x [310 x i64]], ptr @A, i64 0, i64 %indvars.iv106, i64 %indvars.iv112
  br label %12

._crit_edge84.us:                                 ; preds = %.loopexit71.us
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %exitcond116.not = icmp eq i64 %indvars.iv.next113, %wide.trip.count115
  br i1 %exitcond116.not, label %.preheader, label %.preheader72.us, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph, %.preheader73.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader73.._crit_edge_crit_edge ], [ %33, %.lr.ph ]
  %28 = phi i32 [ %5, %.preheader73.._crit_edge_crit_edge ], [ %32, %.lr.ph ]
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %29 = icmp slt i64 %indvars.iv.next99, %.pre-phi
  br i1 %29, label %.preheader73, label %._crit_edge76, !llvm.loop !17

.lr.ph:                                           ; preds = %.preheader73, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader73 ]
  %30 = getelementptr inbounds [310 x [310 x i64]], ptr @A, i64 0, i64 %indvars.iv98, i64 %indvars.iv
  %31 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %30)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %32 = load i32, ptr @N, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = icmp slt i64 %indvars.iv.next, %33
  br i1 %34, label %.lr.ph, label %._crit_edge, !llvm.loop !19

.preheader:                                       ; preds = %._crit_edge84.us
  br i1 %8, label %.lr.ph92.preheader, label %._crit_edge93

.lr.ph92.preheader:                               ; preds = %.preheader
  %35 = zext nneg i32 %7 to i64
  %wide.trip.count127 = zext nneg i32 %7 to i64
  br label %.lr.ph92

.thread66:                                        ; preds = %14
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  br label %47

.loopexit:                                        ; preds = %46, %.lr.ph92
  %.1.lcssa = phi i64 [ %.04890, %.lr.ph92 ], [ %.2, %46 ]
  %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
  %exitcond128.not = icmp eq i64 %indvars.iv.next125, %wide.trip.count127
  br i1 %exitcond128.not, label %._crit_edge93, label %.lr.ph92, !llvm.loop !20

._crit_edge93:                                    ; preds = %.loopexit, %._crit_edge76, %.preheader
  %.048.lcssa = phi i64 [ 0, %.preheader ], [ 0, %._crit_edge76 ], [ %.1.lcssa, %.loopexit ]
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.048.lcssa)
  br label %47

.lr.ph92:                                         ; preds = %.lr.ph92.preheader, %.loopexit
  %indvars.iv124 = phi i64 [ 0, %.lr.ph92.preheader ], [ %indvars.iv.next125, %.loopexit ]
  %indvars.iv117 = phi i64 [ 1, %.lr.ph92.preheader ], [ %indvars.iv.next118, %.loopexit ]
  %.04890 = phi i64 [ 0, %.lr.ph92.preheader ], [ %.1.lcssa, %.loopexit ]
  %indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
  %38 = icmp ult i64 %indvars.iv.next125, %35
  br i1 %38, label %.lr.ph89, label %.loopexit

.lr.ph89:                                         ; preds = %.lr.ph92, %46
  %indvars.iv119 = phi i64 [ %indvars.iv.next120, %46 ], [ %indvars.iv117, %.lr.ph92 ]
  %.186 = phi i64 [ %.2, %46 ], [ %.04890, %.lr.ph92 ]
  %39 = getelementptr inbounds [310 x [310 x i8]], ptr @habuku, i64 0, i64 %indvars.iv124, i64 %indvars.iv119
  %40 = load i8, ptr %39, align 1, !tbaa !9, !range !21, !noundef !22
  %41 = trunc nuw i8 %40 to i1
  br i1 %41, label %46, label %42

42:                                               ; preds = %.lr.ph89
  %43 = getelementptr inbounds [310 x [310 x i64]], ptr @A, i64 0, i64 %indvars.iv124, i64 %indvars.iv119
  %44 = load i64, ptr %43, align 8, !tbaa !11
  %45 = add nsw i64 %44, %.186
  br label %46

46:                                               ; preds = %.lr.ph89, %42
  %.2 = phi i64 [ %.186, %.lr.ph89 ], [ %45, %42 ]
  %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
  %exitcond123.not = icmp eq i64 %indvars.iv.next120, %wide.trip.count127
  br i1 %exitcond123.not, label %.loopexit, label %.lr.ph89, !llvm.loop !23

47:                                               ; preds = %.thread66, %._crit_edge93
  %.sink = phi ptr [ %36, %.thread66 ], [ %37, %._crit_edge93 ]
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %.sink, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0
}

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4

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

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

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

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

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


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