; LLVM IR from eyangch/competitive-programming :: Codeforces/1552 (e)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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.anon = type { i64 }

@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@id = external dso_local global [100 x i64], align 16
@ans1 = external dso_local global [100 x i64], align 16
@ans2 = external dso_local global [100 x i64], align 16
@c = external dso_local global [100 x %"class.std::vector"], align 16
@used = external dso_local global [100 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca %class.anon, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %9 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %10 = getelementptr i8, ptr %9, i64 -24
  %11 = load i64, ptr %10, align 8
  %12 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %11
  %13 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %12, ptr noundef null)
  %14 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %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) @N)
  %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) @K)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %17

17:                                               ; preds = %29, %0
  %18 = load i64, ptr %2, align 8, !tbaa !8
  %19 = load i64, ptr @N, align 8, !tbaa !8
  %20 = load i64, ptr @K, align 8, !tbaa !8
  %21 = mul nsw i64 %19, %20
  %22 = icmp slt i64 %18, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %32

24:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #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) %3)
  %26 = load i64, ptr %3, align 8, !tbaa !8
  %27 = sub nsw i64 %26, 1
  %28 = getelementptr inbounds [100 x %"class.std::vector"], ptr @c, i64 0, i64 %27
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %29

29:                                               ; preds = %24
  %30 = load i64, ptr %2, align 8, !tbaa !8
  %31 = add nsw i64 %30, 1
  store i64 %31, ptr %2, align 8, !tbaa !8
  br label %17, !llvm.loop !11

32:                                               ; preds = %23
  %33 = load i64, ptr @N, align 8, !tbaa !8
  %34 = getelementptr inbounds i64, ptr @id, i64 %33
  call void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef @id, ptr noundef %34, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 1, ptr %4, align 8, !tbaa !8
  br label %35

35:                                               ; preds = %105, %32
  %36 = load i64, ptr %4, align 8, !tbaa !8
  %37 = load i64, ptr @K, align 8, !tbaa !8
  %38 = icmp slt i64 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %108

40:                                               ; preds = %35
  %41 = load i64, ptr @N, align 8, !tbaa !8
  %42 = getelementptr inbounds i64, ptr @id, i64 %41
  %43 = getelementptr inbounds %class.anon, ptr %6, i32 0, i32 0
  %44 = load i64, ptr %4, align 8, !tbaa !8
  store i64 %44, ptr %43, align 8, !tbaa !13
  %45 = getelementptr inbounds %class.anon, ptr %6, i32 0, i32 0
  %46 = load i64, ptr %45, align 8
  call void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef @id, ptr noundef %42, i64 %46)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !8
  br label %47

47:                                               ; preds = %100, %40
  %48 = load i64, ptr %7, align 8, !tbaa !8
  %49 = load i64, ptr @N, align 8, !tbaa !8
  %50 = load i64, ptr @K, align 8, !tbaa !8
  %51 = sub nsw i64 %50, 1
  %52 = sdiv i64 %49, %51
  %53 = load i64, ptr @N, align 8, !tbaa !8
  %54 = load i64, ptr @K, align 8, !tbaa !8
  %55 = sub nsw i64 %54, 1
  %56 = srem i64 %53, %55
  %57 = icmp sgt i64 %56, 0
  %58 = zext i1 %57 to i64
  %59 = add nsw i64 %52, %58
  %60 = icmp slt i64 %48, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %47
  store i32 8, ptr %5, align 4
  br label %103

62:                                               ; preds = %47
  %63 = load i64, ptr %7, align 8, !tbaa !8
  %64 = getelementptr inbounds [100 x i64], ptr @id, i64 0, i64 %63
  %65 = load i64, ptr %64, align 8, !tbaa !8
  %66 = getelementptr inbounds [100 x i8], ptr @used, i64 0, i64 %65
  %67 = load i8, ptr %66, align 1, !tbaa !15, !range !17, !noundef !18
  %68 = trunc i8 %67 to i1
  br i1 %68, label %69, label %70

69:                                               ; preds = %62
  store i32 8, ptr %5, align 4
  br label %103

70:                                               ; preds = %62
  %71 = load i64, ptr %7, align 8, !tbaa !8
  %72 = getelementptr inbounds [100 x i64], ptr @id, i64 0, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !8
  %74 = getelementptr inbounds [100 x i8], ptr @used, i64 0, i64 %73
  store i8 1, ptr %74, align 1, !tbaa !15
  %75 = load i64, ptr %7, align 8, !tbaa !8
  %76 = getelementptr inbounds [100 x i64], ptr @id, i64 0, i64 %75
  %77 = load i64, ptr %76, align 8, !tbaa !8
  %78 = getelementptr inbounds [100 x %"class.std::vector"], ptr @c, i64 0, i64 %77
  %79 = load i64, ptr %4, align 8, !tbaa !8
  %80 = sub nsw i64 %79, 1
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %78, i64 noundef %80) #6
  %82 = load i64, ptr %81, align 8, !tbaa !8
  %83 = add nsw i64 %82, 1
  %84 = load i64, ptr %7, align 8, !tbaa !8
  %85 = getelementptr inbounds [100 x i64], ptr @id, i64 0, i64 %84
  %86 = load i64, ptr %85, align 8, !tbaa !8
  %87 = getelementptr inbounds [100 x i64], ptr @ans1, i64 0, i64 %86
  store i64 %83, ptr %87, align 8, !tbaa !8
  %88 = load i64, ptr %7, align 8, !tbaa !8
  %89 = getelementptr inbounds [100 x i64], ptr @id, i64 0, i64 %88
  %90 = load i64, ptr %89, align 8, !tbaa !8
  %91 = getelementptr inbounds [100 x %"class.std::vector"], ptr @c, i64 0, i64 %90
  %92 = load i64, ptr %4, align 8, !tbaa !8
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %91, i64 noundef %92) #6
  %94 = load i64, ptr %93, align 8, !tbaa !8
  %95 = add nsw i64 %94, 1
  %96 = load i64, ptr %7, align 8, !tbaa !8
  %97 = getelementptr inbounds [100 x i64], ptr @id, i64 0, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !8
  %99 = getelementptr inbounds [100 x i64], ptr @ans2, i64 0, i64 %98
  store i64 %95, ptr %99, align 8, !tbaa !8
  br label %100

100:                                              ; preds = %70
  %101 = load i64, ptr %7, align 8, !tbaa !8
  %102 = add nsw i64 %101, 1
  store i64 %102, ptr %7, align 8, !tbaa !8
  br label %47, !llvm.loop !19

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

104:                                              ; preds = %103
  br label %105

105:                                              ; preds = %104
  %106 = load i64, ptr %4, align 8, !tbaa !8
  %107 = add nsw i64 %106, 1
  store i64 %107, ptr %4, align 8, !tbaa !8
  br label %35, !llvm.loop !20

108:                                              ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !8
  br label %109

109:                                              ; preds = %125, %108
  %110 = load i64, ptr %8, align 8, !tbaa !8
  %111 = load i64, ptr @N, align 8, !tbaa !8
  %112 = icmp slt i64 %110, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %109
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %128

114:                                              ; preds = %109
  %115 = load i64, ptr %8, align 8, !tbaa !8
  %116 = getelementptr inbounds [100 x i64], ptr @ans1, i64 0, i64 %115
  %117 = load i64, ptr %116, align 8, !tbaa !8
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %117)
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %118, i8 noundef signext 32)
  %120 = load i64, ptr %8, align 8, !tbaa !8
  %121 = getelementptr inbounds [100 x i64], ptr @ans2, i64 0, i64 %120
  %122 = load i64, ptr %121, align 8, !tbaa !8
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %119, i64 noundef %122)
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %123, i8 noundef signext 10)
  br label %125

125:                                              ; preds = %114
  %126 = load i64, ptr %8, align 8, !tbaa !8
  %127 = add nsw i64 %126, 1
  store i64 %127, ptr %8, align 8, !tbaa !8
  br label %109, !llvm.loop !21

128:                                              ; preds = %113
  %129 = load i32, ptr %1, align 4
  ret i32 %129
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #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)) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef, ptr noundef, i64) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !9, i64 0}
!14 = !{!"_ZTSZ4mainE3$_0", !9, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !10, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}


; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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" }

@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@id = external dso_local global [100 x i64], align 16
@ans1 = external dso_local local_unnamed_addr global [100 x i64], align 16
@ans2 = external dso_local local_unnamed_addr global [100 x i64], align 16
@c = external dso_local global [100 x %"class.std::vector"], align 16
@used = external dso_local local_unnamed_addr global [100 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %4 = getelementptr i8, ptr %3, i64 -24
  %5 = load i64, ptr %4, align 8
  %6 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %5
  %7 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %6, ptr noundef null)
  %8 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(8) @K)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  store i64 0, ptr %1, align 8, !tbaa !8
  %11 = load i64, ptr @N, align 8, !tbaa !8
  %12 = load i64, ptr @K, align 8, !tbaa !8
  %13 = mul nsw i64 %12, %11
  %14 = icmp sgt i64 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa = phi i64 [ %11, %0 ], [ %24, %.lr.ph ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  %15 = getelementptr inbounds i64, ptr @id, i64 %.lcssa
  call void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef nonnull @id, ptr noundef nonnull %15, i32 noundef 0)
  %16 = load i64, ptr @K, align 8, !tbaa !8
  %17 = icmp sgt i64 %16, 1
  %.pre32 = load i64, ptr @N, align 8, !tbaa !8
  br i1 %17, label %.lr.ph27, label %.preheader

.lr.ph:                                           ; preds = %0, %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %18 = 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)
  %19 = load i64, ptr %2, align 8, !tbaa !8
  %20 = add nsw i64 %19, -1
  %21 = getelementptr inbounds [100 x %"class.std::vector"], ptr @c, i64 0, i64 %20
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 8 dereferenceable(8) %1)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %22 = load i64, ptr %1, align 8, !tbaa !8
  %23 = add nsw i64 %22, 1
  store i64 %23, ptr %1, align 8, !tbaa !8
  %24 = load i64, ptr @N, align 8, !tbaa !8
  %25 = load i64, ptr @K, align 8, !tbaa !8
  %26 = mul nsw i64 %25, %24
  %27 = icmp slt i64 %23, %26
  br i1 %27, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.preheader:                                       ; preds = %._crit_edge23, %._crit_edge
  %28 = phi i64 [ %.pre32, %._crit_edge ], [ %78, %._crit_edge23 ]
  %29 = icmp sgt i64 %28, 0
  br i1 %29, label %.lr.ph29, label %._crit_edge30

.lr.ph27:                                         ; preds = %._crit_edge, %._crit_edge23
  %30 = phi i64 [ %78, %._crit_edge23 ], [ %.pre32, %._crit_edge ]
  %.01925 = phi i64 [ %79, %._crit_edge23 ], [ 1, %._crit_edge ]
  %31 = getelementptr inbounds i64, ptr @id, i64 %30
  call void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef nonnull @id, ptr noundef nonnull %31, i64 %.01925)
  %32 = load i64, ptr @N, align 8, !tbaa !8
  %33 = load i64, ptr @K, align 8, !tbaa !8
  %34 = add nsw i64 %33, -1
  %35 = sdiv i64 %32, %34
  %36 = srem i64 %32, %34
  %37 = icmp sgt i64 %36, 0
  %38 = zext i1 %37 to i64
  %39 = add nsw i64 %35, %38
  %40 = icmp sgt i64 %39, 0
  br i1 %40, label %.lr.ph22, label %._crit_edge23

.lr.ph22:                                         ; preds = %.lr.ph27
  %41 = add nsw i64 %.01925, -1
  %42 = load i64, ptr @id, align 16, !tbaa !8
  %43 = getelementptr inbounds [100 x i8], ptr @used, i64 0, i64 %42
  %44 = load i8, ptr %43, align 1, !tbaa !13, !range !15, !noundef !16
  %45 = trunc nuw i8 %44 to i1
  br i1 %45, label %._crit_edge23, label %.lr.ph40

46:                                               ; preds = %.lr.ph40
  %47 = getelementptr inbounds [100 x i64], ptr @id, i64 0, i64 %67
  %48 = load i64, ptr %47, align 8, !tbaa !8
  %49 = getelementptr inbounds [100 x i8], ptr @used, i64 0, i64 %48
  %50 = load i8, ptr %49, align 1, !tbaa !13, !range !15, !noundef !16
  %51 = trunc nuw i8 %50 to i1
  br i1 %51, label %._crit_edge23, label %.lr.ph40, !llvm.loop !17

.lr.ph40:                                         ; preds = %.lr.ph22, %46
  %52 = phi ptr [ %49, %46 ], [ %43, %.lr.ph22 ]
  %53 = phi i64 [ %48, %46 ], [ %42, %.lr.ph22 ]
  %54 = phi ptr [ %47, %46 ], [ @id, %.lr.ph22 ]
  %.0182039 = phi i64 [ %67, %46 ], [ 0, %.lr.ph22 ]
  store i8 1, ptr %52, align 1, !tbaa !13
  %55 = getelementptr inbounds [100 x %"class.std::vector"], ptr @c, i64 0, i64 %53
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %55, i64 noundef %41) #6
  %57 = load i64, ptr %56, align 8, !tbaa !8
  %58 = add nsw i64 %57, 1
  %59 = load i64, ptr %54, align 8, !tbaa !8
  %60 = getelementptr inbounds [100 x i64], ptr @ans1, i64 0, i64 %59
  store i64 %58, ptr %60, align 8, !tbaa !8
  %61 = getelementptr inbounds [100 x %"class.std::vector"], ptr @c, i64 0, i64 %59
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %61, i64 noundef %.01925) #6
  %63 = load i64, ptr %62, align 8, !tbaa !8
  %64 = add nsw i64 %63, 1
  %65 = load i64, ptr %54, align 8, !tbaa !8
  %66 = getelementptr inbounds [100 x i64], ptr @ans2, i64 0, i64 %65
  store i64 %64, ptr %66, align 8, !tbaa !8
  %67 = add nuw nsw i64 %.0182039, 1
  %68 = load i64, ptr @N, align 8, !tbaa !8
  %69 = load i64, ptr @K, align 8, !tbaa !8
  %70 = add nsw i64 %69, -1
  %71 = sdiv i64 %68, %70
  %72 = srem i64 %68, %70
  %73 = icmp sgt i64 %72, 0
  %74 = zext i1 %73 to i64
  %75 = add nsw i64 %71, %74
  %76 = icmp slt i64 %67, %75
  br i1 %76, label %46, label %._crit_edge23, !llvm.loop !17

._crit_edge23:                                    ; preds = %46, %.lr.ph40, %.lr.ph22, %.lr.ph27
  %77 = phi i64 [ %33, %.lr.ph27 ], [ %33, %.lr.ph22 ], [ %69, %.lr.ph40 ], [ %69, %46 ]
  %78 = phi i64 [ %32, %.lr.ph27 ], [ %32, %.lr.ph22 ], [ %68, %.lr.ph40 ], [ %68, %46 ]
  %79 = add nuw nsw i64 %.01925, 1
  %80 = icmp slt i64 %79, %77
  br i1 %80, label %.lr.ph27, label %.preheader, !llvm.loop !18

._crit_edge30:                                    ; preds = %.lr.ph29, %.preheader
  ret i32 0

.lr.ph29:                                         ; preds = %.preheader, %.lr.ph29
  %.028 = phi i64 [ %89, %.lr.ph29 ], [ 0, %.preheader ]
  %81 = getelementptr inbounds [100 x i64], ptr @ans1, i64 0, i64 %.028
  %82 = load i64, ptr %81, align 8, !tbaa !8
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %82)
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %83, i8 noundef signext 32)
  %85 = getelementptr inbounds [100 x i64], ptr @ans2, i64 0, i64 %.028
  %86 = load i64, ptr %85, align 8, !tbaa !8
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %84, i64 noundef %86)
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %87, i8 noundef signext 10)
  %89 = add nuw nsw i64 %.028, 1
  %90 = load i64, ptr @N, align 8, !tbaa !8
  %91 = icmp slt i64 %89, %90
  br i1 %91, label %.lr.ph29, label %._crit_edge30, !llvm.loop !19
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #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 #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef, ptr noundef, i64) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !10, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


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