; LLVM IR from eyangch/competitive-programming :: Codeforces/1704 (e)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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" }

@MOD = external dso_local global i64, align 8
@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@A = external dso_local global [1000 x i64], align 16
@mxi = external dso_local global [1000 x i64], align 16
@mem = external dso_local global [1000 x i64], align 16
@G = external dso_local global [1000 x %"class.std::vector"], align 16
@R = external dso_local global [1000 x %"class.std::vector"], align 16
@idle = external dso_local global [1005 x i8], align 16
@vis = external dso_local global [1000 x [1000 x i8]], align 16
@sink = external dso_local global i64, align 8
@mxd = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5dfs_ixx(i64 noundef, i64 noundef) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #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 i64 @_Z3dfsx(i64 noundef) #0

; 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 i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %19 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %20 = getelementptr i8, ptr %19, i64 -24
  %21 = load i64, ptr %20, align 8
  %22 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %21
  %23 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %22, ptr noundef null)
  %24 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  br label %26

26:                                               ; preds = %166, %164, %0
  %27 = load i64, ptr @T, align 8, !tbaa !8
  %28 = add nsw i64 %27, -1
  store i64 %28, ptr @T, align 8, !tbaa !8
  %29 = icmp ne i64 %27, 0
  br i1 %29, label %30, label %167

30:                                               ; preds = %26
  %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) @N)
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %33 = load i64, ptr @N, align 8, !tbaa !8
  %34 = getelementptr inbounds i8, ptr @idle, i64 %33
  %35 = getelementptr inbounds i8, ptr %34, i64 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !11
  call void @_ZSt4fillIPbiEvT_S1_RKT0_(ptr noundef @idle, ptr noundef %35, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %36 = load i64, ptr @N, align 8, !tbaa !8
  %37 = getelementptr inbounds i64, ptr @mxi, i64 %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !11
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @mxi, ptr noundef %37, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  %38 = load i64, ptr @N, align 8, !tbaa !8
  %39 = getelementptr inbounds i64, ptr @mem, i64 %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 -1, ptr %4, align 4, !tbaa !11
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @mem, ptr noundef %39, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  store i64 0, ptr @mxd, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store i64 0, ptr %5, align 8, !tbaa !8
  br label %40

40:                                               ; preds = %58, %30
  %41 = load i64, ptr %5, align 8, !tbaa !8
  %42 = load i64, ptr @N, align 8, !tbaa !8
  %43 = icmp slt i64 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %61

45:                                               ; preds = %40
  %46 = load i64, ptr %5, align 8, !tbaa !8
  %47 = getelementptr inbounds [1000 x %"class.std::vector"], ptr @G, i64 0, i64 %46
  call void @_ZNSt6vectorIxSaIxEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %47) #7
  %48 = load i64, ptr %5, align 8, !tbaa !8
  %49 = getelementptr inbounds [1000 x %"class.std::vector"], ptr @R, i64 0, i64 %48
  call void @_ZNSt6vectorIxSaIxEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %49) #7
  %50 = load i64, ptr %5, align 8, !tbaa !8
  %51 = getelementptr inbounds [1000 x [1000 x i8]], ptr @vis, i64 0, i64 %50
  %52 = getelementptr inbounds [1000 x i8], ptr %51, i64 0, i64 0
  %53 = load i64, ptr %5, align 8, !tbaa !8
  %54 = getelementptr inbounds [1000 x [1000 x i8]], ptr @vis, i64 0, i64 %53
  %55 = getelementptr inbounds [1000 x i8], ptr %54, i64 0, i64 0
  %56 = load i64, ptr @N, align 8, !tbaa !8
  %57 = getelementptr inbounds i8, ptr %55, i64 %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !11
  call void @_ZSt4fillIPbiEvT_S1_RKT0_(ptr noundef %52, ptr noundef %57, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %58

58:                                               ; preds = %45
  %59 = load i64, ptr %5, align 8, !tbaa !8
  %60 = add nsw i64 %59, 1
  store i64 %60, ptr %5, align 8, !tbaa !8
  br label %40, !llvm.loop !13

61:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 0, ptr %7, align 8, !tbaa !8
  br label %62

62:                                               ; preds = %71, %61
  %63 = load i64, ptr %7, align 8, !tbaa !8
  %64 = load i64, ptr @N, align 8, !tbaa !8
  %65 = icmp slt i64 %63, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %74

67:                                               ; preds = %62
  %68 = load i64, ptr %7, align 8, !tbaa !8
  %69 = getelementptr inbounds [1000 x i64], ptr @A, i64 0, i64 %68
  %70 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %69)
  br label %71

71:                                               ; preds = %67
  %72 = load i64, ptr %7, align 8, !tbaa !8
  %73 = add nsw i64 %72, 1
  store i64 %73, ptr %7, align 8, !tbaa !8
  br label %62, !llvm.loop !15

74:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !8
  br label %75

75:                                               ; preds = %91, %74
  %76 = load i64, ptr %8, align 8, !tbaa !8
  %77 = load i64, ptr @M, align 8, !tbaa !8
  %78 = icmp slt i64 %76, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %94

80:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %81 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %82 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %81, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %83 = load i64, ptr %9, align 8, !tbaa !8
  %84 = add nsw i64 %83, -1
  store i64 %84, ptr %9, align 8, !tbaa !8
  %85 = load i64, ptr %10, align 8, !tbaa !8
  %86 = add nsw i64 %85, -1
  store i64 %86, ptr %10, align 8, !tbaa !8
  %87 = load i64, ptr %9, align 8, !tbaa !8
  %88 = getelementptr inbounds [1000 x %"class.std::vector"], ptr @G, i64 0, i64 %87
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %88, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %89 = load i64, ptr %10, align 8, !tbaa !8
  %90 = getelementptr inbounds [1000 x %"class.std::vector"], ptr @R, i64 0, i64 %89
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %90, ptr noundef nonnull align 8 dereferenceable(8) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %91

91:                                               ; preds = %80
  %92 = load i64, ptr %8, align 8, !tbaa !8
  %93 = add nsw i64 %92, 1
  store i64 %93, ptr %8, align 8, !tbaa !8
  br label %75, !llvm.loop !16

94:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store i64 0, ptr %11, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store i64 0, ptr %12, align 8, !tbaa !8
  br label %95

95:                                               ; preds = %105, %94
  %96 = load i64, ptr %12, align 8, !tbaa !8
  %97 = load i64, ptr @N, align 8, !tbaa !8
  %98 = icmp slt i64 %96, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %108

100:                                              ; preds = %95
  %101 = load i64, ptr %12, align 8, !tbaa !8
  %102 = getelementptr inbounds [1000 x i64], ptr @A, i64 0, i64 %101
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %102)
  %104 = load i64, ptr %103, align 8, !tbaa !8
  store i64 %104, ptr %11, align 8, !tbaa !8
  br label %105

105:                                              ; preds = %100
  %106 = load i64, ptr %12, align 8, !tbaa !8
  %107 = add nsw i64 %106, 1
  store i64 %107, ptr %12, align 8, !tbaa !8
  br label %95, !llvm.loop !17

108:                                              ; preds = %99
  %109 = load i64, ptr %11, align 8, !tbaa !8
  %110 = icmp ne i64 %109, 0
  br i1 %110, label %114, label %111

111:                                              ; preds = %108
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %112, i8 noundef signext 10)
  store i32 2, ptr %13, align 4
  br label %164, !llvm.loop !18

114:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store i64 0, ptr %14, align 8, !tbaa !8
  br label %115

115:                                              ; preds = %128, %114
  %116 = load i64, ptr %14, align 8, !tbaa !8
  %117 = load i64, ptr @N, align 8, !tbaa !8
  %118 = icmp slt i64 %116, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %115
  store i32 16, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %131

120:                                              ; preds = %115
  %121 = load i64, ptr %14, align 8, !tbaa !8
  %122 = getelementptr inbounds [1000 x %"class.std::vector"], ptr @G, i64 0, i64 %121
  %123 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %122) #7
  %124 = icmp ne i64 %123, 0
  br i1 %124, label %127, label %125

125:                                              ; preds = %120
  %126 = load i64, ptr %14, align 8, !tbaa !8
  store i64 %126, ptr @sink, align 8, !tbaa !8
  br label %127

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

128:                                              ; preds = %127
  %129 = load i64, ptr %14, align 8, !tbaa !8
  %130 = add nsw i64 %129, 1
  store i64 %130, ptr %14, align 8, !tbaa !8
  br label %115, !llvm.loop !19

131:                                              ; preds = %119
  %132 = load i64, ptr @sink, align 8, !tbaa !8
  call void @_Z5dfs_ixx(i64 noundef %132, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store i64 0, ptr %15, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store i64 0, ptr %16, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  store i64 0, ptr %17, align 8, !tbaa !8
  br label %133

133:                                              ; preds = %151, %131
  %134 = load i64, ptr %17, align 8, !tbaa !8
  %135 = load i64, ptr @mxd, align 8, !tbaa !8
  %136 = icmp sle i64 %134, %135
  br i1 %136, label %138, label %137

137:                                              ; preds = %133
  store i32 19, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %154

138:                                              ; preds = %133
  %139 = load i64, ptr %17, align 8, !tbaa !8
  %140 = getelementptr inbounds [1000 x i64], ptr @mxi, i64 0, i64 %139
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %140)
  %142 = load i64, ptr %141, align 8, !tbaa !8
  store i64 %142, ptr %15, align 8, !tbaa !8
  %143 = load i64, ptr %15, align 8, !tbaa !8
  %144 = icmp sle i64 %143, 0
  br i1 %144, label %145, label %148

145:                                              ; preds = %138
  %146 = load i64, ptr %16, align 8, !tbaa !8
  %147 = add nsw i64 %146, 1
  store i64 %147, ptr %16, align 8, !tbaa !8
  br label %148

148:                                              ; preds = %145, %138
  %149 = load i64, ptr %15, align 8, !tbaa !8
  %150 = add nsw i64 %149, -1
  store i64 %150, ptr %15, align 8, !tbaa !8
  br label %151

151:                                              ; preds = %148
  %152 = load i64, ptr %17, align 8, !tbaa !8
  %153 = add nsw i64 %152, 1
  store i64 %153, ptr %17, align 8, !tbaa !8
  br label %133, !llvm.loop !20

154:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %155 = load i64, ptr @sink, align 8, !tbaa !8
  %156 = call noundef i64 @_Z3dfsx(i64 noundef %155)
  store i64 %156, ptr %18, align 8, !tbaa !8
  %157 = load i64, ptr %16, align 8, !tbaa !8
  %158 = load i64, ptr %18, align 8, !tbaa !8
  %159 = add nsw i64 %157, %158
  %160 = load i64, ptr @MOD, align 8, !tbaa !8
  %161 = srem i64 %159, %160
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %161)
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %162, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  store i32 0, ptr %13, align 4
  br label %164

164:                                              ; preds = %154, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  %165 = load i32, ptr %13, align 4
  switch i32 %165, label %169 [
    i32 0, label %166
    i32 2, label %26
  ]

166:                                              ; preds = %164
  br label %26, !llvm.loop !18

167:                                              ; preds = %26
  %168 = load i32, ptr %1, align 4
  ret i32 %168

169:                                              ; preds = %164
  unreachable
}

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

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

attributes #0 = { 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 #1 = { inlinehint 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 #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 = { 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 #5 = { "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 = { 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 #7 = { 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 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}


; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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" }

@MOD = external dso_local local_unnamed_addr global i64, align 8
@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@A = external dso_local global [1000 x i64], align 16
@mxi = external dso_local global [1000 x i64], align 16
@mem = external dso_local global [1000 x i64], align 16
@G = external dso_local global [1000 x %"class.std::vector"], align 16
@R = external dso_local global [1000 x %"class.std::vector"], align 16
@idle = external dso_local global [1005 x i8], align 16
@vis = external dso_local global [1000 x [1000 x i8]], align 16
@sink = external dso_local local_unnamed_addr global i64, align 8
@mxd = external dso_local local_unnamed_addr global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5dfs_ixx(i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) 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 i64 @_Z3dfsx(i64 noundef) local_unnamed_addr #0

; 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 i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %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 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %15 = 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) @T)
  %16 = load i64, ptr @T, align 8, !tbaa !8
  %17 = add nsw i64 %16, -1
  store i64 %17, ptr @T, align 8, !tbaa !8
  %.not54 = icmp eq i64 %16, 0
  br i1 %.not54, label %._crit_edge57, label %.lr.ph56

.lr.ph56:                                         ; preds = %0, %91
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %20 = load i64, ptr @N, align 8, !tbaa !8
  %gep = getelementptr i8, ptr getelementptr inbounds (i8, ptr @idle, i64 2), i64 %20
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !11
  call void @_ZSt4fillIPbiEvT_S1_RKT0_(ptr noundef nonnull @idle, ptr noundef nonnull %gep, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %21 = load i64, ptr @N, align 8, !tbaa !8
  %22 = getelementptr inbounds i64, ptr @mxi, i64 %21
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr %2, align 4, !tbaa !11
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @mxi, ptr noundef nonnull %22, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %23 = load i64, ptr @N, align 8, !tbaa !8
  %24 = getelementptr inbounds i64, ptr @mem, i64 %23
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 -1, ptr %3, align 4, !tbaa !11
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @mem, ptr noundef nonnull %24, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  store i64 0, ptr @mxd, align 8, !tbaa !8
  %25 = load i64, ptr @N, align 8, !tbaa !8
  %26 = icmp sgt i64 %25, 0
  br i1 %26, label %.lr.ph, label %.preheader34

.preheader35:                                     ; preds = %.lr.ph
  %27 = icmp sgt i64 %34, 0
  br i1 %27, label %.lr.ph38, label %.preheader34

.lr.ph:                                           ; preds = %.lr.ph56, %.lr.ph
  %.036 = phi i64 [ %33, %.lr.ph ], [ 0, %.lr.ph56 ]
  %28 = getelementptr inbounds [1000 x %"class.std::vector"], ptr @G, i64 0, i64 %.036
  call void @_ZNSt6vectorIxSaIxEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #7
  %29 = getelementptr inbounds [1000 x %"class.std::vector"], ptr @R, i64 0, i64 %.036
  call void @_ZNSt6vectorIxSaIxEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %29) #7
  %30 = getelementptr inbounds [1000 x [1000 x i8]], ptr @vis, i64 0, i64 %.036
  %31 = load i64, ptr @N, align 8, !tbaa !8
  %32 = getelementptr inbounds i8, ptr %30, i64 %31
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 0, ptr %4, align 4, !tbaa !11
  call void @_ZSt4fillIPbiEvT_S1_RKT0_(ptr noundef nonnull %30, ptr noundef nonnull %32, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %33 = add nuw nsw i64 %.036, 1
  %34 = load i64, ptr @N, align 8, !tbaa !8
  %35 = icmp slt i64 %33, %34
  br i1 %35, label %.lr.ph, label %.preheader35, !llvm.loop !13

.preheader34:                                     ; preds = %.lr.ph38, %.lr.ph56, %.preheader35
  %36 = phi i64 [ %34, %.preheader35 ], [ %25, %.lr.ph56 ], [ %42, %.lr.ph38 ]
  %37 = load i64, ptr @M, align 8, !tbaa !8
  %38 = icmp sgt i64 %37, 0
  br i1 %38, label %.lr.ph40, label %._crit_edge

.lr.ph38:                                         ; preds = %.preheader35, %.lr.ph38
  %.03037 = phi i64 [ %41, %.lr.ph38 ], [ 0, %.preheader35 ]
  %39 = getelementptr inbounds [1000 x i64], ptr @A, i64 0, i64 %.03037
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %39)
  %41 = add nuw nsw i64 %.03037, 1
  %42 = load i64, ptr @N, align 8, !tbaa !8
  %43 = icmp slt i64 %41, %42
  br i1 %43, label %.lr.ph38, label %.preheader34, !llvm.loop !15

._crit_edge.loopexit:                             ; preds = %.lr.ph40
  %.pre = load i64, ptr @N, align 8, !tbaa !8
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader34
  %44 = phi i64 [ %.pre, %._crit_edge.loopexit ], [ %36, %.preheader34 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  store i64 0, ptr %7, align 8, !tbaa !8
  %45 = icmp sgt i64 %44, 0
  br i1 %45, label %.lr.ph43, label %._crit_edge44.thread

.lr.ph40:                                         ; preds = %.preheader34, %.lr.ph40
  %.02939 = phi i64 [ %55, %.lr.ph40 ], [ 0, %.preheader34 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %46, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %48 = load i64, ptr %5, align 8, !tbaa !8
  %49 = add nsw i64 %48, -1
  store i64 %49, ptr %5, align 8, !tbaa !8
  %50 = load i64, ptr %6, align 8, !tbaa !8
  %51 = add nsw i64 %50, -1
  store i64 %51, ptr %6, align 8, !tbaa !8
  %52 = getelementptr inbounds [1000 x %"class.std::vector"], ptr @G, i64 0, i64 %49
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %52, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %53 = load i64, ptr %6, align 8, !tbaa !8
  %54 = getelementptr inbounds [1000 x %"class.std::vector"], ptr @R, i64 0, i64 %53
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %54, ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %55 = add nuw nsw i64 %.02939, 1
  %56 = load i64, ptr @M, align 8, !tbaa !8
  %57 = icmp slt i64 %55, %56
  br i1 %57, label %.lr.ph40, label %._crit_edge.loopexit, !llvm.loop !16

._crit_edge44:                                    ; preds = %.lr.ph43
  %.not31 = icmp eq i64 %61, 0
  br i1 %.not31, label %._crit_edge44.thread, label %.preheader

.preheader:                                       ; preds = %._crit_edge44
  %58 = icmp sgt i64 %63, 0
  br i1 %58, label %.lr.ph46, label %._crit_edge47

.lr.ph43:                                         ; preds = %._crit_edge, %.lr.ph43
  %.02841 = phi i64 [ %62, %.lr.ph43 ], [ 0, %._crit_edge ]
  %59 = getelementptr inbounds [1000 x i64], ptr @A, i64 0, i64 %.02841
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %59)
  %61 = load i64, ptr %60, align 8, !tbaa !8
  store i64 %61, ptr %7, align 8, !tbaa !8
  %62 = add nuw nsw i64 %.02841, 1
  %63 = load i64, ptr @N, align 8, !tbaa !8
  %64 = icmp slt i64 %62, %63
  br i1 %64, label %.lr.ph43, label %._crit_edge44, !llvm.loop !17

._crit_edge44.thread:                             ; preds = %._crit_edge, %._crit_edge44
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %65, i8 noundef signext 10)
  br label %91, !llvm.loop !18

._crit_edge47:                                    ; preds = %72, %.preheader
  %67 = load i64, ptr @sink, align 8, !tbaa !8
  call void @_Z5dfs_ixx(i64 noundef %67, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  store i64 0, ptr %8, align 8, !tbaa !8
  %68 = load i64, ptr @mxd, align 8, !tbaa !8
  %.not3248 = icmp slt i64 %68, 0
  br i1 %.not3248, label %._crit_edge53, label %.lr.ph52

.lr.ph46:                                         ; preds = %.preheader, %72
  %.02745 = phi i64 [ %73, %72 ], [ 0, %.preheader ]
  %69 = getelementptr inbounds [1000 x %"class.std::vector"], ptr @G, i64 0, i64 %.02745
  %70 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %69) #7
  %.not33 = icmp eq i64 %70, 0
  br i1 %.not33, label %71, label %72

71:                                               ; preds = %.lr.ph46
  store i64 %.02745, ptr @sink, align 8, !tbaa !8
  br label %72

72:                                               ; preds = %.lr.ph46, %71
  %73 = add nuw nsw i64 %.02745, 1
  %74 = load i64, ptr @N, align 8, !tbaa !8
  %75 = icmp slt i64 %73, %74
  br i1 %75, label %.lr.ph46, label %._crit_edge47, !llvm.loop !19

._crit_edge53:                                    ; preds = %.lr.ph52, %._crit_edge47
  %.026.lcssa = phi i64 [ 0, %._crit_edge47 ], [ %spec.select, %.lr.ph52 ]
  %76 = load i64, ptr @sink, align 8, !tbaa !8
  %77 = call noundef i64 @_Z3dfsx(i64 noundef %76)
  %78 = add nsw i64 %77, %.026.lcssa
  %79 = load i64, ptr @MOD, align 8, !tbaa !8
  %80 = srem i64 %78, %79
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %80)
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %81, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br label %91

.lr.ph52:                                         ; preds = %._crit_edge47, %.lr.ph52
  %.02550 = phi i64 [ %89, %.lr.ph52 ], [ 0, %._crit_edge47 ]
  %.02649 = phi i64 [ %spec.select, %.lr.ph52 ], [ 0, %._crit_edge47 ]
  %83 = getelementptr inbounds [1000 x i64], ptr @mxi, i64 0, i64 %.02550
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %83)
  %85 = load i64, ptr %84, align 8, !tbaa !8
  %86 = icmp slt i64 %85, 1
  %87 = zext i1 %86 to i64
  %spec.select = add nuw nsw i64 %.02649, %87
  %88 = add nsw i64 %85, -1
  store i64 %88, ptr %8, align 8, !tbaa !8
  %89 = add nuw nsw i64 %.02550, 1
  %90 = load i64, ptr @mxd, align 8, !tbaa !8
  %.not32.not = icmp slt i64 %.02550, %90
  br i1 %.not32.not, label %.lr.ph52, label %._crit_edge53, !llvm.loop !20

91:                                               ; preds = %._crit_edge53, %._crit_edge44.thread
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  %92 = load i64, ptr @T, align 8, !tbaa !8
  %93 = add nsw i64 %92, -1
  store i64 %93, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %92, 0
  br i1 %.not, label %._crit_edge57, label %.lr.ph56

._crit_edge57:                                    ; preds = %91, %0
  ret i32 0
}

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

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

; 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 #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; 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 #0 align 2

attributes #0 = { 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 #1 = { inlinehint 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 #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 = { 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 #5 = { "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 = { 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 #7 = { 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 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}


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