; LLVM IR from eyangch/competitive-programming :: Codeforces/1551 (b2)

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

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

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@a = external dso_local global [200000 x i64], align 16
@occ = external dso_local global [200000 x i64], align 16
@ans = external dso_local global [200000 x i64], align 16
@id = external dso_local global [200000 x i64], 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 i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca %class.anon, align 1
  %6 = alloca i64, 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
  store i32 0, ptr %1, align 4
  %12 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %13 = getelementptr i8, ptr %12, i64 -24
  %14 = load i64, ptr %13, align 8
  %15 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %14
  %16 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %15, ptr noundef null)
  %17 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %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) @T)
  br label %19

19:                                               ; preds = %142, %0
  %20 = load i64, ptr @T, align 8, !tbaa !8
  %21 = add nsw i64 %20, -1
  store i64 %21, ptr @T, align 8, !tbaa !8
  %22 = icmp ne i64 %20, 0
  br i1 %22, label %23, label %144

23:                                               ; preds = %19
  %24 = 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)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %26 = load i64, ptr @N, align 8, !tbaa !8
  %27 = getelementptr inbounds i64, ptr @occ, i64 %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !11
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @occ, ptr noundef %27, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %28 = load i64, ptr @N, align 8, !tbaa !8
  %29 = getelementptr inbounds i64, ptr @ans, i64 %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !11
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @ans, ptr noundef %29, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  %30 = load i64, ptr @N, align 8, !tbaa !8
  %31 = getelementptr inbounds i64, ptr @id, i64 %30
  call void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef @id, ptr noundef %31, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store i64 0, ptr %4, align 8, !tbaa !8
  br label %32

32:                                               ; preds = %51, %23
  %33 = load i64, ptr %4, align 8, !tbaa !8
  %34 = load i64, ptr @N, align 8, !tbaa !8
  %35 = icmp slt i64 %33, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %54

37:                                               ; preds = %32
  %38 = load i64, ptr %4, align 8, !tbaa !8
  %39 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %38
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %39)
  %41 = load i64, ptr %4, align 8, !tbaa !8
  %42 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %41
  %43 = load i64, ptr %42, align 8, !tbaa !8
  %44 = add nsw i64 %43, -1
  store i64 %44, ptr %42, align 8, !tbaa !8
  %45 = load i64, ptr %4, align 8, !tbaa !8
  %46 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !8
  %48 = getelementptr inbounds [200000 x i64], ptr @occ, i64 0, i64 %47
  %49 = load i64, ptr %48, align 8, !tbaa !8
  %50 = add nsw i64 %49, 1
  store i64 %50, ptr %48, align 8, !tbaa !8
  br label %51

51:                                               ; preds = %37
  %52 = load i64, ptr %4, align 8, !tbaa !8
  %53 = add nsw i64 %52, 1
  store i64 %53, ptr %4, align 8, !tbaa !8
  br label %32, !llvm.loop !13

54:                                               ; preds = %36
  %55 = load i64, ptr @N, align 8, !tbaa !8
  %56 = getelementptr inbounds i64, ptr @id, i64 %55
  call void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef @id, ptr noundef %56)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store i64 0, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 0, ptr %7, align 8, !tbaa !8
  br label %57

57:                                               ; preds = %74, %54
  %58 = load i64, ptr %7, align 8, !tbaa !8
  %59 = load i64, ptr @N, align 8, !tbaa !8
  %60 = icmp slt i64 %58, %59
  br i1 %60, label %62, label %61

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

62:                                               ; preds = %57
  %63 = load i64, ptr %7, align 8, !tbaa !8
  %64 = getelementptr inbounds [200000 x i64], ptr @occ, i64 0, i64 %63
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @K, ptr noundef nonnull align 8 dereferenceable(8) %64)
  %66 = load i64, ptr %65, align 8, !tbaa !8
  %67 = load i64, ptr %7, align 8, !tbaa !8
  %68 = getelementptr inbounds [200000 x i64], ptr @occ, i64 0, i64 %67
  store i64 %66, ptr %68, align 8, !tbaa !8
  %69 = load i64, ptr %7, align 8, !tbaa !8
  %70 = getelementptr inbounds [200000 x i64], ptr @occ, i64 0, i64 %69
  %71 = load i64, ptr %70, align 8, !tbaa !8
  %72 = load i64, ptr %6, align 8, !tbaa !8
  %73 = add nsw i64 %72, %71
  store i64 %73, ptr %6, align 8, !tbaa !8
  br label %74

74:                                               ; preds = %62
  %75 = load i64, ptr %7, align 8, !tbaa !8
  %76 = add nsw i64 %75, 1
  store i64 %76, ptr %7, align 8, !tbaa !8
  br label %57, !llvm.loop !15

77:                                               ; preds = %61
  %78 = load i64, ptr %6, align 8, !tbaa !8
  %79 = load i64, ptr @K, align 8, !tbaa !8
  %80 = sdiv i64 %78, %79
  %81 = load i64, ptr @K, align 8, !tbaa !8
  %82 = mul nsw i64 %80, %81
  store i64 %82, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 0, ptr %9, align 8, !tbaa !8
  br label %83

83:                                               ; preds = %123, %77
  %84 = load i64, ptr %9, align 8, !tbaa !8
  %85 = load i64, ptr @N, align 8, !tbaa !8
  %86 = icmp slt i64 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %83
  store i32 10, ptr %10, align 4
  br label %126

88:                                               ; preds = %83
  %89 = load i64, ptr %6, align 8, !tbaa !8
  %90 = icmp eq i64 %89, 0
  br i1 %90, label %91, label %92

91:                                               ; preds = %88
  store i32 10, ptr %10, align 4
  br label %126

92:                                               ; preds = %88
  %93 = load i64, ptr %9, align 8, !tbaa !8
  %94 = getelementptr inbounds [200000 x i64], ptr @id, i64 0, i64 %93
  %95 = load i64, ptr %94, align 8, !tbaa !8
  %96 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %95
  %97 = load i64, ptr %96, align 8, !tbaa !8
  %98 = getelementptr inbounds [200000 x i64], ptr @occ, i64 0, i64 %97
  %99 = load i64, ptr %98, align 8, !tbaa !8
  %100 = icmp eq i64 %99, 0
  br i1 %100, label %101, label %102

101:                                              ; preds = %92
  br label %123

102:                                              ; preds = %92
  %103 = load i64, ptr %8, align 8, !tbaa !8
  %104 = add nsw i64 %103, 1
  %105 = load i64, ptr %9, align 8, !tbaa !8
  %106 = getelementptr inbounds [200000 x i64], ptr @id, i64 0, i64 %105
  %107 = load i64, ptr %106, align 8, !tbaa !8
  %108 = getelementptr inbounds [200000 x i64], ptr @ans, i64 0, i64 %107
  store i64 %104, ptr %108, align 8, !tbaa !8
  %109 = load i64, ptr %8, align 8, !tbaa !8
  %110 = add nsw i64 %109, 1
  %111 = load i64, ptr @K, align 8, !tbaa !8
  %112 = srem i64 %110, %111
  store i64 %112, ptr %8, align 8, !tbaa !8
  %113 = load i64, ptr %9, align 8, !tbaa !8
  %114 = getelementptr inbounds [200000 x i64], ptr @id, i64 0, i64 %113
  %115 = load i64, ptr %114, align 8, !tbaa !8
  %116 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %115
  %117 = load i64, ptr %116, align 8, !tbaa !8
  %118 = getelementptr inbounds [200000 x i64], ptr @occ, i64 0, i64 %117
  %119 = load i64, ptr %118, align 8, !tbaa !8
  %120 = add nsw i64 %119, -1
  store i64 %120, ptr %118, align 8, !tbaa !8
  %121 = load i64, ptr %6, align 8, !tbaa !8
  %122 = add nsw i64 %121, -1
  store i64 %122, ptr %6, align 8, !tbaa !8
  br label %123

123:                                              ; preds = %102, %101
  %124 = load i64, ptr %9, align 8, !tbaa !8
  %125 = add nsw i64 %124, 1
  store i64 %125, ptr %9, align 8, !tbaa !8
  br label %83, !llvm.loop !16

126:                                              ; preds = %91, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %127

127:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store i64 0, ptr %11, align 8, !tbaa !8
  br label %128

128:                                              ; preds = %139, %127
  %129 = load i64, ptr %11, align 8, !tbaa !8
  %130 = load i64, ptr @N, align 8, !tbaa !8
  %131 = icmp slt i64 %129, %130
  br i1 %131, label %133, label %132

132:                                              ; preds = %128
  store i32 13, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %142

133:                                              ; preds = %128
  %134 = load i64, ptr %11, align 8, !tbaa !8
  %135 = getelementptr inbounds [200000 x i64], ptr @ans, i64 0, i64 %134
  %136 = load i64, ptr %135, align 8, !tbaa !8
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %136)
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %137, i8 noundef signext 32)
  br label %139

139:                                              ; preds = %133
  %140 = load i64, ptr %11, align 8, !tbaa !8
  %141 = add nsw i64 %140, 1
  store i64 %141, ptr %11, align 8, !tbaa !8
  br label %128, !llvm.loop !17

142:                                              ; preds = %132
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %19, !llvm.loop !18

144:                                              ; preds = %19
  %145 = load i32, ptr %1, align 4
  ret i32 %145
}

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #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) #4

; 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 = { 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 willreturn memory(argmem: readwrite) }
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 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


; 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
@K = external dso_local global i64, align 8
@a = external dso_local global [200000 x i64], align 16
@occ = external dso_local global [200000 x i64], align 16
@ans = external dso_local global [200000 x i64], align 16
@id = external dso_local global [200000 x i64], 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 i32, align 4
  %2 = alloca i32, align 4
  %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) @T)
  %10 = load i64, ptr @T, align 8, !tbaa !8
  %11 = add nsw i64 %10, -1
  store i64 %11, ptr @T, align 8, !tbaa !8
  %.not50 = icmp eq i64 %10, 0
  br i1 %.not50, label %._crit_edge53, label %.lr.ph52

.lr.ph52:                                         ; preds = %0, %._crit_edge49
  %12 = 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)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %14 = load i64, ptr @N, align 8, !tbaa !8
  %15 = getelementptr inbounds i64, ptr @occ, i64 %14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !11
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @occ, ptr noundef nonnull %15, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %16 = load i64, ptr @N, align 8, !tbaa !8
  %17 = getelementptr inbounds i64, ptr @ans, i64 %16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr %2, align 4, !tbaa !11
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @ans, ptr noundef nonnull %17, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %18 = load i64, ptr @N, align 8, !tbaa !8
  %19 = getelementptr inbounds i64, ptr @id, i64 %18
  call void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef nonnull @id, ptr noundef nonnull %19, i32 noundef 0)
  %20 = load i64, ptr @N, align 8, !tbaa !8
  %21 = icmp sgt i64 %20, 0
  br i1 %21, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph52
  %.lcssa = phi i64 [ %20, %.lr.ph52 ], [ %33, %.lr.ph ]
  %22 = getelementptr inbounds i64, ptr @id, i64 %.lcssa
  call void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef nonnull @id, ptr noundef nonnull %22)
  %23 = load i64, ptr @N, align 8, !tbaa !8
  %24 = icmp sgt i64 %23, 0
  br i1 %24, label %.lr.ph37, label %._crit_edge49

.lr.ph:                                           ; preds = %.lr.ph52, %.lr.ph
  %.03033 = phi i64 [ %32, %.lr.ph ], [ 0, %.lr.ph52 ]
  %25 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %.03033
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %25)
  %27 = load i64, ptr %25, align 8, !tbaa !8
  %28 = add nsw i64 %27, -1
  store i64 %28, ptr %25, align 8, !tbaa !8
  %29 = getelementptr inbounds [200000 x i64], ptr @occ, i64 0, i64 %28
  %30 = load i64, ptr %29, align 8, !tbaa !8
  %31 = add nsw i64 %30, 1
  store i64 %31, ptr %29, align 8, !tbaa !8
  %32 = add nuw nsw i64 %.03033, 1
  %33 = load i64, ptr @N, align 8, !tbaa !8
  %34 = icmp slt i64 %32, %33
  br i1 %34, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge38:                                    ; preds = %.lr.ph37
  %35 = load i64, ptr @K, align 8, !tbaa !8
  %36 = srem i64 %43, %35
  %37 = sub nsw i64 %43, %36
  %38 = icmp slt i64 %45, 1
  %39 = icmp eq i64 %37, 0
  %or.cond41 = select i1 %38, i1 true, i1 %39
  br i1 %or.cond41, label %.preheader, label %.lr.ph46

.lr.ph37:                                         ; preds = %._crit_edge, %.lr.ph37
  %.028.fr35 = phi i64 [ %43, %.lr.ph37 ], [ 0, %._crit_edge ]
  %.02734 = phi i64 [ %44, %.lr.ph37 ], [ 0, %._crit_edge ]
  %40 = getelementptr inbounds [200000 x i64], ptr @occ, i64 0, i64 %.02734
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @K, ptr noundef nonnull align 8 dereferenceable(8) %40)
  %42 = load i64, ptr %41, align 8, !tbaa !8
  %.fr = freeze i64 %42
  store i64 %.fr, ptr %40, align 8, !tbaa !8
  %43 = add i64 %.fr, %.028.fr35
  %44 = add nuw nsw i64 %.02734, 1
  %45 = load i64, ptr @N, align 8, !tbaa !8
  %46 = icmp slt i64 %44, %45
  br i1 %46, label %.lr.ph37, label %._crit_edge38, !llvm.loop !15

.preheader:                                       ; preds = %61, %._crit_edge38
  %47 = icmp sgt i64 %45, 0
  br i1 %47, label %.lr.ph48, label %._crit_edge49

.lr.ph46:                                         ; preds = %._crit_edge38, %61
  %.02544 = phi i64 [ %62, %61 ], [ 0, %._crit_edge38 ]
  %.02643 = phi i64 [ %.1, %61 ], [ 0, %._crit_edge38 ]
  %.12942 = phi i64 [ %.2, %61 ], [ %37, %._crit_edge38 ]
  %48 = getelementptr inbounds [200000 x i64], ptr @id, i64 0, i64 %.02544
  %49 = load i64, ptr %48, align 8, !tbaa !8
  %50 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %49
  %51 = load i64, ptr %50, align 8, !tbaa !8
  %52 = getelementptr inbounds [200000 x i64], ptr @occ, i64 0, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !8
  %54 = icmp eq i64 %53, 0
  br i1 %54, label %61, label %55

55:                                               ; preds = %.lr.ph46
  %56 = add nsw i64 %.02643, 1
  %57 = getelementptr inbounds [200000 x i64], ptr @ans, i64 0, i64 %49
  store i64 %56, ptr %57, align 8, !tbaa !8
  %58 = srem i64 %56, %35
  %59 = add nsw i64 %53, -1
  store i64 %59, ptr %52, align 8, !tbaa !8
  %60 = add nsw i64 %.12942, -1
  br label %61

61:                                               ; preds = %.lr.ph46, %55
  %.2 = phi i64 [ %.12942, %.lr.ph46 ], [ %60, %55 ]
  %.1 = phi i64 [ %.02643, %.lr.ph46 ], [ %58, %55 ]
  %62 = add nuw nsw i64 %.02544, 1
  %63 = icmp sge i64 %62, %45
  %64 = icmp eq i64 %.2, 0
  %or.cond = select i1 %63, i1 true, i1 %64
  br i1 %or.cond, label %.preheader, label %.lr.ph46, !llvm.loop !16

._crit_edge49:                                    ; preds = %.lr.ph48, %._crit_edge, %.preheader
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  %66 = load i64, ptr @T, align 8, !tbaa !8
  %67 = add nsw i64 %66, -1
  store i64 %67, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %66, 0
  br i1 %.not, label %._crit_edge53, label %.lr.ph52, !llvm.loop !17

.lr.ph48:                                         ; preds = %.preheader, %.lr.ph48
  %.047 = phi i64 [ %72, %.lr.ph48 ], [ 0, %.preheader ]
  %68 = getelementptr inbounds [200000 x i64], ptr @ans, i64 0, i64 %.047
  %69 = load i64, ptr %68, align 8, !tbaa !8
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %69)
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %70, i8 noundef signext 32)
  %72 = add nuw nsw i64 %.047, 1
  %73 = load i64, ptr @N, align 8, !tbaa !8
  %74 = icmp slt i64 %72, %73
  br i1 %74, label %.lr.ph48, label %._crit_edge49, !llvm.loop !18

._crit_edge53:                                    ; preds = %._crit_edge49, %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 @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #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) 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 #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 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


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