; LLVM IR from ShahjalalShohag/code-library :: Dynamic Programming Optimizations/XOR Equation.ll (Z5solveSt6vectorIxSaIxEExi)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@k = external dso_local global i32, align 4
@Z = external dso_local global i32, align 4
@dp = external dso_local global [55 x [2 x [2 x i32]]], align 16
@A = external dso_local global %"class.std::vector", align 8

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z2yoiii(i32 noundef, i32 noundef, i32 noundef) #1

; 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(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 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 uwtable
define dso_local noundef i32 @_Z5solveSt6vectorIxSaIxEExi(ptr noundef %0, i64 noundef %1, i32 noundef %2) #1 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca %"class.std::vector", align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %21 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  %22 = trunc i64 %21 to i32
  store i32 %22, ptr %8, align 4, !tbaa !11
  %23 = load i32, ptr %7, align 4, !tbaa !11
  store i32 %23, ptr @k, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #4
  store i8 1, ptr %9, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %24

24:                                               ; preds = %42, %3
  %25 = load i32, ptr %10, align 4, !tbaa !11
  %26 = load i32, ptr %8, align 4, !tbaa !11
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %45

29:                                               ; preds = %24
  %30 = load i32, ptr %10, align 4, !tbaa !11
  %31 = sext i32 %30 to i64
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %31) #4
  %33 = load i64, ptr %32, align 8, !tbaa !9
  %34 = icmp eq i64 %33, 0
  %35 = zext i1 %34 to i32
  %36 = load i8, ptr %9, align 1, !tbaa !13, !range !15, !noundef !16
  %37 = trunc i8 %36 to i1
  %38 = zext i1 %37 to i32
  %39 = and i32 %38, %35
  %40 = icmp ne i32 %39, 0
  %41 = zext i1 %40 to i8
  store i8 %41, ptr %9, align 1, !tbaa !13
  br label %42

42:                                               ; preds = %29
  %43 = load i32, ptr %10, align 4, !tbaa !11
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %10, align 4, !tbaa !11
  br label %24, !llvm.loop !17

45:                                               ; preds = %28
  %46 = load i8, ptr %9, align 1, !tbaa !13, !range !15, !noundef !16
  %47 = trunc i8 %46 to i1
  br i1 %47, label %48, label %52

48:                                               ; preds = %45
  %49 = load i64, ptr %6, align 8, !tbaa !9
  %50 = icmp eq i64 %49, 0
  %51 = zext i1 %50 to i32
  store i32 %51, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %147

52:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %53

53:                                               ; preds = %72, %52
  %54 = load i32, ptr %13, align 4, !tbaa !11
  %55 = load i32, ptr %8, align 4, !tbaa !11
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %53
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %75

58:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %59 = load i32, ptr %13, align 4, !tbaa !11
  %60 = sext i32 %59 to i64
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %60) #4
  %62 = load i64, ptr %61, align 8, !tbaa !9
  store i64 %62, ptr %14, align 8, !tbaa !9
  %63 = load i64, ptr %14, align 8, !tbaa !9
  %64 = load i32, ptr @k, align 4, !tbaa !11
  %65 = zext i32 %64 to i64
  %66 = ashr i64 %63, %65
  %67 = and i64 %66, 1
  %68 = load i32, ptr %12, align 4, !tbaa !11
  %69 = sext i32 %68 to i64
  %70 = add nsw i64 %69, %67
  %71 = trunc i64 %70 to i32
  store i32 %71, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %72

72:                                               ; preds = %58
  %73 = load i32, ptr %13, align 4, !tbaa !11
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %13, align 4, !tbaa !11
  br label %53, !llvm.loop !19

75:                                               ; preds = %57
  call void @llvm.memset.p0.i64(ptr align 16 @dp, i8 -1, i64 880, i1 false)
  %76 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIxSaIxEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24) @A, ptr noundef nonnull align 8 dereferenceable(24) %0)
  %77 = load i64, ptr %6, align 8, !tbaa !9
  %78 = load i32, ptr @k, align 4, !tbaa !11
  %79 = zext i32 %78 to i64
  %80 = ashr i64 %77, %79
  %81 = and i64 %80, 1
  %82 = trunc i64 %81 to i32
  store i32 %82, ptr @Z, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %83 = load i32, ptr %8, align 4, !tbaa !11
  %84 = sub nsw i32 %83, 1
  %85 = call noundef i32 @_Z2yoiii(i32 noundef %84, i32 noundef 0, i32 noundef 0)
  store i32 %85, ptr %15, align 4, !tbaa !11
  %86 = load i32, ptr %12, align 4, !tbaa !11
  %87 = srem i32 %86, 2
  %88 = load i32, ptr @Z, align 4, !tbaa !11
  %89 = icmp eq i32 %87, %88
  br i1 %89, label %90, label %145

90:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !11
  br label %91

91:                                               ; preds = %115, %90
  %92 = load i32, ptr %16, align 4, !tbaa !11
  %93 = load i32, ptr %8, align 4, !tbaa !11
  %94 = icmp slt i32 %92, %93
  br i1 %94, label %96, label %95

95:                                               ; preds = %91
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %118

96:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %97 = load i32, ptr %16, align 4, !tbaa !11
  %98 = sext i32 %97 to i64
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %98) #4
  store ptr %99, ptr %17, align 8, !tbaa !5
  %100 = load ptr, ptr %17, align 8, !tbaa !5
  %101 = load i64, ptr %100, align 8, !tbaa !9
  %102 = load i32, ptr @k, align 4, !tbaa !11
  %103 = zext i32 %102 to i64
  %104 = ashr i64 %101, %103
  %105 = and i64 %104, 1
  %106 = icmp ne i64 %105, 0
  br i1 %106, label %107, label %114

107:                                              ; preds = %96
  %108 = load i32, ptr @k, align 4, !tbaa !11
  %109 = shl i32 1, %108
  %110 = sext i32 %109 to i64
  %111 = load ptr, ptr %17, align 8, !tbaa !5
  %112 = load i64, ptr %111, align 8, !tbaa !9
  %113 = xor i64 %112, %110
  store i64 %113, ptr %111, align 8, !tbaa !9
  br label %114

114:                                              ; preds = %107, %96
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  br label %115

115:                                              ; preds = %114
  %116 = load i32, ptr %16, align 4, !tbaa !11
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %16, align 4, !tbaa !11
  br label %91, !llvm.loop !20

118:                                              ; preds = %95
  %119 = load i64, ptr %6, align 8, !tbaa !9
  %120 = load i32, ptr @k, align 4, !tbaa !11
  %121 = zext i32 %120 to i64
  %122 = ashr i64 %119, %121
  %123 = and i64 %122, 1
  %124 = icmp ne i64 %123, 0
  br i1 %124, label %125, label %131

125:                                              ; preds = %118
  %126 = load i32, ptr @k, align 4, !tbaa !11
  %127 = shl i32 1, %126
  %128 = sext i32 %127 to i64
  %129 = load i64, ptr %6, align 8, !tbaa !9
  %130 = xor i64 %129, %128
  store i64 %130, ptr %6, align 8, !tbaa !9
  br label %131

131:                                              ; preds = %125, %118
  call void @_ZNSt6vectorIxSaIxEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(24) %0)
  %132 = load i64, ptr %6, align 8, !tbaa !9
  %133 = load i32, ptr @k, align 4, !tbaa !11
  %134 = sub nsw i32 %133, 1
  %135 = invoke noundef i32 @_Z5solveSt6vectorIxSaIxEExi(ptr noundef %18, i64 noundef %132, i32 noundef %134)
          to label %136 unwind label %141

136:                                              ; preds = %131
  %137 = load i32, ptr %15, align 4, !tbaa !11
  %138 = add nsw i32 %137, %135
  store i32 %138, ptr %15, align 4, !tbaa !11
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #4
  %139 = load i32, ptr %15, align 4, !tbaa !11
  %140 = srem i32 %139, 1000000003
  store i32 %140, ptr %15, align 4, !tbaa !11
  br label %145

141:                                              ; preds = %131
  %142 = landingpad { ptr, i32 }
          cleanup
  %143 = extractvalue { ptr, i32 } %142, 0
  store ptr %143, ptr %19, align 8
  %144 = extractvalue { ptr, i32 } %142, 1
  store i32 %144, ptr %20, align 4
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %149

145:                                              ; preds = %136, %75
  %146 = load i32, ptr %15, align 4, !tbaa !11
  store i32 %146, ptr %4, align 4
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %147

147:                                              ; preds = %145, %48
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %148 = load i32, ptr %4, align 4
  ret i32 %148

149:                                              ; preds = %141
  %150 = load ptr, ptr %19, align 8
  %151 = load i32, ptr %20, align 4
  %152 = insertvalue { ptr, i32 } poison, ptr %150, 0
  %153 = insertvalue { ptr, i32 } %152, i32 %151, 1
  resume { ptr, i32 } %153
}

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

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

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

declare i32 @__gxx_personality_v0(...)

attributes #0 = { 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 #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@k = external dso_local local_unnamed_addr global i32, align 4
@Z = external dso_local local_unnamed_addr global i32, align 4
@dp = external dso_local local_unnamed_addr global [55 x [2 x [2 x i32]]], align 16
@A = external dso_local global %"class.std::vector", align 8

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z5solveSt6vectorIxSaIxEExi(ptr noundef nonnull %0, i64 noundef %1, i32 noundef %2) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::vector", align 8
  %5 = tail call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  %6 = trunc i64 %5 to i32
  store i32 %2, ptr @k, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph.preheader, label %.critedge

.lr.ph.preheader:                                 ; preds = %3
  %wide.trip.count = and i64 %5, 2147483647
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph
  br i1 %11, label %.critedge, label %.lr.ph45

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %.03242 = phi i1 [ true, %.lr.ph.preheader ], [ %11, %.lr.ph ]
  %8 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #4
  %9 = load i64, ptr %8, align 8, !tbaa !9
  %10 = icmp eq i64 %9, 0
  %11 = and i1 %.03242, %10
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

.critedge:                                        ; preds = %3, %._crit_edge
  %12 = icmp eq i64 %1, 0
  %13 = zext i1 %12 to i32
  br label %56

._crit_edge46:                                    ; preds = %.lr.ph45
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(880) @dp, i8 -1, i64 880, i1 false)
  %14 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIxSaIxEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24) @A, ptr noundef nonnull align 8 dereferenceable(24) %0)
  %15 = load i32, ptr @k, align 4, !tbaa !5
  %16 = zext nneg i32 %15 to i64
  %17 = lshr i64 %1, %16
  %18 = trunc i64 %17 to i32
  %19 = and i32 %18, 1
  store i32 %19, ptr @Z, align 4, !tbaa !5
  %20 = add nsw i32 %6, -1
  %21 = tail call noundef i32 @_Z2yoiii(i32 noundef %20, i32 noundef 0, i32 noundef 0)
  %22 = srem i32 %32, 2
  %23 = load i32, ptr @Z, align 4, !tbaa !5
  %24 = icmp eq i32 %22, %23
  br i1 %24, label %.lr.ph49.preheader, label %56

.lr.ph49.preheader:                               ; preds = %._crit_edge46
  %smax = tail call i32 @llvm.smax.i32(i32 %6, i32 1)
  %wide.trip.count60 = zext nneg i32 %smax to i64
  br label %.lr.ph49

.lr.ph45:                                         ; preds = %._crit_edge, %.lr.ph45
  %indvars.iv52 = phi i64 [ %indvars.iv.next53, %.lr.ph45 ], [ 0, %._crit_edge ]
  %.03743 = phi i32 [ %32, %.lr.ph45 ], [ 0, %._crit_edge ]
  %25 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv52) #4
  %26 = load i64, ptr %25, align 8, !tbaa !9
  %27 = load i32, ptr @k, align 4, !tbaa !5
  %28 = zext nneg i32 %27 to i64
  %29 = lshr i64 %26, %28
  %30 = trunc i64 %29 to i32
  %31 = and i32 %30, 1
  %32 = add i32 %31, %.03743
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
  %exitcond56.not = icmp eq i64 %indvars.iv.next53, %wide.trip.count
  br i1 %exitcond56.not, label %._crit_edge46, label %.lr.ph45, !llvm.loop !13

._crit_edge50:                                    ; preds = %50
  %33 = and i64 %44, %1
  %.not = icmp eq i64 %33, 0
  %34 = shl nuw i32 1, %42
  %35 = sext i32 %34 to i64
  %36 = select i1 %.not, i64 0, i64 %35
  %.031 = xor i64 %36, %1
  call void @_ZNSt6vectorIxSaIxEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %0)
  %37 = load i32, ptr @k, align 4, !tbaa !5
  %38 = add nsw i32 %37, -1
  %39 = invoke noundef i32 @_Z5solveSt6vectorIxSaIxEExi(ptr noundef nonnull %4, i64 noundef %.031, i32 noundef %38)
          to label %51 unwind label %54

.lr.ph49:                                         ; preds = %.lr.ph49.preheader, %50
  %indvars.iv57 = phi i64 [ 0, %.lr.ph49.preheader ], [ %indvars.iv.next58, %50 ]
  %40 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv57) #4
  %41 = load i64, ptr %40, align 8, !tbaa !9
  %42 = load i32, ptr @k, align 4, !tbaa !5
  %43 = zext nneg i32 %42 to i64
  %44 = shl nuw i64 1, %43
  %45 = and i64 %44, %41
  %.not39 = icmp eq i64 %45, 0
  br i1 %.not39, label %50, label %46

46:                                               ; preds = %.lr.ph49
  %47 = shl nuw i32 1, %42
  %48 = sext i32 %47 to i64
  %49 = xor i64 %41, %48
  store i64 %49, ptr %40, align 8, !tbaa !9
  br label %50

50:                                               ; preds = %46, %.lr.ph49
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %exitcond61.not = icmp eq i64 %indvars.iv.next58, %wide.trip.count60
  br i1 %exitcond61.not, label %._crit_edge50, label %.lr.ph49, !llvm.loop !14

51:                                               ; preds = %._crit_edge50
  %52 = add nsw i32 %39, %21
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  %53 = srem i32 %52, 1000000003
  br label %56

54:                                               ; preds = %._crit_edge50
  %55 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  resume { ptr, i32 } %55

56:                                               ; preds = %._crit_edge46, %51, %.critedge
  %.0 = phi i32 [ %13, %.critedge ], [ %53, %51 ], [ %21, %._crit_edge46 ]
  ret i32 %.0
}

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass