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

; 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.DbFixer = type { ptr, ptr, i32, ptr, ptr, ptr }
%struct.Token = type { ptr, i32 }
%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.Trigger = type { ptr, ptr, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.TriggerStep = type { i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%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.Schema = type { i32, i32, %struct.Hash, %struct.Hash, %struct.Hash, %struct.Hash, ptr, i8, i8, i16, i32 }
%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.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [29 x i8], align 1

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

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

declare void @sqlite3DbFree(ptr noundef, ptr noundef) #2

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

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

declare ptr @sqlite3HashFind(ptr noundef, ptr noundef) #2

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

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

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

31:                                               ; preds = %3
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = icmp ne ptr %32, null
  br i1 %33, label %35, label %34

34:                                               ; preds = %31, %3
  br label %180

35:                                               ; preds = %31
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.Trigger, ptr %36, i32 0, i32 0
  %38 = load ptr, ptr %37, align 8, !tbaa !16
  store ptr %38, ptr %8, align 8, !tbaa !5
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.Parse, ptr %39, i32 0, i32 0
  %41 = load ptr, ptr %40, align 8, !tbaa !14
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.Trigger, ptr %42, i32 0, i32 6
  %44 = load ptr, ptr %43, align 8, !tbaa !18
  %45 = call i32 @sqlite3SchemaToIndex(ptr noundef %41, ptr noundef %44)
  store i32 %45, ptr %11, align 4, !tbaa !19
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.Trigger, ptr %47, i32 0, i32 8
  store ptr %46, ptr %48, align 8, !tbaa !20
  br label %49

49:                                               ; preds = %52, %35
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %52, label %59

52:                                               ; preds = %49
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.TriggerStep, ptr %54, i32 0, i32 2
  store ptr %53, ptr %55, align 8, !tbaa !21
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.TriggerStep, ptr %56, i32 0, i32 8
  %58 = load ptr, ptr %57, align 8, !tbaa !23
  store ptr %58, ptr %5, align 8, !tbaa !5
  br label %49, !llvm.loop !24

59:                                               ; preds = %49
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.Trigger, ptr %60, i32 0, i32 0
  %62 = load ptr, ptr %61, align 8, !tbaa !16
  call void @sqlite3TokenInit(ptr noundef %12, ptr noundef %62)
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = load i32, ptr %11, align 4, !tbaa !19
  call void @sqlite3FixInit(ptr noundef %10, ptr noundef %63, i32 noundef %64, ptr noundef @.str.1, ptr noundef %12)
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.Trigger, ptr %65, i32 0, i32 8
  %67 = load ptr, ptr %66, align 8, !tbaa !20
  %68 = call i32 @sqlite3FixTriggerStep(ptr noundef %10, ptr noundef %67)
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %76, label %70

70:                                               ; preds = %59
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.Trigger, ptr %71, i32 0, i32 4
  %73 = load ptr, ptr %72, align 8, !tbaa !26
  %74 = call i32 @sqlite3FixExpr(ptr noundef %10, ptr noundef %73)
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %76, label %77

76:                                               ; preds = %70, %59
  br label %180

77:                                               ; preds = %70
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.sqlite3, ptr %78, i32 0, i32 33
  %80 = getelementptr inbounds %struct.sqlite3InitInfo, ptr %79, i32 0, i32 2
  %81 = load i8, ptr %80, align 1, !tbaa !27
  %82 = icmp ne i8 %81, 0
  br i1 %82, label %127, label %83

83:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = call ptr @sqlite3GetVdbe(ptr noundef %84)
  store ptr %85, ptr %13, align 8, !tbaa !5
  %86 = load ptr, ptr %13, align 8, !tbaa !5
  %87 = icmp eq ptr %86, null
  br i1 %87, label %88, label %89

88:                                               ; preds = %83
  store i32 2, ptr %15, align 4
  br label %124

89:                                               ; preds = %83
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = load i32, ptr %11, align 4, !tbaa !19
  call void @sqlite3BeginWriteOperation(ptr noundef %90, i32 noundef 0, i32 noundef %91)
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.Token, ptr %93, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8, !tbaa !34
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.Token, ptr %96, i32 0, i32 1
  %98 = load i32, ptr %97, align 8, !tbaa !35
  %99 = zext i32 %98 to i64
  %100 = call ptr @sqlite3DbStrNDup(ptr noundef %92, ptr noundef %95, i64 noundef %99)
  store ptr %100, ptr %14, align 8, !tbaa !5
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.sqlite3, ptr %102, i32 0, i32 4
  %104 = load ptr, ptr %103, align 8, !tbaa !36
  %105 = load i32, ptr %11, align 4, !tbaa !19
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds %struct.Db, ptr %104, i64 %106
  %108 = getelementptr inbounds %struct.Db, ptr %107, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8, !tbaa !37
  %110 = load ptr, ptr %8, align 8, !tbaa !5
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.Trigger, ptr %111, i32 0, i32 1
  %113 = load ptr, ptr %112, align 8, !tbaa !39
  %114 = load ptr, ptr %14, align 8, !tbaa !5
  call void (ptr, ptr, ...) @sqlite3NestedParse(ptr noundef %101, ptr noundef @.str.12, ptr noundef %109, ptr noundef @.str.11, ptr noundef %110, ptr noundef %113, ptr noundef %114)
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  %116 = load ptr, ptr %14, align 8, !tbaa !5
  call void @sqlite3DbFree(ptr noundef %115, ptr noundef %116)
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = load i32, ptr %11, align 4, !tbaa !19
  call void @sqlite3ChangeCookie(ptr noundef %117, i32 noundef %118)
  %119 = load ptr, ptr %13, align 8, !tbaa !5
  %120 = load i32, ptr %11, align 4, !tbaa !19
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = call ptr (ptr, ptr, ...) @sqlite3MPrintf(ptr noundef %121, ptr noundef @.str.13, ptr noundef %122)
  call void @sqlite3VdbeAddParseSchemaOp(ptr noundef %119, i32 noundef %120, ptr noundef %123)
  store i32 0, ptr %15, align 4
  br label %124

124:                                              ; preds = %89, %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  %125 = load i32, ptr %15, align 4
  switch i32 %125, label %185 [
    i32 0, label %126
    i32 2, label %180
  ]

126:                                              ; preds = %124
  br label %127

127:                                              ; preds = %126, %77
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.sqlite3, ptr %128, i32 0, i32 33
  %130 = getelementptr inbounds %struct.sqlite3InitInfo, ptr %129, i32 0, i32 2
  %131 = load i8, ptr %130, align 1, !tbaa !27
  %132 = icmp ne i8 %131, 0
  br i1 %132, label %133, label %179

133:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %134, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %135 = load ptr, ptr %9, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.sqlite3, ptr %135, i32 0, i32 4
  %137 = load ptr, ptr %136, align 8, !tbaa !36
  %138 = load i32, ptr %11, align 4, !tbaa !19
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds %struct.Db, ptr %137, i64 %139
  %141 = getelementptr inbounds %struct.Db, ptr %140, i32 0, i32 4
  %142 = load ptr, ptr %141, align 8, !tbaa !40
  %143 = getelementptr inbounds %struct.Schema, ptr %142, i32 0, i32 4
  store ptr %143, ptr %17, align 8, !tbaa !5
  %144 = load ptr, ptr %17, align 8, !tbaa !5
  %145 = load ptr, ptr %8, align 8, !tbaa !5
  %146 = load ptr, ptr %7, align 8, !tbaa !5
  %147 = call ptr @sqlite3HashInsert(ptr noundef %144, ptr noundef %145, ptr noundef %146)
  store ptr %147, ptr %7, align 8, !tbaa !5
  %148 = load ptr, ptr %7, align 8, !tbaa !5
  %149 = icmp ne ptr %148, null
  br i1 %149, label %150, label %152

150:                                              ; preds = %133
  %151 = load ptr, ptr %9, align 8, !tbaa !5
  call void @sqlite3OomFault(ptr noundef %151)
  br label %178

152:                                              ; preds = %133
  %153 = load ptr, ptr %16, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.Trigger, ptr %153, i32 0, i32 6
  %155 = load ptr, ptr %154, align 8, !tbaa !18
  %156 = load ptr, ptr %16, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.Trigger, ptr %156, i32 0, i32 7
  %158 = load ptr, ptr %157, align 8, !tbaa !41
  %159 = icmp eq ptr %155, %158
  br i1 %159, label %160, label %177

160:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %161 = load ptr, ptr %16, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.Trigger, ptr %161, i32 0, i32 7
  %163 = load ptr, ptr %162, align 8, !tbaa !41
  %164 = getelementptr inbounds %struct.Schema, ptr %163, i32 0, i32 2
  %165 = load ptr, ptr %16, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.Trigger, ptr %165, i32 0, i32 1
  %167 = load ptr, ptr %166, align 8, !tbaa !39
  %168 = call ptr @sqlite3HashFind(ptr noundef %164, ptr noundef %167)
  store ptr %168, ptr %18, align 8, !tbaa !5
  %169 = load ptr, ptr %18, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.Table, ptr %169, i32 0, i32 19
  %171 = load ptr, ptr %170, align 8, !tbaa !42
  %172 = load ptr, ptr %16, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.Trigger, ptr %172, i32 0, i32 9
  store ptr %171, ptr %173, align 8, !tbaa !44
  %174 = load ptr, ptr %16, align 8, !tbaa !5
  %175 = load ptr, ptr %18, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.Table, ptr %175, i32 0, i32 19
  store ptr %174, ptr %176, align 8, !tbaa !42
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  br label %177

177:                                              ; preds = %160, %152
  br label %178

178:                                              ; preds = %177, %150
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  br label %179

179:                                              ; preds = %178, %127
  br label %180

180:                                              ; preds = %179, %124, %76, %34
  %181 = load ptr, ptr %9, align 8, !tbaa !5
  %182 = load ptr, ptr %7, align 8, !tbaa !5
  call void @sqlite3DeleteTrigger(ptr noundef %181, ptr noundef %182)
  %183 = load ptr, ptr %9, align 8, !tbaa !5
  %184 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sqlite3DeleteTriggerStep(ptr noundef %183, ptr noundef %184)
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 48, 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

185:                                              ; preds = %124
  unreachable
}

declare void @sqlite3TokenInit(ptr noundef, ptr noundef) #2

declare i32 @sqlite3FixTriggerStep(ptr noundef, ptr noundef) #2

declare i32 @sqlite3FixExpr(ptr noundef, ptr noundef) #2

declare ptr @sqlite3GetVdbe(ptr noundef) #2

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

declare ptr @sqlite3DbStrNDup(ptr noundef, ptr noundef, i64 noundef) #2

declare void @sqlite3NestedParse(ptr noundef, ptr noundef, ...) #2

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

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

declare ptr @sqlite3MPrintf(ptr noundef, ptr noundef, ...) #2

declare ptr @sqlite3HashInsert(ptr noundef, ptr noundef, ptr noundef) #2

declare void @sqlite3OomFault(ptr noundef) #2

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

!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 520}
!10 = !{!"Parse", !6, i64 0, !6, i64 8, !6, i64 16, !11, 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, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !6, i64 88, !6, i64 96, !12, i64 104, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !11, i64 176, !11, i64 180, !11, i64 184, !11, i64 188, !7, i64 192, !7, i64 193, !7, i64 194, !7, i64 196, !7, i64 396, !12, i64 432, !12, i64 448, !13, i64 464, !7, i64 466, !7, i64 467, !7, i64 468, !11, i64 472, !11, i64 476, !11, i64 480, !11, i64 484, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !12, i64 536, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576, !6, i64 584}
!11 = !{!"int", !7, i64 0}
!12 = !{!"Token", !6, i64 0, !11, i64 8}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !6, i64 0}
!15 = !{!10, !11, i64 48}
!16 = !{!17, !6, i64 0}
!17 = !{!"Trigger", !6, i64 0, !6, i64 8, !7, i64 16, !7, i64 17, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64}
!18 = !{!17, !6, i64 40}
!19 = !{!11, !11, i64 0}
!20 = !{!17, !6, i64 56}
!21 = !{!22, !6, i64 8}
!22 = !{!"TriggerStep", !7, i64 0, !7, i64 1, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64}
!23 = !{!22, !6, i64 56}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!17, !6, i64 24}
!27 = !{!28, !7, i64 169}
!28 = !{!"sqlite3", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !11, i64 44, !29, i64 48, !29, i64 56, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !13, 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, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !7, i64 112, !11, i64 160, !30, i64 164, !11, i64 172, !11, i64 176, !11, i64 180, !11, i64 184, !11, i64 188, !11, 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, !31, i64 344, !6, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !11, i64 432, !11, i64 436, !32, i64 440, !6, i64 464, !6, i64 472, !6, i64 480, !32, i64 488, !32, i64 512, !33, i64 536, !7, i64 560, !6, i64 624, !11, i64 632, !11, i64 636, !11, i64 640, !29, i64 648, !29, i64 656, !6, i64 664}
!29 = !{!"long long", !7, i64 0}
!30 = !{!"sqlite3InitInfo", !11, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7}
!31 = !{!"Lookaside", !11, i64 0, !13, i64 4, !7, i64 6, !11, i64 8, !11, i64 12, !7, i64 16, !6, i64 32, !6, i64 40, !6, i64 48}
!32 = !{!"Hash", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16}
!33 = !{!"BusyHandler", !6, i64 0, !6, i64 8, !11, i64 16}
!34 = !{!12, !6, i64 0}
!35 = !{!12, !11, i64 8}
!36 = !{!28, !6, i64 32}
!37 = !{!38, !6, i64 0}
!38 = !{!"Db", !6, i64 0, !6, i64 8, !7, i64 16, !7, i64 17, !6, i64 24}
!39 = !{!17, !6, i64 8}
!40 = !{!38, !6, i64 24}
!41 = !{!17, !6, i64 48}
!42 = !{!43, !6, i64 104}
!43 = !{!"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, !7, i64 76, !11, i64 80, !11, i64 84, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!44 = !{!17, !6, i64 64}


; 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.DbFixer = type { ptr, ptr, i32, ptr, ptr, ptr }
%struct.Token = type { ptr, i32 }
%struct.Db = type { ptr, ptr, i8, i8, ptr }

@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [29 x i8], align 1

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

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

declare void @sqlite3DbFree(ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

declare ptr @sqlite3HashFind(ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @sqlite3FinishTrigger(ptr noundef %0, ptr noundef %1, ptr nocapture noundef readonly %2) local_unnamed_addr #0 {
  %4 = alloca %struct.DbFixer, align 8
  %5 = alloca %struct.Token, align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 520
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = load ptr, ptr %0, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #3
  store ptr null, ptr %6, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 48
  %10 = load i32, ptr %9, align 8, !tbaa !14
  %11 = icmp eq i32 %10, 0
  %12 = icmp ne ptr %7, null
  %or.cond = select i1 %11, i1 %12, i1 false
  br i1 %or.cond, label %13, label %69

13:                                               ; preds = %3
  %14 = load ptr, ptr %7, align 8, !tbaa !15
  %15 = getelementptr inbounds i8, ptr %7, i64 40
  %16 = load ptr, ptr %15, align 8, !tbaa !17
  %17 = tail call i32 @sqlite3SchemaToIndex(ptr noundef %8, ptr noundef %16) #3
  %18 = getelementptr inbounds i8, ptr %7, i64 56
  store ptr %1, ptr %18, align 8, !tbaa !18
  %.not77 = icmp eq ptr %1, null
  br i1 %.not77, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %13, %.lr.ph
  %.078 = phi ptr [ %21, %.lr.ph ], [ %1, %13 ]
  %19 = getelementptr inbounds i8, ptr %.078, i64 8
  store ptr %7, ptr %19, align 8, !tbaa !19
  %20 = getelementptr inbounds i8, ptr %.078, i64 56
  %21 = load ptr, ptr %20, align 8, !tbaa !21
  %.not = icmp eq ptr %21, null
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !22

._crit_edge:                                      ; preds = %.lr.ph, %13
  %22 = load ptr, ptr %7, align 8, !tbaa !15
  call void @sqlite3TokenInit(ptr noundef nonnull %5, ptr noundef %22) #3
  call void @sqlite3FixInit(ptr noundef nonnull %4, ptr noundef nonnull %0, i32 noundef %17, ptr noundef nonnull @.str.1, ptr noundef nonnull %5) #3
  %23 = load ptr, ptr %18, align 8, !tbaa !18
  %24 = call i32 @sqlite3FixTriggerStep(ptr noundef nonnull %4, ptr noundef %23) #3
  %.not68 = icmp eq i32 %24, 0
  br i1 %.not68, label %25, label %69

25:                                               ; preds = %._crit_edge
  %26 = getelementptr inbounds i8, ptr %7, i64 24
  %27 = load ptr, ptr %26, align 8, !tbaa !24
  %28 = call i32 @sqlite3FixExpr(ptr noundef nonnull %4, ptr noundef %27) #3
  %.not69 = icmp eq i32 %28, 0
  br i1 %.not69, label %29, label %69

29:                                               ; preds = %25
  %30 = getelementptr inbounds i8, ptr %8, i64 169
  %31 = load i8, ptr %30, align 1, !tbaa !25
  %.not70 = icmp eq i8 %31, 0
  br i1 %.not70, label %32, label %..thread75_crit_edge

..thread75_crit_edge:                             ; preds = %29
  %.pre = sext i32 %17 to i64
  br label %.thread75

32:                                               ; preds = %29
  %33 = call ptr @sqlite3GetVdbe(ptr noundef nonnull %0) #3
  %34 = icmp eq ptr %33, null
  br i1 %34, label %69, label %35

35:                                               ; preds = %32
  call void @sqlite3BeginWriteOperation(ptr noundef nonnull %0, i32 noundef 0, i32 noundef %17) #3
  %36 = load ptr, ptr %2, align 8, !tbaa !32
  %37 = getelementptr inbounds i8, ptr %2, i64 8
  %38 = load i32, ptr %37, align 8, !tbaa !33
  %39 = zext i32 %38 to i64
  %40 = call ptr @sqlite3DbStrNDup(ptr noundef nonnull %8, ptr noundef %36, i64 noundef %39) #3
  %41 = getelementptr inbounds i8, ptr %8, i64 32
  %42 = load ptr, ptr %41, align 8, !tbaa !34
  %43 = sext i32 %17 to i64
  %44 = getelementptr inbounds %struct.Db, ptr %42, i64 %43
  %45 = load ptr, ptr %44, align 8, !tbaa !35
  %46 = getelementptr inbounds i8, ptr %7, i64 8
  %47 = load ptr, ptr %46, align 8, !tbaa !37
  call void (ptr, ptr, ...) @sqlite3NestedParse(ptr noundef nonnull %0, ptr noundef nonnull @.str.12, ptr noundef %45, ptr noundef nonnull @.str.11, ptr noundef %14, ptr noundef %47, ptr noundef %40) #3
  call void @sqlite3DbFree(ptr noundef nonnull %8, ptr noundef %40) #3
  call void @sqlite3ChangeCookie(ptr noundef nonnull %0, i32 noundef %17) #3
  %48 = call ptr (ptr, ptr, ...) @sqlite3MPrintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.13, ptr noundef %14) #3
  call void @sqlite3VdbeAddParseSchemaOp(ptr noundef nonnull %33, i32 noundef %17, ptr noundef %48) #3
  %.pr = load i8, ptr %30, align 1, !tbaa !25
  %.not71 = icmp eq i8 %.pr, 0
  br i1 %.not71, label %69, label %.thread75

.thread75:                                        ; preds = %..thread75_crit_edge, %35
  %.pre-phi = phi i64 [ %.pre, %..thread75_crit_edge ], [ %43, %35 ]
  %49 = getelementptr inbounds i8, ptr %8, i64 32
  %50 = load ptr, ptr %49, align 8, !tbaa !34
  %51 = getelementptr inbounds %struct.Db, ptr %50, i64 %.pre-phi, i32 4
  %52 = load ptr, ptr %51, align 8, !tbaa !38
  %53 = getelementptr inbounds i8, ptr %52, i64 56
  %54 = call ptr @sqlite3HashInsert(ptr noundef nonnull %53, ptr noundef %14, ptr noundef nonnull %7) #3
  %.not72 = icmp eq ptr %54, null
  br i1 %.not72, label %56, label %55

55:                                               ; preds = %.thread75
  call void @sqlite3OomFault(ptr noundef nonnull %8) #3
  br label %69

56:                                               ; preds = %.thread75
  %57 = load ptr, ptr %15, align 8, !tbaa !17
  %58 = getelementptr inbounds i8, ptr %7, i64 48
  %59 = load ptr, ptr %58, align 8, !tbaa !39
  %60 = icmp eq ptr %57, %59
  br i1 %60, label %61, label %69

61:                                               ; preds = %56
  %62 = getelementptr inbounds i8, ptr %59, i64 8
  %63 = getelementptr inbounds i8, ptr %7, i64 8
  %64 = load ptr, ptr %63, align 8, !tbaa !37
  %65 = call ptr @sqlite3HashFind(ptr noundef nonnull %62, ptr noundef %64) #3
  %66 = getelementptr inbounds i8, ptr %65, i64 104
  %67 = load ptr, ptr %66, align 8, !tbaa !40
  %68 = getelementptr inbounds i8, ptr %7, i64 64
  store ptr %67, ptr %68, align 8, !tbaa !42
  store ptr %7, ptr %66, align 8, !tbaa !40
  br label %69

69:                                               ; preds = %32, %55, %61, %56, %35, %._crit_edge, %25, %3
  %.063 = phi ptr [ %7, %._crit_edge ], [ %7, %25 ], [ %7, %35 ], [ %7, %3 ], [ null, %56 ], [ null, %61 ], [ %54, %55 ], [ %7, %32 ]
  %.1 = phi ptr [ null, %._crit_edge ], [ null, %25 ], [ null, %35 ], [ %1, %3 ], [ null, %56 ], [ null, %61 ], [ null, %55 ], [ null, %32 ]
  call void @sqlite3DeleteTrigger(ptr noundef %8, ptr noundef %.063)
  call void @sqlite3DeleteTriggerStep(ptr noundef %8, ptr noundef %.1)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #3
  ret void
}

declare void @sqlite3TokenInit(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @sqlite3FixTriggerStep(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @sqlite3FixExpr(ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @sqlite3GetVdbe(ptr noundef) local_unnamed_addr #2

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

declare ptr @sqlite3DbStrNDup(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare void @sqlite3NestedParse(ptr noundef, ptr noundef, ...) local_unnamed_addr #2

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

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

declare ptr @sqlite3MPrintf(ptr noundef, ptr noundef, ...) local_unnamed_addr #2

declare ptr @sqlite3HashInsert(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @sqlite3OomFault(ptr noundef) local_unnamed_addr #2

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

!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 520}
!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 = !{!6, !7, i64 0}
!14 = !{!6, !10, i64 48}
!15 = !{!16, !7, i64 0}
!16 = !{!"Trigger", !7, i64 0, !7, i64 8, !8, i64 16, !8, i64 17, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64}
!17 = !{!16, !7, i64 40}
!18 = !{!16, !7, i64 56}
!19 = !{!20, !7, i64 8}
!20 = !{!"TriggerStep", !8, i64 0, !8, i64 1, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64}
!21 = !{!20, !7, i64 56}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!16, !7, i64 24}
!25 = !{!26, !8, i64 169}
!26 = !{!"sqlite3", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !10, i64 44, !27, i64 48, !27, 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, !28, 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, !29, i64 344, !7, i64 400, !7, i64 408, !7, i64 416, !7, i64 424, !10, i64 432, !10, i64 436, !30, i64 440, !7, i64 464, !7, i64 472, !7, i64 480, !30, i64 488, !30, i64 512, !31, i64 536, !8, i64 560, !7, i64 624, !10, i64 632, !10, i64 636, !10, i64 640, !27, i64 648, !27, i64 656, !7, i64 664}
!27 = !{!"long long", !8, i64 0}
!28 = !{!"sqlite3InitInfo", !10, i64 0, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7}
!29 = !{!"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}
!30 = !{!"Hash", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 16}
!31 = !{!"BusyHandler", !7, i64 0, !7, i64 8, !10, i64 16}
!32 = !{!11, !7, i64 0}
!33 = !{!11, !10, i64 8}
!34 = !{!26, !7, i64 32}
!35 = !{!36, !7, i64 0}
!36 = !{!"Db", !7, i64 0, !7, i64 8, !8, i64 16, !8, i64 17, !7, i64 24}
!37 = !{!16, !7, i64 8}
!38 = !{!36, !7, i64 24}
!39 = !{!16, !7, i64 48}
!40 = !{!41, !7, i64 104}
!41 = !{!"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}
!42 = !{!16, !7, i64 64}


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