; LLVM IR from HassenSaidi/IC_sqlite :: src (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, i16, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, [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, %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 }
%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 }
%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, ptr, ptr, i32, i32, i32, i16, i16, i16, i16, i16, i8, i32, i32, ptr, ptr, ptr, ptr, ptr }
%struct.Column = type { ptr, ptr, ptr, i8, i8, i8, i8, i16 }

@.str.20 = external hidden unnamed_addr constant [3 x i8], align 1
@sqlite3StrBINARY = external hidden constant [7 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.30 = 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 %161

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 %50

45:                                               ; preds = %38
  %46 = load ptr, ptr %21, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.Table, ptr %46, i32 0, i32 3
  %48 = load ptr, ptr %47, align 8, !tbaa !19
  %49 = icmp ne ptr %48, null
  br i1 %49, label %50, label %51

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

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

54:                                               ; preds = %51
  br label %118

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

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

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

76:                                               ; preds = %63
  br label %81

77:                                               ; preds = %63
  br label %78

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

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

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

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

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

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

112:                                              ; preds = %98
  br label %113

113:                                              ; preds = %112, %105
  %114 = phi ptr [ %111, %105 ], [ null, %112 ]
  store ptr %114, ptr %22, align 8, !tbaa !5
  br label %116

115:                                              ; preds = %94, %88
  store ptr null, ptr %21, align 8, !tbaa !5
  br label %161

116:                                              ; preds = %113
  br label %117

117:                                              ; preds = %116, %81
  br label %118

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

121:                                              ; preds = %118
  %122 = load ptr, ptr %22, align 8, !tbaa !5
  %123 = call ptr @sqlite3ColumnType(ptr noundef %122, ptr noundef null)
  store ptr %123, ptr %24, align 8, !tbaa !5
  %124 = load ptr, ptr %22, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.Column, ptr %124, i32 0, i32 2
  %126 = load ptr, ptr %125, align 8, !tbaa !29
  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 3
  %129 = load i8, ptr %128, align 8, !tbaa !30
  %130 = zext i8 %129 to i32
  %131 = icmp ne i32 %130, 0
  %132 = zext i1 %131 to i32
  store i32 %132, ptr %26, align 4, !tbaa !9
  %133 = load ptr, ptr %22, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.Column, ptr %133, i32 0, i32 7
  %135 = load i16, ptr %134, align 4, !tbaa !31
  %136 = zext i16 %135 to i32
  %137 = and i32 %136, 1
  %138 = icmp ne i32 %137, 0
  %139 = zext i1 %138 to i32
  store i32 %139, ptr %27, align 4, !tbaa !9
  %140 = load ptr, ptr %21, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.Table, ptr %140, i32 0, i32 10
  %142 = load i16, ptr %141, align 4, !tbaa !28
  %143 = sext i16 %142 to i32
  %144 = load i32, ptr %23, align 4, !tbaa !9
  %145 = icmp eq i32 %143, %144
  br i1 %145, label %146, label %152

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

152:                                              ; preds = %146, %121
  %153 = phi i1 [ false, %121 ], [ %151, %146 ]
  %154 = zext i1 %153 to i32
  store i32 %154, ptr %28, align 4, !tbaa !9
  br label %156

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

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

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

160:                                              ; preds = %159, %156
  br label %161

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

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

168:                                              ; preds = %165, %161
  %169 = load ptr, ptr %15, align 8, !tbaa !5
  %170 = icmp ne ptr %169, null
  br i1 %170, label %171, label %174

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

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

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

180:                                              ; preds = %177, %174
  %181 = load ptr, ptr %17, align 8, !tbaa !5
  %182 = icmp ne ptr %181, null
  br i1 %182, label %183, label %186

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

186:                                              ; preds = %183, %180
  %187 = load ptr, ptr %18, align 8, !tbaa !5
  %188 = icmp ne ptr %187, null
  br i1 %188, label %189, label %192

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

192:                                              ; preds = %189, %186
  %193 = load i32, ptr %19, align 4, !tbaa !9
  %194 = icmp eq i32 0, %193
  br i1 %194, label %195, label %205

195:                                              ; preds = %192
  %196 = load ptr, ptr %21, align 8, !tbaa !5
  %197 = icmp ne ptr %196, null
  br i1 %197, label %205, label %198

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

205:                                              ; preds = %198, %195, %192
  %206 = load ptr, ptr %10, align 8, !tbaa !5
  %207 = load i32, ptr %19, align 4, !tbaa !9
  %208 = load ptr, ptr %20, align 8, !tbaa !5
  %209 = icmp ne ptr %208, null
  %210 = zext i1 %209 to i64
  %211 = select i1 %209, ptr @.str.20, ptr null
  %212 = load ptr, ptr %20, align 8, !tbaa !5
  call void (ptr, i32, ptr, ...) @sqlite3ErrorWithMsg(ptr noundef %206, i32 noundef %207, ptr noundef %211, ptr noundef %212)
  %213 = load ptr, ptr %10, align 8, !tbaa !5
  %214 = load ptr, ptr %20, align 8, !tbaa !5
  call void @sqlite3DbFree(ptr noundef %213, ptr noundef %214)
  %215 = load ptr, ptr %10, align 8, !tbaa !5
  %216 = load i32, ptr %19, align 4, !tbaa !9
  %217 = call i32 @sqlite3ApiExit(ptr noundef %215, i32 noundef %216)
  store i32 %217, ptr %19, align 4, !tbaa !9
  %218 = load ptr, ptr %10, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.sqlite3, ptr %218, i32 0, i32 3
  %220 = load ptr, ptr %219, align 8, !tbaa !11
  call void @sqlite3_mutex_leave(ptr noundef %220)
  %221 = 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 %221
}

; 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

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, !14, i64 92, !7, i64 94, !7, i64 95, !7, i64 96, !7, i64 97, !7, i64 98, !7, i64 99, !7, i64 100, !7, i64 101, !7, i64 102, !7, i64 103, !7, i64 104, !7, i64 105, !7, i64 106, !10, i64 108, !10, i64 112, !10, i64 116, !10, i64 120, !7, i64 124, !10, i64 172, !15, i64 176, !10, i64 192, !10, i64 196, !10, i64 200, !10, i64 204, !10, i64 208, !10, i64 212, !6, i64 216, !7, i64 224, !6, i64 232, !6, 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, !7, i64 360, !16, i64 368, !6, i64 456, !6, i64 464, !6, i64 472, !6, i64 480, !10, i64 488, !10, i64 492, !17, i64 496, !6, i64 520, !6, i64 528, !6, i64 536, !17, i64 544, !17, i64 568, !18, i64 592, !7, i64 616, !6, i64 680, !10, i64 688, !10, i64 692, !10, i64 696, !10, i64 700, !13, i64 704, !13, i64 712, !6, i64 720}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!"sqlite3InitInfo", !10, i64 0, !7, i64 4, !7, i64 5, !10, i64 6, !10, i64 6, !10, i64 6, !6, i64 8}
!16 = !{!"Lookaside", !10, i64 0, !14, i64 4, !14, 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}
!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, !6, i64 24}
!20 = !{!"Table", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !10, i64 56, !10, i64 60, !10, i64 64, !14, i64 68, !14, i64 70, !14, i64 72, !14, i64 74, !14, i64 76, !7, i64 78, !10, i64 80, !10, i64 84, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!21 = !{!20, !14, i64 70}
!22 = !{!20, !6, i64 8}
!23 = !{!24, !6, i64 0}
!24 = !{!"Column", !6, i64 0, !6, i64 8, !6, i64 16, !7, i64 24, !7, i64 25, !7, i64 26, !7, i64 27, !14, i64 28}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!20, !10, i64 64}
!28 = !{!20, !14, i64 68}
!29 = !{!24, !6, i64 16}
!30 = !{!24, !7, i64 24}
!31 = !{!24, !14, i64 28}


; 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, ptr, ptr, i8, i8, i8, i8, i16 }

@.str.20 = external hidden unnamed_addr constant [3 x i8], align 1
@sqlite3StrBINARY = external hidden constant [7 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.30 = 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 %72, 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 %72, label %17

17:                                               ; preds = %15
  %18 = getelementptr inbounds i8, ptr %16, i64 24
  %19 = load ptr, ptr %18, align 8, !tbaa !18
  %.not85 = icmp eq ptr %19, null
  br i1 %.not85, label %20, label %72

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

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

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

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

._crit_edge.loopexit:                             ; preds = %.lr.ph, %31
  %.071.lcssa.ph.in = phi i64 [ %indvars.iv.next, %31 ], [ %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
  %34 = phi i16 [ %24, %.preheader ], [ %.pre.pre, %._crit_edge.loopexit ]
  %.071.lcssa = phi i32 [ 0, %.preheader ], [ %.071.lcssa.ph, %._crit_edge.loopexit ]
  %.174 = phi ptr [ null, %.preheader ], [ %27, %._crit_edge.loopexit ]
  %35 = sext i16 %34 to i32
  %36 = icmp eq i32 %.071.lcssa, %35
  br i1 %36, label %37, label %53

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

42:                                               ; preds = %37
  %43 = call i32 @sqlite3IsRowid(ptr noundef nonnull %3)
  %.not86 = icmp eq i32 %43, 0
  br i1 %.not86, label %72, label %44

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

48:                                               ; preds = %44
  %49 = zext nneg i16 %46 to i32
  %50 = load ptr, ptr %22, align 8, !tbaa !21
  %51 = zext nneg i16 %46 to i64
  %52 = getelementptr inbounds %struct.Column, ptr %50, i64 %51
  br label %53

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

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

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

.thread:                                          ; preds = %44, %20, %53, %54, %68
  %.069 = phi ptr [ %55, %68 ], [ %55, %54 ], [ @.str.29, %53 ], [ @.str.29, %20 ], [ @.str.29, %44 ]
  %.067 = phi ptr [ %57, %68 ], [ %57, %54 ], [ null, %53 ], [ null, %20 ], [ null, %44 ]
  %.065.shrunk = phi i1 [ %60, %68 ], [ %60, %54 ], [ false, %53 ], [ false, %20 ], [ false, %44 ]
  %.063.shrunk = phi i16 [ %63, %68 ], [ %63, %54 ], [ 1, %53 ], [ 1, %20 ], [ 1, %44 ]
  %.0 = phi i32 [ %.lobit, %68 ], [ 0, %54 ], [ 0, %53 ], [ 0, %20 ], [ 0, %44 ]
  %.063 = zext nneg i16 %.063.shrunk to i32
  %.065 = zext i1 %.065.shrunk to i32
  %.not88 = icmp eq ptr %.067, null
  %spec.store.select = select i1 %.not88, ptr @sqlite3StrBINARY, ptr %.067
  br label %72

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

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

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

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

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

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

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

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

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

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

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

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

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

; 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

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, !13, i64 92, !7, i64 94, !7, i64 95, !7, i64 96, !7, i64 97, !7, i64 98, !7, i64 99, !7, i64 100, !7, i64 101, !7, i64 102, !7, i64 103, !7, i64 104, !7, i64 105, !7, i64 106, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !7, i64 124, !11, i64 172, !14, i64 176, !11, i64 192, !11, i64 196, !11, i64 200, !11, i64 204, !11, i64 208, !11, i64 212, !6, i64 216, !7, i64 224, !6, i64 232, !6, 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, !7, i64 360, !15, i64 368, !6, i64 456, !6, i64 464, !6, i64 472, !6, i64 480, !11, i64 488, !11, i64 492, !16, i64 496, !6, i64 520, !6, i64 528, !6, i64 536, !16, i64 544, !16, i64 568, !17, i64 592, !7, i64 616, !6, i64 680, !11, i64 688, !11, i64 692, !11, i64 696, !11, i64 700, !12, i64 704, !12, i64 712, !6, i64 720}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!"sqlite3InitInfo", !11, i64 0, !7, i64 4, !7, i64 5, !11, i64 6, !11, i64 6, !11, i64 6, !6, i64 8}
!15 = !{!"Lookaside", !11, i64 0, !13, i64 4, !13, 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}
!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, !6, i64 24}
!19 = !{!"Table", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !11, i64 56, !11, i64 60, !11, i64 64, !13, i64 68, !13, i64 70, !13, i64 72, !13, i64 74, !13, i64 76, !7, i64 78, !11, i64 80, !11, i64 84, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!20 = !{!19, !13, i64 70}
!21 = !{!19, !6, i64 8}
!22 = !{!23, !6, i64 0}
!23 = !{!"Column", !6, i64 0, !6, i64 8, !6, i64 16, !7, i64 24, !7, i64 25, !7, i64 26, !7, i64 27, !13, i64 28}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!19, !11, i64 64}
!27 = !{!19, !13, i64 68}
!28 = !{!23, !6, i64 16}
!29 = !{!23, !7, i64 24}
!30 = !{!23, !13, i64 28}
!31 = !{!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