; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/305 Division 2/Problem E/E.ll (Z6updateii)

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

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

@cnt = external dso_local global [500500 x i32], align 16
@lp = external dso_local global [500500 x i32], align 16
@val = external dso_local global [64 x i32], align 16
@bitcount = external dso_local global [64 x i32], align 16
@lsb = external dso_local global [64 x i32], align 16
@ans = external dso_local global i64, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z6updateii(i32 noundef %0, i32 noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %12 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %12, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #3
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #3
  br label %13

13:                                               ; preds = %37, %2
  %14 = load i32, ptr %6, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 1
  br i1 %15, label %16, label %38

16:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %17 = load i32, ptr %6, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [500500 x i32], ptr @lp, i64 0, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %20, ptr %8, align 4, !tbaa !5
  %21 = load i32, ptr %5, align 4, !tbaa !5
  %22 = add nsw i32 %21, 1
  store i32 %22, ptr %5, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %23 unwind label %33

23:                                               ; preds = %16
  br label %24

24:                                               ; preds = %29, %23
  %25 = load i32, ptr %6, align 4, !tbaa !5
  %26 = load i32, ptr %8, align 4, !tbaa !5
  %27 = srem i32 %25, %26
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %29, label %37

29:                                               ; preds = %24
  %30 = load i32, ptr %8, align 4, !tbaa !5
  %31 = load i32, ptr %6, align 4, !tbaa !5
  %32 = sdiv i32 %31, %30
  store i32 %32, ptr %6, align 4, !tbaa !5
  br label %24, !llvm.loop !9

33:                                               ; preds = %16
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %9, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %136

37:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %13, !llvm.loop !11

38:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %132, %38
  %40 = load i32, ptr %11, align 4, !tbaa !5
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = shl i32 1, %41
  %43 = icmp slt i32 %40, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %135

45:                                               ; preds = %39
  %46 = load i32, ptr %11, align 4, !tbaa !5
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %48, label %70

48:                                               ; preds = %45
  %49 = load i32, ptr %11, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [64 x i32], ptr @lsb, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %53) #3
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = load i32, ptr %11, align 4, !tbaa !5
  %57 = load i32, ptr %11, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [64 x i32], ptr @lsb, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = shl i32 1, %60
  %62 = xor i32 %56, %61
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [64 x i32], ptr @val, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = mul nsw i32 %55, %65
  %67 = load i32, ptr %11, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [64 x i32], ptr @val, i64 0, i64 %68
  store i32 %66, ptr %69, align 4, !tbaa !5
  br label %74

70:                                               ; preds = %45
  %71 = load i32, ptr %11, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [64 x i32], ptr @val, i64 0, i64 %72
  store i32 1, ptr %73, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %70, %48
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = icmp slt i32 %75, 0
  br i1 %76, label %77, label %86

77:                                               ; preds = %74
  %78 = load i32, ptr %11, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [64 x i32], ptr @val, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [500500 x i32], ptr @cnt, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = add nsw i32 %84, -1
  store i32 %85, ptr %83, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %77, %74
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [64 x i32], ptr @bitcount, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = srem i32 %90, 2
  %92 = icmp eq i32 %91, 0
  br i1 %92, label %93, label %106

93:                                               ; preds = %86
  %94 = load i32, ptr %4, align 4, !tbaa !5
  %95 = load i32, ptr %11, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [64 x i32], ptr @val, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [500500 x i32], ptr @cnt, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = mul nsw i32 %94, %101
  %103 = sext i32 %102 to i64
  %104 = load i64, ptr @ans, align 8, !tbaa !12
  %105 = add nsw i64 %104, %103
  store i64 %105, ptr @ans, align 8, !tbaa !12
  br label %119

106:                                              ; preds = %86
  %107 = load i32, ptr %4, align 4, !tbaa !5
  %108 = load i32, ptr %11, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [64 x i32], ptr @val, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [500500 x i32], ptr @cnt, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = mul nsw i32 %107, %114
  %116 = sext i32 %115 to i64
  %117 = load i64, ptr @ans, align 8, !tbaa !12
  %118 = sub nsw i64 %117, %116
  store i64 %118, ptr @ans, align 8, !tbaa !12
  br label %119

119:                                              ; preds = %106, %93
  %120 = load i32, ptr %4, align 4, !tbaa !5
  %121 = icmp sgt i32 %120, 0
  br i1 %121, label %122, label %131

122:                                              ; preds = %119
  %123 = load i32, ptr %11, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [64 x i32], ptr @val, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [500500 x i32], ptr @cnt, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %128, align 4, !tbaa !5
  br label %131

131:                                              ; preds = %122, %119
  br label %132

132:                                              ; preds = %131
  %133 = load i32, ptr %11, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %11, align 4, !tbaa !5
  br label %39, !llvm.loop !14

135:                                              ; preds = %44
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  ret void

136:                                              ; preds = %33
  %137 = load ptr, ptr %9, align 8
  %138 = load i32, ptr %10, align 4
  %139 = insertvalue { ptr, i32 } poison, ptr %137, 0
  %140 = insertvalue { ptr, i32 } %139, i32 %138, 1
  resume { ptr, i32 } %140
}

; 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 void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}


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

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

@cnt = external dso_local local_unnamed_addr global [500500 x i32], align 16
@lp = external dso_local local_unnamed_addr global [500500 x i32], align 16
@val = external dso_local local_unnamed_addr global [64 x i32], align 16
@bitcount = external dso_local local_unnamed_addr global [64 x i32], align 16
@lsb = external dso_local local_unnamed_addr global [64 x i32], align 16
@ans = external dso_local local_unnamed_addr global i64, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z6updateii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #4
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  %5 = icmp sgt i32 %0, 1
  br i1 %5, label %.lr.ph33, label %.lr.ph36

.preheader:                                       ; preds = %._crit_edge
  %6 = shl nuw nsw i32 2, %.02531
  %.not41 = icmp eq i32 %88, 31
  br i1 %.not41, label %._crit_edge37, label %.lr.ph36

.lr.ph36:                                         ; preds = %2, %.preheader
  %7 = phi i32 [ %6, %.preheader ], [ 1, %2 ]
  %8 = icmp slt i32 %1, 0
  %9 = icmp sgt i32 %1, 0
  %smax58 = call i32 @llvm.smax.i32(i32 %7, i32 1)
  %wide.trip.count59 = zext nneg i32 %smax58 to i64
  br i1 %8, label %10, label %.lr.ph36.split

10:                                               ; preds = %.lr.ph36
  %.pre68 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 4), align 4, !tbaa !5
  %.pre69 = load i32, ptr @bitcount, align 16, !tbaa !5
  store i32 1, ptr @val, align 16
  %11 = add nsw i32 %.pre68, -1
  store i32 %11, ptr getelementptr inbounds (i8, ptr @cnt, i64 4), align 4, !tbaa !5
  %12 = and i32 %.pre69, 1
  %13 = icmp eq i32 %12, 0
  %14 = mul nsw i32 %11, %1
  %15 = sext i32 %14 to i64
  %16 = load i64, ptr @ans, align 8, !tbaa !9
  %17 = sub nsw i64 0, %15
  %storemerge.us.peel.p = select i1 %13, i64 %15, i64 %17
  %storemerge.us.peel = add i64 %16, %storemerge.us.peel.p
  store i64 %storemerge.us.peel, ptr @ans, align 8, !tbaa !9
  %exitcond60.peel.not = icmp ult i32 %7, 2
  br i1 %exitcond60.peel.not, label %._crit_edge37, label %.lr.ph36.split.us.peel.next

.lr.ph36.split.us.peel.next:                      ; preds = %10, %45
  %indvars.iv55 = phi i64 [ %indvars.iv.next56, %45 ], [ 1, %10 ]
  %18 = getelementptr inbounds [64 x i32], ptr @lsb, i64 0, i64 %indvars.iv55
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %20) #4
  %22 = load i32, ptr %18, align 4, !tbaa !5
  %23 = shl nuw i32 1, %22
  %24 = trunc nuw nsw i64 %indvars.iv55 to i32
  %25 = xor i32 %23, %24
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [64 x i32], ptr @val, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = load i32, ptr %21, align 4, !tbaa !5
  %30 = mul nsw i32 %28, %29
  %31 = getelementptr inbounds [64 x i32], ptr @val, i64 0, i64 %indvars.iv55
  store i32 %30, ptr %31, align 4
  %32 = sext i32 %30 to i64
  %33 = getelementptr inbounds [500500 x i32], ptr @cnt, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = add nsw i32 %34, -1
  store i32 %35, ptr %33, align 4, !tbaa !5
  %36 = getelementptr inbounds [64 x i32], ptr @bitcount, i64 0, i64 %indvars.iv55
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = and i32 %37, 1
  %39 = icmp eq i32 %38, 0
  %40 = mul nsw i32 %35, %1
  %41 = sext i32 %40 to i64
  %42 = load i64, ptr @ans, align 8, !tbaa !9
  %43 = sub nsw i64 0, %41
  %storemerge.us.p = select i1 %39, i64 %41, i64 %43
  %storemerge.us = add i64 %42, %storemerge.us.p
  store i64 %storemerge.us, ptr @ans, align 8, !tbaa !9
  br i1 %9, label %44, label %45

44:                                               ; preds = %.lr.ph36.split.us.peel.next
  store i32 %34, ptr %33, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %44, %.lr.ph36.split.us.peel.next
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %exitcond60.not = icmp eq i64 %indvars.iv.next56, %wide.trip.count59
  br i1 %exitcond60.not, label %._crit_edge37, label %.lr.ph36.split.us.peel.next, !llvm.loop !11

.lr.ph36.split:                                   ; preds = %.lr.ph36
  %.pre67 = load i32, ptr @bitcount, align 16, !tbaa !5
  store i32 1, ptr @val, align 16
  %46 = and i32 %.pre67, 1
  %47 = icmp eq i32 %46, 0
  %48 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 4), align 4, !tbaa !5
  %49 = mul nsw i32 %48, %1
  %50 = load i64, ptr @ans, align 8, !tbaa !9
  br i1 %9, label %54, label %51

51:                                               ; preds = %.lr.ph36.split
  %52 = zext nneg i32 %49 to i64
  %53 = sub nsw i64 0, %52
  %storemerge.peel.p = select i1 %47, i64 %52, i64 %53
  %storemerge.peel = add i64 %50, %storemerge.peel.p
  store i64 %storemerge.peel, ptr @ans, align 8, !tbaa !9
  %exitcond.peel.not = icmp ult i32 %7, 2
  br i1 %exitcond.peel.not, label %._crit_edge37, label %.lr.ph36.split.split.peel.next

54:                                               ; preds = %.lr.ph36.split
  %55 = sext i32 %49 to i64
  %56 = sub nsw i64 0, %55
  %storemerge.us40.peel.p = select i1 %47, i64 %55, i64 %56
  %storemerge.us40.peel = add i64 %50, %storemerge.us40.peel.p
  store i64 %storemerge.us40.peel, ptr @ans, align 8, !tbaa !9
  %57 = add nsw i32 %48, 1
  store i32 %57, ptr getelementptr inbounds (i8, ptr @cnt, i64 4), align 4, !tbaa !5
  %exitcond53.peel.not = icmp ult i32 %7, 2
  br i1 %exitcond53.peel.not, label %._crit_edge37, label %.lr.ph36.split.split.us.peel.next

.lr.ph36.split.split.us.peel.next:                ; preds = %54, %.lr.ph36.split.split.us.peel.next
  %indvars.iv48 = phi i64 [ %indvars.iv.next49, %.lr.ph36.split.split.us.peel.next ], [ 1, %54 ]
  %58 = getelementptr inbounds [64 x i32], ptr @lsb, i64 0, i64 %indvars.iv48
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %60) #4
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = load i32, ptr %58, align 4, !tbaa !5
  %64 = shl nuw i32 1, %63
  %65 = trunc nuw nsw i64 %indvars.iv48 to i32
  %66 = xor i32 %64, %65
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [64 x i32], ptr @val, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = mul nsw i32 %69, %62
  %71 = getelementptr inbounds [64 x i32], ptr @val, i64 0, i64 %indvars.iv48
  store i32 %70, ptr %71, align 4
  %72 = getelementptr inbounds [64 x i32], ptr @bitcount, i64 0, i64 %indvars.iv48
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = and i32 %73, 1
  %75 = icmp eq i32 %74, 0
  %76 = sext i32 %70 to i64
  %77 = getelementptr inbounds [500500 x i32], ptr @cnt, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = mul nsw i32 %78, %1
  %80 = sext i32 %79 to i64
  %81 = load i64, ptr @ans, align 8, !tbaa !9
  %82 = sub nsw i64 0, %80
  %storemerge.us40.p = select i1 %75, i64 %80, i64 %82
  %storemerge.us40 = add i64 %81, %storemerge.us40.p
  store i64 %storemerge.us40, ptr @ans, align 8, !tbaa !9
  %83 = getelementptr inbounds [500500 x i32], ptr @cnt, i64 0, i64 %76
  %84 = add nsw i32 %78, 1
  store i32 %84, ptr %83, align 4, !tbaa !5
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %exitcond53.not = icmp eq i64 %indvars.iv.next49, %wide.trip.count59
  br i1 %exitcond53.not, label %._crit_edge37, label %.lr.ph36.split.split.us.peel.next, !llvm.loop !14

.lr.ph33:                                         ; preds = %2, %._crit_edge
  %.02531 = phi i32 [ %88, %._crit_edge ], [ 0, %2 ]
  %.02630 = phi i32 [ %.1.lcssa, %._crit_edge ], [ %0, %2 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %85 = zext nneg i32 %.02630 to i64
  %86 = getelementptr inbounds [500500 x i32], ptr @lp, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  store i32 %87, ptr %4, align 4, !tbaa !5
  %88 = add nuw nsw i32 %.02531, 1
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %.preheader27 unwind label %95

.preheader27:                                     ; preds = %.lr.ph33
  %89 = load i32, ptr %4, align 4, !tbaa !5
  %90 = srem i32 %.02630, %89
  %91 = icmp eq i32 %90, 0
  br i1 %91, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader27, %.lr.ph
  %.129 = phi i32 [ %92, %.lr.ph ], [ %.02630, %.preheader27 ]
  %92 = sdiv i32 %.129, %89
  %93 = srem i32 %92, %89
  %94 = icmp eq i32 %93, 0
  br i1 %94, label %.lr.ph, label %._crit_edge, !llvm.loop !15

95:                                               ; preds = %.lr.ph33
  %96 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  resume { ptr, i32 } %96

._crit_edge:                                      ; preds = %.lr.ph, %.preheader27
  %.1.lcssa = phi i32 [ %.02630, %.preheader27 ], [ %92, %.lr.ph ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  %97 = icmp sgt i32 %.1.lcssa, 1
  br i1 %97, label %.lr.ph33, label %.preheader, !llvm.loop !16

._crit_edge37:                                    ; preds = %.lr.ph36.split.split.peel.next, %.lr.ph36.split.split.us.peel.next, %45, %51, %54, %10, %.preheader
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  ret void

.lr.ph36.split.split.peel.next:                   ; preds = %51, %.lr.ph36.split.split.peel.next
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph36.split.split.peel.next ], [ 1, %51 ]
  %98 = getelementptr inbounds [64 x i32], ptr @lsb, i64 0, i64 %indvars.iv
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %100) #4
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = load i32, ptr %98, align 4, !tbaa !5
  %104 = shl nuw i32 1, %103
  %105 = trunc nuw nsw i64 %indvars.iv to i32
  %106 = xor i32 %104, %105
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [64 x i32], ptr @val, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = mul nsw i32 %109, %102
  %111 = getelementptr inbounds [64 x i32], ptr @val, i64 0, i64 %indvars.iv
  store i32 %110, ptr %111, align 4
  %112 = getelementptr inbounds [64 x i32], ptr @bitcount, i64 0, i64 %indvars.iv
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = and i32 %113, 1
  %115 = icmp eq i32 %114, 0
  %116 = sext i32 %110 to i64
  %117 = getelementptr inbounds [500500 x i32], ptr @cnt, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = mul nsw i32 %118, %1
  %120 = sext i32 %119 to i64
  %121 = load i64, ptr @ans, align 8, !tbaa !9
  %122 = sub nsw i64 0, %120
  %storemerge.p = select i1 %115, i64 %120, i64 %122
  %storemerge = add i64 %121, %storemerge.p
  store i64 %storemerge, ptr @ans, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count59
  br i1 %exitcond.not, label %._crit_edge37, label %.lr.ph36.split.split.peel.next, !llvm.loop !17
}

; 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 void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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 = { 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, !13}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.peeled.count", i32 1}
!14 = distinct !{!14, !12, !13}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12, !13}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,MergedLoadStoreMotionPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass