; LLVM IR from eyangch/competitive-programming :: USACOcontests/gold/2017.02 (circlecross)

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

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z3getxRA200001_x(i64 noundef, ptr noundef nonnull align 8 dereferenceable(1600008)) #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 nounwind uwtable
declare dso_local void @_Z3updxxxRA200001_x(i64 noundef, i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(1600008)) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca [200001 x i64], align 16
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %12 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %13 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %14 = getelementptr i8, ptr %13, i64 -24
  %15 = load i64, ptr %14, align 8
  %16 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %15
  %17 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %16, ptr noundef null)
  %18 = load ptr, ptr @stdin, align 8, !tbaa !8
  %19 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %18)
  %20 = load ptr, ptr @stdout, align 8, !tbaa !8
  %21 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %20)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  %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) %2)
  %23 = load i64, ptr %2, align 8, !tbaa !11
  %24 = mul nsw i64 2, %23
  %25 = call ptr @llvm.stacksave.p0()
  store ptr %25, ptr %3, align 8
  %26 = alloca i64, i64 %24, align 16
  store i64 %24, ptr %4, align 8
  %27 = load i64, ptr %2, align 8, !tbaa !11
  %28 = alloca i64, i64 %27, align 16
  store i64 %27, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 1600008, ptr %6) #7
  %29 = load i64, ptr %2, align 8, !tbaa !11
  %30 = getelementptr inbounds i64, ptr %28, i64 %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 -1, ptr %7, align 4, !tbaa !13
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef %28, ptr noundef %30, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !11
  br label %31

31:                                               ; preds = %58, %0
  %32 = load i64, ptr %8, align 8, !tbaa !11
  %33 = load i64, ptr %2, align 8, !tbaa !11
  %34 = mul nsw i64 2, %33
  %35 = icmp slt i64 %32, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %61

37:                                               ; preds = %31
  %38 = load i64, ptr %8, align 8, !tbaa !11
  %39 = getelementptr inbounds i64, ptr %26, i64 %38
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %39)
  %41 = load i64, ptr %8, align 8, !tbaa !11
  %42 = getelementptr inbounds i64, ptr %26, i64 %41
  %43 = load i64, ptr %42, align 8, !tbaa !11
  %44 = add nsw i64 %43, -1
  store i64 %44, ptr %42, align 8, !tbaa !11
  %45 = load i64, ptr %8, align 8, !tbaa !11
  %46 = getelementptr inbounds i64, ptr %26, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !11
  %48 = getelementptr inbounds i64, ptr %28, i64 %47
  %49 = load i64, ptr %48, align 8, !tbaa !11
  %50 = icmp slt i64 %49, 0
  br i1 %50, label %51, label %57

51:                                               ; preds = %37
  %52 = load i64, ptr %8, align 8, !tbaa !11
  %53 = load i64, ptr %8, align 8, !tbaa !11
  %54 = getelementptr inbounds i64, ptr %26, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !11
  %56 = getelementptr inbounds i64, ptr %28, i64 %55
  store i64 %52, ptr %56, align 8, !tbaa !11
  br label %57

57:                                               ; preds = %51, %37
  br label %58

58:                                               ; preds = %57
  %59 = load i64, ptr %8, align 8, !tbaa !11
  %60 = add nsw i64 %59, 1
  store i64 %60, ptr %8, align 8, !tbaa !11
  br label %31, !llvm.loop !15

61:                                               ; preds = %36
  %62 = getelementptr inbounds [200001 x i64], ptr %6, i64 0, i64 0
  %63 = getelementptr inbounds [200001 x i64], ptr %6, i64 0, i64 0
  %64 = load i64, ptr %2, align 8, !tbaa !11
  %65 = mul nsw i64 2, %64
  %66 = getelementptr inbounds i64, ptr %63, i64 %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !13
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef %62, ptr noundef %66, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 0, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store i64 0, ptr %11, align 8, !tbaa !11
  br label %67

67:                                               ; preds = %107, %61
  %68 = load i64, ptr %11, align 8, !tbaa !11
  %69 = load i64, ptr %2, align 8, !tbaa !11
  %70 = mul nsw i64 2, %69
  %71 = icmp slt i64 %68, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %110

73:                                               ; preds = %67
  %74 = load i64, ptr %11, align 8, !tbaa !11
  %75 = getelementptr inbounds i64, ptr %26, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !11
  %77 = getelementptr inbounds i64, ptr %28, i64 %76
  %78 = load i64, ptr %77, align 8, !tbaa !11
  %79 = load i64, ptr %11, align 8, !tbaa !11
  %80 = icmp eq i64 %78, %79
  br i1 %80, label %81, label %85

81:                                               ; preds = %73
  %82 = load i64, ptr %11, align 8, !tbaa !11
  %83 = add nsw i64 %82, 1
  %84 = load i64, ptr %2, align 8, !tbaa !11
  call void @_Z3updxxxRA200001_x(i64 noundef %83, i64 noundef 1, i64 noundef %84, ptr noundef nonnull align 8 dereferenceable(1600008) %6)
  br label %106

85:                                               ; preds = %73
  %86 = load i64, ptr %11, align 8, !tbaa !11
  %87 = getelementptr inbounds i64, ptr %26, i64 %86
  %88 = load i64, ptr %87, align 8, !tbaa !11
  %89 = getelementptr inbounds i64, ptr %28, i64 %88
  %90 = load i64, ptr %89, align 8, !tbaa !11
  %91 = add nsw i64 %90, 1
  %92 = load i64, ptr %2, align 8, !tbaa !11
  call void @_Z3updxxxRA200001_x(i64 noundef %91, i64 noundef -1, i64 noundef %92, ptr noundef nonnull align 8 dereferenceable(1600008) %6)
  %93 = load i64, ptr %11, align 8, !tbaa !11
  %94 = add nsw i64 %93, 1
  %95 = call noundef i64 @_Z3getxRA200001_x(i64 noundef %94, ptr noundef nonnull align 8 dereferenceable(1600008) %6)
  %96 = load i64, ptr %11, align 8, !tbaa !11
  %97 = getelementptr inbounds i64, ptr %26, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !11
  %99 = getelementptr inbounds i64, ptr %28, i64 %98
  %100 = load i64, ptr %99, align 8, !tbaa !11
  %101 = add nsw i64 %100, 1
  %102 = call noundef i64 @_Z3getxRA200001_x(i64 noundef %101, ptr noundef nonnull align 8 dereferenceable(1600008) %6)
  %103 = sub nsw i64 %95, %102
  %104 = load i64, ptr %10, align 8, !tbaa !11
  %105 = add nsw i64 %104, %103
  store i64 %105, ptr %10, align 8, !tbaa !11
  br label %106

106:                                              ; preds = %85, %81
  br label %107

107:                                              ; preds = %106
  %108 = load i64, ptr %11, align 8, !tbaa !11
  %109 = add nsw i64 %108, 1
  store i64 %109, ptr %11, align 8, !tbaa !11
  br label %67, !llvm.loop !17

110:                                              ; preds = %72
  %111 = load i64, ptr %10, align 8, !tbaa !11
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %111)
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %112, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 1600008, ptr %6) #7
  %114 = load ptr, ptr %3, align 8
  call void @llvm.stackrestore.p0(ptr %114)
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  %115 = load i32, ptr %1, align 4
  ret i32 %115
}

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

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #3

; 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
declare ptr @llvm.stacksave.p0() #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #6

; 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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 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)) #6

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5

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 = { nocallback nofree nosync nounwind willreturn }
attributes #6 = { 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 #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 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !10, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !10, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


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

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; 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 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 void @_Z3updxxxRA200001_x(i64 noundef, i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(1600008)) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i64, align 8
  %2 = alloca [200001 x i64], align 16
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %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 @stdin, align 8, !tbaa !8
  %12 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %11)
  %13 = load ptr, ptr @stdout, align 8, !tbaa !8
  %14 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %13)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %16 = load i64, ptr %1, align 8, !tbaa !11
  %17 = shl nsw i64 %16, 1
  %18 = call ptr @llvm.stacksave.p0()
  %19 = alloca i64, i64 %17, align 16
  %20 = load i64, ptr %1, align 8, !tbaa !11
  %21 = alloca i64, i64 %20, align 16
  call void @llvm.lifetime.start.p0(i64 1600008, ptr nonnull %2) #7
  %22 = getelementptr inbounds i64, ptr %21, i64 %20
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 -1, ptr %3, align 4, !tbaa !13
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull %21, ptr noundef nonnull %22, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %23 = load i64, ptr %1, align 8, !tbaa !11
  %24 = shl nsw i64 %23, 1
  %25 = icmp sgt i64 %23, 0
  br i1 %25, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %37, %0
  %.lcssa = phi i64 [ %24, %0 ], [ %40, %37 ]
  %26 = getelementptr inbounds i64, ptr %2, i64 %.lcssa
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 0, ptr %4, align 4, !tbaa !13
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull %2, ptr noundef nonnull %26, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %27 = load i64, ptr %1, align 8, !tbaa !11
  %28 = icmp sgt i64 %27, 0
  br i1 %28, label %.lr.ph26, label %._crit_edge27

.lr.ph:                                           ; preds = %0, %37
  %.01922 = phi i64 [ %38, %37 ], [ 0, %0 ]
  %29 = getelementptr inbounds i64, ptr %19, i64 %.01922
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %29)
  %31 = load i64, ptr %29, align 8, !tbaa !11
  %32 = add nsw i64 %31, -1
  store i64 %32, ptr %29, align 8, !tbaa !11
  %33 = getelementptr inbounds i64, ptr %21, i64 %32
  %34 = load i64, ptr %33, align 8, !tbaa !11
  %35 = icmp slt i64 %34, 0
  br i1 %35, label %36, label %37

36:                                               ; preds = %.lr.ph
  store i64 %.01922, ptr %33, align 8, !tbaa !11
  br label %37

37:                                               ; preds = %.lr.ph, %36
  %38 = add nuw nsw i64 %.01922, 1
  %39 = load i64, ptr %1, align 8, !tbaa !11
  %40 = shl nsw i64 %39, 1
  %41 = icmp slt i64 %38, %40
  br i1 %41, label %.lr.ph, label %._crit_edge, !llvm.loop !15

._crit_edge27:                                    ; preds = %63, %._crit_edge
  %.018.lcssa = phi i64 [ 0, %._crit_edge ], [ %.1, %63 ]
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.018.lcssa)
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 1600008, ptr nonnull %2) #7
  call void @llvm.stackrestore.p0(ptr %18)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0

.lr.ph26:                                         ; preds = %._crit_edge, %63
  %44 = phi i64 [ %64, %63 ], [ %27, %._crit_edge ]
  %.024 = phi i64 [ %.pre-phi, %63 ], [ 0, %._crit_edge ]
  %.01823 = phi i64 [ %.1, %63 ], [ 0, %._crit_edge ]
  %45 = getelementptr inbounds i64, ptr %19, i64 %.024
  %46 = load i64, ptr %45, align 8, !tbaa !11
  %47 = getelementptr inbounds i64, ptr %21, i64 %46
  %48 = load i64, ptr %47, align 8, !tbaa !11
  %49 = icmp eq i64 %48, %.024
  br i1 %49, label %50, label %52

50:                                               ; preds = %.lr.ph26
  %51 = add nuw nsw i64 %.024, 1
  call void @_Z3updxxxRA200001_x(i64 noundef %51, i64 noundef 1, i64 noundef %44, ptr noundef nonnull align 8 dereferenceable(1600008) %2)
  br label %63

52:                                               ; preds = %.lr.ph26
  %53 = add nsw i64 %48, 1
  call void @_Z3updxxxRA200001_x(i64 noundef %53, i64 noundef -1, i64 noundef %44, ptr noundef nonnull align 8 dereferenceable(1600008) %2)
  %54 = add nuw nsw i64 %.024, 1
  %55 = call noundef i64 @_Z3getxRA200001_x(i64 noundef %54, ptr noundef nonnull align 8 dereferenceable(1600008) %2)
  %56 = load i64, ptr %45, align 8, !tbaa !11
  %57 = getelementptr inbounds i64, ptr %21, i64 %56
  %58 = load i64, ptr %57, align 8, !tbaa !11
  %59 = add nsw i64 %58, 1
  %60 = call noundef i64 @_Z3getxRA200001_x(i64 noundef %59, ptr noundef nonnull align 8 dereferenceable(1600008) %2)
  %61 = add i64 %55, %.01823
  %62 = sub i64 %61, %60
  br label %63

63:                                               ; preds = %50, %52
  %.pre-phi = phi i64 [ %51, %50 ], [ %54, %52 ]
  %.1 = phi i64 [ %.01823, %50 ], [ %62, %52 ]
  %64 = load i64, ptr %1, align 8, !tbaa !11
  %65 = shl nsw i64 %64, 1
  %66 = icmp slt i64 %.pre-phi, %65
  br i1 %66, label %.lr.ph26, label %._crit_edge27, !llvm.loop !17
}

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

; 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

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; 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
declare ptr @llvm.stacksave.p0() #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #6

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

; 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 #4 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)) #6

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5

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 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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #6 = { 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 #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 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !10, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !10, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


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