; LLVM IR from eyangch/competitive-programming :: USACOtraining/5.1/starry.ll (Z2ffxx)

; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i64, i64 }

@dx = external dso_local global [8 x i64], align 16
@dy = external dso_local global [8 x i64], align 16
@W = external dso_local global i64, align 8
@H = external dso_local global i64, align 8
@_Z1BB5cxx11 = external dso_local global [100 x %"class.std::__cxx11::basic_string"], align 16
@vis = external dso_local global [100 x [100 x i8]], align 16
@pos = external dso_local global %"class.std::vector", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z2ffxx(i64 noundef %0, i64 noundef %1) #0 {
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  store i64 %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !5
  %10 = load i64, ptr %3, align 8, !tbaa !5
  %11 = icmp slt i64 %10, 0
  br i1 %11, label %38, label %12

12:                                               ; preds = %2
  %13 = load i64, ptr %4, align 8, !tbaa !5
  %14 = icmp slt i64 %13, 0
  br i1 %14, label %38, label %15

15:                                               ; preds = %12
  %16 = load i64, ptr %3, align 8, !tbaa !5
  %17 = load i64, ptr @H, align 8, !tbaa !5
  %18 = icmp sge i64 %16, %17
  br i1 %18, label %38, label %19

19:                                               ; preds = %15
  %20 = load i64, ptr %4, align 8, !tbaa !5
  %21 = load i64, ptr @W, align 8, !tbaa !5
  %22 = icmp sge i64 %20, %21
  br i1 %22, label %38, label %23

23:                                               ; preds = %19
  %24 = load i64, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds [100 x [100 x i8]], ptr @vis, i64 0, i64 %24
  %26 = load i64, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds [100 x i8], ptr %25, i64 0, i64 %26
  %28 = load i8, ptr %27, align 1, !tbaa !9, !range !11, !noundef !12
  %29 = trunc i8 %28 to i1
  br i1 %29, label %38, label %30

30:                                               ; preds = %23
  %31 = load i64, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds [100 x %"class.std::__cxx11::basic_string"], ptr @_Z1BB5cxx11, i64 0, i64 %31
  %33 = load i64, ptr %4, align 8, !tbaa !5
  %34 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %32, i64 noundef %33)
  %35 = load i8, ptr %34, align 1, !tbaa !13
  %36 = sext i8 %35 to i32
  %37 = icmp eq i32 %36, 48
  br i1 %37, label %38, label %39

38:                                               ; preds = %30, %23, %19, %15, %12, %2
  br label %97

39:                                               ; preds = %30
  %40 = load i64, ptr %3, align 8, !tbaa !5
  %41 = getelementptr inbounds [100 x [100 x i8]], ptr @vis, i64 0, i64 %40
  %42 = load i64, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds [100 x i8], ptr %41, i64 0, i64 %42
  store i8 1, ptr %43, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #3
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @pos, ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  store i64 0, ptr %6, align 8, !tbaa !5
  br label %44

44:                                               ; preds = %94, %39
  %45 = load i64, ptr %6, align 8, !tbaa !5
  %46 = icmp slt i64 %45, 8
  br i1 %46, label %48, label %47

47:                                               ; preds = %44
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  br label %97

48:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %49 = load i64, ptr %3, align 8, !tbaa !5
  %50 = load i64, ptr %6, align 8, !tbaa !5
  %51 = getelementptr inbounds [8 x i64], ptr @dx, i64 0, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !5
  %53 = add nsw i64 %49, %52
  store i64 %53, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %54 = load i64, ptr %4, align 8, !tbaa !5
  %55 = load i64, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds [8 x i64], ptr @dy, i64 0, i64 %55
  %57 = load i64, ptr %56, align 8, !tbaa !5
  %58 = add nsw i64 %54, %57
  store i64 %58, ptr %9, align 8, !tbaa !5
  %59 = load i64, ptr %8, align 8, !tbaa !5
  %60 = icmp slt i64 %59, 0
  br i1 %60, label %87, label %61

61:                                               ; preds = %48
  %62 = load i64, ptr %9, align 8, !tbaa !5
  %63 = icmp slt i64 %62, 0
  br i1 %63, label %87, label %64

64:                                               ; preds = %61
  %65 = load i64, ptr %8, align 8, !tbaa !5
  %66 = load i64, ptr @H, align 8, !tbaa !5
  %67 = icmp sge i64 %65, %66
  br i1 %67, label %87, label %68

68:                                               ; preds = %64
  %69 = load i64, ptr %9, align 8, !tbaa !5
  %70 = load i64, ptr @W, align 8, !tbaa !5
  %71 = icmp sge i64 %69, %70
  br i1 %71, label %87, label %72

72:                                               ; preds = %68
  %73 = load i64, ptr %8, align 8, !tbaa !5
  %74 = getelementptr inbounds [100 x [100 x i8]], ptr @vis, i64 0, i64 %73
  %75 = load i64, ptr %9, align 8, !tbaa !5
  %76 = getelementptr inbounds [100 x i8], ptr %74, i64 0, i64 %75
  %77 = load i8, ptr %76, align 1, !tbaa !9, !range !11, !noundef !12
  %78 = trunc i8 %77 to i1
  br i1 %78, label %87, label %79

79:                                               ; preds = %72
  %80 = load i64, ptr %8, align 8, !tbaa !5
  %81 = getelementptr inbounds [100 x %"class.std::__cxx11::basic_string"], ptr @_Z1BB5cxx11, i64 0, i64 %80
  %82 = load i64, ptr %9, align 8, !tbaa !5
  %83 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %81, i64 noundef %82)
  %84 = load i8, ptr %83, align 1, !tbaa !13
  %85 = sext i8 %84 to i32
  %86 = icmp eq i32 %85, 48
  br i1 %86, label %87, label %88

87:                                               ; preds = %79, %72, %68, %64, %61, %48
  store i32 4, ptr %7, align 4
  br label %91

88:                                               ; preds = %79
  %89 = load i64, ptr %8, align 8, !tbaa !5
  %90 = load i64, ptr %9, align 8, !tbaa !5
  call void @_Z2ffxx(i64 noundef %89, i64 noundef %90)
  store i32 0, ptr %7, align 4
  br label %91

91:                                               ; preds = %88, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %92 = load i32, ptr %7, align 4
  switch i32 %92, label %98 [
    i32 0, label %93
    i32 4, label %94
  ]

93:                                               ; preds = %91
  br label %94

94:                                               ; preds = %93, %91
  %95 = load i64, ptr %6, align 8, !tbaa !5
  %96 = add nsw i64 %95, 1
  store i64 %96, ptr %6, align 8, !tbaa !5
  br label %44, !llvm.loop !14

97:                                               ; preds = %47, %38
  ret void

98:                                               ; preds = %91
  unreachable
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { 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 = { 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 long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i64, i64 }

@dx = external dso_local local_unnamed_addr global [8 x i64], align 16
@dy = external dso_local local_unnamed_addr global [8 x i64], align 16
@W = external dso_local local_unnamed_addr global i64, align 8
@H = external dso_local local_unnamed_addr global i64, align 8
@_Z1BB5cxx11 = external dso_local global [100 x %"class.std::__cxx11::basic_string"], align 16
@vis = external dso_local local_unnamed_addr global [100 x [100 x i8]], align 16
@pos = external dso_local global %"class.std::vector", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z2ffxx(i64 noundef %0, i64 noundef %1) local_unnamed_addr #0 {
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"struct.std::pair", align 8
  store i64 %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !5
  %6 = or i64 %1, %0
  %or.cond.not = icmp sgt i64 %6, -1
  %7 = load i64, ptr @H, align 8
  %.not = icmp sgt i64 %7, %0
  %or.cond = select i1 %or.cond.not, i1 %.not, i1 false
  %8 = load i64, ptr @W, align 8
  %.not21 = icmp sgt i64 %8, %1
  %or.cond24 = select i1 %or.cond, i1 %.not21, i1 false
  br i1 %or.cond24, label %9, label %.loopexit

9:                                                ; preds = %2
  %10 = getelementptr inbounds [100 x [100 x i8]], ptr @vis, i64 0, i64 %0, i64 %1
  %11 = load i8, ptr %10, align 1, !tbaa !9, !range !11, !noundef !12
  %12 = trunc nuw i8 %11 to i1
  br i1 %12, label %.loopexit, label %13

13:                                               ; preds = %9
  %14 = getelementptr inbounds [100 x %"class.std::__cxx11::basic_string"], ptr @_Z1BB5cxx11, i64 0, i64 %0
  %15 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %14, i64 noundef %1)
  %16 = load i8, ptr %15, align 1, !tbaa !13
  %17 = icmp eq i8 %16, 48
  br i1 %17, label %.loopexit, label %18

18:                                               ; preds = %13
  store i8 1, ptr %10, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #3
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @pos, ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  %19 = load i64, ptr %3, align 8, !tbaa !5
  %20 = load i64, ptr @dx, align 16, !tbaa !5
  %21 = add nsw i64 %20, %19
  %22 = load i64, ptr %4, align 8, !tbaa !5
  %23 = load i64, ptr @dy, align 16, !tbaa !5
  %24 = add nsw i64 %23, %22
  %25 = icmp sgt i64 %21, -1
  %26 = icmp sgt i64 %24, -1
  %or.cond3.not29 = select i1 %25, i1 %26, i1 false
  %27 = load i64, ptr @H, align 8
  %.not22 = icmp slt i64 %21, %27
  %or.cond25 = select i1 %or.cond3.not29, i1 %.not22, i1 false
  %28 = load i64, ptr @W, align 8
  %.not23 = icmp slt i64 %24, %28
  %or.cond26 = select i1 %or.cond25, i1 %.not23, i1 false
  br i1 %or.cond26, label %29, label %39

29:                                               ; preds = %18
  %30 = getelementptr inbounds [100 x [100 x i8]], ptr @vis, i64 0, i64 %21, i64 %24
  %31 = load i8, ptr %30, align 1, !tbaa !9, !range !11, !noundef !12
  %32 = trunc nuw i8 %31 to i1
  br i1 %32, label %39, label %33

33:                                               ; preds = %29
  %34 = getelementptr inbounds [100 x %"class.std::__cxx11::basic_string"], ptr @_Z1BB5cxx11, i64 0, i64 %21
  %35 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %34, i64 noundef %24)
  %36 = load i8, ptr %35, align 1, !tbaa !13
  %37 = icmp eq i8 %36, 48
  br i1 %37, label %39, label %38

38:                                               ; preds = %33
  call void @_Z2ffxx(i64 noundef %21, i64 noundef %24)
  br label %39

39:                                               ; preds = %18, %29, %33, %38
  %40 = load i64, ptr %3, align 8, !tbaa !5
  %41 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 8), align 8, !tbaa !5
  %42 = add nsw i64 %41, %40
  %43 = load i64, ptr %4, align 8, !tbaa !5
  %44 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 8), align 8, !tbaa !5
  %45 = add nsw i64 %44, %43
  %46 = icmp sgt i64 %42, -1
  %47 = icmp sgt i64 %45, -1
  %or.cond3.not29.1 = select i1 %46, i1 %47, i1 false
  %48 = load i64, ptr @H, align 8
  %.not22.1 = icmp slt i64 %42, %48
  %or.cond25.1 = select i1 %or.cond3.not29.1, i1 %.not22.1, i1 false
  %49 = load i64, ptr @W, align 8
  %.not23.1 = icmp slt i64 %45, %49
  %or.cond26.1 = select i1 %or.cond25.1, i1 %.not23.1, i1 false
  br i1 %or.cond26.1, label %50, label %60

50:                                               ; preds = %39
  %51 = getelementptr inbounds [100 x [100 x i8]], ptr @vis, i64 0, i64 %42, i64 %45
  %52 = load i8, ptr %51, align 1, !tbaa !9, !range !11, !noundef !12
  %53 = trunc nuw i8 %52 to i1
  br i1 %53, label %60, label %54

54:                                               ; preds = %50
  %55 = getelementptr inbounds [100 x %"class.std::__cxx11::basic_string"], ptr @_Z1BB5cxx11, i64 0, i64 %42
  %56 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %55, i64 noundef %45)
  %57 = load i8, ptr %56, align 1, !tbaa !13
  %58 = icmp eq i8 %57, 48
  br i1 %58, label %60, label %59

59:                                               ; preds = %54
  call void @_Z2ffxx(i64 noundef %42, i64 noundef %45)
  br label %60

60:                                               ; preds = %59, %54, %50, %39
  %61 = load i64, ptr %3, align 8, !tbaa !5
  %62 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 16), align 16, !tbaa !5
  %63 = add nsw i64 %62, %61
  %64 = load i64, ptr %4, align 8, !tbaa !5
  %65 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 16), align 16, !tbaa !5
  %66 = add nsw i64 %65, %64
  %67 = icmp sgt i64 %63, -1
  %68 = icmp sgt i64 %66, -1
  %or.cond3.not29.2 = select i1 %67, i1 %68, i1 false
  %69 = load i64, ptr @H, align 8
  %.not22.2 = icmp slt i64 %63, %69
  %or.cond25.2 = select i1 %or.cond3.not29.2, i1 %.not22.2, i1 false
  %70 = load i64, ptr @W, align 8
  %.not23.2 = icmp slt i64 %66, %70
  %or.cond26.2 = select i1 %or.cond25.2, i1 %.not23.2, i1 false
  br i1 %or.cond26.2, label %71, label %81

71:                                               ; preds = %60
  %72 = getelementptr inbounds [100 x [100 x i8]], ptr @vis, i64 0, i64 %63, i64 %66
  %73 = load i8, ptr %72, align 1, !tbaa !9, !range !11, !noundef !12
  %74 = trunc nuw i8 %73 to i1
  br i1 %74, label %81, label %75

75:                                               ; preds = %71
  %76 = getelementptr inbounds [100 x %"class.std::__cxx11::basic_string"], ptr @_Z1BB5cxx11, i64 0, i64 %63
  %77 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %76, i64 noundef %66)
  %78 = load i8, ptr %77, align 1, !tbaa !13
  %79 = icmp eq i8 %78, 48
  br i1 %79, label %81, label %80

80:                                               ; preds = %75
  call void @_Z2ffxx(i64 noundef %63, i64 noundef %66)
  br label %81

81:                                               ; preds = %80, %75, %71, %60
  %82 = load i64, ptr %3, align 8, !tbaa !5
  %83 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 24), align 8, !tbaa !5
  %84 = add nsw i64 %83, %82
  %85 = load i64, ptr %4, align 8, !tbaa !5
  %86 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 24), align 8, !tbaa !5
  %87 = add nsw i64 %86, %85
  %88 = icmp sgt i64 %84, -1
  %89 = icmp sgt i64 %87, -1
  %or.cond3.not29.3 = select i1 %88, i1 %89, i1 false
  %90 = load i64, ptr @H, align 8
  %.not22.3 = icmp slt i64 %84, %90
  %or.cond25.3 = select i1 %or.cond3.not29.3, i1 %.not22.3, i1 false
  %91 = load i64, ptr @W, align 8
  %.not23.3 = icmp slt i64 %87, %91
  %or.cond26.3 = select i1 %or.cond25.3, i1 %.not23.3, i1 false
  br i1 %or.cond26.3, label %92, label %102

92:                                               ; preds = %81
  %93 = getelementptr inbounds [100 x [100 x i8]], ptr @vis, i64 0, i64 %84, i64 %87
  %94 = load i8, ptr %93, align 1, !tbaa !9, !range !11, !noundef !12
  %95 = trunc nuw i8 %94 to i1
  br i1 %95, label %102, label %96

96:                                               ; preds = %92
  %97 = getelementptr inbounds [100 x %"class.std::__cxx11::basic_string"], ptr @_Z1BB5cxx11, i64 0, i64 %84
  %98 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %97, i64 noundef %87)
  %99 = load i8, ptr %98, align 1, !tbaa !13
  %100 = icmp eq i8 %99, 48
  br i1 %100, label %102, label %101

101:                                              ; preds = %96
  call void @_Z2ffxx(i64 noundef %84, i64 noundef %87)
  br label %102

102:                                              ; preds = %101, %96, %92, %81
  %103 = load i64, ptr %3, align 8, !tbaa !5
  %104 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 32), align 16, !tbaa !5
  %105 = add nsw i64 %104, %103
  %106 = load i64, ptr %4, align 8, !tbaa !5
  %107 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 32), align 16, !tbaa !5
  %108 = add nsw i64 %107, %106
  %109 = icmp sgt i64 %105, -1
  %110 = icmp sgt i64 %108, -1
  %or.cond3.not29.4 = select i1 %109, i1 %110, i1 false
  %111 = load i64, ptr @H, align 8
  %.not22.4 = icmp slt i64 %105, %111
  %or.cond25.4 = select i1 %or.cond3.not29.4, i1 %.not22.4, i1 false
  %112 = load i64, ptr @W, align 8
  %.not23.4 = icmp slt i64 %108, %112
  %or.cond26.4 = select i1 %or.cond25.4, i1 %.not23.4, i1 false
  br i1 %or.cond26.4, label %113, label %123

113:                                              ; preds = %102
  %114 = getelementptr inbounds [100 x [100 x i8]], ptr @vis, i64 0, i64 %105, i64 %108
  %115 = load i8, ptr %114, align 1, !tbaa !9, !range !11, !noundef !12
  %116 = trunc nuw i8 %115 to i1
  br i1 %116, label %123, label %117

117:                                              ; preds = %113
  %118 = getelementptr inbounds [100 x %"class.std::__cxx11::basic_string"], ptr @_Z1BB5cxx11, i64 0, i64 %105
  %119 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %118, i64 noundef %108)
  %120 = load i8, ptr %119, align 1, !tbaa !13
  %121 = icmp eq i8 %120, 48
  br i1 %121, label %123, label %122

122:                                              ; preds = %117
  call void @_Z2ffxx(i64 noundef %105, i64 noundef %108)
  br label %123

123:                                              ; preds = %122, %117, %113, %102
  %124 = load i64, ptr %3, align 8, !tbaa !5
  %125 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 40), align 8, !tbaa !5
  %126 = add nsw i64 %125, %124
  %127 = load i64, ptr %4, align 8, !tbaa !5
  %128 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 40), align 8, !tbaa !5
  %129 = add nsw i64 %128, %127
  %130 = icmp sgt i64 %126, -1
  %131 = icmp sgt i64 %129, -1
  %or.cond3.not29.5 = select i1 %130, i1 %131, i1 false
  %132 = load i64, ptr @H, align 8
  %.not22.5 = icmp slt i64 %126, %132
  %or.cond25.5 = select i1 %or.cond3.not29.5, i1 %.not22.5, i1 false
  %133 = load i64, ptr @W, align 8
  %.not23.5 = icmp slt i64 %129, %133
  %or.cond26.5 = select i1 %or.cond25.5, i1 %.not23.5, i1 false
  br i1 %or.cond26.5, label %134, label %144

134:                                              ; preds = %123
  %135 = getelementptr inbounds [100 x [100 x i8]], ptr @vis, i64 0, i64 %126, i64 %129
  %136 = load i8, ptr %135, align 1, !tbaa !9, !range !11, !noundef !12
  %137 = trunc nuw i8 %136 to i1
  br i1 %137, label %144, label %138

138:                                              ; preds = %134
  %139 = getelementptr inbounds [100 x %"class.std::__cxx11::basic_string"], ptr @_Z1BB5cxx11, i64 0, i64 %126
  %140 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %139, i64 noundef %129)
  %141 = load i8, ptr %140, align 1, !tbaa !13
  %142 = icmp eq i8 %141, 48
  br i1 %142, label %144, label %143

143:                                              ; preds = %138
  call void @_Z2ffxx(i64 noundef %126, i64 noundef %129)
  br label %144

144:                                              ; preds = %143, %138, %134, %123
  %145 = load i64, ptr %3, align 8, !tbaa !5
  %146 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 48), align 16, !tbaa !5
  %147 = add nsw i64 %146, %145
  %148 = load i64, ptr %4, align 8, !tbaa !5
  %149 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 48), align 16, !tbaa !5
  %150 = add nsw i64 %149, %148
  %151 = icmp sgt i64 %147, -1
  %152 = icmp sgt i64 %150, -1
  %or.cond3.not29.6 = select i1 %151, i1 %152, i1 false
  %153 = load i64, ptr @H, align 8
  %.not22.6 = icmp slt i64 %147, %153
  %or.cond25.6 = select i1 %or.cond3.not29.6, i1 %.not22.6, i1 false
  %154 = load i64, ptr @W, align 8
  %.not23.6 = icmp slt i64 %150, %154
  %or.cond26.6 = select i1 %or.cond25.6, i1 %.not23.6, i1 false
  br i1 %or.cond26.6, label %155, label %165

155:                                              ; preds = %144
  %156 = getelementptr inbounds [100 x [100 x i8]], ptr @vis, i64 0, i64 %147, i64 %150
  %157 = load i8, ptr %156, align 1, !tbaa !9, !range !11, !noundef !12
  %158 = trunc nuw i8 %157 to i1
  br i1 %158, label %165, label %159

159:                                              ; preds = %155
  %160 = getelementptr inbounds [100 x %"class.std::__cxx11::basic_string"], ptr @_Z1BB5cxx11, i64 0, i64 %147
  %161 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %160, i64 noundef %150)
  %162 = load i8, ptr %161, align 1, !tbaa !13
  %163 = icmp eq i8 %162, 48
  br i1 %163, label %165, label %164

164:                                              ; preds = %159
  call void @_Z2ffxx(i64 noundef %147, i64 noundef %150)
  br label %165

165:                                              ; preds = %164, %159, %155, %144
  %166 = load i64, ptr %3, align 8, !tbaa !5
  %167 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 56), align 8, !tbaa !5
  %168 = add nsw i64 %167, %166
  %169 = load i64, ptr %4, align 8, !tbaa !5
  %170 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 56), align 8, !tbaa !5
  %171 = add nsw i64 %170, %169
  %172 = icmp sgt i64 %168, -1
  %173 = icmp sgt i64 %171, -1
  %or.cond3.not29.7 = select i1 %172, i1 %173, i1 false
  %174 = load i64, ptr @H, align 8
  %.not22.7 = icmp slt i64 %168, %174
  %or.cond25.7 = select i1 %or.cond3.not29.7, i1 %.not22.7, i1 false
  %175 = load i64, ptr @W, align 8
  %.not23.7 = icmp slt i64 %171, %175
  %or.cond26.7 = select i1 %or.cond25.7, i1 %.not23.7, i1 false
  br i1 %or.cond26.7, label %176, label %.loopexit

176:                                              ; preds = %165
  %177 = getelementptr inbounds [100 x [100 x i8]], ptr @vis, i64 0, i64 %168, i64 %171
  %178 = load i8, ptr %177, align 1, !tbaa !9, !range !11, !noundef !12
  %179 = trunc nuw i8 %178 to i1
  br i1 %179, label %.loopexit, label %180

180:                                              ; preds = %176
  %181 = getelementptr inbounds [100 x %"class.std::__cxx11::basic_string"], ptr @_Z1BB5cxx11, i64 0, i64 %168
  %182 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %181, i64 noundef %171)
  %183 = load i8, ptr %182, align 1, !tbaa !13
  %184 = icmp eq i8 %183, 48
  br i1 %184, label %.loopexit, label %185

185:                                              ; preds = %180
  call void @_Z2ffxx(i64 noundef %168, i64 noundef %171)
  br label %.loopexit

.loopexit:                                        ; preds = %165, %176, %180, %185, %2, %9, %13
  ret void
}

; Function Attrs: mustprogress nounwind 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 #1 align 2

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

; 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 nounwind uwtable
declare dso_local void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { 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 = { 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 long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!7, !7, i64 0}


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