; LLVM IR from themisvaltinos/Partitioned-Hash-Join :: modules/query (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, 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 }
%struct.row_ids = type { i32, i32, ptr }

; 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 uwtable
define dso_local ptr @applyFilters(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %198, %4
  %20 = load i32, ptr %10, align 4, !tbaa !9
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.query, ptr %21, i32 0, i32 2
  %23 = load i32, ptr %22, align 4, !tbaa !11
  %24 = icmp ult i32 %20, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %19
  store i32 2, ptr %11, align 4
  br label %201

26:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.query, ptr %27, i32 0, i32 5
  %29 = load i32, ptr %10, align 4, !tbaa !9
  %30 = zext i32 %29 to i64
  %31 = getelementptr inbounds [16 x %struct.filter_predicate], ptr %28, i64 0, i64 %30
  %32 = getelementptr inbounds %struct.filter_predicate, ptr %31, i32 0, i32 0
  %33 = getelementptr inbounds %struct.column, ptr %32, i32 0, i32 0
  %34 = load i32, ptr %33, align 4, !tbaa !13
  store i32 %34, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.query, ptr %35, i32 0, i32 5
  %37 = load i32, ptr %10, align 4, !tbaa !9
  %38 = zext i32 %37 to i64
  %39 = getelementptr inbounds [16 x %struct.filter_predicate], ptr %36, i64 0, i64 %38
  %40 = getelementptr inbounds %struct.filter_predicate, ptr %39, i32 0, i32 0
  %41 = getelementptr inbounds %struct.column, ptr %40, i32 0, i32 1
  %42 = load i32, ptr %41, align 4, !tbaa !16
  store i32 %42, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = load i32, ptr %12, align 4, !tbaa !9
  %45 = zext i32 %44 to i64
  %46 = getelementptr inbounds ptr, ptr %43, i64 %45
  %47 = load ptr, ptr %46, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.relation, ptr %47, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8, !tbaa !17
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.query, ptr %50, i32 0, i32 5
  %52 = load i32, ptr %10, align 4, !tbaa !9
  %53 = zext i32 %52 to i64
  %54 = getelementptr inbounds [16 x %struct.filter_predicate], ptr %51, i64 0, i64 %53
  %55 = getelementptr inbounds %struct.filter_predicate, ptr %54, i32 0, i32 0
  %56 = getelementptr inbounds %struct.column, ptr %55, i32 0, i32 2
  %57 = load i32, ptr %56, align 4, !tbaa !20
  %58 = zext i32 %57 to i64
  %59 = getelementptr inbounds ptr, ptr %49, i64 %58
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  store ptr %60, ptr %14, align 8, !tbaa !5
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = load i32, ptr %13, align 4, !tbaa !9
  %63 = zext i32 %62 to i64
  %64 = getelementptr inbounds ptr, ptr %61, i64 %63
  %65 = load ptr, ptr %64, align 8, !tbaa !5
  %66 = icmp eq ptr %65, null
  br i1 %66, label %67, label %123

67:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %109, %67
  %69 = load i32, ptr %15, align 4, !tbaa !9
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = load i32, ptr %12, align 4, !tbaa !9
  %72 = zext i32 %71 to i64
  %73 = getelementptr inbounds ptr, ptr %70, i64 %72
  %74 = load ptr, ptr %73, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.relation, ptr %74, i32 0, i32 1
  %76 = load i64, ptr %75, align 8, !tbaa !21
  %77 = trunc i64 %76 to i32
  %78 = icmp ult i32 %69, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %68
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %112

80:                                               ; preds = %68
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.query, ptr %81, i32 0, i32 5
  %83 = load i32, ptr %10, align 4, !tbaa !9
  %84 = zext i32 %83 to i64
  %85 = getelementptr inbounds [16 x %struct.filter_predicate], ptr %82, i64 0, i64 %84
  %86 = getelementptr inbounds %struct.filter_predicate, ptr %85, i32 0, i32 2
  %87 = load i32, ptr %86, align 4, !tbaa !22
  %88 = load ptr, ptr %14, align 8, !tbaa !5
  %89 = load i32, ptr %15, align 4, !tbaa !9
  %90 = zext i32 %89 to i64
  %91 = getelementptr inbounds i64, ptr %88, i64 %90
  %92 = load i64, ptr %91, align 8, !tbaa !23
  %93 = trunc i64 %92 to i32
  %94 = load ptr, ptr %8, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.query, ptr %94, i32 0, i32 5
  %96 = load i32, ptr %10, align 4, !tbaa !9
  %97 = zext i32 %96 to i64
  %98 = getelementptr inbounds [16 x %struct.filter_predicate], ptr %95, i64 0, i64 %97
  %99 = getelementptr inbounds %struct.filter_predicate, ptr %98, i32 0, i32 1
  %100 = load i32, ptr %99, align 4, !tbaa !24
  %101 = call zeroext i1 @predicateHolds(i32 noundef %87, i32 noundef %93, i32 noundef %100)
  br i1 %101, label %102, label %108

102:                                              ; preds = %80
  %103 = load i32, ptr %15, align 4, !tbaa !9
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = load i32, ptr %13, align 4, !tbaa !9
  %106 = zext i32 %105 to i64
  %107 = getelementptr inbounds ptr, ptr %104, i64 %106
  call void @addRowID(i32 noundef %103, ptr noundef %107)
  br label %108

108:                                              ; preds = %102, %80
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %15, align 4, !tbaa !9
  %111 = add i32 %110, 1
  store i32 %111, ptr %15, align 4, !tbaa !9
  br label %68, !llvm.loop !25

112:                                              ; preds = %79
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = load i32, ptr %13, align 4, !tbaa !9
  %115 = zext i32 %114 to i64
  %116 = getelementptr inbounds ptr, ptr %113, i64 %115
  %117 = load ptr, ptr %116, align 8, !tbaa !5
  %118 = icmp eq ptr %117, null
  br i1 %118, label %119, label %122

119:                                              ; preds = %112
  %120 = load ptr, ptr %9, align 8, !tbaa !5
  store i8 1, ptr %120, align 1, !tbaa !27
  %121 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %121, ptr %5, align 8
  store i32 1, ptr %11, align 4
  br label %195

122:                                              ; preds = %112
  br label %194

123:                                              ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  store ptr null, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %124

124:                                              ; preds = %171, %123
  %125 = load i32, ptr %17, align 4, !tbaa !9
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = load i32, ptr %13, align 4, !tbaa !9
  %128 = zext i32 %127 to i64
  %129 = getelementptr inbounds ptr, ptr %126, i64 %128
  %130 = load ptr, ptr %129, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.row_ids, ptr %130, i32 0, i32 0
  %132 = load i32, ptr %131, align 8, !tbaa !29
  %133 = icmp ult i32 %125, %132
  br i1 %133, label %135, label %134

134:                                              ; preds = %124
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %174

135:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %136 = load ptr, ptr %7, align 8, !tbaa !5
  %137 = load i32, ptr %13, align 4, !tbaa !9
  %138 = zext i32 %137 to i64
  %139 = getelementptr inbounds ptr, ptr %136, i64 %138
  %140 = load ptr, ptr %139, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.row_ids, ptr %140, i32 0, i32 2
  %142 = load ptr, ptr %141, align 8, !tbaa !31
  %143 = load i32, ptr %17, align 4, !tbaa !9
  %144 = zext i32 %143 to i64
  %145 = getelementptr inbounds i32, ptr %142, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !9
  store i32 %146, ptr %18, align 4, !tbaa !9
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.query, ptr %147, i32 0, i32 5
  %149 = load i32, ptr %10, align 4, !tbaa !9
  %150 = zext i32 %149 to i64
  %151 = getelementptr inbounds [16 x %struct.filter_predicate], ptr %148, i64 0, i64 %150
  %152 = getelementptr inbounds %struct.filter_predicate, ptr %151, i32 0, i32 2
  %153 = load i32, ptr %152, align 4, !tbaa !22
  %154 = load ptr, ptr %14, align 8, !tbaa !5
  %155 = load i32, ptr %18, align 4, !tbaa !9
  %156 = zext i32 %155 to i64
  %157 = getelementptr inbounds i64, ptr %154, i64 %156
  %158 = load i64, ptr %157, align 8, !tbaa !23
  %159 = trunc i64 %158 to i32
  %160 = load ptr, ptr %8, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.query, ptr %160, i32 0, i32 5
  %162 = load i32, ptr %10, align 4, !tbaa !9
  %163 = zext i32 %162 to i64
  %164 = getelementptr inbounds [16 x %struct.filter_predicate], ptr %161, i64 0, i64 %163
  %165 = getelementptr inbounds %struct.filter_predicate, ptr %164, i32 0, i32 1
  %166 = load i32, ptr %165, align 4, !tbaa !24
  %167 = call zeroext i1 @predicateHolds(i32 noundef %153, i32 noundef %159, i32 noundef %166)
  br i1 %167, label %168, label %170

168:                                              ; preds = %135
  %169 = load i32, ptr %18, align 4, !tbaa !9
  call void @addRowID(i32 noundef %169, ptr noundef %16)
  br label %170

170:                                              ; preds = %168, %135
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %171

171:                                              ; preds = %170
  %172 = load i32, ptr %17, align 4, !tbaa !9
  %173 = add i32 %172, 1
  store i32 %173, ptr %17, align 4, !tbaa !9
  br label %124, !llvm.loop !32

174:                                              ; preds = %134
  %175 = load ptr, ptr %16, align 8, !tbaa !5
  %176 = icmp eq ptr %175, null
  br i1 %176, label %177, label %180

177:                                              ; preds = %174
  %178 = load ptr, ptr %9, align 8, !tbaa !5
  store i8 1, ptr %178, align 1, !tbaa !27
  %179 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %179, ptr %5, align 8
  store i32 1, ptr %11, align 4
  br label %191

180:                                              ; preds = %174
  %181 = load ptr, ptr %7, align 8, !tbaa !5
  %182 = load i32, ptr %13, align 4, !tbaa !9
  %183 = zext i32 %182 to i64
  %184 = getelementptr inbounds ptr, ptr %181, i64 %183
  %185 = load ptr, ptr %184, align 8, !tbaa !5
  call void @free(ptr noundef %185) #4
  %186 = load ptr, ptr %16, align 8, !tbaa !5
  %187 = load ptr, ptr %7, align 8, !tbaa !5
  %188 = load i32, ptr %13, align 4, !tbaa !9
  %189 = zext i32 %188 to i64
  %190 = getelementptr inbounds ptr, ptr %187, i64 %189
  store ptr %186, ptr %190, align 8, !tbaa !5
  store i32 0, ptr %11, align 4
  br label %191

191:                                              ; preds = %180, %177
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  %192 = load i32, ptr %11, align 4
  switch i32 %192, label %195 [
    i32 0, label %193
  ]

193:                                              ; preds = %191
  br label %194

194:                                              ; preds = %193, %122
  store i32 0, ptr %11, align 4
  br label %195

195:                                              ; preds = %194, %191, %119
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  %196 = load i32, ptr %11, align 4
  switch i32 %196, label %201 [
    i32 0, label %197
  ]

197:                                              ; preds = %195
  br label %198

198:                                              ; preds = %197
  %199 = load i32, ptr %10, align 4, !tbaa !9
  %200 = add i32 %199, 1
  store i32 %200, ptr %10, align 4, !tbaa !9
  br label %19, !llvm.loop !33

201:                                              ; preds = %195, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  %202 = load i32, ptr %11, align 4
  switch i32 %202, label %207 [
    i32 2, label %203
    i32 1, label %205
  ]

203:                                              ; preds = %201
  %204 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %204, ptr %5, align 8
  br label %205

205:                                              ; preds = %203, %201
  %206 = load ptr, ptr %5, align 8
  ret ptr %206

207:                                              ; preds = %201
  unreachable
}

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @predicateHolds(i32 noundef, i32 noundef, i32 noundef) #1

declare void @addRowID(i32 noundef, ptr noundef) #2

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

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

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

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


; 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.filter_predicate = type { %struct.column, i32, i32 }
%struct.column = type { i32, i32, i32 }

; 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: nounwind uwtable
define dso_local noundef ptr @applyFilters(ptr nocapture noundef readonly %0, ptr noundef returned %1, ptr nocapture noundef readonly %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #1 {
  %5 = alloca ptr, align 8
  %6 = getelementptr inbounds i8, ptr %2, i64 8
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %.not7176.not = icmp eq i32 %7, 0
  br i1 %.not7176.not, label %.loopexit, label %.lr.ph79

.lr.ph79:                                         ; preds = %4
  %8 = getelementptr inbounds i8, ptr %2, i64 400
  br label %9

9:                                                ; preds = %.lr.ph79, %.thread
  %indvars.iv87 = phi i64 [ 0, %.lr.ph79 ], [ %indvars.iv.next88, %.thread ]
  %10 = getelementptr inbounds [16 x %struct.filter_predicate], ptr %8, i64 0, i64 %indvars.iv87
  %11 = load i32, ptr %10, align 4, !tbaa !10
  %12 = getelementptr inbounds i8, ptr %10, i64 4
  %13 = load i32, ptr %12, align 4, !tbaa !13
  %14 = zext i32 %11 to i64
  %15 = getelementptr inbounds ptr, ptr %0, i64 %14
  %16 = load ptr, ptr %15, align 8, !tbaa !14
  %17 = load ptr, ptr %16, align 8, !tbaa !16
  %18 = getelementptr inbounds i8, ptr %10, i64 8
  %19 = load i32, ptr %18, align 4, !tbaa !19
  %20 = zext i32 %19 to i64
  %21 = getelementptr inbounds ptr, ptr %17, i64 %20
  %22 = load ptr, ptr %21, align 8, !tbaa !14
  %23 = zext i32 %13 to i64
  %24 = getelementptr inbounds ptr, ptr %1, i64 %23
  %25 = load ptr, ptr %24, align 8, !tbaa !14
  %26 = icmp eq ptr %25, null
  br i1 %26, label %.preheader, label %48

.preheader:                                       ; preds = %9
  %27 = getelementptr inbounds i8, ptr %16, i64 8
  %28 = load i64, ptr %27, align 8, !tbaa !20
  %29 = and i64 %28, 4294967295
  %.not81 = icmp eq i64 %29, 0
  br i1 %.not81, label %.thread65, label %.lr.ph74

.lr.ph74:                                         ; preds = %.preheader
  %30 = getelementptr inbounds i8, ptr %10, i64 16
  %31 = getelementptr inbounds i8, ptr %10, i64 12
  br label %33

._crit_edge75:                                    ; preds = %42
  %.pre90 = load ptr, ptr %24, align 8, !tbaa !14
  %32 = icmp eq ptr %.pre90, null
  br i1 %32, label %.thread65, label %.thread

33:                                               ; preds = %.lr.ph74, %42
  %indvars.iv84 = phi i64 [ 0, %.lr.ph74 ], [ %indvars.iv.next85, %42 ]
  %34 = load i32, ptr %30, align 4, !tbaa !21
  %35 = getelementptr inbounds i64, ptr %22, i64 %indvars.iv84
  %36 = load i64, ptr %35, align 8, !tbaa !22
  %37 = trunc i64 %36 to i32
  %38 = load i32, ptr %31, align 4, !tbaa !23
  %39 = call zeroext i1 @predicateHolds(i32 noundef %34, i32 noundef %37, i32 noundef %38)
  br i1 %39, label %40, label %42

40:                                               ; preds = %33
  %41 = trunc nuw i64 %indvars.iv84 to i32
  call void @addRowID(i32 noundef %41, ptr noundef nonnull %24) #4
  br label %42

42:                                               ; preds = %33, %40
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  %43 = load ptr, ptr %15, align 8, !tbaa !14
  %44 = getelementptr inbounds i8, ptr %43, i64 8
  %45 = load i64, ptr %44, align 8, !tbaa !20
  %46 = and i64 %45, 4294967295
  %47 = icmp ult i64 %indvars.iv.next85, %46
  br i1 %47, label %33, label %._crit_edge75, !llvm.loop !24

.thread65:                                        ; preds = %.preheader, %._crit_edge75
  store i8 1, ptr %3, align 1, !tbaa !26
  br label %.loopexit

48:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  store ptr null, ptr %5, align 8, !tbaa !14
  %49 = load i32, ptr %25, align 8, !tbaa !28
  %.not80 = icmp eq i32 %49, 0
  br i1 %.not80, label %._crit_edge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %48
  %50 = getelementptr inbounds i8, ptr %10, i64 16
  %51 = getelementptr inbounds i8, ptr %10, i64 12
  br label %52

._crit_edge:                                      ; preds = %66
  %.pre = load ptr, ptr %5, align 8, !tbaa !14
  %.not = icmp eq ptr %.pre, null
  br i1 %.not, label %._crit_edge.thread, label %.thread68

52:                                               ; preds = %.lr.ph, %66
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %66 ]
  %53 = phi ptr [ %25, %.lr.ph ], [ %67, %66 ]
  %54 = getelementptr inbounds i8, ptr %53, i64 8
  %55 = load ptr, ptr %54, align 8, !tbaa !30
  %56 = getelementptr inbounds i32, ptr %55, i64 %indvars.iv
  %57 = load i32, ptr %56, align 4, !tbaa !31
  %58 = load i32, ptr %50, align 4, !tbaa !21
  %59 = zext i32 %57 to i64
  %60 = getelementptr inbounds i64, ptr %22, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !22
  %62 = trunc i64 %61 to i32
  %63 = load i32, ptr %51, align 4, !tbaa !23
  %64 = call zeroext i1 @predicateHolds(i32 noundef %58, i32 noundef %62, i32 noundef %63)
  br i1 %64, label %65, label %66

65:                                               ; preds = %52
  call void @addRowID(i32 noundef %57, ptr noundef nonnull %5) #4
  br label %66

66:                                               ; preds = %65, %52
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %67 = load ptr, ptr %24, align 8, !tbaa !14
  %68 = load i32, ptr %67, align 8, !tbaa !28
  %69 = zext i32 %68 to i64
  %70 = icmp ult i64 %indvars.iv.next, %69
  br i1 %70, label %52, label %._crit_edge, !llvm.loop !32

.thread68:                                        ; preds = %._crit_edge
  call void @free(ptr noundef nonnull %67) #4
  %71 = load ptr, ptr %5, align 8, !tbaa !14
  store ptr %71, ptr %24, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  br label %.thread

._crit_edge.thread:                               ; preds = %48, %._crit_edge
  store i8 1, ptr %3, align 1, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  br label %.loopexit

.thread:                                          ; preds = %._crit_edge75, %.thread68
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = zext i32 %72 to i64
  %.not71 = icmp ult i64 %indvars.iv.next88, %73
  br i1 %.not71, label %9, label %.loopexit, !llvm.loop !33

.loopexit:                                        ; preds = %.thread, %4, %._crit_edge.thread, %.thread65
  ret ptr %1
}

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @predicateHolds(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @addRowID(i32 noundef, ptr noundef) local_unnamed_addr #2

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

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

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

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


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