; LLVM IR from recrsn/tinydb :: database (parse_select)

; 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.table_info = type { [32 x i8], i32, [32 x %struct.field], i64 }
%struct.field = type { [32 x i8], i64, i32 }
%struct.query = type { i32, i32, i32, [32 x ptr], [32 x %struct.query_field], [32 x %struct.query_condition] }
%struct.query_field = type { [32 x i8], [32 x i8], i32 }
%struct.query_condition = type { %struct.literal, %struct.literal, i32, i32 }
%struct.literal = type { i32, [2048 x i8], ptr, i32 }
%struct.table = type { %struct.table_info, i8, ptr, ptr }

@stdin = external global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external global ptr, align 8
@.str.24 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @str_trim(ptr noundef) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @table_find_field(ptr noundef byval(%struct.table_info) align 8, ptr noundef) #0

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @open_table(ptr noundef) #0

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

; Function Attrs: nounwind
declare i32 @__isoc99_sscanf(ptr noundef, ptr noundef, ...) #4

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

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

; Function Attrs: nounwind
declare ptr @strtok(ptr noundef, ptr noundef) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @single_query(ptr noundef byval(%struct.query) align 8) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @has_self_join(ptr noundef byval(%struct.query) align 8) #0

declare i32 @fputs(ptr noundef, ptr noundef) #5

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @do_join_query(ptr noundef byval(%struct.query) align 8) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @open_index(ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @parse_select(ptr noundef %0) #0 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca [2048 x i8], align 16
  %5 = alloca [8 x i8], align 1
  %6 = alloca %struct.query, align 8
  %7 = alloca [32 x [32 x i8]], align 16
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca [32 x i8], align 16
  %12 = alloca [32 x i8], align 16
  %13 = alloca [32 x i8], align 16
  %14 = alloca i32, align 4
  %15 = alloca %struct.literal, align 8
  %16 = alloca i32, align 4
  %17 = alloca i8, align 1
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2048, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 135312, ptr %6) #7
  %20 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 1
  store i32 0, ptr %20, align 4, !tbaa !9
  %21 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 0
  store i32 0, ptr %21, align 8, !tbaa !12
  %22 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 2
  store i32 0, ptr %22, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1024, ptr %7) #7
  call void @llvm.memset.p0.i64(ptr align 16 %7, i8 0, i64 1024, i1 false)
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds [2048 x i8], ptr %4, i64 0, i64 0
  %25 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %23, ptr noundef @.str.24, ptr noundef %24) #7
  %26 = icmp eq i32 %25, 1
  br i1 %26, label %27, label %308

27:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %28 = getelementptr inbounds [2048 x i8], ptr %4, i64 0, i64 0
  %29 = call ptr @strtok(ptr noundef %28, ptr noundef @.str.14) #7
  store ptr %29, ptr %8, align 8, !tbaa !5
  br label %30

30:                                               ; preds = %33, %27
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %33, label %44

33:                                               ; preds = %30
  %34 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 1
  %35 = load i32, ptr %34, align 4, !tbaa !9
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %34, align 4, !tbaa !9
  %37 = sext i32 %35 to i64
  %38 = getelementptr inbounds [32 x [32 x i8]], ptr %7, i64 0, i64 %37
  %39 = getelementptr inbounds [32 x i8], ptr %38, i64 0, i64 0
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = call ptr @str_trim(ptr noundef %40)
  %42 = call ptr @strcpy(ptr noundef %39, ptr noundef %41) #7
  %43 = call ptr @strtok(ptr noundef null, ptr noundef @.str.14) #7
  store ptr %43, ptr %8, align 8, !tbaa !5
  br label %30, !llvm.loop !14

44:                                               ; preds = %30
  br label %45

45:                                               ; preds = %210, %44
  %46 = getelementptr inbounds [2048 x i8], ptr %4, i64 0, i64 0
  %47 = load ptr, ptr @stdin, align 8, !tbaa !5
  %48 = call ptr @fgets(ptr noundef %46, i32 noundef 2048, ptr noundef %47)
  %49 = getelementptr inbounds [2048 x i8], ptr %4, i64 0, i64 0
  %50 = call ptr @str_trim(ptr noundef %49)
  %51 = getelementptr inbounds [2048 x i8], ptr %4, i64 0, i64 0
  %52 = call i32 @strncmp(ptr noundef @.str.25, ptr noundef %51, i64 noundef 4) #8
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %54, label %88

54:                                               ; preds = %45
  %55 = getelementptr inbounds [2048 x i8], ptr %4, i64 0, i64 0
  %56 = call ptr @strtok(ptr noundef %55, ptr noundef @.str.26) #7
  br label %57

57:                                               ; preds = %86, %54
  %58 = call ptr @strtok(ptr noundef null, ptr noundef @.str.14) #7
  store ptr %58, ptr %8, align 8, !tbaa !5
  %59 = icmp ne ptr %58, null
  br i1 %59, label %60, label %87

60:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  %62 = call ptr @str_trim(ptr noundef %61)
  %63 = call ptr @open_table(ptr noundef %62)
  store ptr %63, ptr %9, align 8, !tbaa !5
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = icmp eq ptr %64, null
  br i1 %65, label %66, label %69

66:                                               ; preds = %60
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = call ptr @open_index(ptr noundef %67)
  store ptr %68, ptr %9, align 8, !tbaa !5
  br label %69

69:                                               ; preds = %66, %60
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = icmp ne ptr null, %70
  br i1 %71, label %72, label %80

72:                                               ; preds = %69
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 3
  %75 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 0
  %76 = load i32, ptr %75, align 8, !tbaa !12
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %75, align 8, !tbaa !12
  %78 = sext i32 %76 to i64
  %79 = getelementptr inbounds [32 x ptr], ptr %74, i64 0, i64 %78
  store ptr %73, ptr %79, align 8, !tbaa !5
  br label %83

80:                                               ; preds = %69
  %81 = load ptr, ptr @stderr, align 8, !tbaa !5
  %82 = call i32 @fputs(ptr noundef @.str.27, ptr noundef %81)
  store i1 false, ptr %2, align 1
  store i32 1, ptr %10, align 4
  br label %84

83:                                               ; preds = %72
  store i32 0, ptr %10, align 4
  br label %84

84:                                               ; preds = %83, %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  %85 = load i32, ptr %10, align 4
  switch i32 %85, label %307 [
    i32 0, label %86
  ]

86:                                               ; preds = %84
  br label %57, !llvm.loop !16

87:                                               ; preds = %57
  br label %209

88:                                               ; preds = %45
  %89 = getelementptr inbounds [2048 x i8], ptr %4, i64 0, i64 0
  %90 = call i32 @strncmp(ptr noundef @.str.28, ptr noundef %89, i64 noundef 5) #8
  %91 = icmp eq i32 %90, 0
  br i1 %91, label %100, label %92

92:                                               ; preds = %88
  %93 = getelementptr inbounds [2048 x i8], ptr %4, i64 0, i64 0
  %94 = call i32 @strncmp(ptr noundef @.str.29, ptr noundef %93, i64 noundef 3) #8
  %95 = icmp eq i32 %94, 0
  br i1 %95, label %100, label %96

96:                                               ; preds = %92
  %97 = getelementptr inbounds [2048 x i8], ptr %4, i64 0, i64 0
  %98 = call i32 @strncmp(ptr noundef @.str.30, ptr noundef %97, i64 noundef 2) #8
  %99 = icmp eq i32 %98, 0
  br i1 %99, label %100, label %202

100:                                              ; preds = %96, %92, %88
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #7
  %101 = getelementptr inbounds [2048 x i8], ptr %4, i64 0, i64 0
  %102 = getelementptr inbounds [32 x i8], ptr %13, i64 0, i64 0
  %103 = getelementptr inbounds [32 x i8], ptr %11, i64 0, i64 0
  %104 = getelementptr inbounds [8 x i8], ptr %5, i64 0, i64 0
  %105 = getelementptr inbounds [32 x i8], ptr %12, i64 0, i64 0
  %106 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %101, ptr noundef @.str.31, ptr noundef %102, ptr noundef %103, ptr noundef %104, ptr noundef %105) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %107 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 2
  %108 = load i32, ptr %107, align 8, !tbaa !13
  store i32 %108, ptr %14, align 4, !tbaa !17
  %109 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 5
  %110 = load i32, ptr %14, align 4, !tbaa !17
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [32 x %struct.query_condition], ptr %109, i64 0, i64 %111
  %113 = getelementptr inbounds %struct.query_condition, ptr %112, i32 0, i32 0
  %114 = getelementptr inbounds [32 x i8], ptr %11, i64 0, i64 0
  %115 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 3
  %116 = getelementptr inbounds [32 x ptr], ptr %115, i64 0, i64 0
  %117 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 0
  %118 = load i32, ptr %117, align 8, !tbaa !12
  call void @parse_query_literal(ptr noundef %113, ptr noundef %114, ptr noundef %116, i32 noundef %118)
  %119 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 5
  %120 = load i32, ptr %14, align 4, !tbaa !17
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [32 x %struct.query_condition], ptr %119, i64 0, i64 %121
  %123 = getelementptr inbounds %struct.query_condition, ptr %122, i32 0, i32 1
  %124 = getelementptr inbounds [32 x i8], ptr %12, i64 0, i64 0
  %125 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 3
  %126 = getelementptr inbounds [32 x ptr], ptr %125, i64 0, i64 0
  %127 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 0
  %128 = load i32, ptr %127, align 8, !tbaa !12
  call void @parse_query_literal(ptr noundef %123, ptr noundef %124, ptr noundef %126, i32 noundef %128)
  %129 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 5
  %130 = load i32, ptr %14, align 4, !tbaa !17
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [32 x %struct.query_condition], ptr %129, i64 0, i64 %131
  %133 = getelementptr inbounds %struct.query_condition, ptr %132, i32 0, i32 3
  %134 = getelementptr inbounds [8 x i8], ptr %5, i64 0, i64 0
  call void @parse_query_operator(ptr noundef %133, ptr noundef %134)
  %135 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 5
  %136 = load i32, ptr %14, align 4, !tbaa !17
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [32 x %struct.query_condition], ptr %135, i64 0, i64 %137
  %139 = getelementptr inbounds %struct.query_condition, ptr %138, i32 0, i32 0
  %140 = getelementptr inbounds %struct.literal, ptr %139, i32 0, i32 0
  %141 = load i32, ptr %140, align 8, !tbaa !18
  %142 = icmp eq i32 %141, 0
  br i1 %142, label %143, label %173

143:                                              ; preds = %100
  %144 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 5
  %145 = load i32, ptr %14, align 4, !tbaa !17
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [32 x %struct.query_condition], ptr %144, i64 0, i64 %146
  %148 = getelementptr inbounds %struct.query_condition, ptr %147, i32 0, i32 1
  %149 = getelementptr inbounds %struct.literal, ptr %148, i32 0, i32 0
  %150 = load i32, ptr %149, align 8, !tbaa !21
  %151 = icmp eq i32 %150, 1
  br i1 %151, label %152, label %173

152:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 2072, ptr %15) #7
  %153 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 5
  %154 = load i32, ptr %14, align 4, !tbaa !17
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [32 x %struct.query_condition], ptr %153, i64 0, i64 %155
  %157 = getelementptr inbounds %struct.query_condition, ptr %156, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %157, i64 2072, i1 false), !tbaa.struct !22
  %158 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 5
  %159 = load i32, ptr %14, align 4, !tbaa !17
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [32 x %struct.query_condition], ptr %158, i64 0, i64 %160
  %162 = getelementptr inbounds %struct.query_condition, ptr %161, i32 0, i32 0
  %163 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 5
  %164 = load i32, ptr %14, align 4, !tbaa !17
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [32 x %struct.query_condition], ptr %163, i64 0, i64 %165
  %167 = getelementptr inbounds %struct.query_condition, ptr %166, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %162, ptr align 8 %167, i64 2072, i1 false), !tbaa.struct !22
  %168 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 5
  %169 = load i32, ptr %14, align 4, !tbaa !17
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [32 x %struct.query_condition], ptr %168, i64 0, i64 %170
  %172 = getelementptr inbounds %struct.query_condition, ptr %171, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %172, ptr align 8 %15, i64 2072, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 2072, ptr %15) #7
  br label %173

173:                                              ; preds = %152, %143, %100
  %174 = getelementptr inbounds [32 x i8], ptr %13, i64 0, i64 0
  %175 = call i32 @strcmp(ptr noundef %174, ptr noundef @.str.28) #8
  %176 = icmp eq i32 %175, 0
  br i1 %176, label %181, label %177

177:                                              ; preds = %173
  %178 = getelementptr inbounds [32 x i8], ptr %13, i64 0, i64 0
  %179 = call i32 @strcmp(ptr noundef %178, ptr noundef @.str.29) #8
  %180 = icmp eq i32 %179, 0
  br i1 %180, label %181, label %187

181:                                              ; preds = %177, %173
  %182 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 5
  %183 = load i32, ptr %14, align 4, !tbaa !17
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [32 x %struct.query_condition], ptr %182, i64 0, i64 %184
  %186 = getelementptr inbounds %struct.query_condition, ptr %185, i32 0, i32 2
  store i32 1, ptr %186, align 8, !tbaa !24
  br label %198

187:                                              ; preds = %177
  %188 = getelementptr inbounds [32 x i8], ptr %13, i64 0, i64 0
  %189 = call i32 @strcmp(ptr noundef %188, ptr noundef @.str.30) #8
  %190 = icmp eq i32 %189, 0
  br i1 %190, label %191, label %197

191:                                              ; preds = %187
  %192 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 5
  %193 = load i32, ptr %14, align 4, !tbaa !17
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [32 x %struct.query_condition], ptr %192, i64 0, i64 %194
  %196 = getelementptr inbounds %struct.query_condition, ptr %195, i32 0, i32 2
  store i32 0, ptr %196, align 8, !tbaa !24
  br label %197

197:                                              ; preds = %191, %187
  br label %198

198:                                              ; preds = %197, %181
  %199 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 2
  %200 = load i32, ptr %199, align 8, !tbaa !13
  %201 = add nsw i32 %200, 1
  store i32 %201, ptr %199, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #7
  br label %208

202:                                              ; preds = %96
  %203 = getelementptr inbounds [2048 x i8], ptr %4, i64 0, i64 0
  %204 = call i32 @strncmp(ptr noundef @.str.12, ptr noundef %203, i64 noundef 3) #8
  %205 = icmp eq i32 %204, 0
  br i1 %205, label %206, label %207

206:                                              ; preds = %202
  br label %215

207:                                              ; preds = %202
  br label %208

208:                                              ; preds = %207, %198
  br label %209

209:                                              ; preds = %208, %87
  br label %210

210:                                              ; preds = %209
  %211 = load ptr, ptr @stdin, align 8, !tbaa !5
  %212 = call i32 @feof(ptr noundef %211) #7
  %213 = icmp ne i32 %212, 0
  %214 = xor i1 %213, true
  br i1 %214, label %45, label %215, !llvm.loop !25

215:                                              ; preds = %210, %206
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !17
  br label %216

216:                                              ; preds = %292, %215
  %217 = load i32, ptr %16, align 4, !tbaa !17
  %218 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 1
  %219 = load i32, ptr %218, align 4, !tbaa !9
  %220 = icmp slt i32 %217, %219
  br i1 %220, label %222, label %221

221:                                              ; preds = %216
  store i32 8, ptr %10, align 4
  br label %295

222:                                              ; preds = %216
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #7
  store i8 0, ptr %17, align 1, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !17
  br label %223

223:                                              ; preds = %280, %222
  %224 = load i32, ptr %18, align 4, !tbaa !17
  %225 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 0
  %226 = load i32, ptr %225, align 8, !tbaa !12
  %227 = icmp slt i32 %224, %226
  br i1 %227, label %229, label %228

228:                                              ; preds = %223
  store i32 11, ptr %10, align 4
  br label %283

229:                                              ; preds = %223
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %230 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 3
  %231 = load i32, ptr %18, align 4, !tbaa !17
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [32 x ptr], ptr %230, i64 0, i64 %232
  %234 = load ptr, ptr %233, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.table, ptr %234, i32 0, i32 0
  %236 = load i32, ptr %16, align 4, !tbaa !17
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [32 x [32 x i8]], ptr %7, i64 0, i64 %237
  %239 = getelementptr inbounds [32 x i8], ptr %238, i64 0, i64 0
  %240 = call i32 @table_find_field(ptr noundef byval(%struct.table_info) align 8 %235, ptr noundef %239)
  store i32 %240, ptr %19, align 4, !tbaa !17
  %241 = load i32, ptr %19, align 4, !tbaa !17
  %242 = icmp ne i32 %241, -1
  br i1 %242, label %243, label %276

243:                                              ; preds = %229
  %244 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 4
  %245 = load i32, ptr %16, align 4, !tbaa !17
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds [32 x %struct.query_field], ptr %244, i64 0, i64 %246
  %248 = getelementptr inbounds %struct.query_field, ptr %247, i32 0, i32 0
  %249 = getelementptr inbounds [32 x i8], ptr %248, i64 0, i64 0
  %250 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 3
  %251 = load i32, ptr %18, align 4, !tbaa !17
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [32 x ptr], ptr %250, i64 0, i64 %252
  %254 = load ptr, ptr %253, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.table, ptr %254, i32 0, i32 0
  %256 = getelementptr inbounds %struct.table_info, ptr %255, i32 0, i32 0
  %257 = getelementptr inbounds [32 x i8], ptr %256, i64 0, i64 0
  %258 = call ptr @strcpy(ptr noundef %249, ptr noundef %257) #7
  %259 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 4
  %260 = load i32, ptr %16, align 4, !tbaa !17
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds [32 x %struct.query_field], ptr %259, i64 0, i64 %261
  %263 = getelementptr inbounds %struct.query_field, ptr %262, i32 0, i32 1
  %264 = getelementptr inbounds [32 x i8], ptr %263, i64 0, i64 0
  %265 = load i32, ptr %16, align 4, !tbaa !17
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [32 x [32 x i8]], ptr %7, i64 0, i64 %266
  %268 = getelementptr inbounds [32 x i8], ptr %267, i64 0, i64 0
  %269 = call ptr @strcpy(ptr noundef %264, ptr noundef %268) #7
  %270 = load i32, ptr %19, align 4, !tbaa !17
  %271 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 4
  %272 = load i32, ptr %16, align 4, !tbaa !17
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [32 x %struct.query_field], ptr %271, i64 0, i64 %273
  %275 = getelementptr inbounds %struct.query_field, ptr %274, i32 0, i32 2
  store i32 %270, ptr %275, align 4, !tbaa !28
  store i8 1, ptr %17, align 1, !tbaa !26
  store i32 11, ptr %10, align 4
  br label %277

276:                                              ; preds = %229
  store i32 0, ptr %10, align 4
  br label %277

277:                                              ; preds = %276, %243
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  %278 = load i32, ptr %10, align 4
  switch i32 %278, label %283 [
    i32 0, label %279
  ]

279:                                              ; preds = %277
  br label %280

280:                                              ; preds = %279
  %281 = load i32, ptr %18, align 4, !tbaa !17
  %282 = add nsw i32 %281, 1
  store i32 %282, ptr %18, align 4, !tbaa !17
  br label %223, !llvm.loop !30

283:                                              ; preds = %277, %228
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %284

284:                                              ; preds = %283
  %285 = load i8, ptr %17, align 1, !tbaa !26, !range !31, !noundef !32
  %286 = trunc i8 %285 to i1
  br i1 %286, label %288, label %287

287:                                              ; preds = %284
  store i1 false, ptr %2, align 1
  store i32 1, ptr %10, align 4
  br label %289

288:                                              ; preds = %284
  store i32 0, ptr %10, align 4
  br label %289

289:                                              ; preds = %288, %287
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #7
  %290 = load i32, ptr %10, align 4
  switch i32 %290, label %295 [
    i32 0, label %291
  ]

291:                                              ; preds = %289
  br label %292

292:                                              ; preds = %291
  %293 = load i32, ptr %16, align 4, !tbaa !17
  %294 = add nsw i32 %293, 1
  store i32 %294, ptr %16, align 4, !tbaa !17
  br label %216, !llvm.loop !33

295:                                              ; preds = %289, %221
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  %296 = load i32, ptr %10, align 4
  switch i32 %296, label %307 [
    i32 8, label %297
  ]

297:                                              ; preds = %295
  %298 = getelementptr inbounds %struct.query, ptr %6, i32 0, i32 0
  %299 = load i32, ptr %298, align 8, !tbaa !12
  %300 = icmp eq i32 1, %299
  br i1 %300, label %301, label %305

301:                                              ; preds = %297
  %302 = call zeroext i1 @has_self_join(ptr noundef byval(%struct.query) align 8 %6)
  br i1 %302, label %305, label %303

303:                                              ; preds = %301
  %304 = call zeroext i1 @single_query(ptr noundef byval(%struct.query) align 8 %6)
  store i1 %304, ptr %2, align 1
  store i32 1, ptr %10, align 4
  br label %307

305:                                              ; preds = %301, %297
  %306 = call zeroext i1 @do_join_query(ptr noundef byval(%struct.query) align 8 %6)
  store i1 %306, ptr %2, align 1
  store i32 1, ptr %10, align 4
  br label %307

307:                                              ; preds = %305, %303, %295, %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %309

308:                                              ; preds = %1
  store i1 false, ptr %2, align 1
  store i32 1, ptr %10, align 4
  br label %309

309:                                              ; preds = %308, %307
  call void @llvm.lifetime.end.p0(i64 1024, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 135312, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 2048, ptr %4) #7
  %310 = load i1, ptr %2, align 1
  ret i1 %310
}

; Function Attrs: nounwind
declare i32 @feof(ptr noundef) #4

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 4}
!10 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !7, i64 16, !7, i64 272, !7, i64 2448}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 0}
!13 = !{!10, !11, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = !{!11, !11, i64 0}
!18 = !{!19, !11, i64 0}
!19 = !{!"", !20, i64 0, !20, i64 2072, !11, i64 4144, !11, i64 4148}
!20 = !{!"", !11, i64 0, !7, i64 4, !6, i64 2056, !11, i64 2064}
!21 = !{!19, !11, i64 2072}
!22 = !{i64 0, i64 4, !17, i64 4, i64 2048, !23, i64 2056, i64 8, !5, i64 2064, i64 4, !17}
!23 = !{!7, !7, i64 0}
!24 = !{!19, !11, i64 4144}
!25 = distinct !{!25, !15}
!26 = !{!27, !27, i64 0}
!27 = !{!"_Bool", !7, i64 0}
!28 = !{!29, !11, i64 64}
!29 = !{!"", !7, i64 0, !7, i64 32, !11, i64 64}
!30 = distinct !{!30, !15}
!31 = !{i8 0, i8 2}
!32 = !{}
!33 = distinct !{!33, !15}


; 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.table_info = type { [32 x i8], i32, [32 x %struct.field], i64 }
%struct.field = type { [32 x i8], i64, i32 }
%struct.query = type { i32, i32, i32, [32 x ptr], [32 x %struct.query_field], [32 x %struct.query_condition] }
%struct.query_field = type { [32 x i8], [32 x i8], i32 }
%struct.query_condition = type { %struct.literal, %struct.literal, i32, i32 }
%struct.literal = type { i32, [2048 x i8], ptr, i32 }

@stdin = external local_unnamed_addr global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.24 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @str_trim(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: nounwind uwtable
declare dso_local i32 @table_find_field(ptr noundef byval(%struct.table_info) align 8, ptr noundef) local_unnamed_addr #0

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

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

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

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn
declare ptr @strtok(ptr noundef, ptr nocapture noundef readonly) local_unnamed_addr #5

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @single_query(ptr noundef byval(%struct.query) align 8) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @parse_query_literal(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @has_self_join(ptr noundef byval(%struct.query) align 8) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @do_join_query(ptr noundef byval(%struct.query) align 8) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @parse_select(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
  %2 = alloca [2048 x i8], align 16
  %3 = alloca [8 x i8], align 1
  %4 = alloca %struct.query, align 8
  %5 = alloca [32 x [32 x i8]], align 16
  %6 = alloca [32 x i8], align 16
  %7 = alloca [32 x i8], align 16
  %8 = alloca [32 x i8], align 16
  %9 = alloca %struct.literal, align 8
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 135312, ptr nonnull %4) #8
  %10 = getelementptr inbounds i8, ptr %4, i64 4
  store i32 0, ptr %10, align 4, !tbaa !5
  store i32 0, ptr %4, align 8, !tbaa !10
  %11 = getelementptr inbounds i8, ptr %4, i64 8
  store i32 0, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %5) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %5, i8 0, i64 1024, i1 false)
  %12 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %0, ptr noundef nonnull @.str.24, ptr noundef nonnull %2) #8
  %13 = icmp eq i32 %12, 1
  br i1 %13, label %14, label %.preheader._crit_edge

14:                                               ; preds = %1
  %15 = call ptr @strtok(ptr noundef nonnull %2, ptr noundef nonnull @.str.14) #8
  %.not75 = icmp eq ptr %15, null
  br i1 %.not75, label %.preheader71, label %.lr.ph

.preheader71:                                     ; preds = %.lr.ph, %14
  %16 = getelementptr inbounds i8, ptr %4, i64 2448
  %17 = getelementptr inbounds i8, ptr %4, i64 16
  br label %25

.lr.ph:                                           ; preds = %14, %.lr.ph
  %.04576 = phi ptr [ %24, %.lr.ph ], [ %15, %14 ]
  %18 = load i32, ptr %10, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr %10, align 4, !tbaa !5
  %20 = sext i32 %18 to i64
  %21 = getelementptr inbounds [32 x [32 x i8]], ptr %5, i64 0, i64 %20
  %22 = call ptr @str_trim(ptr noundef nonnull %.04576)
  %23 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %21, ptr noundef nonnull dereferenceable(1) %22) #8
  %24 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str.14) #8
  %.not = icmp eq ptr %24, null
  br i1 %.not, label %.preheader71, label %.lr.ph, !llvm.loop !12

25:                                               ; preds = %.preheader71, %.loopexit
  %26 = load ptr, ptr @stdin, align 8, !tbaa !14
  %27 = call ptr @fgets(ptr noundef nonnull %2, i32 noundef 2048, ptr noundef %26)
  %28 = call ptr @str_trim(ptr noundef nonnull %2)
  %29 = call i32 @strncmp(ptr noundef nonnull dereferenceable(1) @.str.25, ptr noundef nonnull dereferenceable(1) %2, i64 noundef 4) #9
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %31, label %47

31:                                               ; preds = %25
  %32 = call ptr @strtok(ptr noundef nonnull %2, ptr noundef nonnull @.str.26) #8
  %33 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str.14) #8
  %.not5477 = icmp eq ptr %33, null
  br i1 %.not5477, label %.loopexit, label %.lr.ph78

.lr.ph78:                                         ; preds = %31, %.thread
  %34 = phi ptr [ %46, %.thread ], [ %33, %31 ]
  %35 = call ptr @str_trim(ptr noundef nonnull %34)
  %36 = call ptr @open_table(ptr noundef %35)
  %37 = icmp eq ptr %36, null
  br i1 %37, label %38, label %.thread

38:                                               ; preds = %.lr.ph78
  %39 = call ptr @open_index(ptr noundef nonnull %34)
  %.not58.not = icmp eq ptr %39, null
  br i1 %.not58.not, label %.thread64, label %.thread

.thread64:                                        ; preds = %38
  %40 = load ptr, ptr @stderr, align 8, !tbaa !14
  %41 = call i32 @fputs(ptr noundef nonnull @.str.27, ptr noundef %40) #10
  br label %.preheader._crit_edge

.thread:                                          ; preds = %.lr.ph78, %38
  %.05061 = phi ptr [ %39, %38 ], [ %36, %.lr.ph78 ]
  %42 = load i32, ptr %4, align 8, !tbaa !10
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %4, align 8, !tbaa !10
  %44 = sext i32 %42 to i64
  %45 = getelementptr inbounds [32 x ptr], ptr %17, i64 0, i64 %44
  store ptr %.05061, ptr %45, align 8, !tbaa !14
  %46 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str.14) #8
  %.not54 = icmp eq ptr %46, null
  br i1 %.not54, label %.loopexit, label %.lr.ph78

47:                                               ; preds = %25
  %48 = call i32 @strncmp(ptr noundef nonnull dereferenceable(1) @.str.28, ptr noundef nonnull dereferenceable(1) %2, i64 noundef 5) #9
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %56, label %50

50:                                               ; preds = %47
  %51 = call i32 @strncmp(ptr noundef nonnull dereferenceable(1) @.str.29, ptr noundef nonnull dereferenceable(1) %2, i64 noundef 3) #9
  %52 = icmp eq i32 %51, 0
  br i1 %52, label %56, label %53

53:                                               ; preds = %50
  %54 = call i32 @strncmp(ptr noundef nonnull dereferenceable(1) @.str.30, ptr noundef nonnull dereferenceable(1) %2, i64 noundef 2) #9
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %56, label %84

56:                                               ; preds = %53, %50, %47
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #8
  %57 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %2, ptr noundef nonnull @.str.31, ptr noundef nonnull %8, ptr noundef nonnull %6, ptr noundef nonnull %3, ptr noundef nonnull %7) #8
  %58 = load i32, ptr %11, align 8, !tbaa !11
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [32 x %struct.query_condition], ptr %16, i64 0, i64 %59
  %61 = load i32, ptr %4, align 8, !tbaa !10
  call void @parse_query_literal(ptr noundef nonnull %60, ptr noundef nonnull %6, ptr noundef nonnull %17, i32 noundef %61)
  %62 = getelementptr inbounds i8, ptr %60, i64 2072
  %63 = load i32, ptr %4, align 8, !tbaa !10
  call void @parse_query_literal(ptr noundef nonnull %62, ptr noundef nonnull %7, ptr noundef nonnull %17, i32 noundef %63)
  %64 = getelementptr inbounds i8, ptr %60, i64 4148
  call void @parse_query_operator(ptr noundef nonnull %64, ptr noundef nonnull %3)
  %65 = load i32, ptr %60, align 8, !tbaa !16
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %67, label %71

67:                                               ; preds = %56
  %68 = load i32, ptr %62, align 8, !tbaa !19
  %69 = icmp eq i32 %68, 1
  br i1 %69, label %70, label %71

70:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 2072, ptr nonnull %9)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2072) %9, ptr noundef nonnull align 8 dereferenceable(2072) %60, i64 2072, i1 false), !tbaa.struct !20
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2072) %60, ptr noundef nonnull align 8 dereferenceable(2072) %62, i64 2072, i1 false), !tbaa.struct !20
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2072) %62, ptr noundef nonnull align 8 dereferenceable(2072) %9, i64 2072, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 2072, ptr nonnull %9)
  br label %71

71:                                               ; preds = %70, %67, %56
  %72 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %8, ptr noundef nonnull dereferenceable(1) @.str.28) #9
  %73 = icmp eq i32 %72, 0
  br i1 %73, label %.sink.split, label %74

74:                                               ; preds = %71
  %75 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %8, ptr noundef nonnull dereferenceable(1) @.str.29) #9
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %.sink.split, label %77

77:                                               ; preds = %74
  %78 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %8, ptr noundef nonnull dereferenceable(1) @.str.30) #9
  %79 = icmp eq i32 %78, 0
  br i1 %79, label %.sink.split, label %81

.sink.split:                                      ; preds = %77, %71, %74
  %.sink = phi i32 [ 1, %74 ], [ 1, %71 ], [ 0, %77 ]
  %80 = getelementptr inbounds i8, ptr %60, i64 4144
  store i32 %.sink, ptr %80, align 8, !tbaa !23
  br label %81

81:                                               ; preds = %.sink.split, %77
  %82 = load i32, ptr %11, align 8, !tbaa !11
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #8
  br label %.loopexit

84:                                               ; preds = %53
  %85 = call i32 @strncmp(ptr noundef nonnull dereferenceable(1) @.str.12, ptr noundef nonnull dereferenceable(1) %2, i64 noundef 3) #9
  %86 = icmp eq i32 %85, 0
  br i1 %86, label %89, label %.loopexit

.loopexit:                                        ; preds = %.thread, %31, %84, %81
  %87 = load ptr, ptr @stdin, align 8, !tbaa !14
  %88 = call i32 @feof(ptr noundef %87) #8
  %.not55 = icmp eq i32 %88, 0
  br i1 %.not55, label %25, label %89, !llvm.loop !24

89:                                               ; preds = %84, %.loopexit
  %90 = load i32, ptr %10, align 4, !tbaa !5
  %.not5783 = icmp sgt i32 %90, 0
  br i1 %.not5783, label %.preheader.lr.ph, label %.critedge

.preheader.lr.ph:                                 ; preds = %89
  %91 = getelementptr inbounds i8, ptr %4, i64 272
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %.thread69
  %indvars.iv90 = phi i64 [ 0, %.preheader.lr.ph ], [ %indvars.iv.next91, %.thread69 ]
  %92 = load i32, ptr %4, align 8, !tbaa !10
  %93 = icmp sgt i32 %92, 0
  br i1 %93, label %.lr.ph82, label %.preheader._crit_edge

.lr.ph82:                                         ; preds = %.preheader
  %94 = getelementptr inbounds [32 x [32 x i8]], ptr %5, i64 0, i64 %indvars.iv90
  br label %99

95:                                               ; preds = %99
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %96 = load i32, ptr %4, align 8, !tbaa !10
  %97 = sext i32 %96 to i64
  %98 = icmp slt i64 %indvars.iv.next, %97
  br i1 %98, label %99, label %.preheader._crit_edge, !llvm.loop !25

99:                                               ; preds = %.lr.ph82, %95
  %indvars.iv = phi i64 [ 0, %.lr.ph82 ], [ %indvars.iv.next, %95 ]
  %100 = getelementptr inbounds [32 x ptr], ptr %17, i64 0, i64 %indvars.iv
  %101 = load ptr, ptr %100, align 8, !tbaa !14
  %102 = call i32 @table_find_field(ptr noundef byval(%struct.table_info) align 8 %101, ptr noundef nonnull %94)
  %.not56 = icmp eq i32 %102, -1
  br i1 %.not56, label %95, label %.thread69

.thread69:                                        ; preds = %99
  %103 = getelementptr inbounds [32 x ptr], ptr %17, i64 0, i64 %indvars.iv
  %104 = getelementptr inbounds [32 x %struct.query_field], ptr %91, i64 0, i64 %indvars.iv90
  %105 = load ptr, ptr %103, align 8, !tbaa !14
  %106 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %104, ptr noundef nonnull dereferenceable(1) %105) #8
  %107 = getelementptr inbounds i8, ptr %104, i64 32
  %108 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %107, ptr noundef nonnull dereferenceable(1) %94) #8
  %109 = getelementptr inbounds i8, ptr %104, i64 64
  store i32 %102, ptr %109, align 4, !tbaa !26
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %110 = load i32, ptr %10, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %.not57 = icmp slt i64 %indvars.iv.next91, %111
  br i1 %.not57, label %.preheader, label %.critedge, !llvm.loop !28

.critedge:                                        ; preds = %.thread69, %89
  %112 = load i32, ptr %4, align 8, !tbaa !10
  %113 = icmp eq i32 %112, 1
  br i1 %113, label %114, label %118

114:                                              ; preds = %.critedge
  %115 = call zeroext i1 @has_self_join(ptr noundef nonnull byval(%struct.query) align 8 %4)
  br i1 %115, label %118, label %116

116:                                              ; preds = %114
  %117 = call zeroext i1 @single_query(ptr noundef nonnull byval(%struct.query) align 8 %4)
  br label %.preheader._crit_edge

118:                                              ; preds = %114, %.critedge
  %119 = call zeroext i1 @do_join_query(ptr noundef nonnull byval(%struct.query) align 8 %4)
  br label %.preheader._crit_edge

.preheader._crit_edge:                            ; preds = %.preheader, %95, %.thread64, %1, %116, %118
  %.9 = phi i1 [ %119, %118 ], [ %117, %116 ], [ false, %1 ], [ false, %.thread64 ], [ false, %95 ], [ false, %.preheader ]
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 135312, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %2) #8
  ret i1 %.9
}

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

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

!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, !7, i64 4}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !8, i64 16, !8, i64 272, !8, i64 2448}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 0}
!11 = !{!6, !7, i64 8}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!17, !7, i64 0}
!17 = !{!"", !18, i64 0, !18, i64 2072, !7, i64 4144, !7, i64 4148}
!18 = !{!"", !7, i64 0, !8, i64 4, !15, i64 2056, !7, i64 2064}
!19 = !{!17, !7, i64 2072}
!20 = !{i64 0, i64 4, !21, i64 4, i64 2048, !22, i64 2056, i64 8, !14, i64 2064, i64 4, !21}
!21 = !{!7, !7, i64 0}
!22 = !{!8, !8, i64 0}
!23 = !{!17, !7, i64 4144}
!24 = distinct !{!24, !13}
!25 = distinct !{!25, !13}
!26 = !{!27, !7, i64 64}
!27 = !{!"", !8, i64 0, !8, i64 32, !7, i64 64}
!28 = distinct !{!28, !13}


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