; LLVM IR from KamilSJaron/smudgeplot :: src_ploidyplot (libfastk)

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

@.str.28 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @Malloc(i64 noundef, ptr noundef) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @Realloc(ptr noundef, i64 noundef, ptr noundef) #0

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

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

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

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #3

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #4

declare i32 @open(ptr noundef, i32 noundef, ...) #5

declare i64 @read(i32 noundef, ptr noundef, i64 noundef) #5

declare i32 @close(i32 noundef) #5

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

declare i64 @write(i32 noundef, ptr noundef, i64 noundef) #5

; Function Attrs: nounwind
declare i64 @lseek(i32 noundef, i64 noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @More_Kmer_Stream(ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @Open_Kmer_Cache(ptr noundef %0, i64 noundef %1, i64 noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef %5, ptr noundef %6, i32 noundef %7) #0 {
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca i32, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store i64 %1, ptr %11, align 8, !tbaa !9
  store i64 %2, ptr %12, align 8, !tbaa !9
  store i32 %3, ptr %13, align 4, !tbaa !11
  store i32 %4, ptr %14, align 4, !tbaa !11
  store ptr %5, ptr %15, align 8, !tbaa !5
  store ptr %6, ptr %16, align 8, !tbaa !5
  store i32 %7, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %30, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %31 = load ptr, ptr %18, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct._Kmer_Stream, ptr %31, i32 0, i32 14
  %33 = load ptr, ptr %32, align 8, !tbaa !13
  %34 = load ptr, ptr %18, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._Kmer_Stream, ptr %34, i32 0, i32 14
  %36 = load ptr, ptr %35, align 8, !tbaa !13
  %37 = load i32, ptr %13, align 4, !tbaa !11
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds i64, ptr %36, i64 %38
  %40 = load i32, ptr %14, align 4, !tbaa !11
  %41 = load i32, ptr %13, align 4, !tbaa !11
  %42 = sub nsw i32 %40, %41
  %43 = add nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  %45 = mul i64 %44, 8
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %33, ptr align 8 %39, i64 %45, i1 false)
  %46 = load ptr, ptr %18, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct._Kmer_Stream, ptr %46, i32 0, i32 14
  %48 = load ptr, ptr %47, align 8, !tbaa !13
  %49 = load i32, ptr %14, align 4, !tbaa !11
  %50 = load i32, ptr %13, align 4, !tbaa !11
  %51 = sub nsw i32 %49, %50
  %52 = add nsw i32 %51, 1
  %53 = sext i32 %52 to i64
  %54 = mul i64 %53, 8
  %55 = call ptr @Realloc(ptr noundef %48, i64 noundef %54, ptr noundef @.str.38)
  %56 = load ptr, ptr %18, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct._Kmer_Stream, ptr %56, i32 0, i32 14
  store ptr %55, ptr %57, align 8, !tbaa !13
  %58 = load i32, ptr %13, align 4, !tbaa !11
  %59 = load ptr, ptr %18, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._Kmer_Stream, ptr %59, i32 0, i32 14
  %61 = load ptr, ptr %60, align 8, !tbaa !13
  %62 = sext i32 %58 to i64
  %63 = sub i64 0, %62
  %64 = getelementptr inbounds i64, ptr %61, i64 %63
  store ptr %64, ptr %60, align 8, !tbaa !13
  %65 = load ptr, ptr %18, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._Kmer_Stream, ptr %65, i32 0, i32 17
  %67 = load i32, ptr %66, align 4, !tbaa !15
  %68 = load ptr, ptr %18, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._Kmer_Stream, ptr %68, i32 0, i32 18
  %70 = load i32, ptr %69, align 8, !tbaa !16
  %71 = icmp sle i32 %67, %70
  br i1 %71, label %72, label %77

72:                                               ; preds = %8
  %73 = load ptr, ptr %18, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._Kmer_Stream, ptr %73, i32 0, i32 16
  %75 = load i32, ptr %74, align 8, !tbaa !17
  %76 = call i32 @close(i32 noundef %75)
  br label %77

77:                                               ; preds = %72, %8
  %78 = load ptr, ptr %18, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct._Kmer_Stream, ptr %78, i32 0, i32 19
  %80 = load i32, ptr %79, align 4, !tbaa !18
  %81 = sext i32 %80 to i64
  %82 = load ptr, ptr %15, align 8, !tbaa !5
  %83 = call i64 @strlen(ptr noundef %82) #8
  %84 = add i64 %81, %83
  %85 = add i64 %84, 10
  %86 = call ptr @Malloc(i64 noundef %85, ptr noundef @.str.39)
  store ptr %86, ptr %27, align 8, !tbaa !5
  %87 = load ptr, ptr %27, align 8, !tbaa !5
  %88 = icmp eq ptr %87, null
  br i1 %88, label %89, label %90

89:                                               ; preds = %77
  call void @exit(i32 noundef 1) #9
  unreachable

90:                                               ; preds = %77
  %91 = load ptr, ptr %18, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct._Kmer_Stream, ptr %91, i32 0, i32 20
  %93 = load ptr, ptr %92, align 8, !tbaa !19
  %94 = call ptr @rindex(ptr noundef %93, i32 noundef 47) #8
  store ptr %94, ptr %28, align 8, !tbaa !5
  %95 = load ptr, ptr %18, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._Kmer_Stream, ptr %95, i32 0, i32 20
  %97 = load ptr, ptr %96, align 8, !tbaa !19
  %98 = load ptr, ptr %18, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct._Kmer_Stream, ptr %98, i32 0, i32 19
  %100 = load i32, ptr %99, align 4, !tbaa !18
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds i8, ptr %97, i64 %101
  store i8 0, ptr %102, align 1, !tbaa !20
  %103 = load ptr, ptr %27, align 8, !tbaa !5
  %104 = load ptr, ptr %15, align 8, !tbaa !5
  %105 = load ptr, ptr %28, align 8, !tbaa !5
  %106 = getelementptr inbounds i8, ptr %105, i64 2
  %107 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %103, ptr noundef @.str.40, ptr noundef %104, ptr noundef %106) #7
  %108 = load ptr, ptr %18, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._Kmer_Stream, ptr %108, i32 0, i32 20
  %110 = load ptr, ptr %109, align 8, !tbaa !19
  %111 = load ptr, ptr %18, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct._Kmer_Stream, ptr %111, i32 0, i32 19
  %113 = load i32, ptr %112, align 4, !tbaa !18
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds i8, ptr %110, i64 %114
  store i8 46, ptr %115, align 1, !tbaa !20
  %116 = load ptr, ptr %27, align 8, !tbaa !5
  %117 = call i32 (ptr, i32, ...) @open(ptr noundef %116, i32 noundef 578, i32 noundef 448)
  store i32 %117, ptr %20, align 4, !tbaa !11
  %118 = load i32, ptr %20, align 4, !tbaa !11
  %119 = icmp slt i32 %118, 0
  br i1 %119, label %120, label %121

120:                                              ; preds = %90
  store i32 1, ptr %9, align 4
  store i32 1, ptr %29, align 4
  br label %289

121:                                              ; preds = %90
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %122

122:                                              ; preds = %132, %121
  %123 = load i64, ptr %11, align 8, !tbaa !9
  %124 = load ptr, ptr %18, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct._Kmer_Stream, ptr %124, i32 0, i32 22
  %126 = load ptr, ptr %125, align 8, !tbaa !21
  %127 = load i32, ptr %21, align 4, !tbaa !11
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds i64, ptr %126, i64 %128
  %130 = load i64, ptr %129, align 8, !tbaa !9
  %131 = icmp sge i64 %123, %130
  br i1 %131, label %132, label %135

132:                                              ; preds = %122
  %133 = load i32, ptr %21, align 4, !tbaa !11
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %21, align 4, !tbaa !11
  br label %122, !llvm.loop !22

135:                                              ; preds = %122
  %136 = load i64, ptr %11, align 8, !tbaa !9
  store i64 %136, ptr %23, align 8, !tbaa !9
  %137 = load i32, ptr %21, align 4, !tbaa !11
  %138 = icmp eq i32 %137, 0
  br i1 %138, label %139, label %140

139:                                              ; preds = %135
  store i64 0, ptr %24, align 8, !tbaa !9
  br label %149

140:                                              ; preds = %135
  %141 = load ptr, ptr %18, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct._Kmer_Stream, ptr %141, i32 0, i32 22
  %143 = load ptr, ptr %142, align 8, !tbaa !21
  %144 = load i32, ptr %21, align 4, !tbaa !11
  %145 = sub nsw i32 %144, 1
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds i64, ptr %143, i64 %146
  %148 = load i64, ptr %147, align 8, !tbaa !9
  store i64 %148, ptr %24, align 8, !tbaa !9
  br label %149

149:                                              ; preds = %140, %139
  br label %150

150:                                              ; preds = %254, %149
  %151 = load i64, ptr %12, align 8, !tbaa !9
  %152 = load i64, ptr %24, align 8, !tbaa !9
  %153 = icmp sgt i64 %151, %152
  br i1 %153, label %154, label %265

154:                                              ; preds = %150
  %155 = load ptr, ptr %18, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct._Kmer_Stream, ptr %155, i32 0, i32 20
  %157 = load ptr, ptr %156, align 8, !tbaa !19
  %158 = load ptr, ptr %18, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct._Kmer_Stream, ptr %158, i32 0, i32 19
  %160 = load i32, ptr %159, align 4, !tbaa !18
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds i8, ptr %157, i64 %161
  %163 = load i32, ptr %21, align 4, !tbaa !11
  %164 = add nsw i32 %163, 1
  %165 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %162, ptr noundef @.str.28, i32 noundef %164) #7
  %166 = load ptr, ptr %18, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct._Kmer_Stream, ptr %166, i32 0, i32 20
  %168 = load ptr, ptr %167, align 8, !tbaa !19
  %169 = call i32 (ptr, i32, ...) @open(ptr noundef %168, i32 noundef 0)
  store i32 %169, ptr %19, align 4, !tbaa !11
  %170 = load i32, ptr %19, align 4, !tbaa !11
  %171 = call i64 @lseek(i32 noundef %170, i64 noundef 12, i32 noundef 0) #7
  %172 = load i64, ptr %12, align 8, !tbaa !9
  %173 = load ptr, ptr %18, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct._Kmer_Stream, ptr %173, i32 0, i32 22
  %175 = load ptr, ptr %174, align 8, !tbaa !21
  %176 = load i32, ptr %21, align 4, !tbaa !11
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds i64, ptr %175, i64 %177
  %179 = load i64, ptr %178, align 8, !tbaa !9
  %180 = icmp sgt i64 %172, %179
  br i1 %180, label %181, label %191

181:                                              ; preds = %154
  %182 = load ptr, ptr %18, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct._Kmer_Stream, ptr %182, i32 0, i32 22
  %184 = load ptr, ptr %183, align 8, !tbaa !21
  %185 = load i32, ptr %21, align 4, !tbaa !11
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds i64, ptr %184, i64 %186
  %188 = load i64, ptr %187, align 8, !tbaa !9
  %189 = load i64, ptr %24, align 8, !tbaa !9
  %190 = sub nsw i64 %188, %189
  store i64 %190, ptr %26, align 8, !tbaa !9
  br label %195

191:                                              ; preds = %154
  %192 = load i64, ptr %12, align 8, !tbaa !9
  %193 = load i64, ptr %24, align 8, !tbaa !9
  %194 = sub nsw i64 %192, %193
  store i64 %194, ptr %26, align 8, !tbaa !9
  br label %195

195:                                              ; preds = %191, %181
  %196 = load i64, ptr %23, align 8, !tbaa !9
  %197 = load i64, ptr %24, align 8, !tbaa !9
  %198 = sub nsw i64 %196, %197
  store i64 %198, ptr %25, align 8, !tbaa !9
  %199 = load ptr, ptr %18, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct._Kmer_Stream, ptr %199, i32 0, i32 10
  %201 = load i32, ptr %200, align 4, !tbaa !24
  %202 = sext i32 %201 to i64
  %203 = load i64, ptr %26, align 8, !tbaa !9
  %204 = mul nsw i64 %203, %202
  store i64 %204, ptr %26, align 8, !tbaa !9
  %205 = load ptr, ptr %18, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct._Kmer_Stream, ptr %205, i32 0, i32 10
  %207 = load i32, ptr %206, align 4, !tbaa !24
  %208 = sext i32 %207 to i64
  %209 = load i64, ptr %25, align 8, !tbaa !9
  %210 = mul nsw i64 %209, %208
  store i64 %210, ptr %25, align 8, !tbaa !9
  %211 = load i64, ptr %25, align 8, !tbaa !9
  %212 = icmp sgt i64 %211, 0
  br i1 %212, label %213, label %217

213:                                              ; preds = %195
  %214 = load i32, ptr %19, align 4, !tbaa !11
  %215 = load i64, ptr %25, align 8, !tbaa !9
  %216 = call i64 @lseek(i32 noundef %214, i64 noundef %215, i32 noundef 1) #7
  br label %217

217:                                              ; preds = %213, %195
  br label %218

218:                                              ; preds = %249, %217
  %219 = load i64, ptr %25, align 8, !tbaa !9
  %220 = load i64, ptr %26, align 8, !tbaa !9
  %221 = icmp slt i64 %219, %220
  br i1 %221, label %222, label %254

222:                                              ; preds = %218
  %223 = load i64, ptr %25, align 8, !tbaa !9
  %224 = load i32, ptr %17, align 4, !tbaa !11
  %225 = sext i32 %224 to i64
  %226 = add nsw i64 %223, %225
  %227 = load i64, ptr %26, align 8, !tbaa !9
  %228 = icmp sgt i64 %226, %227
  br i1 %228, label %229, label %234

229:                                              ; preds = %222
  %230 = load i64, ptr %26, align 8, !tbaa !9
  %231 = load i64, ptr %25, align 8, !tbaa !9
  %232 = sub nsw i64 %230, %231
  %233 = trunc i64 %232 to i32
  store i32 %233, ptr %22, align 4, !tbaa !11
  br label %236

234:                                              ; preds = %222
  %235 = load i32, ptr %17, align 4, !tbaa !11
  store i32 %235, ptr %22, align 4, !tbaa !11
  br label %236

236:                                              ; preds = %234, %229
  %237 = load i32, ptr %19, align 4, !tbaa !11
  %238 = load ptr, ptr %16, align 8, !tbaa !5
  %239 = load i32, ptr %22, align 4, !tbaa !11
  %240 = sext i32 %239 to i64
  %241 = call i64 @read(i32 noundef %237, ptr noundef %238, i64 noundef %240)
  %242 = load i32, ptr %20, align 4, !tbaa !11
  %243 = load ptr, ptr %16, align 8, !tbaa !5
  %244 = load i32, ptr %22, align 4, !tbaa !11
  %245 = sext i32 %244 to i64
  %246 = call i64 @write(i32 noundef %242, ptr noundef %243, i64 noundef %245)
  %247 = icmp slt i64 %246, 0
  br i1 %247, label %248, label %249

248:                                              ; preds = %236
  store i32 1, ptr %9, align 4
  store i32 1, ptr %29, align 4
  br label %289

249:                                              ; preds = %236
  %250 = load i32, ptr %22, align 4, !tbaa !11
  %251 = sext i32 %250 to i64
  %252 = load i64, ptr %25, align 8, !tbaa !9
  %253 = add nsw i64 %252, %251
  store i64 %253, ptr %25, align 8, !tbaa !9
  br label %218, !llvm.loop !25

254:                                              ; preds = %218
  %255 = load i32, ptr %19, align 4, !tbaa !11
  %256 = call i32 @close(i32 noundef %255)
  %257 = load ptr, ptr %18, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct._Kmer_Stream, ptr %257, i32 0, i32 22
  %259 = load ptr, ptr %258, align 8, !tbaa !21
  %260 = load i32, ptr %21, align 4, !tbaa !11
  %261 = add nsw i32 %260, 1
  store i32 %261, ptr %21, align 4, !tbaa !11
  %262 = sext i32 %260 to i64
  %263 = getelementptr inbounds i64, ptr %259, i64 %262
  %264 = load i64, ptr %263, align 8, !tbaa !9
  store i64 %264, ptr %24, align 8, !tbaa !9
  store i64 %264, ptr %23, align 8, !tbaa !9
  br label %150, !llvm.loop !26

265:                                              ; preds = %150
  %266 = load ptr, ptr %18, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct._Kmer_Stream, ptr %266, i32 0, i32 20
  %268 = load ptr, ptr %267, align 8, !tbaa !19
  call void @free(ptr noundef %268) #7
  %269 = load ptr, ptr %27, align 8, !tbaa !5
  %270 = load ptr, ptr %18, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct._Kmer_Stream, ptr %270, i32 0, i32 20
  store ptr %269, ptr %271, align 8, !tbaa !19
  %272 = load i32, ptr %20, align 4, !tbaa !11
  %273 = call i64 @lseek(i32 noundef %272, i64 noundef 0, i32 noundef 0) #7
  %274 = load i32, ptr %20, align 4, !tbaa !11
  %275 = load ptr, ptr %18, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct._Kmer_Stream, ptr %275, i32 0, i32 16
  store i32 %274, ptr %276, align 8, !tbaa !17
  %277 = load ptr, ptr %18, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct._Kmer_Stream, ptr %277, i32 0, i32 17
  store i32 0, ptr %278, align 4, !tbaa !15
  %279 = load i64, ptr %11, align 8, !tbaa !9
  %280 = load ptr, ptr %18, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct._Kmer_Stream, ptr %280, i32 0, i32 3
  store i64 %279, ptr %281, align 8, !tbaa !27
  %282 = load i32, ptr %13, align 4, !tbaa !11
  %283 = load ptr, ptr %18, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct._Kmer_Stream, ptr %283, i32 0, i32 5
  store i32 %282, ptr %284, align 8, !tbaa !28
  %285 = load i64, ptr %12, align 8, !tbaa !9
  %286 = load ptr, ptr %18, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct._Kmer_Stream, ptr %286, i32 0, i32 2
  store i64 %285, ptr %287, align 8, !tbaa !29
  %288 = load ptr, ptr %18, align 8, !tbaa !5
  call void @More_Kmer_Stream(ptr noundef %288)
  store i32 0, ptr %9, align 4
  store i32 1, ptr %29, align 4
  br label %289

289:                                              ; preds = %265, %248, %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  %290 = load i32, ptr %9, align 4
  ret i32 %290
}

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 "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 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 72}
!14 = !{!"", !12, i64 0, !12, i64 4, !10, i64 8, !10, i64 16, !6, i64 24, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !6, i64 64, !6, i64 72, !6, i64 80, !12, i64 88, !12, i64 92, !12, i64 96, !12, i64 100, !6, i64 104, !6, i64 112, !6, i64 120, !12, i64 128}
!15 = !{!14, !12, i64 92}
!16 = !{!14, !12, i64 96}
!17 = !{!14, !12, i64 88}
!18 = !{!14, !12, i64 100}
!19 = !{!14, !6, i64 104}
!20 = !{!7, !7, i64 0}
!21 = !{!14, !6, i64 120}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!14, !12, i64 52}
!25 = distinct !{!25, !23}
!26 = distinct !{!26, !23}
!27 = !{!14, !10, i64 16}
!28 = !{!14, !12, i64 32}
!29 = !{!14, !10, i64 8}


; 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.28 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @Malloc(i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @Realloc(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare ptr @rindex(ptr noundef, i32 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 nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #5

; Function Attrs: nofree
declare noundef i32 @open(ptr nocapture noundef readonly, i32 noundef, ...) local_unnamed_addr #6

; Function Attrs: nofree
declare noundef i64 @read(i32 noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #6

declare i32 @close(i32 noundef) local_unnamed_addr #7

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

; Function Attrs: nofree
declare noundef i64 @write(i32 noundef, ptr nocapture noundef readonly, i64 noundef) local_unnamed_addr #6

; Function Attrs: nounwind
declare i64 @lseek(i32 noundef, i64 noundef, i32 noundef) local_unnamed_addr #9

; Function Attrs: nounwind uwtable
declare hidden void @More_Kmer_Stream(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @Open_Kmer_Cache(ptr noundef %0, i64 noundef %1, i64 noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef %5, ptr nocapture noundef %6, i32 noundef %7) local_unnamed_addr #0 {
  %9 = getelementptr inbounds i8, ptr %0, i64 72
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = sext i32 %3 to i64
  %12 = getelementptr inbounds i64, ptr %10, i64 %11
  %reass.sub = sub i32 %4, %3
  %13 = add i32 %reass.sub, 1
  %14 = sext i32 %13 to i64
  %15 = shl nsw i64 %14, 3
  tail call void @llvm.memmove.p0.p0.i64(ptr align 8 %10, ptr align 8 %12, i64 %15, i1 false)
  %16 = load ptr, ptr %9, align 8, !tbaa !5
  %17 = tail call ptr @Realloc(ptr noundef %16, i64 noundef %15, ptr noundef nonnull @.str.38)
  %18 = sub nsw i64 0, %11
  %19 = getelementptr inbounds i64, ptr %17, i64 %18
  store ptr %19, ptr %9, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %0, i64 92
  %21 = load i32, ptr %20, align 4, !tbaa !12
  %22 = getelementptr inbounds i8, ptr %0, i64 96
  %23 = load i32, ptr %22, align 8, !tbaa !13
  %.not = icmp sgt i32 %21, %23
  br i1 %.not, label %28, label %24

24:                                               ; preds = %8
  %25 = getelementptr inbounds i8, ptr %0, i64 88
  %26 = load i32, ptr %25, align 8, !tbaa !14
  %27 = tail call i32 @close(i32 noundef %26) #11
  br label %28

28:                                               ; preds = %24, %8
  %29 = getelementptr inbounds i8, ptr %0, i64 100
  %30 = load i32, ptr %29, align 4, !tbaa !15
  %31 = sext i32 %30 to i64
  %32 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %5) #12
  %33 = add nsw i64 %31, 10
  %34 = add i64 %33, %32
  %35 = tail call ptr @Malloc(i64 noundef %34, ptr noundef nonnull @.str.39)
  %36 = icmp eq ptr %35, null
  br i1 %36, label %37, label %38

37:                                               ; preds = %28
  tail call void @exit(i32 noundef 1) #13
  unreachable

38:                                               ; preds = %28
  %39 = getelementptr inbounds i8, ptr %0, i64 104
  %40 = load ptr, ptr %39, align 8, !tbaa !16
  %41 = tail call ptr @rindex(ptr noundef %40, i32 noundef 47) #12
  %42 = load i32, ptr %29, align 4, !tbaa !15
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds i8, ptr %40, i64 %43
  store i8 0, ptr %44, align 1, !tbaa !17
  %45 = getelementptr inbounds i8, ptr %41, i64 2
  %46 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %35, ptr noundef nonnull dereferenceable(1) @.str.40, ptr noundef %5, ptr noundef nonnull %45) #11
  %47 = load ptr, ptr %39, align 8, !tbaa !16
  %48 = load i32, ptr %29, align 4, !tbaa !15
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds i8, ptr %47, i64 %49
  store i8 46, ptr %50, align 1, !tbaa !17
  %51 = tail call i32 (ptr, i32, ...) @open(ptr noundef nonnull %35, i32 noundef 578, i32 noundef 448) #11
  %52 = icmp slt i32 %51, 0
  br i1 %52, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %38
  %53 = getelementptr inbounds i8, ptr %0, i64 120
  %54 = load ptr, ptr %53, align 8, !tbaa !18
  br label %55

55:                                               ; preds = %55, %.preheader
  %indvars.iv = phi i64 [ %indvars.iv.next, %55 ], [ 0, %.preheader ]
  %56 = getelementptr inbounds i64, ptr %54, i64 %indvars.iv
  %57 = load i64, ptr %56, align 8, !tbaa !19
  %.not107 = icmp sgt i64 %57, %1
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br i1 %.not107, label %58, label %55, !llvm.loop !20

58:                                               ; preds = %55
  %59 = icmp eq i64 %indvars.iv, 0
  br i1 %59, label %64, label %60

60:                                               ; preds = %58
  %61 = getelementptr inbounds i64, ptr %54, i64 %indvars.iv
  %62 = getelementptr i8, ptr %61, i64 -8
  %63 = load i64, ptr %62, align 8, !tbaa !19
  br label %64

64:                                               ; preds = %58, %60
  %.096 = phi i64 [ %63, %60 ], [ 0, %58 ]
  %65 = icmp slt i64 %.096, %2
  br i1 %65, label %.lr.ph116, label %._crit_edge117

.lr.ph116:                                        ; preds = %64
  %66 = getelementptr inbounds i8, ptr %0, i64 52
  %67 = sext i32 %7 to i64
  br label %68

68:                                               ; preds = %.lr.ph116, %._crit_edge
  %indvars.iv119 = phi i64 [ %indvars.iv, %.lr.ph116 ], [ %indvars.iv.next120, %._crit_edge ]
  %.197113 = phi i64 [ %.096, %.lr.ph116 ], [ %105, %._crit_edge ]
  %.098112 = phi i64 [ %1, %.lr.ph116 ], [ %105, %._crit_edge ]
  %69 = load ptr, ptr %39, align 8, !tbaa !16
  %70 = load i32, ptr %29, align 4, !tbaa !15
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds i8, ptr %69, i64 %71
  %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
  %73 = trunc nuw i64 %indvars.iv.next120 to i32
  %74 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %72, ptr noundef nonnull dereferenceable(1) @.str.28, i32 noundef %73) #11
  %75 = load ptr, ptr %39, align 8, !tbaa !16
  %76 = tail call i32 (ptr, i32, ...) @open(ptr noundef %75, i32 noundef 0) #11
  %77 = tail call i64 @lseek(i32 noundef %76, i64 noundef 12, i32 noundef 0) #11
  %78 = load ptr, ptr %53, align 8, !tbaa !18
  %79 = getelementptr inbounds i64, ptr %78, i64 %indvars.iv119
  %80 = load i64, ptr %79, align 8, !tbaa !19
  %. = tail call i64 @llvm.smin.i64(i64 %80, i64 %2)
  %.094 = sub nsw i64 %., %.197113
  %81 = sub nsw i64 %.098112, %.197113
  %82 = load i32, ptr %66, align 4, !tbaa !22
  %83 = sext i32 %82 to i64
  %84 = mul nsw i64 %.094, %83
  %85 = mul nsw i64 %81, %83
  %86 = icmp sgt i64 %85, 0
  br i1 %86, label %87, label %89

87:                                               ; preds = %68
  %88 = tail call i64 @lseek(i32 noundef %76, i64 noundef %85, i32 noundef 1) #11
  br label %89

89:                                               ; preds = %87, %68
  %90 = icmp slt i64 %85, %84
  br i1 %90, label %.lr.ph, label %._crit_edge

91:                                               ; preds = %.lr.ph
  %92 = add nsw i64 %.095111, %98
  %93 = icmp slt i64 %92, %84
  br i1 %93, label %.lr.ph, label %._crit_edge, !llvm.loop !23

.lr.ph:                                           ; preds = %89, %91
  %.095111 = phi i64 [ %92, %91 ], [ %85, %89 ]
  %94 = add nsw i64 %.095111, %67
  %95 = icmp sgt i64 %94, %84
  %96 = sub nsw i64 %84, %.095111
  %97 = trunc i64 %96 to i32
  %.099 = select i1 %95, i32 %97, i32 %7
  %98 = sext i32 %.099 to i64
  %99 = tail call i64 @read(i32 noundef %76, ptr noundef %6, i64 noundef %98) #11
  %100 = tail call i64 @write(i32 noundef %51, ptr noundef %6, i64 noundef %98) #11
  %101 = icmp slt i64 %100, 0
  br i1 %101, label %.loopexit, label %91

._crit_edge:                                      ; preds = %91, %89
  %102 = tail call i32 @close(i32 noundef %76) #11
  %103 = load ptr, ptr %53, align 8, !tbaa !18
  %104 = getelementptr inbounds i64, ptr %103, i64 %indvars.iv119
  %105 = load i64, ptr %104, align 8, !tbaa !19
  %106 = icmp slt i64 %105, %2
  br i1 %106, label %68, label %._crit_edge117, !llvm.loop !24

._crit_edge117:                                   ; preds = %._crit_edge, %64
  %107 = load ptr, ptr %39, align 8, !tbaa !16
  tail call void @free(ptr noundef %107) #11
  store ptr %35, ptr %39, align 8, !tbaa !16
  %108 = tail call i64 @lseek(i32 noundef %51, i64 noundef 0, i32 noundef 0) #11
  %109 = getelementptr inbounds i8, ptr %0, i64 88
  store i32 %51, ptr %109, align 8, !tbaa !14
  store i32 0, ptr %20, align 4, !tbaa !12
  %110 = getelementptr inbounds i8, ptr %0, i64 16
  store i64 %1, ptr %110, align 8, !tbaa !25
  %111 = getelementptr inbounds i8, ptr %0, i64 32
  store i32 %3, ptr %111, align 8, !tbaa !26
  %112 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 %2, ptr %112, align 8, !tbaa !27
  tail call void @More_Kmer_Stream(ptr noundef nonnull %0)
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph, %38, %._crit_edge117
  %.0 = phi i32 [ 0, %._crit_edge117 ], [ 1, %38 ], [ 1, %.lr.ph ]
  ret i32 %.0
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #10

attributes #0 = { 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 #1 = { mustprogress nofree 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 = { 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 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 #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { "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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { 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 #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #11 = { nounwind }
attributes #12 = { nounwind willreturn memory(read) }
attributes #13 = { noreturn 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, !11, i64 72}
!6 = !{!"", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !11, i64 24, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !11, i64 64, !11, i64 72, !11, i64 80, !7, i64 88, !7, i64 92, !7, i64 96, !7, i64 100, !11, i64 104, !11, i64 112, !11, i64 120, !7, i64 128}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long long", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!6, !7, i64 92}
!13 = !{!6, !7, i64 96}
!14 = !{!6, !7, i64 88}
!15 = !{!6, !7, i64 100}
!16 = !{!6, !11, i64 104}
!17 = !{!8, !8, i64 0}
!18 = !{!6, !11, i64 120}
!19 = !{!10, !10, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!6, !7, i64 52}
!23 = distinct !{!23, !21}
!24 = distinct !{!24, !21}
!25 = !{!6, !10, i64 16}
!26 = !{!6, !7, i64 32}
!27 = !{!6, !10, i64 8}


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