; LLVM IR from Tunghohin/Competitive_Coding :: Codeforces/cf1775_C.ll (Z5solvev)

; 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" }
%"class.std::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { i64 }
%"class.std::bitset<64>::reference" = type { ptr, i64 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::bitset", align 8
  %4 = alloca %"class.std::bitset", align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::bitset<64>::reference", align 8
  %10 = alloca %"class.std::bitset<64>::reference", align 8
  %11 = alloca i1, align 1
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i1, align 1
  %15 = alloca %"class.std::bitset<64>::reference", align 8
  %16 = alloca %"class.std::bitset<64>::reference", align 8
  %17 = alloca i1, align 1
  %18 = alloca i1, align 1
  %19 = alloca %"class.std::bitset<64>::reference", align 8
  %20 = alloca %"class.std::bitset<64>::reference", align 8
  %21 = alloca i1, align 1
  %22 = alloca i1, align 1
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %25 = 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)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %27 = load i64, ptr %1, align 8, !tbaa !5
  call void @_ZNSt6bitsetILm64EEC2Ey(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %27) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %28 = load i64, ptr %2, align 8, !tbaa !5
  call void @_ZNSt6bitsetILm64EEC2Ey(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef %28) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %29 = load i64, ptr %1, align 8, !tbaa !5
  store i64 %29, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 4611686018427387904, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !5
  br label %30

30:                                               ; preds = %126, %0
  %31 = load i64, ptr %7, align 8, !tbaa !5
  %32 = icmp sle i64 %31, 63
  br i1 %32, label %34, label %33

33:                                               ; preds = %30
  store i32 2, ptr %8, align 4
  br label %129

34:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #6
  %35 = load i64, ptr %7, align 8, !tbaa !5
  call void @_ZNSt6bitsetILm64EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<64>::reference") align 8 %9, ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %35)
  %36 = call noundef zeroext i1 @_ZNKSt6bitsetILm64EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %9) #6
  store i1 false, ptr %11, align 1
  store i1 false, ptr %14, align 1
  br i1 %36, label %42, label %37

37:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #6
  store i1 true, ptr %11, align 1
  %38 = load i64, ptr %7, align 8, !tbaa !5
  invoke void @_ZNSt6bitsetILm64EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<64>::reference") align 8 %10, ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef %38)
          to label %39 unwind label %51

39:                                               ; preds = %37
  store i1 true, ptr %14, align 1
  %40 = call noundef zeroext i1 @_ZNKSt6bitsetILm64EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %10) #6
  %41 = xor i1 %40, true
  br label %42

42:                                               ; preds = %39, %34
  %43 = phi i1 [ false, %34 ], [ %41, %39 ]
  %44 = load i1, ptr %14, align 1
  br i1 %44, label %45, label %46

45:                                               ; preds = %42
  call void @_ZNSt6bitsetILm64EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #6
  br label %46

46:                                               ; preds = %45, %42
  %47 = load i1, ptr %11, align 1
  br i1 %47, label %48, label %49

48:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  br label %49

49:                                               ; preds = %48, %46
  call void @_ZNSt6bitsetILm64EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  br i1 %43, label %50, label %58

50:                                               ; preds = %49
  br label %126

51:                                               ; preds = %37
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %12, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %13, align 4
  %55 = load i1, ptr %11, align 1
  br i1 %55, label %56, label %57

56:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  br label %57

57:                                               ; preds = %56, %51
  call void @_ZNSt6bitsetILm64EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  br label %131

58:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #6
  %59 = load i64, ptr %7, align 8, !tbaa !5
  call void @_ZNSt6bitsetILm64EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<64>::reference") align 8 %15, ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %59)
  %60 = call noundef zeroext i1 @_ZNKSt6bitsetILm64EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %15) #6
  store i1 false, ptr %17, align 1
  store i1 false, ptr %18, align 1
  br i1 %60, label %65, label %61

61:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #6
  store i1 true, ptr %17, align 1
  %62 = load i64, ptr %7, align 8, !tbaa !5
  invoke void @_ZNSt6bitsetILm64EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<64>::reference") align 8 %16, ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef %62)
          to label %63 unwind label %76

63:                                               ; preds = %61
  store i1 true, ptr %18, align 1
  %64 = call noundef zeroext i1 @_ZNKSt6bitsetILm64EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %16) #6
  br label %65

65:                                               ; preds = %63, %58
  %66 = phi i1 [ false, %58 ], [ %64, %63 ]
  %67 = load i1, ptr %18, align 1
  br i1 %67, label %68, label %69

68:                                               ; preds = %65
  call void @_ZNSt6bitsetILm64EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #6
  br label %69

69:                                               ; preds = %68, %65
  %70 = load i1, ptr %17, align 1
  br i1 %70, label %71, label %72

71:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #6
  br label %72

72:                                               ; preds = %71, %69
  call void @_ZNSt6bitsetILm64EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  br i1 %66, label %73, label %83

73:                                               ; preds = %72
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %74, i8 noundef signext 10)
  store i32 1, ptr %8, align 4
  br label %129

76:                                               ; preds = %61
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %12, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %13, align 4
  %80 = load i1, ptr %17, align 1
  br i1 %80, label %81, label %82

81:                                               ; preds = %76
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #6
  br label %82

82:                                               ; preds = %81, %76
  call void @_ZNSt6bitsetILm64EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  br label %131

83:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #6
  %84 = load i64, ptr %7, align 8, !tbaa !5
  call void @_ZNSt6bitsetILm64EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<64>::reference") align 8 %19, ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %84)
  %85 = call noundef zeroext i1 @_ZNKSt6bitsetILm64EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %19) #6
  store i1 false, ptr %21, align 1
  store i1 false, ptr %22, align 1
  br i1 %85, label %86, label %91

86:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #6
  store i1 true, ptr %21, align 1
  %87 = load i64, ptr %7, align 8, !tbaa !5
  invoke void @_ZNSt6bitsetILm64EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<64>::reference") align 8 %20, ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef %87)
          to label %88 unwind label %108

88:                                               ; preds = %86
  store i1 true, ptr %22, align 1
  %89 = call noundef zeroext i1 @_ZNKSt6bitsetILm64EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %20) #6
  %90 = xor i1 %89, true
  br label %91

91:                                               ; preds = %88, %83
  %92 = phi i1 [ false, %83 ], [ %90, %88 ]
  %93 = load i1, ptr %22, align 1
  br i1 %93, label %94, label %95

94:                                               ; preds = %91
  call void @_ZNSt6bitsetILm64EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #6
  br label %95

95:                                               ; preds = %94, %91
  %96 = load i1, ptr %21, align 1
  br i1 %96, label %97, label %98

97:                                               ; preds = %95
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #6
  br label %98

98:                                               ; preds = %97, %95
  call void @_ZNSt6bitsetILm64EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  br i1 %92, label %99, label %115

99:                                               ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %100 = load i64, ptr %1, align 8, !tbaa !5
  %101 = load i64, ptr %7, align 8, !tbaa !5
  %102 = ashr i64 %100, %101
  %103 = add nsw i64 %102, 1
  %104 = load i64, ptr %7, align 8, !tbaa !5
  %105 = shl i64 %103, %104
  store i64 %105, ptr %23, align 8, !tbaa !5
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %23)
  %107 = load i64, ptr %106, align 8, !tbaa !5
  store i64 %107, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %125

108:                                              ; preds = %86
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %12, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %13, align 4
  %112 = load i1, ptr %21, align 1
  br i1 %112, label %113, label %114

113:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #6
  br label %114

114:                                              ; preds = %113, %108
  call void @_ZNSt6bitsetILm64EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  br label %131

115:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %116 = load i64, ptr %1, align 8, !tbaa !5
  %117 = load i64, ptr %7, align 8, !tbaa !5
  %118 = ashr i64 %116, %117
  %119 = add nsw i64 %118, 1
  %120 = load i64, ptr %7, align 8, !tbaa !5
  %121 = shl i64 %119, %120
  %122 = sub nsw i64 %121, 1
  store i64 %122, ptr %24, align 8, !tbaa !5
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %24)
  %124 = load i64, ptr %123, align 8, !tbaa !5
  store i64 %124, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %125

125:                                              ; preds = %115, %99
  br label %126

126:                                              ; preds = %125, %50
  %127 = load i64, ptr %7, align 8, !tbaa !5
  %128 = add nsw i64 %127, 1
  store i64 %128, ptr %7, align 8, !tbaa !5
  br label %30, !llvm.loop !9

129:                                              ; preds = %73, %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  %130 = load i32, ptr %8, align 4
  switch i32 %130, label %145 [
    i32 2, label %132
  ]

131:                                              ; preds = %114, %82, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #6
  br label %148

132:                                              ; preds = %129
  %133 = load i64, ptr %5, align 8, !tbaa !5
  %134 = load i64, ptr %6, align 8, !tbaa !5
  %135 = icmp sle i64 %133, %134
  br i1 %135, label %136, label %140

136:                                              ; preds = %132
  %137 = load i64, ptr %5, align 8, !tbaa !5
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %137)
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %138, i8 noundef signext 10)
  br label %143

140:                                              ; preds = %132
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %141, i8 noundef signext 10)
  br label %143

143:                                              ; preds = %140, %136
  %144 = phi ptr [ %139, %136 ], [ %142, %140 ]
  store i32 0, ptr %8, align 4
  br label %145

145:                                              ; preds = %143, %129
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #6
  %146 = load i32, ptr %8, align 4
  switch i32 %146, label %153 [
    i32 0, label %147
    i32 1, label %147
  ]

147:                                              ; preds = %145, %145
  ret void

148:                                              ; preds = %131
  %149 = load ptr, ptr %12, align 8
  %150 = load i32, ptr %13, align 4
  %151 = insertvalue { ptr, i32 } poison, ptr %149, 0
  %152 = insertvalue { ptr, i32 } %151, i32 %150, 1
  resume { ptr, i32 } %152

153:                                              ; preds = %145
  unreachable
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm64EEC2Ey(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm64EEixEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset<64>::reference") align 8, ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6bitsetILm64EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm64EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { "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 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 #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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; 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" }
%"class.std::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { i64 }
%"class.std::bitset<64>::reference" = type { ptr, i64 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::bitset", align 8
  %4 = alloca %"class.std::bitset", align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca %"class.std::bitset<64>::reference", align 8
  %8 = alloca %"class.std::bitset<64>::reference", align 8
  %9 = alloca %"class.std::bitset<64>::reference", align 8
  %10 = alloca %"class.std::bitset<64>::reference", align 8
  %11 = alloca %"class.std::bitset<64>::reference", align 8
  %12 = alloca %"class.std::bitset<64>::reference", align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %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 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %17 = load i64, ptr %1, align 8, !tbaa !5
  call void @_ZNSt6bitsetILm64EEC2Ey(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %17) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %18 = load i64, ptr %2, align 8, !tbaa !5
  call void @_ZNSt6bitsetILm64EEC2Ey(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %19 = load i64, ptr %1, align 8, !tbaa !5
  store i64 %19, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  store i64 4611686018427387904, ptr %6, align 8, !tbaa !5
  br label %20

20:                                               ; preds = %0, %46
  %.02434 = phi i64 [ 0, %0 ], [ %47, %46 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  call void @_ZNSt6bitsetILm64EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<64>::reference") align 8 %7, ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %.02434)
  %21 = call noundef zeroext i1 @_ZNKSt6bitsetILm64EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  br i1 %21, label %.critedge.thread, label %.critedge

.critedge.thread:                                 ; preds = %20
  call void @_ZNSt6bitsetILm64EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  br label %23

.critedge:                                        ; preds = %20
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  call void @_ZNSt6bitsetILm64EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<64>::reference") align 8 %8, ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef %.02434)
  %22 = call noundef zeroext i1 @_ZNKSt6bitsetILm64EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  call void @_ZNSt6bitsetILm64EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  call void @_ZNSt6bitsetILm64EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  br i1 %22, label %23, label %46

23:                                               ; preds = %.critedge.thread, %.critedge
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #6
  call void @_ZNSt6bitsetILm64EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<64>::reference") align 8 %9, ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %.02434)
  %24 = call noundef zeroext i1 @_ZNKSt6bitsetILm64EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %9) #6
  br i1 %24, label %.critedge27.thread, label %.critedge27

.critedge27.thread:                               ; preds = %23
  call void @_ZNSt6bitsetILm64EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  br label %28

.critedge27:                                      ; preds = %23
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #6
  call void @_ZNSt6bitsetILm64EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<64>::reference") align 8 %10, ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef %.02434)
  %25 = call noundef zeroext i1 @_ZNKSt6bitsetILm64EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %10) #6
  call void @_ZNSt6bitsetILm64EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  call void @_ZNSt6bitsetILm64EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  br i1 %25, label %26, label %28

26:                                               ; preds = %.critedge27
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  br label %54

28:                                               ; preds = %.critedge27.thread, %.critedge27
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #6
  call void @_ZNSt6bitsetILm64EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<64>::reference") align 8 %11, ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %.02434)
  %29 = call noundef zeroext i1 @_ZNKSt6bitsetILm64EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %11) #6
  br i1 %29, label %.critedge29, label %.critedge29.thread

.critedge29.thread:                               ; preds = %28
  call void @_ZNSt6bitsetILm64EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  br label %38

.critedge29:                                      ; preds = %28
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #6
  call void @_ZNSt6bitsetILm64EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<64>::reference") align 8 %12, ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef %.02434)
  %30 = call noundef zeroext i1 @_ZNKSt6bitsetILm64EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %12) #6
  call void @_ZNSt6bitsetILm64EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  call void @_ZNSt6bitsetILm64EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  br i1 %30, label %38, label %31

31:                                               ; preds = %.critedge29
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  %32 = load i64, ptr %1, align 8, !tbaa !5
  %33 = ashr i64 %32, %.02434
  %34 = add nsw i64 %33, 1
  %35 = shl i64 %34, %.02434
  store i64 %35, ptr %13, align 8, !tbaa !5
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %37 = load i64, ptr %36, align 8, !tbaa !5
  store i64 %37, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  br label %46

38:                                               ; preds = %.critedge29.thread, %.critedge29
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #6
  %39 = load i64, ptr %1, align 8, !tbaa !5
  %40 = ashr i64 %39, %.02434
  %41 = add nsw i64 %40, 1
  %42 = shl i64 %41, %.02434
  %43 = add nsw i64 %42, -1
  store i64 %43, ptr %14, align 8, !tbaa !5
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %45 = load i64, ptr %44, align 8, !tbaa !5
  store i64 %45, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  br label %46

46:                                               ; preds = %31, %38, %.critedge
  %47 = add nuw nsw i64 %.02434, 1
  %exitcond = icmp eq i64 %47, 64
  br i1 %exitcond, label %.critedge31, label %20, !llvm.loop !9

.critedge31:                                      ; preds = %46
  %48 = load i64, ptr %5, align 8, !tbaa !5
  %49 = load i64, ptr %6, align 8, !tbaa !5
  %.not = icmp sgt i64 %48, %49
  br i1 %.not, label %52, label %50

50:                                               ; preds = %.critedge31
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %48)
  br label %54

52:                                               ; preds = %.critedge31
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  br label %54

54:                                               ; preds = %26, %50, %52
  %.sink = phi ptr [ %27, %26 ], [ %51, %50 ], [ %53, %52 ]
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %.sink, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm64EEC2Ey(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm64EEixEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset<64>::reference") align 8, ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6bitsetILm64EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm64EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

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

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

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

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

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

; 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { "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 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 #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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,SROAPass,SimplifyCFGPass