; LLVM IR from ryanlayer/giggle :: lib/htslib (bcf_sr_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.sr_sort_t = type { [256 x i8], i32, i32, ptr, i32, i32, i32, ptr, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.__kstring_t, i32, i32, ptr, i32, ptr, ptr, i32, i32, i32, i32 }
%struct.__kstring_t = type { i64, i64, ptr }

@.str.10 = external hidden unnamed_addr constant [1 x i8], align 1
@__func__.grp_create_key = external hidden unnamed_addr constant [15 x i8], align 1

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

declare i64 @hts_realloc_or_die(i64 noundef, i64 noundef, i64 noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local ptr @grp_create_key(ptr noundef %0) #3 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.sr_sort_t, ptr %8, i32 0, i32 18
  %10 = getelementptr inbounds %struct.__kstring_t, ptr %9, i32 0, i32 0
  %11 = load i64, ptr %10, align 8, !tbaa !9
  %12 = icmp ne i64 %11, 0
  br i1 %12, label %15, label %13

13:                                               ; preds = %1
  %14 = call noalias ptr @strdup(ptr noundef @.str.10) #7
  store ptr %14, ptr %2, align 8
  br label %153

15:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  br label %16

16:                                               ; preds = %15
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.sr_sort_t, ptr %17, i32 0, i32 20
  %19 = load i32, ptr %18, align 4, !tbaa !14
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.sr_sort_t, ptr %20, i32 0, i32 22
  %22 = load i32, ptr %21, align 8, !tbaa !15
  %23 = icmp sgt i32 %19, %22
  br i1 %23, label %24, label %47

24:                                               ; preds = %16
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.sr_sort_t, ptr %25, i32 0, i32 20
  %27 = load i32, ptr %26, align 4, !tbaa !14
  %28 = icmp sge i32 %27, 1
  br i1 %28, label %29, label %33

29:                                               ; preds = %24
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.sr_sort_t, ptr %30, i32 0, i32 20
  %32 = load i32, ptr %31, align 4, !tbaa !14
  br label %34

33:                                               ; preds = %24
  br label %34

34:                                               ; preds = %33, %29
  %35 = phi i32 [ %32, %29 ], [ 1, %33 ]
  %36 = sext i32 %35 to i64
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.sr_sort_t, ptr %37, i32 0, i32 22
  %39 = load i32, ptr %38, align 8, !tbaa !15
  %40 = sext i32 %39 to i64
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.sr_sort_t, ptr %41, i32 0, i32 23
  %43 = call i64 @hts_realloc_or_die(i64 noundef %36, i64 noundef %40, i64 noundef 4, i64 noundef 8, i32 noundef 0, ptr noundef %42, ptr noundef @__func__.grp_create_key)
  %44 = trunc i64 %43 to i32
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.sr_sort_t, ptr %45, i32 0, i32 22
  store i32 %44, ptr %46, align 8, !tbaa !15
  br label %47

47:                                               ; preds = %34, %16
  br label %48

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %48
  store i32 0, ptr %4, align 4, !tbaa !16
  br label %50

50:                                               ; preds = %88, %49
  %51 = load i32, ptr %4, align 4, !tbaa !16
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.sr_sort_t, ptr %52, i32 0, i32 20
  %54 = load i32, ptr %53, align 4, !tbaa !14
  %55 = icmp slt i32 %51, %54
  br i1 %55, label %56, label %91

56:                                               ; preds = %50
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.sr_sort_t, ptr %57, i32 0, i32 18
  %59 = getelementptr inbounds %struct.__kstring_t, ptr %58, i32 0, i32 2
  %60 = load ptr, ptr %59, align 8, !tbaa !17
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.sr_sort_t, ptr %61, i32 0, i32 21
  %63 = load ptr, ptr %62, align 8, !tbaa !18
  %64 = load i32, ptr %4, align 4, !tbaa !16
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds i32, ptr %63, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !16
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds i8, ptr %60, i64 %68
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.sr_sort_t, ptr %70, i32 0, i32 23
  %72 = load ptr, ptr %71, align 8, !tbaa !19
  %73 = load i32, ptr %4, align 4, !tbaa !16
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds ptr, ptr %72, i64 %74
  store ptr %69, ptr %75, align 8, !tbaa !5
  %76 = load i32, ptr %4, align 4, !tbaa !16
  %77 = icmp sgt i32 %76, 0
  br i1 %77, label %78, label %87

78:                                               ; preds = %56
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.sr_sort_t, ptr %79, i32 0, i32 23
  %81 = load ptr, ptr %80, align 8, !tbaa !19
  %82 = load i32, ptr %4, align 4, !tbaa !16
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds ptr, ptr %81, i64 %83
  %85 = load ptr, ptr %84, align 8, !tbaa !5
  %86 = getelementptr inbounds i8, ptr %85, i64 -1
  store i8 0, ptr %86, align 1, !tbaa !20
  br label %87

87:                                               ; preds = %78, %56
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %4, align 4, !tbaa !16
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %4, align 4, !tbaa !16
  br label %50, !llvm.loop !21

91:                                               ; preds = %50
  %92 = load ptr, ptr %3, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.sr_sort_t, ptr %92, i32 0, i32 23
  %94 = load ptr, ptr %93, align 8, !tbaa !19
  %95 = load ptr, ptr %3, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.sr_sort_t, ptr %95, i32 0, i32 20
  %97 = load i32, ptr %96, align 4, !tbaa !14
  %98 = sext i32 %97 to i64
  call void @qsort(ptr noundef %94, i64 noundef %98, i64 noundef 8, ptr noundef @cmpstringp)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %99 = load ptr, ptr %3, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.sr_sort_t, ptr %99, i32 0, i32 18
  %101 = getelementptr inbounds %struct.__kstring_t, ptr %100, i32 0, i32 0
  %102 = load i64, ptr %101, align 8, !tbaa !9
  %103 = add i64 %102, 1
  %104 = call noalias ptr @malloc(i64 noundef %103) #8
  store ptr %104, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %105, ptr %6, align 8, !tbaa !5
  store i32 0, ptr %4, align 4, !tbaa !16
  br label %106

106:                                              ; preds = %148, %91
  %107 = load i32, ptr %4, align 4, !tbaa !16
  %108 = load ptr, ptr %3, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.sr_sort_t, ptr %108, i32 0, i32 20
  %110 = load i32, ptr %109, align 4, !tbaa !14
  %111 = icmp slt i32 %107, %110
  br i1 %111, label %112, label %151

112:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %113 = load ptr, ptr %3, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.sr_sort_t, ptr %113, i32 0, i32 23
  %115 = load ptr, ptr %114, align 8, !tbaa !19
  %116 = load i32, ptr %4, align 4, !tbaa !16
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds ptr, ptr %115, i64 %117
  %119 = load ptr, ptr %118, align 8, !tbaa !5
  %120 = call i64 @strlen(ptr noundef %119) #9
  %121 = trunc i64 %120 to i32
  store i32 %121, ptr %7, align 4, !tbaa !16
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.sr_sort_t, ptr %123, i32 0, i32 23
  %125 = load ptr, ptr %124, align 8, !tbaa !19
  %126 = load i32, ptr %4, align 4, !tbaa !16
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds ptr, ptr %125, i64 %127
  %129 = load ptr, ptr %128, align 8, !tbaa !5
  %130 = load i32, ptr %7, align 4, !tbaa !16
  %131 = sext i32 %130 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %122, ptr align 1 %129, i64 %131, i1 false)
  %132 = load i32, ptr %7, align 4, !tbaa !16
  %133 = add nsw i32 %132, 1
  %134 = load ptr, ptr %6, align 8, !tbaa !5
  %135 = sext i32 %133 to i64
  %136 = getelementptr inbounds i8, ptr %134, i64 %135
  store ptr %136, ptr %6, align 8, !tbaa !5
  %137 = load i32, ptr %4, align 4, !tbaa !16
  %138 = add nsw i32 %137, 1
  %139 = load ptr, ptr %3, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.sr_sort_t, ptr %139, i32 0, i32 20
  %141 = load i32, ptr %140, align 4, !tbaa !14
  %142 = icmp eq i32 %138, %141
  %143 = zext i1 %142 to i64
  %144 = select i1 %142, i32 0, i32 59
  %145 = trunc i32 %144 to i8
  %146 = load ptr, ptr %6, align 8, !tbaa !5
  %147 = getelementptr inbounds i8, ptr %146, i64 -1
  store i8 %145, ptr %147, align 1, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %148

148:                                              ; preds = %112
  %149 = load i32, ptr %4, align 4, !tbaa !16
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %4, align 4, !tbaa !16
  br label %106, !llvm.loop !23

151:                                              ; preds = %106
  %152 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %152, ptr %2, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %153

153:                                              ; preds = %151, %13
  %154 = load ptr, ptr %2, align 8
  ret ptr %154
}

; Function Attrs: nounwind
declare noalias ptr @strdup(ptr noundef) #4

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

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 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 = { nounwind "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 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 #6 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind willreturn memory(read) }

!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, !13, i64 368}
!10 = !{!"", !7, i64 0, !11, i64 256, !11, i64 260, !6, i64 264, !11, i64 272, !11, i64 276, !11, i64 280, !6, i64 288, !11, i64 296, !11, i64 300, !11, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !12, i64 368, !11, i64 392, !11, i64 396, !6, i64 400, !11, i64 408, !6, i64 416, !6, i64 424, !11, i64 432, !11, i64 436, !11, i64 440, !11, i64 444}
!11 = !{!"int", !7, i64 0}
!12 = !{!"__kstring_t", !13, i64 0, !13, i64 8, !6, i64 16}
!13 = !{!"long", !7, i64 0}
!14 = !{!10, !11, i64 396}
!15 = !{!10, !11, i64 408}
!16 = !{!11, !11, i64 0}
!17 = !{!10, !6, i64 384}
!18 = !{!10, !6, i64 400}
!19 = !{!10, !6, i64 416}
!20 = !{!7, !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}


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

@.str.10 = external hidden unnamed_addr constant [1 x i8], align 1
@__func__.grp_create_key = external hidden unnamed_addr constant [15 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

declare i64 @hts_realloc_or_die(i64 noundef, i64 noundef, i64 noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local noalias ptr @grp_create_key(ptr noundef %0) local_unnamed_addr #2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 368
  %3 = load i64, ptr %2, align 8, !tbaa !5
  %.not = icmp eq i64 %3, 0
  br i1 %.not, label %4, label %6

4:                                                ; preds = %1
  %5 = tail call noalias ptr @strdup(ptr noundef nonnull @.str.10) #8
  br label %.loopexit

6:                                                ; preds = %1
  %7 = getelementptr inbounds i8, ptr %0, i64 396
  %8 = load i32, ptr %7, align 4, !tbaa !13
  %9 = getelementptr inbounds i8, ptr %0, i64 408
  %10 = load i32, ptr %9, align 8, !tbaa !14
  %11 = icmp sgt i32 %8, %10
  br i1 %11, label %12, label %17

12:                                               ; preds = %6
  %narrow = tail call i32 @llvm.smax.i32(i32 %8, i32 1)
  %spec.select = zext nneg i32 %narrow to i64
  %13 = sext i32 %10 to i64
  %14 = getelementptr inbounds i8, ptr %0, i64 416
  %15 = tail call i64 @hts_realloc_or_die(i64 noundef %spec.select, i64 noundef %13, i64 noundef 4, i64 noundef 8, i32 noundef 0, ptr noundef nonnull %14, ptr noundef nonnull @__func__.grp_create_key) #8
  %16 = trunc i64 %15 to i32
  store i32 %16, ptr %9, align 8, !tbaa !14
  %.pre = load i32, ptr %7, align 4, !tbaa !13
  br label %17

17:                                               ; preds = %12, %6
  %18 = phi i32 [ %.pre, %12 ], [ %8, %6 ]
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %20, label %._crit_edge

20:                                               ; preds = %17
  %21 = getelementptr inbounds i8, ptr %0, i64 384
  %22 = getelementptr inbounds i8, ptr %0, i64 400
  %23 = getelementptr inbounds i8, ptr %0, i64 416
  %24 = load ptr, ptr %21, align 8, !tbaa !15
  %25 = load ptr, ptr %22, align 8, !tbaa !16
  %26 = load i32, ptr %25, align 4, !tbaa !17
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds i8, ptr %24, i64 %27
  %29 = load ptr, ptr %23, align 8, !tbaa !18
  store ptr %28, ptr %29, align 8, !tbaa !19
  %.not57 = icmp eq i32 %18, 1
  br i1 %.not57, label %._crit_edge, label %.peel.next

.peel.next:                                       ; preds = %20, %.peel.next
  %indvars.iv = phi i64 [ %indvars.iv.next, %.peel.next ], [ 1, %20 ]
  %30 = load ptr, ptr %21, align 8, !tbaa !15
  %31 = load ptr, ptr %22, align 8, !tbaa !16
  %32 = getelementptr inbounds i32, ptr %31, i64 %indvars.iv
  %33 = load i32, ptr %32, align 4, !tbaa !17
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds i8, ptr %30, i64 %34
  %36 = load ptr, ptr %23, align 8, !tbaa !18
  %37 = getelementptr inbounds ptr, ptr %36, i64 %indvars.iv
  store ptr %35, ptr %37, align 8, !tbaa !19
  %38 = load ptr, ptr %23, align 8, !tbaa !18
  %39 = getelementptr inbounds ptr, ptr %38, i64 %indvars.iv
  %40 = load ptr, ptr %39, align 8, !tbaa !19
  %41 = getelementptr inbounds i8, ptr %40, i64 -1
  store i8 0, ptr %41, align 1, !tbaa !20
  %.pre56 = load i32, ptr %7, align 4, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %42 = sext i32 %.pre56 to i64
  %43 = icmp slt i64 %indvars.iv.next, %42
  br i1 %43, label %.peel.next, label %._crit_edge, !llvm.loop !21

._crit_edge:                                      ; preds = %.peel.next, %20, %17
  %.lcssa = phi i32 [ %18, %17 ], [ 1, %20 ], [ %.pre56, %.peel.next ]
  %44 = getelementptr inbounds i8, ptr %0, i64 416
  %45 = load ptr, ptr %44, align 8, !tbaa !18
  %46 = sext i32 %.lcssa to i64
  tail call void @qsort(ptr noundef %45, i64 noundef %46, i64 noundef 8, ptr noundef nonnull @cmpstringp) #8
  %47 = load i64, ptr %2, align 8, !tbaa !5
  %48 = add i64 %47, 1
  %49 = tail call noalias ptr @malloc(i64 noundef %48) #9
  %50 = load i32, ptr %7, align 4, !tbaa !13
  %51 = icmp sgt i32 %50, 0
  br i1 %51, label %.lr.ph48, label %.loopexit

.lr.ph48:                                         ; preds = %._crit_edge
  %52 = load ptr, ptr %44, align 8, !tbaa !18
  %53 = zext nneg i32 %50 to i64
  br label %54

54:                                               ; preds = %.lr.ph48, %54
  %indvars.iv52 = phi i64 [ 0, %.lr.ph48 ], [ %indvars.iv.next53, %54 ]
  %.03846 = phi ptr [ %49, %.lr.ph48 ], [ %60, %54 ]
  %55 = getelementptr inbounds ptr, ptr %52, i64 %indvars.iv52
  %56 = load ptr, ptr %55, align 8, !tbaa !19
  %57 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %56) #10
  %sext = shl i64 %57, 32
  %58 = ashr exact i64 %sext, 32
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.03846, ptr align 1 %56, i64 %58, i1 false)
  %sext42 = add i64 %sext, 4294967296
  %59 = ashr exact i64 %sext42, 32
  %60 = getelementptr inbounds i8, ptr %.03846, i64 %59
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
  %61 = icmp eq i64 %indvars.iv.next53, %53
  %62 = select i1 %61, i8 0, i8 59
  %63 = getelementptr inbounds i8, ptr %60, i64 -1
  store i8 %62, ptr %63, align 1, !tbaa !20
  %exitcond.not = icmp eq i64 %indvars.iv.next53, %53
  br i1 %exitcond.not, label %.loopexit, label %54, !llvm.loop !24

.loopexit:                                        ; preds = %54, %._crit_edge, %4
  %.0 = phi ptr [ %5, %4 ], [ %49, %._crit_edge ], [ %49, %54 ]
  ret ptr %.0
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias ptr @strdup(ptr nocapture noundef readonly) local_unnamed_addr #3

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #6

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #7

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #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 #2 = { 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 = { mustprogress nofree nounwind willreturn 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 #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 = { 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 #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { nounwind willreturn memory(read) }

!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, !12, i64 368}
!6 = !{!"", !7, i64 0, !9, i64 256, !9, i64 260, !10, i64 264, !9, i64 272, !9, i64 276, !9, i64 280, !10, i64 288, !9, i64 296, !9, i64 300, !9, i64 304, !10, i64 312, !10, i64 320, !10, i64 328, !10, i64 336, !10, i64 344, !10, i64 352, !10, i64 360, !11, i64 368, !9, i64 392, !9, i64 396, !10, i64 400, !9, i64 408, !10, i64 416, !10, i64 424, !9, i64 432, !9, i64 436, !9, i64 440, !9, i64 444}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!"__kstring_t", !12, i64 0, !12, i64 8, !10, i64 16}
!12 = !{!"long", !7, i64 0}
!13 = !{!6, !9, i64 396}
!14 = !{!6, !9, i64 408}
!15 = !{!6, !10, i64 384}
!16 = !{!6, !10, i64 400}
!17 = !{!9, !9, i64 0}
!18 = !{!6, !10, i64 416}
!19 = !{!10, !10, i64 0}
!20 = !{!7, !7, i64 0}
!21 = distinct !{!21, !22, !23}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!"llvm.loop.peeled.count", i32 1}
!24 = distinct !{!24, !22}


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