; LLVM IR from AdarshGaur/Competitive-Programming :: Codeforces/Codeforces Round #817 (Div. 4)/F. L-shapes.ll (Z9sideTouchll)

; 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<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::initializer_list" = type { ptr, i64 }
%"struct.std::_Bit_reference" = type { ptr, i64 }

@n = external dso_local global i64, align 8
@m = external dso_local global i64, align 8
@_Z4gridB5cxx11 = external dso_local global %"class.std::vector", align 8
@vis = external dso_local global %"class.std::vector.0", align 8

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z9sideTouchll(i64 noundef %0, i64 noundef %1) #0 {
  %3 = alloca i1, align 1
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.std::initializer_list", align 8
  %8 = alloca [3 x i32], align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca %"class.std::initializer_list", align 8
  %15 = alloca [3 x i32], align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca %"struct.std::_Bit_reference", align 8
  store i64 %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 12, ptr %8) #3
  store i32 -1, ptr %8, align 4, !tbaa !9
  %22 = getelementptr inbounds i32, ptr %8, i64 1
  store i32 0, ptr %22, align 4, !tbaa !9
  %23 = getelementptr inbounds i32, ptr %8, i64 2
  store i32 1, ptr %23, align 4, !tbaa !9
  %24 = getelementptr inbounds %"class.std::initializer_list", ptr %7, i32 0, i32 0
  store ptr %8, ptr %24, align 8, !tbaa !11
  %25 = getelementptr inbounds %"class.std::initializer_list", ptr %7, i32 0, i32 1
  store i64 3, ptr %25, align 8, !tbaa !14
  store ptr %7, ptr %6, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %26 = load ptr, ptr %6, align 8, !tbaa !15
  %27 = call noundef ptr @_ZNKSt16initializer_listIiE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %26) #3
  store ptr %27, ptr %9, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %28 = load ptr, ptr %6, align 8, !tbaa !15
  %29 = call noundef ptr @_ZNKSt16initializer_listIiE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %28) #3
  store ptr %29, ptr %10, align 8, !tbaa !15
  br label %30

30:                                               ; preds = %120, %2
  %31 = load ptr, ptr %9, align 8, !tbaa !15
  %32 = load ptr, ptr %10, align 8, !tbaa !15
  %33 = icmp ne ptr %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  store i32 2, ptr %11, align 4
  br label %123

35:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %36 = load ptr, ptr %9, align 8, !tbaa !15
  %37 = load i32, ptr %36, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  store i64 %38, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #3
  store i32 -1, ptr %15, align 4, !tbaa !9
  %39 = getelementptr inbounds i32, ptr %15, i64 1
  store i32 0, ptr %39, align 4, !tbaa !9
  %40 = getelementptr inbounds i32, ptr %15, i64 2
  store i32 1, ptr %40, align 4, !tbaa !9
  %41 = getelementptr inbounds %"class.std::initializer_list", ptr %14, i32 0, i32 0
  store ptr %15, ptr %41, align 8, !tbaa !11
  %42 = getelementptr inbounds %"class.std::initializer_list", ptr %14, i32 0, i32 1
  store i64 3, ptr %42, align 8, !tbaa !14
  store ptr %14, ptr %13, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %43 = load ptr, ptr %13, align 8, !tbaa !15
  %44 = call noundef ptr @_ZNKSt16initializer_listIiE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %43) #3
  store ptr %44, ptr %16, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %45 = load ptr, ptr %13, align 8, !tbaa !15
  %46 = call noundef ptr @_ZNKSt16initializer_listIiE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %45) #3
  store ptr %46, ptr %17, align 8, !tbaa !15
  br label %47

47:                                               ; preds = %111, %35
  %48 = load ptr, ptr %16, align 8, !tbaa !15
  %49 = load ptr, ptr %17, align 8, !tbaa !15
  %50 = icmp ne ptr %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  store i32 4, ptr %11, align 4
  br label %114

52:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %53 = load ptr, ptr %16, align 8, !tbaa !15
  %54 = load i32, ptr %53, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  store i64 %55, ptr %18, align 8, !tbaa !5
  %56 = load i64, ptr %12, align 8, !tbaa !5
  %57 = icmp eq i64 %56, 0
  br i1 %57, label %58, label %62

58:                                               ; preds = %52
  %59 = load i64, ptr %18, align 8, !tbaa !5
  %60 = icmp eq i64 %59, 0
  br i1 %60, label %61, label %62

61:                                               ; preds = %58
  store i32 5, ptr %11, align 4
  br label %108

62:                                               ; preds = %58, %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %63 = load i64, ptr %4, align 8, !tbaa !5
  %64 = load i64, ptr %12, align 8, !tbaa !5
  %65 = add nsw i64 %63, %64
  store i64 %65, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  %66 = load i64, ptr %5, align 8, !tbaa !5
  %67 = load i64, ptr %18, align 8, !tbaa !5
  %68 = add nsw i64 %66, %67
  store i64 %68, ptr %20, align 8, !tbaa !5
  %69 = load i64, ptr %19, align 8, !tbaa !5
  %70 = icmp slt i64 %69, 0
  br i1 %70, label %82, label %71

71:                                               ; preds = %62
  %72 = load i64, ptr %19, align 8, !tbaa !5
  %73 = load i64, ptr @n, align 8, !tbaa !5
  %74 = icmp eq i64 %72, %73
  br i1 %74, label %82, label %75

75:                                               ; preds = %71
  %76 = load i64, ptr %20, align 8, !tbaa !5
  %77 = icmp slt i64 %76, 0
  br i1 %77, label %82, label %78

78:                                               ; preds = %75
  %79 = load i64, ptr %20, align 8, !tbaa !5
  %80 = load i64, ptr @m, align 8, !tbaa !5
  %81 = icmp eq i64 %79, %80
  br i1 %81, label %82, label %83

82:                                               ; preds = %78, %75, %71, %62
  store i32 5, ptr %11, align 4
  br label %105

83:                                               ; preds = %78
  %84 = load i64, ptr %19, align 8, !tbaa !5
  %85 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_Z4gridB5cxx11, i64 noundef %84) #3
  %86 = load i64, ptr %20, align 8, !tbaa !5
  %87 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %85, i64 noundef %86)
  %88 = load i8, ptr %87, align 1, !tbaa !16
  %89 = sext i8 %88 to i32
  %90 = icmp eq i32 %89, 42
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #3
  br i1 %90, label %91, label %101

91:                                               ; preds = %83
  %92 = load i64, ptr %19, align 8, !tbaa !5
  %93 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vis, i64 noundef %92) #3
  %94 = load i64, ptr %20, align 8, !tbaa !5
  %95 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %93, i64 noundef %94)
  %96 = getelementptr inbounds { ptr, i64 }, ptr %21, i32 0, i32 0
  %97 = extractvalue { ptr, i64 } %95, 0
  store ptr %97, ptr %96, align 8
  %98 = getelementptr inbounds { ptr, i64 }, ptr %21, i32 0, i32 1
  %99 = extractvalue { ptr, i64 } %95, 1
  store i64 %99, ptr %98, align 8
  %100 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %21) #3
  br label %101

101:                                              ; preds = %91, %83
  %102 = phi i1 [ false, %83 ], [ %100, %91 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #3
  br i1 %102, label %103, label %104

103:                                              ; preds = %101
  store i1 true, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %105

104:                                              ; preds = %101
  store i32 0, ptr %11, align 4
  br label %105

105:                                              ; preds = %104, %103, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  %106 = load i32, ptr %11, align 4
  switch i32 %106, label %108 [
    i32 0, label %107
  ]

107:                                              ; preds = %105
  store i32 0, ptr %11, align 4
  br label %108

108:                                              ; preds = %107, %105, %61
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  %109 = load i32, ptr %11, align 4
  switch i32 %109, label %114 [
    i32 0, label %110
    i32 5, label %111
  ]

110:                                              ; preds = %108
  br label %111

111:                                              ; preds = %110, %108
  %112 = load ptr, ptr %16, align 8, !tbaa !15
  %113 = getelementptr inbounds i32, ptr %112, i32 1
  store ptr %113, ptr %16, align 8, !tbaa !15
  br label %47

114:                                              ; preds = %108, %51
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  %115 = load i32, ptr %11, align 4
  switch i32 %115, label %117 [
    i32 4, label %116
  ]

116:                                              ; preds = %114
  store i32 0, ptr %11, align 4
  br label %117

117:                                              ; preds = %116, %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  %118 = load i32, ptr %11, align 4
  switch i32 %118, label %123 [
    i32 0, label %119
  ]

119:                                              ; preds = %117
  br label %120

120:                                              ; preds = %119
  %121 = load ptr, ptr %9, align 8, !tbaa !15
  %122 = getelementptr inbounds i32, ptr %121, i32 1
  store ptr %122, ptr %9, align 8, !tbaa !15
  br label %30

123:                                              ; preds = %117, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %124 = load i32, ptr %11, align 4
  switch i32 %124, label %128 [
    i32 2, label %125
    i32 1, label %126
  ]

125:                                              ; preds = %123
  store i1 false, ptr %3, align 1
  br label %126

126:                                              ; preds = %125, %123
  %127 = load i1, ptr %3, align 1
  ret i1 %127

128:                                              ; preds = %123
  unreachable
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt16initializer_listIiE5beginEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt16initializer_listIiE3endEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

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

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 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 #3 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTSSt16initializer_listIiE", !13, i64 0, !6, i64 8}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!12, !6, i64 8}
!15 = !{!13, !13, i64 0}
!16 = !{!7, !7, i64 0}


; 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<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::initializer_list" = type { ptr, i64 }
%"struct.std::_Bit_reference" = type { ptr, i64 }

@n = external dso_local local_unnamed_addr global i64, align 8
@m = external dso_local local_unnamed_addr global i64, align 8
@_Z4gridB5cxx11 = external dso_local global %"class.std::vector", align 8
@vis = external dso_local global %"class.std::vector.0", align 8

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z9sideTouchll(i64 noundef %0, i64 noundef %1) local_unnamed_addr #0 {
  %3 = alloca %"class.std::initializer_list", align 8
  %4 = alloca [3 x i32], align 4
  %5 = alloca %"class.std::initializer_list", align 8
  %6 = alloca [3 x i32], align 4
  %7 = alloca %"struct.std::_Bit_reference", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #3
  store i32 -1, ptr %4, align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %4, i64 4
  store i32 0, ptr %8, align 4, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %4, i64 8
  store i32 1, ptr %9, align 4, !tbaa !5
  store ptr %4, ptr %3, align 8, !tbaa !9
  %10 = getelementptr inbounds i8, ptr %3, i64 8
  store i64 3, ptr %10, align 8, !tbaa !13
  %11 = call noundef ptr @_ZNKSt16initializer_listIiE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %3) #3
  %12 = call noundef ptr @_ZNKSt16initializer_listIiE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %3) #3
  %.not59.not = icmp eq ptr %11, %12
  br i1 %.not59.not, label %.loopexit, label %.lr.ph63

.lr.ph63:                                         ; preds = %2
  %13 = getelementptr inbounds i8, ptr %6, i64 4
  %14 = getelementptr inbounds i8, ptr %6, i64 8
  %15 = getelementptr inbounds i8, ptr %5, i64 8
  %16 = getelementptr inbounds i8, ptr %7, i64 8
  br label %17

17:                                               ; preds = %.lr.ph63, %._crit_edge
  %.03760 = phi ptr [ %11, %.lr.ph63 ], [ %49, %._crit_edge ]
  %18 = load i32, ptr %.03760, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #3
  store i32 -1, ptr %6, align 4, !tbaa !5
  store i32 0, ptr %13, align 4, !tbaa !5
  store i32 1, ptr %14, align 4, !tbaa !5
  store ptr %6, ptr %5, align 8, !tbaa !9
  store i64 3, ptr %15, align 8, !tbaa !13
  %19 = call noundef ptr @_ZNKSt16initializer_listIiE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %5) #3
  %20 = call noundef ptr @_ZNKSt16initializer_listIiE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %5) #3
  %.not4556 = icmp eq ptr %19, %20
  br i1 %.not4556, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %17
  %.fr65 = freeze i32 %18
  %21 = sext i32 %.fr65 to i64
  %22 = icmp eq i32 %.fr65, 0
  %23 = add i64 %21, %0
  %24 = icmp slt i64 %23, 0
  br i1 %24, label %._crit_edge, label %.lr.ph.split

.lr.ph.split:                                     ; preds = %.lr.ph, %46
  %.04257 = phi ptr [ %47, %46 ], [ %19, %.lr.ph ]
  %25 = load i32, ptr %.04257, align 4, !tbaa !5
  %26 = icmp eq i32 %25, 0
  %or.cond = select i1 %22, i1 %26, i1 false
  br i1 %or.cond, label %46, label %27

27:                                               ; preds = %.lr.ph.split
  %28 = sext i32 %25 to i64
  %29 = add nsw i64 %28, %1
  %30 = load i64, ptr @n, align 8, !tbaa !14
  %31 = icmp eq i64 %23, %30
  %32 = icmp slt i64 %29, 0
  %or.cond5 = select i1 %31, i1 true, i1 %32
  %33 = load i64, ptr @m, align 8
  %34 = icmp eq i64 %29, %33
  %or.cond47 = select i1 %or.cond5, i1 true, i1 %34
  br i1 %or.cond47, label %46, label %35

35:                                               ; preds = %27
  %36 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_Z4gridB5cxx11, i64 noundef %23) #3
  %37 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %36, i64 noundef %29)
  %38 = load i8, ptr %37, align 1, !tbaa !15
  %39 = icmp eq i8 %38, 42
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  br i1 %39, label %40, label %.critedge

40:                                               ; preds = %35
  %41 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vis, i64 noundef %23) #3
  %42 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %41, i64 noundef %29)
  %43 = extractvalue { ptr, i64 } %42, 0
  store ptr %43, ptr %7, align 8
  %44 = extractvalue { ptr, i64 } %42, 1
  store i64 %44, ptr %16, align 8
  %45 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %7) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  br i1 %45, label %48, label %46

.critedge:                                        ; preds = %35
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  br label %46

46:                                               ; preds = %40, %.critedge, %.lr.ph.split, %27
  %47 = getelementptr inbounds i8, ptr %.04257, i64 4
  %.not45 = icmp eq ptr %47, %20
  br i1 %.not45, label %._crit_edge, label %.lr.ph.split

48:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  br label %.loopexit

._crit_edge:                                      ; preds = %46, %.lr.ph, %17
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  %49 = getelementptr inbounds i8, ptr %.03760, i64 4
  %.not.not = icmp eq ptr %49, %12
  br i1 %.not.not, label %.loopexit, label %17

.loopexit:                                        ; preds = %._crit_edge, %2, %48
  %.not55 = phi i1 [ true, %48 ], [ false, %2 ], [ false, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #3
  ret i1 %.not55
}

; 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 nounwind uwtable
declare dso_local noundef ptr @_ZNKSt16initializer_listIiE5beginEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt16initializer_listIiE3endEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

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

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 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 #3 = { 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, !11, i64 0}
!10 = !{!"_ZTSSt16initializer_listIiE", !11, i64 0, !12, i64 8}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!10, !12, i64 8}
!14 = !{!12, !12, i64 0}
!15 = !{!7, !7, i64 0}


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