; LLVM IR from wrnlb666/yet-another-string-library-in-c :: yasli (str_sort)

; 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.__va_list_tag = type { i32, i32, 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: nocallback nofree nosync nounwind willreturn
declare void @llvm.va_start.p0(ptr) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.va_end.p0(ptr) #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 uwtable
define dso_local ptr @str_sort(ptr noundef %0, i64 noundef %1, ptr noundef %2, ...) #3 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca [5 x i8], align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca [1 x %struct.__va_list_tag], align 16
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 5, ptr %8) #6
  call void @llvm.memset.p0.i64(ptr align 1 %8, i8 0, i64 5, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %13 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %13, ptr %9, align 8, !tbaa !5
  br label %14

14:                                               ; preds = %71, %3
  %15 = load ptr, ptr %9, align 8, !tbaa !5
  %16 = load i8, ptr %15, align 1, !tbaa !11
  %17 = sext i8 %16 to i32
  %18 = icmp ne i32 %17, 0
  br i1 %18, label %20, label %19

19:                                               ; preds = %14
  store i32 2, ptr %10, align 4
  br label %74

20:                                               ; preds = %14
  %21 = load ptr, ptr %9, align 8, !tbaa !5
  %22 = load i8, ptr %21, align 1, !tbaa !11
  %23 = sext i8 %22 to i32
  %24 = icmp eq i32 %23, 99
  br i1 %24, label %25, label %27

25:                                               ; preds = %20
  %26 = getelementptr inbounds [5 x i8], ptr %8, i64 0, i64 0
  store i8 1, ptr %26, align 1, !tbaa !12
  store i32 2, ptr %10, align 4
  br label %74

27:                                               ; preds = %20
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = load i8, ptr %28, align 1, !tbaa !11
  %30 = sext i8 %29 to i32
  %31 = icmp eq i32 %30, 105
  br i1 %31, label %32, label %34

32:                                               ; preds = %27
  %33 = getelementptr inbounds [5 x i8], ptr %8, i64 0, i64 1
  store i8 1, ptr %33, align 1, !tbaa !12
  br label %69

34:                                               ; preds = %27
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  %36 = load i8, ptr %35, align 1, !tbaa !11
  %37 = sext i8 %36 to i32
  %38 = icmp eq i32 %37, 108
  br i1 %38, label %39, label %49

39:                                               ; preds = %34
  %40 = getelementptr inbounds [5 x i8], ptr %8, i64 0, i64 3
  %41 = load i8, ptr %40, align 1, !tbaa !12, !range !14, !noundef !15
  %42 = trunc i8 %41 to i1
  %43 = zext i1 %42 to i32
  %44 = icmp eq i32 %43, 1
  br i1 %44, label %45, label %46

45:                                               ; preds = %39
  br label %71

46:                                               ; preds = %39
  %47 = getelementptr inbounds [5 x i8], ptr %8, i64 0, i64 2
  store i8 1, ptr %47, align 1, !tbaa !12
  br label %48

48:                                               ; preds = %46
  br label %68

49:                                               ; preds = %34
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = load i8, ptr %50, align 1, !tbaa !11
  %52 = sext i8 %51 to i32
  %53 = icmp eq i32 %52, 97
  br i1 %53, label %54, label %66

54:                                               ; preds = %49
  %55 = getelementptr inbounds [5 x i8], ptr %8, i64 0, i64 2
  %56 = load i8, ptr %55, align 1, !tbaa !12, !range !14, !noundef !15
  %57 = trunc i8 %56 to i1
  %58 = zext i1 %57 to i32
  %59 = icmp eq i32 %58, 1
  br i1 %59, label %60, label %63

60:                                               ; preds = %54
  %61 = getelementptr inbounds [5 x i8], ptr %8, i64 0, i64 2
  store i8 0, ptr %61, align 1, !tbaa !12
  %62 = getelementptr inbounds [5 x i8], ptr %8, i64 0, i64 4
  store i8 1, ptr %62, align 1, !tbaa !12
  br label %65

63:                                               ; preds = %54
  %64 = getelementptr inbounds [5 x i8], ptr %8, i64 0, i64 3
  store i8 1, ptr %64, align 1, !tbaa !12
  br label %65

65:                                               ; preds = %63, %60
  br label %67

66:                                               ; preds = %49
  store ptr null, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %74

67:                                               ; preds = %65
  br label %68

68:                                               ; preds = %67, %48
  br label %69

69:                                               ; preds = %68, %32
  br label %70

70:                                               ; preds = %69
  br label %71

71:                                               ; preds = %70, %45
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %72, i32 1
  store ptr %73, ptr %9, align 8, !tbaa !5
  br label %14, !llvm.loop !16

74:                                               ; preds = %66, %25, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  %75 = load i32, ptr %10, align 4
  switch i32 %75, label %181 [
    i32 2, label %76
  ]

76:                                               ; preds = %74
  %77 = load i64, ptr %6, align 8, !tbaa !9
  %78 = icmp eq i64 %77, 0
  br i1 %78, label %79, label %91

79:                                               ; preds = %76
  br label %80

80:                                               ; preds = %87, %79
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = load i64, ptr %6, align 8, !tbaa !9
  %83 = getelementptr inbounds ptr, ptr %81, i64 %82
  %84 = load ptr, ptr %83, align 8, !tbaa !5
  %85 = icmp ne ptr %84, null
  br i1 %85, label %86, label %90

86:                                               ; preds = %80
  br label %87

87:                                               ; preds = %86
  %88 = load i64, ptr %6, align 8, !tbaa !9
  %89 = add i64 %88, 1
  store i64 %89, ptr %6, align 8, !tbaa !9
  br label %80, !llvm.loop !18

90:                                               ; preds = %80
  br label %91

91:                                               ; preds = %90, %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %92 = getelementptr inbounds [5 x i8], ptr %8, i64 0, i64 0
  %93 = load i8, ptr %92, align 1, !tbaa !12, !range !14, !noundef !15
  %94 = trunc i8 %93 to i1
  %95 = zext i1 %94 to i32
  %96 = icmp eq i32 %95, 1
  br i1 %96, label %97, label %116

97:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #6
  %98 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %12, i64 0, i64 0
  call void @llvm.va_start.p0(ptr %98)
  %99 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %12, i64 0, i64 0
  %100 = getelementptr inbounds %struct.__va_list_tag, ptr %99, i32 0, i32 0
  %101 = load i32, ptr %100, align 16
  %102 = icmp ule i32 %101, 40
  br i1 %102, label %103, label %108

103:                                              ; preds = %97
  %104 = getelementptr inbounds %struct.__va_list_tag, ptr %99, i32 0, i32 3
  %105 = load ptr, ptr %104, align 16
  %106 = getelementptr i8, ptr %105, i32 %101
  %107 = add i32 %101, 8
  store i32 %107, ptr %100, align 16
  br label %112

108:                                              ; preds = %97
  %109 = getelementptr inbounds %struct.__va_list_tag, ptr %99, i32 0, i32 2
  %110 = load ptr, ptr %109, align 8
  %111 = getelementptr i8, ptr %110, i32 8
  store ptr %111, ptr %109, align 8
  br label %112

112:                                              ; preds = %108, %103
  %113 = phi ptr [ %106, %103 ], [ %110, %108 ]
  %114 = load ptr, ptr %113, align 8, !tbaa !5
  store ptr %114, ptr %11, align 8, !tbaa !5
  %115 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %12, i64 0, i64 0
  call void @llvm.va_end.p0(ptr %115)
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #6
  br label %175

116:                                              ; preds = %91
  %117 = getelementptr inbounds [5 x i8], ptr %8, i64 0, i64 2
  %118 = load i8, ptr %117, align 1, !tbaa !12, !range !14, !noundef !15
  %119 = trunc i8 %118 to i1
  %120 = zext i1 %119 to i32
  %121 = icmp eq i32 %120, 1
  br i1 %121, label %122, label %123

122:                                              ; preds = %116
  store ptr @str_cmp_l, ptr %11, align 8, !tbaa !5
  br label %174

123:                                              ; preds = %116
  %124 = getelementptr inbounds [5 x i8], ptr %8, i64 0, i64 3
  %125 = load i8, ptr %124, align 1, !tbaa !12, !range !14, !noundef !15
  %126 = trunc i8 %125 to i1
  %127 = zext i1 %126 to i32
  %128 = icmp eq i32 %127, 1
  br i1 %128, label %129, label %136

129:                                              ; preds = %123
  %130 = getelementptr inbounds [5 x i8], ptr %8, i64 0, i64 1
  %131 = load i8, ptr %130, align 1, !tbaa !12, !range !14, !noundef !15
  %132 = trunc i8 %131 to i1
  %133 = zext i1 %132 to i32
  %134 = icmp eq i32 %133, 0
  br i1 %134, label %135, label %136

135:                                              ; preds = %129
  store ptr @str_cmp_a, ptr %11, align 8, !tbaa !5
  br label %173

136:                                              ; preds = %129, %123
  %137 = getelementptr inbounds [5 x i8], ptr %8, i64 0, i64 3
  %138 = load i8, ptr %137, align 1, !tbaa !12, !range !14, !noundef !15
  %139 = trunc i8 %138 to i1
  %140 = zext i1 %139 to i32
  %141 = icmp eq i32 %140, 1
  br i1 %141, label %142, label %149

142:                                              ; preds = %136
  %143 = getelementptr inbounds [5 x i8], ptr %8, i64 0, i64 1
  %144 = load i8, ptr %143, align 1, !tbaa !12, !range !14, !noundef !15
  %145 = trunc i8 %144 to i1
  %146 = zext i1 %145 to i32
  %147 = icmp eq i32 %146, 1
  br i1 %147, label %148, label %149

148:                                              ; preds = %142
  store ptr @str_cmp_ai, ptr %11, align 8, !tbaa !5
  br label %172

149:                                              ; preds = %142, %136
  %150 = getelementptr inbounds [5 x i8], ptr %8, i64 0, i64 4
  %151 = load i8, ptr %150, align 1, !tbaa !12, !range !14, !noundef !15
  %152 = trunc i8 %151 to i1
  %153 = zext i1 %152 to i32
  %154 = icmp eq i32 %153, 1
  br i1 %154, label %155, label %156

155:                                              ; preds = %149
  store ptr @str_cmp_la, ptr %11, align 8, !tbaa !5
  br label %171

156:                                              ; preds = %149
  %157 = getelementptr inbounds [5 x i8], ptr %8, i64 0, i64 4
  %158 = load i8, ptr %157, align 1, !tbaa !12, !range !14, !noundef !15
  %159 = trunc i8 %158 to i1
  %160 = zext i1 %159 to i32
  %161 = icmp eq i32 %160, 1
  br i1 %161, label %162, label %169

162:                                              ; preds = %156
  %163 = getelementptr inbounds [5 x i8], ptr %8, i64 0, i64 1
  %164 = load i8, ptr %163, align 1, !tbaa !12, !range !14, !noundef !15
  %165 = trunc i8 %164 to i1
  %166 = zext i1 %165 to i32
  %167 = icmp eq i32 %166, 1
  br i1 %167, label %168, label %169

168:                                              ; preds = %162
  store ptr @str_cmp_lai, ptr %11, align 8, !tbaa !5
  br label %170

169:                                              ; preds = %162, %156
  store ptr null, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %180

170:                                              ; preds = %168
  br label %171

171:                                              ; preds = %170, %155
  br label %172

172:                                              ; preds = %171, %148
  br label %173

173:                                              ; preds = %172, %135
  br label %174

174:                                              ; preds = %173, %122
  br label %175

175:                                              ; preds = %174, %112
  %176 = load ptr, ptr %5, align 8, !tbaa !5
  %177 = load i64, ptr %6, align 8, !tbaa !9
  %178 = load ptr, ptr %11, align 8, !tbaa !5
  call void @qsort(ptr noundef %176, i64 noundef %177, i64 noundef 8, ptr noundef %178)
  %179 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %179, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %180

180:                                              ; preds = %175, %169
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %181

181:                                              ; preds = %180, %74
  call void @llvm.lifetime.end.p0(i64 5, ptr %8) #6
  %182 = load ptr, ptr %4, align 8
  ret ptr %182
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @str_cmp_l(ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @str_cmp_a(ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @str_cmp_ai(ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @str_cmp_la(ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @str_cmp_lai(ptr noundef, ptr noundef) #4

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

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

!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 = !{!"long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}


; 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.__va_list_tag = type { i32, i32, ptr, ptr }

; 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: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.va_start.p0(ptr) #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.va_end.p0(ptr) #1

; Function Attrs: nofree nounwind uwtable
define dso_local noundef ptr @str_sort(ptr noundef %0, i64 noundef %1, ptr nocapture noundef readonly %2, ...) local_unnamed_addr #2 {
  %4 = alloca [1 x %struct.__va_list_tag], align 16
  br label %5

5:                                                ; preds = %11, %3
  %.sroa.5.0 = phi i8 [ 0, %3 ], [ %.sroa.5.1, %11 ]
  %.sroa.9.0 = phi i8 [ 0, %3 ], [ %.sroa.9.1, %11 ]
  %.sroa.13.0 = phi i8 [ 0, %3 ], [ %.sroa.13.1, %11 ]
  %.sroa.17.0 = phi i1 [ false, %3 ], [ %.sroa.17.1, %11 ]
  %.028 = phi ptr [ %2, %3 ], [ %12, %11 ]
  %6 = load i8, ptr %.028, align 1, !tbaa !5
  switch i8 %6, label %.loopexit41 [
    i8 0, label %.loopexit42.loopexit
    i8 99, label %.loopexit42
    i8 105, label %11
    i8 108, label %7
    i8 97, label %9
  ]

7:                                                ; preds = %5
  %8 = trunc nuw i8 %.sroa.13.0 to i1
  %spec.select = select i1 %8, i8 %.sroa.9.0, i8 1
  br label %11

9:                                                ; preds = %5
  %10 = trunc nuw i8 %.sroa.9.0 to i1
  %..sroa.9.0 = select i1 %10, i8 0, i8 %.sroa.9.0
  %.sroa.13.0. = select i1 %10, i8 %.sroa.13.0, i8 1
  %..sroa.17.0 = select i1 %10, i1 true, i1 %.sroa.17.0
  br label %11

11:                                               ; preds = %7, %9, %5
  %.sroa.5.1 = phi i8 [ 1, %5 ], [ %.sroa.5.0, %7 ], [ %.sroa.5.0, %9 ]
  %.sroa.9.1 = phi i8 [ %.sroa.9.0, %5 ], [ %spec.select, %7 ], [ %..sroa.9.0, %9 ]
  %.sroa.13.1 = phi i8 [ %.sroa.13.0, %5 ], [ %.sroa.13.0, %7 ], [ %.sroa.13.0., %9 ]
  %.sroa.17.1 = phi i1 [ %.sroa.17.0, %5 ], [ %.sroa.17.0, %7 ], [ %..sroa.17.0, %9 ]
  %12 = getelementptr inbounds i8, ptr %.028, i64 1
  br label %5, !llvm.loop !8

.loopexit42.loopexit:                             ; preds = %5
  br label %.loopexit42

.loopexit42:                                      ; preds = %5, %.loopexit42.loopexit
  %.sroa.0.0.ph = phi i1 [ false, %.loopexit42.loopexit ], [ true, %5 ]
  %13 = icmp eq i64 %1, 0
  br i1 %13, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %.loopexit42, %.preheader
  %.030 = phi i64 [ %16, %.preheader ], [ 0, %.loopexit42 ]
  %14 = getelementptr inbounds ptr, ptr %0, i64 %.030
  %15 = load ptr, ptr %14, align 8, !tbaa !10
  %.not36 = icmp eq ptr %15, null
  %16 = add i64 %.030, 1
  br i1 %.not36, label %.loopexit, label %.preheader, !llvm.loop !12

.loopexit:                                        ; preds = %.preheader, %.loopexit42
  %.131 = phi i64 [ %1, %.loopexit42 ], [ %.030, %.preheader ]
  br i1 %.sroa.0.0.ph, label %17, label %33

17:                                               ; preds = %.loopexit
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  call void @llvm.va_start.p0(ptr nonnull %4)
  %18 = load i32, ptr %4, align 16
  %19 = icmp ult i32 %18, 41
  br i1 %19, label %20, label %26

20:                                               ; preds = %17
  %21 = getelementptr inbounds i8, ptr %4, i64 16
  %22 = load ptr, ptr %21, align 16
  %23 = zext nneg i32 %18 to i64
  %24 = getelementptr i8, ptr %22, i64 %23
  %25 = add nuw nsw i32 %18, 8
  store i32 %25, ptr %4, align 16
  br label %30

26:                                               ; preds = %17
  %27 = getelementptr inbounds i8, ptr %4, i64 8
  %28 = load ptr, ptr %27, align 8
  %29 = getelementptr i8, ptr %28, i64 8
  store ptr %29, ptr %27, align 8
  br label %30

30:                                               ; preds = %26, %20
  %31 = phi ptr [ %24, %20 ], [ %28, %26 ]
  %32 = load ptr, ptr %31, align 8, !tbaa !10
  call void @llvm.va_end.p0(ptr nonnull %4)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  br label %43

33:                                               ; preds = %.loopexit
  %34 = trunc nuw i8 %.sroa.9.0 to i1
  br i1 %34, label %43, label %35

35:                                               ; preds = %33
  %36 = trunc nuw i8 %.sroa.13.0 to i1
  %37 = and i8 %.sroa.5.0, 1
  %38 = icmp eq i8 %37, 0
  %or.cond = select i1 %36, i1 %38, i1 false
  br i1 %or.cond, label %43, label %39

39:                                               ; preds = %35
  br i1 %36, label %40, label %42

40:                                               ; preds = %39
  %41 = trunc nuw i8 %.sroa.5.0 to i1
  %brmerge = select i1 %41, i1 true, i1 %.sroa.17.0
  %str_cmp_ai.mux = select i1 %41, ptr @str_cmp_ai, ptr @str_cmp_la
  br i1 %brmerge, label %43, label %.loopexit41

42:                                               ; preds = %39
  br i1 %.sroa.17.0, label %43, label %.loopexit41

43:                                               ; preds = %40, %42, %35, %33, %30
  %.0 = phi ptr [ %32, %30 ], [ @str_cmp_l, %33 ], [ @str_cmp_a, %35 ], [ %str_cmp_ai.mux, %40 ], [ @str_cmp_la, %42 ]
  call void @qsort(ptr noundef %0, i64 noundef %.131, i64 noundef 8, ptr noundef %.0) #5
  br label %.loopexit41

.loopexit41:                                      ; preds = %5, %40, %43, %42
  %.2 = phi ptr [ %0, %43 ], [ null, %42 ], [ null, %40 ], [ null, %5 ]
  ret ptr %.2
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @str_cmp_l(ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @str_cmp_a(ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @str_cmp_ai(ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @str_cmp_la(ptr noundef, ptr noundef) #3

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #2 = { nofree 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 #3 = { inlinehint 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 #4 = { 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 #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 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !6, i64 0}
!12 = distinct !{!12, !9}


; Effective O3 passes: AggressiveInstCombinePass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass