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

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

@.str.14 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [1 x i8], align 1

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @decode_temp_table_field(ptr noundef, ptr noundef, i64 noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @index_query(ptr noundef byval(%struct.query) align 8 %0) #3 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca [2048 x i8], align 16
  %5 = alloca %struct.query_condition, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %15 = getelementptr inbounds %struct.query, ptr %0, i32 0, i32 3
  %16 = getelementptr inbounds [32 x ptr], ptr %15, i64 0, i64 0
  %17 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %17, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2048, ptr %4) #5
  %18 = getelementptr inbounds %struct.query, ptr %0, i32 0, i32 2
  %19 = load i32, ptr %18, align 8, !tbaa !9
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %21, label %123

21:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4152, ptr %5) #5
  %22 = getelementptr inbounds %struct.query, ptr %0, i32 0, i32 5
  %23 = getelementptr inbounds [32 x %struct.query_condition], ptr %22, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %5, ptr align 8 %23, i64 4152, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store i64 0, ptr %6, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.table, ptr %24, i32 0, i32 0
  %26 = getelementptr inbounds %struct.table_info, ptr %25, i32 0, i32 3
  %27 = load i64, ptr %26, align 8, !tbaa !17
  %28 = sub i64 %27, 1
  store i64 %28, ptr %7, align 8, !tbaa !15
  br label %29

29:                                               ; preds = %118, %21
  %30 = load i64, ptr %6, align 8, !tbaa !15
  %31 = load i64, ptr %7, align 8, !tbaa !15
  %32 = icmp ule i64 %30, %31
  br i1 %32, label %33, label %119

33:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %34 = load i64, ptr %6, align 8, !tbaa !15
  %35 = load i64, ptr %7, align 8, !tbaa !15
  %36 = load i64, ptr %6, align 8, !tbaa !15
  %37 = sub i64 %35, %36
  %38 = udiv i64 %37, 2
  %39 = add i64 %34, %38
  store i64 %39, ptr %8, align 8, !tbaa !15
  %40 = call i32 (ptr, ...) @printf(ptr noundef @.str.16)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !13
  br label %41

41:                                               ; preds = %63, %33
  %42 = load i32, ptr %9, align 4, !tbaa !13
  %43 = getelementptr inbounds %struct.query, ptr %0, i32 0, i32 1
  %44 = load i32, ptr %43, align 4, !tbaa !21
  %45 = icmp slt i32 %42, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %66

47:                                               ; preds = %41
  %48 = getelementptr inbounds [2048 x i8], ptr %4, i64 0, i64 0
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = load i64, ptr %8, align 8, !tbaa !15
  %51 = getelementptr inbounds %struct.query, ptr %0, i32 0, i32 4
  %52 = load i32, ptr %9, align 4, !tbaa !13
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [32 x %struct.query_field], ptr %51, i64 0, i64 %53
  %55 = getelementptr inbounds %struct.query_field, ptr %54, i32 0, i32 2
  %56 = load i32, ptr %55, align 4, !tbaa !22
  call void @decode_temp_table_field(ptr noundef %48, ptr noundef %49, i64 noundef %50, i32 noundef %56)
  %57 = load i32, ptr %9, align 4, !tbaa !13
  %58 = icmp eq i32 %57, 0
  %59 = zext i1 %58 to i64
  %60 = select i1 %58, ptr @.str.18, ptr @.str.14
  %61 = getelementptr inbounds [2048 x i8], ptr %4, i64 0, i64 0
  %62 = call i32 (ptr, ...) @printf(ptr noundef @.str.17, ptr noundef %60, ptr noundef %61)
  br label %63

63:                                               ; preds = %47
  %64 = load i32, ptr %9, align 4, !tbaa !13
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %9, align 4, !tbaa !13
  br label %41, !llvm.loop !24

66:                                               ; preds = %46
  %67 = call i32 @puts(ptr noundef @.str.18)
  %68 = getelementptr inbounds [2048 x i8], ptr %4, i64 0, i64 0
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = load i64, ptr %8, align 8, !tbaa !15
  call void @decode_temp_table_field(ptr noundef %68, ptr noundef %69, i64 noundef %70, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %71 = getelementptr inbounds %struct.query_condition, ptr %5, i32 0, i32 1
  %72 = getelementptr inbounds %struct.literal, ptr %71, i32 0, i32 1
  %73 = getelementptr inbounds [2048 x i8], ptr %72, i64 0, i64 0
  %74 = getelementptr inbounds [2048 x i8], ptr %4, i64 0, i64 0
  %75 = call i32 @strcmp(ptr noundef %73, ptr noundef %74) #6
  store i32 %75, ptr %10, align 4, !tbaa !13
  %76 = load i32, ptr %10, align 4, !tbaa !13
  %77 = icmp eq i32 %76, 0
  br i1 %77, label %78, label %106

78:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !13
  br label %79

79:                                               ; preds = %101, %78
  %80 = load i32, ptr %11, align 4, !tbaa !13
  %81 = getelementptr inbounds %struct.query, ptr %0, i32 0, i32 1
  %82 = load i32, ptr %81, align 4, !tbaa !21
  %83 = icmp slt i32 %80, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %104

85:                                               ; preds = %79
  %86 = getelementptr inbounds [2048 x i8], ptr %4, i64 0, i64 0
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = load i64, ptr %8, align 8, !tbaa !15
  %89 = getelementptr inbounds %struct.query, ptr %0, i32 0, i32 4
  %90 = load i32, ptr %11, align 4, !tbaa !13
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [32 x %struct.query_field], ptr %89, i64 0, i64 %91
  %93 = getelementptr inbounds %struct.query_field, ptr %92, i32 0, i32 2
  %94 = load i32, ptr %93, align 4, !tbaa !22
  call void @decode_temp_table_field(ptr noundef %86, ptr noundef %87, i64 noundef %88, i32 noundef %94)
  %95 = load i32, ptr %11, align 4, !tbaa !13
  %96 = icmp eq i32 %95, 0
  %97 = zext i1 %96 to i64
  %98 = select i1 %96, ptr @.str.18, ptr @.str.14
  %99 = getelementptr inbounds [2048 x i8], ptr %4, i64 0, i64 0
  %100 = call i32 (ptr, ...) @printf(ptr noundef @.str.17, ptr noundef %98, ptr noundef %99)
  br label %101

101:                                              ; preds = %85
  %102 = load i32, ptr %11, align 4, !tbaa !13
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %11, align 4, !tbaa !13
  br label %79, !llvm.loop !26

104:                                              ; preds = %84
  %105 = call i32 @puts(ptr noundef @.str.18)
  store i1 true, ptr %2, align 1
  store i32 1, ptr %12, align 4
  br label %116

106:                                              ; preds = %66
  %107 = load i32, ptr %10, align 4, !tbaa !13
  %108 = icmp sgt i32 %107, 0
  br i1 %108, label %109, label %112

109:                                              ; preds = %106
  %110 = load i64, ptr %8, align 8, !tbaa !15
  %111 = add i64 %110, 1
  store i64 %111, ptr %6, align 8, !tbaa !15
  br label %115

112:                                              ; preds = %106
  %113 = load i64, ptr %8, align 8, !tbaa !15
  %114 = sub i64 %113, 1
  store i64 %114, ptr %7, align 8, !tbaa !15
  br label %115

115:                                              ; preds = %112, %109
  store i32 0, ptr %12, align 4
  br label %116

116:                                              ; preds = %115, %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %117 = load i32, ptr %12, align 4
  switch i32 %117, label %120 [
    i32 0, label %118
  ]

118:                                              ; preds = %116
  br label %29, !llvm.loop !27

119:                                              ; preds = %29
  store i32 0, ptr %12, align 4
  br label %120

120:                                              ; preds = %119, %116
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4152, ptr %5) #5
  %121 = load i32, ptr %12, align 4
  switch i32 %121, label %167 [
    i32 0, label %122
  ]

122:                                              ; preds = %120
  br label %166

123:                                              ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !13
  br label %124

124:                                              ; preds = %162, %123
  %125 = load i32, ptr %13, align 4, !tbaa !13
  %126 = sext i32 %125 to i64
  %127 = load ptr, ptr %3, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.table, ptr %127, i32 0, i32 0
  %129 = getelementptr inbounds %struct.table_info, ptr %128, i32 0, i32 3
  %130 = load i64, ptr %129, align 8, !tbaa !17
  %131 = icmp ult i64 %126, %130
  br i1 %131, label %133, label %132

132:                                              ; preds = %124
  store i32 10, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %165

133:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !13
  br label %134

134:                                              ; preds = %157, %133
  %135 = load i32, ptr %14, align 4, !tbaa !13
  %136 = getelementptr inbounds %struct.query, ptr %0, i32 0, i32 1
  %137 = load i32, ptr %136, align 4, !tbaa !21
  %138 = icmp slt i32 %135, %137
  br i1 %138, label %140, label %139

139:                                              ; preds = %134
  store i32 13, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %160

140:                                              ; preds = %134
  %141 = getelementptr inbounds [2048 x i8], ptr %4, i64 0, i64 0
  %142 = load ptr, ptr %3, align 8, !tbaa !5
  %143 = load i32, ptr %13, align 4, !tbaa !13
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds %struct.query, ptr %0, i32 0, i32 4
  %146 = load i32, ptr %14, align 4, !tbaa !13
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [32 x %struct.query_field], ptr %145, i64 0, i64 %147
  %149 = getelementptr inbounds %struct.query_field, ptr %148, i32 0, i32 2
  %150 = load i32, ptr %149, align 4, !tbaa !22
  call void @decode_temp_table_field(ptr noundef %141, ptr noundef %142, i64 noundef %144, i32 noundef %150)
  %151 = load i32, ptr %14, align 4, !tbaa !13
  %152 = icmp eq i32 %151, 0
  %153 = zext i1 %152 to i64
  %154 = select i1 %152, ptr @.str.18, ptr @.str.14
  %155 = getelementptr inbounds [2048 x i8], ptr %4, i64 0, i64 0
  %156 = call i32 (ptr, ...) @printf(ptr noundef @.str.17, ptr noundef %154, ptr noundef %155)
  br label %157

157:                                              ; preds = %140
  %158 = load i32, ptr %14, align 4, !tbaa !13
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %14, align 4, !tbaa !13
  br label %134, !llvm.loop !28

160:                                              ; preds = %139
  %161 = call i32 @puts(ptr noundef @.str.18)
  br label %162

162:                                              ; preds = %160
  %163 = load i32, ptr %13, align 4, !tbaa !13
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %13, align 4, !tbaa !13
  br label %124, !llvm.loop !29

165:                                              ; preds = %132
  br label %166

166:                                              ; preds = %165, %122
  store i32 0, ptr %12, align 4
  br label %167

167:                                              ; preds = %166, %120
  call void @llvm.lifetime.end.p0(i64 2048, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  %168 = load i32, ptr %12, align 4
  switch i32 %168, label %171 [
    i32 0, label %169
    i32 1, label %169
  ]

169:                                              ; preds = %167, %167
  %170 = load i1, ptr %2, align 1
  ret i1 %170

171:                                              ; preds = %167
  unreachable
}

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

declare i32 @puts(ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 }
attributes #6 = { 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 8}
!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 = !{i64 0, i64 4, !13, i64 4, i64 2048, !14, i64 2056, i64 8, !5, i64 2064, i64 4, !13, i64 2072, i64 4, !13, i64 2076, i64 2048, !14, i64 4128, i64 8, !5, i64 4136, i64 4, !13, i64 4144, i64 4, !13, i64 4148, i64 4, !13}
!13 = !{!11, !11, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!18, !16, i64 1576}
!18 = !{!"", !19, i64 0, !20, i64 1584, !6, i64 1592, !6, i64 1600}
!19 = !{!"", !7, i64 0, !11, i64 32, !7, i64 40, !16, i64 1576}
!20 = !{!"_Bool", !7, i64 0}
!21 = !{!10, !11, i64 4}
!22 = !{!23, !11, i64 64}
!23 = !{!"", !7, i64 0, !7, i64 32, !11, i64 64}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}
!27 = distinct !{!27, !25}
!28 = distinct !{!28, !25}
!29 = distinct !{!29, !25}


; 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.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 }

@.str.14 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [1 x i8], align 1

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @decode_temp_table_field(ptr noundef, ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @index_query(ptr nocapture noundef readonly byval(%struct.query) align 8 %0) local_unnamed_addr #3 {
  %2 = alloca [2048 x i8], align 16
  %3 = alloca %struct.query_condition, align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 16
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %2) #5
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = load i32, ptr %6, align 8, !tbaa !9
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %22, label %.preheader49

.preheader49:                                     ; preds = %1
  %9 = getelementptr inbounds i8, ptr %5, i64 1576
  %10 = load i64, ptr %9, align 8, !tbaa !12
  %.not59 = icmp eq i64 %10, 0
  br i1 %.not59, label %.loopexit, label %.preheader48.lr.ph

.preheader48.lr.ph:                               ; preds = %.preheader49
  %11 = getelementptr inbounds i8, ptr %0, i64 4
  %12 = load i32, ptr %11, align 4, !tbaa !17
  %13 = icmp sgt i32 %12, 0
  %14 = getelementptr inbounds i8, ptr %0, i64 272
  br i1 %13, label %.preheader48.us.preheader, label %.preheader48

.preheader48.us.preheader:                        ; preds = %.preheader48.lr.ph
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 336
  %.pre = load i32, ptr %.phi.trans.insert, align 8, !tbaa !18
  %wide.trip.count = zext nneg i32 %12 to i64
  %exitcond.peel.not = icmp eq i32 %12, 1
  br label %.preheader48.us

.preheader48.us:                                  ; preds = %.preheader48.us.preheader, %._crit_edge.us
  %indvars.iv69 = phi i64 [ 0, %.preheader48.us.preheader ], [ %indvars.iv.next70, %._crit_edge.us ]
  call void @decode_temp_table_field(ptr noundef nonnull %2, ptr noundef nonnull %5, i64 noundef %indvars.iv69, i32 noundef %.pre)
  %15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, ptr noundef nonnull @.str.18, ptr noundef nonnull %2)
  br i1 %exitcond.peel.not, label %._crit_edge.us, label %.peel.next

.peel.next:                                       ; preds = %.preheader48.us, %.peel.next
  %indvars.iv65 = phi i64 [ %indvars.iv.next66, %.peel.next ], [ 1, %.preheader48.us ]
  %16 = getelementptr inbounds [32 x %struct.query_field], ptr %14, i64 0, i64 %indvars.iv65, i32 2
  %17 = load i32, ptr %16, align 4, !tbaa !18
  call void @decode_temp_table_field(ptr noundef nonnull %2, ptr noundef %5, i64 noundef %indvars.iv69, i32 noundef %17)
  %18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, ptr noundef nonnull @.str.14, ptr noundef nonnull %2)
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next66, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.us, label %.peel.next, !llvm.loop !20

._crit_edge.us:                                   ; preds = %.peel.next, %.preheader48.us
  %19 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.18)
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %20 = load i64, ptr %9, align 8, !tbaa !12
  %21 = icmp ugt i64 %20, %indvars.iv.next70
  br i1 %21, label %.preheader48.us, label %.loopexit, !llvm.loop !23

22:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4152, ptr nonnull %3) #5
  %23 = getelementptr inbounds i8, ptr %0, i64 2448
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(4152) %3, ptr noundef nonnull align 8 dereferenceable(4152) %23, i64 4152, i1 false), !tbaa.struct !24
  %24 = getelementptr inbounds i8, ptr %5, i64 1576
  %25 = load i64, ptr %24, align 8, !tbaa !12
  %26 = add i64 %25, -1
  %27 = getelementptr inbounds i8, ptr %0, i64 4
  %28 = load i32, ptr %27, align 4
  %.fr60 = freeze i32 %28
  %29 = icmp sgt i32 %.fr60, 0
  %30 = getelementptr inbounds i8, ptr %0, i64 272
  %31 = getelementptr inbounds i8, ptr %3, i64 2076
  br i1 %29, label %.split.us.preheader, label %.split.preheader

.split.us.preheader:                              ; preds = %22
  %wide.trip.count81 = zext nneg i32 %.fr60 to i64
  %32 = getelementptr inbounds i8, ptr %0, i64 336
  %33 = load i32, ptr %32, align 8
  %exitcond82.peel.not = icmp eq i32 %.fr60, 1
  br label %.split.us

.split.us:                                        ; preds = %.split.us.preheader, %44
  %.042.us = phi i64 [ %.244.us, %44 ], [ %26, %.split.us.preheader ]
  %.039.us = phi i64 [ %.2.us, %44 ], [ 0, %.split.us.preheader ]
  %.not.us = icmp ugt i64 %.039.us, %.042.us
  br i1 %.not.us, label %.critedge, label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.split.us
  %34 = sub i64 %.042.us, %.039.us
  %35 = lshr i64 %34, 1
  %36 = add i64 %35, %.039.us
  %37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16)
  call void @decode_temp_table_field(ptr noundef nonnull %2, ptr noundef %5, i64 noundef %36, i32 noundef %33)
  %38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, ptr noundef nonnull @.str.18, ptr noundef nonnull %2)
  br i1 %exitcond82.peel.not, label %._crit_edge.us56, label %.peel.next84

39:                                               ; preds = %._crit_edge.us56
  %40 = icmp sgt i32 %53, 0
  %41 = add i64 %36, 1
  %42 = add i64 %36, -1
  %.143.us = select i1 %40, i64 %.042.us, i64 %42
  %.140.us = select i1 %40, i64 %41, i64 %.039.us
  br label %44

._crit_edge55.us:                                 ; preds = %.lr.ph54.us, %.lr.ph54.us.preheader
  %43 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.18)
  br label %44

44:                                               ; preds = %._crit_edge55.us, %39
  %.244.us = phi i64 [ %.042.us, %._crit_edge55.us ], [ %.143.us, %39 ]
  %.2.us = phi i64 [ %.039.us, %._crit_edge55.us ], [ %.140.us, %39 ]
  br i1 %.not47.us, label %.split58.us, label %.split.us, !llvm.loop !27

.lr.ph54.us:                                      ; preds = %.lr.ph54.us.preheader, %.lr.ph54.us
  %indvars.iv86 = phi i64 [ %indvars.iv.next87, %.lr.ph54.us ], [ 1, %.lr.ph54.us.preheader ]
  %45 = getelementptr inbounds [32 x %struct.query_field], ptr %30, i64 0, i64 %indvars.iv86, i32 2
  %46 = load i32, ptr %45, align 4, !tbaa !18
  call void @decode_temp_table_field(ptr noundef nonnull %2, ptr noundef %5, i64 noundef %36, i32 noundef %46)
  %47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, ptr noundef nonnull @.str.14, ptr noundef nonnull %2)
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %exitcond90.not = icmp eq i64 %indvars.iv.next87, %wide.trip.count81
  br i1 %exitcond90.not, label %._crit_edge55.us, label %.lr.ph54.us, !llvm.loop !28

.peel.next84:                                     ; preds = %.lr.ph.us, %.peel.next84
  %indvars.iv78 = phi i64 [ %indvars.iv.next79, %.peel.next84 ], [ 1, %.lr.ph.us ]
  %48 = getelementptr inbounds [32 x %struct.query_field], ptr %30, i64 0, i64 %indvars.iv78, i32 2
  %49 = load i32, ptr %48, align 4, !tbaa !18
  call void @decode_temp_table_field(ptr noundef nonnull %2, ptr noundef %5, i64 noundef %36, i32 noundef %49)
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, ptr noundef nonnull @.str.14, ptr noundef nonnull %2)
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %exitcond82.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count81
  br i1 %exitcond82.not, label %._crit_edge.us56, label %.peel.next84, !llvm.loop !29

.lr.ph54.us.preheader:                            ; preds = %._crit_edge.us56
  call void @decode_temp_table_field(ptr noundef nonnull %2, ptr noundef %5, i64 noundef %36, i32 noundef %33)
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, ptr noundef nonnull @.str.18, ptr noundef nonnull %2)
  br i1 %exitcond82.peel.not, label %._crit_edge55.us, label %.lr.ph54.us

._crit_edge.us56:                                 ; preds = %.peel.next84, %.lr.ph.us
  %52 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.18)
  call void @decode_temp_table_field(ptr noundef nonnull %2, ptr noundef %5, i64 noundef %36, i32 noundef 0)
  %53 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %31, ptr noundef nonnull dereferenceable(1) %2) #6
  %.not47.us = icmp eq i32 %53, 0
  br i1 %.not47.us, label %.lr.ph54.us.preheader, label %39

.split.preheader:                                 ; preds = %22, %.split
  %.039100 = phi i64 [ %.140, %.split ], [ 0, %22 ]
  %.04299 = phi i64 [ %.143, %.split ], [ %26, %22 ]
  %54 = sub i64 %.04299, %.039100
  %55 = lshr i64 %54, 1
  %56 = add i64 %55, %.039100
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16)
  %58 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.18)
  call void @decode_temp_table_field(ptr noundef nonnull %2, ptr noundef %5, i64 noundef %56, i32 noundef 0)
  %59 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %31, ptr noundef nonnull dereferenceable(1) %2) #6
  %.not47 = icmp eq i32 %59, 0
  br i1 %.not47, label %.split58.us.loopexit62, label %.split

.split:                                           ; preds = %.split.preheader
  %60 = icmp sgt i32 %59, 0
  %61 = add i64 %56, 1
  %62 = add i64 %56, -1
  %.143 = select i1 %60, i64 %.04299, i64 %62
  %.140 = select i1 %60, i64 %61, i64 %.039100
  %.not = icmp ugt i64 %.140, %.143
  br i1 %.not, label %.critedge, label %.split.preheader, !llvm.loop !27

.split58.us.loopexit62:                           ; preds = %.split.preheader
  %63 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.18)
  br label %.split58.us

.split58.us:                                      ; preds = %44, %.split58.us.loopexit62
  call void @llvm.lifetime.end.p0(i64 4152, ptr nonnull %3) #5
  br label %.loopexit

.preheader48:                                     ; preds = %.preheader48.lr.ph, %.preheader48
  %indvars.iv = phi i64 [ %indvars.iv.next, %.preheader48 ], [ 0, %.preheader48.lr.ph ]
  %64 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.18)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %65 = load i64, ptr %9, align 8, !tbaa !12
  %66 = icmp ugt i64 %65, %indvars.iv.next
  br i1 %66, label %.preheader48, label %.loopexit, !llvm.loop !23

.critedge:                                        ; preds = %.split, %.split.us
  call void @llvm.lifetime.end.p0(i64 4152, ptr nonnull %3) #5
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader48, %._crit_edge.us, %.preheader49, %.split58.us, %.critedge
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %2) #5
  ret i1 true
}

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { nounwind }
attributes #6 = { 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 8}
!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 = !{!13, !15, i64 1576}
!13 = !{!"", !14, i64 0, !16, i64 1584, !6, i64 1592, !6, i64 1600}
!14 = !{!"", !7, i64 0, !11, i64 32, !7, i64 40, !15, i64 1576}
!15 = !{!"long", !7, i64 0}
!16 = !{!"_Bool", !7, i64 0}
!17 = !{!10, !11, i64 4}
!18 = !{!19, !11, i64 64}
!19 = !{!"", !7, i64 0, !7, i64 32, !11, i64 64}
!20 = distinct !{!20, !21, !22}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!"llvm.loop.peeled.count", i32 1}
!23 = distinct !{!23, !21}
!24 = !{i64 0, i64 4, !25, i64 4, i64 2048, !26, i64 2056, i64 8, !5, i64 2064, i64 4, !25, i64 2072, i64 4, !25, i64 2076, i64 2048, !26, i64 4128, i64 8, !5, i64 4136, i64 4, !25, i64 4144, i64 4, !25, i64 4148, i64 4, !25}
!25 = !{!11, !11, i64 0}
!26 = !{!7, !7, i64 0}
!27 = distinct !{!27, !21}
!28 = distinct !{!28, !21, !22}
!29 = distinct !{!29, !21, !22}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass