; LLVM IR from eyangch/competitive-programming :: Codeforces/1710 (a)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@A = external dso_local global [100000 x i64], align 16
@B = external dso_local global [100000 x i64], align 16
@_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 norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i8, align 1
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %10 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %12
  %14 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  %15 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %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) @T)
  br label %17

17:                                               ; preds = %111, %0
  %18 = load i64, ptr @T, align 8, !tbaa !8
  %19 = add nsw i64 %18, -1
  store i64 %19, ptr @T, align 8, !tbaa !8
  %20 = icmp ne i64 %18, 0
  br i1 %20, label %21, label %118

21:                                               ; preds = %17
  %22 = 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)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(8) @K)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %25

25:                                               ; preds = %34, %21
  %26 = load i64, ptr %2, align 8, !tbaa !8
  %27 = load i64, ptr @K, align 8, !tbaa !8
  %28 = icmp slt i64 %26, %27
  br i1 %28, label %30, label %29

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

30:                                               ; preds = %25
  %31 = load i64, ptr %2, align 8, !tbaa !8
  %32 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %31
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %32)
  br label %34

34:                                               ; preds = %30
  %35 = load i64, ptr %2, align 8, !tbaa !8
  %36 = add nsw i64 %35, 1
  store i64 %36, ptr %2, align 8, !tbaa !8
  br label %25, !llvm.loop !11

37:                                               ; preds = %29
  %38 = load i64, ptr @K, align 8, !tbaa !8
  %39 = getelementptr inbounds i64, ptr @A, i64 %38
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef @A, ptr noundef %39)
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #7
  store i8 0, ptr %3, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store i64 0, ptr %4, align 8, !tbaa !8
  br label %40

40:                                               ; preds = %108, %37
  %41 = load i64, ptr %4, align 8, !tbaa !8
  %42 = icmp slt i64 %41, 2
  br i1 %42, label %44, label %43

43:                                               ; preds = %40
  store i32 7, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %111

44:                                               ; preds = %40
  %45 = load i64, ptr @K, align 8, !tbaa !8
  %46 = getelementptr inbounds i64, ptr @A, i64 %45
  %47 = call noundef ptr @_ZSt4copyIPxS0_ET0_T_S2_S1_(ptr noundef @A, ptr noundef %46, ptr noundef @B)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %48 = load i64, ptr @M, align 8, !tbaa !8
  store i64 %48, ptr %6, align 8, !tbaa !8
  %49 = load i64, ptr @M, align 8, !tbaa !8
  %50 = and i64 %49, 1
  %51 = icmp ne i64 %50, 0
  br i1 %51, label %52, label %74

52:                                               ; preds = %44
  %53 = load i64, ptr @K, align 8, !tbaa !8
  %54 = sub nsw i64 %53, 1
  %55 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %54
  %56 = load i64, ptr %55, align 8, !tbaa !8
  %57 = load i64, ptr @N, align 8, !tbaa !8
  %58 = mul nsw i64 3, %57
  %59 = icmp slt i64 %56, %58
  br i1 %59, label %60, label %61

60:                                               ; preds = %52
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) @N, ptr noundef nonnull align 8 dereferenceable(8) @M) #7
  store i32 9, ptr %5, align 4
  br label %105

61:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %62 = load i64, ptr @K, align 8, !tbaa !8
  %63 = sub nsw i64 %62, 1
  %64 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %63
  %65 = load i64, ptr %64, align 8, !tbaa !8
  %66 = load i64, ptr @N, align 8, !tbaa !8
  %67 = sdiv i64 %65, %66
  store i64 %67, ptr %7, align 8, !tbaa !8
  %68 = load i64, ptr @K, align 8, !tbaa !8
  %69 = sub nsw i64 %68, 1
  %70 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %69
  store i64 0, ptr %70, align 8, !tbaa !8
  %71 = load i64, ptr %7, align 8, !tbaa !8
  %72 = load i64, ptr %6, align 8, !tbaa !8
  %73 = sub nsw i64 %72, %71
  store i64 %73, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %74

74:                                               ; preds = %61, %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !8
  br label %75

75:                                               ; preds = %97, %74
  %76 = load i64, ptr %8, align 8, !tbaa !8
  %77 = load i64, ptr @K, align 8, !tbaa !8
  %78 = icmp slt i64 %76, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %75
  store i32 10, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %100

80:                                               ; preds = %75
  %81 = load i64, ptr %8, align 8, !tbaa !8
  %82 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %81
  %83 = load i64, ptr %82, align 8, !tbaa !8
  %84 = load i64, ptr @N, align 8, !tbaa !8
  %85 = mul nsw i64 2, %84
  %86 = icmp sge i64 %83, %85
  br i1 %86, label %87, label %96

87:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %88 = load i64, ptr %8, align 8, !tbaa !8
  %89 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %88
  %90 = load i64, ptr %89, align 8, !tbaa !8
  %91 = load i64, ptr @N, align 8, !tbaa !8
  %92 = sdiv i64 %90, %91
  store i64 %92, ptr %9, align 8, !tbaa !8
  %93 = load i64, ptr %9, align 8, !tbaa !8
  %94 = load i64, ptr %6, align 8, !tbaa !8
  %95 = sub nsw i64 %94, %93
  store i64 %95, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %96

96:                                               ; preds = %87, %80
  br label %97

97:                                               ; preds = %96
  %98 = load i64, ptr %8, align 8, !tbaa !8
  %99 = add nsw i64 %98, 1
  store i64 %99, ptr %8, align 8, !tbaa !8
  br label %75, !llvm.loop !15

100:                                              ; preds = %79
  %101 = load i64, ptr %6, align 8, !tbaa !8
  %102 = icmp sle i64 %101, 0
  br i1 %102, label %103, label %104

103:                                              ; preds = %100
  store i8 1, ptr %3, align 1, !tbaa !13
  br label %104

104:                                              ; preds = %103, %100
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) @N, ptr noundef nonnull align 8 dereferenceable(8) @M) #7
  store i32 0, ptr %5, align 4
  br label %105

105:                                              ; preds = %104, %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %106 = load i32, ptr %5, align 4
  switch i32 %106, label %120 [
    i32 0, label %107
    i32 9, label %108
  ]

107:                                              ; preds = %105
  br label %108

108:                                              ; preds = %107, %105
  %109 = load i64, ptr %4, align 8, !tbaa !8
  %110 = add nsw i64 %109, 1
  store i64 %110, ptr %4, align 8, !tbaa !8
  br label %40, !llvm.loop !16

111:                                              ; preds = %43
  %112 = load i8, ptr %3, align 1, !tbaa !13, !range !17, !noundef !18
  %113 = trunc i8 %112 to i1
  %114 = zext i1 %113 to i64
  %115 = select i1 %113, ptr @.str, ptr @.str.1
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef %115)
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %116, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  br label %17, !llvm.loop !19

118:                                              ; preds = %17
  %119 = load i32, ptr %1, align 4
  ret i32 %119

120:                                              ; preds = %105
  unreachable
}

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt4copyIPxS0_ET0_T_S2_S1_(ptr noundef, ptr noundef, ptr noundef) #5

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

; 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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

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 = { 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 #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = distinct !{!19, !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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@A = external dso_local global [100000 x i64], align 16
@B = external dso_local global [100000 x i64], align 16
@_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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %2 = getelementptr i8, ptr %1, i64 -24
  %3 = load i64, ptr %2, align 8
  %4 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %3
  %5 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %4, ptr noundef null)
  %6 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %7 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  %8 = load i64, ptr @T, align 8, !tbaa !8
  %9 = add nsw i64 %8, -1
  store i64 %9, ptr @T, align 8, !tbaa !8
  %.not36 = icmp eq i64 %8, 0
  br i1 %.not36, label %._crit_edge39, label %.lr.ph38

.lr.ph38:                                         ; preds = %0, %104
  %10 = 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)
  %11 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %12 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %13 = load i64, ptr @K, align 8, !tbaa !8
  %14 = icmp sgt i64 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph38
  %.lcssa = phi i64 [ %13, %.lr.ph38 ], [ %24, %.lr.ph ]
  %15 = getelementptr inbounds i64, ptr @A, i64 %.lcssa
  tail call void @_ZSt4sortIPxEvT_S1_(ptr noundef nonnull @A, ptr noundef nonnull %15)
  %16 = load i64, ptr @K, align 8, !tbaa !8
  %17 = getelementptr inbounds i64, ptr @A, i64 %16
  %18 = tail call noundef ptr @_ZSt4copyIPxS0_ET0_T_S2_S1_(ptr noundef nonnull @A, ptr noundef nonnull %17, ptr noundef nonnull @B)
  %19 = load i64, ptr @M, align 8, !tbaa !8
  %20 = and i64 %19, 1
  %.not25 = icmp eq i64 %20, 0
  %.pre = load i64, ptr @K, align 8, !tbaa !8
  br i1 %.not25, label %36, label %26

.lr.ph:                                           ; preds = %.lr.ph38, %.lr.ph
  %.027 = phi i64 [ %23, %.lr.ph ], [ 0, %.lr.ph38 ]
  %21 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %.027
  %22 = 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) %21)
  %23 = add nuw nsw i64 %.027, 1
  %24 = load i64, ptr @K, align 8, !tbaa !8
  %25 = icmp slt i64 %23, %24
  br i1 %25, label %.lr.ph, label %._crit_edge, !llvm.loop !11

26:                                               ; preds = %._crit_edge
  %27 = add nsw i64 %.pre, -1
  %28 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %27
  %29 = load i64, ptr %28, align 8, !tbaa !8
  %30 = load i64, ptr @N, align 8, !tbaa !8
  %31 = mul nsw i64 %30, 3
  %32 = icmp slt i64 %29, %31
  br i1 %32, label %62, label %33

33:                                               ; preds = %26
  %34 = sdiv i64 %29, %30
  store i64 0, ptr %28, align 8, !tbaa !8
  %35 = sub nsw i64 %19, %34
  br label %36

36:                                               ; preds = %33, %._crit_edge
  %.018 = phi i64 [ %35, %33 ], [ %19, %._crit_edge ]
  %37 = icmp sgt i64 %.pre, 0
  br i1 %37, label %.lr.ph31, label %._crit_edge32

.lr.ph31:                                         ; preds = %36
  %38 = load i64, ptr @N, align 8, !tbaa !8
  %39 = shl nsw i64 %38, 1
  %xtraiter = and i64 %.pre, 1
  %40 = icmp eq i64 %.pre, 1
  br i1 %40, label %._crit_edge32.loopexit.unr-lcssa, label %.lr.ph31.new

.lr.ph31.new:                                     ; preds = %.lr.ph31
  %unroll_iter = and i64 %.pre, 9223372036854775806
  br label %47

._crit_edge32.loopexit.unr-lcssa:                 ; preds = %60, %.lr.ph31
  %.220.lcssa.ph = phi i64 [ poison, %.lr.ph31 ], [ %.220.149, %60 ]
  %.01629.unr = phi i64 [ 0, %.lr.ph31 ], [ %61, %60 ]
  %.11928.unr = phi i64 [ %.018, %.lr.ph31 ], [ %.220.149, %60 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge32, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge32.loopexit.unr-lcssa
  %41 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %.01629.unr
  %42 = load i64, ptr %41, align 8, !tbaa !8
  %.not26.epil = icmp slt i64 %42, %39
  br i1 %.not26.epil, label %._crit_edge32, label %43

43:                                               ; preds = %.epil.preheader
  %44 = sdiv i64 %42, %38
  %45 = sub nsw i64 %.11928.unr, %44
  br label %._crit_edge32

._crit_edge32:                                    ; preds = %._crit_edge32.loopexit.unr-lcssa, %43, %.epil.preheader, %36
  %.119.lcssa = phi i64 [ %.018, %36 ], [ %.220.lcssa.ph, %._crit_edge32.loopexit.unr-lcssa ], [ %45, %43 ], [ %.11928.unr, %.epil.preheader ]
  %46 = icmp slt i64 %.119.lcssa, 1
  br label %62

47:                                               ; preds = %60, %.lr.ph31.new
  %.01629 = phi i64 [ 0, %.lr.ph31.new ], [ %61, %60 ]
  %.11928 = phi i64 [ %.018, %.lr.ph31.new ], [ %.220.149, %60 ]
  %niter = phi i64 [ 0, %.lr.ph31.new ], [ %niter.next.1, %60 ]
  %48 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %.01629
  %49 = load i64, ptr %48, align 16, !tbaa !8
  %.not26 = icmp slt i64 %49, %39
  br i1 %.not26, label %53, label %50

50:                                               ; preds = %47
  %51 = sdiv i64 %49, %38
  %52 = sub nsw i64 %.11928, %51
  br label %53

53:                                               ; preds = %47, %50
  %.220 = phi i64 [ %52, %50 ], [ %.11928, %47 ]
  %54 = or disjoint i64 %.01629, 1
  %55 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %54
  %56 = load i64, ptr %55, align 8, !tbaa !8
  %.not26.148 = icmp slt i64 %56, %39
  br i1 %.not26.148, label %60, label %57

57:                                               ; preds = %53
  %58 = sdiv i64 %56, %38
  %59 = sub nsw i64 %.220, %58
  br label %60

60:                                               ; preds = %57, %53
  %.220.149 = phi i64 [ %59, %57 ], [ %.220, %53 ]
  %61 = add nuw nsw i64 %.01629, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge32.loopexit.unr-lcssa, label %47, !llvm.loop !13

62:                                               ; preds = %26, %._crit_edge32
  %.2 = phi i1 [ %46, %._crit_edge32 ], [ false, %26 ]
  tail call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) @N, ptr noundef nonnull align 8 dereferenceable(8) @M) #6
  %63 = load i64, ptr @K, align 8, !tbaa !8
  %64 = getelementptr inbounds i64, ptr @A, i64 %63
  %65 = tail call noundef ptr @_ZSt4copyIPxS0_ET0_T_S2_S1_(ptr noundef nonnull @A, ptr noundef nonnull %64, ptr noundef nonnull @B)
  %66 = load i64, ptr @M, align 8, !tbaa !8
  %67 = and i64 %66, 1
  %.not25.1 = icmp eq i64 %67, 0
  %.pre41 = load i64, ptr @K, align 8, !tbaa !8
  br i1 %.not25.1, label %78, label %68

68:                                               ; preds = %62
  %69 = add nsw i64 %.pre41, -1
  %70 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %69
  %71 = load i64, ptr %70, align 8, !tbaa !8
  %72 = load i64, ptr @N, align 8, !tbaa !8
  %73 = mul nsw i64 %72, 3
  %74 = icmp slt i64 %71, %73
  br i1 %74, label %104, label %75

75:                                               ; preds = %68
  %76 = sdiv i64 %71, %72
  store i64 0, ptr %70, align 8, !tbaa !8
  %77 = sub nsw i64 %66, %76
  br label %78

78:                                               ; preds = %75, %62
  %.018.1 = phi i64 [ %77, %75 ], [ %66, %62 ]
  %79 = icmp sgt i64 %.pre41, 0
  br i1 %79, label %.lr.ph31.1, label %._crit_edge32.1

.lr.ph31.1:                                       ; preds = %78
  %80 = load i64, ptr @N, align 8, !tbaa !8
  %81 = shl nsw i64 %80, 1
  %xtraiter51 = and i64 %.pre41, 1
  %82 = icmp eq i64 %.pre41, 1
  br i1 %82, label %._crit_edge32.1.loopexit.unr-lcssa, label %.lr.ph31.1.new

.lr.ph31.1.new:                                   ; preds = %.lr.ph31.1
  %unroll_iter54 = and i64 %.pre41, 9223372036854775806
  br label %83

83:                                               ; preds = %96, %.lr.ph31.1.new
  %.01629.1 = phi i64 [ 0, %.lr.ph31.1.new ], [ %97, %96 ]
  %.11928.1 = phi i64 [ %.018.1, %.lr.ph31.1.new ], [ %.220.1.1, %96 ]
  %niter55 = phi i64 [ 0, %.lr.ph31.1.new ], [ %niter55.next.1, %96 ]
  %84 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %.01629.1
  %85 = load i64, ptr %84, align 16, !tbaa !8
  %.not26.1 = icmp slt i64 %85, %81
  br i1 %.not26.1, label %89, label %86

86:                                               ; preds = %83
  %87 = sdiv i64 %85, %80
  %88 = sub nsw i64 %.11928.1, %87
  br label %89

89:                                               ; preds = %86, %83
  %.220.1 = phi i64 [ %88, %86 ], [ %.11928.1, %83 ]
  %90 = or disjoint i64 %.01629.1, 1
  %91 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %90
  %92 = load i64, ptr %91, align 8, !tbaa !8
  %.not26.1.1 = icmp slt i64 %92, %81
  br i1 %.not26.1.1, label %96, label %93

93:                                               ; preds = %89
  %94 = sdiv i64 %92, %80
  %95 = sub nsw i64 %.220.1, %94
  br label %96

96:                                               ; preds = %93, %89
  %.220.1.1 = phi i64 [ %95, %93 ], [ %.220.1, %89 ]
  %97 = add nuw nsw i64 %.01629.1, 2
  %niter55.next.1 = add i64 %niter55, 2
  %niter55.ncmp.1 = icmp eq i64 %niter55.next.1, %unroll_iter54
  br i1 %niter55.ncmp.1, label %._crit_edge32.1.loopexit.unr-lcssa, label %83, !llvm.loop !13

._crit_edge32.1.loopexit.unr-lcssa:               ; preds = %96, %.lr.ph31.1
  %.220.1.lcssa.ph = phi i64 [ poison, %.lr.ph31.1 ], [ %.220.1.1, %96 ]
  %.01629.1.unr = phi i64 [ 0, %.lr.ph31.1 ], [ %97, %96 ]
  %.11928.1.unr = phi i64 [ %.018.1, %.lr.ph31.1 ], [ %.220.1.1, %96 ]
  %lcmp.mod52.not = icmp eq i64 %xtraiter51, 0
  br i1 %lcmp.mod52.not, label %._crit_edge32.1, label %.epil.preheader50

.epil.preheader50:                                ; preds = %._crit_edge32.1.loopexit.unr-lcssa
  %98 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %.01629.1.unr
  %99 = load i64, ptr %98, align 8, !tbaa !8
  %.not26.1.epil = icmp slt i64 %99, %81
  br i1 %.not26.1.epil, label %._crit_edge32.1, label %100

100:                                              ; preds = %.epil.preheader50
  %101 = sdiv i64 %99, %80
  %102 = sub nsw i64 %.11928.1.unr, %101
  br label %._crit_edge32.1

._crit_edge32.1:                                  ; preds = %._crit_edge32.1.loopexit.unr-lcssa, %100, %.epil.preheader50, %78
  %.119.lcssa.1 = phi i64 [ %.018.1, %78 ], [ %.220.1.lcssa.ph, %._crit_edge32.1.loopexit.unr-lcssa ], [ %102, %100 ], [ %.11928.1.unr, %.epil.preheader50 ]
  %103 = icmp slt i64 %.119.lcssa.1, 1
  %spec.select.1 = select i1 %103, i1 true, i1 %.2
  br label %104

104:                                              ; preds = %68, %._crit_edge32.1
  %.2.1 = phi i1 [ %spec.select.1, %._crit_edge32.1 ], [ %.2, %68 ]
  tail call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) @N, ptr noundef nonnull align 8 dereferenceable(8) @M) #6
  %105 = select i1 %.2.1, ptr @.str, ptr @.str.1
  %106 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %105)
  %107 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %106, i8 noundef signext 10)
  %108 = load i64, ptr @T, align 8, !tbaa !8
  %109 = add nsw i64 %108, -1
  store i64 %109, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %108, 0
  br i1 %.not, label %._crit_edge39, label %.lr.ph38, !llvm.loop !14

._crit_edge39:                                    ; preds = %104, %0
  ret i32 0
}

; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPxEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

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

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

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 = { 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 = { 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 = !{!"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 = distinct !{!13, !12}
!14 = distinct !{!14, !12}


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