; LLVM IR from gaoshanlee193/riscv-vector4wireless-extension :: toolchain/benchmark/coremark (core_list_join)

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

%struct.list_data_s = type { i16, i16 }
%struct.RESULTS_S = type { i16, i16, i16, [4 x ptr], i32, i32, i32, ptr, %struct.MAT_PARAMS_S, i16, i16, i16, i16, i16, %struct.CORE_PORTABLE_S }
%struct.MAT_PARAMS_S = type { i32, ptr, ptr, ptr }
%struct.CORE_PORTABLE_S = type { i8 }
%struct.list_head_s = type { ptr, ptr }

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i16 @core_bench_list(ptr noundef %0, i16 noundef signext %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca i16, align 2
  %5 = alloca i16, align 2
  %6 = alloca i16, align 2
  %7 = alloca i16, align 2
  %8 = alloca ptr, align 8
  %9 = alloca i16, align 2
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %struct.list_data_s, align 2
  %14 = alloca i16, align 2
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i16 %1, ptr %4, align 2, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 2, ptr %5) #4
  store i16 0, ptr %5, align 2, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 2, ptr %6) #4
  store i16 0, ptr %6, align 2, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 2, ptr %7) #4
  store i16 0, ptr %7, align 2, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.RESULTS_S, ptr %15, i32 0, i32 7
  %17 = load ptr, ptr %16, align 8, !tbaa !11
  store ptr %17, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %9) #4
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.RESULTS_S, ptr %18, i32 0, i32 2
  %20 = load i16, ptr %19, align 4, !tbaa !16
  store i16 %20, ptr %9, align 2, !tbaa !9
  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 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.memset.p0.i64(ptr align 2 %13, i8 0, i64 4, i1 false)
  call void @llvm.lifetime.start.p0(i64 2, ptr %14) #4
  %21 = load i16, ptr %4, align 2, !tbaa !9
  %22 = getelementptr inbounds %struct.list_data_s, ptr %13, i32 0, i32 1
  store i16 %21, ptr %22, align 2, !tbaa !17
  store i16 0, ptr %14, align 2, !tbaa !9
  br label %23

23:                                               ; preds = %115, %2
  %24 = load i16, ptr %14, align 2, !tbaa !9
  %25 = sext i16 %24 to i32
  %26 = load i16, ptr %9, align 2, !tbaa !9
  %27 = sext i16 %26 to i32
  %28 = icmp slt i32 %25, %27
  br i1 %28, label %29, label %118

29:                                               ; preds = %23
  %30 = load i16, ptr %14, align 2, !tbaa !9
  %31 = sext i16 %30 to i32
  %32 = and i32 %31, 255
  %33 = trunc i32 %32 to i16
  %34 = getelementptr inbounds %struct.list_data_s, ptr %13, i32 0, i32 0
  store i16 %33, ptr %34, align 2, !tbaa !19
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = call ptr @core_list_find(ptr noundef %35, ptr noundef %13)
  store ptr %36, ptr %10, align 8, !tbaa !5
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = call ptr @core_list_reverse(ptr noundef %37)
  store ptr %38, ptr %8, align 8, !tbaa !5
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = icmp eq ptr %39, null
  br i1 %40, label %41, label %58

41:                                               ; preds = %29
  %42 = load i16, ptr %7, align 2, !tbaa !9
  %43 = add i16 %42, 1
  store i16 %43, ptr %7, align 2, !tbaa !9
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.list_head_s, ptr %44, i32 0, i32 0
  %46 = load ptr, ptr %45, align 8, !tbaa !20
  %47 = getelementptr inbounds %struct.list_head_s, ptr %46, i32 0, i32 1
  %48 = load ptr, ptr %47, align 8, !tbaa !22
  %49 = getelementptr inbounds %struct.list_data_s, ptr %48, i32 0, i32 0
  %50 = load i16, ptr %49, align 2, !tbaa !19
  %51 = sext i16 %50 to i32
  %52 = ashr i32 %51, 8
  %53 = and i32 %52, 1
  %54 = load i16, ptr %5, align 2, !tbaa !9
  %55 = zext i16 %54 to i32
  %56 = add nsw i32 %55, %53
  %57 = trunc i32 %56 to i16
  store i16 %57, ptr %5, align 2, !tbaa !9
  br label %105

58:                                               ; preds = %29
  %59 = load i16, ptr %6, align 2, !tbaa !9
  %60 = add i16 %59, 1
  store i16 %60, ptr %6, align 2, !tbaa !9
  %61 = load ptr, ptr %10, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.list_head_s, ptr %61, i32 0, i32 1
  %63 = load ptr, ptr %62, align 8, !tbaa !22
  %64 = getelementptr inbounds %struct.list_data_s, ptr %63, i32 0, i32 0
  %65 = load i16, ptr %64, align 2, !tbaa !19
  %66 = sext i16 %65 to i32
  %67 = and i32 %66, 1
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %82

69:                                               ; preds = %58
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.list_head_s, ptr %70, i32 0, i32 1
  %72 = load ptr, ptr %71, align 8, !tbaa !22
  %73 = getelementptr inbounds %struct.list_data_s, ptr %72, i32 0, i32 0
  %74 = load i16, ptr %73, align 2, !tbaa !19
  %75 = sext i16 %74 to i32
  %76 = ashr i32 %75, 9
  %77 = and i32 %76, 1
  %78 = load i16, ptr %5, align 2, !tbaa !9
  %79 = zext i16 %78 to i32
  %80 = add nsw i32 %79, %77
  %81 = trunc i32 %80 to i16
  store i16 %81, ptr %5, align 2, !tbaa !9
  br label %82

82:                                               ; preds = %69, %58
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.list_head_s, ptr %83, i32 0, i32 0
  %85 = load ptr, ptr %84, align 8, !tbaa !20
  %86 = icmp ne ptr %85, null
  br i1 %86, label %87, label %104

87:                                               ; preds = %82
  %88 = load ptr, ptr %10, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.list_head_s, ptr %88, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8, !tbaa !20
  store ptr %90, ptr %11, align 8, !tbaa !5
  %91 = load ptr, ptr %11, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.list_head_s, ptr %91, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8, !tbaa !20
  %94 = load ptr, ptr %10, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.list_head_s, ptr %94, i32 0, i32 0
  store ptr %93, ptr %95, align 8, !tbaa !20
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.list_head_s, ptr %96, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8, !tbaa !20
  %99 = load ptr, ptr %11, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.list_head_s, ptr %99, i32 0, i32 0
  store ptr %98, ptr %100, align 8, !tbaa !20
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.list_head_s, ptr %102, i32 0, i32 0
  store ptr %101, ptr %103, align 8, !tbaa !20
  br label %104

104:                                              ; preds = %87, %82
  br label %105

105:                                              ; preds = %104, %41
  %106 = getelementptr inbounds %struct.list_data_s, ptr %13, i32 0, i32 1
  %107 = load i16, ptr %106, align 2, !tbaa !17
  %108 = sext i16 %107 to i32
  %109 = icmp sge i32 %108, 0
  br i1 %109, label %110, label %114

110:                                              ; preds = %105
  %111 = getelementptr inbounds %struct.list_data_s, ptr %13, i32 0, i32 1
  %112 = load i16, ptr %111, align 2, !tbaa !17
  %113 = add i16 %112, 1
  store i16 %113, ptr %111, align 2, !tbaa !17
  br label %114

114:                                              ; preds = %110, %105
  br label %115

115:                                              ; preds = %114
  %116 = load i16, ptr %14, align 2, !tbaa !9
  %117 = add i16 %116, 1
  store i16 %117, ptr %14, align 2, !tbaa !9
  br label %23, !llvm.loop !23

118:                                              ; preds = %23
  %119 = load i16, ptr %6, align 2, !tbaa !9
  %120 = zext i16 %119 to i32
  %121 = mul nsw i32 %120, 4
  %122 = load i16, ptr %7, align 2, !tbaa !9
  %123 = zext i16 %122 to i32
  %124 = sub nsw i32 %121, %123
  %125 = load i16, ptr %5, align 2, !tbaa !9
  %126 = zext i16 %125 to i32
  %127 = add nsw i32 %126, %124
  %128 = trunc i32 %127 to i16
  store i16 %128, ptr %5, align 2, !tbaa !9
  %129 = load i16, ptr %4, align 2, !tbaa !9
  %130 = sext i16 %129 to i32
  %131 = icmp sgt i32 %130, 0
  br i1 %131, label %132, label %136

132:                                              ; preds = %118
  %133 = load ptr, ptr %8, align 8, !tbaa !5
  %134 = load ptr, ptr %3, align 8, !tbaa !5
  %135 = call ptr @core_list_mergesort(ptr noundef %133, ptr noundef @cmp_complex, ptr noundef %134)
  store ptr %135, ptr %8, align 8, !tbaa !5
  br label %136

136:                                              ; preds = %132, %118
  %137 = load ptr, ptr %8, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.list_head_s, ptr %137, i32 0, i32 0
  %139 = load ptr, ptr %138, align 8, !tbaa !20
  %140 = call ptr @core_list_remove(ptr noundef %139)
  store ptr %140, ptr %12, align 8, !tbaa !5
  %141 = load ptr, ptr %8, align 8, !tbaa !5
  %142 = call ptr @core_list_find(ptr noundef %141, ptr noundef %13)
  store ptr %142, ptr %11, align 8, !tbaa !5
  %143 = load ptr, ptr %11, align 8, !tbaa !5
  %144 = icmp ne ptr %143, null
  br i1 %144, label %149, label %145

145:                                              ; preds = %136
  %146 = load ptr, ptr %8, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.list_head_s, ptr %146, i32 0, i32 0
  %148 = load ptr, ptr %147, align 8, !tbaa !20
  store ptr %148, ptr %11, align 8, !tbaa !5
  br label %149

149:                                              ; preds = %145, %136
  br label %150

150:                                              ; preds = %153, %149
  %151 = load ptr, ptr %11, align 8, !tbaa !5
  %152 = icmp ne ptr %151, null
  br i1 %152, label %153, label %164

153:                                              ; preds = %150
  %154 = load ptr, ptr %8, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.list_head_s, ptr %154, i32 0, i32 1
  %156 = load ptr, ptr %155, align 8, !tbaa !22
  %157 = getelementptr inbounds %struct.list_data_s, ptr %156, i32 0, i32 0
  %158 = load i16, ptr %157, align 2, !tbaa !19
  %159 = load i16, ptr %5, align 2, !tbaa !9
  %160 = call zeroext i16 @crc16(i16 noundef signext %158, i16 noundef zeroext %159)
  store i16 %160, ptr %5, align 2, !tbaa !9
  %161 = load ptr, ptr %11, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.list_head_s, ptr %161, i32 0, i32 0
  %163 = load ptr, ptr %162, align 8, !tbaa !20
  store ptr %163, ptr %11, align 8, !tbaa !5
  br label %150, !llvm.loop !25

164:                                              ; preds = %150
  %165 = load ptr, ptr %12, align 8, !tbaa !5
  %166 = load ptr, ptr %8, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.list_head_s, ptr %166, i32 0, i32 0
  %168 = load ptr, ptr %167, align 8, !tbaa !20
  %169 = call ptr @core_list_undo_remove(ptr noundef %165, ptr noundef %168)
  store ptr %169, ptr %12, align 8, !tbaa !5
  %170 = load ptr, ptr %8, align 8, !tbaa !5
  %171 = call ptr @core_list_mergesort(ptr noundef %170, ptr noundef @cmp_idx, ptr noundef null)
  store ptr %171, ptr %8, align 8, !tbaa !5
  %172 = load ptr, ptr %8, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.list_head_s, ptr %172, i32 0, i32 0
  %174 = load ptr, ptr %173, align 8, !tbaa !20
  store ptr %174, ptr %11, align 8, !tbaa !5
  br label %175

175:                                              ; preds = %178, %164
  %176 = load ptr, ptr %11, align 8, !tbaa !5
  %177 = icmp ne ptr %176, null
  br i1 %177, label %178, label %189

178:                                              ; preds = %175
  %179 = load ptr, ptr %8, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.list_head_s, ptr %179, i32 0, i32 1
  %181 = load ptr, ptr %180, align 8, !tbaa !22
  %182 = getelementptr inbounds %struct.list_data_s, ptr %181, i32 0, i32 0
  %183 = load i16, ptr %182, align 2, !tbaa !19
  %184 = load i16, ptr %5, align 2, !tbaa !9
  %185 = call zeroext i16 @crc16(i16 noundef signext %183, i16 noundef zeroext %184)
  store i16 %185, ptr %5, align 2, !tbaa !9
  %186 = load ptr, ptr %11, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.list_head_s, ptr %186, i32 0, i32 0
  %188 = load ptr, ptr %187, align 8, !tbaa !20
  store ptr %188, ptr %11, align 8, !tbaa !5
  br label %175, !llvm.loop !26

189:                                              ; preds = %175
  %190 = load i16, ptr %5, align 2, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 2, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, 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
  call void @llvm.lifetime.end.p0(i64 2, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %5) #4
  ret i16 %190
}

; 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 uwtable
declare dso_local ptr @core_list_find(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @core_list_reverse(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @core_list_mergesort(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @core_list_remove(ptr noundef) #1

declare zeroext i16 @crc16(i16 noundef signext, i16 noundef zeroext) #3

; Function Attrs: nounwind uwtable
declare dso_local ptr @core_list_undo_remove(ptr noundef, ptr noundef) #1

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

!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 = !{!"short", !7, i64 0}
!11 = !{!12, !6, i64 56}
!12 = !{!"RESULTS_S", !10, i64 0, !10, i64 2, !10, i64 4, !7, i64 8, !13, i64 40, !13, i64 44, !13, i64 48, !6, i64 56, !14, i64 64, !10, i64 96, !10, i64 98, !10, i64 100, !10, i64 102, !10, i64 104, !15, i64 106}
!13 = !{!"int", !7, i64 0}
!14 = !{!"MAT_PARAMS_S", !13, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!15 = !{!"CORE_PORTABLE_S", !7, i64 0}
!16 = !{!12, !10, i64 4}
!17 = !{!18, !10, i64 2}
!18 = !{!"list_data_s", !10, i64 0, !10, i64 2}
!19 = !{!18, !10, i64 0}
!20 = !{!21, !6, i64 0}
!21 = !{!"list_head_s", !6, i64 0, !6, i64 8}
!22 = !{!21, !6, i64 8}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}
!26 = distinct !{!26, !24}


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

%struct.list_data_s = type { i16, i16 }

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i16 @core_bench_list(ptr noundef %0, i16 noundef signext %1) local_unnamed_addr #1 {
  %3 = alloca %struct.list_data_s, align 4
  %4 = getelementptr inbounds i8, ptr %0, i64 56
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 4
  %7 = load i16, ptr %6, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  store i32 0, ptr %3, align 4
  %8 = getelementptr inbounds i8, ptr %3, i64 2
  store i16 %1, ptr %8, align 2, !tbaa !15
  %9 = icmp sgt i16 %7, 0
  br i1 %9, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2, %40
  %.069 = phi i16 [ %41, %40 ], [ 0, %2 ]
  %.04868 = phi i16 [ %.250, %40 ], [ 0, %2 ]
  %.05167 = phi i16 [ %.152, %40 ], [ 0, %2 ]
  %.05366 = phi ptr [ %12, %40 ], [ %5, %2 ]
  %.05565 = phi i16 [ %.156, %40 ], [ 0, %2 ]
  %10 = and i16 %.069, 255
  store i16 %10, ptr %3, align 4, !tbaa !17
  %11 = call ptr @core_list_find(ptr noundef %.05366, ptr noundef nonnull %3)
  %12 = call ptr @core_list_reverse(ptr noundef %.05366)
  %13 = icmp eq ptr %11, null
  br i1 %13, label %14, label %22

14:                                               ; preds = %.lr.ph
  %15 = add i16 %.05565, 1
  %16 = load ptr, ptr %12, align 8, !tbaa !18
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  %18 = load ptr, ptr %17, align 8, !tbaa !20
  %19 = load i16, ptr %18, align 2, !tbaa !17
  %20 = lshr i16 %19, 8
  %21 = and i16 %20, 1
  br label %35

22:                                               ; preds = %.lr.ph
  %23 = add i16 %.05167, 1
  %24 = getelementptr inbounds i8, ptr %11, i64 8
  %25 = load ptr, ptr %24, align 8, !tbaa !20
  %26 = load i16, ptr %25, align 2, !tbaa !17
  %27 = and i16 %26, 1
  %.not63 = icmp eq i16 %27, 0
  %28 = lshr i16 %26, 9
  %29 = and i16 %28, 1
  %30 = select i1 %.not63, i16 0, i16 %29
  %31 = load ptr, ptr %11, align 8, !tbaa !18
  %.not64 = icmp eq ptr %31, null
  br i1 %.not64, label %35, label %32

32:                                               ; preds = %22
  %33 = load ptr, ptr %31, align 8, !tbaa !18
  store ptr %33, ptr %11, align 8, !tbaa !18
  %34 = load ptr, ptr %12, align 8, !tbaa !18
  store ptr %34, ptr %31, align 8, !tbaa !18
  store ptr %31, ptr %12, align 8, !tbaa !18
  br label %35

35:                                               ; preds = %22, %32, %14
  %.156 = phi i16 [ %15, %14 ], [ %.05565, %32 ], [ %.05565, %22 ]
  %.152 = phi i16 [ %.05167, %14 ], [ %23, %32 ], [ %23, %22 ]
  %.pn = phi i16 [ %21, %14 ], [ %30, %32 ], [ %30, %22 ]
  %.250 = add i16 %.pn, %.04868
  %36 = load i16, ptr %8, align 2, !tbaa !15
  %37 = icmp sgt i16 %36, -1
  br i1 %37, label %38, label %40

38:                                               ; preds = %35
  %39 = add nuw i16 %36, 1
  store i16 %39, ptr %8, align 2, !tbaa !15
  br label %40

40:                                               ; preds = %35, %38
  %41 = add nuw nsw i16 %.069, 1
  %exitcond.not = icmp eq i16 %41, %7
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !21

._crit_edge.loopexit:                             ; preds = %40
  %42 = shl i16 %.152, 2
  %43 = sub i16 %42, %.156
  %44 = add i16 %43, %.250
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %2
  %.053.lcssa = phi ptr [ %5, %2 ], [ %12, %._crit_edge.loopexit ]
  %45 = phi i16 [ 0, %2 ], [ %44, %._crit_edge.loopexit ]
  %46 = icmp sgt i16 %1, 0
  br i1 %46, label %47, label %49

47:                                               ; preds = %._crit_edge
  %48 = call ptr @core_list_mergesort(ptr noundef %.053.lcssa, ptr noundef nonnull @cmp_complex, ptr noundef %0)
  br label %49

49:                                               ; preds = %47, %._crit_edge
  %.154 = phi ptr [ %48, %47 ], [ %.053.lcssa, %._crit_edge ]
  %50 = load ptr, ptr %.154, align 8, !tbaa !18
  %51 = call ptr @core_list_remove(ptr noundef %50)
  %52 = call ptr @core_list_find(ptr noundef nonnull %.154, ptr noundef nonnull %3)
  %.not = icmp eq ptr %52, null
  br i1 %.not, label %53, label %.lr.ph77

53:                                               ; preds = %49
  %54 = load ptr, ptr %.154, align 8, !tbaa !18
  %.not6173 = icmp eq ptr %54, null
  br i1 %.not6173, label %._crit_edge78, label %.lr.ph77

.lr.ph77:                                         ; preds = %49, %53
  %.04792 = phi ptr [ %54, %53 ], [ %52, %49 ]
  %55 = getelementptr inbounds i8, ptr %.154, i64 8
  br label %56

56:                                               ; preds = %.lr.ph77, %56
  %.175 = phi ptr [ %.04792, %.lr.ph77 ], [ %60, %56 ]
  %.374 = phi i16 [ %45, %.lr.ph77 ], [ %59, %56 ]
  %57 = load ptr, ptr %55, align 8, !tbaa !20
  %58 = load i16, ptr %57, align 2, !tbaa !17
  %59 = call zeroext i16 @crc16(i16 noundef signext %58, i16 noundef zeroext %.374) #3
  %60 = load ptr, ptr %.175, align 8, !tbaa !18
  %.not61 = icmp eq ptr %60, null
  br i1 %.not61, label %._crit_edge78, label %56, !llvm.loop !23

._crit_edge78:                                    ; preds = %56, %53
  %.3.lcssa = phi i16 [ %45, %53 ], [ %59, %56 ]
  %61 = load ptr, ptr %.154, align 8, !tbaa !18
  %62 = call ptr @core_list_undo_remove(ptr noundef %51, ptr noundef %61)
  %63 = call ptr @core_list_mergesort(ptr noundef nonnull %.154, ptr noundef nonnull @cmp_idx, ptr noundef null)
  %.280 = load ptr, ptr %63, align 8, !tbaa !18
  %.not6281 = icmp eq ptr %.280, null
  br i1 %.not6281, label %._crit_edge86, label %.lr.ph85

.lr.ph85:                                         ; preds = %._crit_edge78
  %64 = getelementptr inbounds i8, ptr %63, i64 8
  br label %65

65:                                               ; preds = %.lr.ph85, %65
  %.283 = phi ptr [ %.280, %.lr.ph85 ], [ %.2, %65 ]
  %.482 = phi i16 [ %.3.lcssa, %.lr.ph85 ], [ %68, %65 ]
  %66 = load ptr, ptr %64, align 8, !tbaa !20
  %67 = load i16, ptr %66, align 2, !tbaa !17
  %68 = call zeroext i16 @crc16(i16 noundef signext %67, i16 noundef zeroext %.482) #3
  %.2 = load ptr, ptr %.283, align 8, !tbaa !18
  %.not62 = icmp eq ptr %.2, null
  br i1 %.not62, label %._crit_edge86, label %65, !llvm.loop !24

._crit_edge86:                                    ; preds = %65, %._crit_edge78
  %.4.lcssa = phi i16 [ %.3.lcssa, %._crit_edge78 ], [ %68, %65 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  ret i16 %.4.lcssa
}

; Function Attrs: nounwind uwtable
declare dso_local ptr @core_list_find(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @core_list_reverse(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @core_list_mergesort(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @core_list_remove(ptr noundef) local_unnamed_addr #1

declare zeroext i16 @crc16(i16 noundef signext, i16 noundef zeroext) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local ptr @core_list_undo_remove(ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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, !11, i64 56}
!6 = !{!"RESULTS_S", !7, i64 0, !7, i64 2, !7, i64 4, !8, i64 8, !10, i64 40, !10, i64 44, !10, i64 48, !11, i64 56, !12, i64 64, !7, i64 96, !7, i64 98, !7, i64 100, !7, i64 102, !7, i64 104, !13, i64 106}
!7 = !{!"short", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"MAT_PARAMS_S", !10, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!13 = !{!"CORE_PORTABLE_S", !8, i64 0}
!14 = !{!6, !7, i64 4}
!15 = !{!16, !7, i64 2}
!16 = !{!"list_data_s", !7, i64 0, !7, i64 2}
!17 = !{!16, !7, i64 0}
!18 = !{!19, !11, i64 0}
!19 = !{!"list_head_s", !11, i64 0, !11, i64 8}
!20 = !{!19, !11, i64 8}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = distinct !{!24, !22}


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