; LLVM IR from eProsima/Fast-DDS :: src/cpp/rtps/persistence (sqlite3)

; 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.sqlite3 = type { ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i64, i64, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i64, i64, [12 x i32], i32, %struct.sqlite3InitInfo, i32, i32, i32, i32, i32, i32, ptr, %union.anon, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %union.anon.0, %struct.Lookaside, ptr, ptr, ptr, ptr, i32, i32, %struct.Hash, ptr, ptr, ptr, %struct.Hash, %struct.Hash, %struct.BusyHandler, [2 x %struct.Db], ptr, i32, i32, i32, i32, i64, i64, ptr, ptr }
%struct.sqlite3InitInfo = type { i32, i8, i8, i8, ptr }
%union.anon = type { ptr }
%union.anon.0 = type { double }
%struct.Lookaside = type { i32, i16, i16, i8, i32, [3 x i32], ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.Hash = type { i32, i32, ptr, ptr }
%struct.BusyHandler = type { ptr, ptr, i32 }
%struct.Db = type { ptr, ptr, i8, i8, ptr }
%struct.Table = type { ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i16, i16, i16, i16, i16, i8, i8, %union.anon.12, ptr, ptr }
%union.anon.12 = type { %struct.anon.13 }
%struct.anon.13 = type { i32, ptr, ptr }
%struct.Column = type { ptr, i8, i8, i8, i8, i16, i16 }

@.str.28 = external hidden unnamed_addr constant [3 x i8], align 1
@sqlite3StrBINARY = external hidden constant [7 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [28 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: nounwind uwtable
declare dso_local void @sqlite3_mutex_enter(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @sqlite3_mutex_leave(ptr noundef) #1

; 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
declare hidden void @sqlite3BtreeEnterAll(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @sqlite3BtreeLeaveAll(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @sqlite3DbFree(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @sqlite3StrICmp(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @sqlite3ErrorWithMsg(ptr noundef, i32 noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @sqlite3ApiExit(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare hidden ptr @sqlite3MPrintf(ptr noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @sqlite3_table_column_metadata(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8) #1 {
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store ptr %2, ptr %12, align 8, !tbaa !5
  store ptr %3, ptr %13, align 8, !tbaa !5
  store ptr %4, ptr %14, align 8, !tbaa !5
  store ptr %5, ptr %15, align 8, !tbaa !5
  store ptr %6, ptr %16, align 8, !tbaa !5
  store ptr %7, ptr %17, align 8, !tbaa !5
  store ptr %8, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #2
  store ptr null, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #2
  store ptr null, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #2
  store ptr null, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #2
  store i32 0, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #2
  store ptr null, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #2
  store ptr null, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #2
  store i32 0, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #2
  store i32 0, ptr %27, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #2
  store i32 0, ptr %28, align 4, !tbaa !9
  %29 = load ptr, ptr %10, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.sqlite3, ptr %29, i32 0, i32 3
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  call void @sqlite3_mutex_enter(ptr noundef %31)
  %32 = load ptr, ptr %10, align 8, !tbaa !5
  call void @sqlite3BtreeEnterAll(ptr noundef %32)
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = call i32 @sqlite3Init(ptr noundef %33, ptr noundef %20)
  store i32 %34, ptr %19, align 4, !tbaa !9
  %35 = load i32, ptr %19, align 4, !tbaa !9
  %36 = icmp ne i32 0, %35
  br i1 %36, label %37, label %38

37:                                               ; preds = %9
  br label %162

38:                                               ; preds = %9
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  %41 = load ptr, ptr %11, align 8, !tbaa !5
  %42 = call ptr @sqlite3FindTable(ptr noundef %39, ptr noundef %40, ptr noundef %41)
  store ptr %42, ptr %21, align 8, !tbaa !5
  %43 = load ptr, ptr %21, align 8, !tbaa !5
  %44 = icmp ne ptr %43, null
  br i1 %44, label %45, label %51

45:                                               ; preds = %38
  %46 = load ptr, ptr %21, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.Table, ptr %46, i32 0, i32 14
  %48 = load i8, ptr %47, align 1, !tbaa !19
  %49 = zext i8 %48 to i32
  %50 = icmp eq i32 %49, 2
  br i1 %50, label %51, label %52

51:                                               ; preds = %45, %38
  store ptr null, ptr %21, align 8, !tbaa !5
  br label %162

52:                                               ; preds = %45
  %53 = load ptr, ptr %13, align 8, !tbaa !5
  %54 = icmp eq ptr %53, null
  br i1 %54, label %55, label %56

55:                                               ; preds = %52
  br label %119

56:                                               ; preds = %52
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %79, %56
  %58 = load i32, ptr %23, align 4, !tbaa !9
  %59 = load ptr, ptr %21, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.Table, ptr %59, i32 0, i32 9
  %61 = load i16, ptr %60, align 2, !tbaa !21
  %62 = sext i16 %61 to i32
  %63 = icmp slt i32 %58, %62
  br i1 %63, label %64, label %82

64:                                               ; preds = %57
  %65 = load ptr, ptr %21, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.Table, ptr %65, i32 0, i32 1
  %67 = load ptr, ptr %66, align 8, !tbaa !22
  %68 = load i32, ptr %23, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds %struct.Column, ptr %67, i64 %69
  store ptr %70, ptr %22, align 8, !tbaa !5
  %71 = load ptr, ptr %22, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.Column, ptr %71, i32 0, i32 0
  %73 = load ptr, ptr %72, align 8, !tbaa !23
  %74 = load ptr, ptr %13, align 8, !tbaa !5
  %75 = call i32 @sqlite3StrICmp(ptr noundef %73, ptr noundef %74)
  %76 = icmp eq i32 0, %75
  br i1 %76, label %77, label %78

77:                                               ; preds = %64
  br label %82

78:                                               ; preds = %64
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %23, align 4, !tbaa !9
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %23, align 4, !tbaa !9
  br label %57, !llvm.loop !25

82:                                               ; preds = %77, %57
  %83 = load i32, ptr %23, align 4, !tbaa !9
  %84 = load ptr, ptr %21, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.Table, ptr %84, i32 0, i32 9
  %86 = load i16, ptr %85, align 2, !tbaa !21
  %87 = sext i16 %86 to i32
  %88 = icmp eq i32 %83, %87
  br i1 %88, label %89, label %118

89:                                               ; preds = %82
  %90 = load ptr, ptr %21, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.Table, ptr %90, i32 0, i32 7
  %92 = load i32, ptr %91, align 8, !tbaa !27
  %93 = and i32 %92, 128
  %94 = icmp eq i32 %93, 0
  br i1 %94, label %95, label %116

95:                                               ; preds = %89
  %96 = load ptr, ptr %13, align 8, !tbaa !5
  %97 = call i32 @sqlite3IsRowid(ptr noundef %96)
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %116

99:                                               ; preds = %95
  %100 = load ptr, ptr %21, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.Table, ptr %100, i32 0, i32 8
  %102 = load i16, ptr %101, align 4, !tbaa !28
  %103 = sext i16 %102 to i32
  store i32 %103, ptr %23, align 4, !tbaa !9
  %104 = load i32, ptr %23, align 4, !tbaa !9
  %105 = icmp sge i32 %104, 0
  br i1 %105, label %106, label %113

106:                                              ; preds = %99
  %107 = load ptr, ptr %21, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.Table, ptr %107, i32 0, i32 1
  %109 = load ptr, ptr %108, align 8, !tbaa !22
  %110 = load i32, ptr %23, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds %struct.Column, ptr %109, i64 %111
  br label %114

113:                                              ; preds = %99
  br label %114

114:                                              ; preds = %113, %106
  %115 = phi ptr [ %112, %106 ], [ null, %113 ]
  store ptr %115, ptr %22, align 8, !tbaa !5
  br label %117

116:                                              ; preds = %95, %89
  store ptr null, ptr %21, align 8, !tbaa !5
  br label %162

117:                                              ; preds = %114
  br label %118

118:                                              ; preds = %117, %82
  br label %119

119:                                              ; preds = %118, %55
  %120 = load ptr, ptr %22, align 8, !tbaa !5
  %121 = icmp ne ptr %120, null
  br i1 %121, label %122, label %156

122:                                              ; preds = %119
  %123 = load ptr, ptr %22, align 8, !tbaa !5
  %124 = call ptr @sqlite3ColumnType(ptr noundef %123, ptr noundef null)
  store ptr %124, ptr %24, align 8, !tbaa !5
  %125 = load ptr, ptr %22, align 8, !tbaa !5
  %126 = call ptr @sqlite3ColumnColl(ptr noundef %125)
  store ptr %126, ptr %25, align 8, !tbaa !5
  %127 = load ptr, ptr %22, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.Column, ptr %127, i32 0, i32 1
  %129 = load i8, ptr %128, align 8
  %130 = and i8 %129, 15
  %131 = zext i8 %130 to i32
  %132 = icmp ne i32 %131, 0
  %133 = zext i1 %132 to i32
  store i32 %133, ptr %26, align 4, !tbaa !9
  %134 = load ptr, ptr %22, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.Column, ptr %134, i32 0, i32 6
  %136 = load i16, ptr %135, align 2, !tbaa !29
  %137 = zext i16 %136 to i32
  %138 = and i32 %137, 1
  %139 = icmp ne i32 %138, 0
  %140 = zext i1 %139 to i32
  store i32 %140, ptr %27, align 4, !tbaa !9
  %141 = load ptr, ptr %21, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.Table, ptr %141, i32 0, i32 8
  %143 = load i16, ptr %142, align 4, !tbaa !28
  %144 = sext i16 %143 to i32
  %145 = load i32, ptr %23, align 4, !tbaa !9
  %146 = icmp eq i32 %144, %145
  br i1 %146, label %147, label %153

147:                                              ; preds = %122
  %148 = load ptr, ptr %21, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.Table, ptr %148, i32 0, i32 7
  %150 = load i32, ptr %149, align 8, !tbaa !27
  %151 = and i32 %150, 8
  %152 = icmp ne i32 %151, 0
  br label %153

153:                                              ; preds = %147, %122
  %154 = phi i1 [ false, %122 ], [ %152, %147 ]
  %155 = zext i1 %154 to i32
  store i32 %155, ptr %28, align 4, !tbaa !9
  br label %157

156:                                              ; preds = %119
  store ptr @.str.38, ptr %24, align 8, !tbaa !5
  store i32 1, ptr %27, align 4, !tbaa !9
  br label %157

157:                                              ; preds = %156, %153
  %158 = load ptr, ptr %25, align 8, !tbaa !5
  %159 = icmp ne ptr %158, null
  br i1 %159, label %161, label %160

160:                                              ; preds = %157
  store ptr @sqlite3StrBINARY, ptr %25, align 8, !tbaa !5
  br label %161

161:                                              ; preds = %160, %157
  br label %162

162:                                              ; preds = %161, %116, %51, %37
  %163 = load ptr, ptr %10, align 8, !tbaa !5
  call void @sqlite3BtreeLeaveAll(ptr noundef %163)
  %164 = load ptr, ptr %14, align 8, !tbaa !5
  %165 = icmp ne ptr %164, null
  br i1 %165, label %166, label %169

166:                                              ; preds = %162
  %167 = load ptr, ptr %24, align 8, !tbaa !5
  %168 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %167, ptr %168, align 8, !tbaa !5
  br label %169

169:                                              ; preds = %166, %162
  %170 = load ptr, ptr %15, align 8, !tbaa !5
  %171 = icmp ne ptr %170, null
  br i1 %171, label %172, label %175

172:                                              ; preds = %169
  %173 = load ptr, ptr %25, align 8, !tbaa !5
  %174 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %173, ptr %174, align 8, !tbaa !5
  br label %175

175:                                              ; preds = %172, %169
  %176 = load ptr, ptr %16, align 8, !tbaa !5
  %177 = icmp ne ptr %176, null
  br i1 %177, label %178, label %181

178:                                              ; preds = %175
  %179 = load i32, ptr %26, align 4, !tbaa !9
  %180 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 %179, ptr %180, align 4, !tbaa !9
  br label %181

181:                                              ; preds = %178, %175
  %182 = load ptr, ptr %17, align 8, !tbaa !5
  %183 = icmp ne ptr %182, null
  br i1 %183, label %184, label %187

184:                                              ; preds = %181
  %185 = load i32, ptr %27, align 4, !tbaa !9
  %186 = load ptr, ptr %17, align 8, !tbaa !5
  store i32 %185, ptr %186, align 4, !tbaa !9
  br label %187

187:                                              ; preds = %184, %181
  %188 = load ptr, ptr %18, align 8, !tbaa !5
  %189 = icmp ne ptr %188, null
  br i1 %189, label %190, label %193

190:                                              ; preds = %187
  %191 = load i32, ptr %28, align 4, !tbaa !9
  %192 = load ptr, ptr %18, align 8, !tbaa !5
  store i32 %191, ptr %192, align 4, !tbaa !9
  br label %193

193:                                              ; preds = %190, %187
  %194 = load i32, ptr %19, align 4, !tbaa !9
  %195 = icmp eq i32 0, %194
  br i1 %195, label %196, label %206

196:                                              ; preds = %193
  %197 = load ptr, ptr %21, align 8, !tbaa !5
  %198 = icmp ne ptr %197, null
  br i1 %198, label %206, label %199

199:                                              ; preds = %196
  %200 = load ptr, ptr %10, align 8, !tbaa !5
  %201 = load ptr, ptr %20, align 8, !tbaa !5
  call void @sqlite3DbFree(ptr noundef %200, ptr noundef %201)
  %202 = load ptr, ptr %10, align 8, !tbaa !5
  %203 = load ptr, ptr %12, align 8, !tbaa !5
  %204 = load ptr, ptr %13, align 8, !tbaa !5
  %205 = call ptr (ptr, ptr, ...) @sqlite3MPrintf(ptr noundef %202, ptr noundef @.str.39, ptr noundef %203, ptr noundef %204)
  store ptr %205, ptr %20, align 8, !tbaa !5
  store i32 1, ptr %19, align 4, !tbaa !9
  br label %206

206:                                              ; preds = %199, %196, %193
  %207 = load ptr, ptr %10, align 8, !tbaa !5
  %208 = load i32, ptr %19, align 4, !tbaa !9
  %209 = load ptr, ptr %20, align 8, !tbaa !5
  %210 = icmp ne ptr %209, null
  %211 = zext i1 %210 to i64
  %212 = select i1 %210, ptr @.str.28, ptr null
  %213 = load ptr, ptr %20, align 8, !tbaa !5
  call void (ptr, i32, ptr, ...) @sqlite3ErrorWithMsg(ptr noundef %207, i32 noundef %208, ptr noundef %212, ptr noundef %213)
  %214 = load ptr, ptr %10, align 8, !tbaa !5
  %215 = load ptr, ptr %20, align 8, !tbaa !5
  call void @sqlite3DbFree(ptr noundef %214, ptr noundef %215)
  %216 = load ptr, ptr %10, align 8, !tbaa !5
  %217 = load i32, ptr %19, align 4, !tbaa !9
  %218 = call i32 @sqlite3ApiExit(ptr noundef %216, i32 noundef %217)
  store i32 %218, ptr %19, align 4, !tbaa !9
  %219 = load ptr, ptr %10, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.sqlite3, ptr %219, i32 0, i32 3
  %221 = load ptr, ptr %220, align 8, !tbaa !11
  call void @sqlite3_mutex_leave(ptr noundef %221)
  %222 = load i32, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #2
  ret i32 %222
}

; Function Attrs: nounwind uwtable
declare hidden i32 @sqlite3Init(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden ptr @sqlite3FindTable(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @sqlite3IsRowid(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden ptr @sqlite3ColumnType(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden ptr @sqlite3ColumnColl(ptr noundef) #1

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 = { 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, !6, i64 24}
!12 = !{!"sqlite3", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40, !10, i64 44, !13, i64 48, !13, i64 56, !13, i64 64, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !7, i64 100, !7, i64 101, !7, i64 102, !7, i64 103, !7, i64 104, !7, i64 105, !7, i64 106, !7, i64 107, !7, i64 108, !7, i64 109, !7, i64 110, !7, i64 111, !7, i64 112, !7, i64 113, !10, i64 116, !13, i64 120, !13, i64 128, !7, i64 136, !10, i64 184, !14, i64 192, !10, i64 208, !10, i64 212, !10, i64 216, !10, i64 220, !10, i64 224, !10, i64 228, !6, i64 232, !7, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !6, i64 392, !7, i64 400, !15, i64 408, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !10, i64 536, !10, i64 540, !17, i64 544, !6, i64 568, !6, i64 576, !6, i64 584, !17, i64 592, !17, i64 616, !18, i64 640, !7, i64 664, !6, i64 728, !10, i64 736, !10, i64 740, !10, i64 744, !10, i64 748, !13, i64 752, !13, i64 760, !6, i64 768, !6, i64 776}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"sqlite3InitInfo", !10, i64 0, !7, i64 4, !7, i64 5, !10, i64 6, !10, i64 6, !10, i64 6, !6, i64 8}
!15 = !{!"Lookaside", !10, i64 0, !16, i64 4, !16, i64 6, !7, i64 8, !10, i64 12, !7, i64 16, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88}
!16 = !{!"short", !7, i64 0}
!17 = !{!"Hash", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16}
!18 = !{!"BusyHandler", !6, i64 0, !6, i64 8, !10, i64 16}
!19 = !{!20, !7, i64 63}
!20 = !{!"Table", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40, !10, i64 44, !10, i64 48, !16, i64 52, !16, i64 54, !16, i64 56, !16, i64 58, !16, i64 60, !7, i64 62, !7, i64 63, !7, i64 64, !6, i64 88, !6, i64 96}
!21 = !{!20, !16, i64 54}
!22 = !{!20, !6, i64 8}
!23 = !{!24, !6, i64 0}
!24 = !{!"Column", !6, i64 0, !10, i64 8, !10, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !16, i64 12, !16, i64 14}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!20, !10, i64 48}
!28 = !{!20, !16, i64 52}
!29 = !{!24, !16, i64 14}


; 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.Column = type { ptr, i8, i8, i8, i8, i16, i16 }

@.str.28 = external hidden unnamed_addr constant [3 x i8], align 1
@sqlite3StrBINARY = external hidden constant [7 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [28 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: nounwind uwtable
declare dso_local void @sqlite3_mutex_enter(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @sqlite3_mutex_leave(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare hidden void @sqlite3BtreeEnterAll(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @sqlite3BtreeLeaveAll(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @sqlite3DbFree(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @sqlite3StrICmp(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @sqlite3ErrorWithMsg(ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @sqlite3ApiExit(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden ptr @sqlite3MPrintf(ptr noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i32 @sqlite3_table_column_metadata(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef writeonly %4, ptr noundef writeonly %5, ptr noundef writeonly %6, ptr noundef writeonly %7, ptr noundef writeonly %8) local_unnamed_addr #1 {
  %10 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #2
  store ptr null, ptr %10, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 24
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  tail call void @sqlite3_mutex_enter(ptr noundef %12)
  tail call void @sqlite3BtreeEnterAll(ptr noundef %0)
  %13 = call i32 @sqlite3Init(ptr noundef %0, ptr noundef nonnull %10)
  %14 = icmp ne i32 %13, 0
  br i1 %14, label %73, label %15

15:                                               ; preds = %9
  %16 = call ptr @sqlite3FindTable(ptr noundef nonnull %0, ptr noundef %2, ptr noundef %1)
  %.not = icmp eq ptr %16, null
  br i1 %.not, label %73, label %17

17:                                               ; preds = %15
  %18 = getelementptr inbounds i8, ptr %16, i64 63
  %19 = load i8, ptr %18, align 1, !tbaa !18
  %20 = icmp eq i8 %19, 2
  br i1 %20, label %73, label %21

21:                                               ; preds = %17
  %22 = icmp eq ptr %3, null
  br i1 %22, label %.thread, label %.preheader

.preheader:                                       ; preds = %21
  %23 = getelementptr inbounds i8, ptr %16, i64 8
  %24 = getelementptr inbounds i8, ptr %16, i64 54
  %25 = load i16, ptr %24, align 2, !tbaa !20
  %26 = icmp sgt i16 %25, 0
  br i1 %26, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader, %32
  %indvars.iv = phi i64 [ %indvars.iv.next, %32 ], [ 0, %.preheader ]
  %27 = load ptr, ptr %23, align 8, !tbaa !21
  %28 = getelementptr inbounds %struct.Column, ptr %27, i64 %indvars.iv
  %29 = load ptr, ptr %28, align 8, !tbaa !22
  %30 = call i32 @sqlite3StrICmp(ptr noundef %29, ptr noundef nonnull %3)
  %31 = icmp eq i32 %30, 0
  %.pre.pre = load i16, ptr %24, align 2, !tbaa !20
  br i1 %31, label %._crit_edge.loopexit, label %32

32:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %33 = sext i16 %.pre.pre to i64
  %34 = icmp slt i64 %indvars.iv.next, %33
  br i1 %34, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !24

._crit_edge.loopexit:                             ; preds = %.lr.ph, %32
  %.071.lcssa.ph.in = phi i64 [ %indvars.iv.next, %32 ], [ %indvars.iv, %.lr.ph ]
  %.071.lcssa.ph = trunc i64 %.071.lcssa.ph.in to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %35 = phi i16 [ %25, %.preheader ], [ %.pre.pre, %._crit_edge.loopexit ]
  %.071.lcssa = phi i32 [ 0, %.preheader ], [ %.071.lcssa.ph, %._crit_edge.loopexit ]
  %.174 = phi ptr [ null, %.preheader ], [ %28, %._crit_edge.loopexit ]
  %36 = sext i16 %35 to i32
  %37 = icmp eq i32 %.071.lcssa, %36
  br i1 %37, label %38, label %54

38:                                               ; preds = %._crit_edge
  %39 = getelementptr inbounds i8, ptr %16, i64 48
  %40 = load i32, ptr %39, align 8, !tbaa !26
  %41 = and i32 %40, 128
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %73

43:                                               ; preds = %38
  %44 = call i32 @sqlite3IsRowid(ptr noundef nonnull %3)
  %.not85 = icmp eq i32 %44, 0
  br i1 %.not85, label %73, label %45

45:                                               ; preds = %43
  %46 = getelementptr inbounds i8, ptr %16, i64 52
  %47 = load i16, ptr %46, align 4, !tbaa !27
  %48 = icmp sgt i16 %47, -1
  br i1 %48, label %49, label %.thread

49:                                               ; preds = %45
  %50 = zext nneg i16 %47 to i32
  %51 = load ptr, ptr %23, align 8, !tbaa !21
  %52 = zext nneg i16 %47 to i64
  %53 = getelementptr inbounds %struct.Column, ptr %51, i64 %52
  br label %54

54:                                               ; preds = %49, %._crit_edge
  %.2 = phi ptr [ %.174, %._crit_edge ], [ %53, %49 ]
  %.172 = phi i32 [ %.071.lcssa, %._crit_edge ], [ %50, %49 ]
  %.not86 = icmp eq ptr %.2, null
  br i1 %.not86, label %.thread, label %55

55:                                               ; preds = %54
  %56 = call ptr @sqlite3ColumnType(ptr noundef nonnull %.2, ptr noundef null)
  %57 = call ptr @sqlite3ColumnColl(ptr noundef nonnull %.2)
  %58 = getelementptr inbounds i8, ptr %.2, i64 8
  %59 = load i8, ptr %58, align 8
  %60 = and i8 %59, 15
  %61 = icmp ne i8 %60, 0
  %62 = getelementptr inbounds i8, ptr %.2, i64 14
  %63 = load i16, ptr %62, align 2, !tbaa !28
  %64 = and i16 %63, 1
  %65 = getelementptr inbounds i8, ptr %16, i64 52
  %66 = load i16, ptr %65, align 4, !tbaa !27
  %67 = sext i16 %66 to i32
  %68 = icmp eq i32 %.172, %67
  br i1 %68, label %69, label %.thread

69:                                               ; preds = %55
  %70 = getelementptr inbounds i8, ptr %16, i64 48
  %71 = load i32, ptr %70, align 8, !tbaa !26
  %72 = lshr i32 %71, 3
  %.lobit = and i32 %72, 1
  br label %.thread

.thread:                                          ; preds = %45, %21, %54, %55, %69
  %.069 = phi ptr [ %56, %69 ], [ %56, %55 ], [ @.str.38, %54 ], [ @.str.38, %21 ], [ @.str.38, %45 ]
  %.067 = phi ptr [ %57, %69 ], [ %57, %55 ], [ null, %54 ], [ null, %21 ], [ null, %45 ]
  %.065.shrunk = phi i1 [ %61, %69 ], [ %61, %55 ], [ false, %54 ], [ false, %21 ], [ false, %45 ]
  %.063.shrunk = phi i16 [ %64, %69 ], [ %64, %55 ], [ 1, %54 ], [ 1, %21 ], [ 1, %45 ]
  %.0 = phi i32 [ %.lobit, %69 ], [ 0, %55 ], [ 0, %54 ], [ 0, %21 ], [ 0, %45 ]
  %.063 = zext nneg i16 %.063.shrunk to i32
  %.065 = zext i1 %.065.shrunk to i32
  %.not87 = icmp eq ptr %.067, null
  %spec.store.select = select i1 %.not87, ptr @sqlite3StrBINARY, ptr %.067
  br label %73

73:                                               ; preds = %38, %43, %15, %17, %9, %.thread
  %.075 = phi i1 [ false, %9 ], [ true, %.thread ], [ false, %17 ], [ false, %15 ], [ false, %43 ], [ false, %38 ]
  %.170 = phi ptr [ null, %9 ], [ %.069, %.thread ], [ null, %17 ], [ null, %15 ], [ null, %43 ], [ null, %38 ]
  %.168 = phi ptr [ null, %9 ], [ %spec.store.select, %.thread ], [ null, %17 ], [ null, %15 ], [ null, %43 ], [ null, %38 ]
  %.166 = phi i32 [ 0, %9 ], [ %.065, %.thread ], [ 0, %17 ], [ 0, %15 ], [ 0, %43 ], [ 0, %38 ]
  %.164 = phi i32 [ 0, %9 ], [ %.063, %.thread ], [ 0, %17 ], [ 0, %15 ], [ 0, %43 ], [ 0, %38 ]
  %.1 = phi i32 [ 0, %9 ], [ %.0, %.thread ], [ 0, %17 ], [ 0, %15 ], [ 0, %43 ], [ 0, %38 ]
  call void @sqlite3BtreeLeaveAll(ptr noundef %0)
  %.not88 = icmp eq ptr %4, null
  br i1 %.not88, label %75, label %74

74:                                               ; preds = %73
  store ptr %.170, ptr %4, align 8, !tbaa !5
  br label %75

75:                                               ; preds = %74, %73
  %.not89 = icmp eq ptr %5, null
  br i1 %.not89, label %77, label %76

76:                                               ; preds = %75
  store ptr %.168, ptr %5, align 8, !tbaa !5
  br label %77

77:                                               ; preds = %76, %75
  %.not90 = icmp eq ptr %6, null
  br i1 %.not90, label %79, label %78

78:                                               ; preds = %77
  store i32 %.166, ptr %6, align 4, !tbaa !29
  br label %79

79:                                               ; preds = %78, %77
  %.not91 = icmp eq ptr %7, null
  br i1 %.not91, label %81, label %80

80:                                               ; preds = %79
  store i32 %.164, ptr %7, align 4, !tbaa !29
  br label %81

81:                                               ; preds = %80, %79
  %.not92 = icmp eq ptr %8, null
  br i1 %.not92, label %83, label %82

82:                                               ; preds = %81
  store i32 %.1, ptr %8, align 4, !tbaa !29
  br label %83

83:                                               ; preds = %82, %81
  %or.cond = or i1 %14, %.075
  %.pre103 = load ptr, ptr %10, align 8, !tbaa !5
  br i1 %or.cond, label %86, label %84

84:                                               ; preds = %83
  call void @sqlite3DbFree(ptr noundef %0, ptr noundef %.pre103)
  %85 = call ptr (ptr, ptr, ...) @sqlite3MPrintf(ptr noundef %0, ptr noundef nonnull @.str.39, ptr noundef %2, ptr noundef %3)
  store ptr %85, ptr %10, align 8, !tbaa !5
  br label %86

86:                                               ; preds = %84, %83
  %87 = phi ptr [ %.pre103, %83 ], [ %85, %84 ]
  %.076 = phi i32 [ %13, %83 ], [ 1, %84 ]
  %.not93 = icmp eq ptr %87, null
  %88 = select i1 %.not93, ptr null, ptr @.str.28
  call void (ptr, i32, ptr, ...) @sqlite3ErrorWithMsg(ptr noundef %0, i32 noundef %.076, ptr noundef %88, ptr noundef %87)
  %89 = load ptr, ptr %10, align 8, !tbaa !5
  call void @sqlite3DbFree(ptr noundef %0, ptr noundef %89)
  %90 = call i32 @sqlite3ApiExit(ptr noundef %0, i32 noundef %.076)
  %91 = load ptr, ptr %11, align 8, !tbaa !9
  call void @sqlite3_mutex_leave(ptr noundef %91)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #2
  ret i32 %90
}

; Function Attrs: nounwind uwtable
declare hidden i32 @sqlite3Init(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden ptr @sqlite3FindTable(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @sqlite3IsRowid(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden ptr @sqlite3ColumnType(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden ptr @sqlite3ColumnColl(ptr noundef) local_unnamed_addr #1

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 = { 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, !6, i64 24}
!10 = !{!"sqlite3", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !11, i64 44, !12, i64 48, !12, i64 56, !12, i64 64, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !7, i64 100, !7, i64 101, !7, i64 102, !7, i64 103, !7, i64 104, !7, i64 105, !7, i64 106, !7, i64 107, !7, i64 108, !7, i64 109, !7, i64 110, !7, i64 111, !7, i64 112, !7, i64 113, !11, i64 116, !12, i64 120, !12, i64 128, !7, i64 136, !11, i64 184, !13, i64 192, !11, i64 208, !11, i64 212, !11, i64 216, !11, i64 220, !11, i64 224, !11, i64 228, !6, i64 232, !7, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !6, i64 392, !7, i64 400, !14, i64 408, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !11, i64 536, !11, i64 540, !16, i64 544, !6, i64 568, !6, i64 576, !6, i64 584, !16, i64 592, !16, i64 616, !17, i64 640, !7, i64 664, !6, i64 728, !11, i64 736, !11, i64 740, !11, i64 744, !11, i64 748, !12, i64 752, !12, i64 760, !6, i64 768, !6, i64 776}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"sqlite3InitInfo", !11, i64 0, !7, i64 4, !7, i64 5, !11, i64 6, !11, i64 6, !11, i64 6, !6, i64 8}
!14 = !{!"Lookaside", !11, i64 0, !15, i64 4, !15, i64 6, !7, i64 8, !11, i64 12, !7, i64 16, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88}
!15 = !{!"short", !7, i64 0}
!16 = !{!"Hash", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16}
!17 = !{!"BusyHandler", !6, i64 0, !6, i64 8, !11, i64 16}
!18 = !{!19, !7, i64 63}
!19 = !{!"Table", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !11, i64 44, !11, i64 48, !15, i64 52, !15, i64 54, !15, i64 56, !15, i64 58, !15, i64 60, !7, i64 62, !7, i64 63, !7, i64 64, !6, i64 88, !6, i64 96}
!20 = !{!19, !15, i64 54}
!21 = !{!19, !6, i64 8}
!22 = !{!23, !6, i64 0}
!23 = !{!"Column", !6, i64 0, !11, i64 8, !11, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !15, i64 12, !15, i64 14}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!19, !11, i64 48}
!27 = !{!19, !15, i64 52}
!28 = !{!23, !15, i64 14}
!29 = !{!11, !11, i64 0}


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