; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Codeagon 2016/Problem B (B)

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

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@n = external dso_local global i32, align 4
@a = external dso_local global [16 x i32], align 16
@sieve = external dso_local global [1000001 x i32], align 16
@l = external dso_local global [1000001 x i64], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z8getSievev() #2

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %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 i64, align 8
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %22, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %17, label %16

16:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %25

17:                                               ; preds = %12
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [16 x i32], ptr @a, i64 0, i64 %19
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %20)
  br label %22

22:                                               ; preds = %17
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !9

25:                                               ; preds = %16
  call void @_Z8getSievev()
  store i64 0, ptr getelementptr inbounds ([1000001 x i64], ptr @l, i64 0, i64 1), align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 2, ptr %3, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %44, %25
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = icmp slt i32 %27, 1000001
  br i1 %28, label %30, label %29

29:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %47

30:                                               ; preds = %26
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [1000001 x i32], ptr @sieve, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = sdiv i32 %31, %35
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [1000001 x i64], ptr @l, i64 0, i64 %37
  %39 = load i64, ptr %38, align 8, !tbaa !11
  %40 = add nsw i64 %39, 1
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [1000001 x i64], ptr @l, i64 0, i64 %42
  store i64 %40, ptr %43, align 8, !tbaa !11
  br label %44

44:                                               ; preds = %30
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %3, align 4, !tbaa !5
  br label %26, !llvm.loop !13

47:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 2, ptr %4, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %63, %47
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = icmp slt i32 %49, 1000001
  br i1 %50, label %52, label %51

51:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %66

52:                                               ; preds = %48
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = sub nsw i32 %53, 1
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [1000001 x i64], ptr @l, i64 0, i64 %55
  %57 = load i64, ptr %56, align 8, !tbaa !11
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [1000001 x i64], ptr @l, i64 0, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !11
  %62 = add nsw i64 %61, %57
  store i64 %62, ptr %60, align 8, !tbaa !11
  br label %63

63:                                               ; preds = %52
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %4, align 4, !tbaa !5
  br label %48, !llvm.loop !14

66:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i64 0, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %117, %66
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = load i32, ptr @n, align 4, !tbaa !5
  %70 = shl i32 1, %69
  %71 = icmp slt i32 %68, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %67
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %120

73:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %106, %73
  %75 = load i32, ptr %10, align 4, !tbaa !5
  %76 = load i32, ptr @n, align 4, !tbaa !5
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %109

79:                                               ; preds = %74
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = load i32, ptr %10, align 4, !tbaa !5
  %82 = shl i32 1, %81
  %83 = and i32 %80, %82
  %84 = icmp sgt i32 %83, 0
  br i1 %84, label %85, label %105

85:                                               ; preds = %79
  %86 = load i32, ptr %10, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [16 x i32], ptr @a, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [1000001 x i64], ptr @l, i64 0, i64 %90
  %92 = load i64, ptr %91, align 8, !tbaa !11
  %93 = srem i64 %92, 2
  %94 = load i64, ptr %8, align 8, !tbaa !11
  %95 = xor i64 %94, %93
  store i64 %95, ptr %8, align 8, !tbaa !11
  %96 = load i32, ptr %10, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [16 x i32], ptr @a, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [1000001 x i64], ptr @l, i64 0, i64 %100
  %102 = load i64, ptr %101, align 8, !tbaa !11
  %103 = load i64, ptr %9, align 8, !tbaa !11
  %104 = add nsw i64 %103, %102
  store i64 %104, ptr %9, align 8, !tbaa !11
  br label %105

105:                                              ; preds = %85, %79
  br label %106

106:                                              ; preds = %105
  %107 = load i32, ptr %10, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %10, align 4, !tbaa !5
  br label %74, !llvm.loop !15

109:                                              ; preds = %78
  %110 = load i64, ptr %8, align 8, !tbaa !11
  %111 = icmp ne i64 %110, 0
  br i1 %111, label %116, label %112

112:                                              ; preds = %109
  %113 = load i64, ptr %9, align 8, !tbaa !11
  %114 = load i64, ptr %5, align 8, !tbaa !11
  %115 = add nsw i64 %114, %113
  store i64 %115, ptr %5, align 8, !tbaa !11
  br label %116

116:                                              ; preds = %112, %109
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %117

117:                                              ; preds = %116
  %118 = load i32, ptr %6, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %6, align 4, !tbaa !5
  br label %67, !llvm.loop !16

120:                                              ; preds = %72
  %121 = load i64, ptr %5, align 8, !tbaa !11
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %121)
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %122, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  %124 = load i32, ptr %1, align 4
  ret i32 %124
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0 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 = { inlinehint 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 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 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 #5 = { "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 #6 = { 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 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !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::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 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@n = external dso_local global i32, align 4
@a = external dso_local global [16 x i32], align 16
@sieve = external dso_local local_unnamed_addr global [1000001 x i32], align 16
@l = external dso_local local_unnamed_addr global [1000001 x i64], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z8getSievev() local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  tail call void @_Z8getSievev()
  store i64 0, ptr getelementptr inbounds (i8, ptr @l, i64 8), align 8, !tbaa !9
  br label %9

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %4 = getelementptr inbounds [16 x i32], ptr @a, i64 0, i64 %indvars.iv
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %4)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %7 = sext i32 %6 to i64
  %8 = icmp slt i64 %indvars.iv.next, %7
  br i1 %8, label %.lr.ph, label %._crit_edge, !llvm.loop !11

9:                                                ; preds = %19, %._crit_edge
  %indvars.iv54 = phi i64 [ 2, %._crit_edge ], [ %indvars.iv.next55.1, %19 ]
  %10 = getelementptr inbounds [1000001 x i32], ptr @sieve, i64 0, i64 %indvars.iv54
  %11 = load i32, ptr %10, align 8, !tbaa !5
  %12 = trunc nuw nsw i64 %indvars.iv54 to i32
  %13 = sdiv i32 %12, %11
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [1000001 x i64], ptr @l, i64 0, i64 %14
  %16 = load i64, ptr %15, align 8, !tbaa !9
  %17 = add nsw i64 %16, 1
  %18 = getelementptr inbounds [1000001 x i64], ptr @l, i64 0, i64 %indvars.iv54
  store i64 %17, ptr %18, align 16, !tbaa !9
  %exitcond.not = icmp eq i64 %indvars.iv54, 1000000
  br i1 %exitcond.not, label %.preheader38.preheader, label %19, !llvm.loop !13

19:                                               ; preds = %9
  %indvars.iv.next55 = or disjoint i64 %indvars.iv54, 1
  %20 = getelementptr inbounds [1000001 x i32], ptr @sieve, i64 0, i64 %indvars.iv.next55
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = trunc nuw nsw i64 %indvars.iv.next55 to i32
  %23 = sdiv i32 %22, %21
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [1000001 x i64], ptr @l, i64 0, i64 %24
  %26 = load i64, ptr %25, align 8, !tbaa !9
  %27 = add nsw i64 %26, 1
  %28 = getelementptr inbounds [1000001 x i64], ptr @l, i64 0, i64 %indvars.iv.next55
  store i64 %27, ptr %28, align 8, !tbaa !9
  %indvars.iv.next55.1 = add nuw nsw i64 %indvars.iv54, 2
  br label %9

.preheader38.preheader:                           ; preds = %9
  %.pre = load i64, ptr getelementptr inbounds (i8, ptr @l, i64 8), align 8, !tbaa !9
  br label %.preheader38

.preheader37:                                     ; preds = %.preheader38
  %29 = load i32, ptr @n, align 4, !tbaa !5
  %30 = shl nuw i32 1, %29
  %31 = icmp sgt i32 %30, 1
  %32 = icmp sgt i32 %29, 0
  %or.cond = and i1 %31, %32
  br i1 %or.cond, label %.preheader.us.preheader, label %._crit_edge50

.preheader.us.preheader:                          ; preds = %.preheader37
  %wide.trip.count = zext nneg i32 %29 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge46.us
  %.03049.us = phi i32 [ %48, %._crit_edge46.us ], [ 1, %.preheader.us.preheader ]
  %.03148.us = phi i64 [ %spec.select.us, %._crit_edge46.us ], [ 0, %.preheader.us.preheader ]
  br label %33

33:                                               ; preds = %.preheader.us, %46
  %indvars.iv61 = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next62, %46 ]
  %.02743.us = phi i64 [ 0, %.preheader.us ], [ %.1.us, %46 ]
  %.02842.us = phi i64 [ 0, %.preheader.us ], [ %.129.us, %46 ]
  %34 = trunc nuw nsw i64 %indvars.iv61 to i32
  %35 = shl nuw i32 1, %34
  %36 = and i32 %35, %.03049.us
  %.not36.us = icmp eq i32 %36, 0
  br i1 %.not36.us, label %46, label %37

37:                                               ; preds = %33
  %38 = getelementptr inbounds [16 x i32], ptr @a, i64 0, i64 %indvars.iv61
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [1000001 x i64], ptr @l, i64 0, i64 %40
  %42 = load i64, ptr %41, align 8, !tbaa !9
  %43 = srem i64 %42, 2
  %44 = xor i64 %43, %.02842.us
  %45 = add nsw i64 %42, %.02743.us
  br label %46

46:                                               ; preds = %37, %33
  %.129.us = phi i64 [ %44, %37 ], [ %.02842.us, %33 ]
  %.1.us = phi i64 [ %45, %37 ], [ %.02743.us, %33 ]
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %exitcond64.not = icmp eq i64 %indvars.iv.next62, %wide.trip.count
  br i1 %exitcond64.not, label %._crit_edge46.us, label %33, !llvm.loop !14

._crit_edge46.us:                                 ; preds = %46
  %.not.us = icmp eq i64 %.129.us, 0
  %47 = select i1 %.not.us, i64 %.1.us, i64 0
  %spec.select.us = add nsw i64 %47, %.03148.us
  %48 = add nuw nsw i32 %.03049.us, 1
  %exitcond65.not = icmp eq i32 %48, %30
  br i1 %exitcond65.not, label %._crit_edge50, label %.preheader.us, !llvm.loop !15

.preheader38:                                     ; preds = %.preheader38, %.preheader38.preheader
  %49 = phi i64 [ %.pre, %.preheader38.preheader ], [ %58, %.preheader38 ]
  %indvars.iv57 = phi i64 [ 2, %.preheader38.preheader ], [ %indvars.iv.next58.2, %.preheader38 ]
  %50 = getelementptr inbounds [1000001 x i64], ptr @l, i64 0, i64 %indvars.iv57
  %51 = load i64, ptr %50, align 8, !tbaa !9
  %52 = add nsw i64 %51, %49
  store i64 %52, ptr %50, align 8, !tbaa !9
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %53 = getelementptr inbounds [1000001 x i64], ptr @l, i64 0, i64 %indvars.iv.next58
  %54 = load i64, ptr %53, align 8, !tbaa !9
  %55 = add nsw i64 %54, %52
  store i64 %55, ptr %53, align 8, !tbaa !9
  %indvars.iv.next58.1 = add nuw nsw i64 %indvars.iv57, 2
  %56 = getelementptr inbounds [1000001 x i64], ptr @l, i64 0, i64 %indvars.iv.next58.1
  %57 = load i64, ptr %56, align 8, !tbaa !9
  %58 = add nsw i64 %57, %55
  store i64 %58, ptr %56, align 8, !tbaa !9
  %indvars.iv.next58.2 = add nuw nsw i64 %indvars.iv57, 3
  %exitcond60.not.2 = icmp eq i64 %indvars.iv.next58.2, 1000001
  br i1 %exitcond60.not.2, label %.preheader37, label %.preheader38, !llvm.loop !16

._crit_edge50:                                    ; preds = %._crit_edge46.us, %.preheader37
  %.031.lcssa = phi i64 [ 0, %.preheader37 ], [ %spec.select.us, %._crit_edge46.us ]
  %59 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.031.lcssa)
  %60 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #0 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 = { inlinehint 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 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 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 #4 = { nofree nounwind "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" }

!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}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


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