; LLVM IR from themisvaltinos/Partitioned-Hash-Join :: tests (test_optimizer)

; 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.query = type { i32, i32, i32, i32, [16 x %struct.join_predicate], [16 x %struct.filter_predicate], [16 x %struct.column] }
%struct.join_predicate = type { %struct.column, %struct.column }
%struct.column = type { i32, i32, i32 }
%struct.filter_predicate = type { %struct.column, i32, i32 }
%struct.relation = type { ptr, i64, i64 }

@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@num_relations = external dso_local global i32, align 4
@.str.36 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [30 x i8], align 1
@l2size = external dso_local global i32, align 4
@__PRETTY_FUNCTION__.testOptimizeQuery = external hidden unnamed_addr constant [29 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.74 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.75 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.76 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.77 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.78 = external hidden unnamed_addr constant [33 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @acutest_check_(i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) #0

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

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

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

; Function Attrs: noreturn nounwind uwtable
declare dso_local void @acutest_abort_() #3

declare i32 @fclose(ptr noundef) #4

declare ptr @loadRelation(ptr noundef) #4

declare ptr @gatherStatistics(ptr noundef) #4

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #4

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #6

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #7

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #5

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

declare void @destroyStats(ptr noundef, i32 noundef) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #7

; Function Attrs: nounwind uwtable
define dso_local void @testOptimizeQuery() #0 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca [128 x i8], align 16
  %6 = alloca [1024 x i8], align 16
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = call i32 @getL2CacheSize()
  store i32 %13, ptr @l2size, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #8
  %14 = call noalias ptr @fopen(ptr noundef @.str.51, ptr noundef @.str.52)
  store ptr %14, ptr %1, align 8, !tbaa !9
  %15 = load ptr, ptr %1, align 8, !tbaa !9
  %16 = icmp ne ptr %15, null
  br i1 %16, label %17, label %18

17:                                               ; preds = %0
  br label %19

18:                                               ; preds = %0
  call void @__assert_fail(ptr noundef @.str.53, ptr noundef @.str.36, i32 noundef 147, ptr noundef @__PRETTY_FUNCTION__.testOptimizeQuery) #9
  unreachable

19:                                               ; preds = %17
  %20 = load i32, ptr @num_relations, align 4, !tbaa !5
  %21 = zext i32 %20 to i64
  %22 = call ptr @llvm.stacksave.p0()
  store ptr %22, ptr %2, align 8
  %23 = alloca ptr, i64 %21, align 16
  store i64 %21, ptr %3, align 8
  %24 = load i32, ptr @num_relations, align 4, !tbaa !5
  %25 = zext i32 %24 to i64
  %26 = alloca ptr, i64 %25, align 16
  store i64 %25, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 128, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 1024, ptr %6) #8
  %27 = getelementptr inbounds [128 x i8], ptr %5, i64 0, i64 0
  %28 = call ptr @strcpy(ptr noundef %27, ptr noundef @.str.54) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %29 = getelementptr inbounds [128 x i8], ptr %5, i64 0, i64 0
  %30 = getelementptr inbounds [128 x i8], ptr %5, i64 0, i64 0
  %31 = call i64 @strlen(ptr noundef %30) #10
  %32 = getelementptr inbounds i8, ptr %29, i64 %31
  store ptr %32, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %67, %19
  %34 = getelementptr inbounds [1024 x i8], ptr %6, i64 0, i64 0
  %35 = load ptr, ptr %1, align 8, !tbaa !9
  %36 = call ptr @fgets(ptr noundef %34, i32 noundef 1024, ptr noundef %35)
  %37 = icmp ne ptr %36, null
  br i1 %37, label %39, label %38

38:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %68

39:                                               ; preds = %33
  %40 = getelementptr inbounds [1024 x i8], ptr %6, i64 0, i64 0
  %41 = call i64 @strlen(ptr noundef %40) #10
  %42 = sub i64 %41, 1
  %43 = getelementptr inbounds [1024 x i8], ptr %6, i64 0, i64 %42
  store i8 0, ptr %43, align 1, !tbaa !11
  %44 = getelementptr inbounds [1024 x i8], ptr %6, i64 0, i64 0
  %45 = call i64 @strlen(ptr noundef %44) #10
  %46 = icmp ugt i64 %45, 0
  br i1 %46, label %47, label %67

47:                                               ; preds = %39
  %48 = load ptr, ptr %7, align 8, !tbaa !9
  %49 = getelementptr inbounds [1024 x i8], ptr %6, i64 0, i64 0
  %50 = call ptr @strcpy(ptr noundef %48, ptr noundef %49) #8
  %51 = getelementptr inbounds [128 x i8], ptr %5, i64 0, i64 0
  %52 = call ptr @loadRelation(ptr noundef %51)
  %53 = load i32, ptr %8, align 4, !tbaa !5
  %54 = add i32 %53, 1
  store i32 %54, ptr %8, align 4, !tbaa !5
  %55 = zext i32 %53 to i64
  %56 = getelementptr inbounds ptr, ptr %23, i64 %55
  store ptr %52, ptr %56, align 8, !tbaa !9
  %57 = load i32, ptr %8, align 4, !tbaa !5
  %58 = sub i32 %57, 1
  %59 = zext i32 %58 to i64
  %60 = getelementptr inbounds ptr, ptr %23, i64 %59
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  %62 = call ptr @gatherStatistics(ptr noundef %61)
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = sub i32 %63, 1
  %65 = zext i32 %64 to i64
  %66 = getelementptr inbounds ptr, ptr %26, i64 %65
  store ptr %62, ptr %66, align 8, !tbaa !9
  br label %67

67:                                               ; preds = %47, %39
  br label %33, !llvm.loop !12

68:                                               ; preds = %38
  %69 = load ptr, ptr %1, align 8, !tbaa !9
  %70 = call i32 @fclose(ptr noundef %69)
  %71 = call noalias ptr @fopen(ptr noundef @.str.70, ptr noundef @.str.52)
  store ptr %71, ptr %1, align 8, !tbaa !9
  %72 = load ptr, ptr %1, align 8, !tbaa !9
  %73 = icmp ne ptr %72, null
  br i1 %73, label %74, label %75

74:                                               ; preds = %68
  br label %76

75:                                               ; preds = %68
  call void @__assert_fail(ptr noundef @.str.53, ptr noundef @.str.36, i32 noundef 171, ptr noundef @__PRETTY_FUNCTION__.testOptimizeQuery) #9
  unreachable

76:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %77 = load ptr, ptr %1, align 8, !tbaa !9
  %78 = call i32 @fgetc(ptr noundef %77)
  store i32 %78, ptr %10, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %320, %76
  %80 = load i32, ptr %10, align 4, !tbaa !5
  %81 = icmp ne i32 %80, -1
  br i1 %81, label %83, label %82

82:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %323

83:                                               ; preds = %79
  %84 = load i32, ptr %10, align 4, !tbaa !5
  %85 = load ptr, ptr %1, align 8, !tbaa !9
  %86 = call i32 @ungetc(i32 noundef %84, ptr noundef %85)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %87 = load ptr, ptr %1, align 8, !tbaa !9
  %88 = call ptr @parseQuery(ptr noundef %87)
  store ptr %88, ptr %11, align 8, !tbaa !9
  %89 = load ptr, ptr %11, align 8, !tbaa !9
  %90 = load i32, ptr @num_relations, align 4, !tbaa !5
  call void @optimizeQuery(ptr noundef %89, ptr noundef %26, i32 noundef %90, i1 noundef zeroext false)
  %91 = load i32, ptr %9, align 4, !tbaa !5
  %92 = icmp eq i32 %91, 0
  br i1 %92, label %93, label %124

93:                                               ; preds = %83
  br label %94

94:                                               ; preds = %93
  %95 = load ptr, ptr %11, align 8, !tbaa !9
  %96 = getelementptr inbounds %struct.query, ptr %95, i32 0, i32 4
  %97 = getelementptr inbounds [16 x %struct.join_predicate], ptr %96, i64 0, i64 0
  %98 = getelementptr inbounds %struct.join_predicate, ptr %97, i32 0, i32 1
  %99 = getelementptr inbounds %struct.column, ptr %98, i32 0, i32 1
  %100 = load i32, ptr %99, align 4, !tbaa !14
  %101 = icmp eq i32 %100, 2
  %102 = zext i1 %101 to i32
  %103 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %102, ptr noundef @.str.36, i32 noundef 185, ptr noundef @.str.5, ptr noundef @.str.71)
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %106, label %105

105:                                              ; preds = %94
  call void @acutest_abort_() #11
  unreachable

106:                                              ; preds = %94
  br label %107

107:                                              ; preds = %106
  br label %108

108:                                              ; preds = %107
  br label %109

109:                                              ; preds = %108
  %110 = load ptr, ptr %11, align 8, !tbaa !9
  %111 = getelementptr inbounds %struct.query, ptr %110, i32 0, i32 4
  %112 = getelementptr inbounds [16 x %struct.join_predicate], ptr %111, i64 0, i64 0
  %113 = getelementptr inbounds %struct.join_predicate, ptr %112, i32 0, i32 1
  %114 = getelementptr inbounds %struct.column, ptr %113, i32 0, i32 2
  %115 = load i32, ptr %114, align 4, !tbaa !17
  %116 = icmp eq i32 %115, 1
  %117 = zext i1 %116 to i32
  %118 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %117, ptr noundef @.str.36, i32 noundef 186, ptr noundef @.str.5, ptr noundef @.str.72)
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %121, label %120

120:                                              ; preds = %109
  call void @acutest_abort_() #11
  unreachable

121:                                              ; preds = %109
  br label %122

122:                                              ; preds = %121
  br label %123

123:                                              ; preds = %122
  br label %124

124:                                              ; preds = %123, %83
  %125 = load i32, ptr %9, align 4, !tbaa !5
  %126 = icmp eq i32 %125, 1
  br i1 %126, label %127, label %188

127:                                              ; preds = %124
  br label %128

128:                                              ; preds = %127
  %129 = load ptr, ptr %11, align 8, !tbaa !9
  %130 = getelementptr inbounds %struct.query, ptr %129, i32 0, i32 4
  %131 = getelementptr inbounds [16 x %struct.join_predicate], ptr %130, i64 0, i64 0
  %132 = getelementptr inbounds %struct.join_predicate, ptr %131, i32 0, i32 1
  %133 = getelementptr inbounds %struct.column, ptr %132, i32 0, i32 1
  %134 = load i32, ptr %133, align 4, !tbaa !14
  %135 = icmp eq i32 %134, 1
  %136 = zext i1 %135 to i32
  %137 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %136, ptr noundef @.str.36, i32 noundef 191, ptr noundef @.str.5, ptr noundef @.str.73)
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %140, label %139

139:                                              ; preds = %128
  call void @acutest_abort_() #11
  unreachable

140:                                              ; preds = %128
  br label %141

141:                                              ; preds = %140
  br label %142

142:                                              ; preds = %141
  br label %143

143:                                              ; preds = %142
  %144 = load ptr, ptr %11, align 8, !tbaa !9
  %145 = getelementptr inbounds %struct.query, ptr %144, i32 0, i32 4
  %146 = getelementptr inbounds [16 x %struct.join_predicate], ptr %145, i64 0, i64 0
  %147 = getelementptr inbounds %struct.join_predicate, ptr %146, i32 0, i32 1
  %148 = getelementptr inbounds %struct.column, ptr %147, i32 0, i32 2
  %149 = load i32, ptr %148, align 4, !tbaa !17
  %150 = icmp eq i32 %149, 2
  %151 = zext i1 %150 to i32
  %152 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %151, ptr noundef @.str.36, i32 noundef 192, ptr noundef @.str.5, ptr noundef @.str.74)
  %153 = icmp ne i32 %152, 0
  br i1 %153, label %155, label %154

154:                                              ; preds = %143
  call void @acutest_abort_() #11
  unreachable

155:                                              ; preds = %143
  br label %156

156:                                              ; preds = %155
  br label %157

157:                                              ; preds = %156
  br label %158

158:                                              ; preds = %157
  %159 = load ptr, ptr %11, align 8, !tbaa !9
  %160 = getelementptr inbounds %struct.query, ptr %159, i32 0, i32 4
  %161 = getelementptr inbounds [16 x %struct.join_predicate], ptr %160, i64 0, i64 1
  %162 = getelementptr inbounds %struct.join_predicate, ptr %161, i32 0, i32 1
  %163 = getelementptr inbounds %struct.column, ptr %162, i32 0, i32 1
  %164 = load i32, ptr %163, align 4, !tbaa !14
  %165 = icmp eq i32 %164, 0
  %166 = zext i1 %165 to i32
  %167 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %166, ptr noundef @.str.36, i32 noundef 193, ptr noundef @.str.5, ptr noundef @.str.75)
  %168 = icmp ne i32 %167, 0
  br i1 %168, label %170, label %169

169:                                              ; preds = %158
  call void @acutest_abort_() #11
  unreachable

170:                                              ; preds = %158
  br label %171

171:                                              ; preds = %170
  br label %172

172:                                              ; preds = %171
  br label %173

173:                                              ; preds = %172
  %174 = load ptr, ptr %11, align 8, !tbaa !9
  %175 = getelementptr inbounds %struct.query, ptr %174, i32 0, i32 4
  %176 = getelementptr inbounds [16 x %struct.join_predicate], ptr %175, i64 0, i64 1
  %177 = getelementptr inbounds %struct.join_predicate, ptr %176, i32 0, i32 1
  %178 = getelementptr inbounds %struct.column, ptr %177, i32 0, i32 2
  %179 = load i32, ptr %178, align 4, !tbaa !17
  %180 = icmp eq i32 %179, 0
  %181 = zext i1 %180 to i32
  %182 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %181, ptr noundef @.str.36, i32 noundef 194, ptr noundef @.str.5, ptr noundef @.str.76)
  %183 = icmp ne i32 %182, 0
  br i1 %183, label %185, label %184

184:                                              ; preds = %173
  call void @acutest_abort_() #11
  unreachable

185:                                              ; preds = %173
  br label %186

186:                                              ; preds = %185
  br label %187

187:                                              ; preds = %186
  br label %188

188:                                              ; preds = %187, %124
  %189 = load i32, ptr %9, align 4, !tbaa !5
  %190 = icmp eq i32 %189, 5
  br i1 %190, label %191, label %252

191:                                              ; preds = %188
  br label %192

192:                                              ; preds = %191
  %193 = load ptr, ptr %11, align 8, !tbaa !9
  %194 = getelementptr inbounds %struct.query, ptr %193, i32 0, i32 4
  %195 = getelementptr inbounds [16 x %struct.join_predicate], ptr %194, i64 0, i64 0
  %196 = getelementptr inbounds %struct.join_predicate, ptr %195, i32 0, i32 1
  %197 = getelementptr inbounds %struct.column, ptr %196, i32 0, i32 1
  %198 = load i32, ptr %197, align 4, !tbaa !14
  %199 = icmp eq i32 %198, 2
  %200 = zext i1 %199 to i32
  %201 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %200, ptr noundef @.str.36, i32 noundef 199, ptr noundef @.str.5, ptr noundef @.str.71)
  %202 = icmp ne i32 %201, 0
  br i1 %202, label %204, label %203

203:                                              ; preds = %192
  call void @acutest_abort_() #11
  unreachable

204:                                              ; preds = %192
  br label %205

205:                                              ; preds = %204
  br label %206

206:                                              ; preds = %205
  br label %207

207:                                              ; preds = %206
  %208 = load ptr, ptr %11, align 8, !tbaa !9
  %209 = getelementptr inbounds %struct.query, ptr %208, i32 0, i32 4
  %210 = getelementptr inbounds [16 x %struct.join_predicate], ptr %209, i64 0, i64 0
  %211 = getelementptr inbounds %struct.join_predicate, ptr %210, i32 0, i32 1
  %212 = getelementptr inbounds %struct.column, ptr %211, i32 0, i32 2
  %213 = load i32, ptr %212, align 4, !tbaa !17
  %214 = icmp eq i32 %213, 1
  %215 = zext i1 %214 to i32
  %216 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %215, ptr noundef @.str.36, i32 noundef 200, ptr noundef @.str.5, ptr noundef @.str.72)
  %217 = icmp ne i32 %216, 0
  br i1 %217, label %219, label %218

218:                                              ; preds = %207
  call void @acutest_abort_() #11
  unreachable

219:                                              ; preds = %207
  br label %220

220:                                              ; preds = %219
  br label %221

221:                                              ; preds = %220
  br label %222

222:                                              ; preds = %221
  %223 = load ptr, ptr %11, align 8, !tbaa !9
  %224 = getelementptr inbounds %struct.query, ptr %223, i32 0, i32 4
  %225 = getelementptr inbounds [16 x %struct.join_predicate], ptr %224, i64 0, i64 1
  %226 = getelementptr inbounds %struct.join_predicate, ptr %225, i32 0, i32 1
  %227 = getelementptr inbounds %struct.column, ptr %226, i32 0, i32 1
  %228 = load i32, ptr %227, align 4, !tbaa !14
  %229 = icmp eq i32 %228, 1
  %230 = zext i1 %229 to i32
  %231 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %230, ptr noundef @.str.36, i32 noundef 201, ptr noundef @.str.5, ptr noundef @.str.77)
  %232 = icmp ne i32 %231, 0
  br i1 %232, label %234, label %233

233:                                              ; preds = %222
  call void @acutest_abort_() #11
  unreachable

234:                                              ; preds = %222
  br label %235

235:                                              ; preds = %234
  br label %236

236:                                              ; preds = %235
  br label %237

237:                                              ; preds = %236
  %238 = load ptr, ptr %11, align 8, !tbaa !9
  %239 = getelementptr inbounds %struct.query, ptr %238, i32 0, i32 4
  %240 = getelementptr inbounds [16 x %struct.join_predicate], ptr %239, i64 0, i64 1
  %241 = getelementptr inbounds %struct.join_predicate, ptr %240, i32 0, i32 1
  %242 = getelementptr inbounds %struct.column, ptr %241, i32 0, i32 2
  %243 = load i32, ptr %242, align 4, !tbaa !17
  %244 = icmp eq i32 %243, 0
  %245 = zext i1 %244 to i32
  %246 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %245, ptr noundef @.str.36, i32 noundef 202, ptr noundef @.str.5, ptr noundef @.str.76)
  %247 = icmp ne i32 %246, 0
  br i1 %247, label %249, label %248

248:                                              ; preds = %237
  call void @acutest_abort_() #11
  unreachable

249:                                              ; preds = %237
  br label %250

250:                                              ; preds = %249
  br label %251

251:                                              ; preds = %250
  br label %252

252:                                              ; preds = %251, %188
  %253 = load i32, ptr %9, align 4, !tbaa !5
  %254 = icmp eq i32 %253, 11
  br i1 %254, label %255, label %316

255:                                              ; preds = %252
  br label %256

256:                                              ; preds = %255
  %257 = load ptr, ptr %11, align 8, !tbaa !9
  %258 = getelementptr inbounds %struct.query, ptr %257, i32 0, i32 4
  %259 = getelementptr inbounds [16 x %struct.join_predicate], ptr %258, i64 0, i64 0
  %260 = getelementptr inbounds %struct.join_predicate, ptr %259, i32 0, i32 1
  %261 = getelementptr inbounds %struct.column, ptr %260, i32 0, i32 1
  %262 = load i32, ptr %261, align 4, !tbaa !14
  %263 = icmp eq i32 %262, 3
  %264 = zext i1 %263 to i32
  %265 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %264, ptr noundef @.str.36, i32 noundef 207, ptr noundef @.str.5, ptr noundef @.str.78)
  %266 = icmp ne i32 %265, 0
  br i1 %266, label %268, label %267

267:                                              ; preds = %256
  call void @acutest_abort_() #11
  unreachable

268:                                              ; preds = %256
  br label %269

269:                                              ; preds = %268
  br label %270

270:                                              ; preds = %269
  br label %271

271:                                              ; preds = %270
  %272 = load ptr, ptr %11, align 8, !tbaa !9
  %273 = getelementptr inbounds %struct.query, ptr %272, i32 0, i32 4
  %274 = getelementptr inbounds [16 x %struct.join_predicate], ptr %273, i64 0, i64 0
  %275 = getelementptr inbounds %struct.join_predicate, ptr %274, i32 0, i32 1
  %276 = getelementptr inbounds %struct.column, ptr %275, i32 0, i32 2
  %277 = load i32, ptr %276, align 4, !tbaa !17
  %278 = icmp eq i32 %277, 1
  %279 = zext i1 %278 to i32
  %280 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %279, ptr noundef @.str.36, i32 noundef 208, ptr noundef @.str.5, ptr noundef @.str.72)
  %281 = icmp ne i32 %280, 0
  br i1 %281, label %283, label %282

282:                                              ; preds = %271
  call void @acutest_abort_() #11
  unreachable

283:                                              ; preds = %271
  br label %284

284:                                              ; preds = %283
  br label %285

285:                                              ; preds = %284
  br label %286

286:                                              ; preds = %285
  %287 = load ptr, ptr %11, align 8, !tbaa !9
  %288 = getelementptr inbounds %struct.query, ptr %287, i32 0, i32 4
  %289 = getelementptr inbounds [16 x %struct.join_predicate], ptr %288, i64 0, i64 1
  %290 = getelementptr inbounds %struct.join_predicate, ptr %289, i32 0, i32 1
  %291 = getelementptr inbounds %struct.column, ptr %290, i32 0, i32 1
  %292 = load i32, ptr %291, align 4, !tbaa !14
  %293 = icmp eq i32 %292, 1
  %294 = zext i1 %293 to i32
  %295 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %294, ptr noundef @.str.36, i32 noundef 209, ptr noundef @.str.5, ptr noundef @.str.77)
  %296 = icmp ne i32 %295, 0
  br i1 %296, label %298, label %297

297:                                              ; preds = %286
  call void @acutest_abort_() #11
  unreachable

298:                                              ; preds = %286
  br label %299

299:                                              ; preds = %298
  br label %300

300:                                              ; preds = %299
  br label %301

301:                                              ; preds = %300
  %302 = load ptr, ptr %11, align 8, !tbaa !9
  %303 = getelementptr inbounds %struct.query, ptr %302, i32 0, i32 4
  %304 = getelementptr inbounds [16 x %struct.join_predicate], ptr %303, i64 0, i64 1
  %305 = getelementptr inbounds %struct.join_predicate, ptr %304, i32 0, i32 1
  %306 = getelementptr inbounds %struct.column, ptr %305, i32 0, i32 2
  %307 = load i32, ptr %306, align 4, !tbaa !17
  %308 = icmp eq i32 %307, 0
  %309 = zext i1 %308 to i32
  %310 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %309, ptr noundef @.str.36, i32 noundef 210, ptr noundef @.str.5, ptr noundef @.str.76)
  %311 = icmp ne i32 %310, 0
  br i1 %311, label %313, label %312

312:                                              ; preds = %301
  call void @acutest_abort_() #11
  unreachable

313:                                              ; preds = %301
  br label %314

314:                                              ; preds = %313
  br label %315

315:                                              ; preds = %314
  br label %316

316:                                              ; preds = %315, %252
  %317 = load ptr, ptr %11, align 8, !tbaa !9
  call void @free(ptr noundef %317) #8
  %318 = load i32, ptr %9, align 4, !tbaa !5
  %319 = add nsw i32 %318, 1
  store i32 %319, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %320

320:                                              ; preds = %316
  %321 = load ptr, ptr %1, align 8, !tbaa !9
  %322 = call i32 @fgetc(ptr noundef %321)
  store i32 %322, ptr %10, align 4, !tbaa !5
  br label %79, !llvm.loop !18

323:                                              ; preds = %82
  %324 = load ptr, ptr %1, align 8, !tbaa !9
  %325 = call i32 @fclose(ptr noundef %324)
  %326 = load i32, ptr @num_relations, align 4, !tbaa !5
  call void @destroyStats(ptr noundef %26, i32 noundef %326)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %327

327:                                              ; preds = %350, %323
  %328 = load i32, ptr %12, align 4, !tbaa !5
  %329 = load i32, ptr @num_relations, align 4, !tbaa !5
  %330 = icmp ult i32 %328, %329
  br i1 %330, label %332, label %331

331:                                              ; preds = %327
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %353

332:                                              ; preds = %327
  %333 = load i32, ptr %12, align 4, !tbaa !5
  %334 = zext i32 %333 to i64
  %335 = getelementptr inbounds ptr, ptr %23, i64 %334
  %336 = load ptr, ptr %335, align 8, !tbaa !9
  %337 = icmp ne ptr %336, null
  br i1 %337, label %338, label %349

338:                                              ; preds = %332
  %339 = load i32, ptr %12, align 4, !tbaa !5
  %340 = zext i32 %339 to i64
  %341 = getelementptr inbounds ptr, ptr %23, i64 %340
  %342 = load ptr, ptr %341, align 8, !tbaa !9
  %343 = getelementptr inbounds %struct.relation, ptr %342, i32 0, i32 0
  %344 = load ptr, ptr %343, align 8, !tbaa !19
  call void @free(ptr noundef %344) #8
  %345 = load i32, ptr %12, align 4, !tbaa !5
  %346 = zext i32 %345 to i64
  %347 = getelementptr inbounds ptr, ptr %23, i64 %346
  %348 = load ptr, ptr %347, align 8, !tbaa !9
  call void @free(ptr noundef %348) #8
  br label %349

349:                                              ; preds = %338, %332
  br label %350

350:                                              ; preds = %349
  %351 = load i32, ptr %12, align 4, !tbaa !5
  %352 = add i32 %351, 1
  store i32 %352, ptr %12, align 4, !tbaa !5
  br label %327, !llvm.loop !22

353:                                              ; preds = %331
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 128, ptr %5) #8
  %354 = load ptr, ptr %2, align 8
  call void @llvm.stackrestore.p0(ptr %354)
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #8
  ret void
}

declare i32 @getL2CacheSize() #4

declare i32 @fgetc(ptr noundef) #4

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

declare ptr @parseQuery(ptr noundef) #4

declare void @optimizeQuery(ptr noundef, ptr noundef, i32 noundef, i1 noundef zeroext) #4

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind willreturn }
attributes #8 = { nounwind }
attributes #9 = { noreturn nounwind }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { 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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !6, i64 16}
!15 = !{!"join_predicate", !16, i64 0, !16, i64 12}
!16 = !{!"column", !6, i64 0, !6, i64 4, !6, i64 8}
!17 = !{!15, !6, i64 20}
!18 = distinct !{!18, !13}
!19 = !{!20, !10, i64 0}
!20 = !{!"relation", !10, i64 0, !21, i64 8, !21, i64 16}
!21 = !{!"long", !7, i64 0}
!22 = distinct !{!22, !13}


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

@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@num_relations = external dso_local local_unnamed_addr global i32, align 4
@.str.36 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [30 x i8], align 1
@l2size = external dso_local local_unnamed_addr global i32, align 4
@__PRETTY_FUNCTION__.testOptimizeQuery = external hidden unnamed_addr constant [29 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.74 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.75 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.76 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.77 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.78 = external hidden unnamed_addr constant [33 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @acutest_check_(i32 noundef, ptr noundef, i32 noundef, ptr 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) #1

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

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

; Function Attrs: noreturn nounwind uwtable
declare dso_local void @acutest_abort_() local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #4

declare ptr @loadRelation(ptr noundef) local_unnamed_addr #5

declare ptr @gatherStatistics(ptr noundef) local_unnamed_addr #5

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #4

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #7

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #8

; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #4

declare void @destroyStats(ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
define dso_local void @testOptimizeQuery() local_unnamed_addr #0 {
  %1 = alloca [128 x i8], align 16
  %2 = alloca [1024 x i8], align 16
  %3 = tail call i32 @getL2CacheSize() #9
  store i32 %3, ptr @l2size, align 4, !tbaa !5
  %4 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.51, ptr noundef nonnull @.str.52)
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %5, label %6

5:                                                ; preds = %0
  tail call void @__assert_fail(ptr noundef nonnull @.str.53, ptr noundef nonnull @.str.36, i32 noundef 147, ptr noundef nonnull @__PRETTY_FUNCTION__.testOptimizeQuery) #10
  unreachable

6:                                                ; preds = %0
  %7 = load i32, ptr @num_relations, align 4, !tbaa !5
  %8 = zext i32 %7 to i64
  %9 = alloca ptr, i64 %8, align 16
  %10 = alloca ptr, i64 %8, align 16
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %1) #9
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %2) #9
  %11 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) @.str.54) #9
  %12 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %1) #11
  %13 = getelementptr inbounds i8, ptr %1, i64 %12
  %14 = call ptr @fgets(ptr noundef nonnull %2, i32 noundef 1024, ptr noundef nonnull %4)
  %.not4766 = icmp eq ptr %14, null
  br i1 %.not4766, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %28, %6
  %15 = call i32 @fclose(ptr noundef nonnull %4)
  %16 = call noalias ptr @fopen(ptr noundef nonnull @.str.70, ptr noundef nonnull @.str.52)
  %.not48 = icmp eq ptr %16, null
  br i1 %.not48, label %30, label %31

.lr.ph:                                           ; preds = %6, %28
  %.04367 = phi i32 [ %.1, %28 ], [ 0, %6 ]
  %17 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %2) #11
  %18 = add i64 %17, -1
  %19 = getelementptr inbounds [1024 x i8], ptr %2, i64 0, i64 %18
  store i8 0, ptr %19, align 1, !tbaa !9
  %char0 = load i8, ptr %2, align 16
  %.not65 = icmp eq i8 %char0, 0
  br i1 %.not65, label %28, label %20

20:                                               ; preds = %.lr.ph
  %21 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %13, ptr noundef nonnull dereferenceable(1) %2) #9
  %22 = call ptr @loadRelation(ptr noundef nonnull %1) #9
  %23 = add i32 %.04367, 1
  %24 = zext i32 %.04367 to i64
  %25 = getelementptr inbounds ptr, ptr %9, i64 %24
  store ptr %22, ptr %25, align 8, !tbaa !10
  %26 = call ptr @gatherStatistics(ptr noundef %22) #9
  %27 = getelementptr inbounds ptr, ptr %10, i64 %24
  store ptr %26, ptr %27, align 8, !tbaa !10
  br label %28

28:                                               ; preds = %20, %.lr.ph
  %.1 = phi i32 [ %23, %20 ], [ %.04367, %.lr.ph ]
  %29 = call ptr @fgets(ptr noundef nonnull %2, i32 noundef 1024, ptr noundef nonnull %4)
  %.not47 = icmp eq ptr %29, null
  br i1 %.not47, label %._crit_edge, label %.lr.ph, !llvm.loop !12

30:                                               ; preds = %._crit_edge
  call void @__assert_fail(ptr noundef nonnull @.str.53, ptr noundef nonnull @.str.36, i32 noundef 171, ptr noundef nonnull @__PRETTY_FUNCTION__.testOptimizeQuery) #10
  unreachable

31:                                               ; preds = %._crit_edge
  %32 = call i32 @fgetc(ptr noundef nonnull %16)
  %.not4968 = icmp eq i32 %32, -1
  br i1 %.not4968, label %._crit_edge73, label %.lr.ph72

._crit_edge73:                                    ; preds = %137, %31
  %33 = call i32 @fclose(ptr noundef nonnull %16)
  %34 = load i32, ptr @num_relations, align 4, !tbaa !5
  call void @destroyStats(ptr noundef nonnull %10, i32 noundef %34) #9
  %35 = load i32, ptr @num_relations, align 4, !tbaa !5
  %.not78 = icmp eq i32 %35, 0
  br i1 %.not78, label %._crit_edge77, label %.lr.ph76

.lr.ph72:                                         ; preds = %31, %137
  %.04170 = phi i32 [ %139, %137 ], [ %32, %31 ]
  %.04269 = phi i32 [ %138, %137 ], [ 0, %31 ]
  %36 = call i32 @ungetc(i32 noundef %.04170, ptr noundef nonnull %16)
  %37 = call ptr @parseQuery(ptr noundef nonnull %16) #9
  %38 = load i32, ptr @num_relations, align 4, !tbaa !5
  call void @optimizeQuery(ptr noundef %37, ptr noundef nonnull %10, i32 noundef %38, i1 noundef zeroext false) #9
  switch i32 %.04269, label %137 [
    i32 0, label %39
    i32 1, label %53
    i32 5, label %81
    i32 11, label %109
  ]

39:                                               ; preds = %.lr.ph72
  %40 = getelementptr inbounds i8, ptr %37, i64 32
  %41 = load i32, ptr %40, align 4, !tbaa !14
  %42 = icmp eq i32 %41, 2
  %43 = zext i1 %42 to i32
  %44 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %43, ptr noundef nonnull @.str.36, i32 noundef 185, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.71)
  %.not51 = icmp eq i32 %44, 0
  br i1 %.not51, label %45, label %46

45:                                               ; preds = %39
  call void @acutest_abort_() #12
  unreachable

46:                                               ; preds = %39
  %47 = getelementptr inbounds i8, ptr %37, i64 36
  %48 = load i32, ptr %47, align 4, !tbaa !17
  %49 = icmp eq i32 %48, 1
  %50 = zext i1 %49 to i32
  %51 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %50, ptr noundef nonnull @.str.36, i32 noundef 186, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.72)
  %.not52 = icmp eq i32 %51, 0
  br i1 %.not52, label %52, label %137

52:                                               ; preds = %46
  call void @acutest_abort_() #12
  unreachable

53:                                               ; preds = %.lr.ph72
  %54 = getelementptr inbounds i8, ptr %37, i64 32
  %55 = load i32, ptr %54, align 4, !tbaa !14
  %56 = icmp eq i32 %55, 1
  %57 = zext i1 %56 to i32
  %58 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %57, ptr noundef nonnull @.str.36, i32 noundef 191, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.73)
  %.not53 = icmp eq i32 %58, 0
  br i1 %.not53, label %59, label %60

59:                                               ; preds = %53
  call void @acutest_abort_() #12
  unreachable

60:                                               ; preds = %53
  %61 = getelementptr inbounds i8, ptr %37, i64 36
  %62 = load i32, ptr %61, align 4, !tbaa !17
  %63 = icmp eq i32 %62, 2
  %64 = zext i1 %63 to i32
  %65 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %64, ptr noundef nonnull @.str.36, i32 noundef 192, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.74)
  %.not54 = icmp eq i32 %65, 0
  br i1 %.not54, label %66, label %67

66:                                               ; preds = %60
  call void @acutest_abort_() #12
  unreachable

67:                                               ; preds = %60
  %68 = getelementptr inbounds i8, ptr %37, i64 56
  %69 = load i32, ptr %68, align 4, !tbaa !14
  %70 = icmp eq i32 %69, 0
  %71 = zext i1 %70 to i32
  %72 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %71, ptr noundef nonnull @.str.36, i32 noundef 193, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.75)
  %.not55 = icmp eq i32 %72, 0
  br i1 %.not55, label %73, label %74

73:                                               ; preds = %67
  call void @acutest_abort_() #12
  unreachable

74:                                               ; preds = %67
  %75 = getelementptr inbounds i8, ptr %37, i64 60
  %76 = load i32, ptr %75, align 4, !tbaa !17
  %77 = icmp eq i32 %76, 0
  %78 = zext i1 %77 to i32
  %79 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %78, ptr noundef nonnull @.str.36, i32 noundef 194, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.76)
  %.not56 = icmp eq i32 %79, 0
  br i1 %.not56, label %80, label %137

80:                                               ; preds = %74
  call void @acutest_abort_() #12
  unreachable

81:                                               ; preds = %.lr.ph72
  %82 = getelementptr inbounds i8, ptr %37, i64 32
  %83 = load i32, ptr %82, align 4, !tbaa !14
  %84 = icmp eq i32 %83, 2
  %85 = zext i1 %84 to i32
  %86 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %85, ptr noundef nonnull @.str.36, i32 noundef 199, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.71)
  %.not57 = icmp eq i32 %86, 0
  br i1 %.not57, label %87, label %88

87:                                               ; preds = %81
  call void @acutest_abort_() #12
  unreachable

88:                                               ; preds = %81
  %89 = getelementptr inbounds i8, ptr %37, i64 36
  %90 = load i32, ptr %89, align 4, !tbaa !17
  %91 = icmp eq i32 %90, 1
  %92 = zext i1 %91 to i32
  %93 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %92, ptr noundef nonnull @.str.36, i32 noundef 200, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.72)
  %.not58 = icmp eq i32 %93, 0
  br i1 %.not58, label %94, label %95

94:                                               ; preds = %88
  call void @acutest_abort_() #12
  unreachable

95:                                               ; preds = %88
  %96 = getelementptr inbounds i8, ptr %37, i64 56
  %97 = load i32, ptr %96, align 4, !tbaa !14
  %98 = icmp eq i32 %97, 1
  %99 = zext i1 %98 to i32
  %100 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %99, ptr noundef nonnull @.str.36, i32 noundef 201, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.77)
  %.not59 = icmp eq i32 %100, 0
  br i1 %.not59, label %101, label %102

101:                                              ; preds = %95
  call void @acutest_abort_() #12
  unreachable

102:                                              ; preds = %95
  %103 = getelementptr inbounds i8, ptr %37, i64 60
  %104 = load i32, ptr %103, align 4, !tbaa !17
  %105 = icmp eq i32 %104, 0
  %106 = zext i1 %105 to i32
  %107 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %106, ptr noundef nonnull @.str.36, i32 noundef 202, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.76)
  %.not60 = icmp eq i32 %107, 0
  br i1 %.not60, label %108, label %137

108:                                              ; preds = %102
  call void @acutest_abort_() #12
  unreachable

109:                                              ; preds = %.lr.ph72
  %110 = getelementptr inbounds i8, ptr %37, i64 32
  %111 = load i32, ptr %110, align 4, !tbaa !14
  %112 = icmp eq i32 %111, 3
  %113 = zext i1 %112 to i32
  %114 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %113, ptr noundef nonnull @.str.36, i32 noundef 207, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.78)
  %.not61 = icmp eq i32 %114, 0
  br i1 %.not61, label %115, label %116

115:                                              ; preds = %109
  call void @acutest_abort_() #12
  unreachable

116:                                              ; preds = %109
  %117 = getelementptr inbounds i8, ptr %37, i64 36
  %118 = load i32, ptr %117, align 4, !tbaa !17
  %119 = icmp eq i32 %118, 1
  %120 = zext i1 %119 to i32
  %121 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %120, ptr noundef nonnull @.str.36, i32 noundef 208, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.72)
  %.not62 = icmp eq i32 %121, 0
  br i1 %.not62, label %122, label %123

122:                                              ; preds = %116
  call void @acutest_abort_() #12
  unreachable

123:                                              ; preds = %116
  %124 = getelementptr inbounds i8, ptr %37, i64 56
  %125 = load i32, ptr %124, align 4, !tbaa !14
  %126 = icmp eq i32 %125, 1
  %127 = zext i1 %126 to i32
  %128 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %127, ptr noundef nonnull @.str.36, i32 noundef 209, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.77)
  %.not63 = icmp eq i32 %128, 0
  br i1 %.not63, label %129, label %130

129:                                              ; preds = %123
  call void @acutest_abort_() #12
  unreachable

130:                                              ; preds = %123
  %131 = getelementptr inbounds i8, ptr %37, i64 60
  %132 = load i32, ptr %131, align 4, !tbaa !17
  %133 = icmp eq i32 %132, 0
  %134 = zext i1 %133 to i32
  %135 = call i32 (i32, ptr, i32, ptr, ...) @acutest_check_(i32 noundef %134, ptr noundef nonnull @.str.36, i32 noundef 210, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.76)
  %.not64 = icmp eq i32 %135, 0
  br i1 %.not64, label %136, label %137

136:                                              ; preds = %130
  call void @acutest_abort_() #12
  unreachable

137:                                              ; preds = %102, %74, %46, %.lr.ph72, %130
  call void @free(ptr noundef %37) #9
  %138 = add nuw nsw i32 %.04269, 1
  %139 = call i32 @fgetc(ptr noundef nonnull %16)
  %.not49 = icmp eq i32 %139, -1
  br i1 %.not49, label %._crit_edge73, label %.lr.ph72, !llvm.loop !18

._crit_edge77:                                    ; preds = %145, %._crit_edge73
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %1) #9
  ret void

.lr.ph76:                                         ; preds = %._crit_edge73, %145
  %140 = phi i32 [ %146, %145 ], [ %35, %._crit_edge73 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %145 ], [ 0, %._crit_edge73 ]
  %141 = getelementptr inbounds ptr, ptr %9, i64 %indvars.iv
  %142 = load ptr, ptr %141, align 8, !tbaa !10
  %.not50 = icmp eq ptr %142, null
  br i1 %.not50, label %145, label %143

143:                                              ; preds = %.lr.ph76
  %144 = load ptr, ptr %142, align 8, !tbaa !19
  call void @free(ptr noundef %144) #9
  call void @free(ptr noundef nonnull %142) #9
  %.pre = load i32, ptr @num_relations, align 4, !tbaa !5
  br label %145

145:                                              ; preds = %.lr.ph76, %143
  %146 = phi i32 [ %140, %.lr.ph76 ], [ %.pre, %143 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %147 = zext i32 %146 to i64
  %148 = icmp ult i64 %indvars.iv.next, %147
  br i1 %148, label %.lr.ph76, label %._crit_edge77, !llvm.loop !22
}

declare i32 @getL2CacheSize() local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @fgetc(ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @ungetc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #4

declare ptr @parseQuery(ptr noundef) local_unnamed_addr #5

declare void @optimizeQuery(ptr noundef, ptr noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #5

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn 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 #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nounwind }
attributes #10 = { noreturn nounwind }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !6, i64 16}
!15 = !{!"join_predicate", !16, i64 0, !16, i64 12}
!16 = !{!"column", !6, i64 0, !6, i64 4, !6, i64 8}
!17 = !{!15, !6, i64 20}
!18 = distinct !{!18, !13}
!19 = !{!20, !11, i64 0}
!20 = !{!"relation", !11, i64 0, !21, i64 8, !21, i64 16}
!21 = !{!"long", !7, i64 0}
!22 = distinct !{!22, !13}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass