; LLVM IR from ibr-ds/STANlite :: Enclave/sqlite (build)

; 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.Parse = type { ptr, ptr, ptr, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, %struct.Token, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i8, i8, i8, [10 x %struct.yColCache], [8 x i32], %struct.Token, %struct.Token, i16, i8, i8, i8, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, %struct.Token, ptr, ptr, ptr, ptr, ptr }
%struct.yColCache = type { i32, i16, i8, i32, i32, i32 }
%struct.Token = type { ptr, i32 }
%struct.sqlite3 = type { ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i64, 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, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %union.anon, %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, i64, i64, ptr }
%struct.sqlite3InitInfo = type { i32, i8, i8, i8, i8 }
%union.anon = type { double }
%struct.Lookaside = type { i32, i16, i8, i32, i32, [3 x i32], 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.SrcList = type { i32, i32, [1 x %struct.SrcList_item] }
%struct.SrcList_item = type { ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, %struct.anon.1, i8, i32, ptr, ptr, i64, %union.anon.2, ptr }
%struct.anon.1 = type { i8, i8, [2 x i8] }
%union.anon.2 = type { ptr }
%struct.Index = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i16, i16, i16, i8, i8 }
%struct.Table = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i16, i16, i16, i16, i8, i32, i32, ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

declare ptr @sqlite3GetVdbe(ptr noundef) #1

declare i32 @sqlite3VdbeAddOp4(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @sqlite3NestedParse(ptr noundef, ptr noundef, ...) #2

declare i32 @sqlite3ReadSchema(ptr noundef) #1

declare void @sqlite3ErrorMsg(ptr noundef, ptr noundef, ...) #1

declare i32 @sqlite3SchemaToIndex(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @sqlite3FindIndex(ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @sqlite3AuthCheck(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #1

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @sqlite3ClearStatTables(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local void @sqlite3DropIndex(ptr noundef %0, ptr noundef %1, i32 noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %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 ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.Parse, ptr %16, i32 0, i32 0
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  store ptr %18, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %19 = load ptr, ptr %9, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.sqlite3, ptr %19, i32 0, i32 17
  %21 = load i8, ptr %20, align 1, !tbaa !15
  %22 = icmp ne i8 %21, 0
  br i1 %22, label %23, label %24

23:                                               ; preds = %3
  br label %155

24:                                               ; preds = %3
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = call i32 @sqlite3ReadSchema(ptr noundef %25)
  %27 = icmp ne i32 0, %26
  br i1 %27, label %28, label %29

28:                                               ; preds = %24
  br label %155

29:                                               ; preds = %24
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.SrcList, ptr %31, i32 0, i32 2
  %33 = getelementptr inbounds [1 x %struct.SrcList_item], ptr %32, i64 0, i64 0
  %34 = getelementptr inbounds %struct.SrcList_item, ptr %33, i32 0, i32 2
  %35 = load ptr, ptr %34, align 8, !tbaa !22
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.SrcList, ptr %36, i32 0, i32 2
  %38 = getelementptr inbounds [1 x %struct.SrcList_item], ptr %37, i64 0, i64 0
  %39 = getelementptr inbounds %struct.SrcList_item, ptr %38, i32 0, i32 1
  %40 = load ptr, ptr %39, align 8, !tbaa !25
  %41 = call ptr @sqlite3FindIndex(ptr noundef %30, ptr noundef %35, ptr noundef %40)
  store ptr %41, ptr %7, align 8, !tbaa !5
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = icmp eq ptr %42, null
  br i1 %43, label %44, label %60

44:                                               ; preds = %29
  %45 = load i32, ptr %6, align 4, !tbaa !9
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %50, label %47

47:                                               ; preds = %44
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ptr, ...) @sqlite3ErrorMsg(ptr noundef %48, ptr noundef @.str.60, ptr noundef %49, i32 noundef 0)
  br label %57

50:                                               ; preds = %44
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.SrcList, ptr %52, i32 0, i32 2
  %54 = getelementptr inbounds [1 x %struct.SrcList_item], ptr %53, i64 0, i64 0
  %55 = getelementptr inbounds %struct.SrcList_item, ptr %54, i32 0, i32 1
  %56 = load ptr, ptr %55, align 8, !tbaa !25
  call void @sqlite3CodeVerifyNamedSchema(ptr noundef %51, ptr noundef %56)
  br label %57

57:                                               ; preds = %50, %47
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.Parse, ptr %58, i32 0, i32 5
  store i8 1, ptr %59, align 1, !tbaa !26
  br label %155

60:                                               ; preds = %29
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.Index, ptr %61, i32 0, i32 16
  %63 = load i8, ptr %62, align 1
  %64 = and i8 %63, 3
  %65 = zext i8 %64 to i32
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %69

67:                                               ; preds = %60
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  call void (ptr, ptr, ...) @sqlite3ErrorMsg(ptr noundef %68, ptr noundef @.str.61, i32 noundef 0)
  br label %155

69:                                               ; preds = %60
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.Index, ptr %71, i32 0, i32 6
  %73 = load ptr, ptr %72, align 8, !tbaa !27
  %74 = call i32 @sqlite3SchemaToIndex(ptr noundef %70, ptr noundef %73)
  store i32 %74, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 10, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.Index, ptr %75, i32 0, i32 3
  %77 = load ptr, ptr %76, align 8, !tbaa !29
  store ptr %77, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.sqlite3, ptr %78, i32 0, i32 4
  %80 = load ptr, ptr %79, align 8, !tbaa !30
  %81 = load i32, ptr %10, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds %struct.Db, ptr %80, i64 %82
  %84 = getelementptr inbounds %struct.Db, ptr %83, i32 0, i32 0
  %85 = load ptr, ptr %84, align 8, !tbaa !31
  store ptr %85, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %86 = load i32, ptr %10, align 4, !tbaa !9
  %87 = icmp eq i32 %86, 1
  %88 = zext i1 %87 to i64
  %89 = select i1 %87, ptr @.str.1, ptr @.str
  store ptr %89, ptr %14, align 8, !tbaa !5
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = load ptr, ptr %14, align 8, !tbaa !5
  %92 = load ptr, ptr %13, align 8, !tbaa !5
  %93 = call i32 @sqlite3AuthCheck(ptr noundef %90, i32 noundef 9, ptr noundef %91, ptr noundef null, ptr noundef %92)
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %96

95:                                               ; preds = %69
  store i32 2, ptr %15, align 4
  br label %114

96:                                               ; preds = %69
  %97 = load i32, ptr %10, align 4, !tbaa !9
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %100

99:                                               ; preds = %96
  store i32 12, ptr %11, align 4, !tbaa !9
  br label %100

100:                                              ; preds = %99, %96
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = load i32, ptr %11, align 4, !tbaa !9
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.Index, ptr %103, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !33
  %106 = load ptr, ptr %12, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.Table, ptr %106, i32 0, i32 0
  %108 = load ptr, ptr %107, align 8, !tbaa !34
  %109 = load ptr, ptr %13, align 8, !tbaa !5
  %110 = call i32 @sqlite3AuthCheck(ptr noundef %101, i32 noundef %102, ptr noundef %105, ptr noundef %108, ptr noundef %109)
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %113

112:                                              ; preds = %100
  store i32 2, ptr %15, align 4
  br label %114

113:                                              ; preds = %100
  store i32 0, ptr %15, align 4
  br label %114

114:                                              ; preds = %113, %112, %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  %115 = load i32, ptr %15, align 4
  switch i32 %115, label %158 [
    i32 0, label %116
    i32 2, label %155
  ]

116:                                              ; preds = %114
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = call ptr @sqlite3GetVdbe(ptr noundef %117)
  store ptr %118, ptr %8, align 8, !tbaa !5
  %119 = load ptr, ptr %8, align 8, !tbaa !5
  %120 = icmp ne ptr %119, null
  br i1 %120, label %121, label %154

121:                                              ; preds = %116
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = load i32, ptr %10, align 4, !tbaa !9
  call void @sqlite3BeginWriteOperation(ptr noundef %122, i32 noundef 1, i32 noundef %123)
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = load ptr, ptr %9, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.sqlite3, ptr %125, i32 0, i32 4
  %127 = load ptr, ptr %126, align 8, !tbaa !30
  %128 = load i32, ptr %10, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds %struct.Db, ptr %127, i64 %129
  %131 = getelementptr inbounds %struct.Db, ptr %130, i32 0, i32 0
  %132 = load ptr, ptr %131, align 8, !tbaa !31
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.Index, ptr %133, i32 0, i32 0
  %135 = load ptr, ptr %134, align 8, !tbaa !33
  call void (ptr, ptr, ...) @sqlite3NestedParse(ptr noundef %124, ptr noundef @.str.62, ptr noundef %132, ptr noundef @.str, ptr noundef %135)
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  %137 = load i32, ptr %10, align 4, !tbaa !9
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.Index, ptr %138, i32 0, i32 0
  %140 = load ptr, ptr %139, align 8, !tbaa !33
  call void @sqlite3ClearStatTables(ptr noundef %136, i32 noundef %137, ptr noundef @.str.63, ptr noundef %140)
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  %142 = load i32, ptr %10, align 4, !tbaa !9
  call void @sqlite3ChangeCookie(ptr noundef %141, i32 noundef %142)
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = load ptr, ptr %7, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.Index, ptr %144, i32 0, i32 11
  %146 = load i32, ptr %145, align 8, !tbaa !36
  %147 = load i32, ptr %10, align 4, !tbaa !9
  call void @destroyRootPage(ptr noundef %143, i32 noundef %146, i32 noundef %147)
  %148 = load ptr, ptr %8, align 8, !tbaa !5
  %149 = load i32, ptr %10, align 4, !tbaa !9
  %150 = load ptr, ptr %7, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.Index, ptr %150, i32 0, i32 0
  %152 = load ptr, ptr %151, align 8, !tbaa !33
  %153 = call i32 @sqlite3VdbeAddOp4(ptr noundef %148, i32 noundef 140, i32 noundef %149, i32 noundef 0, i32 noundef 0, ptr noundef %152, i32 noundef 0)
  br label %154

154:                                              ; preds = %121, %116
  br label %155

155:                                              ; preds = %154, %114, %67, %57, %28, %23
  %156 = load ptr, ptr %9, align 8, !tbaa !5
  %157 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sqlite3SrcListDelete(ptr noundef %156, ptr noundef %157)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret void

158:                                              ; preds = %114
  unreachable
}

; Function Attrs: nounwind uwtable
declare hidden void @destroyRootPage(ptr noundef, i32 noundef, i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 #3 = { 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 0}
!12 = !{!"Parse", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !7, i64 28, !7, i64 29, !7, i64 30, !7, i64 31, !7, i64 32, !7, i64 33, !7, i64 34, !7, i64 35, !7, i64 36, !7, i64 37, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !6, i64 88, !6, i64 96, !13, i64 104, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !7, i64 192, !7, i64 193, !7, i64 194, !7, i64 196, !7, i64 396, !13, i64 432, !13, i64 448, !14, i64 464, !7, i64 466, !7, i64 467, !7, i64 468, !10, i64 472, !10, i64 476, !10, i64 480, !10, i64 484, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !13, i64 536, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576, !6, i64 584}
!13 = !{!"Token", !6, i64 0, !10, i64 8}
!14 = !{!"short", !7, i64 0}
!15 = !{!16, !7, i64 85}
!16 = !{!"sqlite3", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40, !10, i64 44, !17, i64 48, !17, i64 56, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !14, i64 80, !7, i64 82, !7, i64 83, !7, i64 84, !7, i64 85, !7, i64 86, !7, i64 87, !7, i64 88, !7, i64 89, !7, i64 90, !7, i64 91, !7, i64 92, !7, i64 93, !7, i64 94, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !7, i64 112, !10, i64 160, !18, i64 164, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !10, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, 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, !7, i64 336, !19, i64 344, !6, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !10, i64 432, !10, i64 436, !20, i64 440, !6, i64 464, !6, i64 472, !6, i64 480, !20, i64 488, !20, i64 512, !21, i64 536, !7, i64 560, !6, i64 624, !10, i64 632, !10, i64 636, !10, i64 640, !17, i64 648, !17, i64 656, !6, i64 664}
!17 = !{!"long long", !7, i64 0}
!18 = !{!"sqlite3InitInfo", !10, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7}
!19 = !{!"Lookaside", !10, i64 0, !14, i64 4, !7, i64 6, !10, i64 8, !10, i64 12, !7, i64 16, !6, i64 32, !6, i64 40, !6, i64 48}
!20 = !{!"Hash", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16}
!21 = !{!"BusyHandler", !6, i64 0, !6, i64 8, !10, i64 16}
!22 = !{!23, !6, i64 16}
!23 = !{!"SrcList_item", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !24, i64 60, !7, i64 64, !10, i64 68, !6, i64 72, !6, i64 80, !17, i64 88, !7, i64 96, !6, i64 104}
!24 = !{!"", !7, i64 0, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1}
!25 = !{!23, !6, i64 8}
!26 = !{!12, !7, i64 29}
!27 = !{!28, !6, i64 48}
!28 = !{!"Index", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !14, i64 92, !14, i64 94, !14, i64 96, !7, i64 98, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99}
!29 = !{!28, !6, i64 24}
!30 = !{!16, !6, i64 32}
!31 = !{!32, !6, i64 0}
!32 = !{!"Db", !6, i64 0, !6, i64 8, !7, i64 16, !7, i64 17, !6, i64 24}
!33 = !{!28, !6, i64 0}
!34 = !{!35, !6, i64 0}
!35 = !{!"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, !7, i64 76, !10, i64 80, !10, i64 84, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!36 = !{!28, !10, i64 88}


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

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [4 x i8], align 1

declare ptr @sqlite3GetVdbe(ptr noundef) local_unnamed_addr #0

declare i32 @sqlite3VdbeAddOp4(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

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

declare i32 @sqlite3ReadSchema(ptr noundef) local_unnamed_addr #0

declare void @sqlite3ErrorMsg(ptr noundef, ptr noundef, ...) local_unnamed_addr #0

declare i32 @sqlite3SchemaToIndex(ptr noundef, ptr noundef) local_unnamed_addr #0

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

declare i32 @sqlite3AuthCheck(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @sqlite3DropIndex(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #1 {
  %4 = load ptr, ptr %0, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %4, i64 85
  %6 = load i8, ptr %5, align 1, !tbaa !13
  %.not = icmp eq i8 %6, 0
  br i1 %.not, label %7, label %.thread

7:                                                ; preds = %3
  %8 = tail call i32 @sqlite3ReadSchema(ptr noundef nonnull %0) #2
  %.not54 = icmp eq i32 %8, 0
  br i1 %.not54, label %9, label %.thread

9:                                                ; preds = %7
  %10 = getelementptr inbounds i8, ptr %1, i64 24
  %11 = load ptr, ptr %10, align 8, !tbaa !20
  %12 = getelementptr inbounds i8, ptr %1, i64 16
  %13 = load ptr, ptr %12, align 8, !tbaa !23
  %14 = tail call ptr @sqlite3FindIndex(ptr noundef nonnull %4, ptr noundef %11, ptr noundef %13)
  %15 = icmp eq ptr %14, null
  br i1 %15, label %16, label %22

16:                                               ; preds = %9
  %.not60 = icmp eq i32 %2, 0
  br i1 %.not60, label %17, label %18

17:                                               ; preds = %16
  tail call void (ptr, ptr, ...) @sqlite3ErrorMsg(ptr noundef nonnull %0, ptr noundef nonnull @.str.60, ptr noundef nonnull %1, i32 noundef 0) #2
  br label %20

18:                                               ; preds = %16
  %19 = load ptr, ptr %12, align 8, !tbaa !23
  tail call void @sqlite3CodeVerifyNamedSchema(ptr noundef nonnull %0, ptr noundef %19)
  br label %20

20:                                               ; preds = %18, %17
  %21 = getelementptr inbounds i8, ptr %0, i64 29
  store i8 1, ptr %21, align 1, !tbaa !24
  br label %.thread

22:                                               ; preds = %9
  %23 = getelementptr inbounds i8, ptr %14, i64 99
  %24 = load i8, ptr %23, align 1
  %25 = and i8 %24, 3
  %.not55 = icmp eq i8 %25, 0
  br i1 %.not55, label %27, label %26

26:                                               ; preds = %22
  tail call void (ptr, ptr, ...) @sqlite3ErrorMsg(ptr noundef nonnull %0, ptr noundef nonnull @.str.61, i32 noundef 0) #2
  br label %.thread

27:                                               ; preds = %22
  %28 = getelementptr inbounds i8, ptr %14, i64 48
  %29 = load ptr, ptr %28, align 8, !tbaa !25
  %30 = tail call i32 @sqlite3SchemaToIndex(ptr noundef nonnull %4, ptr noundef %29) #2
  %31 = getelementptr inbounds i8, ptr %14, i64 24
  %32 = load ptr, ptr %31, align 8, !tbaa !27
  %33 = getelementptr inbounds i8, ptr %4, i64 32
  %34 = load ptr, ptr %33, align 8, !tbaa !28
  %35 = sext i32 %30 to i64
  %36 = getelementptr inbounds %struct.Db, ptr %34, i64 %35
  %37 = load ptr, ptr %36, align 8, !tbaa !29
  %38 = icmp eq i32 %30, 1
  %39 = select i1 %38, ptr @.str.1, ptr @.str
  %40 = tail call i32 @sqlite3AuthCheck(ptr noundef nonnull %0, i32 noundef 9, ptr noundef nonnull %39, ptr noundef null, ptr noundef %37) #2
  %.not56 = icmp eq i32 %40, 0
  br i1 %.not56, label %41, label %.thread

41:                                               ; preds = %27
  %.not57 = icmp eq i32 %30, 0
  %spec.select = select i1 %.not57, i32 10, i32 12
  %42 = load ptr, ptr %14, align 8, !tbaa !31
  %43 = load ptr, ptr %32, align 8, !tbaa !32
  %44 = tail call i32 @sqlite3AuthCheck(ptr noundef nonnull %0, i32 noundef %spec.select, ptr noundef %42, ptr noundef %43, ptr noundef %37) #2
  %.not58 = icmp eq i32 %44, 0
  br i1 %.not58, label %45, label %.thread

45:                                               ; preds = %41
  %46 = tail call ptr @sqlite3GetVdbe(ptr noundef nonnull %0) #2
  %.not59 = icmp eq ptr %46, null
  br i1 %.not59, label %.thread, label %47

47:                                               ; preds = %45
  tail call void @sqlite3BeginWriteOperation(ptr noundef nonnull %0, i32 noundef 1, i32 noundef %30)
  %48 = load ptr, ptr %33, align 8, !tbaa !28
  %49 = getelementptr inbounds %struct.Db, ptr %48, i64 %35
  %50 = load ptr, ptr %49, align 8, !tbaa !29
  %51 = load ptr, ptr %14, align 8, !tbaa !31
  tail call void (ptr, ptr, ...) @sqlite3NestedParse(ptr noundef nonnull %0, ptr noundef nonnull @.str.62, ptr noundef %50, ptr noundef nonnull @.str, ptr noundef %51)
  %52 = load ptr, ptr %14, align 8, !tbaa !31
  tail call void @sqlite3ClearStatTables(ptr noundef nonnull %0, i32 noundef %30, ptr noundef nonnull @.str.63, ptr noundef %52)
  tail call void @sqlite3ChangeCookie(ptr noundef nonnull %0, i32 noundef %30)
  %53 = getelementptr inbounds i8, ptr %14, i64 88
  %54 = load i32, ptr %53, align 8, !tbaa !34
  tail call void @destroyRootPage(ptr noundef nonnull %0, i32 noundef %54, i32 noundef %30)
  %55 = load ptr, ptr %14, align 8, !tbaa !31
  %56 = tail call i32 @sqlite3VdbeAddOp4(ptr noundef nonnull %46, i32 noundef 140, i32 noundef %30, i32 noundef 0, i32 noundef 0, ptr noundef %55, i32 noundef 0) #2
  br label %.thread

.thread:                                          ; preds = %41, %27, %45, %47, %7, %3, %26, %20
  tail call void @sqlite3SrcListDelete(ptr noundef nonnull %4, ptr noundef %1)
  ret void
}

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

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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, !7, i64 0}
!6 = !{!"Parse", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !8, i64 28, !8, i64 29, !8, i64 30, !8, i64 31, !8, i64 32, !8, i64 33, !8, i64 34, !8, i64 35, !8, i64 36, !8, i64 37, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !7, i64 88, !7, i64 96, !11, i64 104, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !8, i64 192, !8, i64 193, !8, i64 194, !8, i64 196, !8, i64 396, !11, i64 432, !11, i64 448, !12, i64 464, !8, i64 466, !8, i64 467, !8, i64 468, !10, i64 472, !10, i64 476, !10, i64 480, !10, i64 484, !7, i64 488, !7, i64 496, !7, i64 504, !7, i64 512, !7, i64 520, !7, i64 528, !11, i64 536, !7, i64 552, !7, i64 560, !7, i64 568, !7, i64 576, !7, i64 584}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"Token", !7, i64 0, !10, i64 8}
!12 = !{!"short", !8, i64 0}
!13 = !{!14, !8, i64 85}
!14 = !{!"sqlite3", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !10, i64 44, !15, i64 48, !15, i64 56, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !12, i64 80, !8, i64 82, !8, i64 83, !8, i64 84, !8, i64 85, !8, i64 86, !8, i64 87, !8, i64 88, !8, i64 89, !8, i64 90, !8, i64 91, !8, i64 92, !8, i64 93, !8, i64 94, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !8, i64 112, !10, i64 160, !16, i64 164, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !10, i64 192, !7, i64 200, !7, i64 208, !7, i64 216, !7, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !7, i64 256, !7, i64 264, !7, i64 272, !7, i64 280, !7, i64 288, !7, i64 296, !7, i64 304, !7, i64 312, !7, i64 320, !7, i64 328, !8, i64 336, !17, i64 344, !7, i64 400, !7, i64 408, !7, i64 416, !7, i64 424, !10, i64 432, !10, i64 436, !18, i64 440, !7, i64 464, !7, i64 472, !7, i64 480, !18, i64 488, !18, i64 512, !19, i64 536, !8, i64 560, !7, i64 624, !10, i64 632, !10, i64 636, !10, i64 640, !15, i64 648, !15, i64 656, !7, i64 664}
!15 = !{!"long long", !8, i64 0}
!16 = !{!"sqlite3InitInfo", !10, i64 0, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7}
!17 = !{!"Lookaside", !10, i64 0, !12, i64 4, !8, i64 6, !10, i64 8, !10, i64 12, !8, i64 16, !7, i64 32, !7, i64 40, !7, i64 48}
!18 = !{!"Hash", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 16}
!19 = !{!"BusyHandler", !7, i64 0, !7, i64 8, !10, i64 16}
!20 = !{!21, !7, i64 16}
!21 = !{!"SrcList_item", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !22, i64 60, !8, i64 64, !10, i64 68, !7, i64 72, !7, i64 80, !15, i64 88, !8, i64 96, !7, i64 104}
!22 = !{!"", !8, i64 0, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1}
!23 = !{!21, !7, i64 8}
!24 = !{!6, !8, i64 29}
!25 = !{!26, !7, i64 48}
!26 = !{!"Index", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !10, i64 88, !12, i64 92, !12, i64 94, !12, i64 96, !8, i64 98, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99, !10, i64 99}
!27 = !{!26, !7, i64 24}
!28 = !{!14, !7, i64 32}
!29 = !{!30, !7, i64 0}
!30 = !{!"Db", !7, i64 0, !7, i64 8, !8, i64 16, !8, i64 17, !7, i64 24}
!31 = !{!26, !7, i64 0}
!32 = !{!33, !7, i64 0}
!33 = !{!"Table", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !10, i64 56, !10, i64 60, !10, i64 64, !12, i64 68, !12, i64 70, !12, i64 72, !12, i64 74, !8, i64 76, !10, i64 80, !10, i64 84, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120}
!34 = !{!26, !10, i64 88}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass