; 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 }
%struct.vcf_buf_t = type { i32, i32, ptr }
%struct.var_t = type { ptr, i32, i32, i32, i32, ptr, ptr, ptr }
%struct.grp_t = type { ptr, i32, i32, ptr, i32 }
%struct.varset_t = type { i32, i32, ptr, i32, 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: nounwind
declare void @free(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @bcf_sr_sort_destroy(ptr noundef %0) #3 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %4 = load ptr, ptr %2, align 8, !tbaa !5
  %5 = getelementptr inbounds %struct.sr_sort_t, ptr %4, i32 0, i32 17
  %6 = load ptr, ptr %5, align 8, !tbaa !9
  %7 = icmp ne ptr %6, null
  br i1 %7, label %8, label %12

8:                                                ; preds = %1
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.sr_sort_t, ptr %9, i32 0, i32 17
  %11 = load ptr, ptr %10, align 8, !tbaa !9
  call void @khash_str2int_destroy_free(ptr noundef %11)
  br label %12

12:                                               ; preds = %8, %1
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.sr_sort_t, ptr %13, i32 0, i32 16
  %15 = load ptr, ptr %14, align 8, !tbaa !14
  %16 = icmp ne ptr %15, null
  br i1 %16, label %17, label %21

17:                                               ; preds = %12
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.sr_sort_t, ptr %18, i32 0, i32 16
  %20 = load ptr, ptr %19, align 8, !tbaa !14
  call void @khash_str2int_destroy_free(ptr noundef %20)
  br label %21

21:                                               ; preds = %17, %12
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !15
  br label %22

22:                                               ; preds = %37, %21
  %23 = load i32, ptr %3, align 4, !tbaa !15
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.sr_sort_t, ptr %24, i32 0, i32 26
  %26 = load i32, ptr %25, align 4, !tbaa !16
  %27 = icmp slt i32 %23, %26
  br i1 %27, label %28, label %40

28:                                               ; preds = %22
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.sr_sort_t, ptr %29, i32 0, i32 14
  %31 = load ptr, ptr %30, align 8, !tbaa !17
  %32 = load i32, ptr %3, align 4, !tbaa !15
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds %struct.vcf_buf_t, ptr %31, i64 %33
  %35 = getelementptr inbounds %struct.vcf_buf_t, ptr %34, i32 0, i32 2
  %36 = load ptr, ptr %35, align 8, !tbaa !18
  call void @free(ptr noundef %36) #5
  br label %37

37:                                               ; preds = %28
  %38 = load i32, ptr %3, align 4, !tbaa !15
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %3, align 4, !tbaa !15
  br label %22, !llvm.loop !20

40:                                               ; preds = %22
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.sr_sort_t, ptr %41, i32 0, i32 14
  %43 = load ptr, ptr %42, align 8, !tbaa !17
  call void @free(ptr noundef %43) #5
  store i32 0, ptr %3, align 4, !tbaa !15
  br label %44

44:                                               ; preds = %83, %40
  %45 = load i32, ptr %3, align 4, !tbaa !15
  %46 = load ptr, ptr %2, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.sr_sort_t, ptr %46, i32 0, i32 2
  %48 = load i32, ptr %47, align 4, !tbaa !22
  %49 = icmp slt i32 %45, %48
  br i1 %49, label %50, label %86

50:                                               ; preds = %44
  %51 = load ptr, ptr %2, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.sr_sort_t, ptr %51, i32 0, i32 3
  %53 = load ptr, ptr %52, align 8, !tbaa !23
  %54 = load i32, ptr %3, align 4, !tbaa !15
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds %struct.var_t, ptr %53, i64 %55
  %57 = getelementptr inbounds %struct.var_t, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !24
  call void @free(ptr noundef %58) #5
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.sr_sort_t, ptr %59, i32 0, i32 3
  %61 = load ptr, ptr %60, align 8, !tbaa !23
  %62 = load i32, ptr %3, align 4, !tbaa !15
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds %struct.var_t, ptr %61, i64 %63
  %65 = getelementptr inbounds %struct.var_t, ptr %64, i32 0, i32 5
  %66 = load ptr, ptr %65, align 8, !tbaa !26
  call void @free(ptr noundef %66) #5
  %67 = load ptr, ptr %2, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.sr_sort_t, ptr %67, i32 0, i32 3
  %69 = load ptr, ptr %68, align 8, !tbaa !23
  %70 = load i32, ptr %3, align 4, !tbaa !15
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds %struct.var_t, ptr %69, i64 %71
  %73 = getelementptr inbounds %struct.var_t, ptr %72, i32 0, i32 6
  %74 = load ptr, ptr %73, align 8, !tbaa !27
  call void @free(ptr noundef %74) #5
  %75 = load ptr, ptr %2, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.sr_sort_t, ptr %75, i32 0, i32 3
  %77 = load ptr, ptr %76, align 8, !tbaa !23
  %78 = load i32, ptr %3, align 4, !tbaa !15
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds %struct.var_t, ptr %77, i64 %79
  %81 = getelementptr inbounds %struct.var_t, ptr %80, i32 0, i32 7
  %82 = load ptr, ptr %81, align 8, !tbaa !28
  call void @kbs_destroy(ptr noundef %82)
  br label %83

83:                                               ; preds = %50
  %84 = load i32, ptr %3, align 4, !tbaa !15
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %3, align 4, !tbaa !15
  br label %44, !llvm.loop !29

86:                                               ; preds = %44
  %87 = load ptr, ptr %2, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.sr_sort_t, ptr %87, i32 0, i32 3
  %89 = load ptr, ptr %88, align 8, !tbaa !23
  call void @free(ptr noundef %89) #5
  store i32 0, ptr %3, align 4, !tbaa !15
  br label %90

90:                                               ; preds = %105, %86
  %91 = load i32, ptr %3, align 4, !tbaa !15
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.sr_sort_t, ptr %92, i32 0, i32 9
  %94 = load i32, ptr %93, align 4, !tbaa !30
  %95 = icmp slt i32 %91, %94
  br i1 %95, label %96, label %108

96:                                               ; preds = %90
  %97 = load ptr, ptr %2, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.sr_sort_t, ptr %97, i32 0, i32 12
  %99 = load ptr, ptr %98, align 8, !tbaa !31
  %100 = load i32, ptr %3, align 4, !tbaa !15
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds %struct.grp_t, ptr %99, i64 %101
  %103 = getelementptr inbounds %struct.grp_t, ptr %102, i32 0, i32 3
  %104 = load ptr, ptr %103, align 8, !tbaa !32
  call void @free(ptr noundef %104) #5
  br label %105

105:                                              ; preds = %96
  %106 = load i32, ptr %3, align 4, !tbaa !15
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %3, align 4, !tbaa !15
  br label %90, !llvm.loop !34

108:                                              ; preds = %90
  %109 = load ptr, ptr %2, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.sr_sort_t, ptr %109, i32 0, i32 12
  %111 = load ptr, ptr %110, align 8, !tbaa !31
  call void @free(ptr noundef %111) #5
  store i32 0, ptr %3, align 4, !tbaa !15
  br label %112

112:                                              ; preds = %135, %108
  %113 = load i32, ptr %3, align 4, !tbaa !15
  %114 = load ptr, ptr %2, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.sr_sort_t, ptr %114, i32 0, i32 5
  %116 = load i32, ptr %115, align 4, !tbaa !35
  %117 = icmp slt i32 %113, %116
  br i1 %117, label %118, label %138

118:                                              ; preds = %112
  %119 = load ptr, ptr %2, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.sr_sort_t, ptr %119, i32 0, i32 13
  %121 = load ptr, ptr %120, align 8, !tbaa !36
  %122 = load i32, ptr %3, align 4, !tbaa !15
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds %struct.varset_t, ptr %121, i64 %123
  %125 = getelementptr inbounds %struct.varset_t, ptr %124, i32 0, i32 4
  %126 = load ptr, ptr %125, align 8, !tbaa !37
  call void @kbs_destroy(ptr noundef %126)
  %127 = load ptr, ptr %2, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.sr_sort_t, ptr %127, i32 0, i32 13
  %129 = load ptr, ptr %128, align 8, !tbaa !36
  %130 = load i32, ptr %3, align 4, !tbaa !15
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds %struct.varset_t, ptr %129, i64 %131
  %133 = getelementptr inbounds %struct.varset_t, ptr %132, i32 0, i32 2
  %134 = load ptr, ptr %133, align 8, !tbaa !39
  call void @free(ptr noundef %134) #5
  br label %135

135:                                              ; preds = %118
  %136 = load i32, ptr %3, align 4, !tbaa !15
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %3, align 4, !tbaa !15
  br label %112, !llvm.loop !40

138:                                              ; preds = %112
  %139 = load ptr, ptr %2, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.sr_sort_t, ptr %139, i32 0, i32 13
  %141 = load ptr, ptr %140, align 8, !tbaa !36
  call void @free(ptr noundef %141) #5
  %142 = load ptr, ptr %2, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.sr_sort_t, ptr %142, i32 0, i32 18
  %144 = getelementptr inbounds %struct.__kstring_t, ptr %143, i32 0, i32 2
  %145 = load ptr, ptr %144, align 8, !tbaa !41
  call void @free(ptr noundef %145) #5
  %146 = load ptr, ptr %2, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.sr_sort_t, ptr %146, i32 0, i32 21
  %148 = load ptr, ptr %147, align 8, !tbaa !42
  call void @free(ptr noundef %148) #5
  %149 = load ptr, ptr %2, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.sr_sort_t, ptr %149, i32 0, i32 23
  %151 = load ptr, ptr %150, align 8, !tbaa !43
  call void @free(ptr noundef %151) #5
  %152 = load ptr, ptr %2, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.sr_sort_t, ptr %152, i32 0, i32 11
  %154 = load ptr, ptr %153, align 8, !tbaa !44
  call void @free(ptr noundef %154) #5
  %155 = load ptr, ptr %2, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.sr_sort_t, ptr %155, i32 0, i32 7
  %157 = load ptr, ptr %156, align 8, !tbaa !45
  call void @free(ptr noundef %157) #5
  %158 = load ptr, ptr %2, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %158, i8 0, i64 448, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  ret void
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @khash_str2int_destroy_free(ptr noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @kbs_destroy(ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { 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 = { 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 = { 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, !6, i64 360}
!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, !6, i64 352}
!15 = !{!11, !11, i64 0}
!16 = !{!10, !11, i64 436}
!17 = !{!10, !6, i64 336}
!18 = !{!19, !6, i64 8}
!19 = !{!"", !11, i64 0, !11, i64 4, !6, i64 8}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!10, !11, i64 260}
!23 = !{!10, !6, i64 264}
!24 = !{!25, !6, i64 0}
!25 = !{!"", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !6, i64 24, !6, i64 32, !6, i64 40}
!26 = !{!25, !6, i64 24}
!27 = !{!25, !6, i64 32}
!28 = !{!25, !6, i64 40}
!29 = distinct !{!29, !21}
!30 = !{!10, !11, i64 300}
!31 = !{!10, !6, i64 320}
!32 = !{!33, !6, i64 16}
!33 = !{!"", !6, i64 0, !11, i64 8, !11, i64 12, !6, i64 16, !11, i64 24}
!34 = distinct !{!34, !21}
!35 = !{!10, !11, i64 276}
!36 = !{!10, !6, i64 328}
!37 = !{!38, !6, i64 24}
!38 = !{!"", !11, i64 0, !11, i64 4, !6, i64 8, !11, i64 16, !6, i64 24}
!39 = !{!38, !6, i64 8}
!40 = distinct !{!40, !21}
!41 = !{!10, !6, i64 384}
!42 = !{!10, !6, i64 400}
!43 = !{!10, !6, i64 416}
!44 = !{!10, !6, i64 312}
!45 = !{!10, !6, i64 288}


; 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.var_t = type { ptr, i32, i32, i32, i32, ptr, ptr, ptr }
%struct.grp_t = type { ptr, i32, i32, ptr, i32 }
%struct.varset_t = type { i32, i32, ptr, i32, ptr }

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

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

4:                                                ; preds = %1
  tail call void @khash_str2int_destroy_free(ptr noundef nonnull %3)
  br label %5

5:                                                ; preds = %4, %1
  %6 = getelementptr inbounds i8, ptr %0, i64 352
  %7 = load ptr, ptr %6, align 8, !tbaa !13
  %.not43 = icmp eq ptr %7, null
  br i1 %.not43, label %9, label %8

8:                                                ; preds = %5
  tail call void @khash_str2int_destroy_free(ptr noundef nonnull %7)
  br label %9

9:                                                ; preds = %8, %5
  %10 = getelementptr inbounds i8, ptr %0, i64 436
  %11 = load i32, ptr %10, align 4, !tbaa !14
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %9
  %13 = getelementptr inbounds i8, ptr %0, i64 336
  br label %14

14:                                               ; preds = %.lr.ph, %14
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %14 ]
  %15 = load ptr, ptr %13, align 8, !tbaa !15
  %16 = getelementptr inbounds %struct.vcf_buf_t, ptr %15, i64 %indvars.iv, i32 2
  %17 = load ptr, ptr %16, align 8, !tbaa !16
  tail call void @free(ptr noundef %17) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = load i32, ptr %10, align 4, !tbaa !14
  %19 = sext i32 %18 to i64
  %20 = icmp slt i64 %indvars.iv.next, %19
  br i1 %20, label %14, label %._crit_edge, !llvm.loop !18

._crit_edge:                                      ; preds = %14, %9
  %21 = getelementptr inbounds i8, ptr %0, i64 336
  %22 = load ptr, ptr %21, align 8, !tbaa !15
  tail call void @free(ptr noundef %22) #4
  %23 = getelementptr inbounds i8, ptr %0, i64 260
  %24 = load i32, ptr %23, align 4, !tbaa !20
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.lr.ph47, label %._crit_edge48

.lr.ph47:                                         ; preds = %._crit_edge
  %26 = getelementptr inbounds i8, ptr %0, i64 264
  br label %27

27:                                               ; preds = %.lr.ph47, %27
  %indvars.iv58 = phi i64 [ 0, %.lr.ph47 ], [ %indvars.iv.next59, %27 ]
  %28 = load ptr, ptr %26, align 8, !tbaa !21
  %29 = getelementptr inbounds %struct.var_t, ptr %28, i64 %indvars.iv58
  %30 = load ptr, ptr %29, align 8, !tbaa !22
  tail call void @free(ptr noundef %30) #4
  %31 = load ptr, ptr %26, align 8, !tbaa !21
  %32 = getelementptr inbounds %struct.var_t, ptr %31, i64 %indvars.iv58, i32 5
  %33 = load ptr, ptr %32, align 8, !tbaa !24
  tail call void @free(ptr noundef %33) #4
  %34 = load ptr, ptr %26, align 8, !tbaa !21
  %35 = getelementptr inbounds %struct.var_t, ptr %34, i64 %indvars.iv58, i32 6
  %36 = load ptr, ptr %35, align 8, !tbaa !25
  tail call void @free(ptr noundef %36) #4
  %37 = load ptr, ptr %26, align 8, !tbaa !21
  %38 = getelementptr inbounds %struct.var_t, ptr %37, i64 %indvars.iv58, i32 7
  %39 = load ptr, ptr %38, align 8, !tbaa !26
  tail call void @kbs_destroy(ptr noundef %39)
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %40 = load i32, ptr %23, align 4, !tbaa !20
  %41 = sext i32 %40 to i64
  %42 = icmp slt i64 %indvars.iv.next59, %41
  br i1 %42, label %27, label %._crit_edge48, !llvm.loop !27

._crit_edge48:                                    ; preds = %27, %._crit_edge
  %43 = getelementptr inbounds i8, ptr %0, i64 264
  %44 = load ptr, ptr %43, align 8, !tbaa !21
  tail call void @free(ptr noundef %44) #4
  %45 = getelementptr inbounds i8, ptr %0, i64 300
  %46 = load i32, ptr %45, align 4, !tbaa !28
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %.lr.ph51, label %._crit_edge52

.lr.ph51:                                         ; preds = %._crit_edge48
  %48 = getelementptr inbounds i8, ptr %0, i64 320
  br label %49

49:                                               ; preds = %.lr.ph51, %49
  %indvars.iv61 = phi i64 [ 0, %.lr.ph51 ], [ %indvars.iv.next62, %49 ]
  %50 = load ptr, ptr %48, align 8, !tbaa !29
  %51 = getelementptr inbounds %struct.grp_t, ptr %50, i64 %indvars.iv61, i32 3
  %52 = load ptr, ptr %51, align 8, !tbaa !30
  tail call void @free(ptr noundef %52) #4
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %53 = load i32, ptr %45, align 4, !tbaa !28
  %54 = sext i32 %53 to i64
  %55 = icmp slt i64 %indvars.iv.next62, %54
  br i1 %55, label %49, label %._crit_edge52, !llvm.loop !32

._crit_edge52:                                    ; preds = %49, %._crit_edge48
  %56 = getelementptr inbounds i8, ptr %0, i64 320
  %57 = load ptr, ptr %56, align 8, !tbaa !29
  tail call void @free(ptr noundef %57) #4
  %58 = getelementptr inbounds i8, ptr %0, i64 276
  %59 = load i32, ptr %58, align 4, !tbaa !33
  %60 = icmp sgt i32 %59, 0
  br i1 %60, label %.lr.ph55, label %._crit_edge56

.lr.ph55:                                         ; preds = %._crit_edge52
  %61 = getelementptr inbounds i8, ptr %0, i64 328
  br label %62

62:                                               ; preds = %.lr.ph55, %62
  %indvars.iv64 = phi i64 [ 0, %.lr.ph55 ], [ %indvars.iv.next65, %62 ]
  %63 = load ptr, ptr %61, align 8, !tbaa !34
  %64 = getelementptr inbounds %struct.varset_t, ptr %63, i64 %indvars.iv64, i32 4
  %65 = load ptr, ptr %64, align 8, !tbaa !35
  tail call void @kbs_destroy(ptr noundef %65)
  %66 = load ptr, ptr %61, align 8, !tbaa !34
  %67 = getelementptr inbounds %struct.varset_t, ptr %66, i64 %indvars.iv64, i32 2
  %68 = load ptr, ptr %67, align 8, !tbaa !37
  tail call void @free(ptr noundef %68) #4
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %69 = load i32, ptr %58, align 4, !tbaa !33
  %70 = sext i32 %69 to i64
  %71 = icmp slt i64 %indvars.iv.next65, %70
  br i1 %71, label %62, label %._crit_edge56, !llvm.loop !38

._crit_edge56:                                    ; preds = %62, %._crit_edge52
  %72 = getelementptr inbounds i8, ptr %0, i64 328
  %73 = load ptr, ptr %72, align 8, !tbaa !34
  tail call void @free(ptr noundef %73) #4
  %74 = getelementptr inbounds i8, ptr %0, i64 384
  %75 = load ptr, ptr %74, align 8, !tbaa !39
  tail call void @free(ptr noundef %75) #4
  %76 = getelementptr inbounds i8, ptr %0, i64 400
  %77 = load ptr, ptr %76, align 8, !tbaa !40
  tail call void @free(ptr noundef %77) #4
  %78 = getelementptr inbounds i8, ptr %0, i64 416
  %79 = load ptr, ptr %78, align 8, !tbaa !41
  tail call void @free(ptr noundef %79) #4
  %80 = getelementptr inbounds i8, ptr %0, i64 312
  %81 = load ptr, ptr %80, align 8, !tbaa !42
  tail call void @free(ptr noundef %81) #4
  %82 = getelementptr inbounds i8, ptr %0, i64 288
  %83 = load ptr, ptr %82, align 8, !tbaa !43
  tail call void @free(ptr noundef %83) #4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(448) %0, i8 0, i64 448, i1 false)
  ret void
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @khash_str2int_destroy_free(ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @kbs_destroy(ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { mustprogress nounwind willreturn allockind("free") 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 #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 = { 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 = { 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, !10, i64 360}
!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, !10, i64 352}
!14 = !{!6, !9, i64 436}
!15 = !{!6, !10, i64 336}
!16 = !{!17, !10, i64 8}
!17 = !{!"", !9, i64 0, !9, i64 4, !10, i64 8}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!6, !9, i64 260}
!21 = !{!6, !10, i64 264}
!22 = !{!23, !10, i64 0}
!23 = !{!"", !10, i64 0, !9, i64 8, !9, i64 12, !9, i64 16, !9, i64 20, !10, i64 24, !10, i64 32, !10, i64 40}
!24 = !{!23, !10, i64 24}
!25 = !{!23, !10, i64 32}
!26 = !{!23, !10, i64 40}
!27 = distinct !{!27, !19}
!28 = !{!6, !9, i64 300}
!29 = !{!6, !10, i64 320}
!30 = !{!31, !10, i64 16}
!31 = !{!"", !10, i64 0, !9, i64 8, !9, i64 12, !10, i64 16, !9, i64 24}
!32 = distinct !{!32, !19}
!33 = !{!6, !9, i64 276}
!34 = !{!6, !10, i64 328}
!35 = !{!36, !10, i64 24}
!36 = !{!"", !9, i64 0, !9, i64 4, !10, i64 8, !9, i64 16, !10, i64 24}
!37 = !{!36, !10, i64 8}
!38 = distinct !{!38, !19}
!39 = !{!6, !10, i64 384}
!40 = !{!6, !10, i64 400}
!41 = !{!6, !10, i64 416}
!42 = !{!6, !10, i64 312}
!43 = !{!6, !10, i64 288}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass