; LLVM IR from attractivechaos/klib :: test (kseq_bench)

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

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [27 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %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 i32, align 4
  %14 = alloca ptr, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %15 = load i32, ptr %4, align 4, !tbaa !5
  %16 = icmp eq i32 %15, 1
  br i1 %16, label %17, label %20

17:                                               ; preds = %2
  %18 = load ptr, ptr @stderr, align 8, !tbaa !9
  %19 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef @.str) #7
  store i32 1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %174

20:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %21 = call noalias ptr @malloc(i64 noundef 4096) #8
  store ptr %21, ptr %9, align 8, !tbaa !9
  %22 = load ptr, ptr %5, align 8, !tbaa !9
  %23 = getelementptr inbounds ptr, ptr %22, i64 1
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  %25 = call ptr @gzopen(ptr noundef %24, ptr noundef @.str.1)
  store ptr %25, ptr %6, align 8, !tbaa !9
  %26 = call i64 @clock() #7
  store i64 %26, ptr %7, align 8, !tbaa !11
  br label %27

27:                                               ; preds = %32, %20
  %28 = load ptr, ptr %6, align 8, !tbaa !9
  %29 = load ptr, ptr %9, align 8, !tbaa !9
  %30 = call i32 @gzread(ptr noundef %28, ptr noundef %29, i32 noundef 4096)
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %32, label %33

32:                                               ; preds = %27
  br label %27, !llvm.loop !13

33:                                               ; preds = %27
  %34 = load ptr, ptr @stderr, align 8, !tbaa !9
  %35 = call i64 @clock() #7
  %36 = load i64, ptr %7, align 8, !tbaa !11
  %37 = sub nsw i64 %35, %36
  %38 = sitofp i64 %37 to float
  %39 = fdiv float %38, 1.000000e+06
  %40 = fpext float %39 to double
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef @.str.2, double noundef %40) #7
  %42 = load ptr, ptr %6, align 8, !tbaa !9
  %43 = call i32 @gzclose(ptr noundef %42)
  %44 = load ptr, ptr %9, align 8, !tbaa !9
  call void @free(ptr noundef %44) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %45 = load ptr, ptr %5, align 8, !tbaa !9
  %46 = getelementptr inbounds ptr, ptr %45, i64 1
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  %48 = call ptr @gzopen(ptr noundef %47, ptr noundef @.str.1)
  store ptr %48, ptr %6, align 8, !tbaa !9
  %49 = load ptr, ptr %6, align 8, !tbaa !9
  %50 = call ptr @ks_init(ptr noundef %49)
  store ptr %50, ptr %10, align 8, !tbaa !9
  %51 = call i64 @clock() #7
  store i64 %51, ptr %7, align 8, !tbaa !11
  br label %52

52:                                               ; preds = %56, %33
  %53 = load ptr, ptr %10, align 8, !tbaa !9
  %54 = call i32 @ks_getc(ptr noundef %53)
  %55 = icmp sge i32 %54, 0
  br i1 %55, label %56, label %57

56:                                               ; preds = %52
  br label %52, !llvm.loop !15

57:                                               ; preds = %52
  %58 = load ptr, ptr @stderr, align 8, !tbaa !9
  %59 = call i64 @clock() #7
  %60 = load i64, ptr %7, align 8, !tbaa !11
  %61 = sub nsw i64 %59, %60
  %62 = sitofp i64 %61 to float
  %63 = fdiv float %62, 1.000000e+06
  %64 = fpext float %63 to double
  %65 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef @.str.3, double noundef %64) #7
  %66 = load ptr, ptr %10, align 8, !tbaa !9
  call void @ks_destroy(ptr noundef %66)
  %67 = load ptr, ptr %6, align 8, !tbaa !9
  %68 = call i32 @gzclose(ptr noundef %67)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %69 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 24) #9
  store ptr %69, ptr %12, align 8, !tbaa !9
  %70 = load ptr, ptr %5, align 8, !tbaa !9
  %71 = getelementptr inbounds ptr, ptr %70, i64 1
  %72 = load ptr, ptr %71, align 8, !tbaa !9
  %73 = call ptr @gzopen(ptr noundef %72, ptr noundef @.str.1)
  store ptr %73, ptr %6, align 8, !tbaa !9
  %74 = load ptr, ptr %6, align 8, !tbaa !9
  %75 = call ptr @ks_init(ptr noundef %74)
  store ptr %75, ptr %11, align 8, !tbaa !9
  %76 = call i64 @clock() #7
  store i64 %76, ptr %7, align 8, !tbaa !11
  br label %77

77:                                               ; preds = %82, %57
  %78 = load ptr, ptr %11, align 8, !tbaa !9
  %79 = load ptr, ptr %12, align 8, !tbaa !9
  %80 = call i32 @ks_getuntil(ptr noundef %78, i32 noundef 10, ptr noundef %79, ptr noundef %13)
  %81 = icmp sge i32 %80, 0
  br i1 %81, label %82, label %83

82:                                               ; preds = %77
  br label %77, !llvm.loop !16

83:                                               ; preds = %77
  %84 = load ptr, ptr @stderr, align 8, !tbaa !9
  %85 = call i64 @clock() #7
  %86 = load i64, ptr %7, align 8, !tbaa !11
  %87 = sub nsw i64 %85, %86
  %88 = sitofp i64 %87 to float
  %89 = fdiv float %88, 1.000000e+06
  %90 = fpext float %89 to double
  %91 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef @.str.4, double noundef %90) #7
  %92 = load ptr, ptr %11, align 8, !tbaa !9
  call void @ks_destroy(ptr noundef %92)
  %93 = load ptr, ptr %6, align 8, !tbaa !9
  %94 = call i32 @gzclose(ptr noundef %93)
  %95 = load ptr, ptr %12, align 8, !tbaa !9
  %96 = getelementptr inbounds %struct.__kstring_t, ptr %95, i32 0, i32 2
  %97 = load ptr, ptr %96, align 8, !tbaa !17
  call void @free(ptr noundef %97) #7
  %98 = load ptr, ptr %12, align 8, !tbaa !9
  call void @free(ptr noundef %98) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  %99 = load i32, ptr %4, align 4, !tbaa !5
  %100 = icmp eq i32 %99, 2
  br i1 %100, label %101, label %145

101:                                              ; preds = %83
  %102 = load ptr, ptr %5, align 8, !tbaa !9
  %103 = getelementptr inbounds ptr, ptr %102, i64 1
  %104 = load ptr, ptr %103, align 8, !tbaa !9
  %105 = call ptr @gzopen(ptr noundef %104, ptr noundef @.str.1)
  store ptr %105, ptr %6, align 8, !tbaa !9
  %106 = call i64 @clock() #7
  store i64 %106, ptr %7, align 8, !tbaa !11
  br label %107

107:                                              ; preds = %133, %101
  %108 = load ptr, ptr %6, align 8, !tbaa !9
  %109 = getelementptr inbounds %struct.gzFile_s, ptr %108, i32 0, i32 0
  %110 = load i32, ptr %109, align 8, !tbaa !19
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %127

112:                                              ; preds = %107
  %113 = load ptr, ptr %6, align 8, !tbaa !9
  %114 = getelementptr inbounds %struct.gzFile_s, ptr %113, i32 0, i32 0
  %115 = load i32, ptr %114, align 8, !tbaa !19
  %116 = add i32 %115, -1
  store i32 %116, ptr %114, align 8, !tbaa !19
  %117 = load ptr, ptr %6, align 8, !tbaa !9
  %118 = getelementptr inbounds %struct.gzFile_s, ptr %117, i32 0, i32 2
  %119 = load i64, ptr %118, align 8, !tbaa !21
  %120 = add nsw i64 %119, 1
  store i64 %120, ptr %118, align 8, !tbaa !21
  %121 = load ptr, ptr %6, align 8, !tbaa !9
  %122 = getelementptr inbounds %struct.gzFile_s, ptr %121, i32 0, i32 1
  %123 = load ptr, ptr %122, align 8, !tbaa !22
  %124 = getelementptr inbounds i8, ptr %123, i32 1
  store ptr %124, ptr %122, align 8, !tbaa !22
  %125 = load i8, ptr %123, align 1, !tbaa !23
  %126 = zext i8 %125 to i32
  br label %130

127:                                              ; preds = %107
  %128 = load ptr, ptr %6, align 8, !tbaa !9
  %129 = call i32 @gzgetc(ptr noundef %128)
  br label %130

130:                                              ; preds = %127, %112
  %131 = phi i32 [ %126, %112 ], [ %129, %127 ]
  %132 = icmp sge i32 %131, 0
  br i1 %132, label %133, label %134

133:                                              ; preds = %130
  br label %107, !llvm.loop !24

134:                                              ; preds = %130
  %135 = load ptr, ptr @stderr, align 8, !tbaa !9
  %136 = call i64 @clock() #7
  %137 = load i64, ptr %7, align 8, !tbaa !11
  %138 = sub nsw i64 %136, %137
  %139 = sitofp i64 %138 to float
  %140 = fdiv float %139, 1.000000e+06
  %141 = fpext float %140 to double
  %142 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %135, ptr noundef @.str.5, double noundef %141) #7
  %143 = load ptr, ptr %6, align 8, !tbaa !9
  %144 = call i32 @gzclose(ptr noundef %143)
  br label %145

145:                                              ; preds = %134, %83
  %146 = load i32, ptr %4, align 4, !tbaa !5
  %147 = icmp eq i32 %146, 2
  br i1 %147, label %148, label %173

148:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %149 = call noalias ptr @malloc(i64 noundef 4096) #8
  store ptr %149, ptr %14, align 8, !tbaa !9
  %150 = load ptr, ptr %5, align 8, !tbaa !9
  %151 = getelementptr inbounds ptr, ptr %150, i64 1
  %152 = load ptr, ptr %151, align 8, !tbaa !9
  %153 = call ptr @gzopen(ptr noundef %152, ptr noundef @.str.1)
  store ptr %153, ptr %6, align 8, !tbaa !9
  %154 = call i64 @clock() #7
  store i64 %154, ptr %7, align 8, !tbaa !11
  br label %155

155:                                              ; preds = %160, %148
  %156 = load ptr, ptr %6, align 8, !tbaa !9
  %157 = load ptr, ptr %14, align 8, !tbaa !9
  %158 = call ptr @gzgets(ptr noundef %156, ptr noundef %157, i32 noundef 4096)
  %159 = icmp ugt ptr %158, null
  br i1 %159, label %160, label %161

160:                                              ; preds = %155
  br label %155, !llvm.loop !25

161:                                              ; preds = %155
  %162 = load ptr, ptr @stderr, align 8, !tbaa !9
  %163 = call i64 @clock() #7
  %164 = load i64, ptr %7, align 8, !tbaa !11
  %165 = sub nsw i64 %163, %164
  %166 = sitofp i64 %165 to float
  %167 = fdiv float %166, 1.000000e+06
  %168 = fpext float %167 to double
  %169 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %162, ptr noundef @.str.6, double noundef %168) #7
  %170 = load ptr, ptr %6, align 8, !tbaa !9
  %171 = call i32 @gzclose(ptr noundef %170)
  %172 = load ptr, ptr %14, align 8, !tbaa !9
  call void @free(ptr noundef %172) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %173

173:                                              ; preds = %161, %145
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %174

174:                                              ; preds = %173, %17
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %175 = load i32, ptr %3, align 4
  ret i32 %175
}

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

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

declare ptr @gzopen(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind
declare i64 @clock() #2

declare i32 @gzread(ptr noundef, ptr noundef, i32 noundef) #4

declare i32 @gzclose(ptr noundef) #4

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ks_init(ptr noundef) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @ks_getc(ptr noundef) #5

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

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

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

declare i32 @gzgetc(ptr noundef) #4

declare ptr @gzgets(ptr noundef, ptr noundef, i32 noundef) #4

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 "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) "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 = { "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 = { 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind allocsize(0,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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = !{!18, !10, i64 16}
!18 = !{!"__kstring_t", !12, i64 0, !12, i64 8, !10, i64 16}
!19 = !{!20, !6, i64 0}
!20 = !{!"gzFile_s", !6, i64 0, !10, i64 8, !12, i64 16}
!21 = !{!20, !12, i64 16}
!22 = !{!20, !10, i64 8}
!23 = !{!7, !7, i64 0}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [27 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca i32, align 4
  %4 = icmp eq i32 %0, 1
  br i1 %4, label %5, label %8

5:                                                ; preds = %2
  %6 = load ptr, ptr @stderr, align 8, !tbaa !5
  %7 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %6, ptr noundef nonnull @.str) #9
  br label %.critedge

8:                                                ; preds = %2
  %9 = tail call noalias dereferenceable_or_null(4096) ptr @malloc(i64 noundef 4096) #10
  %10 = getelementptr inbounds i8, ptr %1, i64 8
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = tail call ptr @gzopen(ptr noundef %11, ptr noundef nonnull @.str.1) #11
  %13 = tail call i64 @clock() #11
  br label %14

14:                                               ; preds = %14, %8
  %15 = tail call i32 @gzread(ptr noundef %12, ptr noundef %9, i32 noundef 4096) #11
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %14, label %17, !llvm.loop !9

17:                                               ; preds = %14
  %18 = load ptr, ptr @stderr, align 8, !tbaa !5
  %19 = tail call i64 @clock() #11
  %20 = sub nsw i64 %19, %13
  %21 = sitofp i64 %20 to float
  %22 = fdiv float %21, 1.000000e+06
  %23 = fpext float %22 to double
  %24 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef nonnull @.str.2, double noundef %23) #9
  %25 = tail call i32 @gzclose(ptr noundef %12) #11
  tail call void @free(ptr noundef %9) #11
  %26 = load ptr, ptr %10, align 8, !tbaa !5
  %27 = tail call ptr @gzopen(ptr noundef %26, ptr noundef nonnull @.str.1) #11
  %28 = tail call ptr @ks_init(ptr noundef %27)
  %29 = tail call i64 @clock() #11
  br label %30

30:                                               ; preds = %30, %17
  %31 = tail call i32 @ks_getc(ptr noundef %28)
  %32 = icmp sgt i32 %31, -1
  br i1 %32, label %30, label %33, !llvm.loop !11

33:                                               ; preds = %30
  %34 = load ptr, ptr @stderr, align 8, !tbaa !5
  %35 = tail call i64 @clock() #11
  %36 = sub nsw i64 %35, %29
  %37 = sitofp i64 %36 to float
  %38 = fdiv float %37, 1.000000e+06
  %39 = fpext float %38 to double
  %40 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef nonnull @.str.3, double noundef %39) #9
  tail call void @ks_destroy(ptr noundef %28)
  %41 = tail call i32 @gzclose(ptr noundef %27) #11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #11
  %42 = tail call noalias dereferenceable_or_null(24) ptr @calloc(i64 noundef 1, i64 noundef 24) #12
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = tail call ptr @gzopen(ptr noundef %43, ptr noundef nonnull @.str.1) #11
  %45 = tail call ptr @ks_init(ptr noundef %44)
  %46 = tail call i64 @clock() #11
  br label %47

47:                                               ; preds = %47, %33
  %48 = call i32 @ks_getuntil(ptr noundef %45, i32 noundef 10, ptr noundef %42, ptr noundef nonnull %3)
  %49 = icmp sgt i32 %48, -1
  br i1 %49, label %47, label %50, !llvm.loop !12

50:                                               ; preds = %47
  %51 = load ptr, ptr @stderr, align 8, !tbaa !5
  %52 = call i64 @clock() #11
  %53 = sub nsw i64 %52, %46
  %54 = sitofp i64 %53 to float
  %55 = fdiv float %54, 1.000000e+06
  %56 = fpext float %55 to double
  %57 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef nonnull @.str.4, double noundef %56) #9
  call void @ks_destroy(ptr noundef %45)
  %58 = call i32 @gzclose(ptr noundef %44) #11
  %59 = getelementptr inbounds i8, ptr %42, i64 16
  %60 = load ptr, ptr %59, align 8, !tbaa !13
  call void @free(ptr noundef %60) #11
  call void @free(ptr noundef %42) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #11
  %61 = icmp eq i32 %0, 2
  br i1 %61, label %62, label %.critedge

62:                                               ; preds = %50
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = call ptr @gzopen(ptr noundef %63, ptr noundef nonnull @.str.1) #11
  %65 = call i64 @clock() #11
  %66 = getelementptr inbounds i8, ptr %64, i64 16
  %67 = getelementptr inbounds i8, ptr %64, i64 8
  br label %68

68:                                               ; preds = %80, %62
  %69 = load i32, ptr %64, align 8, !tbaa !16
  %.not = icmp eq i32 %69, 0
  br i1 %.not, label %78, label %70

70:                                               ; preds = %68
  %71 = add i32 %69, -1
  store i32 %71, ptr %64, align 8, !tbaa !16
  %72 = load i64, ptr %66, align 8, !tbaa !19
  %73 = add nsw i64 %72, 1
  store i64 %73, ptr %66, align 8, !tbaa !19
  %74 = load ptr, ptr %67, align 8, !tbaa !20
  %75 = getelementptr inbounds i8, ptr %74, i64 1
  store ptr %75, ptr %67, align 8, !tbaa !20
  %76 = load i8, ptr %74, align 1, !tbaa !21
  %77 = zext i8 %76 to i32
  br label %80

78:                                               ; preds = %68
  %79 = call i32 @gzgetc(ptr noundef nonnull %64) #11
  br label %80

80:                                               ; preds = %78, %70
  %81 = phi i32 [ %77, %70 ], [ %79, %78 ]
  %82 = icmp sgt i32 %81, -1
  br i1 %82, label %68, label %83, !llvm.loop !22

83:                                               ; preds = %80
  %84 = load ptr, ptr @stderr, align 8, !tbaa !5
  %85 = call i64 @clock() #11
  %86 = sub nsw i64 %85, %65
  %87 = sitofp i64 %86 to float
  %88 = fdiv float %87, 1.000000e+06
  %89 = fpext float %88 to double
  %90 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef nonnull @.str.5, double noundef %89) #9
  %91 = call i32 @gzclose(ptr noundef nonnull %64) #11
  %92 = call noalias dereferenceable_or_null(4096) ptr @malloc(i64 noundef 4096) #10
  %93 = load ptr, ptr %10, align 8, !tbaa !5
  %94 = call ptr @gzopen(ptr noundef %93, ptr noundef nonnull @.str.1) #11
  %95 = call i64 @clock() #11
  br label %96

96:                                               ; preds = %96, %83
  %97 = call ptr @gzgets(ptr noundef %94, ptr noundef %92, i32 noundef 4096) #11
  %.not40 = icmp eq ptr %97, null
  br i1 %.not40, label %98, label %96, !llvm.loop !23

98:                                               ; preds = %96
  %99 = load ptr, ptr @stderr, align 8, !tbaa !5
  %100 = call i64 @clock() #11
  %101 = sub nsw i64 %100, %95
  %102 = sitofp i64 %101 to float
  %103 = fdiv float %102, 1.000000e+06
  %104 = fpext float %103 to double
  %105 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %99, ptr noundef nonnull @.str.6, double noundef %104) #9
  %106 = call i32 @gzclose(ptr noundef %94) #11
  call void @free(ptr noundef %92) #11
  br label %.critedge

.critedge:                                        ; preds = %98, %50, %5
  %.0 = phi i32 [ 1, %5 ], [ 0, %50 ], [ 0, %98 ]
  ret i32 %.0
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

declare ptr @gzopen(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind
declare i64 @clock() local_unnamed_addr #5

declare i32 @gzread(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

declare i32 @gzclose(ptr noundef) local_unnamed_addr #4

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

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

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

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

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

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

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

declare i32 @gzgetc(ptr noundef) local_unnamed_addr #4

declare ptr @gzgets(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress 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 #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 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 #9 = { cold nounwind }
attributes #10 = { nounwind allocsize(0) }
attributes #11 = { nounwind }
attributes #12 = { nounwind allocsize(0,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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !6, i64 16}
!14 = !{!"__kstring_t", !15, i64 0, !15, i64 8, !6, i64 16}
!15 = !{!"long", !7, i64 0}
!16 = !{!17, !18, i64 0}
!17 = !{!"gzFile_s", !18, i64 0, !6, i64 8, !15, i64 16}
!18 = !{!"int", !7, i64 0}
!19 = !{!17, !15, i64 16}
!20 = !{!17, !6, i64 8}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass