; LLVM IR from wuzhouhui/leetcode :: 78_subsets (subsets)

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

; Function Attrs: nounwind uwtable
define dso_local ptr @subsets(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 i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  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
  %20 = load i32, ptr %7, align 4, !tbaa !9
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %25, label %22

22:                                               ; preds = %4
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr null, ptr %23, align 8, !tbaa !5
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 0, ptr %24, align 4, !tbaa !9
  store ptr null, ptr %5, align 8
  br label %157

25:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store ptr null, ptr %16, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %11, i8 -1, i64 8, i1 false)
  store i64 0, ptr %10, align 8, !tbaa !11
  br label %26

26:                                               ; preds = %148, %25
  %27 = load i64, ptr %10, align 8, !tbaa !11
  %28 = load i32, ptr %7, align 4, !tbaa !9
  %29 = zext i32 %28 to i64
  %30 = shl i64 1, %29
  %31 = icmp ult i64 %27, %30
  br i1 %31, label %32, label %151

32:                                               ; preds = %26
  store i32 0, ptr %15, align 4, !tbaa !9
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %48, %32
  %34 = load i32, ptr %12, align 4, !tbaa !9
  %35 = load i32, ptr %7, align 4, !tbaa !9
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %37, label %51

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

44:                                               ; preds = %37
  %45 = load i32, ptr %15, align 4, !tbaa !9
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %15, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %44, %37
  br label %48

48:                                               ; preds = %47
  %49 = load i32, ptr %12, align 4, !tbaa !9
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %12, align 4, !tbaa !9
  br label %33, !llvm.loop !13

51:                                               ; preds = %33
  %52 = load ptr, ptr %16, align 8, !tbaa !5
  %53 = icmp ne ptr %52, null
  br i1 %53, label %63, label %54

54:                                               ; preds = %51
  store i32 8, ptr %19, align 4, !tbaa !9
  store i32 0, ptr %18, align 4, !tbaa !9
  %55 = load i32, ptr %19, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = mul i64 %56, 8
  %58 = call noalias ptr @malloc(i64 noundef %57) #7
  store ptr %58, ptr %16, align 8, !tbaa !5
  %59 = load i32, ptr %19, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = mul i64 %60, 4
  %62 = call noalias ptr @malloc(i64 noundef %61) #7
  store ptr %62, ptr %17, align 8, !tbaa !5
  br label %63

63:                                               ; preds = %54, %51
  %64 = load i32, ptr %18, align 4, !tbaa !9
  %65 = load i32, ptr %19, align 4, !tbaa !9
  %66 = icmp sge i32 %64, %65
  br i1 %66, label %67, label %80

67:                                               ; preds = %63
  %68 = load i32, ptr %19, align 4, !tbaa !9
  %69 = add nsw i32 %68, 8
  store i32 %69, ptr %19, align 4, !tbaa !9
  %70 = load ptr, ptr %16, align 8, !tbaa !5
  %71 = load i32, ptr %19, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = mul i64 %72, 8
  %74 = call ptr @realloc(ptr noundef %70, i64 noundef %73) #8
  store ptr %74, ptr %16, align 8, !tbaa !5
  %75 = load ptr, ptr %17, align 8, !tbaa !5
  %76 = load i32, ptr %19, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = mul i64 %77, 4
  %79 = call ptr @realloc(ptr noundef %75, i64 noundef %78) #8
  store ptr %79, ptr %17, align 8, !tbaa !5
  br label %80

80:                                               ; preds = %67, %63
  %81 = load i32, ptr %15, align 4, !tbaa !9
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %94, label %83

83:                                               ; preds = %80
  %84 = load ptr, ptr %16, align 8, !tbaa !5
  %85 = load i32, ptr %18, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds ptr, ptr %84, i64 %86
  store ptr null, ptr %87, align 8, !tbaa !5
  %88 = load ptr, ptr %17, align 8, !tbaa !5
  %89 = load i32, ptr %18, align 4, !tbaa !9
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds i32, ptr %88, i64 %90
  store i32 0, ptr %91, align 4, !tbaa !9
  %92 = load i32, ptr %18, align 4, !tbaa !9
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %18, align 4, !tbaa !9
  br label %148

94:                                               ; preds = %80
  %95 = load i32, ptr %15, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = mul i64 %96, 4
  %98 = call noalias ptr @malloc(i64 noundef %97) #7
  %99 = load ptr, ptr %16, align 8, !tbaa !5
  %100 = load i32, ptr %18, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds ptr, ptr %99, i64 %101
  store ptr %98, ptr %102, align 8, !tbaa !5
  store i32 0, ptr %13, align 4, !tbaa !9
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %103

103:                                              ; preds = %130, %94
  %104 = load i32, ptr %12, align 4, !tbaa !9
  %105 = load i32, ptr %7, align 4, !tbaa !9
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %107, label %133

107:                                              ; preds = %103
  %108 = load i64, ptr %10, align 8, !tbaa !11
  %109 = load i32, ptr %12, align 4, !tbaa !9
  %110 = zext i32 %109 to i64
  %111 = shl i64 1, %110
  %112 = and i64 %108, %111
  %113 = icmp ne i64 %112, 0
  br i1 %113, label %114, label %129

114:                                              ; preds = %107
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = load i32, ptr %12, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds i32, ptr %115, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !9
  %120 = load ptr, ptr %16, align 8, !tbaa !5
  %121 = load i32, ptr %18, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds ptr, ptr %120, i64 %122
  %124 = load ptr, ptr %123, align 8, !tbaa !5
  %125 = load i32, ptr %13, align 4, !tbaa !9
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %13, align 4, !tbaa !9
  %127 = sext i32 %125 to i64
  %128 = getelementptr inbounds i32, ptr %124, i64 %127
  store i32 %119, ptr %128, align 4, !tbaa !9
  br label %129

129:                                              ; preds = %114, %107
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %12, align 4, !tbaa !9
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %12, align 4, !tbaa !9
  br label %103, !llvm.loop !15

133:                                              ; preds = %103
  %134 = load ptr, ptr %16, align 8, !tbaa !5
  %135 = load i32, ptr %18, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds ptr, ptr %134, i64 %136
  %138 = load ptr, ptr %137, align 8, !tbaa !5
  %139 = load i32, ptr %15, align 4, !tbaa !9
  %140 = sext i32 %139 to i64
  call void @qsort(ptr noundef %138, i64 noundef %140, i64 noundef 4, ptr noundef @intcmp)
  %141 = load i32, ptr %15, align 4, !tbaa !9
  %142 = load ptr, ptr %17, align 8, !tbaa !5
  %143 = load i32, ptr %18, align 4, !tbaa !9
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds i32, ptr %142, i64 %144
  store i32 %141, ptr %145, align 4, !tbaa !9
  %146 = load i32, ptr %18, align 4, !tbaa !9
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %18, align 4, !tbaa !9
  br label %148

148:                                              ; preds = %133, %83
  %149 = load i64, ptr %10, align 8, !tbaa !11
  %150 = add i64 %149, 1
  store i64 %150, ptr %10, align 8, !tbaa !11
  br label %26, !llvm.loop !16

151:                                              ; preds = %26
  %152 = load ptr, ptr %17, align 8, !tbaa !5
  %153 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %152, ptr %153, align 8, !tbaa !5
  %154 = load i32, ptr %18, align 4, !tbaa !9
  %155 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 %154, ptr %155, align 4, !tbaa !9
  %156 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %156, ptr %5, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %157

157:                                              ; preds = %151, %22
  %158 = load ptr, ptr %5, align 8
  ret ptr %158
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #4

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

; Function Attrs: nounwind uwtable
declare hidden i32 @intcmp(ptr noundef, ptr 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #4 = { nounwind allocsize(1) "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 = { "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 }
attributes #7 = { nounwind allocsize(0) }
attributes #8 = { nounwind allocsize(1) }

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

; Function Attrs: nounwind uwtable
define dso_local ptr @subsets(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 %.loopexit, label %.preheader83

.preheader83:                                     ; preds = %4
  %5 = zext i32 %1 to i64
  %6 = icmp sgt i32 %1, 0
  %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

.preheader:                                       ; preds = %.preheader83, %67
  %.096 = phi i32 [ undef, %.preheader83 ], [ %.2, %67 ]
  %.05395 = phi i32 [ undef, %.preheader83 ], [ %.255, %67 ]
  %.05694 = phi ptr [ undef, %.preheader83 ], [ %.258, %67 ]
  %.05993 = phi ptr [ null, %.preheader83 ], [ %.261, %67 ]
  %.06991 = phi i64 [ 0, %.preheader83 ], [ %69, %67 ]
  br i1 %6, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader
  br i1 %min.iters.check, label %.lr.ph.preheader106, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %broadcast.splatinsert = insertelement <4 x i64> poison, i64 %.06991, 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.phi105 = 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.phi105, %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, label %.lr.ph.preheader106

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

.lr.ph:                                           ; preds = %.lr.ph.preheader106, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader106 ]
  %.06285 = phi i32 [ %spec.select, %.lr.ph ], [ %.06285.ph, %.lr.ph.preheader106 ]
  %20 = shl nuw i64 1, %indvars.iv
  %21 = and i64 %20, %.06991
  %.not76 = icmp ne i64 %21, 0
  %22 = zext i1 %.not76 to i32
  %spec.select = add nuw nsw i32 %.06285, %22
  %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, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %.preheader
  %.062.lcssa = phi i32 [ 0, %.preheader ], [ %19, %middle.block ], [ %spec.select, %.lr.ph ]
  %.not72 = icmp eq ptr %.05993, null
  br i1 %.not72, label %.thread, label %25

.thread:                                          ; preds = %._crit_edge
  %23 = tail call noalias dereferenceable_or_null(64) ptr @malloc(i64 noundef 64) #5
  %24 = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #5
  br label %33

25:                                               ; preds = %._crit_edge
  %.not73 = icmp slt i32 %.05395, %.096
  br i1 %.not73, label %33, label %26

26:                                               ; preds = %25
  %27 = add nsw i32 %.096, 8
  %28 = sext i32 %27 to i64
  %29 = shl nsw i64 %28, 3
  %30 = tail call ptr @realloc(ptr noundef nonnull %.05993, i64 noundef %29) #6
  %31 = shl nsw i64 %28, 2
  %32 = tail call ptr @realloc(ptr noundef %.05694, i64 noundef %31) #6
  br label %33

33:                                               ; preds = %.thread, %26, %25
  %.15482 = phi i32 [ %.05395, %26 ], [ %.05395, %25 ], [ 0, %.thread ]
  %.261 = phi ptr [ %30, %26 ], [ %.05993, %25 ], [ %23, %.thread ]
  %.258 = phi ptr [ %32, %26 ], [ %.05694, %25 ], [ %24, %.thread ]
  %.2 = phi i32 [ %27, %26 ], [ %.096, %25 ], [ 8, %.thread ]
  %.not74 = icmp eq i32 %.062.lcssa, 0
  br i1 %.not74, label %34, label %37

34:                                               ; preds = %33
  %35 = sext i32 %.15482 to i64
  %36 = getelementptr inbounds ptr, ptr %.261, i64 %35
  store ptr null, ptr %36, align 8, !tbaa !10
  br label %67

37:                                               ; preds = %33
  %38 = sext i32 %.062.lcssa to i64
  %39 = shl nsw i64 %38, 2
  %40 = tail call noalias ptr @malloc(i64 noundef %39) #5
  %41 = sext i32 %.15482 to i64
  %42 = getelementptr inbounds ptr, ptr %.261, i64 %41
  store ptr %40, ptr %42, align 8, !tbaa !10
  br i1 %6, label %.lr.ph89.preheader, label %._crit_edge90

.lr.ph89.preheader:                               ; preds = %37
  br i1 %7, label %._crit_edge90.loopexit.unr-lcssa, label %.lr.ph89

.lr.ph89:                                         ; preds = %.lr.ph89.preheader, %59
  %indvars.iv98 = phi i64 [ %indvars.iv.next99.1, %59 ], [ 0, %.lr.ph89.preheader ]
  %.06587 = phi i32 [ %.166.1, %59 ], [ 0, %.lr.ph89.preheader ]
  %niter = phi i64 [ %niter.next.1, %59 ], [ 0, %.lr.ph89.preheader ]
  %43 = shl nuw i64 1, %indvars.iv98
  %44 = and i64 %43, %.06991
  %.not75 = icmp eq i64 %44, 0
  br i1 %.not75, label %.lr.ph89.1, label %45

45:                                               ; preds = %.lr.ph89
  %46 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv98
  %47 = load i32, ptr %46, align 4, !tbaa !14
  %48 = add nsw i32 %.06587, 1
  %49 = sext i32 %.06587 to i64
  %50 = getelementptr inbounds i32, ptr %40, i64 %49
  store i32 %47, ptr %50, align 4, !tbaa !14
  br label %.lr.ph89.1

.lr.ph89.1:                                       ; preds = %.lr.ph89, %45
  %.166 = phi i32 [ %48, %45 ], [ %.06587, %.lr.ph89 ]
  %51 = shl nuw i64 2, %indvars.iv98
  %52 = and i64 %51, %.06991
  %.not75.1 = icmp eq i64 %52, 0
  br i1 %.not75.1, label %59, label %53

53:                                               ; preds = %.lr.ph89.1
  %indvars.iv.next99 = or disjoint i64 %indvars.iv98, 1
  %54 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.next99
  %55 = load i32, ptr %54, align 4, !tbaa !14
  %56 = add nsw i32 %.166, 1
  %57 = sext i32 %.166 to i64
  %58 = getelementptr inbounds i32, ptr %40, i64 %57
  store i32 %55, ptr %58, align 4, !tbaa !14
  br label %59

59:                                               ; preds = %53, %.lr.ph89.1
  %.166.1 = phi i32 [ %56, %53 ], [ %.166, %.lr.ph89.1 ]
  %indvars.iv.next99.1 = add nuw nsw i64 %indvars.iv98, 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_edge90.loopexit.unr-lcssa, label %.lr.ph89, !llvm.loop !16

._crit_edge90.loopexit.unr-lcssa:                 ; preds = %59, %.lr.ph89.preheader
  %indvars.iv98.unr = phi i64 [ 0, %.lr.ph89.preheader ], [ %indvars.iv.next99.1, %59 ]
  %.06587.unr = phi i32 [ 0, %.lr.ph89.preheader ], [ %.166.1, %59 ]
  br i1 %lcmp.mod.not, label %._crit_edge90, label %.lr.ph89.epil

.lr.ph89.epil:                                    ; preds = %._crit_edge90.loopexit.unr-lcssa
  %60 = shl nuw i64 1, %indvars.iv98.unr
  %61 = and i64 %60, %.06991
  %.not75.epil = icmp eq i64 %61, 0
  br i1 %.not75.epil, label %._crit_edge90, label %62

62:                                               ; preds = %.lr.ph89.epil
  %63 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv98.unr
  %64 = load i32, ptr %63, align 4, !tbaa !14
  %65 = sext i32 %.06587.unr to i64
  %66 = getelementptr inbounds i32, ptr %40, i64 %65
  store i32 %64, ptr %66, align 4, !tbaa !14
  br label %._crit_edge90

._crit_edge90:                                    ; preds = %._crit_edge90.loopexit.unr-lcssa, %62, %.lr.ph89.epil, %37
  tail call void @qsort(ptr noundef %40, i64 noundef %38, i64 noundef 4, ptr noundef nonnull @intcmp) #7
  br label %67

67:                                               ; preds = %._crit_edge90, %34
  %.sink103 = phi i64 [ %41, %._crit_edge90 ], [ %35, %34 ]
  %.062.lcssa.sink = phi i32 [ %.062.lcssa, %._crit_edge90 ], [ 0, %34 ]
  %68 = getelementptr inbounds i32, ptr %.258, i64 %.sink103
  store i32 %.062.lcssa.sink, ptr %68, align 4, !tbaa !14
  %.255 = add nsw i32 %.15482, 1
  %69 = add i64 %.06991, 1
  %.069.highbits = lshr i64 %69, %5
  %70 = icmp eq i64 %.069.highbits, 0
  br i1 %70, label %.preheader, label %.loopexit, !llvm.loop !17

.loopexit:                                        ; preds = %67, %4
  %storemerge71 = phi ptr [ null, %4 ], [ %.258, %67 ]
  %storemerge = phi i32 [ 0, %4 ], [ %.255, %67 ]
  %.064 = phi ptr [ null, %4 ], [ %.261, %67 ]
  store ptr %storemerge71, ptr %2, align 8, !tbaa !10
  store i32 %storemerge, ptr %3, align 4, !tbaa !14
  ret ptr %.064
}

; 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: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #2

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

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

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

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 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, 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 #3 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind allocsize(0) }
attributes #6 = { nounwind allocsize(1) }
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 = distinct !{!5, !6, !7, !8}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!"llvm.loop.isvectorized", i32 1}
!8 = !{!"llvm.loop.unroll.runtime.disable"}
!9 = distinct !{!9, !6, !8, !7}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C/C++ TBAA"}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !12, i64 0}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !6}


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