; LLVM IR from VastoLorde95/Competitive-Programming :: SPOJ/Random/LPPP (x)

; 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
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z11isSubsetSumPxxx(ptr noundef, i64 noundef, i64 noundef) #0

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

17:                                               ; preds = %155, %0
  %18 = load i64, ptr %3, align 8, !tbaa !5
  %19 = add nsw i64 %18, 1
  store i64 %19, ptr %3, align 8, !tbaa !5
  %20 = load i64, ptr %2, align 8, !tbaa !5
  %21 = icmp sle i64 %19, %20
  br i1 %21, label %22, label %157

22:                                               ; preds = %17
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %4)
  store i64 3, ptr %5, align 8, !tbaa !5
  %24 = load i64, ptr %4, align 8, !tbaa !5
  %25 = call ptr @llvm.stacksave.p0()
  store ptr %25, ptr %6, align 8
  %26 = alloca i64, i64 %24, align 16
  store i64 %24, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store i64 0, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 0, ptr %9, align 8, !tbaa !5
  br label %27

27:                                               ; preds = %41, %22
  %28 = load i64, ptr %9, align 8, !tbaa !5
  %29 = load i64, ptr %4, align 8, !tbaa !5
  %30 = icmp slt i64 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %44

32:                                               ; preds = %27
  %33 = load i64, ptr %9, align 8, !tbaa !5
  %34 = getelementptr inbounds i64, ptr %26, i64 %33
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %34)
  %36 = load i64, ptr %9, align 8, !tbaa !5
  %37 = getelementptr inbounds i64, ptr %26, i64 %36
  %38 = load i64, ptr %37, align 8, !tbaa !5
  %39 = load i64, ptr %8, align 8, !tbaa !5
  %40 = add nsw i64 %39, %38
  store i64 %40, ptr %8, align 8, !tbaa !5
  br label %41

41:                                               ; preds = %32
  %42 = load i64, ptr %9, align 8, !tbaa !5
  %43 = add nsw i64 %42, 1
  store i64 %43, ptr %9, align 8, !tbaa !5
  br label %27, !llvm.loop !9

44:                                               ; preds = %31
  %45 = load i64, ptr %5, align 8, !tbaa !5
  %46 = icmp eq i64 %45, 1
  br i1 %46, label %47, label %53

47:                                               ; preds = %44
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %49 = load i64, ptr %3, align 8, !tbaa !5
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %48, i64 noundef %49)
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %50, ptr noundef @.str.1)
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %51, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 2, ptr %10, align 4
  br label %155, !llvm.loop !11

53:                                               ; preds = %44
  %54 = load i64, ptr %4, align 8, !tbaa !5
  %55 = load i64, ptr %5, align 8, !tbaa !5
  %56 = icmp slt i64 %54, %55
  br i1 %56, label %57, label %63

57:                                               ; preds = %53
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %59 = load i64, ptr %3, align 8, !tbaa !5
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %58, i64 noundef %59)
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef @.str.2)
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %61, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 2, ptr %10, align 4
  br label %155, !llvm.loop !11

63:                                               ; preds = %53
  br label %64

64:                                               ; preds = %63
  %65 = load i64, ptr %8, align 8, !tbaa !5
  %66 = load i64, ptr %5, align 8, !tbaa !5
  %67 = srem i64 %65, %66
  %68 = icmp ne i64 %67, 0
  br i1 %68, label %69, label %75

69:                                               ; preds = %64
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %71 = load i64, ptr %3, align 8, !tbaa !5
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %70, i64 noundef %71)
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %72, ptr noundef @.str.2)
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %73, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 2, ptr %10, align 4
  br label %155, !llvm.loop !11

75:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %76 = load i64, ptr %8, align 8, !tbaa !5
  %77 = load i64, ptr %5, align 8, !tbaa !5
  %78 = sdiv i64 %76, %77
  store i64 %78, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 0, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store i64 0, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 0, ptr %14, align 8, !tbaa !5
  br label %79

79:                                               ; preds = %104, %75
  %80 = load i64, ptr %14, align 8, !tbaa !5
  %81 = load i64, ptr %4, align 8, !tbaa !5
  %82 = icmp slt i64 %80, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %79
  store i32 7, ptr %10, align 4
  br label %107

84:                                               ; preds = %79
  %85 = load i64, ptr %14, align 8, !tbaa !5
  %86 = getelementptr inbounds i64, ptr %26, i64 %85
  %87 = load i64, ptr %86, align 8, !tbaa !5
  %88 = load i64, ptr %11, align 8, !tbaa !5
  %89 = icmp sgt i64 %87, %88
  br i1 %89, label %90, label %91

90:                                               ; preds = %84
  store i64 1, ptr %12, align 8, !tbaa !5
  store i32 7, ptr %10, align 4
  br label %107

91:                                               ; preds = %84
  %92 = load i64, ptr %14, align 8, !tbaa !5
  %93 = getelementptr inbounds i64, ptr %26, i64 %92
  %94 = load i64, ptr %93, align 8, !tbaa !5
  %95 = load i64, ptr %11, align 8, !tbaa !5
  %96 = icmp eq i64 %94, %95
  br i1 %96, label %97, label %102

97:                                               ; preds = %91
  %98 = load i64, ptr %14, align 8, !tbaa !5
  %99 = getelementptr inbounds i64, ptr %26, i64 %98
  store i64 0, ptr %99, align 8, !tbaa !5
  %100 = load i64, ptr %13, align 8, !tbaa !5
  %101 = add nsw i64 %100, 1
  store i64 %101, ptr %13, align 8, !tbaa !5
  br label %102

102:                                              ; preds = %97, %91
  br label %103

103:                                              ; preds = %102
  br label %104

104:                                              ; preds = %103
  %105 = load i64, ptr %14, align 8, !tbaa !5
  %106 = add nsw i64 %105, 1
  store i64 %106, ptr %14, align 8, !tbaa !5
  br label %79, !llvm.loop !12

107:                                              ; preds = %90, %83
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %108

108:                                              ; preds = %107
  %109 = load i64, ptr %12, align 8, !tbaa !5
  %110 = icmp eq i64 %109, 1
  br i1 %110, label %111, label %117

111:                                              ; preds = %108
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %113 = load i64, ptr %3, align 8, !tbaa !5
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %112, i64 noundef %113)
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %114, ptr noundef @.str.2)
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %115, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 2, ptr %10, align 4
  br label %154, !llvm.loop !11

117:                                              ; preds = %108
  store i64 0, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 0, ptr %15, align 8, !tbaa !5
  br label %118

118:                                              ; preds = %135, %117
  %119 = load i64, ptr %15, align 8, !tbaa !5
  %120 = load i64, ptr %5, align 8, !tbaa !5
  %121 = load i64, ptr %13, align 8, !tbaa !5
  %122 = sub nsw i64 %120, %121
  %123 = icmp slt i64 %119, %122
  br i1 %123, label %125, label %124

124:                                              ; preds = %118
  store i32 10, ptr %10, align 4
  br label %138

125:                                              ; preds = %118
  %126 = load i64, ptr %4, align 8, !tbaa !5
  %127 = getelementptr inbounds i64, ptr %26, i64 %126
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef %26, ptr noundef %127)
  %128 = load i64, ptr %4, align 8, !tbaa !5
  %129 = load i64, ptr %11, align 8, !tbaa !5
  %130 = call noundef zeroext i1 @_Z11isSubsetSumPxxx(ptr noundef %26, i64 noundef %128, i64 noundef %129)
  %131 = zext i1 %130 to i32
  %132 = icmp eq i32 %131, 0
  br i1 %132, label %133, label %134

133:                                              ; preds = %125
  store i64 1, ptr %12, align 8, !tbaa !5
  store i32 10, ptr %10, align 4
  br label %138

134:                                              ; preds = %125
  br label %135

135:                                              ; preds = %134
  %136 = load i64, ptr %15, align 8, !tbaa !5
  %137 = add nsw i64 %136, 1
  store i64 %137, ptr %15, align 8, !tbaa !5
  br label %118, !llvm.loop !13

138:                                              ; preds = %133, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %139

139:                                              ; preds = %138
  %140 = load i64, ptr %12, align 8, !tbaa !5
  %141 = icmp eq i64 %140, 1
  br i1 %141, label %142, label %148

142:                                              ; preds = %139
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %144 = load i64, ptr %3, align 8, !tbaa !5
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %143, i64 noundef %144)
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %145, ptr noundef @.str.2)
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %146, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 2, ptr %10, align 4
  br label %154, !llvm.loop !11

148:                                              ; preds = %139
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %150 = load i64, ptr %3, align 8, !tbaa !5
  %151 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %149, i64 noundef %150)
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %151, ptr noundef @.str.1)
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %152, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 2, ptr %10, align 4
  br label %154, !llvm.loop !11

154:                                              ; preds = %148, %142, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %155

155:                                              ; preds = %154, %69, %57, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %156 = load ptr, ptr %6, align 8
  call void @llvm.stackrestore.p0(ptr %156)
  br label %17

157:                                              ; preds = %17
  store i32 0, ptr %1, align 4
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %158 = load i32, ptr %1, align 4
  ret i32 %158
}

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

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

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

; 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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPxEvT_S1_(ptr noundef, ptr noundef) #4

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

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 norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind willreturn }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = distinct !{!13, !10}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_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
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z11isSubsetSumPxxx(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i64, align 8
  %2 = 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
  %3 = 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)
  %4 = load i64, ptr %1, align 8, !tbaa !5
  %.not.not58 = icmp sgt i64 %4, 0
  br i1 %.not.not58, label %.lr.ph60, label %._crit_edge61

.lr.ph60:                                         ; preds = %0, %._crit_edge.thread
  %5 = phi i64 [ %42, %._crit_edge.thread ], [ 1, %0 ]
  %6 = 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)
  %7 = load i64, ptr %2, align 8, !tbaa !5
  %8 = call ptr @llvm.stacksave.p0()
  %9 = alloca i64, i64 %7, align 16
  %10 = load i64, ptr %2, align 8, !tbaa !5
  %11 = icmp sgt i64 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge.thread, !llvm.loop !9

.lr.ph:                                           ; preds = %.lr.ph60, %.lr.ph
  %.03849 = phi i64 [ %16, %.lr.ph ], [ 0, %.lr.ph60 ]
  %.03948 = phi i64 [ %15, %.lr.ph ], [ 0, %.lr.ph60 ]
  %12 = getelementptr inbounds i64, ptr %9, i64 %.03849
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %14 = load i64, ptr %12, align 8, !tbaa !5
  %15 = add nsw i64 %14, %.03948
  %16 = add nuw nsw i64 %.03849, 1
  %17 = load i64, ptr %2, align 8, !tbaa !5
  %18 = icmp slt i64 %16, %17
  br i1 %18, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph
  %19 = icmp sgt i64 %17, 2
  %20 = srem i64 %15, 3
  %21 = sdiv i64 %15, 3
  %.not = icmp eq i64 %20, 0
  %or.cond = select i1 %19, i1 %.not, i1 false
  br i1 %or.cond, label %.lr.ph54, label %._crit_edge.thread, !llvm.loop !9

.critedge.preheader:                              ; preds = %31
  %22 = icmp slt i64 %.1, 3
  br i1 %22, label %.lr.ph57.preheader, label %.critedge46

.lr.ph57.preheader:                               ; preds = %.critedge.preheader
  %23 = sub i64 3, %.1
  %smax = call i64 @llvm.smax.i64(i64 %23, i64 1)
  br label %.lr.ph57

.lr.ph54:                                         ; preds = %._crit_edge, %31
  %.03452 = phi i64 [ %32, %31 ], [ 0, %._crit_edge ]
  %.03551 = phi i64 [ %.1, %31 ], [ 0, %._crit_edge ]
  %24 = getelementptr inbounds i64, ptr %9, i64 %.03452
  %25 = load i64, ptr %24, align 8, !tbaa !5
  %26 = icmp sgt i64 %25, %21
  br i1 %26, label %._crit_edge.thread, label %27, !llvm.loop !9

27:                                               ; preds = %.lr.ph54
  %28 = icmp eq i64 %25, %21
  br i1 %28, label %29, label %31

29:                                               ; preds = %27
  store i64 0, ptr %24, align 8, !tbaa !5
  %30 = add nsw i64 %.03551, 1
  br label %31

31:                                               ; preds = %29, %27
  %.1 = phi i64 [ %30, %29 ], [ %.03551, %27 ]
  %32 = add nuw nsw i64 %.03452, 1
  %exitcond.not = icmp eq i64 %32, %17
  br i1 %exitcond.not, label %.critedge.preheader, label %.lr.ph54, !llvm.loop !12

.critedge:                                        ; preds = %.lr.ph57
  %33 = add nuw nsw i64 %.056, 1
  %exitcond64.not = icmp eq i64 %33, %smax
  br i1 %exitcond64.not, label %.critedge46, label %.lr.ph57, !llvm.loop !13

.lr.ph57:                                         ; preds = %.lr.ph57.preheader, %.critedge
  %.056 = phi i64 [ %33, %.critedge ], [ 0, %.lr.ph57.preheader ]
  %34 = load i64, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds i64, ptr %9, i64 %34
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef nonnull %9, ptr noundef nonnull %35)
  %36 = load i64, ptr %2, align 8, !tbaa !5
  %37 = call noundef zeroext i1 @_Z11isSubsetSumPxxx(ptr noundef nonnull %9, i64 noundef %36, i64 noundef %21)
  br i1 %37, label %.critedge, label %._crit_edge.thread, !llvm.loop !9

.critedge46:                                      ; preds = %.critedge, %.critedge.preheader
  br label %._crit_edge.thread, !llvm.loop !9

._crit_edge.thread:                               ; preds = %.lr.ph54, %.lr.ph57, %._crit_edge, %.lr.ph60, %.critedge46
  %.str.2.sink = phi ptr [ @.str.1, %.critedge46 ], [ @.str.2, %.lr.ph60 ], [ @.str.2, %._crit_edge ], [ @.str.2, %.lr.ph57 ], [ @.str.2, %.lr.ph54 ]
  %38 = 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)
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %38, i64 noundef %5)
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull %.str.2.sink)
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %40, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.stackrestore.p0(ptr %8)
  %42 = add nuw nsw i64 %5, 1
  %43 = load i64, ptr %1, align 8, !tbaa !5
  %.not.not = icmp slt i64 %5, %43
  br i1 %.not.not, label %.lr.ph60, label %._crit_edge61

._crit_edge61:                                    ; preds = %._crit_edge.thread, %0
  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 i32 0
}

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPxEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #4

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #5

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 norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,DivRemPairsPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass