; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/LONG/DEC14/SANSKAR (sans)

; 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 [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 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 ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = 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
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %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) %2)
  br label %16

16:                                               ; preds = %136, %0
  %17 = load i64, ptr %2, align 8, !tbaa !5
  %18 = add nsw i64 %17, -1
  store i64 %18, ptr %2, align 8, !tbaa !5
  %19 = icmp ne i64 %17, 0
  br i1 %19, label %20, label %138

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

26:                                               ; preds = %40, %20
  %27 = load i64, ptr %8, align 8, !tbaa !5
  %28 = load i64, ptr %3, align 8, !tbaa !5
  %29 = icmp slt i64 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %43

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

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

43:                                               ; preds = %30
  %44 = load i64, ptr %4, align 8, !tbaa !5
  %45 = icmp eq i64 %44, 1
  br i1 %45, label %46, label %49

46:                                               ; preds = %43
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %47, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 2, ptr %9, align 4
  br label %136, !llvm.loop !11

49:                                               ; preds = %43
  %50 = load i64, ptr %3, align 8, !tbaa !5
  %51 = load i64, ptr %4, align 8, !tbaa !5
  %52 = icmp slt i64 %50, %51
  br i1 %52, label %53, label %56

53:                                               ; preds = %49
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %54, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 2, ptr %9, align 4
  br label %136, !llvm.loop !11

56:                                               ; preds = %49
  br label %57

57:                                               ; preds = %56
  %58 = load i64, ptr %7, align 8, !tbaa !5
  %59 = load i64, ptr %4, align 8, !tbaa !5
  %60 = srem i64 %58, %59
  %61 = icmp ne i64 %60, 0
  br i1 %61, label %62, label %65

62:                                               ; preds = %57
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 2, ptr %9, align 4
  br label %136, !llvm.loop !11

65:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %66 = load i64, ptr %7, align 8, !tbaa !5
  %67 = load i64, ptr %4, align 8, !tbaa !5
  %68 = sdiv i64 %66, %67
  store i64 %68, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 0, 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
  br label %69

69:                                               ; preds = %94, %65
  %70 = load i64, ptr %13, align 8, !tbaa !5
  %71 = load i64, ptr %3, align 8, !tbaa !5
  %72 = icmp slt i64 %70, %71
  br i1 %72, label %74, label %73

73:                                               ; preds = %69
  store i32 7, ptr %9, align 4
  br label %97

74:                                               ; preds = %69
  %75 = load i64, ptr %13, align 8, !tbaa !5
  %76 = getelementptr inbounds i64, ptr %25, i64 %75
  %77 = load i64, ptr %76, align 8, !tbaa !5
  %78 = load i64, ptr %10, align 8, !tbaa !5
  %79 = icmp sgt i64 %77, %78
  br i1 %79, label %80, label %81

80:                                               ; preds = %74
  store i64 1, ptr %11, align 8, !tbaa !5
  store i32 7, ptr %9, align 4
  br label %97

81:                                               ; preds = %74
  %82 = load i64, ptr %13, align 8, !tbaa !5
  %83 = getelementptr inbounds i64, ptr %25, i64 %82
  %84 = load i64, ptr %83, align 8, !tbaa !5
  %85 = load i64, ptr %10, align 8, !tbaa !5
  %86 = icmp eq i64 %84, %85
  br i1 %86, label %87, label %92

87:                                               ; preds = %81
  %88 = load i64, ptr %13, align 8, !tbaa !5
  %89 = getelementptr inbounds i64, ptr %25, i64 %88
  store i64 0, ptr %89, align 8, !tbaa !5
  %90 = load i64, ptr %12, align 8, !tbaa !5
  %91 = add nsw i64 %90, 1
  store i64 %91, ptr %12, align 8, !tbaa !5
  br label %92

92:                                               ; preds = %87, %81
  br label %93

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93
  %95 = load i64, ptr %13, align 8, !tbaa !5
  %96 = add nsw i64 %95, 1
  store i64 %96, ptr %13, align 8, !tbaa !5
  br label %69, !llvm.loop !12

97:                                               ; preds = %80, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %98

98:                                               ; preds = %97
  %99 = load i64, ptr %11, align 8, !tbaa !5
  %100 = icmp eq i64 %99, 1
  br i1 %100, label %101, label %104

101:                                              ; preds = %98
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %102, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 2, ptr %9, align 4
  br label %135, !llvm.loop !11

104:                                              ; preds = %98
  store i64 0, ptr %11, 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 %105

105:                                              ; preds = %122, %104
  %106 = load i64, ptr %14, align 8, !tbaa !5
  %107 = load i64, ptr %4, align 8, !tbaa !5
  %108 = load i64, ptr %12, align 8, !tbaa !5
  %109 = sub nsw i64 %107, %108
  %110 = icmp slt i64 %106, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %105
  store i32 10, ptr %9, align 4
  br label %125

112:                                              ; preds = %105
  %113 = load i64, ptr %3, align 8, !tbaa !5
  %114 = getelementptr inbounds i64, ptr %25, i64 %113
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef %25, ptr noundef %114)
  %115 = load i64, ptr %3, align 8, !tbaa !5
  %116 = load i64, ptr %10, align 8, !tbaa !5
  %117 = call noundef zeroext i1 @_Z11isSubsetSumPxxx(ptr noundef %25, i64 noundef %115, i64 noundef %116)
  %118 = zext i1 %117 to i32
  %119 = icmp eq i32 %118, 0
  br i1 %119, label %120, label %121

120:                                              ; preds = %112
  store i64 1, ptr %11, align 8, !tbaa !5
  store i32 10, ptr %9, align 4
  br label %125

121:                                              ; preds = %112
  br label %122

122:                                              ; preds = %121
  %123 = load i64, ptr %14, align 8, !tbaa !5
  %124 = add nsw i64 %123, 1
  store i64 %124, ptr %14, align 8, !tbaa !5
  br label %105, !llvm.loop !13

125:                                              ; preds = %120, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %126

126:                                              ; preds = %125
  %127 = load i64, ptr %11, align 8, !tbaa !5
  %128 = icmp eq i64 %127, 1
  br i1 %128, label %129, label %132

129:                                              ; preds = %126
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %130, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 2, ptr %9, align 4
  br label %135, !llvm.loop !11

132:                                              ; preds = %126
  %133 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %133, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 2, ptr %9, align 4
  br label %135, !llvm.loop !11

135:                                              ; preds = %132, %129, %101
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %136

136:                                              ; preds = %135, %62, %53, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  %137 = load ptr, ptr %5, align 8
  call void @llvm.stackrestore.p0(ptr %137)
  br label %16

138:                                              ; preds = %16
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  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
  %139 = load i32, ptr %1, align 4
  ret i32 %139
}

; 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 @_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 [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 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
  %3 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %4 = 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)
  %5 = load i64, ptr %1, align 8, !tbaa !5
  %6 = add nsw i64 %5, -1
  store i64 %6, ptr %1, align 8, !tbaa !5
  %.not46 = icmp eq i64 %5, 0
  br i1 %.not46, label %._crit_edge49, label %.lr.ph48

.lr.ph48:                                         ; preds = %0, %.loopexit
  %7 = 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)
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %9 = load i64, ptr %2, align 8, !tbaa !5
  %10 = call ptr @llvm.stacksave.p0()
  %11 = alloca i64, i64 %9, align 16
  %12 = load i64, ptr %2, align 8, !tbaa !5
  %13 = icmp sgt i64 %12, 0
  br i1 %13, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph48
  %.027.lcssa = phi i64 [ 0, %.lr.ph48 ], [ %19, %.lr.ph ]
  %.lcssa = phi i64 [ %12, %.lr.ph48 ], [ %21, %.lr.ph ]
  %14 = load i64, ptr %3, align 8, !tbaa !5
  %15 = icmp eq i64 %14, 1
  br i1 %15, label %.loopexit, label %23, !llvm.loop !9

.lr.ph:                                           ; preds = %.lr.ph48, %.lr.ph
  %.02637 = phi i64 [ %20, %.lr.ph ], [ 0, %.lr.ph48 ]
  %.02736 = phi i64 [ %19, %.lr.ph ], [ 0, %.lr.ph48 ]
  %16 = getelementptr inbounds i64, ptr %11, i64 %.02637
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %18 = load i64, ptr %16, align 8, !tbaa !5
  %19 = add nsw i64 %18, %.02736
  %20 = add nuw nsw i64 %.02637, 1
  %21 = load i64, ptr %2, align 8, !tbaa !5
  %22 = icmp slt i64 %20, %21
  br i1 %22, label %.lr.ph, label %._crit_edge, !llvm.loop !11

23:                                               ; preds = %._crit_edge
  %24 = icmp slt i64 %.lcssa, %14
  br i1 %24, label %.loopexit, label %25, !llvm.loop !9

25:                                               ; preds = %23
  %26 = srem i64 %.027.lcssa, %14
  %27 = sdiv i64 %.027.lcssa, %14
  %.not32 = icmp eq i64 %26, 0
  br i1 %.not32, label %28, label %.loopexit, !llvm.loop !9

28:                                               ; preds = %25
  %29 = icmp sgt i64 %.lcssa, 0
  br i1 %29, label %.lr.ph42, label %.critedge.preheader

.critedge.preheader:                              ; preds = %38, %28
  %.023.lcssa = phi i64 [ 0, %28 ], [ %.1, %38 ]
  %30 = icmp sgt i64 %14, %.023.lcssa
  br i1 %30, label %.lr.ph45, label %.critedge34

.lr.ph42:                                         ; preds = %28, %38
  %.02240 = phi i64 [ %39, %38 ], [ 0, %28 ]
  %.02339 = phi i64 [ %.1, %38 ], [ 0, %28 ]
  %31 = getelementptr inbounds i64, ptr %11, i64 %.02240
  %32 = load i64, ptr %31, align 8, !tbaa !5
  %33 = icmp sgt i64 %32, %27
  br i1 %33, label %.loopexit, label %34, !llvm.loop !9

34:                                               ; preds = %.lr.ph42
  %35 = icmp eq i64 %32, %27
  br i1 %35, label %36, label %38

36:                                               ; preds = %34
  store i64 0, ptr %31, align 8, !tbaa !5
  %37 = add nsw i64 %.02339, 1
  br label %38

38:                                               ; preds = %36, %34
  %.1 = phi i64 [ %37, %36 ], [ %.02339, %34 ]
  %39 = add nuw nsw i64 %.02240, 1
  %exitcond.not = icmp eq i64 %39, %.lcssa
  br i1 %exitcond.not, label %.critedge.preheader, label %.lr.ph42, !llvm.loop !12

.critedge:                                        ; preds = %.lr.ph45
  %40 = add nuw nsw i64 %.044, 1
  %41 = load i64, ptr %3, align 8, !tbaa !5
  %42 = sub nsw i64 %41, %.023.lcssa
  %43 = icmp slt i64 %40, %42
  br i1 %43, label %.lr.ph45, label %.critedge34, !llvm.loop !13

.lr.ph45:                                         ; preds = %.critedge.preheader, %.critedge
  %.044 = phi i64 [ %40, %.critedge ], [ 0, %.critedge.preheader ]
  %44 = load i64, ptr %2, align 8, !tbaa !5
  %45 = getelementptr inbounds i64, ptr %11, i64 %44
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef nonnull %11, ptr noundef nonnull %45)
  %46 = load i64, ptr %2, align 8, !tbaa !5
  %47 = call noundef zeroext i1 @_Z11isSubsetSumPxxx(ptr noundef nonnull %11, i64 noundef %46, i64 noundef %27)
  br i1 %47, label %.critedge, label %.loopexit, !llvm.loop !9

.critedge34:                                      ; preds = %.critedge, %.critedge.preheader
  br label %.loopexit, !llvm.loop !9

.loopexit:                                        ; preds = %.lr.ph42, %.lr.ph45, %25, %23, %._crit_edge, %.critedge34
  %.str.1.sink = phi ptr [ @.str, %.critedge34 ], [ @.str, %._crit_edge ], [ @.str.1, %23 ], [ @.str.1, %25 ], [ @.str.1, %.lr.ph45 ], [ @.str.1, %.lr.ph42 ]
  %48 = 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.1.sink)
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.stackrestore.p0(ptr %10)
  %50 = load i64, ptr %1, align 8, !tbaa !5
  %51 = add nsw i64 %50, -1
  store i64 %51, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %50, 0
  br i1 %.not, label %._crit_edge49, label %.lr.ph48

._crit_edge49:                                    ; preds = %.loopexit, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  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 @_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

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 = { 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: DivRemPairsPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass