; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Company Contests/SnapDeal Hackathon/Problem D (D)

; 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_istream" = type { ptr, i64, %"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_ostream" = type { ptr, %"class.std::basic_ios" }

@n = external dso_local global i64, align 8
@a = external dso_local global [200100 x i64], align 16
@sum = external dso_local global [200100 x [21 x i64]], align 16
@k1 = external dso_local global i64, align 8
@k2 = external dso_local global i64, align 8
@ans = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z1fxx(i64 noundef, i64 noundef) #0

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

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

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

25:                                               ; preds = %34, %0
  %26 = load i64, ptr %2, align 8, !tbaa !8
  %27 = load i64, ptr @n, align 8, !tbaa !8
  %28 = icmp slt i64 %26, %27
  br i1 %28, label %30, label %29

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

30:                                               ; preds = %25
  %31 = load i64, ptr %2, align 8, !tbaa !8
  %32 = getelementptr inbounds [200100 x i64], ptr @a, i64 0, i64 %31
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %32)
  br label %34

34:                                               ; preds = %30
  %35 = load i64, ptr %2, align 8, !tbaa !8
  %36 = add nsw i64 %35, 1
  store i64 %36, ptr %2, align 8, !tbaa !8
  br label %25, !llvm.loop !11

37:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  store i64 0, ptr %3, align 8, !tbaa !8
  br label %38

38:                                               ; preds = %53, %37
  %39 = load i64, ptr %3, align 8, !tbaa !8
  %40 = icmp sle i64 %39, 20
  br i1 %40, label %42, label %41

41:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %56

42:                                               ; preds = %38
  %43 = load i64, ptr @a, align 16, !tbaa !8
  %44 = load i64, ptr %3, align 8, !tbaa !8
  %45 = trunc i64 %44 to i32
  %46 = shl i32 1, %45
  %47 = sext i32 %46 to i64
  %48 = and i64 %43, %47
  %49 = icmp sgt i64 %48, 0
  %50 = zext i1 %49 to i64
  %51 = load i64, ptr %3, align 8, !tbaa !8
  %52 = getelementptr inbounds [21 x i64], ptr @sum, i64 0, i64 %51
  store i64 %50, ptr %52, align 8, !tbaa !8
  br label %53

53:                                               ; preds = %42
  %54 = load i64, ptr %3, align 8, !tbaa !8
  %55 = add nsw i64 %54, 1
  store i64 %55, ptr %3, align 8, !tbaa !8
  br label %38, !llvm.loop !13

56:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 1, ptr %4, align 8, !tbaa !8
  br label %57

57:                                               ; preds = %93, %56
  %58 = load i64, ptr %4, align 8, !tbaa !8
  %59 = load i64, ptr @n, align 8, !tbaa !8
  %60 = icmp slt i64 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %96

62:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 0, ptr %6, align 8, !tbaa !8
  br label %63

63:                                               ; preds = %89, %62
  %64 = load i64, ptr %6, align 8, !tbaa !8
  %65 = icmp sle i64 %64, 20
  br i1 %65, label %67, label %66

66:                                               ; preds = %63
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %92

67:                                               ; preds = %63
  %68 = load i64, ptr %4, align 8, !tbaa !8
  %69 = sub nsw i64 %68, 1
  %70 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %69
  %71 = load i64, ptr %6, align 8, !tbaa !8
  %72 = getelementptr inbounds [21 x i64], ptr %70, i64 0, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !8
  %74 = load i64, ptr %4, align 8, !tbaa !8
  %75 = getelementptr inbounds [200100 x i64], ptr @a, i64 0, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !8
  %77 = load i64, ptr %6, align 8, !tbaa !8
  %78 = trunc i64 %77 to i32
  %79 = shl i32 1, %78
  %80 = sext i32 %79 to i64
  %81 = and i64 %76, %80
  %82 = icmp sgt i64 %81, 0
  %83 = zext i1 %82 to i64
  %84 = add nsw i64 %73, %83
  %85 = load i64, ptr %4, align 8, !tbaa !8
  %86 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %85
  %87 = load i64, ptr %6, align 8, !tbaa !8
  %88 = getelementptr inbounds [21 x i64], ptr %86, i64 0, i64 %87
  store i64 %84, ptr %88, align 8, !tbaa !8
  br label %89

89:                                               ; preds = %67
  %90 = load i64, ptr %6, align 8, !tbaa !8
  %91 = add nsw i64 %90, 1
  store i64 %91, ptr %6, align 8, !tbaa !8
  br label %63, !llvm.loop !14

92:                                               ; preds = %66
  br label %93

93:                                               ; preds = %92
  %94 = load i64, ptr %4, align 8, !tbaa !8
  %95 = add nsw i64 %94, 1
  store i64 %95, ptr %4, align 8, !tbaa !8
  br label %57, !llvm.loop !15

96:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !8
  br label %97

97:                                               ; preds = %130, %96
  %98 = load i64, ptr %7, align 8, !tbaa !8
  %99 = load i64, ptr @n, align 8, !tbaa !8
  %100 = icmp slt i64 %98, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %97
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %133

102:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %103 = load i64, ptr %7, align 8, !tbaa !8
  store i64 %103, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %104 = load i64, ptr @n, align 8, !tbaa !8
  store i64 %104, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  br label %105

105:                                              ; preds = %123, %102
  %106 = load i64, ptr %8, align 8, !tbaa !8
  %107 = load i64, ptr %9, align 8, !tbaa !8
  %108 = icmp slt i64 %106, %107
  br i1 %108, label %109, label %124

109:                                              ; preds = %105
  %110 = load i64, ptr %8, align 8, !tbaa !8
  %111 = load i64, ptr %9, align 8, !tbaa !8
  %112 = add nsw i64 %110, %111
  %113 = sdiv i64 %112, 2
  store i64 %113, ptr %10, align 8, !tbaa !8
  %114 = load i64, ptr %7, align 8, !tbaa !8
  %115 = load i64, ptr %10, align 8, !tbaa !8
  %116 = call noundef i64 @_Z1fxx(i64 noundef %114, i64 noundef %115)
  %117 = icmp ne i64 %116, 0
  br i1 %117, label %118, label %120

118:                                              ; preds = %109
  %119 = load i64, ptr %10, align 8, !tbaa !8
  store i64 %119, ptr %9, align 8, !tbaa !8
  br label %123

120:                                              ; preds = %109
  %121 = load i64, ptr %10, align 8, !tbaa !8
  %122 = add nsw i64 %121, 1
  store i64 %122, ptr %8, align 8, !tbaa !8
  br label %123

123:                                              ; preds = %120, %118
  br label %105, !llvm.loop !16

124:                                              ; preds = %105
  %125 = load i64, ptr @n, align 8, !tbaa !8
  %126 = load i64, ptr %9, align 8, !tbaa !8
  %127 = sub nsw i64 %125, %126
  %128 = load i64, ptr @ans, align 8, !tbaa !8
  %129 = add nsw i64 %128, %127
  store i64 %129, ptr @ans, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %130

130:                                              ; preds = %124
  %131 = load i64, ptr %7, align 8, !tbaa !8
  %132 = add nsw i64 %131, 1
  store i64 %132, ptr %7, align 8, !tbaa !8
  br label %97, !llvm.loop !17

133:                                              ; preds = %101
  %134 = load i64, ptr @ans, align 8, !tbaa !8
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %134)
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %135, i8 noundef signext 10)
  ret i32 0
}

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

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

; 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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 = { 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 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !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}
!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_istream" = type { ptr, i64, %"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_ostream" = type { ptr, %"class.std::basic_ios" }

@n = external dso_local global i64, align 8
@a = external dso_local global [200100 x i64], align 16
@sum = external dso_local local_unnamed_addr global [200100 x [21 x i64]], align 16
@k1 = external dso_local global i64, align 8
@k2 = external dso_local global i64, align 8
@ans = external dso_local local_unnamed_addr global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z1fxx(i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %2 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %3 = getelementptr i8, ptr %2, i64 -24
  %4 = load i64, ptr %3, align 8
  %5 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %4
  %6 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %5, ptr noundef null)
  %7 = load ptr, ptr @_ZSt4cerr, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt4cerr, i64 %9
  %11 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  %12 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @n)
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) @k1)
  %14 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) @k2)
  %15 = load i64, ptr @n, align 8, !tbaa !8
  %16 = icmp sgt i64 %15, 0
  br i1 %16, label %.lr.ph, label %.preheader40

.preheader40:                                     ; preds = %.lr.ph, %0
  %.lcssa = phi i64 [ %15, %0 ], [ %43, %.lr.ph ]
  %17 = load i64, ptr @a, align 16, !tbaa !8
  %18 = and i64 %17, 1
  store i64 %18, ptr @sum, align 16, !tbaa !8
  %19 = lshr i64 %17, 1
  %.lobit = and i64 %19, 1
  store i64 %.lobit, ptr getelementptr inbounds (i8, ptr @sum, i64 8), align 8, !tbaa !8
  %20 = lshr i64 %17, 2
  %.lobit50 = and i64 %20, 1
  store i64 %.lobit50, ptr getelementptr inbounds (i8, ptr @sum, i64 16), align 16, !tbaa !8
  %21 = lshr i64 %17, 3
  %.lobit51 = and i64 %21, 1
  store i64 %.lobit51, ptr getelementptr inbounds (i8, ptr @sum, i64 24), align 8, !tbaa !8
  %22 = lshr i64 %17, 4
  %.lobit52 = and i64 %22, 1
  store i64 %.lobit52, ptr getelementptr inbounds (i8, ptr @sum, i64 32), align 16, !tbaa !8
  %23 = lshr i64 %17, 5
  %.lobit53 = and i64 %23, 1
  store i64 %.lobit53, ptr getelementptr inbounds (i8, ptr @sum, i64 40), align 8, !tbaa !8
  %24 = lshr i64 %17, 6
  %.lobit54 = and i64 %24, 1
  store i64 %.lobit54, ptr getelementptr inbounds (i8, ptr @sum, i64 48), align 16, !tbaa !8
  %25 = lshr i64 %17, 7
  %.lobit55 = and i64 %25, 1
  store i64 %.lobit55, ptr getelementptr inbounds (i8, ptr @sum, i64 56), align 8, !tbaa !8
  %26 = lshr i64 %17, 8
  %.lobit56 = and i64 %26, 1
  store i64 %.lobit56, ptr getelementptr inbounds (i8, ptr @sum, i64 64), align 16, !tbaa !8
  %27 = lshr i64 %17, 9
  %.lobit57 = and i64 %27, 1
  store i64 %.lobit57, ptr getelementptr inbounds (i8, ptr @sum, i64 72), align 8, !tbaa !8
  %28 = lshr i64 %17, 10
  %.lobit58 = and i64 %28, 1
  store i64 %.lobit58, ptr getelementptr inbounds (i8, ptr @sum, i64 80), align 16, !tbaa !8
  %29 = lshr i64 %17, 11
  %.lobit59 = and i64 %29, 1
  store i64 %.lobit59, ptr getelementptr inbounds (i8, ptr @sum, i64 88), align 8, !tbaa !8
  %30 = lshr i64 %17, 12
  %.lobit60 = and i64 %30, 1
  store i64 %.lobit60, ptr getelementptr inbounds (i8, ptr @sum, i64 96), align 16, !tbaa !8
  %31 = lshr i64 %17, 13
  %.lobit61 = and i64 %31, 1
  store i64 %.lobit61, ptr getelementptr inbounds (i8, ptr @sum, i64 104), align 8, !tbaa !8
  %32 = lshr i64 %17, 14
  %.lobit62 = and i64 %32, 1
  store i64 %.lobit62, ptr getelementptr inbounds (i8, ptr @sum, i64 112), align 16, !tbaa !8
  %33 = lshr i64 %17, 15
  %.lobit63 = and i64 %33, 1
  store i64 %.lobit63, ptr getelementptr inbounds (i8, ptr @sum, i64 120), align 8, !tbaa !8
  %34 = lshr i64 %17, 16
  %.lobit64 = and i64 %34, 1
  store i64 %.lobit64, ptr getelementptr inbounds (i8, ptr @sum, i64 128), align 16, !tbaa !8
  %35 = lshr i64 %17, 17
  %.lobit65 = and i64 %35, 1
  store i64 %.lobit65, ptr getelementptr inbounds (i8, ptr @sum, i64 136), align 8, !tbaa !8
  %36 = lshr i64 %17, 18
  %.lobit66 = and i64 %36, 1
  store i64 %.lobit66, ptr getelementptr inbounds (i8, ptr @sum, i64 144), align 16, !tbaa !8
  %37 = lshr i64 %17, 19
  %.lobit67 = and i64 %37, 1
  store i64 %.lobit67, ptr getelementptr inbounds (i8, ptr @sum, i64 152), align 8, !tbaa !8
  %38 = lshr i64 %17, 20
  %.lobit68 = and i64 %38, 1
  store i64 %.lobit68, ptr getelementptr inbounds (i8, ptr @sum, i64 160), align 16, !tbaa !8
  %39 = icmp sgt i64 %.lcssa, 1
  br i1 %39, label %.preheader38, label %.preheader37

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.041 = phi i64 [ %42, %.lr.ph ], [ 0, %0 ]
  %40 = getelementptr inbounds [200100 x i64], ptr @a, i64 0, i64 %.041
  %41 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %40)
  %42 = add nuw nsw i64 %.041, 1
  %43 = load i64, ptr @n, align 8, !tbaa !8
  %44 = icmp slt i64 %42, %43
  br i1 %44, label %.lr.ph, label %.preheader40, !llvm.loop !11

.preheader38:                                     ; preds = %.preheader40, %.preheader38
  %45 = phi i64 [ %90, %.preheader38 ], [ %.lobit59, %.preheader40 ]
  %46 = phi i64 [ %87, %.preheader38 ], [ %.lobit58, %.preheader40 ]
  %47 = phi i64 [ %84, %.preheader38 ], [ %.lobit57, %.preheader40 ]
  %.03444 = phi i64 [ %121, %.preheader38 ], [ 1, %.preheader40 ]
  %48 = add nsw i64 %.03444, -1
  %49 = getelementptr inbounds [200100 x i64], ptr @a, i64 0, i64 %.03444
  %50 = load i64, ptr %49, align 8, !tbaa !8
  %51 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %48, i64 0
  %52 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %.03444, i64 0
  %53 = lshr i64 %50, 1
  %54 = load <2 x i64>, ptr %51, align 8, !tbaa !8
  %55 = insertelement <2 x i64> poison, i64 %50, i64 0
  %56 = insertelement <2 x i64> %55, i64 %53, i64 1
  %57 = and <2 x i64> %56, <i64 1, i64 1>
  %58 = add nsw <2 x i64> %54, %57
  store <2 x i64> %58, ptr %52, align 8, !tbaa !8
  %59 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %48, i64 2
  %60 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %.03444, i64 2
  %61 = load <2 x i64>, ptr %59, align 8, !tbaa !8
  %62 = shufflevector <2 x i64> %55, <2 x i64> poison, <2 x i32> zeroinitializer
  %63 = lshr <2 x i64> %62, <i64 2, i64 3>
  %64 = and <2 x i64> %63, <i64 1, i64 1>
  %65 = add nsw <2 x i64> %61, %64
  store <2 x i64> %65, ptr %60, align 8, !tbaa !8
  %66 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %48, i64 4
  %67 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %.03444, i64 4
  %68 = load <2 x i64>, ptr %66, align 8, !tbaa !8
  %69 = lshr <2 x i64> %62, <i64 4, i64 5>
  %70 = and <2 x i64> %69, <i64 1, i64 1>
  %71 = add nsw <2 x i64> %68, %70
  store <2 x i64> %71, ptr %67, align 8, !tbaa !8
  %72 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %48, i64 6
  %73 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %.03444, i64 6
  %74 = load <2 x i64>, ptr %72, align 8, !tbaa !8
  %75 = lshr <2 x i64> %62, <i64 6, i64 7>
  %76 = and <2 x i64> %75, <i64 1, i64 1>
  %77 = add nsw <2 x i64> %74, %76
  store <2 x i64> %77, ptr %73, align 8, !tbaa !8
  %78 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %48, i64 8
  %79 = load i64, ptr %78, align 8, !tbaa !8
  %80 = lshr i64 %50, 8
  %.lobit76 = and i64 %80, 1
  %81 = add nsw i64 %79, %.lobit76
  %82 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %.03444, i64 8
  store i64 %81, ptr %82, align 8, !tbaa !8
  %83 = lshr i64 %50, 9
  %.lobit77 = and i64 %83, 1
  %84 = add nuw nsw i64 %47, %.lobit77
  %85 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %.03444, i64 9
  store i64 %84, ptr %85, align 8, !tbaa !8
  %86 = lshr i64 %50, 10
  %.lobit78 = and i64 %86, 1
  %87 = add nuw nsw i64 %46, %.lobit78
  %88 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %.03444, i64 10
  store i64 %87, ptr %88, align 8, !tbaa !8
  %89 = lshr i64 %50, 11
  %.lobit79 = and i64 %89, 1
  %90 = add nuw nsw i64 %45, %.lobit79
  %91 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %.03444, i64 11
  store i64 %90, ptr %91, align 8, !tbaa !8
  %92 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %48, i64 12
  %93 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %.03444, i64 12
  %94 = load <2 x i64>, ptr %92, align 8, !tbaa !8
  %95 = lshr <2 x i64> %62, <i64 12, i64 13>
  %96 = and <2 x i64> %95, <i64 1, i64 1>
  %97 = add nsw <2 x i64> %94, %96
  store <2 x i64> %97, ptr %93, align 8, !tbaa !8
  %98 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %48, i64 14
  %99 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %.03444, i64 14
  %100 = load <2 x i64>, ptr %98, align 8, !tbaa !8
  %101 = lshr <2 x i64> %62, <i64 14, i64 15>
  %102 = and <2 x i64> %101, <i64 1, i64 1>
  %103 = add nsw <2 x i64> %100, %102
  store <2 x i64> %103, ptr %99, align 8, !tbaa !8
  %104 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %48, i64 16
  %105 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %.03444, i64 16
  %106 = load <2 x i64>, ptr %104, align 8, !tbaa !8
  %107 = lshr <2 x i64> %62, <i64 16, i64 17>
  %108 = and <2 x i64> %107, <i64 1, i64 1>
  %109 = add nsw <2 x i64> %106, %108
  store <2 x i64> %109, ptr %105, align 8, !tbaa !8
  %110 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %48, i64 18
  %111 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %.03444, i64 18
  %112 = load <2 x i64>, ptr %110, align 8, !tbaa !8
  %113 = lshr <2 x i64> %62, <i64 18, i64 19>
  %114 = and <2 x i64> %113, <i64 1, i64 1>
  %115 = add nsw <2 x i64> %112, %114
  store <2 x i64> %115, ptr %111, align 8, !tbaa !8
  %116 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %48, i64 20
  %117 = load i64, ptr %116, align 8, !tbaa !8
  %118 = lshr i64 %50, 20
  %.lobit88 = and i64 %118, 1
  %119 = add nsw i64 %117, %.lobit88
  %120 = getelementptr inbounds [200100 x [21 x i64]], ptr @sum, i64 0, i64 %.03444, i64 20
  store i64 %119, ptr %120, align 8, !tbaa !8
  %121 = add nuw nsw i64 %.03444, 1
  %exitcond.not = icmp eq i64 %121, %.lcssa
  br i1 %exitcond.not, label %.preheader37.loopexit, label %.preheader38, !llvm.loop !13

.preheader37.loopexit:                            ; preds = %.preheader38
  %.pre = load i64, ptr @n, align 8, !tbaa !8
  br label %.preheader37

.preheader37:                                     ; preds = %.preheader37.loopexit, %.preheader40
  %122 = phi i64 [ %.pre, %.preheader37.loopexit ], [ %.lcssa, %.preheader40 ]
  %123 = icmp sgt i64 %122, 0
  br i1 %123, label %.preheader, label %.preheader37.._crit_edge_crit_edge

.preheader37.._crit_edge_crit_edge:               ; preds = %.preheader37
  %.pre49 = load i64, ptr @ans, align 8, !tbaa !8
  br label %._crit_edge

.preheader:                                       ; preds = %.preheader37, %134
  %124 = phi i64 [ %135, %134 ], [ %122, %.preheader37 ]
  %.03247 = phi i64 [ %139, %134 ], [ 0, %.preheader37 ]
  br label %128

._crit_edge:                                      ; preds = %134, %.preheader37.._crit_edge_crit_edge
  %125 = phi i64 [ %.pre49, %.preheader37.._crit_edge_crit_edge ], [ %138, %134 ]
  %126 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %125)
  %127 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %126, i8 noundef signext 10)
  ret i32 0

128:                                              ; preds = %.preheader, %128
  %.02946 = phi i64 [ %124, %.preheader ], [ %.1, %128 ]
  %.03045 = phi i64 [ %.03247, %.preheader ], [ %.131, %128 ]
  %129 = add nsw i64 %.02946, %.03045
  %130 = sdiv i64 %129, 2
  %131 = tail call noundef i64 @_Z1fxx(i64 noundef %.03247, i64 noundef %130)
  %.not = icmp eq i64 %131, 0
  %132 = add nsw i64 %130, 1
  %.131 = select i1 %.not, i64 %132, i64 %.03045
  %.1 = select i1 %.not, i64 %.02946, i64 %130
  %133 = icmp slt i64 %.131, %.1
  br i1 %133, label %128, label %134, !llvm.loop !14

134:                                              ; preds = %128
  %135 = load i64, ptr @n, align 8, !tbaa !8
  %136 = sub i64 %135, %.1
  %137 = load i64, ptr @ans, align 8, !tbaa !8
  %138 = add nsw i64 %136, %137
  store i64 %138, ptr @ans, align 8, !tbaa !8
  %139 = add nuw nsw i64 %.03247, 1
  %140 = icmp slt i64 %139, %135
  br i1 %140, label %.preheader, label %._crit_edge, !llvm.loop !15
}

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

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

; 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 #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) 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 #3 align 2

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 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 #2 = { "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 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 = { 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" }

!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 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


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