; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/102 Division 1/Problem C (DP)

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

@id = external dso_local global [4 x %"class.std::vector"], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@dp = external dso_local global [10 x [9 x [524288 x i32]]], align 16
@res = external dso_local global [9 x [9 x i32]], align 16
@mx = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::initializer_list", align 8
  %6 = alloca [4 x i32], align 4
  %7 = alloca %"class.std::initializer_list", align 8
  %8 = alloca [4 x i32], align 4
  %9 = alloca %"class.std::initializer_list", align 8
  %10 = alloca [4 x i32], align 4
  %11 = alloca %"class.std::initializer_list", align 8
  %12 = alloca [4 x i32], align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = icmp slt i32 %16, 2
  br i1 %17, label %21, label %18

18:                                               ; preds = %0
  %19 = load i32, ptr @m, align 4, !tbaa !5
  %20 = icmp slt i32 %19, 2
  br i1 %20, label %21, label %45

21:                                               ; preds = %18, %0
  %22 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %41, %21
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = load i32, ptr @n, align 4, !tbaa !5
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %28, label %27

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

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

29:                                               ; preds = %36, %28
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = load i32, ptr @m, align 4, !tbaa !5
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

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

34:                                               ; preds = %29
  %35 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %36

36:                                               ; preds = %34
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %4, align 4, !tbaa !5
  br label %29, !llvm.loop !9

39:                                               ; preds = %33
  %40 = call i32 @puts(ptr noundef @.str.4)
  br label %41

41:                                               ; preds = %39
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %2, align 4, !tbaa !5
  br label %23, !llvm.loop !11

44:                                               ; preds = %27
  store i32 0, ptr %1, align 4
  br label %164

45:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  %46 = getelementptr inbounds i32, ptr %6, i64 1
  store i32 1, ptr %46, align 4, !tbaa !5
  %47 = getelementptr inbounds i32, ptr %6, i64 2
  %48 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %48, ptr %47, align 4, !tbaa !5
  %49 = getelementptr inbounds i32, ptr %6, i64 3
  %50 = load i32, ptr @n, align 4, !tbaa !5
  %51 = mul nsw i32 2, %50
  store i32 %51, ptr %49, align 4, !tbaa !5
  %52 = getelementptr inbounds %"class.std::initializer_list", ptr %5, i32 0, i32 0
  store ptr %6, ptr %52, align 8, !tbaa !12
  %53 = getelementptr inbounds %"class.std::initializer_list", ptr %5, i32 0, i32 1
  store i64 4, ptr %53, align 8, !tbaa !16
  %54 = getelementptr inbounds { ptr, i64 }, ptr %5, i32 0, i32 0
  %55 = load ptr, ptr %54, align 8
  %56 = getelementptr inbounds { ptr, i64 }, ptr %5, i32 0, i32 1
  %57 = load i64, ptr %56, align 8
  %58 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSESt16initializer_listIiE(ptr noundef nonnull align 8 dereferenceable(24) @id, ptr %55, i64 %57)
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #5
  %59 = load i32, ptr @n, align 4, !tbaa !5
  %60 = sub nsw i32 %59, 1
  store i32 %60, ptr %8, align 4, !tbaa !5
  %61 = getelementptr inbounds i32, ptr %8, i64 1
  %62 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %62, ptr %61, align 4, !tbaa !5
  %63 = getelementptr inbounds i32, ptr %8, i64 2
  %64 = load i32, ptr @n, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %63, align 4, !tbaa !5
  %66 = getelementptr inbounds i32, ptr %8, i64 3
  %67 = load i32, ptr @n, align 4, !tbaa !5
  %68 = mul nsw i32 2, %67
  %69 = sub nsw i32 %68, 1
  store i32 %69, ptr %66, align 4, !tbaa !5
  %70 = getelementptr inbounds %"class.std::initializer_list", ptr %7, i32 0, i32 0
  store ptr %8, ptr %70, align 8, !tbaa !12
  %71 = getelementptr inbounds %"class.std::initializer_list", ptr %7, i32 0, i32 1
  store i64 4, ptr %71, align 8, !tbaa !16
  %72 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 0
  %73 = load ptr, ptr %72, align 8
  %74 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 1
  %75 = load i64, ptr %74, align 8
  %76 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSESt16initializer_listIiE(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds ([4 x %"class.std::vector"], ptr @id, i64 0, i64 1), ptr %73, i64 %75)
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  %77 = load i32, ptr @n, align 4, !tbaa !5
  %78 = sub nsw i32 %77, 1
  store i32 %78, ptr %10, align 4, !tbaa !5
  %79 = getelementptr inbounds i32, ptr %10, i64 1
  %80 = load i32, ptr @n, align 4, !tbaa !5
  %81 = mul nsw i32 2, %80
  %82 = sub nsw i32 %81, 2
  store i32 %82, ptr %79, align 4, !tbaa !5
  %83 = getelementptr inbounds i32, ptr %10, i64 2
  %84 = load i32, ptr @n, align 4, !tbaa !5
  %85 = mul nsw i32 2, %84
  %86 = sub nsw i32 %85, 1
  store i32 %86, ptr %83, align 4, !tbaa !5
  %87 = getelementptr inbounds i32, ptr %10, i64 3
  %88 = load i32, ptr @n, align 4, !tbaa !5
  %89 = mul nsw i32 2, %88
  store i32 %89, ptr %87, align 4, !tbaa !5
  %90 = getelementptr inbounds %"class.std::initializer_list", ptr %9, i32 0, i32 0
  store ptr %10, ptr %90, align 8, !tbaa !12
  %91 = getelementptr inbounds %"class.std::initializer_list", ptr %9, i32 0, i32 1
  store i64 4, ptr %91, align 8, !tbaa !16
  %92 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8
  %94 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 1
  %95 = load i64, ptr %94, align 8
  %96 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSESt16initializer_listIiE(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds ([4 x %"class.std::vector"], ptr @id, i64 0, i64 2), ptr %93, i64 %95)
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #5
  %97 = load i32, ptr @n, align 4, !tbaa !5
  %98 = sub nsw i32 %97, 3
  store i32 %98, ptr %12, align 4, !tbaa !5
  %99 = getelementptr inbounds i32, ptr %12, i64 1
  %100 = load i32, ptr @n, align 4, !tbaa !5
  %101 = sub nsw i32 %100, 2
  store i32 %101, ptr %99, align 4, !tbaa !5
  %102 = getelementptr inbounds i32, ptr %12, i64 2
  %103 = load i32, ptr @n, align 4, !tbaa !5
  %104 = sub nsw i32 %103, 1
  store i32 %104, ptr %102, align 4, !tbaa !5
  %105 = getelementptr inbounds i32, ptr %12, i64 3
  %106 = load i32, ptr @n, align 4, !tbaa !5
  %107 = mul nsw i32 2, %106
  %108 = sub nsw i32 %107, 1
  store i32 %108, ptr %105, align 4, !tbaa !5
  %109 = getelementptr inbounds %"class.std::initializer_list", ptr %11, i32 0, i32 0
  store ptr %12, ptr %109, align 8, !tbaa !12
  %110 = getelementptr inbounds %"class.std::initializer_list", ptr %11, i32 0, i32 1
  store i64 4, ptr %110, align 8, !tbaa !16
  %111 = getelementptr inbounds { ptr, i64 }, ptr %11, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8
  %113 = getelementptr inbounds { ptr, i64 }, ptr %11, i32 0, i32 1
  %114 = load i64, ptr %113, align 8
  %115 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSESt16initializer_listIiE(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds ([4 x %"class.std::vector"], ptr @id, i64 0, i64 3), ptr %112, i64 %114)
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  call void @llvm.memset.p0.i64(ptr align 16 @dp, i8 -1, i64 188743680, i1 false)
  %116 = call noundef i32 @_Z2goiii(i32 noundef 0, i32 noundef 0, i32 noundef 0)
  store i32 %116, ptr @mx, align 4, !tbaa !5
  %117 = load i32, ptr @mx, align 4, !tbaa !5
  %118 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %117)
  call void @_Z3getiii(i32 noundef 0, i32 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %160, %45
  %120 = load i32, ptr %13, align 4, !tbaa !5
  %121 = load i32, ptr @n, align 4, !tbaa !5
  %122 = icmp slt i32 %120, %121
  br i1 %122, label %124, label %123

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

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

125:                                              ; preds = %155, %124
  %126 = load i32, ptr %14, align 4, !tbaa !5
  %127 = load i32, ptr @m, align 4, !tbaa !5
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %130, label %129

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

130:                                              ; preds = %125
  %131 = load i32, ptr %13, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [9 x [9 x i32]], ptr @res, i64 0, i64 %132
  %134 = load i32, ptr %14, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [9 x i32], ptr %133, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = icmp sgt i32 %137, 0
  br i1 %138, label %139, label %152

139:                                              ; preds = %130
  %140 = load i32, ptr %13, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [9 x [9 x i32]], ptr @res, i64 0, i64 %141
  %143 = load i32, ptr %14, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [9 x i32], ptr %142, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = add nsw i32 65, %146
  %148 = sub nsw i32 %147, 1
  %149 = trunc i32 %148 to i8
  %150 = sext i8 %149 to i32
  %151 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %150)
  br label %154

152:                                              ; preds = %130
  %153 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %154

154:                                              ; preds = %152, %139
  br label %155

155:                                              ; preds = %154
  %156 = load i32, ptr %14, align 4, !tbaa !5
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %14, align 4, !tbaa !5
  br label %125, !llvm.loop !17

158:                                              ; preds = %129
  %159 = call i32 @puts(ptr noundef @.str.4)
  br label %160

160:                                              ; preds = %158
  %161 = load i32, ptr %13, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %13, align 4, !tbaa !5
  br label %119, !llvm.loop !18

163:                                              ; preds = %123
  store i32 0, ptr %1, align 4
  br label %164

164:                                              ; preds = %163, %44
  %165 = load i32, ptr %1, align 4
  ret i32 %165
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #3

declare i32 @printf(ptr noundef, ...) #3

declare i32 @puts(ptr noundef) #3

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

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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, !14, i64 0}
!13 = !{!"_ZTSSt16initializer_listIiE", !14, i64 0, !15, i64 8}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!13, !15, i64 8}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@id = external dso_local global [4 x %"class.std::vector"], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@dp = external dso_local local_unnamed_addr global [10 x [9 x [524288 x i32]]], align 16
@res = external dso_local local_unnamed_addr global [9 x [9 x i32]], align 16
@mx = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca [4 x i32], align 4
  %2 = alloca [4 x i32], align 4
  %3 = alloca [4 x i32], align 4
  %4 = alloca [4 x i32], align 8
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %7 = icmp slt i32 %6, 2
  %8 = load i32, ptr @m, align 4
  %9 = icmp slt i32 %8, 2
  %or.cond = select i1 %7, i1 true, i1 %9
  br i1 %or.cond, label %10, label %24

10:                                               ; preds = %0
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %10, %._crit_edge31
  %.02232 = phi i32 [ %17, %._crit_edge31 ], [ 0, %10 ]
  %14 = load i32, ptr @m, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph30, label %._crit_edge31

._crit_edge31:                                    ; preds = %.lr.ph30, %.preheader
  %16 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.4)
  %17 = add nuw nsw i32 %.02232, 1
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %.preheader, label %.loopexit, !llvm.loop !9

.lr.ph30:                                         ; preds = %.preheader, %.lr.ph30
  %.02329 = phi i32 [ %21, %.lr.ph30 ], [ 0, %.preheader ]
  %20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %21 = add nuw nsw i32 %.02329, 1
  %22 = load i32, ptr @m, align 4, !tbaa !5
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %.lr.ph30, label %._crit_edge31, !llvm.loop !11

24:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #5
  store i32 0, ptr %1, align 4, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %1, i64 4
  store i32 1, ptr %25, align 4, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %1, i64 8
  store i32 %6, ptr %26, align 4, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %1, i64 12
  %28 = shl nuw nsw i32 %6, 1
  store i32 %28, ptr %27, align 4, !tbaa !5
  %29 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSESt16initializer_listIiE(ptr noundef nonnull align 8 dereferenceable(24) @id, ptr nonnull %1, i64 4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #5
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = add nsw i32 %30, -1
  store i32 %31, ptr %2, align 4, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %2, i64 4
  store i32 %30, ptr %32, align 4, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %2, i64 8
  %34 = add nsw i32 %30, 1
  store i32 %34, ptr %33, align 4, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %2, i64 12
  %36 = shl nsw i32 %30, 1
  %37 = add nsw i32 %36, -1
  store i32 %37, ptr %35, align 4, !tbaa !5
  %38 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSESt16initializer_listIiE(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @id, i64 24), ptr nonnull %2, i64 4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = add nsw i32 %39, -1
  store i32 %40, ptr %3, align 4, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %3, i64 4
  %42 = shl nsw i32 %39, 1
  %43 = add nsw i32 %42, -2
  store i32 %43, ptr %41, align 4, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %3, i64 8
  %45 = add nsw i32 %42, -1
  store i32 %45, ptr %44, align 4, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %3, i64 12
  store i32 %42, ptr %46, align 4, !tbaa !5
  %47 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSESt16initializer_listIiE(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @id, i64 48), ptr nonnull %3, i64 4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %49 = insertelement <2 x i32> poison, i32 %48, i64 0
  %50 = shufflevector <2 x i32> %49, <2 x i32> poison, <2 x i32> zeroinitializer
  %51 = add nsw <2 x i32> %50, <i32 -3, i32 -2>
  store <2 x i32> %51, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %4, i64 8
  %53 = add nsw i32 %48, -1
  store i32 %53, ptr %52, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %4, i64 12
  %55 = shl nsw i32 %48, 1
  %56 = add nsw i32 %55, -1
  store i32 %56, ptr %54, align 4, !tbaa !5
  %57 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSESt16initializer_listIiE(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @id, i64 72), ptr nonnull %4, i64 4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(188743680) @dp, i8 -1, i64 188743680, i1 false)
  %58 = call noundef i32 @_Z2goiii(i32 noundef 0, i32 noundef 0, i32 noundef 0)
  store i32 %58, ptr @mx, align 4, !tbaa !5
  %59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %58)
  call void @_Z3getiii(i32 noundef 0, i32 noundef 0, i32 noundef 0)
  %60 = load i32, ptr @n, align 4, !tbaa !5
  %61 = icmp sgt i32 %60, 0
  br i1 %61, label %.preheader25, label %.loopexit

.preheader25:                                     ; preds = %24, %._crit_edge
  %indvars.iv35 = phi i64 [ %indvars.iv.next36, %._crit_edge ], [ 0, %24 ]
  %62 = load i32, ptr @m, align 4, !tbaa !5
  %63 = icmp sgt i32 %62, 0
  br i1 %63, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %77, %.preheader25
  %64 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.4)
  %indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1
  %65 = load i32, ptr @n, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = icmp slt i64 %indvars.iv.next36, %66
  br i1 %67, label %.preheader25, label %.loopexit, !llvm.loop !12

.lr.ph:                                           ; preds = %.preheader25, %77
  %indvars.iv = phi i64 [ %indvars.iv.next, %77 ], [ 0, %.preheader25 ]
  %68 = getelementptr inbounds [9 x [9 x i32]], ptr @res, i64 0, i64 %indvars.iv35, i64 %indvars.iv
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = icmp sgt i32 %69, 0
  br i1 %70, label %71, label %75

71:                                               ; preds = %.lr.ph
  %72 = shl i32 %69, 24
  %sext = add i32 %72, 1073741824
  %73 = ashr exact i32 %sext, 24
  %74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %73)
  br label %77

75:                                               ; preds = %.lr.ph
  %76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %77

77:                                               ; preds = %71, %75
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %78 = load i32, ptr @m, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = icmp slt i64 %indvars.iv.next, %79
  br i1 %80, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.loopexit:                                        ; preds = %._crit_edge, %._crit_edge31, %24, %10
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3

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

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass