; LLVM IR from ryanlayer/giggle :: src (file_read)

; 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.input_file = type { ptr, ptr, ptr, ptr, ptr, ptr, i64, i32, ptr, ptr, ptr }
%struct.BGZF = type { i32, i32, i32, i32, i32, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr }
%struct.__kstring_t = type { i64, i64, ptr }
%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 }

@.str.15 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [52 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: noreturn
declare void @err(i32 noundef, ptr noundef, ...) #1

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

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

; 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) #4

declare i32 @bgzf_getline(ptr noundef, i32 noundef, ptr noundef) #5

; Function Attrs: nounwind uwtable
define dso_local i32 @input_file_get_next_interval_vcf(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #6 {
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.input_file, ptr %22, i32 0, i32 6
  %24 = load i64, ptr %23, align 8, !tbaa !9
  %25 = load ptr, ptr %14, align 8, !tbaa !5
  store i64 %24, ptr %25, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.input_file, ptr %26, i32 0, i32 2
  %28 = load ptr, ptr %27, align 8, !tbaa !14
  %29 = load ptr, ptr %9, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.input_file, ptr %29, i32 0, i32 5
  %31 = load ptr, ptr %30, align 8, !tbaa !15
  %32 = call i32 @bgzf_getline(ptr noundef %28, i32 noundef 10, ptr noundef %31)
  store i32 %32, ptr %16, align 4, !tbaa !16
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.input_file, ptr %33, i32 0, i32 2
  %35 = load ptr, ptr %34, align 8, !tbaa !14
  %36 = getelementptr inbounds %struct.BGZF, ptr %35, i32 0, i32 5
  %37 = load i64, ptr %36, align 8, !tbaa !17
  %38 = shl i64 %37, 16
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.input_file, ptr %39, i32 0, i32 2
  %41 = load ptr, ptr %40, align 8, !tbaa !14
  %42 = getelementptr inbounds %struct.BGZF, ptr %41, i32 0, i32 4
  %43 = load i32, ptr %42, align 8, !tbaa !19
  %44 = and i32 %43, 65535
  %45 = sext i32 %44 to i64
  %46 = or i64 %38, %45
  %47 = load ptr, ptr %9, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.input_file, ptr %47, i32 0, i32 6
  store i64 %46, ptr %48, align 8, !tbaa !9
  %49 = load i32, ptr %16, align 4, !tbaa !16
  %50 = icmp slt i32 %49, 0
  br i1 %50, label %51, label %53

51:                                               ; preds = %7
  %52 = load i32, ptr %16, align 4, !tbaa !16
  store i32 %52, ptr %8, align 4
  store i32 1, ptr %17, align 4
  br label %190

53:                                               ; preds = %7
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.input_file, ptr %54, i32 0, i32 5
  %56 = load ptr, ptr %55, align 8, !tbaa !15
  %57 = load ptr, ptr %9, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.input_file, ptr %57, i32 0, i32 4
  %59 = load ptr, ptr %58, align 8, !tbaa !20
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.input_file, ptr %60, i32 0, i32 1
  %62 = load ptr, ptr %61, align 8, !tbaa !21
  %63 = call i32 @vcf_parse(ptr noundef %56, ptr noundef %59, ptr noundef %62)
  %64 = load ptr, ptr %15, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.__kstring_t, ptr %64, i32 0, i32 0
  store i64 0, ptr %65, align 8, !tbaa !22
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.input_file, ptr %66, i32 0, i32 5
  %68 = load ptr, ptr %67, align 8, !tbaa !15
  %69 = getelementptr inbounds %struct.__kstring_t, ptr %68, i32 0, i32 2
  %70 = load ptr, ptr %69, align 8, !tbaa !24
  %71 = load ptr, ptr %15, align 8, !tbaa !5
  %72 = call i32 @kputs(ptr noundef %70, ptr noundef %71)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #9
  store i32 4, ptr %18, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #9
  %73 = load i32, ptr %18, align 4, !tbaa !16
  %74 = sext i32 %73 to i64
  %75 = call noalias ptr @calloc(i64 noundef 1, i64 noundef %74) #10
  store ptr %75, ptr %19, align 8, !tbaa !5
  %76 = load ptr, ptr %19, align 8, !tbaa !5
  %77 = icmp eq ptr %76, null
  br i1 %77, label %78, label %79

78:                                               ; preds = %53
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.16) #11
  unreachable

79:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #9
  store i32 4, ptr %20, align 4, !tbaa !16
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.input_file, ptr %80, i32 0, i32 4
  %82 = load ptr, ptr %81, align 8, !tbaa !20
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.input_file, ptr %83, i32 0, i32 1
  %85 = load ptr, ptr %84, align 8, !tbaa !21
  %86 = call i32 @bcf_get_info_values(ptr noundef %82, ptr noundef %85, ptr noundef @.str.17, ptr noundef %13, ptr noundef %20, i32 noundef 1)
  %87 = icmp slt i32 %86, 0
  br i1 %87, label %88, label %121

88:                                               ; preds = %79
  store i32 4, ptr %20, align 4, !tbaa !16
  %89 = load ptr, ptr %9, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.input_file, ptr %89, i32 0, i32 4
  %91 = load ptr, ptr %90, align 8, !tbaa !20
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.input_file, ptr %92, i32 0, i32 1
  %94 = load ptr, ptr %93, align 8, !tbaa !21
  %95 = call i32 @bcf_get_info_values(ptr noundef %91, ptr noundef %94, ptr noundef @.str.18, ptr noundef %19, ptr noundef %18, i32 noundef 1)
  %96 = icmp sge i32 %95, 0
  br i1 %96, label %97, label %107

97:                                               ; preds = %88
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.input_file, ptr %98, i32 0, i32 1
  %100 = load ptr, ptr %99, align 8, !tbaa !21
  %101 = getelementptr inbounds %struct.bcf1_t, ptr %100, i32 0, i32 1
  %102 = load i32, ptr %101, align 4, !tbaa !25
  %103 = load ptr, ptr %19, align 8, !tbaa !5
  %104 = load i32, ptr %103, align 4, !tbaa !16
  %105 = add i32 %102, %104
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  store i32 %105, ptr %106, align 4, !tbaa !16
  br label %120

107:                                              ; preds = %88
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.input_file, ptr %108, i32 0, i32 1
  %110 = load ptr, ptr %109, align 8, !tbaa !21
  %111 = getelementptr inbounds %struct.bcf1_t, ptr %110, i32 0, i32 1
  %112 = load i32, ptr %111, align 4, !tbaa !25
  %113 = load ptr, ptr %9, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.input_file, ptr %113, i32 0, i32 1
  %115 = load ptr, ptr %114, align 8, !tbaa !21
  %116 = getelementptr inbounds %struct.bcf1_t, ptr %115, i32 0, i32 2
  %117 = load i32, ptr %116, align 8, !tbaa !29
  %118 = add nsw i32 %112, %117
  %119 = load ptr, ptr %13, align 8, !tbaa !5
  store i32 %118, ptr %119, align 4, !tbaa !16
  br label %120

120:                                              ; preds = %107, %97
  br label %121

121:                                              ; preds = %120, %79
  %122 = load ptr, ptr %13, align 8, !tbaa !5
  %123 = load i32, ptr %122, align 4, !tbaa !16
  %124 = add i32 %123, 1
  %125 = load ptr, ptr %13, align 8, !tbaa !5
  store i32 %124, ptr %125, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.input_file, ptr %126, i32 0, i32 4
  %128 = load ptr, ptr %127, align 8, !tbaa !20
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.input_file, ptr %129, i32 0, i32 1
  %131 = load ptr, ptr %130, align 8, !tbaa !21
  %132 = getelementptr inbounds %struct.bcf1_t, ptr %131, i32 0, i32 0
  %133 = load i32, ptr %132, align 8, !tbaa !30
  %134 = call ptr @bcf_hdr_id2name(ptr noundef %128, i32 noundef %133)
  store ptr %134, ptr %21, align 8, !tbaa !5
  br label %135

135:                                              ; preds = %160, %121
  %136 = load ptr, ptr %21, align 8, !tbaa !5
  %137 = call i64 @strlen(ptr noundef %136) #12
  %138 = add i64 %137, 1
  %139 = load ptr, ptr %11, align 8, !tbaa !5
  %140 = load i32, ptr %139, align 4, !tbaa !16
  %141 = sext i32 %140 to i64
  %142 = icmp ugt i64 %138, %141
  br i1 %142, label %143, label %161

143:                                              ; preds = %135
  %144 = load ptr, ptr %11, align 8, !tbaa !5
  %145 = load i32, ptr %144, align 4, !tbaa !16
  %146 = mul nsw i32 %145, 2
  %147 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 %146, ptr %147, align 4, !tbaa !16
  %148 = load ptr, ptr %10, align 8, !tbaa !5
  %149 = load ptr, ptr %148, align 8, !tbaa !5
  %150 = load ptr, ptr %11, align 8, !tbaa !5
  %151 = load i32, ptr %150, align 4, !tbaa !16
  %152 = sext i32 %151 to i64
  %153 = mul i64 %152, 1
  %154 = call ptr @realloc(ptr noundef %149, i64 noundef %153) #13
  %155 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %154, ptr %155, align 8, !tbaa !5
  %156 = load ptr, ptr %10, align 8, !tbaa !5
  %157 = load ptr, ptr %156, align 8, !tbaa !5
  %158 = icmp eq ptr %157, null
  br i1 %158, label %159, label %160

159:                                              ; preds = %143
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.19) #11
  unreachable

160:                                              ; preds = %143
  br label %135, !llvm.loop !31

161:                                              ; preds = %135
  %162 = load ptr, ptr %21, align 8, !tbaa !5
  %163 = call i32 @strncmp(ptr noundef @.str.15, ptr noundef %162, i64 noundef 3) #12
  %164 = icmp eq i32 %163, 0
  br i1 %164, label %165, label %174

165:                                              ; preds = %161
  %166 = load ptr, ptr %10, align 8, !tbaa !5
  %167 = load ptr, ptr %166, align 8, !tbaa !5
  %168 = load ptr, ptr %21, align 8, !tbaa !5
  %169 = getelementptr inbounds i8, ptr %168, i64 3
  %170 = load ptr, ptr %21, align 8, !tbaa !5
  %171 = call i64 @strlen(ptr noundef %170) #12
  %172 = add i64 %171, 1
  %173 = sub i64 %172, 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %167, ptr align 1 %169, i64 %173, i1 false)
  br label %181

174:                                              ; preds = %161
  %175 = load ptr, ptr %10, align 8, !tbaa !5
  %176 = load ptr, ptr %175, align 8, !tbaa !5
  %177 = load ptr, ptr %21, align 8, !tbaa !5
  %178 = load ptr, ptr %21, align 8, !tbaa !5
  %179 = call i64 @strlen(ptr noundef %178) #12
  %180 = add i64 %179, 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %176, ptr align 1 %177, i64 %180, i1 false)
  br label %181

181:                                              ; preds = %174, %165
  %182 = load ptr, ptr %9, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.input_file, ptr %182, i32 0, i32 1
  %184 = load ptr, ptr %183, align 8, !tbaa !21
  %185 = getelementptr inbounds %struct.bcf1_t, ptr %184, i32 0, i32 1
  %186 = load i32, ptr %185, align 4, !tbaa !25
  %187 = add nsw i32 %186, 1
  %188 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 %187, ptr %188, align 4, !tbaa !16
  %189 = load i32, ptr %16, align 4, !tbaa !16
  store i32 %189, ptr %8, align 4
  store i32 1, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  br label %190

190:                                              ; preds = %181, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  %191 = load i32, ptr %8, align 4
  ret i32 %191
}

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

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strncmp(ptr noundef, ptr noundef, i64 noundef) #2

declare i32 @vcf_parse(ptr noundef, ptr noundef, ptr noundef) #5

declare i32 @bcf_get_info_values(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #5

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

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

!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, !11, i64 48}
!10 = !{!"input_file", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !11, i64 48, !12, i64 56, !6, i64 64, !6, i64 72, !6, i64 80}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !6, i64 16}
!15 = !{!10, !6, i64 40}
!16 = !{!12, !12, i64 0}
!17 = !{!18, !11, i64 24}
!18 = !{!"BGZF", !12, i64 0, !12, i64 2, !12, i64 2, !12, i64 2, !12, i64 2, !12, i64 2, !12, i64 3, !12, i64 3, !12, i64 3, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !11, i64 24, !11, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !12, i64 88, !6, i64 96}
!19 = !{!18, !12, i64 16}
!20 = !{!10, !6, i64 32}
!21 = !{!10, !6, i64 8}
!22 = !{!23, !11, i64 0}
!23 = !{!"__kstring_t", !11, i64 0, !11, i64 8, !6, i64 16}
!24 = !{!23, !6, i64 16}
!25 = !{!26, !12, i64 4}
!26 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !27, i64 12, !12, i64 16, !12, i64 18, !12, i64 20, !12, i64 21, !23, i64 24, !23, i64 48, !28, i64 72, !12, i64 176, !12, i64 180, !7, i64 184, !12, i64 196}
!27 = !{!"float", !7, i64 0}
!28 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !12, i64 88, !12, i64 92, !12, i64 96, !12, i64 100}
!29 = !{!26, !12, i64 8}
!30 = !{!26, !12, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}


; 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.15 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [52 x i8], align 1

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

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

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

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

; 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) #4

declare i32 @bgzf_getline(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
define dso_local i32 @input_file_get_next_interval_vcf(ptr nocapture noundef %0, ptr nocapture noundef %1, ptr nocapture noundef %2, ptr nocapture noundef writeonly %3, ptr noundef %4, ptr nocapture noundef writeonly %5, ptr noundef %6) local_unnamed_addr #6 {
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store ptr %4, ptr %8, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 48
  %13 = load i64, ptr %12, align 8, !tbaa !9
  store i64 %13, ptr %5, align 8, !tbaa !13
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  %15 = load ptr, ptr %14, align 8, !tbaa !14
  %16 = getelementptr inbounds i8, ptr %0, i64 40
  %17 = load ptr, ptr %16, align 8, !tbaa !15
  %18 = tail call i32 @bgzf_getline(ptr noundef %15, i32 noundef 10, ptr noundef %17) #9
  %19 = load ptr, ptr %14, align 8, !tbaa !14
  %20 = getelementptr inbounds i8, ptr %19, i64 24
  %21 = load i64, ptr %20, align 8, !tbaa !16
  %22 = shl i64 %21, 16
  %23 = getelementptr inbounds i8, ptr %19, i64 16
  %24 = load i32, ptr %23, align 8, !tbaa !18
  %25 = and i32 %24, 65535
  %26 = zext nneg i32 %25 to i64
  %27 = or disjoint i64 %22, %26
  store i64 %27, ptr %12, align 8, !tbaa !9
  %28 = icmp slt i32 %18, 0
  br i1 %28, label %99, label %29

29:                                               ; preds = %7
  %30 = load ptr, ptr %16, align 8, !tbaa !15
  %31 = getelementptr inbounds i8, ptr %0, i64 32
  %32 = load ptr, ptr %31, align 8, !tbaa !19
  %33 = getelementptr inbounds i8, ptr %0, i64 8
  %34 = load ptr, ptr %33, align 8, !tbaa !20
  %35 = tail call i32 @vcf_parse(ptr noundef %30, ptr noundef %32, ptr noundef %34) #9
  store i64 0, ptr %6, align 8, !tbaa !21
  %36 = load ptr, ptr %16, align 8, !tbaa !15
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  %38 = load ptr, ptr %37, align 8, !tbaa !23
  %39 = tail call i32 @kputs(ptr noundef %38, ptr noundef nonnull %6)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #9
  store i32 4, ptr %9, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #9
  %40 = tail call noalias dereferenceable_or_null(4) ptr @calloc(i64 noundef 1, i64 noundef 4) #10
  store ptr %40, ptr %10, align 8, !tbaa !5
  %41 = icmp eq ptr %40, null
  br i1 %41, label %42, label %43

42:                                               ; preds = %29
  tail call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.16) #11
  unreachable

43:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #9
  store i32 4, ptr %11, align 4, !tbaa !24
  %44 = load ptr, ptr %31, align 8, !tbaa !19
  %45 = load ptr, ptr %33, align 8, !tbaa !20
  %46 = call i32 @bcf_get_info_values(ptr noundef %44, ptr noundef %45, ptr noundef nonnull @.str.17, ptr noundef nonnull %8, ptr noundef nonnull %11, i32 noundef 1) #9
  %47 = icmp slt i32 %46, 0
  br i1 %47, label %48, label %._crit_edge

._crit_edge:                                      ; preds = %43
  %.pre = load ptr, ptr %8, align 8, !tbaa !5
  %.pre48 = load i32, ptr %.pre, align 4, !tbaa !24
  %.pre49 = load ptr, ptr %33, align 8, !tbaa !20
  br label %65

48:                                               ; preds = %43
  store i32 4, ptr %11, align 4, !tbaa !24
  %49 = load ptr, ptr %31, align 8, !tbaa !19
  %50 = load ptr, ptr %33, align 8, !tbaa !20
  %51 = call i32 @bcf_get_info_values(ptr noundef %49, ptr noundef %50, ptr noundef nonnull @.str.18, ptr noundef nonnull %10, ptr noundef nonnull %9, i32 noundef 1) #9
  %52 = icmp sgt i32 %51, -1
  %53 = load ptr, ptr %33, align 8, !tbaa !20
  %54 = getelementptr inbounds i8, ptr %53, i64 4
  %55 = load i32, ptr %54, align 4, !tbaa !25
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  br i1 %52, label %57, label %61

57:                                               ; preds = %48
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = load i32, ptr %58, align 4, !tbaa !24
  %60 = add i32 %59, %55
  store i32 %60, ptr %56, align 4, !tbaa !24
  br label %65

61:                                               ; preds = %48
  %62 = getelementptr inbounds i8, ptr %53, i64 8
  %63 = load i32, ptr %62, align 8, !tbaa !29
  %64 = add nsw i32 %63, %55
  store i32 %64, ptr %56, align 4, !tbaa !24
  br label %65

65:                                               ; preds = %._crit_edge, %57, %61
  %66 = phi ptr [ %.pre49, %._crit_edge ], [ %53, %57 ], [ %53, %61 ]
  %67 = phi i32 [ %.pre48, %._crit_edge ], [ %60, %57 ], [ %64, %61 ]
  %68 = phi ptr [ %.pre, %._crit_edge ], [ %56, %57 ], [ %56, %61 ]
  %69 = add i32 %67, 1
  store i32 %69, ptr %68, align 4, !tbaa !24
  %70 = load ptr, ptr %31, align 8, !tbaa !19
  %71 = load i32, ptr %66, align 8, !tbaa !30
  %72 = call ptr @bcf_hdr_id2name(ptr noundef %70, i32 noundef %71)
  br label %73

73:                                               ; preds = %79, %65
  %74 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %72) #12
  %75 = add i64 %74, 1
  %76 = load i32, ptr %2, align 4, !tbaa !24
  %77 = sext i32 %76 to i64
  %78 = icmp ugt i64 %75, %77
  br i1 %78, label %79, label %86

79:                                               ; preds = %73
  %80 = shl nsw i32 %76, 1
  store i32 %80, ptr %2, align 4, !tbaa !24
  %81 = load ptr, ptr %1, align 8, !tbaa !5
  %82 = sext i32 %80 to i64
  %83 = call ptr @realloc(ptr noundef %81, i64 noundef %82) #13
  store ptr %83, ptr %1, align 8, !tbaa !5
  %84 = icmp eq ptr %83, null
  br i1 %84, label %85, label %73, !llvm.loop !31

85:                                               ; preds = %79
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.19) #11
  unreachable

86:                                               ; preds = %73
  %87 = call i32 @strncmp(ptr noundef nonnull dereferenceable(1) @.str.15, ptr noundef nonnull dereferenceable(1) %72, i64 noundef 3) #12
  %88 = icmp eq i32 %87, 0
  %89 = load ptr, ptr %1, align 8, !tbaa !5
  br i1 %88, label %90, label %93

90:                                               ; preds = %86
  %91 = getelementptr inbounds i8, ptr %72, i64 3
  %92 = add i64 %74, -2
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %89, ptr nonnull align 1 %91, i64 %92, i1 false)
  br label %94

93:                                               ; preds = %86
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %89, ptr align 1 %72, i64 %75, i1 false)
  br label %94

94:                                               ; preds = %93, %90
  %95 = load ptr, ptr %33, align 8, !tbaa !20
  %96 = getelementptr inbounds i8, ptr %95, i64 4
  %97 = load i32, ptr %96, align 4, !tbaa !25
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %3, align 4, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  br label %99

99:                                               ; preds = %7, %94
  ret i32 %18
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @kputs(ptr noundef, ptr noundef) local_unnamed_addr #7

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

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

declare i32 @vcf_parse(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

declare i32 @bcf_get_info_values(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @bcf_hdr_id2name(ptr noundef, i32 noundef) local_unnamed_addr #7

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

!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, !11, i64 48}
!10 = !{!"input_file", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !11, i64 48, !12, i64 56, !6, i64 64, !6, i64 72, !6, i64 80}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !6, i64 16}
!15 = !{!10, !6, i64 40}
!16 = !{!17, !11, i64 24}
!17 = !{!"BGZF", !12, i64 0, !12, i64 2, !12, i64 2, !12, i64 2, !12, i64 2, !12, i64 2, !12, i64 3, !12, i64 3, !12, i64 3, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !11, i64 24, !11, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !12, i64 88, !6, i64 96}
!18 = !{!17, !12, i64 16}
!19 = !{!10, !6, i64 32}
!20 = !{!10, !6, i64 8}
!21 = !{!22, !11, i64 0}
!22 = !{!"__kstring_t", !11, i64 0, !11, i64 8, !6, i64 16}
!23 = !{!22, !6, i64 16}
!24 = !{!12, !12, i64 0}
!25 = !{!26, !12, i64 4}
!26 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !27, i64 12, !12, i64 16, !12, i64 18, !12, i64 20, !12, i64 21, !22, i64 24, !22, i64 48, !28, i64 72, !12, i64 176, !12, i64 180, !7, i64 184, !12, i64 196}
!27 = !{!"float", !7, i64 0}
!28 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !12, i64 88, !12, i64 92, !12, i64 96, !12, i64 100}
!29 = !{!26, !12, i64 8}
!30 = !{!26, !12, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass