; LLVM IR from VastoLorde95/Competitive-Programming :: Codejam/2015/Round 1B/Problem A (A)

; 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::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"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" }

@t = external dso_local global i64, align 8
@n = external dso_local global i64, align 8
@dp = external dso_local global [10000001 x i64], align 16
@flip = external dso_local global i64, align 8
@memo = external dso_local global %"class.std::unordered_map", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z6flipitx(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 uwtable
declare dso_local noundef i32 @_Z5recurx(i64 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIxxSt4hashIxESt8equal_toIxESaISt4pairIKxxEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @t)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 1, ptr %2, align 8, !tbaa !5
  br label %10

10:                                               ; preds = %17, %0
  %11 = load i64, ptr %2, align 8, !tbaa !5
  %12 = icmp sle i64 %11, 2000000
  br i1 %12, label %14, label %13

13:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %20

14:                                               ; preds = %10
  %15 = load i64, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %15
  store i64 100000000, ptr %16, align 8, !tbaa !5
  br label %17

17:                                               ; preds = %14
  %18 = load i64, ptr %2, align 8, !tbaa !5
  %19 = add nsw i64 %18, 1
  store i64 %19, ptr %2, align 8, !tbaa !5
  br label %10, !llvm.loop !9

20:                                               ; preds = %13
  store i64 1, ptr getelementptr inbounds ([10000001 x i64], ptr @dp, i64 0, i64 1), align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  store i64 2, ptr %3, align 8, !tbaa !5
  br label %21

21:                                               ; preds = %58, %20
  %22 = load i64, ptr %3, align 8, !tbaa !5
  %23 = icmp sle i64 %22, 2000000
  br i1 %23, label %25, label %24

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

25:                                               ; preds = %21
  %26 = load i64, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %28 = load i64, ptr %3, align 8, !tbaa !5
  %29 = sub nsw i64 %28, 1
  %30 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %29
  %31 = load i64, ptr %30, align 8, !tbaa !5
  %32 = add nsw i64 %31, 1
  store i64 %32, ptr %4, align 8, !tbaa !5
  %33 = 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)
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(8) %33)
  %35 = load i64, ptr %34, align 8, !tbaa !5
  %36 = load i64, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %36
  store i64 %35, ptr %37, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  %38 = load i64, ptr %3, align 8, !tbaa !5
  %39 = call noundef i64 @_Z6flipitx(i64 noundef %38)
  store i64 %39, ptr @flip, align 8, !tbaa !5
  %40 = load i64, ptr @flip, align 8, !tbaa !5
  %41 = load i64, ptr %3, align 8, !tbaa !5
  %42 = icmp sgt i64 %40, %41
  br i1 %42, label %43, label %57

43:                                               ; preds = %25
  %44 = load i64, ptr @flip, align 8, !tbaa !5
  %45 = icmp sle i64 %44, 2000000
  br i1 %45, label %46, label %57

46:                                               ; preds = %43
  %47 = load i64, ptr @flip, align 8, !tbaa !5
  %48 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %49 = load i64, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %49
  %51 = load i64, ptr %50, align 8, !tbaa !5
  %52 = add nsw i64 %51, 1
  store i64 %52, ptr %5, align 8, !tbaa !5
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %54 = load i64, ptr %53, align 8, !tbaa !5
  %55 = load i64, ptr @flip, align 8, !tbaa !5
  %56 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %55
  store i64 %54, ptr %56, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %57

57:                                               ; preds = %46, %43, %25
  br label %58

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

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

62:                                               ; preds = %71, %61
  %63 = load i64, ptr %6, align 8, !tbaa !5
  %64 = icmp sle i64 %63, 2000000
  br i1 %64, label %66, label %65

65:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %74

66:                                               ; preds = %62
  %67 = load i64, ptr %6, align 8, !tbaa !5
  %68 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %67
  %69 = load i64, ptr %68, align 8, !tbaa !5
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIxxSt4hashIxESt8equal_toIxESaISt4pairIKxxEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @memo, ptr noundef nonnull align 8 dereferenceable(8) %6)
  store i64 %69, ptr %70, align 8, !tbaa !5
  br label %71

71:                                               ; preds = %66
  %72 = load i64, ptr %6, align 8, !tbaa !5
  %73 = add nsw i64 %72, 1
  store i64 %73, ptr %6, align 8, !tbaa !5
  br label %62, !llvm.loop !12

74:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 1, ptr %7, align 4, !tbaa !13
  br label %75

75:                                               ; preds = %89, %74
  %76 = load i32, ptr %7, align 4, !tbaa !13
  %77 = icmp sle i32 %76, 100000
  br i1 %77, label %79, label %78

78:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %92

79:                                               ; preds = %75
  %80 = load i32, ptr %7, align 4, !tbaa !13
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %80)
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %81, ptr noundef @.str)
  %83 = load i32, ptr %7, align 4, !tbaa !13
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %84
  %86 = load i64, ptr %85, align 8, !tbaa !5
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %82, i64 noundef %86)
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %87, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %89

89:                                               ; preds = %79
  %90 = load i32, ptr %7, align 4, !tbaa !13
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %7, align 4, !tbaa !13
  br label %75, !llvm.loop !15

92:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 1, ptr %8, align 8, !tbaa !5
  br label %93

93:                                               ; preds = %108, %92
  %94 = load i64, ptr %8, align 8, !tbaa !5
  %95 = load i64, ptr @t, align 8, !tbaa !5
  %96 = icmp sle i64 %94, %95
  br i1 %96, label %98, label %97

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

98:                                               ; preds = %93
  %99 = 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)
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  %101 = load i64, ptr %8, align 8, !tbaa !5
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %100, i64 noundef %101)
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %102, ptr noundef @.str.3)
  %104 = load i64, ptr @n, align 8, !tbaa !5
  %105 = call noundef i32 @_Z5recurx(i64 noundef %104)
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %103, i32 noundef %105)
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %106, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %108

108:                                              ; preds = %98
  %109 = load i64, ptr %8, align 8, !tbaa !5
  %110 = add nsw i64 %109, 1
  store i64 %110, ptr %8, align 8, !tbaa !5
  br label %93, !llvm.loop !16

111:                                              ; preds = %97
  ret i32 0
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #6

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #2 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) #2 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)) #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 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 = { 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 #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 = { "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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!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::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"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" }

@t = external dso_local global i64, align 8
@n = external dso_local global i64, align 8
@dp = external dso_local global [10000001 x i64], align 16
@flip = external dso_local local_unnamed_addr global i64, align 8
@memo = external dso_local global %"class.std::unordered_map", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z6flipitx(i64 noundef) 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 uwtable
declare dso_local noundef i32 @_Z5recurx(i64 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
vector.ph:
  %0 = alloca i64, align 8
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = 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) @t)
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next.4, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %5 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %offset.idx
  %6 = getelementptr inbounds i8, ptr %5, i64 16
  store <2 x i64> <i64 100000000, i64 100000000>, ptr %5, align 8, !tbaa !5
  store <2 x i64> <i64 100000000, i64 100000000>, ptr %6, align 8, !tbaa !5
  %offset.idx.1 = add nuw nsw i64 %index, 5
  %7 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %offset.idx.1
  %8 = getelementptr inbounds i8, ptr %7, i64 16
  store <2 x i64> <i64 100000000, i64 100000000>, ptr %7, align 8, !tbaa !5
  store <2 x i64> <i64 100000000, i64 100000000>, ptr %8, align 8, !tbaa !5
  %offset.idx.2 = add nuw nsw i64 %index, 9
  %9 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %offset.idx.2
  %10 = getelementptr inbounds i8, ptr %9, i64 16
  store <2 x i64> <i64 100000000, i64 100000000>, ptr %9, align 8, !tbaa !5
  store <2 x i64> <i64 100000000, i64 100000000>, ptr %10, align 8, !tbaa !5
  %offset.idx.3 = add nuw nsw i64 %index, 13
  %11 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %offset.idx.3
  %12 = getelementptr inbounds i8, ptr %11, i64 16
  store <2 x i64> <i64 100000000, i64 100000000>, ptr %11, align 8, !tbaa !5
  store <2 x i64> <i64 100000000, i64 100000000>, ptr %12, align 8, !tbaa !5
  %offset.idx.4 = add nuw nsw i64 %index, 17
  %13 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %offset.idx.4
  %14 = getelementptr inbounds i8, ptr %13, i64 16
  store <2 x i64> <i64 100000000, i64 100000000>, ptr %13, align 8, !tbaa !5
  store <2 x i64> <i64 100000000, i64 100000000>, ptr %14, align 8, !tbaa !5
  %index.next.4 = add nuw nsw i64 %index, 20
  %15 = icmp eq i64 %index.next.4, 2000000
  br i1 %15, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  store i64 1, ptr getelementptr inbounds (i8, ptr @dp, i64 8), align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %0) #7
  store i64 2, ptr %0, align 8, !tbaa !5
  br label %17

16:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %0) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  store i64 1, ptr %3, align 8, !tbaa !5
  br label %46

17:                                               ; preds = %middle.block, %41
  %storemerge18 = phi i64 [ 2, %middle.block ], [ %43, %41 ]
  %18 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %storemerge18
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  %19 = add nsw i64 %storemerge18, -1
  %20 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %19
  %21 = load i64, ptr %20, align 8, !tbaa !5
  %22 = add nsw i64 %21, 1
  store i64 %22, ptr %1, align 8, !tbaa !5
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %23)
  %25 = load i64, ptr %24, align 8, !tbaa !5
  %26 = load i64, ptr %0, align 8, !tbaa !5
  %27 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %26
  store i64 %25, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  %28 = call noundef i64 @_Z6flipitx(i64 noundef %26)
  store i64 %28, ptr @flip, align 8, !tbaa !5
  %29 = load i64, ptr %0, align 8, !tbaa !5
  %30 = icmp sgt i64 %28, %29
  %31 = icmp slt i64 %28, 2000001
  %or.cond = and i1 %31, %30
  br i1 %or.cond, label %32, label %41

32:                                               ; preds = %17
  %33 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %28
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %34 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %29
  %35 = load i64, ptr %34, align 8, !tbaa !5
  %36 = add nsw i64 %35, 1
  store i64 %36, ptr %2, align 8, !tbaa !5
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %38 = load i64, ptr %37, align 8, !tbaa !5
  %39 = load i64, ptr @flip, align 8, !tbaa !5
  %40 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %39
  store i64 %38, ptr %40, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %.pre = load i64, ptr %0, align 8, !tbaa !5
  br label %41

41:                                               ; preds = %17, %32
  %42 = phi i64 [ %29, %17 ], [ %.pre, %32 ]
  %43 = add nsw i64 %42, 1
  store i64 %43, ptr %0, align 8, !tbaa !5
  %44 = icmp slt i64 %42, 2000000
  br i1 %44, label %17, label %16, !llvm.loop !13

45:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %54

46:                                               ; preds = %16, %46
  %storemerge1619 = phi i64 [ 1, %16 ], [ %51, %46 ]
  %47 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %storemerge1619
  %48 = load i64, ptr %47, align 8, !tbaa !5
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIxxSt4hashIxESt8equal_toIxESaISt4pairIKxxEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @memo, ptr noundef nonnull align 8 dereferenceable(8) %3)
  store i64 %48, ptr %49, align 8, !tbaa !5
  %50 = load i64, ptr %3, align 8, !tbaa !5
  %51 = add nsw i64 %50, 1
  store i64 %51, ptr %3, align 8, !tbaa !5
  %52 = icmp slt i64 %50, 2000000
  br i1 %52, label %46, label %45, !llvm.loop !14

.preheader:                                       ; preds = %54
  %53 = load i64, ptr @t, align 8, !tbaa !5
  %.not21 = icmp slt i64 %53, 1
  br i1 %.not21, label %._crit_edge, label %.lr.ph

54:                                               ; preds = %45, %54
  %indvars.iv = phi i64 [ 1, %45 ], [ %indvars.iv.next, %54 ]
  %55 = trunc nuw nsw i64 %indvars.iv to i32
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %55)
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %56, ptr noundef nonnull @.str)
  %58 = getelementptr inbounds [10000001 x i64], ptr @dp, i64 0, i64 %indvars.iv
  %59 = load i64, ptr %58, align 8, !tbaa !5
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %57, i64 noundef %59)
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond24.not = icmp eq i64 %indvars.iv.next, 100001
  br i1 %exitcond24.not, label %.preheader, label %54, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  ret i32 0

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %.022 = phi i64 [ %70, %.lr.ph ], [ 1, %.preheader ]
  %62 = 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)
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.2)
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %63, i64 noundef %.022)
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef nonnull @.str.3)
  %66 = load i64, ptr @n, align 8, !tbaa !5
  %67 = call noundef i32 @_Z5recurx(i64 noundef %66)
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %65, i32 noundef %67)
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %68, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %70 = add nuw nsw i64 %.022, 1
  %71 = load i64, ptr @t, align 8, !tbaa !5
  %.not.not = icmp slt i64 %.022, %71
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !16
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) 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 #2 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 #2 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)) #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 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 = { 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 #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 = { "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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass