; 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.cache_def = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.__kstring_t = type { i64, i64, ptr }
%struct.re_pattern_buffer = type { ptr, i64, i64, i64, ptr, ptr, i64, i8 }
%struct.giggle_index = type { ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.input_file = type { ptr, ptr, ptr, ptr, ptr, ptr, i64, i32, ptr, ptr, ptr }
%struct.giggle_query_result = type { ptr, i32, ptr, i32 }

@stderr = external global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [20 x i8], align 1
@optarg = external global ptr, align 8
@optopt = external global i32, align 4
@.str.9 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [2 x i8], align 1
@cache = external dso_local global %struct.cache_def, align 8

; Function Attrs: nounwind uwtable
declare dso_local i32 @search_help(i32 noundef) #0

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @search_main(i32 noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca double, align 8
  %28 = alloca i32, align 4
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = alloca ptr, align 8
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca ptr, align 8
  %36 = alloca ptr, align 8
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca i32, align 4
  %41 = alloca ptr, align 8
  %42 = alloca ptr, align 8
  %43 = alloca ptr, align 8
  %44 = alloca i32, align 4
  %45 = alloca double, align 8
  %46 = alloca i32, align 4
  %47 = alloca i32, align 4
  %48 = alloca i32, align 4
  %49 = alloca ptr, align 8
  %50 = alloca i32, align 4
  %51 = alloca i32, align 4
  %52 = alloca i32, align 4
  %53 = alloca ptr, align 8
  %54 = alloca i32, align 4
  %55 = alloca ptr, align 8
  %56 = alloca i32, align 4
  %57 = alloca i32, align 4
  %58 = alloca i64, align 8
  %59 = alloca %struct.__kstring_t, align 8
  %60 = alloca ptr, align 8
  %61 = alloca ptr, align 8
  %62 = alloca i32, align 4
  %63 = alloca i32, align 4
  store i32 %0, ptr %5, align 4, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !9
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = icmp slt i32 %64, 2
  br i1 %65, label %66, label %68

66:                                               ; preds = %3
  %67 = call i32 @search_help(i32 noundef 0)
  store i32 %67, ptr %4, align 4
  br label %516

68:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #10
  store i32 100, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #10
  store ptr null, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #10
  store ptr null, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #10
  store ptr null, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #10
  store ptr null, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #10
  store ptr null, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #10
  store ptr @.str.7, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #10
  store i32 0, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #10
  store i32 0, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #10
  store i32 0, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #10
  store i32 0, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #10
  store i32 0, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #10
  store i32 0, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #10
  store i32 0, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #10
  store i32 0, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #10
  store i32 0, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #10
  store i32 0, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #10
  store i32 0, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #10
  store double 0x41E710893C800000, ptr %27, align 8, !tbaa !11
  br label %69

69:                                               ; preds = %139, %68
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = load ptr, ptr %6, align 8, !tbaa !9
  %72 = call i32 @getopt(i32 noundef %70, ptr noundef %71, ptr noundef @.str.8) #10
  store i32 %72, ptr %9, align 4, !tbaa !5
  %73 = icmp ne i32 %72, -1
  br i1 %73, label %74, label %140

74:                                               ; preds = %69
  %75 = load i32, ptr %9, align 4, !tbaa !5
  switch i32 %75, label %137 [
    i32 105, label %76
    i32 114, label %78
    i32 113, label %80
    i32 117, label %82
    i32 99, label %84
    i32 115, label %85
    i32 118, label %86
    i32 111, label %87
    i32 109, label %88
    i32 102, label %89
    i32 103, label %91
    i32 108, label %94
    i32 104, label %95
    i32 63, label %97
  ]

76:                                               ; preds = %74
  store i32 1, ptr %16, align 4, !tbaa !5
  %77 = load ptr, ptr @optarg, align 8, !tbaa !9
  store ptr %77, ptr %10, align 8, !tbaa !9
  br label %139

78:                                               ; preds = %74
  store i32 1, ptr %18, align 4, !tbaa !5
  %79 = load ptr, ptr @optarg, align 8, !tbaa !9
  store ptr %79, ptr %11, align 8, !tbaa !9
  br label %139

80:                                               ; preds = %74
  store i32 1, ptr %19, align 4, !tbaa !5
  %81 = load ptr, ptr @optarg, align 8, !tbaa !9
  store ptr %81, ptr %12, align 8, !tbaa !9
  br label %139

82:                                               ; preds = %74
  store i32 1, ptr %26, align 4, !tbaa !5
  %83 = load ptr, ptr @optarg, align 8, !tbaa !9
  store ptr %83, ptr %14, align 8, !tbaa !9
  br label %139

84:                                               ; preds = %74
  store i32 1, ptr %20, align 4, !tbaa !5
  br label %139

85:                                               ; preds = %74
  store i32 1, ptr %21, align 4, !tbaa !5
  br label %139

86:                                               ; preds = %74
  store i32 1, ptr %22, align 4, !tbaa !5
  br label %139

87:                                               ; preds = %74
  store i32 1, ptr %24, align 4, !tbaa !5
  br label %139

88:                                               ; preds = %74
  store i32 1, ptr %25, align 4, !tbaa !5
  br label %139

89:                                               ; preds = %74
  store i32 1, ptr %23, align 4, !tbaa !5
  %90 = load ptr, ptr @optarg, align 8, !tbaa !9
  store ptr %90, ptr %13, align 8, !tbaa !9
  br label %139

91:                                               ; preds = %74
  %92 = load ptr, ptr @optarg, align 8, !tbaa !9
  %93 = call double @atof(ptr noundef %92) #11
  store double %93, ptr %27, align 8, !tbaa !11
  br label %139

94:                                               ; preds = %74
  store i32 1, ptr %17, align 4, !tbaa !5
  br label %139

95:                                               ; preds = %74
  %96 = call i32 @search_help(i32 noundef 0)
  store i32 %96, ptr %4, align 4
  store i32 1, ptr %28, align 4
  br label %515

97:                                               ; preds = %74
  %98 = load i32, ptr @optopt, align 4, !tbaa !5
  %99 = icmp eq i32 %98, 105
  br i1 %99, label %112, label %100

100:                                              ; preds = %97
  %101 = load i32, ptr @optopt, align 4, !tbaa !5
  %102 = icmp eq i32 %101, 114
  br i1 %102, label %112, label %103

103:                                              ; preds = %100
  %104 = load i32, ptr @optopt, align 4, !tbaa !5
  %105 = icmp eq i32 %104, 113
  br i1 %105, label %112, label %106

106:                                              ; preds = %103
  %107 = load i32, ptr @optopt, align 4, !tbaa !5
  %108 = icmp eq i32 %107, 117
  br i1 %108, label %112, label %109

109:                                              ; preds = %106
  %110 = load i32, ptr @optopt, align 4, !tbaa !5
  %111 = icmp eq i32 %110, 102
  br i1 %111, label %112, label %116

112:                                              ; preds = %109, %106, %103, %100, %97
  %113 = load ptr, ptr @stderr, align 8, !tbaa !9
  %114 = load i32, ptr @optopt, align 4, !tbaa !5
  %115 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %113, ptr noundef @.str.9, i32 noundef %114) #10
  br label %135

116:                                              ; preds = %109
  %117 = call ptr @__ctype_b_loc() #12
  %118 = load ptr, ptr %117, align 8, !tbaa !9
  %119 = load i32, ptr @optopt, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds i16, ptr %118, i64 %120
  %122 = load i16, ptr %121, align 2, !tbaa !13
  %123 = zext i16 %122 to i32
  %124 = and i32 %123, 16384
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %130

126:                                              ; preds = %116
  %127 = load ptr, ptr @stderr, align 8, !tbaa !9
  %128 = load i32, ptr @optopt, align 4, !tbaa !5
  %129 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %127, ptr noundef @.str.10, i32 noundef %128) #10
  br label %134

130:                                              ; preds = %116
  %131 = load ptr, ptr @stderr, align 8, !tbaa !9
  %132 = load i32, ptr @optopt, align 4, !tbaa !5
  %133 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %131, ptr noundef @.str.11, i32 noundef %132) #10
  br label %134

134:                                              ; preds = %130, %126
  br label %135

135:                                              ; preds = %134, %112
  %136 = call i32 @search_help(i32 noundef 64)
  store i32 %136, ptr %4, align 4
  store i32 1, ptr %28, align 4
  br label %515

137:                                              ; preds = %74
  %138 = call i32 @search_help(i32 noundef 0)
  store i32 %138, ptr %4, align 4
  store i32 1, ptr %28, align 4
  br label %515

139:                                              ; preds = %94, %91, %89, %88, %87, %86, %85, %84, %82, %80, %78, %76
  br label %69, !llvm.loop !15

140:                                              ; preds = %69
  %141 = load i32, ptr %16, align 4, !tbaa !5
  %142 = icmp eq i32 %141, 0
  br i1 %142, label %143, label %147

143:                                              ; preds = %140
  %144 = load ptr, ptr @stderr, align 8, !tbaa !9
  %145 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %144, ptr noundef @.str.12) #10
  %146 = call i32 @search_help(i32 noundef 64)
  store i32 %146, ptr %4, align 4
  store i32 1, ptr %28, align 4
  br label %515

147:                                              ; preds = %140
  %148 = load i32, ptr %17, align 4, !tbaa !5
  %149 = icmp eq i32 %148, 1
  br i1 %149, label %150, label %187

150:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #10
  store ptr null, ptr %29, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #10
  store ptr null, ptr %30, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #10
  store ptr null, ptr %31, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #10
  %151 = load ptr, ptr %10, align 8, !tbaa !9
  %152 = call i32 @giggle_get_indexed_files(ptr noundef %151, ptr noundef %29, ptr noundef %30, ptr noundef %31)
  store i32 %152, ptr %32, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #10
  %153 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  store i32 0, ptr %33, align 4, !tbaa !5
  br label %154

154:                                              ; preds = %180, %150
  %155 = load i32, ptr %33, align 4, !tbaa !5
  %156 = load i32, ptr %32, align 4, !tbaa !5
  %157 = icmp ult i32 %155, %156
  br i1 %157, label %158, label %183

158:                                              ; preds = %154
  %159 = load ptr, ptr %29, align 8, !tbaa !9
  %160 = load i32, ptr %33, align 4, !tbaa !5
  %161 = zext i32 %160 to i64
  %162 = getelementptr inbounds ptr, ptr %159, i64 %161
  %163 = load ptr, ptr %162, align 8, !tbaa !9
  %164 = load ptr, ptr %30, align 8, !tbaa !9
  %165 = load i32, ptr %33, align 4, !tbaa !5
  %166 = zext i32 %165 to i64
  %167 = getelementptr inbounds i32, ptr %164, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = load ptr, ptr %31, align 8, !tbaa !9
  %170 = load i32, ptr %33, align 4, !tbaa !5
  %171 = zext i32 %170 to i64
  %172 = getelementptr inbounds double, ptr %169, i64 %171
  %173 = load double, ptr %172, align 8, !tbaa !11
  %174 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, ptr noundef %163, i32 noundef %168, double noundef %173)
  %175 = load ptr, ptr %29, align 8, !tbaa !9
  %176 = load i32, ptr %33, align 4, !tbaa !5
  %177 = zext i32 %176 to i64
  %178 = getelementptr inbounds ptr, ptr %175, i64 %177
  %179 = load ptr, ptr %178, align 8, !tbaa !9
  call void @free(ptr noundef %179) #10
  br label %180

180:                                              ; preds = %158
  %181 = load i32, ptr %33, align 4, !tbaa !5
  %182 = add i32 %181, 1
  store i32 %182, ptr %33, align 4, !tbaa !5
  br label %154, !llvm.loop !17

183:                                              ; preds = %154
  %184 = load ptr, ptr %29, align 8, !tbaa !9
  call void @free(ptr noundef %184) #10
  %185 = load ptr, ptr %30, align 8, !tbaa !9
  call void @free(ptr noundef %185) #10
  %186 = load ptr, ptr %31, align 8, !tbaa !9
  call void @free(ptr noundef %186) #10
  store i32 0, ptr %4, align 4
  store i32 1, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #10
  br label %515

187:                                              ; preds = %147
  %188 = load i32, ptr %21, align 4, !tbaa !5
  %189 = icmp eq i32 %188, 1
  br i1 %189, label %190, label %197

190:                                              ; preds = %187
  %191 = load i32, ptr %19, align 4, !tbaa !5
  %192 = icmp eq i32 %191, 0
  br i1 %192, label %193, label %197

193:                                              ; preds = %190
  %194 = load ptr, ptr @stderr, align 8, !tbaa !9
  %195 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %194, ptr noundef @.str.15) #10
  %196 = call i32 @search_help(i32 noundef 64)
  store i32 %196, ptr %4, align 4
  store i32 1, ptr %28, align 4
  br label %515

197:                                              ; preds = %190, %187
  %198 = load i32, ptr %18, align 4, !tbaa !5
  %199 = icmp eq i32 %198, 0
  br i1 %199, label %200, label %207

200:                                              ; preds = %197
  %201 = load i32, ptr %19, align 4, !tbaa !5
  %202 = icmp eq i32 %201, 0
  br i1 %202, label %203, label %207

203:                                              ; preds = %200
  %204 = load ptr, ptr @stderr, align 8, !tbaa !9
  %205 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %204, ptr noundef @.str.16) #10
  %206 = call i32 @search_help(i32 noundef 64)
  store i32 %206, ptr %4, align 4
  store i32 1, ptr %28, align 4
  br label %515

207:                                              ; preds = %200, %197
  %208 = load i32, ptr %18, align 4, !tbaa !5
  %209 = icmp eq i32 %208, 1
  br i1 %209, label %210, label %217

210:                                              ; preds = %207
  %211 = load i32, ptr %19, align 4, !tbaa !5
  %212 = icmp eq i32 %211, 1
  br i1 %212, label %213, label %217

213:                                              ; preds = %210
  %214 = load ptr, ptr @stderr, align 8, !tbaa !9
  %215 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %214, ptr noundef @.str.17) #10
  %216 = call i32 @search_help(i32 noundef 64)
  store i32 %216, ptr %4, align 4
  store i32 1, ptr %28, align 4
  br label %515

217:                                              ; preds = %210, %207
  %218 = load i32, ptr %26, align 4, !tbaa !5
  %219 = icmp eq i32 %218, 1
  br i1 %219, label %220, label %227

220:                                              ; preds = %217
  %221 = load i32, ptr %25, align 4, !tbaa !5
  %222 = icmp eq i32 %221, 0
  br i1 %222, label %223, label %227

223:                                              ; preds = %220
  %224 = load ptr, ptr @stderr, align 8, !tbaa !9
  %225 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %224, ptr noundef @.str.18) #10
  %226 = call i32 @search_help(i32 noundef 64)
  store i32 %226, ptr %4, align 4
  store i32 1, ptr %28, align 4
  br label %515

227:                                              ; preds = %220, %217
  %228 = load i32, ptr %22, align 4, !tbaa !5
  %229 = icmp eq i32 %228, 0
  br i1 %229, label %230, label %234

230:                                              ; preds = %227
  %231 = load i32, ptr %21, align 4, !tbaa !5
  %232 = icmp eq i32 %231, 0
  br i1 %232, label %233, label %234

233:                                              ; preds = %230
  store i32 1, ptr %20, align 4, !tbaa !5
  br label %234

234:                                              ; preds = %233, %230, %227
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #10
  store i32 0, ptr %34, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #10
  store ptr null, ptr %35, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #10
  store ptr null, ptr %36, align 8, !tbaa !9
  %235 = load i32, ptr %23, align 4, !tbaa !5
  %236 = icmp eq i32 %235, 1
  br i1 %236, label %237, label %322

237:                                              ; preds = %234
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #10
  store i32 0, ptr %37, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #10
  store i32 0, ptr %38, align 4, !tbaa !5
  br label %238

238:                                              ; preds = %245, %237
  %239 = load ptr, ptr %13, align 8, !tbaa !9
  %240 = load ptr, ptr %13, align 8, !tbaa !9
  %241 = call i64 @strlen(ptr noundef %240) #11
  %242 = trunc i64 %241 to i32
  %243 = call i32 @scan_s(ptr noundef %239, i32 noundef %242, ptr noundef %37, ptr noundef %38, i8 noundef signext 44)
  %244 = icmp sge i32 %243, 0
  br i1 %244, label %245, label %250

245:                                              ; preds = %238
  %246 = load i32, ptr %34, align 4, !tbaa !5
  %247 = add i32 %246, 1
  store i32 %247, ptr %34, align 4, !tbaa !5
  %248 = load i32, ptr %38, align 4, !tbaa !5
  %249 = add nsw i32 %248, 1
  store i32 %249, ptr %37, align 4, !tbaa !5
  br label %238, !llvm.loop !18

250:                                              ; preds = %238
  %251 = load i32, ptr %34, align 4, !tbaa !5
  %252 = icmp eq i32 %251, 0
  br i1 %252, label %253, label %257

253:                                              ; preds = %250
  %254 = load ptr, ptr @stderr, align 8, !tbaa !9
  %255 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %254, ptr noundef @.str.19) #10
  %256 = call i32 @search_help(i32 noundef 64)
  store i32 %256, ptr %4, align 4
  store i32 1, ptr %28, align 4
  br label %319

257:                                              ; preds = %250
  %258 = load i32, ptr %34, align 4, !tbaa !5
  %259 = zext i32 %258 to i64
  %260 = mul i64 %259, 64
  %261 = call noalias ptr @malloc(i64 noundef %260) #13
  store ptr %261, ptr %35, align 8, !tbaa !9
  %262 = load ptr, ptr %35, align 8, !tbaa !9
  %263 = icmp eq ptr %262, null
  br i1 %263, label %264, label %265

264:                                              ; preds = %257
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.20) #14
  unreachable

265:                                              ; preds = %257
  %266 = load i32, ptr %34, align 4, !tbaa !5
  %267 = zext i32 %266 to i64
  %268 = mul i64 %267, 8
  %269 = call noalias ptr @malloc(i64 noundef %268) #13
  store ptr %269, ptr %36, align 8, !tbaa !9
  %270 = load ptr, ptr %36, align 8, !tbaa !9
  %271 = icmp eq ptr %270, null
  br i1 %271, label %272, label %273

272:                                              ; preds = %265
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.20) #14
  unreachable

273:                                              ; preds = %265
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #10
  store i32 0, ptr %39, align 4, !tbaa !5
  store i32 0, ptr %37, align 4, !tbaa !5
  store i32 0, ptr %38, align 4, !tbaa !5
  br label %274

274:                                              ; preds = %313, %273
  %275 = load ptr, ptr %13, align 8, !tbaa !9
  %276 = load ptr, ptr %13, align 8, !tbaa !9
  %277 = call i64 @strlen(ptr noundef %276) #11
  %278 = trunc i64 %277 to i32
  %279 = call i32 @scan_s(ptr noundef %275, i32 noundef %278, ptr noundef %37, ptr noundef %38, i8 noundef signext 44)
  %280 = icmp sge i32 %279, 0
  br i1 %280, label %281, label %318

281:                                              ; preds = %274
  %282 = load ptr, ptr %13, align 8, !tbaa !9
  %283 = load i32, ptr %37, align 4, !tbaa !5
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds i8, ptr %282, i64 %284
  %286 = load i32, ptr %38, align 4, !tbaa !5
  %287 = load i32, ptr %37, align 4, !tbaa !5
  %288 = sub nsw i32 %286, %287
  %289 = sext i32 %288 to i64
  %290 = call noalias ptr @strndup(ptr noundef %285, i64 noundef %289) #10
  %291 = load ptr, ptr %36, align 8, !tbaa !9
  %292 = load i32, ptr %39, align 4, !tbaa !5
  %293 = zext i32 %292 to i64
  %294 = getelementptr inbounds ptr, ptr %291, i64 %293
  store ptr %290, ptr %294, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #10
  %295 = load ptr, ptr %35, align 8, !tbaa !9
  %296 = load i32, ptr %39, align 4, !tbaa !5
  %297 = zext i32 %296 to i64
  %298 = getelementptr inbounds %struct.re_pattern_buffer, ptr %295, i64 %297
  %299 = load ptr, ptr %36, align 8, !tbaa !9
  %300 = load i32, ptr %39, align 4, !tbaa !5
  %301 = zext i32 %300 to i64
  %302 = getelementptr inbounds ptr, ptr %299, i64 %301
  %303 = load ptr, ptr %302, align 8, !tbaa !9
  %304 = call i32 @regcomp(ptr noundef %298, ptr noundef %303, i32 noundef 0)
  store i32 %304, ptr %40, align 4, !tbaa !5
  %305 = load i32, ptr %40, align 4, !tbaa !5
  %306 = icmp ne i32 %305, 0
  br i1 %306, label %307, label %313

307:                                              ; preds = %281
  %308 = load ptr, ptr %36, align 8, !tbaa !9
  %309 = load i32, ptr %39, align 4, !tbaa !5
  %310 = zext i32 %309 to i64
  %311 = getelementptr inbounds ptr, ptr %308, i64 %310
  %312 = load ptr, ptr %311, align 8, !tbaa !9
  call void (i32, ptr, ...) @errx(i32 noundef 64, ptr noundef @.str.21, ptr noundef %312) #14
  unreachable

313:                                              ; preds = %281
  %314 = load i32, ptr %39, align 4, !tbaa !5
  %315 = add i32 %314, 1
  store i32 %315, ptr %39, align 4, !tbaa !5
  %316 = load i32, ptr %38, align 4, !tbaa !5
  %317 = add nsw i32 %316, 1
  store i32 %317, ptr %37, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #10
  br label %274, !llvm.loop !19

318:                                              ; preds = %274
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #10
  store i32 0, ptr %28, align 4
  br label %319

319:                                              ; preds = %318, %253
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #10
  %320 = load i32, ptr %28, align 4
  switch i32 %320, label %514 [
    i32 0, label %321
  ]

321:                                              ; preds = %319
  br label %322

322:                                              ; preds = %321, %234
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #10
  %323 = load ptr, ptr %10, align 8, !tbaa !9
  %324 = load i32, ptr %25, align 4, !tbaa !5
  %325 = call ptr @giggle_load_with_metadata(ptr noundef %323, i32 noundef %324, ptr noundef @block_store_giggle_set_data_handler)
  store ptr %325, ptr %41, align 8, !tbaa !9
  %326 = load ptr, ptr %41, align 8, !tbaa !9
  %327 = icmp eq ptr %326, null
  br i1 %327, label %328, label %330

328:                                              ; preds = %322
  %329 = load ptr, ptr %10, align 8, !tbaa !9
  call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef @.str.22, ptr noundef %329) #14
  unreachable

330:                                              ; preds = %322
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #10
  store ptr null, ptr %42, align 8, !tbaa !9
  %331 = load ptr, ptr %14, align 8, !tbaa !9
  %332 = icmp ne ptr %331, null
  br i1 %332, label %333, label %339

333:                                              ; preds = %330
  %334 = load ptr, ptr %41, align 8, !tbaa !9
  %335 = getelementptr inbounds %struct.giggle_index, ptr %334, i32 0, i32 6
  %336 = load ptr, ptr %335, align 8, !tbaa !20
  %337 = load ptr, ptr %14, align 8, !tbaa !9
  %338 = call ptr @parse_query_filter_string(ptr noundef %336, ptr noundef %337)
  store ptr %338, ptr %42, align 8, !tbaa !9
  br label %339

339:                                              ; preds = %333, %330
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #10
  store ptr null, ptr %43, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #10
  store i32 0, ptr %44, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #10
  store double 0.000000e+00, ptr %45, align 8, !tbaa !11
  %340 = load i32, ptr %18, align 4, !tbaa !5
  %341 = icmp eq i32 %340, 1
  br i1 %341, label %342, label %401

342:                                              ; preds = %339
  call void @llvm.lifetime.start.p0(i64 4, ptr %46) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #10
  store i32 0, ptr %47, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %48) #10
  %343 = load ptr, ptr %11, align 8, !tbaa !9
  %344 = call i64 @strlen(ptr noundef %343) #11
  %345 = trunc i64 %344 to i32
  store i32 %345, ptr %48, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %50) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %51) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %52) #10
  store i32 0, ptr %46, align 4, !tbaa !5
  br label %346

346:                                              ; preds = %397, %342
  %347 = load i32, ptr %46, align 4, !tbaa !5
  %348 = load i32, ptr %48, align 4, !tbaa !5
  %349 = icmp ule i32 %347, %348
  br i1 %349, label %350, label %400

350:                                              ; preds = %346
  %351 = load ptr, ptr %11, align 8, !tbaa !9
  %352 = load i32, ptr %46, align 4, !tbaa !5
  %353 = zext i32 %352 to i64
  %354 = getelementptr inbounds i8, ptr %351, i64 %353
  %355 = load i8, ptr %354, align 1, !tbaa !22
  %356 = sext i8 %355 to i32
  %357 = icmp eq i32 %356, 44
  br i1 %357, label %366, label %358

358:                                              ; preds = %350
  %359 = load ptr, ptr %11, align 8, !tbaa !9
  %360 = load i32, ptr %46, align 4, !tbaa !5
  %361 = zext i32 %360 to i64
  %362 = getelementptr inbounds i8, ptr %359, i64 %361
  %363 = load i8, ptr %362, align 1, !tbaa !22
  %364 = sext i8 %363 to i32
  %365 = icmp eq i32 %364, 0
  br i1 %365, label %366, label %396

366:                                              ; preds = %358, %350
  %367 = load ptr, ptr %11, align 8, !tbaa !9
  %368 = load i32, ptr %46, align 4, !tbaa !5
  %369 = zext i32 %368 to i64
  %370 = getelementptr inbounds i8, ptr %367, i64 %369
  store i8 0, ptr %370, align 1, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %53) #10
  %371 = load ptr, ptr %11, align 8, !tbaa !9
  %372 = load i32, ptr %47, align 4, !tbaa !5
  %373 = zext i32 %372 to i64
  %374 = getelementptr inbounds i8, ptr %371, i64 %373
  %375 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %53, ptr noundef @.str.23, ptr noundef %374) #10
  store i32 %375, ptr %52, align 4, !tbaa !5
  %376 = load ptr, ptr %53, align 8, !tbaa !9
  %377 = call i32 @parse_region(ptr noundef %376, ptr noundef %49, ptr noundef %50, ptr noundef %51)
  %378 = icmp eq i32 %377, 0
  br i1 %378, label %379, label %388

379:                                              ; preds = %366
  %380 = load ptr, ptr %41, align 8, !tbaa !9
  %381 = load ptr, ptr %49, align 8, !tbaa !9
  %382 = load i32, ptr %50, align 4, !tbaa !5
  %383 = load i32, ptr %51, align 4, !tbaa !5
  %384 = load ptr, ptr %42, align 8, !tbaa !9
  %385 = load ptr, ptr %43, align 8, !tbaa !9
  %386 = call ptr @giggle_query_with_query_filter(ptr noundef %380, ptr noundef %381, i32 noundef %382, i32 noundef %383, ptr noundef %384, ptr noundef %385)
  store ptr %386, ptr %43, align 8, !tbaa !9
  %387 = load ptr, ptr %53, align 8, !tbaa !9
  call void @free(ptr noundef %387) #10
  br label %393

388:                                              ; preds = %366
  %389 = load ptr, ptr %11, align 8, !tbaa !9
  %390 = load i32, ptr %47, align 4, !tbaa !5
  %391 = zext i32 %390 to i64
  %392 = getelementptr inbounds i8, ptr %389, i64 %391
  call void (i32, ptr, ...) @errx(i32 noundef 64, ptr noundef @.str.24, ptr noundef %392) #14
  unreachable

393:                                              ; preds = %379
  %394 = load i32, ptr %46, align 4, !tbaa !5
  %395 = add i32 %394, 1
  store i32 %395, ptr %47, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %53) #10
  br label %396

396:                                              ; preds = %393, %358
  br label %397

397:                                              ; preds = %396
  %398 = load i32, ptr %46, align 4, !tbaa !5
  %399 = add i32 %398, 1
  store i32 %399, ptr %46, align 4, !tbaa !5
  br label %346, !llvm.loop !23

400:                                              ; preds = %346
  call void @llvm.lifetime.end.p0(i64 4, ptr %52) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %51) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %50) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #10
  br label %491

401:                                              ; preds = %339
  %402 = load i32, ptr %19, align 4, !tbaa !5
  %403 = icmp eq i32 %402, 1
  br i1 %403, label %404, label %490

404:                                              ; preds = %401
  call void @llvm.lifetime.start.p0(i64 4, ptr %54) #10
  store i32 50, ptr %54, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %55) #10
  %405 = load i32, ptr %54, align 4, !tbaa !5
  %406 = sext i32 %405 to i64
  %407 = mul i64 %406, 1
  %408 = call noalias ptr @malloc(i64 noundef %407) #13
  store ptr %408, ptr %55, align 8, !tbaa !9
  %409 = load ptr, ptr %55, align 8, !tbaa !9
  %410 = icmp eq ptr %409, null
  br i1 %410, label %411, label %412

411:                                              ; preds = %404
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.20) #14
  unreachable

412:                                              ; preds = %404
  call void @llvm.lifetime.start.p0(i64 4, ptr %56) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %57) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %58) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr %59) #10
  call void @llvm.memset.p0.i64(ptr align 8 %59, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %60) #10
  %413 = load ptr, ptr %12, align 8, !tbaa !9
  %414 = call ptr @input_file_init(ptr noundef %413)
  store ptr %414, ptr %60, align 8, !tbaa !9
  %415 = load ptr, ptr %60, align 8, !tbaa !9
  %416 = icmp eq ptr %415, null
  br i1 %416, label %417, label %419

417:                                              ; preds = %412
  %418 = load ptr, ptr %12, align 8, !tbaa !9
  call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef @.str.25, ptr noundef %418) #14
  unreachable

419:                                              ; preds = %412
  br label %420

420:                                              ; preds = %468, %419
  %421 = load ptr, ptr %60, align 8, !tbaa !9
  %422 = getelementptr inbounds %struct.input_file, ptr %421, i32 0, i32 8
  %423 = load ptr, ptr %422, align 8, !tbaa !24
  %424 = load ptr, ptr %60, align 8, !tbaa !9
  %425 = call i32 %423(ptr noundef %424, ptr noundef %55, ptr noundef %54, ptr noundef %56, ptr noundef %57, ptr noundef %58, ptr noundef %59)
  %426 = icmp sge i32 %425, 0
  br i1 %426, label %427, label %477

427:                                              ; preds = %420
  %428 = load ptr, ptr %41, align 8, !tbaa !9
  %429 = load ptr, ptr %55, align 8, !tbaa !9
  %430 = load i32, ptr %56, align 4, !tbaa !5
  %431 = load i32, ptr %57, align 4, !tbaa !5
  %432 = load ptr, ptr %42, align 8, !tbaa !9
  %433 = load ptr, ptr %43, align 8, !tbaa !9
  %434 = call ptr @giggle_query_with_query_filter(ptr noundef %428, ptr noundef %429, i32 noundef %430, i32 noundef %431, ptr noundef %432, ptr noundef %433)
  store ptr %434, ptr %43, align 8, !tbaa !9
  %435 = load i32, ptr %24, align 4, !tbaa !5
  %436 = icmp eq i32 %435, 1
  br i1 %436, label %437, label %468

437:                                              ; preds = %427
  %438 = load ptr, ptr %43, align 8, !tbaa !9
  %439 = getelementptr inbounds %struct.giggle_query_result, ptr %438, i32 0, i32 3
  %440 = load i32, ptr %439, align 8, !tbaa !27
  %441 = icmp ugt i32 %440, 0
  br i1 %441, label %442, label %468

442:                                              ; preds = %437
  call void @llvm.lifetime.start.p0(i64 8, ptr %61) #10
  %443 = load ptr, ptr %60, align 8, !tbaa !9
  call void @input_file_get_curr_line_bgzf(ptr noundef %443, ptr noundef %61)
  %444 = load ptr, ptr %61, align 8, !tbaa !9
  %445 = call i32 (ptr, ...) @printf(ptr noundef @.str.26, ptr noundef %444)
  %446 = load ptr, ptr %60, align 8, !tbaa !9
  %447 = getelementptr inbounds %struct.input_file, ptr %446, i32 0, i32 7
  %448 = load i32, ptr %447, align 8, !tbaa !29
  %449 = icmp eq i32 %448, 0
  br i1 %449, label %450, label %452

450:                                              ; preds = %442
  %451 = call i32 (ptr, ...) @printf(ptr noundef @.str.27)
  br label %452

452:                                              ; preds = %450, %442
  call void @llvm.lifetime.start.p0(i64 4, ptr %62) #10
  %453 = load ptr, ptr %43, align 8, !tbaa !9
  %454 = load ptr, ptr %41, align 8, !tbaa !9
  %455 = load ptr, ptr %35, align 8, !tbaa !9
  %456 = load ptr, ptr %36, align 8, !tbaa !9
  %457 = load i32, ptr %34, align 4, !tbaa !5
  %458 = load i32, ptr %44, align 4, !tbaa !5
  %459 = load double, ptr %45, align 8, !tbaa !11
  %460 = load double, ptr %27, align 8, !tbaa !11
  %461 = fptosi double %460 to i64
  %462 = load i32, ptr %23, align 4, !tbaa !5
  %463 = load i32, ptr %22, align 4, !tbaa !5
  %464 = load i32, ptr %20, align 4, !tbaa !5
  %465 = load i32, ptr %21, align 4, !tbaa !5
  %466 = load i32, ptr %24, align 4, !tbaa !5
  %467 = call i32 @print_giggle_query_result(ptr noundef %453, ptr noundef %454, ptr noundef %455, ptr noundef %456, i32 noundef %457, i32 noundef %458, double noundef %459, i64 noundef %461, i32 noundef %462, i32 noundef %463, i32 noundef %464, i32 noundef %465, i32 noundef %466)
  store i32 %467, ptr %62, align 4, !tbaa !5
  call void @giggle_query_result_destroy(ptr noundef %43)
  call void @llvm.lifetime.end.p0(i64 4, ptr %62) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %61) #10
  br label %468

468:                                              ; preds = %452, %437, %427
  %469 = load i32, ptr %44, align 4, !tbaa !5
  %470 = add i32 %469, 1
  store i32 %470, ptr %44, align 4, !tbaa !5
  %471 = load i32, ptr %57, align 4, !tbaa !5
  %472 = load i32, ptr %56, align 4, !tbaa !5
  %473 = sub i32 %471, %472
  %474 = uitofp i32 %473 to double
  %475 = load double, ptr %45, align 8, !tbaa !11
  %476 = fadd double %475, %474
  store double %476, ptr %45, align 8, !tbaa !11
  br label %420, !llvm.loop !30

477:                                              ; preds = %420
  %478 = load ptr, ptr %55, align 8, !tbaa !9
  call void @free(ptr noundef %478) #10
  %479 = getelementptr inbounds %struct.__kstring_t, ptr %59, i32 0, i32 2
  %480 = load ptr, ptr %479, align 8, !tbaa !31
  %481 = icmp ne ptr %480, null
  br i1 %481, label %482, label %485

482:                                              ; preds = %477
  %483 = getelementptr inbounds %struct.__kstring_t, ptr %59, i32 0, i32 2
  %484 = load ptr, ptr %483, align 8, !tbaa !31
  call void @free(ptr noundef %484) #10
  br label %485

485:                                              ; preds = %482, %477
  %486 = load double, ptr %45, align 8, !tbaa !11
  %487 = load i32, ptr %44, align 4, !tbaa !5
  %488 = uitofp i32 %487 to double
  %489 = fdiv double %486, %488
  store double %489, ptr %45, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %60) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %59) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %58) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %57) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %56) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %55) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %54) #10
  br label %490

490:                                              ; preds = %485, %401
  br label %491

491:                                              ; preds = %490, %400
  call void @llvm.lifetime.start.p0(i64 4, ptr %63) #10
  %492 = load ptr, ptr %43, align 8, !tbaa !9
  %493 = load ptr, ptr %41, align 8, !tbaa !9
  %494 = load ptr, ptr %35, align 8, !tbaa !9
  %495 = load ptr, ptr %36, align 8, !tbaa !9
  %496 = load i32, ptr %34, align 4, !tbaa !5
  %497 = load i32, ptr %44, align 4, !tbaa !5
  %498 = load double, ptr %45, align 8, !tbaa !11
  %499 = load double, ptr %27, align 8, !tbaa !11
  %500 = fptosi double %499 to i64
  %501 = load i32, ptr %23, align 4, !tbaa !5
  %502 = load i32, ptr %22, align 4, !tbaa !5
  %503 = load i32, ptr %20, align 4, !tbaa !5
  %504 = load i32, ptr %21, align 4, !tbaa !5
  %505 = load i32, ptr %24, align 4, !tbaa !5
  %506 = call i32 @print_giggle_query_result(ptr noundef %492, ptr noundef %493, ptr noundef %494, ptr noundef %495, i32 noundef %496, i32 noundef %497, double noundef %498, i64 noundef %500, i32 noundef %501, i32 noundef %502, i32 noundef %503, i32 noundef %504, i32 noundef %505)
  store i32 %506, ptr %63, align 4, !tbaa !5
  call void @giggle_query_result_destroy(ptr noundef %43)
  %507 = load ptr, ptr %42, align 8, !tbaa !9
  %508 = icmp ne ptr %507, null
  br i1 %508, label %509, label %510

509:                                              ; preds = %491
  call void @query_filter_destroy(ptr noundef %42)
  br label %510

510:                                              ; preds = %509, %491
  call void @giggle_index_destroy(ptr noundef %41)
  %511 = load ptr, ptr getelementptr inbounds (%struct.cache_def, ptr @cache, i32 0, i32 6), align 8, !tbaa !33
  call void (...) %511()
  %512 = load ptr, ptr %7, align 8, !tbaa !9
  call void @free(ptr noundef %512) #10
  %513 = load i32, ptr %63, align 4, !tbaa !5
  store i32 %513, ptr %4, align 4
  store i32 1, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %63) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #10
  br label %514

514:                                              ; preds = %510, %319
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #10
  br label %515

515:                                              ; preds = %514, %223, %213, %203, %193, %183, %143, %137, %135, %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #10
  br label %516

516:                                              ; preds = %515, %66
  %517 = load i32, ptr %4, align 4
  ret i32 %517
}

; Function Attrs: nounwind
declare i32 @getopt(i32 noundef, ptr noundef, ptr noundef) #1

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare double @atof(ptr noundef nonnull) #4

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__ctype_b_loc() #5

declare i32 @giggle_get_indexed_files(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

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

declare i32 @scan_s(ptr noundef, i32 noundef, ptr noundef, ptr noundef, i8 noundef signext) #3

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

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

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

; Function Attrs: nounwind
declare noalias ptr @strndup(ptr noundef, i64 noundef) #1

declare i32 @regcomp(ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: noreturn
declare void @errx(i32 noundef, ptr noundef, ...) #8

declare ptr @giggle_load_with_metadata(ptr noundef, i32 noundef, ptr noundef) #3

declare void @block_store_giggle_set_data_handler(...) #3

declare ptr @parse_query_filter_string(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind
declare i32 @asprintf(ptr noundef, ptr noundef, ...) #1

declare i32 @parse_region(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare ptr @giggle_query_with_query_filter(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #3

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

declare ptr @input_file_init(ptr noundef) #3

declare void @input_file_get_curr_line_bgzf(ptr noundef, ptr noundef) #3

declare void @giggle_query_result_destroy(ptr noundef) #3

declare void @query_filter_destroy(ptr noundef) #3

declare void @giggle_index_destroy(ptr noundef) #3

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

!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 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = !{!21, !10, i64 40}
!21 = !{!"giggle_index", !10, i64 0, !6, i64 8, !6, i64 12, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56}
!22 = !{!7, !7, i64 0}
!23 = distinct !{!23, !16}
!24 = !{!25, !10, i64 64}
!25 = !{!"input_file", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !26, i64 48, !6, i64 56, !10, i64 64, !10, i64 72, !10, i64 80}
!26 = !{!"long", !7, i64 0}
!27 = !{!28, !6, i64 24}
!28 = !{!"giggle_query_result", !10, i64 0, !6, i64 8, !10, i64 16, !6, i64 24}
!29 = !{!25, !6, i64 56}
!30 = distinct !{!30, !16}
!31 = !{!32, !10, i64 16}
!32 = !{!"__kstring_t", !26, i64 0, !26, i64 8, !10, i64 16}
!33 = !{!34, !10, i64 48}
!34 = !{!"cache_def", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.cache_def = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.__kstring_t = type { i64, i64, ptr }
%struct.re_pattern_buffer = type { ptr, i64, i64, i64, ptr, ptr, i64, i8 }

@stderr = external local_unnamed_addr global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [20 x i8], align 1
@optarg = external local_unnamed_addr global ptr, align 8
@optopt = external local_unnamed_addr global i32, align 4
@.str.9 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [2 x i8], align 1
@cache = external dso_local local_unnamed_addr global %struct.cache_def, align 8

; Function Attrs: nounwind uwtable
declare dso_local i32 @search_help(i32 noundef) local_unnamed_addr #0

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @search_main(i32 noundef %0, ptr noundef %1, ptr nocapture noundef %2) local_unnamed_addr #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %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 i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i64, align 8
  %21 = alloca %struct.__kstring_t, align 8
  %22 = alloca ptr, align 8
  %23 = icmp slt i32 %0, 2
  br i1 %23, label %24, label %.preheader191

24:                                               ; preds = %3
  %25 = tail call i32 @search_help(i32 noundef 0)
  br label %279

.preheader191:                                    ; preds = %3, %.preheader191.backedge
  %.0171 = phi i32 [ %.0171.be, %.preheader191.backedge ], [ 0, %3 ]
  %.0169 = phi i32 [ %.0169.be, %.preheader191.backedge ], [ 0, %3 ]
  %.0167 = phi i32 [ %.0167.be, %.preheader191.backedge ], [ 0, %3 ]
  %.0164 = phi i32 [ %.0164.be, %.preheader191.backedge ], [ 0, %3 ]
  %.0162 = phi i32 [ %.0162.be, %.preheader191.backedge ], [ 0, %3 ]
  %.0160 = phi i32 [ %.0160.be, %.preheader191.backedge ], [ 0, %3 ]
  %.0158 = phi i32 [ %.0158.be, %.preheader191.backedge ], [ 0, %3 ]
  %.0156 = phi i32 [ %.0156.be, %.preheader191.backedge ], [ 0, %3 ]
  %.0154 = phi i32 [ %.0154.be, %.preheader191.backedge ], [ 0, %3 ]
  %.0152 = phi i32 [ %.0152.be, %.preheader191.backedge ], [ 0, %3 ]
  %.0150 = phi double [ %.0150.be, %.preheader191.backedge ], [ 0x41E710893C800000, %3 ]
  %.0147 = phi i32 [ %.0147.be, %.preheader191.backedge ], [ 0, %3 ]
  %.0137 = phi ptr [ %.0137.be, %.preheader191.backedge ], [ null, %3 ]
  %.0128 = phi ptr [ %.0128.be, %.preheader191.backedge ], [ null, %3 ]
  %.0126 = phi ptr [ %.0126.be, %.preheader191.backedge ], [ null, %3 ]
  %.0124 = phi ptr [ %.0124.be, %.preheader191.backedge ], [ null, %3 ]
  %.0122 = phi ptr [ %.0122.be, %.preheader191.backedge ], [ null, %3 ]
  %26 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.8) #13
  switch i32 %26, label %66 [
    i32 -1, label %68
    i32 105, label %27
    i32 114, label %29
    i32 113, label %31
    i32 117, label %33
    i32 99, label %.preheader191.backedge
    i32 115, label %35
    i32 118, label %36
    i32 111, label %37
    i32 109, label %38
    i32 102, label %39
    i32 103, label %41
    i32 108, label %44
    i32 104, label %45
    i32 63, label %47
  ]

.preheader191.backedge:                           ; preds = %.preheader191, %44, %41, %39, %38, %37, %36, %35, %33, %31, %29, %27
  %.0171.be = phi i32 [ 1, %44 ], [ %.0171, %41 ], [ %.0171, %39 ], [ %.0171, %38 ], [ %.0171, %37 ], [ %.0171, %36 ], [ %.0171, %35 ], [ %.0171, %33 ], [ %.0171, %31 ], [ %.0171, %29 ], [ %.0171, %27 ], [ %.0171, %.preheader191 ]
  %.0169.be = phi i32 [ %.0169, %44 ], [ %.0169, %41 ], [ %.0169, %39 ], [ %.0169, %38 ], [ %.0169, %37 ], [ %.0169, %36 ], [ %.0169, %35 ], [ %.0169, %33 ], [ %.0169, %31 ], [ 1, %29 ], [ %.0169, %27 ], [ %.0169, %.preheader191 ]
  %.0167.be = phi i32 [ %.0167, %44 ], [ %.0167, %41 ], [ %.0167, %39 ], [ %.0167, %38 ], [ %.0167, %37 ], [ %.0167, %36 ], [ %.0167, %35 ], [ %.0167, %33 ], [ 1, %31 ], [ %.0167, %29 ], [ %.0167, %27 ], [ %.0167, %.preheader191 ]
  %.0164.be = phi i32 [ %.0164, %44 ], [ %.0164, %41 ], [ %.0164, %39 ], [ %.0164, %38 ], [ %.0164, %37 ], [ %.0164, %36 ], [ %.0164, %35 ], [ %.0164, %33 ], [ %.0164, %31 ], [ %.0164, %29 ], [ %.0164, %27 ], [ 1, %.preheader191 ]
  %.0162.be = phi i32 [ %.0162, %44 ], [ %.0162, %41 ], [ %.0162, %39 ], [ %.0162, %38 ], [ %.0162, %37 ], [ %.0162, %36 ], [ 1, %35 ], [ %.0162, %33 ], [ %.0162, %31 ], [ %.0162, %29 ], [ %.0162, %27 ], [ %.0162, %.preheader191 ]
  %.0160.be = phi i32 [ %.0160, %44 ], [ %.0160, %41 ], [ %.0160, %39 ], [ %.0160, %38 ], [ %.0160, %37 ], [ 1, %36 ], [ %.0160, %35 ], [ %.0160, %33 ], [ %.0160, %31 ], [ %.0160, %29 ], [ %.0160, %27 ], [ %.0160, %.preheader191 ]
  %.0158.be = phi i32 [ %.0158, %44 ], [ %.0158, %41 ], [ 1, %39 ], [ %.0158, %38 ], [ %.0158, %37 ], [ %.0158, %36 ], [ %.0158, %35 ], [ %.0158, %33 ], [ %.0158, %31 ], [ %.0158, %29 ], [ %.0158, %27 ], [ %.0158, %.preheader191 ]
  %.0156.be = phi i32 [ %.0156, %44 ], [ %.0156, %41 ], [ %.0156, %39 ], [ %.0156, %38 ], [ 1, %37 ], [ %.0156, %36 ], [ %.0156, %35 ], [ %.0156, %33 ], [ %.0156, %31 ], [ %.0156, %29 ], [ %.0156, %27 ], [ %.0156, %.preheader191 ]
  %.0154.be = phi i32 [ %.0154, %44 ], [ %.0154, %41 ], [ %.0154, %39 ], [ 1, %38 ], [ %.0154, %37 ], [ %.0154, %36 ], [ %.0154, %35 ], [ %.0154, %33 ], [ %.0154, %31 ], [ %.0154, %29 ], [ %.0154, %27 ], [ %.0154, %.preheader191 ]
  %.0152.be = phi i32 [ %.0152, %44 ], [ %.0152, %41 ], [ %.0152, %39 ], [ %.0152, %38 ], [ %.0152, %37 ], [ %.0152, %36 ], [ %.0152, %35 ], [ 1, %33 ], [ %.0152, %31 ], [ %.0152, %29 ], [ %.0152, %27 ], [ %.0152, %.preheader191 ]
  %.0150.be = phi double [ %.0150, %44 ], [ %43, %41 ], [ %.0150, %39 ], [ %.0150, %38 ], [ %.0150, %37 ], [ %.0150, %36 ], [ %.0150, %35 ], [ %.0150, %33 ], [ %.0150, %31 ], [ %.0150, %29 ], [ %.0150, %27 ], [ %.0150, %.preheader191 ]
  %.0147.be = phi i32 [ %.0147, %44 ], [ %.0147, %41 ], [ %.0147, %39 ], [ %.0147, %38 ], [ %.0147, %37 ], [ %.0147, %36 ], [ %.0147, %35 ], [ %.0147, %33 ], [ %.0147, %31 ], [ %.0147, %29 ], [ 1, %27 ], [ %.0147, %.preheader191 ]
  %.0137.be = phi ptr [ %.0137, %44 ], [ %.0137, %41 ], [ %.0137, %39 ], [ %.0137, %38 ], [ %.0137, %37 ], [ %.0137, %36 ], [ %.0137, %35 ], [ %34, %33 ], [ %.0137, %31 ], [ %.0137, %29 ], [ %.0137, %27 ], [ %.0137, %.preheader191 ]
  %.0128.be = phi ptr [ %.0128, %44 ], [ %.0128, %41 ], [ %40, %39 ], [ %.0128, %38 ], [ %.0128, %37 ], [ %.0128, %36 ], [ %.0128, %35 ], [ %.0128, %33 ], [ %.0128, %31 ], [ %.0128, %29 ], [ %.0128, %27 ], [ %.0128, %.preheader191 ]
  %.0126.be = phi ptr [ %.0126, %44 ], [ %.0126, %41 ], [ %.0126, %39 ], [ %.0126, %38 ], [ %.0126, %37 ], [ %.0126, %36 ], [ %.0126, %35 ], [ %.0126, %33 ], [ %32, %31 ], [ %.0126, %29 ], [ %.0126, %27 ], [ %.0126, %.preheader191 ]
  %.0124.be = phi ptr [ %.0124, %44 ], [ %.0124, %41 ], [ %.0124, %39 ], [ %.0124, %38 ], [ %.0124, %37 ], [ %.0124, %36 ], [ %.0124, %35 ], [ %.0124, %33 ], [ %.0124, %31 ], [ %30, %29 ], [ %.0124, %27 ], [ %.0124, %.preheader191 ]
  %.0122.be = phi ptr [ %.0122, %44 ], [ %.0122, %41 ], [ %.0122, %39 ], [ %.0122, %38 ], [ %.0122, %37 ], [ %.0122, %36 ], [ %.0122, %35 ], [ %.0122, %33 ], [ %.0122, %31 ], [ %.0122, %29 ], [ %28, %27 ], [ %.0122, %.preheader191 ]
  br label %.preheader191, !llvm.loop !5

27:                                               ; preds = %.preheader191
  %28 = load ptr, ptr @optarg, align 8, !tbaa !7
  br label %.preheader191.backedge

29:                                               ; preds = %.preheader191
  %30 = load ptr, ptr @optarg, align 8, !tbaa !7
  br label %.preheader191.backedge

31:                                               ; preds = %.preheader191
  %32 = load ptr, ptr @optarg, align 8, !tbaa !7
  br label %.preheader191.backedge

33:                                               ; preds = %.preheader191
  %34 = load ptr, ptr @optarg, align 8, !tbaa !7
  br label %.preheader191.backedge

35:                                               ; preds = %.preheader191
  br label %.preheader191.backedge

36:                                               ; preds = %.preheader191
  br label %.preheader191.backedge

37:                                               ; preds = %.preheader191
  br label %.preheader191.backedge

38:                                               ; preds = %.preheader191
  br label %.preheader191.backedge

39:                                               ; preds = %.preheader191
  %40 = load ptr, ptr @optarg, align 8, !tbaa !7
  br label %.preheader191.backedge

41:                                               ; preds = %.preheader191
  %42 = load ptr, ptr @optarg, align 8, !tbaa !7
  %43 = tail call double @atof(ptr noundef %42) #14
  br label %.preheader191.backedge

44:                                               ; preds = %.preheader191
  br label %.preheader191.backedge

45:                                               ; preds = %.preheader191
  %46 = tail call i32 @search_help(i32 noundef 0)
  br label %279

47:                                               ; preds = %.preheader191
  %48 = load i32, ptr @optopt, align 4
  switch i32 %48, label %52 [
    i32 117, label %49
    i32 114, label %49
    i32 113, label %49
    i32 105, label %49
    i32 102, label %49
  ]

49:                                               ; preds = %47, %47, %47, %47, %47
  %50 = load ptr, ptr @stderr, align 8, !tbaa !7
  %51 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef nonnull @.str.9, i32 noundef %48) #15
  br label %64

52:                                               ; preds = %47
  %53 = tail call ptr @__ctype_b_loc() #16
  %54 = load ptr, ptr %53, align 8, !tbaa !7
  %55 = sext i32 %48 to i64
  %56 = getelementptr inbounds i16, ptr %54, i64 %55
  %57 = load i16, ptr %56, align 2, !tbaa !11
  %58 = and i16 %57, 16384
  %.not187 = icmp eq i16 %58, 0
  %59 = load ptr, ptr @stderr, align 8, !tbaa !7
  br i1 %.not187, label %62, label %60

60:                                               ; preds = %52
  %61 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %59, ptr noundef nonnull @.str.10, i32 noundef %48) #15
  br label %64

62:                                               ; preds = %52
  %63 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %59, ptr noundef nonnull @.str.11, i32 noundef %48) #15
  br label %64

64:                                               ; preds = %60, %62, %49
  %65 = tail call i32 @search_help(i32 noundef 64)
  br label %279

66:                                               ; preds = %.preheader191
  %67 = tail call i32 @search_help(i32 noundef 0)
  br label %279

68:                                               ; preds = %.preheader191
  %69 = icmp eq i32 %.0147, 0
  br i1 %69, label %70, label %74

70:                                               ; preds = %68
  %71 = load ptr, ptr @stderr, align 8, !tbaa !7
  %72 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef nonnull @.str.12) #15
  %73 = tail call i32 @search_help(i32 noundef 64)
  br label %279

74:                                               ; preds = %68
  %.not443 = icmp eq i32 %.0171, 0
  br i1 %.not443, label %94, label %75

75:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #13
  store ptr null, ptr %4, align 8, !tbaa !7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #13
  store ptr null, ptr %5, align 8, !tbaa !7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #13
  store ptr null, ptr %6, align 8, !tbaa !7
  %76 = call i32 @giggle_get_indexed_files(ptr noundef %.0122, ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %6) #13
  %77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %.not = icmp eq i32 %76, 0
  br i1 %.not, label %._crit_edge261, label %.lr.ph260.preheader

.lr.ph260.preheader:                              ; preds = %75
  %wide.trip.count = zext i32 %76 to i64
  br label %.lr.ph260

.lr.ph260:                                        ; preds = %.lr.ph260.preheader, %.lr.ph260
  %indvars.iv = phi i64 [ 0, %.lr.ph260.preheader ], [ %indvars.iv.next, %.lr.ph260 ]
  %78 = load ptr, ptr %4, align 8, !tbaa !7
  %79 = getelementptr inbounds ptr, ptr %78, i64 %indvars.iv
  %80 = load ptr, ptr %79, align 8, !tbaa !7
  %81 = load ptr, ptr %5, align 8, !tbaa !7
  %82 = getelementptr inbounds i32, ptr %81, i64 %indvars.iv
  %83 = load i32, ptr %82, align 4, !tbaa !13
  %84 = load ptr, ptr %6, align 8, !tbaa !7
  %85 = getelementptr inbounds double, ptr %84, i64 %indvars.iv
  %86 = load double, ptr %85, align 8, !tbaa !15
  %87 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, ptr noundef %80, i32 noundef %83, double noundef %86)
  %88 = load ptr, ptr %4, align 8, !tbaa !7
  %89 = getelementptr inbounds ptr, ptr %88, i64 %indvars.iv
  %90 = load ptr, ptr %89, align 8, !tbaa !7
  call void @free(ptr noundef %90) #13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge261, label %.lr.ph260, !llvm.loop !17

._crit_edge261:                                   ; preds = %.lr.ph260, %75
  %91 = load ptr, ptr %4, align 8, !tbaa !7
  call void @free(ptr noundef %91) #13
  %92 = load ptr, ptr %5, align 8, !tbaa !7
  call void @free(ptr noundef %92) #13
  %93 = load ptr, ptr %6, align 8, !tbaa !7
  call void @free(ptr noundef %93) #13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #13
  br label %279

94:                                               ; preds = %74
  %95 = icmp ne i32 %.0162, 0
  %96 = icmp eq i32 %.0167, 0
  %or.cond9 = select i1 %95, i1 %96, i1 false
  br i1 %or.cond9, label %97, label %101

97:                                               ; preds = %94
  %98 = load ptr, ptr @stderr, align 8, !tbaa !7
  %99 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef nonnull @.str.15) #15
  %100 = tail call i32 @search_help(i32 noundef 64)
  br label %279

101:                                              ; preds = %94
  %102 = icmp eq i32 %.0169, 0
  %or.cond11 = select i1 %102, i1 %96, i1 false
  br i1 %or.cond11, label %103, label %107

103:                                              ; preds = %101
  %104 = load ptr, ptr @stderr, align 8, !tbaa !7
  %105 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef nonnull @.str.16) #15
  %106 = tail call i32 @search_help(i32 noundef 64)
  br label %279

107:                                              ; preds = %101
  %108 = icmp ne i32 %.0169, 0
  %109 = icmp ne i32 %.0167, 0
  %or.cond13 = select i1 %108, i1 %109, i1 false
  br i1 %or.cond13, label %110, label %114

110:                                              ; preds = %107
  %111 = load ptr, ptr @stderr, align 8, !tbaa !7
  %112 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %111, ptr noundef nonnull @.str.17) #15
  %113 = tail call i32 @search_help(i32 noundef 64)
  br label %279

114:                                              ; preds = %107
  %115 = icmp ne i32 %.0152, 0
  %116 = icmp eq i32 %.0154, 0
  %or.cond15 = select i1 %115, i1 %116, i1 false
  br i1 %or.cond15, label %117, label %121

117:                                              ; preds = %114
  %118 = load ptr, ptr @stderr, align 8, !tbaa !7
  %119 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %118, ptr noundef nonnull @.str.18) #15
  %120 = tail call i32 @search_help(i32 noundef 64)
  br label %279

121:                                              ; preds = %114
  %122 = icmp eq i32 %.0160, 0
  %123 = icmp eq i32 %.0162, 0
  %or.cond17 = select i1 %122, i1 %123, i1 false
  %spec.select = select i1 %or.cond17, i32 1, i32 %.0164
  %.not444 = icmp eq i32 %.0158, 0
  br i1 %.not444, label %175, label %124

124:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #13
  store i32 0, ptr %7, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #13
  store i32 0, ptr %8, align 4, !tbaa !13
  %125 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %.0128) #14
  %126 = trunc i64 %125 to i32
  %127 = call i32 @scan_s(ptr noundef %.0128, i32 noundef %126, ptr noundef nonnull %7, ptr noundef nonnull %8, i8 noundef signext 44) #13
  %128 = icmp sgt i32 %127, -1
  br i1 %128, label %.lr.ph, label %.thread

.lr.ph:                                           ; preds = %124, %.lr.ph
  %.0144244 = phi i32 [ %129, %.lr.ph ], [ 0, %124 ]
  %129 = add i32 %.0144244, 1
  %130 = load i32, ptr %8, align 4, !tbaa !13
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %7, align 4, !tbaa !13
  %132 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %.0128) #14
  %133 = trunc i64 %132 to i32
  %134 = call i32 @scan_s(ptr noundef %.0128, i32 noundef %133, ptr noundef nonnull %7, ptr noundef nonnull %8, i8 noundef signext 44) #13
  %135 = icmp sgt i32 %134, -1
  br i1 %135, label %.lr.ph, label %._crit_edge, !llvm.loop !18

._crit_edge:                                      ; preds = %.lr.ph
  %.not181 = icmp eq i32 %129, 0
  br i1 %.not181, label %.thread, label %139

.thread:                                          ; preds = %124, %._crit_edge
  %136 = load ptr, ptr @stderr, align 8, !tbaa !7
  %137 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %136, ptr noundef nonnull @.str.19) #15
  %138 = call i32 @search_help(i32 noundef 64)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #13
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #13
  br label %279

139:                                              ; preds = %._crit_edge
  %140 = zext i32 %129 to i64
  %141 = shl nuw nsw i64 %140, 6
  %142 = call noalias ptr @malloc(i64 noundef %141) #17
  %143 = icmp eq ptr %142, null
  br i1 %143, label %144, label %145

144:                                              ; preds = %139
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.20) #18
  unreachable

145:                                              ; preds = %139
  %146 = shl nuw nsw i64 %140, 3
  %147 = call noalias ptr @malloc(i64 noundef %146) #17
  %148 = icmp eq ptr %147, null
  br i1 %148, label %149, label %150

149:                                              ; preds = %145
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.20) #18
  unreachable

150:                                              ; preds = %145
  store i32 0, ptr %7, align 4, !tbaa !13
  store i32 0, ptr %8, align 4, !tbaa !13
  %151 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %.0128) #14
  %152 = trunc i64 %151 to i32
  %153 = call i32 @scan_s(ptr noundef %.0128, i32 noundef %152, ptr noundef nonnull %7, ptr noundef nonnull %8, i8 noundef signext 44) #13
  %154 = icmp sgt i32 %153, -1
  br i1 %154, label %.lr.ph248, label %._crit_edge249

.lr.ph248:                                        ; preds = %150, %167
  %.0139246 = phi i32 [ %168, %167 ], [ 0, %150 ]
  %155 = load i32, ptr %7, align 4, !tbaa !13
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds i8, ptr %.0128, i64 %156
  %158 = load i32, ptr %8, align 4, !tbaa !13
  %159 = sub nsw i32 %158, %155
  %160 = sext i32 %159 to i64
  %161 = call noalias ptr @strndup(ptr noundef %157, i64 noundef %160) #13
  %162 = zext i32 %.0139246 to i64
  %163 = getelementptr inbounds ptr, ptr %147, i64 %162
  store ptr %161, ptr %163, align 8, !tbaa !7
  %164 = getelementptr inbounds %struct.re_pattern_buffer, ptr %142, i64 %162
  %165 = call i32 @regcomp(ptr noundef nonnull %164, ptr noundef %161, i32 noundef 0) #13
  %.not180 = icmp eq i32 %165, 0
  br i1 %.not180, label %167, label %166

166:                                              ; preds = %.lr.ph248
  call void (i32, ptr, ...) @errx(i32 noundef 64, ptr noundef nonnull @.str.21, ptr noundef %161) #18
  unreachable

167:                                              ; preds = %.lr.ph248
  %168 = add i32 %.0139246, 1
  %169 = load i32, ptr %8, align 4, !tbaa !13
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %7, align 4, !tbaa !13
  %171 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %.0128) #14
  %172 = trunc i64 %171 to i32
  %173 = call i32 @scan_s(ptr noundef %.0128, i32 noundef %172, ptr noundef nonnull %7, ptr noundef nonnull %8, i8 noundef signext 44) #13
  %174 = icmp sgt i32 %173, -1
  br i1 %174, label %.lr.ph248, label %._crit_edge249, !llvm.loop !19

._crit_edge249:                                   ; preds = %167, %150
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #13
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #13
  br label %175

175:                                              ; preds = %._crit_edge249, %121
  %.1145 = phi i32 [ %129, %._crit_edge249 ], [ 0, %121 ]
  %.1143 = phi ptr [ %142, %._crit_edge249 ], [ null, %121 ]
  %.1141 = phi ptr [ %147, %._crit_edge249 ], [ null, %121 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #13
  %176 = call ptr @giggle_load_with_metadata(ptr noundef %.0122, i32 noundef %.0154, ptr noundef nonnull @block_store_giggle_set_data_handler) #13
  store ptr %176, ptr %9, align 8, !tbaa !7
  %177 = icmp eq ptr %176, null
  br i1 %177, label %178, label %179

178:                                              ; preds = %175
  call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef nonnull @.str.22, ptr noundef %.0122) #18
  unreachable

179:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #13
  store ptr null, ptr %10, align 8, !tbaa !7
  %.not182 = icmp eq ptr %.0137, null
  br i1 %.not182, label %184, label %180

180:                                              ; preds = %179
  %181 = getelementptr inbounds i8, ptr %176, i64 40
  %182 = load ptr, ptr %181, align 8, !tbaa !20
  %183 = call ptr @parse_query_filter_string(ptr noundef %182, ptr noundef nonnull %.0137) #13
  store ptr %183, ptr %10, align 8, !tbaa !7
  br label %184

184:                                              ; preds = %180, %179
  %185 = phi ptr [ %183, %180 ], [ null, %179 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #13
  store ptr null, ptr %11, align 8, !tbaa !7
  br i1 %108, label %186, label %215

186:                                              ; preds = %184
  %187 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %.0124) #14
  %188 = trunc i64 %187 to i32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #13
  br label %189

189:                                              ; preds = %186, %212
  %190 = phi ptr [ %185, %186 ], [ %213, %212 ]
  %.0130257 = phi i32 [ 0, %186 ], [ %.1131, %212 ]
  %.0132256 = phi i32 [ 0, %186 ], [ %.pre-phi, %212 ]
  %191 = zext i32 %.0132256 to i64
  %192 = getelementptr inbounds i8, ptr %.0124, i64 %191
  %193 = load i8, ptr %192, align 1, !tbaa !22
  switch i8 %193, label %._crit_edge325 [
    i8 44, label %194
    i8 0, label %194
  ]

._crit_edge325:                                   ; preds = %189
  %.pre326 = add i32 %.0132256, 1
  br label %212

194:                                              ; preds = %189, %189
  store i8 0, ptr %192, align 1, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #13
  %195 = zext i32 %.0130257 to i64
  %196 = getelementptr inbounds i8, ptr %.0124, i64 %195
  %197 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %15, ptr noundef nonnull @.str.23, ptr noundef %196) #13
  %198 = load ptr, ptr %15, align 8, !tbaa !7
  %199 = call i32 @parse_region(ptr noundef %198, ptr noundef nonnull %12, ptr noundef nonnull %13, ptr noundef nonnull %14) #13
  %200 = icmp eq i32 %199, 0
  br i1 %200, label %201, label %211

201:                                              ; preds = %194
  %202 = load ptr, ptr %9, align 8, !tbaa !7
  %203 = load ptr, ptr %12, align 8, !tbaa !7
  %204 = load i32, ptr %13, align 4, !tbaa !13
  %205 = load i32, ptr %14, align 4, !tbaa !13
  %206 = load ptr, ptr %10, align 8, !tbaa !7
  %207 = load ptr, ptr %11, align 8, !tbaa !7
  %208 = call ptr @giggle_query_with_query_filter(ptr noundef %202, ptr noundef %203, i32 noundef %204, i32 noundef %205, ptr noundef %206, ptr noundef %207) #13
  store ptr %208, ptr %11, align 8, !tbaa !7
  %209 = load ptr, ptr %15, align 8, !tbaa !7
  call void @free(ptr noundef %209) #13
  %210 = add i32 %.0132256, 1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #13
  br label %212

211:                                              ; preds = %194
  call void (i32, ptr, ...) @errx(i32 noundef 64, ptr noundef nonnull @.str.24, ptr noundef nonnull %196) #18
  unreachable

212:                                              ; preds = %._crit_edge325, %201
  %.pre-phi = phi i32 [ %.pre326, %._crit_edge325 ], [ %210, %201 ]
  %213 = phi ptr [ %190, %._crit_edge325 ], [ %206, %201 ]
  %.1131 = phi i32 [ %.0130257, %._crit_edge325 ], [ %210, %201 ]
  %.not185 = icmp ugt i32 %.pre-phi, %188
  br i1 %.not185, label %214, label %189, !llvm.loop !23

214:                                              ; preds = %212
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #13
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #13
  br label %270

215:                                              ; preds = %184
  br i1 %109, label %216, label %270

216:                                              ; preds = %215
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #13
  store i32 50, ptr %16, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #13
  %217 = call noalias dereferenceable_or_null(50) ptr @malloc(i64 noundef 50) #17
  store ptr %217, ptr %17, align 8, !tbaa !7
  %218 = icmp eq ptr %217, null
  br i1 %218, label %219, label %220

219:                                              ; preds = %216
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.20) #18
  unreachable

220:                                              ; preds = %216
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %19) #13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #13
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %21) #13
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %21, i8 0, i64 24, i1 false)
  %221 = call ptr @input_file_init(ptr noundef %.0126) #13
  %222 = icmp eq ptr %221, null
  br i1 %222, label %229, label %.preheader

.preheader:                                       ; preds = %220
  %223 = getelementptr inbounds i8, ptr %221, i64 64
  %224 = load ptr, ptr %223, align 8, !tbaa !24
  %225 = call i32 %224(ptr noundef nonnull %221, ptr noundef nonnull %17, ptr noundef nonnull %16, ptr noundef nonnull %18, ptr noundef nonnull %19, ptr noundef nonnull %20, ptr noundef nonnull %21) #13
  %226 = icmp sgt i32 %225, -1
  br i1 %226, label %.lr.ph252, label %._crit_edge253

.lr.ph252:                                        ; preds = %.preheader
  %.not445 = icmp eq i32 %.0156, 0
  %227 = getelementptr inbounds i8, ptr %221, i64 56
  %228 = fptosi double %.0150 to i64
  %.pre = load ptr, ptr %9, align 8, !tbaa !7
  br label %230

229:                                              ; preds = %220
  call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef nonnull @.str.25, ptr noundef %.0126) #18
  unreachable

230:                                              ; preds = %.lr.ph252, %252
  %231 = phi ptr [ %.pre, %.lr.ph252 ], [ %253, %252 ]
  %.0133251 = phi double [ 0.000000e+00, %.lr.ph252 ], [ %259, %252 ]
  %.0135250 = phi i32 [ 0, %.lr.ph252 ], [ %254, %252 ]
  %232 = load ptr, ptr %17, align 8, !tbaa !7
  %233 = load i32, ptr %18, align 4, !tbaa !13
  %234 = load i32, ptr %19, align 4, !tbaa !13
  %235 = load ptr, ptr %10, align 8, !tbaa !7
  %236 = load ptr, ptr %11, align 8, !tbaa !7
  %237 = call ptr @giggle_query_with_query_filter(ptr noundef %231, ptr noundef %232, i32 noundef %233, i32 noundef %234, ptr noundef %235, ptr noundef %236) #13
  store ptr %237, ptr %11, align 8, !tbaa !7
  br i1 %.not445, label %252, label %238

238:                                              ; preds = %230
  %239 = getelementptr inbounds i8, ptr %237, i64 24
  %240 = load i32, ptr %239, align 8, !tbaa !27
  %.not184 = icmp eq i32 %240, 0
  br i1 %.not184, label %252, label %241

241:                                              ; preds = %238
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #13
  call void @input_file_get_curr_line_bgzf(ptr noundef nonnull %221, ptr noundef nonnull %22) #13
  %242 = load ptr, ptr %22, align 8, !tbaa !7
  %243 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.26, ptr noundef %242)
  %244 = load i32, ptr %227, align 8, !tbaa !29
  %245 = icmp eq i32 %244, 0
  br i1 %245, label %246, label %248

246:                                              ; preds = %241
  %247 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27)
  br label %248

248:                                              ; preds = %246, %241
  %249 = load ptr, ptr %11, align 8, !tbaa !7
  %250 = load ptr, ptr %9, align 8, !tbaa !7
  %251 = call i32 @print_giggle_query_result(ptr noundef %249, ptr noundef %250, ptr noundef %.1143, ptr noundef %.1141, i32 noundef %.1145, i32 noundef %.0135250, double noundef %.0133251, i64 noundef %228, i32 noundef %.0158, i32 noundef %.0160, i32 noundef %spec.select, i32 noundef %.0162, i32 noundef 1)
  call void @giggle_query_result_destroy(ptr noundef nonnull %11) #13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #13
  br label %252

252:                                              ; preds = %248, %238, %230
  %253 = phi ptr [ %250, %248 ], [ %231, %238 ], [ %231, %230 ]
  %254 = add i32 %.0135250, 1
  %255 = load i32, ptr %19, align 4, !tbaa !13
  %256 = load i32, ptr %18, align 4, !tbaa !13
  %257 = sub i32 %255, %256
  %258 = uitofp i32 %257 to double
  %259 = fadd double %.0133251, %258
  %260 = load ptr, ptr %223, align 8, !tbaa !24
  %261 = call i32 %260(ptr noundef nonnull %221, ptr noundef nonnull %17, ptr noundef nonnull %16, ptr noundef nonnull %18, ptr noundef nonnull %19, ptr noundef nonnull %20, ptr noundef nonnull %21) #13
  %262 = icmp sgt i32 %261, -1
  br i1 %262, label %230, label %._crit_edge253, !llvm.loop !30

._crit_edge253:                                   ; preds = %252, %.preheader
  %.0135.lcssa = phi i32 [ 0, %.preheader ], [ %254, %252 ]
  %.0133.lcssa = phi double [ 0.000000e+00, %.preheader ], [ %259, %252 ]
  %263 = load ptr, ptr %17, align 8, !tbaa !7
  call void @free(ptr noundef %263) #13
  %264 = getelementptr inbounds i8, ptr %21, i64 16
  %265 = load ptr, ptr %264, align 8, !tbaa !31
  %.not183 = icmp eq ptr %265, null
  br i1 %.not183, label %267, label %266

266:                                              ; preds = %._crit_edge253
  call void @free(ptr noundef nonnull %265) #13
  br label %267

267:                                              ; preds = %266, %._crit_edge253
  %268 = uitofp i32 %.0135.lcssa to double
  %269 = fdiv double %.0133.lcssa, %268
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %21) #13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #13
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %19) #13
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #13
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #13
  %.pre324 = load ptr, ptr %10, align 8, !tbaa !7
  br label %270

270:                                              ; preds = %215, %267, %214
  %271 = phi ptr [ %213, %214 ], [ %.pre324, %267 ], [ %185, %215 ]
  %.1136 = phi i32 [ 0, %214 ], [ %.0135.lcssa, %267 ], [ 0, %215 ]
  %.1134 = phi double [ 0.000000e+00, %214 ], [ %269, %267 ], [ 0.000000e+00, %215 ]
  %272 = load ptr, ptr %11, align 8, !tbaa !7
  %273 = load ptr, ptr %9, align 8, !tbaa !7
  %274 = fptosi double %.0150 to i64
  %275 = call i32 @print_giggle_query_result(ptr noundef %272, ptr noundef %273, ptr noundef %.1143, ptr noundef %.1141, i32 noundef %.1145, i32 noundef %.1136, double noundef %.1134, i64 noundef %274, i32 noundef %.0158, i32 noundef %.0160, i32 noundef %spec.select, i32 noundef %.0162, i32 noundef %.0156)
  call void @giggle_query_result_destroy(ptr noundef nonnull %11) #13
  %.not186 = icmp eq ptr %271, null
  br i1 %.not186, label %277, label %276

276:                                              ; preds = %270
  call void @query_filter_destroy(ptr noundef nonnull %10) #13
  br label %277

277:                                              ; preds = %276, %270
  call void @giggle_index_destroy(ptr noundef nonnull %9) #13
  %278 = load ptr, ptr getelementptr inbounds (i8, ptr @cache, i64 48), align 8, !tbaa !33
  call void (...) %278() #13
  call void @free(ptr noundef %2) #13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #13
  br label %279

279:                                              ; preds = %.thread, %45, %64, %66, %70, %._crit_edge261, %97, %103, %110, %117, %277, %24
  %.3 = phi i32 [ %25, %24 ], [ %67, %66 ], [ %65, %64 ], [ %46, %45 ], [ %73, %70 ], [ 0, %._crit_edge261 ], [ %100, %97 ], [ %106, %103 ], [ %113, %110 ], [ %120, %117 ], [ %275, %277 ], [ %138, %.thread ]
  ret i32 %.3
}

; Function Attrs: nounwind
declare i32 @getopt(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare double @atof(ptr nocapture noundef nonnull) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_b_loc() local_unnamed_addr #5

declare i32 @giggle_get_indexed_files(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

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

declare i32 @scan_s(ptr noundef, i32 noundef, ptr noundef, ptr noundef, i8 noundef signext) local_unnamed_addr #6

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias ptr @strndup(ptr nocapture noundef readonly, i64 noundef) local_unnamed_addr #11

declare i32 @regcomp(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #6

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

declare ptr @giggle_load_with_metadata(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

declare void @block_store_giggle_set_data_handler(...) #6

declare ptr @parse_query_filter_string(ptr noundef, ptr noundef) local_unnamed_addr #6

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

declare i32 @parse_region(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

declare ptr @giggle_query_with_query_filter(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

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

declare ptr @input_file_init(ptr noundef) local_unnamed_addr #6

declare void @input_file_get_curr_line_bgzf(ptr noundef, ptr noundef) local_unnamed_addr #6

declare void @giggle_query_result_destroy(ptr noundef) local_unnamed_addr #6

declare void @query_filter_destroy(ptr noundef) local_unnamed_addr #6

declare void @giggle_index_destroy(ptr noundef) local_unnamed_addr #6

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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 = { "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 = { 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 #8 = { 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 #9 = { 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 #10 = { noreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { mustprogress nofree nounwind willreturn 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 #12 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #13 = { nounwind }
attributes #14 = { nounwind willreturn memory(read) }
attributes #15 = { cold nounwind }
attributes #16 = { nounwind willreturn memory(none) }
attributes #17 = { nounwind allocsize(0) }
attributes #18 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!12, !12, i64 0}
!12 = !{!"short", !9, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !9, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !9, i64 0}
!17 = distinct !{!17, !6}
!18 = distinct !{!18, !6}
!19 = distinct !{!19, !6}
!20 = !{!21, !8, i64 40}
!21 = !{!"giggle_index", !8, i64 0, !14, i64 8, !14, i64 12, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !8, i64 48, !8, i64 56}
!22 = !{!9, !9, i64 0}
!23 = distinct !{!23, !6}
!24 = !{!25, !8, i64 64}
!25 = !{!"input_file", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !26, i64 48, !14, i64 56, !8, i64 64, !8, i64 72, !8, i64 80}
!26 = !{!"long", !9, i64 0}
!27 = !{!28, !14, i64 24}
!28 = !{!"giggle_query_result", !8, i64 0, !14, i64 8, !8, i64 16, !14, i64 24}
!29 = !{!25, !14, i64 56}
!30 = distinct !{!30, !6}
!31 = !{!32, !8, i64 16}
!32 = !{!"__kstring_t", !26, i64 0, !26, i64 8, !8, i64 16}
!33 = !{!34, !8, i64 48}
!34 = !{!"cache_def", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !8, i64 48}


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