; LLVM IR from wuzhouhui/leetcode :: 90_subsets_II (subsetsWithDup)

; 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"

@maxp = external hidden global i32, align 4
@p = external hidden global i32, align 4
@res = external hidden global ptr, align 8
@col = external hidden global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local ptr @subsetsWithDup(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %16 = load i32, ptr %7, align 4, !tbaa !9
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %21, label %18

18:                                               ; preds = %4
  %19 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr null, ptr %19, align 8, !tbaa !5
  %20 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 0, ptr %20, align 4, !tbaa !9
  store ptr null, ptr %5, align 8
  br label %117

21:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  store i64 0, ptr %10, align 8, !tbaa !11
  store i64 0, ptr %11, align 8, !tbaa !11
  br label %22

22:                                               ; preds = %106, %21
  %23 = load i64, ptr %11, align 8, !tbaa !11
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = zext i32 %24 to i64
  %26 = shl i64 1, %25
  %27 = icmp ult i64 %23, %26
  br i1 %27, label %28, label %111

28:                                               ; preds = %22
  store i32 0, ptr %13, align 4, !tbaa !9
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %44, %28
  %30 = load i32, ptr %12, align 4, !tbaa !9
  %31 = load i32, ptr %7, align 4, !tbaa !9
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %33, label %47

33:                                               ; preds = %29
  %34 = load i64, ptr %10, align 8, !tbaa !11
  %35 = load i32, ptr %12, align 4, !tbaa !9
  %36 = zext i32 %35 to i64
  %37 = shl i64 1, %36
  %38 = and i64 %34, %37
  %39 = icmp ne i64 %38, 0
  br i1 %39, label %40, label %43

40:                                               ; preds = %33
  %41 = load i32, ptr %13, align 4, !tbaa !9
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %13, align 4, !tbaa !9
  br label %43

43:                                               ; preds = %40, %33
  br label %44

44:                                               ; preds = %43
  %45 = load i32, ptr %12, align 4, !tbaa !9
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %12, align 4, !tbaa !9
  br label %29, !llvm.loop !13

47:                                               ; preds = %29
  %48 = load i32, ptr %13, align 4, !tbaa !9
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %69, label %50

50:                                               ; preds = %47
  store i32 8, ptr @maxp, align 4, !tbaa !9
  store i32 0, ptr @p, align 4, !tbaa !9
  %51 = load i32, ptr @maxp, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = mul i64 %52, 8
  %54 = call noalias ptr @malloc(i64 noundef %53) #5
  store ptr %54, ptr @res, align 8, !tbaa !5
  %55 = load i32, ptr @maxp, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = mul i64 %56, 4
  %58 = call noalias ptr @malloc(i64 noundef %57) #5
  store ptr %58, ptr @col, align 8, !tbaa !5
  %59 = load ptr, ptr @res, align 8, !tbaa !5
  %60 = load i32, ptr @p, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds ptr, ptr %59, i64 %61
  store ptr null, ptr %62, align 8, !tbaa !5
  %63 = load ptr, ptr @col, align 8, !tbaa !5
  %64 = load i32, ptr @p, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds i32, ptr %63, i64 %65
  store i32 0, ptr %66, align 4, !tbaa !9
  %67 = load i32, ptr @p, align 4, !tbaa !9
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr @p, align 4, !tbaa !9
  br label %106

69:                                               ; preds = %47
  %70 = load i32, ptr %13, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = mul i64 %71, 4
  %73 = call noalias ptr @malloc(i64 noundef %72) #5
  store ptr %73, ptr %15, align 8, !tbaa !5
  store i32 0, ptr %14, align 4, !tbaa !9
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %97, %69
  %75 = load i32, ptr %12, align 4, !tbaa !9
  %76 = load i32, ptr %7, align 4, !tbaa !9
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %78, label %100

78:                                               ; preds = %74
  %79 = load i64, ptr %10, align 8, !tbaa !11
  %80 = load i32, ptr %12, align 4, !tbaa !9
  %81 = zext i32 %80 to i64
  %82 = shl i64 1, %81
  %83 = and i64 %79, %82
  %84 = icmp ne i64 %83, 0
  br i1 %84, label %85, label %96

85:                                               ; preds = %78
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = load i32, ptr %12, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds i32, ptr %86, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !9
  %91 = load ptr, ptr %15, align 8, !tbaa !5
  %92 = load i32, ptr %14, align 4, !tbaa !9
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %14, align 4, !tbaa !9
  %94 = sext i32 %92 to i64
  %95 = getelementptr inbounds i32, ptr %91, i64 %94
  store i32 %90, ptr %95, align 4, !tbaa !9
  br label %96

96:                                               ; preds = %85, %78
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %12, align 4, !tbaa !9
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %12, align 4, !tbaa !9
  br label %74, !llvm.loop !15

100:                                              ; preds = %74
  %101 = load ptr, ptr %15, align 8, !tbaa !5
  %102 = load i32, ptr %13, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  call void @qsort(ptr noundef %101, i64 noundef %103, i64 noundef 4, ptr noundef @intcmp)
  %104 = load ptr, ptr %15, align 8, !tbaa !5
  %105 = load i32, ptr %13, align 4, !tbaa !9
  call void @add_ans(ptr noundef %104, i32 noundef %105)
  br label %106

106:                                              ; preds = %100, %50
  %107 = load i64, ptr %11, align 8, !tbaa !11
  %108 = add i64 %107, 1
  store i64 %108, ptr %11, align 8, !tbaa !11
  %109 = load i64, ptr %10, align 8, !tbaa !11
  %110 = add i64 %109, 1
  store i64 %110, ptr %10, align 8, !tbaa !11
  br label %22, !llvm.loop !16

111:                                              ; preds = %22
  %112 = load ptr, ptr @col, align 8, !tbaa !5
  %113 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %112, ptr %113, align 8, !tbaa !5
  %114 = load i32, ptr @p, align 4, !tbaa !9
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 %114, ptr %115, align 4, !tbaa !9
  %116 = load ptr, ptr @res, align 8, !tbaa !5
  store ptr %116, ptr %5, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %117

117:                                              ; preds = %111, %18
  %118 = load ptr, ptr %5, align 8
  ret ptr %118
}

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden i32 @intcmp(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @add_ans(ptr noundef, i32 noundef) #0

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind allocsize(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 #3 = { "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 = { nounwind }
attributes #5 = { nounwind allocsize(0) }

!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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !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"

@maxp = external hidden local_unnamed_addr global i32, align 4
@p = external hidden local_unnamed_addr global i32, align 4
@res = external hidden local_unnamed_addr global ptr, align 8
@col = external hidden local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local ptr @subsetsWithDup(ptr nocapture noundef readonly %0, i32 noundef %1, ptr nocapture noundef writeonly %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #0 {
  %.not = icmp eq i32 %1, 0
  br i1 %.not, label %57, label %.preheader41

.preheader41:                                     ; preds = %4
  %5 = zext i32 %1 to i64
  %6 = icmp sgt i32 %1, 0
  br i1 %6, label %.preheader.us.us.preheader, label %.preheader41.split.split

.preheader.us.us.preheader:                       ; preds = %.preheader41
  %min.iters.check = icmp ult i32 %1, 8
  %n.vec = and i64 %5, 2147483640
  %cmp.n = icmp eq i64 %n.vec, %5
  %xtraiter = and i64 %5, 1
  %7 = icmp eq i32 %1, 1
  %unroll_iter = and i64 %5, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader.us.us

.preheader.us.us:                                 ; preds = %.preheader.us.us.preheader, %44
  %.03550.us.us = phi i64 [ %45, %44 ], [ 0, %.preheader.us.us.preheader ]
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader.us.us
  %indvars.iv.ph = phi i64 [ 0, %.preheader.us.us ], [ %n.vec, %middle.block ]
  %.03143.us.us.ph = phi i32 [ 0, %.preheader.us.us ], [ %19, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.preheader.us.us
  %broadcast.splatinsert = insertelement <4 x i64> poison, i64 %.03550.us.us, i64 0
  %broadcast.splat = shufflevector <4 x i64> %broadcast.splatinsert, <4 x i64> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ]
  %vec.phi78 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ]
  %step.add = add <4 x i64> %vec.ind, <i64 4, i64 4, i64 4, i64 4>
  %8 = shl nuw <4 x i64> <i64 1, i64 1, i64 1, i64 1>, %vec.ind
  %9 = shl nuw <4 x i64> <i64 1, i64 1, i64 1, i64 1>, %step.add
  %10 = and <4 x i64> %8, %broadcast.splat
  %11 = and <4 x i64> %9, %broadcast.splat
  %12 = icmp ne <4 x i64> %10, zeroinitializer
  %13 = icmp ne <4 x i64> %11, zeroinitializer
  %14 = zext <4 x i1> %12 to <4 x i32>
  %15 = zext <4 x i1> %13 to <4 x i32>
  %16 = add <4 x i32> %vec.phi, %14
  %17 = add <4 x i32> %vec.phi78, %15
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
  %18 = icmp eq i64 %index.next, %n.vec
  br i1 %18, label %middle.block, label %vector.body, !llvm.loop !5

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %17, %16
  %19 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  br i1 %cmp.n, label %._crit_edge.us.us, label %scalar.ph.preheader

.lr.ph47.us.us:                                   ; preds = %._crit_edge.us.us
  %20 = zext nneg i32 %spec.select.us.us.lcssa to i64
  %21 = shl nuw nsw i64 %20, 2
  %22 = tail call noalias ptr @malloc(i64 noundef %21) #4
  br i1 %7, label %._crit_edge48.us.us.unr-lcssa, label %.lr.ph47.us.us.new

.lr.ph47.us.us.new:                               ; preds = %.lr.ph47.us.us, %40
  %indvars.iv69 = phi i64 [ %indvars.iv.next70.1, %40 ], [ 0, %.lr.ph47.us.us ]
  %.03045.us.us = phi i32 [ %.1.us.us.1, %40 ], [ 0, %.lr.ph47.us.us ]
  %niter = phi i64 [ %niter.next.1, %40 ], [ 0, %.lr.ph47.us.us ]
  %23 = shl nuw i64 1, %indvars.iv69
  %24 = and i64 %23, %.03550.us.us
  %.not39.us.us = icmp eq i64 %24, 0
  br i1 %.not39.us.us, label %31, label %25

25:                                               ; preds = %.lr.ph47.us.us.new
  %26 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv69
  %27 = load i32, ptr %26, align 4, !tbaa !9
  %28 = add nsw i32 %.03045.us.us, 1
  %29 = sext i32 %.03045.us.us to i64
  %30 = getelementptr inbounds i32, ptr %22, i64 %29
  store i32 %27, ptr %30, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %25, %.lr.ph47.us.us.new
  %.1.us.us = phi i32 [ %28, %25 ], [ %.03045.us.us, %.lr.ph47.us.us.new ]
  %32 = shl nuw i64 2, %indvars.iv69
  %33 = and i64 %32, %.03550.us.us
  %.not39.us.us.1 = icmp eq i64 %33, 0
  br i1 %.not39.us.us.1, label %40, label %34

34:                                               ; preds = %31
  %indvars.iv.next70 = or disjoint i64 %indvars.iv69, 1
  %35 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.next70
  %36 = load i32, ptr %35, align 4, !tbaa !9
  %37 = add nsw i32 %.1.us.us, 1
  %38 = sext i32 %.1.us.us to i64
  %39 = getelementptr inbounds i32, ptr %22, i64 %38
  store i32 %36, ptr %39, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %34, %31
  %.1.us.us.1 = phi i32 [ %37, %34 ], [ %.1.us.us, %31 ]
  %indvars.iv.next70.1 = add nuw nsw i64 %indvars.iv69, 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_edge48.us.us.unr-lcssa, label %.lr.ph47.us.us.new, !llvm.loop !13

41:                                               ; preds = %._crit_edge.us.us
  store i32 8, ptr @maxp, align 4, !tbaa !9
  %42 = tail call noalias dereferenceable_or_null(64) ptr @malloc(i64 noundef 64) #4
  store ptr %42, ptr @res, align 8, !tbaa !14
  %43 = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #4
  store ptr %43, ptr @col, align 8, !tbaa !14
  store ptr null, ptr %42, align 8, !tbaa !14
  store i32 0, ptr %43, align 4, !tbaa !9
  store i32 1, ptr @p, align 4, !tbaa !9
  br label %44

44:                                               ; preds = %._crit_edge48.us.us, %41
  %45 = add i64 %.03550.us.us, 1
  %.035.highbits.us.us = lshr i64 %45, %5
  %46 = icmp eq i64 %.035.highbits.us.us, 0
  br i1 %46, label %.preheader.us.us, label %.split.us.loopexit, !llvm.loop !16

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %.03143.us.us = phi i32 [ %spec.select.us.us, %scalar.ph ], [ %.03143.us.us.ph, %scalar.ph.preheader ]
  %47 = shl nuw i64 1, %indvars.iv
  %48 = and i64 %47, %.03550.us.us
  %.not40.us.us = icmp ne i64 %48, 0
  %49 = zext i1 %.not40.us.us to i32
  %spec.select.us.us = add nuw nsw i32 %.03143.us.us, %49
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %5
  br i1 %exitcond.not, label %._crit_edge.us.us, label %scalar.ph, !llvm.loop !17

._crit_edge.us.us:                                ; preds = %scalar.ph, %middle.block
  %spec.select.us.us.lcssa = phi i32 [ %19, %middle.block ], [ %spec.select.us.us, %scalar.ph ]
  %.not38.us.us = icmp eq i32 %spec.select.us.us.lcssa, 0
  br i1 %.not38.us.us, label %41, label %.lr.ph47.us.us

._crit_edge48.us.us.unr-lcssa:                    ; preds = %40, %.lr.ph47.us.us
  %indvars.iv69.unr = phi i64 [ 0, %.lr.ph47.us.us ], [ %indvars.iv.next70.1, %40 ]
  %.03045.us.us.unr = phi i32 [ 0, %.lr.ph47.us.us ], [ %.1.us.us.1, %40 ]
  br i1 %lcmp.mod.not, label %._crit_edge48.us.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge48.us.us.unr-lcssa
  %50 = shl nuw i64 1, %indvars.iv69.unr
  %51 = and i64 %50, %.03550.us.us
  %.not39.us.us.epil = icmp eq i64 %51, 0
  br i1 %.not39.us.us.epil, label %._crit_edge48.us.us, label %52

52:                                               ; preds = %.epil.preheader
  %53 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv69.unr
  %54 = load i32, ptr %53, align 4, !tbaa !9
  %55 = sext i32 %.03045.us.us.unr to i64
  %56 = getelementptr inbounds i32, ptr %22, i64 %55
  store i32 %54, ptr %56, align 4, !tbaa !9
  br label %._crit_edge48.us.us

._crit_edge48.us.us:                              ; preds = %.epil.preheader, %52, %._crit_edge48.us.us.unr-lcssa
  tail call void @qsort(ptr noundef %22, i64 noundef %20, i64 noundef 4, ptr noundef nonnull @intcmp) #5
  tail call void @add_ans(ptr noundef %22, i32 noundef %spec.select.us.us.lcssa)
  br label %44

.preheader41.split.split:                         ; preds = %.preheader41
  store i32 8, ptr @maxp, align 4, !tbaa !9
  br label %.preheader

57:                                               ; preds = %4
  store ptr null, ptr %2, align 8, !tbaa !14
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %65

.preheader:                                       ; preds = %.preheader41.split.split, %.preheader
  %.03550 = phi i64 [ 0, %.preheader41.split.split ], [ %60, %.preheader ]
  %58 = tail call noalias dereferenceable_or_null(64) ptr @malloc(i64 noundef 64) #4
  %59 = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #4
  store ptr null, ptr %58, align 8, !tbaa !14
  store i32 0, ptr %59, align 4, !tbaa !9
  %60 = add i64 %.03550, 1
  %.035.highbits = lshr i64 %60, %5
  %61 = icmp eq i64 %.035.highbits, 0
  br i1 %61, label %.preheader, label %.split.split, !llvm.loop !16

.split.split:                                     ; preds = %.preheader
  store i32 1, ptr @p, align 4, !tbaa !9
  store ptr %58, ptr @res, align 8, !tbaa !14
  store ptr %59, ptr @col, align 8, !tbaa !14
  br label %.split.us

.split.us.loopexit:                               ; preds = %44
  %.pre = load ptr, ptr @col, align 8, !tbaa !14
  %.pre74 = load i32, ptr @p, align 4, !tbaa !9
  br label %.split.us

.split.us:                                        ; preds = %.split.us.loopexit, %.split.split
  %62 = phi i32 [ %.pre74, %.split.us.loopexit ], [ 1, %.split.split ]
  %63 = phi ptr [ %.pre, %.split.us.loopexit ], [ %59, %.split.split ]
  store ptr %63, ptr %2, align 8, !tbaa !14
  store i32 %62, ptr %3, align 4, !tbaa !9
  %64 = load ptr, ptr @res, align 8, !tbaa !14
  br label %65

65:                                               ; preds = %.split.us, %57
  %.0 = phi ptr [ %64, %.split.us ], [ null, %57 ]
  ret ptr %.0
}

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @intcmp(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @add_ans(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3

attributes #0 = { 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 #1 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { nofree "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind allocsize(0) }
attributes #5 = { nounwind }

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

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


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass