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

; 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.giggle_query_result = type { ptr, i32, ptr, i32 }
%struct.giggle_index = type { ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.file_data = type { ptr, i32, double }

@.str.3 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [45 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @print_giggle_query_result(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5, double noundef %6, i64 noundef %7, i32 noundef %8, i32 noundef %9, i32 noundef %10, i32 noundef %11, i32 noundef %12) #0 {
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca double, align 8
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca ptr, align 8
  %31 = alloca ptr, align 8
  %32 = alloca ptr, align 8
  %33 = alloca i32, align 4
  %34 = alloca i64, align 8
  %35 = alloca i64, align 8
  %36 = alloca i64, align 8
  %37 = alloca double, align 8
  %38 = alloca i64, align 8
  %39 = alloca i64, align 8
  %40 = alloca x86_fp80, align 16
  %41 = alloca x86_fp80, align 16
  %42 = alloca x86_fp80, align 16
  %43 = alloca x86_fp80, align 16
  %44 = alloca double, align 8
  store ptr %0, ptr %15, align 8, !tbaa !5
  store ptr %1, ptr %16, align 8, !tbaa !5
  store ptr %2, ptr %17, align 8, !tbaa !5
  store ptr %3, ptr %18, align 8, !tbaa !5
  store i32 %4, ptr %19, align 4, !tbaa !9
  store i32 %5, ptr %20, align 4, !tbaa !9
  store double %6, ptr %21, align 8, !tbaa !11
  store i64 %7, ptr %22, align 8, !tbaa !13
  store i32 %8, ptr %23, align 4, !tbaa !9
  store i32 %9, ptr %24, align 4, !tbaa !9
  store i32 %10, ptr %25, align 4, !tbaa !9
  store i32 %11, ptr %26, align 4, !tbaa !9
  store i32 %12, ptr %27, align 4, !tbaa !9
  %45 = load ptr, ptr %15, align 8, !tbaa !5
  %46 = icmp eq ptr %45, null
  br i1 %46, label %47, label %48

47:                                               ; preds = %13
  store i32 0, ptr %14, align 4
  br label %222

48:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #3
  %49 = load i32, ptr %26, align 4, !tbaa !9
  %50 = icmp eq i32 %49, 1
  br i1 %50, label %51, label %53

51:                                               ; preds = %48
  %52 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %53

53:                                               ; preds = %51, %48
  store i32 0, ptr %28, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %218, %53
  %55 = load i32, ptr %28, align 4, !tbaa !9
  %56 = load ptr, ptr %15, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.giggle_query_result, ptr %56, i32 0, i32 1
  %58 = load i32, ptr %57, align 8, !tbaa !15
  %59 = icmp ult i32 %55, %58
  br i1 %59, label %60, label %221

60:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #3
  %61 = load ptr, ptr %16, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.giggle_index, ptr %61, i32 0, i32 4
  %63 = load ptr, ptr %62, align 8, !tbaa !17
  %64 = load i32, ptr %28, align 4, !tbaa !9
  %65 = call ptr @file_index_get(ptr noundef %63, i32 noundef %64)
  store ptr %65, ptr %30, align 8, !tbaa !5
  %66 = load ptr, ptr %16, align 8, !tbaa !5
  %67 = load ptr, ptr %17, align 8, !tbaa !5
  %68 = load ptr, ptr %18, align 8, !tbaa !5
  %69 = load i32, ptr %19, align 4, !tbaa !9
  %70 = load i32, ptr %28, align 4, !tbaa !9
  %71 = load i32, ptr %23, align 4, !tbaa !9
  %72 = call i32 @test_pattern_match(ptr noundef %66, ptr noundef %67, ptr noundef %68, i32 noundef %69, i32 noundef %70, i32 noundef %71)
  %73 = icmp ne i32 %72, 0
  br i1 %73, label %74, label %217

74:                                               ; preds = %60
  %75 = load i32, ptr %24, align 4, !tbaa !9
  %76 = icmp eq i32 %75, 1
  br i1 %76, label %77, label %97

77:                                               ; preds = %74
  %78 = load ptr, ptr %15, align 8, !tbaa !5
  %79 = load i32, ptr %28, align 4, !tbaa !9
  %80 = call i32 @giggle_get_query_len(ptr noundef %78, i32 noundef %79)
  %81 = icmp ugt i32 %80, 0
  br i1 %81, label %82, label %97

82:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #3
  %83 = load ptr, ptr %15, align 8, !tbaa !5
  %84 = load i32, ptr %28, align 4, !tbaa !9
  %85 = call ptr @giggle_get_query_itr(ptr noundef %83, i32 noundef %84)
  store ptr %85, ptr %32, align 8, !tbaa !5
  br label %86

86:                                               ; preds = %90, %82
  %87 = load ptr, ptr %32, align 8, !tbaa !5
  %88 = call i32 @giggle_query_next(ptr noundef %87, ptr noundef %31)
  %89 = icmp eq i32 %88, 0
  br i1 %89, label %90, label %96

90:                                               ; preds = %86
  %91 = load ptr, ptr %31, align 8, !tbaa !5
  %92 = load ptr, ptr %30, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.file_data, ptr %92, i32 0, i32 0
  %94 = load ptr, ptr %93, align 8, !tbaa !19
  %95 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef %91, ptr noundef %94)
  br label %86, !llvm.loop !21

96:                                               ; preds = %86
  call void @giggle_iter_destroy(ptr noundef %32)
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #3
  br label %216

97:                                               ; preds = %77, %74
  %98 = load i32, ptr %25, align 4, !tbaa !9
  %99 = icmp eq i32 %98, 1
  br i1 %99, label %100, label %111

100:                                              ; preds = %97
  %101 = load ptr, ptr %30, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.file_data, ptr %101, i32 0, i32 0
  %103 = load ptr, ptr %102, align 8, !tbaa !19
  %104 = load ptr, ptr %30, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.file_data, ptr %104, i32 0, i32 1
  %106 = load i32, ptr %105, align 8, !tbaa !23
  %107 = load ptr, ptr %15, align 8, !tbaa !5
  %108 = load i32, ptr %28, align 4, !tbaa !9
  %109 = call i32 @giggle_get_query_len(ptr noundef %107, i32 noundef %108)
  %110 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, ptr noundef %103, i32 noundef %106, i32 noundef %109)
  br label %215

111:                                              ; preds = %97
  %112 = load i32, ptr %26, align 4, !tbaa !9
  %113 = icmp eq i32 %112, 1
  br i1 %113, label %114, label %214

114:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #3
  %115 = load ptr, ptr %15, align 8, !tbaa !5
  %116 = load i32, ptr %28, align 4, !tbaa !9
  %117 = call i32 @giggle_get_query_len(ptr noundef %115, i32 noundef %116)
  store i32 %117, ptr %33, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #3
  %118 = load i32, ptr %33, align 4, !tbaa !9
  %119 = zext i32 %118 to i64
  store i64 %119, ptr %34, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #3
  %120 = load i32, ptr %20, align 4, !tbaa !9
  %121 = load i32, ptr %33, align 4, !tbaa !9
  %122 = call i32 @safe_subtract(i32 noundef %120, i32 noundef %121)
  %123 = sext i32 %122 to i64
  store i64 %123, ptr %35, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #3
  %124 = load ptr, ptr %30, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.file_data, ptr %124, i32 0, i32 1
  %126 = load i32, ptr %125, align 8, !tbaa !23
  %127 = load i32, ptr %33, align 4, !tbaa !9
  %128 = call i32 @safe_subtract(i32 noundef %126, i32 noundef %127)
  %129 = sext i32 %128 to i64
  store i64 %129, ptr %36, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #3
  %130 = load ptr, ptr %30, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.file_data, ptr %130, i32 0, i32 2
  %132 = load double, ptr %131, align 8, !tbaa !24
  %133 = load double, ptr %21, align 8, !tbaa !11
  %134 = fadd double %132, %133
  store double %134, ptr %37, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #3
  %135 = load i64, ptr %34, align 8, !tbaa !13
  %136 = load i64, ptr %35, align 8, !tbaa !13
  %137 = add nsw i64 %135, %136
  %138 = load i64, ptr %36, align 8, !tbaa !13
  %139 = add nsw i64 %137, %138
  %140 = sitofp i64 %139 to double
  %141 = load i64, ptr %22, align 8, !tbaa !13
  %142 = sitofp i64 %141 to double
  %143 = load double, ptr %37, align 8, !tbaa !11
  %144 = fdiv double %142, %143
  %145 = fcmp ogt double %140, %144
  br i1 %145, label %146, label %153

146:                                              ; preds = %114
  %147 = load i64, ptr %34, align 8, !tbaa !13
  %148 = load i64, ptr %35, align 8, !tbaa !13
  %149 = add nsw i64 %147, %148
  %150 = load i64, ptr %36, align 8, !tbaa !13
  %151 = add nsw i64 %149, %150
  %152 = sitofp i64 %151 to double
  br label %158

153:                                              ; preds = %114
  %154 = load i64, ptr %22, align 8, !tbaa !13
  %155 = sitofp i64 %154 to double
  %156 = load double, ptr %37, align 8, !tbaa !11
  %157 = fdiv double %155, %156
  br label %158

158:                                              ; preds = %153, %146
  %159 = phi double [ %152, %146 ], [ %157, %153 ]
  %160 = fptosi double %159 to i64
  store i64 %160, ptr %38, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #3
  %161 = load i64, ptr %38, align 8, !tbaa !13
  %162 = trunc i64 %161 to i32
  %163 = load i64, ptr %34, align 8, !tbaa !13
  %164 = load i64, ptr %35, align 8, !tbaa !13
  %165 = add nsw i64 %163, %164
  %166 = load i64, ptr %36, align 8, !tbaa !13
  %167 = add nsw i64 %165, %166
  %168 = trunc i64 %167 to i32
  %169 = call i32 @safe_subtract(i32 noundef %162, i32 noundef %168)
  %170 = sext i32 %169 to i64
  store i64 %170, ptr %39, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 16, ptr %40) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %41) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %42) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %43) #3
  %171 = load i64, ptr %34, align 8, !tbaa !13
  %172 = load i64, ptr %35, align 8, !tbaa !13
  %173 = load i64, ptr %36, align 8, !tbaa !13
  %174 = load i64, ptr %39, align 8, !tbaa !13
  %175 = call x86_fp80 @_kt_fisher_exact(i64 noundef %171, i64 noundef %172, i64 noundef %173, i64 noundef %174, ptr noundef %40, ptr noundef %41, ptr noundef %42)
  store x86_fp80 %175, ptr %43, align 16, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #3
  %176 = load i64, ptr %34, align 8, !tbaa !13
  %177 = add nsw i64 %176, 1
  %178 = sitofp i64 %177 to double
  %179 = load i64, ptr %35, align 8, !tbaa !13
  %180 = icmp sgt i64 1, %179
  br i1 %180, label %181, label %182

181:                                              ; preds = %158
  br label %184

182:                                              ; preds = %158
  %183 = load i64, ptr %35, align 8, !tbaa !13
  br label %184

184:                                              ; preds = %182, %181
  %185 = phi i64 [ 1, %181 ], [ %183, %182 ]
  %186 = sitofp i64 %185 to double
  %187 = fdiv double %178, %186
  %188 = load i64, ptr %36, align 8, !tbaa !13
  %189 = add nsw i64 %188, 1
  %190 = sitofp i64 %189 to double
  %191 = load i64, ptr %39, align 8, !tbaa !13
  %192 = add nsw i64 %191, 1
  %193 = sitofp i64 %192 to double
  %194 = fdiv double %190, %193
  %195 = fdiv double %187, %194
  store double %195, ptr %44, align 8, !tbaa !11
  %196 = load ptr, ptr %30, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.file_data, ptr %196, i32 0, i32 0
  %198 = load ptr, ptr %197, align 8, !tbaa !19
  %199 = load ptr, ptr %30, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.file_data, ptr %199, i32 0, i32 1
  %201 = load i32, ptr %200, align 8, !tbaa !23
  %202 = load i32, ptr %33, align 4, !tbaa !9
  %203 = load double, ptr %44, align 8, !tbaa !11
  %204 = load x86_fp80, ptr %42, align 16, !tbaa !25
  %205 = load x86_fp80, ptr %40, align 16, !tbaa !25
  %206 = load x86_fp80, ptr %41, align 16, !tbaa !25
  %207 = load double, ptr %44, align 8, !tbaa !11
  %208 = call double @log2fc(double noundef %207)
  %209 = fpext double %208 to x86_fp80
  %210 = load x86_fp80, ptr %42, align 16, !tbaa !25
  %211 = call x86_fp80 @neglog10p(x86_fp80 noundef %210)
  %212 = fmul x86_fp80 %209, %211
  %213 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef %198, i32 noundef %201, i32 noundef %202, double noundef %203, x86_fp80 noundef %204, x86_fp80 noundef %205, x86_fp80 noundef %206, x86_fp80 noundef %212)
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %43) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %42) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %41) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %40) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #3
  br label %214

214:                                              ; preds = %184, %111
  br label %215

215:                                              ; preds = %214, %100
  br label %216

216:                                              ; preds = %215, %96
  br label %217

217:                                              ; preds = %216, %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #3
  br label %218

218:                                              ; preds = %217
  %219 = load i32, ptr %28, align 4, !tbaa !9
  %220 = add i32 %219, 1
  store i32 %220, ptr %28, align 4, !tbaa !9
  br label %54, !llvm.loop !27

221:                                              ; preds = %54
  store i32 0, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #3
  br label %222

222:                                              ; preds = %221, %47
  %223 = load i32, ptr %14, align 4
  ret i32 %223
}

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

declare i32 @printf(ptr noundef, ...) #2

declare ptr @file_index_get(ptr noundef, i32 noundef) #2

declare i32 @test_pattern_match(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) #2

declare i32 @giggle_get_query_len(ptr noundef, i32 noundef) #2

declare ptr @giggle_get_query_itr(ptr noundef, i32 noundef) #2

declare i32 @giggle_query_next(ptr noundef, ptr noundef) #2

declare void @giggle_iter_destroy(ptr noundef) #2

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

declare i32 @safe_subtract(i32 noundef, i32 noundef) #2

declare x86_fp80 @_kt_fisher_exact(i64 noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare double @log2fc(double noundef) #2

declare x86_fp80 @neglog10p(x86_fp80 noundef) #2

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 = { "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 }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = !{!16, !10, i64 8}
!16 = !{!"giggle_query_result", !6, i64 0, !10, i64 8, !6, i64 16, !10, i64 24}
!17 = !{!18, !6, i64 24}
!18 = !{!"giggle_index", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!19 = !{!20, !6, i64 0}
!20 = !{!"file_data", !6, i64 0, !10, i64 8, !12, i64 16}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!20, !10, i64 8}
!24 = !{!20, !12, i64 16}
!25 = !{!26, !26, i64 0}
!26 = !{!"long double", !7, i64 0}
!27 = distinct !{!27, !22}


; 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.3 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [45 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @print_giggle_query_result(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5, double noundef %6, i64 noundef %7, i32 noundef %8, i32 noundef %9, i32 noundef %10, i32 noundef %11, i32 noundef %12) local_unnamed_addr #0 {
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca x86_fp80, align 16
  %17 = alloca x86_fp80, align 16
  %18 = alloca x86_fp80, align 16
  %19 = icmp eq ptr %0, null
  br i1 %19, label %.loopexit, label %20

20:                                               ; preds = %13
  %21 = icmp eq i32 %11, 1
  br i1 %21, label %22, label %24

22:                                               ; preds = %20
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %24

24:                                               ; preds = %22, %20
  %25 = getelementptr inbounds i8, ptr %0, i64 8
  %26 = load i32, ptr %25, align 8, !tbaa !5
  %.not = icmp eq i32 %26, 0
  br i1 %.not, label %.loopexit, label %.lr.ph68

.lr.ph68:                                         ; preds = %24
  %27 = getelementptr inbounds i8, ptr %1, i64 24
  %28 = icmp eq i32 %9, 1
  %29 = icmp eq i32 %10, 1
  %30 = sitofp i64 %7 to double
  br i1 %29, label %.lr.ph68.split.us, label %.lr.ph68.split

.lr.ph68.split.us:                                ; preds = %.lr.ph68, %53
  %.06266.us = phi i32 [ %54, %53 ], [ 0, %.lr.ph68 ]
  %31 = load ptr, ptr %27, align 8, !tbaa !11
  %32 = call ptr @file_index_get(ptr noundef %31, i32 noundef %.06266.us) #5
  %33 = call i32 @test_pattern_match(ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %.06266.us, i32 noundef %8) #5
  %.not.us = icmp eq i32 %33, 0
  br i1 %.not.us, label %53, label %34

34:                                               ; preds = %.lr.ph68.split.us
  br i1 %28, label %35, label %47

35:                                               ; preds = %34
  %36 = call i32 @giggle_get_query_len(ptr noundef nonnull %0, i32 noundef %.06266.us) #5
  %.not65.us = icmp eq i32 %36, 0
  br i1 %.not65.us, label %47, label %37

37:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %38 = call ptr @giggle_get_query_itr(ptr noundef nonnull %0, i32 noundef %.06266.us) #5
  store ptr %38, ptr %15, align 8, !tbaa !13
  %39 = call i32 @giggle_query_next(ptr noundef %38, ptr noundef nonnull %14) #5
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %.lr.ph.us, label %._crit_edge.us

._crit_edge.us:                                   ; preds = %.lr.ph.us, %37
  call void @giggle_iter_destroy(ptr noundef nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  br label %53

.lr.ph.us:                                        ; preds = %37, %.lr.ph.us
  %41 = load ptr, ptr %14, align 8, !tbaa !13
  %42 = load ptr, ptr %32, align 8, !tbaa !14
  %43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef %41, ptr noundef %42)
  %44 = load ptr, ptr %15, align 8, !tbaa !13
  %45 = call i32 @giggle_query_next(ptr noundef %44, ptr noundef nonnull %14) #5
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %.lr.ph.us, label %._crit_edge.us, !llvm.loop !17

47:                                               ; preds = %35, %34
  %48 = load ptr, ptr %32, align 8, !tbaa !14
  %49 = getelementptr inbounds i8, ptr %32, i64 8
  %50 = load i32, ptr %49, align 8, !tbaa !19
  %51 = call i32 @giggle_get_query_len(ptr noundef nonnull %0, i32 noundef %.06266.us) #5
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, ptr noundef %48, i32 noundef %50, i32 noundef %51)
  br label %53

53:                                               ; preds = %47, %._crit_edge.us, %.lr.ph68.split.us
  %54 = add nuw i32 %.06266.us, 1
  %55 = load i32, ptr %25, align 8, !tbaa !5
  %56 = icmp ult i32 %54, %55
  br i1 %56, label %.lr.ph68.split.us, label %.loopexit, !llvm.loop !20

.lr.ph68.split:                                   ; preds = %.lr.ph68
  br i1 %21, label %.lr.ph68.split.split.us, label %.lr.ph68.split.split

.lr.ph68.split.split.us:                          ; preds = %.lr.ph68.split, %118
  %.06266.us69 = phi i32 [ %119, %118 ], [ 0, %.lr.ph68.split ]
  %57 = load ptr, ptr %27, align 8, !tbaa !11
  %58 = call ptr @file_index_get(ptr noundef %57, i32 noundef %.06266.us69) #5
  %59 = call i32 @test_pattern_match(ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %.06266.us69, i32 noundef %8) #5
  %.not.us70 = icmp eq i32 %59, 0
  br i1 %.not.us70, label %118, label %60

60:                                               ; preds = %.lr.ph68.split.split.us
  br i1 %28, label %61, label %73

61:                                               ; preds = %60
  %62 = call i32 @giggle_get_query_len(ptr noundef nonnull %0, i32 noundef %.06266.us69) #5
  %.not65.us71 = icmp eq i32 %62, 0
  br i1 %.not65.us71, label %73, label %63

63:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %64 = call ptr @giggle_get_query_itr(ptr noundef nonnull %0, i32 noundef %.06266.us69) #5
  store ptr %64, ptr %15, align 8, !tbaa !13
  %65 = call i32 @giggle_query_next(ptr noundef %64, ptr noundef nonnull %14) #5
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %.lr.ph.us72, label %._crit_edge.us73

._crit_edge.us73:                                 ; preds = %.lr.ph.us72, %63
  call void @giggle_iter_destroy(ptr noundef nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  br label %118

.lr.ph.us72:                                      ; preds = %63, %.lr.ph.us72
  %67 = load ptr, ptr %14, align 8, !tbaa !13
  %68 = load ptr, ptr %58, align 8, !tbaa !14
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef %67, ptr noundef %68)
  %70 = load ptr, ptr %15, align 8, !tbaa !13
  %71 = call i32 @giggle_query_next(ptr noundef %70, ptr noundef nonnull %14) #5
  %72 = icmp eq i32 %71, 0
  br i1 %72, label %.lr.ph.us72, label %._crit_edge.us73, !llvm.loop !17

73:                                               ; preds = %61, %60
  %74 = call i32 @giggle_get_query_len(ptr noundef nonnull %0, i32 noundef %.06266.us69) #5
  %75 = zext i32 %74 to i64
  %76 = call i32 @safe_subtract(i32 noundef %5, i32 noundef %74) #5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds i8, ptr %58, i64 8
  %79 = load i32, ptr %78, align 8, !tbaa !19
  %80 = call i32 @safe_subtract(i32 noundef %79, i32 noundef %74) #5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds i8, ptr %58, i64 16
  %83 = load double, ptr %82, align 8, !tbaa !21
  %84 = fadd double %83, %6
  %85 = add nsw i64 %77, %75
  %86 = add nsw i64 %85, %81
  %87 = sitofp i64 %86 to double
  %88 = fdiv double %30, %84
  %89 = fcmp olt double %88, %87
  %..us = select i1 %89, double %87, double %88
  %90 = fptosi double %..us to i64
  %91 = trunc i64 %90 to i32
  %92 = trunc i64 %86 to i32
  %93 = call i32 @safe_subtract(i32 noundef %91, i32 noundef %92) #5
  %94 = sext i32 %93 to i64
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %17) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %18) #5
  %95 = call x86_fp80 @_kt_fisher_exact(i64 noundef %75, i64 noundef %77, i64 noundef %81, i64 noundef %94, ptr noundef nonnull %16, ptr noundef nonnull %17, ptr noundef nonnull %18) #5
  %96 = add nuw nsw i64 %75, 1
  %97 = uitofp nneg i64 %96 to double
  %98 = call i64 @llvm.smax.i64(i64 %77, i64 1)
  %99 = uitofp nneg i64 %98 to double
  %100 = fdiv double %97, %99
  %101 = add nsw i64 %81, 1
  %102 = sitofp i64 %101 to double
  %103 = add nsw i64 %94, 1
  %104 = sitofp i64 %103 to double
  %105 = fdiv double %102, %104
  %106 = fdiv double %100, %105
  %107 = load ptr, ptr %58, align 8, !tbaa !14
  %108 = load i32, ptr %78, align 8, !tbaa !19
  %109 = load x86_fp80, ptr %18, align 16, !tbaa !22
  %110 = load x86_fp80, ptr %16, align 16, !tbaa !22
  %111 = load x86_fp80, ptr %17, align 16, !tbaa !22
  %112 = call double @log2fc(double noundef %106) #5
  %113 = fpext double %112 to x86_fp80
  %114 = load x86_fp80, ptr %18, align 16, !tbaa !22
  %115 = call x86_fp80 @neglog10p(x86_fp80 noundef %114) #5
  %116 = fmul x86_fp80 %115, %113
  %117 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef %107, i32 noundef %108, i32 noundef %74, double noundef %106, x86_fp80 noundef %109, x86_fp80 noundef %110, x86_fp80 noundef %111, x86_fp80 noundef %116)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #5
  br label %118

118:                                              ; preds = %73, %._crit_edge.us73, %.lr.ph68.split.split.us
  %119 = add nuw i32 %.06266.us69, 1
  %120 = load i32, ptr %25, align 8, !tbaa !5
  %121 = icmp ult i32 %119, %120
  br i1 %121, label %.lr.ph68.split.split.us, label %.loopexit, !llvm.loop !20

.lr.ph68.split.split:                             ; preds = %.lr.ph68.split
  br i1 %28, label %.lr.ph68.split.split.split.us, label %.lr.ph68.split.split.split

.lr.ph68.split.split.split.us:                    ; preds = %.lr.ph68.split.split, %137
  %.06266.us74 = phi i32 [ %138, %137 ], [ 0, %.lr.ph68.split.split ]
  %122 = load ptr, ptr %27, align 8, !tbaa !11
  %123 = call ptr @file_index_get(ptr noundef %122, i32 noundef %.06266.us74) #5
  %124 = call i32 @test_pattern_match(ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %.06266.us74, i32 noundef %8) #5
  %.not.us75 = icmp eq i32 %124, 0
  br i1 %.not.us75, label %137, label %125

125:                                              ; preds = %.lr.ph68.split.split.split.us
  %126 = call i32 @giggle_get_query_len(ptr noundef nonnull %0, i32 noundef %.06266.us74) #5
  %.not65.us76 = icmp eq i32 %126, 0
  br i1 %.not65.us76, label %137, label %127

127:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %128 = call ptr @giggle_get_query_itr(ptr noundef nonnull %0, i32 noundef %.06266.us74) #5
  store ptr %128, ptr %15, align 8, !tbaa !13
  %129 = call i32 @giggle_query_next(ptr noundef %128, ptr noundef nonnull %14) #5
  %130 = icmp eq i32 %129, 0
  br i1 %130, label %.lr.ph.us77, label %._crit_edge.us78

._crit_edge.us78:                                 ; preds = %.lr.ph.us77, %127
  call void @giggle_iter_destroy(ptr noundef nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  br label %137

.lr.ph.us77:                                      ; preds = %127, %.lr.ph.us77
  %131 = load ptr, ptr %14, align 8, !tbaa !13
  %132 = load ptr, ptr %123, align 8, !tbaa !14
  %133 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef %131, ptr noundef %132)
  %134 = load ptr, ptr %15, align 8, !tbaa !13
  %135 = call i32 @giggle_query_next(ptr noundef %134, ptr noundef nonnull %14) #5
  %136 = icmp eq i32 %135, 0
  br i1 %136, label %.lr.ph.us77, label %._crit_edge.us78, !llvm.loop !17

137:                                              ; preds = %125, %._crit_edge.us78, %.lr.ph68.split.split.split.us
  %138 = add nuw i32 %.06266.us74, 1
  %139 = load i32, ptr %25, align 8, !tbaa !5
  %140 = icmp ult i32 %138, %139
  br i1 %140, label %.lr.ph68.split.split.split.us, label %.loopexit, !llvm.loop !20

.lr.ph68.split.split.split:                       ; preds = %.lr.ph68.split.split, %.lr.ph68.split.split.split
  %.06266 = phi i32 [ %144, %.lr.ph68.split.split.split ], [ 0, %.lr.ph68.split.split ]
  %141 = load ptr, ptr %27, align 8, !tbaa !11
  %142 = tail call ptr @file_index_get(ptr noundef %141, i32 noundef %.06266) #5
  %143 = tail call i32 @test_pattern_match(ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %.06266, i32 noundef %8) #5
  %144 = add nuw i32 %.06266, 1
  %145 = load i32, ptr %25, align 8, !tbaa !5
  %146 = icmp ult i32 %144, %145
  br i1 %146, label %.lr.ph68.split.split.split, label %.loopexit, !llvm.loop !20

.loopexit:                                        ; preds = %.lr.ph68.split.split.split, %137, %118, %53, %24, %13
  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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

declare ptr @file_index_get(ptr noundef, i32 noundef) local_unnamed_addr #3

declare i32 @test_pattern_match(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare i32 @giggle_get_query_len(ptr noundef, i32 noundef) local_unnamed_addr #3

declare ptr @giggle_get_query_itr(ptr noundef, i32 noundef) local_unnamed_addr #3

declare i32 @giggle_query_next(ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @giggle_iter_destroy(ptr noundef) local_unnamed_addr #3

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

declare i32 @safe_subtract(i32 noundef, i32 noundef) local_unnamed_addr #3

declare x86_fp80 @_kt_fisher_exact(i64 noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare double @log2fc(double noundef) local_unnamed_addr #3

declare x86_fp80 @neglog10p(x86_fp80 noundef) local_unnamed_addr #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #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 = { "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 nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 8}
!6 = !{!"giggle_query_result", !7, i64 0, !10, i64 8, !7, i64 16, !10, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !7, i64 24}
!12 = !{!"giggle_index", !7, i64 0, !10, i64 8, !10, i64 12, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !7, i64 0}
!15 = !{!"file_data", !7, i64 0, !10, i64 8, !16, i64 16}
!16 = !{!"double", !8, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!15, !10, i64 8}
!20 = distinct !{!20, !18}
!21 = !{!15, !16, i64 16}
!22 = !{!23, !23, i64 0}
!23 = !{!"long double", !8, i64 0}


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