; 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.bcf_srs_t = type { i32, ptr, i32, i32, ptr, i32, ptr, i32, i32, i32, ptr, ptr, ptr, i32, i32, %struct.__kstring_t, i32, i32, ptr, ptr }
%struct.__kstring_t = type { i64, i64, ptr }
%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.bcf_sr_t = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, i32 }
%struct.bcf1_t = type { i32, i32, i32, float, i64, %struct.__kstring_t, %struct.__kstring_t, %struct.bcf_dec_t, i32, i32, [3 x i32], i32 }
%struct.bcf_dec_t = type { i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32 }
%struct.vcf_buf_t = type { i32, i32, ptr }

@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [32 x i8], align 1
@__PRETTY_FUNCTION__.bcf_sr_sort_next = external hidden unnamed_addr constant [66 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [19 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: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #1

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local i32 @bcf_sr_sort_next(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) #4 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.bcf_srs_t, ptr %19, i32 0, i32 7
  %21 = load i32, ptr %20, align 8, !tbaa !11
  %22 = icmp eq i32 %21, 1
  br i1 %22, label %23, label %100

23:                                               ; preds = %4
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.sr_sort_t, ptr %24, i32 0, i32 26
  store i32 1, ptr %25, align 4, !tbaa !15
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.sr_sort_t, ptr %26, i32 0, i32 27
  %28 = load i32, ptr %27, align 8, !tbaa !17
  %29 = icmp ne i32 %28, 0
  br i1 %29, label %36, label %30

30:                                               ; preds = %23
  %31 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 16) #9
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.sr_sort_t, ptr %32, i32 0, i32 14
  store ptr %31, ptr %33, align 8, !tbaa !18
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.sr_sort_t, ptr %34, i32 0, i32 27
  store i32 1, ptr %35, align 8, !tbaa !17
  br label %36

36:                                               ; preds = %30, %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.bcf_srs_t, ptr %37, i32 0, i32 6
  %39 = load ptr, ptr %38, align 8, !tbaa !19
  %40 = getelementptr inbounds %struct.bcf_sr_t, ptr %39, i64 0
  store ptr %40, ptr %12, align 8, !tbaa !5
  %41 = load ptr, ptr %12, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.bcf_sr_t, ptr %41, i32 0, i32 6
  %43 = load ptr, ptr %42, align 8, !tbaa !20
  %44 = getelementptr inbounds ptr, ptr %43, i64 1
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.bcf1_t, ptr %45, i32 0, i32 1
  %47 = load i32, ptr %46, align 4, !tbaa !22
  %48 = load i32, ptr %9, align 4, !tbaa !9
  %49 = icmp eq i32 %47, %48
  br i1 %49, label %50, label %51

50:                                               ; preds = %36
  br label %52

51:                                               ; preds = %36
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.1, i32 noundef 546, ptr noundef @__PRETTY_FUNCTION__.bcf_sr_sort_next) #10
  unreachable

52:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.bcf_sr_t, ptr %53, i32 0, i32 6
  %55 = load ptr, ptr %54, align 8, !tbaa !20
  %56 = getelementptr inbounds ptr, ptr %55, i64 0
  %57 = load ptr, ptr %56, align 8, !tbaa !5
  store ptr %57, ptr %13, align 8, !tbaa !5
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %58

58:                                               ; preds = %79, %52
  %59 = load i32, ptr %11, align 4, !tbaa !9
  %60 = load ptr, ptr %12, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.bcf_sr_t, ptr %60, i32 0, i32 7
  %62 = load i32, ptr %61, align 8, !tbaa !26
  %63 = icmp sle i32 %59, %62
  br i1 %63, label %64, label %82

64:                                               ; preds = %58
  %65 = load ptr, ptr %12, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.bcf_sr_t, ptr %65, i32 0, i32 6
  %67 = load ptr, ptr %66, align 8, !tbaa !20
  %68 = load i32, ptr %11, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds ptr, ptr %67, i64 %69
  %71 = load ptr, ptr %70, align 8, !tbaa !5
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.bcf_sr_t, ptr %72, i32 0, i32 6
  %74 = load ptr, ptr %73, align 8, !tbaa !20
  %75 = load i32, ptr %11, align 4, !tbaa !9
  %76 = sub nsw i32 %75, 1
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds ptr, ptr %74, i64 %77
  store ptr %71, ptr %78, align 8, !tbaa !5
  br label %79

79:                                               ; preds = %64
  %80 = load i32, ptr %11, align 4, !tbaa !9
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %11, align 4, !tbaa !9
  br label %58, !llvm.loop !27

82:                                               ; preds = %58
  %83 = load ptr, ptr %13, align 8, !tbaa !5
  %84 = load ptr, ptr %12, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.bcf_sr_t, ptr %84, i32 0, i32 6
  %86 = load ptr, ptr %85, align 8, !tbaa !20
  %87 = load ptr, ptr %12, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.bcf_sr_t, ptr %87, i32 0, i32 7
  %89 = load i32, ptr %88, align 8, !tbaa !26
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds ptr, ptr %86, i64 %90
  store ptr %83, ptr %91, align 8, !tbaa !5
  %92 = load ptr, ptr %12, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.bcf_sr_t, ptr %92, i32 0, i32 7
  %94 = load i32, ptr %93, align 8, !tbaa !26
  %95 = add nsw i32 %94, -1
  store i32 %95, ptr %93, align 8, !tbaa !26
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.bcf_srs_t, ptr %96, i32 0, i32 4
  %98 = load ptr, ptr %97, align 8, !tbaa !29
  %99 = getelementptr inbounds i32, ptr %98, i64 0
  store i32 1, ptr %99, align 4, !tbaa !9
  store i32 1, ptr %5, align 4
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %369

100:                                              ; preds = %4
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.sr_sort_t, ptr %101, i32 0, i32 26
  %103 = load i32, ptr %102, align 4, !tbaa !15
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.bcf_srs_t, ptr %104, i32 0, i32 7
  %106 = load i32, ptr %105, align 8, !tbaa !11
  %107 = icmp ne i32 %103, %106
  br i1 %107, label %108, label %170

108:                                              ; preds = %100
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.sr_sort_t, ptr %110, i32 0, i32 15
  store ptr %109, ptr %111, align 8, !tbaa !30
  %112 = load ptr, ptr %7, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.sr_sort_t, ptr %112, i32 0, i32 26
  %114 = load i32, ptr %113, align 4, !tbaa !15
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.bcf_srs_t, ptr %115, i32 0, i32 7
  %117 = load i32, ptr %116, align 8, !tbaa !11
  %118 = icmp slt i32 %114, %117
  br i1 %118, label %119, label %162

119:                                              ; preds = %108
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.sr_sort_t, ptr %120, i32 0, i32 14
  %122 = load ptr, ptr %121, align 8, !tbaa !18
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.bcf_srs_t, ptr %123, i32 0, i32 7
  %125 = load i32, ptr %124, align 8, !tbaa !11
  %126 = sext i32 %125 to i64
  %127 = mul i64 %126, 16
  %128 = call ptr @realloc(ptr noundef %122, i64 noundef %127) #11
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.sr_sort_t, ptr %129, i32 0, i32 14
  store ptr %128, ptr %130, align 8, !tbaa !18
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.sr_sort_t, ptr %131, i32 0, i32 14
  %133 = load ptr, ptr %132, align 8, !tbaa !18
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.sr_sort_t, ptr %134, i32 0, i32 26
  %136 = load i32, ptr %135, align 4, !tbaa !15
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds %struct.vcf_buf_t, ptr %133, i64 %137
  %139 = load ptr, ptr %6, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.bcf_srs_t, ptr %139, i32 0, i32 7
  %141 = load i32, ptr %140, align 8, !tbaa !11
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.sr_sort_t, ptr %142, i32 0, i32 26
  %144 = load i32, ptr %143, align 4, !tbaa !15
  %145 = sub nsw i32 %141, %144
  %146 = sext i32 %145 to i64
  %147 = mul i64 16, %146
  call void @llvm.memset.p0.i64(ptr align 8 %138, i8 0, i64 %147, i1 false)
  %148 = load ptr, ptr %7, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.sr_sort_t, ptr %148, i32 0, i32 27
  %150 = load i32, ptr %149, align 8, !tbaa !17
  %151 = load ptr, ptr %7, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.sr_sort_t, ptr %151, i32 0, i32 26
  %153 = load i32, ptr %152, align 4, !tbaa !15
  %154 = icmp slt i32 %150, %153
  br i1 %154, label %155, label %161

155:                                              ; preds = %119
  %156 = load ptr, ptr %7, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.sr_sort_t, ptr %156, i32 0, i32 26
  %158 = load i32, ptr %157, align 4, !tbaa !15
  %159 = load ptr, ptr %7, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.sr_sort_t, ptr %159, i32 0, i32 27
  store i32 %158, ptr %160, align 8, !tbaa !17
  br label %161

161:                                              ; preds = %155, %119
  br label %162

162:                                              ; preds = %161, %108
  %163 = load ptr, ptr %6, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.bcf_srs_t, ptr %163, i32 0, i32 7
  %165 = load i32, ptr %164, align 8, !tbaa !11
  %166 = load ptr, ptr %7, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.sr_sort_t, ptr %166, i32 0, i32 26
  store i32 %165, ptr %167, align 4, !tbaa !15
  %168 = load ptr, ptr %7, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.sr_sort_t, ptr %168, i32 0, i32 24
  store ptr null, ptr %169, align 8, !tbaa !31
  br label %170

170:                                              ; preds = %162, %100
  %171 = load ptr, ptr %7, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.sr_sort_t, ptr %171, i32 0, i32 24
  %173 = load ptr, ptr %172, align 8, !tbaa !31
  %174 = icmp ne ptr %173, null
  br i1 %174, label %175, label %188

175:                                              ; preds = %170
  %176 = load ptr, ptr %7, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.sr_sort_t, ptr %176, i32 0, i32 25
  %178 = load i32, ptr %177, align 8, !tbaa !32
  %179 = load i32, ptr %9, align 4, !tbaa !9
  %180 = icmp ne i32 %178, %179
  br i1 %180, label %188, label %181

181:                                              ; preds = %175
  %182 = load ptr, ptr %7, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.sr_sort_t, ptr %182, i32 0, i32 24
  %184 = load ptr, ptr %183, align 8, !tbaa !31
  %185 = load ptr, ptr %8, align 8, !tbaa !5
  %186 = call i32 @strcmp(ptr noundef %184, ptr noundef %185) #12
  %187 = icmp ne i32 %186, 0
  br i1 %187, label %188, label %193

188:                                              ; preds = %181, %175, %170
  %189 = load ptr, ptr %6, align 8, !tbaa !5
  %190 = load ptr, ptr %7, align 8, !tbaa !5
  %191 = load ptr, ptr %8, align 8, !tbaa !5
  %192 = load i32, ptr %9, align 4, !tbaa !9
  call void @bcf_sr_sort_set(ptr noundef %189, ptr noundef %190, ptr noundef %191, i32 noundef %192)
  br label %193

193:                                              ; preds = %188, %181
  %194 = load ptr, ptr %7, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.sr_sort_t, ptr %194, i32 0, i32 14
  %196 = load ptr, ptr %195, align 8, !tbaa !18
  %197 = getelementptr inbounds %struct.vcf_buf_t, ptr %196, i64 0
  %198 = getelementptr inbounds %struct.vcf_buf_t, ptr %197, i32 0, i32 0
  %199 = load i32, ptr %198, align 8, !tbaa !33
  %200 = icmp ne i32 %199, 0
  br i1 %200, label %202, label %201

201:                                              ; preds = %193
  store i32 0, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %369

202:                                              ; preds = %193
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !9
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %203

203:                                              ; preds = %364, %202
  %204 = load i32, ptr %10, align 4, !tbaa !9
  %205 = load ptr, ptr %7, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.sr_sort_t, ptr %205, i32 0, i32 15
  %207 = load ptr, ptr %206, align 8, !tbaa !30
  %208 = getelementptr inbounds %struct.bcf_srs_t, ptr %207, i32 0, i32 7
  %209 = load i32, ptr %208, align 8, !tbaa !11
  %210 = icmp slt i32 %204, %209
  br i1 %210, label %211, label %367

211:                                              ; preds = %203
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %212 = load ptr, ptr %7, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.sr_sort_t, ptr %212, i32 0, i32 14
  %214 = load ptr, ptr %213, align 8, !tbaa !18
  %215 = load i32, ptr %10, align 4, !tbaa !9
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds %struct.vcf_buf_t, ptr %214, i64 %216
  store ptr %217, ptr %16, align 8, !tbaa !5
  %218 = load ptr, ptr %16, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.vcf_buf_t, ptr %218, i32 0, i32 2
  %220 = load ptr, ptr %219, align 8, !tbaa !35
  %221 = getelementptr inbounds ptr, ptr %220, i64 0
  %222 = load ptr, ptr %221, align 8, !tbaa !5
  %223 = icmp ne ptr %222, null
  br i1 %223, label %224, label %332

224:                                              ; preds = %211
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %225 = load ptr, ptr %7, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.sr_sort_t, ptr %225, i32 0, i32 15
  %227 = load ptr, ptr %226, align 8, !tbaa !30
  %228 = getelementptr inbounds %struct.bcf_srs_t, ptr %227, i32 0, i32 6
  %229 = load ptr, ptr %228, align 8, !tbaa !19
  %230 = load i32, ptr %10, align 4, !tbaa !9
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds %struct.bcf_sr_t, ptr %229, i64 %231
  store ptr %232, ptr %17, align 8, !tbaa !5
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %233

233:                                              ; preds = %255, %224
  %234 = load i32, ptr %11, align 4, !tbaa !9
  %235 = load ptr, ptr %17, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.bcf_sr_t, ptr %235, i32 0, i32 7
  %237 = load i32, ptr %236, align 8, !tbaa !26
  %238 = icmp sle i32 %234, %237
  br i1 %238, label %239, label %258

239:                                              ; preds = %233
  %240 = load ptr, ptr %17, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.bcf_sr_t, ptr %240, i32 0, i32 6
  %242 = load ptr, ptr %241, align 8, !tbaa !20
  %243 = load i32, ptr %11, align 4, !tbaa !9
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds ptr, ptr %242, i64 %244
  %246 = load ptr, ptr %245, align 8, !tbaa !5
  %247 = load ptr, ptr %16, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct.vcf_buf_t, ptr %247, i32 0, i32 2
  %249 = load ptr, ptr %248, align 8, !tbaa !35
  %250 = getelementptr inbounds ptr, ptr %249, i64 0
  %251 = load ptr, ptr %250, align 8, !tbaa !5
  %252 = icmp eq ptr %246, %251
  br i1 %252, label %253, label %254

253:                                              ; preds = %239
  br label %258

254:                                              ; preds = %239
  br label %255

255:                                              ; preds = %254
  %256 = load i32, ptr %11, align 4, !tbaa !9
  %257 = add nsw i32 %256, 1
  store i32 %257, ptr %11, align 4, !tbaa !9
  br label %233, !llvm.loop !36

258:                                              ; preds = %253, %233
  %259 = load i32, ptr %11, align 4, !tbaa !9
  %260 = load ptr, ptr %17, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.bcf_sr_t, ptr %260, i32 0, i32 7
  %262 = load i32, ptr %261, align 8, !tbaa !26
  %263 = icmp sle i32 %259, %262
  br i1 %263, label %264, label %265

264:                                              ; preds = %258
  br label %266

265:                                              ; preds = %258
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.1, i32 noundef 583, ptr noundef @__PRETTY_FUNCTION__.bcf_sr_sort_next) #10
  unreachable

266:                                              ; preds = %264
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %267 = load ptr, ptr %17, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.bcf_sr_t, ptr %267, i32 0, i32 6
  %269 = load ptr, ptr %268, align 8, !tbaa !20
  %270 = getelementptr inbounds ptr, ptr %269, i64 0
  %271 = load ptr, ptr %270, align 8, !tbaa !5
  store ptr %271, ptr %18, align 8, !tbaa !5
  %272 = load ptr, ptr %17, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.bcf_sr_t, ptr %272, i32 0, i32 6
  %274 = load ptr, ptr %273, align 8, !tbaa !20
  %275 = load i32, ptr %11, align 4, !tbaa !9
  %276 = add nsw i32 %275, 1
  store i32 %276, ptr %11, align 4, !tbaa !9
  %277 = sext i32 %275 to i64
  %278 = getelementptr inbounds ptr, ptr %274, i64 %277
  %279 = load ptr, ptr %278, align 8, !tbaa !5
  %280 = load ptr, ptr %17, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct.bcf_sr_t, ptr %280, i32 0, i32 6
  %282 = load ptr, ptr %281, align 8, !tbaa !20
  %283 = getelementptr inbounds ptr, ptr %282, i64 0
  store ptr %279, ptr %283, align 8, !tbaa !5
  br label %284

284:                                              ; preds = %305, %266
  %285 = load i32, ptr %11, align 4, !tbaa !9
  %286 = load ptr, ptr %17, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct.bcf_sr_t, ptr %286, i32 0, i32 7
  %288 = load i32, ptr %287, align 8, !tbaa !26
  %289 = icmp sle i32 %285, %288
  br i1 %289, label %290, label %308

290:                                              ; preds = %284
  %291 = load ptr, ptr %17, align 8, !tbaa !5
  %292 = getelementptr inbounds %struct.bcf_sr_t, ptr %291, i32 0, i32 6
  %293 = load ptr, ptr %292, align 8, !tbaa !20
  %294 = load i32, ptr %11, align 4, !tbaa !9
  %295 = sext i32 %294 to i64
  %296 = getelementptr inbounds ptr, ptr %293, i64 %295
  %297 = load ptr, ptr %296, align 8, !tbaa !5
  %298 = load ptr, ptr %17, align 8, !tbaa !5
  %299 = getelementptr inbounds %struct.bcf_sr_t, ptr %298, i32 0, i32 6
  %300 = load ptr, ptr %299, align 8, !tbaa !20
  %301 = load i32, ptr %11, align 4, !tbaa !9
  %302 = sub nsw i32 %301, 1
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds ptr, ptr %300, i64 %303
  store ptr %297, ptr %304, align 8, !tbaa !5
  br label %305

305:                                              ; preds = %290
  %306 = load i32, ptr %11, align 4, !tbaa !9
  %307 = add nsw i32 %306, 1
  store i32 %307, ptr %11, align 4, !tbaa !9
  br label %284, !llvm.loop !37

308:                                              ; preds = %284
  %309 = load ptr, ptr %18, align 8, !tbaa !5
  %310 = load ptr, ptr %17, align 8, !tbaa !5
  %311 = getelementptr inbounds %struct.bcf_sr_t, ptr %310, i32 0, i32 6
  %312 = load ptr, ptr %311, align 8, !tbaa !20
  %313 = load ptr, ptr %17, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct.bcf_sr_t, ptr %313, i32 0, i32 7
  %315 = load i32, ptr %314, align 8, !tbaa !26
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds ptr, ptr %312, i64 %316
  store ptr %309, ptr %317, align 8, !tbaa !5
  %318 = load ptr, ptr %17, align 8, !tbaa !5
  %319 = getelementptr inbounds %struct.bcf_sr_t, ptr %318, i32 0, i32 7
  %320 = load i32, ptr %319, align 8, !tbaa !26
  %321 = add nsw i32 %320, -1
  store i32 %321, ptr %319, align 8, !tbaa !26
  %322 = load i32, ptr %15, align 4, !tbaa !9
  %323 = add nsw i32 %322, 1
  store i32 %323, ptr %15, align 4, !tbaa !9
  %324 = load ptr, ptr %7, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct.sr_sort_t, ptr %324, i32 0, i32 15
  %326 = load ptr, ptr %325, align 8, !tbaa !30
  %327 = getelementptr inbounds %struct.bcf_srs_t, ptr %326, i32 0, i32 4
  %328 = load ptr, ptr %327, align 8, !tbaa !29
  %329 = load i32, ptr %10, align 4, !tbaa !9
  %330 = sext i32 %329 to i64
  %331 = getelementptr inbounds i32, ptr %328, i64 %330
  store i32 1, ptr %331, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %341

332:                                              ; preds = %211
  %333 = load ptr, ptr %7, align 8, !tbaa !5
  %334 = getelementptr inbounds %struct.sr_sort_t, ptr %333, i32 0, i32 15
  %335 = load ptr, ptr %334, align 8, !tbaa !30
  %336 = getelementptr inbounds %struct.bcf_srs_t, ptr %335, i32 0, i32 4
  %337 = load ptr, ptr %336, align 8, !tbaa !29
  %338 = load i32, ptr %10, align 4, !tbaa !9
  %339 = sext i32 %338 to i64
  %340 = getelementptr inbounds i32, ptr %337, i64 %339
  store i32 0, ptr %340, align 4, !tbaa !9
  br label %341

341:                                              ; preds = %332, %308
  %342 = load ptr, ptr %16, align 8, !tbaa !5
  %343 = getelementptr inbounds %struct.vcf_buf_t, ptr %342, i32 0, i32 0
  %344 = load i32, ptr %343, align 8, !tbaa !33
  %345 = add nsw i32 %344, -1
  store i32 %345, ptr %343, align 8, !tbaa !33
  %346 = load ptr, ptr %16, align 8, !tbaa !5
  %347 = getelementptr inbounds %struct.vcf_buf_t, ptr %346, i32 0, i32 0
  %348 = load i32, ptr %347, align 8, !tbaa !33
  %349 = icmp sgt i32 %348, 0
  br i1 %349, label %350, label %363

350:                                              ; preds = %341
  %351 = load ptr, ptr %16, align 8, !tbaa !5
  %352 = getelementptr inbounds %struct.vcf_buf_t, ptr %351, i32 0, i32 2
  %353 = load ptr, ptr %352, align 8, !tbaa !35
  %354 = load ptr, ptr %16, align 8, !tbaa !5
  %355 = getelementptr inbounds %struct.vcf_buf_t, ptr %354, i32 0, i32 2
  %356 = load ptr, ptr %355, align 8, !tbaa !35
  %357 = getelementptr inbounds ptr, ptr %356, i64 1
  %358 = load ptr, ptr %16, align 8, !tbaa !5
  %359 = getelementptr inbounds %struct.vcf_buf_t, ptr %358, i32 0, i32 0
  %360 = load i32, ptr %359, align 8, !tbaa !33
  %361 = sext i32 %360 to i64
  %362 = mul i64 %361, 8
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %353, ptr align 8 %357, i64 %362, i1 false)
  br label %363

363:                                              ; preds = %350, %341
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br label %364

364:                                              ; preds = %363
  %365 = load i32, ptr %10, align 4, !tbaa !9
  %366 = add nsw i32 %365, 1
  store i32 %366, ptr %10, align 4, !tbaa !9
  br label %203, !llvm.loop !38

367:                                              ; preds = %203
  %368 = load i32, ptr %15, align 4, !tbaa !9
  store i32 %368, ptr %5, align 4
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %369

369:                                              ; preds = %367, %201, %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  %370 = load i32, ptr %5, align 4
  ret i32 %370
}

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { noreturn 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { nounwind allocsize(0,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 #6 = { 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0,1) }
attributes #10 = { noreturn nounwind }
attributes #11 = { nounwind allocsize(1) }
attributes #12 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 48}
!12 = !{!"", !10, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !6, i64 24, !10, i64 32, !6, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !10, i64 92, !13, i64 96, !10, i64 120, !10, i64 124, !6, i64 128, !6, i64 136}
!13 = !{!"__kstring_t", !14, i64 0, !14, i64 8, !6, i64 16}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !10, i64 436}
!16 = !{!"", !7, i64 0, !10, i64 256, !10, i64 260, !6, i64 264, !10, i64 272, !10, i64 276, !10, i64 280, !6, i64 288, !10, i64 296, !10, i64 300, !10, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !13, i64 368, !10, i64 392, !10, i64 396, !6, i64 400, !10, i64 408, !6, i64 416, !6, i64 424, !10, i64 432, !10, i64 436, !10, i64 440, !10, i64 444}
!17 = !{!16, !10, i64 440}
!18 = !{!16, !6, i64 336}
!19 = !{!12, !6, i64 40}
!20 = !{!21, !6, i64 48}
!21 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !10, i64 56, !10, i64 60, !10, i64 64, !6, i64 72, !6, i64 80, !10, i64 88}
!22 = !{!23, !10, i64 4}
!23 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !24, i64 12, !10, i64 16, !10, i64 18, !10, i64 20, !10, i64 21, !13, i64 24, !13, i64 48, !25, i64 72, !10, i64 176, !10, i64 180, !7, i64 184, !10, i64 196}
!24 = !{!"float", !7, i64 0}
!25 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100}
!26 = !{!21, !10, i64 56}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!12, !6, i64 24}
!30 = !{!16, !6, i64 344}
!31 = !{!16, !6, i64 424}
!32 = !{!16, !10, i64 432}
!33 = !{!34, !10, i64 0}
!34 = !{!"", !10, i64 0, !10, i64 4, !6, i64 8}
!35 = !{!34, !6, i64 8}
!36 = distinct !{!36, !28}
!37 = distinct !{!37, !28}
!38 = distinct !{!38, !28}


; 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.vcf_buf_t = type { i32, i32, ptr }
%struct.bcf_sr_t = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, i32 }

@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [32 x i8], align 1
@__PRETTY_FUNCTION__.bcf_sr_sort_next = external hidden unnamed_addr constant [66 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @bcf_sr_sort_next(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #3 {
  %5 = getelementptr inbounds i8, ptr %0, i64 48
  %6 = load i32, ptr %5, align 8, !tbaa !5
  %7 = icmp eq i32 %6, 1
  %8 = getelementptr inbounds i8, ptr %1, i64 436
  br i1 %7, label %9, label %60

9:                                                ; preds = %4
  store i32 1, ptr %8, align 4, !tbaa !13
  %10 = getelementptr inbounds i8, ptr %1, i64 440
  %11 = load i32, ptr %10, align 8, !tbaa !15
  %.not112 = icmp eq i32 %11, 0
  br i1 %.not112, label %12, label %15

12:                                               ; preds = %9
  %13 = tail call noalias dereferenceable_or_null(16) ptr @calloc(i64 noundef 1, i64 noundef 16) #7
  %14 = getelementptr inbounds i8, ptr %1, i64 336
  store ptr %13, ptr %14, align 8, !tbaa !16
  store i32 1, ptr %10, align 8, !tbaa !15
  br label %15

15:                                               ; preds = %12, %9
  %16 = getelementptr inbounds i8, ptr %0, i64 40
  %17 = load ptr, ptr %16, align 8, !tbaa !17
  %18 = getelementptr inbounds i8, ptr %17, i64 48
  %19 = load ptr, ptr %18, align 8, !tbaa !18
  %20 = getelementptr inbounds i8, ptr %19, i64 8
  %21 = load ptr, ptr %20, align 8, !tbaa !20
  %22 = getelementptr inbounds i8, ptr %21, i64 4
  %23 = load i32, ptr %22, align 4, !tbaa !21
  %24 = icmp eq i32 %23, %3
  br i1 %24, label %26, label %25

25:                                               ; preds = %15
  tail call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.1, i32 noundef 546, ptr noundef nonnull @__PRETTY_FUNCTION__.bcf_sr_sort_next) #8
  unreachable

26:                                               ; preds = %15
  %27 = load ptr, ptr %19, align 8, !tbaa !20
  %28 = getelementptr inbounds i8, ptr %17, i64 56
  %29 = load i32, ptr %28, align 8, !tbaa !25
  %.not113132 = icmp slt i32 %29, 1
  br i1 %.not113132, label %._crit_edge136, label %.lr.ph135.preheader

.lr.ph135.preheader:                              ; preds = %26
  %30 = zext nneg i32 %29 to i64
  %xtraiter = and i64 %30, 3
  %31 = icmp ult i32 %29, 4
  br i1 %31, label %._crit_edge136.loopexit.unr-lcssa, label %.lr.ph135.preheader.new

.lr.ph135.preheader.new:                          ; preds = %.lr.ph135.preheader
  %unroll_iter = and i64 %30, 2147483644
  br label %.lr.ph135

.lr.ph135:                                        ; preds = %.lr.ph135, %.lr.ph135.preheader.new
  %indvars.iv150 = phi i64 [ 1, %.lr.ph135.preheader.new ], [ %indvars.iv.next151.3, %.lr.ph135 ]
  %niter = phi i64 [ 0, %.lr.ph135.preheader.new ], [ %niter.next.3, %.lr.ph135 ]
  %32 = load ptr, ptr %18, align 8, !tbaa !18
  %33 = getelementptr inbounds ptr, ptr %32, i64 %indvars.iv150
  %34 = load ptr, ptr %33, align 8, !tbaa !20
  %35 = getelementptr i8, ptr %33, i64 -8
  store ptr %34, ptr %35, align 8, !tbaa !20
  %36 = load ptr, ptr %18, align 8, !tbaa !18
  %37 = getelementptr inbounds ptr, ptr %36, i64 %indvars.iv150
  %38 = getelementptr inbounds i8, ptr %37, i64 8
  %39 = load ptr, ptr %38, align 8, !tbaa !20
  store ptr %39, ptr %37, align 8, !tbaa !20
  %40 = load ptr, ptr %18, align 8, !tbaa !18
  %41 = getelementptr inbounds ptr, ptr %40, i64 %indvars.iv150
  %42 = getelementptr inbounds i8, ptr %41, i64 16
  %43 = load ptr, ptr %42, align 8, !tbaa !20
  %44 = getelementptr i8, ptr %41, i64 8
  store ptr %43, ptr %44, align 8, !tbaa !20
  %45 = load ptr, ptr %18, align 8, !tbaa !18
  %46 = getelementptr inbounds ptr, ptr %45, i64 %indvars.iv150
  %47 = getelementptr inbounds i8, ptr %46, i64 24
  %48 = load ptr, ptr %47, align 8, !tbaa !20
  %49 = getelementptr i8, ptr %46, i64 16
  store ptr %48, ptr %49, align 8, !tbaa !20
  %indvars.iv.next151.3 = add nuw nsw i64 %indvars.iv150, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge136.loopexit.unr-lcssa, label %.lr.ph135, !llvm.loop !26

._crit_edge136.loopexit.unr-lcssa:                ; preds = %.lr.ph135, %.lr.ph135.preheader
  %indvars.iv150.unr = phi i64 [ 1, %.lr.ph135.preheader ], [ %indvars.iv.next151.3, %.lr.ph135 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge136.loopexit, label %.lr.ph135.epil

.lr.ph135.epil:                                   ; preds = %._crit_edge136.loopexit.unr-lcssa, %.lr.ph135.epil
  %indvars.iv150.epil = phi i64 [ %indvars.iv.next151.epil, %.lr.ph135.epil ], [ %indvars.iv150.unr, %._crit_edge136.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph135.epil ], [ 0, %._crit_edge136.loopexit.unr-lcssa ]
  %50 = load ptr, ptr %18, align 8, !tbaa !18
  %51 = getelementptr inbounds ptr, ptr %50, i64 %indvars.iv150.epil
  %52 = load ptr, ptr %51, align 8, !tbaa !20
  %53 = getelementptr i8, ptr %51, i64 -8
  store ptr %52, ptr %53, align 8, !tbaa !20
  %indvars.iv.next151.epil = add nuw nsw i64 %indvars.iv150.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge136.loopexit, label %.lr.ph135.epil, !llvm.loop !28

._crit_edge136.loopexit:                          ; preds = %.lr.ph135.epil, %._crit_edge136.loopexit.unr-lcssa
  %.pre157 = load ptr, ptr %18, align 8, !tbaa !18
  br label %._crit_edge136

._crit_edge136:                                   ; preds = %._crit_edge136.loopexit, %26
  %54 = phi ptr [ %.pre157, %._crit_edge136.loopexit ], [ %19, %26 ]
  %55 = sext i32 %29 to i64
  %56 = getelementptr inbounds ptr, ptr %54, i64 %55
  store ptr %27, ptr %56, align 8, !tbaa !20
  %57 = add nsw i32 %29, -1
  store i32 %57, ptr %28, align 8, !tbaa !25
  %58 = getelementptr inbounds i8, ptr %0, i64 24
  %59 = load ptr, ptr %58, align 8, !tbaa !30
  store i32 1, ptr %59, align 4, !tbaa !31
  br label %.loopexit

60:                                               ; preds = %4
  %61 = load i32, ptr %8, align 4, !tbaa !13
  %.not = icmp eq i32 %61, %6
  br i1 %.not, label %84, label %62

62:                                               ; preds = %60
  %63 = getelementptr inbounds i8, ptr %1, i64 344
  store ptr %0, ptr %63, align 8, !tbaa !32
  %64 = icmp slt i32 %61, %6
  br i1 %64, label %65, label %.thread

65:                                               ; preds = %62
  %66 = getelementptr inbounds i8, ptr %1, i64 336
  %67 = load ptr, ptr %66, align 8, !tbaa !16
  %68 = sext i32 %6 to i64
  %69 = shl nsw i64 %68, 4
  %70 = tail call ptr @realloc(ptr noundef %67, i64 noundef %69) #9
  store ptr %70, ptr %66, align 8, !tbaa !16
  %71 = load i32, ptr %8, align 4, !tbaa !13
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds %struct.vcf_buf_t, ptr %70, i64 %72
  %74 = load i32, ptr %5, align 8, !tbaa !5
  %75 = sub nsw i32 %74, %71
  %76 = sext i32 %75 to i64
  %77 = shl nsw i64 %76, 4
  tail call void @llvm.memset.p0.i64(ptr align 8 %73, i8 0, i64 %77, i1 false)
  %78 = getelementptr inbounds i8, ptr %1, i64 440
  %79 = load i32, ptr %78, align 8, !tbaa !15
  %80 = icmp slt i32 %79, %71
  br i1 %80, label %81, label %.thread

81:                                               ; preds = %65
  store i32 %71, ptr %78, align 8, !tbaa !15
  br label %.thread

.thread:                                          ; preds = %62, %81, %65
  %82 = phi i32 [ %74, %65 ], [ %74, %81 ], [ %6, %62 ]
  store i32 %82, ptr %8, align 4, !tbaa !13
  %83 = getelementptr inbounds i8, ptr %1, i64 424
  store ptr null, ptr %83, align 8, !tbaa !33
  br label %90

84:                                               ; preds = %60
  %.phi.trans.insert = getelementptr inbounds i8, ptr %1, i64 424
  %.pre = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !33
  %.not104 = icmp eq ptr %.pre, null
  br i1 %.not104, label %90, label %85

85:                                               ; preds = %84
  %86 = getelementptr inbounds i8, ptr %1, i64 432
  %87 = load i32, ptr %86, align 8, !tbaa !34
  %.not105 = icmp eq i32 %87, %3
  br i1 %.not105, label %88, label %90

88:                                               ; preds = %85
  %89 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %.pre, ptr noundef nonnull dereferenceable(1) %2) #10
  %.not106 = icmp eq i32 %89, 0
  br i1 %.not106, label %91, label %90

90:                                               ; preds = %.thread, %88, %85, %84
  tail call void @bcf_sr_sort_set(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef %2, i32 noundef %3)
  br label %91

91:                                               ; preds = %90, %88
  %92 = getelementptr inbounds i8, ptr %1, i64 336
  %93 = load ptr, ptr %92, align 8, !tbaa !16
  %94 = load i32, ptr %93, align 8, !tbaa !35
  %.not107 = icmp eq i32 %94, 0
  br i1 %.not107, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %91
  %95 = getelementptr inbounds i8, ptr %1, i64 344
  %96 = load ptr, ptr %95, align 8, !tbaa !32
  %97 = getelementptr inbounds i8, ptr %96, i64 48
  %98 = load i32, ptr %97, align 8, !tbaa !5
  %99 = icmp sgt i32 %98, 0
  br i1 %99, label %.lr.ph131, label %.loopexit

.lr.ph131:                                        ; preds = %.preheader, %147
  %100 = phi ptr [ %148, %147 ], [ %96, %.preheader ]
  %indvars.iv147 = phi i64 [ %indvars.iv.next148, %147 ], [ 0, %.preheader ]
  %.095129 = phi i32 [ %.196, %147 ], [ 0, %.preheader ]
  %101 = load ptr, ptr %92, align 8, !tbaa !16
  %102 = getelementptr inbounds %struct.vcf_buf_t, ptr %101, i64 %indvars.iv147
  %103 = getelementptr inbounds i8, ptr %102, i64 8
  %104 = load ptr, ptr %103, align 8, !tbaa !37
  %105 = load ptr, ptr %104, align 8, !tbaa !20
  %.not108 = icmp eq ptr %105, null
  br i1 %.not108, label %135, label %106

106:                                              ; preds = %.lr.ph131
  %107 = getelementptr inbounds i8, ptr %100, i64 40
  %108 = load ptr, ptr %107, align 8, !tbaa !17
  %109 = getelementptr inbounds %struct.bcf_sr_t, ptr %108, i64 %indvars.iv147
  %110 = getelementptr inbounds i8, ptr %109, i64 56
  %111 = load i32, ptr %110, align 8, !tbaa !25
  %.not109121 = icmp slt i32 %111, 1
  br i1 %.not109121, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %106
  %112 = getelementptr inbounds i8, ptr %109, i64 48
  %113 = load ptr, ptr %112, align 8, !tbaa !18
  %114 = add nuw i32 %111, 1
  %wide.trip.count = zext i32 %114 to i64
  br label %115

115:                                              ; preds = %.lr.ph, %119
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %119 ]
  %116 = getelementptr inbounds ptr, ptr %113, i64 %indvars.iv
  %117 = load ptr, ptr %116, align 8, !tbaa !20
  %118 = icmp eq ptr %117, %105
  br i1 %118, label %120, label %119

119:                                              ; preds = %115
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %115, !llvm.loop !38

._crit_edge:                                      ; preds = %106, %119
  tail call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.1, i32 noundef 583, ptr noundef nonnull @__PRETTY_FUNCTION__.bcf_sr_sort_next) #8
  unreachable

120:                                              ; preds = %115
  %121 = trunc nuw nsw i64 %indvars.iv to i32
  %122 = load ptr, ptr %113, align 8, !tbaa !20
  %123 = and i64 %indvars.iv, 4294967295
  %124 = getelementptr inbounds ptr, ptr %113, i64 %123
  %125 = load ptr, ptr %124, align 8, !tbaa !20
  store ptr %125, ptr %113, align 8, !tbaa !20
  %.not111.not124 = icmp sgt i32 %111, %121
  %wide.trip.count145 = zext nneg i32 %111 to i64
  br i1 %.not111.not124, label %.lr.ph127, label %._crit_edge128

.lr.ph127:                                        ; preds = %120, %.lr.ph127
  %indvars.iv142 = phi i64 [ %indvars.iv.next143, %.lr.ph127 ], [ %indvars.iv, %120 ]
  %indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1
  %126 = load ptr, ptr %112, align 8, !tbaa !18
  %127 = getelementptr inbounds ptr, ptr %126, i64 %indvars.iv.next143
  %128 = load ptr, ptr %127, align 8, !tbaa !20
  %129 = getelementptr inbounds ptr, ptr %126, i64 %indvars.iv142
  store ptr %128, ptr %129, align 8, !tbaa !20
  %exitcond146.not = icmp eq i64 %indvars.iv.next143, %wide.trip.count145
  br i1 %exitcond146.not, label %._crit_edge128, label %.lr.ph127, !llvm.loop !39

._crit_edge128:                                   ; preds = %.lr.ph127, %120
  %130 = load ptr, ptr %112, align 8, !tbaa !18
  %131 = getelementptr inbounds ptr, ptr %130, i64 %wide.trip.count145
  store ptr %122, ptr %131, align 8, !tbaa !20
  %132 = add nsw i32 %111, -1
  store i32 %132, ptr %110, align 8, !tbaa !25
  %133 = add nsw i32 %.095129, 1
  %134 = load ptr, ptr %95, align 8, !tbaa !32
  br label %135

135:                                              ; preds = %.lr.ph131, %._crit_edge128
  %.sink165 = phi ptr [ %134, %._crit_edge128 ], [ %100, %.lr.ph131 ]
  %.sink = phi i32 [ 1, %._crit_edge128 ], [ 0, %.lr.ph131 ]
  %.196 = phi i32 [ %133, %._crit_edge128 ], [ %.095129, %.lr.ph131 ]
  %136 = getelementptr inbounds i8, ptr %.sink165, i64 24
  %137 = load ptr, ptr %136, align 8, !tbaa !30
  %138 = getelementptr inbounds i32, ptr %137, i64 %indvars.iv147
  store i32 %.sink, ptr %138, align 4, !tbaa !31
  %139 = load i32, ptr %102, align 8, !tbaa !35
  %140 = add nsw i32 %139, -1
  store i32 %140, ptr %102, align 8, !tbaa !35
  %141 = icmp sgt i32 %139, 1
  br i1 %141, label %142, label %147

142:                                              ; preds = %135
  %143 = load ptr, ptr %103, align 8, !tbaa !37
  %144 = getelementptr inbounds i8, ptr %143, i64 8
  %145 = zext nneg i32 %140 to i64
  %146 = shl nuw nsw i64 %145, 3
  tail call void @llvm.memmove.p0.p0.i64(ptr align 8 %143, ptr nonnull align 8 %144, i64 %146, i1 false)
  %.pre156 = load ptr, ptr %95, align 8, !tbaa !32
  br label %147

147:                                              ; preds = %142, %135
  %148 = phi ptr [ %.pre156, %142 ], [ %.sink165, %135 ]
  %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
  %149 = getelementptr inbounds i8, ptr %148, i64 48
  %150 = load i32, ptr %149, align 8, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = icmp slt i64 %indvars.iv.next148, %151
  br i1 %152, label %.lr.ph131, label %.loopexit, !llvm.loop !40

.loopexit:                                        ; preds = %147, %.preheader, %91, %._crit_edge136
  %.0 = phi i32 [ 1, %._crit_edge136 ], [ 0, %91 ], [ 0, %.preheader ], [ %.196, %147 ]
  ret i32 %.0
}

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

; 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 #5

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

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

attributes #0 = { 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 #1 = { noreturn 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) 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 #5 = { 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 #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nounwind allocsize(0,1) }
attributes #8 = { noreturn nounwind }
attributes #9 = { nounwind allocsize(1) }
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, !7, i64 48}
!6 = !{!"", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 20, !10, i64 24, !7, i64 32, !10, i64 40, !7, i64 48, !7, i64 52, !7, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !7, i64 88, !7, i64 92, !11, i64 96, !7, i64 120, !7, i64 124, !10, i64 128, !10, i64 136}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"__kstring_t", !12, i64 0, !12, i64 8, !10, i64 16}
!12 = !{!"long", !8, i64 0}
!13 = !{!14, !7, i64 436}
!14 = !{!"", !8, i64 0, !7, i64 256, !7, i64 260, !10, i64 264, !7, i64 272, !7, i64 276, !7, i64 280, !10, i64 288, !7, i64 296, !7, i64 300, !7, 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, !7, i64 392, !7, i64 396, !10, i64 400, !7, i64 408, !10, i64 416, !10, i64 424, !7, i64 432, !7, i64 436, !7, i64 440, !7, i64 444}
!15 = !{!14, !7, i64 440}
!16 = !{!14, !10, i64 336}
!17 = !{!6, !10, i64 40}
!18 = !{!19, !10, i64 48}
!19 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !7, i64 56, !7, i64 60, !7, i64 64, !10, i64 72, !10, i64 80, !7, i64 88}
!20 = !{!10, !10, i64 0}
!21 = !{!22, !7, i64 4}
!22 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !23, i64 12, !7, i64 16, !7, i64 18, !7, i64 20, !7, i64 21, !11, i64 24, !11, i64 48, !24, i64 72, !7, i64 176, !7, i64 180, !8, i64 184, !7, i64 196}
!23 = !{!"float", !8, i64 0}
!24 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !7, i64 88, !7, i64 92, !7, i64 96, !7, i64 100}
!25 = !{!19, !7, i64 56}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.unroll.disable"}
!30 = !{!6, !10, i64 24}
!31 = !{!7, !7, i64 0}
!32 = !{!14, !10, i64 344}
!33 = !{!14, !10, i64 424}
!34 = !{!14, !7, i64 432}
!35 = !{!36, !7, i64 0}
!36 = !{!"", !7, i64 0, !7, i64 4, !10, i64 8}
!37 = !{!36, !10, i64 8}
!38 = distinct !{!38, !27}
!39 = distinct !{!39, !27}
!40 = distinct !{!40, !27}


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