; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Codesprints 2016/Codesprint July/Problem G (brute)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@w = external dso_local global [5010 x i64], align 16
@x = external dso_local global [5010 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %13 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %14 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %15 = getelementptr i8, ptr %14, i64 -24
  %16 = load i64, ptr %15, align 8
  %17 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %16
  %18 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %17, ptr noundef null)
  %19 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %20 = getelementptr i8, ptr %19, i64 -24
  %21 = load i64, ptr %20, align 8
  %22 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %21
  %23 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %22, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !8
  br label %26

26:                                               ; preds = %40, %0
  %27 = load i32, ptr %4, align 4, !tbaa !8
  %28 = load i32, ptr %2, align 4, !tbaa !8
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %43

31:                                               ; preds = %26
  %32 = load i32, ptr %4, align 4, !tbaa !8
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [5010 x i64], ptr @x, i64 0, i64 %33
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %34)
  %36 = load i32, ptr %4, align 4, !tbaa !8
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [5010 x i64], ptr @w, i64 0, i64 %37
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 8 dereferenceable(8) %38)
  br label %40

40:                                               ; preds = %31
  %41 = load i32, ptr %4, align 4, !tbaa !8
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %4, align 4, !tbaa !8
  br label %26, !llvm.loop !11

43:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store i64 1152921504606846976, ptr %5, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !8
  br label %44

44:                                               ; preds = %114, %43
  %45 = load i32, ptr %6, align 4, !tbaa !8
  %46 = sext i32 %45 to i64
  %47 = load i32, ptr %2, align 4, !tbaa !8
  %48 = zext i32 %47 to i64
  %49 = shl i64 1, %48
  %50 = icmp slt i64 %46, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %44
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %117

52:                                               ; preds = %44
  %53 = load i32, ptr %6, align 4, !tbaa !8
  %54 = call i32 @llvm.ctpop.i32(i32 %53)
  %55 = load i32, ptr %3, align 4, !tbaa !8
  %56 = icmp ne i32 %54, %55
  br i1 %56, label %57, label %58

57:                                               ; preds = %52
  br label %114

58:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !8
  br label %59

59:                                               ; preds = %104, %58
  %60 = load i32, ptr %9, align 4, !tbaa !8
  %61 = load i32, ptr %2, align 4, !tbaa !8
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %107

64:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 1152921504606846976, ptr %10, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !8
  br label %65

65:                                               ; preds = %97, %64
  %66 = load i32, ptr %11, align 4, !tbaa !8
  %67 = load i32, ptr %2, align 4, !tbaa !8
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %100

70:                                               ; preds = %65
  %71 = load i32, ptr %6, align 4, !tbaa !8
  %72 = sext i32 %71 to i64
  %73 = load i32, ptr %11, align 4, !tbaa !8
  %74 = zext i32 %73 to i64
  %75 = shl i64 1, %74
  %76 = and i64 %72, %75
  %77 = icmp sgt i64 %76, 0
  br i1 %77, label %78, label %96

78:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %79 = load i32, ptr %9, align 4, !tbaa !8
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [5010 x i64], ptr @w, i64 0, i64 %80
  %82 = load i64, ptr %81, align 8, !tbaa !13
  %83 = load i32, ptr %11, align 4, !tbaa !8
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [5010 x i64], ptr @x, i64 0, i64 %84
  %86 = load i64, ptr %85, align 8, !tbaa !13
  %87 = load i32, ptr %9, align 4, !tbaa !8
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [5010 x i64], ptr @x, i64 0, i64 %88
  %90 = load i64, ptr %89, align 8, !tbaa !13
  %91 = sub nsw i64 %86, %90
  %92 = call noundef i64 @_ZSt3absx(i64 noundef %91)
  %93 = mul nsw i64 %82, %92
  store i64 %93, ptr %12, align 8, !tbaa !13
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %95 = load i64, ptr %94, align 8, !tbaa !13
  store i64 %95, ptr %10, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %96

96:                                               ; preds = %78, %70
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %11, align 4, !tbaa !8
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %11, align 4, !tbaa !8
  br label %65, !llvm.loop !15

100:                                              ; preds = %69
  %101 = load i64, ptr %10, align 8, !tbaa !13
  %102 = load i64, ptr %8, align 8, !tbaa !13
  %103 = add nsw i64 %102, %101
  store i64 %103, ptr %8, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %104

104:                                              ; preds = %100
  %105 = load i32, ptr %9, align 4, !tbaa !8
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %9, align 4, !tbaa !8
  br label %59, !llvm.loop !16

107:                                              ; preds = %63
  %108 = load i64, ptr %8, align 8, !tbaa !13
  %109 = load i64, ptr %5, align 8, !tbaa !13
  %110 = icmp slt i64 %108, %109
  br i1 %110, label %111, label %113

111:                                              ; preds = %107
  %112 = load i64, ptr %8, align 8, !tbaa !13
  store i64 %112, ptr %5, align 8, !tbaa !13
  br label %113

113:                                              ; preds = %111, %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %114

114:                                              ; preds = %113, %57
  %115 = load i32, ptr %6, align 4, !tbaa !8
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %6, align 4, !tbaa !8
  br label %44, !llvm.loop !17

117:                                              ; preds = %51
  %118 = load i64, ptr %5, align 8, !tbaa !13
  call void @_Z2trIxJEEvT_DpRKT0_(i64 noundef %118)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %119 = load i32, ptr %1, align 4
  ret i32 %119
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3absx(i64 noundef) #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2trIxJEEvT_DpRKT0_(i64 noundef) #4

attributes #0 = { mustprogress norecurse 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 = { "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 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 willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { inlinehint 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 #7 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !10, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@w = external dso_local global [5010 x i64], align 16
@x = external dso_local global [5010 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %6 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %8
  %10 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef null)
  %11 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %12 = getelementptr i8, ptr %11, i64 -24
  %13 = load i64, ptr %12, align 8
  %14 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %13
  %15 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %14, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %18 = load i32, ptr %1, align 4, !tbaa !8
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %.lr.ph39.preheader

.preheader29:                                     ; preds = %.lr.ph
  %.not42 = icmp eq i32 %24, 63
  br i1 %.not42, label %._crit_edge40, label %.lr.ph39.preheader

.lr.ph39.preheader:                               ; preds = %0, %.preheader29
  %.ph = phi i32 [ %18, %0 ], [ %24, %.preheader29 ]
  br label %.lr.ph39

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %20 = getelementptr inbounds [5010 x i64], ptr @x, i64 0, i64 %indvars.iv
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %20)
  %22 = getelementptr inbounds [5010 x i64], ptr @w, i64 0, i64 %indvars.iv
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(8) %22)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %24 = load i32, ptr %1, align 4, !tbaa !8
  %25 = sext i32 %24 to i64
  %26 = icmp slt i64 %indvars.iv.next, %25
  br i1 %26, label %.lr.ph, label %.preheader29, !llvm.loop !11

._crit_edge40:                                    ; preds = %68, %.preheader29
  %.025.lcssa = phi i64 [ 1152921504606846976, %.preheader29 ], [ %.2, %68 ]
  call void @_Z2trIxJEEvT_DpRKT0_(i64 noundef %.025.lcssa)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0

.lr.ph39:                                         ; preds = %.lr.ph39.preheader, %68
  %27 = phi i32 [ %69, %68 ], [ %.ph, %.lr.ph39.preheader ]
  %indvars.iv52 = phi i64 [ %indvars.iv.next53, %68 ], [ 0, %.lr.ph39.preheader ]
  %.02537 = phi i64 [ %.2, %68 ], [ 1152921504606846976, %.lr.ph39.preheader ]
  %28 = trunc nuw nsw i64 %indvars.iv52 to i32
  %29 = call range(i32 0, 32) i32 @llvm.ctpop.i32(i32 %28)
  %30 = load i32, ptr %2, align 4, !tbaa !8
  %.not = icmp eq i32 %29, %30
  br i1 %.not, label %.preheader, label %68

.preheader:                                       ; preds = %.lr.ph39
  %31 = icmp sgt i32 %27, 0
  br i1 %31, label %.lr.ph35.split, label %._crit_edge36

._crit_edge36:                                    ; preds = %._crit_edge, %.preheader
  %32 = phi i32 [ %27, %.preheader ], [ %38, %._crit_edge ]
  %.023.lcssa = phi i64 [ 0, %.preheader ], [ %41, %._crit_edge ]
  %spec.select = call i64 @llvm.smin.i64(i64 %.023.lcssa, i64 %.02537)
  br label %68

.lr.ph35.split:                                   ; preds = %.preheader, %._crit_edge
  %33 = phi i32 [ %38, %._crit_edge ], [ %27, %.preheader ]
  %34 = phi i32 [ %39, %._crit_edge ], [ %27, %.preheader ]
  %indvars.iv49 = phi i64 [ %indvars.iv.next50, %._crit_edge ], [ 0, %.preheader ]
  %.02333 = phi i64 [ %41, %._crit_edge ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  store i64 1152921504606846976, ptr %3, align 8, !tbaa !13
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %.lr.ph32, label %._crit_edge

.lr.ph32:                                         ; preds = %.lr.ph35.split
  %36 = getelementptr inbounds [5010 x i64], ptr @w, i64 0, i64 %indvars.iv49
  %37 = getelementptr inbounds [5010 x i64], ptr @x, i64 0, i64 %indvars.iv49
  br label %44

._crit_edge:                                      ; preds = %61, %.lr.ph35.split
  %38 = phi i32 [ %33, %.lr.ph35.split ], [ %62, %61 ]
  %39 = phi i32 [ %34, %.lr.ph35.split ], [ %63, %61 ]
  %40 = phi i64 [ 1152921504606846976, %.lr.ph35.split ], [ %64, %61 ]
  %41 = add nsw i64 %40, %.02333
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
  %42 = sext i32 %39 to i64
  %43 = icmp slt i64 %indvars.iv.next50, %42
  br i1 %43, label %.lr.ph35.split, label %._crit_edge36, !llvm.loop !15

44:                                               ; preds = %.lr.ph32, %61
  %45 = phi i32 [ %33, %.lr.ph32 ], [ %62, %61 ]
  %46 = phi i32 [ %34, %.lr.ph32 ], [ %63, %61 ]
  %47 = phi i64 [ 1152921504606846976, %.lr.ph32 ], [ %64, %61 ]
  %48 = phi i32 [ %34, %.lr.ph32 ], [ %65, %61 ]
  %indvars.iv46 = phi i64 [ 0, %.lr.ph32 ], [ %indvars.iv.next47, %61 ]
  %49 = shl nuw i64 1, %indvars.iv46
  %50 = and i64 %49, %indvars.iv52
  %.not28 = icmp eq i64 %50, 0
  br i1 %.not28, label %61, label %51

51:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %52 = load i64, ptr %36, align 8, !tbaa !13
  %53 = getelementptr inbounds [5010 x i64], ptr @x, i64 0, i64 %indvars.iv46
  %54 = load i64, ptr %53, align 8, !tbaa !13
  %55 = load i64, ptr %37, align 8, !tbaa !13
  %56 = sub nsw i64 %54, %55
  %57 = call noundef i64 @_ZSt3absx(i64 noundef %56)
  %58 = mul nsw i64 %57, %52
  store i64 %58, ptr %4, align 8, !tbaa !13
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %60 = load i64, ptr %59, align 8, !tbaa !13
  store i64 %60, ptr %3, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  %.pre = load i32, ptr %1, align 4, !tbaa !8
  br label %61

61:                                               ; preds = %44, %51
  %62 = phi i32 [ %45, %44 ], [ %.pre, %51 ]
  %63 = phi i32 [ %46, %44 ], [ %.pre, %51 ]
  %64 = phi i64 [ %47, %44 ], [ %60, %51 ]
  %65 = phi i32 [ %48, %44 ], [ %.pre, %51 ]
  %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
  %66 = sext i32 %65 to i64
  %67 = icmp slt i64 %indvars.iv.next47, %66
  br i1 %67, label %44, label %._crit_edge, !llvm.loop !17

68:                                               ; preds = %.lr.ph39, %._crit_edge36
  %69 = phi i32 [ %27, %.lr.ph39 ], [ %32, %._crit_edge36 ]
  %.2 = phi i64 [ %.02537, %.lr.ph39 ], [ %spec.select, %._crit_edge36 ]
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
  %70 = zext nneg i32 %69 to i64
  %71 = shl nuw i64 1, %70
  %72 = icmp sgt i64 %71, %indvars.iv.next53
  br i1 %72, label %.lr.ph39, label %._crit_edge40, !llvm.loop !18
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 2

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.ctpop.i32(i32) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3absx(i64 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2trIxJEEvT_DpRKT0_(i64 noundef) local_unnamed_addr #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #7

attributes #0 = { mustprogress norecurse 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 = { "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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { inlinehint 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !10, i64 0}
!15 = distinct !{!15, !12, !16}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


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