; LLVM IR from andreimaximov/algorithms :: codeforces/new-year-and-fireworks (main)

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

%"struct.std::_Bit_reference" = type { ptr, i64 }

@_ZL4DIRS = external hidden constant [8 x [2 x i32]], align 16

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

30:                                               ; preds = %7
  %31 = load ptr, ptr %14, align 8, !tbaa !9
  %32 = load i64, ptr %11, align 8, !tbaa !5
  %33 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IS_IS_IbSaIbEESaIS1_EESaIS3_EESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %31, i64 noundef %32) #3
  %34 = load i64, ptr %12, align 8, !tbaa !5
  %35 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IS_IbSaIbEESaIS1_EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %34) #3
  %36 = load i64, ptr %9, align 8, !tbaa !5
  %37 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef %36) #3
  %38 = load i64, ptr %13, align 8, !tbaa !5
  %39 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %37, i64 noundef %38)
  %40 = getelementptr inbounds { ptr, i64 }, ptr %16, i32 0, i32 0
  %41 = extractvalue { ptr, i64 } %39, 0
  store ptr %41, ptr %40, align 8
  %42 = getelementptr inbounds { ptr, i64 }, ptr %16, i32 0, i32 1
  %43 = extractvalue { ptr, i64 } %39, 1
  store i64 %43, ptr %42, align 8
  %44 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %16) #3
  br label %45

45:                                               ; preds = %30, %7
  %46 = phi i1 [ true, %7 ], [ %44, %30 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #3
  br i1 %46, label %47, label %48

47:                                               ; preds = %45
  store i32 0, ptr %8, align 4
  br label %189

48:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #3
  %49 = load ptr, ptr %15, align 8, !tbaa !9
  %50 = load i64, ptr %11, align 8, !tbaa !5
  %51 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %49, i64 noundef %50) #3
  %52 = load i64, ptr %12, align 8, !tbaa !5
  %53 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %51, i64 noundef %52)
  %54 = getelementptr inbounds { ptr, i64 }, ptr %18, i32 0, i32 0
  %55 = extractvalue { ptr, i64 } %53, 0
  store ptr %55, ptr %54, align 8
  %56 = getelementptr inbounds { ptr, i64 }, ptr %18, i32 0, i32 1
  %57 = extractvalue { ptr, i64 } %53, 1
  store i64 %57, ptr %56, align 8
  %58 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %18) #3
  %59 = xor i1 %58, true
  %60 = zext i1 %59 to i64
  %61 = select i1 %59, i32 1, i32 0
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #3
  store i32 %61, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #3
  %62 = load ptr, ptr %14, align 8, !tbaa !9
  %63 = load i64, ptr %11, align 8, !tbaa !5
  %64 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IS_IS_IbSaIbEESaIS1_EESaIS3_EESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %62, i64 noundef %63) #3
  %65 = load i64, ptr %12, align 8, !tbaa !5
  %66 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IS_IbSaIbEESaIS1_EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %64, i64 noundef %65) #3
  %67 = load i64, ptr %9, align 8, !tbaa !5
  %68 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %67) #3
  %69 = load i64, ptr %13, align 8, !tbaa !5
  %70 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %68, i64 noundef %69)
  %71 = getelementptr inbounds { ptr, i64 }, ptr %19, i32 0, i32 0
  %72 = extractvalue { ptr, i64 } %70, 0
  store ptr %72, ptr %71, align 8
  %73 = getelementptr inbounds { ptr, i64 }, ptr %19, i32 0, i32 1
  %74 = extractvalue { ptr, i64 } %70, 1
  store i64 %74, ptr %73, align 8
  %75 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %19, i1 noundef zeroext true) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #3
  %76 = load ptr, ptr %15, align 8, !tbaa !9
  %77 = load i64, ptr %11, align 8, !tbaa !5
  %78 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %76, i64 noundef %77) #3
  %79 = load i64, ptr %12, align 8, !tbaa !5
  %80 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %78, i64 noundef %79)
  %81 = getelementptr inbounds { ptr, i64 }, ptr %20, i32 0, i32 0
  %82 = extractvalue { ptr, i64 } %80, 0
  store ptr %82, ptr %81, align 8
  %83 = getelementptr inbounds { ptr, i64 }, ptr %20, i32 0, i32 1
  %84 = extractvalue { ptr, i64 } %80, 1
  store i64 %84, ptr %83, align 8
  %85 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %20, i1 noundef zeroext true) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  %86 = load ptr, ptr %10, align 8, !tbaa !9
  %87 = load i64, ptr %9, align 8, !tbaa !5
  %88 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %86, i64 noundef %87) #3
  %89 = load i32, ptr %88, align 4, !tbaa !11
  store i32 %89, ptr %21, align 4, !tbaa !11
  br label %90

90:                                               ; preds = %93, %48
  %91 = load i32, ptr %21, align 4, !tbaa !11
  %92 = icmp sgt i32 %91, 1
  br i1 %92, label %93, label %135

93:                                               ; preds = %90
  %94 = load i64, ptr %13, align 8, !tbaa !5
  %95 = getelementptr inbounds [8 x [2 x i32]], ptr @_ZL4DIRS, i64 0, i64 %94
  %96 = getelementptr inbounds [2 x i32], ptr %95, i64 0, i64 0
  %97 = load i32, ptr %96, align 8, !tbaa !11
  %98 = sext i32 %97 to i64
  %99 = load i64, ptr %11, align 8, !tbaa !5
  %100 = add i64 %99, %98
  store i64 %100, ptr %11, align 8, !tbaa !5
  %101 = load i64, ptr %13, align 8, !tbaa !5
  %102 = getelementptr inbounds [8 x [2 x i32]], ptr @_ZL4DIRS, i64 0, i64 %101
  %103 = getelementptr inbounds [2 x i32], ptr %102, i64 0, i64 1
  %104 = load i32, ptr %103, align 4, !tbaa !11
  %105 = sext i32 %104 to i64
  %106 = load i64, ptr %12, align 8, !tbaa !5
  %107 = add i64 %106, %105
  store i64 %107, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #3
  %108 = load ptr, ptr %15, align 8, !tbaa !9
  %109 = load i64, ptr %11, align 8, !tbaa !5
  %110 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %108, i64 noundef %109) #3
  %111 = load i64, ptr %12, align 8, !tbaa !5
  %112 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %110, i64 noundef %111)
  %113 = getelementptr inbounds { ptr, i64 }, ptr %22, i32 0, i32 0
  %114 = extractvalue { ptr, i64 } %112, 0
  store ptr %114, ptr %113, align 8
  %115 = getelementptr inbounds { ptr, i64 }, ptr %22, i32 0, i32 1
  %116 = extractvalue { ptr, i64 } %112, 1
  store i64 %116, ptr %115, align 8
  %117 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %22) #3
  %118 = xor i1 %117, true
  %119 = zext i1 %118 to i64
  %120 = select i1 %118, i32 1, i32 0
  %121 = load i32, ptr %17, align 4, !tbaa !11
  %122 = add nsw i32 %121, %120
  store i32 %122, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #3
  %123 = load ptr, ptr %15, align 8, !tbaa !9
  %124 = load i64, ptr %11, align 8, !tbaa !5
  %125 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %123, i64 noundef %124) #3
  %126 = load i64, ptr %12, align 8, !tbaa !5
  %127 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %125, i64 noundef %126)
  %128 = getelementptr inbounds { ptr, i64 }, ptr %23, i32 0, i32 0
  %129 = extractvalue { ptr, i64 } %127, 0
  store ptr %129, ptr %128, align 8
  %130 = getelementptr inbounds { ptr, i64 }, ptr %23, i32 0, i32 1
  %131 = extractvalue { ptr, i64 } %127, 1
  store i64 %131, ptr %130, align 8
  %132 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %23, i1 noundef zeroext true) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #3
  %133 = load i32, ptr %21, align 4, !tbaa !11
  %134 = add nsw i32 %133, -1
  store i32 %134, ptr %21, align 4, !tbaa !11
  br label %90, !llvm.loop !13

135:                                              ; preds = %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  %136 = load i64, ptr %13, align 8, !tbaa !5
  %137 = sub i64 %136, 1
  %138 = urem i64 %137, 8
  store i64 %138, ptr %24, align 8, !tbaa !5
  %139 = load i64, ptr %9, align 8, !tbaa !5
  %140 = add i64 %139, 1
  %141 = load ptr, ptr %10, align 8, !tbaa !9
  %142 = load i64, ptr %11, align 8, !tbaa !5
  %143 = load i64, ptr %24, align 8, !tbaa !5
  %144 = getelementptr inbounds [8 x [2 x i32]], ptr @_ZL4DIRS, i64 0, i64 %143
  %145 = getelementptr inbounds [2 x i32], ptr %144, i64 0, i64 0
  %146 = load i32, ptr %145, align 8, !tbaa !11
  %147 = sext i32 %146 to i64
  %148 = add i64 %142, %147
  %149 = load i64, ptr %12, align 8, !tbaa !5
  %150 = load i64, ptr %24, align 8, !tbaa !5
  %151 = getelementptr inbounds [8 x [2 x i32]], ptr @_ZL4DIRS, i64 0, i64 %150
  %152 = getelementptr inbounds [2 x i32], ptr %151, i64 0, i64 1
  %153 = load i32, ptr %152, align 4, !tbaa !11
  %154 = sext i32 %153 to i64
  %155 = add i64 %149, %154
  %156 = load i64, ptr %24, align 8, !tbaa !5
  %157 = load ptr, ptr %14, align 8, !tbaa !9
  %158 = load ptr, ptr %15, align 8, !tbaa !9
  %159 = call noundef i32 @_Z3dfsmRKSt6vectorIiSaIiEEmmmRS_IS_IS_IS_IbSaIbEESaIS5_EESaIS7_EESaIS9_EERS7_(i64 noundef %140, ptr noundef nonnull align 8 dereferenceable(24) %141, i64 noundef %148, i64 noundef %155, i64 noundef %156, ptr noundef nonnull align 8 dereferenceable(24) %157, ptr noundef nonnull align 8 dereferenceable(24) %158)
  %160 = load i32, ptr %17, align 4, !tbaa !11
  %161 = add nsw i32 %160, %159
  store i32 %161, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #3
  %162 = load i64, ptr %13, align 8, !tbaa !5
  %163 = add i64 %162, 1
  %164 = urem i64 %163, 8
  store i64 %164, ptr %25, align 8, !tbaa !5
  %165 = load i64, ptr %9, align 8, !tbaa !5
  %166 = add i64 %165, 1
  %167 = load ptr, ptr %10, align 8, !tbaa !9
  %168 = load i64, ptr %11, align 8, !tbaa !5
  %169 = load i64, ptr %25, align 8, !tbaa !5
  %170 = getelementptr inbounds [8 x [2 x i32]], ptr @_ZL4DIRS, i64 0, i64 %169
  %171 = getelementptr inbounds [2 x i32], ptr %170, i64 0, i64 0
  %172 = load i32, ptr %171, align 8, !tbaa !11
  %173 = sext i32 %172 to i64
  %174 = add i64 %168, %173
  %175 = load i64, ptr %12, align 8, !tbaa !5
  %176 = load i64, ptr %25, align 8, !tbaa !5
  %177 = getelementptr inbounds [8 x [2 x i32]], ptr @_ZL4DIRS, i64 0, i64 %176
  %178 = getelementptr inbounds [2 x i32], ptr %177, i64 0, i64 1
  %179 = load i32, ptr %178, align 4, !tbaa !11
  %180 = sext i32 %179 to i64
  %181 = add i64 %175, %180
  %182 = load i64, ptr %25, align 8, !tbaa !5
  %183 = load ptr, ptr %14, align 8, !tbaa !9
  %184 = load ptr, ptr %15, align 8, !tbaa !9
  %185 = call noundef i32 @_Z3dfsmRKSt6vectorIiSaIiEEmmmRS_IS_IS_IS_IbSaIbEESaIS5_EESaIS7_EESaIS9_EERS7_(i64 noundef %166, ptr noundef nonnull align 8 dereferenceable(24) %167, i64 noundef %174, i64 noundef %181, i64 noundef %182, ptr noundef nonnull align 8 dereferenceable(24) %183, ptr noundef nonnull align 8 dereferenceable(24) %184)
  %186 = load i32, ptr %17, align 4, !tbaa !11
  %187 = add nsw i32 %186, %185
  store i32 %187, ptr %17, align 4, !tbaa !11
  %188 = load i32, ptr %17, align 4, !tbaa !11
  store i32 %188, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  br label %189

189:                                              ; preds = %135, %47
  %190 = load i32, ptr %8, align 4
  ret i32 %190
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 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 noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IS_IS_IbSaIbEESaIS1_EESaIS3_EESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IS_IbSaIbEESaIS1_EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 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) #1 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)) #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 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 = { 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", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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"

%"struct.std::_Bit_reference" = type { ptr, i64 }

@_ZL4DIRS = external hidden local_unnamed_addr constant [8 x [2 x i32]], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z3dfsmRKSt6vectorIiSaIiEEmmmRS_IS_IS_IS_IbSaIbEESaIS5_EESaIS7_EESaIS9_EERS7_(i64 noundef %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %2, i64 noundef %3, i64 noundef %4, ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %6) local_unnamed_addr #0 {
  %8 = alloca %"struct.std::_Bit_reference", align 8
  %9 = alloca %"struct.std::_Bit_reference", align 8
  %10 = alloca %"struct.std::_Bit_reference", align 8
  %11 = alloca %"struct.std::_Bit_reference", align 8
  %12 = alloca %"struct.std::_Bit_reference", align 8
  %13 = alloca %"struct.std::_Bit_reference", align 8
  %14 = tail call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #3
  %15 = icmp eq i64 %14, %0
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #3
  br i1 %15, label %.critedge, label %16

16:                                               ; preds = %7
  %17 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IS_IS_IbSaIbEESaIS1_EESaIS3_EESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %2) #3
  %18 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IS_IbSaIbEESaIS1_EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %3) #3
  %19 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %0) #3
  %20 = tail call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %19, i64 noundef %4)
  %21 = extractvalue { ptr, i64 } %20, 0
  store ptr %21, ptr %8, align 8
  %22 = getelementptr inbounds i8, ptr %8, i64 8
  %23 = extractvalue { ptr, i64 } %20, 1
  store i64 %23, ptr %22, align 8
  %24 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %8) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #3
  br i1 %24, label %102, label %25

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

25:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #3
  %26 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %2) #3
  %27 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %26, i64 noundef %3)
  %28 = extractvalue { ptr, i64 } %27, 0
  store ptr %28, ptr %9, align 8
  %29 = getelementptr inbounds i8, ptr %9, i64 8
  %30 = extractvalue { ptr, i64 } %27, 1
  store i64 %30, ptr %29, align 8
  %31 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %9) #3
  %32 = xor i1 %31, true
  %33 = zext i1 %32 to i32
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #3
  %34 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IS_IS_IbSaIbEESaIS1_EESaIS3_EESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %2) #3
  %35 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IS_IbSaIbEESaIS1_EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef %3) #3
  %36 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef %0) #3
  %37 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %36, i64 noundef %4)
  %38 = extractvalue { ptr, i64 } %37, 0
  store ptr %38, ptr %10, align 8
  %39 = getelementptr inbounds i8, ptr %10, i64 8
  %40 = extractvalue { ptr, i64 } %37, 1
  store i64 %40, ptr %39, align 8
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %10, i1 noundef zeroext true) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #3
  %42 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %2) #3
  %43 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %42, i64 noundef %3)
  %44 = extractvalue { ptr, i64 } %43, 0
  store ptr %44, ptr %11, align 8
  %45 = getelementptr inbounds i8, ptr %11, i64 8
  %46 = extractvalue { ptr, i64 } %43, 1
  store i64 %46, ptr %45, align 8
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %11, i1 noundef zeroext true) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #3
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %0) #3
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = icmp sgt i32 %49, 1
  br i1 %50, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %25
  %51 = getelementptr inbounds [8 x [2 x i32]], ptr @_ZL4DIRS, i64 0, i64 %4
  %52 = load i32, ptr %51, align 8, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds i8, ptr %51, i64 4
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds i8, ptr %12, i64 8
  %58 = getelementptr inbounds i8, ptr %13, i64 8
  br label %59

59:                                               ; preds = %.lr.ph, %59
  %.05664 = phi i64 [ %2, %.lr.ph ], [ %60, %59 ]
  %.05763 = phi i32 [ %49, %.lr.ph ], [ %75, %59 ]
  %.05862 = phi i32 [ %33, %.lr.ph ], [ %69, %59 ]
  %.05961 = phi i64 [ %3, %.lr.ph ], [ %61, %59 ]
  %60 = add i64 %.05664, %53
  %61 = add i64 %.05961, %56
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #3
  %62 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %60) #3
  %63 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %62, i64 noundef %61)
  %64 = extractvalue { ptr, i64 } %63, 0
  store ptr %64, ptr %12, align 8
  %65 = extractvalue { ptr, i64 } %63, 1
  store i64 %65, ptr %57, align 8
  %66 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %12) #3
  %67 = xor i1 %66, true
  %68 = zext i1 %67 to i32
  %69 = add nuw nsw i32 %.05862, %68
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #3
  %70 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %60) #3
  %71 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %70, i64 noundef %61)
  %72 = extractvalue { ptr, i64 } %71, 0
  store ptr %72, ptr %13, align 8
  %73 = extractvalue { ptr, i64 } %71, 1
  store i64 %73, ptr %58, align 8
  %74 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %13, i1 noundef zeroext true) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #3
  %75 = add nsw i32 %.05763, -1
  %76 = icmp ugt i32 %.05763, 2
  br i1 %76, label %59, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %59, %25
  %.059.lcssa = phi i64 [ %3, %25 ], [ %61, %59 ]
  %.058.lcssa = phi i32 [ %33, %25 ], [ %69, %59 ]
  %.056.lcssa = phi i64 [ %2, %25 ], [ %60, %59 ]
  %77 = add i64 %4, 7
  %78 = and i64 %77, 7
  %79 = add i64 %0, 1
  %80 = getelementptr inbounds [8 x [2 x i32]], ptr @_ZL4DIRS, i64 0, i64 %78
  %81 = load i32, ptr %80, align 8, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = add i64 %.056.lcssa, %82
  %84 = getelementptr inbounds i8, ptr %80, i64 4
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = add i64 %.059.lcssa, %86
  %88 = call noundef i32 @_Z3dfsmRKSt6vectorIiSaIiEEmmmRS_IS_IS_IS_IbSaIbEESaIS5_EESaIS7_EESaIS9_EERS7_(i64 noundef %79, ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %83, i64 noundef %87, i64 noundef %78, ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %6)
  %89 = add nsw i32 %88, %.058.lcssa
  %90 = add i64 %4, 1
  %91 = and i64 %90, 7
  %92 = getelementptr inbounds [8 x [2 x i32]], ptr @_ZL4DIRS, i64 0, i64 %91
  %93 = load i32, ptr %92, align 8, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = add i64 %.056.lcssa, %94
  %96 = getelementptr inbounds i8, ptr %92, i64 4
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = add i64 %.059.lcssa, %98
  %100 = call noundef i32 @_Z3dfsmRKSt6vectorIiSaIiEEmmmRS_IS_IS_IS_IbSaIbEESaIS5_EESaIS7_EESaIS9_EERS7_(i64 noundef %79, ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %95, i64 noundef %99, i64 noundef %91, ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %6)
  %101 = add nsw i32 %89, %100
  br label %102

102:                                              ; preds = %16, %.critedge, %._crit_edge
  %.0 = phi i32 [ %101, %._crit_edge ], [ 0, %.critedge ], [ 0, %16 ]
  ret i32 %.0
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 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 noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IS_IS_IbSaIbEESaIS1_EESaIS3_EESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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